qrdx 0.0.49 → 0.0.50

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.mjs CHANGED
@@ -1,6 +1,6 @@
1
- import {z as z$1}from'zod';import _0,{memo,useMemo}from'react';import {jsx,jsxs,Fragment}from'react/jsx-runtime';export{OFFICIAL_FRAME_INDEX}from'./frames-index.mjs';export{OFFICIAL_FRAMES,getOfficialFrame}from'./frames-official.mjs';export{QRCodeCanvas}from'./qr-code-canvas.mjs';var mm=Object.defineProperty;var q=(t,e,n)=>()=>{if(n)throw n[0];try{return t&&(e=t(t=0)),e}catch(o){throw n=[o],o}};var dm=(t,e)=>{for(var n in e)mm(t,n,{get:e[n],enumerable:true});};var yn,Mt,de=q(()=>{"use strict";(a=>{class t{constructor(c,s,l,u){this.version=c;this.errorCorrectionLevel=s;if(c<t.MIN_VERSION||c>t.MAX_VERSION)throw new RangeError("Version value out of range");if(u<-1||u>7)throw new RangeError("Mask value out of range");this.size=c*4+17;let m=[];for(let d=0;d<this.size;d++)m.push(!1);for(let d=0;d<this.size;d++)this.modules.push(m.slice()),this.isFunction.push(m.slice());this.drawFunctionPatterns();let f=this.addEccAndInterleave(l);if(this.drawCodewords(f),u==-1){let d=1e9;for(let p=0;p<8;p++){this.applyMask(p),this.drawFormatBits(p);let h=this.getPenaltyScore();h<d&&(u=p,d=h),this.applyMask(p);}}o(0<=u&&u<=7),this.mask=u,this.applyMask(u),this.drawFormatBits(u),this.isFunction=[];}version;errorCorrectionLevel;static encodeText(c,s){let l=a.QrSegment.makeSegments(c);return t.encodeSegments(l,s)}static encodeBinary(c,s){let l=a.QrSegment.makeBytes(c);return t.encodeSegments([l],s)}static encodeSegments(c,s,l=1,u=40,m=-1,f=!0){if(!(t.MIN_VERSION<=l&&l<=u&&u<=t.MAX_VERSION)||m<-1||m>7)throw new RangeError("Invalid value");let d,p;for(d=l;;d++){let _=t.getNumDataCodewords(d,s)*8,y=r.getTotalBits(c,d);if(y<=_){p=y;break}if(d>=u)throw new RangeError("Data too long")}for(let _ of [t.Ecc.MEDIUM,t.Ecc.QUARTILE,t.Ecc.HIGH])f&&p<=t.getNumDataCodewords(d,_)*8&&(s=_);let h=[];for(let _ of c){e(_.mode.modeBits,4,h),e(_.numChars,_.mode.numCharCountBits(d),h);for(let y of _.getData())h.push(y);}o(h.length==p);let g=t.getNumDataCodewords(d,s)*8;o(h.length<=g),e(0,Math.min(4,g-h.length),h),e(0,(8-h.length%8)%8,h),o(h.length%8==0);for(let _=236;h.length<g;_^=253)e(_,8,h);let b=[];for(;b.length*8<h.length;)b.push(0);return h.forEach((_,y)=>b[y>>>3]|=_<<7-(y&7)),new t(d,s,b,m)}size;mask;modules=[];isFunction=[];getModule(c,s){return 0<=c&&c<this.size&&0<=s&&s<this.size&&this.modules[s][c]}getModules(){return this.modules}drawFunctionPatterns(){for(let l=0;l<this.size;l++)this.setFunctionModule(6,l,l%2==0),this.setFunctionModule(l,6,l%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);let c=this.getAlignmentPatternPositions(),s=c.length;for(let l=0;l<s;l++)for(let u=0;u<s;u++)l==0&&u==0||l==0&&u==s-1||l==s-1&&u==0||this.drawAlignmentPattern(c[l],c[u]);this.drawFormatBits(0),this.drawVersion();}drawFormatBits(c){let s=this.errorCorrectionLevel.formatBits<<3|c,l=s;for(let m=0;m<10;m++)l=l<<1^(l>>>9)*1335;let u=(s<<10|l)^21522;o(u>>>15==0);for(let m=0;m<=5;m++)this.setFunctionModule(8,m,n(u,m));this.setFunctionModule(8,7,n(u,6)),this.setFunctionModule(8,8,n(u,7)),this.setFunctionModule(7,8,n(u,8));for(let m=9;m<15;m++)this.setFunctionModule(14-m,8,n(u,m));for(let m=0;m<8;m++)this.setFunctionModule(this.size-1-m,8,n(u,m));for(let m=8;m<15;m++)this.setFunctionModule(8,this.size-15+m,n(u,m));this.setFunctionModule(8,this.size-8,!0);}drawVersion(){if(this.version<7)return;let c=this.version;for(let l=0;l<12;l++)c=c<<1^(c>>>11)*7973;let s=this.version<<12|c;o(s>>>18==0);for(let l=0;l<18;l++){let u=n(s,l),m=this.size-11+l%3,f=Math.floor(l/3);this.setFunctionModule(m,f,u),this.setFunctionModule(f,m,u);}}drawFinderPattern(c,s){for(let l=-4;l<=4;l++)for(let u=-4;u<=4;u++){let m=Math.max(Math.abs(u),Math.abs(l)),f=c+u,d=s+l;0<=f&&f<this.size&&0<=d&&d<this.size&&this.setFunctionModule(f,d,m!=2&&m!=4);}}drawAlignmentPattern(c,s){for(let l=-2;l<=2;l++)for(let u=-2;u<=2;u++)this.setFunctionModule(c+u,s+l,Math.max(Math.abs(u),Math.abs(l))!=1);}setFunctionModule(c,s,l){this.modules[s][c]=l,this.isFunction[s][c]=!0;}addEccAndInterleave(c){let s=this.version,l=this.errorCorrectionLevel;if(c.length!=t.getNumDataCodewords(s,l))throw new RangeError("Invalid argument");let u=t.NUM_ERROR_CORRECTION_BLOCKS[l.ordinal][s],m=t.ECC_CODEWORDS_PER_BLOCK[l.ordinal][s],f=Math.floor(t.getNumRawDataModules(s)/8),d=u-f%u,p=Math.floor(f/u),h=[],g=t.reedSolomonComputeDivisor(m);for(let _=0,y=0;_<u;_++){let M=c.slice(y,y+p-m+(_<d?0:1));y+=M.length;let C=t.reedSolomonComputeRemainder(M,g);_<d&&M.push(0),h.push(M.concat(C));}let b=[];for(let _=0;_<h[0].length;_++)h.forEach((y,M)=>{(_!=p-m||M>=d)&&b.push(y[_]);});return o(b.length==f),b}drawCodewords(c){if(c.length!=Math.floor(t.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let s=0;for(let l=this.size-1;l>=1;l-=2){l==6&&(l=5);for(let u=0;u<this.size;u++)for(let m=0;m<2;m++){let f=l-m,p=(l+1&2)==0?this.size-1-u:u;!this.isFunction[p][f]&&s<c.length*8&&(this.modules[p][f]=n(c[s>>>3],7-(s&7)),s++);}}o(s==c.length*8);}applyMask(c){if(c<0||c>7)throw new RangeError("Mask value out of range");for(let s=0;s<this.size;s++)for(let l=0;l<this.size;l++){let u;switch(c){case 0:u=(l+s)%2==0;break;case 1:u=s%2==0;break;case 2:u=l%3==0;break;case 3:u=(l+s)%3==0;break;case 4:u=(Math.floor(l/3)+Math.floor(s/2))%2==0;break;case 5:u=l*s%2+l*s%3==0;break;case 6:u=(l*s%2+l*s%3)%2==0;break;case 7:u=((l+s)%2+l*s%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[s][l]&&u&&(this.modules[s][l]=!this.modules[s][l]);}}getPenaltyScore(){let c=0;for(let m=0;m<this.size;m++){let f=!1,d=0,p=[0,0,0,0,0,0,0];for(let h=0;h<this.size;h++)this.modules[m][h]==f?(d++,d==5?c+=t.PENALTY_N1:d>5&&c++):(this.finderPenaltyAddHistory(d,p),f||(c+=this.finderPenaltyCountPatterns(p)*t.PENALTY_N3),f=this.modules[m][h],d=1);c+=this.finderPenaltyTerminateAndCount(f,d,p)*t.PENALTY_N3;}for(let m=0;m<this.size;m++){let f=!1,d=0,p=[0,0,0,0,0,0,0];for(let h=0;h<this.size;h++)this.modules[h][m]==f?(d++,d==5?c+=t.PENALTY_N1:d>5&&c++):(this.finderPenaltyAddHistory(d,p),f||(c+=this.finderPenaltyCountPatterns(p)*t.PENALTY_N3),f=this.modules[h][m],d=1);c+=this.finderPenaltyTerminateAndCount(f,d,p)*t.PENALTY_N3;}for(let m=0;m<this.size-1;m++)for(let f=0;f<this.size-1;f++){let d=this.modules[m][f];d==this.modules[m][f+1]&&d==this.modules[m+1][f]&&d==this.modules[m+1][f+1]&&(c+=t.PENALTY_N2);}let s=0;for(let m of this.modules)s=m.reduce((f,d)=>f+(d?1:0),s);let l=this.size*this.size,u=Math.ceil(Math.abs(s*20-l*10)/l)-1;return o(0<=u&&u<=9),c+=u*t.PENALTY_N4,o(0<=c&&c<=2568888),c}getAlignmentPatternPositions(){if(this.version==1)return [];{let c=Math.floor(this.version/7)+2,s=this.version==32?26:Math.ceil((this.version*4+4)/(c*2-2))*2,l=[6];for(let u=this.size-7;l.length<c;u-=s)l.splice(1,0,u);return l}}static getNumRawDataModules(c){if(c<t.MIN_VERSION||c>t.MAX_VERSION)throw new RangeError("Version number out of range");let s=(16*c+128)*c+64;if(c>=2){let l=Math.floor(c/7)+2;s-=(25*l-10)*l-55,c>=7&&(s-=36);}return o(208<=s&&s<=29648),s}static getNumDataCodewords(c,s){return Math.floor(t.getNumRawDataModules(c)/8)-t.ECC_CODEWORDS_PER_BLOCK[s.ordinal][c]*t.NUM_ERROR_CORRECTION_BLOCKS[s.ordinal][c]}static reedSolomonComputeDivisor(c){if(c<1||c>255)throw new RangeError("Degree out of range");let s=[];for(let u=0;u<c-1;u++)s.push(0);s.push(1);let l=1;for(let u=0;u<c;u++){for(let m=0;m<s.length;m++)s[m]=t.reedSolomonMultiply(s[m],l),m+1<s.length&&(s[m]^=s[m+1]);l=t.reedSolomonMultiply(l,2);}return s}static reedSolomonComputeRemainder(c,s){let l=s.map(u=>0);for(let u of c){let m=u^l.shift();l.push(0),s.forEach((f,d)=>l[d]^=t.reedSolomonMultiply(f,m));}return l}static reedSolomonMultiply(c,s){if(c>>>8||s>>>8)throw new RangeError("Byte out of range");let l=0;for(let u=7;u>=0;u--)l=l<<1^(l>>>7)*285,l^=(s>>>u&1)*c;return o(l>>>8==0),l}finderPenaltyCountPatterns(c){let s=c[1];o(s<=this.size*3);let l=s>0&&c[2]==s&&c[3]==s*3&&c[4]==s&&c[5]==s;return (l&&c[0]>=s*4&&c[6]>=s?1:0)+(l&&c[6]>=s*4&&c[0]>=s?1:0)}finderPenaltyTerminateAndCount(c,s,l){return c&&(this.finderPenaltyAddHistory(s,l),s=0),s+=this.size,this.finderPenaltyAddHistory(s,l),this.finderPenaltyCountPatterns(l)}finderPenaltyAddHistory(c,s){s[0]==0&&(c+=this.size),s.pop(),s.unshift(c);}static MIN_VERSION=1;static MAX_VERSION=40;static PENALTY_N1=3;static PENALTY_N2=3;static PENALTY_N3=40;static PENALTY_N4=10;static ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]];static NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]]}a.QrCode=t;function e(i,c,s){if(c<0||c>31||i>>>c)throw new RangeError("Value out of range");for(let l=c-1;l>=0;l--)s.push(i>>>l&1);}function n(i,c){return (i>>>c&1)!=0}function o(i){if(!i)throw new Error("Assertion error")}class r{constructor(c,s,l){this.mode=c;this.numChars=s;this.bitData=l;if(s<0)throw new RangeError("Invalid argument");this.bitData=l.slice();}mode;numChars;bitData;static makeBytes(c){let s=[];for(let l of c)e(l,8,s);return new r(r.Mode.BYTE,c.length,s)}static makeNumeric(c){if(!r.isNumeric(c))throw new RangeError("String contains non-numeric characters");let s=[];for(let l=0;l<c.length;){let u=Math.min(c.length-l,3);e(parseInt(c.substr(l,u),10),u*3+1,s),l+=u;}return new r(r.Mode.NUMERIC,c.length,s)}static makeAlphanumeric(c){if(!r.isAlphanumeric(c))throw new RangeError("String contains unencodable characters in alphanumeric mode");let s=[],l;for(l=0;l+2<=c.length;l+=2){let u=r.ALPHANUMERIC_CHARSET.indexOf(c.charAt(l))*45;u+=r.ALPHANUMERIC_CHARSET.indexOf(c.charAt(l+1)),e(u,11,s);}return l<c.length&&e(r.ALPHANUMERIC_CHARSET.indexOf(c.charAt(l)),6,s),new r(r.Mode.ALPHANUMERIC,c.length,s)}static makeSegments(c){return c==""?[]:r.isNumeric(c)?[r.makeNumeric(c)]:r.isAlphanumeric(c)?[r.makeAlphanumeric(c)]:[r.makeBytes(r.toUtf8ByteArray(c))]}static makeEci(c){let s=[];if(c<0)throw new RangeError("ECI assignment value out of range");if(c<128)e(c,8,s);else if(c<16384)e(2,2,s),e(c,14,s);else if(c<1e6)e(6,3,s),e(c,21,s);else throw new RangeError("ECI assignment value out of range");return new r(r.Mode.ECI,0,s)}static isNumeric(c){return r.NUMERIC_REGEX.test(c)}static isAlphanumeric(c){return r.ALPHANUMERIC_REGEX.test(c)}getData(){return this.bitData.slice()}static getTotalBits(c,s){let l=0;for(let u of c){let m=u.mode.numCharCountBits(s);if(u.numChars>=1<<m)return 1/0;l+=4+m+u.bitData.length;}return l}static toUtf8ByteArray(c){c=encodeURI(c);let s=[];for(let l=0;l<c.length;l++)c.charAt(l)!="%"?s.push(c.charCodeAt(l)):(s.push(parseInt(c.substr(l+1,2),16)),l+=2);return s}static NUMERIC_REGEX=/^[0-9]*$/;static ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/;static ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:"}a.QrSegment=r;})(yn||={});(e=>{let t;(o=>{class n{constructor(a,i){this.ordinal=a;this.formatBits=i;}ordinal;formatBits;static LOW=new n(0,1);static MEDIUM=new n(1,0);static QUARTILE=new n(2,3);static HIGH=new n(3,2)}o.Ecc=n;})(t=e.QrCode||={});})(yn||={});(e=>{let t;(o=>{class n{constructor(a,i){this.modeBits=a;this.numBitsCharCount=i;}modeBits;numBitsCharCount;static NUMERIC=new n(1,[10,12,14]);static ALPHANUMERIC=new n(2,[9,11,13]);static BYTE=new n(4,[8,16,16]);static KANJI=new n(8,[8,10,12]);static ECI=new n(7,[0,0,0]);numCharCountBits(a){return this.numBitsCharCount[Math.floor((a+7)/17)]}}o.Mode=n;})(t=e.QrSegment||={});})(yn||={});Mt=yn;});var Lt,bt,te,_t,Pt,Ct,fr,At=q(()=>{"use strict";de();Lt={L:Mt.QrCode.Ecc.LOW,M:Mt.QrCode.Ecc.MEDIUM,Q:Mt.QrCode.Ecc.QUARTILE,H:Mt.QrCode.Ecc.HIGH},bt=128,te="Q",_t="#FFFFFF",Pt="#000000",Ct=0,fr=.1;});var ji,ee,No,$n,ve,Zi,hr,zn=q(()=>{"use strict";ji=["none","banner-bottom","banner-top","border","rounded-border","speech-bubble","banner-top-bottom","speech-bubble-top","chat-bubble","circle","polaroid","phone","ticket","badge","envelope","tag","menu-card","sticker","gradient-border","focus"],ee=24,No="Scan me",$n=.5,ve=1.5,Zi=z$1.enum(ji),hr=z$1.object({style:Zi,text:z$1.string().max(ee).optional(),color:z$1.string().optional(),textColor:z$1.string().optional(),secondaryText:z$1.string().max(ee).optional(),secondaryColor:z$1.string().optional(),fontScale:z$1.number().min($n).max(ve).optional()});});function it(t,e=3){let n=10**e;return Math.round(t*n)/n+0}function $(t,e=3){return String(it(t,e))}function A(t,...e){let n=t[0]??"";for(let o=0;o<e.length;o++){let r=e[o];n+=(typeof r=="number"?$(r):r)+(t[o+1]??"");}return n}var ht=q(()=>{"use strict";});function pr(t,e=Number.POSITIVE_INFINITY){if(!hm.test(t))return null;let n=[],o=0,r=()=>{for(;o<t.length&&/[\s,]/.test(t[o]);)o++;},a=()=>{r(),Oo.lastIndex=o;let s=Oo.exec(t);if(!s)return null;let l=s[0],u=l.indexOf(".");if(u>=0&&l.length-u-1>e)return null;o=Oo.lastIndex;let m=Number(l);return Number.isFinite(m)?m:null},i=()=>{r();let s=t[o];return s==="0"||s==="1"?(o++,s==="1"?1:0):null},c=()=>(r(),o<t.length&&/[0-9.+-]/.test(t[o]));for(r();o<t.length;){let s=t[o],l=s.toUpperCase(),u=fm[l];if(u===void 0||n.length===0&&l!=="M")return null;if(o++,u===0){n.push({command:s,values:[]}),r();continue}let m=s,f=true;for(;f||c();){let d=[];for(let p=0;p<u;p++){let h=l==="A"&&(p===3||p===4)?i():a();if(h===null)return null;d.push(h);}n.push({command:m,values:d}),l==="M"&&(m=s==="M"?"L":"l"),f=false;}r();}return n}function Ji(t){let e=0;for(let{command:n}of t)e+=n.toUpperCase()==="A"?4:1;return e}function Ki(t,e=1,n=0,o=0){let r="";for(let{command:a,values:i}of t){let c=a.toUpperCase(),s=a===c,l=s?n:0,u=s?o:0,m;switch(c){case "Z":m=[];break;case "H":m=[$(i[0]*e+l)];break;case "V":m=[$(i[0]*e+u)];break;case "A":m=[$(Math.abs(i[0])*e),$(Math.abs(i[1])*e),$(i[2]),String(i[3]),String(i[4]),$(i[5]*e+l),$(i[6]*e+u)];break;default:m=i.map((f,d)=>$(f*e+(d%2===0?l:u)));}r+=a+m.join(" ");}return r}var fm,hm,Oo,Do=q(()=>{"use strict";ht();fm={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0},hm=/^[MmLlHhVvCcSsQqTtAaZz0-9.,+\-\s]*$/,Oo=/[+-]?(?:\d+\.?\d*|\.\d+)/y;});function gr(t,e=.25){let n=[],o=[],r=[0,0],a=[0,0],i=()=>{o.length>2&&n.push(o),o=[];};for(let c of t)if(c.op==="M")i(),r=[c.x,c.y],a=r,o.push(r);else if(c.op==="L")a=[c.x,c.y],o.push(a);else if(c.op==="C"){let s=a,l=[c.x1,c.y1],u=[c.x2,c.y2],m=[c.x,c.y],f=Math.hypot(l[0]-s[0],l[1]-s[1])+Math.hypot(u[0]-l[0],u[1]-l[1])+Math.hypot(m[0]-u[0],m[1]-u[1]),d=Math.max(2,Math.min(64,Math.ceil(Math.sqrt(f/(4*e)))));for(let p=1;p<=d;p++){let h=p/d,g=1-h;o.push([g*g*g*s[0]+3*g*g*h*l[0]+3*g*h*h*u[0]+h*h*h*m[0],g*g*g*s[1]+3*g*g*h*l[1]+3*g*h*h*u[1]+h*h*h*m[1]]);}a=m;}else i(),a=r;return i(),n}function br(t,e){let n=[r=>r[0]-e.x0,r=>e.x1-r[0],r=>r[1]-e.y0,r=>e.y1-r[1]],o=t;for(let r of n){if(o.length===0)break;let a=o;o=[];for(let i=0;i<a.length;i++){let c=a[i],s=a[(i+a.length-1)%a.length],l=r(c),u=r(s);l>=0?(u<0&&o.push(ts(s,c,u,l)),o.push(c)):u>=0&&o.push(ts(s,c,u,l));}}return o.length>2?o:[]}function ts(t,e,n,o){let r=n/(n-o);return [t[0]+(e[0]-t[0])*r,t[1]+(e[1]-t[1])*r]}function es(t){return t.filter(e=>e.length>2).map(e=>`M${e.map(([n,o])=>`${$(n)} ${$(o)}`).join("L")}Z`).join("")}function We(t){let e=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,r=Number.NEGATIVE_INFINITY,a=(i,c)=>{e=Math.min(e,i),n=Math.min(n,c),o=Math.max(o,i),r=Math.max(r,c);};for(let i of t)i.op==="C"?(a(i.x1,i.y1),a(i.x2,i.y2),a(i.x,i.y)):i.op!=="Z"&&a(i.x,i.y);return Number.isFinite(e)?{x0:e,y0:n,x1:o,y1:r}:null}var _r=q(()=>{"use strict";ht();});function os(t){return t.replace(/&(#x[0-9a-f]+|#\d+|[a-z]+);/gi,(e,n)=>{if(n[0]==="#"){let o=n[1].toLowerCase()==="x"?Number.parseInt(n.slice(2),16):Number.parseInt(n.slice(1),10);return Number.isInteger(o)&&o>0&&o<=1114111&&!(o>=55296&&o<=57343)?String.fromCodePoint(o):e}return pm[n.toLowerCase()]??e})}function xn(t,e,n){return t.lastIndex=n,t.test(e)?t.lastIndex:n}function xm(t,e){let n=t.length,o=x=>{let S=Number.POSITIVE_INFINITY,w=-1;return E=>((E<S||w>=0&&w<E)&&(S=E,w=t.indexOf(x,E)),w)},r=o("-->"),a=o("?>"),i=o("]]>"),c=o(">"),s,l=x=>{let S=t.charCodeAt(x);if(S!==ns&&S!==rs)return x+1;let w=t.indexOf(t[x],x+1);return w<0?n:w+1},u=x=>{for(let S=x;S<n&&!s?.[S];S=l(S)){let w=t.charCodeAt(S);if(w===Bo||w===Go&&t.charCodeAt(S+1)===Bo)return S}s??=new Uint8Array(n);for(let S=x;S<n&&!s[S];S=l(S))s[S]=1;return -1},m=-1,f=-1,d=-1,p=-1,h=x=>{let S=x+1;if(S<m||S>=f){m=S,f=xn(_m,t,S),d=-1;for(let E=f;E>S;E--){let P=t.charCodeAt(E);if((E===f||P===ns||P===rs)&&(p=u(E),p>=0)){d=E;break}}}if(d<=S)return -1;let w=t.charCodeAt(p)===Go;return e.open(t.slice(S,d),t.slice(d,p),w),p+(w?2:1)},g=-1,b=-1,_=-1,y=x=>{let S=x+2;if(S<g||S>=b){g=S,b=xn(ym,t,S);let w=xn(Uo,t,b);_=b>S&&t.charCodeAt(w)===Bo?w:-1;}return _},M=x=>{if(t.startsWith("<!--",x)){let S=r(x+4);if(S>=0)return S+3}if(t.startsWith("<?",x)){let S=a(x+2);if(S>=0)return S+2}if(t.startsWith("<![CDATA[",x)){let S=i(x+9);if(S>=0)return e.cdata(t.slice(x+9,S)),S+3}if(t.startsWith("<!",x)){let S=c(x+2);if(S>=0)return S+1}if(t.charCodeAt(x+1)===Go){let S=y(x);return S<0?-1:(e.close(),S+1)}return h(x)},C=0;for(;C<n;)if(t.charCodeAt(C)===gm){let x=M(C);C=x<0?C+1:x;}else {let x=t.indexOf("<",C),S=x<0?n:x;e.text(t.slice(C,S)),C=S;}}function Sm(t){let e={},n=0;for(;n<t.length;){let o=xn($m,t,n);if(o===n){n++;continue}let r=xn(Uo,t,o);if(t.charCodeAt(r)===bm){let a=xn(Uo,t,r+1),i=t[a],c=i==='"'||i==="'"?t.indexOf(i,a+1):-1;if(c>=0){e[t.slice(n,o)]=os(t.slice(a+1,c)),n=c+1;continue}}n=o;}return e}function Le(t){let e={name:"#root",attrs:{},children:[],text:""},n=[e],o=()=>n.at(-1);xm(t,{open(a,i,c){let s=Sm(i),l={name:a,attrs:s,children:[],text:""};o().children.push(l),c||n.push(l);},close(){n.length>1&&n.pop();},text(a){o().text+=os(a);},cdata(a){o().text+=a;}});let r=a=>{for(let i of a.children){if(i.name==="svg")return i;let c=r(i);if(c)return c}return null};return r(e)}function pt(t,e){let[n,o,r,a,i,c]=t,[s,l,u,m,f,d]=e;return [n*s+r*l,o*s+a*l,n*u+r*m,o*u+a*m,n*f+r*d+i,o*f+a*d+c]}function X(t,e,n){return [t[0]*e+t[2]*n+t[4],t[1]*e+t[3]*n+t[5]]}function Sn(t){return Math.sqrt(Math.abs(t[0]*t[3]-t[1]*t[2]))}function Ve(t){return t?(t.match(/[+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?/gi)??[]).map(Number):[]}function ne(t){let e=yr;if(!t)return e;for(let[,n,o]of t.matchAll(/(matrix|translate|scale|rotate|skewX|skewY)\s*\(([^)]*)\)/g)){let r=Ve(o),a=yr;switch(n){case "matrix":r.length===6&&(a=r);break;case "translate":a=[1,0,0,1,r[0]??0,r[1]??0];break;case "scale":a=[r[0]??1,0,0,r[1]??r[0]??1,0,0];break;case "rotate":{let i=(r[0]??0)*Math.PI/180,c=Math.cos(i),s=Math.sin(i),[l,u]=[r[1]??0,r[2]??0];a=pt(pt([1,0,0,1,l,u],[c,s,-s,c,0,0]),[1,0,0,1,-l,-u]);break}case "skewX":a=[1,0,Math.tan((r[0]??0)*Math.PI/180),1,0,0];break;case "skewY":a=[1,Math.tan((r[0]??0)*Math.PI/180),0,1,0,0];break;}e=pt(e,a);}return e}function Mm(t,e,n,o,r,a,i,c,s){if(t===c&&e===s)return [];let l=Math.abs(n),u=Math.abs(o);if(l===0||u===0)return [{op:"L",x:c,y:s}];let m=r*Math.PI/180,f=Math.cos(m),d=Math.sin(m),p=(t-c)/2,h=(e-s)/2,g=f*p+d*h,b=-d*p+f*h,_=g*g/(l*l)+b*b/(u*u);_>1&&(l*=Math.sqrt(_),u*=Math.sqrt(_));let y=l*l*u*u-l*l*b*b-u*u*g*g,M=l*l*b*b+u*u*g*g,C=(a===i?-1:1)*Math.sqrt(Math.max(0,y/M)),x=C*l*b/u,S=-C*u*g/l,w=f*x-d*S+(t+c)/2,E=d*x+f*S+(e+s)/2,P=(G,V,Q,j)=>Math.atan2(G*j-V*Q,G*Q+V*j),R=P(1,0,(g-x)/l,(b-S)/u),v=P((g-x)/l,(b-S)/u,(-g-x)/l,(-b-S)/u);!i&&v>0?v-=2*Math.PI:i&&v<0&&(v+=2*Math.PI);let L=Math.max(1,Math.ceil(Math.abs(v)/(Math.PI/2)-1e-9)),k=v/L,T=4/3*Math.tan(k/4),I=(G,V)=>[w+l*f*G-u*d*V,E+l*d*G+u*f*V],W=[];for(let G=0;G<L;G++){let V=R+G*k,Q=V+k,[j,et]=I(Math.cos(V)-T*Math.sin(V),Math.sin(V)+T*Math.cos(V)),[ft,F]=I(Math.cos(Q)+T*Math.sin(Q),Math.sin(Q)-T*Math.cos(Q)),[U,xt]=G===L-1?[c,s]:I(Math.cos(Q),Math.sin(Q));W.push({op:"C",x1:j,y1:et,x2:ft,y2:F,x:U,y:xt});}return W}function fe(t){let e=[],n=0,o=0,r=0,a=0,i=0,c="",s=null,l=null,u=()=>{for(;n<t.length&&/[\s,]/.test(t[n]);)n++;},m=()=>{u(),Qo.lastIndex=n;let p=Qo.exec(t);return p?(n=Qo.lastIndex,Number(p[0])):null},f=()=>{u();let p=t[n];return p==="0"||p==="1"?(n++,p==="1"):null},d=p=>{let h=[];for(let g=0;g<p;g++){let b=m();if(b===null)return null;h.push(b);}return h};for(;u(),!(n>=t.length);){let p=t[n];if(/[MmLlHhVvCcSsQqTtAaZz]/.test(p))c=p,n++;else if(!c||c==="Z"||c==="z")break;let h=c===c.toLowerCase(),g=h?o:0,b=h?r:0,_=c.toUpperCase();if(_==="Z"){e.push({op:"Z"}),o=a,r=i,s=null,l=null;continue}if(_==="A"){let x=d(3),S=f(),w=f(),E=d(2);if(!(x&&E)||S===null||w===null)break;let[P,R,v]=x,L=E[0]+g,k=E[1]+b;e.push(...Mm(o,r,P,R,v,S,w,L,k)),o=L,r=k,s=null,l=null;continue}let y={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2}[_]??0,M=d(y);if(!M)break;let C=M;switch(_){case "M":o=C[0]+g,r=C[1]+b,a=o,i=r,e.push({op:"M",x:o,y:r}),c=h?"l":"L",s=null,l=null;break;case "L":case "H":case "V":_!=="V"&&(o=C[0]+g),_==="V"?r=C[0]+b:_==="L"&&(r=C[1]+b),e.push({op:"L",x:o,y:r}),s=null,l=null;break;case "C":case "S":{let x,S;_==="C"?(x=[C[0]+g,C[1]+b],S=C.slice(2)):(x=s?[2*o-s[0],2*r-s[1]]:[o,r],S=C);let w=[S[0]+g,S[1]+b],E=[S[2]+g,S[3]+b];e.push({op:"C",x1:x[0],y1:x[1],x2:w[0],y2:w[1],x:E[0],y:E[1]}),[o,r]=E,s=w,l=null;break}case "Q":case "T":{let x,S;_==="Q"?(x=[C[0]+g,C[1]+b],S=[C[2]+g,C[3]+b]):(x=l?[2*o-l[0],2*r-l[1]]:[o,r],S=[C[0]+g,C[1]+b]),e.push({op:"C",x1:o+2/3*(x[0]-o),y1:r+2/3*(x[1]-r),x2:S[0]+2/3*(x[0]-S[0]),y2:S[1]+2/3*(x[1]-S[1]),x:S[0],y:S[1]}),[o,r]=S,l=x,s=null;break}}}return e}function re(t,e,n,o){if(n<=0||o<=0)return [];let r=n*$r,a=o*$r;return [{op:"M",x:t+n,y:e},{op:"C",x1:t+n,y1:e+a,x2:t+r,y2:e+o,x:t,y:e+o},{op:"C",x1:t-r,y1:e+o,x2:t-n,y2:e+a,x:t-n,y:e},{op:"C",x1:t-n,y1:e-a,x2:t-r,y2:e-o,x:t,y:e-o},{op:"C",x1:t+r,y1:e-o,x2:t+n,y2:e-a,x:t+n,y:e},{op:"Z"}]}function oe(t,e,n,o,r=0,a=0){if(n<=0||o<=0)return [];let i=Math.min(Math.max(r,0),n/2),c=Math.min(Math.max(a,0),o/2);if(i===0||c===0)return [{op:"M",x:t,y:e},{op:"L",x:t+n,y:e},{op:"L",x:t+n,y:e+o},{op:"L",x:t,y:e+o},{op:"Z"}];let s=i*$r,l=c*$r,u=t+n,m=e+o;return [{op:"M",x:t+i,y:e},{op:"L",x:u-i,y:e},{op:"C",x1:u-i+s,y1:e,x2:u,y2:e+c-l,x:u,y:e+c},{op:"L",x:u,y:m-c},{op:"C",x1:u,y1:m-c+l,x2:u-i+s,y2:m,x:u-i,y:m},{op:"L",x:t+i,y:m},{op:"C",x1:t+i-s,y1:m,x2:t,y2:m-c+l,x:t,y:m-c},{op:"L",x:t,y:e+c},{op:"C",x1:t,y1:e+c-l,x2:t+i-s,y2:e,x:t+i,y:e},{op:"Z"}]}var pm,gm,Bo,Go,bm,ns,rs,Uo,_m,ym,$m,yr,Qo,$r,he=q(()=>{"use strict";pm={amp:"&",lt:"<",gt:">",quot:'"',apos:"'"};gm=60,Bo=62,Go=47,bm=61,ns=34,rs=39,Uo=/\s*/y,_m=/[^\s/>]*/y,ym=/[^\s>]*/y,$m=/[^\s=]*/y;yr=[1,0,0,1,0,0];Qo=/[+-]?(?:\d+\.?\d*|\.\d+)(?:[eE][+-]?\d+)?/y;$r=.5522847498;});function Er(t,e=ee){let n=t.slice(0,1e3).normalize("NFC").replace(Cm," ").replace(wm,"").replace(/\s+/g," ").trim();return Array.from(n).slice(0,Math.max(0,e)).join("").trim()}function Em(t){for(let e of t)if((e.codePointAt(0)??0)>255)return false;return true}function ds(t){let e=Cn(t);return {x0:t.qr.x-e,y0:t.qr.y-e,x1:t.qr.x+t.qr.size+e,y1:t.qr.y+t.qr.size+e}}function Cn(t){return t.qr.padding??t.qr.size*st.defaultPadding}function Dm(t){switch(t.type){case "rect":return {bounds:{x0:t.x,y0:t.y,x1:t.x+t.width,y1:t.y+t.height},segments:t.hole?18:9};case "circle":return {bounds:{x0:t.cx-t.r,y0:t.cy-t.r,x1:t.cx+t.r,y1:t.cy+t.r},segments:t.hole?10:5};case "ellipse":return {bounds:{x0:t.cx-t.rx,y0:t.cy-t.ry,x1:t.cx+t.rx,y1:t.cy+t.ry},segments:5};case "polygon":{let e=t.points.map(([o])=>o),n=t.points.map(([,o])=>o);return {bounds:{x0:Math.min(...e),y0:Math.min(...n),x1:Math.max(...e),y1:Math.max(...n)},segments:t.points.length}}case "path":{let e=pr(t.d,st.maxDecimals);return e?{bounds:We(fe(t.d)),segments:Ji(e)}:{bounds:null,segments:0}}case "line":{let e=t.width/2,n=Math.hypot(t.x2-t.x1,t.y2-t.y1),o=t.dash?Math.ceil(n/(t.dash[0]+t.dash[1])):1;return {bounds:{x0:Math.min(t.x1,t.x2)-e,y0:Math.min(t.y1,t.y2)-e,x1:Math.max(t.x1,t.x2)+e,y1:Math.max(t.y1,t.y2)+e},segments:o*(t.cap==="round"?4:5)}}default:return {bounds:{x0:t.x,y0:t.y,x1:t.x+t.size,y1:t.y+t.size},segments:ss}}}function Bm(t,e){let n=(b,_=[])=>e.addIssue({code:"custom",message:b,path:_}),o=st,r=new TextEncoder().encode(JSON.stringify(t)).length;if(r>o.maxBytes){n(`The spec is ${r} bytes; the limit is ${o.maxBytes}`);return}let{width:a,height:i}=t.artboard,c=Math.max(a,i)*.005,s={x0:-c,y0:-c,x1:a+c,y1:i+c},l=b=>b.x0>=s.x0&&b.y0>=s.y0&&b.x1<=s.x1&&b.y1<=s.y1,{qr:u}=t,m=Cn(t);m<u.size*o.minPadding-1e-9&&n(`qr.padding must be at least ${o.minPadding*100}% of qr.size`,["qr","padding"]),u.size<Math.min(a,i)*o.minQrShare-1e-9&&n(`qr.size must be at least ${o.minQrShare*100}% of the artboard's shorter side`,["qr","size"]);let f=ds(t);(f.x0<-1e-9||f.y0<-1e-9||f.x1>a+1e-9||f.y1>i+1e-9)&&n("The code and its padding must sit inside the artboard",["qr"]),(u.radius??0)>(u.size+2*m)/2&&n("qr.radius is larger than half the plate",["qr","radius"]);let d=0,p=0;t.shapes.forEach((b,_)=>{let y=["shapes",_],{bounds:M,segments:C}=Dm(b);if(!M){n("Path data must use only M L H V C S Q T A Z, plain numbers (up to 3 decimals) and start with M",[...y,"d"]);return}if(l(M)||n("The shape extends outside the artboard",y),b.type==="rect"&&b.hole){let{hole:x}=b;(x.x<b.x||x.y<b.y||x.x+x.width>b.x+b.width+1e-9||x.y+x.height>b.y+b.height+1e-9)&&n("The hole must sit inside its rect",[...y,"hole"]);}b.type==="circle"&&b.hole&&b.hole>=b.r&&n("The hole must be smaller than the circle",[...y,"hole"]),d+=C,typeof b.fill=="object"&&"gradient"in b.fill&&(p+=(b.fill.gradient.steps??32)*C);}),d>o.maxSegments&&n(`The shapes have ${d} segments; the limit is ${o.maxSegments}`,["shapes"]),p>o.maxGradientWork&&n("Gradient fills are too detailed (fewer steps or simpler shapes)",["shapes"]);let h=new Set,g=new Set;t.labels.forEach((b,_)=>{let y=["labels",_];h.has(b.id)&&n(`Label id "${b.id}" is used twice`,[...y,"id"]),h.add(b.id),b.slot!=="fixed"&&(g.has(b.slot)&&n(`Only one label may use the ${b.slot} slot`,[...y,"slot"]),g.add(b.slot));let M=b.maxLength??o.maxTextLength;b.text!==Er(b.text,M)&&n(`Label text must be at most ${M} characters, trimmed, with no control or invisible characters (see sanitizeFrameText)`,[...y,"text"]);let C;if(b.type==="text")C={x0:b.box.x,y0:b.box.y,x1:b.box.x+b.box.width,y1:b.box.y+b.box.height},b.fontSize!==void 0&&b.fontSize>b.box.height*wr+1e-9&&n("fontSize may be at most 95% of the label's row height",[...y,"fontSize"]),Om(C,f)&&n("The label overlaps the code or its padding",[...y,"box"]);else {let{cx:x,cy:S,radius:w}=b.curve,E=b.fontSize*ve*.6;C={x0:x-w-E,y0:S-w-E,x1:x+w+E,y1:S+w+E};let P=Math.hypot(Math.max(f.x0-x,0,x-f.x1),Math.max(f.y0-S,0,S-f.y1));Math.hypot(Math.max(Math.abs(f.x0-x),Math.abs(f.x1-x)),Math.max(Math.abs(f.y0-S),Math.abs(f.y1-S)))<=w-E||P>=w+E||n("The curved label crosses the code or its padding",[...y,"curve"]);}l(C)||n("The label extends outside the artboard",y);});}function Gm(t){let e=Xe.safeParse(t);return e.success?[]:e.error.issues.map(n=>n.path.length>0?`${n.path.join(".")}: ${n.message}`:n.message)}var Mr,Cr,Hn,st,is,wr,ss,cs,Cm,wm,Ho,yt,Ot,Sr,xr,qo,Mn,Ie,zo,Rm,Pm,Am,vm,Lm,Im,Fm,ls,us,Tm,km,ms,as,Nm,Om,Xe,fs,Wo,wn=q(()=>{"use strict";Do();_r();he();zn();Mr="qrdx.frame",Cr=1,Hn="custom",st={minArtboard:50,maxArtboard:2e3,maxCoordinate:4e3,maxDecimals:3,maxShapes:64,maxLabels:8,maxPolygonPoints:256,maxPathLength:16e3,maxSegments:2e3,maxGradientSteps:64,maxGradientWork:16e3,maxBytes:32768,minQrShare:.5,minPadding:.04,defaultPadding:.08,maxTextLength:ee},is=["wifi","star","heart","phone","headphones","calendar","user","chat","bag","bell","cup","card","check","info","home","pin","share","download","clock","snowflake","pumpkin","tree","sparkle","gift"],wr=.95,ss=200,cs=["frame","text","accent","background"],Cm=/[\t\n\v\f\r\u0085\u2028\u2029]/g,wm=/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u115f\u1160\u17b4\u17b5\u180b-\u180f\u200b-\u200f\u202a-\u202e\u2060-\u206f\u3164\ufe00-\ufe0f\ufeff\uffa0\ufff0-\ufffb]|\udb40[\udc00-\udcff]|[\ud800-\udbff](?![\udc00-\udfff])|(?<![\ud800-\udbff])[\udc00-\udfff]/g;Ho=t=>Math.abs(t*1e3-Math.round(t*1e3))<1e-6,yt=z$1.number().min(-st.maxCoordinate).max(st.maxCoordinate).refine(Ho,{message:`Numbers may have at most ${st.maxDecimals} decimals`}),Ot=yt.refine(t=>t>0,{message:"Must be greater than 0"}),Sr=yt.refine(t=>t>=0,{message:"Must not be negative"}),xr=z$1.string().regex(/^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/,"Use a #rgb or #rrggbb color"),qo=z$1.union([z$1.enum(cs),xr]),Mn=z$1.union([qo,z$1.object({mix:z$1.tuple([qo,qo]),amount:z$1.number().min(0).max(1).refine(Ho)}).strict()]),Ie=z$1.union([Mn,z$1.object({gradient:z$1.object({from:Mn,to:Mn,direction:z$1.enum(["horizontal","vertical"]).optional(),steps:z$1.int().min(2).max(st.maxGradientSteps).optional()}).strict()}).strict()]),zo={x:yt,y:yt,width:Ot,height:Ot},Rm=z$1.object({type:z$1.literal("rect"),...zo,radius:Sr.optional(),fill:Ie,hole:z$1.object({...zo,radius:Sr.optional()}).strict().optional()}).strict(),Pm=z$1.object({type:z$1.literal("circle"),cx:yt,cy:yt,r:Ot,hole:Ot.optional(),fill:Ie}).strict(),Am=z$1.object({type:z$1.literal("ellipse"),cx:yt,cy:yt,rx:Ot,ry:Ot,fill:Ie}).strict(),vm=z$1.object({type:z$1.literal("polygon"),points:z$1.array(z$1.tuple([yt,yt])).min(3).max(st.maxPolygonPoints),fill:Ie}).strict(),Lm=z$1.object({type:z$1.literal("path"),d:z$1.string().min(2).max(st.maxPathLength),fill:Ie,fillRule:z$1.enum(["nonzero","evenodd"]).optional()}).strict(),Im=z$1.object({type:z$1.literal("line"),x1:yt,y1:yt,x2:yt,y2:yt,width:Ot,cap:z$1.enum(["butt","round"]).optional(),dash:z$1.tuple([Ot,Ot]).optional(),fill:Ie}).strict(),Fm=z$1.object({type:z$1.literal("icon"),icon:z$1.enum(is),x:yt,y:yt,size:Ot,fill:Ie}).strict(),ls=z$1.discriminatedUnion("type",[Rm,Pm,Am,vm,Lm,Im,Fm]),us={id:z$1.string().regex(/^[a-z][a-z0-9-]{0,31}$/),slot:z$1.enum(["primary","secondary","fixed"]),text:z$1.string().max(200),maxLength:z$1.int().min(1).max(ee).optional(),color:Mn,weight:z$1.enum(["bold","regular"]).optional()},Tm=z$1.object({type:z$1.literal("text"),...us,box:z$1.object(zo).strict(),align:z$1.enum(["start","middle","end"]).optional(),fontSize:Ot.optional()}).strict(),km=z$1.object({type:z$1.literal("curved"),...us,curve:z$1.object({cx:yt,cy:yt,radius:Ot,side:z$1.enum(["top","bottom"]),spread:z$1.number().min(20).max(300).refine(Ho).optional()}).strict(),fontSize:Ot}).strict(),ms=z$1.discriminatedUnion("type",[Tm,km]),as=yt.refine(t=>t>=st.minArtboard&&t<=st.maxArtboard,{message:`Artboard sides must be ${st.minArtboard} to ${st.maxArtboard} units`}),Nm=z$1.object({kind:z$1.literal(Mr),version:z$1.literal(Cr),artboard:z$1.object({width:as,height:as}).strict(),qr:z$1.object({x:yt,y:yt,size:Ot,padding:Sr.optional(),radius:Sr.optional()}).strict(),colors:z$1.object({frame:xr,text:xr.optional(),accent:xr.optional()}).strict(),shapes:z$1.array(ls).max(st.maxShapes),labels:z$1.array(ms).max(st.maxLabels),bleed:z$1.union([z$1.literal("none"),Mn]).optional()}).strict();Om=(t,e)=>Math.min(t.x1,e.x1)-Math.max(t.x0,e.x0)>1e-6&&Math.min(t.y1,e.y1)-Math.max(t.y0,e.y0)>1e-6;Xe=Nm.superRefine(Bm);fs=hr.extend({style:z$1.literal(Hn),spec:Xe}),Wo=z$1.discriminatedUnion("style",[hr,fs]);});function tt(t){if(t.length===0)return "";let[e,...n]=t;return `M${$(e[0])} ${$(e[1])}${n.map(([o,r])=>`L${$(o)} ${$(r)}`).join("")}Z`}function z(t,e,n){return `M${$(t-n)} ${$(e)}A${$(n)} ${$(n)} 0 1 1 ${$(t+n)} ${$(e)}A${$(n)} ${$(n)} 0 1 1 ${$(t-n)} ${$(e)}Z`}function O(t,e,n,o,r=0){let a=Math.min(n,o)/2,[i,c,s,l]=(typeof r=="number"?[r,r,r,r]:r).map(m=>Math.max(0,Math.min(m,a))),u=(m,f,d)=>m>0?`A${$(m)} ${$(m)} 0 0 1 ${$(f)} ${$(d)}`:"";return `M${$(t+i)} ${$(e)}H${$(t+n-c)}${u(c,t+n,e+c)}V${$(e+o-s)}${u(s,t+n-s,e+o)}H${$(t+l)}${u(l,t,e+o-l)}V${$(e+i)}${u(i,t+i,e)}Z`}function En(t,e,n,o,r=-90){return Array.from({length:o},(a,i)=>{let c=(r+360/o*i)*Math.PI/180;return [t+n*Math.cos(c),e+n*Math.sin(c)]})}function Rn(t,e,n,o,r=5){return Array.from({length:r*2},(a,i)=>{let c=i%2===0?n:o,s=-Math.PI/2+Math.PI/r*i;return [t+c*Math.cos(s),e+c*Math.sin(s)]})}function Wn(t,e,n,o,r=4,a=64){return Array.from({length:a},(i,c)=>{let s=2*Math.PI*c/a,l=Math.cos(s),u=Math.sin(s);return [t+n*Math.sign(l)*Math.abs(l)**(2/r),e+o*Math.sign(u)*Math.abs(u)**(2/r)]})}function Pn(t,e,n){let o=n/2,r=(a,i)=>`${$(t+a*o)} ${$(e+i*o)}`;return `M${r(0,-0.52)}C${r(.18,-0.92)} ${r(.98,-0.94)} ${r(1,-0.34)}C${r(1,.12)} ${r(.5,.48)} ${r(0,.92)}C${r(-0.5,.48)} ${r(-1,.12)} ${r(-1,-0.34)}C${r(-0.98,-0.94)} ${r(-0.18,-0.92)} ${r(0,-0.52)}Z`}function hs(t,e,n,o){if(o===0)return t;let r=o*Math.PI/180,a=Math.cos(r),i=Math.sin(r);return t.map(([c,s])=>[e+(c-e)*a-(s-n)*i,n+(c-e)*i+(s-n)*a])}function Rr(t,e,n=0){let o=Math.imul(t+2654435769,2246822507)^Math.imul(e+n,3266489909);return o=Math.imul(o^o>>>15,739982445),o=Math.imul(o^o>>>12,695872825),o^=o>>>15,(o>>>0)/4294967296}function Ye(t){let e=2166136261;for(let n=0;n<t.length;n++)e^=t.charCodeAt(n),e=Math.imul(e,16777619);return (e>>>0).toString(36)}var ae=q(()=>{"use strict";ht();});function An(t,e,n,o,r,a){let i=a-r>180?1:0;return `M${Pr(Fe(t,e,o,r))}A${$(o)} ${$(o)} 0 ${i} 1 ${Pr(Fe(t,e,o,a))}L${Pr(Fe(t,e,n,a))}A${$(n)} ${$(n)} 0 ${i} 0 ${Pr(Fe(t,e,n,r))}Z`}function Vn(t,e,n,o){return `M${$(t-n)} ${$(e)}A${$(n)} ${$(o)} 0 1 1 ${$(t+n)} ${$(e)}A${$(n)} ${$(o)} 0 1 1 ${$(t-n)} ${$(e)}Z`}function Qm(t){let e=0;return t.forEach(([n,o],r)=>{let[a,i]=t[(r+1)%t.length];e+=n*i-a*o;}),e/2}function ps(t){return tt(Qm(t)<0?[...t].reverse():t)}function Ar(t,e,n,o,r){let a=Math.hypot(n-t,o-e)||1,i=-(o-e)/a*(r/2),c=(n-t)/a*(r/2);return ps([[t+i,e+c],[n+i,o+c],[n-i,o-c],[t-i,e-c]])}function Um(){let t=[];for(let e of [0,60,120]){let[n,o]=Fe(12,12,10.5,e+180),[r,a]=Fe(12,12,10.5,e);t.push(Ar(n,o,r,a,2));}for(let e=0;e<6;e++){let n=e*60,[o,r]=Fe(12,12,6.2,n);for(let a of [-45,45]){let[i,c]=Fe(o,r,3.6,n+a);t.push(Ar(o,r,i,c,1.7));}}return It(...t)}function Xo(t){return qm[t]()}var Vo,Fe,Pr,It,pe,qm,Yo=q(()=>{"use strict";ae();ht();Vo=24,Fe=(t,e,n,o)=>{let r=o*Math.PI/180;return [t+n*Math.cos(r),e+n*Math.sin(r)]},Pr=([t,e])=>`${$(t)} ${$(e)}`;It=(...t)=>({d:t.join(""),fillRule:"nonzero"}),pe=(...t)=>({d:t.join(""),fillRule:"evenodd"});qm={wifi:()=>It(An(12,20,4.6,7.2,-135,-45),An(12,20,9.2,11.8,-135,-45),An(12,20,13.8,16.4,-135,-45),z(12,20,2.2)),star:()=>It(tt(Rn(12,12.8,11.6,4.8))),heart:()=>It(Pn(12,12.4,22)),phone:()=>pe(O(6,1.5,12,21,2.6),O(7.8,4.2,8.4,13.4,.6),z(12,19.8,1.1)),headphones:()=>It(An(12,13,7.6,9.8,-180,0),O(2,12,5,9.5,2),O(17,12,5,9.5,2)),calendar:()=>pe(O(2.5,4,19,17.5,2.5),O(4.6,9,14.8,10.6,.8),O(7,11.4,2.6,2.6,.4),O(10.7,11.4,2.6,2.6,.4),O(14.4,11.4,2.6,2.6,.4),O(7,15.1,2.6,2.6,.4),O(10.7,15.1,2.6,2.6,.4),O(6.5,1.4,2.4,2.6,[1.2,1.2,0,0]),O(15.1,1.4,2.4,2.6,[1.2,1.2,0,0])),user:()=>It(z(12,7.5,4.6),"M3 21.5C3 16.2 7 13.6 12 13.6C17 13.6 21 16.2 21 21.5Z"),chat:()=>pe(O(2,3,20,14,4),tt([[6.5,17],[11.5,17],[5.8,21.8]]),z(7.5,10,1.5),z(12,10,1.5),z(16.5,10,1.5)),bag:()=>It(O(3.5,7.5,17,14.5,2),An(12,7.5,3.1,4.8,-180,0)),bell:()=>It("M3.5 17.2A8.5 8.5 0 0 1 20.5 17.2Z",O(1.5,18.2,21,2.6,1.3),O(11.2,6.6,1.6,2.6,0),O(9.8,4.6,4.4,2.4,1.2)),cup:()=>It("M4 6.5H17V13.5A6.5 6.5 0 0 1 4 13.5Z",An(17,10.2,1.7,3.6,-90,90),O(2,20.6,17,2,1),O(7,1.6,1.6,3.4,.8),O(11.6,1.6,1.6,3.4,.8)),card:()=>pe(O(1.5,4.5,21,15,2.5),O(1.5,8,21,3,0),O(4.5,13.6,4.6,3.2,.6)),check:()=>pe(z(12,12,10.5),tt([[6.6,12.4],[8.4,10.6],[10.6,12.8],[15.8,7.6],[17.6,9.4],[10.6,16.4]])),info:()=>pe(z(12,12,10.5),z(12,7.2,1.6),O(10.6,10,2.8,8,.8)),home:()=>pe(tt([[12,2.5],[22.5,11.5],[19.5,11.5],[19.5,21.5],[4.5,21.5],[4.5,11.5],[1.5,11.5]]),O(10,14.5,4,7,[.6,.6,0,0])),pin:()=>pe("M12 22.5C8.5 17.6 4.5 14 4.5 9.5A7.5 7.5 0 0 1 19.5 9.5C19.5 14 15.5 17.6 12 22.5Z",z(12,9.5,3)),share:()=>It(Ar(6,12,18,5,1.8),Ar(6,12,18,19,1.8),z(18,5,3.2),z(6,12,3.2),z(18,19,3.2)),download:()=>It(O(10.6,2,2.8,9.5,0),tt([[6,10],[18,10],[12,16.5]]),tt([[2.5,15],[5.3,15],[5.3,19],[18.7,19],[18.7,15],[21.5,15],[21.5,21.8],[2.5,21.8]])),clock:()=>pe(z(12,12,10.5),z(12,12,8.4),tt([[11,5.4],[13,5.4],[13,11.3],[16.9,13.5],[15.9,15.2],[11,12.5]])),snowflake:Um,pumpkin:()=>It(Vn(7.8,14.6,5.8,6.9),Vn(16.2,14.6,5.8,6.9),Vn(12,14.6,4.8,7.4),O(10.9,3.4,2.2,4.6,.8),ps([[13,4.2],[17.2,3],[16.2,5.4],[13,6]])),tree:()=>It(tt([[12,1.5],[16.8,8.2],[7.2,8.2]]),tt([[12,5.2],[19,13.6],[5,13.6]]),tt([[12,9.4],[21.2,19.2],[2.8,19.2]]),O(10.4,18.6,3.2,3.9,.4)),sparkle:()=>It(tt(Rn(9.5,13.5,9,2.4,4)),tt(Rn(19,5,4,1.1,4))),gift:()=>It(O(3,11.2,7.8,10.6,1),O(13.2,11.2,7.8,10.6,1),O(2,7.4,8.8,3.2,1),O(13.2,7.4,8.8,3.2,1),Vn(8.8,4.8,2.9,1.9),Vn(15.2,4.8,2.9,1.9))};});function gs(t,e){let n=t.trim(),o=Number.parseFloat(n);return Number.isNaN(o)?Number.NaN:n.endsWith("%")?o/100*e:o}function mt(t){if(!t)return null;let e=t.trim().toLowerCase();if(e==="transparent")return {r:0,g:0,b:0,a:0};let n=zm[e];if(n)return {r:n[0],g:n[1],b:n[2],a:1};if(e.startsWith("#")){let r=e.slice(1);return (r.length===3||r.length===4)&&(r=r.split("").map(a=>a+a).join("")),/^[0-9a-f]{6}([0-9a-f]{2})?$/.test(r)?{r:Number.parseInt(r.slice(0,2),16),g:Number.parseInt(r.slice(2,4),16),b:Number.parseInt(r.slice(4,6),16),a:r.length===8?Number.parseInt(r.slice(6,8),16)/255:1}:null}let o=/^rgba?\(([^)]*)\)$/.exec(e);if(o){let[r,a]=o[1].split("/"),i=r.split(/[\s,]+/).filter(Boolean);if(i.length!==(a===void 0&&i.length===4?4:3))return null;let c=a??i[3],[s,l,u]=i.slice(0,3).map(d=>gs(d,255)),m=c===void 0?1:gs(c,1);if([s,l,u,m].some(d=>Number.isNaN(d)))return null;let f=(d,p)=>Math.min(Math.max(d,0),p);return {r:f(s,255),g:f(l,255),b:f(u,255),a:f(m,1)}}return null}function Te(t,e,n){let o=t/255,r=e/255,a=n/255,i=1-Math.max(o,r,a);return i>=1?[0,0,0,1]:[it((1-o-i)/(1-i)),it((1-r-i)/(1-i)),it((1-a-i)/(1-i)),it(i)]}var zm,Dt=q(()=>{"use strict";ht();zm={black:[0,0,0],white:[255,255,255],red:[255,0,0],green:[0,128,0],lime:[0,255,0],blue:[0,0,255],navy:[0,0,128],yellow:[255,255,0],orange:[255,165,0],purple:[128,0,128],pink:[255,192,203],gray:[128,128,128],grey:[128,128,128],silver:[192,192,192],maroon:[128,0,0],olive:[128,128,0],teal:[0,128,128],aqua:[0,255,255],cyan:[0,255,255],fuchsia:[255,0,255],magenta:[255,0,255]};});function _s(t){return Hm.includes(t)}function ys(t){return t===" "?.3:/[MWmw@%]/.test(t)?.92:/[A-Z0-9#&]/.test(t)?.72:/[il.,:;!'|1]/.test(t)?.32:.6}function Ln(t){let e=0;for(let n of t)e+=ys(n);return Math.max(e,1)}function Ut(t,e,n){let o=mt(t)??{r:0,g:0,b:0},r=mt(e)??{r:255,g:255,b:255},a=Math.min(1,Math.max(0,n));return `#${jo(o.r+(r.r-o.r)*a)}${jo(o.g+(r.g-o.g)*a)}${jo(o.b+(r.b-o.b)*a)}`}function vr(t,e,n,o,r,a,i,c){let s=[...t],l=r*.08,u=s.map(h=>ys(h)*r),m=u.reduce((h,g)=>h+g,0)+l*Math.max(0,s.length-1),f=a==="top"?o-r*.35:o+r*.35,d=[],p=0;return s.forEach((h,g)=>{let b=u[g],_=(p+b/2)/f;if(p+=b+l,h.trim()==="")return;let y=a==="top"?-Math.PI/2-m/2/f+_:Math.PI/2+m/2/f-_;d.push({text:h,x:e+f*Math.cos(y),y:n+f*Math.sin(y),fontSize:r,maxWidth:r*2,color:i,rotate:y*180/Math.PI+(a==="top"?90:-90),field:c});}),d}function bs(t,e,n,o){let r=t<e+o?e+o-t:t>e+n-o?t-(e+n-o):0;return o-Math.sqrt(Math.max(0,o*o-Math.min(r,o)**2))}function o0(t,e,n,o,r,a,i=48){let c=Math.max(n-o,0),s=t-2*o,l=new Set([o,t-o]);for(let g=0;g<=i;g++)l.add(t*g/i);let u=[...l].sort((g,b)=>g-b),m=t*.002,f=5,d=g=>bs(g,0,t,n),p=g=>o+bs(g,o,s,c),h=[];for(let g=0;g+1<u.length;g++){let b=u[g],_=Math.min(t,u[g+1]+(g+2<u.length?m:0)),y=Ut(r,a,(b+_)/2/t),M=x=>Array.from({length:f},(S,w)=>{let E=w/(f-1);return x?_+(b-_)*E:b+(_-b)*E});b>=o-1e-9&&u[g+1]<=t-o+1e-9?h.push(Ft([...M(false).map(x=>[x,d(x)]),...M(true).map(x=>[x,p(x)])],y),Ft([...M(false).map(x=>[x,e-p(x)]),...M(true).map(x=>[x,e-d(x)])],y)):h.push(Ft([...M(false).map(x=>[x,d(x)]),...M(true).map(x=>[x,e-d(x)])],y));}return h}var Hm,Zo,vt,jo,Qt,ct,vn,Ft,ke,$s,Wm,Vm,Xm,Ym,jm,Zm,Jm,Km,t0,e0,n0,r0,a0,i0,xs,Lr=q(()=>{"use strict";ae();ht();Dt();Hm=["banner-top-bottom","speech-bubble-top","chat-bubble","circle","polaroid","phone","ticket","badge","envelope","tag","menu-card","sticker","gradient-border","focus"];Zo={from:"#7c3aed",to:"#db2777"},vt="#FFFFFF";jo=t=>Math.round(Math.min(255,Math.max(0,t))).toString(16).padStart(2,"0");Qt=(t,e,n,o,r=0)=>({x:t,y:e,width:n,height:o,radius:r}),ct=(t,e,n,o,r,a)=>({type:"rect",...Qt(t,e,n,o,r),fill:a}),vn=(t,e,n)=>({type:"rect",...t,fill:n,hole:e}),Ft=(t,e)=>({type:"polygon",points:t,fill:e}),ke=(t,e,n="nonzero")=>({type:"path",d:t,fill:e,fillRule:n}),$s=(...t)=>t.filter(e=>e!==null),Wm=t=>{let{size:e,gap:n,border:o,band:r,color:a,background:i,frame:c,fitLabel:s}=t,l=e+2*(o+n),u=l-2*o,m=e+2*n,f=r+m+r,d=u-2*n,p=c.textColor||vt;return {width:l,height:f,qrX:o+n,qrY:r+n,qrSize:e,shapes:[ct(o,r,u,m,0,i),vn(Qt(0,0,l,f),Qt(o,r,u,m),a)],label:s(t.text,l/2,r/2,r,d,p),extraLabels:$s(s(t.secondaryText,l/2,r+m+r/2,r,d,p,"secondaryText")),squareEdges:!0,color:a}},Vm=t=>{let{size:e,gap:n,border:o,band:r,color:a,background:i,frame:c,fitLabel:s}=t,l=e+2*(o+n),u=l-2*o,m=e*.07,f=Math.max(m-o,0),d=e*.025,p=e*.08,h=r+p+d;return {width:l,height:h+l,qrX:o+n,qrY:h+o+n,qrSize:e,shapes:[ct(0,0,l,r,r/2,a),Ft([[l/2-p,r-p/2],[l/2+p,r-p/2],[l/2,r+p]],a),ct(o,h+o,u,u,f,i),vn(Qt(0,h,l,l,m),Qt(o,h+o,u,u,f),a)],label:s(t.text,l/2,r/2,r,u-2*n,c.textColor||vt),squareEdges:!1,color:a}},Xm=t=>{let{size:e,gap:n,border:o,color:r,background:a,frame:i,fitLabel:c}=t,s=e+2*(o+n),l=s-2*o,u=e*.12,m=e+2*n,f=t.text?e*.2:o,d=o+m+f,p=e*.13,h=d-e*.02;return {width:s,height:d+p,qrX:o+n,qrY:o+n,qrSize:e,shapes:[ct(0,0,s,d,u,r),ke(A`M${s*.13} ${h}L${s*.05} ${d+p}`+A`Q${s*.16} ${d+p*.45} ${s*.32} ${h}Z`,r),ct(o,o,l,m,Math.max(u-o,0),a)],label:c(t.text,s/2,o+m+f/2,f,l-2*n,i.textColor||vt),squareEdges:!1,color:r}};Ym=t=>{let{size:e,gap:n,color:o,background:r,frame:a,fontScale:i}=t,c=e*Math.SQRT1_2+n*.9,s=e*.21,l=c+s,u=c+s/2,m=l,f=a.textColor||vt,d=u*(140*Math.PI/180),p=_=>Math.min(s*.5*i,d/(Ln(_)+.08*_.length)),h=t.text?vr(t.text,m,m,u,p(t.text),"top",f,"text"):[],g=t.secondaryText?vr(t.secondaryText,m,m,u,p(t.secondaryText),"bottom",f,"secondaryText"):[],b=s*.07;return {width:2*l,height:2*l,qrX:m-e/2,qrY:m-e/2,qrSize:e,shapes:[ke(z(m,m,c),r),ke(z(m,m,l)+z(m,m,c),o,"evenodd"),ke(z(m-u,m,b)+z(m+u,m,b),f)],label:null,extraLabels:[...h,...g],squareEdges:!1,color:o}},jm=t=>{let{size:e,gap:n,color:o,background:r,frame:a,fitLabel:i}=t,c=e*.07,s=e+2*n,l=e*.3,u=e*.025,m=s+2*c,f=c+s+l,d=e*.015;return {width:m+u,height:f+u,qrX:c+n,qrY:c+n,qrSize:e,shapes:[ct(u,u,m,f,d,Ut(o,vt,.72)),ct(0,0,m,f,d,o),ct(c,c,s,s,0,r)],label:i(t.text,m/2,c+s+l/2,l*.8,s-2*n,a.textColor||vt),squareEdges:!1,color:o}},Zm=t=>{let{size:e,gap:n,color:o,background:r,frame:a,fitLabel:i}=t,c=e*.05,s=e*.17,l=e*.15,u=t.text?e*.17:0,m=e+2*n,f=n+e+(t.text?n*.5+u:n),d=m+2*c,p=s+f+l,h=e*.036,g=e*.03;return {width:d,height:p,qrX:c+n,qrY:s+n,qrSize:e,shapes:[ct(0,0,d,p,e*.17,o),ct(c,s,m,f,e*.06,r),ct(d/2-e*.11,s/2-h/2,e*.22,h,h/2,r),ct(d/2-e*.15,s+f+l/2-g/2,e*.3,g,g/2,r)],label:i(t.text,d/2,s+n+e+n*.5+u/2,u,m-2*n,a.textColor||o),squareEdges:!1,color:o}},Jm=t=>{let{size:e,gap:n,band:o,color:r,background:a,frame:i,fitLabel:c}=t,s=e*.05,l=e+2*n,u=l+2*s,m=it(s+l+s*1.2),f=m+o,d=it(e*.055),p=e*.04,h=A`M${p} 0H${u-p}A${p} ${p} 0 0 1 ${u} ${p}`+A`V${m-d}A${d} ${d} 0 0 0 ${u} ${m+d}`+A`V${f-p}A${p} ${p} 0 0 1 ${u-p} ${f}`+A`H${p}A${p} ${p} 0 0 1 0 ${f-p}`+A`V${m+d}A${d} ${d} 0 0 0 0 ${m-d}`+A`V${p}A${p} ${p} 0 0 1 ${p} 0Z`,g=[],b=e*.03,_=e*.022,y=e*.012;for(let M=d+_;M+b<=u-d-_/2;M+=b+_)g.push(O(M,m-y/2,b,y));return {width:u,height:f,qrX:s+n,qrY:s+n,qrSize:e,shapes:[ke(h,r),ct(s,s,l,l,e*.02,a),ke(g.join(""),a)],label:c(t.text,u/2,m+o/2,o,l-2*n,i.textColor||vt),squareEdges:!1,color:r}},Km=t=>{let{size:e,gap:n,border:o,band:r,color:a,background:i,frame:c,fitLabel:s}=t,l=e*.18,u=e*.05,m=e+2*(o+n),f=e*.06,d=Math.max(f-o,0),p=m+2*l,h=m-o,g=l*.5,b=h+u,_=g+u*2,y=l*.28,M=Ut(a,"#000000",.28),C=Ut(a,"#000000",.5);return {width:p,height:b+r,qrX:l+o+n,qrY:o+n,qrSize:e,shapes:[Ft([[0,b],[_,b],[_,b+r],[0,b+r],[y,b+r/2]],M),Ft([[p,b],[p-y,b+r/2],[p,b+r],[p-_,b+r],[p-_,b]],M),Ft([[g,h+r],[g+u*1.6,h+r+u],[g,h+r+u]],C),Ft([[p-g,h+r],[p-g,h+r+u],[p-g-u*1.6,h+r+u]],C),ct(l+o,o,m-2*o,m-2*o,d,i),vn(Qt(l,0,m,m,f),Qt(l+o,o,m-2*o,m-2*o,d),a),ct(g,h,p-2*g,r,0,a)],label:s(t.text,p/2,h+r/2,r,p-2*g-2*n,c.textColor||vt),squareEdges:!1,color:a}},t0=t=>{let{size:e,gap:n,band:o,color:r,background:a,frame:i,fitLabel:c}=t,s=e*.08,l=e+2*n,u=l+2*s,m=e*.05,f=m+n+e+n*.6,d=e*.14,p=f+d+o+e*.02,h=m+e*.32,g=e*.012,b=f+d-m;return {width:u,height:p,qrX:s+n,qrY:m+n,qrSize:e,shapes:[ct(0,h,u,p-h,0,Ut(r,vt,.45)),Ft([[0,h],[u/2,0],[u,h]],Ut(r,vt,.25)),ct(s,m,l,b,0,a),vn(Qt(s-g,m-g,l+2*g,b+g),Qt(s,m,l,b),r),Ft([[0,f],[u/2,f+d],[u,f],[u,p],[0,p]],r)],label:c(t.text,u/2,f+d+o/2,o,l-2*n,i.textColor||vt),squareEdges:!1,color:r}},e0=t=>{let{size:e,gap:n,band:o,color:r,background:a,frame:i,fitLabel:c}=t,s=e*.06,l=e+2*n,u=l+2*s,m=e*.24,f=e*.04,d=m*.48,p=e*.14,h=t.text?o:s,g=m+l+h,b=e*.04,_=A`M${p} 0H${u-p}L${u} ${p}`+A`V${g-b}A${b} ${b} 0 0 1 ${u-b} ${g}`+A`H${b}A${b} ${b} 0 0 1 0 ${g-b}V${p}Z`+z(u/2,d,f);return {width:u,height:g,qrX:s+n,qrY:m+n,qrSize:e,shapes:[ke(_,r,"evenodd"),ke(z(u/2,d,f*1.7)+z(u/2,d,f),Ut(r,vt,.35),"evenodd"),ct(s,m,l,l,e*.02,a)],label:c(t.text,u/2,m+l+h/2,h,l-2*n,i.textColor||vt),squareEdges:!1,color:r}},n0=t=>{let{size:e,color:n,background:o,frame:r,fitLabel:a}=t,i=e*.13,c=t.text?e*.26:i,s=t.secondaryText?e*.2:i,l=e+2*i,u=c+e+s,m=e*.03,f=e*.022,d=e*.045,p=e*.008,h=r.textColor||n,g=[ct(0,0,l,u,m,o),vn(Qt(0,0,l,u,m),Qt(f,f,l-2*f,u-2*f,Math.max(m-f,0)),n),vn(Qt(d,d,l-2*d,u-2*d),Qt(d+p,d+p,l-2*(d+p),u-2*(d+p)),n)];if(t.text){let b=c-e*.075,_=e*.022;g.push(ct(l*.3,b-p/2,l*.4,p,0,n),Ft([[l/2,b-_],[l/2+_,b],[l/2,b+_],[l/2-_,b]],n));}return {width:l,height:u,qrX:i,qrY:c,qrSize:e,shapes:g,label:a(t.text,l/2,e*.115,e*.17,l-2*i,h),extraLabels:$s(a(t.secondaryText,l/2,c+e+s*.45,s*.8,l-2*i,h,"secondaryText")),squareEdges:!1,color:n}},r0=t=>{let{size:e,gap:n,color:o,background:r,frame:a,fitLabel:i}=t,c=e*.025,s=e*.07,l=e*.03,u=e*.13,m=t.text?e*.17:0,f=n*1.25,d=e+2*f,p=d+2*s,h=d+2*s+m,g=p+2*c,b=h+2*c;return {width:g+l,height:b+l,qrX:c+s+f,qrY:c+s+f,qrSize:e,shapes:[ct(l,l,g,b,u+c,Ut(o,vt,.7)),ct(0,0,g,b,u+c,vt),ct(c,c,p,h,u,o),ct(c+s,c+s,d,d,e*.04,r)],label:i(t.text,c+p/2,c+s+d+(s+m)/2,s+m,d-2*n,a.textColor||vt),squareEdges:!1,color:o}};a0=t=>{let{size:e,gap:n,background:o,frame:r,fitLabel:a}=t,i=r.color||Zo.from,c=r.secondaryColor||Zo.to,s=e*.05,l=e+2*(s+n),u=t.text?e*.18:0,m=e+(t.text?n+u:2*n),f=m+2*s,d=e*.1;return {width:l,height:f,qrX:s+n,qrY:s+n,qrSize:e,shapes:[ct(s,s,l-2*s,m,d-s,o),...o0(l,f,d,s,i,c)],label:a(t.text,l/2,s+n+e+u/2,u,l-2*s-2*n,r.textColor||Ut(i,c,.5)),squareEdges:!1,color:i}},i0=t=>{let{size:e,gap:n,color:o,background:r,frame:a,fitLabel:i}=t,c=e*.035,s=e*.2,l=e+2*(n+c),u=t.text?e*.2:0,m=l,f=m+u,d=(p,h,g,b)=>[[p,h],[p+g*s,h],[p+g*s,h+b*c],[p+g*c,h+b*c],[p+g*c,h+b*s],[p,h+b*s]];return {width:l,height:f,qrX:c+n,qrY:c+n,qrSize:e,shapes:[ct(0,0,l,f,0,r),Ft(d(0,0,1,1),o),Ft(d(m,0,-1,1),o),Ft(d(m,m,-1,-1),o),Ft(d(0,m,1,-1),o)],label:i(t.text,l/2,m+u*.4,u,l-2*n,a.textColor||o),squareEdges:!1,color:o}},xs={"banner-top-bottom":Wm,"speech-bubble-top":Vm,"chat-bubble":Xm,circle:Ym,polaroid:jm,phone:Zm,ticket:Jm,badge:Km,envelope:t0,tag:e0,"menu-card":n0,sticker:r0,"gradient-border":a0,focus:i0};});function wt(t,e="#000000"){return t?typeof t=="string"?t:t.type==="solid"?t.color:t.type==="image"?t.underlay||e:(t.type==="linear"||t.type==="radial"||t.type==="angular")&&t.stops[0]?.color||e:e}var ge=q(()=>{"use strict";});function Jo(t){if(t&&typeof t=="object"){let n=Ss.get(t);if(n)return n}if(t==null)throw new Xn(['A "custom" frame needs a spec']);let e=Xe.safeParse(t);if(!e.success)throw new Xn(e.error.issues.map(n=>n.path.length>0?`${n.path.join(".")}: ${n.message}`:n.message));return typeof t=="object"&&Ss.set(t,e.data),e.data}function Ko(t){let e=Jo(t);return Cn(e)/e.qr.size}function s0(t){let e=wt(t,_t),n=mt(e);return n&&n.a>=1?e:_t}function c0(t,e,n){let o=t.color||e.colors.frame,r=t.textColor||e.colors.text||o,a=t.secondaryColor||e.colors.accent||o,i=c=>{switch(c){case "frame":return o;case "text":return r;case "accent":return a;case "background":return n;default:return c}};return c=>typeof c=="string"?i(c):Ut(i(c.mix[0]),i(c.mix[1]),c.amount)}function Ms(t,e,n=0,o=0){let r=pr(t);return r?Ki(r,e,n,o):""}function l0(t,e,n,o){return `M${$(t-n)} ${$(e)}A${$(n)} ${$(o)} 0 1 1 ${$(t+n)} ${$(e)}A${$(n)} ${$(o)} 0 1 1 ${$(t-n)} ${$(e)}Z`}function u0(t,e){let[n,o,r,a]=[t.x1*e,t.y1*e,t.x2*e,t.y2*e],i=Math.hypot(r-n,a-o),c=t.width*e/2,s=i>0?(r-n)/i:1,l=i>0?(a-o)/i:0,u=-l*c,m=s*c,f=(g,b)=>{let _=[n+s*g,o+l*g],y=[n+s*b,o+l*b];if(t.cap==="round"&&b-g>2*c){let M=[_[0]+s*c,_[1]+l*c],C=[y[0]-s*c,y[1]-l*c];return `M${$(M[0]-u)} ${$(M[1]-m)}L${$(C[0]-u)} ${$(C[1]-m)}A${$(c)} ${$(c)} 0 0 1 ${$(C[0]+u)} ${$(C[1]+m)}L${$(M[0]+u)} ${$(M[1]+m)}A${$(c)} ${$(c)} 0 0 1 ${$(M[0]-u)} ${$(M[1]-m)}Z`}return `M${$(_[0]-u)} ${$(_[1]-m)}L${$(y[0]-u)} ${$(y[1]-m)}L${$(y[0]+u)} ${$(y[1]+m)}L${$(_[0]+u)} ${$(_[1]+m)}Z`};if(!t.dash)return {type:"path",d:f(0,i),fillRule:"nonzero"};let d=t.dash[0]*e,p=d+t.dash[1]*e,h=[];for(let g=0;g+d<=i+1e-6;g+=p)h.push(f(g,g+d));return {type:"path",d:h.join(""),fillRule:"nonzero"}}function m0(t,e){switch(t.type){case "rect":return {type:"rect",x:t.x*e,y:t.y*e,width:t.width*e,height:t.height*e,radius:(t.radius??0)*e,...t.hole&&{hole:{x:t.hole.x*e,y:t.hole.y*e,width:t.hole.width*e,height:t.hole.height*e,radius:(t.hole.radius??0)*e}}};case "circle":return {type:"path",d:z(t.cx*e,t.cy*e,t.r*e)+(t.hole?z(t.cx*e,t.cy*e,t.hole*e):""),fillRule:t.hole?"evenodd":"nonzero"};case "ellipse":return {type:"path",d:l0(t.cx*e,t.cy*e,t.rx*e,t.ry*e),fillRule:"nonzero"};case "polygon":return {type:"polygon",points:t.points.map(([n,o])=>[n*e,o*e])};case "path":return {type:"path",d:Ms(t.d,e),fillRule:t.fillRule??"nonzero"};case "line":return u0(t,e);default:{let n=Xo(t.icon);return {type:"path",d:Ms(n.d,t.size*e/Vo,t.x*e,t.y*e),fillRule:n.fillRule}}}}function d0(t){if(t.type==="rect"){let{x:e,y:n,width:o,height:r,radius:a,hole:i}=t;return [...oe(e,n,o,r,a,a),...i?oe(i.x,i.y,i.width,i.height,i.radius,i.radius):[]]}return t.type==="polygon"?[...t.points.map(([e,n],o)=>o===0?{op:"M",x:e,y:n}:{op:"L",x:e,y:n}),{op:"Z"}]:fe(t.d)}function f0(t,e,n){let o=d0(t),r=gr(o,.2),a=t.type==="rect"?t.hole?"evenodd":"nonzero":t.type==="path"?t.fillRule??"nonzero":"nonzero",i=e.direction==="vertical",c=g=>i?g[1]:g[0],s=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY;for(let g of r)for(let b of g)s=Math.min(s,c(b)),l=Math.max(l,c(b));if(!(l>s))return [];let u=e.steps??32,m=n(e.from),f=n(e.to),d=l-s,p=d*.002,h=[];for(let g=0;g<u;g++){let b=s+d*g/u,_=Math.min(l,s+d*(g+1)/u+(g+1<u?p:0)),y=i?{x0:Number.NEGATIVE_INFINITY,x1:Number.POSITIVE_INFINITY,y0:b,y1:_}:{x0:b,x1:_,y0:Number.NEGATIVE_INFINITY,y1:Number.POSITIVE_INFINITY},M=r.map(C=>br(C,y)).filter(C=>C.length>2);M.length!==0&&h.push({type:"path",d:es(M),fill:Ut(m,f,(g+.5)/u),fillRule:a});}return h}function h0(t,e,n){let o=m0(t,e);return typeof t.fill=="object"&&"gradient"in t.fill?f0(o,t.fill.gradient,n):[{...o,fill:n(t.fill)}]}function p0(t,e){let n=Math.min(t.maxLength??st.maxTextLength,st.maxTextLength),o=t.slot==="primary"?e.text??t.text:t.slot==="secondary"?e.secondaryText??t.text:t.text;return Er(o,n)}function g0(t){return t===void 0||!Number.isFinite(t)?1:Math.min(ve,Math.max($n,t))}function b0(t,e,n,o){let r=p0(t,e);if(!r)return [];let a=g0(e.fontScale),i=o(t.color),c=t.weight==="regular"?{fontWeight:400}:{};if(t.type==="curved"){let{cx:h,cy:g,radius:b,side:_,spread:y=140}=t.curve,M=b*n*(y*Math.PI/180),C=Math.min(t.fontSize*n*a,M/(Ln(r)+.08*r.length));return vr(r,h*n,g*n,b*n,C,_,i,t.id).map(x=>({...x,...c}))}let s=t.box.x*n,l=t.box.y*n,u=t.box.width*n,m=t.box.height*n,f=(t.fontSize??t.box.height*.52)*n,d=Math.min(f*a,m*wr,u/Ln(r)),p=t.align??"middle";return [{text:r,x:p==="start"?s:p==="end"?s+u:s+u/2,y:l+m/2+d*.35,fontSize:d,maxWidth:u,color:i,...p!=="middle"&&{align:p},...c,field:t.id}]}function ta(t,e,n){let o=Jo(e.spec),r=t/o.qr.size,a=s0(n),i=c0(e,o,a),c=o.shapes.flatMap(d=>h0(d,r,i)),s=Cn(o)*r;c.push({type:"rect",x:o.qr.x*r-s,y:o.qr.y*r-s,width:t+2*s,height:t+2*s,radius:(o.qr.radius??0)*r,fill:a});let l=o.labels.flatMap(d=>b0(d,e,r,i)),u=l[0],m=u&&u.rotate===void 0?u:null,f=o.bleed??"none";return {width:o.artboard.width*r,height:o.artboard.height*r,qrX:o.qr.x*r,qrY:o.qr.y*r,qrSize:t,shapes:c,label:m,extraLabels:m?l.slice(1):l,squareEdges:f!=="none",color:i(f==="none"?"frame":f)}}var Xn,Ss,ea=q(()=>{"use strict";zn();wn();At();Yo();Lr();ae();ge();ht();Dt();Do();_r();he();Xn=class extends Error{issues;constructor(e){super(`Invalid frame spec: ${e.slice(0,5).join("; ")}`),this.name="FrameSpecError",this.issues=e;}},Ss=new WeakMap;});function qt(t){return !!(t?.style&&t.style!=="none")}function oa(t){return t.style===Hn?Ko(t.spec):ra}function Rs(t){return (t.text??No).trim().slice(0,ee)}function Ps(t){return (t.secondaryText??"").trim().slice(0,ee)}function $0(t){return t===void 0||!Number.isFinite(t)?1:Math.min(ve,Math.max($n,t))}function x0(t,e,n,o,r,a,i,c){if(!t)return null;let s=Math.min(o*.52*i,r/Ln(t));return {text:t,x:e,y:n+s*.35,fontSize:s,maxWidth:r,color:a,field:c}}function je(t,e,n){if(e.style===Hn)return ta(t,e,n);let o=e.color||y0,r=wt(n,_t),a=Rs(e),i=t*ra,c=t*.04,s=t*.22,l=t+2*(c+i),u=l-2*c,m=u-2*i,f=c+i,d=$0(e.fontScale),p=(h,g,b,_,y,M,C="text")=>x0(h,g,b,_,y,M,d,C);if(_s(e.style))return xs[e.style]({size:t,frame:e,color:o,background:r,text:a,secondaryText:Ps(e),gap:i,border:c,band:s,fontScale:d,fitLabel:p});switch(e.style){case "banner-top":{let h=t+2*i;return {width:l,height:s+h+c,qrX:f,qrY:s+i,qrSize:t,shapes:[Yn(c,s,u,h,0,r),Ir(be(0,0,l,s+h+c,0),be(c,s,u,h,0),o)],label:p(a,l/2,s/2,s,m,e.textColor||na),squareEdges:true,color:o}}case "border":case "rounded-border":{let h=a?t*.18:0,g=t+(a?i+h:2*i),b=g+2*c,_=e.style==="rounded-border"?t*.1:0,y=Math.max(_-c,0);return {width:l,height:b,qrX:f,qrY:c+i,qrSize:t,shapes:[Yn(c,c,u,g,y,r),Ir(be(0,0,l,b,_),be(c,c,u,g,y),o)],label:p(a,l/2,c+i+t+h/2,h,m,e.textColor||o),squareEdges:_===0,color:o}}case "speech-bubble":{let h=t*.07,g=Math.max(h-c,0),b=t*.025,_=t*.08,y=l+b+_;return {width:l,height:y+s,qrX:f,qrY:c+i,qrSize:t,shapes:[Yn(c,c,u,u,g,r),Ir(be(0,0,l,l,h),be(c,c,u,u,g),o),{type:"polygon",points:[[l/2-_,y+_/2],[l/2,l+b],[l/2+_,y+_/2]],fill:o},Yn(0,y,l,s,s/2,o)],label:p(a,l/2,y+s/2,s,m,e.textColor||na),squareEdges:false,color:o}}default:{let h=t+2*i;return {width:l,height:c+h+s,qrX:f,qrY:c+i,qrSize:t,shapes:[Yn(c,c,u,h,0,r),Ir(be(0,0,l,c+h+s,0),be(c,c,u,h,0),o)],label:p(a,l/2,c+h+s/2,s,m,e.textColor||na),squareEdges:true,color:o}}}}function be(t,e,n,o,r){return {x:t,y:e,width:n,height:o,radius:r}}function Yn(t,e,n,o,r,a){return {type:"rect",...be(t,e,n,o,r),fill:a}}function Ir(t,e,n){return {type:"rect",...t,fill:n,hole:e}}function _e(t,e){if(!qt(e))return {width:t,height:t};let{width:n,height:o}=je(t,e);return {width:n,height:o}}function Cs({x:t,y:e,width:n,height:o,radius:r}){let a=nt(Math.min(r,n/2,o/2)),[i,c,s,l]=[nt(t),nt(e),nt(n),nt(o)];return a<=0?A`M${i} ${c}h${s}v${l}h${-s}z`:A`M${i+a} ${c}h${nt(s-2*a)}a${a} ${a} 0 0 1 ${a} ${a}`+A`v${nt(l-2*a)}a${a} ${a} 0 0 1 ${-a} ${a}`+A`h${nt(-(s-2*a))}a${a} ${a} 0 0 1 ${-a} ${-a}`+A`v${nt(-(l-2*a))}a${a} ${a} 0 0 1 ${a} ${-a}z`}function S0(t,e){return t.type==="rect"&&t.hole?jsx("path",{d:Cs(t)+Cs(t.hole),fill:t.fill,fillRule:"evenodd"},e):t.type==="polygon"?jsx("polygon",{fill:t.fill,points:t.points.map(([n,o])=>`${nt(n)},${nt(o)}`).join(" ")},e):t.type==="path"?jsx("path",{d:t.d,fill:t.fill,...t.fillRule==="evenodd"&&{fillRule:"evenodd"}},e):jsx("rect",{fill:t.fill,height:nt(t.height),width:nt(t.width),x:nt(t.x),y:nt(t.y),...t.radius>0&&{rx:nt(t.radius),ry:nt(t.radius)}},e)}function Fr(t,e){let{size:n,frame:o,bgColor:r,svgProps:a,markLabels:i}=e,c=je(n,o,r),s=As(c),l=nt(c.width),u=nt(c.height);return jsxs("svg",{height:u,viewBox:`0 0 ${l} ${u}`,width:l,xmlns:"http://www.w3.org/2000/svg",...a,children:[jsx("g",{"data-qrdx-frame":o.style,children:c.shapes.map((m,f)=>S0(m,f))}),_0.cloneElement(t,{x:nt(c.qrX),y:nt(c.qrY),width:n,height:n}),s.map((m,f)=>jsx("text",{"data-max-width":nt(m.maxWidth),fill:m.color,fontFamily:ws,fontSize:nt(m.fontSize),fontWeight:m.fontWeight??700,textAnchor:m.align??"middle",x:nt(m.x),y:nt(m.y),...m.rotate&&{transform:`rotate(${nt(m.rotate)} ${nt(m.x)} ${nt(m.y)})`},...i&&m.field&&{[Es]:m.field},children:m.text},f))]})}function As(t){return [...t.label?[t.label]:[],...t.extraLabels??[]]}var ws,ra,y0,na,Es,nt,ye=q(()=>{"use strict";zn();wn();At();ea();Lr();ge();ht();ws="system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif",ra=.08,y0="#000000",na="#FFFFFF",Es="data-qrdx-frame-label";nt=t=>it(t,2);});var Jn,Gs,Zn,Qs,xe,Bs,Us,ua,Nr=q(()=>{"use strict";Jn=["logo","halftone"],Gs=z$1.enum(Jn),Zn={logo:["blend","badge"],halftone:["color","mono"]},Qs=z$1.enum([...Zn.logo,...Zn.halftone]),xe=192,Bs=t=>Math.ceil(t/3)*4,Us=z$1.object({width:z$1.number().int().min(1).max(xe),height:z$1.number().int().min(1).max(xe),data:z$1.string().max(Bs(xe*xe*4))}).refine(t=>t.data.length===Bs(t.width*t.height*4),{message:"Art image data does not match its width and height"}),ua=z$1.object({mode:Gs,image:Us,intensity:z$1.number().min(0).max(1).optional(),variant:Qs.optional(),matchEyes:z$1.boolean().optional()});});function Ht(t,e="#000000"){return t?typeof t=="string"?{type:"solid",color:t}:t:{type:"solid",color:e}}function Fn(t){return !t||typeof t=="string"?false:t.type==="linear"||t.type==="radial"||t.type==="angular"}function ma(t){return typeof t=="object"&&t!==null&&t.type==="image"}function L0(t,e="#000000"){let n=Ht(t,e);return n.type==="solid"?n.color:n.type==="image"?n.underlay||e:n.stops[0]?.color||e}function js(t="center"){let[e,n]=t.split("-");return t==="center"?"center":n?`${n} ${e}`:e==="top"||e==="bottom"?`center ${e}`:`${e} center`}function I0(t){if(!t)return "#000000";if(typeof t=="string")return t;let e=Ht(t);if(e.type==="solid")return e.color;if(e.type==="image"){let r=e.fit==="tile"?`${25*(e.scale??1)}% auto`:(e.scale??1)===1?e.fit==="contain"?"contain":"cover":`${100*(e.scale??1)}% auto`,a=e.fit==="tile"?"repeat":"no-repeat";return `${`url("${e.src.replace(/"/g,"%22")}")`} ${js(e.position)} / ${r} ${a}, ${e.underlay??"transparent"}`}let o=[...e.stops].sort((r,a)=>r.offset-a.offset).map(r=>`${r.color} ${r.offset}%`).join(", ");return e.type==="linear"?`linear-gradient(${(e.angle??0)+90}deg, ${o})`:e.type==="angular"?`conic-gradient(from ${e.angle??0}deg, ${o})`:`radial-gradient(circle, ${o})`}var v0,qs,Or,zs,Hs,Ws,Vs,Xs,Ys,Ne,Tn=q(()=>{"use strict";v0=z$1.enum(["solid","linear","radial","angular","image"]),qs=z$1.object({type:z$1.literal("solid"),color:z$1.string()}),Or=z$1.object({color:z$1.string(),offset:z$1.number().min(0).max(100)}),zs=z$1.object({type:z$1.literal("linear"),stops:z$1.array(Or).min(2),angle:z$1.number().optional().default(0)}),Hs=z$1.object({type:z$1.literal("radial"),stops:z$1.array(Or).min(2)}),Ws=z$1.object({type:z$1.literal("angular"),stops:z$1.array(Or).min(2),angle:z$1.number().optional().default(0)}),Vs=z$1.enum(["cover","contain","tile"]),Xs=z$1.enum(["top-left","top","top-right","left","center","right","bottom-left","bottom","bottom-right"]),Ys=z$1.object({type:z$1.literal("image"),src:z$1.string().min(1),fit:Vs.optional().default("cover"),scale:z$1.number().min(.1).max(4).optional().default(1),position:Xs.optional().default("center"),opacity:z$1.number().min(0).max(1).optional().default(1),underlay:z$1.string().optional()}),Ne=z$1.union([z$1.string(),qs,zs,Hs,Ws,Ys]);});var da,Js,fa,T0,ha=q(()=>{"use strict";da=["square","rounded","circle","message","message-reverse","diya","diya-reverse","rounded-triangle","leaf","drop","plus","cross-rounded","hexagon","octagon","flower","heart","squircle","dots","extra-rounded","leaf-reverse","drop-reverse"],Js=["diamond","star","banner"],fa=z$1.enum([...da,...Js]),T0=z$1.enum(da);});var pa,tc,ga,k0,ba=q(()=>{"use strict";pa=["square","rounded","gear","circle","diya","extra-rounded","message","pointy","leaf","drop","octagon","bevel","squircle","cushion","shield","petal","leaf-reverse"],tc=["curly"],ga=z$1.enum([...pa,...tc]),k0=z$1.enum(pa);});var ec,_a,ya=q(()=>{"use strict";ec=["circle","circle-large","square","diamond","circle-mixed","pacman","rounded","small-square","vertical-line","horizontal-line","liquid","liquid-horizontal","liquid-vertical","classy","classy-rounded","leaf","plus","hexagon","star","heart","random-dots","mosaic","octagon"],_a=z$1.enum(ec);});var nc,$a,rc,oc,Br,xa,ac,O0,ic,tr,Gr,Sa,sc,cc,Ma,Vt,ie,Ca,lc,uc,Qr,Dr,mc,D0,Se=q(()=>{"use strict";Nr();Tn();ha();ba();wn();ya();nc=["square","rounded","circle"],$a=z$1.enum(nc),rc=z$1.object({src:z$1.string(),height:z$1.number(),width:z$1.number(),excavate:z$1.boolean(),x:z$1.number().optional(),y:z$1.number().optional(),padding:z$1.number().min(0).optional(),shape:$a.optional(),plate:z$1.string().optional()}),oc=.1,Br=.3,xa=.25,ac=2,O0=z$1.object({size:z$1.number().min(oc).max(Br).optional(),padding:z$1.number().min(0).max(ac).optional(),x:z$1.number().min(0).max(1).optional(),y:z$1.number().min(0).max(1).optional(),shape:$a.optional(),plate:z$1.string().optional()}),ic=z$1.enum(["L","M","Q","H"]),tr=.5,Gr=1,Sa=.07,sc=["square","circle","heart"],cc=z$1.enum(sc),Ma=3,Vt=64,ie=8,Ca=.42,lc=z$1.object({type:z$1.literal("silhouette"),width:z$1.number().int().min(ie).max(Vt),height:z$1.number().int().min(ie).max(Vt),cells:z$1.string().max(Vt*Vt).regex(/^[01]*$/).describe('Row by row, "1" inside the shape and "0" outside: width \xD7 height characters')}).refine(t=>t.cells.length===t.width*t.height,{message:"Silhouette cells do not match its width and height"}),uc=z$1.union([cc,lc]),Qr=["topLeft","topRight","bottomLeft"],Dr=z$1.object({outer:Ne.optional(),inner:Ne.optional()}),mc=z$1.object({topLeft:Dr.optional(),topRight:Dr.optional(),bottomLeft:Dr.optional()}),D0=z$1.object({value:z$1.string(),size:z$1.number().optional(),level:ic.optional(),bgColor:Ne.optional(),fgColor:Ne.optional(),eyeColor:Ne.optional(),dotColor:Ne.optional(),bodyPattern:_a.optional(),cornerEyePattern:ga.optional(),cornerEyeDotPattern:fa.optional(),margin:z$1.number().optional(),imageSettings:rc.optional(),isOGContext:z$1.boolean().optional(),templateId:z$1.string().optional(),customProps:z$1.record(z$1.string(),z$1.any()).optional(),frame:Wo.optional(),art:ua.optional(),eyeColors:mc.optional(),moduleScale:z$1.number().min(tr).max(Gr).optional(),autoLevel:z$1.boolean().optional(),shape:uc.optional()});});function dc(t,e,n={}){if(t==="circle")return jsx("circle",{cx:$(e.x+e.w/2),cy:$(e.y+e.h/2),r:$(Math.min(e.w,e.h)/2),...n});let o=t==="rounded"?Math.min(e.w,e.h)*qr:0;return jsx("rect",{height:$(e.h),width:$(e.w),x:$(e.x),y:$(e.y),...o>0&&{rx:$(o),ry:$(o)},...n})}function U0(t,e){let n=t.w*e,o=t.h*e;return {x:t.x+n,y:t.y+o,w:t.w-2*n,h:t.h-2*o}}function Hr(t,e){let n=t.shape??"square",o=t.plate,r=o?U0(e,zr):e,a=c=>jsx("image",{height:$(r.h),href:t.src,preserveAspectRatio:"none",width:$(r.w),x:$(r.x),y:$(r.y),...c&&{clipPath:`url(#${c})`}});if(n==="square"&&!o)return a();let i=n==="square"?void 0:`qrdx-logo-${Ye(`${n}|${$(r.x)}|${$(r.y)}|${$(r.w)}|${$(r.h)}`)}`;return jsxs("g",{children:[o&&dc(n,e,{fill:o}),i&&jsx("clipPath",{id:i,children:dc(n,r)}),a(i)]})}var qr,zr,Wr=q(()=>{"use strict";ae();ht();qr=.22,zr=.14;});function H0(t){let e=t*4+17,n=new Uint8Array(e*e),o=(i,c)=>{i>=0&&c>=0&&i<e&&c<e&&(n[c*e+i]=1);};for(let i=0;i<e;i++)o(6,i),o(i,6);for(let[i,c]of [[3,3],[e-4,3],[3,e-4]])for(let s=-4;s<=4;s++)for(let l=-4;l<=4;l++)o(i+l,c+s);let r=[];if(t>1){let i=Math.floor(t/7)+2,c=t===32?26:Math.ceil((t*4+4)/(i*2-2))*2;r.push(6);for(let s=e-7;r.length<i;s-=c)r.splice(1,0,s);}let a=r.length-1;for(let[i,c]of r.entries())for(let[s,l]of r.entries())if(!(i===0&&s===0||i===0&&s===a||i===a&&s===0))for(let u=-2;u<=2;u++)for(let m=-2;m<=2;m++)o(c+m,l+u);for(let i=0;i<=8;i++)o(8,i),o(i,8);for(let i=0;i<8;i++)o(e-1-i,8),o(8,e-1-i);if(t>=7)for(let i=0;i<18;i++){let c=e-11+i%3,s=Math.floor(i/3);o(c,s),o(s,c);}return n}function W0(t,e){let n=t*4+17,o=Lt[e].ordinal,r=wa.NUM_ERROR_CORRECTION_BLOCKS[o]?.[t]??0,a=wa.ECC_CODEWORDS_PER_BLOCK[o]?.[t]??0,i=Math.floor(wa.getNumRawDataModules(t)/8),c=r-i%r,s=Math.floor(i/r),l=Array.from({length:r},(M,C)=>s+(C<c?0:1)),u=[],m=[],f=s-a;for(let M=0;M<=s;M++)for(let C=0;C<r;C++)if(C<c){if(M===f)continue;u.push(C),m.push(M<f?M:M-1);}else u.push(C),m.push(M);if(u.length!==i)throw new Error(`Codeword map: interleave mismatch at version ${t}`);let d=H0(t),p=new Int16Array(n*n).fill(-1),h=new Int16Array(n*n).fill(-1),g=new Int8Array(n*n).fill(-1),b=i*8,_=0;for(let M=n-1;M>=1;M-=2){M===6&&(M=5);let C=(M+1&2)===0;for(let x=0;x<n;x++)for(let S=0;S<2;S++){let w=M-S,P=(C?n-1-x:x)*n+w;if(!d[P]&&_<b){let R=_>>>3;p[P]=u[R],h[P]=m[R],g[P]=7-(_&7),_++;}}}if(_!==b)throw new Error(`Codeword map: placement mismatch at version ${t}`);let y=z0[`${t}${e}`]??0;return {version:t,level:e,size:n,blocks:r,eccPerBlock:a,blockLengths:l,correctable:Math.floor((a-y)/2),block:p,codeword:h,bit:g}}function er(t,e){if(!(Number.isInteger(t)&&t>=1&&t<=40))throw new RangeError(`QR version must be 1\u201340, got ${t}`);let n=`${t}${e}`,o=Je.get(n);if(o)return Je.delete(n),Je.set(n,o),o;let r=W0(t,e);if(Je.size>=V0){let a=Je.keys().next().value;a!==void 0&&Je.delete(a);}return Je.set(n,r),r}function nr(t,e){let n=new Array(t.blocks).fill(0),o=new Set;for(let r of e){let a=t.block[r]??-1;if(a<0)continue;let i=a*4096+t.codeword[r];o.has(i)||(o.add(i),n[a]=n[a]+1);}return n}var wa,z0,V0,Je,Vr=q(()=>{"use strict";de();At();(({QrCode:wa}=Mt)),z0={"1L":3,"1M":2,"1Q":1,"1H":1,"2L":2,"3L":1};V0=8,Je=new Map;});function fc(t){let e=[t.start],n=t.start;for(let o of t.segments){let r=o.at(-1);if(o.length===1)e.push(r);else {let a=X0[o.length];for(let i=1;i<=a;i++){let c=i/a,s=1-c;if(o.length===2){let[l]=o;e.push([s*s*n[0]+2*s*c*l[0]+c*c*r[0],s*s*n[1]+2*s*c*l[1]+c*c*r[1]]);}else {let[l,u]=o;e.push([s*s*s*n[0]+3*s*s*c*l[0]+3*s*c*c*u[0]+c*c*c*r[0],s*s*s*n[1]+3*s*s*c*l[1]+3*s*c*c*u[1]+c*c*c*r[1]]);}}}n=r;}return e}function pc(t,e){let n=[];for(let o of t)for(let r=0;r<o.length;r++){let[a,i]=o[r],[c,s]=o[(r+1)%o.length];i<=e!=s<=e&&n.push(a+(e-i)/(s-i)*(c-a));}return n.sort((o,r)=>o-r)}function gc(t,e){let n=0;for(let o of t)if(o<e)n++;else break;return n%2===1}function Y0(t,e,n){return gc(pc(t,n),e)}function bc(t){let e=new Map;return (n,o)=>{let r=e.get(o);return r||(r=pc(t,o),e.set(o,r)),gc(r,n)}}function j0(t,e,n,o){let r=n[0]-t,a=n[1]-e,i=o[0]-n[0],c=o[1]-n[1],s=u=>Math.max(Math.abs(r+u*i),Math.abs(a+u*c)),l=Math.min(s(0),s(1));for(let[u,m]of [[a-r,i-c],[-(r+a),i+c]])if(m!==0){let f=u/m;f>0&&f<1&&(l=Math.min(l,s(f)));}return l}function Z0(t,e,n){if(!Y0(t,e,n))return 0;let o=Number.POSITIVE_INFINITY;for(let r of t)for(let a=0;a<r.length;a++)o=Math.min(o,j0(e,n,r[a],r[(a+1)%r.length]));return Number.isFinite(o)?o:0}function J0(t){let e=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,r=Number.NEGATIVE_INFINITY;for(let a of t)for(let[i,c]of a)e=Math.min(e,i),n=Math.min(n,c),o=Math.max(o,i),r=Math.max(r,c);return {x0:e,y0:n,x1:o,y1:r}}function _c(t){let e=t.map(fc),n=J0(e),o=n.x1-n.x0,r=n.y1-n.y0;if(!(o>0&&r>0))return null;let a=(p,h)=>{let g=Math.max(p-n.x0,n.x1-p,h-n.y0,n.y1-h);return g>0?Z0(e,p,h)/(2*g):0},i={cx:n.x0+o/2,cy:n.y0+r/2,value:0};i.value=a(i.cx,i.cy);let c=32;for(let p=1;p<c;p++)for(let h=1;h<c;h++){let g=n.x0+o*h/c,b=n.y0+r*p/c,_=a(g,b);_>i.value&&(i={cx:g,cy:b,value:_});}let s=o/c,l=r/c;for(let p=0;p<6;p++){let h=i;for(let g=-2;g<=2;g++)for(let b=-2;b<=2;b++){let _=h.cx+s*b/2,y=h.cy+l*g/2,M=a(_,y);M>i.value&&(i={cx:_,cy:y,value:M});}s/=2,l/=2;}if(i.value<=0)return null;let m=.5/Math.max(i.cx-n.x0,n.x1-i.cx,i.cy-n.y0,n.y1-i.cy),f=([p,h])=>[.5+(p-i.cx)*m,.5+(h-i.cy)*m],d=t.map(p=>({start:f(p.start),segments:p.segments.map(h=>h.map(f))}));return {rings:d,polygons:d.map(fc),half:i.value}}function yc(t,e){let n=([r,a])=>`${$(r*e)} ${$(a*e)}`,o="";for(let r of t.rings){o+=`M${n(r.start)}`;for(let a of r.segments){let i=a.length===1?"L":a.length===2?"Q":"C";o+=i+a.map(n).join(" ");}o+="Z";}return o}function $c(){return hc??=_c([K0]),hc}function t1(t){let{width:e,height:n,cells:o}=t;return Number.isInteger(e)&&Number.isInteger(n)&&e>=ie&&n>=ie&&e<=Vt&&n<=Vt&&typeof o=="string"&&o.length===e*n&&/^[01]*$/.test(o)?(r,a)=>r>=0&&a>=0&&r<e&&a<n&&o[a*e+r]==="1":null}function e1(t,e,n){let o=(s,l)=>t(s-1,l-1),r=new Map,a=(s,l)=>{for(let[u,m]of [[s,l],[l,s]]){let f=r.get(Me(u))??[];f.push(m),r.set(Me(u),f);}};for(let s=0;s<=n;s++)for(let l=0;l<=e;l++){let u=o(l,s),m=o(l+1,s),f=o(l+1,s+1),d=o(l,s+1),p=[l,s-.5],h=[l+.5,s],g=[l,s+.5],b=[l-.5,s];switch((u?8:0)+(m?4:0)+(f?2:0)+(d?1:0)){case 1:case 14:a(b,g);break;case 2:case 13:a(g,h);break;case 3:case 12:a(b,h);break;case 4:case 11:a(p,h);break;case 6:case 9:a(p,g);break;case 7:case 8:a(b,p);break;case 5:a(p,h),a(b,g);break;case 10:a(b,p),a(g,h);break;}}let i=[],c=new Set;for(let[s,l]of r){if(c.has(s)||l.length===0)continue;let[u,m]=s.split(",").map(Number),f=[[u,m]];c.add(s);let d=[u,m],p=l[0];for(;!c.has(Me(p));){c.add(Me(p)),f.push(p);let h=n1(r.get(Me(p))??[],d,c);if(!h)break;d=p,p=h;}f.length>=3&&i.push(r1(f));}return i}function n1(t,e,n){let o=Me(e);return t.find(r=>Me(r)!==o&&!n.has(Me(r)))??t.find(r=>Me(r)!==o)}function r1(t){let e=[];for(let n=0;n<t.length;n++){let o=t[(n-1+t.length)%t.length],r=t[n],a=t[(n+1)%t.length],i=(r[0]-o[0])*(a[1]-r[1])-(r[1]-o[1])*(a[0]-r[0]);Math.abs(i)>1e-9&&e.push(r);}return e.length>=3?e:t}function o1(t){let e=(a,i)=>[(a[0]+i[0])/2,(a[1]+i[1])/2],n=t.length,o=e(t[n-1],t[0]),r=t.map((a,i)=>[a,e(a,t[(i+1)%n])]);return {start:o,segments:r}}function Ea(t){let e=`${t.width}x${t.height}:${t.cells}`,n=rr.get(e);if(n)return n;let o=t1(t),r;if(!o)r={outline:null,problem:"invalid"};else if(t.cells.includes("1")){let a=e1(o,t.width,t.height),i=a.length>0?_c(a.map(o1)):null;r=i&&2*i.half>=Ca?{outline:i,problem:null}:{outline:null,problem:i?"thin":"empty"};}else r={outline:null,problem:"empty"};return rr.size>16&&rr.delete(rr.keys().next().value),rr.set(e,r),r}var X0,K0,hc,Me,rr,xc=q(()=>{"use strict";Se();ht();X0={2:6,3:12};K0={start:[0,-.58],segments:[[[.2,-.92],[1,-.97],[1,-.3]],[[1,.3],[.62,.6],[0,.92]],[[-.62,.6],[-1,.3],[-1,-.3]],[[-1,-.97],[-.2,-.92],[0,-.58]]]};Me=([t,e])=>`${t},${e}`;rr=new Map;});function Ke(t){return Math.max(t,Ma)}function Xr(t){return t==="heart"?$c():typeof t=="object"&&t?.type==="silhouette"?Ea(t).outline:null}function Ra(t){return t==="circle"||Xr(t)!==null}function c1(t){let{outline:e,problem:n}=Ea(t);if(e&&!n)return {ok:true,share:2*e.half};let o=n??"invalid";return {ok:false,reason:o,message:s1[o]}}function Tt(t,e,n){if(n==="circle"){let i=Ke(e),c=(t/2+i)*Math.SQRT2+a1;return Math.ceil(c-t/2)}let o=Xr(n);if(!o)return e;let r=Ke(e),a=(t+2*(r+i1))/(2*o.half);return Math.ceil((a-t)/2-1e-9)}function Cc(t){let e=t>>>0;return ()=>{e=e+1831565813>>>0;let n=e;return n=Math.imul(n^n>>>15,n|1),n^=n+Math.imul(n^n>>>7,n|61),((n^n>>>14)>>>0)/4294967296}}function l1(t,e,n){let o=Tt(e,n,"circle"),r=Ke(n),a=e+2*o,i=a/2,c=i-Sc-.5,s=Cc(Number.parseInt(Ye(t),36)||1),l=o-r,u=o+e+r;return Array.from({length:a},(m,f)=>Array.from({length:a},(d,p)=>{let h=s()<Mc;return p>=l&&p<u&&f>=l&&f<u?false:h&&Math.hypot(p+.5-i,f+.5-i)<=c}))}function wc(t,e,n,o){if(o==="circle")return l1(t,e,n);let r=Xr(o);if(!r)return null;let a=Tt(e,n,o),i=Ke(n),c=e+2*a,s=bc(r.polygons),l=.5+Sc,u=(p,h)=>{let g=p+.5,b=h+.5;return s(g/c,b/c)?u1.every(([_,y])=>s((g+_*l)/c,(b+y*l)/c)):false},m=Cc(Number.parseInt(Ye(t),36)||1),f=a-i,d=a+e+i;return Array.from({length:c},(p,h)=>Array.from({length:c},(g,b)=>{let _=m()<Mc;return b>=f&&b<d&&h>=f&&h<d?false:_&&u(b,h)}))}function Pa(t,e){if(t==="circle")return {circle:e/2};let n=Xr(t);return n?{path:yc(n,e)}:null}function m1(t,e){let n=Pa(t,e);return n?"circle"in n?z(e/2,e/2,n.circle):n.path:null}var a1,Sc,Mc,i1,s1,u1,tn=q(()=>{"use strict";Se();xc();ae();a1=1,Sc=.5,Mc=.5,i1=.5;s1={invalid:"This silhouette isn't a valid shape grid.",empty:"No shape found: use a picture with a dark or opaque shape on a light or clear background.",thin:"This shape is too thin to hold the code with its quiet zone. Try a rounder, fuller shape."};u1=Array.from({length:8},(t,e)=>{let n=e*Math.PI/4;return [Math.cos(n),Math.sin(n)]});});function Aa(t){let{width:e,height:n,data:o}=t,r=[0,e-1,(n-1)*e,n*e-1].map(i=>{let c=i*4;return {color:[kt(o[c]),kt(o[c+1]),kt(o[c+2])],alpha:o[c+3]/255}});if(r.some(i=>i.alpha<.9))return null;let a=r[0].color;return r.every(({color:i})=>or(i,a)<.006)?a:null}function d1(t){let{width:e,height:n,data:o}=t,r=Aa(t),a=new Float32Array(e*n);for(let i=0;i<a.length;i++){let c=i*4,s=o[c+3]/255;if(r&&s>0){let l=Math.sqrt(or([kt(o[c]),kt(o[c+1]),kt(o[c+2])],r));s*=Math.min(1,Math.max(0,(l-.06)/.1));}a[i]=s;}return a}function p1(t,e){let{width:n,height:o,data:r}=t,a=new Float64Array(4096),i=new Float64Array(4096*3),c=0;for(let d=0;d<e.length;d++){if(e[d]<.9)continue;let p=d*4,h=Math.floor(r[p]/16)*256+Math.floor(r[p+1]/16)*16+Math.floor(r[p+2]/16);a[h]+=1,i[h*3]+=kt(r[p]),i[h*3+1]+=kt(r[p+1]),i[h*3+2]+=kt(r[p+2]),c++;}if(c===0)return {palette:[],error:0};let s=[...a.keys()].filter(d=>a[d]>0).sort((d,p)=>a[p]-a[d]),l=[];for(let d of s){if(a[d]/c<Ec/2||l.length>=f1)break;let p=[i[d*3]/a[d],i[d*3+1]/a[d],i[d*3+2]/a[d]];l.every(h=>or(h,p)>=h1**2)&&l.push(p);}let u=[],m=0;for(let d=0;d<3;d++){u=l.map(()=>({n:0,r:0,g:0,b:0,x:0,y:0})),m=0;for(let p=0;p<e.length;p++){if(e[p]<.9)continue;let h=p*4,g=[kt(r[h]),kt(r[h+1]),kt(r[h+2])],b=0,_=Number.POSITIVE_INFINITY;for(let[M,C]of l.entries()){let x=or(g,C);x<_&&(_=x,b=M);}let y=u[b];y.n++,y.r+=g[0],y.g+=g[1],y.b+=g[2],y.x+=p%n,y.y+=Math.floor(p/n),m+=Math.sqrt(_);}for(let[p,h]of u.entries())h.n>0&&(l[p]=[h.r/h.n,h.g/h.n,h.b/h.n]);}return {palette:l.map((d,p)=>({color:d,area:u[p].n/c,cx:u[p].n?u[p].x/u[p].n+.5:n/2,cy:u[p].n?u[p].y/u[p].n+.5:o/2})).filter(d=>d.area>=Ec).sort((d,p)=>p.area-d.area),error:m/c}}function g1(t,e,n){let o=e+2,r=n+2,a=(m,f)=>m<=0||f<=0||m>e||f>n?0:t[(f-1)*e+(m-1)],i=new Map,c=new Map,s=m=>{let f=c.get(m);if(f)return f;let d=Math.floor(m/2),p=d%o,h=Math.floor(d/o),g=a(p,h),b=m%2===1,_=b?a(p,h+1):a(p+1,h),y=g===_?.5:Math.min(1,Math.max(0,(.5-g)/(_-g))),M=b?[p-.5,h-.5+y]:[p-.5+y,h-.5];return c.set(m,M),M},l=(m,f)=>{i.set(m,f);};for(let m=0;m<r-1;m++)for(let f=0;f<o-1;f++){let d=a(f,m)>=.5,p=a(f+1,m)>=.5,h=a(f+1,m+1)>=.5,g=a(f,m+1)>=.5,b=2*(m*o+f),_=2*((m+1)*o+f),y=2*(m*o+f)+1,M=2*(m*o+f+1)+1;switch((d?8:0)+(p?4:0)+(h?2:0)+(g?1:0)){case 1:l(_,y);break;case 2:l(M,_);break;case 3:l(M,y);break;case 4:l(b,M);break;case 5:{(a(f,m)+a(f+1,m)+a(f+1,m+1)+a(f,m+1))/4>=.5?(l(b,y),l(_,M)):(l(b,M),l(_,y));break}case 6:l(b,_);break;case 7:l(b,y);break;case 8:l(y,b);break;case 9:l(_,b);break;case 10:{(a(f,m)+a(f+1,m)+a(f+1,m+1)+a(f,m+1))/4>=.5?(l(y,_),l(M,b)):(l(y,b),l(M,_));break}case 11:l(M,b);break;case 12:l(y,M);break;case 13:l(_,M);break;case 14:l(y,_);break;}}let u=[];for(let m of i.keys()){if(!i.has(m))continue;let f=[],d=m;for(;d!==void 0&&i.has(d);){f.push(s(d));let p=i.get(d);i.delete(d),d=p;}f.length>=3&&u.push(f);}return u}function b1(t){let e=0;for(let n=0;n<t.length;n++){let o=t[n],r=t[(n+1)%t.length];e+=o[0]*r[1]-r[0]*o[1];}return e/2}function Rc(t,e){if(t.length<=2)return t;let n=new Uint8Array(t.length);n[0]=1,n[t.length-1]=1;let o=[[0,t.length-1]];for(;o.length>0;){let[r,a]=o.pop(),i=t[r],c=t[a],s=c[0]-i[0],l=c[1]-i[1],u=Math.hypot(s,l)||1,m=-1,f=e;for(let d=r+1;d<a;d++){let p=t[d],h=Math.abs(l*(p[0]-i[0])-s*(p[1]-i[1]))/u;h>f&&(f=h,m=d);}m>=0&&(n[m]=1,o.push([r,m],[m,a]));}return t.filter((r,a)=>n[a]===1)}function _1(t,e){let n=0,o=-1;for(let[i,c]of t.entries()){let s=(c[0]-t[0][0])**2+(c[1]-t[0][1])**2;s>o&&(o=s,n=i);}let r=Rc(t.slice(0,n+1),e),a=Rc([...t.slice(n),t[0]],e);return [...r.slice(0,-1),...a.slice(0,-1)]}function y1(t,e){let n=t.length,o=(a,i)=>{let c=Math.hypot(i[0]-a[0],i[1]-a[1])||1,s=Math.min(.5,e/c);return [a[0]+(i[0]-a[0])*s,a[1]+(i[1]-a[1])*s]},r="";for(let a=0;a<n;a++){let i=t[a],c=o(i,t[(a-1+n)%n]),s=o(i,t[(a+1)%n]);r+=a===0?`M${Oe(c[0])} ${Oe(c[1])}`:`L${Oe(c[0])} ${Oe(c[1])}`,r+=`Q${Oe(i[0])} ${Oe(i[1])} ${Oe(s[0])} ${Oe(s[1])}`;}return `${r}Z`}function $1(t,e,n){let o="";for(let r of g1(t,e,n)){if(Math.abs(b1(r))<.8)continue;let a=_1(r,.18);a.length>=3&&(o+=y1(a,.9));}return o}function Pc(t){let{width:e,height:n,data:o}=t,r=d1(t),a=0;for(let h of r)a+=h;let{palette:i,error:c}=p1(t,r),s={width:e,height:n,palette:i,alpha:r,coverage:a/(e*n)};if(i.length===0||c>x1)return {...s,layers:[],photographic:i.length>0};let l=i.length,u=Array.from({length:l},()=>new Float32Array(e*n)),m=i.map(h=>h.color);for(let h=0;h<r.length;h++){let g=r[h];if(g<=0)continue;let b=h*4,_=[kt(o[b]),kt(o[b+1]),kt(o[b+2])],y=0,M=-1,C=Number.POSITIVE_INFINITY,x=Number.POSITIVE_INFINITY;for(let R=0;R<l;R++){let v=or(_,m[R]);v<C?(M=y,x=C,y=R,C=v):v<x&&(M=R,x=v);}if(M<0||C<1e-6){u[y][h]=g;continue}let S=m[y],w=m[M],E=[w[0]-S[0],w[1]-S[1],w[2]-S[2]],P=Math.min(1,Math.max(0,((_[0]-S[0])*E[0]+(_[1]-S[1])*E[1]+(_[2]-S[2])*E[2])/(E[0]**2+E[1]**2+E[2]**2)));u[y][h]=g*(1-P),u[M][h]=g*P;}let f=[],d=new Float32Array(e*n),p=new Array(l);for(let h=l-1;h>=0;h--){let g=u[h];for(let b=0;b<d.length;b++)d[b]+=g[b];p[h]=d.slice();}for(let h=0;h<l;h++){let g=$1(p[h],e,n);g&&f.push({color:m[h],d:g});}return {...s,layers:f,photographic:false}}var kt,or,J,f1,h1,Ec,Oe,x1,va=q(()=>{"use strict";ht();kt=t=>t/255,or=(t,e)=>(t[0]-e[0])**2+(t[1]-e[1])**2+(t[2]-e[2])**2,J=t=>.2126*t[0]+.7152*t[1]+.0722*t[2];f1=8,h1=.14,Ec=.006;Oe=t=>it(t,2);x1=.075;});function S1(t){let e="";for(let o=0;o<t.length;o+=32768)e+=String.fromCharCode(...t.subarray(o,o+32768));return btoa(e)}function C1(t){return M1.get(t,()=>{let e=atob(t),n=new Uint8Array(e.length);for(let o=0;o<e.length;o++)n[o]=e.charCodeAt(o);return n})}function Ta(t){let{width:e,height:n,data:o}=t;if(!(Number.isInteger(e)&&Number.isInteger(n))||e<1||n<1||e>xe||n>xe||typeof o!="string")return null;try{let r=C1(o);return r.length===e*n*4?{width:e,height:n,data:r}:null}catch{return null}}function kc(t,e={}){let{width:n,height:o,data:r}=t;if(!(n>0&&o>0)||r.length<n*o*4)throw new Error("Art image pixels must be width \xD7 height \xD7 4 RGBA bytes");let a=Math.min(n,o),i=e.square?Math.floor((n-a)/2):0,c=e.square?Math.floor((o-a)/2):0,s=e.square?a:n,l=e.square?a:o,u=Math.min(Math.max(Math.round(e.maxSize??Fa.halftone),1),xe),m=Math.min(1,u/Math.max(s,l)),f=Math.max(1,Math.round(s*m)),d=Math.max(1,Math.round(l*m)),p=new Uint8Array(f*d*4);for(let h=0;h<d;h++){let g=Math.floor(h*l/d),b=Math.max(g+1,Math.floor((h+1)*l/d));for(let _=0;_<f;_++){let y=Math.floor(_*s/f),M=Math.max(y+1,Math.floor((_+1)*s/f)),C=0,x=0,S=0,w=0,E=0;for(let R=g;R<b;R++)for(let v=y;v<M;v++){let L=((R+c)*n+v+i)*4,k=r[L+3]/255;C+=r[L]*k,x+=r[L+1]*k,S+=r[L+2]*k,w+=k,E++;}let P=(h*f+_)*4;p[P]=w>0?Math.round(C/w):0,p[P+1]=w>0?Math.round(x/w):0,p[P+2]=w>0?Math.round(S/w):0,p[P+3]=Math.round(w/E*255);}}return {width:f,height:d,data:S1(p)}}async function w1(t){if(typeof t!="string"&&!(t instanceof Blob))return t.complete||await new Promise(n=>{t.addEventListener("load",n,{once:true}),t.addEventListener("error",n,{once:true});}),t;let e=typeof t=="string"?t:URL.createObjectURL(t);try{return await new Promise((n,o)=>{let r=new Image;r.crossOrigin="anonymous",r.onload=()=>n(r),r.onerror=()=>o(new Error("Could not load the art image")),r.src=e;})}finally{typeof t!="string"&&setTimeout(()=>URL.revokeObjectURL(e),1e3);}}async function E1(t,e={}){if(typeof document>"u")throw new Error("loadQRArtImage needs a browser; pass decoded pixels to createQRArtImage instead");let n=e.mode??"halftone",o=e.maxSize??Fa[n],r=await w1(t),a=r.naturalWidth||r.width||o,i=r.naturalHeight||r.height||o,c=n==="halftone",s=Math.min(1,o*4/(c?Math.min(a,i):Math.max(a,i))),l=Math.max(1,Math.round(a*s)),u=Math.max(1,Math.round(i*s)),m=document.createElement("canvas");m.width=l,m.height=u;let f=m.getContext("2d",{willReadFrequently:true});if(!f)throw new Error("Could not get a canvas context");f.imageSmoothingQuality="high",f.drawImage(r,0,0,l,u);let d;try{d=f.getImageData(0,0,l,u);}catch{throw new Error("Could not read the art image (cross-origin images need CORS); upload it instead")}finally{m.remove();}return kc(d,{maxSize:o,square:c})}function ka(t){return !!(t&&Jn.includes(t.mode)&&t.image&&Ta(t.image))}function Zr(t){let e=Zn[t.mode];return t.variant&&e.includes(t.variant)?t.variant:e[0]}function R1(t,e){if(t===1)return [];let n=Math.floor(t/7)+2,o=t===32?26:Math.ceil((t*4+4)/(n*2-2))*2,r=[6];for(let a=e-7;r.length<n;a-=o)r.splice(1,0,a);return r}function ar(t,e){let n=R1(t,e),o=n.length-1,r=[];for(let[a,i]of n.entries())for(let[c,s]of n.entries())a===0&&c===0||a===0&&c===o||a===o&&c===0||r.push([i,s]);return r}function Nc(t){let e=vc.get(t);if(e)return e;let n=t*4+17,o=new Uint8Array(n*n),r=(a,i,c,s,l)=>{for(let u=Math.max(0,i);u<Math.min(n,i+s);u++)for(let m=Math.max(0,a);m<Math.min(n,a+c);m++)o[u*n+m]=l;};r(6,0,1,n,Ac),r(0,6,n,1,Ac),r(0,8,9,1,De),r(8,0,1,9,De),r(n-8,8,8,1,De),r(8,n-8,1,8,De),t>=7&&(r(n-11,0,3,6,De),r(0,n-11,6,3,De));for(let[a,i]of ar(t,n))r(a-2,i-2,5,5,Yt);return r(0,0,8,8,Wt),r(n-8,0,8,8,Wt),r(0,n-8,8,8,Wt),vc.set(t,o),o}function A1(t){let e=t*4+17,n=Nc(t);return Array.from({length:e},(o,r)=>Array.from({length:e},(a,i)=>n[r*e+i]!==P1))}function v1(t){let e=t[8],n=e?.[0]?1:0,o=e?.[1]?1:0,r=(1-n)*2+o;return ["M","L","H","Q"][r]??"M"}function Nn(t,e){let n=mt(t);return !n||n.a===0?e:[n.r/255,n.g/255,n.b/255]}function Be(t,e,n,o){let r=J(t);if(o?r<=n:r>=n)return t;let a=J(e);return Math.abs(r-a)<1e-6?e:nn(t,e,Math.min(1,Math.max(0,(r-n)/(r-a))))}function Nt(t,e=1){let n=o=>Math.min(255,Math.round(Math.round(Math.min(Math.max(o,0),1)*255)/e)*e);return `#${La(n(t[0]))}${La(n(t[1]))}${La(n(t[2]))}`}function I1(t){let e=t<0?-1:1,n=Math.abs(t),o=1/(1+.3275911*n),r=1-((((1.061405429*o-1.453152027)*o+1.421413741)*o-.284496736)*o+.254829592)*o*Math.exp(-n*n);return e*r}function Oa(t,e,n,o){let r=o==="cover"?Math.max(n/t,n/e):Math.min(n/t,n/e);return {scale:r,offsetX:(n-t*r)/2,offsetY:(n-e*r)/2}}function Dc(t,e){let{width:n,height:o,data:r}=t,a=new Float32Array(n*o*3),i=e??new Float32Array(n*o);for(let c=0;c<n*o;c++)a[c*3]=r[c*4]/255,a[c*3+1]=r[c*4+1]/255,a[c*3+2]=r[c*4+2]/255,e||(i[c]=r[c*4+3]/255);return {width:n,height:o,rgb:a,alpha:i}}function k1(t){let e=Dc(t),{rgb:n,alpha:o}=e,r=new Float64Array(256),a=0;for(let m=0;m<o.length;m++){if(o[m]<.5)continue;let f=J([n[m*3],n[m*3+1],n[m*3+2]]);r[Math.min(255,Math.floor(f*256))]+=1,a++;}let i=m=>{let f=0;for(let d=0;d<256;d++)if(f+=r[d],f>=m*a)return d/255;return 1},c=a?i(.01):0,s=a?i(.99):1;s-c<.15&&(c=0,s=1);let l=Math.min(1.6,1/(s-c)),u=(c+s)/2;for(let m=0;m<o.length;m++){let f=[n[m*3],n[m*3+1],n[m*3+2]],d=J(f),p=.5+(d-u)*l;for(let h=0;h<3;h++)n[m*3+h]=Math.min(1,Math.max(0,p+(f[h]-d)*1.12));}return e}function Bc(t,e,n,o,r=1){let{width:a,height:i,rgb:c,alpha:s}=t,l=Math.min(Math.max(e-.5,0),a-1),u=Math.min(Math.max(n-.5,0),i-1),m=Math.floor(l),f=Math.floor(u),d=Math.min(m+1,a-1),p=Math.min(f+1,i-1),h=l-m,g=u-f,b=0,_=0,y=0,M=0,C=(S,w,E)=>{let P=w*a+S,R=s[P]*E;b+=c[P*3]*R,_+=c[P*3+1]*R,y+=c[P*3+2]*R,M+=R;};if(C(m,f,(1-h)*(1-g)),C(d,f,h*(1-g)),C(m,p,(1-h)*g),C(d,p,h*g),M<=0)return o;let x=M*r;return [o[0]+(b/M-o[0])*x,o[1]+(_/M-o[1])*x,o[2]+(y/M-o[2])*x]}function Da(t,e){return O1.get(t.image.data,()=>Pc(e))}function Gc(t,e,n){return D1.get(t.image.data,()=>Dc(e,n.alpha))}function B1(t,e,n){let o=Et(n*2),r=Et(n);return `M${Et(t-n)} ${Et(e)}a${r} ${r} 0 1 0 ${o} 0a${r} ${r} 0 1 0 ${-o} 0z`}function en(t,e,n,o,r){let a=Math.min(r,n/2,o/2);if(a<=0)return `M${Et(t)} ${Et(e)}h${Et(n)}v${Et(o)}h${Et(-n)}z`;let i=Et(a);return `M${Et(t+a)} ${Et(e)}h${Et(n-2*a)}a${i} ${i} 0 0 1 ${i} ${i}v${Et(o-2*a)}a${i} ${i} 0 0 1 ${-i} ${i}h${Et(-(n-2*a))}a${i} ${i} 0 0 1 ${-i} ${-i}v${Et(-(o-2*a))}a${i} ${i} 0 0 1 ${i} ${-i}z`}function Uc(t,e,n){let o="";for(let[r,a]of t){let i=(r-2+e)*n,c=(a-2+e)*n;o+=en(i,c,5*n,5*n,n*.35),o+=en(i+n,c+n,3*n,3*n,n*.15),o+=en(i+2*n,c+2*n,n,n,n*.12);}return o}function Q1(t,e){let n=Nn(t,[0,0,0]),o=Nn(e,[1,1,1]),r=J(o)-J(n);return r>=jr?null:r<=-jr?"inverted":"low-contrast"}function qc(t,e,n){let o=Math.min(Math.max(t.intensity??Tc,0),G1[Zr(t)]);return J(n)-J(e)>=jr?o:0}function U1(t){let{art:e,modules:n,version:o}=t,r=e.image&&Ta(e.image);if(!(r&&Jn.includes(e.mode)))return null;let a=n.length;if(a!==o*4+17)return null;let i=Nn(t.fgColor,[0,0,0]),c=Nn(t.bgColor,[1,1,1]),s=qc(e,i,c);return s<=0?null:{art:e,image:r,modules:n,size:a,version:o,kinds:Nc(o),margin:t.margin,pixelSize:t.pixelSize,t:s,fg:i,bg:c,variant:Zr(e),body:t.body}}function Ba(t){let e=U1(t);if(!e)return null;let n;return e.art.mode==="halftone"?n=e.variant==="mono"?X1(e):V1(e):n=e.variant==="badge"?rd(e):Y1(e),jsx("g",{"data-qrdx-art":e.art.mode,"data-qrdx-art-variant":e.variant,children:n})}function q1(t,e){return {margin:.42-.17*t+(e===3?.04:0),darkCap:.4+.3*t}}function Ga(t){let e=t*4+17,n=Ic.get(t);if(!n){let a=e*2,i=new Uint8Array(a*a),c=zc*2;for(let s=0;s<a;s++)for(let l=0;l<a;l++){let u=l<c||l>=a-c,m=s<c||s>=a-c;u&&m&&!(l>=a-c&&s>=a-c)&&(i[s*a+l]=1);}for(let[s,l]of ar(t,e))for(let u=(l-2)*2-1;u<(l+3)*2+1;u++)for(let m=(s-2)*2-1;m<(s+3)*2+1;m++)m>=0&&u>=0&&m<a&&u<a&&(i[u*a+m]=1);Ic.set(t,i),n=i;}let o=n,r=e*2;return (a,i)=>{let c=Math.floor(a*2),s=Math.floor(i*2);return c>=0&&s>=0&&c<r&&s<r&&o[s*r+c]===1}}function Hc(t,e,n=false){let{image:o,size:r,kinds:a,fg:i,bg:c}=t,s=N1.get(t.art.image.data,()=>k1(o)),l=Oa(o.width,o.height,r,"cover"),u=r*e,m=new Float32Array(u*u*3).fill(Number.NaN),d=1/(e*l.scale)>1.3?2:1,p=J(c)-.1*(J(c)-J(i)),h=Ga(t.version);for(let g=0;g<r;g++)for(let b=0;b<r;b++){let _=a[g*r+b],y=_===Wt||_===Yt;if(!(y&&!n))for(let M=0;M<e;M++)for(let C=0;C<e;C++){let x=0,S=0,w=0;for(let T=0;T<d;T++)for(let I=0;I<d;I++){let W=b+(C+(I+.5)/d)/e,G=g+(M+(T+.5)/d)/e,V=Bc(s,(W-l.offsetX)/l.scale,(G-l.offsetY)/l.scale,c);x+=V[0],S+=V[1],w+=V[2];}let E=d*d,P=[x/E,S/E,w/E],R=b+(C+.5)/e,v=g+(M+.5)/e,L=Math.min(R,v,r-R,r-v);L<1.5&&(P=nn(P,c,.35*(1-L/1.5))),n&&(y||h(R,v))&&(P=Be(P,c,p,false));let k=((g*e+M)*u+b*e+C)*3;m[k]=P[0],m[k+1]=P[1],m[k+2]=P[2];}}return {n:e,count:u,rgb:m}}function z1(t,e,n){let{size:o,kinds:r,modules:a,fg:i,bg:c,t:s}=t,{n:l,count:u,rgb:m}=e,f=J(i),d=J(c),p=d-f,h=q1(s,l),g=w=>.2126*m[w]+.7152*m[w+1]+.0722*m[w+2],b=new Float32Array(o*o),_=new Float32Array(o*o);for(let w=0;w<o;w++)for(let E=0;E<o;E++){let P=r[w*o+E];if(P===Wt){b[w*o+E]=d;continue}if(P===Yt){b[w*o+E]=a[w]?.[E]?f:d;continue}let R=0,v=0,L=0;for(let k=0;k<l;k++)for(let T=0;T<l;T++){let I=g(((w*l+k)*u+E*l+T)*3);R+=I,n.under[k*l+T]||(v+=I,L++);}b[w*o+E]=R/(l*l),_[w*o+E]=L?v/L:R/(l*l);}let y=o+1,M=new Float64Array(y*y);for(let w=0;w<o;w++)for(let E=0;E<o;E++)M[(w+1)*y+E+1]=b[w*o+E]+M[w*y+E+1]+M[(w+1)*y+E]-M[w*y+E];let C=2,x=(w,E)=>{let P=Math.max(0,w-C),R=Math.max(0,E-C),v=Math.min(o,w+C+1),L=Math.min(o,E+C+1);return (M[L*y+v]-M[R*y+v]-M[L*y+P]+M[R*y+P])/((v-P)*(L-R))},S=n.weight;for(let w=0;w<o;w++)for(let E=0;E<o;E++){let P=r[w*o+E];if(P===Wt||P===Yt)continue;let R=P===De,v=(h.margin+(R?.08:0))*p,L=(h.darkCap-(R?.12:0))*p,k=(S*((n.light-n.dark)/2)-v)/(1-S),T=x(E,w),I=_[w*o+E],W=!!a[w]?.[E],G=0,V=c;if(W){let Q=Math.min(T+k,f+L);I>Q&&(G=(I-Q)/Math.max(I-f,1e-6),V=i);}else {let Q=Math.max(T-k,d-L);I<Q&&(G=(Q-I)/Math.max(d-I,1e-6));}if(!(G<=0)){G=Math.min(1,G);for(let Q=0;Q<l;Q++)for(let j=0;j<l;j++){let et=((w*l+Q)*u+E*l+j)*3;for(let ft=0;ft<3;ft++)m[et+ft]+=(V[ft]-m[et+ft])*G;}}}}function Wc(t,e,n,o){let{count:r}=e,a=new rn;for(let s=0;s<r;s++){let l=0,u=n(s*r);for(let m=1;m<=r;m++){let f=m<r?n(s*r+m):null;(m===r||f!==u)&&(u&&a.cellRun(u,l,s,m-l),l=m,u=f);}}let i=t.pixelSize/e.n,c=Et(t.margin*t.pixelSize);return jsx("g",{transform:`translate(${c} ${c}) scale(${Qc(i)})`,children:a.toElements(o)},o)}function Qa(t,e){let n=ar(t.version,t.size);return n.length===0?[]:[jsx("path",{d:Uc(n,t.margin,t.pixelSize),fill:e,fillRule:"evenodd"},"art-alignment")]}function Vc(t){let{image:e,size:n}=t;return Math.floor(Math.min(e.width,e.height)/n)>=4&&n<=45?4:3}function W1(t,e,n){let o=e+1,r=new Float64Array(o*o);for(let i=0;i<e;i++)for(let c=0;c<e;c++)r[(i+1)*o+c+1]=t[i*e+c]+r[i*o+c+1]+r[(i+1)*o+c]-r[i*o+c];let a=new Float32Array(e*e);for(let i=0;i<e;i++)for(let c=0;c<e;c++){let s=Math.max(0,c-n),l=Math.max(0,i-n),u=Math.min(e,c+n+1),m=Math.min(e,i+n+1);a[i*e+c]=(r[m*o+u]-r[l*o+u]-r[m*o+s]+r[l*o+s])/((u-s)*(m-l));}return a}function Xc(t,e,n,o){let{size:r,kinds:a,modules:i,fg:c,bg:s}=t,l=J(c),u=J(s),m=u-l,f=W1(e,r,2),d=new Float32Array(r*r),p=new Float32Array(r*r).fill(Number.NaN);for(let h=0;h<r;h++)for(let g=0;g<r;g++){let b=h*r+g,_=a[b];if(_===Wt||_===Yt)continue;let y=_===De,M=o.base+(y?.08:0),C=(o.margin+(y?.03:0))*m,x=(o.cap-(y?.04:0))*m,S=Lc(M),w=Lc(y?Math.max(o.max,.94):o.max),E=S*((o.dark+o.light)/2)+(1-S)*f[b],P=n[b],R=!!i[h]?.[g],v=R?o.dark:o.light,L=R?Math.min(E-C,l+x):Math.max(E+C,u-x),T=(R?P<=L:P>=L)?0:(P-L)/(P-v);T>w&&(T=w,p[b]=Math.min(u,Math.max(l,(L-w*v)/(1-w))));let I=R?P<=L-.06:P>=L+.06;o.skip&&I&&!y||(T=Math.max(T,S)),d[b]=T>0?H1(T):0;}return {diameter:d,surround:p}}function V1(t){let{size:e,kinds:n,modules:o,fg:r,bg:a,t:i,margin:c,pixelSize:s}=t,l=Vc(t),u=Hc(t,l,true),m=J(r),f=J(a),d=m+.1*(f-m),p=f-.05*(f-m),{count:h,rgb:g}=u,b=(x,S,w,E)=>((S*l+E)*h+x*l+w)*3,_=new Float32Array(e*e);for(let x=0;x<e;x++)for(let S=0;S<e;S++){let w=n[x*e+S];if(w===Wt||w===Yt){_[x*e+S]=w===Yt&&o[x]?.[S]?m:f;continue}let E=0;for(let P=0;P<l;P++)for(let R=0;R<l;R++){let v=b(S,x,R,P);E+=.2126*g[v]+.7152*g[v+1]+.0722*g[v+2];}_[x*e+S]=E/(l*l);}let y=Xc(t,_,_,{base:.6-.28*i,max:.86,dark:d,light:p,margin:.2-.1*i,cap:.4+.14*i,skip:false});for(let x=0;x<e;x++)for(let S=0;S<e;S++){let w=y.surround[x*e+S];if(Number.isNaN(w))continue;let E=_[x*e+S],R=w<E?r:a,v=Math.min(1,Math.abs(E-w)/Math.max(Math.abs(E-J(R)),1e-6));for(let L=0;L<l;L++)for(let k=0;k<l;k++){let T=b(S,x,k,L);for(let I=0;I<3;I++)g[T+I]+=(R[I]-g[T+I])*v;}}let M=[Wc(t,u,x=>{let S=x*3;return Number.isNaN(g[S])?null:Nt([g[S],g[S+1],g[S+2]],8)},"art-photo")],C=new rn;for(let x=0;x<e;x++)for(let S=0;S<e;S++){let w=y.diameter[x*e+S];if(!(w>0))continue;let E=0,P=0,R=0;for(let k=0;k<l;k++)for(let T=0;T<l;T++){let I=b(S,x,T,k);E+=g[I],P+=g[I+1],R+=g[I+2];}let v=[E/(l*l),P/(l*l),R/(l*l)],L=o[x]?.[S]?Be(v,r,d,true):Be(v,a,p,false);C.circle(Nt(L,10),(S+c+.5)*s,(x+c+.5)*s,w/2*s);}return M.push(...C.toElements("art-dot"),...Qa(t,Nt(r))),M}function X1(t){let{size:e,kinds:n,modules:o,fg:r,bg:a}=t,i=Vc(t),c=Hc(t,i),s=J(r),l=J(a),u=i%2===1?1:2,m=(i-u)/2,f=E=>E>=m&&E<m+u,d=[];for(let E=0;E<i;E++)for(let P=0;P<i;P++)d.push(f(P)&&f(E));z1(t,c,{weight:F1(u/i),dark:s,light:l,under:d});let{count:p,rgb:h}=c,g=new Float32Array(p*p),b=new Int8Array(p*p).fill(-1);for(let E=0;E<p*p;E++){let P=E*3;if(Number.isNaN(h[P])){g[E]=Number.NaN;continue}let R=(.2126*h[P]+.7152*h[P+1]+.0722*h[P+2]-s)/(l-s);g[E]=.5+(T1(0,1,R)-.5)*1.15;}for(let E=0;E<e;E++)for(let P=0;P<e;P++){let R=n[E*e+P];if(!(R===Wt||R===Yt))for(let v=m;v<m+u;v++)for(let L=m;L<m+u;L++)b[(E*i+v)*p+P*i+L]=o[E]?.[P]?0:1;}let _=Ga(t.version);for(let E=0;E<p;E++)for(let P=0;P<p;P++){let R=E*p+P;b[R]<0&&_((P+.5)/i,(E+.5)/i)&&(b[R]=1);}let y=new Uint8Array(p*p),M=.3,C=0,x=0,S=(E,P,R)=>{if(E<0||E>=p||P>=p)return;let v=P*p+E;if(!Number.isNaN(g[v])){let L=Math.floor(E/i)===Math.floor(C/i)&&Math.floor(P/i)===Math.floor(x/i);g[v]+=L?R:R*M;}};for(let E=0;E<p;E++){let P=E%2===0?1:-1;for(let R=0;R<p;R++){let v=P===1?R:p-1-R,L=E*p+v,k=g[L];if(Number.isNaN(k))continue;let T=b[L]>=0?b[L]:k>=.5?1:0;y[L]=T===0?1:0;let I=Math.min(.75,Math.max(-0.75,k-T));C=v,x=E,S(v+P,E,I*7/16),S(v-P,E+1,I*3/16),S(v,E+1,I*5/16),S(v+P,E+1,I/16);}}let w=Nt(r);return [Wc(t,c,E=>y[E]?w:null,"art-halftone"),...Qa(t,w)]}function Fc(t,e){let n=null,o=0;for(let r of t.palette){if(e&&L1(r.color,e)<.02)continue;let a=r.area*(.35+Oc(r.color))*(J(r.color)>.86?.05:1);a>o&&(o=a,n=r.color);}return n}function Yc(t,e,n,o,r){let a;if(t.photographic){let i=new rn,{width:c,height:s,rgb:l,alpha:u}=e;for(let m=0;m<s;m++){let f=0,d=null;for(let p=0;p<=c;p++){let h=m*c+p,g=p<c&&u[h]>=.5?Nt(o([l[h*3],l[h*3+1],l[h*3+2]]),6):null;(p===c||g!==d)&&(d&&i.cellRun(d,f,m,p-f),f=p,d=g);}}a=i.toElements(`${r}-px`);}else a=t.layers.map((i,c)=>jsx("path",{d:i.d,fill:Nt(o(i.color)),fillRule:"evenodd"},`${r}-${c}`));return jsx("g",{transform:`translate(${Et(n.x)} ${Et(n.y)}) scale(${Qc(n.scale)})`,children:a},r)}function Y1(t){let{art:e,image:n,size:o,kinds:r,modules:a,fg:i,bg:c,t:s,margin:l,pixelSize:u}=t,m=Da(e,n),f=Gc(e,n,m),d=Oa(m.width,m.height,o,"contain"),p=Math.min(1,.3+1.4*s),h=I=>nn(c,I,p),g=Nt(c),b=Nt(i),_=[Yc(m,f,{x:(l+d.offsetX)*u,y:(l+d.offsetY)*u,scale:d.scale*u},h,"art-logo")],y=zc,M=(I,W)=>en((I+l)*u,(W+l)*u,(y+.4)*u,(y+.4)*u,1.2*u),C=ar(t.version,o).map(([I,W])=>en((I-2.5+l)*u,(W-2.5+l)*u,6*u,6*u,u*.8)).join("");_.push(jsx("path",{d:M(-0.4,-0.4)+M(o-y,-0.4)+M(-0.4,o-y)+C,fill:g},"art-plates"));let x=Ga(t.version),S=J(c),w=J(i),E=new Float32Array(o*o),P=new Float32Array(o*o),R=new Array(o*o);for(let I=0;I<o;I++)for(let W=0;W<o;W++){let G=I*o+W,V=r[G];if(V===Wt||V===Yt){E[G]=V===Yt&&a[I]?.[W]?w:S;continue}let Q=1,j=0,et=0,ft=0,F=0;for(let U=0;U<4;U++)for(let xt=0;xt<4;xt++){let Rt=W+(xt+.5)/4,ze=I+(U+.5)/4,ue=x(Rt,ze)?c:Bc(f,(Rt-d.offsetX)/d.scale,(ze-d.offsetY)/d.scale,c,p),Jt=J(ue);Q=Math.min(Q,Jt),j+=Jt,et+=ue[0],ft+=ue[1],F+=ue[2];}E[G]=j/16,P[G]=Q,R[G]=[et/16,ft/16,F/16];}let v=w+.08*(S-w),L=S-.04*(S-w),k=Xc(t,E,E,{base:.74-.26*s,max:.9,dark:v,light:L,margin:.23-.1*s,cap:.4+.1*s,skip:s>=.7}),T=new rn;for(let I=0;I<o;I++)for(let W=0;W<o;W++){let G=I*o+W,V=k.diameter[G],Q=!!a[I]?.[W];if(!(V>0)||!Q&&P[G]>=S-.02)continue;let j=Q?Be(R[G],i,v,true):Be(R[G],c,L,false);T.circle(Nt(j,8),(W+l+.5)*u,(I+l+.5)*u,V/2*u);}return _.push(...T.toElements("art-dot")),_.push(...Qa(t,b)),_}function Jc(t,e,n){let o=e>=1?t:t*e,r=e>=1?t/e:t,a=Math.max(.7,t*.09),i=o+2*a,c=r+2*a;return {logoW:o,logoH:r,plateW:i,plateH:c,radius:Math.min(i,c)*.26,cx:n/2,cy:n/2}}function tl(t,e,n){return nl(e+.5,n+.5,t)<Zc}function K1(t,e){let n=Kc(t),o=Zc+1,r=Math.max(0,Math.floor(t.cx-t.plateW/2-o)),a=Math.min(e-1,Math.ceil(t.cx+t.plateW/2+o)),i=Math.max(0,Math.floor(t.cy-t.plateH/2-o)),c=Math.min(e-1,Math.ceil(t.cy+t.plateH/2+o)),s=[];for(let l=i;l<=c;l++)for(let u=r;u<=a;u++)tl(n,u,l)&&s.push(l*e+u);return s}function Ia(t,e,n){let o=Jc(t,e,n.size),r=td(n);return nr(n,K1(o,n.size)).every(a=>a<=r)}function el(t,e,n){if(Ia(n,e,t))return n;let o=0,r=n;if(!Ia(o,e,t))return -1;for(;r-o>1/64;){let a=(o+r)/2;Ia(a,e,t)?o=a:r=a;}return o}function ed(t,e){let n=`${t.version}${t.level}:${e.toFixed(3)}`,o=Yr.get(n);return o===void 0&&(o=el(t,e,jc*t.size),Yr.size>=64&&Yr.clear(),Yr.set(n,o)),o}function nd(t,e){let{size:n,t:o,modules:r,version:a}=t,i=v1(r),c=(.18+.15*o)*j1[i],s=e.width/e.height,l=Math.min(jc,c)*n,u=er(a,i),m=Math.max(0,ed(u,s));if(m<J1)return {wantedBox:l,maxBox:m,box:0,plate:null};let f=el(u,s,Math.min(l,m));return f<0?{wantedBox:l,maxBox:m,box:0,plate:null}:{wantedBox:l,maxBox:m,box:f,plate:Jc(f,s,n)}}function nl(t,e,n){let o=Math.abs(t-n.cx)-(n.w/2-n.r),r=Math.abs(e-n.cy)-(n.h/2-n.r);return Math.hypot(Math.max(o,0),Math.max(r,0))+Math.min(Math.max(o,r),0)-n.r}function rl(t,e){let{fg:n,bg:o,t:r}=t,a=J(n),i=J(o),c=Fc(e),s=Math.min(1,r/.6),l=c?Be(c,n,a+.3*(i-a),true):n,u=nn(n,l,s),m=c?Fc(e,c):null,f=a+.42*(i-a),d=m&&J(m)<=f+.22?nn(n,Be(m,n,f,true),s):u;return {body:u,inner:d}}function rd(t){let{art:e,image:n,size:o,kinds:r,modules:a,bg:i,margin:c,pixelSize:s,version:l}=t,u=Da(e,n),m=nd(t,u).plate,{body:f}=rl(t,u),d=Nt(f),p=m&&Kc(m),h=a.map(R=>[...R]);for(let R=0;R<o;R++)for(let v=0;v<o;v++){let L=r[R*o+v];(L===Yt||p&&L!==Wt&&tl(p,v,R))&&(h[R][v]=false);}let g=[],b=t.body?.(h);if(b)g.push(jsx("g",{fill:d,children:b},"art-body"));else {let R=new rn;for(let v=0;v<o;v++)for(let L=0;L<o;L++)h[v]?.[L]&&r[v*o+L]!==Wt&&R.circle(d,(L+c+.5)*s,(v+c+.5)*s,.45*s);g.push(...R.toElements("art-body"));}let _=ar(l,o).filter(([R,v])=>!p||nl(R+.5,v+.5,p)>3.2);if(_.length>0&&g.push(jsx("path",{d:Uc(_,c,s),fill:d,fillRule:"evenodd"},"art-alignment")),!m)return g;let y=Gc(e,n,u),M=(m.cx-m.plateW/2+c)*s,C=(m.cy-m.plateH/2+c)*s,x=m.plateW*s,S=m.plateH*s,w=m.radius*s,E=.1*s,P=en(M,C,x,S,w);return g.push(jsx("path",{d:P,fill:Nt(i)},"art-plate"),jsx("path",{d:P+en(M+E,C+E,x-2*E,S-2*E,w-E),fill:Nt(nn(i,f,.16)),fillRule:"evenodd"},"art-plate-ring"),Yc(u,y,{x:(m.cx-m.logoW/2+c)*s,y:(m.cy-m.logoH/2+c)*s,scale:m.logoW/u.width*s},R=>R,"art-logo")),g}function Ua(t){let{art:e}=t;if(e.mode!=="logo"||e.matchEyes===false)return null;let n=e.image&&Ta(e.image);if(!n)return null;let o=Nn(t.fgColor,[0,0,0]),r=Nn(t.bgColor,[1,1,1]),a=qc(e,o,r);if(a<=0)return null;let i=Da(e,n);if(i.palette.length===0)return null;if(Zr(e)==="badge"){let{body:p,inner:h}=rl({fg:o,bg:r,t:a},i),g={outer:Nt(p),inner:Nt(h)};return {topLeft:g,topRight:g,bottomLeft:g}}let c=J(o),s=J(r),l=Math.min(1,a/.6),u=t.version*4+17,m=Oa(i.width,i.height,u,"contain"),f=.45*Math.max(i.width,i.height),d=(p,h)=>{let g=(p-m.offsetX)/m.scale,b=(h-m.offsetY)/m.scale,_=null,y=0;for(let C of i.palette){if(J(C.color)>.86)continue;let x=(C.cx-g)**2+(C.cy-b)**2,S=C.area*(.35+Oc(C.color))*Math.exp(-x/(2*f**2));S>y&&(y=S,_=C.color);}if(!_)return {};let M=Be(_,o,c+.42*(s-c),true);return {inner:Nt(nn(o,M,l))}};return {topLeft:d(3.5,3.5),topRight:d(u-3.5,3.5),bottomLeft:d(3.5,u-3.5)}}var Tc,Fa,kn,M1,P1,Wt,Yt,De,Ac,vc,nn,Oc,L1,La,Na,Lc,F1,T1,N1,O1,D1,Et,Qc,rn,G1,jr,zc,Ic,H1,j1,jc,Zc,Z1,J1,Kc,td,Yr,qa=q(()=>{"use strict";Nr();va();Vr();ht();Dt();Tc=.6,Fa={logo:160,halftone:160};kn=class{entries=new Map;limit;constructor(e){this.limit=e;}get(e,n){let o=this.entries.get(e);if(o!==void 0)return this.entries.delete(e),this.entries.set(e,o),o;let r=n();if(this.entries.size>=this.limit){let a=this.entries.keys().next().value;a!==void 0&&this.entries.delete(a);}return this.entries.set(e,r),r}},M1=new kn(8);P1=0,Wt=1,Yt=2,De=3,Ac=4,vc=new Map;nn=(t,e,n)=>[t[0]+(e[0]-t[0])*n,t[1]+(e[1]-t[1])*n,t[2]+(e[2]-t[2])*n];Oc=t=>Math.max(...t)-Math.min(...t),L1=(t,e)=>(t[0]-e[0])**2+(t[1]-e[1])**2+(t[2]-e[2])**2,La=t=>t.toString(16).padStart(2,"0");Na=.3,Lc=t=>1-Math.exp(-((t/2)**2)/(2*Na**2)),F1=t=>I1(t/(2*Na*Math.SQRT2))**2,T1=(t,e,n)=>{let o=Math.min(1,Math.max(0,(n-t)/(e-t)));return o*o*(3-2*o)};N1=new kn(4),O1=new kn(6),D1=new kn(6);Et=t=>it(t,2),Qc=t=>it(t,4),rn=class{groups=new Map;add(e,n){let o=this.groups.get(e);o?o.push(n):this.groups.set(e,[n]);}cellRun(e,n,o,r){this.add(e,`M${n} ${o}h${r}.04v1.04h-${r}.04z`);}circle(e,n,o,r){this.add(e,B1(n,o,r));}toElements(e){return [...this.groups].map(([n,o],r)=>jsx("path",{d:o.join(""),fill:n},`${e}-${r}`))}};G1={blend:1,badge:1,color:.9,mono:.7},jr=.35;zc=8.5,Ic=new Map;H1=t=>2*Na*Math.sqrt(-2*Math.log(1-Math.min(t,.95)));j1={L:.5,M:.72,Q:.88,H:1},jc=.32,Zc=.55,Z1=.6,J1=2;Kc=t=>({cx:t.cx,cy:t.cy,w:t.plateW,h:t.plateH,r:t.radius});td=t=>Math.floor(t.correctable*Z1);Yr=new Map;});function al(t){return od.includes(t)}function Jr(t,e){if(t===void 0||!Number.isFinite(t))return 1;let n=e?il[e]??1:tr;return Math.min(Gr,Math.max(tr,n,t))}function ad(t,e,n){return t<7&&e<7||t>=n-7&&e<7||t<7&&e>=n-7}function id(t,e){if(t===1)return [];let n=Math.floor(t/7)+2,o=t===32?26:Math.ceil((t*4+4)/(n*2-2))*2,r=[6];for(let a=e-7;r.length<n;a-=o)r.splice(1,0,a);return r}function za(t){let e=(t-17)/4,n=Number.isInteger(e)?id(e,t):[],o=n.length-1,r=[];for(let[a,i]of n.entries())for(let[c,s]of n.entries())a===0&&c===0||a===0&&c===o||a===o&&c===0||r.push([i,s]);return (a,i)=>r.some(([c,s])=>Math.abs(a-c)<=2&&Math.abs(i-s)<=2)}function cd(t,e,n,o,r,a){switch(t){case "horizontal-line":{let i=o*.43;return O(e-o/2,n-i,o,2*i)}case "leaf":{let i=o*.5;return O(e-i,n-i,2*i,2*i,[o*.4,o*.05,o*.4,o*.05])}case "plus":{let i=o*.22,c=o*.5;return tt([[e-i,n-c],[e+i,n-c],[e+i,n-i],[e+c,n-i],[e+c,n+i],[e+i,n+i],[e+i,n+c],[e-i,n+c],[e-i,n+i],[e-c,n+i],[e-c,n-i],[e-i,n-i]])}case "hexagon":return tt(En(e,n,o*.54,6));case "star":return tt(Rn(e,n+o*.04,o*.62,o*.34));case "heart":return Pn(e,n+o*.02,o*1.08);case "random-dots":return z(e,n,o*(.38+.15*Rr(r,a)));case "mosaic":{let i=o*(.8+.14*Rr(r,a,1))/2,c=[[e-i,n-i],[e+i,n-i],[e+i,n+i],[e-i,n+i]];return tt(hs(c,e,n,(Rr(r,a,2)-.5)*16))}case "octagon":return tt(En(e,n,o*.48/Math.cos(Math.PI/8),8,22.5));default:return z(e,n,o*.45)}}function sl(t,e){let{margin:n,pixelSize:o,pattern:r}=e,a=Jr(e.scale,r),i=t.length,c=e.plain?()=>false:za(i),s=(h,g)=>!e.plain&&ad(h,g,i),l=(h,g)=>h>=0&&g>=0&&h<i&&g<i&&!!t[g]?.[h]&&!s(h,g),u=h=>(h+.5+n)*o,m=[],f=[],d=sd[r];for(let h=0;h<i;h++)for(let g=0;g<i;g++){if(!l(g,h))continue;let b=u(g),_=u(h);if(c(g,h)){m.push(A`M${b-o/2} ${_-o/2}h${o}v${o}h${-o}z`);continue}if(!d){f.push(cd(r,b,_,o*a,g,h));continue}let y=o*d.thickness*a/2,M=d.horizontal&&l(g+1,h),C=d.horizontal&&l(g-1,h),x=d.vertical&&l(g,h-1),S=d.vertical&&l(g,h+1),E=[!(x||C),!(x||M),!(S||M),!(S||C)].map((P,R)=>P?y*d.radius(R):0);f.push(O(b-y,_-y,2*y,2*y,E)),2*y<o&&(M&&f.push(O(b,_-y,o,2*y)),S&&f.push(O(b-y,_,2*y,o)));}if(d?.fillets&&a===1){let h=o*.3;for(let g=0;g<i;g++)for(let b=0;b<i;b++){if(l(b,g)||s(b,g))continue;let _=u(b)-o/2,y=u(g)-o/2,M=_+o,C=y+o;l(b-1,g)&&l(b,g-1)&&l(b-1,g-1)&&f.push(A`M${_} ${y}h${h}A${h} ${h} 0 0 0 ${_} ${y+h}Z`),l(b+1,g)&&l(b,g-1)&&l(b+1,g-1)&&f.push(A`M${M} ${y}v${h}A${h} ${h} 0 0 0 ${M-h} ${y}Z`),l(b+1,g)&&l(b,g+1)&&l(b+1,g+1)&&f.push(A`M${M} ${C}h${-h}A${h} ${h} 0 0 0 ${M} ${C-h}Z`),l(b-1,g)&&l(b,g+1)&&l(b-1,g+1)&&f.push(A`M${_} ${C}v${-h}A${h} ${h} 0 0 0 ${_+h} ${C}Z`);}}let p=[];return f.length>0&&p.push(jsx("path",{d:f.join("")},"modules")),m.length>0&&p.push(jsx("path",{d:m.join("")},"alignment")),p}var od,il,sd,Ha=q(()=>{"use strict";Se();ae();ht();od=["horizontal-line","liquid","liquid-horizontal","liquid-vertical","classy","classy-rounded","leaf","plus","hexagon","star","heart","random-dots","mosaic","octagon"];il={circle:.95,"circle-large":.85,square:.75,diamond:.95,pacman:.9,rounded:.75,"vertical-line":.8,liquid:.75,"liquid-horizontal":.85,"liquid-vertical":.85,classy:.7,"classy-rounded":.7,leaf:.75,plus:.8,hexagon:.75,star:.85,heart:.85,"random-dots":.85,mosaic:.8,octagon:.8};sd={liquid:{horizontal:!0,vertical:!0,thickness:1,radius:()=>1,fillets:!0},"liquid-horizontal":{horizontal:!0,vertical:!1,thickness:.86,radius:()=>1,fillets:!1},"liquid-vertical":{horizontal:!1,vertical:!0,thickness:.86,radius:()=>1,fillets:!1},classy:{horizontal:!0,vertical:!0,thickness:1,radius:t=>t===0||t===2?1:0,fillets:!1},"classy-rounded":{horizontal:!0,vertical:!0,thickness:1,radius:t=>t===0||t===2?1:.4,fillets:!1}};});function ld(t){return t==="top-left"?0:t==="top-right"?1:3}function Kr(t,e,n,o="circle",r="top-left"){let a=n*2,i=n,c=a/3;switch(o){case "leaf":case "leaf-reverse":case "drop":case "drop-reverse":{let s=ld(r),l=(s+2)%4,u=1.3*c,m=.7*c,f=p=>{switch(o){case "leaf":return p===s||p===l;case "leaf-reverse":return !(p===s||p===l);case "drop":return p===s;default:return p===l}},d=[0,1,2,3].map(p=>f(p)?m:u);return jsx("path",{d:O(t-n,e-n,a,a,d)})}case "extra-rounded":return jsx("path",{d:O(t-n,e-n,a,a,1.15*c)});case "plus":{let s=1.15*c,l=n;return jsx("path",{d:tt([[t-s,e-l],[t+s,e-l],[t+s,e-s],[t+l,e-s],[t+l,e+s],[t+s,e+s],[t+s,e+l],[t-s,e+l],[t-s,e+s],[t-l,e+s],[t-l,e-s],[t-s,e-s]])})}case "cross-rounded":{let s=1.15*c,l=.5*c;return jsx("path",{d:O(t-n,e-s,a,2*s,l)+O(t-s,e-n,2*s,a,l)})}case "hexagon":return jsx("path",{d:tt(En(t,e,1.72*c,6))});case "octagon":return jsx("path",{d:tt(En(t,e,n/Math.cos(Math.PI/8),8,22.5))});case "flower":{let s=.6*c,l=.9*c;return jsx("path",{d:z(t-s,e-s,l)+z(t+s,e-s,l)+z(t+s,e+s,l)+z(t-s,e+s,l)+z(t,e,1.2*c)})}case "heart":return jsx("path",{d:Pn(t,e+.12*c,3.5*c)});case "squircle":return jsx("path",{d:tt(Wn(t,e,n,n,4,64))});case "dots":{let s=[];for(let l of [-1,0,1])for(let u of [-1,0,1])s.push(z(t+u*c*.82,e+l*c*.82,.58*c));return jsx("path",{d:s.join("")})}case "square":return jsx("rect",{height:$(a),transform:A`rotate(0,${t},${e})`,width:$(a),x:$(t-i),y:$(e-i)});case "rounded":return jsx("rect",{height:$(a),rx:$(n*.5),ry:$(n*.5),transform:A`rotate(0,${t},${e})`,width:$(a),x:$(t-i),y:$(e-i)});case "diamond":return jsx("path",{d:A`M ${t-i*.714286} ${e-i*.714286}v ${a*.714286}h ${a*.714286}v -${a*.714286}z`,transform:A`rotate(45,${t},${e})`});case "message":{let s=a/30,l=f=>(f-40)*s+t,u=f=>(f-40)*s+e,m=A`M ${l(25)} ${u(35.714285714285715)}v ${8.571428571428571*s}a ${10.714285714285714*s} ${10.714285714285714*s}, 0, 0, 0, ${10.714285714285714*s} ${10.714285714285714*s}h ${19.285714285714285*s}v -${19.285714285714285*s}a ${10.714285714285714*s} ${10.714285714285714*s}, 0, 0, 0, -${10.714285714285714*s} -${10.714285714285714*s}h -${8.571428571428571*s}a ${10.714285714285714*s} ${10.714285714285714*s}, 0, 0, 0, -${10.714285714285714*s} ${10.714285714285714*s}`;return jsx("path",{clipRule:"evenodd",d:m,transform:A`rotate(0,${t},${e})`})}case "message-reverse":{let s=a/30,l=f=>(f-40)*s+t,u=f=>(f-40)*s+e,m=A`M ${l(25)} ${u(35.714285714285715)}v ${8.571428571428571*s}a ${10.714285714285714*s} ${10.714285714285714*s}, 0, 0, 0, ${10.714285714285714*s} ${10.714285714285714*s}h ${19.285714285714285*s}v -${19.285714285714285*s}a ${10.714285714285714*s} ${10.714285714285714*s}, 0, 0, 0, -${10.714285714285714*s} -${10.714285714285714*s}h -${8.571428571428571*s}a ${10.714285714285714*s} ${10.714285714285714*s}, 0, 0, 0, -${10.714285714285714*s} ${10.714285714285714*s}`;return jsx("path",{clipRule:"evenodd",d:m,transform:A`rotate(-180,${t},${e})`})}case "diya":{let s=a/30,l=f=>(f-40)*s+t,u=f=>(f-40)*s+e,m=A`M ${l(25)} ${u(35.714285714285715)}v ${8.571428571428571*s}a ${10.714285714285714*s} ${10.714285714285714*s}, 0, 0, 0, ${10.714285714285714*s} ${10.714285714285714*s}h ${19.285714285714285*s}v -${19.285714285714285*s}a ${10.714285714285714*s} ${10.714285714285714*s}, 0, 0, 0, -${10.714285714285714*s} -${10.714285714285714*s}h -${8.571428571428571*s}H ${l(25)}z`;return jsx("path",{clipRule:"evenodd",d:m,transform:A`rotate(0,${t},${e})`})}case "diya-reverse":{let s=a/30,l=f=>(f-40)*s+t,u=f=>(f-40)*s+e,m=A`M ${l(25)} ${u(35.714285714285715)}v ${19.285714285714285*s}h ${19.285714285714285*s}a ${10.714285714285714*s} ${10.714285714285714*s}, 0, 0, 0, ${10.714285714285714*s} -${10.714285714285714*s}v -${19.285714285714285*s}h -${19.285714285714285*s}a ${10.714285714285714*s} ${10.714285714285714*s}, 0, 0, 0, -${10.714285714285714*s} ${10.714285714285714*s}z`;return jsx("path",{clipRule:"evenodd",d:m,transform:A`rotate(0,${t},${e})`})}case "rounded-triangle":{let s=a/21,l=f=>(f-40)*s+t,u=f=>(f-40)*s+e,m=A`M ${l(33.57142857142857)} ${u(29.285714285714285)}h ${12.857142857142856*s}c ${4.285714285714286*s} 0 ${4.285714285714286*s} ${4.285714285714286*s} ${4.285714285714286*s} ${4.285714285714286*s}v ${12.857142857142856*s}c 0 ${4.285714285714286*s} -${4.285714285714286*s} ${4.285714285714286*s} -${4.285714285714286*s} ${4.285714285714286*s}h -${12.857142857142856*s}c -${4.285714285714286*s} 0 -${4.285714285714286*s} -${4.285714285714286*s} -${4.285714285714286*s} -${4.285714285714286*s}v -${12.857142857142856*s}c 0 -${4.285714285714286*s} ${4.285714285714286*s} -${4.285714285714286*s} ${4.285714285714286*s} -${4.285714285714286*s}z`;return jsx("path",{d:m,transform:A`rotate(45,${t},${e})`})}case "star":{let s=a/27,l=f=>(f-40)*s+t,u=f=>(f-40)*s+e,m=A`M ${l(38.84615384615385)},${u(26.546153846153846)}c${.6692307692307691*s},-${1.0153846153846153*s},${2.215384615384615*s},-${1.0153846153846153*s},${2.884615384615384*s},0l${4.038461538461538*s},${6.069230769230768*s}c${.23076923076923075*s},${.3461538461538461*s},${.6*s},${.6*s},${1.0153846153846153*s},${.7153846153846153*s}l${7.223076923076922*s},${1.823076923076923*s}c${1.2*s},${.3*s},${1.6846153846153844*s},${1.7076923076923076*s},${.8999999999999999*s},${2.6538461538461533*s}l-${4.73076923076923*s},${5.584615384615384*s}c-${.2769230769230769*s},${.3230769230769231*s},-${.41538461538461535*s},${.7384615384615384*s},-${.3923076923076923*s},${1.1307692307692307*s}l${.4384615384615384*s},${7.199999999999999*s}c${.06923076923076922*s},${1.2*s},-${1.1769230769230767*s},${2.0769230769230766*s},-${2.3307692307692305*s},${1.6384615384615382*s}l-${6.9692307692307685*s},-${2.6076923076923073*s}c-${.3923076923076923*s},-${.16153846153846155*s},-${.8538461538461538*s},-${.16153846153846155*s},-${1.2461538461538462*s},0l-${6.9692307692307685*s},${2.6076923076923073*s}c-${1.1538461538461537*s},${.4384615384615384*s},-${2.4*s},-${.4384615384615384*s},-${2.3307692307692305*s},-${1.6384615384615382*s}l${.4384615384615384*s},-${7.199999999999999*s}c${.023076923076923075*s},-${.41538461538461535*s},-${.11538461538461538*s},-${.8307692307692307*s},-${.3923076923076923*s},-${1.1307692307692307*s}l-${4.73076923076923*s},-${5.584615384615384*s}c-${.7846153846153846*s},-${.923076923076923*s},-${.3230769230769231*s},-${2.3307692307692305*s},${.8999999999999999*s},-${2.6538461538461533*s}l${7.223076923076922*s},-${1.823076923076923*s}c${.41538461538461535*s},-${.11538461538461538*s},${.7846153846153846*s},-${.3461538461538461*s},${1.0153846153846153*s},-${.7153846153846153*s}l${4.038461538461538*s},-${6.069230769230768*s}z`;return jsx("path",{clipRule:"evenodd",d:m,transform:A`rotate(0,${t},${e})`})}case "banner":{let s=a/28;return jsx("g",{transform:A`translate(${t-40*s},${e-40*s}) scale(${$(s,6)})`,children:jsx("path",{clipRule:"evenodd",d:"M38.235 26.104C38.759 25.677, 39.51 25.677, 40.034 26.104L41.776 27.52C42.091 27.777, 42.501 27.887, 42.902 27.822L45.118 27.466C45.785 27.359, 46.436 27.735, 46.677 28.366L47.477 30.464C47.621 30.843, 47.921 31.143, 48.301 31.288L50.399 32.088C51.03 32.328, 51.406 32.979, 51.298 33.646L50.942 35.863C50.878 36.264, 50.988 36.674, 51.244 36.989L52.661 38.73C53.087 39.254, 53.087 40.006, 52.661 40.53L51.244 42.271C50.988 42.587, 50.878 42.996, 50.942 43.397L51.298 45.614C51.406 46.281, 51.03 46.932, 50.399 47.173L48.301 47.972C47.921 48.117, 47.621 48.417, 47.477 48.797L46.677 50.894C46.436 51.526, 45.785 51.901, 45.118 51.794L42.902 51.438C42.501 51.374, 42.091 51.483, 41.776 51.74L40.034 53.157C39.51 53.583, 38.759 53.583, 38.235 53.157L36.493 51.74C36.178 51.483, 35.768 51.374, 35.367 51.438L33.15 51.794C32.483 51.901, 31.833 51.526, 31.592 50.894L30.792 48.797C30.647 48.417, 30.347 48.117, 29.968 47.972L27.87 47.173C27.239 46.932, 26.863 46.281, 26.97 45.614L27.326 43.397C27.391 42.996, 27.281 42.587, 27.025 42.271L25.608 40.53C25.182 40.006, 25.182 39.254, 25.608 38.73L27.025 36.989C27.281 36.674, 27.391 36.264, 27.326 35.863L26.97 33.646C26.863 32.979, 27.239 32.328, 27.87 32.088L29.968 31.288C30.347 31.143, 30.647 30.843, 30.792 30.464L31.592 28.366C31.833 27.735, 32.483 27.359, 33.15 27.466L35.367 27.822C35.768 27.887, 36.178 27.777, 36.493 27.52L38.235 26.104Z"})})}default:return jsx("circle",{cx:$(t),cy:$(e),r:$(n),transform:A`rotate(0,${t},${e})`})}}var cl=q(()=>{"use strict";ae();ht();});function On(t,e,n,o){let r=t==="top-left"?0:t==="top-right"?1:3,a=(r+2)%4;return [0,1,2,3].map(i=>i===r||o&&i===a?n:e)}function ll(t,e,n,o){return [[t+o,e],[t+n-o,e],[t+n,e+o],[t+n,e+n-o],[t+n-o,e+n],[t+o,e+n],[t,e+n-o],[t,e+o]]}function ul(t,e,n,o){let r=n/7,a=Math.max(0,(o+Math.SQRT2-2)*r);return tt(ll(t,e,n,o*r))+tt(ll(t+r,e+r,5*r,a))}function ml(t,e,n,o,r=false){let a=n/7,i=c=>r?On(o,0,c,true):On(o,c,0,true);return O(t,e,n,n,i(2.5*a))+O(t+a,e+a,5*a,5*a,i(1.5*a))}function ud(t,e,n,o){let r=n/7;return O(t,e,n,n,On(o,2.6*r,0,false))+O(t+r,e+r,5*r,5*r,On(o,1.6*r,0,false))}function md(t,e,n){let o=n/7,r=t+n/2,a=e+n/2;return tt(Wn(r,a,3.5*o,3.5*o,4,96))+tt(Wn(r,a,2.5*o,2.5*o,4,96))}function dl(t,e,n,o,r){let a=o,i=n/2,c=(i-a)*.55,s=(l,u)=>A`${t+l} ${e+u}`;return A`M${s(a,0)}`+A`C${s(a+c,0)} ${s(i-c,r)} ${s(i,r)}`+A`C${s(i+c,r)} ${s(n-a-c,0)} ${s(n-a,0)}`+A`A${a} ${a} 0 0 1 ${s(n,a)}`+A`C${s(n,a+c)} ${s(n-r,i-c)} ${s(n-r,i)}`+A`C${s(n-r,i+c)} ${s(n,n-a-c)} ${s(n,n-a)}`+A`A${a} ${a} 0 0 1 ${s(n-a,n)}`+A`C${s(n-a-c,n)} ${s(i+c,n-r)} ${s(i,n-r)}`+A`C${s(i-c,n-r)} ${s(a+c,n)} ${s(a,n)}`+A`A${a} ${a} 0 0 1 ${s(0,n-a)}`+A`C${s(0,n-a-c)} ${s(r,i+c)} ${s(r,i)}`+A`C${s(r,i-c)} ${s(0,a+c)} ${s(0,a)}`+A`A${a} ${a} 0 0 1 ${s(a,0)}Z`}function dd(t,e,n){let o=n/7,r=.12*o;return dl(t,e,n,1.4*o,r)+dl(t+o,e+o,5*o,.7*o,r)}function fl(t,e,n,o,r,a){let i=n/2,c=(s,l)=>A`${t+s} ${e+l}`;return A`M${c(o,0)}H${t+n-o}`+A`A${o} ${o} 0 0 1 ${c(n,o)}`+A`V${e+r}`+A`C${c(n,r+1.55*a)} ${c(i+1.6*a,n)} ${c(i,n)}`+A`C${c(i-1.6*a,n)} ${c(0,r+1.55*a)} ${c(0,r)}`+A`V${e+o}A${o} ${o} 0 0 1 ${c(o,0)}Z`}function fd(t,e,n){let o=n/7;return fl(t,e,n,.7*o,3.9*o,o)+fl(t+o,e+o,5*o,.35*o,2.7*o,.8*o)}function hd(t,e,n,o){let r=n/7;return O(t,e,n,n,On(o,.5*r,2.5*r,false))+O(t+r,e+r,5*r,5*r,On(o,.25*r,1.5*r,false))}function pd(t,e,n){let o=n/7;return A`M ${t} ${e}v ${n}h ${n}v -${n}z`+A`M ${t+o} ${e+o}h ${5*o}v ${5*o}h -${5*o}z`}function gd(t,e,n){let o=n/7,r=o*.875,a=o*.4375,i=A`M ${t+r} ${e}`+A`h ${n-2*r}`+A`a ${r} ${r} 0 0 1 ${r} ${r}`+A`v ${n-2*r}`+A`a ${r} ${r} 0 0 1 ${-r} ${r}`+A`h ${-(n-2*r)}`+A`a ${r} ${r} 0 0 1 ${-r} ${-r}`+A`v ${-(n-2*r)}`+A`a ${r} ${r} 0 0 1 ${r} ${-r}z`,c=A`M ${t+o+a} ${e+o}`+A`h ${5*o-2*a}`+A`a ${a} ${a} 0 0 1 ${a} ${a}`+A`v ${5*o-2*a}`+A`a ${a} ${a} 0 0 1 ${-a} ${a}`+A`h ${-(5*o-2*a)}`+A`a ${a} ${a} 0 0 1 ${-a} ${-a}`+A`v ${-(5*o-2*a)}`+A`a ${a} ${a} 0 0 1 ${a} ${-a}z`;return i+c}function bd(t,e,n){let o=t+n/2,r=e+n/2,a=it(n/2),i=it(n*(2.5/7));return A`M ${o-a} ${r}`+A`a ${a} ${a} 0 1 0 ${a*2} 0`+A`a ${a} ${a} 0 1 0 ${-a*2} 0z`+A`M ${o-i} ${r}`+A`a ${i} ${i} 0 1 1 ${i*2} 0`+A`a ${i} ${i} 0 1 1 ${-i*2} 0z`}function _d(t,e,n){let o=n/74.7002,r=c=>c*o+t,a=c=>c*o+e;return A`M${r(37.3496)} ${a(0)}C${r(39.2939)} ${a(0)} ${r(40.9948)} ${a(1.03842)} ${r(41.9287)} ${a(2.59082)}C${r(43.2293)} ${a(1.34013)} ${r(45.1347)} ${a(.780267)} ${r(47.0098)} ${a(1.28027)}C${r(48.8871)} ${a(1.78928)} ${r(50.261)} ${a(3.23767)} ${r(50.7578)} ${a(4.98438)}C${r(52.3454)} ${a(4.0996)} ${r(54.3432)} ${a(4.047)} ${r(56.0303)} ${a(5.01953)}C${r(57.7094)} ${a(5.98752)} ${r(58.6586)} ${a(7.73647)} ${r(58.6924)} ${a(9.5459)}C${r(60.4517)} ${a(9.10661)} ${r(62.3883)} ${a(9.57215)} ${r(63.7598)} ${a(10.9502)}C${r(65.1282)} ${a(12.3253)} ${r(65.5963)} ${a(14.2585)} ${r(65.1641)} ${a(16.0127)}C${r(66.974)} ${a(16.044)} ${r(68.7242)} ${a(16.9982)} ${r(69.7002)} ${a(18.6797)}C${r(70.6781)} ${a(20.3647)} ${r(70.6241)} ${a(22.3635)} ${r(69.7402)} ${a(23.9502)}C${r(71.4776)} ${a(24.4496)} ${r(72.9194)} ${a(25.8232)} ${r(73.4199)} ${a(27.7002)}C${r(73.927)} ${a(29.5707)} ${r(73.3661)} ${a(31.4794)} ${r(72.1104)} ${a(32.7822)}C${r(73.6621)} ${a(33.7163)} ${r(74.7002)} ${a(35.4166)} ${r(74.7002)} ${a(37.3604)}C${r(74.7001)} ${a(39.307)} ${r(73.6582)} ${a(41.0084)} ${r(72.1025)} ${a(41.9414)}C${r(73.357)} ${a(43.245)} ${r(73.9207)} ${a(45.1525)} ${r(73.4199)} ${a(47.0303)}C${r(72.9187)} ${a(48.9027)} ${r(71.4782)} ${a(50.2735)} ${r(69.7383)} ${a(50.7734)}C${r(70.6201)} ${a(52.3601)} ${r(70.6716)} ${a(54.3549)} ${r(69.7002)} ${a(56.04)}C${r(68.7237)} ${a(57.7225)} ${r(66.9721)} ${a(58.6729)} ${r(65.1611)} ${a(58.7031)}C${r(65.598)} ${a(60.4623)} ${r(65.131)} ${a(62.3982)} ${r(63.7598)} ${a(63.7695)}C${r(62.3847)} ${a(65.138)} ${r(60.4515)} ${a(65.6061)} ${r(58.6973)} ${a(65.1738)}C${r(58.6635)} ${a(66.9833)} ${r(57.7094)} ${a(68.7322)} ${r(56.0303)} ${a(69.7002)}C${r(54.3461)} ${a(70.6777)} ${r(52.348)} ${a(70.6248)} ${r(50.7617)} ${a(69.7422)}C${r(50.2643)} ${a(71.4831)} ${r(48.8896)} ${a(72.9284)} ${r(47.0098)} ${a(73.4297)}C${r(45.1389)} ${a(73.9368)} ${r(43.2296)} ${a(73.3763)} ${r(41.9268)} ${a(72.1201)}C${r(40.9927)} ${a(73.6717)} ${r(39.2932)} ${a(74.71)} ${r(37.3496)} ${a(74.71)}C${r(35.4051)} ${a(74.7098)} ${r(33.7042)} ${a(73.6711)} ${r(32.7705)} ${a(72.1182)}C${r(31.4697)} ${a(73.3758)} ${r(29.5597)} ${a(73.9418)} ${r(27.6797)} ${a(73.4404)}V${a(73.4502)}C${r(25.8065)} ${a(72.9422)} ${r(24.434)} ${a(71.4985)} ${r(23.9346)} ${a(69.7568)}C${r(22.3504)} ${a(70.6301)} ${r(20.3591)} ${a(70.6781)} ${r(18.6797)} ${a(69.71)}C${r(16.9957)} ${a(68.7391)} ${r(16.045)} ${a(66.9831)} ${r(16.0166)} ${a(65.168)}C${r(14.2547)} ${a(65.6091)} ${r(12.3134)} ${a(65.1435)} ${r(10.9395)} ${a(63.7695)}C${r(9.5687)} ${a(62.3919)} ${r(9.10168)} ${a(60.454)} ${r(9.53809)} ${a(58.6973)}C${r(7.72791)} ${a(58.6641)} ${r(5.97815)} ${a(57.71)} ${r(5.00977)} ${a(56.0303)}C${r(4.03552)} ${a(54.3517)} ${r(4.08377)} ${a(52.3649)} ${r(4.95801)} ${a(50.7812)}C${r(3.21705)} ${a(50.2839)} ${r(1.77087)} ${a(48.9101)} ${r(1.26953)} ${a(47.0303)}V${a(47.0205)}C${r(.762081)} ${a(45.1489)} ${r(1.32758)} ${a(43.2375)} ${r(2.58496)} ${a(41.9346)}C${r(1.03604)} ${a(41)} ${r(108484e-9)} ${a(39.3019)} ${r(0)} ${a(37.3604)}C${r(0)} ${a(35.4159)} ${r(1.03815)} ${a(33.7141)} ${r(2.59082)} ${a(32.7803)}C${r(1.34044)} ${a(31.4797)} ${r(.780389)} ${a(29.575)} ${r(1.28027)} ${a(27.7002)}C${r(1.78258)} ${a(25.8232)} ${r(3.22806)} ${a(24.4482)} ${r(4.97363)} ${a(23.9512)}C${r(4.08938)} ${a(22.3638)} ${r(4.03743)} ${a(20.3664)} ${r(5.00977)} ${a(18.6797)}C${r(5.97815)} ${a(16.9999)} ${r(7.72788)} ${a(16.0496)} ${r(9.53809)} ${a(16.0166)}C${r(9.10139)} ${a(14.2576)} ${r(9.56846)} ${a(12.3214)} ${r(10.9395)} ${a(10.9502)}C${r(12.3171)} ${a(9.57911)} ${r(14.2558)} ${a(9.11137)} ${r(16.0127)} ${a(9.54785)}C${r(16.0426)} ${a(7.73421)} ${r(16.9969)} ${a(5.97989)} ${r(18.6797)} ${a(5.00977)}C${r(20.3596)} ${a(4.03474)} ${r(22.3521)} ${a(4.08468)} ${r(23.9365)} ${a(4.96094)}C${r(24.4378)} ${a(3.22749)} ${r(25.8059)} ${a(1.7898)} ${r(27.6797)} ${a(1.29004)}C${r(29.5511)} ${a(.78264)} ${r(31.4617)} ${a(1.34357)} ${r(32.7646)} ${a(2.60059)}C${r(33.6971)} ${a(1.04268)} ${r(35.4013)} ${a(152405e-9)} ${r(37.3496)} ${a(0)}ZM${r(41.0615)} ${a(9.17578)}C${r(40.1006)} ${a(10.1057)} ${r(38.793)} ${a(10.6797)} ${r(37.3496)} ${a(10.6797)}C${r(35.9064)} ${a(10.6796)} ${r(34.5985)} ${a(10.1066)} ${r(33.6377)} ${a(9.17676)}C${r(32.9511)} ${a(10.3241)} ${r(31.8358)} ${a(11.2176)} ${r(30.4404)} ${a(11.5898)}C${r(29.0527)} ${a(11.9661)} ${r(27.6436)} ${a(11.7542)} ${r(26.4766)} ${a(11.1074)}C${r(26.1072)} ${a(12.3879)} ${r(25.2629)} ${a(13.5333)} ${r(24.0195)} ${a(14.25)}C${r(22.7695)} ${a(14.9754)} ${r(21.347)} ${a(15.1322)} ${r(20.0479)} ${a(14.8047)}C${r(20.0289)} ${a(16.1454)} ${r(19.5108)} ${a(17.4793)} ${r(18.4902)} ${a(18.5)}C${r(17.4696)} ${a(19.5158)} ${r(16.1409)} ${a(20.033)} ${r(14.8066)} ${a(20.0566)}C${r(15.1312)} ${a(21.3534)} ${r(14.9738)} ${a(22.7723)} ${r(14.25)} ${a(24.0195)}C${r(13.5243)} ${a(25.2699)} ${r(12.3701)} ${a(26.1148)} ${r(11.082)} ${a(26.4795)}C${r(11.7347)} ${a(27.6479)} ${r(11.9529)} ${a(29.062)} ${r(11.5801)} ${a(30.46)}C${r(11.2085)} ${a(31.8485)} ${r(10.3194)} ${a(32.9607)} ${r(9.17578)} ${a(33.6475)}C${r(10.106)} ${a(34.6084)} ${r(10.6797)} ${a(35.9167)} ${r(10.6797)} ${a(37.3604)}C${r(10.6796)} ${a(38.805)} ${r(10.1053)} ${a(40.1141)} ${r(9.17383)} ${a(41.0752)}C${r(10.3132)} ${a(41.7614)} ${r(11.1999)} ${a(42.871)} ${r(11.5703)} ${a(44.2598)}C${r(11.946)} ${a(45.6504)} ${r(11.7335)} ${a(47.0592)} ${r(11.0889)} ${a(48.2266)}C${r(12.377)} ${a(48.593)} ${r(13.5297)} ${a(49.441)} ${r(14.25)} ${a(50.6904)}C${r(14.9754)} ${a(51.9405)} ${r(15.1322)} ${a(53.3629)} ${r(14.8047)} ${a(54.6621)}C${r(16.142)} ${a(54.6835)} ${r(17.4721)} ${a(55.2016)} ${r(18.4902)} ${a(56.2197)}C${r(19.5097)} ${a(57.2441)} ${r(20.0278)} ${a(58.5787)} ${r(20.0479)} ${a(59.918)}C${r(21.3469)} ${a(59.5917)} ${r(22.7696)} ${a(59.7493)} ${r(24.0195)} ${a(60.4697)}C${r(25.2676)} ${a(61.1892)} ${r(26.1117)} ${a(62.3406)} ${r(26.4775)} ${a(63.627)}C${r(27.6424)} ${a(62.9822)} ${r(29.0498)} ${a(62.7688)} ${r(30.4404)} ${a(63.1396)}C${r(31.8284)} ${a(63.5112)} ${r(32.9402)} ${a(64.3999)} ${r(33.627)} ${a(65.543)}C${r(34.5887)} ${a(64.6072)} ${r(35.9012)} ${a(64.0304)} ${r(37.3496)} ${a(64.0303)}C${r(38.7912)} ${a(64.0303)} ${r(40.098)} ${a(64.6023)} ${r(41.0586)} ${a(65.5303)}C${r(41.7458)} ${a(64.3887)} ${r(42.8594)} ${a(63.5007)} ${r(44.25)} ${a(63.1299)}C${r(45.643)} ${a(62.7522)} ${r(47.057)} ${a(62.9676)} ${r(48.2266)} ${a(63.6201)}C${r(48.5931)} ${a(62.3323)} ${r(49.4413)} ${a(61.1801)} ${r(50.6904)} ${a(60.46)}C${r(51.9373)} ${a(59.7364)} ${r(53.3558)} ${a(59.5781)} ${r(54.6523)} ${a(59.9023)}C${r(54.6744)} ${a(58.5659)} ${r(55.1925)} ${a(57.2372)} ${r(56.21)} ${a(56.2197)}C${r(57.2339)} ${a(55.2007)} ${r(58.5676)} ${a(54.6816)} ${r(59.9062)} ${a(54.6611)}C${r(59.5835)} ${a(53.3649)} ${r(59.7414)} ${a(51.9468)} ${r(60.46)} ${a(50.7002)}C${r(61.1797)} ${a(49.4517)} ${r(62.3312)} ${a(48.6068)} ${r(63.6182)} ${a(48.2412)}C${r(62.9651)} ${a(47.0726)} ${r(62.7473)} ${a(45.658)} ${r(63.1201)} ${a(44.2598)}C${r(63.4916)} ${a(42.8718)} ${r(64.3794)} ${a(41.7591)} ${r(65.5225)} ${a(41.0723)}C${r(64.5929)} ${a(40.1115)} ${r(64.0206)} ${a(38.8033)} ${r(64.0205)} ${a(37.3604)}C${r(64.0205)} ${a(35.9186)} ${r(64.5915)} ${a(34.611)} ${r(65.5195)} ${a(33.6504)}C${r(64.3785)} ${a(32.9631)} ${r(63.4908)} ${a(31.8501)} ${r(63.1201)} ${a(30.46)}C${r(62.7421)} ${a(29.0656)} ${r(62.9572)} ${a(27.6498)} ${r(63.6113)} ${a(26.4795)}C${r(62.3272)} ${a(26.1115)} ${r(61.1784)} ${a(25.2657)} ${r(60.46)} ${a(24.0195)}C${r(59.7364)} ${a(22.7727)} ${r(59.5781)} ${a(21.3541)} ${r(59.9023)} ${a(20.0576)}C${r(58.5626)} ${a(20.038)} ${r(57.23)} ${a(19.52)} ${r(56.21)} ${a(18.5)}C${r(55.1931)} ${a(17.4783)} ${r(54.675)} ${a(16.1482)} ${r(54.6523)} ${a(14.8125)}C${r(53.3557)} ${a(15.1357)} ${r(51.9374)} ${a(14.9785)} ${r(50.6904)} ${a(14.2598)}C${r(49.4399)} ${a(13.5339)} ${r(48.5931)} ${a(12.3801)} ${r(48.2285)} ${a(11.0918)}C${r(47.0603)} ${a(11.7439)} ${r(45.6474)} ${a(11.9624)} ${r(44.25)} ${a(11.5898)}V${a(11.5801)}C${r(42.8613)} ${a(11.2085)} ${r(41.7483)} ${a(10.3196)} ${r(41.0615)} ${a(9.17578)}Z`}function Wa(t){let e=t/70;return {scale:e,transform:(o,r)=>(o-5)*e+r}}function yd(t,e,n){let{scale:o,transform:r}=Wa(n);return A`M ${r(5,t)} ${r(30,e)}v ${20*o}a ${25*o} ${25*o}, 0, 0, 0, ${25*o} ${25*o}h ${45*o}v -${45*o}a ${25*o} ${25*o}, 0, 0, 0, -${25*o} -${25*o}h -${20*o}H ${r(5,t)}zM ${r(30,t)} ${r(15,e)}h ${20*o}a ${15*o} ${15*o}, 0, 0, 1, ${15*o} ${15*o}v ${35*o}h -${35*o}a ${15*o} ${15*o}, 0, 0, 1, -${15*o} -${15*o}v -${35*o}z`}function $d(t,e,n){let o=n/7,r=o*1.5,a=o*.75,i=A`M ${t+r} ${e}`+A`h ${n-2*r}`+A`a ${r} ${r} 0 0 1 ${r} ${r}`+A`v ${n-2*r}`+A`a ${r} ${r} 0 0 1 ${-r} ${r}`+A`h ${-(n-2*r)}`+A`a ${r} ${r} 0 0 1 ${-r} ${-r}`+A`v ${-(n-2*r)}`+A`a ${r} ${r} 0 0 1 ${r} ${-r}z`,c=A`M ${t+o+a} ${e+o}`+A`h ${5*o-2*a}`+A`a ${a} ${a} 0 0 1 ${a} ${a}`+A`v ${5*o-2*a}`+A`a ${a} ${a} 0 0 1 ${-a} ${a}`+A`h ${-(5*o-2*a)}`+A`a ${a} ${a} 0 0 1 ${-a} ${-a}`+A`v ${-(5*o-2*a)}`+A`a ${a} ${a} 0 0 1 ${a} ${-a}z`;return i+c}function xd(t,e,n){let{scale:o,transform:r}=Wa(n);return A`M ${r(5,t)} ${r(40,e)}a ${35*o} ${35*o}, 0, 0, 0, ${35*o} ${35*o}h ${30*o}a ${5*o} ${5*o}, 0, 0, 0, ${5*o} -${5*o}v -${30*o}a ${35*o} ${35*o}, 0, 0, 0, -${35*o} -${35*o}a ${35*o} ${35*o}, 0, 0, 0, -${35*o} ${35*o}zM ${r(40,t)} ${r(15,e)}a ${25*o} ${25*o}, 0, 0, 1, ${25*o} ${25*o}v ${25*o}h -${25*o}a ${25*o} ${25*o}, 0, 0, 1, -${25*o} -${25*o}a ${25*o} ${25*o}, 0, 0, 1, ${25*o} -${25*o}z`}function Sd(t,e,n){let{scale:o,transform:r}=Wa(n);return A`M ${r(5,t)} ${r(30,e)}v ${20*o}a ${25*o} ${25*o}, 0, 0, 0, ${25*o} ${25*o}h ${45*o}v -${45*o}a ${25*o} ${25*o}, 0, 0, 0, -${25*o} -${25*o}h -${20*o}a ${25*o} ${25*o}, 0, 0, 0, -${25*o} ${25*o}M ${r(30,t)} ${r(15,e)}h ${20*o}a ${15*o} ${15*o}, 0, 0, 1, ${15*o} ${15*o}v ${35*o}h -${35*o}a ${15*o} ${15*o}, 0, 0, 1, -${15*o} -${15*o}v -${20*o}a ${15*o} ${15*o}, 0, 0, 1, ${15*o} -${15*o}z`}function Md(t,e,n){let o=n/70,r=t+n/2-40*o,a=e+n/2-40*o,i=(s,l)=>s*o+l;return A`M${i(35.19239999999999,r)} ${i(5.837547376725838,a)}C${i(37.69667692307692,r)} ${i(3.8737070690335305,a)}, ${i(41.218430769230764,r)} ${i(3.8737092228796843,a)}, ${i(43.722707692307694,r)} ${i(5.837547376725838,a)}L${i(46.62781538461539,r)} ${i(8.115648915187375,a)}L${i(50.23356923076923,r)} ${i(7.32361506903353,a)}C${i(53.342,r)} ${i(6.640824299802762,a)}, ${i(56.51483076923077,r)} ${i(8.168784299802759,a)}, ${i(57.91892307692308,r)} ${i(11.024719684418145,a)}L${i(59.54787692307692,r)} ${i(14.337679684418145,a)}L${i(63.14027692307692,r)} ${i(15.188578145956608,a)}C${i(66.23707692307693,r)} ${i(15.922091992110452,a)}, ${i(68.43270769230769,r)} ${i(18.675396607495067,a)}, ${i(68.45876923076924,r)} ${i(21.857768915187375,a)}L${i(68.48892307692307,r)} ${i(25.54931045364891,a)}L${i(71.35633846153846,r)} ${i(27.874602761341222,a)}C${i(73.82830769230769,r)} ${i(29.879187376725838,a)}, ${i(74.61187692307692,r)} ${i(33.312418145956606,a)}, ${i(73.25452307692306,r)} ${i(36.19103353057199,a)}L${i(71.68006153846153,r)} ${i(39.530141222879685,a)}L${i(73.25452307692306,r)} ${i(42.86924891518738,a)}C${i(74.61187692307692,r)} ${i(45.747864299802764,a)}, ${i(73.82830769230769,r)} ${i(49.18109506903353,a)}, ${i(71.35633846153846,r)} ${i(51.18567968441815,a)}L${i(68.48892307692307,r)} ${i(53.510971992110456,a)}L${i(68.45876923076924,r)} ${i(57.202664299802755,a)}C${i(68.43270769230769,r)} ${i(60.38497199211046,a)}, ${i(66.23707692307693,r)} ${i(63.13823353057199,a)}, ${i(63.14027692307692,r)} ${i(63.871833530572,a)}L${i(59.54787692307692,r)} ${i(64.72260276134121,a)}L${i(57.91892307692308,r)} ${i(68.03564891518737,a)}C${i(56.51483076923077,r)} ${i(70.89164891518737,a)}, ${i(53.342,r)} ${i(72.41958737672583,a)}, ${i(50.23356923076923,r)} ${i(71.7368181459566,a)}L${i(46.62781538461539,r)} ${i(70.94463353057199,a)}L${i(43.722707692307694,r)} ${i(73.22275660749506,a)}C${i(41.218430769230764,r)} ${i(75.18663353057198,a)}, ${i(37.69667692307692,r)} ${i(75.18663353057198,a)}, ${i(35.19239999999999,r)} ${i(73.22275660749506,a)}L${i(32.28729230769231,r)} ${i(70.94463353057199,a)}L${i(28.68153846153846,r)} ${i(71.7368181459566,a)}C${i(25.573215384615384,r)} ${i(72.41958737672583,a)}, ${i(22.400384615384613,r)} ${i(70.89164891518737,a)}, ${i(20.996141538461536,r)} ${i(68.03564891518737,a)}L${i(19.36720923076923,r)} ${i(64.72260276134121,a)}L${i(15.774852307692306,r)} ${i(63.871833530572,a)}C${i(12.67803076923077,r)} ${i(63.13823353057199,a)}, ${i(10.48237846153846,r)} ${i(60.38497199211046,a)}, ${i(10.45636,r)} ${i(57.202664299802755,a)}L${i(10.426163076923077,r)} ${i(53.510971992110456,a)}L${i(7.558747692307692,r)} ${i(51.18567968441815,a)}C${i(5.086880338461539,r)} ${i(49.18109506903353,a)}, ${i(4.303258769230769,r)} ${i(45.747864299802764,a)}, ${i(5.660599692307692,r)} ${i(42.86924891518738,a)}L${i(7.235153846153846,r)} ${i(39.530141222879685,a)}L${i(5.660599692307692,r)} ${i(36.19103353057199,a)}C${i(4.3032566153846155,r)} ${i(33.312418145956606,a)}, ${i(5.086885938461538,r)} ${i(29.879187376725838,a)}, ${i(7.558747692307692,r)} ${i(27.874602761341222,a)}L${i(10.426163076923077,r)} ${i(25.54931045364891,a)}L${i(10.45636,r)} ${i(21.857768915187375,a)}C${i(10.48237846153846,r)} ${i(18.67537506903353,a)}, ${i(12.678052307692308,r)} ${i(15.922091992110452,a)}, ${i(15.774852307692306,r)} ${i(15.188578145956608,a)}L${i(19.36720923076923,r)} ${i(14.337679684418145,a)}L${i(20.996141538461536,r)} ${i(11.024719684418145,a)}C${i(22.400384615384613,r)} ${i(8.168784299802759,a)}, ${i(25.573215384615384,r)} ${i(6.640824299802762,a)}, ${i(28.68153846153846,r)} ${i(7.32361506903353,a)}L${i(32.28729230769231,r)} ${i(8.115648915187375,a)}L${i(35.19239999999999,r)} ${i(5.837547376725838,a)}M${i(39.45766153846154,r)} ${i(13.665055069033532,a)}L${i(37.01498461538461,r)} ${i(15.58053506903353,a)}C${i(35.39098461538461,r)} ${i(16.854061222879682,a)}, ${i(33.282799999999995,r)} ${i(17.335251992110454,a)}, ${i(31.26701538461538,r)} ${i(16.892464299802757,a)}L${i(28.235046153846152,r)} ${i(16.22649506903353,a)}L${i(26.865415384615382,r)} ${i(19.012107376725837,a)}C${i(25.954812307692308,r)} ${i(20.864178145956608,a)}, ${i(24.264193846153844,r)} ${i(22.212399684418145,a)}, ${i(22.255926153846154,r)} ${i(22.688076607495066,a)}L${i(19.235393846153844,r)} ${i(23.40354122287968,a)}L${i(19.21,r)} ${i(26.507556607495065,a)}C${i(19.19313538461538,r)} ${i(28.57137199211045,a)}, ${i(18.25492,r)} ${i(30.519525838264297,a)}, ${i(16.651919999999997,r)} ${i(31.81937199211045,a)}L${i(14.240926153846154,r)} ${i(33.774633530572,a)}L${i(15.564830769230769,r)} ${i(36.58238737672584,a)}C${i(16.445064615384617,r)} ${i(38.44891045364892,a)}, ${i(16.445064615384617,r)} ${i(40.611371992110456,a)}, ${i(15.564830769230769,r)} ${i(42.47811045364892,a)}L${i(14.240926153846154,r)} ${i(45.28564891518738,a)}L${i(16.651919999999997,r)} ${i(47.240910453648915,a)}L${i(13.883236923076923,r)} ${i(50.654971992110454,a)}L${i(16.651919999999997,r)} ${i(47.240910453648915,a)}C${i(18.25492,r)} ${i(48.54075660749507,a)}, ${i(19.19313538461538,r)} ${i(50.4891258382643,a)}, ${i(19.21,r)} ${i(52.5527258382643,a)}L${i(19.235393846153844,r)} ${i(55.65684891518738,a)}L${i(22.255926153846154,r)} ${i(56.37235660749507,a)}C${i(24.264193846153844,r)} ${i(56.847925838264295,a)}, ${i(25.954812307692308,r)} ${i(58.196233530571995,a)}, ${i(26.865415384615382,r)} ${i(60.0483258382643,a)}L${i(28.235046153846152,r)} ${i(62.833895069033524,a)}L${i(31.26701538461538,r)} ${i(62.1679258382643,a)}C${i(33.282799999999995,r)} ${i(61.72509506903353,a)}, ${i(35.39098461538461,r)} ${i(62.20626429980276,a)}, ${i(37.01498461538461,r)} ${i(63.47983353057199,a)}L${i(39.45766153846154,r)} ${i(65.39524891518737,a)}L${i(41.90012307692308,r)} ${i(63.47983353057199,a)}C${i(43.524123076923075,r)} ${i(62.20626429980276,a)}, ${i(45.632307692307684,r)} ${i(61.72509506903353,a)}, ${i(47.6480923076923,r)} ${i(62.1679258382643,a)}L${i(50.68006153846154,r)} ${i(62.833895069033524,a)}L${i(52.049692307692304,r)} ${i(60.0483258382643,a)}C${i(52.960338461538456,r)} ${i(58.196233530571995,a)}, ${i(54.6508923076923,r)} ${i(56.847925838264295,a)}, ${i(56.65913846153846,r)} ${i(56.37235660749507,a)}L${i(59.67969230769231,r)} ${i(55.65684891518738,a)}L${i(59.70510769230769,r)} ${i(52.5527258382643,a)}C${i(59.72190769230769,r)} ${i(50.4891258382643,a)}, ${i(60.66012307692307,r)} ${i(48.54075660749507,a)}, ${i(62.263230769230766,r)} ${i(47.240910453648915,a)}L${i(64.67424615384616,r)} ${i(45.28564891518738,a)}L${i(63.35027692307692,r)} ${i(42.47811045364892,a)}C${i(62.47,r)} ${i(40.611371992110456,a)}, ${i(62.47,r)} ${i(38.44891045364892,a)}, ${i(63.35027692307692,r)} ${i(36.58238737672584,a)}L${i(64.67424615384616,r)} ${i(33.774633530572,a)}L${i(62.263230769230766,r)} ${i(31.81958737672584,a)}C${i(60.66012307692307,r)} ${i(30.519525838264297,a)}, ${i(59.72190769230769,r)} ${i(28.57137199211045,a)}, ${i(59.70510769230769,r)} ${i(26.507556607495065,a)}L${i(59.67969230769231,r)} ${i(23.40354122287968,a)}L${i(56.65913846153846,r)} ${i(22.688076607495066,a)}C${i(54.6508923076923,r)} ${i(22.212399684418145,a)}, ${i(52.960338461538456,r)} ${i(20.864178145956608,a)}, ${i(52.049692307692304,r)} ${i(19.012128915187375,a)}L${i(50.68006153846154,r)} ${i(16.22649506903353,a)}L${i(47.6480923076923,r)} ${i(16.892464299802757,a)}C${i(45.632307692307684,r)} ${i(17.335251992110454,a)}, ${i(43.524338461538456,r)} ${i(16.85408276134122,a)}, ${i(41.90012307692308,r)} ${i(15.58053506903353,a)}L${i(39.45766153846154,r)} ${i(13.665055069033532,a)}Z`}function to(t,e,n,o,r="top-left"){switch(o){case "leaf":return ml(t,e,n,r);case "leaf-reverse":return ml(t,e,n,r,true);case "drop":return ud(t,e,n,r);case "octagon":return ul(t,e,n,1.6);case "bevel":return ul(t,e,n,1.1);case "squircle":return md(t,e,n);case "cushion":return dd(t,e,n);case "shield":return fd(t,e,n);case "petal":return hd(t,e,n,r);case "gear":return _d(t,e,n);case "rounded":return gd(t,e,n);case "circle":return bd(t,e,n);case "diya":return yd(t,e,n);case "extra-rounded":return $d(t,e,n);case "message":return xd(t,e,n);case "pointy":return Sd(t,e,n);case "curly":return Md(t,e,n);default:return pd(t,e,n)}}var hl=q(()=>{"use strict";ae();ht();});var pl,gl=q(()=>{"use strict";pl={id:"Arrow",name:"Arrow",description:"QR code with arrow",wrapper:(t,e)=>jsx("svg",{height:"300",id:"svgQrWrapper",style:{width:"100%",height:"100%"},viewBox:"0 0 300 300",width:"300",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",children:jsxs("svg",{fill:"#000000",height:"300",viewBox:"0 0 300 300",width:"300",xmlns:"http://www.w3.org/2000/svg",children:[jsx("path",{d:"M73.57,175.23h0c.12-2.06.31-4.19.49-6.25s.48-4.13.85-6.13.79-4,1.27-5.95a30.21,30.21,0,0,1,1.94-5.28h0c.06-.18.13-.43.19-.67a3.55,3.55,0,0,0-2.8-4.19l-.18-.06a1.85,1.85,0,0,0-.54-.06c-.19,0-.31-.06-.49-.06s-.61-.06-.91-.06c-.61,0-1.21.06-1.82.06-1.21.12-2.37.25-3.52.43a62.08,62.08,0,0,0-6.8,1.45,58.45,58.45,0,0,0-6.43,2.31c-1,.42-2.07,1-3.1,1.4s-2,1.09-3,1.57a.76.76,0,0,0,.54,1.4h.07c1.09-.24,2.12-.55,3.15-.79s2.13-.48,3.16-.61A46,46,0,0,1,62,153c1.34-.06,2.73-.06,4.07-.06a62.58,62.58,0,0,0-7.23,10.43,85.58,85.58,0,0,0-6.55,15.36,107.86,107.86,0,0,0-5,32.53,104.06,104.06,0,0,0,5,32.29,90.47,90.47,0,0,0,15.54,28.52.94.94,0,0,0,1.27.19.89.89,0,0,0,.18-1.28h0a87.24,87.24,0,0,1-13.89-28.28A102.85,102.85,0,0,1,58,180.87a82.15,82.15,0,0,1,6.68-14,51.58,51.58,0,0,1,5.71-7.76c0,1.21,0,2.36.06,3.58.12,2.18.24,4.31.48,6.43s.49,4.25.85,6.37a1,1,0,0,0,.91.85A1.37,1.37,0,0,0,73.57,175.23Z",fill:e?.fgColor||"black",id:"CallToActionArrow"}),jsx("g",{fill:"none",transform:"translate(82, 95)scale(0.5)",children:t})]})})};});var _l,yl=q(()=>{"use strict";_l={id:"default",name:"Default",description:"Simple QR code without decorative elements",wrapper:t=>jsx("svg",{height:"300",id:"svgQrWrapper",style:{width:"100%",height:"100%"},viewBox:"0 0 300 300",width:"300",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",children:jsx("g",{fill:"none",transform:"translate(9, 9) scale(0.95)",children:t})})};});var xl,Sl=q(()=>{"use strict";xl={id:"Halloween",name:"Halloween",description:"QR code with Halloween theme",wrapper:t=>jsx("svg",{height:"300",id:"svgQrWrapper",style:{width:"100%",height:"100%"},viewBox:"0 0 300 300",width:"300",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",children:jsx("svg",{fill:"none",height:"300",viewBox:"0 0 300 300",width:"300",xmlns:"http://www.w3.org/2000/svg",children:jsxs("g",{transform:"translate(10, 10)",children:[jsx("circle",{cx:"138",cy:"167.682",fill:"white",r:"99.3177",stroke:"#F89941",strokeWidth:"20"}),jsx("rect",{fill:"url(#pattern0)",height:"110.806",width:"113",x:"81.0001",y:"124.097"}),jsx("ellipse",{cx:"167.989",cy:"67.8947",fill:"#F89941",rx:"35.4453",ry:"48.4419"}),jsx("path",{d:"M187.937 69.0763C187.937 82.6574 184.092 94.8451 178.005 103.57C171.912 112.304 163.736 117.381 154.992 117.381C146.247 117.381 138.072 112.304 131.979 103.57C125.891 94.8451 122.047 82.6574 122.047 69.0763C122.047 55.4952 125.891 43.3075 131.979 34.5823C138.072 25.8486 146.247 20.7714 154.992 20.7714C163.736 20.7714 171.912 25.8486 178.005 34.5823C184.092 43.3075 187.937 55.4952 187.937 69.0763Z",fill:"#F89941",stroke:"#E78249",strokeWidth:"5"}),jsx("ellipse",{cx:"154.072",cy:"69.4866",fill:"#F89941",rx:"34.0512",ry:"50.6615"}),jsx("path",{d:"M171.396 69.667C171.396 82.7394 167.562 94.4717 161.488 102.874C155.412 111.279 147.235 116.2 138.451 116.2C129.666 116.2 121.489 111.279 115.413 102.874C109.34 94.4717 105.506 82.7394 105.506 69.667C105.506 56.5946 109.34 44.8624 115.413 36.4603C121.489 28.0551 129.666 23.1344 138.451 23.1344C147.235 23.1344 155.412 28.0551 161.488 36.4603C167.562 44.8624 171.396 56.5946 171.396 69.667Z",fill:"#F89941",stroke:"#E78249",strokeWidth:"5"}),jsx("ellipse",{cx:"134.316",cy:"70.8486",fill:"#F89941",rx:"33.673",ry:"47.8511"}),jsx("ellipse",{fill:"#F89941",rx:"35.4453",ry:"48.4419",transform:"matrix(-1 0 0 1 106.743 68.4484)"}),jsx("path",{d:"M86.7942 69.6299C86.7942 83.2111 90.6388 95.3988 96.7262 104.124C102.819 112.858 110.995 117.935 119.739 117.935C128.484 117.935 136.659 112.858 142.753 104.124C148.84 95.3988 152.685 83.2111 152.685 69.6299C152.685 56.0488 148.84 43.8611 142.753 35.1359C136.659 26.4023 128.484 21.3251 119.739 21.3251C110.995 21.3251 102.819 26.4023 96.7262 35.1359C90.6388 43.8611 86.7942 56.0488 86.7942 69.6299Z",fill:"#F89941",stroke:"#E78249",strokeWidth:"5"}),jsx("ellipse",{fill:"#F89941",rx:"32.9438",ry:"50.3847",transform:"matrix(-1 0 0 1 119.744 69.7634)"}),jsx("path",{d:"M103.335 70.2207C103.335 83.293 107.169 95.0253 113.243 103.427C119.319 111.833 127.496 116.753 136.281 116.753C145.065 116.753 153.242 111.833 159.318 103.427C165.392 95.0253 169.226 83.293 169.226 70.2207C169.226 57.1483 165.392 45.416 159.318 37.014C153.242 28.6088 145.065 23.688 136.281 23.688C127.496 23.688 119.319 28.6088 113.243 37.014C107.169 45.416 103.335 57.1483 103.335 70.2207Z",fill:"#F89941",stroke:"#E78249",strokeWidth:"5"}),jsx("ellipse",{fill:"#F89941",rx:"32.3901",ry:"47.6163",transform:"matrix(-1 0 0 1 139.677 70.8708)"}),jsx("ellipse",{fill:"#F89941",rx:"33.2207",ry:"47.6163",transform:"matrix(-1 0 0 1 134.971 71.4245)"}),jsx("path",{d:"M158.85 46.6783C165.21 42.2516 166.538 40.633 167.867 39.0144C167.867 39.0144 169.806 43.8236 169.88 46.3566C169.954 48.8897 169.712 50.1469 167.248 51.6467C164.783 53.1464 155.406 53.0446 150.083 52.9746C149.31 52.5001 150.72 52.3371 158.85 46.6783Z",fill:"black"}),jsx("path",{d:"M115.765 46.5118C109.392 42.1412 108.058 40.5475 106.724 38.9538C106.724 38.9538 104.783 45.8361 104.758 46.822C104.733 47.808 104.657 50.8051 108.247 51.9995C111.837 53.194 119.234 52.7723 124.551 52.7272C125.322 52.2652 123.912 52.0991 115.765 46.5118Z",fill:"black"}),jsx("path",{d:"M160 90.4999C167.156 83.1595 169.5 78.2827 171.351 72.9348C172.24 70.3672 162.909 72.0429 158 72.9348C157.276 73.0664 155.751 76.9145 155 77C154.182 77.0932 151.841 73.0759 151 73.086C149.725 73.1013 147.727 73.086 145.875 73.4285C145.345 74.3645 146.367 77.5746 145.875 78.2827C145.321 78.2827 141.796 77.2604 141.242 76.4298C140.689 74.492 140.949 73.3629 140.118 72.5323C137.555 72.9075 138.023 72.6567 135.412 73.086C134.768 73.1919 133.09 77.7212 132.441 77.8195C131.615 77.9448 128.644 74.0088 127.809 74.1138C126.747 74.2475 124.821 74.4683 123.64 74.577C123.126 74.6244 123.554 77.5019 123.177 78.2827C122.898 78.8616 119.426 77.8921 118.5 77.5C118.037 76.5024 117.844 74.5583 117 74.577C111 74.1138 109.4 73.843 103.575 70.8713C103.575 70.8713 102.5 80 111 89C119.5 98 147.127 103.706 160 90.4999Z",fill:"black"}),jsx("path",{d:"M135.238 7.25181C137.192 1.73111 142.678 0.363204 145.935 0L148.377 1.81602C149.158 2.39714 149.842 2.40909 150.331 3.25657C150.331 4.22511 146.337 5.41975 142.429 6.582C137.545 8.03482 139.482 17.0534 142.429 19.2811C143.401 20.0152 143.524 19.9639 145.966 19.9639C148.029 19.9639 150.387 18.2474 151.566 17.3526C151.566 17.3526 151.861 20.2573 149.798 21.4777C147.735 22.698 143.578 21.8578 143.608 21.9658C144.493 23.9183 146.89 22.4887 148.029 23.3362C147.346 23.3362 146.556 24.2889 144.198 24.5329C142.672 24.5798 142.135 24.5329 140.956 23.9183C139.777 23.3037 139.482 22.8696 138.893 22.1395C136.83 23.3598 138.893 25.4305 138.893 25.4305C138.893 25.4305 134.472 25.8512 133.587 23.9183C133.264 23.2115 133.882 22.1395 133.587 21.9658C131.819 22.4539 130.935 23.4807 127.373 22.8696C124.312 22.3443 125.102 18.3211 124.451 17.3526C127.381 18.079 125.131 20.0392 129.327 19.9639C140.838 19.7576 132.796 14.1527 135.238 7.25181Z",fill:"#5D725F"}),jsxs("defs",{children:[jsx("pattern",{height:"1",id:"pattern0",patternContentUnits:"objectBoundingBox",width:"1"}),jsx("clipPath",{id:"clip0_2087_156668",children:jsx("rect",{fill:"white",height:"276",width:"276"})})]}),jsx("g",{fill:"none",transform:"translate(80, 122)scale(0.38)",children:t})]})})})};});var Ml,Cl=q(()=>{"use strict";Ml={id:"SquareBorder",name:"Square Border",description:"QR code with square decorative border",wrapper:(t,e)=>jsx("svg",{height:"300",id:"svgQrWrapper",style:{width:"100%",height:"100%"},viewBox:"0 0 300 300",width:"300",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",children:jsx("svg",{fill:"black",height:"300",viewBox:"0 0 316 316",width:"300",xmlns:"http://www.w3.org/2000/svg",children:jsxs("g",{children:[jsx("path",{clipRule:"evenodd",d:"M308 8H8v300h300V8ZM0 0v316h316V0H0Z",fill:e?.fgColor||"black",fillRule:"evenodd"}),jsx("g",{fill:"none",transform:"translate(20, 20) scale(0.92)",children:t})]})})})};});var wl,El=q(()=>{"use strict";wl={id:"StandardBox",name:"Standard Box",description:"QR code with standard box",wrapper:(t,e)=>jsx("svg",{height:"300",id:"svgQrWrapper",style:{width:"100%",height:"100%"},viewBox:"0 0 300 300",width:"300",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",children:jsxs("svg",{fill:"#000000",height:"300",viewBox:"0 0 300 300",width:"300",xmlns:"http://www.w3.org/2000/svg",children:[jsx("path",{d:"M243,1.7h-186a10.25,10.25,0,0,0-10.2,10.12v186A10.13,10.13,0,0,0,57,208H243a10.13,10.13,0,0,0,10.12-10.12v-186A10.13,10.13,0,0,0,243,1.7Zm2.36,193.05a5.46,5.46,0,0,1-5.47,5.47H60.16a5.46,5.46,0,0,1-5.47-5.47V14.93a5.46,5.46,0,0,1,5.47-5.47H239.91a5.46,5.46,0,0,1,5.47,5.47Z",fill:e?.fgColor||"black"}),jsx("path",{d:"M243.54,238.81H173.61a2.29,2.29,0,0,1-1.62-.67l-20.55-20.55a2.33,2.33,0,0,0-3.25,0l-20.55,20.55a2.29,2.29,0,0,1-1.62.67H56.09A9.15,9.15,0,0,0,46.93,248v41.17a9.16,9.16,0,0,0,9.16,9.16H243.61a9.09,9.09,0,0,0,9.09-9.16V248A9.16,9.16,0,0,0,243.54,238.81Z",fill:e?.fgColor||"black"}),jsx("g",{fill:"none",transform:"translate(60, 15)scale(0.6)",children:t})]})})};});var Rl,Pl=q(()=>{"use strict";Rl={id:"StrikedBox",name:"Striked Box",description:"QR code with striked box",wrapper:t=>jsx("svg",{height:"300",id:"svgQrWrapper",style:{width:"100%",height:"100%"},viewBox:"0 0 300 300",width:"300",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",children:jsxs("svg",{fill:"#22071b",height:"300",viewBox:"0 0 300 300",width:"300",xmlns:"http://www.w3.org/2000/svg",children:[jsx("path",{d:"M195.11,290.77l-7.28,4.88a2.16,2.16,0,0,0-.57,3,2.21,2.21,0,0,0,1.77.92,2.4,2.4,0,0,0,1.2-.35l7.28-4.88a2.14,2.14,0,0,0-2.4-3.54Z"}),jsx("path",{d:"M266.85,227.52l-7.28,4.87a2.16,2.16,0,0,0-.57,3,2.21,2.21,0,0,0,1.77.92,1.86,1.86,0,0,0,1.2-.35l7.28-4.88a2.13,2.13,0,1,0-2.4-3.53Z"}),jsx("path",{d:"M41,176.34l-9.11,6.08a2.15,2.15,0,0,0-.57,3,2.19,2.19,0,0,0,1.77.92,2.14,2.14,0,0,0,1.2-.35l9.12-6.08A2.14,2.14,0,0,0,41,176.34Z"}),jsx("path",{d:"M41,269.08l-9.11,6.07a2.15,2.15,0,0,0-.57,3,2.19,2.19,0,0,0,1.77.92,2.92,2.92,0,0,0,1.2-.35l9.12-6.08A2.14,2.14,0,0,0,41,269.08Z"}),jsx("path",{d:"M147,10.1a2.4,2.4,0,0,0,1.14-.35l7.7-5.16a2.13,2.13,0,0,0-2.4-3.53l-7.64,5.15a2.15,2.15,0,0,0-.56,3A2.19,2.19,0,0,0,147,10.1Z"}),jsx("path",{d:"M275.54,54.77a2.14,2.14,0,0,0-3-.56l-17.1,11.45V31.31a10.18,10.18,0,0,0-10.18-10.18H137.22l-10.39,7a2.4,2.4,0,0,1-1.2.35,2.21,2.21,0,0,1-1.77-.92,2.15,2.15,0,0,1,.57-3l1.41-.92,13.64-8.76a2.1,2.1,0,1,0-2.26-3.54L122,21.2h-8.13l-10.39,7a2.37,2.37,0,0,1-1.2.35,2.19,2.19,0,0,1-1.76-.92,2.15,2.15,0,0,1,.56-3L124,9.25a2.13,2.13,0,1,0-2.4-3.53l-23,15.48H58.2A10.18,10.18,0,0,0,48,31.38v28L31.34,70.46a2.09,2.09,0,0,0-.57,3,2,2,0,0,0,1.77.92,2.58,2.58,0,0,0,1.2-.35l14.35-9.54,3.18-2.12a2.14,2.14,0,1,1,2.41,3.53l-5.52,3.67V76.9l-7,4.66a2.15,2.15,0,0,0-.56,3,2,2,0,0,0,1.77.92,2.34,2.34,0,0,0,1.2-.36l7.35-4.94A2.13,2.13,0,0,1,52.69,84l-4.46,3v65.66L25.05,168.07a2.15,2.15,0,0,0-.57,3,2,2,0,0,0,1.77.92,2.37,2.37,0,0,0,1.2-.35l25-16.75a2,2,0,0,1,2.62.77,2.16,2.16,0,0,1-.57,3l-6.36,4.24V275a10.09,10.09,0,0,0,9.83,10.11l-5.87,4a2.15,2.15,0,0,0-.57,3,2.06,2.06,0,0,0,1.77.92,2.38,2.38,0,0,0,1.2-.36l23-15.41a2.14,2.14,0,0,1,2.41,3.54l-6.58,4.45h52l-5.58,3.75a2.14,2.14,0,0,0-.56,3,2,2,0,0,0,1.76.91,2.37,2.37,0,0,0,1.2-.35l30.54-20.28a2.15,2.15,0,0,1,3,.56,2.1,2.1,0,0,1-.57,3l-14.21,9.54H217l-4.6,3a2.16,2.16,0,0,0-.63,3,2.11,2.11,0,0,0,1.76,1,2,2,0,0,0,1.13-.36L237,277.35a2.14,2.14,0,1,1,2.33,3.6l-6.78,4.38h13a10.18,10.18,0,0,0,10.18-10.18v-91.1l-4.38,3a2.43,2.43,0,0,1-1.2.35,2.19,2.19,0,0,1-1.77-.92,2.15,2.15,0,0,1,.57-3l24.38-16.33a2.13,2.13,0,1,0-2.4-3.53l-15.48,10.25V91.53l-4.38,3a2.34,2.34,0,0,1-1.21.36,2.22,2.22,0,0,1-1.76-.92,2.15,2.15,0,0,1,.56-3l6.72-4.52,13.71-9.19a2.14,2.14,0,0,0-2.4-3.54l-11.24,7.57V75.84l-4.38,3a2.34,2.34,0,0,1-1.21.36,2.22,2.22,0,0,1-1.76-.92,2.15,2.15,0,0,1,.56-3l6.72-4.52,19.43-13.08A2.05,2.05,0,0,0,275.54,54.77ZM237,216.07h-172a5.23,5.23,0,0,1-5.23-5.24V38.94a5.22,5.22,0,0,1,5.23-5.23H237a5.22,5.22,0,0,1,5.23,5.23V210.83h.07A5.22,5.22,0,0,1,237,216.07Z"}),jsx("path",{d:"M270.45,139.8l-7.28,4.88a2.15,2.15,0,0,0-.56,3,2.22,2.22,0,0,0,1.76.92,2.44,2.44,0,0,0,1.21-.36l7.28-4.87a2.14,2.14,0,0,0-2.41-3.54Z"}),jsx("g",{fill:"none",transform:"translate(64, 38)scale(0.58)",children:t})]})})};});var Xa=q(()=>{"use strict";gl();yl();Sl();Cl();El();Pl();});var Ya,Al,xg,Sg,ja=q(()=>{"use strict";Xa();Xa();Ya={default:_l,Arrow:pl,StandardBox:wl,SquareBorder:Ml,StrikedBox:Rl,Halloween:xl},Al=t=>Ya[t],xg=()=>Object.values(Ya),Sg=()=>Object.keys(Ya);});function Fl(t){return `#${Za(t.r)}${Za(t.g)}${Za(t.b)}`}function ro(t){let e=mt(t);return !e||e.a>=1||e.a<=0?{color:t}:{color:Fl(e),opacity:it(e.a,3)}}function oo(t,e){let n=Math.min(Math.max(t.a,0),1);return {r:t.r*n+e.r*(1-n),g:t.g*n+e.g*(1-n),b:t.b*n+e.b*(1-n),a:1}}function Ad(t){return [...t].map(e=>({offset:Math.min(Math.max(e.offset/100,0),1),color:mt(e.color)??Tl})).sort((e,n)=>e.offset-n.offset)}function Ja(t,e){let n=t[0],o=t.at(-1);if(!(n&&o))return Tl;if(e<=n.offset)return n.color;if(e>=o.offset)return o.color;for(let r=0;r+1<t.length;r++){let a=t[r],i=t[r+1];if(e>=a.offset&&e<=i.offset){let c=i.offset-a.offset,s=c>0?(e-a.offset)/c:1,l=a.color.a+(i.color.a-a.color.a)*s,u=(m,f)=>{let d=m*a.color.a+(f*i.color.a-m*a.color.a)*s;return l>0?d/l:m+(f-m)*s};return {r:u(a.color.r,i.color.r),g:u(a.color.g,i.color.g),b:u(a.color.b,i.color.b),a:l}}}return o.color}function kl(t,e,n,o,r){let a=Ad(t);if(a.length===0)return {wedges:[]};let i=a[0].color.a,c=a.every(_=>Math.abs(_.color.a-i)<.002),s=[...new Set([0,...a.map(_=>_.offset),1])].sort((_,y)=>_-y),l=[];for(let _=0;_+1<s.length;_++){let y=s[_],M=s[_+1];if(M<=y)continue;let C=Ja(a,y+1e-9),x=Ja(a,M-1e-9),S=Math.max(Math.abs(C.r*C.a-x.r*x.a),Math.abs(C.g*C.a-x.g*x.a),Math.abs(C.b*C.a-x.b*x.a),Math.abs(C.a-x.a)*255),w=Math.ceil(S/vd),E=Math.ceil((M-y)*360/vl),P=Math.max(1,w,E);for(let R=0;R<P;R++)l.push([y+(M-y)*R/P,y+(M-y)*(R+1)/P]);}let u=l;if(l.length>Ll){let _=Math.ceil(l.length/Ll);u=[];for(let y=0;y<l.length;y+=_){let M=l.slice(y,y+_);u.push([M[0][0],M.at(-1)[1]]);}}let m=e-90,f=r/Math.cos(2*vl/2*(Math.PI/180)),d=_=>{let y=_*Math.PI/180;return [$(n+f*Math.cos(y)),$(o+f*Math.sin(y))]},p=`${$(n)} ${$(o)}`,h=_=>it((_%360+360)%360,4),g=u.length-1,b=u.map(([_,y],M)=>{let C=Ja(a,(_+y)/2),x=(y-_)*360,S=c&&M===0&&g>0?x:0,w=c&&M<g?x:0,E=m+_*360-S,P=m+y*360+w,[R,v]=d(E),[L,k]=d(P);return {d:`M${p}L${R} ${v}L${L} ${k}Z`,color:Fl(C),...c||C.a>=1?{}:{opacity:it(C.a,3)},from:h(E),sweep:it(P-E,4)}});return c&&i<1?{wedges:b,opacity:it(i,3)}:{wedges:b}}function Il(t,e,n,o){return (Math.atan2(o-e,n-t)*180/Math.PI%360+360)%360}function Nl(t,e,n){if(t>=n.x-1e-6&&t<=n.x+n.width+1e-6&&e>=n.y-1e-6&&e<=n.y+n.height+1e-6)return null;let r=[[n.x,n.y],[n.x+n.width,n.y],[n.x,n.y+n.height],[n.x+n.width,n.y+n.height]],a=Il(t,e,n.x+n.width/2,n.y+n.height/2),i=0,c=0;for(let[s,l]of r){let u=Il(t,e,s,l)-a;u>180?u-=360:u<=-180&&(u+=360),i=Math.min(i,u),c=Math.max(c,u);}return [a+i,a+c]}function Ol(t,e){let n=t[1]-t[0],o=e[1]-e[0];if(n>=360||o>=360)return true;let r=((e[0]-t[0])%360+360)%360;return r<=n||r+o>=360}var Za,Tl,vl,Ll,vd,ao=q(()=>{"use strict";ht();Dt();Za=t=>Math.round(Math.min(Math.max(t,0),255)).toString(16).padStart(2,"0");Tl={r:0,g:0,b:0,a:1};vl=4,Ll=720,vd=2;});var Hl={};dm(Hl,{QRCodeSVG:()=>ri,SUPPORTS_PATH2D:()=>Gd,convertImageSettingsToPixels:()=>zl,excavateModules:()=>co,generatePath:()=>ei,getContrastLevel:()=>qd,getContrastRatio:()=>Ud,getImageSettings:()=>Ee,getLuminance:()=>an,getSolidColor:()=>wt,hexToRgb:()=>Qd,resolveErrorLevel:()=>Bt});function co(t,e){return t.slice().map((n,o)=>o<e.y||o>=e.y+e.h?n:n.map((r,a)=>a<e.x||a>=e.x+e.w?r:false))}function ei(t,e=0){let n=[];return t.forEach((o,r)=>{let a=null;o.forEach((i,c)=>{if(!i&&a!==null){n.push(A`M${a+e} ${r+e}h${c-a}v1H${a+e}z`),a=null;return}if(c===o.length-1){if(!i)return;a===null?n.push(A`M${c+e},${r+e} h1v1H${c+e}z`):n.push(A`M${a+e},${r+e} h${c+1-a}v1H${a+e}z`);return}i&&a===null&&(a=c);});}),n.join("")}function Id(t,e,n){return t<7&&e<7||t>=n-7&&e<7||t<7&&e>=n-7}function Ka(t,e){let{margin:n,pixelSize:o,pattern:r="circle",plain:a=false}=e;if(al(r))return sl(t,{margin:n,pixelSize:o,pattern:r,scale:e.scale,plain:a});let i=Jr(e.scale,r),c=[],s=t.length,l=o*.45,u=a?()=>false:za(s);return t.forEach((m,f)=>{m.forEach((d,p)=>{if(d&&(a||!Id(p,f,s))){let h=(p+.5+n)*o,g=(f+.5+n)*o,b=`${p}-${f}`,_=c.length;if(u(p,f)){c.push(jsx("rect",{height:$(o),width:$(o),x:$(h-o/2),y:$(g-o/2)},b));return}switch(r){case "circle":c.push(jsx("circle",{cx:$(h),cy:$(g),r:$(l),transform:A`rotate(0,${h},${g})`},b));break;case "circle-large":{let y=o*.5;c.push(jsx("circle",{cx:$(h),cy:$(g),r:$(y),transform:A`rotate(0,${h},${g})`},b));}break;case "small-square":{let y=o*.357143;c.push(jsx("path",{d:A`M ${h-y} ${g-y}v ${o*.714286}h ${o*.714286}v -${o*.714286}z`,transform:A`rotate(0,${h},${g})`},b));}break;case "diamond":{let y=o*.357143;c.push(jsx("path",{d:A`M ${h-y} ${g-y}v ${o*.714286}h ${o*.714286}v -${o*.714286}z`,transform:A`rotate(45,${h},${g})`},b));}break;case "circle-mixed":{let y=(p+f)%3===0?Fd:(p+f)%2===0?1:1.25,M=l*y;c.push(jsx("circle",{cx:$(h),cy:$(g),r:$(M),transform:A`rotate(0,${h},${g})`},b));}break;case "pacman":{let y=o*.5,M=o*.357143;c.push(jsx("path",{d:A`M ${h-y} ${g-M}v ${o*.714286}h ${y}a ${y*.5} ${y*.5}, 0, 0, 0, 0 -${o*.714286}h -${y}v -${o*.714286}z`,transform:A`rotate(${(p+f)%2===0?0:90},${h},${g})`},b));}break;case "rounded":{let y=o*.5,M=o*.2;c.push(jsx("rect",{height:$(o),rx:$(M),ry:$(M),transform:A`rotate(0,${h},${g})`,width:$(o),x:$(h-y),y:$(g-y)},b));}break;case "square":{let y=o*.5;c.push(jsx("rect",{height:$(o),transform:A`rotate(0,${h},${g})`,width:$(o),x:$(h-y),y:$(g-y)},b));}break;case "vertical-line":{let y=o*.714286,M=o;c.push(jsx("path",{d:A`M ${h-o*.5} ${g-y*.5}v ${y}h ${M}v -${y}z`,transform:A`rotate(90,${h},${g})`},b));}break;default:c.push(jsx("circle",{cx:$(h),cy:$(g),r:$(l),transform:A`rotate(0,${h},${g})`},b));}if(i!==1&&c.length>_){let y=c.pop();c.push(jsx("g",{transform:A`translate(${h},${g}) scale(${$(i,6)}) translate(${-h},${-g})`,children:y},b));}}});}),c}function Td(t,e){let n=t*Math.PI/180,o=e/2,r=e/2,a=Math.sqrt(e*e+e*e)/2,i=o-a*Math.cos(n),c=r-a*Math.sin(n),s=o+a*Math.cos(n),l=r+a*Math.sin(n);return {x1:i,y1:c,x2:s,y2:l}}function ni(t,e){return `${t}-${Ye(JSON.stringify(e))}`}function kd(t,e,n,o,r){let a=t;if(t===0)switch(r){case "top-left":a=0;break;case "top-right":a=90;break;case "bottom-left":a=270;break;default:a=0;}let i=a*Math.PI/180,c=e+o/2,s=n+o/2,l=Math.sqrt(o*o+o*o)/2,u=c-l*Math.cos(i),m=s-l*Math.sin(i),f=c+l*Math.cos(i),d=s+l*Math.sin(i);return {x1:u,y1:m,x2:f,y2:d}}function so(t,e){return e.map((n,o)=>{let{color:r,opacity:a}=ro(n.color);return jsx("stop",{offset:`${n.offset}%`,stopColor:r,stopOpacity:a},`${t}-stop-${o}`)})}function Ql(t,e,n,o,r,a){let i=kl(e.stops,e.angle??0,n,o,r),c=i.wedges.map((s,l)=>jsx("path",{d:s.d,"data-arc":`${s.from} ${s.sweep}`,fill:s.color,fillOpacity:s.opacity,shapeRendering:s.opacity===void 0?void 0:"crispEdges"},`${t}-w-${l}`));return jsx("pattern",{"data-qrdx-conic":`${$(n)} ${$(o)}`,height:$(a),id:t,patternUnits:"userSpaceOnUse",width:$(a),x:0,y:0,children:i.opacity===void 0?c:jsx("g",{opacity:i.opacity,children:c})},t)}function Nd(t="center"){let[e,n]=t.split("-"),o=t==="center"?"center":e,r=n??(e==="left"||e==="right"?e:"center");return {x:r==="left"?0:r==="right"?1:.5,y:o==="top"?0:o==="bottom"?1:.5}}function Ul(t,e,n){let o=e.scale??1,r=e.fit==="tile",a=r?n/4*o:n,i=e.underlay?ro(e.underlay):null,c=r?a:n*o,s=Nd(e.position),l=r?0:s.x*(n-c),u=r?0:s.y*(n-c),m=r?"xMidYMid slice":`${Od[s.x*2]??"xMid"}${Dd[s.y*2]??"YMid"} ${e.fit==="contain"?"meet":"slice"}`;return jsxs("pattern",{height:$(a),id:t,patternUnits:"userSpaceOnUse",width:$(a),x:0,y:0,children:[i&&jsx("rect",{fill:i.color,fillOpacity:i.opacity,height:$(a),width:$(a),x:0,y:0}),jsx("image",{height:$(c),href:e.src,opacity:(e.opacity??1)<1?e.opacity:void 0,preserveAspectRatio:m,width:$(c),x:$(l),y:$(u)})]},t)}function Bd(t,e,n,o,r,a,i){let c=Ht(t);if(c.type==="solid")return null;if(c.type==="image"){let l=ql(c,i);return {id:l,element:Ul(l,c,i)}}let s=ni(a,[c,e,n,o,r,...c.type==="angular"?[i]:[]]);if(c.type==="linear"){let l=c,u=l.angle??0,{x1:m,y1:f,x2:d,y2:p}=kd(u,e,n,o,r);return {id:s,element:jsx("linearGradient",{gradientUnits:"userSpaceOnUse",id:s,x1:$(m),x2:$(d),y1:$(f),y2:$(p),children:so(s,l.stops)},s)}}if(c.type==="radial"){let l=c,u=e+o/2,m=n+o/2,f=o/2*.97;return {id:s,element:jsx("radialGradient",{cx:$(u),cy:$(m),fx:$(u),fy:$(m),gradientUnits:"userSpaceOnUse",id:s,r:$(f),children:so(s,l.stops)},s)}}return c.type==="angular"?{id:s,element:Ql(s,c,e+o/2,n+o/2,o*.75,i)}:null}function ti(t,e,n){let o=Ht(t);if(o.type==="solid")return null;if(o.type==="image"){let a=ql(o,e);return {id:a,element:Ul(a,o,e)}}let r=ni(n,[o,e]);if(o.type==="linear"){let a=o,i=a.angle??0,{x1:c,y1:s,x2:l,y2:u}=Td(i,e);return {id:r,element:jsx("linearGradient",{gradientUnits:"userSpaceOnUse",id:r,x1:$(c),x2:$(l),y1:$(s),y2:$(u),children:so(r,a.stops)},r)}}if(o.type==="radial"){let a=o,i=e/2,c=e/2,s=e/2*.97;return {id:r,element:jsx("radialGradient",{cx:$(i),cy:$(c),fx:$(i),fy:$(c),gradientUnits:"userSpaceOnUse",id:r,r:$(s),children:so(r,a.stops)},r)}}return o.type==="angular"?{id:r,element:Ql(r,o,e/2,e/2,e*.75,e)}:null}function Dl(t){let e=new Set,n=[];for(let o of t)o&&!e.has(o.id)&&(e.add(o.id),n.push(o.element));return n}function we(t,e,n){if(e)return {fill:`url(#${e})`};let o=Ht(t,n),r=o.type==="solid"?o.color:o.type==="image"?o.underlay??n:n,{color:a,opacity:i}=ro(r);return i===void 0?{fill:a}:{fill:a,fillOpacity:i}}function Ee(t,e,n,o){if(o==null)return null;let r=t.length,a=Math.floor(e*fr),i=(r+2*n)/e,c=(o.width||a)*i,s=(o.height||a)*i,l=o.x==null?r/2-c/2:o.x*i,u=o.y==null?r/2-s/2:o.y*i,m=null;if(o.excavate){let f=Math.max(0,o.padding??0)*i,d=Math.floor(l-f),p=Math.floor(u-f),h=Math.ceil(c+l+f-d),g=Math.ceil(s+u+f-p);m={x:d,y:p,w:h,h:g};}return {x:l,y:u,h:s,w:c,excavation:m}}function Bt(t){let e=t.level??te,{imageSettings:n}=t,o=t.isOGContext&&n?.excavate&&(e==="L"||e==="M")?"Q":e;if(t.autoLevel&&n&&o!=="H"){let r=Mt.QrCode.encodeText(t.value,Lt[o]).getModules(),a=Ee(r,t.size??bt,Tt(r.length,t.margin??Ct,t.shape),n);a&&(a.excavation?a.excavation.w*a.excavation.h:a.w*a.h)/(r.length*r.length)>Sa&&(o="H");}return o}function zl(t,e,n,o){let r=e/n,a=t.w*r,i=t.h*r,c=(t.x+o)*r,s=(t.y+o)*r;return {imgWidth:a,imgHeight:i,imgLeft:c,imgTop:s}}function ri(t){let{value:e,size:n=bt,level:o=te,bgColor:r=_t,fgColor:a=Pt,eyeColor:i,dotColor:c,bodyPattern:s="circle",cornerEyePattern:l="gear",cornerEyeDotPattern:u="circle",margin:m=Ct,isOGContext:f=false,imageSettings:d,templateId:p,customTemplate:h,customProps:g,frame:b,art:_,eyeColors:y,moduleScale:M,autoLevel:C,shape:x,frameLabelMarkers:S,...w}=t,E=lo({value:e,size:n,margin:m,level:o,shape:x,autoLevel:C,isOGContext:f},d),P=qt(b),R=P?{}:w,v=lt=>P?Fr(lt,{size:n,frame:b,bgColor:r,svgProps:w,markLabels:S}):lt,L=Bt({value:e,size:n,level:o,margin:m,imageSettings:E,isOGContext:f,autoLevel:C,shape:x}),k=Mt.QrCode.encodeText(e,Lt[L]),T=k.getModules(),I=Tt(T.length,m,x),W=wc(e,T.length,m,x),G=(lt,zt)=>{let Kt=Pa(x,lt);return Kt?"circle"in Kt?jsx("circle",{cx:$(lt/2),cy:$(lt/2),...zt,r:$(lt/2)}):jsx("path",{d:Kt.path,...zt}):jsx("rect",{...zt,height:lt,width:lt,x:0,y:0})},V=T.length+I*2,Q=Ee(T,n,I,E),j=null;if(E!=null&&Q!=null){Q.excavation!=null&&(T=co(T,Q.excavation));let{imgWidth:lt,imgHeight:zt,imgLeft:Kt,imgTop:bn}=zl(Q,n,V,I);if(f){let _n=E.shape??"square";j=jsx("img",{alt:"Logo",src:E.src,style:{position:"absolute",left:`${$(Kt)}px`,top:`${$(bn)}px`,width:`${$(lt)}px`,height:`${$(zt)}px`,..._n!=="square"&&{borderRadius:_n==="circle"?"50%":`${$(Math.min(lt,zt)*qr)}px`},...E.plate&&{backgroundColor:E.plate,padding:`${$(lt*zr)}px`,boxSizing:"border-box"}}});}else j=Hr(E,{x:Kt,y:bn,w:lt,h:zt});}let et=n/V,ft=T.length,F=7*et,U=1.5*et,xt={fgColor:wt(a,Pt),bgColor:wt(r,_t)},Rt=ka(_)?Ba({art:_,modules:T,version:k.version,margin:I,pixelSize:et,...xt,body:lt=>Ka(lt,{margin:I,pixelSize:et,pattern:s,scale:M})}):null,ze=Rt&&_?Ua({art:_,version:k.version,...xt}):null,ue=Rt?null:Ka(T,{margin:I,pixelSize:et,pattern:s,scale:M}),Jt=W?Ka(W,{margin:0,pixelSize:et,pattern:s,scale:M,plain:true}):null,me=Ht(r,_t),B=Ht(a,Pt),at=io(me)?ti(me,n,"bg-color"):null,Z=io(B)?ti(B,n,"fg-color"):null,St=we(r,at?.id??null,_t),qn=we(a,Z?.id??null,Pt),ki=Rt?jsxs(Fragment,{children:[Rt,Jt&&jsx("g",{...qn,children:Jt})]}):jsxs("g",{...qn,children:[ue,Jt]}),cn=I*et,ln=I*et,un=(ft-7+I)*et,mn=I*et,dn=I*et,fn=(ft-7+I)*et,He=wt(a,Pt),hn=lt=>y?.[lt]?.outer??ze?.[lt]?.outer??i,pn=lt=>y?.[lt]?.inner??ze?.[lt]?.inner??c,gn=(lt,zt,Kt,bn,_n)=>{let ko=Ht(lt,He);return io(ko)?Bd(ko,zt,Kt,F,bn,_n,n):null},Ao=gn(hn("topLeft"),cn,ln,"top-left","corners-square-color-0-0"),vo=gn(hn("topRight"),un,mn,"top-right","corners-square-color-1-0"),Lo=gn(hn("bottomLeft"),dn,fn,"bottom-left","corners-square-color-0-1"),Io=gn(pn("topLeft"),cn,ln,"top-left","corners-dot-color-0-0"),Fo=gn(pn("topRight"),un,mn,"top-right","corners-dot-color-1-0"),To=gn(pn("bottomLeft"),dn,fn,"bottom-left","corners-dot-color-0-1"),Ni=we(hn("topLeft"),Ao?.id??null,He),Oi=we(hn("topRight"),vo?.id??null,He),Di=we(hn("bottomLeft"),Lo?.id??null,He),Bi=we(pn("topLeft"),Io?.id??null,He),Gi=we(pn("topRight"),Fo?.id??null,He),Qi=we(pn("bottomLeft"),To?.id??null,He),Ui=to(cn,ln,F,l,"top-left"),qi=Kr(cn+F/2,ln+F/2,U,u,"top-left"),zi=to(un,mn,F,l,"top-right"),Hi=Kr(un+F/2,mn+F/2,U,u,"top-right"),Wi=to(dn,fn,F,l,"bottom-left"),Vi=Kr(dn+F/2,fn+F/2,U,u,"bottom-left"),cm=jsxs(Fragment,{children:[jsx("defs",{children:Dl([at,Z,Ao,vo,Lo,Io,Fo,To])}),G(n,St),ki,jsx("g",{...Ni,children:jsx("path",{d:Ui,fillRule:"evenodd",transform:A`rotate(0,${cn+F/2},${ln+F/2})`})}),jsx("g",{...Bi,children:qi}),jsx("g",{...Oi,children:jsx("path",{d:zi,fillRule:"evenodd",transform:A`rotate(0,${un+F/2},${mn+F/2})`})}),jsx("g",{...Gi,children:Hi}),jsx("g",{...Di,children:jsx("path",{d:Wi,fillRule:"evenodd",transform:A`rotate(0,${dn+F/2},${fn+F/2})`})}),jsx("g",{...Qi,children:Vi}),j]}),Xi=h||(p?Al(p):void 0);if(Xi){let zt=io(me)?ti(me,300,"bg-color-template"):null,Kt=we(r,zt?.id??null,_t),bn=jsxs("svg",{height:300,viewBox:"0 0 300 300",width:300,xmlns:"http://www.w3.org/2000/svg",children:[jsx("defs",{children:Dl([zt,Z,Ao,vo,Lo,Io,Fo,To])}),G(300,Kt),jsxs("g",{transform:`scale(${$(300/n,6)})`,children:[ki,jsx("g",{...Ni,children:jsx("path",{d:Ui,fillRule:"evenodd",transform:A`rotate(0,${cn+F/2},${ln+F/2})`})}),jsx("g",{...Bi,children:qi}),jsx("g",{...Oi,children:jsx("path",{d:zi,fillRule:"evenodd",transform:A`rotate(0,${un+F/2},${mn+F/2})`})}),jsx("g",{...Gi,children:Hi}),jsx("g",{...Di,children:jsx("path",{d:Wi,fillRule:"evenodd",transform:A`rotate(0,${dn+F/2},${fn+F/2})`})}),jsx("g",{...Qi,children:Vi}),j]})]}),_n=300/n,lm={pixelSize:et*_n,url:e},Yi=Xi.wrapper(bn,{fgColor:a,bgColor:r,...g||{},...w},lm),um={...Yi?.props?.style||{},width:void 0,height:void 0,...R.style};return v(_0.cloneElement(Yi,{...R,width:n,height:n,style:um}))}return v(jsx("svg",{height:n,viewBox:`0 0 ${n} ${n}`,width:n,xmlns:"http://www.w3.org/2000/svg",...R,children:cm}))}var Fd,Od,Dd,ql,io,Gd,Qd,an,Bl,Ud,qd,Re=q(()=>{"use strict";Tn();Se();qa();Ha();de();At();cl();hl();ye();Wr();Bn();tn();ae();ja();ge();ht();ao();Dt();ge();Fd=.9;Od=["xMin","xMid","xMax"],Dd=["YMin","YMid","YMax"];ql=(t,e)=>ni("img",[t,e]);io=t=>Fn(t)||ma(t);Gd=(()=>{try{new Path2D().addPath(new Path2D);}catch{return !1}return !0})(),Qd=t=>{let e=t.trim().replace(/^#/,"");e.length===3||e.length===4?e=e.slice(0,3).split("").map(o=>o+o).join(""):e.length===8&&(e=e.slice(0,6));let n=/^([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return n?{r:Number.parseInt(n[1],16),g:Number.parseInt(n[2],16),b:Number.parseInt(n[3],16)}:null},an=(t,e,n)=>{let[o,r,a]=[t,e,n].map(i=>(i/=255,i<=.03928?i/12.92:((i+.055)/1.055)**2.4));return .2126*o+.7152*r+.0722*a},Bl=t=>{let e=mt(t);if(!e)return null;let n=o=>o*e.a+255*(1-e.a);return {r:n(e.r),g:n(e.g),b:n(e.b)}},Ud=(t,e)=>{let n=Bl(t),o=Bl(e);if(!(n&&o))return 1;let r=an(n.r,n.g,n.b),a=an(o.r,o.g,o.b),i=Math.max(r,a),c=Math.min(r,a);return (i+.05)/(c+.05)},qd=t=>t>=7?{level:"AAA",warning:!1,message:"Excellent contrast"}:t>=4.5?{level:"AA",warning:!1,message:"Good contrast"}:t>=3?{level:"AA Large",warning:!0,message:"Low contrast - may be difficult to scan"}:{level:"Fail",warning:!0,message:"Poor contrast - QR code may not scan properly"};});function Vl(t){let e=Mt.QrCode.encodeText(t.value,Lt[t.level]),n=zd[e.errorCorrectionLevel.ordinal]??t.level;return {code:t,cells:e.getModules(),layoutMargin:Tt(e.size,t.margin,t.shape),map:er(e.version,n),level:n,version:e.version}}function Xl(t,e){let{cells:n,map:o}=t,r=n.length,a=Ee(n,t.code.size,t.layoutMargin,e);if(!a)return null;let i=a.excavation??{x:Math.floor(a.x),y:Math.floor(a.y),w:Math.ceil(a.x+a.w)-Math.floor(a.x),h:Math.ceil(a.y+a.h)-Math.floor(a.y)},c=[];for(let l=Math.max(0,i.y);l<Math.min(r,i.y+i.h);l++)for(let u=Math.max(0,i.x);u<Math.min(r,i.x+i.w);u++)c.push(l*r+u);let s=nr(o,c);return {worst:Math.max(0,...s),correctable:o.correctable,budget:Math.floor(o.correctable*Wl),level:t.level,version:t.version}}function uo(t,e){return Xl(Vl(t),e)}function Hd(t,e){return Yl(uo(t,e))}function oi(t,e,n,o){let r=e.map(c=>Vl({...t,level:c})),a=c=>{let s=o(c);return r.every(l=>Yl(Xl(l,s)))};if(a(n))return n;let i=t.size*.005;for(let c=n-i;c>0;c-=i)if(a(c))return c;return 0}function lo(t,e){if(!e)return;let n=Math.floor(t.size*fr),o=e.width||n,r=e.height||n,a=f=>{if(f===o)return e;let d=r*f/o;return {...e,width:f,height:d,...e.x!=null&&{x:e.x+(o-f)/2},...e.y!=null&&{y:e.y+(r-d)/2}}},i=t.level??te,c={value:t.value,size:t.size,margin:t.margin,shape:t.shape},s=f=>Bt({...t,level:i,imageSettings:f}),l=f=>{let d=oi(c,[f],o,a);return d>0?a(d):void 0},u=s(e);if(u===i)return l(i);let m=l(u);return m&&s(m)===u?m:l(i)}var Wl,zd,Yl,Bn=q(()=>{"use strict";de();Vr();At();tn();Re();Wl=.6,zd=["L","M","Q","H"];Yl=t=>!t||t.worst<=t.budget;});At();ye();var C0=16384;var aa=[17,18,0,1,2,3,4,5,16,6,7,8,9,10,11,12,13,14,15],w0=8,ia=class{buffer;position=0;bits=0;used=0;constructor(e){this.buffer=new Uint8Array(Math.max(e,64));}write(e,n){if(n!==0)for(this.bits|=e<<this.used,this.used+=n;this.used>=8;){if(this.position===this.buffer.length){let o=new Uint8Array(this.buffer.length*2);o.set(this.buffer),this.buffer=o;}this.buffer[this.position++]=this.bits&255,this.bits>>>=8,this.used-=8;}}finish(){return this.used>0&&this.write(0,8-this.used),this.buffer.subarray(0,this.position)}};function ks(t,e){let n=new Uint8Array(t.length),o=[];for(let l=0;l<t.length;l++)(t[l]??0)>0&&o.push(l);if(o.length===0)return n;if(o.length===1)return n[o[0]]=1,n;let r=o.length,a=2*r-1,i=new Float64Array(a),c=new Int32Array(a),s=new Uint8Array(a);for(let l=1;;l*=2){for(let h=0;h<r;h++)i[h]=Math.max(t[o[h]]??0,l);let u=Array.from({length:r},(h,g)=>g).sort((h,g)=>i[h]-i[g]||h-g),m=0,f=r,d=h=>m<r&&(f>=h||i[u[m]]<=i[f])?u[m++]:f++;for(let h=r;h<a;h++){let g=d(h),b=d(h);i[h]=i[g]+i[b],c[g]=h,c[b]=h;}s[a-1]=0;let p=0;for(let h=a-2;h>=0;h--){let g=s[c[h]]+1;s[h]=g,h<r&&g>p&&(p=g);}if(p<=e){for(let h=0;h<r;h++)n[o[h]]=s[h];return n}}}function E0(t,e){let n=0;for(let o=0;o<e;o++)n=n<<1|t>>o&1;return n}function Ns(t){let e=new Uint16Array(16),n=0;for(let c of t)c>0&&(e[c]=e[c]+1,n++);let o=new Uint16Array(16),r=0;for(let c=1;c<=15;c++)r=r+e[c-1]<<1,o[c]=r;let a=new Uint16Array(t.length),i=new Uint8Array(t.length);return t.forEach((c,s)=>{if(c===0)return;let l=o[c];o[c]=l+1,a[s]=E0(l,c),i[s]=n===1?0:c;}),{lengths:t,codes:a,emitted:i}}function Ze(t,e,n){t.write(e.codes[n],e.emitted[n]);}function R0(t){let e=[],n=a=>e.push({code:a,extra:0,extraBits:0}),o=w0,r=0;for(;r<t.length;){let a=t[r],i=1;for(;r+i<t.length&&t[r+i]===a;)i++;r+=i;let c=i;if(a===0){for(;c>0;)if(c<3)for(;c>0;c--)n(0);else if(c<=10)e.push({code:17,extra:c-3,extraBits:3}),c=0;else {let s=Math.min(c,138);e.push({code:18,extra:s-11,extraBits:7}),c-=s;}continue}for(a!==o&&(n(a),o=a,c--);c>0;)if(c<3)for(;c>0;c--)n(a);else {let s=Math.min(c,6);e.push({code:16,extra:s-3,extraBits:2}),c-=s;}}return e}function P0(t,e){let n=[];if(e.forEach((c,s)=>{c>0&&n.push(s);}),n.length<=2&&n.every(c=>c<256)){let[c=0,s]=n;t.write(1,1),t.write(n.length===2?1:0,1),c<2?(t.write(0,1),t.write(c,1)):(t.write(1,1),t.write(c,8)),s!==void 0&&t.write(s,8);return}let o=R0(e),r=new Uint32Array(19);for(let c of o)r[c.code]=r[c.code]+1;let a=Ns(ks(r,7)),i=aa.length;for(;i>4&&a.lengths[aa[i-1]]===0;)i--;t.write(0,1),t.write(i-4,4);for(let c=0;c<i;c++)t.write(a.lengths[aa[c]],3);t.write(0,1);for(let c of o)Ze(t,a,c.code),t.write(c.extra,c.extraBits);}function Tr(t){let e=t-1;if(e<4)return {symbol:e,extra:0,extraBits:0};let n=31-Math.clz32(e),o=e>>n-1&1,r=n-1;return {symbol:2*n+o,extra:e&(1<<r)-1,extraBits:r}}function vs(t,e,n,o){let r=0;for(;r<o&&t[e+r]===t[e+r-n];)r++;return r}function Ls(t,e,n){let o=t.length,r=0;for(;r<o;){let a=Math.min(4096,o-r),i=r>=1?vs(t,r,1,a):0,c=r>=e?vs(t,r,e,a):0;if(Math.max(i,c)>=3){c>=i?(n.copy(c,e===1?2:1),r+=c):(n.copy(i,2),r+=i);continue}n.literal(t[r]),r++;}}var Is=20;function Fs(t,e,n){for(let o=0;o<n.length;o++)t[e+o]=n.charCodeAt(o);}function Ts(t,e,n){t[e]=n&255,t[e+1]=n>>>8&255,t[e+2]=n>>>16&255,t[e+3]=n>>>24&255;}function ca(t,e,n){if(!(Number.isInteger(e)&&Number.isInteger(n))||e<1||n<1||e>16384||n>16384)throw new RangeError(`WebP images are 1 to 16384 pixels wide and high (got ${e} \xD7 ${n})`);let o=e*n;if(t.length<o*4)throw new RangeError(`Expected ${o*4} bytes of RGBA for ${e} \xD7 ${n}, got ${t.length}`);let r=new Uint32Array(o),a=false;for(let C=0;C<o;C++){let x=C*4,S=t[x],w=t[x+1],E=t[x+2],P=t[x+3];P!==255&&(a=true),r[C]=(P<<24|(S-w&255)<<16|w<<8|E-w&255)>>>0;}let i=new Uint32Array(280),c=new Uint32Array(256),s=new Uint32Array(256),l=new Uint32Array(256),u=new Uint32Array(40);Ls(r,e,{literal(C){i[C>>>8&255]++,c[C>>>16&255]++,s[C&255]++,l[C>>>24]++;},copy(C,x){i[256+Tr(C).symbol]++,u[Tr(x).symbol]++;}});let m=[i,c,s,l,u].map(C=>ks(C,15)),[f,d,p,h,g]=m.map(Ns),b=new ia(Math.ceil(o/4)+1024);b.write(47,8),b.write(e-1,14),b.write(n-1,14),b.write(a?1:0,1),b.write(0,3),b.write(1,1),b.write(2,2),b.write(0,1),b.write(0,1),b.write(0,1);for(let C of m)P0(b,C);Ls(r,e,{literal(C){Ze(b,f,C>>>8&255),Ze(b,d,C>>>16&255),Ze(b,p,C&255),Ze(b,h,C>>>24);},copy(C,x){let S=Tr(C);Ze(b,f,256+S.symbol),b.write(S.extra,S.extraBits);let w=Tr(x);Ze(b,g,w.symbol),b.write(w.extra,w.extraBits);}});let _=b.finish(),y=_.length+(_.length&1),M=new Uint8Array(Is+y);return Fs(M,0,"RIFF"),Ts(M,4,M.length-8),Fs(M,8,"WEBPVP8L"),Ts(M,16,_.length),M.set(_,Is),M}function sa(t,e,n){return String.fromCharCode(...t.subarray(e,e+n))}function Os(t){return t.length>=12&&sa(t,0,4)==="RIFF"&&sa(t,8,4)==="WEBP"}function la(t){if(!Os(t))return null;let e=12;for(;e+8<=t.length;){let n=sa(t,e,4);if(n==="VP8L")return "lossless";if(n==="VP8 ")return "lossy";let o=(t[e+4]|t[e+5]<<8|t[e+6]<<16|t[e+7]<<24)>>>0;e+=8+o+(o&1);}return null}function A0(t,e,n){return typeof t.toBlob!="function"?Promise.resolve(null):new Promise(o=>{try{t.toBlob(o,e,n);}catch{o(null);}})}async function kr(t,e={}){let n=e.quality!==void 0,o=n?Math.min(1,Math.max(0,Number(e.quality))):1,r=await A0(t,"image/webp",o);if(r){let s=new Uint8Array(await r.arrayBuffer()),l=la(s);if(l==="lossless"||n&&l==="lossy")return new Blob([s],{type:"image/webp"})}let a=t.getContext("2d");if(!a)throw new Error("Could not get canvas context");let{data:i}=a.getImageData(0,0,t.width,t.height),c=ca(i,t.width,t.height);return new Blob([c],{type:"image/webp"})}var Ds=32768;async function jn(t){let e=new Uint8Array(await t.arrayBuffer()),n="";for(let o=0;o<e.length;o+=Ds)n+=String.fromCharCode(...e.subarray(o,o+Ds));return `data:${t.type||"application/octet-stream"};base64,${btoa(n)}`}At();ge();Nr();Tn();var F0=z$1.object({x:z$1.number(),y:z$1.number(),w:z$1.number(),h:z$1.number()});ha();ba();zn();wn();ya();Se();var B0=z$1.object({fgColor:z$1.string().optional(),bgColor:z$1.string().optional()}),G0=z$1.object({pixelSize:z$1.number(),url:z$1.string()}),Q0=z$1.object({id:z$1.string(),name:z$1.string(),description:z$1.string().optional()});de();At();ye();Wr();Bn();Re();ge();async function cb(t){let{value:e,size:n=bt,level:o=te,bgColor:r=_t,fgColor:a=Pt,margin:i=Ct,imageSettings:c,eyeColor:s,dotColor:l,bodyPattern:u,cornerEyePattern:m,cornerEyeDotPattern:f,isOGContext:d,templateId:p,customTemplate:h,customProps:g,frame:b,art:_,eyeColors:y,moduleScale:M,frameLabelMarkers:C,autoLevel:x,...S}=t,w=lo({value:e,size:n,margin:i,level:o,autoLevel:x},c),E=Bt({value:e,size:n,level:o,margin:i,imageSettings:w,autoLevel:x}),P=Mt.QrCode.encodeText(e,Lt[E]).getModules(),R=P.length+i*2,v=Ee(P,n,i,w),L=jsx(Fragment,{});if(w!=null&&v!=null){v.excavation!=null&&(P=co(P,v.excavation));let W=w.src.startsWith("data:")?w.src:await fetch(`https://wsrv.nl/?url=${encodeURIComponent(w.src)}&w=100&h=100&encoding=base64`).then(G=>{if(!G.ok)throw new Error(`Failed to load QR logo (${G.status}): ${w.src}`);return G.text()});L=Hr({...w,src:W},{x:v.x+i,y:v.y+i,w:v.w,h:v.h});}let k=ei(P,i),T=qt(b),I=jsxs("svg",{height:n,viewBox:`0 0 ${R} ${R}`,width:n,xmlns:"http://www.w3.org/2000/svg",...T?{}:S,children:[jsx("path",{d:`M0,0 h${R}v${R}H0z`,fill:wt(r,_t),shapeRendering:"crispEdges"}),jsx("path",{d:k,fill:wt(a,Pt),shapeRendering:"crispEdges"}),L]});return T?Fr(I,{size:n,frame:b,bgColor:r,svgProps:S}):I}qa();Ha();var mb=(t,e,n,o)=>{let r=document.createElement("canvas");r.width=e,r.height=n;let a=r.getContext("2d");if(!a)return;a.putImageData(t,0,0);let i=r.toDataURL("image/png"),c=document.createElement("a");c.href=i,c.download=o,document.body.appendChild(c),c.click(),document.body.removeChild(c);},Xd=async(t,e,n,o)=>{let{default:r}=await import('jsqr');return new Promise(a=>{t.complete?i():(t.onload=()=>i(),t.onerror=()=>a(null));function i(){let c=document.createElement("canvas");requestAnimationFrame(()=>{if(!(t.naturalWidth&&t.naturalHeight)){a(null);return}let s=t.naturalWidth/t.naturalHeight<=.33||t.naturalWidth/t.naturalHeight>=3?Math.sqrt(t.naturalWidth*t.naturalHeight/12e5):t.naturalWidth/t.naturalHeight<=.5||t.naturalWidth/t.naturalHeight>=2?Math.sqrt(t.naturalWidth*t.naturalHeight/9e5):Math.sqrt(t.naturalWidth*t.naturalHeight/64e4),l=c.getContext("2d",{willReadFrequently:true});if(!l){a(null);return}let u=[1,.8,.6,.4,.2,.1];for(let m of u){let f=Math.floor(t.naturalWidth*e*m/s),d=Math.floor(t.naturalHeight*e*m/s);c.width=f,c.height=d,l.clearRect(0,0,f,d),l.imageSmoothingEnabled=true,l.imageSmoothingQuality="high";try{l.drawImage(t,Math.floor(n),Math.floor(o),Math.floor(t.naturalWidth*e),Math.floor(t.naturalHeight*e),0,0,f,d);let p=l.getImageData(0,0,f,d);try{let h=r(p.data,f,d);if(h?.data){a(h);return}}catch(h){console.error("QR Detection error:",h);}}catch(p){console.error("Canvas drawing error:",p);}}a(null);});}})},jl=async(t,e,n=false)=>{if(!t)return "NO_QR";await new Promise(r=>setTimeout(r,100));let o=[{dx:0,dy:0,ratio:1},{dx:0,dy:t.naturalHeight*.35,ratio:.65},{dx:t.naturalWidth*.35,dy:t.naturalHeight*.35,ratio:.65},{dx:t.naturalWidth*.35,dy:0,ratio:.65},{dx:t.naturalWidth*.35/2,dy:t.naturalHeight*.35/2,ratio:.65}];for(let r of o)try{let a=await Xd(t,r.ratio,r.dx,r.dy);if(a?.data)return n?a:a.data}catch(a){console.warn("QR decode error:",a);}return "NO_QR"};function db(t,e,n){if(!(t&&e)||e.length!==4)return;let o=document.createElement("canvas");o.width=t.naturalWidth,o.height=t.naturalHeight;let r=o.getContext("2d");if(!r)return;r.drawImage(t,0,0),r.save(),r.strokeStyle="#ff0000",r.lineWidth=Math.max(5,Math.min(t.naturalWidth,t.naturalHeight)/200),r.shadowColor="transparent",r.shadowBlur=0,r.beginPath(),r.moveTo(e[0].x,e[0].y),r.lineTo(e[1].x,e[1].y),r.lineTo(e[3].x,e[3].y),r.lineTo(e[2].x,e[2].y),r.closePath(),r.stroke(),r.fillStyle="#ff0000",e.forEach((c,s)=>{r.fillRect(c.x-3,c.y-3,6,6),r.fillStyle="#ffffff",r.font="16px Arial",r.fillText(`${s}`,c.x+5,c.y-5),r.fillStyle="#ff0000";}),r.restore();let a=o.toDataURL("image/png"),i=document.createElement("a");i.href=a,i.download=n,document.body.appendChild(i),i.click(),document.body.removeChild(i);}At();At();de();At();ye();tn();Re();ht();Dt();Tn();At();ye();ge();ao();Dt();he();ao();Dt();he();ht();Dt();he();var Zl=["gradientUnits","gradientTransform","spreadMethod"],Yd={linear:["x1","y1","x2","y2"],radial:["cx","cy","r","fx","fy","fr"]},jd={r:0,g:0,b:0,a:1};function Jl(t,e){for(let n of (t.attrs.style??"").split(";")){let[o,...r]=n.split(":");if(o?.trim()===e)return r.join(":").trim()}return t.attrs[e]}function ii(t){return t.name==="linearGradient"?"linear":t.name==="radialGradient"?"radial":null}function Zd(t){let e=[],n=0;for(let o of t.children){if(o.name!=="stop")continue;let r=(o.attrs.offset??"0").trim(),a=Number.parseFloat(r),i=Number.isFinite(a)?r.endsWith("%")?a/100:a:0;n=Math.max(n,Math.min(Math.max(i,0),1));let c=Jl(o,"stop-color")??"#000000",s=mt(c==="currentColor"?"#000000":c)??jd,l=Number.parseFloat(Jl(o,"stop-opacity")??"1");e.push({offset:n,color:Number.isFinite(l)?{...s,a:s.a*Math.min(Math.max(l,0),1)}:s});}return e}function mo(t){let e=new Map,n=r=>{let a=r.attrs.id;ii(r)&&a&&!e.has(a)&&e.set(a,r);for(let i of r.children)n(i);};n(t);let o=new Map;for(let[r,a]of e){let i=ii(a),c={},s=[],l=new Set,u=a;for(;u&&!l.has(u);){l.add(u);let m=ii(u)===i?[...Zl,...Yd[i]]:Zl;for(let d of m){let p=u.attrs[d];c[d]===void 0&&p!==void 0&&(c[d]=p);}s.length===0&&(s=Zd(u));let f=u.attrs.href??u.attrs["xlink:href"];u=f?.startsWith("#")?e.get(f.slice(1)):void 0;}o.set(r,{kind:i,attrs:c,stops:s});}return o}function si(t){let e=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,r=Number.NEGATIVE_INFINITY,a=(m,f)=>{e=Math.min(e,m),o=Math.max(o,m),n=Math.min(n,f),r=Math.max(r,f);},i=(m,f,d,p)=>{let h=-m+3*f-3*d+p,g=2*(m-2*f+d),b=f-m;if(Math.abs(h)<1e-12)return Math.abs(g)<1e-12?[]:[-b/g];let _=g*g-4*h*b;if(_<0)return [];let y=Math.sqrt(_);return [(-g+y)/(2*h),(-g-y)/(2*h)]},c=(m,f,d,p,h)=>{let g=1-m;return g*g*g*f+3*g*g*m*d+3*g*m*m*p+m**3*h},s=0,l=0,u=[0,0];for(let m of t)if(m.op==="M"&&(u=[m.x,m.y]),m.op==="M"||m.op==="L")a(m.x,m.y),s=m.x,l=m.y;else if(m.op==="C"){a(m.x,m.y);for(let f of [...i(s,m.x1,m.x2,m.x),...i(l,m.y1,m.y2,m.y)])f>0&&f<1&&a(c(f,s,m.x1,m.x2,m.x),c(f,l,m.y1,m.y2,m.y));s=m.x,l=m.y;}else [s,l]=u;return Number.isFinite(e)?{x:e,y:n,width:o-e,height:r-n}:null}var Jd=t=>t[0]*t[3]-t[1]*t[2];function Ge(t){let e=Jd(t);if(!Number.isFinite(e)||Math.abs(e)<1e-12)return null;let[n,o,r,a,i,c]=t;return [a/e,-o/e,-r/e,n/e,(r*c-a*i)/e,(o*i-n*c)/e]}function tu(t,e,n){let{kind:o,attrs:r,stops:a}=t,i=a[0],c=a.at(-1);if(!(i&&c)||a.every(x=>x.color.a===0))return null;if(a.length===1)return i.color;let s=r.gradientUnits==="userSpaceOnUse",l=yr;if(!s){let x=si(e);if(!x||x.width<=0||x.height<=0)return null;l=[x.width,0,0,x.height,x.x,x.y];}let u=pt(l,ne(r.gradientTransform));if(!Ge(u))return c.color;let[m,f]=n,d=Math.sqrt((m*m+f*f)/2),p=(x,S)=>{let w=Number.parseFloat(x);return Number.isFinite(w)?x.trim().endsWith("%")?w/100*(s?S:1):w:null},h=(x,S,w)=>p(r[x]??S,w)??p(S,w)??0;if(o==="linear"){let x=[h("x1","0%",m),h("y1","0%",f),h("x2","100%",m),h("y2","0%",f)],[S,w,E,P]=x;return S===E&&w===P?c.color:{kind:o,coords:x,matrix:u,stops:a}}let g=h("cx","50%",m),b=h("cy","50%",f),_=h("r","50%",d),y=r.fx===void 0?g:h("fx","50%",m),M=r.fy===void 0?b:h("fy","50%",f),C=Math.max(0,h("fr","0%",d));return _<0?null:_===0?c.color:{kind:o,coords:[y,M,C,g,b,_],matrix:u,stops:a}}function fo(t){return t.map(e=>$(e,6)).join(" ")}function Kd(t,e){return (e==="cmyk"?Te(t.r,t.g,t.b):[t.r/255,t.g/255,t.b/255]).map(o=>$(o,4)).join(" ")}var Kl=(t,e)=>`<< /FunctionType 2 /Domain [0 1] /C0 [${t}] /C1 [${e}] /N 1 >>`;function tf(t,e){let n=[],o=t.map(c=>it(c.offset,4)),r=t.map(c=>Kd(c.color,e)),a=o[0],i=o.at(-1);if(a>0){let c=r[0];n.push({from:0,to:a,c0:c,c1:c});}for(let c=0;c+1<t.length;c++){let s=o[c],l=o[c+1];l>s&&n.push({from:s,to:l,c0:r[c],c1:r[c+1]});}if(i<1){let c=r.at(-1);n.push({from:i,to:1,c0:c,c1:c});}if(n.length===1){let[c]=n;return Kl(c.c0,c.c1)}return ["<< /FunctionType 3 /Domain [0 1]",`/Functions [${n.map(c=>Kl(c.c0,c.c1)).join(" ")}]`,`/Bounds [${n.slice(1).map(c=>$(c.from,4)).join(" ")}]`,`/Encode [${n.map(()=>"0 1").join(" ")}] >>`].join(" ")}function ho(t,e){return [`<< /ShadingType ${t.kind==="linear"?2:3}`,`/ColorSpace /Device${e==="cmyk"?"CMYK":"RGB"}`,`/Coords [${t.coords.map(n=>$(n,6)).join(" ")}]`,`/Function ${tf(t.stops,e)}`,"/Extend [true true] >>"].join(" ")}function ef(t,e){if(t.op==="Z")return t;if(t.op==="C"){let[r,a]=X(e,t.x1,t.y1),[i,c]=X(e,t.x2,t.y2),[s,l]=X(e,t.x,t.y);return {op:"C",x1:r,y1:a,x2:i,y2:c,x:s,y:l}}let[n,o]=X(e,t.x,t.y);return {op:t.op,x:n,y:o}}var eu={r:255,g:255,b:255,a:1},nf=/^url\(\s*#bg-color-/,po=/^url\(\s*#([^)\s]+)\s*\)/,rf=new Set(["defs","clipPath","mask","pattern","linearGradient","radialGradient","symbol","title","desc","metadata","style","script","use","foreignObject"]);function K(t,e){let n=t.attrs.style;if(n)for(let o of n.split(";")){let[r,...a]=o.split(":");if(r?.trim()===e)return a.join(":").trim()}return t.attrs[e]}function Y(t,e,n=0){if(t===void 0||t==="")return n;let o=Number.parseFloat(t);return Number.isNaN(o)?n:t.trim().endsWith("%")?o/100*e:o}function ir(t,e){if((t.name==="linearGradient"||t.name==="radialGradient")&&t.attrs.id){let n=t.children.find(r=>r.name==="stop"),o=n&&(K(n,"stop-color")??"#000000");o&&e.set(t.attrs.id,o);}for(let n of t.children)ir(n,e);return e}function sr(t,e){if(t.name==="image"){let n=t.attrs.href??t.attrs["xlink:href"];n&&e.add(n);}for(let n of t.children)sr(n,e);return e}function go(t){return /^data:image\/png[;,]/i.test(t)?"PNG":/^data:image\/jpe?g[;,]/i.test(t)?"JPEG":null}async function bo(t){return typeof document>"u"||typeof Image>"u"?null:await new Promise(e=>{let n=new Image;n.crossOrigin="anonymous",n.onload=()=>{let o=document.createElement("canvas"),r=Math.max(n.naturalWidth||512,n.naturalHeight||512),a=Math.min(1024/r,4);o.width=Math.round((n.naturalWidth||512)*a),o.height=Math.round((n.naturalHeight||512)*a);let i=o.getContext("2d");if(!i){e(null);return}i.drawImage(n,0,0,o.width,o.height);try{e(o.toDataURL("image/png"));}catch{e(null);}},n.onerror=()=>e(null),n.src=t;})}function nu(t,e,n){let o={x:Y(t.attrs.x,e[0]),y:Y(t.attrs.y,e[1]),width:Y(t.attrs.width,e[0]),height:Y(t.attrs.height,e[1])};if(o.width<=0||o.height<=0)return null;let r=(t.attrs.preserveAspectRatio??"").trim();if(!r||r.startsWith("none")||!n||!(n.width>0&&n.height>0))return {draw:o,clip:null};let[a="xMidYMid",i="meet"]=r.split(/\s+/),c=i==="slice",s=(c?Math.max:Math.min)(o.width/n.width,o.height/n.height),l=n.width*s,u=n.height*s,m=f=>{let d=f==="x"?a.slice(0,4):a.slice(4);return d.endsWith("Min")?0:d.endsWith("Max")?1:.5};return {draw:{x:o.x+(o.width-l)*m("x"),y:o.y+(o.height-u)*m("y"),width:l,height:u},clip:c?o:null}}function ru(t,e){t.name==="clipPath"&&t.attrs.id&&e.set(t.attrs.id,t);for(let n of t.children)ru(n,e);return e}function ou(t,e){t.name==="pattern"&&t.attrs.id&&e.set(t.attrs.id,t);for(let n of t.children)ou(n,e);return e}function of(t,e){let[n,o]=e,r=(a,i)=>Y(t.attrs[a],i);switch(t.name){case "path":return fe(t.attrs.d??"");case "rect":{let a=t.attrs.rx??t.attrs.ry,i=t.attrs.ry??t.attrs.rx;return oe(r("x",n),r("y",o),r("width",n),r("height",o),Y(a,n),Y(i,o))}case "circle":{let a=r("r",Math.hypot(n,o)/Math.SQRT2);return re(r("cx",n),r("cy",o),a,a)}case "ellipse":return re(r("cx",n),r("cy",o),r("rx",n),r("ry",o));default:return []}}var Gn=class{gradients;shadings;clipPaths=new Map;patterns=new Map;backdrop=eu;paper=eu;background=null;onPaper=false;inConic=false;constructor(e,n=null){this.gradients=e,this.shadings=n;}resolveColor(e){if(!e||e==="none")return null;let n=po.exec(e);if(n)return this.resolveColor(this.gradients.get(n[1]));let o=mt(e==="currentColor"?"#000000":e);return o&&o.a>0?o:null}shadedGradient(e){let n=e?po.exec(e)?.[1]:void 0;return n?this.shadings?.get(n):void 0}resolveFill(e,n,o,r=1){if(r<=0)return null;let a=this.patternOf(e);if(a)return {pattern:a,alpha:r};let i=this.shadedGradient(e);if(i){let l=tu(i,n,o);if(!l)return null;if("coords"in l)return {gradient:l,alpha:r};let u={...l,a:l.a*r};return u.a>0?{color:u}:null}let c=this.resolveColor(e);if(!c)return null;let s={...c,a:c.a*r};return s.a>0?{color:s}:null}patternOf(e){let n=e?po.exec(e)?.[1]:void 0,o=n?this.patterns.get(n):void 0;if(!(o?.attrs.patternUnits!=="userSpaceOnUse"||(o.attrs.patternContentUnits??"userSpaceOnUse")!=="userSpaceOnUse"||o.attrs.viewBox))return o}flatten(e){if(e.a>=1)return e;let n=this.background,o=n!==null&&Math.abs(n.r-e.r)<.5&&Math.abs(n.g-e.g)<.5&&Math.abs(n.b-e.b)<.5&&Math.abs(n.a-e.a)<.002;return oo(e,this.onPaper||o?this.paper:this.backdrop)}paintPattern(e,n,o,r){let a=si(e);if(!a||a.width<=0||a.height<=0)return true;let[i,c]=n.viewport,s=Y(o.attrs.x,i),l=Y(o.attrs.y,c),u=Y(o.attrs.width,i),m=Y(o.attrs.height,c);if(!(u>0&&m>0))return true;let f=ne(o.attrs.patternTransform),d=Ge(f);if(!d)return true;if(!this.beginClip(e,n.matrix,n.fillRule==="evenodd"))return false;let p=this.inConic;this.inConic=o.attrs["data-qrdx-conic"]!==void 0;try{let h=[X(d,a.x,a.y),X(d,a.x+a.width,a.y),X(d,a.x,a.y+a.height),X(d,a.x+a.width,a.y+a.height)],g=h.map(([L])=>L),b=h.map(([,L])=>L),_=Math.min(...g),y=Math.max(...g),M=Math.min(...b),C=Math.max(...b),x=Math.floor((_-s)/u),S=Math.ceil((y-s)/u)-1,w=Math.floor((M-l)/m),E=Math.ceil((C-l)/m)-1,P=(S-x+1)*(E-w+1);if(P>4096)return !0;let R=(o.attrs["data-qrdx-conic"]??"").trim().split(/\s+/).map(Number),v=pt(n.matrix,f);for(let L=w;L<=E;L++)for(let k=x;k<=S;k++){let T=s+k*u,I=l+L*m,W=pt(v,[1,0,0,1,T,I]),G={x:_-T,y:M-I,width:y-_,height:C-M},V=R.length===2&&R.every(Number.isFinite)?Nl(R[0],R[1],G):null,Q=P>1&&this.beginClip([{op:"M",x:0,y:0},{op:"L",x:u,y:0},{op:"L",x:u,y:m},{op:"L",x:0,y:m},{op:"Z"}],W,!1);try{let j={matrix:W,viewport:n.viewport,fill:"#000000",fillRule:"nonzero",stroke:"none",strokeWidth:1,fontSize:16,fontWeight:"normal",textAnchor:"start",fillOpacity:1,opacity:r},et=(ft,F)=>{for(let U of ft){if(U.name==="g"&&!U.attrs.transform){let xt=Number.parseFloat(U.attrs.opacity??"1");et(U.children,{...F,opacity:(F.opacity??1)*(Number.isFinite(xt)?xt:1)});continue}if(V&&U.attrs["data-arc"]){let[xt,Rt]=U.attrs["data-arc"].split(/\s+/).map(Number);if(!Ol([xt,xt+Rt],V))continue}this.walk(U,F);}};et(o.children,j);}finally{Q&&this.endClip();}}}finally{this.inConic=p,this.endClip();}return true}paintBleed(e,n,o,r){if(!this.shadedGradient(o))return false;let[a,i]=this.viewportMatrix({...e,attrs:{...e.attrs,x:"0",y:"0"}},{...n,matrix:pt(n.matrix,ne(e.attrs.transform))}),c=Ge(a);if(!c)return false;let[s,l,u,m]=r,d=[[s,l],[u,l],[u,m],[s,m]].map(([p,h])=>X(c,p,h)).map(([p,h],g)=>({op:g===0?"M":"L",x:p,y:h}));return d.push({op:"Z"}),this.paint(d,{name:"rect",attrs:{},children:[],text:""},{...n,matrix:a,viewport:i,fill:o,fillRule:"nonzero",stroke:"none"}),true}beginClip(e,n,o){return false}endClip(){}clipOf(e,n){let o=K(e,"clip-path"),r=o?po.exec(o)?.[1]:void 0,a=r?this.clipPaths.get(r):void 0;if(!a)return null;let i=[],c=false;for(let s of a.children){let l=of(s,n.viewport);if(l.length===0)continue;let u=ne(s.attrs.transform),m=u[0]===1&&u[1]===0&&u[2]===0&&u[3]===1&&u[4]===0&&u[5]===0;i.push(...m?l:l.map(f=>ef(f,u))),c||=K(s,"clip-rule")==="evenodd";}return i.length>0?{segments:i,matrix:n.matrix,evenOdd:c}:null}viewportMatrix(e,n){let o=Y(e.attrs.x,n.viewport[0]),r=Y(e.attrs.y,n.viewport[1]),a=Y(e.attrs.width,n.viewport[0],n.viewport[0]),i=Y(e.attrs.height,n.viewport[1],n.viewport[1]),c=Ve(e.attrs.viewBox);if(c.length!==4||!(c[2]&&c[3]))return [pt(n.matrix,[1,0,0,1,o,r]),[a,i]];let[s,l,u,m]=c,f=a/u,d=i/m,p=o,h=r;if((e.attrs.preserveAspectRatio??"").trim()!=="none"){let g=e.attrs.preserveAspectRatio?.includes("slice")?Math.max(f,d):Math.min(f,d);p+=(a-u*g)/2,h+=(i-m*g)/2,f=g,d=g;}return [pt(n.matrix,[f,0,0,d,p-s*f,h-l*d]),[u,m]]}walk(e,n,o=false){if(o&&(this.clipPaths=ru(e,new Map),this.patterns=ou(e,new Map)),rf.has(e.name)||K(e,"display")==="none"||K(e,"visibility")==="hidden")return;let r=pt(n.matrix,ne(e.attrs.transform)),a=n.viewport;if(e.name==="svg"){let[f,d]=this.viewportMatrix(o?{...e,attrs:{...e.attrs,x:"0",y:"0"}}:e,{...n,matrix:r});r=f,a=d;}let i=K(e,"font-size"),c=Number.parseFloat(K(e,"opacity")??"1"),s=K(e,"fill-opacity"),l=s===void 0?n.fillOpacity??1:Number.parseFloat(s),u={fillOpacity:Number.isFinite(l)?Math.min(Math.max(l,0),1):1,opacity:(n.opacity??1)*(Number.isFinite(c)?Math.min(Math.max(c,0),1):1),matrix:r,viewport:a,fill:K(e,"fill")??n.fill,fillRule:K(e,"fill-rule")??n.fillRule,stroke:K(e,"stroke")??n.stroke,strokeWidth:K(e,"stroke-width")===void 0?n.strokeWidth:Y(K(e,"stroke-width"),a[0],1),fontSize:i===void 0?n.fontSize:Y(i,16,16),fontWeight:K(e,"font-weight")??n.fontWeight,textAnchor:K(e,"text-anchor")??n.textAnchor},m=this.onPaper;(e.name==="rect"||e.name==="circle"||e.name==="path")&&nf.test(K(e,"fill")??"")&&(this.onPaper=true);try{let f=e.attrs["clip-path"]?this.clipOf(e,u):null;if(f&&this.beginClip(f.segments,f.matrix,f.evenOdd)){try{this.paintNode(e,u);}finally{this.endClip();}return}this.paintNode(e,u);}finally{this.onPaper=m;}}paintNode(e,n){let[o,r]=n.viewport,a=(i,c)=>Y(e.attrs[i],c);switch(e.name){case "path":this.paint(fe(e.attrs.d??""),e,n);return;case "rect":{let i=e.attrs.rx??e.attrs.ry,c=e.attrs.ry??e.attrs.rx;this.paint(oe(a("x",o),a("y",r),a("width",o),a("height",r),Y(i,o),Y(c,r)),e,n);return}case "circle":{let i=a("r",Math.hypot(o,r)/Math.SQRT2);this.paint(re(a("cx",o),a("cy",r),i,i),e,n);return}case "ellipse":this.paint(re(a("cx",o),a("cy",r),a("rx",o),a("ry",r)),e,n);return;case "line":this.paint([{op:"M",x:a("x1",o),y:a("y1",r)},{op:"L",x:a("x2",o),y:a("y2",r)}],e,{...n,fill:"none"});return;case "polygon":case "polyline":{let i=Ve(e.attrs.points),c=[];for(let s=0;s+1<i.length;s+=2)c.push({op:s===0?"M":"L",x:i[s],y:i[s+1]});e.name==="polygon"&&c.length>0&&c.push({op:"Z"}),this.paint(c,e,n);return}case "text":this.text(e,n);return;case "image":this.image(e,n);return;default:for(let i of e.children)this.walk(i,n);}}};var _o=1e3;async function cr(t){let e=await ce(sn({...t,size:t.size??bt},_o));return decodeURIComponent(e.replace("data:image/svg+xml,",""))}function ci(t){if(qt(t.frame)){let e=je(_o,t.frame);return e.squareEdges?e.color:null}return wt(t.bgColor,_t)}function yo(t,e){let n=ci(t);if(!(n&&Fn(t.bgColor))||qt(t.frame)||t.templateId||t.customTemplate)return n;let o=Le(e)?.children.find(a=>a.name==="rect"),r=o&&K(o,"fill");return r?.startsWith("url(")?r:n}function $o(t,e){let n={r:255,g:255,b:255,a:1},o=mt(wt(e.bgColor,_t));t.paper=n,t.background=o&&!Fn(e.bgColor)?o:null,t.backdrop=o?oo(o,n):n;}he();Dt();var xo=25.4,au=5,iu=2e3,Pe=_o,li=5,su=2,sf=.25*(xo/72);function cf(t,e="mm"){return e==="in"?t*xo:t}function lf(t){let e=Bt(t),n=Mt.QrCode.encodeText(t.value,Lt[e]).size;return n+Tt(n,t.margin??Ct,t.shape)*2}function So(t,e){let n=cf(e.size,e.unit);if(!Number.isFinite(n)||n<au||n>iu)throw new Error(`Print size must be between ${au} mm and ${iu/1e3} m`);let o=Math.min(Math.max(e.bleed??0,0),20),r=n/Pe,a=qt(t.frame)?je(Pe,t.frame):null,i=(a?.width??Pe)*r,c=(a?.height??Pe)*r,s=e.cropMarks?o+su+li+1:o,l=lf(t);return {codeWidth:n,trimWidth:i,trimHeight:c,bleed:o,pageWidth:i+2*s,pageHeight:c+2*s,trimX:s,trimY:s,moduleSize:n/l,moduleCount:l,maxScanDistance:n*10}}var ui=class t{pdf;internals;names=new Map;constructor(e,n){this.pdf=e,this.internals=n;}static attach(e){let n=e.internal;return typeof e.advancedAPI!="function"||typeof e.addShadingPattern!="function"||typeof n.write!="function"||typeof n.events?.subscribe!="function"?null:new t(e,n)}name(e){let n=this.names.get(e);return n||(this.names.size===0&&this.install(),n=`Sh${this.names.size}`,this.names.set(e,n)),n}install(){this.pdf.advancedAPI(e=>{e.addShadingPattern("qrdx-shadings",{});}),this.internals.events.subscribe("putShadingPatternDict",()=>{for(let[e,n]of this.names)this.internals.write(`/${n} ${e}`);});}},mi=class extends Gn{pdf;cmyk;images;shadingResources;constructor(e,n,o,r,a){super(o,r?.gradients??null),this.pdf=e,this.cmyk=n,this.images=a,this.shadingResources=r?.resources??null;}setColor(e,n){let o=e==="fill"?this.pdf.setFillColor.bind(this.pdf):e==="draw"?this.pdf.setDrawColor.bind(this.pdf):this.pdf.setTextColor.bind(this.pdf);if(this.cmyk){let[r,a,i,c]=Te(n.r,n.g,n.b);o(r,a,i,c);}else o(Math.round(n.r),Math.round(n.g),Math.round(n.b));}setRegistrationColor(){this.cmyk?this.pdf.setDrawColor(1,1,1,1):this.pdf.setDrawColor(0,0,0);}tracePath(e,n){let o=false;for(let r of e)if(r.op==="M"){let[a,i]=X(n,r.x,r.y);this.pdf.moveTo(a,i),o=true;}else if(r.op==="L"){let[a,i]=X(n,r.x,r.y);o?this.pdf.lineTo(a,i):(this.pdf.moveTo(a,i),o=true);}else if(r.op==="C"){let[a,i]=X(n,r.x1,r.y1),[c,s]=X(n,r.x2,r.y2),[l,u]=X(n,r.x,r.y);this.pdf.curveTo(a,i,c,s,l,u);}else o&&this.pdf.close();}shade(e,n,o){let r=this.pdf.internal,a=r.scaleFactor,i=[a,0,0,-a,0,r.pageSize.getHeight()*a],c=pt(i,pt(n.matrix,o.matrix));if(!(this.shadingResources&&Ge(c)))return;let s=this.shadingResources.name(ho(o,this.cmyk?"cmyk":"rgb"));this.pdf.saveGraphicsState(),this.tracePath(e,n.matrix),this.pdf.clip(n.fillRule==="evenodd"?"evenodd":void 0),this.pdf.discardPath(),r.write(`${fo(c)} cm /${s} sh`),this.pdf.restoreGraphicsState();}beginClip(e,n,o){return this.pdf.saveGraphicsState(),this.tracePath(e,n),this.pdf.clip(o?"evenodd":void 0),this.pdf.discardPath(),true}endClip(){this.pdf.restoreGraphicsState();}withAlpha(e,n,o){if(e>=1&&n>=1){o();return}this.pdf.saveGraphicsState();let r=this.pdf.GState;this.pdf.setGState(new r({opacity:e,"stroke-opacity":n}));try{o();}finally{this.pdf.restoreGraphicsState();}}opaqueGradient(e,n){let o=e.stops[0]?.color.a??1;return e.stops.every(a=>Math.abs(a.color.a-o)<.002)?{gradient:{...e,stops:e.stops.map(a=>({...a,color:{...a.color,a:1}}))},alpha:o*n}:{gradient:{...e,stops:e.stops.map(a=>({...a,color:this.flatten({...a.color,a:a.color.a*n})}))},alpha:1}}paint(e,n,o){if(e.length===0)return;let r=o.opacity??1;if(r<=0)return;let a=this.resolveFill(o.fill,e,o.viewport,(o.fillOpacity??1)*r);if(a&&"pattern"in a)this.paintPattern(e,o,a.pattern,a.alpha);else if(a&&"gradient"in a){let{gradient:m,alpha:f}=this.opaqueGradient(a.gradient,a.alpha);this.withAlpha(f,1,()=>this.shade(e,o,m));}let i=a&&"color"in a?a.color:null,c=i&&this.inConic?this.flatten(i):i,s=o.strokeWidth>0?this.resolveColor(o.stroke):null,l=s&&{...s,a:s.a*r};if(!(c||l))return;let u=o.fillRule==="evenodd";this.withAlpha(c?.a??1,l?.a??1,()=>{c&&this.setColor("fill",c),l&&(this.setColor("draw",l),this.pdf.setLineWidth(o.strokeWidth*Sn(o.matrix))),this.tracePath(e,o.matrix),c&&l?u?this.pdf.fillStrokeEvenOdd():this.pdf.fillStroke():c?u?this.pdf.fillEvenOdd():this.pdf.fill():this.pdf.stroke();});}text(e,n){let o=e.text.replace(/\s+/g," ").trim(),r=this.resolveColor(n.fill);if(!(o&&r))return;let a=Sn(n.matrix),[i,c]=X(n.matrix,Y(e.attrs.x,n.viewport[0]),Y(e.attrs.y,n.viewport[1])),s=n.fontWeight==="bold"||Number.parseInt(n.fontWeight,10)>=600;this.pdf.setFont("helvetica",s?"bold":"normal");let l=n.fontSize*a*(72/xo);this.pdf.setFontSize(l);let u=Number.parseFloat(e.attrs["data-max-width"]??"");if(u>0){let d=u*a,p=this.pdf.getTextWidth(o);p>d&&(l*=d/p,this.pdf.setFontSize(l));}this.setColor("text",r);let m=Math.atan2(n.matrix[1],n.matrix[0]);if(Math.abs(m)>2e-4){let d=n.textAnchor==="middle"?this.pdf.getTextWidth(o)/2:n.textAnchor==="end"?this.pdf.getTextWidth(o):0;this.pdf.text(o,i-d*Math.cos(m),c-d*Math.sin(m),{angle:-m*180/Math.PI,baseline:"alphabetic"});return}let f=n.textAnchor==="middle"?"center":n.textAnchor==="end"?"right":"left";this.pdf.text(o,i,c,{align:f,baseline:"alphabetic"});}aliases=new Map;image(e,n){let o=e.attrs.href??e.attrs["xlink:href"],r=o&&(go(o)?o:this.images.get(o)),a=r&&go(r);if(!(r&&a))return;let i=this.aliases.get(r);i||(i=`qrdx-image-${this.aliases.size}`,this.aliases.set(r,i));let c=null;if(e.attrs.preserveAspectRatio)try{let g=this.pdf.getImageProperties(r);c={width:g.width,height:g.height};}catch{c=null;}let s=nu(e,n.viewport,c);if(!s)return;let{draw:l,clip:u}=s,[m,f]=X(n.matrix,l.x,l.y),[d,p]=X(n.matrix,l.x+l.width,l.y+l.height),h=u!==null&&this.beginClip([{op:"M",x:u.x,y:u.y},{op:"L",x:u.x+u.width,y:u.y},{op:"L",x:u.x+u.width,y:u.y+u.height},{op:"L",x:u.x,y:u.y+u.height},{op:"Z"}],n.matrix,false);try{this.withAlpha(n.opacity??1,1,()=>{this.pdf.addImage(r,a,Math.min(m,d),Math.min(f,p),Math.abs(d-m),Math.abs(p-f),i);});}finally{h&&this.endClip();}}};function uf(t,e,n){let{trimX:o,trimY:r,trimWidth:a,trimHeight:i,bleed:c}=n,s=c+su,l=o,u=o+a,m=r,f=r+i;e.setRegistrationColor(),t.setLineWidth(sf);for(let d of [l,u]){let p=d===l?-1:1;for(let h of [m,f]){let g=h===m?-1:1;t.line(d+p*s,h,d+p*(s+li),h),t.line(d,h+g*s,d,h+g*(s+li));}}}async function mf(t,e){return (await cu(t,e)).output("dataurlstring")}async function Wb(t,e){return (await cu(t,e)).output("arraybuffer")}async function cu(t,e){let n=So(t,e),o;try{({jsPDF:o}=await import('jspdf'));}catch(b){throw new Error(`PDF export needs the optional "jspdf" package. Install it with \`npm install jspdf\`. (${b})`)}let r=await cr(t),a=Le(r);if(!a)throw new Error("Failed to render the QR code for printing");let i=new Map;for(let b of sr(a,new Set))if(!go(b)){let _=await bo(b);_&&i.set(b,_);}let c=new o({orientation:n.pageWidth>n.pageHeight?"landscape":"portrait",unit:"mm",format:[n.pageWidth,n.pageHeight],compress:true,floatPrecision:3});c.setProperties({title:"QR code",creator:"qrdx"});let s=mo(a),l=s.size>0?ui.attach(c):null,u=new mi(c,e.colorMode==="cmyk",ir(a,new Map),l?{gradients:s,resources:l}:null,i);$o(u,t);let m=n.codeWidth/Pe,f=Y(a.attrs.width,Pe,Pe),d=Y(a.attrs.height,Pe,Pe),p={matrix:pt([1,0,0,1,n.trimX,n.trimY],[m,0,0,m,0,0]),viewport:[f,d],fill:"#000000",fillRule:"nonzero",stroke:"none",strokeWidth:1,fontSize:16,fontWeight:"normal",textAnchor:"start"},h=n.bleed>0?yo(t,r):null,g=[n.trimX-n.bleed,n.trimY-n.bleed,n.trimX+n.trimWidth+n.bleed,n.trimY+n.trimHeight+n.bleed];if(!(h&&u.paintBleed(a,p,h,g))){let b=h?u.resolveColor(h):null;b&&(u.setColor("fill",b),c.rect(n.trimX-n.bleed,n.trimY-n.bleed,n.trimWidth+2*n.bleed,n.trimHeight+2*n.bleed,"F"));}return u.walk(a,p,true),e.cropMarks&&uf(c,u,n),c}async function df(t,e){let n=So(t,{size:e.size,unit:e.unit}),o=await cr(t),r=e.unit??"mm",a=s=>`${$(r==="in"?s/xo:s)}${r}`,i=/^<svg\b[^>]*>/.exec(o)?.[0];if(!i)throw new Error("Failed to render the QR code for printing");return `<?xml version="1.0" encoding="UTF-8"?>
2
- ${i.replace(/\swidth="[^"]*"/,` width="${a(n.trimWidth)}"`).replace(/\sheight="[^"]*"/,` height="${a(n.trimHeight)}"`)}${o.slice(i.length)}`}async function Vb(t,e){let n=await mf(t,e);le(n,e.filename??"qr-code-print.pdf");}async function Xb(t,e){let n=await df(t,e);le(`data:image/svg+xml;charset=utf-8,${encodeURIComponent(n)}`,e.filename??"qr-code-print.svg");}ge();ht();Dt();var ff=[137,80,78,71,13,10,26,10];async function uu(t,e){let n=new Blob([t]).stream().pipeThrough(e);return new Uint8Array(await new Response(n).arrayBuffer())}async function mu(t){return typeof CompressionStream>"u"?null:await uu(t,new CompressionStream("deflate"))}async function hf(t){if(typeof DecompressionStream>"u")return null;try{return await uu(t,new DecompressionStream("deflate"))}catch{return null}}var di=(t,e)=>t[e]*2**24+(t[e+1]<<16)+(t[e+2]<<8)+t[e+3]>>>0,lu={0:1,2:3,3:1,4:2,6:4};function pf(t,e,n){let o=t+e-n,r=Math.abs(o-t),a=Math.abs(o-e),i=Math.abs(o-n);return r<=a&&r<=i?t:a<=i?e:n}async function fi(t){if(ff.some((h,g)=>t[g]!==h))return null;let e=8,n=0,o=0,r=-1,a=null,i=null,c=[];for(;e+8<=t.length;){let h=di(t,e),g=String.fromCharCode(...t.subarray(e+4,e+8)),b=t.subarray(e+8,e+8+h);if(e+=12+h,g==="IHDR"){n=di(b,0),o=di(b,4);let _=b[8];r=b[9];let y=b[12];if(_!==8||y!==0||!(r in lu))return null}else if(g==="PLTE")a=b;else if(g==="tRNS")i=b;else if(g==="IDAT")c.push(b);else if(g==="IEND")break}if(!(n&&o)||n*o>4096*4096)return null;let s=new Uint8Array(c.reduce((h,g)=>h+g.length,0)),l=0;for(let h of c)s.set(h,l),l+=h.length;let u=await hf(s),m=lu[r],f=n*m;if(!u||u.length<o*(f+1))return null;let d=new Uint8Array(o*f);for(let h=0;h<o;h++){let g=u[h*(f+1)],b=u.subarray(h*(f+1)+1,(h+1)*(f+1)),_=h*f;for(let y=0;y<f;y++){let M=y>=m?d[_+y-m]:0,C=h>0?d[_-f+y]:0,x=h>0&&y>=m?d[_-f+y-m]:0,S=b[y],w=0;g===1?w=M:g===2?w=C:g===3?w=M+C>>1:g===4&&(w=pf(M,C,x)),d[_+y]=S+w&255;}}let p=new Uint8Array(n*o*4);for(let h=0;h<n*o;h++){let g=h*4,b=h*m;if(r===3){let _=d[b];p[g]=a?.[_*3]??0,p[g+1]=a?.[_*3+1]??0,p[g+2]=a?.[_*3+2]??0,p[g+3]=i?.[_]??255;}else if(r===0||r===4){let _=d[b];p[g]=_,p[g+1]=_,p[g+2]=_,p[g+3]=r===4?d[b+1]:255;}else p[g]=d[b],p[g+1]=d[b+1],p[g+2]=d[b+2],p[g+3]=r===6?d[b+3]:255;}return {width:n,height:o,data:p}}he();var gf=25.4,du=72/gf,bf=50;function _f(t){let e=/^data:[^,]*?(;base64)?,(.*)$/s.exec(t);if(!e)return null;try{let n=e[1]?atob(e[2]):decodeURIComponent(e[2]),o=new Uint8Array(n.length);for(let r=0;r<n.length;r++)o[r]=n.charCodeAt(r)&255;return o}catch{return null}}function yf(t){if(t[0]!==255||t[1]!==216)return null;let e=2;for(;e+9<t.length;){if(t[e]!==255)return null;let n=t[e+1];if(n===216||n>=208&&n<=215){e+=2;continue}let o=t[e+2]<<8|t[e+3];if(n===192||n===193||n===194){let r=t[e+5]<<8|t[e+6],a=t[e+7]<<8|t[e+8],i=t[e+9];return {width:a,height:r,components:i,progressive:n===194}}e+=2+o;}return null}async function $f(t,e){let{width:n,height:o,data:r}=t,a=e?4:3,i=new Uint8Array(n*o*a);for(let s=0;s<n*o;s++){let l=r[s*4+3]/255,u=r[s*4]*l+255*(1-l),m=r[s*4+1]*l+255*(1-l),f=r[s*4+2]*l+255*(1-l);if(e){let[d,p,h,g]=Te(u,m,f);i.set([d*255,p*255,h*255,g*255].map(Math.round),s*a);}else i.set([Math.round(u),Math.round(m),Math.round(f)],s*a);}let c=await mu(i);return {kind:"raw",width:n,height:o,components:a,bytes:c??i,compressed:!!c}}async function xf(t,e){let n=t;if(!/^data:image\/(png|jpe?g)[;,]/i.test(n)){let i=await bo(n);if(!i)return null;n=i;}let o=_f(n);if(!o)return null;let r=yf(o);if(r)return r.components===1||r.components===3?{kind:"jpeg",width:r.width,height:r.height,components:r.components,bytes:o,progressive:r.progressive}:null;let a=await fi(o);return a?await $f(a,e):null}function Sf(t){let e="",n=0,o=r=>{e+=r,n+=r.length,n>=76&&(e+=`
3
- `,n=0);};for(let r=0;r<t.length;r+=4){let a=Math.min(4,t.length-r),i=0;for(let s=0;s<4;s++)i=i*256+(s<a?t[r+s]:0);if(i===0&&a===4){o("z");continue}let c=[];for(let s=0;s<5;s++)c.unshift(String.fromCharCode(i%85+33)),i=Math.floor(i/85);o(c.slice(0,a+1).join(""));}return `${e}~>`}var Mf=`/qrdxdict 40 dict def
1
+ import {z}from'zod';import ri,{memo,useMemo}from'react';import {jsx,jsxs,Fragment}from'react/jsx-runtime';export{OFFICIAL_FRAME_INDEX}from'./frames-index.mjs';export{OFFICIAL_FRAMES,getOfficialFrame}from'./frames-official.mjs';export{QRCodeCanvas}from'./qr-code-canvas.mjs';var ym=Object.defineProperty;var U=(t,e,n)=>()=>{if(n)throw n[0];try{return t&&(e=t(t=0)),e}catch(o){throw n=[o],o}};var $m=(t,e)=>{for(var n in e)ym(t,n,{get:e[n],enumerable:true});};var yn,Mt,me=U(()=>{"use strict";(a=>{class t{constructor(c,s,l,u){this.version=c;this.errorCorrectionLevel=s;if(c<t.MIN_VERSION||c>t.MAX_VERSION)throw new RangeError("Version value out of range");if(u<-1||u>7)throw new RangeError("Mask value out of range");this.size=c*4+17;let m=[];for(let d=0;d<this.size;d++)m.push(!1);for(let d=0;d<this.size;d++)this.modules.push(m.slice()),this.isFunction.push(m.slice());this.drawFunctionPatterns();let f=this.addEccAndInterleave(l);if(this.drawCodewords(f),u==-1){let d=1e9;for(let p=0;p<8;p++){this.applyMask(p),this.drawFormatBits(p);let h=this.getPenaltyScore();h<d&&(u=p,d=h),this.applyMask(p);}}o(0<=u&&u<=7),this.mask=u,this.applyMask(u),this.drawFormatBits(u),this.isFunction=[];}version;errorCorrectionLevel;static encodeText(c,s){let l=a.QrSegment.makeSegments(c);return t.encodeSegments(l,s)}static encodeBinary(c,s){let l=a.QrSegment.makeBytes(c);return t.encodeSegments([l],s)}static encodeSegments(c,s,l=1,u=40,m=-1,f=!0){if(!(t.MIN_VERSION<=l&&l<=u&&u<=t.MAX_VERSION)||m<-1||m>7)throw new RangeError("Invalid value");let d,p;for(d=l;;d++){let _=t.getNumDataCodewords(d,s)*8,y=r.getTotalBits(c,d);if(y<=_){p=y;break}if(d>=u)throw new RangeError("Data too long")}for(let _ of [t.Ecc.MEDIUM,t.Ecc.QUARTILE,t.Ecc.HIGH])f&&p<=t.getNumDataCodewords(d,_)*8&&(s=_);let h=[];for(let _ of c){e(_.mode.modeBits,4,h),e(_.numChars,_.mode.numCharCountBits(d),h);for(let y of _.getData())h.push(y);}o(h.length==p);let g=t.getNumDataCodewords(d,s)*8;o(h.length<=g),e(0,Math.min(4,g-h.length),h),e(0,(8-h.length%8)%8,h),o(h.length%8==0);for(let _=236;h.length<g;_^=253)e(_,8,h);let b=[];for(;b.length*8<h.length;)b.push(0);return h.forEach((_,y)=>b[y>>>3]|=_<<7-(y&7)),new t(d,s,b,m)}size;mask;modules=[];isFunction=[];getModule(c,s){return 0<=c&&c<this.size&&0<=s&&s<this.size&&this.modules[s][c]}getModules(){return this.modules}drawFunctionPatterns(){for(let l=0;l<this.size;l++)this.setFunctionModule(6,l,l%2==0),this.setFunctionModule(l,6,l%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);let c=this.getAlignmentPatternPositions(),s=c.length;for(let l=0;l<s;l++)for(let u=0;u<s;u++)l==0&&u==0||l==0&&u==s-1||l==s-1&&u==0||this.drawAlignmentPattern(c[l],c[u]);this.drawFormatBits(0),this.drawVersion();}drawFormatBits(c){let s=this.errorCorrectionLevel.formatBits<<3|c,l=s;for(let m=0;m<10;m++)l=l<<1^(l>>>9)*1335;let u=(s<<10|l)^21522;o(u>>>15==0);for(let m=0;m<=5;m++)this.setFunctionModule(8,m,n(u,m));this.setFunctionModule(8,7,n(u,6)),this.setFunctionModule(8,8,n(u,7)),this.setFunctionModule(7,8,n(u,8));for(let m=9;m<15;m++)this.setFunctionModule(14-m,8,n(u,m));for(let m=0;m<8;m++)this.setFunctionModule(this.size-1-m,8,n(u,m));for(let m=8;m<15;m++)this.setFunctionModule(8,this.size-15+m,n(u,m));this.setFunctionModule(8,this.size-8,!0);}drawVersion(){if(this.version<7)return;let c=this.version;for(let l=0;l<12;l++)c=c<<1^(c>>>11)*7973;let s=this.version<<12|c;o(s>>>18==0);for(let l=0;l<18;l++){let u=n(s,l),m=this.size-11+l%3,f=Math.floor(l/3);this.setFunctionModule(m,f,u),this.setFunctionModule(f,m,u);}}drawFinderPattern(c,s){for(let l=-4;l<=4;l++)for(let u=-4;u<=4;u++){let m=Math.max(Math.abs(u),Math.abs(l)),f=c+u,d=s+l;0<=f&&f<this.size&&0<=d&&d<this.size&&this.setFunctionModule(f,d,m!=2&&m!=4);}}drawAlignmentPattern(c,s){for(let l=-2;l<=2;l++)for(let u=-2;u<=2;u++)this.setFunctionModule(c+u,s+l,Math.max(Math.abs(u),Math.abs(l))!=1);}setFunctionModule(c,s,l){this.modules[s][c]=l,this.isFunction[s][c]=!0;}addEccAndInterleave(c){let s=this.version,l=this.errorCorrectionLevel;if(c.length!=t.getNumDataCodewords(s,l))throw new RangeError("Invalid argument");let u=t.NUM_ERROR_CORRECTION_BLOCKS[l.ordinal][s],m=t.ECC_CODEWORDS_PER_BLOCK[l.ordinal][s],f=Math.floor(t.getNumRawDataModules(s)/8),d=u-f%u,p=Math.floor(f/u),h=[],g=t.reedSolomonComputeDivisor(m);for(let _=0,y=0;_<u;_++){let M=c.slice(y,y+p-m+(_<d?0:1));y+=M.length;let C=t.reedSolomonComputeRemainder(M,g);_<d&&M.push(0),h.push(M.concat(C));}let b=[];for(let _=0;_<h[0].length;_++)h.forEach((y,M)=>{(_!=p-m||M>=d)&&b.push(y[_]);});return o(b.length==f),b}drawCodewords(c){if(c.length!=Math.floor(t.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let s=0;for(let l=this.size-1;l>=1;l-=2){l==6&&(l=5);for(let u=0;u<this.size;u++)for(let m=0;m<2;m++){let f=l-m,p=(l+1&2)==0?this.size-1-u:u;!this.isFunction[p][f]&&s<c.length*8&&(this.modules[p][f]=n(c[s>>>3],7-(s&7)),s++);}}o(s==c.length*8);}applyMask(c){if(c<0||c>7)throw new RangeError("Mask value out of range");for(let s=0;s<this.size;s++)for(let l=0;l<this.size;l++){let u;switch(c){case 0:u=(l+s)%2==0;break;case 1:u=s%2==0;break;case 2:u=l%3==0;break;case 3:u=(l+s)%3==0;break;case 4:u=(Math.floor(l/3)+Math.floor(s/2))%2==0;break;case 5:u=l*s%2+l*s%3==0;break;case 6:u=(l*s%2+l*s%3)%2==0;break;case 7:u=((l+s)%2+l*s%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[s][l]&&u&&(this.modules[s][l]=!this.modules[s][l]);}}getPenaltyScore(){let c=0;for(let m=0;m<this.size;m++){let f=!1,d=0,p=[0,0,0,0,0,0,0];for(let h=0;h<this.size;h++)this.modules[m][h]==f?(d++,d==5?c+=t.PENALTY_N1:d>5&&c++):(this.finderPenaltyAddHistory(d,p),f||(c+=this.finderPenaltyCountPatterns(p)*t.PENALTY_N3),f=this.modules[m][h],d=1);c+=this.finderPenaltyTerminateAndCount(f,d,p)*t.PENALTY_N3;}for(let m=0;m<this.size;m++){let f=!1,d=0,p=[0,0,0,0,0,0,0];for(let h=0;h<this.size;h++)this.modules[h][m]==f?(d++,d==5?c+=t.PENALTY_N1:d>5&&c++):(this.finderPenaltyAddHistory(d,p),f||(c+=this.finderPenaltyCountPatterns(p)*t.PENALTY_N3),f=this.modules[h][m],d=1);c+=this.finderPenaltyTerminateAndCount(f,d,p)*t.PENALTY_N3;}for(let m=0;m<this.size-1;m++)for(let f=0;f<this.size-1;f++){let d=this.modules[m][f];d==this.modules[m][f+1]&&d==this.modules[m+1][f]&&d==this.modules[m+1][f+1]&&(c+=t.PENALTY_N2);}let s=0;for(let m of this.modules)s=m.reduce((f,d)=>f+(d?1:0),s);let l=this.size*this.size,u=Math.ceil(Math.abs(s*20-l*10)/l)-1;return o(0<=u&&u<=9),c+=u*t.PENALTY_N4,o(0<=c&&c<=2568888),c}getAlignmentPatternPositions(){if(this.version==1)return [];{let c=Math.floor(this.version/7)+2,s=this.version==32?26:Math.ceil((this.version*4+4)/(c*2-2))*2,l=[6];for(let u=this.size-7;l.length<c;u-=s)l.splice(1,0,u);return l}}static getNumRawDataModules(c){if(c<t.MIN_VERSION||c>t.MAX_VERSION)throw new RangeError("Version number out of range");let s=(16*c+128)*c+64;if(c>=2){let l=Math.floor(c/7)+2;s-=(25*l-10)*l-55,c>=7&&(s-=36);}return o(208<=s&&s<=29648),s}static getNumDataCodewords(c,s){return Math.floor(t.getNumRawDataModules(c)/8)-t.ECC_CODEWORDS_PER_BLOCK[s.ordinal][c]*t.NUM_ERROR_CORRECTION_BLOCKS[s.ordinal][c]}static reedSolomonComputeDivisor(c){if(c<1||c>255)throw new RangeError("Degree out of range");let s=[];for(let u=0;u<c-1;u++)s.push(0);s.push(1);let l=1;for(let u=0;u<c;u++){for(let m=0;m<s.length;m++)s[m]=t.reedSolomonMultiply(s[m],l),m+1<s.length&&(s[m]^=s[m+1]);l=t.reedSolomonMultiply(l,2);}return s}static reedSolomonComputeRemainder(c,s){let l=s.map(u=>0);for(let u of c){let m=u^l.shift();l.push(0),s.forEach((f,d)=>l[d]^=t.reedSolomonMultiply(f,m));}return l}static reedSolomonMultiply(c,s){if(c>>>8||s>>>8)throw new RangeError("Byte out of range");let l=0;for(let u=7;u>=0;u--)l=l<<1^(l>>>7)*285,l^=(s>>>u&1)*c;return o(l>>>8==0),l}finderPenaltyCountPatterns(c){let s=c[1];o(s<=this.size*3);let l=s>0&&c[2]==s&&c[3]==s*3&&c[4]==s&&c[5]==s;return (l&&c[0]>=s*4&&c[6]>=s?1:0)+(l&&c[6]>=s*4&&c[0]>=s?1:0)}finderPenaltyTerminateAndCount(c,s,l){return c&&(this.finderPenaltyAddHistory(s,l),s=0),s+=this.size,this.finderPenaltyAddHistory(s,l),this.finderPenaltyCountPatterns(l)}finderPenaltyAddHistory(c,s){s[0]==0&&(c+=this.size),s.pop(),s.unshift(c);}static MIN_VERSION=1;static MAX_VERSION=40;static PENALTY_N1=3;static PENALTY_N2=3;static PENALTY_N3=40;static PENALTY_N4=10;static ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]];static NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]]}a.QrCode=t;function e(i,c,s){if(c<0||c>31||i>>>c)throw new RangeError("Value out of range");for(let l=c-1;l>=0;l--)s.push(i>>>l&1);}function n(i,c){return (i>>>c&1)!=0}function o(i){if(!i)throw new Error("Assertion error")}class r{constructor(c,s,l){this.mode=c;this.numChars=s;this.bitData=l;if(s<0)throw new RangeError("Invalid argument");this.bitData=l.slice();}mode;numChars;bitData;static makeBytes(c){let s=[];for(let l of c)e(l,8,s);return new r(r.Mode.BYTE,c.length,s)}static makeNumeric(c){if(!r.isNumeric(c))throw new RangeError("String contains non-numeric characters");let s=[];for(let l=0;l<c.length;){let u=Math.min(c.length-l,3);e(parseInt(c.substr(l,u),10),u*3+1,s),l+=u;}return new r(r.Mode.NUMERIC,c.length,s)}static makeAlphanumeric(c){if(!r.isAlphanumeric(c))throw new RangeError("String contains unencodable characters in alphanumeric mode");let s=[],l;for(l=0;l+2<=c.length;l+=2){let u=r.ALPHANUMERIC_CHARSET.indexOf(c.charAt(l))*45;u+=r.ALPHANUMERIC_CHARSET.indexOf(c.charAt(l+1)),e(u,11,s);}return l<c.length&&e(r.ALPHANUMERIC_CHARSET.indexOf(c.charAt(l)),6,s),new r(r.Mode.ALPHANUMERIC,c.length,s)}static makeSegments(c){return c==""?[]:r.isNumeric(c)?[r.makeNumeric(c)]:r.isAlphanumeric(c)?[r.makeAlphanumeric(c)]:[r.makeBytes(r.toUtf8ByteArray(c))]}static makeEci(c){let s=[];if(c<0)throw new RangeError("ECI assignment value out of range");if(c<128)e(c,8,s);else if(c<16384)e(2,2,s),e(c,14,s);else if(c<1e6)e(6,3,s),e(c,21,s);else throw new RangeError("ECI assignment value out of range");return new r(r.Mode.ECI,0,s)}static isNumeric(c){return r.NUMERIC_REGEX.test(c)}static isAlphanumeric(c){return r.ALPHANUMERIC_REGEX.test(c)}getData(){return this.bitData.slice()}static getTotalBits(c,s){let l=0;for(let u of c){let m=u.mode.numCharCountBits(s);if(u.numChars>=1<<m)return 1/0;l+=4+m+u.bitData.length;}return l}static toUtf8ByteArray(c){c=encodeURI(c);let s=[];for(let l=0;l<c.length;l++)c.charAt(l)!="%"?s.push(c.charCodeAt(l)):(s.push(parseInt(c.substr(l+1,2),16)),l+=2);return s}static NUMERIC_REGEX=/^[0-9]*$/;static ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/;static ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:"}a.QrSegment=r;})(yn||={});(e=>{let t;(o=>{class n{constructor(a,i){this.ordinal=a;this.formatBits=i;}ordinal;formatBits;static LOW=new n(0,1);static MEDIUM=new n(1,0);static QUARTILE=new n(2,3);static HIGH=new n(3,2)}o.Ecc=n;})(t=e.QrCode||={});})(yn||={});(e=>{let t;(o=>{class n{constructor(a,i){this.modeBits=a;this.numBitsCharCount=i;}modeBits;numBitsCharCount;static NUMERIC=new n(1,[10,12,14]);static ALPHANUMERIC=new n(2,[9,11,13]);static BYTE=new n(4,[8,16,16]);static KANJI=new n(8,[8,10,12]);static ECI=new n(7,[0,0,0]);numCharCountBits(a){return this.numBitsCharCount[Math.floor((a+7)/17)]}}o.Mode=n;})(t=e.QrSegment||={});})(yn||={});Mt=yn;});var Lt,_t,te,yt,Pt,Ct,fr,At=U(()=>{"use strict";me();Lt={L:Mt.QrCode.Ecc.LOW,M:Mt.QrCode.Ecc.MEDIUM,Q:Mt.QrCode.Ecc.QUARTILE,H:Mt.QrCode.Ecc.HIGH},_t=128,te="Q",yt="#FFFFFF",Pt="#000000",Ct=0,fr=.1;});var ns,ee,Oo,$n,Ae,rs,hr,zn=U(()=>{"use strict";ns=["none","banner-bottom","banner-top","border","rounded-border","speech-bubble","banner-top-bottom","speech-bubble-top","chat-bubble","circle","polaroid","phone","ticket","badge","envelope","tag","menu-card","sticker","gradient-border","focus"],ee=24,Oo="Scan me",$n=.5,Ae=1.5,rs=z.enum(ns),hr=z.object({style:rs,text:z.string().max(ee).optional(),color:z.string().optional(),textColor:z.string().optional(),secondaryText:z.string().max(ee).optional(),secondaryColor:z.string().optional(),fontScale:z.number().min($n).max(Ae).optional()});});function st(t,e=3){let n=10**e;return Math.round(t*n)/n+0}function $(t,e=3){return String(st(t,e))}function P(t,...e){let n=t[0]??"";for(let o=0;o<e.length;o++){let r=e[o];n+=(typeof r=="number"?$(r):r)+(t[o+1]??"");}return n}var ht=U(()=>{"use strict";});function pr(t,e=Number.POSITIVE_INFINITY){if(!Sm.test(t))return null;let n=[],o=0,r=()=>{for(;o<t.length&&/[\s,]/.test(t[o]);)o++;},a=()=>{r(),Do.lastIndex=o;let s=Do.exec(t);if(!s)return null;let l=s[0],u=l.indexOf(".");if(u>=0&&l.length-u-1>e)return null;o=Do.lastIndex;let m=Number(l);return Number.isFinite(m)?m:null},i=()=>{r();let s=t[o];return s==="0"||s==="1"?(o++,s==="1"?1:0):null},c=()=>(r(),o<t.length&&/[0-9.+-]/.test(t[o]));for(r();o<t.length;){let s=t[o],l=s.toUpperCase(),u=xm[l];if(u===void 0||n.length===0&&l!=="M")return null;if(o++,u===0){n.push({command:s,values:[]}),r();continue}let m=s,f=true;for(;f||c();){let d=[];for(let p=0;p<u;p++){let h=l==="A"&&(p===3||p===4)?i():a();if(h===null)return null;d.push(h);}n.push({command:m,values:d}),l==="M"&&(m=s==="M"?"L":"l"),f=false;}r();}return n}function os(t){let e=0;for(let{command:n}of t)e+=n.toUpperCase()==="A"?4:1;return e}function as(t,e=1,n=0,o=0){let r="";for(let{command:a,values:i}of t){let c=a.toUpperCase(),s=a===c,l=s?n:0,u=s?o:0,m;switch(c){case "Z":m=[];break;case "H":m=[$(i[0]*e+l)];break;case "V":m=[$(i[0]*e+u)];break;case "A":m=[$(Math.abs(i[0])*e),$(Math.abs(i[1])*e),$(i[2]),String(i[3]),String(i[4]),$(i[5]*e+l),$(i[6]*e+u)];break;default:m=i.map((f,d)=>$(f*e+(d%2===0?l:u)));}r+=a+m.join(" ");}return r}var xm,Sm,Do,Bo=U(()=>{"use strict";ht();xm={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0},Sm=/^[MmLlHhVvCcSsQqTtAaZz0-9.,+\-\s]*$/,Do=/[+-]?(?:\d+\.?\d*|\.\d+)/y;});function gr(t,e=.25){let n=[],o=[],r=[0,0],a=[0,0],i=()=>{o.length>2&&n.push(o),o=[];};for(let c of t)if(c.op==="M")i(),r=[c.x,c.y],a=r,o.push(r);else if(c.op==="L")a=[c.x,c.y],o.push(a);else if(c.op==="C"){let s=a,l=[c.x1,c.y1],u=[c.x2,c.y2],m=[c.x,c.y],f=Math.hypot(l[0]-s[0],l[1]-s[1])+Math.hypot(u[0]-l[0],u[1]-l[1])+Math.hypot(m[0]-u[0],m[1]-u[1]),d=Math.max(2,Math.min(64,Math.ceil(Math.sqrt(f/(4*e)))));for(let p=1;p<=d;p++){let h=p/d,g=1-h;o.push([g*g*g*s[0]+3*g*g*h*l[0]+3*g*h*h*u[0]+h*h*h*m[0],g*g*g*s[1]+3*g*g*h*l[1]+3*g*h*h*u[1]+h*h*h*m[1]]);}a=m;}else i(),a=r;return i(),n}function br(t,e){let n=[r=>r[0]-e.x0,r=>e.x1-r[0],r=>r[1]-e.y0,r=>e.y1-r[1]],o=t;for(let r of n){if(o.length===0)break;let a=o;o=[];for(let i=0;i<a.length;i++){let c=a[i],s=a[(i+a.length-1)%a.length],l=r(c),u=r(s);l>=0?(u<0&&o.push(is(s,c,u,l)),o.push(c)):u>=0&&o.push(is(s,c,u,l));}}return o.length>2?o:[]}function is(t,e,n,o){let r=n/(n-o);return [t[0]+(e[0]-t[0])*r,t[1]+(e[1]-t[1])*r]}function ss(t){return t.filter(e=>e.length>2).map(e=>`M${e.map(([n,o])=>`${$(n)} ${$(o)}`).join("L")}Z`).join("")}function We(t){let e=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,r=Number.NEGATIVE_INFINITY,a=(i,c)=>{e=Math.min(e,i),n=Math.min(n,c),o=Math.max(o,i),r=Math.max(r,c);};for(let i of t)i.op==="C"?(a(i.x1,i.y1),a(i.x2,i.y2),a(i.x,i.y)):i.op!=="Z"&&a(i.x,i.y);return Number.isFinite(e)?{x0:e,y0:n,x1:o,y1:r}:null}var _r=U(()=>{"use strict";ht();});function us(t){return t.replace(/&(#x[0-9a-f]+|#\d+|[a-z]+);/gi,(e,n)=>{if(n[0]==="#"){let o=n[1].toLowerCase()==="x"?Number.parseInt(n.slice(2),16):Number.parseInt(n.slice(1),10);return Number.isInteger(o)&&o>0&&o<=1114111&&!(o>=55296&&o<=57343)?String.fromCodePoint(o):e}return Mm[n.toLowerCase()]??e})}function xn(t,e,n){return t.lastIndex=n,t.test(e)?t.lastIndex:n}function Am(t,e){let n=t.length,o=x=>{let S=Number.POSITIVE_INFINITY,E=-1;return w=>((w<S||E>=0&&E<w)&&(S=w,E=t.indexOf(x,w)),E)},r=o("-->"),a=o("?>"),i=o("]]>"),c=o(">"),s,l=x=>{let S=t.charCodeAt(x);if(S!==cs&&S!==ls)return x+1;let E=t.indexOf(t[x],x+1);return E<0?n:E+1},u=x=>{for(let S=x;S<n&&!s?.[S];S=l(S)){let E=t.charCodeAt(S);if(E===Go||E===Qo&&t.charCodeAt(S+1)===Go)return S}s??=new Uint8Array(n);for(let S=x;S<n&&!s[S];S=l(S))s[S]=1;return -1},m=-1,f=-1,d=-1,p=-1,h=x=>{let S=x+1;if(S<m||S>=f){m=S,f=xn(Em,t,S),d=-1;for(let w=f;w>S;w--){let R=t.charCodeAt(w);if((w===f||R===cs||R===ls)&&(p=u(w),p>=0)){d=w;break}}}if(d<=S)return -1;let E=t.charCodeAt(p)===Qo;return e.open(t.slice(S,d),t.slice(d,p),E),p+(E?2:1)},g=-1,b=-1,_=-1,y=x=>{let S=x+2;if(S<g||S>=b){g=S,b=xn(Rm,t,S);let E=xn(qo,t,b);_=b>S&&t.charCodeAt(E)===Go?E:-1;}return _},M=x=>{if(t.startsWith("<!--",x)){let S=r(x+4);if(S>=0)return S+3}if(t.startsWith("<?",x)){let S=a(x+2);if(S>=0)return S+2}if(t.startsWith("<![CDATA[",x)){let S=i(x+9);if(S>=0)return e.cdata(t.slice(x+9,S)),S+3}if(t.startsWith("<!",x)){let S=c(x+2);if(S>=0)return S+1}if(t.charCodeAt(x+1)===Qo){let S=y(x);return S<0?-1:(e.close(),S+1)}return h(x)},C=0;for(;C<n;)if(t.charCodeAt(C)===Cm){let x=M(C);C=x<0?C+1:x;}else {let x=t.indexOf("<",C),S=x<0?n:x;e.text(t.slice(C,S)),C=S;}}function vm(t){let e={},n=0;for(;n<t.length;){let o=xn(Pm,t,n);if(o===n){n++;continue}let r=xn(qo,t,o);if(t.charCodeAt(r)===wm){let a=xn(qo,t,r+1),i=t[a],c=i==='"'||i==="'"?t.indexOf(i,a+1):-1;if(c>=0){e[t.slice(n,o)]=us(t.slice(a+1,c)),n=c+1;continue}}n=o;}return e}function ve(t){let e={name:"#root",attrs:{},children:[],text:""},n=[e],o=()=>n.at(-1);Am(t,{open(a,i,c){let s=vm(i),l={name:a,attrs:s,children:[],text:""};o().children.push(l),c||n.push(l);},close(){n.length>1&&n.pop();},text(a){o().text+=us(a);},cdata(a){o().text+=a;}});let r=a=>{for(let i of a.children){if(i.name==="svg")return i;let c=r(i);if(c)return c}return null};return r(e)}function pt(t,e){let[n,o,r,a,i,c]=t,[s,l,u,m,f,d]=e;return [n*s+r*l,o*s+a*l,n*u+r*m,o*u+a*m,n*f+r*d+i,o*f+a*d+c]}function Y(t,e,n){return [t[0]*e+t[2]*n+t[4],t[1]*e+t[3]*n+t[5]]}function Sn(t){return Math.sqrt(Math.abs(t[0]*t[3]-t[1]*t[2]))}function Ve(t){return t?(t.match(/[+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?/gi)??[]).map(Number):[]}function ne(t){let e=yr;if(!t)return e;for(let[,n,o]of t.matchAll(/(matrix|translate|scale|rotate|skewX|skewY)\s*\(([^)]*)\)/g)){let r=Ve(o),a=yr;switch(n){case "matrix":r.length===6&&(a=r);break;case "translate":a=[1,0,0,1,r[0]??0,r[1]??0];break;case "scale":a=[r[0]??1,0,0,r[1]??r[0]??1,0,0];break;case "rotate":{let i=(r[0]??0)*Math.PI/180,c=Math.cos(i),s=Math.sin(i),[l,u]=[r[1]??0,r[2]??0];a=pt(pt([1,0,0,1,l,u],[c,s,-s,c,0,0]),[1,0,0,1,-l,-u]);break}case "skewX":a=[1,0,Math.tan((r[0]??0)*Math.PI/180),1,0,0];break;case "skewY":a=[1,Math.tan((r[0]??0)*Math.PI/180),0,1,0,0];break;}e=pt(e,a);}return e}function Lm(t,e,n,o,r,a,i,c,s){if(t===c&&e===s)return [];let l=Math.abs(n),u=Math.abs(o);if(l===0||u===0)return [{op:"L",x:c,y:s}];let m=r*Math.PI/180,f=Math.cos(m),d=Math.sin(m),p=(t-c)/2,h=(e-s)/2,g=f*p+d*h,b=-d*p+f*h,_=g*g/(l*l)+b*b/(u*u);_>1&&(l*=Math.sqrt(_),u*=Math.sqrt(_));let y=l*l*u*u-l*l*b*b-u*u*g*g,M=l*l*b*b+u*u*g*g,C=(a===i?-1:1)*Math.sqrt(Math.max(0,y/M)),x=C*l*b/u,S=-C*u*g/l,E=f*x-d*S+(t+c)/2,w=d*x+f*S+(e+s)/2,R=(q,O,z,et)=>Math.atan2(q*et-O*z,q*z+O*et),v=R(1,0,(g-x)/l,(b-S)/u),A=R((g-x)/l,(b-S)/u,(-g-x)/l,(-b-S)/u);!i&&A>0?A-=2*Math.PI:i&&A<0&&(A+=2*Math.PI);let L=Math.max(1,Math.ceil(Math.abs(A)/(Math.PI/2)-1e-9)),T=A/L,N=4/3*Math.tan(T/4),I=(q,O)=>[E+l*f*q-u*d*O,w+l*d*q+u*f*O],G=[];for(let q=0;q<L;q++){let O=v+q*T,z=O+T,[et,St]=I(Math.cos(O)-N*Math.sin(O),Math.sin(O)+N*Math.cos(O)),[ct,F]=I(Math.cos(z)+N*Math.sin(z),Math.sin(z)-N*Math.cos(z)),[H,W]=q===L-1?[c,s]:I(Math.cos(z),Math.sin(z));G.push({op:"C",x1:et,y1:St,x2:ct,y2:F,x:H,y:W});}return G}function de(t){let e=[],n=0,o=0,r=0,a=0,i=0,c="",s=null,l=null,u=()=>{for(;n<t.length&&/[\s,]/.test(t[n]);)n++;},m=()=>{u(),Uo.lastIndex=n;let p=Uo.exec(t);return p?(n=Uo.lastIndex,Number(p[0])):null},f=()=>{u();let p=t[n];return p==="0"||p==="1"?(n++,p==="1"):null},d=p=>{let h=[];for(let g=0;g<p;g++){let b=m();if(b===null)return null;h.push(b);}return h};for(;u(),!(n>=t.length);){let p=t[n];if(/[MmLlHhVvCcSsQqTtAaZz]/.test(p))c=p,n++;else if(!c||c==="Z"||c==="z")break;let h=c===c.toLowerCase(),g=h?o:0,b=h?r:0,_=c.toUpperCase();if(_==="Z"){e.push({op:"Z"}),o=a,r=i,s=null,l=null;continue}if(_==="A"){let x=d(3),S=f(),E=f(),w=d(2);if(!(x&&w)||S===null||E===null)break;let[R,v,A]=x,L=w[0]+g,T=w[1]+b;e.push(...Lm(o,r,R,v,A,S,E,L,T)),o=L,r=T,s=null,l=null;continue}let y={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2}[_]??0,M=d(y);if(!M)break;let C=M;switch(_){case "M":o=C[0]+g,r=C[1]+b,a=o,i=r,e.push({op:"M",x:o,y:r}),c=h?"l":"L",s=null,l=null;break;case "L":case "H":case "V":_!=="V"&&(o=C[0]+g),_==="V"?r=C[0]+b:_==="L"&&(r=C[1]+b),e.push({op:"L",x:o,y:r}),s=null,l=null;break;case "C":case "S":{let x,S;_==="C"?(x=[C[0]+g,C[1]+b],S=C.slice(2)):(x=s?[2*o-s[0],2*r-s[1]]:[o,r],S=C);let E=[S[0]+g,S[1]+b],w=[S[2]+g,S[3]+b];e.push({op:"C",x1:x[0],y1:x[1],x2:E[0],y2:E[1],x:w[0],y:w[1]}),[o,r]=w,s=E,l=null;break}case "Q":case "T":{let x,S;_==="Q"?(x=[C[0]+g,C[1]+b],S=[C[2]+g,C[3]+b]):(x=l?[2*o-l[0],2*r-l[1]]:[o,r],S=[C[0]+g,C[1]+b]),e.push({op:"C",x1:o+2/3*(x[0]-o),y1:r+2/3*(x[1]-r),x2:S[0]+2/3*(x[0]-S[0]),y2:S[1]+2/3*(x[1]-S[1]),x:S[0],y:S[1]}),[o,r]=S,l=x,s=null;break}}}return e}function re(t,e,n,o){if(n<=0||o<=0)return [];let r=n*$r,a=o*$r;return [{op:"M",x:t+n,y:e},{op:"C",x1:t+n,y1:e+a,x2:t+r,y2:e+o,x:t,y:e+o},{op:"C",x1:t-r,y1:e+o,x2:t-n,y2:e+a,x:t-n,y:e},{op:"C",x1:t-n,y1:e-a,x2:t-r,y2:e-o,x:t,y:e-o},{op:"C",x1:t+r,y1:e-o,x2:t+n,y2:e-a,x:t+n,y:e},{op:"Z"}]}function oe(t,e,n,o,r=0,a=0){if(n<=0||o<=0)return [];let i=Math.min(Math.max(r,0),n/2),c=Math.min(Math.max(a,0),o/2);if(i===0||c===0)return [{op:"M",x:t,y:e},{op:"L",x:t+n,y:e},{op:"L",x:t+n,y:e+o},{op:"L",x:t,y:e+o},{op:"Z"}];let s=i*$r,l=c*$r,u=t+n,m=e+o;return [{op:"M",x:t+i,y:e},{op:"L",x:u-i,y:e},{op:"C",x1:u-i+s,y1:e,x2:u,y2:e+c-l,x:u,y:e+c},{op:"L",x:u,y:m-c},{op:"C",x1:u,y1:m-c+l,x2:u-i+s,y2:m,x:u-i,y:m},{op:"L",x:t+i,y:m},{op:"C",x1:t+i-s,y1:m,x2:t,y2:m-c+l,x:t,y:m-c},{op:"L",x:t,y:e+c},{op:"C",x1:t,y1:e+c-l,x2:t+i-s,y2:e,x:t+i,y:e},{op:"Z"}]}var Mm,Cm,Go,Qo,wm,cs,ls,qo,Em,Rm,Pm,yr,Uo,$r,fe=U(()=>{"use strict";Mm={amp:"&",lt:"<",gt:">",quot:'"',apos:"'"};Cm=60,Go=62,Qo=47,wm=61,cs=34,ls=39,qo=/\s*/y,Em=/[^\s/>]*/y,Rm=/[^\s>]*/y,Pm=/[^\s=]*/y;yr=[1,0,0,1,0,0];Uo=/[+-]?(?:\d+\.?\d*|\.\d+)(?:[eE][+-]?\d+)?/y;$r=.5522847498;});function Er(t,e=ee){let n=t.slice(0,1e3).normalize("NFC").replace(Im," ").replace(Tm,"").replace(/\s+/g," ").trim();return Array.from(n).slice(0,Math.max(0,e)).join("").trim()}function Fm(t){for(let e of t)if((e.codePointAt(0)??0)>255)return false;return true}function _s(t){let e=Cn(t);return {x0:t.qr.x-e,y0:t.qr.y-e,x1:t.qr.x+t.qr.size+e,y1:t.qr.y+t.qr.size+e}}function Cn(t){return t.qr.padding??t.qr.size*lt.defaultPadding}function Wm(t){switch(t.type){case "rect":return {bounds:{x0:t.x,y0:t.y,x1:t.x+t.width,y1:t.y+t.height},segments:t.hole?18:9};case "circle":return {bounds:{x0:t.cx-t.r,y0:t.cy-t.r,x1:t.cx+t.r,y1:t.cy+t.r},segments:t.hole?10:5};case "ellipse":return {bounds:{x0:t.cx-t.rx,y0:t.cy-t.ry,x1:t.cx+t.rx,y1:t.cy+t.ry},segments:5};case "polygon":{let e=t.points.map(([o])=>o),n=t.points.map(([,o])=>o);return {bounds:{x0:Math.min(...e),y0:Math.min(...n),x1:Math.max(...e),y1:Math.max(...n)},segments:t.points.length}}case "path":{let e=pr(t.d,lt.maxDecimals);return e?{bounds:We(de(t.d)),segments:os(e)}:{bounds:null,segments:0}}case "line":{let e=t.width/2,n=Math.hypot(t.x2-t.x1,t.y2-t.y1),o=t.dash?Math.ceil(n/(t.dash[0]+t.dash[1])):1;return {bounds:{x0:Math.min(t.x1,t.x2)-e,y0:Math.min(t.y1,t.y2)-e,x1:Math.max(t.x1,t.x2)+e,y1:Math.max(t.y1,t.y2)+e},segments:o*(t.cap==="round"?4:5)}}default:return {bounds:{x0:t.x,y0:t.y,x1:t.x+t.size,y1:t.y+t.size},segments:fs}}}function Vm(t,e){let n=(b,_=[])=>e.addIssue({code:"custom",message:b,path:_}),o=lt,r=new TextEncoder().encode(JSON.stringify(t)).length;if(r>o.maxBytes){n(`The spec is ${r} bytes; the limit is ${o.maxBytes}`);return}let{width:a,height:i}=t.artboard,c=Math.max(a,i)*.005,s={x0:-c,y0:-c,x1:a+c,y1:i+c},l=b=>b.x0>=s.x0&&b.y0>=s.y0&&b.x1<=s.x1&&b.y1<=s.y1,{qr:u}=t,m=Cn(t);m<u.size*o.minPadding-1e-9&&n(`qr.padding must be at least ${o.minPadding*100}% of qr.size`,["qr","padding"]),u.size<Math.min(a,i)*o.minQrShare-1e-9&&n(`qr.size must be at least ${o.minQrShare*100}% of the artboard's shorter side`,["qr","size"]);let f=_s(t);(f.x0<-1e-9||f.y0<-1e-9||f.x1>a+1e-9||f.y1>i+1e-9)&&n("The code and its padding must sit inside the artboard",["qr"]),(u.radius??0)>(u.size+2*m)/2&&n("qr.radius is larger than half the plate",["qr","radius"]);let d=0,p=0;t.shapes.forEach((b,_)=>{let y=["shapes",_],{bounds:M,segments:C}=Wm(b);if(!M){n("Path data must use only M L H V C S Q T A Z, plain numbers (up to 3 decimals) and start with M",[...y,"d"]);return}if(l(M)||n("The shape extends outside the artboard",y),b.type==="rect"&&b.hole){let{hole:x}=b;(x.x<b.x||x.y<b.y||x.x+x.width>b.x+b.width+1e-9||x.y+x.height>b.y+b.height+1e-9)&&n("The hole must sit inside its rect",[...y,"hole"]);}b.type==="circle"&&b.hole&&b.hole>=b.r&&n("The hole must be smaller than the circle",[...y,"hole"]),d+=C,typeof b.fill=="object"&&"gradient"in b.fill&&(p+=(b.fill.gradient.steps??32)*C);}),d>o.maxSegments&&n(`The shapes have ${d} segments; the limit is ${o.maxSegments}`,["shapes"]),p>o.maxGradientWork&&n("Gradient fills are too detailed (fewer steps or simpler shapes)",["shapes"]);let h=new Set,g=new Set;t.labels.forEach((b,_)=>{let y=["labels",_];h.has(b.id)&&n(`Label id "${b.id}" is used twice`,[...y,"id"]),h.add(b.id),b.slot!=="fixed"&&(g.has(b.slot)&&n(`Only one label may use the ${b.slot} slot`,[...y,"slot"]),g.add(b.slot));let M=b.maxLength??o.maxTextLength;b.text!==Er(b.text,M)&&n(`Label text must be at most ${M} characters, trimmed, with no control or invisible characters (see sanitizeFrameText)`,[...y,"text"]);let C;if(b.type==="text")C={x0:b.box.x,y0:b.box.y,x1:b.box.x+b.box.width,y1:b.box.y+b.box.height},b.fontSize!==void 0&&b.fontSize>b.box.height*wr+1e-9&&n("fontSize may be at most 95% of the label's row height",[...y,"fontSize"]),Hm(C,f)&&n("The label overlaps the code or its padding",[...y,"box"]);else {let{cx:x,cy:S,radius:E}=b.curve,w=b.fontSize*Ae*.6;C={x0:x-E-w,y0:S-E-w,x1:x+E+w,y1:S+E+w};let R=Math.hypot(Math.max(f.x0-x,0,x-f.x1),Math.max(f.y0-S,0,S-f.y1));Math.hypot(Math.max(Math.abs(f.x0-x),Math.abs(f.x1-x)),Math.max(Math.abs(f.y0-S),Math.abs(f.y1-S)))<=E-w||R>=E+w||n("The curved label crosses the code or its padding",[...y,"curve"]);}l(C)||n("The label extends outside the artboard",y);});}function Xm(t){let e=Xe.safeParse(t);return e.success?[]:e.error.issues.map(n=>n.path.length>0?`${n.path.join(".")}: ${n.message}`:n.message)}var Mr,Cr,Hn,lt,ds,wr,fs,hs,Im,Tm,Wo,$t,Dt,Sr,xr,zo,Mn,Le,Ho,km,Nm,Om,Dm,Bm,Gm,Qm,ps,gs,Um,qm,bs,ms,zm,Hm,Xe,ys,Vo,wn=U(()=>{"use strict";Bo();_r();fe();zn();Mr="qrdx.frame",Cr=1,Hn="custom",lt={minArtboard:50,maxArtboard:2e3,maxCoordinate:4e3,maxDecimals:3,maxShapes:64,maxLabels:8,maxPolygonPoints:256,maxPathLength:16e3,maxSegments:2e3,maxGradientSteps:64,maxGradientWork:16e3,maxBytes:32768,minQrShare:.5,minPadding:.04,defaultPadding:.08,maxTextLength:ee},ds=["wifi","star","heart","phone","headphones","calendar","user","chat","bag","bell","cup","card","check","info","home","pin","share","download","clock","snowflake","pumpkin","tree","sparkle","gift"],wr=.95,fs=200,hs=["frame","text","accent","background"],Im=/[\t\n\v\f\r\u0085\u2028\u2029]/g,Tm=/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u115f\u1160\u17b4\u17b5\u180b-\u180f\u200b-\u200f\u202a-\u202e\u2060-\u206f\u3164\ufe00-\ufe0f\ufeff\uffa0\ufff0-\ufffb]|\udb40[\udc00-\udcff]|[\ud800-\udbff](?![\udc00-\udfff])|(?<![\ud800-\udbff])[\udc00-\udfff]/g;Wo=t=>Math.abs(t*1e3-Math.round(t*1e3))<1e-6,$t=z.number().min(-lt.maxCoordinate).max(lt.maxCoordinate).refine(Wo,{message:`Numbers may have at most ${lt.maxDecimals} decimals`}),Dt=$t.refine(t=>t>0,{message:"Must be greater than 0"}),Sr=$t.refine(t=>t>=0,{message:"Must not be negative"}),xr=z.string().regex(/^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/,"Use a #rgb or #rrggbb color"),zo=z.union([z.enum(hs),xr]),Mn=z.union([zo,z.object({mix:z.tuple([zo,zo]),amount:z.number().min(0).max(1).refine(Wo)}).strict()]),Le=z.union([Mn,z.object({gradient:z.object({from:Mn,to:Mn,direction:z.enum(["horizontal","vertical"]).optional(),steps:z.int().min(2).max(lt.maxGradientSteps).optional()}).strict()}).strict()]),Ho={x:$t,y:$t,width:Dt,height:Dt},km=z.object({type:z.literal("rect"),...Ho,radius:Sr.optional(),fill:Le,hole:z.object({...Ho,radius:Sr.optional()}).strict().optional()}).strict(),Nm=z.object({type:z.literal("circle"),cx:$t,cy:$t,r:Dt,hole:Dt.optional(),fill:Le}).strict(),Om=z.object({type:z.literal("ellipse"),cx:$t,cy:$t,rx:Dt,ry:Dt,fill:Le}).strict(),Dm=z.object({type:z.literal("polygon"),points:z.array(z.tuple([$t,$t])).min(3).max(lt.maxPolygonPoints),fill:Le}).strict(),Bm=z.object({type:z.literal("path"),d:z.string().min(2).max(lt.maxPathLength),fill:Le,fillRule:z.enum(["nonzero","evenodd"]).optional()}).strict(),Gm=z.object({type:z.literal("line"),x1:$t,y1:$t,x2:$t,y2:$t,width:Dt,cap:z.enum(["butt","round"]).optional(),dash:z.tuple([Dt,Dt]).optional(),fill:Le}).strict(),Qm=z.object({type:z.literal("icon"),icon:z.enum(ds),x:$t,y:$t,size:Dt,fill:Le}).strict(),ps=z.discriminatedUnion("type",[km,Nm,Om,Dm,Bm,Gm,Qm]),gs={id:z.string().regex(/^[a-z][a-z0-9-]{0,31}$/),slot:z.enum(["primary","secondary","fixed"]),text:z.string().max(200),maxLength:z.int().min(1).max(ee).optional(),color:Mn,weight:z.enum(["bold","regular"]).optional()},Um=z.object({type:z.literal("text"),...gs,box:z.object(Ho).strict(),align:z.enum(["start","middle","end"]).optional(),fontSize:Dt.optional()}).strict(),qm=z.object({type:z.literal("curved"),...gs,curve:z.object({cx:$t,cy:$t,radius:Dt,side:z.enum(["top","bottom"]),spread:z.number().min(20).max(300).refine(Wo).optional()}).strict(),fontSize:Dt}).strict(),bs=z.discriminatedUnion("type",[Um,qm]),ms=$t.refine(t=>t>=lt.minArtboard&&t<=lt.maxArtboard,{message:`Artboard sides must be ${lt.minArtboard} to ${lt.maxArtboard} units`}),zm=z.object({kind:z.literal(Mr),version:z.literal(Cr),artboard:z.object({width:ms,height:ms}).strict(),qr:z.object({x:$t,y:$t,size:Dt,padding:Sr.optional(),radius:Sr.optional()}).strict(),colors:z.object({frame:xr,text:xr.optional(),accent:xr.optional()}).strict(),shapes:z.array(ps).max(lt.maxShapes),labels:z.array(bs).max(lt.maxLabels),bleed:z.union([z.literal("none"),Mn]).optional()}).strict();Hm=(t,e)=>Math.min(t.x1,e.x1)-Math.max(t.x0,e.x0)>1e-6&&Math.min(t.y1,e.y1)-Math.max(t.y0,e.y0)>1e-6;Xe=zm.superRefine(Vm);ys=hr.extend({style:z.literal(Hn),spec:Xe}),Vo=z.discriminatedUnion("style",[hr,ys]);});function tt(t){if(t.length===0)return "";let[e,...n]=t;return `M${$(e[0])} ${$(e[1])}${n.map(([o,r])=>`L${$(o)} ${$(r)}`).join("")}Z`}function V(t,e,n){return `M${$(t-n)} ${$(e)}A${$(n)} ${$(n)} 0 1 1 ${$(t+n)} ${$(e)}A${$(n)} ${$(n)} 0 1 1 ${$(t-n)} ${$(e)}Z`}function D(t,e,n,o,r=0){let a=Math.min(n,o)/2,[i,c,s,l]=(typeof r=="number"?[r,r,r,r]:r).map(m=>Math.max(0,Math.min(m,a))),u=(m,f,d)=>m>0?`A${$(m)} ${$(m)} 0 0 1 ${$(f)} ${$(d)}`:"";return `M${$(t+i)} ${$(e)}H${$(t+n-c)}${u(c,t+n,e+c)}V${$(e+o-s)}${u(s,t+n-s,e+o)}H${$(t+l)}${u(l,t,e+o-l)}V${$(e+i)}${u(i,t+i,e)}Z`}function En(t,e,n,o,r=-90){return Array.from({length:o},(a,i)=>{let c=(r+360/o*i)*Math.PI/180;return [t+n*Math.cos(c),e+n*Math.sin(c)]})}function Rn(t,e,n,o,r=5){return Array.from({length:r*2},(a,i)=>{let c=i%2===0?n:o,s=-Math.PI/2+Math.PI/r*i;return [t+c*Math.cos(s),e+c*Math.sin(s)]})}function Wn(t,e,n,o,r=4,a=64){return Array.from({length:a},(i,c)=>{let s=2*Math.PI*c/a,l=Math.cos(s),u=Math.sin(s);return [t+n*Math.sign(l)*Math.abs(l)**(2/r),e+o*Math.sign(u)*Math.abs(u)**(2/r)]})}function Pn(t,e,n){let o=n/2,r=(a,i)=>`${$(t+a*o)} ${$(e+i*o)}`;return `M${r(0,-0.52)}C${r(.18,-0.92)} ${r(.98,-0.94)} ${r(1,-0.34)}C${r(1,.12)} ${r(.5,.48)} ${r(0,.92)}C${r(-0.5,.48)} ${r(-1,.12)} ${r(-1,-0.34)}C${r(-0.98,-0.94)} ${r(-0.18,-0.92)} ${r(0,-0.52)}Z`}function $s(t,e,n,o){if(o===0)return t;let r=o*Math.PI/180,a=Math.cos(r),i=Math.sin(r);return t.map(([c,s])=>[e+(c-e)*a-(s-n)*i,n+(c-e)*i+(s-n)*a])}function Rr(t,e,n=0){let o=Math.imul(t+2654435769,2246822507)^Math.imul(e+n,3266489909);return o=Math.imul(o^o>>>15,739982445),o=Math.imul(o^o>>>12,695872825),o^=o>>>15,(o>>>0)/4294967296}function Ye(t){let e=2166136261;for(let n=0;n<t.length;n++)e^=t.charCodeAt(n),e=Math.imul(e,16777619);return (e>>>0).toString(36)}var ae=U(()=>{"use strict";ht();});function An(t,e,n,o,r,a){let i=a-r>180?1:0;return `M${Pr(Ie(t,e,o,r))}A${$(o)} ${$(o)} 0 ${i} 1 ${Pr(Ie(t,e,o,a))}L${Pr(Ie(t,e,n,a))}A${$(n)} ${$(n)} 0 ${i} 0 ${Pr(Ie(t,e,n,r))}Z`}function Vn(t,e,n,o){return `M${$(t-n)} ${$(e)}A${$(n)} ${$(o)} 0 1 1 ${$(t+n)} ${$(e)}A${$(n)} ${$(o)} 0 1 1 ${$(t-n)} ${$(e)}Z`}function Ym(t){let e=0;return t.forEach(([n,o],r)=>{let[a,i]=t[(r+1)%t.length];e+=n*i-a*o;}),e/2}function xs(t){return tt(Ym(t)<0?[...t].reverse():t)}function Ar(t,e,n,o,r){let a=Math.hypot(n-t,o-e)||1,i=-(o-e)/a*(r/2),c=(n-t)/a*(r/2);return xs([[t+i,e+c],[n+i,o+c],[n-i,o-c],[t-i,e-c]])}function jm(){let t=[];for(let e of [0,60,120]){let[n,o]=Ie(12,12,10.5,e+180),[r,a]=Ie(12,12,10.5,e);t.push(Ar(n,o,r,a,2));}for(let e=0;e<6;e++){let n=e*60,[o,r]=Ie(12,12,6.2,n);for(let a of [-45,45]){let[i,c]=Ie(o,r,3.6,n+a);t.push(Ar(o,r,i,c,1.7));}}return It(...t)}function Yo(t){return Zm[t]()}var Xo,Ie,Pr,It,he,Zm,jo=U(()=>{"use strict";ae();ht();Xo=24,Ie=(t,e,n,o)=>{let r=o*Math.PI/180;return [t+n*Math.cos(r),e+n*Math.sin(r)]},Pr=([t,e])=>`${$(t)} ${$(e)}`;It=(...t)=>({d:t.join(""),fillRule:"nonzero"}),he=(...t)=>({d:t.join(""),fillRule:"evenodd"});Zm={wifi:()=>It(An(12,20,4.6,7.2,-135,-45),An(12,20,9.2,11.8,-135,-45),An(12,20,13.8,16.4,-135,-45),V(12,20,2.2)),star:()=>It(tt(Rn(12,12.8,11.6,4.8))),heart:()=>It(Pn(12,12.4,22)),phone:()=>he(D(6,1.5,12,21,2.6),D(7.8,4.2,8.4,13.4,.6),V(12,19.8,1.1)),headphones:()=>It(An(12,13,7.6,9.8,-180,0),D(2,12,5,9.5,2),D(17,12,5,9.5,2)),calendar:()=>he(D(2.5,4,19,17.5,2.5),D(4.6,9,14.8,10.6,.8),D(7,11.4,2.6,2.6,.4),D(10.7,11.4,2.6,2.6,.4),D(14.4,11.4,2.6,2.6,.4),D(7,15.1,2.6,2.6,.4),D(10.7,15.1,2.6,2.6,.4),D(6.5,1.4,2.4,2.6,[1.2,1.2,0,0]),D(15.1,1.4,2.4,2.6,[1.2,1.2,0,0])),user:()=>It(V(12,7.5,4.6),"M3 21.5C3 16.2 7 13.6 12 13.6C17 13.6 21 16.2 21 21.5Z"),chat:()=>he(D(2,3,20,14,4),tt([[6.5,17],[11.5,17],[5.8,21.8]]),V(7.5,10,1.5),V(12,10,1.5),V(16.5,10,1.5)),bag:()=>It(D(3.5,7.5,17,14.5,2),An(12,7.5,3.1,4.8,-180,0)),bell:()=>It("M3.5 17.2A8.5 8.5 0 0 1 20.5 17.2Z",D(1.5,18.2,21,2.6,1.3),D(11.2,6.6,1.6,2.6,0),D(9.8,4.6,4.4,2.4,1.2)),cup:()=>It("M4 6.5H17V13.5A6.5 6.5 0 0 1 4 13.5Z",An(17,10.2,1.7,3.6,-90,90),D(2,20.6,17,2,1),D(7,1.6,1.6,3.4,.8),D(11.6,1.6,1.6,3.4,.8)),card:()=>he(D(1.5,4.5,21,15,2.5),D(1.5,8,21,3,0),D(4.5,13.6,4.6,3.2,.6)),check:()=>he(V(12,12,10.5),tt([[6.6,12.4],[8.4,10.6],[10.6,12.8],[15.8,7.6],[17.6,9.4],[10.6,16.4]])),info:()=>he(V(12,12,10.5),V(12,7.2,1.6),D(10.6,10,2.8,8,.8)),home:()=>he(tt([[12,2.5],[22.5,11.5],[19.5,11.5],[19.5,21.5],[4.5,21.5],[4.5,11.5],[1.5,11.5]]),D(10,14.5,4,7,[.6,.6,0,0])),pin:()=>he("M12 22.5C8.5 17.6 4.5 14 4.5 9.5A7.5 7.5 0 0 1 19.5 9.5C19.5 14 15.5 17.6 12 22.5Z",V(12,9.5,3)),share:()=>It(Ar(6,12,18,5,1.8),Ar(6,12,18,19,1.8),V(18,5,3.2),V(6,12,3.2),V(18,19,3.2)),download:()=>It(D(10.6,2,2.8,9.5,0),tt([[6,10],[18,10],[12,16.5]]),tt([[2.5,15],[5.3,15],[5.3,19],[18.7,19],[18.7,15],[21.5,15],[21.5,21.8],[2.5,21.8]])),clock:()=>he(V(12,12,10.5),V(12,12,8.4),tt([[11,5.4],[13,5.4],[13,11.3],[16.9,13.5],[15.9,15.2],[11,12.5]])),snowflake:jm,pumpkin:()=>It(Vn(7.8,14.6,5.8,6.9),Vn(16.2,14.6,5.8,6.9),Vn(12,14.6,4.8,7.4),D(10.9,3.4,2.2,4.6,.8),xs([[13,4.2],[17.2,3],[16.2,5.4],[13,6]])),tree:()=>It(tt([[12,1.5],[16.8,8.2],[7.2,8.2]]),tt([[12,5.2],[19,13.6],[5,13.6]]),tt([[12,9.4],[21.2,19.2],[2.8,19.2]]),D(10.4,18.6,3.2,3.9,.4)),sparkle:()=>It(tt(Rn(9.5,13.5,9,2.4,4)),tt(Rn(19,5,4,1.1,4))),gift:()=>It(D(3,11.2,7.8,10.6,1),D(13.2,11.2,7.8,10.6,1),D(2,7.4,8.8,3.2,1),D(13.2,7.4,8.8,3.2,1),Vn(8.8,4.8,2.9,1.9),Vn(15.2,4.8,2.9,1.9))};});function Ss(t,e){let n=t.trim(),o=Number.parseFloat(n);return Number.isNaN(o)?Number.NaN:n.endsWith("%")?o/100*e:o}function dt(t){if(!t)return null;let e=t.trim().toLowerCase();if(e==="transparent")return {r:0,g:0,b:0,a:0};let n=Jm[e];if(n)return {r:n[0],g:n[1],b:n[2],a:1};if(e.startsWith("#")){let r=e.slice(1);return (r.length===3||r.length===4)&&(r=r.split("").map(a=>a+a).join("")),/^[0-9a-f]{6}([0-9a-f]{2})?$/.test(r)?{r:Number.parseInt(r.slice(0,2),16),g:Number.parseInt(r.slice(2,4),16),b:Number.parseInt(r.slice(4,6),16),a:r.length===8?Number.parseInt(r.slice(6,8),16)/255:1}:null}let o=/^rgba?\(([^)]*)\)$/.exec(e);if(o){let[r,a]=o[1].split("/"),i=r.split(/[\s,]+/).filter(Boolean);if(i.length!==(a===void 0&&i.length===4?4:3))return null;let c=a??i[3],[s,l,u]=i.slice(0,3).map(d=>Ss(d,255)),m=c===void 0?1:Ss(c,1);if([s,l,u,m].some(d=>Number.isNaN(d)))return null;let f=(d,p)=>Math.min(Math.max(d,0),p);return {r:f(s,255),g:f(l,255),b:f(u,255),a:f(m,1)}}return null}function Te(t,e,n){let o=t/255,r=e/255,a=n/255,i=1-Math.max(o,r,a);return i>=1?[0,0,0,1]:[st((1-o-i)/(1-i)),st((1-r-i)/(1-i)),st((1-a-i)/(1-i)),st(i)]}var Jm,Bt=U(()=>{"use strict";ht();Jm={black:[0,0,0],white:[255,255,255],red:[255,0,0],green:[0,128,0],lime:[0,255,0],blue:[0,0,255],navy:[0,0,128],yellow:[255,255,0],orange:[255,165,0],purple:[128,0,128],pink:[255,192,203],gray:[128,128,128],grey:[128,128,128],silver:[192,192,192],maroon:[128,0,0],olive:[128,128,0],teal:[0,128,128],aqua:[0,255,255],cyan:[0,255,255],fuchsia:[255,0,255],magenta:[255,0,255]};});function Cs(t){return Km.includes(t)}function ws(t){return t===" "?.3:/[MWmw@%]/.test(t)?.92:/[A-Z0-9#&]/.test(t)?.72:/[il.,:;!'|1]/.test(t)?.32:.6}function Ln(t){let e=0;for(let n of t)e+=ws(n);return Math.max(e,1)}function zt(t,e,n){let o=dt(t)??{r:0,g:0,b:0},r=dt(e)??{r:255,g:255,b:255},a=Math.min(1,Math.max(0,n));return `#${Zo(o.r+(r.r-o.r)*a)}${Zo(o.g+(r.g-o.g)*a)}${Zo(o.b+(r.b-o.b)*a)}`}function vr(t,e,n,o,r,a,i,c){let s=[...t],l=r*.08,u=s.map(h=>ws(h)*r),m=u.reduce((h,g)=>h+g,0)+l*Math.max(0,s.length-1),f=a==="top"?o-r*.35:o+r*.35,d=[],p=0;return s.forEach((h,g)=>{let b=u[g],_=(p+b/2)/f;if(p+=b+l,h.trim()==="")return;let y=a==="top"?-Math.PI/2-m/2/f+_:Math.PI/2+m/2/f-_;d.push({text:h,x:e+f*Math.cos(y),y:n+f*Math.sin(y),fontSize:r,maxWidth:r*2,color:i,rotate:y*180/Math.PI+(a==="top"?90:-90),field:c});}),d}function Ms(t,e,n,o){let r=t<e+o?e+o-t:t>e+n-o?t-(e+n-o):0;return o-Math.sqrt(Math.max(0,o*o-Math.min(r,o)**2))}function d0(t,e,n,o,r,a,i=48){let c=Math.max(n-o,0),s=t-2*o,l=new Set([o,t-o]);for(let g=0;g<=i;g++)l.add(t*g/i);let u=[...l].sort((g,b)=>g-b),m=t*.002,f=5,d=g=>Ms(g,0,t,n),p=g=>o+Ms(g,o,s,c),h=[];for(let g=0;g+1<u.length;g++){let b=u[g],_=Math.min(t,u[g+1]+(g+2<u.length?m:0)),y=zt(r,a,(b+_)/2/t),M=x=>Array.from({length:f},(S,E)=>{let w=E/(f-1);return x?_+(b-_)*w:b+(_-b)*w});b>=o-1e-9&&u[g+1]<=t-o+1e-9?h.push(Tt([...M(false).map(x=>[x,d(x)]),...M(true).map(x=>[x,p(x)])],y),Tt([...M(false).map(x=>[x,e-p(x)]),...M(true).map(x=>[x,e-d(x)])],y)):h.push(Tt([...M(false).map(x=>[x,d(x)]),...M(true).map(x=>[x,e-d(x)])],y));}return h}var Km,Jo,vt,Zo,qt,ut,vn,Tt,Fe,Es,t0,e0,n0,r0,o0,a0,i0,s0,c0,l0,u0,m0,f0,h0,Rs,Lr=U(()=>{"use strict";ae();ht();Bt();Km=["banner-top-bottom","speech-bubble-top","chat-bubble","circle","polaroid","phone","ticket","badge","envelope","tag","menu-card","sticker","gradient-border","focus"];Jo={from:"#7c3aed",to:"#db2777"},vt="#FFFFFF";Zo=t=>Math.round(Math.min(255,Math.max(0,t))).toString(16).padStart(2,"0");qt=(t,e,n,o,r=0)=>({x:t,y:e,width:n,height:o,radius:r}),ut=(t,e,n,o,r,a)=>({type:"rect",...qt(t,e,n,o,r),fill:a}),vn=(t,e,n)=>({type:"rect",...t,fill:n,hole:e}),Tt=(t,e)=>({type:"polygon",points:t,fill:e}),Fe=(t,e,n="nonzero")=>({type:"path",d:t,fill:e,fillRule:n}),Es=(...t)=>t.filter(e=>e!==null),t0=t=>{let{size:e,gap:n,border:o,band:r,color:a,background:i,frame:c,fitLabel:s}=t,l=e+2*(o+n),u=l-2*o,m=e+2*n,f=r+m+r,d=u-2*n,p=c.textColor||vt;return {width:l,height:f,qrX:o+n,qrY:r+n,qrSize:e,shapes:[ut(o,r,u,m,0,i),vn(qt(0,0,l,f),qt(o,r,u,m),a)],label:s(t.text,l/2,r/2,r,d,p),extraLabels:Es(s(t.secondaryText,l/2,r+m+r/2,r,d,p,"secondaryText")),squareEdges:!0,color:a}},e0=t=>{let{size:e,gap:n,border:o,band:r,color:a,background:i,frame:c,fitLabel:s}=t,l=e+2*(o+n),u=l-2*o,m=e*.07,f=Math.max(m-o,0),d=e*.025,p=e*.08,h=r+p+d;return {width:l,height:h+l,qrX:o+n,qrY:h+o+n,qrSize:e,shapes:[ut(0,0,l,r,r/2,a),Tt([[l/2-p,r-p/2],[l/2+p,r-p/2],[l/2,r+p]],a),ut(o,h+o,u,u,f,i),vn(qt(0,h,l,l,m),qt(o,h+o,u,u,f),a)],label:s(t.text,l/2,r/2,r,u-2*n,c.textColor||vt),squareEdges:!1,color:a}},n0=t=>{let{size:e,gap:n,border:o,color:r,background:a,frame:i,fitLabel:c}=t,s=e+2*(o+n),l=s-2*o,u=e*.12,m=e+2*n,f=t.text?e*.2:o,d=o+m+f,p=e*.13,h=d-e*.02;return {width:s,height:d+p,qrX:o+n,qrY:o+n,qrSize:e,shapes:[ut(0,0,s,d,u,r),Fe(P`M${s*.13} ${h}L${s*.05} ${d+p}`+P`Q${s*.16} ${d+p*.45} ${s*.32} ${h}Z`,r),ut(o,o,l,m,Math.max(u-o,0),a)],label:c(t.text,s/2,o+m+f/2,f,l-2*n,i.textColor||vt),squareEdges:!1,color:r}};r0=t=>{let{size:e,gap:n,color:o,background:r,frame:a,fontScale:i}=t,c=e*Math.SQRT1_2+n*.9,s=e*.21,l=c+s,u=c+s/2,m=l,f=a.textColor||vt,d=u*(140*Math.PI/180),p=_=>Math.min(s*.5*i,d/(Ln(_)+.08*_.length)),h=t.text?vr(t.text,m,m,u,p(t.text),"top",f,"text"):[],g=t.secondaryText?vr(t.secondaryText,m,m,u,p(t.secondaryText),"bottom",f,"secondaryText"):[],b=s*.07;return {width:2*l,height:2*l,qrX:m-e/2,qrY:m-e/2,qrSize:e,shapes:[Fe(V(m,m,c),r),Fe(V(m,m,l)+V(m,m,c),o,"evenodd"),Fe(V(m-u,m,b)+V(m+u,m,b),f)],label:null,extraLabels:[...h,...g],squareEdges:!1,color:o}},o0=t=>{let{size:e,gap:n,color:o,background:r,frame:a,fitLabel:i}=t,c=e*.07,s=e+2*n,l=e*.3,u=e*.025,m=s+2*c,f=c+s+l,d=e*.015;return {width:m+u,height:f+u,qrX:c+n,qrY:c+n,qrSize:e,shapes:[ut(u,u,m,f,d,zt(o,vt,.72)),ut(0,0,m,f,d,o),ut(c,c,s,s,0,r)],label:i(t.text,m/2,c+s+l/2,l*.8,s-2*n,a.textColor||vt),squareEdges:!1,color:o}},a0=t=>{let{size:e,gap:n,color:o,background:r,frame:a,fitLabel:i}=t,c=e*.05,s=e*.17,l=e*.15,u=t.text?e*.17:0,m=e+2*n,f=n+e+(t.text?n*.5+u:n),d=m+2*c,p=s+f+l,h=e*.036,g=e*.03;return {width:d,height:p,qrX:c+n,qrY:s+n,qrSize:e,shapes:[ut(0,0,d,p,e*.17,o),ut(c,s,m,f,e*.06,r),ut(d/2-e*.11,s/2-h/2,e*.22,h,h/2,r),ut(d/2-e*.15,s+f+l/2-g/2,e*.3,g,g/2,r)],label:i(t.text,d/2,s+n+e+n*.5+u/2,u,m-2*n,a.textColor||o),squareEdges:!1,color:o}},i0=t=>{let{size:e,gap:n,band:o,color:r,background:a,frame:i,fitLabel:c}=t,s=e*.05,l=e+2*n,u=l+2*s,m=st(s+l+s*1.2),f=m+o,d=st(e*.055),p=e*.04,h=P`M${p} 0H${u-p}A${p} ${p} 0 0 1 ${u} ${p}`+P`V${m-d}A${d} ${d} 0 0 0 ${u} ${m+d}`+P`V${f-p}A${p} ${p} 0 0 1 ${u-p} ${f}`+P`H${p}A${p} ${p} 0 0 1 0 ${f-p}`+P`V${m+d}A${d} ${d} 0 0 0 0 ${m-d}`+P`V${p}A${p} ${p} 0 0 1 ${p} 0Z`,g=[],b=e*.03,_=e*.022,y=e*.012;for(let M=d+_;M+b<=u-d-_/2;M+=b+_)g.push(D(M,m-y/2,b,y));return {width:u,height:f,qrX:s+n,qrY:s+n,qrSize:e,shapes:[Fe(h,r),ut(s,s,l,l,e*.02,a),Fe(g.join(""),a)],label:c(t.text,u/2,m+o/2,o,l-2*n,i.textColor||vt),squareEdges:!1,color:r}},s0=t=>{let{size:e,gap:n,border:o,band:r,color:a,background:i,frame:c,fitLabel:s}=t,l=e*.18,u=e*.05,m=e+2*(o+n),f=e*.06,d=Math.max(f-o,0),p=m+2*l,h=m-o,g=l*.5,b=h+u,_=g+u*2,y=l*.28,M=zt(a,"#000000",.28),C=zt(a,"#000000",.5);return {width:p,height:b+r,qrX:l+o+n,qrY:o+n,qrSize:e,shapes:[Tt([[0,b],[_,b],[_,b+r],[0,b+r],[y,b+r/2]],M),Tt([[p,b],[p-y,b+r/2],[p,b+r],[p-_,b+r],[p-_,b]],M),Tt([[g,h+r],[g+u*1.6,h+r+u],[g,h+r+u]],C),Tt([[p-g,h+r],[p-g,h+r+u],[p-g-u*1.6,h+r+u]],C),ut(l+o,o,m-2*o,m-2*o,d,i),vn(qt(l,0,m,m,f),qt(l+o,o,m-2*o,m-2*o,d),a),ut(g,h,p-2*g,r,0,a)],label:s(t.text,p/2,h+r/2,r,p-2*g-2*n,c.textColor||vt),squareEdges:!1,color:a}},c0=t=>{let{size:e,gap:n,band:o,color:r,background:a,frame:i,fitLabel:c}=t,s=e*.08,l=e+2*n,u=l+2*s,m=e*.05,f=m+n+e+n*.6,d=e*.14,p=f+d+o+e*.02,h=m+e*.32,g=e*.012,b=f+d-m;return {width:u,height:p,qrX:s+n,qrY:m+n,qrSize:e,shapes:[ut(0,h,u,p-h,0,zt(r,vt,.45)),Tt([[0,h],[u/2,0],[u,h]],zt(r,vt,.25)),ut(s,m,l,b,0,a),vn(qt(s-g,m-g,l+2*g,b+g),qt(s,m,l,b),r),Tt([[0,f],[u/2,f+d],[u,f],[u,p],[0,p]],r)],label:c(t.text,u/2,f+d+o/2,o,l-2*n,i.textColor||vt),squareEdges:!1,color:r}},l0=t=>{let{size:e,gap:n,band:o,color:r,background:a,frame:i,fitLabel:c}=t,s=e*.06,l=e+2*n,u=l+2*s,m=e*.24,f=e*.04,d=m*.48,p=e*.14,h=t.text?o:s,g=m+l+h,b=e*.04,_=P`M${p} 0H${u-p}L${u} ${p}`+P`V${g-b}A${b} ${b} 0 0 1 ${u-b} ${g}`+P`H${b}A${b} ${b} 0 0 1 0 ${g-b}V${p}Z`+V(u/2,d,f);return {width:u,height:g,qrX:s+n,qrY:m+n,qrSize:e,shapes:[Fe(_,r,"evenodd"),Fe(V(u/2,d,f*1.7)+V(u/2,d,f),zt(r,vt,.35),"evenodd"),ut(s,m,l,l,e*.02,a)],label:c(t.text,u/2,m+l+h/2,h,l-2*n,i.textColor||vt),squareEdges:!1,color:r}},u0=t=>{let{size:e,color:n,background:o,frame:r,fitLabel:a}=t,i=e*.13,c=t.text?e*.26:i,s=t.secondaryText?e*.2:i,l=e+2*i,u=c+e+s,m=e*.03,f=e*.022,d=e*.045,p=e*.008,h=r.textColor||n,g=[ut(0,0,l,u,m,o),vn(qt(0,0,l,u,m),qt(f,f,l-2*f,u-2*f,Math.max(m-f,0)),n),vn(qt(d,d,l-2*d,u-2*d),qt(d+p,d+p,l-2*(d+p),u-2*(d+p)),n)];if(t.text){let b=c-e*.075,_=e*.022;g.push(ut(l*.3,b-p/2,l*.4,p,0,n),Tt([[l/2,b-_],[l/2+_,b],[l/2,b+_],[l/2-_,b]],n));}return {width:l,height:u,qrX:i,qrY:c,qrSize:e,shapes:g,label:a(t.text,l/2,e*.115,e*.17,l-2*i,h),extraLabels:Es(a(t.secondaryText,l/2,c+e+s*.45,s*.8,l-2*i,h,"secondaryText")),squareEdges:!1,color:n}},m0=t=>{let{size:e,gap:n,color:o,background:r,frame:a,fitLabel:i}=t,c=e*.025,s=e*.07,l=e*.03,u=e*.13,m=t.text?e*.17:0,f=n*1.25,d=e+2*f,p=d+2*s,h=d+2*s+m,g=p+2*c,b=h+2*c;return {width:g+l,height:b+l,qrX:c+s+f,qrY:c+s+f,qrSize:e,shapes:[ut(l,l,g,b,u+c,zt(o,vt,.7)),ut(0,0,g,b,u+c,vt),ut(c,c,p,h,u,o),ut(c+s,c+s,d,d,e*.04,r)],label:i(t.text,c+p/2,c+s+d+(s+m)/2,s+m,d-2*n,a.textColor||vt),squareEdges:!1,color:o}};f0=t=>{let{size:e,gap:n,background:o,frame:r,fitLabel:a}=t,i=r.color||Jo.from,c=r.secondaryColor||Jo.to,s=e*.05,l=e+2*(s+n),u=t.text?e*.18:0,m=e+(t.text?n+u:2*n),f=m+2*s,d=e*.1;return {width:l,height:f,qrX:s+n,qrY:s+n,qrSize:e,shapes:[ut(s,s,l-2*s,m,d-s,o),...d0(l,f,d,s,i,c)],label:a(t.text,l/2,s+n+e+u/2,u,l-2*s-2*n,r.textColor||zt(i,c,.5)),squareEdges:!1,color:i}},h0=t=>{let{size:e,gap:n,color:o,background:r,frame:a,fitLabel:i}=t,c=e*.035,s=e*.2,l=e+2*(n+c),u=t.text?e*.2:0,m=l,f=m+u,d=(p,h,g,b)=>[[p,h],[p+g*s,h],[p+g*s,h+b*c],[p+g*c,h+b*c],[p+g*c,h+b*s],[p,h+b*s]];return {width:l,height:f,qrX:c+n,qrY:c+n,qrSize:e,shapes:[ut(0,0,l,f,0,r),Tt(d(0,0,1,1),o),Tt(d(m,0,-1,1),o),Tt(d(m,m,-1,-1),o),Tt(d(0,m,1,-1),o)],label:i(t.text,l/2,m+u*.4,u,l-2*n,a.textColor||o),squareEdges:!1,color:o}},Rs={"banner-top-bottom":t0,"speech-bubble-top":e0,"chat-bubble":n0,circle:r0,polaroid:o0,phone:a0,ticket:i0,badge:s0,envelope:c0,tag:l0,"menu-card":u0,sticker:m0,"gradient-border":f0,focus:h0};});function wt(t,e="#000000"){return t?typeof t=="string"?t:t.type==="solid"?t.color:t.type==="image"?t.underlay||e:(t.type==="linear"||t.type==="radial"||t.type==="angular")&&t.stops[0]?.color||e:e}var pe=U(()=>{"use strict";});function Ko(t){if(t&&typeof t=="object"){let n=Ps.get(t);if(n)return n}if(t==null)throw new Xn(['A "custom" frame needs a spec']);let e=Xe.safeParse(t);if(!e.success)throw new Xn(e.error.issues.map(n=>n.path.length>0?`${n.path.join(".")}: ${n.message}`:n.message));return typeof t=="object"&&Ps.set(t,e.data),e.data}function ta(t){let e=Ko(t);return Cn(e)/e.qr.size}function p0(t){let e=wt(t,yt),n=dt(e);return n&&n.a>=1?e:yt}function g0(t,e,n){let o=t.color||e.colors.frame,r=t.textColor||e.colors.text||o,a=t.secondaryColor||e.colors.accent||o,i=c=>{switch(c){case "frame":return o;case "text":return r;case "accent":return a;case "background":return n;default:return c}};return c=>typeof c=="string"?i(c):zt(i(c.mix[0]),i(c.mix[1]),c.amount)}function As(t,e,n=0,o=0){let r=pr(t);return r?as(r,e,n,o):""}function b0(t,e,n,o){return `M${$(t-n)} ${$(e)}A${$(n)} ${$(o)} 0 1 1 ${$(t+n)} ${$(e)}A${$(n)} ${$(o)} 0 1 1 ${$(t-n)} ${$(e)}Z`}function _0(t,e){let[n,o,r,a]=[t.x1*e,t.y1*e,t.x2*e,t.y2*e],i=Math.hypot(r-n,a-o),c=t.width*e/2,s=i>0?(r-n)/i:1,l=i>0?(a-o)/i:0,u=-l*c,m=s*c,f=(g,b)=>{let _=[n+s*g,o+l*g],y=[n+s*b,o+l*b];if(t.cap==="round"&&b-g>2*c){let M=[_[0]+s*c,_[1]+l*c],C=[y[0]-s*c,y[1]-l*c];return `M${$(M[0]-u)} ${$(M[1]-m)}L${$(C[0]-u)} ${$(C[1]-m)}A${$(c)} ${$(c)} 0 0 1 ${$(C[0]+u)} ${$(C[1]+m)}L${$(M[0]+u)} ${$(M[1]+m)}A${$(c)} ${$(c)} 0 0 1 ${$(M[0]-u)} ${$(M[1]-m)}Z`}return `M${$(_[0]-u)} ${$(_[1]-m)}L${$(y[0]-u)} ${$(y[1]-m)}L${$(y[0]+u)} ${$(y[1]+m)}L${$(_[0]+u)} ${$(_[1]+m)}Z`};if(!t.dash)return {type:"path",d:f(0,i),fillRule:"nonzero"};let d=t.dash[0]*e,p=d+t.dash[1]*e,h=[];for(let g=0;g+d<=i+1e-6;g+=p)h.push(f(g,g+d));return {type:"path",d:h.join(""),fillRule:"nonzero"}}function y0(t,e){switch(t.type){case "rect":return {type:"rect",x:t.x*e,y:t.y*e,width:t.width*e,height:t.height*e,radius:(t.radius??0)*e,...t.hole&&{hole:{x:t.hole.x*e,y:t.hole.y*e,width:t.hole.width*e,height:t.hole.height*e,radius:(t.hole.radius??0)*e}}};case "circle":return {type:"path",d:V(t.cx*e,t.cy*e,t.r*e)+(t.hole?V(t.cx*e,t.cy*e,t.hole*e):""),fillRule:t.hole?"evenodd":"nonzero"};case "ellipse":return {type:"path",d:b0(t.cx*e,t.cy*e,t.rx*e,t.ry*e),fillRule:"nonzero"};case "polygon":return {type:"polygon",points:t.points.map(([n,o])=>[n*e,o*e])};case "path":return {type:"path",d:As(t.d,e),fillRule:t.fillRule??"nonzero"};case "line":return _0(t,e);default:{let n=Yo(t.icon);return {type:"path",d:As(n.d,t.size*e/Xo,t.x*e,t.y*e),fillRule:n.fillRule}}}}function $0(t){if(t.type==="rect"){let{x:e,y:n,width:o,height:r,radius:a,hole:i}=t;return [...oe(e,n,o,r,a,a),...i?oe(i.x,i.y,i.width,i.height,i.radius,i.radius):[]]}return t.type==="polygon"?[...t.points.map(([e,n],o)=>o===0?{op:"M",x:e,y:n}:{op:"L",x:e,y:n}),{op:"Z"}]:de(t.d)}function x0(t,e,n){let o=$0(t),r=gr(o,.2),a=t.type==="rect"?t.hole?"evenodd":"nonzero":t.type==="path"?t.fillRule??"nonzero":"nonzero",i=e.direction==="vertical",c=g=>i?g[1]:g[0],s=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY;for(let g of r)for(let b of g)s=Math.min(s,c(b)),l=Math.max(l,c(b));if(!(l>s))return [];let u=e.steps??32,m=n(e.from),f=n(e.to),d=l-s,p=d*.002,h=[];for(let g=0;g<u;g++){let b=s+d*g/u,_=Math.min(l,s+d*(g+1)/u+(g+1<u?p:0)),y=i?{x0:Number.NEGATIVE_INFINITY,x1:Number.POSITIVE_INFINITY,y0:b,y1:_}:{x0:b,x1:_,y0:Number.NEGATIVE_INFINITY,y1:Number.POSITIVE_INFINITY},M=r.map(C=>br(C,y)).filter(C=>C.length>2);M.length!==0&&h.push({type:"path",d:ss(M),fill:zt(m,f,(g+.5)/u),fillRule:a});}return h}function S0(t,e,n){let o=y0(t,e);return typeof t.fill=="object"&&"gradient"in t.fill?x0(o,t.fill.gradient,n):[{...o,fill:n(t.fill)}]}function M0(t,e){let n=Math.min(t.maxLength??lt.maxTextLength,lt.maxTextLength),o=t.slot==="primary"?e.text??t.text:t.slot==="secondary"?e.secondaryText??t.text:t.text;return Er(o,n)}function C0(t){return t===void 0||!Number.isFinite(t)?1:Math.min(Ae,Math.max($n,t))}function w0(t,e,n,o){let r=M0(t,e);if(!r)return [];let a=C0(e.fontScale),i=o(t.color),c=t.weight==="regular"?{fontWeight:400}:{};if(t.type==="curved"){let{cx:h,cy:g,radius:b,side:_,spread:y=140}=t.curve,M=b*n*(y*Math.PI/180),C=Math.min(t.fontSize*n*a,M/(Ln(r)+.08*r.length));return vr(r,h*n,g*n,b*n,C,_,i,t.id).map(x=>({...x,...c}))}let s=t.box.x*n,l=t.box.y*n,u=t.box.width*n,m=t.box.height*n,f=(t.fontSize??t.box.height*.52)*n,d=Math.min(f*a,m*wr,u/Ln(r)),p=t.align??"middle";return [{text:r,x:p==="start"?s:p==="end"?s+u:s+u/2,y:l+m/2+d*.35,fontSize:d,maxWidth:u,color:i,...p!=="middle"&&{align:p},...c,field:t.id}]}function ea(t,e,n){let o=Ko(e.spec),r=t/o.qr.size,a=p0(n),i=g0(e,o,a),c=o.shapes.flatMap(d=>S0(d,r,i)),s=Cn(o)*r;c.push({type:"rect",x:o.qr.x*r-s,y:o.qr.y*r-s,width:t+2*s,height:t+2*s,radius:(o.qr.radius??0)*r,fill:a});let l=o.labels.flatMap(d=>w0(d,e,r,i)),u=l[0],m=u&&u.rotate===void 0?u:null,f=o.bleed??"none";return {width:o.artboard.width*r,height:o.artboard.height*r,qrX:o.qr.x*r,qrY:o.qr.y*r,qrSize:t,shapes:c,label:m,extraLabels:m?l.slice(1):l,squareEdges:f!=="none",color:i(f==="none"?"frame":f)}}var Xn,Ps,na=U(()=>{"use strict";zn();wn();At();jo();Lr();ae();pe();ht();Bt();Bo();_r();fe();Xn=class extends Error{issues;constructor(e){super(`Invalid frame spec: ${e.slice(0,5).join("; ")}`),this.name="FrameSpecError",this.issues=e;}},Ps=new WeakMap;});function Ht(t){return !!(t?.style&&t.style!=="none")}function aa(t){return t.style===Hn?ta(t.spec):oa}function Ts(t){return (t.text??Oo).trim().slice(0,ee)}function Fs(t){return (t.secondaryText??"").trim().slice(0,ee)}function P0(t){return t===void 0||!Number.isFinite(t)?1:Math.min(Ae,Math.max($n,t))}function A0(t,e,n,o,r,a,i,c){if(!t)return null;let s=Math.min(o*.52*i,r/Ln(t));return {text:t,x:e,y:n+s*.35,fontSize:s,maxWidth:r,color:a,field:c}}function je(t,e,n){if(e.style===Hn)return ea(t,e,n);let o=e.color||R0,r=wt(n,yt),a=Ts(e),i=t*oa,c=t*.04,s=t*.22,l=t+2*(c+i),u=l-2*c,m=u-2*i,f=c+i,d=P0(e.fontScale),p=(h,g,b,_,y,M,C="text")=>A0(h,g,b,_,y,M,d,C);if(Cs(e.style))return Rs[e.style]({size:t,frame:e,color:o,background:r,text:a,secondaryText:Fs(e),gap:i,border:c,band:s,fontScale:d,fitLabel:p});switch(e.style){case "banner-top":{let h=t+2*i;return {width:l,height:s+h+c,qrX:f,qrY:s+i,qrSize:t,shapes:[Yn(c,s,u,h,0,r),Ir(ge(0,0,l,s+h+c,0),ge(c,s,u,h,0),o)],label:p(a,l/2,s/2,s,m,e.textColor||ra),squareEdges:true,color:o}}case "border":case "rounded-border":{let h=a?t*.18:0,g=t+(a?i+h:2*i),b=g+2*c,_=e.style==="rounded-border"?t*.1:0,y=Math.max(_-c,0);return {width:l,height:b,qrX:f,qrY:c+i,qrSize:t,shapes:[Yn(c,c,u,g,y,r),Ir(ge(0,0,l,b,_),ge(c,c,u,g,y),o)],label:p(a,l/2,c+i+t+h/2,h,m,e.textColor||o),squareEdges:_===0,color:o}}case "speech-bubble":{let h=t*.07,g=Math.max(h-c,0),b=t*.025,_=t*.08,y=l+b+_;return {width:l,height:y+s,qrX:f,qrY:c+i,qrSize:t,shapes:[Yn(c,c,u,u,g,r),Ir(ge(0,0,l,l,h),ge(c,c,u,u,g),o),{type:"polygon",points:[[l/2-_,y+_/2],[l/2,l+b],[l/2+_,y+_/2]],fill:o},Yn(0,y,l,s,s/2,o)],label:p(a,l/2,y+s/2,s,m,e.textColor||ra),squareEdges:false,color:o}}default:{let h=t+2*i;return {width:l,height:c+h+s,qrX:f,qrY:c+i,qrSize:t,shapes:[Yn(c,c,u,h,0,r),Ir(ge(0,0,l,c+h+s,0),ge(c,c,u,h,0),o)],label:p(a,l/2,c+h+s/2,s,m,e.textColor||ra),squareEdges:true,color:o}}}}function ge(t,e,n,o,r){return {x:t,y:e,width:n,height:o,radius:r}}function Yn(t,e,n,o,r,a){return {type:"rect",...ge(t,e,n,o,r),fill:a}}function Ir(t,e,n){return {type:"rect",...t,fill:n,hole:e}}function be(t,e){if(!Ht(e))return {width:t,height:t};let{width:n,height:o}=je(t,e);return {width:n,height:o}}function vs({x:t,y:e,width:n,height:o,radius:r}){let a=rt(Math.min(r,n/2,o/2)),[i,c,s,l]=[rt(t),rt(e),rt(n),rt(o)];return a<=0?P`M${i} ${c}h${s}v${l}h${-s}z`:P`M${i+a} ${c}h${rt(s-2*a)}a${a} ${a} 0 0 1 ${a} ${a}`+P`v${rt(l-2*a)}a${a} ${a} 0 0 1 ${-a} ${a}`+P`h${rt(-(s-2*a))}a${a} ${a} 0 0 1 ${-a} ${-a}`+P`v${rt(-(l-2*a))}a${a} ${a} 0 0 1 ${a} ${-a}z`}function v0(t,e){return t.type==="rect"&&t.hole?jsx("path",{d:vs(t)+vs(t.hole),fill:t.fill,fillRule:"evenodd"},e):t.type==="polygon"?jsx("polygon",{fill:t.fill,points:t.points.map(([n,o])=>`${rt(n)},${rt(o)}`).join(" ")},e):t.type==="path"?jsx("path",{d:t.d,fill:t.fill,...t.fillRule==="evenodd"&&{fillRule:"evenodd"}},e):jsx("rect",{fill:t.fill,height:rt(t.height),width:rt(t.width),x:rt(t.x),y:rt(t.y),...t.radius>0&&{rx:rt(t.radius),ry:rt(t.radius)}},e)}function Tr(t,e){let{size:n,frame:o,bgColor:r,svgProps:a,markLabels:i}=e,c=je(n,o,r),s=ks(c),l=rt(c.width),u=rt(c.height);return jsxs("svg",{height:u,viewBox:`0 0 ${l} ${u}`,width:l,xmlns:"http://www.w3.org/2000/svg",...a,children:[jsx("g",{"data-qrdx-frame":o.style,children:c.shapes.map((m,f)=>v0(m,f))}),ri.cloneElement(t,{x:rt(c.qrX),y:rt(c.qrY),width:n,height:n}),s.map((m,f)=>jsx("text",{"data-max-width":rt(m.maxWidth),fill:m.color,fontFamily:Ls,fontSize:rt(m.fontSize),fontWeight:m.fontWeight??700,textAnchor:m.align??"middle",x:rt(m.x),y:rt(m.y),...m.rotate&&{transform:`rotate(${rt(m.rotate)} ${rt(m.x)} ${rt(m.y)})`},...i&&m.field&&{[Is]:m.field},children:m.text},f))]})}function ks(t){return [...t.label?[t.label]:[],...t.extraLabels??[]]}var Ls,oa,R0,ra,Is,rt,_e=U(()=>{"use strict";zn();wn();At();na();Lr();pe();ht();Ls="system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif",oa=.08,R0="#000000",ra="#FFFFFF",Is="data-qrdx-frame-label";rt=t=>st(t,2);});var Jn,Ws,Zn,Vs,$e,Hs,Xs,ma,Nr=U(()=>{"use strict";Jn=["logo","halftone"],Ws=z.enum(Jn),Zn={logo:["blend","badge"],halftone:["color","mono"]},Vs=z.enum([...Zn.logo,...Zn.halftone]),$e=192,Hs=t=>Math.ceil(t/3)*4,Xs=z.object({width:z.number().int().min(1).max($e),height:z.number().int().min(1).max($e),data:z.string().max(Hs($e*$e*4))}).refine(t=>t.data.length===Hs(t.width*t.height*4),{message:"Art image data does not match its width and height"}),ma=z.object({mode:Ws,image:Xs,intensity:z.number().min(0).max(1).optional(),variant:Vs.optional(),matchEyes:z.boolean().optional()});});function Wt(t,e="#000000"){return t?typeof t=="string"?{type:"solid",color:t}:t:{type:"solid",color:e}}function Tn(t){return !t||typeof t=="string"?false:t.type==="linear"||t.type==="radial"||t.type==="angular"}function da(t){return typeof t=="object"&&t!==null&&t.type==="image"}function B0(t,e="#000000"){let n=Wt(t,e);return n.type==="solid"?n.color:n.type==="image"?n.underlay||e:n.stops[0]?.color||e}function nc(t="center"){let[e,n]=t.split("-");return t==="center"?"center":n?`${n} ${e}`:e==="top"||e==="bottom"?`center ${e}`:`${e} center`}function G0(t){if(!t)return "#000000";if(typeof t=="string")return t;let e=Wt(t);if(e.type==="solid")return e.color;if(e.type==="image"){let r=e.fit==="tile"?`${25*(e.scale??1)}% auto`:(e.scale??1)===1?e.fit==="contain"?"contain":"cover":`${100*(e.scale??1)}% auto`,a=e.fit==="tile"?"repeat":"no-repeat";return `${`url("${e.src.replace(/"/g,"%22")}")`} ${nc(e.position)} / ${r} ${a}, ${e.underlay??"transparent"}`}let o=[...e.stops].sort((r,a)=>r.offset-a.offset).map(r=>`${r.color} ${r.offset}%`).join(", ");return e.type==="linear"?`linear-gradient(${(e.angle??0)+90}deg, ${o})`:e.type==="angular"?`conic-gradient(from ${e.angle??0}deg, ${o})`:`radial-gradient(circle, ${o})`}var D0,Ys,Or,js,Zs,Js,Ks,tc,ec,ke,Fn=U(()=>{"use strict";D0=z.enum(["solid","linear","radial","angular","image"]),Ys=z.object({type:z.literal("solid"),color:z.string()}),Or=z.object({color:z.string(),offset:z.number().min(0).max(100)}),js=z.object({type:z.literal("linear"),stops:z.array(Or).min(2),angle:z.number().optional().default(0)}),Zs=z.object({type:z.literal("radial"),stops:z.array(Or).min(2)}),Js=z.object({type:z.literal("angular"),stops:z.array(Or).min(2),angle:z.number().optional().default(0)}),Ks=z.enum(["cover","contain","tile"]),tc=z.enum(["top-left","top","top-right","left","center","right","bottom-left","bottom","bottom-right"]),ec=z.object({type:z.literal("image"),src:z.string().min(1),fit:Ks.optional().default("cover"),scale:z.number().min(.1).max(4).optional().default(1),position:tc.optional().default("center"),opacity:z.number().min(0).max(1).optional().default(1),underlay:z.string().optional()}),ke=z.union([z.string(),Ys,js,Zs,Js,ec]);});var fa,oc,ha,U0,pa=U(()=>{"use strict";fa=["square","rounded","circle","message","message-reverse","diya","diya-reverse","rounded-triangle","leaf","drop","plus","cross-rounded","hexagon","octagon","flower","heart","squircle","dots","extra-rounded","leaf-reverse","drop-reverse"],oc=["diamond","star","banner"],ha=z.enum([...fa,...oc]),U0=z.enum(fa);});var ga,ic,ba,q0,_a=U(()=>{"use strict";ga=["square","rounded","gear","circle","diya","extra-rounded","message","pointy","leaf","drop","octagon","bevel","squircle","cushion","shield","petal","leaf-reverse"],ic=["curly"],ba=z.enum([...ga,...ic]),q0=z.enum(ga);});var sc,ya,$a=U(()=>{"use strict";sc=["circle","circle-large","square","diamond","circle-mixed","pacman","rounded","small-square","vertical-line","horizontal-line","liquid","liquid-horizontal","liquid-vertical","classy","classy-rounded","leaf","plus","hexagon","star","heart","random-dots","mosaic","octagon"],ya=z.enum(sc);});var cc,xa,lc,uc,Br,Sa,mc,H0,dc,tr,Gr,Ma,fc,hc,Ca,Xt,ie,wa,pc,gc,Qr,Dr,bc,W0,xe=U(()=>{"use strict";Nr();Fn();pa();_a();wn();$a();cc=["square","rounded","circle"],xa=z.enum(cc),lc=z.object({src:z.string(),height:z.number(),width:z.number(),excavate:z.boolean(),x:z.number().optional(),y:z.number().optional(),padding:z.number().min(0).optional(),shape:xa.optional(),plate:z.string().optional()}),uc=.1,Br=.3,Sa=.25,mc=2,H0=z.object({size:z.number().min(uc).max(Br).optional(),padding:z.number().min(0).max(mc).optional(),x:z.number().min(0).max(1).optional(),y:z.number().min(0).max(1).optional(),shape:xa.optional(),plate:z.string().optional()}),dc=z.enum(["L","M","Q","H"]),tr=.5,Gr=1,Ma=.07,fc=["square","circle","heart"],hc=z.enum(fc),Ca=3,Xt=64,ie=8,wa=.42,pc=z.object({type:z.literal("silhouette"),width:z.number().int().min(ie).max(Xt),height:z.number().int().min(ie).max(Xt),cells:z.string().max(Xt*Xt).regex(/^[01]*$/).describe('Row by row, "1" inside the shape and "0" outside: width \xD7 height characters')}).refine(t=>t.cells.length===t.width*t.height,{message:"Silhouette cells do not match its width and height"}),gc=z.union([hc,pc]),Qr=["topLeft","topRight","bottomLeft"],Dr=z.object({outer:ke.optional(),inner:ke.optional()}),bc=z.object({topLeft:Dr.optional(),topRight:Dr.optional(),bottomLeft:Dr.optional()}),W0=z.object({value:z.string(),size:z.number().optional(),level:dc.optional(),bgColor:ke.optional(),fgColor:ke.optional(),eyeColor:ke.optional(),dotColor:ke.optional(),bodyPattern:ya.optional(),cornerEyePattern:ba.optional(),cornerEyeDotPattern:ha.optional(),margin:z.number().optional(),imageSettings:lc.optional(),isOGContext:z.boolean().optional(),templateId:z.string().optional(),customProps:z.record(z.string(),z.any()).optional(),frame:Vo.optional(),art:ma.optional(),eyeColors:bc.optional(),moduleScale:z.number().min(tr).max(Gr).optional(),autoLevel:z.boolean().optional(),shape:gc.optional()});});function _c(t,e,n={}){if(t==="circle")return jsx("circle",{cx:$(e.x+e.w/2),cy:$(e.y+e.h/2),r:$(Math.min(e.w,e.h)/2),...n});let o=t==="rounded"?Math.min(e.w,e.h)*qr:0;return jsx("rect",{height:$(e.h),width:$(e.w),x:$(e.x),y:$(e.y),...o>0&&{rx:$(o),ry:$(o)},...n})}function j0(t,e){let n=t.w*e,o=t.h*e;return {x:t.x+n,y:t.y+o,w:t.w-2*n,h:t.h-2*o}}function Hr(t,e){let n=t.shape??"square",o=t.plate,r=o?j0(e,zr):e,a=c=>jsx("image",{height:$(r.h),href:t.src,preserveAspectRatio:"none",width:$(r.w),x:$(r.x),y:$(r.y),...c&&{clipPath:`url(#${c})`}});if(n==="square"&&!o)return a();let i=n==="square"?void 0:`qrdx-logo-${Ye(`${n}|${$(r.x)}|${$(r.y)}|${$(r.w)}|${$(r.h)}`)}`;return jsxs("g",{children:[o&&_c(n,e,{fill:o}),i&&jsx("clipPath",{id:i,children:_c(n,r)}),a(i)]})}var qr,zr,Wr=U(()=>{"use strict";ae();ht();qr=.22,zr=.14;});function K0(t){let e=t*4+17,n=new Uint8Array(e*e),o=(i,c)=>{i>=0&&c>=0&&i<e&&c<e&&(n[c*e+i]=1);};for(let i=0;i<e;i++)o(6,i),o(i,6);for(let[i,c]of [[3,3],[e-4,3],[3,e-4]])for(let s=-4;s<=4;s++)for(let l=-4;l<=4;l++)o(i+l,c+s);let r=[];if(t>1){let i=Math.floor(t/7)+2,c=t===32?26:Math.ceil((t*4+4)/(i*2-2))*2;r.push(6);for(let s=e-7;r.length<i;s-=c)r.splice(1,0,s);}let a=r.length-1;for(let[i,c]of r.entries())for(let[s,l]of r.entries())if(!(i===0&&s===0||i===0&&s===a||i===a&&s===0))for(let u=-2;u<=2;u++)for(let m=-2;m<=2;m++)o(c+m,l+u);for(let i=0;i<=8;i++)o(8,i),o(i,8);for(let i=0;i<8;i++)o(e-1-i,8),o(8,e-1-i);if(t>=7)for(let i=0;i<18;i++){let c=e-11+i%3,s=Math.floor(i/3);o(c,s),o(s,c);}return n}function t1(t,e){let n=t*4+17,o=Lt[e].ordinal,r=Ea.NUM_ERROR_CORRECTION_BLOCKS[o]?.[t]??0,a=Ea.ECC_CODEWORDS_PER_BLOCK[o]?.[t]??0,i=Math.floor(Ea.getNumRawDataModules(t)/8),c=r-i%r,s=Math.floor(i/r),l=Array.from({length:r},(M,C)=>s+(C<c?0:1)),u=[],m=[],f=s-a;for(let M=0;M<=s;M++)for(let C=0;C<r;C++)if(C<c){if(M===f)continue;u.push(C),m.push(M<f?M:M-1);}else u.push(C),m.push(M);if(u.length!==i)throw new Error(`Codeword map: interleave mismatch at version ${t}`);let d=K0(t),p=new Int16Array(n*n).fill(-1),h=new Int16Array(n*n).fill(-1),g=new Int8Array(n*n).fill(-1),b=i*8,_=0;for(let M=n-1;M>=1;M-=2){M===6&&(M=5);let C=(M+1&2)===0;for(let x=0;x<n;x++)for(let S=0;S<2;S++){let E=M-S,R=(C?n-1-x:x)*n+E;if(!d[R]&&_<b){let v=_>>>3;p[R]=u[v],h[R]=m[v],g[R]=7-(_&7),_++;}}}if(_!==b)throw new Error(`Codeword map: placement mismatch at version ${t}`);let y=J0[`${t}${e}`]??0;return {version:t,level:e,size:n,blocks:r,eccPerBlock:a,blockLengths:l,correctable:Math.floor((a-y)/2),block:p,codeword:h,bit:g}}function er(t,e){if(!(Number.isInteger(t)&&t>=1&&t<=40))throw new RangeError(`QR version must be 1\u201340, got ${t}`);let n=`${t}${e}`,o=Je.get(n);if(o)return Je.delete(n),Je.set(n,o),o;let r=t1(t,e);if(Je.size>=e1){let a=Je.keys().next().value;a!==void 0&&Je.delete(a);}return Je.set(n,r),r}function nr(t,e){let n=new Array(t.blocks).fill(0),o=new Set;for(let r of e){let a=t.block[r]??-1;if(a<0)continue;let i=a*4096+t.codeword[r];o.has(i)||(o.add(i),n[a]=n[a]+1);}return n}var Ea,J0,e1,Je,Vr=U(()=>{"use strict";me();At();(({QrCode:Ea}=Mt)),J0={"1L":3,"1M":2,"1Q":1,"1H":1,"2L":2,"3L":1};e1=8,Je=new Map;});function yc(t){let e=[t.start],n=t.start;for(let o of t.segments){let r=o.at(-1);if(o.length===1)e.push(r);else {let a=n1[o.length];for(let i=1;i<=a;i++){let c=i/a,s=1-c;if(o.length===2){let[l]=o;e.push([s*s*n[0]+2*s*c*l[0]+c*c*r[0],s*s*n[1]+2*s*c*l[1]+c*c*r[1]]);}else {let[l,u]=o;e.push([s*s*s*n[0]+3*s*s*c*l[0]+3*s*c*c*u[0]+c*c*c*r[0],s*s*s*n[1]+3*s*s*c*l[1]+3*s*c*c*u[1]+c*c*c*r[1]]);}}}n=r;}return e}function xc(t,e){let n=[];for(let o of t)for(let r=0;r<o.length;r++){let[a,i]=o[r],[c,s]=o[(r+1)%o.length];i<=e!=s<=e&&n.push(a+(e-i)/(s-i)*(c-a));}return n.sort((o,r)=>o-r)}function Sc(t,e){let n=0;for(let o of t)if(o<e)n++;else break;return n%2===1}function r1(t,e,n){return Sc(xc(t,n),e)}function Mc(t){let e=new Map;return (n,o)=>{let r=e.get(o);return r||(r=xc(t,o),e.set(o,r)),Sc(r,n)}}function o1(t,e,n,o){let r=n[0]-t,a=n[1]-e,i=o[0]-n[0],c=o[1]-n[1],s=u=>Math.max(Math.abs(r+u*i),Math.abs(a+u*c)),l=Math.min(s(0),s(1));for(let[u,m]of [[a-r,i-c],[-(r+a),i+c]])if(m!==0){let f=u/m;f>0&&f<1&&(l=Math.min(l,s(f)));}return l}function a1(t,e,n){if(!r1(t,e,n))return 0;let o=Number.POSITIVE_INFINITY;for(let r of t)for(let a=0;a<r.length;a++)o=Math.min(o,o1(e,n,r[a],r[(a+1)%r.length]));return Number.isFinite(o)?o:0}function i1(t){let e=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,r=Number.NEGATIVE_INFINITY;for(let a of t)for(let[i,c]of a)e=Math.min(e,i),n=Math.min(n,c),o=Math.max(o,i),r=Math.max(r,c);return {x0:e,y0:n,x1:o,y1:r}}function Cc(t){let e=t.map(yc),n=i1(e),o=n.x1-n.x0,r=n.y1-n.y0;if(!(o>0&&r>0))return null;let a=(p,h)=>{let g=Math.max(p-n.x0,n.x1-p,h-n.y0,n.y1-h);return g>0?a1(e,p,h)/(2*g):0},i={cx:n.x0+o/2,cy:n.y0+r/2,value:0};i.value=a(i.cx,i.cy);let c=32;for(let p=1;p<c;p++)for(let h=1;h<c;h++){let g=n.x0+o*h/c,b=n.y0+r*p/c,_=a(g,b);_>i.value&&(i={cx:g,cy:b,value:_});}let s=o/c,l=r/c;for(let p=0;p<6;p++){let h=i;for(let g=-2;g<=2;g++)for(let b=-2;b<=2;b++){let _=h.cx+s*b/2,y=h.cy+l*g/2,M=a(_,y);M>i.value&&(i={cx:_,cy:y,value:M});}s/=2,l/=2;}if(i.value<=0)return null;let m=.5/Math.max(i.cx-n.x0,n.x1-i.cx,i.cy-n.y0,n.y1-i.cy),f=([p,h])=>[.5+(p-i.cx)*m,.5+(h-i.cy)*m],d=t.map(p=>({start:f(p.start),segments:p.segments.map(h=>h.map(f))}));return {rings:d,polygons:d.map(yc),half:i.value}}function wc(t,e){let n=([r,a])=>`${$(r*e)} ${$(a*e)}`,o="";for(let r of t.rings){o+=`M${n(r.start)}`;for(let a of r.segments){let i=a.length===1?"L":a.length===2?"Q":"C";o+=i+a.map(n).join(" ");}o+="Z";}return o}function Ec(){return $c??=Cc([s1]),$c}function c1(t){let{width:e,height:n,cells:o}=t;return Number.isInteger(e)&&Number.isInteger(n)&&e>=ie&&n>=ie&&e<=Xt&&n<=Xt&&typeof o=="string"&&o.length===e*n&&/^[01]*$/.test(o)?(r,a)=>r>=0&&a>=0&&r<e&&a<n&&o[a*e+r]==="1":null}function l1(t,e,n){let o=(s,l)=>t(s-1,l-1),r=new Map,a=(s,l)=>{for(let[u,m]of [[s,l],[l,s]]){let f=r.get(Se(u))??[];f.push(m),r.set(Se(u),f);}};for(let s=0;s<=n;s++)for(let l=0;l<=e;l++){let u=o(l,s),m=o(l+1,s),f=o(l+1,s+1),d=o(l,s+1),p=[l,s-.5],h=[l+.5,s],g=[l,s+.5],b=[l-.5,s];switch((u?8:0)+(m?4:0)+(f?2:0)+(d?1:0)){case 1:case 14:a(b,g);break;case 2:case 13:a(g,h);break;case 3:case 12:a(b,h);break;case 4:case 11:a(p,h);break;case 6:case 9:a(p,g);break;case 7:case 8:a(b,p);break;case 5:a(p,h),a(b,g);break;case 10:a(b,p),a(g,h);break;}}let i=[],c=new Set;for(let[s,l]of r){if(c.has(s)||l.length===0)continue;let[u,m]=s.split(",").map(Number),f=[[u,m]];c.add(s);let d=[u,m],p=l[0];for(;!c.has(Se(p));){c.add(Se(p)),f.push(p);let h=u1(r.get(Se(p))??[],d,c);if(!h)break;d=p,p=h;}f.length>=3&&i.push(m1(f));}return i}function u1(t,e,n){let o=Se(e);return t.find(r=>Se(r)!==o&&!n.has(Se(r)))??t.find(r=>Se(r)!==o)}function m1(t){let e=[];for(let n=0;n<t.length;n++){let o=t[(n-1+t.length)%t.length],r=t[n],a=t[(n+1)%t.length],i=(r[0]-o[0])*(a[1]-r[1])-(r[1]-o[1])*(a[0]-r[0]);Math.abs(i)>1e-9&&e.push(r);}return e.length>=3?e:t}function d1(t){let e=(a,i)=>[(a[0]+i[0])/2,(a[1]+i[1])/2],n=t.length,o=e(t[n-1],t[0]),r=t.map((a,i)=>[a,e(a,t[(i+1)%n])]);return {start:o,segments:r}}function Ra(t){let e=`${t.width}x${t.height}:${t.cells}`,n=rr.get(e);if(n)return n;let o=c1(t),r;if(!o)r={outline:null,problem:"invalid"};else if(t.cells.includes("1")){let a=l1(o,t.width,t.height),i=a.length>0?Cc(a.map(d1)):null;r=i&&2*i.half>=wa?{outline:i,problem:null}:{outline:null,problem:i?"thin":"empty"};}else r={outline:null,problem:"empty"};return rr.size>16&&rr.delete(rr.keys().next().value),rr.set(e,r),r}var n1,s1,$c,Se,rr,Rc=U(()=>{"use strict";xe();ht();n1={2:6,3:12};s1={start:[0,-.58],segments:[[[.2,-.92],[1,-.97],[1,-.3]],[[1,.3],[.62,.6],[0,.92]],[[-.62,.6],[-1,.3],[-1,-.3]],[[-1,-.97],[-.2,-.92],[0,-.58]]]};Se=([t,e])=>`${t},${e}`;rr=new Map;});function Ke(t){return Math.max(t,Ca)}function Xr(t){return t==="heart"?Ec():typeof t=="object"&&t?.type==="silhouette"?Ra(t).outline:null}function Pa(t){return t==="circle"||Xr(t)!==null}function g1(t){let{outline:e,problem:n}=Ra(t);if(e&&!n)return {ok:true,share:2*e.half};let o=n??"invalid";return {ok:false,reason:o,message:p1[o]}}function Ft(t,e,n){if(n==="circle"){let i=Ke(e),c=(t/2+i)*Math.SQRT2+f1;return Math.ceil(c-t/2)}let o=Xr(n);if(!o)return e;let r=Ke(e),a=(t+2*(r+h1))/(2*o.half);return Math.ceil((a-t)/2-1e-9)}function vc(t){let e=t>>>0;return ()=>{e=e+1831565813>>>0;let n=e;return n=Math.imul(n^n>>>15,n|1),n^=n+Math.imul(n^n>>>7,n|61),((n^n>>>14)>>>0)/4294967296}}function b1(t,e,n){let o=Ft(e,n,"circle"),r=Ke(n),a=e+2*o,i=a/2,c=i-Pc-.5,s=vc(Number.parseInt(Ye(t),36)||1),l=o-r,u=o+e+r;return Array.from({length:a},(m,f)=>Array.from({length:a},(d,p)=>{let h=s()<Ac;return p>=l&&p<u&&f>=l&&f<u?false:h&&Math.hypot(p+.5-i,f+.5-i)<=c}))}function Lc(t,e,n,o){if(o==="circle")return b1(t,e,n);let r=Xr(o);if(!r)return null;let a=Ft(e,n,o),i=Ke(n),c=e+2*a,s=Mc(r.polygons),l=.5+Pc,u=(p,h)=>{let g=p+.5,b=h+.5;return s(g/c,b/c)?_1.every(([_,y])=>s((g+_*l)/c,(b+y*l)/c)):false},m=vc(Number.parseInt(Ye(t),36)||1),f=a-i,d=a+e+i;return Array.from({length:c},(p,h)=>Array.from({length:c},(g,b)=>{let _=m()<Ac;return b>=f&&b<d&&h>=f&&h<d?false:_&&u(b,h)}))}function Aa(t,e){if(t==="circle")return {circle:e/2};let n=Xr(t);return n?{path:wc(n,e)}:null}function y1(t,e){let n=Aa(t,e);return n?"circle"in n?V(e/2,e/2,n.circle):n.path:null}var f1,Pc,Ac,h1,p1,_1,tn=U(()=>{"use strict";xe();Rc();ae();f1=1,Pc=.5,Ac=.5,h1=.5;p1={invalid:"This silhouette isn't a valid shape grid.",empty:"No shape found: use a picture with a dark or opaque shape on a light or clear background.",thin:"This shape is too thin to hold the code with its quiet zone. Try a rounder, fuller shape."};_1=Array.from({length:8},(t,e)=>{let n=e*Math.PI/4;return [Math.cos(n),Math.sin(n)]});});function va(t){let{width:e,height:n,data:o}=t,r=[0,e-1,(n-1)*e,n*e-1].map(i=>{let c=i*4;return {color:[kt(o[c]),kt(o[c+1]),kt(o[c+2])],alpha:o[c+3]/255}});if(r.some(i=>i.alpha<.9))return null;let a=r[0].color;return r.every(({color:i})=>or(i,a)<.006)?a:null}function $1(t){let{width:e,height:n,data:o}=t,r=va(t),a=new Float32Array(e*n);for(let i=0;i<a.length;i++){let c=i*4,s=o[c+3]/255;if(r&&s>0){let l=Math.sqrt(or([kt(o[c]),kt(o[c+1]),kt(o[c+2])],r));s*=Math.min(1,Math.max(0,(l-.06)/.1));}a[i]=s;}return a}function M1(t,e){let{width:n,height:o,data:r}=t,a=new Float64Array(4096),i=new Float64Array(4096*3),c=0;for(let d=0;d<e.length;d++){if(e[d]<.9)continue;let p=d*4,h=Math.floor(r[p]/16)*256+Math.floor(r[p+1]/16)*16+Math.floor(r[p+2]/16);a[h]+=1,i[h*3]+=kt(r[p]),i[h*3+1]+=kt(r[p+1]),i[h*3+2]+=kt(r[p+2]),c++;}if(c===0)return {palette:[],error:0};let s=[...a.keys()].filter(d=>a[d]>0).sort((d,p)=>a[p]-a[d]),l=[];for(let d of s){if(a[d]/c<Ic/2||l.length>=x1)break;let p=[i[d*3]/a[d],i[d*3+1]/a[d],i[d*3+2]/a[d]];l.every(h=>or(h,p)>=S1**2)&&l.push(p);}let u=[],m=0;for(let d=0;d<3;d++){u=l.map(()=>({n:0,r:0,g:0,b:0,x:0,y:0})),m=0;for(let p=0;p<e.length;p++){if(e[p]<.9)continue;let h=p*4,g=[kt(r[h]),kt(r[h+1]),kt(r[h+2])],b=0,_=Number.POSITIVE_INFINITY;for(let[M,C]of l.entries()){let x=or(g,C);x<_&&(_=x,b=M);}let y=u[b];y.n++,y.r+=g[0],y.g+=g[1],y.b+=g[2],y.x+=p%n,y.y+=Math.floor(p/n),m+=Math.sqrt(_);}for(let[p,h]of u.entries())h.n>0&&(l[p]=[h.r/h.n,h.g/h.n,h.b/h.n]);}return {palette:l.map((d,p)=>({color:d,area:u[p].n/c,cx:u[p].n?u[p].x/u[p].n+.5:n/2,cy:u[p].n?u[p].y/u[p].n+.5:o/2})).filter(d=>d.area>=Ic).sort((d,p)=>p.area-d.area),error:m/c}}function C1(t,e,n){let o=e+2,r=n+2,a=(m,f)=>m<=0||f<=0||m>e||f>n?0:t[(f-1)*e+(m-1)],i=new Map,c=new Map,s=m=>{let f=c.get(m);if(f)return f;let d=Math.floor(m/2),p=d%o,h=Math.floor(d/o),g=a(p,h),b=m%2===1,_=b?a(p,h+1):a(p+1,h),y=g===_?.5:Math.min(1,Math.max(0,(.5-g)/(_-g))),M=b?[p-.5,h-.5+y]:[p-.5+y,h-.5];return c.set(m,M),M},l=(m,f)=>{i.set(m,f);};for(let m=0;m<r-1;m++)for(let f=0;f<o-1;f++){let d=a(f,m)>=.5,p=a(f+1,m)>=.5,h=a(f+1,m+1)>=.5,g=a(f,m+1)>=.5,b=2*(m*o+f),_=2*((m+1)*o+f),y=2*(m*o+f)+1,M=2*(m*o+f+1)+1;switch((d?8:0)+(p?4:0)+(h?2:0)+(g?1:0)){case 1:l(_,y);break;case 2:l(M,_);break;case 3:l(M,y);break;case 4:l(b,M);break;case 5:{(a(f,m)+a(f+1,m)+a(f+1,m+1)+a(f,m+1))/4>=.5?(l(b,y),l(_,M)):(l(b,M),l(_,y));break}case 6:l(b,_);break;case 7:l(b,y);break;case 8:l(y,b);break;case 9:l(_,b);break;case 10:{(a(f,m)+a(f+1,m)+a(f+1,m+1)+a(f,m+1))/4>=.5?(l(y,_),l(M,b)):(l(y,b),l(M,_));break}case 11:l(M,b);break;case 12:l(y,M);break;case 13:l(_,M);break;case 14:l(y,_);break;}}let u=[];for(let m of i.keys()){if(!i.has(m))continue;let f=[],d=m;for(;d!==void 0&&i.has(d);){f.push(s(d));let p=i.get(d);i.delete(d),d=p;}f.length>=3&&u.push(f);}return u}function w1(t){let e=0;for(let n=0;n<t.length;n++){let o=t[n],r=t[(n+1)%t.length];e+=o[0]*r[1]-r[0]*o[1];}return e/2}function Tc(t,e){if(t.length<=2)return t;let n=new Uint8Array(t.length);n[0]=1,n[t.length-1]=1;let o=[[0,t.length-1]];for(;o.length>0;){let[r,a]=o.pop(),i=t[r],c=t[a],s=c[0]-i[0],l=c[1]-i[1],u=Math.hypot(s,l)||1,m=-1,f=e;for(let d=r+1;d<a;d++){let p=t[d],h=Math.abs(l*(p[0]-i[0])-s*(p[1]-i[1]))/u;h>f&&(f=h,m=d);}m>=0&&(n[m]=1,o.push([r,m],[m,a]));}return t.filter((r,a)=>n[a]===1)}function E1(t,e){let n=0,o=-1;for(let[i,c]of t.entries()){let s=(c[0]-t[0][0])**2+(c[1]-t[0][1])**2;s>o&&(o=s,n=i);}let r=Tc(t.slice(0,n+1),e),a=Tc([...t.slice(n),t[0]],e);return [...r.slice(0,-1),...a.slice(0,-1)]}function R1(t,e){let n=t.length,o=(a,i)=>{let c=Math.hypot(i[0]-a[0],i[1]-a[1])||1,s=Math.min(.5,e/c);return [a[0]+(i[0]-a[0])*s,a[1]+(i[1]-a[1])*s]},r="";for(let a=0;a<n;a++){let i=t[a],c=o(i,t[(a-1+n)%n]),s=o(i,t[(a+1)%n]);r+=a===0?`M${Ne(c[0])} ${Ne(c[1])}`:`L${Ne(c[0])} ${Ne(c[1])}`,r+=`Q${Ne(i[0])} ${Ne(i[1])} ${Ne(s[0])} ${Ne(s[1])}`;}return `${r}Z`}function P1(t,e,n){let o="";for(let r of C1(t,e,n)){if(Math.abs(w1(r))<.8)continue;let a=E1(r,.18);a.length>=3&&(o+=R1(a,.9));}return o}function Fc(t){let{width:e,height:n,data:o}=t,r=$1(t),a=0;for(let h of r)a+=h;let{palette:i,error:c}=M1(t,r),s={width:e,height:n,palette:i,alpha:r,coverage:a/(e*n)};if(i.length===0||c>A1)return {...s,layers:[],photographic:i.length>0};let l=i.length,u=Array.from({length:l},()=>new Float32Array(e*n)),m=i.map(h=>h.color);for(let h=0;h<r.length;h++){let g=r[h];if(g<=0)continue;let b=h*4,_=[kt(o[b]),kt(o[b+1]),kt(o[b+2])],y=0,M=-1,C=Number.POSITIVE_INFINITY,x=Number.POSITIVE_INFINITY;for(let v=0;v<l;v++){let A=or(_,m[v]);A<C?(M=y,x=C,y=v,C=A):A<x&&(M=v,x=A);}if(M<0||C<1e-6){u[y][h]=g;continue}let S=m[y],E=m[M],w=[E[0]-S[0],E[1]-S[1],E[2]-S[2]],R=Math.min(1,Math.max(0,((_[0]-S[0])*w[0]+(_[1]-S[1])*w[1]+(_[2]-S[2])*w[2])/(w[0]**2+w[1]**2+w[2]**2)));u[y][h]=g*(1-R),u[M][h]=g*R;}let f=[],d=new Float32Array(e*n),p=new Array(l);for(let h=l-1;h>=0;h--){let g=u[h];for(let b=0;b<d.length;b++)d[b]+=g[b];p[h]=d.slice();}for(let h=0;h<l;h++){let g=P1(p[h],e,n);g&&f.push({color:m[h],d:g});}return {...s,layers:f,photographic:false}}var kt,or,J,x1,S1,Ic,Ne,A1,La=U(()=>{"use strict";ht();kt=t=>t/255,or=(t,e)=>(t[0]-e[0])**2+(t[1]-e[1])**2+(t[2]-e[2])**2,J=t=>.2126*t[0]+.7152*t[1]+.0722*t[2];x1=8,S1=.14,Ic=.006;Ne=t=>st(t,2);A1=.075;});function v1(t){let e="";for(let o=0;o<t.length;o+=32768)e+=String.fromCharCode(...t.subarray(o,o+32768));return btoa(e)}function I1(t){return L1.get(t,()=>{let e=atob(t),n=new Uint8Array(e.length);for(let o=0;o<e.length;o++)n[o]=e.charCodeAt(o);return n})}function ka(t){let{width:e,height:n,data:o}=t;if(!(Number.isInteger(e)&&Number.isInteger(n))||e<1||n<1||e>$e||n>$e||typeof o!="string")return null;try{let r=I1(o);return r.length===e*n*4?{width:e,height:n,data:r}:null}catch{return null}}function Qc(t,e={}){let{width:n,height:o,data:r}=t;if(!(n>0&&o>0)||r.length<n*o*4)throw new Error("Art image pixels must be width \xD7 height \xD7 4 RGBA bytes");let a=Math.min(n,o),i=e.square?Math.floor((n-a)/2):0,c=e.square?Math.floor((o-a)/2):0,s=e.square?a:n,l=e.square?a:o,u=Math.min(Math.max(Math.round(e.maxSize??Fa.halftone),1),$e),m=Math.min(1,u/Math.max(s,l)),f=Math.max(1,Math.round(s*m)),d=Math.max(1,Math.round(l*m)),p=new Uint8Array(f*d*4);for(let h=0;h<d;h++){let g=Math.floor(h*l/d),b=Math.max(g+1,Math.floor((h+1)*l/d));for(let _=0;_<f;_++){let y=Math.floor(_*s/f),M=Math.max(y+1,Math.floor((_+1)*s/f)),C=0,x=0,S=0,E=0,w=0;for(let v=g;v<b;v++)for(let A=y;A<M;A++){let L=((v+c)*n+A+i)*4,T=r[L+3]/255;C+=r[L]*T,x+=r[L+1]*T,S+=r[L+2]*T,E+=T,w++;}let R=(h*f+_)*4;p[R]=E>0?Math.round(C/E):0,p[R+1]=E>0?Math.round(x/E):0,p[R+2]=E>0?Math.round(S/E):0,p[R+3]=Math.round(E/w*255);}}return {width:f,height:d,data:v1(p)}}async function T1(t){if(typeof t!="string"&&!(t instanceof Blob))return t.complete||await new Promise(n=>{t.addEventListener("load",n,{once:true}),t.addEventListener("error",n,{once:true});}),t;let e=typeof t=="string"?t:URL.createObjectURL(t);try{return await new Promise((n,o)=>{let r=new Image;r.crossOrigin="anonymous",r.onload=()=>n(r),r.onerror=()=>o(new Error("Could not load the art image")),r.src=e;})}finally{typeof t!="string"&&setTimeout(()=>URL.revokeObjectURL(e),1e3);}}async function F1(t,e={}){if(typeof document>"u")throw new Error("loadQRArtImage needs a browser; pass decoded pixels to createQRArtImage instead");let n=e.mode??"halftone",o=e.maxSize??Fa[n],r=await T1(t),a=r.naturalWidth||r.width||o,i=r.naturalHeight||r.height||o,c=n==="halftone",s=Math.min(1,o*4/(c?Math.min(a,i):Math.max(a,i))),l=Math.max(1,Math.round(a*s)),u=Math.max(1,Math.round(i*s)),m=document.createElement("canvas");m.width=l,m.height=u;let f=m.getContext("2d",{willReadFrequently:true});if(!f)throw new Error("Could not get a canvas context");f.imageSmoothingQuality="high",f.drawImage(r,0,0,l,u);let d;try{d=f.getImageData(0,0,l,u);}catch{throw new Error("Could not read the art image (cross-origin images need CORS); upload it instead")}finally{m.remove();}return Qc(d,{maxSize:o,square:c})}function Na(t){return !!(t&&Jn.includes(t.mode)&&t.image&&ka(t.image))}function Zr(t){let e=Zn[t.mode];return t.variant&&e.includes(t.variant)?t.variant:e[0]}function k1(t,e){if(t===1)return [];let n=Math.floor(t/7)+2,o=t===32?26:Math.ceil((t*4+4)/(n*2-2))*2,r=[6];for(let a=e-7;r.length<n;a-=o)r.splice(1,0,a);return r}function ar(t,e){let n=k1(t,e),o=n.length-1,r=[];for(let[a,i]of n.entries())for(let[c,s]of n.entries())a===0&&c===0||a===0&&c===o||a===o&&c===0||r.push([i,s]);return r}function Uc(t){let e=Nc.get(t);if(e)return e;let n=t*4+17,o=new Uint8Array(n*n),r=(a,i,c,s,l)=>{for(let u=Math.max(0,i);u<Math.min(n,i+s);u++)for(let m=Math.max(0,a);m<Math.min(n,a+c);m++)o[u*n+m]=l;};r(6,0,1,n,kc),r(0,6,n,1,kc),r(0,8,9,1,Oe),r(8,0,1,9,Oe),r(n-8,8,8,1,Oe),r(8,n-8,1,8,Oe),t>=7&&(r(n-11,0,3,6,Oe),r(0,n-11,6,3,Oe));for(let[a,i]of ar(t,n))r(a-2,i-2,5,5,jt);return r(0,0,8,8,Vt),r(n-8,0,8,8,Vt),r(0,n-8,8,8,Vt),Nc.set(t,o),o}function O1(t){let e=t*4+17,n=Uc(t);return Array.from({length:e},(o,r)=>Array.from({length:e},(a,i)=>n[r*e+i]!==N1))}function D1(t){let e=t[8],n=e?.[0]?1:0,o=e?.[1]?1:0,r=(1-n)*2+o;return ["M","L","H","Q"][r]??"M"}function Nn(t,e){let n=dt(t);return !n||n.a===0?e:[n.r/255,n.g/255,n.b/255]}function De(t,e,n,o){let r=J(t);if(o?r<=n:r>=n)return t;let a=J(e);return Math.abs(r-a)<1e-6?e:nn(t,e,Math.min(1,Math.max(0,(r-n)/(r-a))))}function Nt(t,e=1){let n=o=>Math.min(255,Math.round(Math.round(Math.min(Math.max(o,0),1)*255)/e)*e);return `#${Ia(n(t[0]))}${Ia(n(t[1]))}${Ia(n(t[2]))}`}function G1(t){let e=t<0?-1:1,n=Math.abs(t),o=1/(1+.3275911*n),r=1-((((1.061405429*o-1.453152027)*o+1.421413741)*o-.284496736)*o+.254829592)*o*Math.exp(-n*n);return e*r}function Da(t,e,n,o){let r=o==="cover"?Math.max(n/t,n/e):Math.min(n/t,n/e);return {scale:r,offsetX:(n-t*r)/2,offsetY:(n-e*r)/2}}function zc(t,e){let{width:n,height:o,data:r}=t,a=new Float32Array(n*o*3),i=e??new Float32Array(n*o);for(let c=0;c<n*o;c++)a[c*3]=r[c*4]/255,a[c*3+1]=r[c*4+1]/255,a[c*3+2]=r[c*4+2]/255,e||(i[c]=r[c*4+3]/255);return {width:n,height:o,rgb:a,alpha:i}}function q1(t){let e=zc(t),{rgb:n,alpha:o}=e,r=new Float64Array(256),a=0;for(let m=0;m<o.length;m++){if(o[m]<.5)continue;let f=J([n[m*3],n[m*3+1],n[m*3+2]]);r[Math.min(255,Math.floor(f*256))]+=1,a++;}let i=m=>{let f=0;for(let d=0;d<256;d++)if(f+=r[d],f>=m*a)return d/255;return 1},c=a?i(.01):0,s=a?i(.99):1;s-c<.15&&(c=0,s=1);let l=Math.min(1.6,1/(s-c)),u=(c+s)/2;for(let m=0;m<o.length;m++){let f=[n[m*3],n[m*3+1],n[m*3+2]],d=J(f),p=.5+(d-u)*l;for(let h=0;h<3;h++)n[m*3+h]=Math.min(1,Math.max(0,p+(f[h]-d)*1.12));}return e}function Hc(t,e,n,o,r=1){let{width:a,height:i,rgb:c,alpha:s}=t,l=Math.min(Math.max(e-.5,0),a-1),u=Math.min(Math.max(n-.5,0),i-1),m=Math.floor(l),f=Math.floor(u),d=Math.min(m+1,a-1),p=Math.min(f+1,i-1),h=l-m,g=u-f,b=0,_=0,y=0,M=0,C=(S,E,w)=>{let R=E*a+S,v=s[R]*w;b+=c[R*3]*v,_+=c[R*3+1]*v,y+=c[R*3+2]*v,M+=v;};if(C(m,f,(1-h)*(1-g)),C(d,f,h*(1-g)),C(m,p,(1-h)*g),C(d,p,h*g),M<=0)return o;let x=M*r;return [o[0]+(b/M-o[0])*x,o[1]+(_/M-o[1])*x,o[2]+(y/M-o[2])*x]}function Ba(t,e){return H1.get(t.image.data,()=>Fc(e))}function Wc(t,e,n){return W1.get(t.image.data,()=>zc(e,n.alpha))}function V1(t,e,n){let o=Et(n*2),r=Et(n);return `M${Et(t-n)} ${Et(e)}a${r} ${r} 0 1 0 ${o} 0a${r} ${r} 0 1 0 ${-o} 0z`}function en(t,e,n,o,r){let a=Math.min(r,n/2,o/2);if(a<=0)return `M${Et(t)} ${Et(e)}h${Et(n)}v${Et(o)}h${Et(-n)}z`;let i=Et(a);return `M${Et(t+a)} ${Et(e)}h${Et(n-2*a)}a${i} ${i} 0 0 1 ${i} ${i}v${Et(o-2*a)}a${i} ${i} 0 0 1 ${-i} ${i}h${Et(-(n-2*a))}a${i} ${i} 0 0 1 ${-i} ${-i}v${Et(-(o-2*a))}a${i} ${i} 0 0 1 ${i} ${-i}z`}function Xc(t,e,n){let o="";for(let[r,a]of t){let i=(r-2+e)*n,c=(a-2+e)*n;o+=en(i,c,5*n,5*n,n*.35),o+=en(i+n,c+n,3*n,3*n,n*.15),o+=en(i+2*n,c+2*n,n,n,n*.12);}return o}function Y1(t,e){let n=Nn(t,[0,0,0]),o=Nn(e,[1,1,1]),r=J(o)-J(n);return r>=jr?null:r<=-jr?"inverted":"low-contrast"}function Yc(t,e,n){let o=Math.min(Math.max(t.intensity??Gc,0),X1[Zr(t)]);return J(n)-J(e)>=jr?o:0}function j1(t){let{art:e,modules:n,version:o}=t,r=e.image&&ka(e.image);if(!(r&&Jn.includes(e.mode)))return null;let a=n.length;if(a!==o*4+17)return null;let i=Nn(t.fgColor,[0,0,0]),c=Nn(t.bgColor,[1,1,1]),s=Yc(e,i,c);return s<=0?null:{art:e,image:r,modules:n,size:a,version:o,kinds:Uc(o),margin:t.margin,pixelSize:t.pixelSize,t:s,fg:i,bg:c,variant:Zr(e),body:t.body}}function Ga(t){let e=j1(t);if(!e)return null;let n;return e.art.mode==="halftone"?n=e.variant==="mono"?nd(e):ed(e):n=e.variant==="badge"?md(e):rd(e),jsx("g",{"data-qrdx-art":e.art.mode,"data-qrdx-art-variant":e.variant,children:n})}function Z1(t,e){return {margin:.42-.17*t+(e===3?.04:0),darkCap:.4+.3*t}}function Qa(t){let e=t*4+17,n=Dc.get(t);if(!n){let a=e*2,i=new Uint8Array(a*a),c=jc*2;for(let s=0;s<a;s++)for(let l=0;l<a;l++){let u=l<c||l>=a-c,m=s<c||s>=a-c;u&&m&&!(l>=a-c&&s>=a-c)&&(i[s*a+l]=1);}for(let[s,l]of ar(t,e))for(let u=(l-2)*2-1;u<(l+3)*2+1;u++)for(let m=(s-2)*2-1;m<(s+3)*2+1;m++)m>=0&&u>=0&&m<a&&u<a&&(i[u*a+m]=1);Dc.set(t,i),n=i;}let o=n,r=e*2;return (a,i)=>{let c=Math.floor(a*2),s=Math.floor(i*2);return c>=0&&s>=0&&c<r&&s<r&&o[s*r+c]===1}}function Zc(t,e,n=false){let{image:o,size:r,kinds:a,fg:i,bg:c}=t,s=z1.get(t.art.image.data,()=>q1(o)),l=Da(o.width,o.height,r,"cover"),u=r*e,m=new Float32Array(u*u*3).fill(Number.NaN),d=1/(e*l.scale)>1.3?2:1,p=J(c)-.1*(J(c)-J(i)),h=Qa(t.version);for(let g=0;g<r;g++)for(let b=0;b<r;b++){let _=a[g*r+b],y=_===Vt||_===jt;if(!(y&&!n))for(let M=0;M<e;M++)for(let C=0;C<e;C++){let x=0,S=0,E=0;for(let N=0;N<d;N++)for(let I=0;I<d;I++){let G=b+(C+(I+.5)/d)/e,q=g+(M+(N+.5)/d)/e,O=Hc(s,(G-l.offsetX)/l.scale,(q-l.offsetY)/l.scale,c);x+=O[0],S+=O[1],E+=O[2];}let w=d*d,R=[x/w,S/w,E/w],v=b+(C+.5)/e,A=g+(M+.5)/e,L=Math.min(v,A,r-v,r-A);L<1.5&&(R=nn(R,c,.35*(1-L/1.5))),n&&(y||h(v,A))&&(R=De(R,c,p,false));let T=((g*e+M)*u+b*e+C)*3;m[T]=R[0],m[T+1]=R[1],m[T+2]=R[2];}}return {n:e,count:u,rgb:m}}function J1(t,e,n){let{size:o,kinds:r,modules:a,fg:i,bg:c,t:s}=t,{n:l,count:u,rgb:m}=e,f=J(i),d=J(c),p=d-f,h=Z1(s,l),g=E=>.2126*m[E]+.7152*m[E+1]+.0722*m[E+2],b=new Float32Array(o*o),_=new Float32Array(o*o);for(let E=0;E<o;E++)for(let w=0;w<o;w++){let R=r[E*o+w];if(R===Vt){b[E*o+w]=d;continue}if(R===jt){b[E*o+w]=a[E]?.[w]?f:d;continue}let v=0,A=0,L=0;for(let T=0;T<l;T++)for(let N=0;N<l;N++){let I=g(((E*l+T)*u+w*l+N)*3);v+=I,n.under[T*l+N]||(A+=I,L++);}b[E*o+w]=v/(l*l),_[E*o+w]=L?A/L:v/(l*l);}let y=o+1,M=new Float64Array(y*y);for(let E=0;E<o;E++)for(let w=0;w<o;w++)M[(E+1)*y+w+1]=b[E*o+w]+M[E*y+w+1]+M[(E+1)*y+w]-M[E*y+w];let C=2,x=(E,w)=>{let R=Math.max(0,E-C),v=Math.max(0,w-C),A=Math.min(o,E+C+1),L=Math.min(o,w+C+1);return (M[L*y+A]-M[v*y+A]-M[L*y+R]+M[v*y+R])/((A-R)*(L-v))},S=n.weight;for(let E=0;E<o;E++)for(let w=0;w<o;w++){let R=r[E*o+w];if(R===Vt||R===jt)continue;let v=R===Oe,A=(h.margin+(v?.08:0))*p,L=(h.darkCap-(v?.12:0))*p,T=(S*((n.light-n.dark)/2)-A)/(1-S),N=x(w,E),I=_[E*o+w],G=!!a[E]?.[w],q=0,O=c;if(G){let z=Math.min(N+T,f+L);I>z&&(q=(I-z)/Math.max(I-f,1e-6),O=i);}else {let z=Math.max(N-T,d-L);I<z&&(q=(z-I)/Math.max(d-I,1e-6));}if(!(q<=0)){q=Math.min(1,q);for(let z=0;z<l;z++)for(let et=0;et<l;et++){let St=((E*l+z)*u+w*l+et)*3;for(let ct=0;ct<3;ct++)m[St+ct]+=(O[ct]-m[St+ct])*q;}}}}function Jc(t,e,n,o){let{count:r}=e,a=new rn;for(let s=0;s<r;s++){let l=0,u=n(s*r);for(let m=1;m<=r;m++){let f=m<r?n(s*r+m):null;(m===r||f!==u)&&(u&&a.cellRun(u,l,s,m-l),l=m,u=f);}}let i=t.pixelSize/e.n,c=Et(t.margin*t.pixelSize);return jsx("g",{transform:`translate(${c} ${c}) scale(${Vc(i)})`,children:a.toElements(o)},o)}function Ua(t,e){let n=ar(t.version,t.size);return n.length===0?[]:[jsx("path",{d:Xc(n,t.margin,t.pixelSize),fill:e,fillRule:"evenodd"},"art-alignment")]}function Kc(t){let{image:e,size:n}=t;return Math.floor(Math.min(e.width,e.height)/n)>=4&&n<=45?4:3}function td(t,e,n){let o=e+1,r=new Float64Array(o*o);for(let i=0;i<e;i++)for(let c=0;c<e;c++)r[(i+1)*o+c+1]=t[i*e+c]+r[i*o+c+1]+r[(i+1)*o+c]-r[i*o+c];let a=new Float32Array(e*e);for(let i=0;i<e;i++)for(let c=0;c<e;c++){let s=Math.max(0,c-n),l=Math.max(0,i-n),u=Math.min(e,c+n+1),m=Math.min(e,i+n+1);a[i*e+c]=(r[m*o+u]-r[l*o+u]-r[m*o+s]+r[l*o+s])/((u-s)*(m-l));}return a}function tl(t,e,n,o){let{size:r,kinds:a,modules:i,fg:c,bg:s}=t,l=J(c),u=J(s),m=u-l,f=td(e,r,2),d=new Float32Array(r*r),p=new Float32Array(r*r).fill(Number.NaN);for(let h=0;h<r;h++)for(let g=0;g<r;g++){let b=h*r+g,_=a[b];if(_===Vt||_===jt)continue;let y=_===Oe,M=o.base+(y?.08:0),C=(o.margin+(y?.03:0))*m,x=(o.cap-(y?.04:0))*m,S=Oc(M),E=Oc(y?Math.max(o.max,.94):o.max),w=S*((o.dark+o.light)/2)+(1-S)*f[b],R=n[b],v=!!i[h]?.[g],A=v?o.dark:o.light,L=v?Math.min(w-C,l+x):Math.max(w+C,u-x),N=(v?R<=L:R>=L)?0:(R-L)/(R-A);N>E&&(N=E,p[b]=Math.min(u,Math.max(l,(L-E*A)/(1-E))));let I=v?R<=L-.06:R>=L+.06;o.skip&&I&&!y||(N=Math.max(N,S)),d[b]=N>0?K1(N):0;}return {diameter:d,surround:p}}function ed(t){let{size:e,kinds:n,modules:o,fg:r,bg:a,t:i,margin:c,pixelSize:s}=t,l=Kc(t),u=Zc(t,l,true),m=J(r),f=J(a),d=m+.1*(f-m),p=f-.05*(f-m),{count:h,rgb:g}=u,b=(x,S,E,w)=>((S*l+w)*h+x*l+E)*3,_=new Float32Array(e*e);for(let x=0;x<e;x++)for(let S=0;S<e;S++){let E=n[x*e+S];if(E===Vt||E===jt){_[x*e+S]=E===jt&&o[x]?.[S]?m:f;continue}let w=0;for(let R=0;R<l;R++)for(let v=0;v<l;v++){let A=b(S,x,v,R);w+=.2126*g[A]+.7152*g[A+1]+.0722*g[A+2];}_[x*e+S]=w/(l*l);}let y=tl(t,_,_,{base:.6-.28*i,max:.86,dark:d,light:p,margin:.2-.1*i,cap:.4+.14*i,skip:false});for(let x=0;x<e;x++)for(let S=0;S<e;S++){let E=y.surround[x*e+S];if(Number.isNaN(E))continue;let w=_[x*e+S],v=E<w?r:a,A=Math.min(1,Math.abs(w-E)/Math.max(Math.abs(w-J(v)),1e-6));for(let L=0;L<l;L++)for(let T=0;T<l;T++){let N=b(S,x,T,L);for(let I=0;I<3;I++)g[N+I]+=(v[I]-g[N+I])*A;}}let M=[Jc(t,u,x=>{let S=x*3;return Number.isNaN(g[S])?null:Nt([g[S],g[S+1],g[S+2]],8)},"art-photo")],C=new rn;for(let x=0;x<e;x++)for(let S=0;S<e;S++){let E=y.diameter[x*e+S];if(!(E>0))continue;let w=0,R=0,v=0;for(let T=0;T<l;T++)for(let N=0;N<l;N++){let I=b(S,x,N,T);w+=g[I],R+=g[I+1],v+=g[I+2];}let A=[w/(l*l),R/(l*l),v/(l*l)],L=o[x]?.[S]?De(A,r,d,true):De(A,a,p,false);C.circle(Nt(L,10),(S+c+.5)*s,(x+c+.5)*s,E/2*s);}return M.push(...C.toElements("art-dot"),...Ua(t,Nt(r))),M}function nd(t){let{size:e,kinds:n,modules:o,fg:r,bg:a}=t,i=Kc(t),c=Zc(t,i),s=J(r),l=J(a),u=i%2===1?1:2,m=(i-u)/2,f=w=>w>=m&&w<m+u,d=[];for(let w=0;w<i;w++)for(let R=0;R<i;R++)d.push(f(R)&&f(w));J1(t,c,{weight:Q1(u/i),dark:s,light:l,under:d});let{count:p,rgb:h}=c,g=new Float32Array(p*p),b=new Int8Array(p*p).fill(-1);for(let w=0;w<p*p;w++){let R=w*3;if(Number.isNaN(h[R])){g[w]=Number.NaN;continue}let v=(.2126*h[R]+.7152*h[R+1]+.0722*h[R+2]-s)/(l-s);g[w]=.5+(U1(0,1,v)-.5)*1.15;}for(let w=0;w<e;w++)for(let R=0;R<e;R++){let v=n[w*e+R];if(!(v===Vt||v===jt))for(let A=m;A<m+u;A++)for(let L=m;L<m+u;L++)b[(w*i+A)*p+R*i+L]=o[w]?.[R]?0:1;}let _=Qa(t.version);for(let w=0;w<p;w++)for(let R=0;R<p;R++){let v=w*p+R;b[v]<0&&_((R+.5)/i,(w+.5)/i)&&(b[v]=1);}let y=new Uint8Array(p*p),M=.3,C=0,x=0,S=(w,R,v)=>{if(w<0||w>=p||R>=p)return;let A=R*p+w;if(!Number.isNaN(g[A])){let L=Math.floor(w/i)===Math.floor(C/i)&&Math.floor(R/i)===Math.floor(x/i);g[A]+=L?v:v*M;}};for(let w=0;w<p;w++){let R=w%2===0?1:-1;for(let v=0;v<p;v++){let A=R===1?v:p-1-v,L=w*p+A,T=g[L];if(Number.isNaN(T))continue;let N=b[L]>=0?b[L]:T>=.5?1:0;y[L]=N===0?1:0;let I=Math.min(.75,Math.max(-0.75,T-N));C=A,x=w,S(A+R,w,I*7/16),S(A-R,w+1,I*3/16),S(A,w+1,I*5/16),S(A+R,w+1,I/16);}}let E=Nt(r);return [Jc(t,c,w=>y[w]?E:null,"art-halftone"),...Ua(t,E)]}function Bc(t,e){let n=null,o=0;for(let r of t.palette){if(e&&B1(r.color,e)<.02)continue;let a=r.area*(.35+qc(r.color))*(J(r.color)>.86?.05:1);a>o&&(o=a,n=r.color);}return n}function el(t,e,n,o,r){let a;if(t.photographic){let i=new rn,{width:c,height:s,rgb:l,alpha:u}=e;for(let m=0;m<s;m++){let f=0,d=null;for(let p=0;p<=c;p++){let h=m*c+p,g=p<c&&u[h]>=.5?Nt(o([l[h*3],l[h*3+1],l[h*3+2]]),6):null;(p===c||g!==d)&&(d&&i.cellRun(d,f,m,p-f),f=p,d=g);}}a=i.toElements(`${r}-px`);}else a=t.layers.map((i,c)=>jsx("path",{d:i.d,fill:Nt(o(i.color)),fillRule:"evenodd"},`${r}-${c}`));return jsx("g",{transform:`translate(${Et(n.x)} ${Et(n.y)}) scale(${Vc(n.scale)})`,children:a},r)}function rd(t){let{art:e,image:n,size:o,kinds:r,modules:a,fg:i,bg:c,t:s,margin:l,pixelSize:u}=t,m=Ba(e,n),f=Wc(e,n,m),d=Da(m.width,m.height,o,"contain"),p=Math.min(1,.3+1.4*s),h=I=>nn(c,I,p),g=Nt(c),b=Nt(i),_=[el(m,f,{x:(l+d.offsetX)*u,y:(l+d.offsetY)*u,scale:d.scale*u},h,"art-logo")],y=jc,M=(I,G)=>en((I+l)*u,(G+l)*u,(y+.4)*u,(y+.4)*u,1.2*u),C=ar(t.version,o).map(([I,G])=>en((I-2.5+l)*u,(G-2.5+l)*u,6*u,6*u,u*.8)).join("");_.push(jsx("path",{d:M(-0.4,-0.4)+M(o-y,-0.4)+M(-0.4,o-y)+C,fill:g},"art-plates"));let x=Qa(t.version),S=J(c),E=J(i),w=new Float32Array(o*o),R=new Float32Array(o*o),v=new Array(o*o);for(let I=0;I<o;I++)for(let G=0;G<o;G++){let q=I*o+G,O=r[q];if(O===Vt||O===jt){w[q]=O===jt&&a[I]?.[G]?E:S;continue}let z=1,et=0,St=0,ct=0,F=0;for(let H=0;H<4;H++)for(let W=0;W<4;W++){let Rt=G+(W+.5)/4,qe=I+(H+.5)/4,Ut=x(Rt,qe)?c:Hc(f,(Rt-d.offsetX)/d.scale,(qe-d.offsetY)/d.scale,c,p),ue=J(Ut);z=Math.min(z,ue),et+=ue,St+=Ut[0],ct+=Ut[1],F+=Ut[2];}w[q]=et/16,R[q]=z,v[q]=[St/16,ct/16,F/16];}let A=E+.08*(S-E),L=S-.04*(S-E),T=tl(t,w,w,{base:.74-.26*s,max:.9,dark:A,light:L,margin:.23-.1*s,cap:.4+.1*s,skip:s>=.7}),N=new rn;for(let I=0;I<o;I++)for(let G=0;G<o;G++){let q=I*o+G,O=T.diameter[q],z=!!a[I]?.[G];if(!(O>0)||!z&&R[q]>=S-.02)continue;let et=z?De(v[q],i,A,true):De(v[q],c,L,false);N.circle(Nt(et,8),(G+l+.5)*u,(I+l+.5)*u,O/2*u);}return _.push(...N.toElements("art-dot")),_.push(...Ua(t,b)),_}function ol(t,e,n){let o=e>=1?t:t*e,r=e>=1?t/e:t,a=Math.max(.7,t*.09),i=o+2*a,c=r+2*a;return {logoW:o,logoH:r,plateW:i,plateH:c,radius:Math.min(i,c)*.26,cx:n/2,cy:n/2}}function il(t,e,n){return cl(e+.5,n+.5,t)<rl}function sd(t,e){let n=al(t),o=rl+1,r=Math.max(0,Math.floor(t.cx-t.plateW/2-o)),a=Math.min(e-1,Math.ceil(t.cx+t.plateW/2+o)),i=Math.max(0,Math.floor(t.cy-t.plateH/2-o)),c=Math.min(e-1,Math.ceil(t.cy+t.plateH/2+o)),s=[];for(let l=i;l<=c;l++)for(let u=r;u<=a;u++)il(n,u,l)&&s.push(l*e+u);return s}function Ta(t,e,n){let o=ol(t,e,n.size),r=cd(n);return nr(n,sd(o,n.size)).every(a=>a<=r)}function sl(t,e,n){if(Ta(n,e,t))return n;let o=0,r=n;if(!Ta(o,e,t))return -1;for(;r-o>1/64;){let a=(o+r)/2;Ta(a,e,t)?o=a:r=a;}return o}function ld(t,e){let n=`${t.version}${t.level}:${e.toFixed(3)}`,o=Yr.get(n);return o===void 0&&(o=sl(t,e,nl*t.size),Yr.size>=64&&Yr.clear(),Yr.set(n,o)),o}function ud(t,e){let{size:n,t:o,modules:r,version:a}=t,i=D1(r),c=(.18+.15*o)*od[i],s=e.width/e.height,l=Math.min(nl,c)*n,u=er(a,i),m=Math.max(0,ld(u,s));if(m<id)return {wantedBox:l,maxBox:m,box:0,plate:null};let f=sl(u,s,Math.min(l,m));return f<0?{wantedBox:l,maxBox:m,box:0,plate:null}:{wantedBox:l,maxBox:m,box:f,plate:ol(f,s,n)}}function cl(t,e,n){let o=Math.abs(t-n.cx)-(n.w/2-n.r),r=Math.abs(e-n.cy)-(n.h/2-n.r);return Math.hypot(Math.max(o,0),Math.max(r,0))+Math.min(Math.max(o,r),0)-n.r}function ll(t,e){let{fg:n,bg:o,t:r}=t,a=J(n),i=J(o),c=Bc(e),s=Math.min(1,r/.6),l=c?De(c,n,a+.3*(i-a),true):n,u=nn(n,l,s),m=c?Bc(e,c):null,f=a+.42*(i-a),d=m&&J(m)<=f+.22?nn(n,De(m,n,f,true),s):u;return {body:u,inner:d}}function md(t){let{art:e,image:n,size:o,kinds:r,modules:a,bg:i,margin:c,pixelSize:s,version:l}=t,u=Ba(e,n),m=ud(t,u).plate,{body:f}=ll(t,u),d=Nt(f),p=m&&al(m),h=a.map(v=>[...v]);for(let v=0;v<o;v++)for(let A=0;A<o;A++){let L=r[v*o+A];(L===jt||p&&L!==Vt&&il(p,A,v))&&(h[v][A]=false);}let g=[],b=t.body?.(h);if(b)g.push(jsx("g",{fill:d,children:b},"art-body"));else {let v=new rn;for(let A=0;A<o;A++)for(let L=0;L<o;L++)h[A]?.[L]&&r[A*o+L]!==Vt&&v.circle(d,(L+c+.5)*s,(A+c+.5)*s,.45*s);g.push(...v.toElements("art-body"));}let _=ar(l,o).filter(([v,A])=>!p||cl(v+.5,A+.5,p)>3.2);if(_.length>0&&g.push(jsx("path",{d:Xc(_,c,s),fill:d,fillRule:"evenodd"},"art-alignment")),!m)return g;let y=Wc(e,n,u),M=(m.cx-m.plateW/2+c)*s,C=(m.cy-m.plateH/2+c)*s,x=m.plateW*s,S=m.plateH*s,E=m.radius*s,w=.1*s,R=en(M,C,x,S,E);return g.push(jsx("path",{d:R,fill:Nt(i)},"art-plate"),jsx("path",{d:R+en(M+w,C+w,x-2*w,S-2*w,E-w),fill:Nt(nn(i,f,.16)),fillRule:"evenodd"},"art-plate-ring"),el(u,y,{x:(m.cx-m.logoW/2+c)*s,y:(m.cy-m.logoH/2+c)*s,scale:m.logoW/u.width*s},v=>v,"art-logo")),g}function qa(t){let{art:e}=t;if(e.mode!=="logo"||e.matchEyes===false)return null;let n=e.image&&ka(e.image);if(!n)return null;let o=Nn(t.fgColor,[0,0,0]),r=Nn(t.bgColor,[1,1,1]),a=Yc(e,o,r);if(a<=0)return null;let i=Ba(e,n);if(i.palette.length===0)return null;if(Zr(e)==="badge"){let{body:p,inner:h}=ll({fg:o,bg:r,t:a},i),g={outer:Nt(p),inner:Nt(h)};return {topLeft:g,topRight:g,bottomLeft:g}}let c=J(o),s=J(r),l=Math.min(1,a/.6),u=t.version*4+17,m=Da(i.width,i.height,u,"contain"),f=.45*Math.max(i.width,i.height),d=(p,h)=>{let g=(p-m.offsetX)/m.scale,b=(h-m.offsetY)/m.scale,_=null,y=0;for(let C of i.palette){if(J(C.color)>.86)continue;let x=(C.cx-g)**2+(C.cy-b)**2,S=C.area*(.35+qc(C.color))*Math.exp(-x/(2*f**2));S>y&&(y=S,_=C.color);}if(!_)return {};let M=De(_,o,c+.42*(s-c),true);return {inner:Nt(nn(o,M,l))}};return {topLeft:d(3.5,3.5),topRight:d(u-3.5,3.5),bottomLeft:d(3.5,u-3.5)}}var Gc,Fa,kn,L1,N1,Vt,jt,Oe,kc,Nc,nn,qc,B1,Ia,Oa,Oc,Q1,U1,z1,H1,W1,Et,Vc,rn,X1,jr,jc,Dc,K1,od,nl,rl,ad,id,al,cd,Yr,za=U(()=>{"use strict";Nr();La();Vr();ht();Bt();Gc=.6,Fa={logo:160,halftone:160};kn=class{entries=new Map;limit;constructor(e){this.limit=e;}get(e,n){let o=this.entries.get(e);if(o!==void 0)return this.entries.delete(e),this.entries.set(e,o),o;let r=n();if(this.entries.size>=this.limit){let a=this.entries.keys().next().value;a!==void 0&&this.entries.delete(a);}return this.entries.set(e,r),r}},L1=new kn(8);N1=0,Vt=1,jt=2,Oe=3,kc=4,Nc=new Map;nn=(t,e,n)=>[t[0]+(e[0]-t[0])*n,t[1]+(e[1]-t[1])*n,t[2]+(e[2]-t[2])*n];qc=t=>Math.max(...t)-Math.min(...t),B1=(t,e)=>(t[0]-e[0])**2+(t[1]-e[1])**2+(t[2]-e[2])**2,Ia=t=>t.toString(16).padStart(2,"0");Oa=.3,Oc=t=>1-Math.exp(-((t/2)**2)/(2*Oa**2)),Q1=t=>G1(t/(2*Oa*Math.SQRT2))**2,U1=(t,e,n)=>{let o=Math.min(1,Math.max(0,(n-t)/(e-t)));return o*o*(3-2*o)};z1=new kn(4),H1=new kn(6),W1=new kn(6);Et=t=>st(t,2),Vc=t=>st(t,4),rn=class{groups=new Map;add(e,n){let o=this.groups.get(e);o?o.push(n):this.groups.set(e,[n]);}cellRun(e,n,o,r){this.add(e,`M${n} ${o}h${r}.04v1.04h-${r}.04z`);}circle(e,n,o,r){this.add(e,V1(n,o,r));}toElements(e){return [...this.groups].map(([n,o],r)=>jsx("path",{d:o.join(""),fill:n},`${e}-${r}`))}};X1={blend:1,badge:1,color:.9,mono:.7},jr=.35;jc=8.5,Dc=new Map;K1=t=>2*Oa*Math.sqrt(-2*Math.log(1-Math.min(t,.95)));od={L:.5,M:.72,Q:.88,H:1},nl=.32,rl=.55,ad=.6,id=2;al=t=>({cx:t.cx,cy:t.cy,w:t.plateW,h:t.plateH,r:t.radius});cd=t=>Math.floor(t.correctable*ad);Yr=new Map;});function ml(t){return dd.includes(t)}function Jr(t,e){if(t===void 0||!Number.isFinite(t))return 1;let n=e?dl[e]??1:tr;return Math.min(Gr,Math.max(tr,n,t))}function fd(t,e,n){return t<7&&e<7||t>=n-7&&e<7||t<7&&e>=n-7}function hd(t,e){if(t===1)return [];let n=Math.floor(t/7)+2,o=t===32?26:Math.ceil((t*4+4)/(n*2-2))*2,r=[6];for(let a=e-7;r.length<n;a-=o)r.splice(1,0,a);return r}function Ha(t){let e=(t-17)/4,n=Number.isInteger(e)?hd(e,t):[],o=n.length-1,r=[];for(let[a,i]of n.entries())for(let[c,s]of n.entries())a===0&&c===0||a===0&&c===o||a===o&&c===0||r.push([i,s]);return (a,i)=>r.some(([c,s])=>Math.abs(a-c)<=2&&Math.abs(i-s)<=2)}function gd(t,e,n,o,r,a){switch(t){case "horizontal-line":{let i=o*.43;return D(e-o/2,n-i,o,2*i)}case "leaf":{let i=o*.5;return D(e-i,n-i,2*i,2*i,[o*.4,o*.05,o*.4,o*.05])}case "plus":{let i=o*.22,c=o*.5;return tt([[e-i,n-c],[e+i,n-c],[e+i,n-i],[e+c,n-i],[e+c,n+i],[e+i,n+i],[e+i,n+c],[e-i,n+c],[e-i,n+i],[e-c,n+i],[e-c,n-i],[e-i,n-i]])}case "hexagon":return tt(En(e,n,o*.54,6));case "star":return tt(Rn(e,n+o*.04,o*.62,o*.34));case "heart":return Pn(e,n+o*.02,o*1.08);case "random-dots":return V(e,n,o*(.38+.15*Rr(r,a)));case "mosaic":{let i=o*(.8+.14*Rr(r,a,1))/2,c=[[e-i,n-i],[e+i,n-i],[e+i,n+i],[e-i,n+i]];return tt($s(c,e,n,(Rr(r,a,2)-.5)*16))}case "octagon":return tt(En(e,n,o*.48/Math.cos(Math.PI/8),8,22.5));default:return V(e,n,o*.45)}}function fl(t,e){let{margin:n,pixelSize:o,pattern:r}=e,a=Jr(e.scale,r),i=t.length,c=e.plain?()=>false:Ha(i),s=(h,g)=>!e.plain&&fd(h,g,i),l=(h,g)=>h>=0&&g>=0&&h<i&&g<i&&!!t[g]?.[h]&&!s(h,g),u=h=>(h+.5+n)*o,m=[],f=[],d=pd[r];for(let h=0;h<i;h++)for(let g=0;g<i;g++){if(!l(g,h))continue;let b=u(g),_=u(h);if(c(g,h)){m.push(P`M${b-o/2} ${_-o/2}h${o}v${o}h${-o}z`);continue}if(!d){f.push(gd(r,b,_,o*a,g,h));continue}let y=o*d.thickness*a/2,M=d.horizontal&&l(g+1,h),C=d.horizontal&&l(g-1,h),x=d.vertical&&l(g,h-1),S=d.vertical&&l(g,h+1),w=[!(x||C),!(x||M),!(S||M),!(S||C)].map((R,v)=>R?y*d.radius(v):0);f.push(D(b-y,_-y,2*y,2*y,w)),2*y<o&&(M&&f.push(D(b,_-y,o,2*y)),S&&f.push(D(b-y,_,2*y,o)));}if(d?.fillets&&a===1){let h=o*.3;for(let g=0;g<i;g++)for(let b=0;b<i;b++){if(l(b,g)||s(b,g))continue;let _=u(b)-o/2,y=u(g)-o/2,M=_+o,C=y+o;l(b-1,g)&&l(b,g-1)&&l(b-1,g-1)&&f.push(P`M${_} ${y}h${h}A${h} ${h} 0 0 0 ${_} ${y+h}Z`),l(b+1,g)&&l(b,g-1)&&l(b+1,g-1)&&f.push(P`M${M} ${y}v${h}A${h} ${h} 0 0 0 ${M-h} ${y}Z`),l(b+1,g)&&l(b,g+1)&&l(b+1,g+1)&&f.push(P`M${M} ${C}h${-h}A${h} ${h} 0 0 0 ${M} ${C-h}Z`),l(b-1,g)&&l(b,g+1)&&l(b-1,g+1)&&f.push(P`M${_} ${C}v${-h}A${h} ${h} 0 0 0 ${_+h} ${C}Z`);}}let p=[];return f.length>0&&p.push(jsx("path",{d:f.join("")},"modules")),m.length>0&&p.push(jsx("path",{d:m.join("")},"alignment")),p}var dd,dl,pd,Wa=U(()=>{"use strict";xe();ae();ht();dd=["horizontal-line","liquid","liquid-horizontal","liquid-vertical","classy","classy-rounded","leaf","plus","hexagon","star","heart","random-dots","mosaic","octagon"];dl={circle:.95,"circle-large":.85,square:.75,diamond:.95,pacman:.9,rounded:.75,"vertical-line":.8,liquid:.75,"liquid-horizontal":.85,"liquid-vertical":.85,classy:.7,"classy-rounded":.7,leaf:.75,plus:.8,hexagon:.75,star:.85,heart:.85,"random-dots":.85,mosaic:.8,octagon:.8};pd={liquid:{horizontal:!0,vertical:!0,thickness:1,radius:()=>1,fillets:!0},"liquid-horizontal":{horizontal:!0,vertical:!1,thickness:.86,radius:()=>1,fillets:!1},"liquid-vertical":{horizontal:!1,vertical:!0,thickness:.86,radius:()=>1,fillets:!1},classy:{horizontal:!0,vertical:!0,thickness:1,radius:t=>t===0||t===2?1:0,fillets:!1},"classy-rounded":{horizontal:!0,vertical:!0,thickness:1,radius:t=>t===0||t===2?1:.4,fillets:!1}};});function bd(t){return t==="top-left"?0:t==="top-right"?1:3}function Kr(t,e,n,o="circle",r="top-left"){let a=n*2,i=n,c=a/3;switch(o){case "leaf":case "leaf-reverse":case "drop":case "drop-reverse":{let s=bd(r),l=(s+2)%4,u=1.3*c,m=.7*c,f=p=>{switch(o){case "leaf":return p===s||p===l;case "leaf-reverse":return !(p===s||p===l);case "drop":return p===s;default:return p===l}},d=[0,1,2,3].map(p=>f(p)?m:u);return jsx("path",{d:D(t-n,e-n,a,a,d)})}case "extra-rounded":return jsx("path",{d:D(t-n,e-n,a,a,1.15*c)});case "plus":{let s=1.15*c,l=n;return jsx("path",{d:tt([[t-s,e-l],[t+s,e-l],[t+s,e-s],[t+l,e-s],[t+l,e+s],[t+s,e+s],[t+s,e+l],[t-s,e+l],[t-s,e+s],[t-l,e+s],[t-l,e-s],[t-s,e-s]])})}case "cross-rounded":{let s=1.15*c,l=.5*c;return jsx("path",{d:D(t-n,e-s,a,2*s,l)+D(t-s,e-n,2*s,a,l)})}case "hexagon":return jsx("path",{d:tt(En(t,e,1.72*c,6))});case "octagon":return jsx("path",{d:tt(En(t,e,n/Math.cos(Math.PI/8),8,22.5))});case "flower":{let s=.6*c,l=.9*c;return jsx("path",{d:V(t-s,e-s,l)+V(t+s,e-s,l)+V(t+s,e+s,l)+V(t-s,e+s,l)+V(t,e,1.2*c)})}case "heart":return jsx("path",{d:Pn(t,e+.12*c,3.5*c)});case "squircle":return jsx("path",{d:tt(Wn(t,e,n,n,4,64))});case "dots":{let s=[];for(let l of [-1,0,1])for(let u of [-1,0,1])s.push(V(t+u*c*.82,e+l*c*.82,.58*c));return jsx("path",{d:s.join("")})}case "square":return jsx("rect",{height:$(a),transform:P`rotate(0,${t},${e})`,width:$(a),x:$(t-i),y:$(e-i)});case "rounded":return jsx("rect",{height:$(a),rx:$(n*.5),ry:$(n*.5),transform:P`rotate(0,${t},${e})`,width:$(a),x:$(t-i),y:$(e-i)});case "diamond":return jsx("path",{d:P`M ${t-i*.714286} ${e-i*.714286}v ${a*.714286}h ${a*.714286}v -${a*.714286}z`,transform:P`rotate(45,${t},${e})`});case "message":{let s=a/30,l=f=>(f-40)*s+t,u=f=>(f-40)*s+e,m=P`M ${l(25)} ${u(35.714285714285715)}v ${8.571428571428571*s}a ${10.714285714285714*s} ${10.714285714285714*s}, 0, 0, 0, ${10.714285714285714*s} ${10.714285714285714*s}h ${19.285714285714285*s}v -${19.285714285714285*s}a ${10.714285714285714*s} ${10.714285714285714*s}, 0, 0, 0, -${10.714285714285714*s} -${10.714285714285714*s}h -${8.571428571428571*s}a ${10.714285714285714*s} ${10.714285714285714*s}, 0, 0, 0, -${10.714285714285714*s} ${10.714285714285714*s}`;return jsx("path",{clipRule:"evenodd",d:m,transform:P`rotate(0,${t},${e})`})}case "message-reverse":{let s=a/30,l=f=>(f-40)*s+t,u=f=>(f-40)*s+e,m=P`M ${l(25)} ${u(35.714285714285715)}v ${8.571428571428571*s}a ${10.714285714285714*s} ${10.714285714285714*s}, 0, 0, 0, ${10.714285714285714*s} ${10.714285714285714*s}h ${19.285714285714285*s}v -${19.285714285714285*s}a ${10.714285714285714*s} ${10.714285714285714*s}, 0, 0, 0, -${10.714285714285714*s} -${10.714285714285714*s}h -${8.571428571428571*s}a ${10.714285714285714*s} ${10.714285714285714*s}, 0, 0, 0, -${10.714285714285714*s} ${10.714285714285714*s}`;return jsx("path",{clipRule:"evenodd",d:m,transform:P`rotate(-180,${t},${e})`})}case "diya":{let s=a/30,l=f=>(f-40)*s+t,u=f=>(f-40)*s+e,m=P`M ${l(25)} ${u(35.714285714285715)}v ${8.571428571428571*s}a ${10.714285714285714*s} ${10.714285714285714*s}, 0, 0, 0, ${10.714285714285714*s} ${10.714285714285714*s}h ${19.285714285714285*s}v -${19.285714285714285*s}a ${10.714285714285714*s} ${10.714285714285714*s}, 0, 0, 0, -${10.714285714285714*s} -${10.714285714285714*s}h -${8.571428571428571*s}H ${l(25)}z`;return jsx("path",{clipRule:"evenodd",d:m,transform:P`rotate(0,${t},${e})`})}case "diya-reverse":{let s=a/30,l=f=>(f-40)*s+t,u=f=>(f-40)*s+e,m=P`M ${l(25)} ${u(35.714285714285715)}v ${19.285714285714285*s}h ${19.285714285714285*s}a ${10.714285714285714*s} ${10.714285714285714*s}, 0, 0, 0, ${10.714285714285714*s} -${10.714285714285714*s}v -${19.285714285714285*s}h -${19.285714285714285*s}a ${10.714285714285714*s} ${10.714285714285714*s}, 0, 0, 0, -${10.714285714285714*s} ${10.714285714285714*s}z`;return jsx("path",{clipRule:"evenodd",d:m,transform:P`rotate(0,${t},${e})`})}case "rounded-triangle":{let s=a/21,l=f=>(f-40)*s+t,u=f=>(f-40)*s+e,m=P`M ${l(33.57142857142857)} ${u(29.285714285714285)}h ${12.857142857142856*s}c ${4.285714285714286*s} 0 ${4.285714285714286*s} ${4.285714285714286*s} ${4.285714285714286*s} ${4.285714285714286*s}v ${12.857142857142856*s}c 0 ${4.285714285714286*s} -${4.285714285714286*s} ${4.285714285714286*s} -${4.285714285714286*s} ${4.285714285714286*s}h -${12.857142857142856*s}c -${4.285714285714286*s} 0 -${4.285714285714286*s} -${4.285714285714286*s} -${4.285714285714286*s} -${4.285714285714286*s}v -${12.857142857142856*s}c 0 -${4.285714285714286*s} ${4.285714285714286*s} -${4.285714285714286*s} ${4.285714285714286*s} -${4.285714285714286*s}z`;return jsx("path",{d:m,transform:P`rotate(45,${t},${e})`})}case "star":{let s=a/27,l=f=>(f-40)*s+t,u=f=>(f-40)*s+e,m=P`M ${l(38.84615384615385)},${u(26.546153846153846)}c${.6692307692307691*s},-${1.0153846153846153*s},${2.215384615384615*s},-${1.0153846153846153*s},${2.884615384615384*s},0l${4.038461538461538*s},${6.069230769230768*s}c${.23076923076923075*s},${.3461538461538461*s},${.6*s},${.6*s},${1.0153846153846153*s},${.7153846153846153*s}l${7.223076923076922*s},${1.823076923076923*s}c${1.2*s},${.3*s},${1.6846153846153844*s},${1.7076923076923076*s},${.8999999999999999*s},${2.6538461538461533*s}l-${4.73076923076923*s},${5.584615384615384*s}c-${.2769230769230769*s},${.3230769230769231*s},-${.41538461538461535*s},${.7384615384615384*s},-${.3923076923076923*s},${1.1307692307692307*s}l${.4384615384615384*s},${7.199999999999999*s}c${.06923076923076922*s},${1.2*s},-${1.1769230769230767*s},${2.0769230769230766*s},-${2.3307692307692305*s},${1.6384615384615382*s}l-${6.9692307692307685*s},-${2.6076923076923073*s}c-${.3923076923076923*s},-${.16153846153846155*s},-${.8538461538461538*s},-${.16153846153846155*s},-${1.2461538461538462*s},0l-${6.9692307692307685*s},${2.6076923076923073*s}c-${1.1538461538461537*s},${.4384615384615384*s},-${2.4*s},-${.4384615384615384*s},-${2.3307692307692305*s},-${1.6384615384615382*s}l${.4384615384615384*s},-${7.199999999999999*s}c${.023076923076923075*s},-${.41538461538461535*s},-${.11538461538461538*s},-${.8307692307692307*s},-${.3923076923076923*s},-${1.1307692307692307*s}l-${4.73076923076923*s},-${5.584615384615384*s}c-${.7846153846153846*s},-${.923076923076923*s},-${.3230769230769231*s},-${2.3307692307692305*s},${.8999999999999999*s},-${2.6538461538461533*s}l${7.223076923076922*s},-${1.823076923076923*s}c${.41538461538461535*s},-${.11538461538461538*s},${.7846153846153846*s},-${.3461538461538461*s},${1.0153846153846153*s},-${.7153846153846153*s}l${4.038461538461538*s},-${6.069230769230768*s}z`;return jsx("path",{clipRule:"evenodd",d:m,transform:P`rotate(0,${t},${e})`})}case "banner":{let s=a/28;return jsx("g",{transform:P`translate(${t-40*s},${e-40*s}) scale(${$(s,6)})`,children:jsx("path",{clipRule:"evenodd",d:"M38.235 26.104C38.759 25.677, 39.51 25.677, 40.034 26.104L41.776 27.52C42.091 27.777, 42.501 27.887, 42.902 27.822L45.118 27.466C45.785 27.359, 46.436 27.735, 46.677 28.366L47.477 30.464C47.621 30.843, 47.921 31.143, 48.301 31.288L50.399 32.088C51.03 32.328, 51.406 32.979, 51.298 33.646L50.942 35.863C50.878 36.264, 50.988 36.674, 51.244 36.989L52.661 38.73C53.087 39.254, 53.087 40.006, 52.661 40.53L51.244 42.271C50.988 42.587, 50.878 42.996, 50.942 43.397L51.298 45.614C51.406 46.281, 51.03 46.932, 50.399 47.173L48.301 47.972C47.921 48.117, 47.621 48.417, 47.477 48.797L46.677 50.894C46.436 51.526, 45.785 51.901, 45.118 51.794L42.902 51.438C42.501 51.374, 42.091 51.483, 41.776 51.74L40.034 53.157C39.51 53.583, 38.759 53.583, 38.235 53.157L36.493 51.74C36.178 51.483, 35.768 51.374, 35.367 51.438L33.15 51.794C32.483 51.901, 31.833 51.526, 31.592 50.894L30.792 48.797C30.647 48.417, 30.347 48.117, 29.968 47.972L27.87 47.173C27.239 46.932, 26.863 46.281, 26.97 45.614L27.326 43.397C27.391 42.996, 27.281 42.587, 27.025 42.271L25.608 40.53C25.182 40.006, 25.182 39.254, 25.608 38.73L27.025 36.989C27.281 36.674, 27.391 36.264, 27.326 35.863L26.97 33.646C26.863 32.979, 27.239 32.328, 27.87 32.088L29.968 31.288C30.347 31.143, 30.647 30.843, 30.792 30.464L31.592 28.366C31.833 27.735, 32.483 27.359, 33.15 27.466L35.367 27.822C35.768 27.887, 36.178 27.777, 36.493 27.52L38.235 26.104Z"})})}default:return jsx("circle",{cx:$(t),cy:$(e),r:$(n),transform:P`rotate(0,${t},${e})`})}}var hl=U(()=>{"use strict";ae();ht();});function On(t,e,n,o){let r=t==="top-left"?0:t==="top-right"?1:3,a=(r+2)%4;return [0,1,2,3].map(i=>i===r||o&&i===a?n:e)}function pl(t,e,n,o){return [[t+o,e],[t+n-o,e],[t+n,e+o],[t+n,e+n-o],[t+n-o,e+n],[t+o,e+n],[t,e+n-o],[t,e+o]]}function gl(t,e,n,o){let r=n/7,a=Math.max(0,(o+Math.SQRT2-2)*r);return tt(pl(t,e,n,o*r))+tt(pl(t+r,e+r,5*r,a))}function bl(t,e,n,o,r=false){let a=n/7,i=c=>r?On(o,0,c,true):On(o,c,0,true);return D(t,e,n,n,i(2.5*a))+D(t+a,e+a,5*a,5*a,i(1.5*a))}function _d(t,e,n,o){let r=n/7;return D(t,e,n,n,On(o,2.6*r,0,false))+D(t+r,e+r,5*r,5*r,On(o,1.6*r,0,false))}function yd(t,e,n){let o=n/7,r=t+n/2,a=e+n/2;return tt(Wn(r,a,3.5*o,3.5*o,4,96))+tt(Wn(r,a,2.5*o,2.5*o,4,96))}function _l(t,e,n,o,r){let a=o,i=n/2,c=(i-a)*.55,s=(l,u)=>P`${t+l} ${e+u}`;return P`M${s(a,0)}`+P`C${s(a+c,0)} ${s(i-c,r)} ${s(i,r)}`+P`C${s(i+c,r)} ${s(n-a-c,0)} ${s(n-a,0)}`+P`A${a} ${a} 0 0 1 ${s(n,a)}`+P`C${s(n,a+c)} ${s(n-r,i-c)} ${s(n-r,i)}`+P`C${s(n-r,i+c)} ${s(n,n-a-c)} ${s(n,n-a)}`+P`A${a} ${a} 0 0 1 ${s(n-a,n)}`+P`C${s(n-a-c,n)} ${s(i+c,n-r)} ${s(i,n-r)}`+P`C${s(i-c,n-r)} ${s(a+c,n)} ${s(a,n)}`+P`A${a} ${a} 0 0 1 ${s(0,n-a)}`+P`C${s(0,n-a-c)} ${s(r,i+c)} ${s(r,i)}`+P`C${s(r,i-c)} ${s(0,a+c)} ${s(0,a)}`+P`A${a} ${a} 0 0 1 ${s(a,0)}Z`}function $d(t,e,n){let o=n/7,r=.12*o;return _l(t,e,n,1.4*o,r)+_l(t+o,e+o,5*o,.7*o,r)}function yl(t,e,n,o,r,a){let i=n/2,c=(s,l)=>P`${t+s} ${e+l}`;return P`M${c(o,0)}H${t+n-o}`+P`A${o} ${o} 0 0 1 ${c(n,o)}`+P`V${e+r}`+P`C${c(n,r+1.55*a)} ${c(i+1.6*a,n)} ${c(i,n)}`+P`C${c(i-1.6*a,n)} ${c(0,r+1.55*a)} ${c(0,r)}`+P`V${e+o}A${o} ${o} 0 0 1 ${c(o,0)}Z`}function xd(t,e,n){let o=n/7;return yl(t,e,n,.7*o,3.9*o,o)+yl(t+o,e+o,5*o,.35*o,2.7*o,.8*o)}function Sd(t,e,n,o){let r=n/7;return D(t,e,n,n,On(o,.5*r,2.5*r,false))+D(t+r,e+r,5*r,5*r,On(o,.25*r,1.5*r,false))}function Md(t,e,n){let o=n/7;return P`M ${t} ${e}v ${n}h ${n}v -${n}z`+P`M ${t+o} ${e+o}h ${5*o}v ${5*o}h -${5*o}z`}function Cd(t,e,n){let o=n/7,r=o*.875,a=o*.4375,i=P`M ${t+r} ${e}`+P`h ${n-2*r}`+P`a ${r} ${r} 0 0 1 ${r} ${r}`+P`v ${n-2*r}`+P`a ${r} ${r} 0 0 1 ${-r} ${r}`+P`h ${-(n-2*r)}`+P`a ${r} ${r} 0 0 1 ${-r} ${-r}`+P`v ${-(n-2*r)}`+P`a ${r} ${r} 0 0 1 ${r} ${-r}z`,c=P`M ${t+o+a} ${e+o}`+P`h ${5*o-2*a}`+P`a ${a} ${a} 0 0 1 ${a} ${a}`+P`v ${5*o-2*a}`+P`a ${a} ${a} 0 0 1 ${-a} ${a}`+P`h ${-(5*o-2*a)}`+P`a ${a} ${a} 0 0 1 ${-a} ${-a}`+P`v ${-(5*o-2*a)}`+P`a ${a} ${a} 0 0 1 ${a} ${-a}z`;return i+c}function wd(t,e,n){let o=t+n/2,r=e+n/2,a=st(n/2),i=st(n*(2.5/7));return P`M ${o-a} ${r}`+P`a ${a} ${a} 0 1 0 ${a*2} 0`+P`a ${a} ${a} 0 1 0 ${-a*2} 0z`+P`M ${o-i} ${r}`+P`a ${i} ${i} 0 1 1 ${i*2} 0`+P`a ${i} ${i} 0 1 1 ${-i*2} 0z`}function Ed(t,e,n){let o=n/74.7002,r=c=>c*o+t,a=c=>c*o+e;return P`M${r(37.3496)} ${a(0)}C${r(39.2939)} ${a(0)} ${r(40.9948)} ${a(1.03842)} ${r(41.9287)} ${a(2.59082)}C${r(43.2293)} ${a(1.34013)} ${r(45.1347)} ${a(.780267)} ${r(47.0098)} ${a(1.28027)}C${r(48.8871)} ${a(1.78928)} ${r(50.261)} ${a(3.23767)} ${r(50.7578)} ${a(4.98438)}C${r(52.3454)} ${a(4.0996)} ${r(54.3432)} ${a(4.047)} ${r(56.0303)} ${a(5.01953)}C${r(57.7094)} ${a(5.98752)} ${r(58.6586)} ${a(7.73647)} ${r(58.6924)} ${a(9.5459)}C${r(60.4517)} ${a(9.10661)} ${r(62.3883)} ${a(9.57215)} ${r(63.7598)} ${a(10.9502)}C${r(65.1282)} ${a(12.3253)} ${r(65.5963)} ${a(14.2585)} ${r(65.1641)} ${a(16.0127)}C${r(66.974)} ${a(16.044)} ${r(68.7242)} ${a(16.9982)} ${r(69.7002)} ${a(18.6797)}C${r(70.6781)} ${a(20.3647)} ${r(70.6241)} ${a(22.3635)} ${r(69.7402)} ${a(23.9502)}C${r(71.4776)} ${a(24.4496)} ${r(72.9194)} ${a(25.8232)} ${r(73.4199)} ${a(27.7002)}C${r(73.927)} ${a(29.5707)} ${r(73.3661)} ${a(31.4794)} ${r(72.1104)} ${a(32.7822)}C${r(73.6621)} ${a(33.7163)} ${r(74.7002)} ${a(35.4166)} ${r(74.7002)} ${a(37.3604)}C${r(74.7001)} ${a(39.307)} ${r(73.6582)} ${a(41.0084)} ${r(72.1025)} ${a(41.9414)}C${r(73.357)} ${a(43.245)} ${r(73.9207)} ${a(45.1525)} ${r(73.4199)} ${a(47.0303)}C${r(72.9187)} ${a(48.9027)} ${r(71.4782)} ${a(50.2735)} ${r(69.7383)} ${a(50.7734)}C${r(70.6201)} ${a(52.3601)} ${r(70.6716)} ${a(54.3549)} ${r(69.7002)} ${a(56.04)}C${r(68.7237)} ${a(57.7225)} ${r(66.9721)} ${a(58.6729)} ${r(65.1611)} ${a(58.7031)}C${r(65.598)} ${a(60.4623)} ${r(65.131)} ${a(62.3982)} ${r(63.7598)} ${a(63.7695)}C${r(62.3847)} ${a(65.138)} ${r(60.4515)} ${a(65.6061)} ${r(58.6973)} ${a(65.1738)}C${r(58.6635)} ${a(66.9833)} ${r(57.7094)} ${a(68.7322)} ${r(56.0303)} ${a(69.7002)}C${r(54.3461)} ${a(70.6777)} ${r(52.348)} ${a(70.6248)} ${r(50.7617)} ${a(69.7422)}C${r(50.2643)} ${a(71.4831)} ${r(48.8896)} ${a(72.9284)} ${r(47.0098)} ${a(73.4297)}C${r(45.1389)} ${a(73.9368)} ${r(43.2296)} ${a(73.3763)} ${r(41.9268)} ${a(72.1201)}C${r(40.9927)} ${a(73.6717)} ${r(39.2932)} ${a(74.71)} ${r(37.3496)} ${a(74.71)}C${r(35.4051)} ${a(74.7098)} ${r(33.7042)} ${a(73.6711)} ${r(32.7705)} ${a(72.1182)}C${r(31.4697)} ${a(73.3758)} ${r(29.5597)} ${a(73.9418)} ${r(27.6797)} ${a(73.4404)}V${a(73.4502)}C${r(25.8065)} ${a(72.9422)} ${r(24.434)} ${a(71.4985)} ${r(23.9346)} ${a(69.7568)}C${r(22.3504)} ${a(70.6301)} ${r(20.3591)} ${a(70.6781)} ${r(18.6797)} ${a(69.71)}C${r(16.9957)} ${a(68.7391)} ${r(16.045)} ${a(66.9831)} ${r(16.0166)} ${a(65.168)}C${r(14.2547)} ${a(65.6091)} ${r(12.3134)} ${a(65.1435)} ${r(10.9395)} ${a(63.7695)}C${r(9.5687)} ${a(62.3919)} ${r(9.10168)} ${a(60.454)} ${r(9.53809)} ${a(58.6973)}C${r(7.72791)} ${a(58.6641)} ${r(5.97815)} ${a(57.71)} ${r(5.00977)} ${a(56.0303)}C${r(4.03552)} ${a(54.3517)} ${r(4.08377)} ${a(52.3649)} ${r(4.95801)} ${a(50.7812)}C${r(3.21705)} ${a(50.2839)} ${r(1.77087)} ${a(48.9101)} ${r(1.26953)} ${a(47.0303)}V${a(47.0205)}C${r(.762081)} ${a(45.1489)} ${r(1.32758)} ${a(43.2375)} ${r(2.58496)} ${a(41.9346)}C${r(1.03604)} ${a(41)} ${r(108484e-9)} ${a(39.3019)} ${r(0)} ${a(37.3604)}C${r(0)} ${a(35.4159)} ${r(1.03815)} ${a(33.7141)} ${r(2.59082)} ${a(32.7803)}C${r(1.34044)} ${a(31.4797)} ${r(.780389)} ${a(29.575)} ${r(1.28027)} ${a(27.7002)}C${r(1.78258)} ${a(25.8232)} ${r(3.22806)} ${a(24.4482)} ${r(4.97363)} ${a(23.9512)}C${r(4.08938)} ${a(22.3638)} ${r(4.03743)} ${a(20.3664)} ${r(5.00977)} ${a(18.6797)}C${r(5.97815)} ${a(16.9999)} ${r(7.72788)} ${a(16.0496)} ${r(9.53809)} ${a(16.0166)}C${r(9.10139)} ${a(14.2576)} ${r(9.56846)} ${a(12.3214)} ${r(10.9395)} ${a(10.9502)}C${r(12.3171)} ${a(9.57911)} ${r(14.2558)} ${a(9.11137)} ${r(16.0127)} ${a(9.54785)}C${r(16.0426)} ${a(7.73421)} ${r(16.9969)} ${a(5.97989)} ${r(18.6797)} ${a(5.00977)}C${r(20.3596)} ${a(4.03474)} ${r(22.3521)} ${a(4.08468)} ${r(23.9365)} ${a(4.96094)}C${r(24.4378)} ${a(3.22749)} ${r(25.8059)} ${a(1.7898)} ${r(27.6797)} ${a(1.29004)}C${r(29.5511)} ${a(.78264)} ${r(31.4617)} ${a(1.34357)} ${r(32.7646)} ${a(2.60059)}C${r(33.6971)} ${a(1.04268)} ${r(35.4013)} ${a(152405e-9)} ${r(37.3496)} ${a(0)}ZM${r(41.0615)} ${a(9.17578)}C${r(40.1006)} ${a(10.1057)} ${r(38.793)} ${a(10.6797)} ${r(37.3496)} ${a(10.6797)}C${r(35.9064)} ${a(10.6796)} ${r(34.5985)} ${a(10.1066)} ${r(33.6377)} ${a(9.17676)}C${r(32.9511)} ${a(10.3241)} ${r(31.8358)} ${a(11.2176)} ${r(30.4404)} ${a(11.5898)}C${r(29.0527)} ${a(11.9661)} ${r(27.6436)} ${a(11.7542)} ${r(26.4766)} ${a(11.1074)}C${r(26.1072)} ${a(12.3879)} ${r(25.2629)} ${a(13.5333)} ${r(24.0195)} ${a(14.25)}C${r(22.7695)} ${a(14.9754)} ${r(21.347)} ${a(15.1322)} ${r(20.0479)} ${a(14.8047)}C${r(20.0289)} ${a(16.1454)} ${r(19.5108)} ${a(17.4793)} ${r(18.4902)} ${a(18.5)}C${r(17.4696)} ${a(19.5158)} ${r(16.1409)} ${a(20.033)} ${r(14.8066)} ${a(20.0566)}C${r(15.1312)} ${a(21.3534)} ${r(14.9738)} ${a(22.7723)} ${r(14.25)} ${a(24.0195)}C${r(13.5243)} ${a(25.2699)} ${r(12.3701)} ${a(26.1148)} ${r(11.082)} ${a(26.4795)}C${r(11.7347)} ${a(27.6479)} ${r(11.9529)} ${a(29.062)} ${r(11.5801)} ${a(30.46)}C${r(11.2085)} ${a(31.8485)} ${r(10.3194)} ${a(32.9607)} ${r(9.17578)} ${a(33.6475)}C${r(10.106)} ${a(34.6084)} ${r(10.6797)} ${a(35.9167)} ${r(10.6797)} ${a(37.3604)}C${r(10.6796)} ${a(38.805)} ${r(10.1053)} ${a(40.1141)} ${r(9.17383)} ${a(41.0752)}C${r(10.3132)} ${a(41.7614)} ${r(11.1999)} ${a(42.871)} ${r(11.5703)} ${a(44.2598)}C${r(11.946)} ${a(45.6504)} ${r(11.7335)} ${a(47.0592)} ${r(11.0889)} ${a(48.2266)}C${r(12.377)} ${a(48.593)} ${r(13.5297)} ${a(49.441)} ${r(14.25)} ${a(50.6904)}C${r(14.9754)} ${a(51.9405)} ${r(15.1322)} ${a(53.3629)} ${r(14.8047)} ${a(54.6621)}C${r(16.142)} ${a(54.6835)} ${r(17.4721)} ${a(55.2016)} ${r(18.4902)} ${a(56.2197)}C${r(19.5097)} ${a(57.2441)} ${r(20.0278)} ${a(58.5787)} ${r(20.0479)} ${a(59.918)}C${r(21.3469)} ${a(59.5917)} ${r(22.7696)} ${a(59.7493)} ${r(24.0195)} ${a(60.4697)}C${r(25.2676)} ${a(61.1892)} ${r(26.1117)} ${a(62.3406)} ${r(26.4775)} ${a(63.627)}C${r(27.6424)} ${a(62.9822)} ${r(29.0498)} ${a(62.7688)} ${r(30.4404)} ${a(63.1396)}C${r(31.8284)} ${a(63.5112)} ${r(32.9402)} ${a(64.3999)} ${r(33.627)} ${a(65.543)}C${r(34.5887)} ${a(64.6072)} ${r(35.9012)} ${a(64.0304)} ${r(37.3496)} ${a(64.0303)}C${r(38.7912)} ${a(64.0303)} ${r(40.098)} ${a(64.6023)} ${r(41.0586)} ${a(65.5303)}C${r(41.7458)} ${a(64.3887)} ${r(42.8594)} ${a(63.5007)} ${r(44.25)} ${a(63.1299)}C${r(45.643)} ${a(62.7522)} ${r(47.057)} ${a(62.9676)} ${r(48.2266)} ${a(63.6201)}C${r(48.5931)} ${a(62.3323)} ${r(49.4413)} ${a(61.1801)} ${r(50.6904)} ${a(60.46)}C${r(51.9373)} ${a(59.7364)} ${r(53.3558)} ${a(59.5781)} ${r(54.6523)} ${a(59.9023)}C${r(54.6744)} ${a(58.5659)} ${r(55.1925)} ${a(57.2372)} ${r(56.21)} ${a(56.2197)}C${r(57.2339)} ${a(55.2007)} ${r(58.5676)} ${a(54.6816)} ${r(59.9062)} ${a(54.6611)}C${r(59.5835)} ${a(53.3649)} ${r(59.7414)} ${a(51.9468)} ${r(60.46)} ${a(50.7002)}C${r(61.1797)} ${a(49.4517)} ${r(62.3312)} ${a(48.6068)} ${r(63.6182)} ${a(48.2412)}C${r(62.9651)} ${a(47.0726)} ${r(62.7473)} ${a(45.658)} ${r(63.1201)} ${a(44.2598)}C${r(63.4916)} ${a(42.8718)} ${r(64.3794)} ${a(41.7591)} ${r(65.5225)} ${a(41.0723)}C${r(64.5929)} ${a(40.1115)} ${r(64.0206)} ${a(38.8033)} ${r(64.0205)} ${a(37.3604)}C${r(64.0205)} ${a(35.9186)} ${r(64.5915)} ${a(34.611)} ${r(65.5195)} ${a(33.6504)}C${r(64.3785)} ${a(32.9631)} ${r(63.4908)} ${a(31.8501)} ${r(63.1201)} ${a(30.46)}C${r(62.7421)} ${a(29.0656)} ${r(62.9572)} ${a(27.6498)} ${r(63.6113)} ${a(26.4795)}C${r(62.3272)} ${a(26.1115)} ${r(61.1784)} ${a(25.2657)} ${r(60.46)} ${a(24.0195)}C${r(59.7364)} ${a(22.7727)} ${r(59.5781)} ${a(21.3541)} ${r(59.9023)} ${a(20.0576)}C${r(58.5626)} ${a(20.038)} ${r(57.23)} ${a(19.52)} ${r(56.21)} ${a(18.5)}C${r(55.1931)} ${a(17.4783)} ${r(54.675)} ${a(16.1482)} ${r(54.6523)} ${a(14.8125)}C${r(53.3557)} ${a(15.1357)} ${r(51.9374)} ${a(14.9785)} ${r(50.6904)} ${a(14.2598)}C${r(49.4399)} ${a(13.5339)} ${r(48.5931)} ${a(12.3801)} ${r(48.2285)} ${a(11.0918)}C${r(47.0603)} ${a(11.7439)} ${r(45.6474)} ${a(11.9624)} ${r(44.25)} ${a(11.5898)}V${a(11.5801)}C${r(42.8613)} ${a(11.2085)} ${r(41.7483)} ${a(10.3196)} ${r(41.0615)} ${a(9.17578)}Z`}function Va(t){let e=t/70;return {scale:e,transform:(o,r)=>(o-5)*e+r}}function Rd(t,e,n){let{scale:o,transform:r}=Va(n);return P`M ${r(5,t)} ${r(30,e)}v ${20*o}a ${25*o} ${25*o}, 0, 0, 0, ${25*o} ${25*o}h ${45*o}v -${45*o}a ${25*o} ${25*o}, 0, 0, 0, -${25*o} -${25*o}h -${20*o}H ${r(5,t)}zM ${r(30,t)} ${r(15,e)}h ${20*o}a ${15*o} ${15*o}, 0, 0, 1, ${15*o} ${15*o}v ${35*o}h -${35*o}a ${15*o} ${15*o}, 0, 0, 1, -${15*o} -${15*o}v -${35*o}z`}function Pd(t,e,n){let o=n/7,r=o*1.5,a=o*.75,i=P`M ${t+r} ${e}`+P`h ${n-2*r}`+P`a ${r} ${r} 0 0 1 ${r} ${r}`+P`v ${n-2*r}`+P`a ${r} ${r} 0 0 1 ${-r} ${r}`+P`h ${-(n-2*r)}`+P`a ${r} ${r} 0 0 1 ${-r} ${-r}`+P`v ${-(n-2*r)}`+P`a ${r} ${r} 0 0 1 ${r} ${-r}z`,c=P`M ${t+o+a} ${e+o}`+P`h ${5*o-2*a}`+P`a ${a} ${a} 0 0 1 ${a} ${a}`+P`v ${5*o-2*a}`+P`a ${a} ${a} 0 0 1 ${-a} ${a}`+P`h ${-(5*o-2*a)}`+P`a ${a} ${a} 0 0 1 ${-a} ${-a}`+P`v ${-(5*o-2*a)}`+P`a ${a} ${a} 0 0 1 ${a} ${-a}z`;return i+c}function Ad(t,e,n){let{scale:o,transform:r}=Va(n);return P`M ${r(5,t)} ${r(40,e)}a ${35*o} ${35*o}, 0, 0, 0, ${35*o} ${35*o}h ${30*o}a ${5*o} ${5*o}, 0, 0, 0, ${5*o} -${5*o}v -${30*o}a ${35*o} ${35*o}, 0, 0, 0, -${35*o} -${35*o}a ${35*o} ${35*o}, 0, 0, 0, -${35*o} ${35*o}zM ${r(40,t)} ${r(15,e)}a ${25*o} ${25*o}, 0, 0, 1, ${25*o} ${25*o}v ${25*o}h -${25*o}a ${25*o} ${25*o}, 0, 0, 1, -${25*o} -${25*o}a ${25*o} ${25*o}, 0, 0, 1, ${25*o} -${25*o}z`}function vd(t,e,n){let{scale:o,transform:r}=Va(n);return P`M ${r(5,t)} ${r(30,e)}v ${20*o}a ${25*o} ${25*o}, 0, 0, 0, ${25*o} ${25*o}h ${45*o}v -${45*o}a ${25*o} ${25*o}, 0, 0, 0, -${25*o} -${25*o}h -${20*o}a ${25*o} ${25*o}, 0, 0, 0, -${25*o} ${25*o}M ${r(30,t)} ${r(15,e)}h ${20*o}a ${15*o} ${15*o}, 0, 0, 1, ${15*o} ${15*o}v ${35*o}h -${35*o}a ${15*o} ${15*o}, 0, 0, 1, -${15*o} -${15*o}v -${20*o}a ${15*o} ${15*o}, 0, 0, 1, ${15*o} -${15*o}z`}function Ld(t,e,n){let o=n/70,r=t+n/2-40*o,a=e+n/2-40*o,i=(s,l)=>s*o+l;return P`M${i(35.19239999999999,r)} ${i(5.837547376725838,a)}C${i(37.69667692307692,r)} ${i(3.8737070690335305,a)}, ${i(41.218430769230764,r)} ${i(3.8737092228796843,a)}, ${i(43.722707692307694,r)} ${i(5.837547376725838,a)}L${i(46.62781538461539,r)} ${i(8.115648915187375,a)}L${i(50.23356923076923,r)} ${i(7.32361506903353,a)}C${i(53.342,r)} ${i(6.640824299802762,a)}, ${i(56.51483076923077,r)} ${i(8.168784299802759,a)}, ${i(57.91892307692308,r)} ${i(11.024719684418145,a)}L${i(59.54787692307692,r)} ${i(14.337679684418145,a)}L${i(63.14027692307692,r)} ${i(15.188578145956608,a)}C${i(66.23707692307693,r)} ${i(15.922091992110452,a)}, ${i(68.43270769230769,r)} ${i(18.675396607495067,a)}, ${i(68.45876923076924,r)} ${i(21.857768915187375,a)}L${i(68.48892307692307,r)} ${i(25.54931045364891,a)}L${i(71.35633846153846,r)} ${i(27.874602761341222,a)}C${i(73.82830769230769,r)} ${i(29.879187376725838,a)}, ${i(74.61187692307692,r)} ${i(33.312418145956606,a)}, ${i(73.25452307692306,r)} ${i(36.19103353057199,a)}L${i(71.68006153846153,r)} ${i(39.530141222879685,a)}L${i(73.25452307692306,r)} ${i(42.86924891518738,a)}C${i(74.61187692307692,r)} ${i(45.747864299802764,a)}, ${i(73.82830769230769,r)} ${i(49.18109506903353,a)}, ${i(71.35633846153846,r)} ${i(51.18567968441815,a)}L${i(68.48892307692307,r)} ${i(53.510971992110456,a)}L${i(68.45876923076924,r)} ${i(57.202664299802755,a)}C${i(68.43270769230769,r)} ${i(60.38497199211046,a)}, ${i(66.23707692307693,r)} ${i(63.13823353057199,a)}, ${i(63.14027692307692,r)} ${i(63.871833530572,a)}L${i(59.54787692307692,r)} ${i(64.72260276134121,a)}L${i(57.91892307692308,r)} ${i(68.03564891518737,a)}C${i(56.51483076923077,r)} ${i(70.89164891518737,a)}, ${i(53.342,r)} ${i(72.41958737672583,a)}, ${i(50.23356923076923,r)} ${i(71.7368181459566,a)}L${i(46.62781538461539,r)} ${i(70.94463353057199,a)}L${i(43.722707692307694,r)} ${i(73.22275660749506,a)}C${i(41.218430769230764,r)} ${i(75.18663353057198,a)}, ${i(37.69667692307692,r)} ${i(75.18663353057198,a)}, ${i(35.19239999999999,r)} ${i(73.22275660749506,a)}L${i(32.28729230769231,r)} ${i(70.94463353057199,a)}L${i(28.68153846153846,r)} ${i(71.7368181459566,a)}C${i(25.573215384615384,r)} ${i(72.41958737672583,a)}, ${i(22.400384615384613,r)} ${i(70.89164891518737,a)}, ${i(20.996141538461536,r)} ${i(68.03564891518737,a)}L${i(19.36720923076923,r)} ${i(64.72260276134121,a)}L${i(15.774852307692306,r)} ${i(63.871833530572,a)}C${i(12.67803076923077,r)} ${i(63.13823353057199,a)}, ${i(10.48237846153846,r)} ${i(60.38497199211046,a)}, ${i(10.45636,r)} ${i(57.202664299802755,a)}L${i(10.426163076923077,r)} ${i(53.510971992110456,a)}L${i(7.558747692307692,r)} ${i(51.18567968441815,a)}C${i(5.086880338461539,r)} ${i(49.18109506903353,a)}, ${i(4.303258769230769,r)} ${i(45.747864299802764,a)}, ${i(5.660599692307692,r)} ${i(42.86924891518738,a)}L${i(7.235153846153846,r)} ${i(39.530141222879685,a)}L${i(5.660599692307692,r)} ${i(36.19103353057199,a)}C${i(4.3032566153846155,r)} ${i(33.312418145956606,a)}, ${i(5.086885938461538,r)} ${i(29.879187376725838,a)}, ${i(7.558747692307692,r)} ${i(27.874602761341222,a)}L${i(10.426163076923077,r)} ${i(25.54931045364891,a)}L${i(10.45636,r)} ${i(21.857768915187375,a)}C${i(10.48237846153846,r)} ${i(18.67537506903353,a)}, ${i(12.678052307692308,r)} ${i(15.922091992110452,a)}, ${i(15.774852307692306,r)} ${i(15.188578145956608,a)}L${i(19.36720923076923,r)} ${i(14.337679684418145,a)}L${i(20.996141538461536,r)} ${i(11.024719684418145,a)}C${i(22.400384615384613,r)} ${i(8.168784299802759,a)}, ${i(25.573215384615384,r)} ${i(6.640824299802762,a)}, ${i(28.68153846153846,r)} ${i(7.32361506903353,a)}L${i(32.28729230769231,r)} ${i(8.115648915187375,a)}L${i(35.19239999999999,r)} ${i(5.837547376725838,a)}M${i(39.45766153846154,r)} ${i(13.665055069033532,a)}L${i(37.01498461538461,r)} ${i(15.58053506903353,a)}C${i(35.39098461538461,r)} ${i(16.854061222879682,a)}, ${i(33.282799999999995,r)} ${i(17.335251992110454,a)}, ${i(31.26701538461538,r)} ${i(16.892464299802757,a)}L${i(28.235046153846152,r)} ${i(16.22649506903353,a)}L${i(26.865415384615382,r)} ${i(19.012107376725837,a)}C${i(25.954812307692308,r)} ${i(20.864178145956608,a)}, ${i(24.264193846153844,r)} ${i(22.212399684418145,a)}, ${i(22.255926153846154,r)} ${i(22.688076607495066,a)}L${i(19.235393846153844,r)} ${i(23.40354122287968,a)}L${i(19.21,r)} ${i(26.507556607495065,a)}C${i(19.19313538461538,r)} ${i(28.57137199211045,a)}, ${i(18.25492,r)} ${i(30.519525838264297,a)}, ${i(16.651919999999997,r)} ${i(31.81937199211045,a)}L${i(14.240926153846154,r)} ${i(33.774633530572,a)}L${i(15.564830769230769,r)} ${i(36.58238737672584,a)}C${i(16.445064615384617,r)} ${i(38.44891045364892,a)}, ${i(16.445064615384617,r)} ${i(40.611371992110456,a)}, ${i(15.564830769230769,r)} ${i(42.47811045364892,a)}L${i(14.240926153846154,r)} ${i(45.28564891518738,a)}L${i(16.651919999999997,r)} ${i(47.240910453648915,a)}L${i(13.883236923076923,r)} ${i(50.654971992110454,a)}L${i(16.651919999999997,r)} ${i(47.240910453648915,a)}C${i(18.25492,r)} ${i(48.54075660749507,a)}, ${i(19.19313538461538,r)} ${i(50.4891258382643,a)}, ${i(19.21,r)} ${i(52.5527258382643,a)}L${i(19.235393846153844,r)} ${i(55.65684891518738,a)}L${i(22.255926153846154,r)} ${i(56.37235660749507,a)}C${i(24.264193846153844,r)} ${i(56.847925838264295,a)}, ${i(25.954812307692308,r)} ${i(58.196233530571995,a)}, ${i(26.865415384615382,r)} ${i(60.0483258382643,a)}L${i(28.235046153846152,r)} ${i(62.833895069033524,a)}L${i(31.26701538461538,r)} ${i(62.1679258382643,a)}C${i(33.282799999999995,r)} ${i(61.72509506903353,a)}, ${i(35.39098461538461,r)} ${i(62.20626429980276,a)}, ${i(37.01498461538461,r)} ${i(63.47983353057199,a)}L${i(39.45766153846154,r)} ${i(65.39524891518737,a)}L${i(41.90012307692308,r)} ${i(63.47983353057199,a)}C${i(43.524123076923075,r)} ${i(62.20626429980276,a)}, ${i(45.632307692307684,r)} ${i(61.72509506903353,a)}, ${i(47.6480923076923,r)} ${i(62.1679258382643,a)}L${i(50.68006153846154,r)} ${i(62.833895069033524,a)}L${i(52.049692307692304,r)} ${i(60.0483258382643,a)}C${i(52.960338461538456,r)} ${i(58.196233530571995,a)}, ${i(54.6508923076923,r)} ${i(56.847925838264295,a)}, ${i(56.65913846153846,r)} ${i(56.37235660749507,a)}L${i(59.67969230769231,r)} ${i(55.65684891518738,a)}L${i(59.70510769230769,r)} ${i(52.5527258382643,a)}C${i(59.72190769230769,r)} ${i(50.4891258382643,a)}, ${i(60.66012307692307,r)} ${i(48.54075660749507,a)}, ${i(62.263230769230766,r)} ${i(47.240910453648915,a)}L${i(64.67424615384616,r)} ${i(45.28564891518738,a)}L${i(63.35027692307692,r)} ${i(42.47811045364892,a)}C${i(62.47,r)} ${i(40.611371992110456,a)}, ${i(62.47,r)} ${i(38.44891045364892,a)}, ${i(63.35027692307692,r)} ${i(36.58238737672584,a)}L${i(64.67424615384616,r)} ${i(33.774633530572,a)}L${i(62.263230769230766,r)} ${i(31.81958737672584,a)}C${i(60.66012307692307,r)} ${i(30.519525838264297,a)}, ${i(59.72190769230769,r)} ${i(28.57137199211045,a)}, ${i(59.70510769230769,r)} ${i(26.507556607495065,a)}L${i(59.67969230769231,r)} ${i(23.40354122287968,a)}L${i(56.65913846153846,r)} ${i(22.688076607495066,a)}C${i(54.6508923076923,r)} ${i(22.212399684418145,a)}, ${i(52.960338461538456,r)} ${i(20.864178145956608,a)}, ${i(52.049692307692304,r)} ${i(19.012128915187375,a)}L${i(50.68006153846154,r)} ${i(16.22649506903353,a)}L${i(47.6480923076923,r)} ${i(16.892464299802757,a)}C${i(45.632307692307684,r)} ${i(17.335251992110454,a)}, ${i(43.524338461538456,r)} ${i(16.85408276134122,a)}, ${i(41.90012307692308,r)} ${i(15.58053506903353,a)}L${i(39.45766153846154,r)} ${i(13.665055069033532,a)}Z`}function to(t,e,n,o,r="top-left"){switch(o){case "leaf":return bl(t,e,n,r);case "leaf-reverse":return bl(t,e,n,r,true);case "drop":return _d(t,e,n,r);case "octagon":return gl(t,e,n,1.6);case "bevel":return gl(t,e,n,1.1);case "squircle":return yd(t,e,n);case "cushion":return $d(t,e,n);case "shield":return xd(t,e,n);case "petal":return Sd(t,e,n,r);case "gear":return Ed(t,e,n);case "rounded":return Cd(t,e,n);case "circle":return wd(t,e,n);case "diya":return Rd(t,e,n);case "extra-rounded":return Pd(t,e,n);case "message":return Ad(t,e,n);case "pointy":return vd(t,e,n);case "curly":return Ld(t,e,n);default:return Md(t,e,n)}}var $l=U(()=>{"use strict";ae();ht();});function Ya(t,e,n){if(t)return n?{[Xa]:e,[xl]:n}:{[Xa]:e}}var Xa,xl,Id,ja=U(()=>{"use strict";Xa="data-qrdx-part",xl="data-qrdx-eye",Id=["eye-outer","eye-centre","body","logo","background"];});var Sl,Ml=U(()=>{"use strict";Sl={id:"Arrow",name:"Arrow",description:"QR code with arrow",wrapper:(t,e)=>jsx("svg",{height:"300",id:"svgQrWrapper",style:{width:"100%",height:"100%"},viewBox:"0 0 300 300",width:"300",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",children:jsxs("svg",{fill:"#000000",height:"300",viewBox:"0 0 300 300",width:"300",xmlns:"http://www.w3.org/2000/svg",children:[jsx("path",{d:"M73.57,175.23h0c.12-2.06.31-4.19.49-6.25s.48-4.13.85-6.13.79-4,1.27-5.95a30.21,30.21,0,0,1,1.94-5.28h0c.06-.18.13-.43.19-.67a3.55,3.55,0,0,0-2.8-4.19l-.18-.06a1.85,1.85,0,0,0-.54-.06c-.19,0-.31-.06-.49-.06s-.61-.06-.91-.06c-.61,0-1.21.06-1.82.06-1.21.12-2.37.25-3.52.43a62.08,62.08,0,0,0-6.8,1.45,58.45,58.45,0,0,0-6.43,2.31c-1,.42-2.07,1-3.1,1.4s-2,1.09-3,1.57a.76.76,0,0,0,.54,1.4h.07c1.09-.24,2.12-.55,3.15-.79s2.13-.48,3.16-.61A46,46,0,0,1,62,153c1.34-.06,2.73-.06,4.07-.06a62.58,62.58,0,0,0-7.23,10.43,85.58,85.58,0,0,0-6.55,15.36,107.86,107.86,0,0,0-5,32.53,104.06,104.06,0,0,0,5,32.29,90.47,90.47,0,0,0,15.54,28.52.94.94,0,0,0,1.27.19.89.89,0,0,0,.18-1.28h0a87.24,87.24,0,0,1-13.89-28.28A102.85,102.85,0,0,1,58,180.87a82.15,82.15,0,0,1,6.68-14,51.58,51.58,0,0,1,5.71-7.76c0,1.21,0,2.36.06,3.58.12,2.18.24,4.31.48,6.43s.49,4.25.85,6.37a1,1,0,0,0,.91.85A1.37,1.37,0,0,0,73.57,175.23Z",fill:e?.fgColor||"black",id:"CallToActionArrow"}),jsx("g",{fill:"none",transform:"translate(82, 95)scale(0.5)",children:t})]})})};});var wl,El=U(()=>{"use strict";wl={id:"default",name:"Default",description:"Simple QR code without decorative elements",wrapper:t=>jsx("svg",{height:"300",id:"svgQrWrapper",style:{width:"100%",height:"100%"},viewBox:"0 0 300 300",width:"300",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",children:jsx("g",{fill:"none",transform:"translate(9, 9) scale(0.95)",children:t})})};});var Pl,Al=U(()=>{"use strict";Pl={id:"Halloween",name:"Halloween",description:"QR code with Halloween theme",wrapper:t=>jsx("svg",{height:"300",id:"svgQrWrapper",style:{width:"100%",height:"100%"},viewBox:"0 0 300 300",width:"300",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",children:jsx("svg",{fill:"none",height:"300",viewBox:"0 0 300 300",width:"300",xmlns:"http://www.w3.org/2000/svg",children:jsxs("g",{transform:"translate(10, 10)",children:[jsx("circle",{cx:"138",cy:"167.682",fill:"white",r:"99.3177",stroke:"#F89941",strokeWidth:"20"}),jsx("rect",{fill:"url(#pattern0)",height:"110.806",width:"113",x:"81.0001",y:"124.097"}),jsx("ellipse",{cx:"167.989",cy:"67.8947",fill:"#F89941",rx:"35.4453",ry:"48.4419"}),jsx("path",{d:"M187.937 69.0763C187.937 82.6574 184.092 94.8451 178.005 103.57C171.912 112.304 163.736 117.381 154.992 117.381C146.247 117.381 138.072 112.304 131.979 103.57C125.891 94.8451 122.047 82.6574 122.047 69.0763C122.047 55.4952 125.891 43.3075 131.979 34.5823C138.072 25.8486 146.247 20.7714 154.992 20.7714C163.736 20.7714 171.912 25.8486 178.005 34.5823C184.092 43.3075 187.937 55.4952 187.937 69.0763Z",fill:"#F89941",stroke:"#E78249",strokeWidth:"5"}),jsx("ellipse",{cx:"154.072",cy:"69.4866",fill:"#F89941",rx:"34.0512",ry:"50.6615"}),jsx("path",{d:"M171.396 69.667C171.396 82.7394 167.562 94.4717 161.488 102.874C155.412 111.279 147.235 116.2 138.451 116.2C129.666 116.2 121.489 111.279 115.413 102.874C109.34 94.4717 105.506 82.7394 105.506 69.667C105.506 56.5946 109.34 44.8624 115.413 36.4603C121.489 28.0551 129.666 23.1344 138.451 23.1344C147.235 23.1344 155.412 28.0551 161.488 36.4603C167.562 44.8624 171.396 56.5946 171.396 69.667Z",fill:"#F89941",stroke:"#E78249",strokeWidth:"5"}),jsx("ellipse",{cx:"134.316",cy:"70.8486",fill:"#F89941",rx:"33.673",ry:"47.8511"}),jsx("ellipse",{fill:"#F89941",rx:"35.4453",ry:"48.4419",transform:"matrix(-1 0 0 1 106.743 68.4484)"}),jsx("path",{d:"M86.7942 69.6299C86.7942 83.2111 90.6388 95.3988 96.7262 104.124C102.819 112.858 110.995 117.935 119.739 117.935C128.484 117.935 136.659 112.858 142.753 104.124C148.84 95.3988 152.685 83.2111 152.685 69.6299C152.685 56.0488 148.84 43.8611 142.753 35.1359C136.659 26.4023 128.484 21.3251 119.739 21.3251C110.995 21.3251 102.819 26.4023 96.7262 35.1359C90.6388 43.8611 86.7942 56.0488 86.7942 69.6299Z",fill:"#F89941",stroke:"#E78249",strokeWidth:"5"}),jsx("ellipse",{fill:"#F89941",rx:"32.9438",ry:"50.3847",transform:"matrix(-1 0 0 1 119.744 69.7634)"}),jsx("path",{d:"M103.335 70.2207C103.335 83.293 107.169 95.0253 113.243 103.427C119.319 111.833 127.496 116.753 136.281 116.753C145.065 116.753 153.242 111.833 159.318 103.427C165.392 95.0253 169.226 83.293 169.226 70.2207C169.226 57.1483 165.392 45.416 159.318 37.014C153.242 28.6088 145.065 23.688 136.281 23.688C127.496 23.688 119.319 28.6088 113.243 37.014C107.169 45.416 103.335 57.1483 103.335 70.2207Z",fill:"#F89941",stroke:"#E78249",strokeWidth:"5"}),jsx("ellipse",{fill:"#F89941",rx:"32.3901",ry:"47.6163",transform:"matrix(-1 0 0 1 139.677 70.8708)"}),jsx("ellipse",{fill:"#F89941",rx:"33.2207",ry:"47.6163",transform:"matrix(-1 0 0 1 134.971 71.4245)"}),jsx("path",{d:"M158.85 46.6783C165.21 42.2516 166.538 40.633 167.867 39.0144C167.867 39.0144 169.806 43.8236 169.88 46.3566C169.954 48.8897 169.712 50.1469 167.248 51.6467C164.783 53.1464 155.406 53.0446 150.083 52.9746C149.31 52.5001 150.72 52.3371 158.85 46.6783Z",fill:"black"}),jsx("path",{d:"M115.765 46.5118C109.392 42.1412 108.058 40.5475 106.724 38.9538C106.724 38.9538 104.783 45.8361 104.758 46.822C104.733 47.808 104.657 50.8051 108.247 51.9995C111.837 53.194 119.234 52.7723 124.551 52.7272C125.322 52.2652 123.912 52.0991 115.765 46.5118Z",fill:"black"}),jsx("path",{d:"M160 90.4999C167.156 83.1595 169.5 78.2827 171.351 72.9348C172.24 70.3672 162.909 72.0429 158 72.9348C157.276 73.0664 155.751 76.9145 155 77C154.182 77.0932 151.841 73.0759 151 73.086C149.725 73.1013 147.727 73.086 145.875 73.4285C145.345 74.3645 146.367 77.5746 145.875 78.2827C145.321 78.2827 141.796 77.2604 141.242 76.4298C140.689 74.492 140.949 73.3629 140.118 72.5323C137.555 72.9075 138.023 72.6567 135.412 73.086C134.768 73.1919 133.09 77.7212 132.441 77.8195C131.615 77.9448 128.644 74.0088 127.809 74.1138C126.747 74.2475 124.821 74.4683 123.64 74.577C123.126 74.6244 123.554 77.5019 123.177 78.2827C122.898 78.8616 119.426 77.8921 118.5 77.5C118.037 76.5024 117.844 74.5583 117 74.577C111 74.1138 109.4 73.843 103.575 70.8713C103.575 70.8713 102.5 80 111 89C119.5 98 147.127 103.706 160 90.4999Z",fill:"black"}),jsx("path",{d:"M135.238 7.25181C137.192 1.73111 142.678 0.363204 145.935 0L148.377 1.81602C149.158 2.39714 149.842 2.40909 150.331 3.25657C150.331 4.22511 146.337 5.41975 142.429 6.582C137.545 8.03482 139.482 17.0534 142.429 19.2811C143.401 20.0152 143.524 19.9639 145.966 19.9639C148.029 19.9639 150.387 18.2474 151.566 17.3526C151.566 17.3526 151.861 20.2573 149.798 21.4777C147.735 22.698 143.578 21.8578 143.608 21.9658C144.493 23.9183 146.89 22.4887 148.029 23.3362C147.346 23.3362 146.556 24.2889 144.198 24.5329C142.672 24.5798 142.135 24.5329 140.956 23.9183C139.777 23.3037 139.482 22.8696 138.893 22.1395C136.83 23.3598 138.893 25.4305 138.893 25.4305C138.893 25.4305 134.472 25.8512 133.587 23.9183C133.264 23.2115 133.882 22.1395 133.587 21.9658C131.819 22.4539 130.935 23.4807 127.373 22.8696C124.312 22.3443 125.102 18.3211 124.451 17.3526C127.381 18.079 125.131 20.0392 129.327 19.9639C140.838 19.7576 132.796 14.1527 135.238 7.25181Z",fill:"#5D725F"}),jsxs("defs",{children:[jsx("pattern",{height:"1",id:"pattern0",patternContentUnits:"objectBoundingBox",width:"1"}),jsx("clipPath",{id:"clip0_2087_156668",children:jsx("rect",{fill:"white",height:"276",width:"276"})})]}),jsx("g",{fill:"none",transform:"translate(80, 122)scale(0.38)",children:t})]})})})};});var vl,Ll=U(()=>{"use strict";vl={id:"SquareBorder",name:"Square Border",description:"QR code with square decorative border",wrapper:(t,e)=>jsx("svg",{height:"300",id:"svgQrWrapper",style:{width:"100%",height:"100%"},viewBox:"0 0 300 300",width:"300",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",children:jsx("svg",{fill:"black",height:"300",viewBox:"0 0 316 316",width:"300",xmlns:"http://www.w3.org/2000/svg",children:jsxs("g",{children:[jsx("path",{clipRule:"evenodd",d:"M308 8H8v300h300V8ZM0 0v316h316V0H0Z",fill:e?.fgColor||"black",fillRule:"evenodd"}),jsx("g",{fill:"none",transform:"translate(20, 20) scale(0.92)",children:t})]})})})};});var Il,Tl=U(()=>{"use strict";Il={id:"StandardBox",name:"Standard Box",description:"QR code with standard box",wrapper:(t,e)=>jsx("svg",{height:"300",id:"svgQrWrapper",style:{width:"100%",height:"100%"},viewBox:"0 0 300 300",width:"300",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",children:jsxs("svg",{fill:"#000000",height:"300",viewBox:"0 0 300 300",width:"300",xmlns:"http://www.w3.org/2000/svg",children:[jsx("path",{d:"M243,1.7h-186a10.25,10.25,0,0,0-10.2,10.12v186A10.13,10.13,0,0,0,57,208H243a10.13,10.13,0,0,0,10.12-10.12v-186A10.13,10.13,0,0,0,243,1.7Zm2.36,193.05a5.46,5.46,0,0,1-5.47,5.47H60.16a5.46,5.46,0,0,1-5.47-5.47V14.93a5.46,5.46,0,0,1,5.47-5.47H239.91a5.46,5.46,0,0,1,5.47,5.47Z",fill:e?.fgColor||"black"}),jsx("path",{d:"M243.54,238.81H173.61a2.29,2.29,0,0,1-1.62-.67l-20.55-20.55a2.33,2.33,0,0,0-3.25,0l-20.55,20.55a2.29,2.29,0,0,1-1.62.67H56.09A9.15,9.15,0,0,0,46.93,248v41.17a9.16,9.16,0,0,0,9.16,9.16H243.61a9.09,9.09,0,0,0,9.09-9.16V248A9.16,9.16,0,0,0,243.54,238.81Z",fill:e?.fgColor||"black"}),jsx("g",{fill:"none",transform:"translate(60, 15)scale(0.6)",children:t})]})})};});var Fl,kl=U(()=>{"use strict";Fl={id:"StrikedBox",name:"Striked Box",description:"QR code with striked box",wrapper:t=>jsx("svg",{height:"300",id:"svgQrWrapper",style:{width:"100%",height:"100%"},viewBox:"0 0 300 300",width:"300",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",children:jsxs("svg",{fill:"#22071b",height:"300",viewBox:"0 0 300 300",width:"300",xmlns:"http://www.w3.org/2000/svg",children:[jsx("path",{d:"M195.11,290.77l-7.28,4.88a2.16,2.16,0,0,0-.57,3,2.21,2.21,0,0,0,1.77.92,2.4,2.4,0,0,0,1.2-.35l7.28-4.88a2.14,2.14,0,0,0-2.4-3.54Z"}),jsx("path",{d:"M266.85,227.52l-7.28,4.87a2.16,2.16,0,0,0-.57,3,2.21,2.21,0,0,0,1.77.92,1.86,1.86,0,0,0,1.2-.35l7.28-4.88a2.13,2.13,0,1,0-2.4-3.53Z"}),jsx("path",{d:"M41,176.34l-9.11,6.08a2.15,2.15,0,0,0-.57,3,2.19,2.19,0,0,0,1.77.92,2.14,2.14,0,0,0,1.2-.35l9.12-6.08A2.14,2.14,0,0,0,41,176.34Z"}),jsx("path",{d:"M41,269.08l-9.11,6.07a2.15,2.15,0,0,0-.57,3,2.19,2.19,0,0,0,1.77.92,2.92,2.92,0,0,0,1.2-.35l9.12-6.08A2.14,2.14,0,0,0,41,269.08Z"}),jsx("path",{d:"M147,10.1a2.4,2.4,0,0,0,1.14-.35l7.7-5.16a2.13,2.13,0,0,0-2.4-3.53l-7.64,5.15a2.15,2.15,0,0,0-.56,3A2.19,2.19,0,0,0,147,10.1Z"}),jsx("path",{d:"M275.54,54.77a2.14,2.14,0,0,0-3-.56l-17.1,11.45V31.31a10.18,10.18,0,0,0-10.18-10.18H137.22l-10.39,7a2.4,2.4,0,0,1-1.2.35,2.21,2.21,0,0,1-1.77-.92,2.15,2.15,0,0,1,.57-3l1.41-.92,13.64-8.76a2.1,2.1,0,1,0-2.26-3.54L122,21.2h-8.13l-10.39,7a2.37,2.37,0,0,1-1.2.35,2.19,2.19,0,0,1-1.76-.92,2.15,2.15,0,0,1,.56-3L124,9.25a2.13,2.13,0,1,0-2.4-3.53l-23,15.48H58.2A10.18,10.18,0,0,0,48,31.38v28L31.34,70.46a2.09,2.09,0,0,0-.57,3,2,2,0,0,0,1.77.92,2.58,2.58,0,0,0,1.2-.35l14.35-9.54,3.18-2.12a2.14,2.14,0,1,1,2.41,3.53l-5.52,3.67V76.9l-7,4.66a2.15,2.15,0,0,0-.56,3,2,2,0,0,0,1.77.92,2.34,2.34,0,0,0,1.2-.36l7.35-4.94A2.13,2.13,0,0,1,52.69,84l-4.46,3v65.66L25.05,168.07a2.15,2.15,0,0,0-.57,3,2,2,0,0,0,1.77.92,2.37,2.37,0,0,0,1.2-.35l25-16.75a2,2,0,0,1,2.62.77,2.16,2.16,0,0,1-.57,3l-6.36,4.24V275a10.09,10.09,0,0,0,9.83,10.11l-5.87,4a2.15,2.15,0,0,0-.57,3,2.06,2.06,0,0,0,1.77.92,2.38,2.38,0,0,0,1.2-.36l23-15.41a2.14,2.14,0,0,1,2.41,3.54l-6.58,4.45h52l-5.58,3.75a2.14,2.14,0,0,0-.56,3,2,2,0,0,0,1.76.91,2.37,2.37,0,0,0,1.2-.35l30.54-20.28a2.15,2.15,0,0,1,3,.56,2.1,2.1,0,0,1-.57,3l-14.21,9.54H217l-4.6,3a2.16,2.16,0,0,0-.63,3,2.11,2.11,0,0,0,1.76,1,2,2,0,0,0,1.13-.36L237,277.35a2.14,2.14,0,1,1,2.33,3.6l-6.78,4.38h13a10.18,10.18,0,0,0,10.18-10.18v-91.1l-4.38,3a2.43,2.43,0,0,1-1.2.35,2.19,2.19,0,0,1-1.77-.92,2.15,2.15,0,0,1,.57-3l24.38-16.33a2.13,2.13,0,1,0-2.4-3.53l-15.48,10.25V91.53l-4.38,3a2.34,2.34,0,0,1-1.21.36,2.22,2.22,0,0,1-1.76-.92,2.15,2.15,0,0,1,.56-3l6.72-4.52,13.71-9.19a2.14,2.14,0,0,0-2.4-3.54l-11.24,7.57V75.84l-4.38,3a2.34,2.34,0,0,1-1.21.36,2.22,2.22,0,0,1-1.76-.92,2.15,2.15,0,0,1,.56-3l6.72-4.52,19.43-13.08A2.05,2.05,0,0,0,275.54,54.77ZM237,216.07h-172a5.23,5.23,0,0,1-5.23-5.24V38.94a5.22,5.22,0,0,1,5.23-5.23H237a5.22,5.22,0,0,1,5.23,5.23V210.83h.07A5.22,5.22,0,0,1,237,216.07Z"}),jsx("path",{d:"M270.45,139.8l-7.28,4.88a2.15,2.15,0,0,0-.56,3,2.22,2.22,0,0,0,1.76.92,2.44,2.44,0,0,0,1.21-.36l7.28-4.87a2.14,2.14,0,0,0-2.41-3.54Z"}),jsx("g",{fill:"none",transform:"translate(64, 38)scale(0.58)",children:t})]})})};});var Ja=U(()=>{"use strict";Ml();El();Al();Ll();Tl();kl();});var Ka,Nl,vg,Lg,ti=U(()=>{"use strict";Ja();Ja();Ka={default:wl,Arrow:Sl,StandardBox:Il,SquareBorder:vl,StrikedBox:Fl,Halloween:Pl},Nl=t=>Ka[t],vg=()=>Object.values(Ka),Lg=()=>Object.keys(Ka);});function Gl(t){return `#${ei(t.r)}${ei(t.g)}${ei(t.b)}`}function ro(t){let e=dt(t);return !e||e.a>=1||e.a<=0?{color:t}:{color:Gl(e),opacity:st(e.a,3)}}function oo(t,e){let n=Math.min(Math.max(t.a,0),1);return {r:t.r*n+e.r*(1-n),g:t.g*n+e.g*(1-n),b:t.b*n+e.b*(1-n),a:1}}function Dd(t){return [...t].map(e=>({offset:Math.min(Math.max(e.offset/100,0),1),color:dt(e.color)??Ql})).sort((e,n)=>e.offset-n.offset)}function ni(t,e){let n=t[0],o=t.at(-1);if(!(n&&o))return Ql;if(e<=n.offset)return n.color;if(e>=o.offset)return o.color;for(let r=0;r+1<t.length;r++){let a=t[r],i=t[r+1];if(e>=a.offset&&e<=i.offset){let c=i.offset-a.offset,s=c>0?(e-a.offset)/c:1,l=a.color.a+(i.color.a-a.color.a)*s,u=(m,f)=>{let d=m*a.color.a+(f*i.color.a-m*a.color.a)*s;return l>0?d/l:m+(f-m)*s};return {r:u(a.color.r,i.color.r),g:u(a.color.g,i.color.g),b:u(a.color.b,i.color.b),a:l}}}return o.color}function Ul(t,e,n,o,r){let a=Dd(t);if(a.length===0)return {wedges:[]};let i=a[0].color.a,c=a.every(_=>Math.abs(_.color.a-i)<.002),s=[...new Set([0,...a.map(_=>_.offset),1])].sort((_,y)=>_-y),l=[];for(let _=0;_+1<s.length;_++){let y=s[_],M=s[_+1];if(M<=y)continue;let C=ni(a,y+1e-9),x=ni(a,M-1e-9),S=Math.max(Math.abs(C.r*C.a-x.r*x.a),Math.abs(C.g*C.a-x.g*x.a),Math.abs(C.b*C.a-x.b*x.a),Math.abs(C.a-x.a)*255),E=Math.ceil(S/Bd),w=Math.ceil((M-y)*360/Ol),R=Math.max(1,E,w);for(let v=0;v<R;v++)l.push([y+(M-y)*v/R,y+(M-y)*(v+1)/R]);}let u=l;if(l.length>Dl){let _=Math.ceil(l.length/Dl);u=[];for(let y=0;y<l.length;y+=_){let M=l.slice(y,y+_);u.push([M[0][0],M.at(-1)[1]]);}}let m=e-90,f=r/Math.cos(2*Ol/2*(Math.PI/180)),d=_=>{let y=_*Math.PI/180;return [$(n+f*Math.cos(y)),$(o+f*Math.sin(y))]},p=`${$(n)} ${$(o)}`,h=_=>st((_%360+360)%360,4),g=u.length-1,b=u.map(([_,y],M)=>{let C=ni(a,(_+y)/2),x=(y-_)*360,S=c&&M===0&&g>0?x:0,E=c&&M<g?x:0,w=m+_*360-S,R=m+y*360+E,[v,A]=d(w),[L,T]=d(R);return {d:`M${p}L${v} ${A}L${L} ${T}Z`,color:Gl(C),...c||C.a>=1?{}:{opacity:st(C.a,3)},from:h(w),sweep:st(R-w,4)}});return c&&i<1?{wedges:b,opacity:st(i,3)}:{wedges:b}}function Bl(t,e,n,o){return (Math.atan2(o-e,n-t)*180/Math.PI%360+360)%360}function ql(t,e,n){if(t>=n.x-1e-6&&t<=n.x+n.width+1e-6&&e>=n.y-1e-6&&e<=n.y+n.height+1e-6)return null;let r=[[n.x,n.y],[n.x+n.width,n.y],[n.x,n.y+n.height],[n.x+n.width,n.y+n.height]],a=Bl(t,e,n.x+n.width/2,n.y+n.height/2),i=0,c=0;for(let[s,l]of r){let u=Bl(t,e,s,l)-a;u>180?u-=360:u<=-180&&(u+=360),i=Math.min(i,u),c=Math.max(c,u);}return [a+i,a+c]}function zl(t,e){let n=t[1]-t[0],o=e[1]-e[0];if(n>=360||o>=360)return true;let r=((e[0]-t[0])%360+360)%360;return r<=n||r+o>=360}var ei,Ql,Ol,Dl,Bd,ao=U(()=>{"use strict";ht();Bt();ei=t=>Math.round(Math.min(Math.max(t,0),255)).toString(16).padStart(2,"0");Ql={r:0,g:0,b:0,a:1};Ol=4,Dl=720,Bd=2;});var Jl={};$m(Jl,{QRCodeSVG:()=>ci,SUPPORTS_PATH2D:()=>Xd,convertImageSettingsToPixels:()=>Zl,excavateModules:()=>co,generatePath:()=>ii,getContrastLevel:()=>Zd,getContrastRatio:()=>jd,getImageSettings:()=>we,getLuminance:()=>an,getSolidColor:()=>wt,hexToRgb:()=>Yd,resolveErrorLevel:()=>Gt});function co(t,e){return t.slice().map((n,o)=>o<e.y||o>=e.y+e.h?n:n.map((r,a)=>a<e.x||a>=e.x+e.w?r:false))}function ii(t,e=0){let n=[];return t.forEach((o,r)=>{let a=null;o.forEach((i,c)=>{if(!i&&a!==null){n.push(P`M${a+e} ${r+e}h${c-a}v1H${a+e}z`),a=null;return}if(c===o.length-1){if(!i)return;a===null?n.push(P`M${c+e},${r+e} h1v1H${c+e}z`):n.push(P`M${a+e},${r+e} h${c+1-a}v1H${a+e}z`);return}i&&a===null&&(a=c);});}),n.join("")}function Gd(t,e,n){return t<7&&e<7||t>=n-7&&e<7||t<7&&e>=n-7}function oi(t,e){let{margin:n,pixelSize:o,pattern:r="circle",plain:a=false}=e;if(ml(r))return fl(t,{margin:n,pixelSize:o,pattern:r,scale:e.scale,plain:a});let i=Jr(e.scale,r),c=[],s=t.length,l=o*.45,u=a?()=>false:Ha(s);return t.forEach((m,f)=>{m.forEach((d,p)=>{if(d&&(a||!Gd(p,f,s))){let h=(p+.5+n)*o,g=(f+.5+n)*o,b=`${p}-${f}`,_=c.length;if(u(p,f)){c.push(jsx("rect",{height:$(o),width:$(o),x:$(h-o/2),y:$(g-o/2)},b));return}switch(r){case "circle":c.push(jsx("circle",{cx:$(h),cy:$(g),r:$(l),transform:P`rotate(0,${h},${g})`},b));break;case "circle-large":{let y=o*.5;c.push(jsx("circle",{cx:$(h),cy:$(g),r:$(y),transform:P`rotate(0,${h},${g})`},b));}break;case "small-square":{let y=o*.357143;c.push(jsx("path",{d:P`M ${h-y} ${g-y}v ${o*.714286}h ${o*.714286}v -${o*.714286}z`,transform:P`rotate(0,${h},${g})`},b));}break;case "diamond":{let y=o*.357143;c.push(jsx("path",{d:P`M ${h-y} ${g-y}v ${o*.714286}h ${o*.714286}v -${o*.714286}z`,transform:P`rotate(45,${h},${g})`},b));}break;case "circle-mixed":{let y=(p+f)%3===0?Qd:(p+f)%2===0?1:1.25,M=l*y;c.push(jsx("circle",{cx:$(h),cy:$(g),r:$(M),transform:P`rotate(0,${h},${g})`},b));}break;case "pacman":{let y=o*.5,M=o*.357143;c.push(jsx("path",{d:P`M ${h-y} ${g-M}v ${o*.714286}h ${y}a ${y*.5} ${y*.5}, 0, 0, 0, 0 -${o*.714286}h -${y}v -${o*.714286}z`,transform:P`rotate(${(p+f)%2===0?0:90},${h},${g})`},b));}break;case "rounded":{let y=o*.5,M=o*.2;c.push(jsx("rect",{height:$(o),rx:$(M),ry:$(M),transform:P`rotate(0,${h},${g})`,width:$(o),x:$(h-y),y:$(g-y)},b));}break;case "square":{let y=o*.5;c.push(jsx("rect",{height:$(o),transform:P`rotate(0,${h},${g})`,width:$(o),x:$(h-y),y:$(g-y)},b));}break;case "vertical-line":{let y=o*.714286,M=o;c.push(jsx("path",{d:P`M ${h-o*.5} ${g-y*.5}v ${y}h ${M}v -${y}z`,transform:P`rotate(90,${h},${g})`},b));}break;default:c.push(jsx("circle",{cx:$(h),cy:$(g),r:$(l),transform:P`rotate(0,${h},${g})`},b));}if(i!==1&&c.length>_){let y=c.pop();c.push(jsx("g",{transform:P`translate(${h},${g}) scale(${$(i,6)}) translate(${-h},${-g})`,children:y},b));}}});}),c}function Ud(t,e){let n=t*Math.PI/180,o=e/2,r=e/2,a=Math.sqrt(e*e+e*e)/2,i=o-a*Math.cos(n),c=r-a*Math.sin(n),s=o+a*Math.cos(n),l=r+a*Math.sin(n);return {x1:i,y1:c,x2:s,y2:l}}function si(t,e){return `${t}-${Ye(JSON.stringify(e))}`}function qd(t,e,n,o,r){let a=t;if(t===0)switch(r){case "top-left":a=0;break;case "top-right":a=90;break;case "bottom-left":a=270;break;default:a=0;}let i=a*Math.PI/180,c=e+o/2,s=n+o/2,l=Math.sqrt(o*o+o*o)/2,u=c-l*Math.cos(i),m=s-l*Math.sin(i),f=c+l*Math.cos(i),d=s+l*Math.sin(i);return {x1:u,y1:m,x2:f,y2:d}}function so(t,e){return e.map((n,o)=>{let{color:r,opacity:a}=ro(n.color);return jsx("stop",{offset:`${n.offset}%`,stopColor:r,stopOpacity:a},`${t}-stop-${o}`)})}function Xl(t,e,n,o,r,a){let i=Ul(e.stops,e.angle??0,n,o,r),c=i.wedges.map((s,l)=>jsx("path",{d:s.d,"data-arc":`${s.from} ${s.sweep}`,fill:s.color,fillOpacity:s.opacity,shapeRendering:s.opacity===void 0?void 0:"crispEdges"},`${t}-w-${l}`));return jsx("pattern",{"data-qrdx-conic":`${$(n)} ${$(o)}`,height:$(a),id:t,patternUnits:"userSpaceOnUse",width:$(a),x:0,y:0,children:i.opacity===void 0?c:jsx("g",{opacity:i.opacity,children:c})},t)}function zd(t="center"){let[e,n]=t.split("-"),o=t==="center"?"center":e,r=n??(e==="left"||e==="right"?e:"center");return {x:r==="left"?0:r==="right"?1:.5,y:o==="top"?0:o==="bottom"?1:.5}}function Yl(t,e,n){let o=e.scale??1,r=e.fit==="tile",a=r?n/4*o:n,i=e.underlay?ro(e.underlay):null,c=r?a:n*o,s=zd(e.position),l=r?0:s.x*(n-c),u=r?0:s.y*(n-c),m=r?"xMidYMid slice":`${Hd[s.x*2]??"xMid"}${Wd[s.y*2]??"YMid"} ${e.fit==="contain"?"meet":"slice"}`;return jsxs("pattern",{height:$(a),id:t,patternUnits:"userSpaceOnUse",width:$(a),x:0,y:0,children:[i&&jsx("rect",{fill:i.color,fillOpacity:i.opacity,height:$(a),width:$(a),x:0,y:0}),jsx("image",{height:$(c),href:e.src,opacity:(e.opacity??1)<1?e.opacity:void 0,preserveAspectRatio:m,width:$(c),x:$(l),y:$(u)})]},t)}function Vd(t,e,n,o,r,a,i){let c=Wt(t);if(c.type==="solid")return null;if(c.type==="image"){let l=jl(c,i);return {id:l,element:Yl(l,c,i)}}let s=si(a,[c,e,n,o,r,...c.type==="angular"?[i]:[]]);if(c.type==="linear"){let l=c,u=l.angle??0,{x1:m,y1:f,x2:d,y2:p}=qd(u,e,n,o,r);return {id:s,element:jsx("linearGradient",{gradientUnits:"userSpaceOnUse",id:s,x1:$(m),x2:$(d),y1:$(f),y2:$(p),children:so(s,l.stops)},s)}}if(c.type==="radial"){let l=c,u=e+o/2,m=n+o/2,f=o/2*.97;return {id:s,element:jsx("radialGradient",{cx:$(u),cy:$(m),fx:$(u),fy:$(m),gradientUnits:"userSpaceOnUse",id:s,r:$(f),children:so(s,l.stops)},s)}}return c.type==="angular"?{id:s,element:Xl(s,c,e+o/2,n+o/2,o*.75,i)}:null}function ai(t,e,n){let o=Wt(t);if(o.type==="solid")return null;if(o.type==="image"){let a=jl(o,e);return {id:a,element:Yl(a,o,e)}}let r=si(n,[o,e]);if(o.type==="linear"){let a=o,i=a.angle??0,{x1:c,y1:s,x2:l,y2:u}=Ud(i,e);return {id:r,element:jsx("linearGradient",{gradientUnits:"userSpaceOnUse",id:r,x1:$(c),x2:$(l),y1:$(s),y2:$(u),children:so(r,a.stops)},r)}}if(o.type==="radial"){let a=o,i=e/2,c=e/2,s=e/2*.97;return {id:r,element:jsx("radialGradient",{cx:$(i),cy:$(c),fx:$(i),fy:$(c),gradientUnits:"userSpaceOnUse",id:r,r:$(s),children:so(r,a.stops)},r)}}return o.type==="angular"?{id:r,element:Xl(r,o,e/2,e/2,e*.75,e)}:null}function Hl(t){let e=new Set,n=[];for(let o of t)o&&!e.has(o.id)&&(e.add(o.id),n.push(o.element));return n}function Ce(t,e,n){if(e)return {fill:`url(#${e})`};let o=Wt(t,n),r=o.type==="solid"?o.color:o.type==="image"?o.underlay??n:n,{color:a,opacity:i}=ro(r);return i===void 0?{fill:a}:{fill:a,fillOpacity:i}}function we(t,e,n,o){if(o==null)return null;let r=t.length,a=Math.floor(e*fr),i=(r+2*n)/e,c=(o.width||a)*i,s=(o.height||a)*i,l=o.x==null?r/2-c/2:o.x*i,u=o.y==null?r/2-s/2:o.y*i,m=null;if(o.excavate){let f=Math.max(0,o.padding??0)*i,d=Math.floor(l-f),p=Math.floor(u-f),h=Math.ceil(c+l+f-d),g=Math.ceil(s+u+f-p);m={x:d,y:p,w:h,h:g};}return {x:l,y:u,h:s,w:c,excavation:m}}function Gt(t){let e=t.level??te,{imageSettings:n}=t,o=t.isOGContext&&n?.excavate&&(e==="L"||e==="M")?"Q":e;if(t.autoLevel&&n&&o!=="H"){let r=Mt.QrCode.encodeText(t.value,Lt[o]).getModules(),a=we(r,t.size??_t,Ft(r.length,t.margin??Ct,t.shape),n);a&&(a.excavation?a.excavation.w*a.excavation.h:a.w*a.h)/(r.length*r.length)>Ma&&(o="H");}return o}function Zl(t,e,n,o){let r=e/n,a=t.w*r,i=t.h*r,c=(t.x+o)*r,s=(t.y+o)*r;return {imgWidth:a,imgHeight:i,imgLeft:c,imgTop:s}}function ci(t){let{value:e,size:n=_t,level:o=te,bgColor:r=yt,fgColor:a=Pt,eyeColor:i,dotColor:c,bodyPattern:s="circle",cornerEyePattern:l="gear",cornerEyeDotPattern:u="circle",margin:m=Ct,isOGContext:f=false,imageSettings:d,templateId:p,customTemplate:h,customProps:g,frame:b,art:_,eyeColors:y,moduleScale:M,autoLevel:C,shape:x,frameLabelMarkers:S,partMarkers:E,...w}=t,R=lo({value:e,size:n,margin:m,level:o,shape:x,autoLevel:C,isOGContext:f},d),v=Ht(b),A=v?{}:w,L=it=>v?Tr(it,{size:n,frame:b,bgColor:r,svgProps:w,markLabels:S}):it,T=Gt({value:e,size:n,level:o,margin:m,imageSettings:R,isOGContext:f,autoLevel:C,shape:x}),N=Mt.QrCode.encodeText(e,Lt[T]),I=N.getModules(),G=Ft(I.length,m,x),q=Lc(e,I.length,m,x),O=(it,Ot)=>Ya(E,it,Ot),z=(it,Ot)=>{let Kt=Aa(x,it);return Kt?"circle"in Kt?jsx("circle",{cx:$(it/2),cy:$(it/2),...Ot,r:$(it/2),...O("background")}):jsx("path",{d:Kt.path,...Ot,...O("background")}):jsx("rect",{...Ot,height:it,width:it,x:0,y:0,...O("background")})},et=I.length+G*2,St=we(I,n,G,R),ct=null;if(R!=null&&St!=null){St.excavation!=null&&(I=co(I,St.excavation));let{imgWidth:it,imgHeight:Ot,imgLeft:Kt,imgTop:bn}=Zl(St,n,et,G);if(f){let _n=R.shape??"square";ct=jsx("img",{alt:"Logo",src:R.src,style:{position:"absolute",left:`${$(Kt)}px`,top:`${$(bn)}px`,width:`${$(it)}px`,height:`${$(Ot)}px`,..._n!=="square"&&{borderRadius:_n==="circle"?"50%":`${$(Math.min(it,Ot)*qr)}px`},...R.plate&&{backgroundColor:R.plate,padding:`${$(it*zr)}px`,boxSizing:"border-box"}}});}else ct=Hr(R,{x:Kt,y:bn,w:it,h:Ot}),E&&(ct=ri.cloneElement(ct,O("logo")));}let F=n/et,H=I.length,W=7*F,Rt=1.5*F,qe={fgColor:wt(a,Pt),bgColor:wt(r,yt)},Ut=Na(_)?Ga({art:_,modules:I,version:N.version,margin:G,pixelSize:F,...qe,body:it=>oi(it,{margin:G,pixelSize:F,pattern:s,scale:M})}):null,ue=Ut&&E?ri.cloneElement(Ut,O("body")):Ut,ze=Ut&&_?qa({art:_,version:N.version,...qe}):null,Q=Ut?null:oi(I,{margin:G,pixelSize:F,pattern:s,scale:M}),nt=q?oi(q,{margin:0,pixelSize:F,pattern:s,scale:M,plain:true}):null,Z=Wt(r,yt),bt=Wt(a,Pt),qn=io(Z)?ai(Z,n,"bg-color"):null,Ao=io(bt)?ai(bt,n,"fg-color"):null,pm=Ce(r,qn?.id??null,yt),Gi=Ce(a,Ao?.id??null,Pt),Qi=ue?jsxs(Fragment,{children:[ue,nt&&jsx("g",{...Gi,...O("body"),children:nt})]}):jsxs("g",{...Gi,...O("body"),children:[Q,nt]}),cn=G*F,ln=G*F,un=(H-7+G)*F,mn=G*F,dn=G*F,fn=(H-7+G)*F,He=wt(a,Pt),hn=it=>y?.[it]?.outer??ze?.[it]?.outer??i,pn=it=>y?.[it]?.inner??ze?.[it]?.inner??c,gn=(it,Ot,Kt,bn,_n)=>{let No=Wt(it,He);return io(No)?Vd(No,Ot,Kt,W,bn,_n,n):null},vo=gn(hn("topLeft"),cn,ln,"top-left","corners-square-color-0-0"),Lo=gn(hn("topRight"),un,mn,"top-right","corners-square-color-1-0"),Io=gn(hn("bottomLeft"),dn,fn,"bottom-left","corners-square-color-0-1"),To=gn(pn("topLeft"),cn,ln,"top-left","corners-dot-color-0-0"),Fo=gn(pn("topRight"),un,mn,"top-right","corners-dot-color-1-0"),ko=gn(pn("bottomLeft"),dn,fn,"bottom-left","corners-dot-color-0-1"),Ui=Ce(hn("topLeft"),vo?.id??null,He),qi=Ce(hn("topRight"),Lo?.id??null,He),zi=Ce(hn("bottomLeft"),Io?.id??null,He),Hi=Ce(pn("topLeft"),To?.id??null,He),Wi=Ce(pn("topRight"),Fo?.id??null,He),Vi=Ce(pn("bottomLeft"),ko?.id??null,He),Xi=to(cn,ln,W,l,"top-left"),Yi=Kr(cn+W/2,ln+W/2,Rt,u,"top-left"),ji=to(un,mn,W,l,"top-right"),Zi=Kr(un+W/2,mn+W/2,Rt,u,"top-right"),Ji=to(dn,fn,W,l,"bottom-left"),Ki=Kr(dn+W/2,fn+W/2,Rt,u,"bottom-left"),gm=jsxs(Fragment,{children:[jsx("defs",{children:Hl([qn,Ao,vo,Lo,Io,To,Fo,ko])}),z(n,pm),Qi,jsx("g",{...Ui,...O("eye-outer","top-left"),children:jsx("path",{d:Xi,fillRule:"evenodd",transform:P`rotate(0,${cn+W/2},${ln+W/2})`})}),jsx("g",{...Hi,...O("eye-centre","top-left"),children:Yi}),jsx("g",{...qi,...O("eye-outer","top-right"),children:jsx("path",{d:ji,fillRule:"evenodd",transform:P`rotate(0,${un+W/2},${mn+W/2})`})}),jsx("g",{...Wi,...O("eye-centre","top-right"),children:Zi}),jsx("g",{...zi,...O("eye-outer","bottom-left"),children:jsx("path",{d:Ji,fillRule:"evenodd",transform:P`rotate(0,${dn+W/2},${fn+W/2})`})}),jsx("g",{...Vi,...O("eye-centre","bottom-left"),children:Ki}),ct]}),ts=h||(p?Nl(p):void 0);if(ts){let Ot=io(Z)?ai(Z,300,"bg-color-template"):null,Kt=Ce(r,Ot?.id??null,yt),bn=jsxs("svg",{height:300,viewBox:"0 0 300 300",width:300,xmlns:"http://www.w3.org/2000/svg",children:[jsx("defs",{children:Hl([Ot,Ao,vo,Lo,Io,To,Fo,ko])}),z(300,Kt),jsxs("g",{transform:`scale(${$(300/n,6)})`,children:[Qi,jsx("g",{...Ui,...O("eye-outer","top-left"),children:jsx("path",{d:Xi,fillRule:"evenodd",transform:P`rotate(0,${cn+W/2},${ln+W/2})`})}),jsx("g",{...Hi,...O("eye-centre","top-left"),children:Yi}),jsx("g",{...qi,...O("eye-outer","top-right"),children:jsx("path",{d:ji,fillRule:"evenodd",transform:P`rotate(0,${un+W/2},${mn+W/2})`})}),jsx("g",{...Wi,...O("eye-centre","top-right"),children:Zi}),jsx("g",{...zi,...O("eye-outer","bottom-left"),children:jsx("path",{d:Ji,fillRule:"evenodd",transform:P`rotate(0,${dn+W/2},${fn+W/2})`})}),jsx("g",{...Vi,...O("eye-centre","bottom-left"),children:Ki}),ct]})]}),_n=300/n,bm={pixelSize:F*_n,url:e},es=ts.wrapper(bn,{fgColor:a,bgColor:r,...g||{},...w},bm),_m={...es?.props?.style||{},width:void 0,height:void 0,...A.style};return L(ri.cloneElement(es,{...A,width:n,height:n,style:_m}))}return L(jsx("svg",{height:n,viewBox:`0 0 ${n} ${n}`,width:n,xmlns:"http://www.w3.org/2000/svg",...A,children:gm}))}var Qd,Hd,Wd,jl,io,Xd,Yd,an,Wl,jd,Zd,Ee=U(()=>{"use strict";Fn();xe();za();Wa();me();At();hl();$l();_e();Wr();Bn();ja();tn();ae();ti();pe();ht();ao();Bt();pe();Qd=.9;Hd=["xMin","xMid","xMax"],Wd=["YMin","YMid","YMax"];jl=(t,e)=>si("img",[t,e]);io=t=>Tn(t)||da(t);Xd=(()=>{try{new Path2D().addPath(new Path2D);}catch{return !1}return !0})(),Yd=t=>{let e=t.trim().replace(/^#/,"");e.length===3||e.length===4?e=e.slice(0,3).split("").map(o=>o+o).join(""):e.length===8&&(e=e.slice(0,6));let n=/^([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return n?{r:Number.parseInt(n[1],16),g:Number.parseInt(n[2],16),b:Number.parseInt(n[3],16)}:null},an=(t,e,n)=>{let[o,r,a]=[t,e,n].map(i=>(i/=255,i<=.03928?i/12.92:((i+.055)/1.055)**2.4));return .2126*o+.7152*r+.0722*a},Wl=t=>{let e=dt(t);if(!e)return null;let n=o=>o*e.a+255*(1-e.a);return {r:n(e.r),g:n(e.g),b:n(e.b)}},jd=(t,e)=>{let n=Wl(t),o=Wl(e);if(!(n&&o))return 1;let r=an(n.r,n.g,n.b),a=an(o.r,o.g,o.b),i=Math.max(r,a),c=Math.min(r,a);return (i+.05)/(c+.05)},Zd=t=>t>=7?{level:"AAA",warning:!1,message:"Excellent contrast"}:t>=4.5?{level:"AA",warning:!1,message:"Good contrast"}:t>=3?{level:"AA Large",warning:!0,message:"Low contrast - may be difficult to scan"}:{level:"Fail",warning:!0,message:"Poor contrast - QR code may not scan properly"};});function tu(t){let e=Mt.QrCode.encodeText(t.value,Lt[t.level]),n=Jd[e.errorCorrectionLevel.ordinal]??t.level;return {code:t,cells:e.getModules(),layoutMargin:Ft(e.size,t.margin,t.shape),map:er(e.version,n),level:n,version:e.version}}function eu(t,e){let{cells:n,map:o}=t,r=n.length,a=we(n,t.code.size,t.layoutMargin,e);if(!a)return null;let i=a.excavation??{x:Math.floor(a.x),y:Math.floor(a.y),w:Math.ceil(a.x+a.w)-Math.floor(a.x),h:Math.ceil(a.y+a.h)-Math.floor(a.y)},c=[];for(let l=Math.max(0,i.y);l<Math.min(r,i.y+i.h);l++)for(let u=Math.max(0,i.x);u<Math.min(r,i.x+i.w);u++)c.push(l*r+u);let s=nr(o,c);return {worst:Math.max(0,...s),correctable:o.correctable,budget:Math.floor(o.correctable*Kl),level:t.level,version:t.version}}function uo(t,e){return eu(tu(t),e)}function Kd(t,e){return nu(uo(t,e))}function li(t,e,n,o){let r=e.map(c=>tu({...t,level:c})),a=c=>{let s=o(c);return r.every(l=>nu(eu(l,s)))};if(a(n))return n;let i=t.size*.005;for(let c=n-i;c>0;c-=i)if(a(c))return c;return 0}function lo(t,e){if(!e)return;let n=Math.floor(t.size*fr),o=e.width||n,r=e.height||n,a=f=>{if(f===o)return e;let d=r*f/o;return {...e,width:f,height:d,...e.x!=null&&{x:e.x+(o-f)/2},...e.y!=null&&{y:e.y+(r-d)/2}}},i=t.level??te,c={value:t.value,size:t.size,margin:t.margin,shape:t.shape},s=f=>Gt({...t,level:i,imageSettings:f}),l=f=>{let d=li(c,[f],o,a);return d>0?a(d):void 0},u=s(e);if(u===i)return l(i);let m=l(u);return m&&s(m)===u?m:l(i)}var Kl,Jd,nu,Bn=U(()=>{"use strict";me();Vr();At();tn();Ee();Kl=.6,Jd=["L","M","Q","H"];nu=t=>!t||t.worst<=t.budget;});At();_e();var I0=16384;var ia=[17,18,0,1,2,3,4,5,16,6,7,8,9,10,11,12,13,14,15],T0=8,sa=class{buffer;position=0;bits=0;used=0;constructor(e){this.buffer=new Uint8Array(Math.max(e,64));}write(e,n){if(n!==0)for(this.bits|=e<<this.used,this.used+=n;this.used>=8;){if(this.position===this.buffer.length){let o=new Uint8Array(this.buffer.length*2);o.set(this.buffer),this.buffer=o;}this.buffer[this.position++]=this.bits&255,this.bits>>>=8,this.used-=8;}}finish(){return this.used>0&&this.write(0,8-this.used),this.buffer.subarray(0,this.position)}};function Qs(t,e){let n=new Uint8Array(t.length),o=[];for(let l=0;l<t.length;l++)(t[l]??0)>0&&o.push(l);if(o.length===0)return n;if(o.length===1)return n[o[0]]=1,n;let r=o.length,a=2*r-1,i=new Float64Array(a),c=new Int32Array(a),s=new Uint8Array(a);for(let l=1;;l*=2){for(let h=0;h<r;h++)i[h]=Math.max(t[o[h]]??0,l);let u=Array.from({length:r},(h,g)=>g).sort((h,g)=>i[h]-i[g]||h-g),m=0,f=r,d=h=>m<r&&(f>=h||i[u[m]]<=i[f])?u[m++]:f++;for(let h=r;h<a;h++){let g=d(h),b=d(h);i[h]=i[g]+i[b],c[g]=h,c[b]=h;}s[a-1]=0;let p=0;for(let h=a-2;h>=0;h--){let g=s[c[h]]+1;s[h]=g,h<r&&g>p&&(p=g);}if(p<=e){for(let h=0;h<r;h++)n[o[h]]=s[h];return n}}}function F0(t,e){let n=0;for(let o=0;o<e;o++)n=n<<1|t>>o&1;return n}function Us(t){let e=new Uint16Array(16),n=0;for(let c of t)c>0&&(e[c]=e[c]+1,n++);let o=new Uint16Array(16),r=0;for(let c=1;c<=15;c++)r=r+e[c-1]<<1,o[c]=r;let a=new Uint16Array(t.length),i=new Uint8Array(t.length);return t.forEach((c,s)=>{if(c===0)return;let l=o[c];o[c]=l+1,a[s]=F0(l,c),i[s]=n===1?0:c;}),{lengths:t,codes:a,emitted:i}}function Ze(t,e,n){t.write(e.codes[n],e.emitted[n]);}function k0(t){let e=[],n=a=>e.push({code:a,extra:0,extraBits:0}),o=T0,r=0;for(;r<t.length;){let a=t[r],i=1;for(;r+i<t.length&&t[r+i]===a;)i++;r+=i;let c=i;if(a===0){for(;c>0;)if(c<3)for(;c>0;c--)n(0);else if(c<=10)e.push({code:17,extra:c-3,extraBits:3}),c=0;else {let s=Math.min(c,138);e.push({code:18,extra:s-11,extraBits:7}),c-=s;}continue}for(a!==o&&(n(a),o=a,c--);c>0;)if(c<3)for(;c>0;c--)n(a);else {let s=Math.min(c,6);e.push({code:16,extra:s-3,extraBits:2}),c-=s;}}return e}function N0(t,e){let n=[];if(e.forEach((c,s)=>{c>0&&n.push(s);}),n.length<=2&&n.every(c=>c<256)){let[c=0,s]=n;t.write(1,1),t.write(n.length===2?1:0,1),c<2?(t.write(0,1),t.write(c,1)):(t.write(1,1),t.write(c,8)),s!==void 0&&t.write(s,8);return}let o=k0(e),r=new Uint32Array(19);for(let c of o)r[c.code]=r[c.code]+1;let a=Us(Qs(r,7)),i=ia.length;for(;i>4&&a.lengths[ia[i-1]]===0;)i--;t.write(0,1),t.write(i-4,4);for(let c=0;c<i;c++)t.write(a.lengths[ia[c]],3);t.write(0,1);for(let c of o)Ze(t,a,c.code),t.write(c.extra,c.extraBits);}function Fr(t){let e=t-1;if(e<4)return {symbol:e,extra:0,extraBits:0};let n=31-Math.clz32(e),o=e>>n-1&1,r=n-1;return {symbol:2*n+o,extra:e&(1<<r)-1,extraBits:r}}function Ns(t,e,n,o){let r=0;for(;r<o&&t[e+r]===t[e+r-n];)r++;return r}function Os(t,e,n){let o=t.length,r=0;for(;r<o;){let a=Math.min(4096,o-r),i=r>=1?Ns(t,r,1,a):0,c=r>=e?Ns(t,r,e,a):0;if(Math.max(i,c)>=3){c>=i?(n.copy(c,e===1?2:1),r+=c):(n.copy(i,2),r+=i);continue}n.literal(t[r]),r++;}}var Ds=20;function Bs(t,e,n){for(let o=0;o<n.length;o++)t[e+o]=n.charCodeAt(o);}function Gs(t,e,n){t[e]=n&255,t[e+1]=n>>>8&255,t[e+2]=n>>>16&255,t[e+3]=n>>>24&255;}function la(t,e,n){if(!(Number.isInteger(e)&&Number.isInteger(n))||e<1||n<1||e>16384||n>16384)throw new RangeError(`WebP images are 1 to 16384 pixels wide and high (got ${e} \xD7 ${n})`);let o=e*n;if(t.length<o*4)throw new RangeError(`Expected ${o*4} bytes of RGBA for ${e} \xD7 ${n}, got ${t.length}`);let r=new Uint32Array(o),a=false;for(let C=0;C<o;C++){let x=C*4,S=t[x],E=t[x+1],w=t[x+2],R=t[x+3];R!==255&&(a=true),r[C]=(R<<24|(S-E&255)<<16|E<<8|w-E&255)>>>0;}let i=new Uint32Array(280),c=new Uint32Array(256),s=new Uint32Array(256),l=new Uint32Array(256),u=new Uint32Array(40);Os(r,e,{literal(C){i[C>>>8&255]++,c[C>>>16&255]++,s[C&255]++,l[C>>>24]++;},copy(C,x){i[256+Fr(C).symbol]++,u[Fr(x).symbol]++;}});let m=[i,c,s,l,u].map(C=>Qs(C,15)),[f,d,p,h,g]=m.map(Us),b=new sa(Math.ceil(o/4)+1024);b.write(47,8),b.write(e-1,14),b.write(n-1,14),b.write(a?1:0,1),b.write(0,3),b.write(1,1),b.write(2,2),b.write(0,1),b.write(0,1),b.write(0,1);for(let C of m)N0(b,C);Os(r,e,{literal(C){Ze(b,f,C>>>8&255),Ze(b,d,C>>>16&255),Ze(b,p,C&255),Ze(b,h,C>>>24);},copy(C,x){let S=Fr(C);Ze(b,f,256+S.symbol),b.write(S.extra,S.extraBits);let E=Fr(x);Ze(b,g,E.symbol),b.write(E.extra,E.extraBits);}});let _=b.finish(),y=_.length+(_.length&1),M=new Uint8Array(Ds+y);return Bs(M,0,"RIFF"),Gs(M,4,M.length-8),Bs(M,8,"WEBPVP8L"),Gs(M,16,_.length),M.set(_,Ds),M}function ca(t,e,n){return String.fromCharCode(...t.subarray(e,e+n))}function qs(t){return t.length>=12&&ca(t,0,4)==="RIFF"&&ca(t,8,4)==="WEBP"}function ua(t){if(!qs(t))return null;let e=12;for(;e+8<=t.length;){let n=ca(t,e,4);if(n==="VP8L")return "lossless";if(n==="VP8 ")return "lossy";let o=(t[e+4]|t[e+5]<<8|t[e+6]<<16|t[e+7]<<24)>>>0;e+=8+o+(o&1);}return null}function O0(t,e,n){return typeof t.toBlob!="function"?Promise.resolve(null):new Promise(o=>{try{t.toBlob(o,e,n);}catch{o(null);}})}async function kr(t,e={}){let n=e.quality!==void 0,o=n?Math.min(1,Math.max(0,Number(e.quality))):1,r=await O0(t,"image/webp",o);if(r){let s=new Uint8Array(await r.arrayBuffer()),l=ua(s);if(l==="lossless"||n&&l==="lossy")return new Blob([s],{type:"image/webp"})}let a=t.getContext("2d");if(!a)throw new Error("Could not get canvas context");let{data:i}=a.getImageData(0,0,t.width,t.height),c=la(i,t.width,t.height);return new Blob([c],{type:"image/webp"})}var zs=32768;async function jn(t){let e=new Uint8Array(await t.arrayBuffer()),n="";for(let o=0;o<e.length;o+=zs)n+=String.fromCharCode(...e.subarray(o,o+zs));return `data:${t.type||"application/octet-stream"};base64,${btoa(n)}`}At();pe();Nr();Fn();var Q0=z.object({x:z.number(),y:z.number(),w:z.number(),h:z.number()});pa();_a();zn();wn();$a();xe();var V0=z.object({fgColor:z.string().optional(),bgColor:z.string().optional()}),X0=z.object({pixelSize:z.number(),url:z.string()}),Y0=z.object({id:z.string(),name:z.string(),description:z.string().optional()});me();At();_e();Wr();Bn();Ee();pe();async function _b(t){let{value:e,size:n=_t,level:o=te,bgColor:r=yt,fgColor:a=Pt,margin:i=Ct,imageSettings:c,eyeColor:s,dotColor:l,bodyPattern:u,cornerEyePattern:m,cornerEyeDotPattern:f,isOGContext:d,templateId:p,customTemplate:h,customProps:g,frame:b,art:_,eyeColors:y,moduleScale:M,frameLabelMarkers:C,partMarkers:x,autoLevel:S,...E}=t,w=lo({value:e,size:n,margin:i,level:o,autoLevel:S},c),R=Gt({value:e,size:n,level:o,margin:i,imageSettings:w,autoLevel:S}),v=Mt.QrCode.encodeText(e,Lt[R]).getModules(),A=v.length+i*2,L=we(v,n,i,w),T=jsx(Fragment,{});if(w!=null&&L!=null){L.excavation!=null&&(v=co(v,L.excavation));let q=w.src.startsWith("data:")?w.src:await fetch(`https://wsrv.nl/?url=${encodeURIComponent(w.src)}&w=100&h=100&encoding=base64`).then(O=>{if(!O.ok)throw new Error(`Failed to load QR logo (${O.status}): ${w.src}`);return O.text()});T=Hr({...w,src:q},{x:L.x+i,y:L.y+i,w:L.w,h:L.h});}let N=ii(v,i),I=Ht(b),G=jsxs("svg",{height:n,viewBox:`0 0 ${A} ${A}`,width:n,xmlns:"http://www.w3.org/2000/svg",...I?{}:E,children:[jsx("path",{d:`M0,0 h${A}v${A}H0z`,fill:wt(r,yt),shapeRendering:"crispEdges"}),jsx("path",{d:N,fill:wt(a,Pt),shapeRendering:"crispEdges"}),T]});return I?Tr(G,{size:n,frame:b,bgColor:r,svgProps:E}):G}za();Wa();var xb=(t,e,n,o)=>{let r=document.createElement("canvas");r.width=e,r.height=n;let a=r.getContext("2d");if(!a)return;a.putImageData(t,0,0);let i=r.toDataURL("image/png"),c=document.createElement("a");c.href=i,c.download=o,document.body.appendChild(c),c.click(),document.body.removeChild(c);},nf=async(t,e,n,o)=>{let{default:r}=await import('jsqr');return new Promise(a=>{t.complete?i():(t.onload=()=>i(),t.onerror=()=>a(null));function i(){let c=document.createElement("canvas");requestAnimationFrame(()=>{if(!(t.naturalWidth&&t.naturalHeight)){a(null);return}let s=t.naturalWidth/t.naturalHeight<=.33||t.naturalWidth/t.naturalHeight>=3?Math.sqrt(t.naturalWidth*t.naturalHeight/12e5):t.naturalWidth/t.naturalHeight<=.5||t.naturalWidth/t.naturalHeight>=2?Math.sqrt(t.naturalWidth*t.naturalHeight/9e5):Math.sqrt(t.naturalWidth*t.naturalHeight/64e4),l=c.getContext("2d",{willReadFrequently:true});if(!l){a(null);return}let u=[1,.8,.6,.4,.2,.1];for(let m of u){let f=Math.floor(t.naturalWidth*e*m/s),d=Math.floor(t.naturalHeight*e*m/s);c.width=f,c.height=d,l.clearRect(0,0,f,d),l.imageSmoothingEnabled=true,l.imageSmoothingQuality="high";try{l.drawImage(t,Math.floor(n),Math.floor(o),Math.floor(t.naturalWidth*e),Math.floor(t.naturalHeight*e),0,0,f,d);let p=l.getImageData(0,0,f,d);try{let h=r(p.data,f,d);if(h?.data){a(h);return}}catch(h){console.error("QR Detection error:",h);}}catch(p){console.error("Canvas drawing error:",p);}}a(null);});}})},ru=async(t,e,n=false)=>{if(!t)return "NO_QR";await new Promise(r=>setTimeout(r,100));let o=[{dx:0,dy:0,ratio:1},{dx:0,dy:t.naturalHeight*.35,ratio:.65},{dx:t.naturalWidth*.35,dy:t.naturalHeight*.35,ratio:.65},{dx:t.naturalWidth*.35,dy:0,ratio:.65},{dx:t.naturalWidth*.35/2,dy:t.naturalHeight*.35/2,ratio:.65}];for(let r of o)try{let a=await nf(t,r.ratio,r.dx,r.dy);if(a?.data)return n?a:a.data}catch(a){console.warn("QR decode error:",a);}return "NO_QR"};function Sb(t,e,n){if(!(t&&e)||e.length!==4)return;let o=document.createElement("canvas");o.width=t.naturalWidth,o.height=t.naturalHeight;let r=o.getContext("2d");if(!r)return;r.drawImage(t,0,0),r.save(),r.strokeStyle="#ff0000",r.lineWidth=Math.max(5,Math.min(t.naturalWidth,t.naturalHeight)/200),r.shadowColor="transparent",r.shadowBlur=0,r.beginPath(),r.moveTo(e[0].x,e[0].y),r.lineTo(e[1].x,e[1].y),r.lineTo(e[3].x,e[3].y),r.lineTo(e[2].x,e[2].y),r.closePath(),r.stroke(),r.fillStyle="#ff0000",e.forEach((c,s)=>{r.fillRect(c.x-3,c.y-3,6,6),r.fillStyle="#ffffff",r.font="16px Arial",r.fillText(`${s}`,c.x+5,c.y-5),r.fillStyle="#ff0000";}),r.restore();let a=o.toDataURL("image/png"),i=document.createElement("a");i.href=a,i.download=n,document.body.appendChild(i),i.click(),document.body.removeChild(i);}At();At();me();At();_e();tn();Ee();ht();Bt();Fn();At();_e();pe();ao();Bt();fe();ao();Bt();fe();ht();Bt();fe();var ou=["gradientUnits","gradientTransform","spreadMethod"],rf={linear:["x1","y1","x2","y2"],radial:["cx","cy","r","fx","fy","fr"]},of={r:0,g:0,b:0,a:1};function au(t,e){for(let n of (t.attrs.style??"").split(";")){let[o,...r]=n.split(":");if(o?.trim()===e)return r.join(":").trim()}return t.attrs[e]}function mi(t){return t.name==="linearGradient"?"linear":t.name==="radialGradient"?"radial":null}function af(t){let e=[],n=0;for(let o of t.children){if(o.name!=="stop")continue;let r=(o.attrs.offset??"0").trim(),a=Number.parseFloat(r),i=Number.isFinite(a)?r.endsWith("%")?a/100:a:0;n=Math.max(n,Math.min(Math.max(i,0),1));let c=au(o,"stop-color")??"#000000",s=dt(c==="currentColor"?"#000000":c)??of,l=Number.parseFloat(au(o,"stop-opacity")??"1");e.push({offset:n,color:Number.isFinite(l)?{...s,a:s.a*Math.min(Math.max(l,0),1)}:s});}return e}function mo(t){let e=new Map,n=r=>{let a=r.attrs.id;mi(r)&&a&&!e.has(a)&&e.set(a,r);for(let i of r.children)n(i);};n(t);let o=new Map;for(let[r,a]of e){let i=mi(a),c={},s=[],l=new Set,u=a;for(;u&&!l.has(u);){l.add(u);let m=mi(u)===i?[...ou,...rf[i]]:ou;for(let d of m){let p=u.attrs[d];c[d]===void 0&&p!==void 0&&(c[d]=p);}s.length===0&&(s=af(u));let f=u.attrs.href??u.attrs["xlink:href"];u=f?.startsWith("#")?e.get(f.slice(1)):void 0;}o.set(r,{kind:i,attrs:c,stops:s});}return o}function di(t){let e=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,r=Number.NEGATIVE_INFINITY,a=(m,f)=>{e=Math.min(e,m),o=Math.max(o,m),n=Math.min(n,f),r=Math.max(r,f);},i=(m,f,d,p)=>{let h=-m+3*f-3*d+p,g=2*(m-2*f+d),b=f-m;if(Math.abs(h)<1e-12)return Math.abs(g)<1e-12?[]:[-b/g];let _=g*g-4*h*b;if(_<0)return [];let y=Math.sqrt(_);return [(-g+y)/(2*h),(-g-y)/(2*h)]},c=(m,f,d,p,h)=>{let g=1-m;return g*g*g*f+3*g*g*m*d+3*g*m*m*p+m**3*h},s=0,l=0,u=[0,0];for(let m of t)if(m.op==="M"&&(u=[m.x,m.y]),m.op==="M"||m.op==="L")a(m.x,m.y),s=m.x,l=m.y;else if(m.op==="C"){a(m.x,m.y);for(let f of [...i(s,m.x1,m.x2,m.x),...i(l,m.y1,m.y2,m.y)])f>0&&f<1&&a(c(f,s,m.x1,m.x2,m.x),c(f,l,m.y1,m.y2,m.y));s=m.x,l=m.y;}else [s,l]=u;return Number.isFinite(e)?{x:e,y:n,width:o-e,height:r-n}:null}var sf=t=>t[0]*t[3]-t[1]*t[2];function Be(t){let e=sf(t);if(!Number.isFinite(e)||Math.abs(e)<1e-12)return null;let[n,o,r,a,i,c]=t;return [a/e,-o/e,-r/e,n/e,(r*c-a*i)/e,(o*i-n*c)/e]}function su(t,e,n){let{kind:o,attrs:r,stops:a}=t,i=a[0],c=a.at(-1);if(!(i&&c)||a.every(x=>x.color.a===0))return null;if(a.length===1)return i.color;let s=r.gradientUnits==="userSpaceOnUse",l=yr;if(!s){let x=di(e);if(!x||x.width<=0||x.height<=0)return null;l=[x.width,0,0,x.height,x.x,x.y];}let u=pt(l,ne(r.gradientTransform));if(!Be(u))return c.color;let[m,f]=n,d=Math.sqrt((m*m+f*f)/2),p=(x,S)=>{let E=Number.parseFloat(x);return Number.isFinite(E)?x.trim().endsWith("%")?E/100*(s?S:1):E:null},h=(x,S,E)=>p(r[x]??S,E)??p(S,E)??0;if(o==="linear"){let x=[h("x1","0%",m),h("y1","0%",f),h("x2","100%",m),h("y2","0%",f)],[S,E,w,R]=x;return S===w&&E===R?c.color:{kind:o,coords:x,matrix:u,stops:a}}let g=h("cx","50%",m),b=h("cy","50%",f),_=h("r","50%",d),y=r.fx===void 0?g:h("fx","50%",m),M=r.fy===void 0?b:h("fy","50%",f),C=Math.max(0,h("fr","0%",d));return _<0?null:_===0?c.color:{kind:o,coords:[y,M,C,g,b,_],matrix:u,stops:a}}function fo(t){return t.map(e=>$(e,6)).join(" ")}function cf(t,e){return (e==="cmyk"?Te(t.r,t.g,t.b):[t.r/255,t.g/255,t.b/255]).map(o=>$(o,4)).join(" ")}var iu=(t,e)=>`<< /FunctionType 2 /Domain [0 1] /C0 [${t}] /C1 [${e}] /N 1 >>`;function lf(t,e){let n=[],o=t.map(c=>st(c.offset,4)),r=t.map(c=>cf(c.color,e)),a=o[0],i=o.at(-1);if(a>0){let c=r[0];n.push({from:0,to:a,c0:c,c1:c});}for(let c=0;c+1<t.length;c++){let s=o[c],l=o[c+1];l>s&&n.push({from:s,to:l,c0:r[c],c1:r[c+1]});}if(i<1){let c=r.at(-1);n.push({from:i,to:1,c0:c,c1:c});}if(n.length===1){let[c]=n;return iu(c.c0,c.c1)}return ["<< /FunctionType 3 /Domain [0 1]",`/Functions [${n.map(c=>iu(c.c0,c.c1)).join(" ")}]`,`/Bounds [${n.slice(1).map(c=>$(c.from,4)).join(" ")}]`,`/Encode [${n.map(()=>"0 1").join(" ")}] >>`].join(" ")}function ho(t,e){return [`<< /ShadingType ${t.kind==="linear"?2:3}`,`/ColorSpace /Device${e==="cmyk"?"CMYK":"RGB"}`,`/Coords [${t.coords.map(n=>$(n,6)).join(" ")}]`,`/Function ${lf(t.stops,e)}`,"/Extend [true true] >>"].join(" ")}function uf(t,e){if(t.op==="Z")return t;if(t.op==="C"){let[r,a]=Y(e,t.x1,t.y1),[i,c]=Y(e,t.x2,t.y2),[s,l]=Y(e,t.x,t.y);return {op:"C",x1:r,y1:a,x2:i,y2:c,x:s,y:l}}let[n,o]=Y(e,t.x,t.y);return {op:t.op,x:n,y:o}}var cu={r:255,g:255,b:255,a:1},mf=/^url\(\s*#bg-color-/,po=/^url\(\s*#([^)\s]+)\s*\)/,df=new Set(["defs","clipPath","mask","pattern","linearGradient","radialGradient","symbol","title","desc","metadata","style","script","use","foreignObject"]);function K(t,e){let n=t.attrs.style;if(n)for(let o of n.split(";")){let[r,...a]=o.split(":");if(r?.trim()===e)return a.join(":").trim()}return t.attrs[e]}function j(t,e,n=0){if(t===void 0||t==="")return n;let o=Number.parseFloat(t);return Number.isNaN(o)?n:t.trim().endsWith("%")?o/100*e:o}function ir(t,e){if((t.name==="linearGradient"||t.name==="radialGradient")&&t.attrs.id){let n=t.children.find(r=>r.name==="stop"),o=n&&(K(n,"stop-color")??"#000000");o&&e.set(t.attrs.id,o);}for(let n of t.children)ir(n,e);return e}function sr(t,e){if(t.name==="image"){let n=t.attrs.href??t.attrs["xlink:href"];n&&e.add(n);}for(let n of t.children)sr(n,e);return e}function go(t){return /^data:image\/png[;,]/i.test(t)?"PNG":/^data:image\/jpe?g[;,]/i.test(t)?"JPEG":null}async function bo(t){return typeof document>"u"||typeof Image>"u"?null:await new Promise(e=>{let n=new Image;n.crossOrigin="anonymous",n.onload=()=>{let o=document.createElement("canvas"),r=Math.max(n.naturalWidth||512,n.naturalHeight||512),a=Math.min(1024/r,4);o.width=Math.round((n.naturalWidth||512)*a),o.height=Math.round((n.naturalHeight||512)*a);let i=o.getContext("2d");if(!i){e(null);return}i.drawImage(n,0,0,o.width,o.height);try{e(o.toDataURL("image/png"));}catch{e(null);}},n.onerror=()=>e(null),n.src=t;})}function lu(t,e,n){let o={x:j(t.attrs.x,e[0]),y:j(t.attrs.y,e[1]),width:j(t.attrs.width,e[0]),height:j(t.attrs.height,e[1])};if(o.width<=0||o.height<=0)return null;let r=(t.attrs.preserveAspectRatio??"").trim();if(!r||r.startsWith("none")||!n||!(n.width>0&&n.height>0))return {draw:o,clip:null};let[a="xMidYMid",i="meet"]=r.split(/\s+/),c=i==="slice",s=(c?Math.max:Math.min)(o.width/n.width,o.height/n.height),l=n.width*s,u=n.height*s,m=f=>{let d=f==="x"?a.slice(0,4):a.slice(4);return d.endsWith("Min")?0:d.endsWith("Max")?1:.5};return {draw:{x:o.x+(o.width-l)*m("x"),y:o.y+(o.height-u)*m("y"),width:l,height:u},clip:c?o:null}}function uu(t,e){t.name==="clipPath"&&t.attrs.id&&e.set(t.attrs.id,t);for(let n of t.children)uu(n,e);return e}function mu(t,e){t.name==="pattern"&&t.attrs.id&&e.set(t.attrs.id,t);for(let n of t.children)mu(n,e);return e}function ff(t,e){let[n,o]=e,r=(a,i)=>j(t.attrs[a],i);switch(t.name){case "path":return de(t.attrs.d??"");case "rect":{let a=t.attrs.rx??t.attrs.ry,i=t.attrs.ry??t.attrs.rx;return oe(r("x",n),r("y",o),r("width",n),r("height",o),j(a,n),j(i,o))}case "circle":{let a=r("r",Math.hypot(n,o)/Math.SQRT2);return re(r("cx",n),r("cy",o),a,a)}case "ellipse":return re(r("cx",n),r("cy",o),r("rx",n),r("ry",o));default:return []}}var Gn=class{gradients;shadings;clipPaths=new Map;patterns=new Map;backdrop=cu;paper=cu;background=null;onPaper=false;inConic=false;constructor(e,n=null){this.gradients=e,this.shadings=n;}resolveColor(e){if(!e||e==="none")return null;let n=po.exec(e);if(n)return this.resolveColor(this.gradients.get(n[1]));let o=dt(e==="currentColor"?"#000000":e);return o&&o.a>0?o:null}shadedGradient(e){let n=e?po.exec(e)?.[1]:void 0;return n?this.shadings?.get(n):void 0}resolveFill(e,n,o,r=1){if(r<=0)return null;let a=this.patternOf(e);if(a)return {pattern:a,alpha:r};let i=this.shadedGradient(e);if(i){let l=su(i,n,o);if(!l)return null;if("coords"in l)return {gradient:l,alpha:r};let u={...l,a:l.a*r};return u.a>0?{color:u}:null}let c=this.resolveColor(e);if(!c)return null;let s={...c,a:c.a*r};return s.a>0?{color:s}:null}patternOf(e){let n=e?po.exec(e)?.[1]:void 0,o=n?this.patterns.get(n):void 0;if(!(o?.attrs.patternUnits!=="userSpaceOnUse"||(o.attrs.patternContentUnits??"userSpaceOnUse")!=="userSpaceOnUse"||o.attrs.viewBox))return o}flatten(e){if(e.a>=1)return e;let n=this.background,o=n!==null&&Math.abs(n.r-e.r)<.5&&Math.abs(n.g-e.g)<.5&&Math.abs(n.b-e.b)<.5&&Math.abs(n.a-e.a)<.002;return oo(e,this.onPaper||o?this.paper:this.backdrop)}paintPattern(e,n,o,r){let a=di(e);if(!a||a.width<=0||a.height<=0)return true;let[i,c]=n.viewport,s=j(o.attrs.x,i),l=j(o.attrs.y,c),u=j(o.attrs.width,i),m=j(o.attrs.height,c);if(!(u>0&&m>0))return true;let f=ne(o.attrs.patternTransform),d=Be(f);if(!d)return true;if(!this.beginClip(e,n.matrix,n.fillRule==="evenodd"))return false;let p=this.inConic;this.inConic=o.attrs["data-qrdx-conic"]!==void 0;try{let h=[Y(d,a.x,a.y),Y(d,a.x+a.width,a.y),Y(d,a.x,a.y+a.height),Y(d,a.x+a.width,a.y+a.height)],g=h.map(([L])=>L),b=h.map(([,L])=>L),_=Math.min(...g),y=Math.max(...g),M=Math.min(...b),C=Math.max(...b),x=Math.floor((_-s)/u),S=Math.ceil((y-s)/u)-1,E=Math.floor((M-l)/m),w=Math.ceil((C-l)/m)-1,R=(S-x+1)*(w-E+1);if(R>4096)return !0;let v=(o.attrs["data-qrdx-conic"]??"").trim().split(/\s+/).map(Number),A=pt(n.matrix,f);for(let L=E;L<=w;L++)for(let T=x;T<=S;T++){let N=s+T*u,I=l+L*m,G=pt(A,[1,0,0,1,N,I]),q={x:_-N,y:M-I,width:y-_,height:C-M},O=v.length===2&&v.every(Number.isFinite)?ql(v[0],v[1],q):null,z=R>1&&this.beginClip([{op:"M",x:0,y:0},{op:"L",x:u,y:0},{op:"L",x:u,y:m},{op:"L",x:0,y:m},{op:"Z"}],G,!1);try{let et={matrix:G,viewport:n.viewport,fill:"#000000",fillRule:"nonzero",stroke:"none",strokeWidth:1,fontSize:16,fontWeight:"normal",textAnchor:"start",fillOpacity:1,opacity:r},St=(ct,F)=>{for(let H of ct){if(H.name==="g"&&!H.attrs.transform){let W=Number.parseFloat(H.attrs.opacity??"1");St(H.children,{...F,opacity:(F.opacity??1)*(Number.isFinite(W)?W:1)});continue}if(O&&H.attrs["data-arc"]){let[W,Rt]=H.attrs["data-arc"].split(/\s+/).map(Number);if(!zl([W,W+Rt],O))continue}this.walk(H,F);}};St(o.children,et);}finally{z&&this.endClip();}}}finally{this.inConic=p,this.endClip();}return true}paintBleed(e,n,o,r){if(!this.shadedGradient(o))return false;let[a,i]=this.viewportMatrix({...e,attrs:{...e.attrs,x:"0",y:"0"}},{...n,matrix:pt(n.matrix,ne(e.attrs.transform))}),c=Be(a);if(!c)return false;let[s,l,u,m]=r,d=[[s,l],[u,l],[u,m],[s,m]].map(([p,h])=>Y(c,p,h)).map(([p,h],g)=>({op:g===0?"M":"L",x:p,y:h}));return d.push({op:"Z"}),this.paint(d,{name:"rect",attrs:{},children:[],text:""},{...n,matrix:a,viewport:i,fill:o,fillRule:"nonzero",stroke:"none"}),true}beginClip(e,n,o){return false}endClip(){}clipOf(e,n){let o=K(e,"clip-path"),r=o?po.exec(o)?.[1]:void 0,a=r?this.clipPaths.get(r):void 0;if(!a)return null;let i=[],c=false;for(let s of a.children){let l=ff(s,n.viewport);if(l.length===0)continue;let u=ne(s.attrs.transform),m=u[0]===1&&u[1]===0&&u[2]===0&&u[3]===1&&u[4]===0&&u[5]===0;i.push(...m?l:l.map(f=>uf(f,u))),c||=K(s,"clip-rule")==="evenodd";}return i.length>0?{segments:i,matrix:n.matrix,evenOdd:c}:null}viewportMatrix(e,n){let o=j(e.attrs.x,n.viewport[0]),r=j(e.attrs.y,n.viewport[1]),a=j(e.attrs.width,n.viewport[0],n.viewport[0]),i=j(e.attrs.height,n.viewport[1],n.viewport[1]),c=Ve(e.attrs.viewBox);if(c.length!==4||!(c[2]&&c[3]))return [pt(n.matrix,[1,0,0,1,o,r]),[a,i]];let[s,l,u,m]=c,f=a/u,d=i/m,p=o,h=r;if((e.attrs.preserveAspectRatio??"").trim()!=="none"){let g=e.attrs.preserveAspectRatio?.includes("slice")?Math.max(f,d):Math.min(f,d);p+=(a-u*g)/2,h+=(i-m*g)/2,f=g,d=g;}return [pt(n.matrix,[f,0,0,d,p-s*f,h-l*d]),[u,m]]}walk(e,n,o=false){if(o&&(this.clipPaths=uu(e,new Map),this.patterns=mu(e,new Map)),df.has(e.name)||K(e,"display")==="none"||K(e,"visibility")==="hidden")return;let r=pt(n.matrix,ne(e.attrs.transform)),a=n.viewport;if(e.name==="svg"){let[f,d]=this.viewportMatrix(o?{...e,attrs:{...e.attrs,x:"0",y:"0"}}:e,{...n,matrix:r});r=f,a=d;}let i=K(e,"font-size"),c=Number.parseFloat(K(e,"opacity")??"1"),s=K(e,"fill-opacity"),l=s===void 0?n.fillOpacity??1:Number.parseFloat(s),u={fillOpacity:Number.isFinite(l)?Math.min(Math.max(l,0),1):1,opacity:(n.opacity??1)*(Number.isFinite(c)?Math.min(Math.max(c,0),1):1),matrix:r,viewport:a,fill:K(e,"fill")??n.fill,fillRule:K(e,"fill-rule")??n.fillRule,stroke:K(e,"stroke")??n.stroke,strokeWidth:K(e,"stroke-width")===void 0?n.strokeWidth:j(K(e,"stroke-width"),a[0],1),fontSize:i===void 0?n.fontSize:j(i,16,16),fontWeight:K(e,"font-weight")??n.fontWeight,textAnchor:K(e,"text-anchor")??n.textAnchor},m=this.onPaper;(e.name==="rect"||e.name==="circle"||e.name==="path")&&mf.test(K(e,"fill")??"")&&(this.onPaper=true);try{let f=e.attrs["clip-path"]?this.clipOf(e,u):null;if(f&&this.beginClip(f.segments,f.matrix,f.evenOdd)){try{this.paintNode(e,u);}finally{this.endClip();}return}this.paintNode(e,u);}finally{this.onPaper=m;}}paintNode(e,n){let[o,r]=n.viewport,a=(i,c)=>j(e.attrs[i],c);switch(e.name){case "path":this.paint(de(e.attrs.d??""),e,n);return;case "rect":{let i=e.attrs.rx??e.attrs.ry,c=e.attrs.ry??e.attrs.rx;this.paint(oe(a("x",o),a("y",r),a("width",o),a("height",r),j(i,o),j(c,r)),e,n);return}case "circle":{let i=a("r",Math.hypot(o,r)/Math.SQRT2);this.paint(re(a("cx",o),a("cy",r),i,i),e,n);return}case "ellipse":this.paint(re(a("cx",o),a("cy",r),a("rx",o),a("ry",r)),e,n);return;case "line":this.paint([{op:"M",x:a("x1",o),y:a("y1",r)},{op:"L",x:a("x2",o),y:a("y2",r)}],e,{...n,fill:"none"});return;case "polygon":case "polyline":{let i=Ve(e.attrs.points),c=[];for(let s=0;s+1<i.length;s+=2)c.push({op:s===0?"M":"L",x:i[s],y:i[s+1]});e.name==="polygon"&&c.length>0&&c.push({op:"Z"}),this.paint(c,e,n);return}case "text":this.text(e,n);return;case "image":this.image(e,n);return;default:for(let i of e.children)this.walk(i,n);}}};var _o=1e3;async function cr(t){let e=await ce(sn({...t,size:t.size??_t},_o));return decodeURIComponent(e.replace("data:image/svg+xml,",""))}function fi(t){if(Ht(t.frame)){let e=je(_o,t.frame);return e.squareEdges?e.color:null}return wt(t.bgColor,yt)}function yo(t,e){let n=fi(t);if(!(n&&Tn(t.bgColor))||Ht(t.frame)||t.templateId||t.customTemplate)return n;let o=ve(e)?.children.find(a=>a.name==="rect"),r=o&&K(o,"fill");return r?.startsWith("url(")?r:n}function $o(t,e){let n={r:255,g:255,b:255,a:1},o=dt(wt(e.bgColor,yt));t.paper=n,t.background=o&&!Tn(e.bgColor)?o:null,t.backdrop=o?oo(o,n):n;}fe();Bt();var xo=25.4,du=5,fu=2e3,Re=_o,hi=5,hu=2,pf=.25*(xo/72);function gf(t,e="mm"){return e==="in"?t*xo:t}function bf(t){let e=Gt(t),n=Mt.QrCode.encodeText(t.value,Lt[e]).size;return n+Ft(n,t.margin??Ct,t.shape)*2}function So(t,e){let n=gf(e.size,e.unit);if(!Number.isFinite(n)||n<du||n>fu)throw new Error(`Print size must be between ${du} mm and ${fu/1e3} m`);let o=Math.min(Math.max(e.bleed??0,0),20),r=n/Re,a=Ht(t.frame)?je(Re,t.frame):null,i=(a?.width??Re)*r,c=(a?.height??Re)*r,s=e.cropMarks?o+hu+hi+1:o,l=bf(t);return {codeWidth:n,trimWidth:i,trimHeight:c,bleed:o,pageWidth:i+2*s,pageHeight:c+2*s,trimX:s,trimY:s,moduleSize:n/l,moduleCount:l,maxScanDistance:n*10}}var pi=class t{pdf;internals;names=new Map;constructor(e,n){this.pdf=e,this.internals=n;}static attach(e){let n=e.internal;return typeof e.advancedAPI!="function"||typeof e.addShadingPattern!="function"||typeof n.write!="function"||typeof n.events?.subscribe!="function"?null:new t(e,n)}name(e){let n=this.names.get(e);return n||(this.names.size===0&&this.install(),n=`Sh${this.names.size}`,this.names.set(e,n)),n}install(){this.pdf.advancedAPI(e=>{e.addShadingPattern("qrdx-shadings",{});}),this.internals.events.subscribe("putShadingPatternDict",()=>{for(let[e,n]of this.names)this.internals.write(`/${n} ${e}`);});}},gi=class extends Gn{pdf;cmyk;images;shadingResources;constructor(e,n,o,r,a){super(o,r?.gradients??null),this.pdf=e,this.cmyk=n,this.images=a,this.shadingResources=r?.resources??null;}setColor(e,n){let o=e==="fill"?this.pdf.setFillColor.bind(this.pdf):e==="draw"?this.pdf.setDrawColor.bind(this.pdf):this.pdf.setTextColor.bind(this.pdf);if(this.cmyk){let[r,a,i,c]=Te(n.r,n.g,n.b);o(r,a,i,c);}else o(Math.round(n.r),Math.round(n.g),Math.round(n.b));}setRegistrationColor(){this.cmyk?this.pdf.setDrawColor(1,1,1,1):this.pdf.setDrawColor(0,0,0);}tracePath(e,n){let o=false;for(let r of e)if(r.op==="M"){let[a,i]=Y(n,r.x,r.y);this.pdf.moveTo(a,i),o=true;}else if(r.op==="L"){let[a,i]=Y(n,r.x,r.y);o?this.pdf.lineTo(a,i):(this.pdf.moveTo(a,i),o=true);}else if(r.op==="C"){let[a,i]=Y(n,r.x1,r.y1),[c,s]=Y(n,r.x2,r.y2),[l,u]=Y(n,r.x,r.y);this.pdf.curveTo(a,i,c,s,l,u);}else o&&this.pdf.close();}shade(e,n,o){let r=this.pdf.internal,a=r.scaleFactor,i=[a,0,0,-a,0,r.pageSize.getHeight()*a],c=pt(i,pt(n.matrix,o.matrix));if(!(this.shadingResources&&Be(c)))return;let s=this.shadingResources.name(ho(o,this.cmyk?"cmyk":"rgb"));this.pdf.saveGraphicsState(),this.tracePath(e,n.matrix),this.pdf.clip(n.fillRule==="evenodd"?"evenodd":void 0),this.pdf.discardPath(),r.write(`${fo(c)} cm /${s} sh`),this.pdf.restoreGraphicsState();}beginClip(e,n,o){return this.pdf.saveGraphicsState(),this.tracePath(e,n),this.pdf.clip(o?"evenodd":void 0),this.pdf.discardPath(),true}endClip(){this.pdf.restoreGraphicsState();}withAlpha(e,n,o){if(e>=1&&n>=1){o();return}this.pdf.saveGraphicsState();let r=this.pdf.GState;this.pdf.setGState(new r({opacity:e,"stroke-opacity":n}));try{o();}finally{this.pdf.restoreGraphicsState();}}opaqueGradient(e,n){let o=e.stops[0]?.color.a??1;return e.stops.every(a=>Math.abs(a.color.a-o)<.002)?{gradient:{...e,stops:e.stops.map(a=>({...a,color:{...a.color,a:1}}))},alpha:o*n}:{gradient:{...e,stops:e.stops.map(a=>({...a,color:this.flatten({...a.color,a:a.color.a*n})}))},alpha:1}}paint(e,n,o){if(e.length===0)return;let r=o.opacity??1;if(r<=0)return;let a=this.resolveFill(o.fill,e,o.viewport,(o.fillOpacity??1)*r);if(a&&"pattern"in a)this.paintPattern(e,o,a.pattern,a.alpha);else if(a&&"gradient"in a){let{gradient:m,alpha:f}=this.opaqueGradient(a.gradient,a.alpha);this.withAlpha(f,1,()=>this.shade(e,o,m));}let i=a&&"color"in a?a.color:null,c=i&&this.inConic?this.flatten(i):i,s=o.strokeWidth>0?this.resolveColor(o.stroke):null,l=s&&{...s,a:s.a*r};if(!(c||l))return;let u=o.fillRule==="evenodd";this.withAlpha(c?.a??1,l?.a??1,()=>{c&&this.setColor("fill",c),l&&(this.setColor("draw",l),this.pdf.setLineWidth(o.strokeWidth*Sn(o.matrix))),this.tracePath(e,o.matrix),c&&l?u?this.pdf.fillStrokeEvenOdd():this.pdf.fillStroke():c?u?this.pdf.fillEvenOdd():this.pdf.fill():this.pdf.stroke();});}text(e,n){let o=e.text.replace(/\s+/g," ").trim(),r=this.resolveColor(n.fill);if(!(o&&r))return;let a=Sn(n.matrix),[i,c]=Y(n.matrix,j(e.attrs.x,n.viewport[0]),j(e.attrs.y,n.viewport[1])),s=n.fontWeight==="bold"||Number.parseInt(n.fontWeight,10)>=600;this.pdf.setFont("helvetica",s?"bold":"normal");let l=n.fontSize*a*(72/xo);this.pdf.setFontSize(l);let u=Number.parseFloat(e.attrs["data-max-width"]??"");if(u>0){let d=u*a,p=this.pdf.getTextWidth(o);p>d&&(l*=d/p,this.pdf.setFontSize(l));}this.setColor("text",r);let m=Math.atan2(n.matrix[1],n.matrix[0]);if(Math.abs(m)>2e-4){let d=n.textAnchor==="middle"?this.pdf.getTextWidth(o)/2:n.textAnchor==="end"?this.pdf.getTextWidth(o):0;this.pdf.text(o,i-d*Math.cos(m),c-d*Math.sin(m),{angle:-m*180/Math.PI,baseline:"alphabetic"});return}let f=n.textAnchor==="middle"?"center":n.textAnchor==="end"?"right":"left";this.pdf.text(o,i,c,{align:f,baseline:"alphabetic"});}aliases=new Map;image(e,n){let o=e.attrs.href??e.attrs["xlink:href"],r=o&&(go(o)?o:this.images.get(o)),a=r&&go(r);if(!(r&&a))return;let i=this.aliases.get(r);i||(i=`qrdx-image-${this.aliases.size}`,this.aliases.set(r,i));let c=null;if(e.attrs.preserveAspectRatio)try{let g=this.pdf.getImageProperties(r);c={width:g.width,height:g.height};}catch{c=null;}let s=lu(e,n.viewport,c);if(!s)return;let{draw:l,clip:u}=s,[m,f]=Y(n.matrix,l.x,l.y),[d,p]=Y(n.matrix,l.x+l.width,l.y+l.height),h=u!==null&&this.beginClip([{op:"M",x:u.x,y:u.y},{op:"L",x:u.x+u.width,y:u.y},{op:"L",x:u.x+u.width,y:u.y+u.height},{op:"L",x:u.x,y:u.y+u.height},{op:"Z"}],n.matrix,false);try{this.withAlpha(n.opacity??1,1,()=>{this.pdf.addImage(r,a,Math.min(m,d),Math.min(f,p),Math.abs(d-m),Math.abs(p-f),i);});}finally{h&&this.endClip();}}};function _f(t,e,n){let{trimX:o,trimY:r,trimWidth:a,trimHeight:i,bleed:c}=n,s=c+hu,l=o,u=o+a,m=r,f=r+i;e.setRegistrationColor(),t.setLineWidth(pf);for(let d of [l,u]){let p=d===l?-1:1;for(let h of [m,f]){let g=h===m?-1:1;t.line(d+p*s,h,d+p*(s+hi),h),t.line(d,h+g*s,d,h+g*(s+hi));}}}async function yf(t,e){return (await pu(t,e)).output("dataurlstring")}async function n_(t,e){return (await pu(t,e)).output("arraybuffer")}async function pu(t,e){let n=So(t,e),o;try{({jsPDF:o}=await import('jspdf'));}catch(b){throw new Error(`PDF export needs the optional "jspdf" package. Install it with \`npm install jspdf\`. (${b})`)}let r=await cr(t),a=ve(r);if(!a)throw new Error("Failed to render the QR code for printing");let i=new Map;for(let b of sr(a,new Set))if(!go(b)){let _=await bo(b);_&&i.set(b,_);}let c=new o({orientation:n.pageWidth>n.pageHeight?"landscape":"portrait",unit:"mm",format:[n.pageWidth,n.pageHeight],compress:true,floatPrecision:3});c.setProperties({title:"QR code",creator:"qrdx"});let s=mo(a),l=s.size>0?pi.attach(c):null,u=new gi(c,e.colorMode==="cmyk",ir(a,new Map),l?{gradients:s,resources:l}:null,i);$o(u,t);let m=n.codeWidth/Re,f=j(a.attrs.width,Re,Re),d=j(a.attrs.height,Re,Re),p={matrix:pt([1,0,0,1,n.trimX,n.trimY],[m,0,0,m,0,0]),viewport:[f,d],fill:"#000000",fillRule:"nonzero",stroke:"none",strokeWidth:1,fontSize:16,fontWeight:"normal",textAnchor:"start"},h=n.bleed>0?yo(t,r):null,g=[n.trimX-n.bleed,n.trimY-n.bleed,n.trimX+n.trimWidth+n.bleed,n.trimY+n.trimHeight+n.bleed];if(!(h&&u.paintBleed(a,p,h,g))){let b=h?u.resolveColor(h):null;b&&(u.setColor("fill",b),c.rect(n.trimX-n.bleed,n.trimY-n.bleed,n.trimWidth+2*n.bleed,n.trimHeight+2*n.bleed,"F"));}return u.walk(a,p,true),e.cropMarks&&_f(c,u,n),c}async function $f(t,e){let n=So(t,{size:e.size,unit:e.unit}),o=await cr(t),r=e.unit??"mm",a=s=>`${$(r==="in"?s/xo:s)}${r}`,i=/^<svg\b[^>]*>/.exec(o)?.[0];if(!i)throw new Error("Failed to render the QR code for printing");return `<?xml version="1.0" encoding="UTF-8"?>
2
+ ${i.replace(/\swidth="[^"]*"/,` width="${a(n.trimWidth)}"`).replace(/\sheight="[^"]*"/,` height="${a(n.trimHeight)}"`)}${o.slice(i.length)}`}async function r_(t,e){let n=await yf(t,e);le(n,e.filename??"qr-code-print.pdf");}async function o_(t,e){let n=await $f(t,e);le(`data:image/svg+xml;charset=utf-8,${encodeURIComponent(n)}`,e.filename??"qr-code-print.svg");}pe();ht();Bt();var xf=[137,80,78,71,13,10,26,10];async function bu(t,e){let n=new Blob([t]).stream().pipeThrough(e);return new Uint8Array(await new Response(n).arrayBuffer())}async function _u(t){return typeof CompressionStream>"u"?null:await bu(t,new CompressionStream("deflate"))}async function Sf(t){if(typeof DecompressionStream>"u")return null;try{return await bu(t,new DecompressionStream("deflate"))}catch{return null}}var bi=(t,e)=>t[e]*2**24+(t[e+1]<<16)+(t[e+2]<<8)+t[e+3]>>>0,gu={0:1,2:3,3:1,4:2,6:4};function Mf(t,e,n){let o=t+e-n,r=Math.abs(o-t),a=Math.abs(o-e),i=Math.abs(o-n);return r<=a&&r<=i?t:a<=i?e:n}async function _i(t){if(xf.some((h,g)=>t[g]!==h))return null;let e=8,n=0,o=0,r=-1,a=null,i=null,c=[];for(;e+8<=t.length;){let h=bi(t,e),g=String.fromCharCode(...t.subarray(e+4,e+8)),b=t.subarray(e+8,e+8+h);if(e+=12+h,g==="IHDR"){n=bi(b,0),o=bi(b,4);let _=b[8];r=b[9];let y=b[12];if(_!==8||y!==0||!(r in gu))return null}else if(g==="PLTE")a=b;else if(g==="tRNS")i=b;else if(g==="IDAT")c.push(b);else if(g==="IEND")break}if(!(n&&o)||n*o>4096*4096)return null;let s=new Uint8Array(c.reduce((h,g)=>h+g.length,0)),l=0;for(let h of c)s.set(h,l),l+=h.length;let u=await Sf(s),m=gu[r],f=n*m;if(!u||u.length<o*(f+1))return null;let d=new Uint8Array(o*f);for(let h=0;h<o;h++){let g=u[h*(f+1)],b=u.subarray(h*(f+1)+1,(h+1)*(f+1)),_=h*f;for(let y=0;y<f;y++){let M=y>=m?d[_+y-m]:0,C=h>0?d[_-f+y]:0,x=h>0&&y>=m?d[_-f+y-m]:0,S=b[y],E=0;g===1?E=M:g===2?E=C:g===3?E=M+C>>1:g===4&&(E=Mf(M,C,x)),d[_+y]=S+E&255;}}let p=new Uint8Array(n*o*4);for(let h=0;h<n*o;h++){let g=h*4,b=h*m;if(r===3){let _=d[b];p[g]=a?.[_*3]??0,p[g+1]=a?.[_*3+1]??0,p[g+2]=a?.[_*3+2]??0,p[g+3]=i?.[_]??255;}else if(r===0||r===4){let _=d[b];p[g]=_,p[g+1]=_,p[g+2]=_,p[g+3]=r===4?d[b+1]:255;}else p[g]=d[b],p[g+1]=d[b+1],p[g+2]=d[b+2],p[g+3]=r===6?d[b+3]:255;}return {width:n,height:o,data:p}}fe();var Cf=25.4,yu=72/Cf,wf=50;function Ef(t){let e=/^data:[^,]*?(;base64)?,(.*)$/s.exec(t);if(!e)return null;try{let n=e[1]?atob(e[2]):decodeURIComponent(e[2]),o=new Uint8Array(n.length);for(let r=0;r<n.length;r++)o[r]=n.charCodeAt(r)&255;return o}catch{return null}}function Rf(t){if(t[0]!==255||t[1]!==216)return null;let e=2;for(;e+9<t.length;){if(t[e]!==255)return null;let n=t[e+1];if(n===216||n>=208&&n<=215){e+=2;continue}let o=t[e+2]<<8|t[e+3];if(n===192||n===193||n===194){let r=t[e+5]<<8|t[e+6],a=t[e+7]<<8|t[e+8],i=t[e+9];return {width:a,height:r,components:i,progressive:n===194}}e+=2+o;}return null}async function Pf(t,e){let{width:n,height:o,data:r}=t,a=e?4:3,i=new Uint8Array(n*o*a);for(let s=0;s<n*o;s++){let l=r[s*4+3]/255,u=r[s*4]*l+255*(1-l),m=r[s*4+1]*l+255*(1-l),f=r[s*4+2]*l+255*(1-l);if(e){let[d,p,h,g]=Te(u,m,f);i.set([d*255,p*255,h*255,g*255].map(Math.round),s*a);}else i.set([Math.round(u),Math.round(m),Math.round(f)],s*a);}let c=await _u(i);return {kind:"raw",width:n,height:o,components:a,bytes:c??i,compressed:!!c}}async function Af(t,e){let n=t;if(!/^data:image\/(png|jpe?g)[;,]/i.test(n)){let i=await bo(n);if(!i)return null;n=i;}let o=Ef(n);if(!o)return null;let r=Rf(o);if(r)return r.components===1||r.components===3?{kind:"jpeg",width:r.width,height:r.height,components:r.components,bytes:o,progressive:r.progressive}:null;let a=await _i(o);return a?await Pf(a,e):null}function vf(t){let e="",n=0,o=r=>{e+=r,n+=r.length,n>=76&&(e+=`
3
+ `,n=0);};for(let r=0;r<t.length;r+=4){let a=Math.min(4,t.length-r),i=0;for(let s=0;s<4;s++)i=i*256+(s<a?t[r+s]:0);if(i===0&&a===4){o("z");continue}let c=[];for(let s=0;s<5;s++)c.unshift(String.fromCharCode(i%85+33)),i=Math.floor(i/85);o(c.slice(0,a+1).join(""));}return `${e}~>`}var Lf=`/qrdxdict 40 dict def
4
4
  qrdxdict begin
5
5
  /m {moveto} bind def
6
6
  /l {lineto} bind def
@@ -21,11 +21,11 @@ qrdxdict begin
21
21
  } bind def
22
22
  /QRDX-Regular /Helvetica latin1
23
23
  /QRDX-Bold /Helvetica-Bold latin1
24
- end`;function hi(t){let e="(";for(let n of t){let o=n.codePointAt(0)??63;n==="("||n===")"||n==="\\"?e+=`\\${n}`:o>=32&&o<127?e+=n:o>=160&&o<=255?e+=`\\${o.toString(8).padStart(3,"0")}`:e+="?";}return `${e})`}var pi=class extends Gn{out=[];shadingNames=new Map;cmyk;images;usesLevel3=false;constructor(e,n,o,r){super(n,o),this.cmyk=e,this.images=r;}color(e){if(this.cmyk){let[n,o,r,a]=Te(e.r,e.g,e.b);return `${$(n)} ${$(o)} ${$(r)} ${$(a)} cmyk`}return `${$(e.r/255)} ${$(e.g/255)} ${$(e.b/255)} rg`}tracePath(e,n){let o=["n"],r=false;for(let a of e)if(a.op==="M"||a.op==="L"&&!r){let[i,c]=X(n,a.x,a.y);o.push(`${$(i)} ${$(c)} m`),r=true;}else if(a.op==="L"){let[i,c]=X(n,a.x,a.y);o.push(`${$(i)} ${$(c)} l`);}else if(a.op==="C"){if(!r)continue;let[i,c]=X(n,a.x1,a.y1),[s,l]=X(n,a.x2,a.y2),[u,m]=X(n,a.x,a.y);o.push(`${$(i)} ${$(c)} ${$(s)} ${$(l)} ${$(u)} ${$(m)} c`);}else r&&o.push("h");return o.join(" ")}beginClip(e,n,o){return this.out.push(`gsave ${this.tracePath(e,n)} ${o?"eoclip":"clip"} n`),true}endClip(){this.out.push("grestore");}rect(e,n,o,r,a){this.out.push(`${this.color(e)} n ${$(n)} ${$(o)} m ${$(n+r)} ${$(o)} l ${$(n+r)} ${$(o+a)} l ${$(n)} ${$(o+a)} l h f`);}shade(e,n,o){let r=pt(n.matrix,o.matrix);if(!Ge(r))return;let a=ho(o,this.cmyk?"cmyk":"rgb"),i=this.shadingNames.get(a);i||(i=`Sh${this.shadingNames.size}`,this.shadingNames.set(a,i)),this.usesLevel3=true;let c=n.fillRule==="evenodd"?"eoclip":"clip";this.out.push(`gsave ${this.tracePath(e,n.matrix)} ${c} n [${fo(r)}] concat ${i} shfill grestore`);}paint(e,n,o){if(e.length===0)return;let r=o.opacity??1;if(r<=0)return;let a=this.resolveFill(o.fill,e,o.viewport,(o.fillOpacity??1)*r);a&&"pattern"in a?this.paintPattern(e,o,a.pattern,a.alpha):a&&"gradient"in a&&this.shade(e,o,{...a.gradient,stops:a.gradient.stops.map(m=>({...m,color:this.flatten({...m.color,a:m.color.a*a.alpha})}))});let i=a&&"color"in a?this.flatten(a.color):null,c=o.strokeWidth>0?this.resolveColor(o.stroke):null,s=c&&this.flatten({...c,a:c.a*r});if(!(i||s))return;let l=this.tracePath(e,o.matrix),u=o.fillRule==="evenodd"?"ef":"f";i&&s?this.out.push(`gsave ${this.color(i)} ${l} ${u} grestore`):i&&this.out.push(`${this.color(i)} ${l} ${u}`),s&&this.out.push(`${this.color(s)} ${$(o.strokeWidth*Sn(o.matrix))} w ${l} s`);}text(e,n){let o=e.text.replace(/\s+/g," ").trim(),r=this.resolveColor(n.fill);if(!(o&&r))return;let a=Sn(n.matrix),[i,c]=X(n.matrix,Y(e.attrs.x,n.viewport[0]),Y(e.attrs.y,n.viewport[1])),l=n.fontWeight==="bold"||Number.parseInt(n.fontWeight,10)>=600?"/QRDX-Bold":"/QRDX-Regular",u=$(n.fontSize*a),m=Number.parseFloat(e.attrs["data-max-width"]??""),f=m>0?` dup stringwidth pop dup ${$(m*a)} gt {${$(m*a)} exch div ${u} mul ${l} findfont exch scalefont setfont} {pop} ifelse`:"",d=n.textAnchor==="middle"?" dup stringwidth pop 2 div neg 0 rmoveto":n.textAnchor==="end"?" dup stringwidth pop neg 0 rmoveto":"",p=Math.atan2(n.matrix[1],n.matrix[0])*180/Math.PI;if(Math.abs(p)>.01){this.out.push(`gsave ${this.color(r)} ${l} findfont ${u} scalefont setfont ${$(i)} ${$(c)} translate ${$(p)} rotate ${hi(o)}${f} 0 0 moveto${d} show grestore`);return}this.out.push(`gsave ${this.color(r)} ${l} findfont ${u} scalefont setfont ${hi(o)}${f} ${$(i)} ${$(c)} moveto${d} show grestore`);}image(e,n){let o=e.attrs.href??e.attrs["xlink:href"],r=o?this.images.get(o):void 0;if(!r)return;let a=Y(e.attrs.x,n.viewport[0]),i=Y(e.attrs.y,n.viewport[1]),c=Y(e.attrs.width,n.viewport[0]),s=Y(e.attrs.height,n.viewport[1]);if(c<=0||s<=0)return;let[l,u]=X(n.matrix,a,i),[m,f]=X(n.matrix,a+c,i+s),{components:d}=r,p=d===1?"/DeviceGray":d===4?"/DeviceCMYK":"/DeviceRGB",h=Array.from({length:d},()=>"0 1").join(" "),g="/ASCII85Decode filter";r.kind==="jpeg"?(g+=" /DCTDecode filter",r.progressive&&(this.usesLevel3=true)):r.compressed&&(g+=" /FlateDecode filter",this.usesLevel3=true),this.out.push(["gsave",`${$(Math.min(l,m))} ${$(Math.min(u,f))} translate ${$(Math.abs(m-l))} ${$(Math.abs(f-u))} scale`,`${p} setcolorspace`,`<< /ImageType 1 /Width ${r.width} /Height ${r.height} /BitsPerComponent 8 /Decode [${h}] /ImageMatrix [${r.width} 0 0 -${r.height} 0 ${r.height}] /DataSource currentfile ${g} >> image`,Sf(r.bytes),"grestore"].join(`
25
- `));}};async function fu(t,e={}){let n=Le(t);if(!n)throw new Error("Could not read the SVG to convert to EPS");let o=Y(n.attrs.width,0,0)||512,r=Y(n.attrs.height,0,0)||o,a=e.width??o;if(!(Number.isFinite(a)&&a>0))throw new Error("EPS width must be a positive number of points");let i=a/o,c=r*i,s=Math.max(0,e.bleed??0),l=a+2*s,u=c+2*s,m=e.colorMode==="cmyk",f=new Map;for(let _ of sr(n,new Set)){let y=await xf(_,m);y&&f.set(_,y);}let d=new pi(m,ir(n,new Map),mo(n),f);$o(d,{bgColor:e.background??"#ffffff"});let h={matrix:pt([1,0,0,-1,s,u-s],[i,0,0,i,0,0]),viewport:[o,r],fill:"#000000",fillRule:"nonzero",stroke:"none",strokeWidth:1,fontSize:16,fontWeight:"normal",textAnchor:"start"},g=s>0?e.bleedColor??void 0:void 0;if(!(g&&d.paintBleed(n,h,g,[0,0,l,u]))){let _=g?d.resolveColor(g):null;_&&d.rect(_,0,0,l,u);}d.walk(n,h,true);let b=(e.title??"QR code").replace(/[^\x20-\x7e]/g,"?");return ["%!PS-Adobe-3.0 EPSF-3.0",`%%BoundingBox: 0 0 ${Math.ceil(l)} ${Math.ceil(u)}`,`%%HiResBoundingBox: 0 0 ${$(l)} ${$(u)}`,`%%Title: ${hi(b)}`,"%%Creator: qrdx",`%%LanguageLevel: ${d.usesLevel3?3:2}`,"%%DocumentData: Clean7Bit","%%EndComments","%%BeginProlog",Mf,"%%EndProlog","qrdxdict begin",...Array.from(d.shadingNames,([_,y])=>`/${y} ${_} def`),"gsave",...d.out,"grestore","end","showpage","%%Trailer","%%EOF",""].join(`
26
- `)}var hu="EPS can't carry image fills: PostScript has no transparency and would repeat the picture for every dot. Download PDF, SVG or PNG instead.";function pu(t){return [t.bgColor,t.fgColor,t.eyeColor,t.dotColor,...Object.values(t.eyeColors??{}).flatMap(n=>[n?.outer,n?.inner])].some(n=>typeof n=="object"&&n?.type==="image")}async function Mo(t,e={}){if(pu(t))throw new Error(hu);let n=So(t,{size:e.sizeMm??bf,unit:"mm",bleed:e.bleedMm}),o=await cr(t);return await fu(o,{width:n.trimWidth*du,bleed:n.bleed*du,bleedColor:n.bleed>0?yo(t,o):ci(t),colorMode:e.colorMode,background:wt(t.bgColor,_t)})}function Co(t){return `data:application/postscript;base64,${btoa(t)}`}async function Cf(t,e={}){let n=await Mo(t,e);le(Co(n),e.filename??"qr-code-print.eps");}ye();var gi={png:{mimeType:"image/png",extension:"png",vector:false},jpg:{mimeType:"image/jpeg",extension:"jpg",vector:false},webp:{mimeType:"image/webp",extension:"webp",vector:false},svg:{mimeType:"image/svg+xml",extension:"svg",vector:true},pdf:{mimeType:"application/pdf",extension:"pdf",vector:false},eps:{mimeType:"application/postscript",extension:"eps",vector:true}},p_={small:{width:200,height:200},medium:{width:400,height:400},large:{width:800,height:800},xlarge:{width:1200,height:1200},"2xl":{width:1600,height:1600},"3xl":{width:2e3,height:2e3}};function bi(t,e){return t<50||e<50?{isValid:false,error:"Size must be at least 50x50 pixels"}:t>5e3||e>5e3?{isValid:false,error:"Size must not exceed 5000x5000 pixels"}:t!==e?{isValid:false,error:"Width and height must be equal for QR codes"}:{isValid:true}}function sn(t,e){let{imageSettings:n,size:o}=t;if(!(n&&o)||o===e)return {...t,size:e};let r=e/o;return {...t,size:e,imageSettings:{...n,width:n.width*r,height:n.height*r,...n.x!=null&&{x:n.x*r},...n.y!=null&&{y:n.y*r},...n.padding!=null&&{padding:n.padding*r}}}}function le(t,e){let n=document.createElement("a");n.href=t,n.download=e,document.body.appendChild(n),n.click(),document.body.removeChild(n);}var gu=t=>(gi[t]??gi.png).mimeType;function wf(t,e,n){let{extension:o,vector:r}=gi[t];if(r)return `qr-code.${o}`;let{width:a,height:i}=_e(e.width,n);return `qr-code-${Math.round(a)}x${Math.round(i)}.${o}`}async function bu(t,e={}){let n=await lr(t,"image/webp",true);try{return await kr(n,e)}finally{n.remove();}}var Ef=25.4/72;async function _u(t){let e=await Mo(t,{sizeMm:(t.size??bt)*Ef});return Co(e)}async function yu(t){let e;try{({jsPDF:e}=await import('jspdf'));}catch(f){throw new Error(`PDF export needs the optional "jspdf" package. Install it with \`npm install jspdf\`. (${f})`)}let n=await ce(t),o=decodeURIComponent(n.replace("data:image/svg+xml,","")),r;try{let f=new TextEncoder().encode(o),d=Array.from(f,h=>String.fromCharCode(h)).join("");r=`data:image/svg+xml;base64,${btoa(d)}`;}catch(f){throw new Error(`Failed to encode SVG for PDF conversion: ${f}`)}let{width:a,height:i}=_e(t.size||bt,t.frame),c=await new Promise((f,d)=>{let p=new Image,h=document.createElement("canvas");h.width=Math.round(a),h.height=Math.round(i);let g=h.getContext("2d");if(!g){d(new Error("Could not get canvas context"));return}let b=setTimeout(()=>{h.remove(),d(new Error("SVG load timeout - image may be too large or contain invalid data"));},3e4);p.onload=()=>{clearTimeout(b);try{g.drawImage(p,0,0,h.width,h.height),f(h);}catch(_){clearTimeout(b),h.remove(),d(new Error(`Failed to draw image to canvas: ${_}`));}},p.onerror=()=>{clearTimeout(b),h.remove(),d(new Error("Could not load SVG for PDF conversion"));},p.src=r;}),s=c.toDataURL("image/png",1),l=a*.264583,u=i*.264583,m=new e({orientation:l>u?"landscape":"portrait",unit:"mm",format:[l,u]});return m.addImage(s,"PNG",0,0,l,u),c.remove(),m.output("dataurlstring")}async function g_(t,e){let{format:n,size:o,filename:r,quality:a}=e,i=bi(o.width,o.height);if(!i.isValid)throw new Error(i.error);let c=sn(t,o.width),s=r||wf(n,o,t.frame);try{if(n==="svg"){let l=await ce(c);le(l,s);}else if(n==="pdf"){let l=await yu(c);le(l,s);}else if(n==="eps")le(await _u(c),s);else if(n==="webp"){let l=await bu(c,{quality:a});le(await jn(l),s);}else {let l=gu(n),u=await lr(c,l);if(typeof u=="string")le(u,s);else throw new Error("Failed to generate image data URL")}}catch(l){throw console.error(`Error downloading ${n.toUpperCase()}:`,l),l}}async function b_(t,e,n,o={}){let r=bi(n.width,n.height);if(!r.isValid)throw new Error(r.error);let a=sn(t,n.width);if(e==="svg")return await ce(a);if(e==="pdf")return await yu(a);if(e==="eps")return await _u(a);if(e==="webp")return await jn(await bu(a,o));let i=gu(e),c=await lr(a,i);if(typeof c=="string")return c;throw new Error("Failed to generate QR code data URL")}async function __(t,e={width:bt,height:bt}){try{let n=bi(e.width,e.height);if(!n.isValid)throw new Error(n.error);let o=sn(t,e.width),r=lr(o,"image/png",!0).then(a=>new Promise((i,c)=>{let s=a;s.toBlob(l=>{s.remove(),l?i(l):c(new Error("Failed to create blob from canvas"));},"image/png");}));await navigator.clipboard.write([new ClipboardItem({"image/png":r})]);}catch(n){throw console.error("Error copying to clipboard:",n),n}}async function y_(t){let e=await ce(t);return decodeURIComponent(e.replace("data:image/svg+xml,",""))}ye();Yo();wn();ht();Dt();_r();he();var Gt={maxBytes:2e5,maxElements:500,maxDepth:16,maxInputSegments:4e3,maxColors:8,artboardSide:1e3,decimals:1,padding:.06},ot=class extends Error{},Rf={script:t=>`Removed ${$t(t,"script")}`,style:t=>`Removed ${$t(t,"style sheet")}: colors set with CSS classes are lost. Export with presentation attributes (Illustrator: Styling \u2192 Presentation Attributes)`,"foreign-object":t=>`Removed ${$t(t,"foreignObject element")}`,image:t=>`Removed ${$t(t,"image")}: frames are vector shapes only`,use:t=>`Removed ${$t(t,"<use> reference")}: ungroup or detach symbols before exporting`,text:t=>`Removed ${$t(t,"text element")}: add text as labels in the frame editor`,effects:t=>`Removed ${$t(t,"filter, mask, clip path or pattern")}`,animation:t=>`Removed ${$t(t,"animation")}`,unknown:t=>`Removed ${$t(t,"unsupported element")}`,"nested-svg":t=>`Removed ${$t(t,"nested <svg>")}: flatten it first`,handlers:t=>`Removed ${$t(t,"event handler attribute")}`,links:t=>`Removed ${$t(t,"link")} (href)`,"external-paint":t=>`Removed ${$t(t,"fill or stroke")} that referenced something outside the file`,gradient:t=>`Flattened ${$t(t,"gradient")} to its first color: add gradients in the frame editor`,opacity:t=>`Made ${$t(t,"semi-transparent shape")} opaque (print files have no transparency)`,"invalid-paint":t=>`${$t(t,"color")} couldn't be read and fell back to the parent color`,stroke:t=>`Removed ${$t(t,"stroke")} on paths, polygons or polylines: outline strokes before exporting (Figma: Outline stroke)`,dash:t=>`Drew ${$t(t,"dashed stroke")} as solid`,clipped:t=>`Cut ${$t(t,"shape")} at the edge of the artboard`,outside:t=>`Removed ${$t(t,"shape")} outside the artboard`,colors:t=>`Merged ${$t(t,"color")} with similar ones (${Gt.maxColors} at most)`,"qr-placed":()=>'No QR placeholder found (a rect with id "qr"): the code was centered; place it in the frame editor'};function $t(t,e){return `${t} ${e}${t===1?"":"s"}`}var xi=class{counts=new Map;add(e,n=1){this.counts.set(e,(this.counts.get(e)??0)+n);}list(){return [...this.counts].map(([e,n])=>({code:e,count:n,message:Rf[e](n)}))}},Pf=/^\s*<\?xml\s[^?>]*\?>/,_i=/[A-Za-z_][\w:.-]*/y,yi=/<\/([A-Za-z_][\w:.-]*)\s*>/y,wo=/\s*/y,Af=/[A-Za-z_:][\w:.-]*/y,vf=/[^"<]*/y,Lf=/[^'<]*/y;function Qn(t,e,n){return t.lastIndex=n,t.test(e)?t.lastIndex:n}function $u(t,e){let n=Qn(wo,t,e),o=Qn(Af,t,n);if(n===e||o===n)return -1;let r=Qn(wo,t,o);if(t[r]!=="=")return -1;let a=Qn(wo,t,r+1),i=t[a];if(i!=='"'&&i!=="'")return -1;let s=Qn(i==='"'?vf:Lf,t,a+1);return t[s]===i?s+1:-1}function If(t,e){let n=Qn(wo,t,e);return t[n]===">"?{end:n+1,selfClosing:false}:t.startsWith("/>",n)?{end:n+2,selfClosing:true}:null}function Ff(t){let e=[],n=0,o="",r=0;for(;r<t.length;){let a=t.indexOf("<",r);if(a<0)break;if(r=a,t.startsWith("<!--",r)){let l=t.indexOf("-->",r+4);if(l<0)throw new ot("The SVG has an unclosed comment");r=l+3;continue}if(t.startsWith("<![CDATA[",r)){let l=t.indexOf("]]>",r+9);if(l<0)throw new ot("The SVG has an unclosed CDATA section");r=l+3;continue}if(t.startsWith("<?",r)){let l=t.indexOf("?>",r+2);if(l<0)throw new ot("The SVG has an unclosed declaration");r=l+2;continue}if(t.startsWith("<!",r))throw new ot("DOCTYPE and other declarations are not allowed");if(t[r+1]==="/"){yi.lastIndex=r;let l=yi.exec(t);if(!l)throw new ot("The SVG has a malformed closing tag");if(e.pop()!==l[1])throw new ot(`The SVG closes <${l[1]}> out of order`);r=yi.lastIndex;continue}_i.lastIndex=r+1;let i=_i.exec(t);if(!i)throw new ot("The SVG has a malformed tag");let c=_i.lastIndex;for(let l=$u(t,c);l>=0;l=$u(t,c))c=l;let s=If(t,c);if(!s)throw new ot(`The SVG has a malformed <${i[0]}> tag (attributes must be quoted and may not contain "<")`);if(n++,n>Gt.maxElements)throw new ot(`The SVG has more than ${Gt.maxElements} elements`);if(o||(o=i[0]),!s.selfClosing&&(e.push(i[0]),e.length>Gt.maxDepth))throw new ot(`The SVG nests elements more than ${Gt.maxDepth} deep`);r=s.end;}if(e.length>0)throw new ot(`The SVG doesn't close <${e.at(-1)}>`);return o}function Tf(t){if(typeof t!="string")throw new ot("Expected SVG markup as a string");let e=new TextEncoder().encode(t).length;if(e>Gt.maxBytes)throw new ot(`The SVG is ${Math.ceil(e/1e3)} KB; the limit is ${Gt.maxBytes/1e3} KB`);if(/<!(?:DOCTYPE|ENTITY|ATTLIST|ELEMENT|NOTATION)/i.test(t))throw new ot("DOCTYPE and entity declarations are not allowed");let n=t.replace(Pf,"");if(n.includes("<?"))throw new ot("Processing instructions (such as xml-stylesheet) are not allowed");if(Ff(n)!=="svg")throw new ot("The file must start with an <svg> element");return n}var $i=t=>Math.round(Math.min(255,Math.max(0,t))).toString(16).padStart(2,"0");function jt(t){let e=t?.replace(/!important/i,"").trim();return e===""||e==="inherit"?void 0:e}function Si(t,e,n,o){let r=t.trim();if(r==="none"||r==="transparent")return null;if(/^url\(/i.test(r)){let i=/^url\(\s*['"]?#([^)'"\s]+)['"]?\s*\)/i.exec(r)?.[1],c=i?n.get(i):void 0;return c?(o.add("gradient"),Si(c,e,n,o)):(o.add("external-paint"),null)}let a=mt(r==="currentColor"?e.color:r);return a?a.a<=0?null:`#${$i(a.r)}${$i(a.g)}${$i(a.b)}`:(o.add("invalid-paint"),null)}function kf(t){let e=new Map,n=r=>{(r.name==="linearGradient"||r.name==="radialGradient")&&r.attrs.id&&e.set(r.attrs.id,r);for(let a of r.children)n(a);};n(t);let o=new Map;for(let[r,a]of e){let i=a.children.find(s=>s.name==="stop");if(!i){let s=(a.attrs.href??a.attrs["xlink:href"])?.match(/^#(.+)$/)?.[1];i=s?e.get(s)?.children.find(l=>l.name==="stop"):void 0;}let c=i&&jt(K(i,"stop-color"));c&&o.set(r,c);}return o}function xu(t,e){return t.map(n=>{if(n.op==="Z")return n;if(n.op==="C"){let[a,i]=X(e,n.x1,n.y1),[c,s]=X(e,n.x2,n.y2),[l,u]=X(e,n.x,n.y);return {op:"C",x1:a,y1:i,x2:c,y2:s,x:l,y:u}}let[o,r]=X(e,n.x,n.y);return {op:n.op,x:o,y:r}})}function Nf(t){let e=0;return t.forEach(([n,o],r)=>{let[a,i]=t[(r+1)%t.length];e+=n*i-a*o;}),e/2}function Ci(t){return t.length<3?[]:[...t.map(([e,n],o)=>({op:o===0?"M":"L",x:e,y:n})),{op:"Z"}]}var Qe=t=>Number.isFinite(t);function ut(t,e,n=0){let o=Number.parseFloat(t.attrs[e]??"");return Qe(o)?o:n}function Su(t){switch(t.name){case "path":return fe(t.attrs.d??"");case "rect":{let e=t.attrs.rx??t.attrs.ry,n=t.attrs.ry??t.attrs.rx;return oe(ut(t,"x"),ut(t,"y"),ut(t,"width"),ut(t,"height"),Number.parseFloat(e??"0")||0,Number.parseFloat(n??"0")||0)}case "circle":{let e=ut(t,"r");return re(ut(t,"cx"),ut(t,"cy"),e,e)}case "ellipse":return re(ut(t,"cx"),ut(t,"cy"),ut(t,"rx"),ut(t,"ry"));case "polygon":case "polyline":{let e=Ve(t.attrs.points),n=[];for(let o=0;o+1<e.length;o+=2)n.push([e[o],e[o+1]]);return Ci(n)}default:return []}}function Of(t,e){let n=e/2;switch(t.name){case "rect":{let o=ut(t,"x"),r=ut(t,"y"),a=ut(t,"width"),i=ut(t,"height"),c=Number.parseFloat(t.attrs.rx??t.attrs.ry??"0")||0,s=oe(o-n,r-n,a+e,i+e,c>0?c+n:0,c>0?c+n:0);if(a<=e||i<=e)return s;let l=Math.max(c-n,0);return [...s,...oe(o+n,r+n,a-e,i-e,l,l)]}case "circle":case "ellipse":{let o=ut(t,"cx"),r=ut(t,"cy"),a=t.name==="circle"?ut(t,"r"):ut(t,"rx"),i=t.name==="circle"?ut(t,"r"):ut(t,"ry"),c=re(o,r,a+n,i+n);return a<=n||i<=n?c:[...c,...re(o,r,a-n,i-n)]}case "line":{let[o,r,a,i]=["x1","y1","x2","y2"].map(m=>ut(t,m)),c=Math.hypot(a-o,i-r);if(c===0)return [];let s=-(i-r)/c*n,l=(a-o)/c*n,u=[[o+s,r+l],[a+s,i+l],[a-s,i-l],[o-s,r-l]];return Ci(Nf(u)<0?u.reverse():u)}default:return null}}var Df=new Set(["path","rect","circle","ellipse","polygon","polyline","line"]),Bf=new Set(["defs","linearGradient","radialGradient","stop","title","desc","metadata"]),Gf={script:"script",style:"style",foreignObject:"foreign-object",image:"image",feImage:"image",use:"use",text:"text",tspan:"text",textPath:"text",filter:"effects",mask:"effects",clipPath:"effects",pattern:"effects",marker:"effects",symbol:"effects",animate:"animation",animateMotion:"animation",animateTransform:"animation",set:"animation"},Qf=/^(?:qrdx[-_ ]?)?qr(?:[-_ ]?code)?$/i;function Cu(t,e){for(let n of Object.keys(t.attrs)){let o=n.toLowerCase();o.startsWith("on")?e.add("handlers"):o==="href"||o==="xlink:href"?t.name!=="linearGradient"&&t.name!=="radialGradient"&&e.add("links"):(o==="filter"||o==="mask"||o==="clip-path")&&e.add("effects");}}function wu(t,e,n,o,r){if(Cu(t,o),jt(K(t,"display"))==="none"||jt(K(t,"visibility"))==="hidden")return;let a=Number.parseFloat(K(t,"opacity")??"1"),i=jt(K(t,"fill-rule")),c=Number.parseFloat(jt(K(t,"stroke-width"))??""),s={matrix:pt(e.matrix,ne(t.attrs.transform)),fill:jt(K(t,"fill"))??e.fill,fillRule:i==="evenodd"||i==="nonzero"?i:e.fillRule,stroke:jt(K(t,"stroke"))??e.stroke,strokeWidth:Qe(c)&&c>=0?c:e.strokeWidth,color:jt(K(t,"color"))??e.color,opacity:e.opacity*(Qe(a)?a:1)};for(let l of t.children){if(Bf.has(l.name))continue;let u=Gf[l.name];if(u){o.add(u);continue}if(l.name==="svg"){o.add("nested-svg");continue}if(l.name==="g"||l.name==="a"){wu(l,s,n,o,r);continue}if(!Df.has(l.name)){o.add("unknown");continue}Uf(l,s,n,o,r);}}function Uf(t,e,n,o,r){if(Cu(t,o),jt(K(t,"display"))==="none"||jt(K(t,"visibility"))==="hidden")return;let a=pt(e.matrix,ne(t.attrs.transform));if(t.name==="rect"&&Qf.test(t.attrs.id??"")&&!r.qrBox){r.qrBox=We(xu(Su(t),a));return}let i=g=>jt(K(t,g)),c=e.opacity*Number.parseFloat(i("opacity")??"1"),s=Number.parseFloat(i("fill-opacity")??"1"),l=Number.parseFloat(i("stroke-opacity")??"1"),u=i("fill-rule"),m={...e,fill:i("fill")??e.fill,fillRule:u==="evenodd"||u==="nonzero"?u:e.fillRule,stroke:i("stroke")??e.stroke,color:i("color")??e.color},f=Number.parseFloat(i("stroke-width")??""),d=Qe(f)&&f>=0?f:e.strokeWidth,p=(g,b,_)=>{if(g.length!==0){if(r.segments+=g.length,r.segments>Gt.maxInputSegments)throw new ot(`The SVG has more than ${Gt.maxInputSegments} path segments; simplify it`);r.shapes.push({segments:xu(g,a),fill:b,fillRule:_});}},h=g=>{let b=(Qe(c)?c:1)*(Qe(g)?g:1);return b<=0?false:(b<1&&o.add("opacity"),true)};if(t.name!=="line"){let g=Si(m.fill,m,n,o);g&&h(s)&&p(Su(t),g,m.fillRule);}if(d>0&&m.stroke!=="none"){let g=Si(m.stroke,m,n,o);if(g&&h(l)){let b=Of(t,d);b?((i("stroke-dasharray")??"none")!=="none"&&o.add("dash"),p(b,g,t.name==="line"?"nonzero":"evenodd")):o.add("stroke");}}}function qf(t,e){let n=l=>{let u=10**e;return Math.round(l*u)/u+0},o=l=>$(l,e),r="",a=0,i=0,c=0,s=0;for(let l of t){if(l.op==="Z"){r+="z",a=c,i=s;continue}let u=n(l.x),m=n(l.y);if(l.op==="M")r+=`m${o(u-a)} ${o(m-i)}`,c=u,s=m;else if(l.op==="L"){if(u===a&&m===i)continue;r+=m===i?`h${o(u-a)}`:u===a?`v${o(m-i)}`:`l${o(u-a)} ${o(m-i)}`;}else r+=`c${o(n(l.x1)-a)} ${o(n(l.y1)-i)} ${o(n(l.x2)-a)} ${o(n(l.y2)-i)} ${o(u-a)} ${o(m-i)}`;a=u,i=m;}return r}var zf=(t,e)=>t.x0<e.x1&&e.x0<t.x1&&t.y0<e.y1&&e.y0<t.y1;function Hf(t){let e=[];for(let n of t){let o=We(n.segments);if(!o)continue;let r=e.at(-1);r&&r.shape.fill===n.fill&&r.shape.fillRule===n.fillRule&&!r.boxes.some(a=>zf(a,o))?(r.shape={...r.shape,segments:[...r.shape.segments,...n.segments]},r.boxes.push(o)):e.push({shape:n,boxes:[o]});}return e.map(n=>n.shape)}var Mi=t=>[Number.parseInt(t.slice(1,3),16),Number.parseInt(t.slice(3,5),16),Number.parseInt(t.slice(5,7),16)];function Wf(t,e,n){let o=new Map;for(let i of t)o.set(i.fill,(o.get(i.fill)??0)+1);let r=new Map([...o.keys()].map(i=>[i,i])),a=0;for(;o.size>e;){let i=[...o.keys()],c=[i[0],i[1]],s=Number.POSITIVE_INFINITY;for(let d=0;d<i.length;d++)for(let p=d+1;p<i.length;p++){let h=Mi(i[d]),g=Mi(i[p]),b=Math.hypot(h[0]-g[0],h[1]-g[1],h[2]-g[2]);b<s&&(s=b,c=[i[d],i[p]]);}let[l,u]=c,[m,f]=(o.get(l)??0)>=(o.get(u)??0)?[l,u]:[u,l];o.set(m,(o.get(m)??0)+(o.get(f)??0)),o.delete(f);for(let[d,p]of r)p===f&&r.set(d,m);a++;}return a>0&&n.add("colors",a),r}var Mu=t=>{let[e,n,o]=Mi(t);return .2126*e+.7152*n+.0722*o>235};function Vf(t,e={}){let n=new xi;try{let o=Tf(t),r=Le(o);if(!r)throw new ot("No <svg> element found");let a=Ve(r.attrs.viewBox),[i,c,s,l]=[0,0,0,0];if(a.length===4&&a[2]>0&&a[3]>0?[i,c,s,l]=a:(s=ut(r,"width"),l=ut(r,"height")),!(Qe(s)&&Qe(l)&&s>0&&l>0))throw new ot("The SVG needs a viewBox (or a width and height)");let m=Gt.artboardSide/Math.max(s,l),f=Math.round(s*m*10)/10,d=Math.round(l*m*10)/10;if(Math.min(f,d)<st.minArtboard)throw new ot("The artboard is too narrow: its sides may differ by 20 times at most");let p=[m,0,0,m,-i*m,-c*m],h={shapes:[],qrBox:null,segments:0};wu(r,{matrix:p,fill:"#000000",fillRule:"nonzero",stroke:"none",strokeWidth:1,color:"#000000",opacity:1},kf(r),n,h);let g={x0:0,y0:0,x1:f,y1:d},b=Math.max(f,d)*.004,_=[],y=0,M=0;for(let F of h.shapes){let U=We(F.segments);if(!U||U.x1<=0||U.y1<=0||U.x0>=f||U.y0>=d){y++;continue}if(U.x0<-b||U.y0<-b||U.x1>f+b||U.y1>d+b){let xt=gr(F.segments,.25).map(Rt=>br(Rt,g)).filter(Rt=>Rt.length>2);if(xt.length===0){y++;continue}M++,_.push({...F,segments:xt.flatMap(Rt=>Ci(Rt))});}else _.push(F);}if(y>0&&n.add("outside",y),M>0&&n.add("clipped",M),_.length===0)throw new ot("The SVG has no filled shapes to use");let C=Wf(_,Gt.maxColors,n);for(let F of _)F.fill=C.get(F.fill)??F.fill;let x=new Map,S=new Map;for(let F of _){let U=We(F.segments);x.set(F.fill,(x.get(F.fill)??0)+(U.x1-U.x0)*(U.y1-U.y0)),S.set(F.fill,(S.get(F.fill)??0)+1);}let w=[...x.keys()].sort((F,U)=>Number(Mu(F))-Number(Mu(U))||x.get(U)-x.get(F)),E=w[0],P=w[1],R=F=>F===E?"frame":F===P?"accent":F,v=h.qrBox;if(!v&&e.qr){let[F,U]=X(p,e.qr.x,e.qr.y);v={x0:F,y0:U,x1:F+e.qr.size*m,y1:U+e.qr.size*m};}let L,k,T;v?(L=Math.min(v.x1-v.x0,v.y1-v.y0),k=(v.x0+v.x1-L)/2,T=(v.y0+v.y1-L)/2):(n.add("qr-placed"),L=Math.min(f,d)*.6,k=(f-L)/2,T=(d-L)/2);let I=F=>Math.round(F*10)/10+0;if(L=Math.floor(L*10)/10,k=I(k),T=I(T),L<Math.min(f,d)*st.minQrShare)throw new ot("The QR area must be at least half the frame's shorter side");let W=Math.min(k,T,f-k-L,d-T-L);if(W<L*st.minPadding-1e-9)throw new ot("Leave room around the QR area: at least 4% of its size on every side, inside the artboard");let G=Math.min(Math.max(e.padding??Gt.padding,st.minPadding),.2),V=Math.floor(Math.min(L*G,W)*10)/10,Q=Hf(_);if(Q.length>st.maxShapes)throw new ot(`The artwork has ${Q.length} separate shapes; the limit is ${st.maxShapes}. Combine shapes of the same color first`);let j={kind:Mr,version:Cr,artboard:{width:f,height:d},qr:{x:k,y:T,size:L,padding:V},colors:{frame:E,...P&&{accent:P}},shapes:Q.map(F=>({type:"path",d:qf(F.segments,Gt.decimals),fill:R(F.fill),...F.fillRule==="evenodd"&&{fillRule:"evenodd"}})),labels:[]},et=Xe.safeParse(j);if(!et.success){let F=et.error.issues[0];throw new ot(`The converted frame doesn't fit the frame format: ${F?.message??"invalid"}`)}let ft=w.map(F=>({color:F,ref:F===E?"frame":F===P?"accent":"fixed",shapes:S.get(F)??0}));return {ok:!0,spec:et.data,warnings:n.list(),palette:ft}}catch(o){return {ok:false,error:o instanceof ot?o.message:`Could not read the SVG (${o instanceof Error?o.name:"error"})`,warnings:n.list()}}}ea();Lr();var Eu={kind:"qrdx.frame",version:1,artboard:{width:1240,height:1420},qr:{x:120,y:120,size:1e3,padding:60},colors:{frame:"#000000",text:"#FFFFFF"},shapes:[{type:"rect",x:40,y:40,width:1160,height:1160,fill:"background"},{type:"rect",x:0,y:0,width:1240,height:1420,fill:"frame",hole:{x:40,y:40,width:1160,height:1160}}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:120,y:1200,width:1e3,height:220}}],bleed:"frame"};var Ru={kind:"qrdx.frame",version:1,artboard:{width:1978.214,height:1978.214},qr:{x:489.107,y:489.107,size:1e3,padding:50},colors:{frame:"#000000",text:"#FFFFFF"},shapes:[{type:"circle",cx:989.107,cy:989.107,r:779.107,fill:"background"},{type:"circle",cx:989.107,cy:989.107,r:989.107,hole:779.107,fill:"frame"},{type:"circle",cx:105,cy:989.107,r:14.7,fill:"text"},{type:"circle",cx:1873.214,cy:989.107,r:14.7,fill:"text"}],labels:[{type:"curved",id:"top",slot:"primary",text:"Scan me",color:"text",curve:{cx:989.107,cy:989.107,radius:884.107,side:"top",spread:140},fontSize:105},{type:"curved",id:"bottom",slot:"secondary",text:"",color:"text",curve:{cx:989.107,cy:989.107,radius:884.107,side:"bottom",spread:140},fontSize:105}]};var Pu={kind:"qrdx.frame",version:1,artboard:{width:1240,height:1340},qr:{x:120,y:120,size:1e3,padding:40},colors:{frame:"#000000"},shapes:[{type:"rect",x:40,y:40,width:1160,height:1260,radius:60,fill:"background"},{type:"rect",x:0,y:0,width:1240,height:1340,radius:100,fill:"frame",hole:{x:40,y:40,width:1160,height:1260,radius:60}}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:120,y:1160,width:1e3,height:100},fontSize:93.6}]};var Au={kind:"qrdx.frame",version:1,artboard:{width:1260,height:1490},qr:{x:130,y:130,size:1e3,padding:80,radius:20},colors:{frame:"#000000",text:"#FFFFFF"},shapes:[{type:"path",d:"M40 0H1220A40 40 0 0 1 1260 40V1215A55 55 0 0 0 1260 1325V1450A40 40 0 0 1 1220 1490H40A40 40 0 0 1 0 1450V1325A55 55 0 0 0 0 1215V40A40 40 0 0 1 40 0Z",fill:"frame"},{type:"line",x1:77,y1:1270,x2:1147,y2:1270,width:12,dash:[30,22],fill:"background"}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:130,y:1270,width:1e3,height:220}}]};var Jf={"banner-bottom":Eu,"rounded-border":Pu,circle:Ru,ticket:Au};var Kf=418,th={"call-to-action":75,holidays:115,seasons:28,"food-drink":32,shopping:30,events:32,places:34,"health-learning":24,business:48};var eh=[{id:"call-to-action",label:"Call to action"},{id:"holidays",label:"Holidays"},{id:"seasons",label:"Seasons"},{id:"food-drink",label:"Food & drink"},{id:"shopping",label:"Shops & packaging"},{id:"events",label:"Events & weddings"},{id:"places",label:"Places & Wi-Fi"},{id:"health-learning",label:"Health & learning"},{id:"business",label:"Business & social"}];function wi(t){return Array.isArray(t)?`[${t.map(wi).join(",")}]`:t&&typeof t=="object"?`{${Object.keys(t).filter(n=>t[n]!==void 0).sort().map(n=>`${JSON.stringify(n)}:${wi(t[n])}`).join(",")}}`:JSON.stringify(t)}function nh(t){let e=wi(t),n=2166136261;for(let o=0;o<e.length;o++)n^=e.charCodeAt(o),n=Math.imul(n,16777619)>>>0;return n.toString(16).padStart(8,"0")}Wr();va();var vu=.06,Lu=.16,Iu=512;function Fu(t){let{width:e,height:n}=t;if(!(e>0&&n>0)||t.data.length<e*n*4)return null;let o=Uint8Array.from(t.data),r=Aa({width:e,height:n,data:o});if(!r)return null;let a=d=>{let p=d*4;return Math.hypot(o[p]/255-r[0],o[p+1]/255-r[1],o[p+2]/255-r[2])},i=new Uint8Array(e*n),c=new Int32Array(e*n),s=0,l=0,u=d=>{i[d]||o[d*4+3]===0||a(d)>=Lu||(i[d]=1,c[l++]=d);};for(let d=0;d<e;d++)u(d),u((n-1)*e+d);for(let d=0;d<n;d++)u(d*e),u(d*e+e-1);for(;s<l;){let d=c[s++],p=d%e;p>0&&u(d-1),p<e-1&&u(d+1),d>=e&&u(d-e),d<(n-1)*e&&u(d+e);}let m=new Uint8ClampedArray(o),f=r;for(let d=0;d<e*n;d++){if(!i[d])continue;let p=Math.min(1,Math.max(0,(a(d)-vu)/(Lu-vu))),h=d*4;if(m[h+3]=Math.round(o[h+3]*p),p>0&&p<1)for(let g=0;g<3;g++){let _=(o[h+g]/255-(1-p)*f[g])/p;m[h+g]=Math.round(Math.min(1,Math.max(0,_))*255);}}return {width:e,height:n,data:m}}async function rh(t){if(typeof document>"u"||typeof Image>"u")throw new Error("removeLogoBackground needs a browser (canvas)");let e=await new Promise(c=>{let s=new Image;s.crossOrigin="anonymous",s.onload=()=>c(s),s.onerror=()=>c(null),s.src=t;});if(!e)return null;let n=e.naturalWidth||512,o=e.naturalHeight||512,r=Math.min(1,Iu/Math.max(n,o)),a=document.createElement("canvas");a.width=Math.max(1,Math.round(n*r)),a.height=Math.max(1,Math.round(o*r));let i=a.getContext("2d",{willReadFrequently:true});if(!i)return null;try{i.drawImage(e,0,0,a.width,a.height);let c=i.getImageData(0,0,a.width,a.height),s=Fu(c);return s?(c.data.set(s.data),i.putImageData(c,0,0),a.toDataURL("image/png")):null}catch{return null}finally{a.remove();}}At();Se();de();At();Bn();tn();Re();function oh(t,e){return Mt.QrCode.encodeText(t,Lt[e??te]).size}function Tu(t,e,n,o=n.size*(e?.size??xa)){let r={src:t,width:o,height:o,excavate:true,...e?.shape&&e.shape!=="square"&&{shape:e.shape},...e?.plate&&{plate:e.plate}},a=e?.x!==void 0||e?.y!==void 0;if(!(e?.padding||a))return r;let i=oh(n.value,n.level),c=Tt(i,n.margin,n.shape),s=n.size/(i+2*c);if(e.padding&&(r.padding=e.padding*s),a){let l=i*s,u=m=>Math.min(Math.max((m??.5)*l-o/2,0),l-o);r.x=u(e.x),r.y=u(e.y);}return r}function ku(t,e,n,o){let r=n.level??te,a=r;o&&(a=Bt({...n,imageSettings:Tu(t,e,n),autoLevel:o}));let i=s=>{let l=m=>Tu(t,e,{...n,level:s},m),u=oi(n,[s],l().width,l);return u>0?l(u):void 0};if(a===r)return i(r);let c=i(a);return c&&Bt({...n,imageSettings:c,autoLevel:o})===a?c:i(r)}function ah({value:t,level:e,margin:n,shape:o,autoLevel:r,logoOptions:a}){let c=ku("data:,",{...a,size:Br},{value:`${t}`,size:1024,margin:n??Ct,level:e,shape:o},r);return c?c.width/1024:0}function Ei({value:t,size:e=1024,fgColor:n,bgColor:o,eyeColor:r,dotColor:a,bodyPattern:i,hideLogo:c,logo:s,logoOptions:l,margin:u,cornerEyePattern:m,cornerEyeDotPattern:f,level:d,templateId:p,frame:h,eyeColors:g,moduleScale:b,autoLevel:_,shape:y}){let M={value:`${t}`,size:e,margin:u??Ct,level:d,shape:y},C=!c&&s?ku(s,l,M,_):void 0;return {value:M.value,bgColor:o,fgColor:n,eyeColor:r,dotColor:a,bodyPattern:i,cornerEyePattern:m,cornerEyeDotPattern:f,level:d,templateId:p,size:e,margin:u,...h&&{frame:h},...g&&{eyeColors:g},...b!==void 0&&{moduleScale:b},..._&&{autoLevel:_},...y&&y!=="square"&&{shape:y},...C&&{imageSettings:C}}}Re();var ch=memo(({value:t,fgColor:e,hideLogo:n,logo:o,logoOptions:r,bgColor:a,eyeColor:i,dotColor:c,bodyPattern:s,cornerEyePattern:l,cornerEyeDotPattern:u,level:m,size:f=bt,scale:d=1,margin:p=Ct,style:h,templateId:g,customTemplate:b,customProps:_,frame:y,art:M,eyeColors:C,moduleScale:x,autoLevel:S,shape:w,frameLabelMarkers:E})=>{let P=f*d,R=useMemo(()=>Ei({value:t,fgColor:e,hideLogo:n,bgColor:a,eyeColor:i,dotColor:c,bodyPattern:s,cornerEyePattern:l,cornerEyeDotPattern:u,level:m,templateId:g,logo:o,logoOptions:r,margin:p,autoLevel:S,shape:w}),[t,e,n,o,r,p,S,w,a,i,c,s,l,u,m,g]),v=P/R.size,L=R.imageSettings&&{...R.imageSettings,height:R.imageSettings.height*v,width:R.imageSettings.width*v,...R.imageSettings.x!=null&&{x:R.imageSettings.x*v},...R.imageSettings.y!=null&&{y:R.imageSettings.y*v},...R.imageSettings.padding!=null&&{padding:R.imageSettings.padding*v}};return jsx(ri,{art:M,bgColor:R.bgColor,bodyPattern:R.bodyPattern,cornerEyeDotPattern:R.cornerEyeDotPattern,cornerEyePattern:R.cornerEyePattern,customProps:_,customTemplate:b,dotColor:R.dotColor,eyeColor:R.eyeColor,fgColor:R.fgColor,frame:y,level:m||R.level,margin:R.margin,...C&&{eyeColors:C},...x!==void 0&&{moduleScale:x},...S&&{autoLevel:S},...w&&w!=="square"&&{shape:w},...E&&{frameLabelMarkers:E},size:P,style:h,templateId:R.templateId,value:R.value,...L&&{imageSettings:L}})});ch.displayName="QRCode";tn();var Nu={diamond:["square","rounded","diya","extra-rounded","message","pointy","leaf","leaf-reverse","drop","bevel","squircle","cushion","shield","petal"],banner:["square","rounded","diya","leaf"],square:["curly"],diya:["curly"],message:["curly"]},Ou={diamond:["square"],pacman:["rounded"],"small-square":["square","rounded"]},Du=["circle","curly"],Bu=["diamond","banner","star"],Gu={circle:["square","rounded","diya","extra-rounded","message","pointy","leaf","leaf-reverse","drop","bevel","squircle","cushion","shield","petal"]},Zt=["square","liquid","classy","classy-rounded"],Qu={"circle/rounded":Zt,"circle/extra-rounded":Zt,"circle/message":[...Zt,"leaf"],"circle/pointy":Zt,"circle/leaf-reverse":Zt,"circle/drop":Zt,"circle/bevel":[...Zt,"leaf"],"circle/squircle":[...Zt,"circle","diamond","circle-mixed","rounded","horizontal-line","leaf","heart","mosaic","octagon"],"circle/cushion":Zt,"circle/shield":[...Zt,"rounded","horizontal-line","leaf"],"circle/petal":Zt};function Uu(t,e,n){return (Gu[t]?.includes(e)??false)&&!Qu[`${t}/${e}`]?.includes(n)}function Ri(t){let e=t.bodyPattern??"circle",n=t.cornerEyePattern??"gear",o=t.cornerEyeDotPattern??"circle";return Nu[o]?.includes(n)?{kind:"dot-eye",message:`${o} centres in ${n} eyes are missed by strict decoders`,fix:"Pick a square, rounded or circle centre, or another eye shape"}:Ou[e]?.includes(n)?{kind:"body-eye",message:`${e} dots next to ${n} eyes are missed up close`,fix:"Pick a fuller dot shape or another eye shape"}:Bu.includes(o)?{kind:"dot",message:`${o} centres are missed in sharp renders and up close`,fix:"Pick a square, rounded or circle centre"}:Du.includes(n)?{kind:"eye",message:`${n} eyes only read in lenient decoders`,fix:"Pick square, rounded or gear eyes"}:Uu(o,n,e)?{kind:"sharp-dot-eye",message:`${o} centres in ${n} eyes are missed by some decoders on screens and in sharp prints`,fix:"Pick a rounded centre, or gear or octagon eyes"}:null}Tn();Se();de();At();ye();Bn();tn();Re();Dt();var Yu=[96,160,320],Ro=640;function vi(){if(typeof document>"u")throw new Error("Scan scoring needs a browser (canvas + image decoding)")}function qe(t){if(t?.aborted)throw new DOMException("Scan scoring was aborted","AbortError")}var ju=()=>new Promise(t=>setTimeout(t,0));async function Li(){let{default:t}=await import('jsqr');return t}function Ai(t,e){if(!t)return false;if(t.data===e)return true;try{return new TextDecoder().decode(Uint8Array.from(t.binaryData))===e}catch{return false}}function uh(t,e,n=.7){let{data:o,width:r,height:a}=t;for(let l=0;l<o.length;l+=4)for(let u=0;u<3;u++)o[l+u]=128+(o[l+u]-128)*n;let i=Math.max(1,Math.round(e*.25)),c=new Float32Array(r*a*3),s=l=>{let u=l?a:r,m=l?r:a,f=(p,h)=>l?p*r+h:h*r+p,d=[0,0,0];for(let p=0;p<u;p++){d.fill(0);for(let h=-i;h<=i;h++){let g=f(p,Math.min(Math.max(h,0),m-1))*4;for(let b=0;b<3;b++)d[b]=d[b]+o[g+b];}for(let h=0;h<m;h++){let g=f(p,h)*3;for(let y=0;y<3;y++)c[g+y]=d[y]/(2*i+1);let b=f(p,Math.max(h-i,0))*4,_=f(p,Math.min(h+i+1,m-1))*4;for(let y=0;y<3;y++)d[y]=d[y]-o[b+y]+o[_+y];}}for(let p=0;p<r*a;p++)for(let h=0;h<3;h++)o[p*4+h]=c[p*3+h];};for(let l=0;l<2;l++)s(true),s(false);}function Un(t,e){let n=document.createElement("canvas");n.width=Math.max(1,Math.round(t)),n.height=Math.max(1,Math.round(e));let o=n.getContext("2d",{willReadFrequently:true});if(!o)throw new Error("Could not get canvas context");return o.imageSmoothingEnabled=true,o.imageSmoothingQuality="high",{canvas:n,ctx:o}}var mh=[.9,1,1.1];function Ii(t,e,n,o,r){let a=0;for(let i of mh){let c=n*i,s=e(c);uh(s,c/o),r(t(s.data,s.width,s.height))&&a++;}return a>=2?"pass":a===1?"fragile":"fail"}var Pi={small:"small print or far away",medium:"typical phone distance",large:"close up"};function dh(t,e){return t===e[0]&&e.length>1?Pi.small:t===e.at(-1)?Pi.large:Pi.medium}function Zu(t,e,n){if(n==="pass")return 0;let o=e===1?[45]:e===2?[20,45]:[15,20,45],r=o[Math.round(t*(o.length-1)/Math.max(e-1,1))]??20;return n==="fragile"?Math.round(r/2):r}function Ju(t,e,n){let o=`${t} px (${dh(t,e)})`;return n==="pass"?{id:`decode-${t}`,passed:true,message:`Reads at ${o}, with camera blur`}:{id:`decode-${t}`,passed:false,message:n==="fragile"?`Reads at ${o} only some of the time`:`Doesn't read at ${o}`,fix:t===e[0]?"Print it bigger, shorten the content (fewer modules) or use solid square dots":"Raise the contrast, use bigger dots or a simpler eye shape"}}function Ku(t,e){return e?"fails":t>=85?"great":t>=65?"ok":"risky"}function fh(t,e,n){let o=Ht(t,e);if(o.type==="solid")return [o.color];if(o.type!=="image")return o.stops.map(c=>c.color);let r=o.underlay?Po(o.underlay):null,a=n?.[o.src];if(!a)return o.underlay?[o.underlay]:[];let i=o.opacity??1;return [a.light,a.dark].flatMap(c=>{let s=Po(c);if(!s)return [];let l={...s,a:s.a*i};if(!r)return [qu(l)];let u=l.a+r.a*(1-l.a),m=(f,d)=>u>0?(f*l.a+d*r.a*(1-l.a))/u:0;return [qu({r:m(l.r,r.r),g:m(l.g,r.g),b:m(l.b,r.b),a:u})]})}var qu=({r:t,g:e,b:n,a:o})=>`rgba(${Math.round(t)}, ${Math.round(e)}, ${Math.round(n)}, ${Math.round(o*1e3)/1e3})`;function hh(t){let e=[],n=t.width*t.height;for(let a=0;a<n;a++){let i=t.data[a*4],c=t.data[a*4+1],s=t.data[a*4+2];t.data[a*4+3]<128||e.push({lum:an(i,c,s),r:i,g:c,b:s});}if(e.length===0)return null;e.sort((a,i)=>a.lum-i.lum);let o=Math.max(1,Math.round(e.length/10)),r=a=>{let i=a.reduce((s,l)=>({r:s.r+l.r,g:s.g+l.g,b:s.b+l.b}),{r:0,g:0,b:0}),c=s=>Math.round(s/a.length).toString(16).padStart(2,"0");return `#${c(i.r)}${c(i.g)}${c(i.b)}`};return {dark:r(e.slice(0,o)),light:r(e.slice(-o))}}async function ph(t){vi();let e=await dr(t),{canvas:n,ctx:o}=Un(64,64);o.drawImage(e,0,0,64,64);let r=hh(o.getImageData(0,0,64,64));return n.remove(),r}function tm(t){let e=[t.bgColor,t.fgColor,t.eyeColor,t.dotColor,...Qr.flatMap(o=>[t.eyeColors?.[o]?.outer,t.eyeColors?.[o]?.inner])],n=new Set;for(let o of e)typeof o=="object"&&o?.type==="image"&&n.add(o.src);return [...n]}var ur=null;function Po(t){let e=mt(t);if(e||typeof document>"u")return e;if(ur??=document.createElement("canvas").getContext("2d"),!ur)return null;ur.fillStyle="#010203",ur.fillStyle=t;let n=String(ur.fillStyle);return n==="#010203"?null:mt(n)}var zu=t=>an(t.r,t.g,t.b),em=(t,e)=>(Math.max(t,e)+.05)/(Math.min(t,e)+.05),mr=4.5,gh=3,Hu=1.5,Wu={code:7,background:12},Vu={r:255,g:255,b:255,a:1},Xu=(t,e)=>({r:t.r*t.a+e.r*(1-t.a),g:t.g*t.a+e.g*(1-t.a),b:t.b*t.a+e.b*(1-t.a),a:1});function bh(t,e={}){let n=e.imageTones,o=(d,p)=>{let h=typeof d=="object"&&d?.type==="image";return fh(d,p,n).map(g=>({color:g,picture:h}))},r=t.fgColor??Pt,a=Qr.flatMap(d=>{let p=t.eyeColors?.[d];return [...p?.outer?o(p.outer,Pt):[],...p?.inner?o(p.inner,Pt):[]]}),i=[...o(r,Pt),...o(t.eyeColor??r,Pt),...o(t.dotColor??r,Pt),...a],c=o(t.bgColor,_t),s=(c.length>0?c:[{color:"#ffffff",picture:false}]).map(d=>{let p=Po(d.color);return {color:p?Xu(p,Vu):Vu,picture:d.picture}}),l=i.flatMap(d=>{let p=Po(d.color);return p?[{color:p,picture:d.picture}]:[]}),u=Number.POSITIVE_INFINITY,m=mr,f=false;for(let d of l)for(let p of s){let h=zu(Xu(d.color,p.color)),g=zu(p.color),b=em(h,g),_=p.picture?Wu.background:d.picture?Wu.code:mr;b/_<u/m&&(u=b,m=_),h>g&&(f=true);}return {ratio:Number.isFinite(u)?u:Number.POSITIVE_INFINITY,required:m,inverted:f}}function _h(t,e){let{ratio:n,inverted:o,required:r}=bh(t,{imageTones:e});if(!Number.isFinite(n))return {checks:[],penalty:0,fails:false};let a=r/mr,i=r!==mr,c=Math.round(n*10)/10,s=[],l=0;return n>=r?s.push({id:"contrast",passed:true,message:`Contrast ${c}:1 between code and background`}):(l=n<Hu*a?60:n<gh*a?30:10,s.push({id:"contrast",passed:false,message:i?`Low contrast for a picture (${c}:1); ${r}:1 or more scans reliably`:`Low contrast (${c}:1); 4.5:1 or more scans reliably`,fix:i?"Lower the picture's opacity over a darker underlay (dots) or a lighter one (background)":"Use a darker code color or a lighter background"})),o?(l+=10,s.push({id:"polarity",passed:false,message:"Light code on a dark background; some scanner apps can't read it",fix:"Use dark modules on a light background"})):s.push({id:"polarity",passed:true,message:"Dark code on a light background"}),{checks:s,penalty:l,fails:n<Hu*(r/mr)}}function Fi(t){return Mt.QrCode.encodeText(t.value,Lt[Bt(t)]).getModules()}function yh(t){let{imageSettings:e}=t;if(!e)return {check:null,penalty:0};let n=Fi(t),o=Ee(n,t.size??bt,Tt(n.length,t.margin??Ct,t.shape),e);if(!o)return {check:null,penalty:0};let r=o.excavation??o,a=n.length,c=[[0,0],[a-8,0],[0,a-8]].some(([p,h])=>r.x<p+9&&r.x+r.w>p&&r.y<h+9&&r.y+r.h>h),s=a>21?a-9:null,l=s!==null&&r.x<s+5&&r.x+r.w>s&&r.y<s+5&&r.y+r.h>s;if(c||l)return {check:{id:"logo",passed:false,message:c?"The logo covers a corner eye":"The logo covers the small square near the bottom-right corner",fix:"Move the logo toward the center or make it smaller"},penalty:40};let u=r.w*r.h/(a*a),m=Bt(t),f=Math.round(u*100),d=uo({value:t.value,size:t.size??bt,margin:t.margin??Ct,level:m,shape:t.shape},e);return !d||d.worst<=d.budget?{check:{id:"logo",passed:true,message:`Logo covers ${f}% of the code; error correction repairs it with room to spare`},penalty:0}:{check:{id:"logo",passed:false,message:`Logo covers ${f}% of the code and spoils ${d.worst} codewords in one block, which repairs ${d.correctable}`,fix:d.level==="H"?"Use a smaller logo":"Switch error correction to H or use a smaller logo"},penalty:d.worst>d.correctable?25:10}}function $h(t){let e=Ra(t.shape)?Ke(t.margin??Ct):t.margin??Ct,n=Fi(t).length+2*e,o=e+(qt(t.frame)?oa(t.frame)*n:0),r=Math.round(o*10)/10;return o>=4?{check:{id:"quiet-zone",passed:true,message:`Quiet zone of ${r} modules`},penalty:0}:o>=1.5?{check:{id:"quiet-zone",passed:true,message:`Quiet zone of ${r} modules (4 is ideal)`},penalty:0}:{check:{id:"quiet-zone",passed:false,message:"No quiet zone around the code",fix:"Leave clear space (about 10% of the code width) around it wherever you place it, or add a frame"},penalty:5}}function xh(t){let e=t.cornerEyePattern??"gear";return e==="curly"?{check:{id:"eye-shape",passed:false,message:"Curly eyes fail strict decoders such as ZXing-based apps",fix:"Pick square, rounded or gear eyes"},penalty:40}:e==="circle"?{check:{id:"eye-shape",passed:false,message:"Circle eyes only read in lenient decoders; many apps miss them",fix:"Pick square, rounded or gear eyes"},penalty:20}:{check:{id:"eye-shape",passed:true,message:`No known decoder issues with ${e} eyes`},penalty:0}}function dr(t){return new Promise((e,n)=>{let o=new Image;o.crossOrigin="anonymous",o.onload=()=>e(o),o.onerror=()=>n(new Error("Could not load image")),o.src=t;})}var Sh=`data:image/svg+xml,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 10"><rect width="10" height="10" rx="2" fill="#808080"/></svg>')}`;async function Mh(t){let{imageSettings:e}=t;if(!e||e.src.startsWith("data:"))return t;let n=Sh;try{let o=await dr(e.src),{canvas:r,ctx:a}=Un(o.naturalWidth||256,o.naturalHeight||256);a.drawImage(o,0,0,r.width,r.height),n=r.toDataURL("image/png");}catch{}return {...t,imageSettings:{...e,src:n}}}async function Ch(t){let e=new Map;for(let r of tm(t))if(!r.startsWith("data:"))try{let a=await dr(r),{canvas:i,ctx:c}=Un(a.naturalWidth||256,a.naturalHeight||256);c.drawImage(a,0,0,i.width,i.height),e.set(r,i.toDataURL("image/png")),i.remove();}catch{e.set(r,null);}if(e.size===0)return t;let n=r=>{if(typeof r!="object"||r?.type!=="image")return r;let a=e.get(r.src);return a===void 0?r:a?{...r,src:a}:r.underlay??Pt},o=t.eyeColors?Object.fromEntries(Object.entries(t.eyeColors).map(([r,a])=>[r,a&&{outer:n(a.outer),inner:n(a.inner)}])):void 0;return {...t,bgColor:n(t.bgColor),fgColor:n(t.fgColor),eyeColor:n(t.eyeColor),dotColor:n(t.dotColor),...o&&{eyeColors:o}}}async function nm(t,e,n,o,r){let a=[],i=0,c=_h(t,r);i+=c.penalty;let s=yh(t);i+=s.penalty;let l=$h(t);i+=l.penalty;let u=xh(t);i+=u.penalty;let m=Ri(t),f=m?.kind==="eye"?null:m;f&&f.kind!=="sharp-dot-eye"&&(i+=10);let d=await Li();qe(o);let p=Fi(t).length,h=p+2*Tt(p,t.margin??Ct,t.shape),g=[],b=false;for(let[M,C]of n.entries()){await ju(),qe(o);let x=Ii(d,e,C,h,S=>Ai(S,t.value));i+=Zu(M,n.length,x),g.push(Ju(C,n,x)),M===n.length-1&&x==="fail"&&(b=true);}a.push(...g,...c.checks),s.check&&a.push(s.check),a.push(u.check,l.check),f&&a.push({id:"style-pair",passed:false,message:f.message,fix:f.fix});let _=b||c.fails,y=Math.max(0,Math.min(100,100-i));return _&&(y=Math.min(y,30)),{score:y,grade:Ku(y,_),checks:a}}function rm(t){return [...t.sizes??Yu].filter(e=>e>0).sort((e,n)=>e-n)}async function p5(t,e={}){vi();let{signal:n}=e,o=rm(e),r=await Ch(await Mh(sn({...t,size:t.size??bt},Ro)));qe(n);let a={};for(let u of tm(t))try{let m=await ph(u);m&&(a[u]=m);}catch{}qe(n);let i=await ce(r),c=await dr(i);qe(n);let s=_e(Ro,t.frame);return await nm(t,u=>{let m=u/Ro,f=s.width*m,d=s.height*m,p=Math.max(8,Math.round(u*.12)),{canvas:h,ctx:g}=Un(f+2*p,d+2*p);g.fillStyle="#ffffff",g.fillRect(0,0,h.width,h.height),g.drawImage(c,p,p,f,d);let b=g.getImageData(0,0,h.width,h.height);return h.remove(),b},o,n,a)}var g5=Ro;async function b5(t,e,n={}){let{width:o,height:r}=e;if(!(o>0&&r>0)||e.data.length<o*r*4)throw new Error("Pixels must be width \xD7 height \xD7 4 RGBA bytes");let a=rm(n),i=t.size??bt,c=_e(i,t.frame),s=o*i/c.width,l={data:wh(e),width:o,height:r};return await nm(t,m=>{let f=om(l,m/s),d=Math.max(8,Math.round(m*.12));return Eh(f,d)},a,n.signal)}function wh(t){let{data:e,width:n,height:o}=t,r=new Uint8ClampedArray(n*o*4);for(let a=0;a<n*o*4;a+=4){let i=e[a+3]/255;for(let c=0;c<3;c++)r[a+c]=e[a+c]*i+255*(1-i);r[a+3]=255;}return r}function Eh(t,e){let n=t.width+2*e,o=t.height+2*e,r=new Uint8ClampedArray(n*o*4).fill(255);for(let a=0;a<t.height;a++)r.set(t.data.subarray(a*t.width*4,(a+1)*t.width*4),((a+e)*n+e)*4);return {data:r,width:n,height:o,colorSpace:"srgb"}}var Ue=(t,e)=>Math.hypot(t.x-e.x,t.y-e.y);function Eo(t,e){return .299*t[e]+.587*t[e+1]+.114*t[e+2]}function Rh(t,e){let n=0;for(let c=0;c<256;c++)n+=c*t[c];let o=0,r=0,a=0,i=128;for(let c=0;c<256;c++){if(r+=t[c],r===0)continue;let s=e-r;if(s===0)break;o+=c*t[c];let l=o/r,u=(n-o)/s,m=r*s*(l-u)**2;m>a&&(a=m,i=c);}return i}async function Ph(t){if(!(t instanceof Blob))return t.complete||await new Promise(n=>{t.addEventListener("load",n,{once:true}),t.addEventListener("error",n,{once:true});}),t;let e=URL.createObjectURL(t);try{let n=await dr(e);return await n.decode?.().catch(()=>{}),n}finally{setTimeout(()=>URL.revokeObjectURL(e),1e3);}}async function _5(t,e={}){vi();let{signal:n}=e,o=[...e.sizes??Yu].filter(B=>B>0).sort((B,at)=>B-at),r=await Li(),a=await Ph(t);qe(n);let i=a.naturalWidth||a.width,c=a.naturalHeight||a.height;if(!(i&&c))throw new Error("Could not read this image");let s=Math.min(1,1600/Math.max(i,c)),{canvas:l,ctx:u}=Un(i*s,c*s);u.fillStyle="#ffffff",u.fillRect(0,0,l.width,l.height),u.drawImage(a,0,0,l.width,l.height);let m=u.getImageData(0,0,l.width,l.height),f=r(m.data,m.width,m.height);if(qe(n),!f){let B=await jl(a,0,false);return l.remove(),typeof B!="string"||B==="NO_QR"?{data:null,version:null,score:0,grade:"fails",checks:[{id:"decode",passed:false,message:"No QR code found in this image",fix:"Try a sharper, well-lit, straight-on photo or a screenshot"}]}:{data:B,version:null,score:55,grade:"risky",checks:[{id:"decode",passed:false,message:"Decoded only after cropping; the code is small or hard to find in this image",fix:"Make the code bigger relative to its surroundings"}]}}let{location:d,version:p}=f,h=17+4*p,g=(Ue(d.topLeftCorner,d.topRightCorner)+Ue(d.bottomLeftCorner,d.bottomRightCorner)+Ue(d.topLeftCorner,d.bottomLeftCorner)+Ue(d.topRightCorner,d.bottomRightCorner))/4,b=g/h,_=[d.topLeftCorner,d.topRightCorner,d.bottomRightCorner,d.bottomLeftCorner],y=Math.max(0,Math.floor(Math.min(..._.map(B=>B.x)))),M=Math.min(m.width,Math.ceil(Math.max(..._.map(B=>B.x)))),C=Math.max(0,Math.floor(Math.min(..._.map(B=>B.y)))),x=Math.min(m.height,Math.ceil(Math.max(..._.map(B=>B.y)))),S=[],w=0,E=new Array(256).fill(0),P=0;for(let B=C;B<x;B++)for(let at=y;at<M;at++){let Z=Math.round(Eo(m.data,(B*m.width+at)*4));E[Z]=E[Z]+1,P++;}let R=Rh(E,P),v={dark:[0,0,0,0],light:[0,0,0,0]};for(let B=C;B<x;B++)for(let at=y;at<M;at++){let Z=(B*m.width+at)*4,St=Eo(m.data,Z)<=R?v.dark:v.light;St[0]=St[0]+m.data[Z],St[1]=St[1]+m.data[Z+1],St[2]=St[2]+m.data[Z+2],St[3]=St[3]+1;}let L=B=>{let at=Math.max(B[3],1);return an(B[0]/at,B[1]/at,B[2]/at)},k=L(v.dark),T=L(v.light),I=em(k,T),W=Math.round(I*10)/10;I>=4.5?S.push({id:"contrast",passed:true,message:`Contrast ${W}:1 in the image`}):(w+=I<2?30:10,S.push({id:"contrast",passed:false,message:`Low contrast in the image (${W}:1)`,fix:"Use a darker code on a lighter background, or better lighting for photos"}));let V=[d.topLeftFinderPattern,d.topRightFinderPattern,d.bottomLeftFinderPattern].map(B=>{let at=Math.min(m.width-1,Math.max(0,Math.round(B.x))),Z=Math.min(m.height-1,Math.max(0,Math.round(B.y)));return Eo(m.data,(Z*m.width+at)*4)}).filter(B=>B>R).length>=2;V?(w+=10,S.push({id:"polarity",passed:false,message:"Light code on a dark background; some scanner apps can't read it",fix:"Use dark modules on a light background"})):S.push({id:"polarity",passed:true,message:"Dark code on a light background"});let Q=Math.max(2,Math.round(b*2)),j={minX:y-Q,maxX:M+Q,minY:C-Q,maxY:x+Q};if(j.minX<0||j.minY<0||j.maxX>m.width||j.maxY>m.height)S.push({id:"quiet-zone",passed:true,skipped:true,message:"The image is cropped too tight to check the quiet zone"});else {let B=0,at=0;for(let Z=j.minY;Z<j.maxY;Z++)for(let St=j.minX;St<j.maxX;St++){if(St>=y&&St<M&&Z>=C&&Z<x)continue;let qn=Eo(m.data,(Z*m.width+St)*4);(V?qn>R:qn<=R)&&B++,at++;}B/Math.max(at,1)>.12?(w+=10,S.push({id:"quiet-zone",passed:false,message:"Something dark touches the code; the quiet zone isn't clear",fix:"Leave clear space (about 4 modules) around the code"})):S.push({id:"quiet-zone",passed:true,message:"Clear space around the code"});}b<2?S.push({id:"resolution",passed:false,message:`Low resolution: about ${Math.round(b*10)/10} px per module`,fix:"Use a larger image, or export the code at a bigger size"}):S.push({id:"resolution",passed:true,message:`About ${Math.round(b)} px per module`});let ft=Math.round(b*4),F=Math.max(0,y-ft),U=Math.max(0,C-ft),xt=Math.min(m.width,M+ft)-F,Rt=Math.min(m.height,x+ft)-U,ze=B=>{let at=B/g,Z=Un(xt*at,Rt*at);Z.ctx.drawImage(l,F,U,xt,Rt,0,0,Z.canvas.width,Z.canvas.height);let St=Z.ctx.getImageData(0,0,Z.canvas.width,Z.canvas.height);return Z.canvas.remove(),St},ue=[],Jt=false;for(let[B,at]of o.entries()){await ju(),qe(n);let Z=Ii(r,ze,at,h,St=>St?.data===f.data);w+=Zu(B,o.length,Z),ue.push(Ju(at,o,Z)),B===o.length-1&&Z==="fail"&&(Jt=true);}l.remove();let me=Math.max(0,Math.min(100,100-w));return Jt&&(me=Math.min(me,30)),{data:f.data,version:p,score:me,grade:Ku(me,Jt),checks:[...ue,...S]}}var Ah=[320];function om(t,e){let n=Math.min(1,e),o=Math.max(1,Math.round(t.width*n)),r=Math.max(1,Math.round(t.height*n)),a=new Uint8ClampedArray(o*r*4),i=t.width/o,c=t.height/r;for(let s=0;s<r;s++){let l=Math.floor(s*c),u=Math.max(l+1,Math.min(t.height,Math.floor((s+1)*c)));for(let m=0;m<o;m++){let f=Math.floor(m*i),d=Math.max(f+1,Math.min(t.width,Math.floor((m+1)*i))),p=[0,0,0,0];for(let b=l;b<u;b++)for(let _=f;_<d;_++){let y=(b*t.width+_)*4;for(let M=0;M<4;M++)p[M]=p[M]+t.data[y+M];}let h=(u-l)*(d-f),g=(s*o+m)*4;for(let b=0;b<4;b++)a[g+b]=p[b]/h;}}return {data:a,width:o,height:r,colorSpace:"srgb"}}function vh(t){try{return new TextDecoder("utf-8",{fatal:!0}).decode(Uint8Array.from(t.binaryData))}catch{return t.data}}async function y5(t,e,n={}){let{width:o,height:r}=t;if(!(o>0&&r>0)||t.data.length<o*r*4)throw new Error("Pixels must be width \xD7 height \xD7 4 RGBA bytes");let a=await Li(),i={data:t.data instanceof Uint8ClampedArray?t.data:Uint8ClampedArray.from(t.data),width:o,height:r},c=a(i.data,o,r,{inversionAttempts:"dontInvert"});if(!c)return {data:null,version:null,passed:false};let s=vh(c),{version:l,location:u}=c;if(!Ai(c,e))return {data:s,version:l,passed:false};let m=17+4*l,f=(Ue(u.topLeftCorner,u.topRightCorner)+Ue(u.bottomLeftCorner,u.bottomRightCorner)+Ue(u.topLeftCorner,u.bottomLeftCorner)+Ue(u.topRightCorner,u.bottomRightCorner))/4;for(let d of n.sizes??Ah)if(Ii(a,h=>om(i,h/f),d,m,h=>Ai(h,e))!=="pass")return {data:s,version:l,passed:false};return {data:s,version:l,passed:true}}Se();var Lh=16,am=.01;function Ih(t){let e=new Float64Array(256);for(let s of t)e[Math.min(255,Math.max(0,Math.round(s*255)))]++;let n=t.length,o=0;for(let s=0;s<256;s++)o+=s*e[s];let r=0,a=0,i=0,c=128;for(let s=0;s<256;s++){if(a+=e[s],a===0)continue;let l=n-a;if(l===0)break;r+=s*e[s];let u=r/a,m=(o-r)/l,f=a*l*(u-m)**2;f>i&&(i=f,c=s);}return (c+.5)/255}function Fh(t,e){let{width:n,height:o,data:r}=t,a=n*o,i=new Uint8Array(a),c=0;for(let d=0;d<a;d++)r[d*4+3]<128&&c++;if(e==="alpha"||e==="auto"&&c>a*.02&&c<a*.98){for(let d=0;d<a;d++)i[d]=r[d*4+3]>=128?1:0;return i}let l=new Float32Array(a);for(let d=0;d<a;d++){let p=r[d*4+3]/255,h=.2126*r[d*4]+.7152*r[d*4+1]+.0722*r[d*4+2];l[d]=1-(h*p+255*(1-p))/255;}let u=Ih(l);for(let d=0;d<a;d++)i[d]=l[d]>u?1:0;let m=0,f=0;for(let d=0;d<n;d++)for(let p of [0,o-1])m++,f+=i[p*n+d];for(let d=1;d<o-1;d++)for(let p of [0,n-1])m++,f+=i[d*n+p];if(f>m/2)for(let d=0;d<a;d++)i[d]=i[d]?0:1;return i}function im(t,e,n,o){for(let r of [1,0]){let a=new Uint8Array(t.length);for(let i=0;i<t.length;i++){if(a[i]||t[i]!==r)continue;let c=[i];a[i]=1;let s=false;for(let u of c){let m=u%e,f=(u-m)/e;(m===0||f===0||m===e-1||f===n-1)&&(s=true);for(let[d,p]of [[m-1,f],[m+1,f],[m,f-1],[m,f+1]]){if(d<0||p<0||d>=e||p>=n)continue;let h=p*e+d;!a[h]&&t[h]===r&&(a[h]=1,c.push(h));}}if((r===1||!s)&&c.length<o)for(let u of c)t[u]=r?0:1;}}}function sm(t,e={}){let{width:n,height:o,data:r}=t;if(!(n>0&&o>0)||r.length<n*o*4)throw new Error("Silhouette pixels must be width \xD7 height \xD7 4 RGBA bytes");let a=Fh(t,e.mode??"auto"),i=a.reduce((S,w)=>S+w,0);im(a,n,o,Math.max(16,i*am));let c=n,s=o,l=-1,u=-1;for(let S=0;S<o;S++)for(let w=0;w<n;w++)a[S*n+w]&&(c=Math.min(c,w),s=Math.min(s,S),l=Math.max(l,w),u=Math.max(u,S));if(l<0)throw new Error("No shape found: use a picture with a dark or opaque shape on a light or clear background");let m=l-c+1,f=u-s+1;if(Math.max(m,f)<Lh)throw new Error("The shape is too small to trace; use a bigger picture");let p=Math.min(Math.max(Math.round(e.cells??Vt),ie),Vt)/Math.max(m,f),h=Math.max(ie,Math.round(m*p)),g=Math.max(ie,Math.round(f*p)),b=Math.max(1,Math.round(m*p)),_=Math.max(1,Math.round(f*p)),y=Math.floor((h-b)/2),M=Math.floor((g-_)/2),C=new Uint8Array(h*g);for(let S=0;S<_;S++){let w=s+Math.floor(S*f/_),E=Math.max(w+1,s+Math.floor((S+1)*f/_));for(let P=0;P<b;P++){let R=c+Math.floor(P*m/b),v=Math.max(R+1,c+Math.floor((P+1)*m/b)),L=0;for(let k=w;k<E;k++)for(let T=R;T<v;T++)L+=a[k*n+T];C[(S+M)*h+P+y]=L*2>=(E-w)*(v-R)?1:0;}}let x=C.reduce((S,w)=>S+w,0);if(im(C,h,g,Math.max(4,x*am)),!C.includes(1))throw new Error("The shape is too small to trace; use a bigger picture");return {type:"silhouette",width:h,height:g,cells:Array.from(C,S=>S?"1":"0").join("")}}var Ti=512;async function Th(t){if(typeof t!="string"&&!(t instanceof Blob))return t.complete||await new Promise(n=>{t.addEventListener("load",n,{once:true}),t.addEventListener("error",n,{once:true});}),t;let e=typeof t=="string"?t:URL.createObjectURL(t);try{return await new Promise((n,o)=>{let r=new Image;r.crossOrigin="anonymous",r.onload=()=>n(r),r.onerror=()=>o(new Error("Could not load the picture")),r.src=e;})}finally{typeof t!="string"&&setTimeout(()=>URL.revokeObjectURL(e),1e3);}}async function kh(t,e={}){if(typeof document>"u")throw new Error("loadQRSilhouette needs a browser; pass decoded pixels to createQRSilhouette instead");let n=await Th(t),o=n.naturalWidth||n.width||Ti,r=n.naturalHeight||n.height||Ti,a=Ti/Math.max(o,r),i=Math.max(1,Math.round(o*a)),c=Math.max(1,Math.round(r*a)),s=document.createElement("canvas");s.width=i,s.height=c;let l=s.getContext("2d",{willReadFrequently:true});if(!l)throw new Error("Could not get a canvas context");l.drawImage(n,0,0,i,c);let u;try{u=l.getImageData(0,0,i,c);}catch{throw new Error("Could not read the picture (cross-origin images need CORS); upload it instead")}finally{s.remove();}return sm(u,e)}ja();Re();Vr();Bn();async function ce(t){let{QRCodeSVG:e}=await Promise.resolve().then(()=>(Re(),Hl)),{renderToStaticMarkup:n}=await import('react-dom/server'),o=await import('react'),r={...t};if(t.imageSettings?.src)try{let d=await Nh(t.imageSettings.src);r={...t,imageSettings:{...t.imageSettings,src:d}};}catch{let{imageSettings:d,...p}=t;r=p;}let{hideLogo:a,url:i,logo:c,scale:s,frameLabelMarkers:l,...u}=r,m=o.createElement(e,{...u,templateId:r.templateId,customTemplate:r.customTemplate}),f=n(m);return `data:image/svg+xml,${encodeURIComponent(f)}`}var Nh=t=>new Promise((e,n)=>{if(t.startsWith("data:")){e(t);return}let o=new Image;o.crossOrigin="anonymous",o.onload=()=>{try{let r=document.createElement("canvas");r.width=o.naturalWidth||o.width,r.height=o.naturalHeight||o.height;let a=r.getContext("2d");if(!a){n(new Error("Could not get canvas context"));return}a.drawImage(o,0,0);let i=r.toDataURL("image/png");r.remove(),e(i);}catch(r){n(new Error(`Failed to convert image to base64: ${r}`));}},o.onerror=()=>{n(new Error(`Could not load image from ${t.slice(0,100)}... Check CORS settings or use a data URL.`));},o.src=t;});async function lr(t,e,n){let o=await ce(t),r=decodeURIComponent(o.replace("data:image/svg+xml,","")),a;try{let i=new TextEncoder().encode(r),c=Array.from(i,l=>String.fromCharCode(l)).join("");a=`data:image/svg+xml;base64,${btoa(c)}`;}catch(i){throw new Error(`Failed to encode SVG for canvas conversion: ${i}`)}return new Promise((i,c)=>{let s=document.createElement("canvas"),l=s.getContext("2d");if(!l){c(new Error("Could not get canvas context"));return}let u=new Image,{width:m,height:f}=_e(t.size||bt,t.frame);s.width=Math.round(m),s.height=Math.round(f);let d=setTimeout(()=>{s.remove(),c(new Error("SVG load timeout - image may be too large or contain invalid data"));},3e4);u.onload=()=>{clearTimeout(d);try{if(e==="image/jpeg"&&(l.fillStyle="white",l.fillRect(0,0,s.width,s.height)),l.drawImage(u,0,0,s.width,s.height),n)i(s);else if(e==="image/webp")kr(s).then(jn).then(i,c).finally(()=>s.remove());else {let p=s.toDataURL(e,1);s.remove(),i(p);}}catch(p){clearTimeout(d),s.remove(),c(new Error(`Failed to draw SVG to canvas: ${p}`));}},u.onerror=()=>{clearTimeout(d),s.remove(),c(new Error("Could not load SVG"));},u.src=a;})}/**
24
+ end`;function yi(t){let e="(";for(let n of t){let o=n.codePointAt(0)??63;n==="("||n===")"||n==="\\"?e+=`\\${n}`:o>=32&&o<127?e+=n:o>=160&&o<=255?e+=`\\${o.toString(8).padStart(3,"0")}`:e+="?";}return `${e})`}var $i=class extends Gn{out=[];shadingNames=new Map;cmyk;images;usesLevel3=false;constructor(e,n,o,r){super(n,o),this.cmyk=e,this.images=r;}color(e){if(this.cmyk){let[n,o,r,a]=Te(e.r,e.g,e.b);return `${$(n)} ${$(o)} ${$(r)} ${$(a)} cmyk`}return `${$(e.r/255)} ${$(e.g/255)} ${$(e.b/255)} rg`}tracePath(e,n){let o=["n"],r=false;for(let a of e)if(a.op==="M"||a.op==="L"&&!r){let[i,c]=Y(n,a.x,a.y);o.push(`${$(i)} ${$(c)} m`),r=true;}else if(a.op==="L"){let[i,c]=Y(n,a.x,a.y);o.push(`${$(i)} ${$(c)} l`);}else if(a.op==="C"){if(!r)continue;let[i,c]=Y(n,a.x1,a.y1),[s,l]=Y(n,a.x2,a.y2),[u,m]=Y(n,a.x,a.y);o.push(`${$(i)} ${$(c)} ${$(s)} ${$(l)} ${$(u)} ${$(m)} c`);}else r&&o.push("h");return o.join(" ")}beginClip(e,n,o){return this.out.push(`gsave ${this.tracePath(e,n)} ${o?"eoclip":"clip"} n`),true}endClip(){this.out.push("grestore");}rect(e,n,o,r,a){this.out.push(`${this.color(e)} n ${$(n)} ${$(o)} m ${$(n+r)} ${$(o)} l ${$(n+r)} ${$(o+a)} l ${$(n)} ${$(o+a)} l h f`);}shade(e,n,o){let r=pt(n.matrix,o.matrix);if(!Be(r))return;let a=ho(o,this.cmyk?"cmyk":"rgb"),i=this.shadingNames.get(a);i||(i=`Sh${this.shadingNames.size}`,this.shadingNames.set(a,i)),this.usesLevel3=true;let c=n.fillRule==="evenodd"?"eoclip":"clip";this.out.push(`gsave ${this.tracePath(e,n.matrix)} ${c} n [${fo(r)}] concat ${i} shfill grestore`);}paint(e,n,o){if(e.length===0)return;let r=o.opacity??1;if(r<=0)return;let a=this.resolveFill(o.fill,e,o.viewport,(o.fillOpacity??1)*r);a&&"pattern"in a?this.paintPattern(e,o,a.pattern,a.alpha):a&&"gradient"in a&&this.shade(e,o,{...a.gradient,stops:a.gradient.stops.map(m=>({...m,color:this.flatten({...m.color,a:m.color.a*a.alpha})}))});let i=a&&"color"in a?this.flatten(a.color):null,c=o.strokeWidth>0?this.resolveColor(o.stroke):null,s=c&&this.flatten({...c,a:c.a*r});if(!(i||s))return;let l=this.tracePath(e,o.matrix),u=o.fillRule==="evenodd"?"ef":"f";i&&s?this.out.push(`gsave ${this.color(i)} ${l} ${u} grestore`):i&&this.out.push(`${this.color(i)} ${l} ${u}`),s&&this.out.push(`${this.color(s)} ${$(o.strokeWidth*Sn(o.matrix))} w ${l} s`);}text(e,n){let o=e.text.replace(/\s+/g," ").trim(),r=this.resolveColor(n.fill);if(!(o&&r))return;let a=Sn(n.matrix),[i,c]=Y(n.matrix,j(e.attrs.x,n.viewport[0]),j(e.attrs.y,n.viewport[1])),l=n.fontWeight==="bold"||Number.parseInt(n.fontWeight,10)>=600?"/QRDX-Bold":"/QRDX-Regular",u=$(n.fontSize*a),m=Number.parseFloat(e.attrs["data-max-width"]??""),f=m>0?` dup stringwidth pop dup ${$(m*a)} gt {${$(m*a)} exch div ${u} mul ${l} findfont exch scalefont setfont} {pop} ifelse`:"",d=n.textAnchor==="middle"?" dup stringwidth pop 2 div neg 0 rmoveto":n.textAnchor==="end"?" dup stringwidth pop neg 0 rmoveto":"",p=Math.atan2(n.matrix[1],n.matrix[0])*180/Math.PI;if(Math.abs(p)>.01){this.out.push(`gsave ${this.color(r)} ${l} findfont ${u} scalefont setfont ${$(i)} ${$(c)} translate ${$(p)} rotate ${yi(o)}${f} 0 0 moveto${d} show grestore`);return}this.out.push(`gsave ${this.color(r)} ${l} findfont ${u} scalefont setfont ${yi(o)}${f} ${$(i)} ${$(c)} moveto${d} show grestore`);}image(e,n){let o=e.attrs.href??e.attrs["xlink:href"],r=o?this.images.get(o):void 0;if(!r)return;let a=j(e.attrs.x,n.viewport[0]),i=j(e.attrs.y,n.viewport[1]),c=j(e.attrs.width,n.viewport[0]),s=j(e.attrs.height,n.viewport[1]);if(c<=0||s<=0)return;let[l,u]=Y(n.matrix,a,i),[m,f]=Y(n.matrix,a+c,i+s),{components:d}=r,p=d===1?"/DeviceGray":d===4?"/DeviceCMYK":"/DeviceRGB",h=Array.from({length:d},()=>"0 1").join(" "),g="/ASCII85Decode filter";r.kind==="jpeg"?(g+=" /DCTDecode filter",r.progressive&&(this.usesLevel3=true)):r.compressed&&(g+=" /FlateDecode filter",this.usesLevel3=true),this.out.push(["gsave",`${$(Math.min(l,m))} ${$(Math.min(u,f))} translate ${$(Math.abs(m-l))} ${$(Math.abs(f-u))} scale`,`${p} setcolorspace`,`<< /ImageType 1 /Width ${r.width} /Height ${r.height} /BitsPerComponent 8 /Decode [${h}] /ImageMatrix [${r.width} 0 0 -${r.height} 0 ${r.height}] /DataSource currentfile ${g} >> image`,vf(r.bytes),"grestore"].join(`
25
+ `));}};async function $u(t,e={}){let n=ve(t);if(!n)throw new Error("Could not read the SVG to convert to EPS");let o=j(n.attrs.width,0,0)||512,r=j(n.attrs.height,0,0)||o,a=e.width??o;if(!(Number.isFinite(a)&&a>0))throw new Error("EPS width must be a positive number of points");let i=a/o,c=r*i,s=Math.max(0,e.bleed??0),l=a+2*s,u=c+2*s,m=e.colorMode==="cmyk",f=new Map;for(let _ of sr(n,new Set)){let y=await Af(_,m);y&&f.set(_,y);}let d=new $i(m,ir(n,new Map),mo(n),f);$o(d,{bgColor:e.background??"#ffffff"});let h={matrix:pt([1,0,0,-1,s,u-s],[i,0,0,i,0,0]),viewport:[o,r],fill:"#000000",fillRule:"nonzero",stroke:"none",strokeWidth:1,fontSize:16,fontWeight:"normal",textAnchor:"start"},g=s>0?e.bleedColor??void 0:void 0;if(!(g&&d.paintBleed(n,h,g,[0,0,l,u]))){let _=g?d.resolveColor(g):null;_&&d.rect(_,0,0,l,u);}d.walk(n,h,true);let b=(e.title??"QR code").replace(/[^\x20-\x7e]/g,"?");return ["%!PS-Adobe-3.0 EPSF-3.0",`%%BoundingBox: 0 0 ${Math.ceil(l)} ${Math.ceil(u)}`,`%%HiResBoundingBox: 0 0 ${$(l)} ${$(u)}`,`%%Title: ${yi(b)}`,"%%Creator: qrdx",`%%LanguageLevel: ${d.usesLevel3?3:2}`,"%%DocumentData: Clean7Bit","%%EndComments","%%BeginProlog",Lf,"%%EndProlog","qrdxdict begin",...Array.from(d.shadingNames,([_,y])=>`/${y} ${_} def`),"gsave",...d.out,"grestore","end","showpage","%%Trailer","%%EOF",""].join(`
26
+ `)}var xu="EPS can't carry image fills: PostScript has no transparency and would repeat the picture for every dot. Download PDF, SVG or PNG instead.";function Su(t){return [t.bgColor,t.fgColor,t.eyeColor,t.dotColor,...Object.values(t.eyeColors??{}).flatMap(n=>[n?.outer,n?.inner])].some(n=>typeof n=="object"&&n?.type==="image")}async function Mo(t,e={}){if(Su(t))throw new Error(xu);let n=So(t,{size:e.sizeMm??wf,unit:"mm",bleed:e.bleedMm}),o=await cr(t);return await $u(o,{width:n.trimWidth*yu,bleed:n.bleed*yu,bleedColor:n.bleed>0?yo(t,o):fi(t),colorMode:e.colorMode,background:wt(t.bgColor,yt)})}function Co(t){return `data:application/postscript;base64,${btoa(t)}`}async function If(t,e={}){let n=await Mo(t,e);le(Co(n),e.filename??"qr-code-print.eps");}_e();var xi={png:{mimeType:"image/png",extension:"png",vector:false},jpg:{mimeType:"image/jpeg",extension:"jpg",vector:false},webp:{mimeType:"image/webp",extension:"webp",vector:false},svg:{mimeType:"image/svg+xml",extension:"svg",vector:true},pdf:{mimeType:"application/pdf",extension:"pdf",vector:false},eps:{mimeType:"application/postscript",extension:"eps",vector:true}},w_={small:{width:200,height:200},medium:{width:400,height:400},large:{width:800,height:800},xlarge:{width:1200,height:1200},"2xl":{width:1600,height:1600},"3xl":{width:2e3,height:2e3}};function Si(t,e){return t<50||e<50?{isValid:false,error:"Size must be at least 50x50 pixels"}:t>5e3||e>5e3?{isValid:false,error:"Size must not exceed 5000x5000 pixels"}:t!==e?{isValid:false,error:"Width and height must be equal for QR codes"}:{isValid:true}}function sn(t,e){let{imageSettings:n,size:o}=t;if(!(n&&o)||o===e)return {...t,size:e};let r=e/o;return {...t,size:e,imageSettings:{...n,width:n.width*r,height:n.height*r,...n.x!=null&&{x:n.x*r},...n.y!=null&&{y:n.y*r},...n.padding!=null&&{padding:n.padding*r}}}}function le(t,e){let n=document.createElement("a");n.href=t,n.download=e,document.body.appendChild(n),n.click(),document.body.removeChild(n);}var Mu=t=>(xi[t]??xi.png).mimeType;function Tf(t,e,n){let{extension:o,vector:r}=xi[t];if(r)return `qr-code.${o}`;let{width:a,height:i}=be(e.width,n);return `qr-code-${Math.round(a)}x${Math.round(i)}.${o}`}async function Cu(t,e={}){let n=await lr(t,"image/webp",true);try{return await kr(n,e)}finally{n.remove();}}var Ff=25.4/72;async function wu(t){let e=await Mo(t,{sizeMm:(t.size??_t)*Ff});return Co(e)}async function Eu(t){let e;try{({jsPDF:e}=await import('jspdf'));}catch(f){throw new Error(`PDF export needs the optional "jspdf" package. Install it with \`npm install jspdf\`. (${f})`)}let n=await ce(t),o=decodeURIComponent(n.replace("data:image/svg+xml,","")),r;try{let f=new TextEncoder().encode(o),d=Array.from(f,h=>String.fromCharCode(h)).join("");r=`data:image/svg+xml;base64,${btoa(d)}`;}catch(f){throw new Error(`Failed to encode SVG for PDF conversion: ${f}`)}let{width:a,height:i}=be(t.size||_t,t.frame),c=await new Promise((f,d)=>{let p=new Image,h=document.createElement("canvas");h.width=Math.round(a),h.height=Math.round(i);let g=h.getContext("2d");if(!g){d(new Error("Could not get canvas context"));return}let b=setTimeout(()=>{h.remove(),d(new Error("SVG load timeout - image may be too large or contain invalid data"));},3e4);p.onload=()=>{clearTimeout(b);try{g.drawImage(p,0,0,h.width,h.height),f(h);}catch(_){clearTimeout(b),h.remove(),d(new Error(`Failed to draw image to canvas: ${_}`));}},p.onerror=()=>{clearTimeout(b),h.remove(),d(new Error("Could not load SVG for PDF conversion"));},p.src=r;}),s=c.toDataURL("image/png",1),l=a*.264583,u=i*.264583,m=new e({orientation:l>u?"landscape":"portrait",unit:"mm",format:[l,u]});return m.addImage(s,"PNG",0,0,l,u),c.remove(),m.output("dataurlstring")}async function E_(t,e){let{format:n,size:o,filename:r,quality:a}=e,i=Si(o.width,o.height);if(!i.isValid)throw new Error(i.error);let c=sn(t,o.width),s=r||Tf(n,o,t.frame);try{if(n==="svg"){let l=await ce(c);le(l,s);}else if(n==="pdf"){let l=await Eu(c);le(l,s);}else if(n==="eps")le(await wu(c),s);else if(n==="webp"){let l=await Cu(c,{quality:a});le(await jn(l),s);}else {let l=Mu(n),u=await lr(c,l);if(typeof u=="string")le(u,s);else throw new Error("Failed to generate image data URL")}}catch(l){throw console.error(`Error downloading ${n.toUpperCase()}:`,l),l}}async function R_(t,e,n,o={}){let r=Si(n.width,n.height);if(!r.isValid)throw new Error(r.error);let a=sn(t,n.width);if(e==="svg")return await ce(a);if(e==="pdf")return await Eu(a);if(e==="eps")return await wu(a);if(e==="webp")return await jn(await Cu(a,o));let i=Mu(e),c=await lr(a,i);if(typeof c=="string")return c;throw new Error("Failed to generate QR code data URL")}async function P_(t,e={width:_t,height:_t}){try{let n=Si(e.width,e.height);if(!n.isValid)throw new Error(n.error);let o=sn(t,e.width),r=lr(o,"image/png",!0).then(a=>new Promise((i,c)=>{let s=a;s.toBlob(l=>{s.remove(),l?i(l):c(new Error("Failed to create blob from canvas"));},"image/png");}));await navigator.clipboard.write([new ClipboardItem({"image/png":r})]);}catch(n){throw console.error("Error copying to clipboard:",n),n}}async function A_(t){let e=await ce(t);return decodeURIComponent(e.replace("data:image/svg+xml,",""))}_e();jo();wn();ht();Bt();_r();fe();var Qt={maxBytes:2e5,maxElements:500,maxDepth:16,maxInputSegments:4e3,maxColors:8,artboardSide:1e3,decimals:1,padding:.06},at=class extends Error{},kf={script:t=>`Removed ${xt(t,"script")}`,style:t=>`Removed ${xt(t,"style sheet")}: colors set with CSS classes are lost. Export with presentation attributes (Illustrator: Styling \u2192 Presentation Attributes)`,"foreign-object":t=>`Removed ${xt(t,"foreignObject element")}`,image:t=>`Removed ${xt(t,"image")}: frames are vector shapes only`,use:t=>`Removed ${xt(t,"<use> reference")}: ungroup or detach symbols before exporting`,text:t=>`Removed ${xt(t,"text element")}: add text as labels in the frame editor`,effects:t=>`Removed ${xt(t,"filter, mask, clip path or pattern")}`,animation:t=>`Removed ${xt(t,"animation")}`,unknown:t=>`Removed ${xt(t,"unsupported element")}`,"nested-svg":t=>`Removed ${xt(t,"nested <svg>")}: flatten it first`,handlers:t=>`Removed ${xt(t,"event handler attribute")}`,links:t=>`Removed ${xt(t,"link")} (href)`,"external-paint":t=>`Removed ${xt(t,"fill or stroke")} that referenced something outside the file`,gradient:t=>`Flattened ${xt(t,"gradient")} to its first color: add gradients in the frame editor`,opacity:t=>`Made ${xt(t,"semi-transparent shape")} opaque (print files have no transparency)`,"invalid-paint":t=>`${xt(t,"color")} couldn't be read and fell back to the parent color`,stroke:t=>`Removed ${xt(t,"stroke")} on paths, polygons or polylines: outline strokes before exporting (Figma: Outline stroke)`,dash:t=>`Drew ${xt(t,"dashed stroke")} as solid`,clipped:t=>`Cut ${xt(t,"shape")} at the edge of the artboard`,outside:t=>`Removed ${xt(t,"shape")} outside the artboard`,colors:t=>`Merged ${xt(t,"color")} with similar ones (${Qt.maxColors} at most)`,"qr-placed":()=>'No QR placeholder found (a rect with id "qr"): the code was centered; place it in the frame editor'};function xt(t,e){return `${t} ${e}${t===1?"":"s"}`}var Ei=class{counts=new Map;add(e,n=1){this.counts.set(e,(this.counts.get(e)??0)+n);}list(){return [...this.counts].map(([e,n])=>({code:e,count:n,message:kf[e](n)}))}},Nf=/^\s*<\?xml\s[^?>]*\?>/,Mi=/[A-Za-z_][\w:.-]*/y,Ci=/<\/([A-Za-z_][\w:.-]*)\s*>/y,wo=/\s*/y,Of=/[A-Za-z_:][\w:.-]*/y,Df=/[^"<]*/y,Bf=/[^'<]*/y;function Qn(t,e,n){return t.lastIndex=n,t.test(e)?t.lastIndex:n}function Ru(t,e){let n=Qn(wo,t,e),o=Qn(Of,t,n);if(n===e||o===n)return -1;let r=Qn(wo,t,o);if(t[r]!=="=")return -1;let a=Qn(wo,t,r+1),i=t[a];if(i!=='"'&&i!=="'")return -1;let s=Qn(i==='"'?Df:Bf,t,a+1);return t[s]===i?s+1:-1}function Gf(t,e){let n=Qn(wo,t,e);return t[n]===">"?{end:n+1,selfClosing:false}:t.startsWith("/>",n)?{end:n+2,selfClosing:true}:null}function Qf(t){let e=[],n=0,o="",r=0;for(;r<t.length;){let a=t.indexOf("<",r);if(a<0)break;if(r=a,t.startsWith("<!--",r)){let l=t.indexOf("-->",r+4);if(l<0)throw new at("The SVG has an unclosed comment");r=l+3;continue}if(t.startsWith("<![CDATA[",r)){let l=t.indexOf("]]>",r+9);if(l<0)throw new at("The SVG has an unclosed CDATA section");r=l+3;continue}if(t.startsWith("<?",r)){let l=t.indexOf("?>",r+2);if(l<0)throw new at("The SVG has an unclosed declaration");r=l+2;continue}if(t.startsWith("<!",r))throw new at("DOCTYPE and other declarations are not allowed");if(t[r+1]==="/"){Ci.lastIndex=r;let l=Ci.exec(t);if(!l)throw new at("The SVG has a malformed closing tag");if(e.pop()!==l[1])throw new at(`The SVG closes <${l[1]}> out of order`);r=Ci.lastIndex;continue}Mi.lastIndex=r+1;let i=Mi.exec(t);if(!i)throw new at("The SVG has a malformed tag");let c=Mi.lastIndex;for(let l=Ru(t,c);l>=0;l=Ru(t,c))c=l;let s=Gf(t,c);if(!s)throw new at(`The SVG has a malformed <${i[0]}> tag (attributes must be quoted and may not contain "<")`);if(n++,n>Qt.maxElements)throw new at(`The SVG has more than ${Qt.maxElements} elements`);if(o||(o=i[0]),!s.selfClosing&&(e.push(i[0]),e.length>Qt.maxDepth))throw new at(`The SVG nests elements more than ${Qt.maxDepth} deep`);r=s.end;}if(e.length>0)throw new at(`The SVG doesn't close <${e.at(-1)}>`);return o}function Uf(t){if(typeof t!="string")throw new at("Expected SVG markup as a string");let e=new TextEncoder().encode(t).length;if(e>Qt.maxBytes)throw new at(`The SVG is ${Math.ceil(e/1e3)} KB; the limit is ${Qt.maxBytes/1e3} KB`);if(/<!(?:DOCTYPE|ENTITY|ATTLIST|ELEMENT|NOTATION)/i.test(t))throw new at("DOCTYPE and entity declarations are not allowed");let n=t.replace(Nf,"");if(n.includes("<?"))throw new at("Processing instructions (such as xml-stylesheet) are not allowed");if(Qf(n)!=="svg")throw new at("The file must start with an <svg> element");return n}var wi=t=>Math.round(Math.min(255,Math.max(0,t))).toString(16).padStart(2,"0");function Zt(t){let e=t?.replace(/!important/i,"").trim();return e===""||e==="inherit"?void 0:e}function Ri(t,e,n,o){let r=t.trim();if(r==="none"||r==="transparent")return null;if(/^url\(/i.test(r)){let i=/^url\(\s*['"]?#([^)'"\s]+)['"]?\s*\)/i.exec(r)?.[1],c=i?n.get(i):void 0;return c?(o.add("gradient"),Ri(c,e,n,o)):(o.add("external-paint"),null)}let a=dt(r==="currentColor"?e.color:r);return a?a.a<=0?null:`#${wi(a.r)}${wi(a.g)}${wi(a.b)}`:(o.add("invalid-paint"),null)}function qf(t){let e=new Map,n=r=>{(r.name==="linearGradient"||r.name==="radialGradient")&&r.attrs.id&&e.set(r.attrs.id,r);for(let a of r.children)n(a);};n(t);let o=new Map;for(let[r,a]of e){let i=a.children.find(s=>s.name==="stop");if(!i){let s=(a.attrs.href??a.attrs["xlink:href"])?.match(/^#(.+)$/)?.[1];i=s?e.get(s)?.children.find(l=>l.name==="stop"):void 0;}let c=i&&Zt(K(i,"stop-color"));c&&o.set(r,c);}return o}function Pu(t,e){return t.map(n=>{if(n.op==="Z")return n;if(n.op==="C"){let[a,i]=Y(e,n.x1,n.y1),[c,s]=Y(e,n.x2,n.y2),[l,u]=Y(e,n.x,n.y);return {op:"C",x1:a,y1:i,x2:c,y2:s,x:l,y:u}}let[o,r]=Y(e,n.x,n.y);return {op:n.op,x:o,y:r}})}function zf(t){let e=0;return t.forEach(([n,o],r)=>{let[a,i]=t[(r+1)%t.length];e+=n*i-a*o;}),e/2}function Ai(t){return t.length<3?[]:[...t.map(([e,n],o)=>({op:o===0?"M":"L",x:e,y:n})),{op:"Z"}]}var Ge=t=>Number.isFinite(t);function mt(t,e,n=0){let o=Number.parseFloat(t.attrs[e]??"");return Ge(o)?o:n}function Au(t){switch(t.name){case "path":return de(t.attrs.d??"");case "rect":{let e=t.attrs.rx??t.attrs.ry,n=t.attrs.ry??t.attrs.rx;return oe(mt(t,"x"),mt(t,"y"),mt(t,"width"),mt(t,"height"),Number.parseFloat(e??"0")||0,Number.parseFloat(n??"0")||0)}case "circle":{let e=mt(t,"r");return re(mt(t,"cx"),mt(t,"cy"),e,e)}case "ellipse":return re(mt(t,"cx"),mt(t,"cy"),mt(t,"rx"),mt(t,"ry"));case "polygon":case "polyline":{let e=Ve(t.attrs.points),n=[];for(let o=0;o+1<e.length;o+=2)n.push([e[o],e[o+1]]);return Ai(n)}default:return []}}function Hf(t,e){let n=e/2;switch(t.name){case "rect":{let o=mt(t,"x"),r=mt(t,"y"),a=mt(t,"width"),i=mt(t,"height"),c=Number.parseFloat(t.attrs.rx??t.attrs.ry??"0")||0,s=oe(o-n,r-n,a+e,i+e,c>0?c+n:0,c>0?c+n:0);if(a<=e||i<=e)return s;let l=Math.max(c-n,0);return [...s,...oe(o+n,r+n,a-e,i-e,l,l)]}case "circle":case "ellipse":{let o=mt(t,"cx"),r=mt(t,"cy"),a=t.name==="circle"?mt(t,"r"):mt(t,"rx"),i=t.name==="circle"?mt(t,"r"):mt(t,"ry"),c=re(o,r,a+n,i+n);return a<=n||i<=n?c:[...c,...re(o,r,a-n,i-n)]}case "line":{let[o,r,a,i]=["x1","y1","x2","y2"].map(m=>mt(t,m)),c=Math.hypot(a-o,i-r);if(c===0)return [];let s=-(i-r)/c*n,l=(a-o)/c*n,u=[[o+s,r+l],[a+s,i+l],[a-s,i-l],[o-s,r-l]];return Ai(zf(u)<0?u.reverse():u)}default:return null}}var Wf=new Set(["path","rect","circle","ellipse","polygon","polyline","line"]),Vf=new Set(["defs","linearGradient","radialGradient","stop","title","desc","metadata"]),Xf={script:"script",style:"style",foreignObject:"foreign-object",image:"image",feImage:"image",use:"use",text:"text",tspan:"text",textPath:"text",filter:"effects",mask:"effects",clipPath:"effects",pattern:"effects",marker:"effects",symbol:"effects",animate:"animation",animateMotion:"animation",animateTransform:"animation",set:"animation"},Yf=/^(?:qrdx[-_ ]?)?qr(?:[-_ ]?code)?$/i;function Lu(t,e){for(let n of Object.keys(t.attrs)){let o=n.toLowerCase();o.startsWith("on")?e.add("handlers"):o==="href"||o==="xlink:href"?t.name!=="linearGradient"&&t.name!=="radialGradient"&&e.add("links"):(o==="filter"||o==="mask"||o==="clip-path")&&e.add("effects");}}function Iu(t,e,n,o,r){if(Lu(t,o),Zt(K(t,"display"))==="none"||Zt(K(t,"visibility"))==="hidden")return;let a=Number.parseFloat(K(t,"opacity")??"1"),i=Zt(K(t,"fill-rule")),c=Number.parseFloat(Zt(K(t,"stroke-width"))??""),s={matrix:pt(e.matrix,ne(t.attrs.transform)),fill:Zt(K(t,"fill"))??e.fill,fillRule:i==="evenodd"||i==="nonzero"?i:e.fillRule,stroke:Zt(K(t,"stroke"))??e.stroke,strokeWidth:Ge(c)&&c>=0?c:e.strokeWidth,color:Zt(K(t,"color"))??e.color,opacity:e.opacity*(Ge(a)?a:1)};for(let l of t.children){if(Vf.has(l.name))continue;let u=Xf[l.name];if(u){o.add(u);continue}if(l.name==="svg"){o.add("nested-svg");continue}if(l.name==="g"||l.name==="a"){Iu(l,s,n,o,r);continue}if(!Wf.has(l.name)){o.add("unknown");continue}jf(l,s,n,o,r);}}function jf(t,e,n,o,r){if(Lu(t,o),Zt(K(t,"display"))==="none"||Zt(K(t,"visibility"))==="hidden")return;let a=pt(e.matrix,ne(t.attrs.transform));if(t.name==="rect"&&Yf.test(t.attrs.id??"")&&!r.qrBox){r.qrBox=We(Pu(Au(t),a));return}let i=g=>Zt(K(t,g)),c=e.opacity*Number.parseFloat(i("opacity")??"1"),s=Number.parseFloat(i("fill-opacity")??"1"),l=Number.parseFloat(i("stroke-opacity")??"1"),u=i("fill-rule"),m={...e,fill:i("fill")??e.fill,fillRule:u==="evenodd"||u==="nonzero"?u:e.fillRule,stroke:i("stroke")??e.stroke,color:i("color")??e.color},f=Number.parseFloat(i("stroke-width")??""),d=Ge(f)&&f>=0?f:e.strokeWidth,p=(g,b,_)=>{if(g.length!==0){if(r.segments+=g.length,r.segments>Qt.maxInputSegments)throw new at(`The SVG has more than ${Qt.maxInputSegments} path segments; simplify it`);r.shapes.push({segments:Pu(g,a),fill:b,fillRule:_});}},h=g=>{let b=(Ge(c)?c:1)*(Ge(g)?g:1);return b<=0?false:(b<1&&o.add("opacity"),true)};if(t.name!=="line"){let g=Ri(m.fill,m,n,o);g&&h(s)&&p(Au(t),g,m.fillRule);}if(d>0&&m.stroke!=="none"){let g=Ri(m.stroke,m,n,o);if(g&&h(l)){let b=Hf(t,d);b?((i("stroke-dasharray")??"none")!=="none"&&o.add("dash"),p(b,g,t.name==="line"?"nonzero":"evenodd")):o.add("stroke");}}}function Zf(t,e){let n=l=>{let u=10**e;return Math.round(l*u)/u+0},o=l=>$(l,e),r="",a=0,i=0,c=0,s=0;for(let l of t){if(l.op==="Z"){r+="z",a=c,i=s;continue}let u=n(l.x),m=n(l.y);if(l.op==="M")r+=`m${o(u-a)} ${o(m-i)}`,c=u,s=m;else if(l.op==="L"){if(u===a&&m===i)continue;r+=m===i?`h${o(u-a)}`:u===a?`v${o(m-i)}`:`l${o(u-a)} ${o(m-i)}`;}else r+=`c${o(n(l.x1)-a)} ${o(n(l.y1)-i)} ${o(n(l.x2)-a)} ${o(n(l.y2)-i)} ${o(u-a)} ${o(m-i)}`;a=u,i=m;}return r}var Jf=(t,e)=>t.x0<e.x1&&e.x0<t.x1&&t.y0<e.y1&&e.y0<t.y1;function Kf(t){let e=[];for(let n of t){let o=We(n.segments);if(!o)continue;let r=e.at(-1);r&&r.shape.fill===n.fill&&r.shape.fillRule===n.fillRule&&!r.boxes.some(a=>Jf(a,o))?(r.shape={...r.shape,segments:[...r.shape.segments,...n.segments]},r.boxes.push(o)):e.push({shape:n,boxes:[o]});}return e.map(n=>n.shape)}var Pi=t=>[Number.parseInt(t.slice(1,3),16),Number.parseInt(t.slice(3,5),16),Number.parseInt(t.slice(5,7),16)];function th(t,e,n){let o=new Map;for(let i of t)o.set(i.fill,(o.get(i.fill)??0)+1);let r=new Map([...o.keys()].map(i=>[i,i])),a=0;for(;o.size>e;){let i=[...o.keys()],c=[i[0],i[1]],s=Number.POSITIVE_INFINITY;for(let d=0;d<i.length;d++)for(let p=d+1;p<i.length;p++){let h=Pi(i[d]),g=Pi(i[p]),b=Math.hypot(h[0]-g[0],h[1]-g[1],h[2]-g[2]);b<s&&(s=b,c=[i[d],i[p]]);}let[l,u]=c,[m,f]=(o.get(l)??0)>=(o.get(u)??0)?[l,u]:[u,l];o.set(m,(o.get(m)??0)+(o.get(f)??0)),o.delete(f);for(let[d,p]of r)p===f&&r.set(d,m);a++;}return a>0&&n.add("colors",a),r}var vu=t=>{let[e,n,o]=Pi(t);return .2126*e+.7152*n+.0722*o>235};function eh(t,e={}){let n=new Ei;try{let o=Uf(t),r=ve(o);if(!r)throw new at("No <svg> element found");let a=Ve(r.attrs.viewBox),[i,c,s,l]=[0,0,0,0];if(a.length===4&&a[2]>0&&a[3]>0?[i,c,s,l]=a:(s=mt(r,"width"),l=mt(r,"height")),!(Ge(s)&&Ge(l)&&s>0&&l>0))throw new at("The SVG needs a viewBox (or a width and height)");let m=Qt.artboardSide/Math.max(s,l),f=Math.round(s*m*10)/10,d=Math.round(l*m*10)/10;if(Math.min(f,d)<lt.minArtboard)throw new at("The artboard is too narrow: its sides may differ by 20 times at most");let p=[m,0,0,m,-i*m,-c*m],h={shapes:[],qrBox:null,segments:0};Iu(r,{matrix:p,fill:"#000000",fillRule:"nonzero",stroke:"none",strokeWidth:1,color:"#000000",opacity:1},qf(r),n,h);let g={x0:0,y0:0,x1:f,y1:d},b=Math.max(f,d)*.004,_=[],y=0,M=0;for(let F of h.shapes){let H=We(F.segments);if(!H||H.x1<=0||H.y1<=0||H.x0>=f||H.y0>=d){y++;continue}if(H.x0<-b||H.y0<-b||H.x1>f+b||H.y1>d+b){let W=gr(F.segments,.25).map(Rt=>br(Rt,g)).filter(Rt=>Rt.length>2);if(W.length===0){y++;continue}M++,_.push({...F,segments:W.flatMap(Rt=>Ai(Rt))});}else _.push(F);}if(y>0&&n.add("outside",y),M>0&&n.add("clipped",M),_.length===0)throw new at("The SVG has no filled shapes to use");let C=th(_,Qt.maxColors,n);for(let F of _)F.fill=C.get(F.fill)??F.fill;let x=new Map,S=new Map;for(let F of _){let H=We(F.segments);x.set(F.fill,(x.get(F.fill)??0)+(H.x1-H.x0)*(H.y1-H.y0)),S.set(F.fill,(S.get(F.fill)??0)+1);}let E=[...x.keys()].sort((F,H)=>Number(vu(F))-Number(vu(H))||x.get(H)-x.get(F)),w=E[0],R=E[1],v=F=>F===w?"frame":F===R?"accent":F,A=h.qrBox;if(!A&&e.qr){let[F,H]=Y(p,e.qr.x,e.qr.y);A={x0:F,y0:H,x1:F+e.qr.size*m,y1:H+e.qr.size*m};}let L,T,N;A?(L=Math.min(A.x1-A.x0,A.y1-A.y0),T=(A.x0+A.x1-L)/2,N=(A.y0+A.y1-L)/2):(n.add("qr-placed"),L=Math.min(f,d)*.6,T=(f-L)/2,N=(d-L)/2);let I=F=>Math.round(F*10)/10+0;if(L=Math.floor(L*10)/10,T=I(T),N=I(N),L<Math.min(f,d)*lt.minQrShare)throw new at("The QR area must be at least half the frame's shorter side");let G=Math.min(T,N,f-T-L,d-N-L);if(G<L*lt.minPadding-1e-9)throw new at("Leave room around the QR area: at least 4% of its size on every side, inside the artboard");let q=Math.min(Math.max(e.padding??Qt.padding,lt.minPadding),.2),O=Math.floor(Math.min(L*q,G)*10)/10,z=Kf(_);if(z.length>lt.maxShapes)throw new at(`The artwork has ${z.length} separate shapes; the limit is ${lt.maxShapes}. Combine shapes of the same color first`);let et={kind:Mr,version:Cr,artboard:{width:f,height:d},qr:{x:T,y:N,size:L,padding:O},colors:{frame:w,...R&&{accent:R}},shapes:z.map(F=>({type:"path",d:Zf(F.segments,Qt.decimals),fill:v(F.fill),...F.fillRule==="evenodd"&&{fillRule:"evenodd"}})),labels:[]},St=Xe.safeParse(et);if(!St.success){let F=St.error.issues[0];throw new at(`The converted frame doesn't fit the frame format: ${F?.message??"invalid"}`)}let ct=E.map(F=>({color:F,ref:F===w?"frame":F===R?"accent":"fixed",shapes:S.get(F)??0}));return {ok:!0,spec:St.data,warnings:n.list(),palette:ct}}catch(o){return {ok:false,error:o instanceof at?o.message:`Could not read the SVG (${o instanceof Error?o.name:"error"})`,warnings:n.list()}}}na();Lr();var Tu={kind:"qrdx.frame",version:1,artboard:{width:1240,height:1420},qr:{x:120,y:120,size:1e3,padding:60},colors:{frame:"#000000",text:"#FFFFFF"},shapes:[{type:"rect",x:40,y:40,width:1160,height:1160,fill:"background"},{type:"rect",x:0,y:0,width:1240,height:1420,fill:"frame",hole:{x:40,y:40,width:1160,height:1160}}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:120,y:1200,width:1e3,height:220}}],bleed:"frame"};var Fu={kind:"qrdx.frame",version:1,artboard:{width:1978.214,height:1978.214},qr:{x:489.107,y:489.107,size:1e3,padding:50},colors:{frame:"#000000",text:"#FFFFFF"},shapes:[{type:"circle",cx:989.107,cy:989.107,r:779.107,fill:"background"},{type:"circle",cx:989.107,cy:989.107,r:989.107,hole:779.107,fill:"frame"},{type:"circle",cx:105,cy:989.107,r:14.7,fill:"text"},{type:"circle",cx:1873.214,cy:989.107,r:14.7,fill:"text"}],labels:[{type:"curved",id:"top",slot:"primary",text:"Scan me",color:"text",curve:{cx:989.107,cy:989.107,radius:884.107,side:"top",spread:140},fontSize:105},{type:"curved",id:"bottom",slot:"secondary",text:"",color:"text",curve:{cx:989.107,cy:989.107,radius:884.107,side:"bottom",spread:140},fontSize:105}]};var ku={kind:"qrdx.frame",version:1,artboard:{width:1240,height:1340},qr:{x:120,y:120,size:1e3,padding:40},colors:{frame:"#000000"},shapes:[{type:"rect",x:40,y:40,width:1160,height:1260,radius:60,fill:"background"},{type:"rect",x:0,y:0,width:1240,height:1340,radius:100,fill:"frame",hole:{x:40,y:40,width:1160,height:1260,radius:60}}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:120,y:1160,width:1e3,height:100},fontSize:93.6}]};var Nu={kind:"qrdx.frame",version:1,artboard:{width:1260,height:1490},qr:{x:130,y:130,size:1e3,padding:80,radius:20},colors:{frame:"#000000",text:"#FFFFFF"},shapes:[{type:"path",d:"M40 0H1220A40 40 0 0 1 1260 40V1215A55 55 0 0 0 1260 1325V1450A40 40 0 0 1 1220 1490H40A40 40 0 0 1 0 1450V1325A55 55 0 0 0 0 1215V40A40 40 0 0 1 40 0Z",fill:"frame"},{type:"line",x1:77,y1:1270,x2:1147,y2:1270,width:12,dash:[30,22],fill:"background"}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:130,y:1270,width:1e3,height:220}}]};var ih={"banner-bottom":Tu,"rounded-border":ku,circle:Fu,ticket:Nu};var sh=418,ch={"call-to-action":75,holidays:115,seasons:28,"food-drink":32,shopping:30,events:32,places:34,"health-learning":24,business:48};var lh=[{id:"call-to-action",label:"Call to action"},{id:"holidays",label:"Holidays"},{id:"seasons",label:"Seasons"},{id:"food-drink",label:"Food & drink"},{id:"shopping",label:"Shops & packaging"},{id:"events",label:"Events & weddings"},{id:"places",label:"Places & Wi-Fi"},{id:"health-learning",label:"Health & learning"},{id:"business",label:"Business & social"}];function vi(t){return Array.isArray(t)?`[${t.map(vi).join(",")}]`:t&&typeof t=="object"?`{${Object.keys(t).filter(n=>t[n]!==void 0).sort().map(n=>`${JSON.stringify(n)}:${vi(t[n])}`).join(",")}}`:JSON.stringify(t)}function uh(t){let e=vi(t),n=2166136261;for(let o=0;o<e.length;o++)n^=e.charCodeAt(o),n=Math.imul(n,16777619)>>>0;return n.toString(16).padStart(8,"0")}Wr();La();var Ou=.06,Du=.16,Bu=512;function Gu(t){let{width:e,height:n}=t;if(!(e>0&&n>0)||t.data.length<e*n*4)return null;let o=Uint8Array.from(t.data),r=va({width:e,height:n,data:o});if(!r)return null;let a=d=>{let p=d*4;return Math.hypot(o[p]/255-r[0],o[p+1]/255-r[1],o[p+2]/255-r[2])},i=new Uint8Array(e*n),c=new Int32Array(e*n),s=0,l=0,u=d=>{i[d]||o[d*4+3]===0||a(d)>=Du||(i[d]=1,c[l++]=d);};for(let d=0;d<e;d++)u(d),u((n-1)*e+d);for(let d=0;d<n;d++)u(d*e),u(d*e+e-1);for(;s<l;){let d=c[s++],p=d%e;p>0&&u(d-1),p<e-1&&u(d+1),d>=e&&u(d-e),d<(n-1)*e&&u(d+e);}let m=new Uint8ClampedArray(o),f=r;for(let d=0;d<e*n;d++){if(!i[d])continue;let p=Math.min(1,Math.max(0,(a(d)-Ou)/(Du-Ou))),h=d*4;if(m[h+3]=Math.round(o[h+3]*p),p>0&&p<1)for(let g=0;g<3;g++){let _=(o[h+g]/255-(1-p)*f[g])/p;m[h+g]=Math.round(Math.min(1,Math.max(0,_))*255);}}return {width:e,height:n,data:m}}async function mh(t){if(typeof document>"u"||typeof Image>"u")throw new Error("removeLogoBackground needs a browser (canvas)");let e=await new Promise(c=>{let s=new Image;s.crossOrigin="anonymous",s.onload=()=>c(s),s.onerror=()=>c(null),s.src=t;});if(!e)return null;let n=e.naturalWidth||512,o=e.naturalHeight||512,r=Math.min(1,Bu/Math.max(n,o)),a=document.createElement("canvas");a.width=Math.max(1,Math.round(n*r)),a.height=Math.max(1,Math.round(o*r));let i=a.getContext("2d",{willReadFrequently:true});if(!i)return null;try{i.drawImage(e,0,0,a.width,a.height);let c=i.getImageData(0,0,a.width,a.height),s=Gu(c);return s?(c.data.set(s.data),i.putImageData(c,0,0),a.toDataURL("image/png")):null}catch{return null}finally{a.remove();}}ja();At();xe();me();At();Bn();tn();Ee();function dh(t,e){return Mt.QrCode.encodeText(t,Lt[e??te]).size}function Qu(t,e,n,o=n.size*(e?.size??Sa)){let r={src:t,width:o,height:o,excavate:true,...e?.shape&&e.shape!=="square"&&{shape:e.shape},...e?.plate&&{plate:e.plate}},a=e?.x!==void 0||e?.y!==void 0;if(!(e?.padding||a))return r;let i=dh(n.value,n.level),c=Ft(i,n.margin,n.shape),s=n.size/(i+2*c);if(e.padding&&(r.padding=e.padding*s),a){let l=i*s,u=m=>Math.min(Math.max((m??.5)*l-o/2,0),l-o);r.x=u(e.x),r.y=u(e.y);}return r}function Uu(t,e,n,o){let r=n.level??te,a=r;o&&(a=Gt({...n,imageSettings:Qu(t,e,n),autoLevel:o}));let i=s=>{let l=m=>Qu(t,e,{...n,level:s},m),u=li(n,[s],l().width,l);return u>0?l(u):void 0};if(a===r)return i(r);let c=i(a);return c&&Gt({...n,imageSettings:c,autoLevel:o})===a?c:i(r)}function fh({value:t,level:e,margin:n,shape:o,autoLevel:r,logoOptions:a}){let c=Uu("data:,",{...a,size:Br},{value:`${t}`,size:1024,margin:n??Ct,level:e,shape:o},r);return c?c.width/1024:0}function Li({value:t,size:e=1024,fgColor:n,bgColor:o,eyeColor:r,dotColor:a,bodyPattern:i,hideLogo:c,logo:s,logoOptions:l,margin:u,cornerEyePattern:m,cornerEyeDotPattern:f,level:d,templateId:p,frame:h,eyeColors:g,moduleScale:b,autoLevel:_,shape:y}){let M={value:`${t}`,size:e,margin:u??Ct,level:d,shape:y},C=!c&&s?Uu(s,l,M,_):void 0;return {value:M.value,bgColor:o,fgColor:n,eyeColor:r,dotColor:a,bodyPattern:i,cornerEyePattern:m,cornerEyeDotPattern:f,level:d,templateId:p,size:e,margin:u,...h&&{frame:h},...g&&{eyeColors:g},...b!==void 0&&{moduleScale:b},..._&&{autoLevel:_},...y&&y!=="square"&&{shape:y},...C&&{imageSettings:C}}}Ee();var gh=memo(({value:t,fgColor:e,hideLogo:n,logo:o,logoOptions:r,bgColor:a,eyeColor:i,dotColor:c,bodyPattern:s,cornerEyePattern:l,cornerEyeDotPattern:u,level:m,size:f=_t,scale:d=1,margin:p=Ct,style:h,templateId:g,customTemplate:b,customProps:_,frame:y,art:M,eyeColors:C,moduleScale:x,autoLevel:S,shape:E,frameLabelMarkers:w,partMarkers:R})=>{let v=f*d,A=useMemo(()=>Li({value:t,fgColor:e,hideLogo:n,bgColor:a,eyeColor:i,dotColor:c,bodyPattern:s,cornerEyePattern:l,cornerEyeDotPattern:u,level:m,templateId:g,logo:o,logoOptions:r,margin:p,autoLevel:S,shape:E}),[t,e,n,o,r,p,S,E,a,i,c,s,l,u,m,g]),L=v/A.size,T=A.imageSettings&&{...A.imageSettings,height:A.imageSettings.height*L,width:A.imageSettings.width*L,...A.imageSettings.x!=null&&{x:A.imageSettings.x*L},...A.imageSettings.y!=null&&{y:A.imageSettings.y*L},...A.imageSettings.padding!=null&&{padding:A.imageSettings.padding*L}};return jsx(ci,{art:M,bgColor:A.bgColor,bodyPattern:A.bodyPattern,cornerEyeDotPattern:A.cornerEyeDotPattern,cornerEyePattern:A.cornerEyePattern,customProps:_,customTemplate:b,dotColor:A.dotColor,eyeColor:A.eyeColor,fgColor:A.fgColor,frame:y,level:m||A.level,margin:A.margin,...C&&{eyeColors:C},...x!==void 0&&{moduleScale:x},...S&&{autoLevel:S},...E&&E!=="square"&&{shape:E},...w&&{frameLabelMarkers:w},...R&&{partMarkers:R},size:v,style:h,templateId:A.templateId,value:A.value,...T&&{imageSettings:T}})});gh.displayName="QRCode";tn();var qu={diamond:["square","rounded","diya","extra-rounded","message","pointy","leaf","leaf-reverse","drop","bevel","squircle","cushion","shield","petal"],banner:["square","rounded","diya","leaf"],square:["curly"],diya:["curly"],message:["curly"]},zu={diamond:["square"],pacman:["rounded"],"small-square":["square","rounded"]},Hu=["circle","curly"],Wu=["diamond","banner","star"],Vu={circle:["square","rounded","diya","extra-rounded","message","pointy","leaf","leaf-reverse","drop","bevel","squircle","cushion","shield","petal"]},Jt=["square","liquid","classy","classy-rounded"],Xu={"circle/rounded":Jt,"circle/extra-rounded":Jt,"circle/message":[...Jt,"leaf"],"circle/pointy":Jt,"circle/leaf-reverse":Jt,"circle/drop":Jt,"circle/bevel":[...Jt,"leaf"],"circle/squircle":[...Jt,"circle","diamond","circle-mixed","rounded","horizontal-line","leaf","heart","mosaic","octagon"],"circle/cushion":Jt,"circle/shield":[...Jt,"rounded","horizontal-line","leaf"],"circle/petal":Jt};function Yu(t,e,n){return (Vu[t]?.includes(e)??false)&&!Xu[`${t}/${e}`]?.includes(n)}function Ii(t){let e=t.bodyPattern??"circle",n=t.cornerEyePattern??"gear",o=t.cornerEyeDotPattern??"circle";return qu[o]?.includes(n)?{kind:"dot-eye",message:`${o} centres in ${n} eyes are missed by strict decoders`,fix:"Pick a square, rounded or circle centre, or another eye shape"}:zu[e]?.includes(n)?{kind:"body-eye",message:`${e} dots next to ${n} eyes are missed up close`,fix:"Pick a fuller dot shape or another eye shape"}:Wu.includes(o)?{kind:"dot",message:`${o} centres are missed in sharp renders and up close`,fix:"Pick a square, rounded or circle centre"}:Hu.includes(n)?{kind:"eye",message:`${n} eyes only read in lenient decoders`,fix:"Pick square, rounded or gear eyes"}:Yu(o,n,e)?{kind:"sharp-dot-eye",message:`${o} centres in ${n} eyes are missed by some decoders on screens and in sharp prints`,fix:"Pick a rounded centre, or gear or octagon eyes"}:null}Fn();xe();me();At();_e();Bn();tn();Ee();Bt();var nm=[96,160,320],Ro=640;function ki(){if(typeof document>"u")throw new Error("Scan scoring needs a browser (canvas + image decoding)")}function Ue(t){if(t?.aborted)throw new DOMException("Scan scoring was aborted","AbortError")}var rm=()=>new Promise(t=>setTimeout(t,0));async function Ni(){let{default:t}=await import('jsqr');return t}function Fi(t,e){if(!t)return false;if(t.data===e)return true;try{return new TextDecoder().decode(Uint8Array.from(t.binaryData))===e}catch{return false}}function _h(t,e,n=.7){let{data:o,width:r,height:a}=t;for(let l=0;l<o.length;l+=4)for(let u=0;u<3;u++)o[l+u]=128+(o[l+u]-128)*n;let i=Math.max(1,Math.round(e*.25)),c=new Float32Array(r*a*3),s=l=>{let u=l?a:r,m=l?r:a,f=(p,h)=>l?p*r+h:h*r+p,d=[0,0,0];for(let p=0;p<u;p++){d.fill(0);for(let h=-i;h<=i;h++){let g=f(p,Math.min(Math.max(h,0),m-1))*4;for(let b=0;b<3;b++)d[b]=d[b]+o[g+b];}for(let h=0;h<m;h++){let g=f(p,h)*3;for(let y=0;y<3;y++)c[g+y]=d[y]/(2*i+1);let b=f(p,Math.max(h-i,0))*4,_=f(p,Math.min(h+i+1,m-1))*4;for(let y=0;y<3;y++)d[y]=d[y]-o[b+y]+o[_+y];}}for(let p=0;p<r*a;p++)for(let h=0;h<3;h++)o[p*4+h]=c[p*3+h];};for(let l=0;l<2;l++)s(true),s(false);}function Un(t,e){let n=document.createElement("canvas");n.width=Math.max(1,Math.round(t)),n.height=Math.max(1,Math.round(e));let o=n.getContext("2d",{willReadFrequently:true});if(!o)throw new Error("Could not get canvas context");return o.imageSmoothingEnabled=true,o.imageSmoothingQuality="high",{canvas:n,ctx:o}}var yh=[.9,1,1.1];function Oi(t,e,n,o,r){let a=0;for(let i of yh){let c=n*i,s=e(c);_h(s,c/o),r(t(s.data,s.width,s.height))&&a++;}return a>=2?"pass":a===1?"fragile":"fail"}var Ti={small:"small print or far away",medium:"typical phone distance",large:"close up"};function $h(t,e){return t===e[0]&&e.length>1?Ti.small:t===e.at(-1)?Ti.large:Ti.medium}function om(t,e,n){if(n==="pass")return 0;let o=e===1?[45]:e===2?[20,45]:[15,20,45],r=o[Math.round(t*(o.length-1)/Math.max(e-1,1))]??20;return n==="fragile"?Math.round(r/2):r}function am(t,e,n){let o=`${t} px (${$h(t,e)})`;return n==="pass"?{id:`decode-${t}`,passed:true,message:`Reads at ${o}, with camera blur`}:{id:`decode-${t}`,passed:false,message:n==="fragile"?`Reads at ${o} only some of the time`:`Doesn't read at ${o}`,fix:t===e[0]?"Print it bigger, shorten the content (fewer modules) or use solid square dots":"Raise the contrast, use bigger dots or a simpler eye shape"}}function im(t,e){return e?"fails":t>=85?"great":t>=65?"ok":"risky"}function xh(t,e,n){let o=Wt(t,e);if(o.type==="solid")return [o.color];if(o.type!=="image")return o.stops.map(c=>c.color);let r=o.underlay?Po(o.underlay):null,a=n?.[o.src];if(!a)return o.underlay?[o.underlay]:[];let i=o.opacity??1;return [a.light,a.dark].flatMap(c=>{let s=Po(c);if(!s)return [];let l={...s,a:s.a*i};if(!r)return [ju(l)];let u=l.a+r.a*(1-l.a),m=(f,d)=>u>0?(f*l.a+d*r.a*(1-l.a))/u:0;return [ju({r:m(l.r,r.r),g:m(l.g,r.g),b:m(l.b,r.b),a:u})]})}var ju=({r:t,g:e,b:n,a:o})=>`rgba(${Math.round(t)}, ${Math.round(e)}, ${Math.round(n)}, ${Math.round(o*1e3)/1e3})`;function Sh(t){let e=[],n=t.width*t.height;for(let a=0;a<n;a++){let i=t.data[a*4],c=t.data[a*4+1],s=t.data[a*4+2];t.data[a*4+3]<128||e.push({lum:an(i,c,s),r:i,g:c,b:s});}if(e.length===0)return null;e.sort((a,i)=>a.lum-i.lum);let o=Math.max(1,Math.round(e.length/10)),r=a=>{let i=a.reduce((s,l)=>({r:s.r+l.r,g:s.g+l.g,b:s.b+l.b}),{r:0,g:0,b:0}),c=s=>Math.round(s/a.length).toString(16).padStart(2,"0");return `#${c(i.r)}${c(i.g)}${c(i.b)}`};return {dark:r(e.slice(0,o)),light:r(e.slice(-o))}}async function Mh(t){ki();let e=await dr(t),{canvas:n,ctx:o}=Un(64,64);o.drawImage(e,0,0,64,64);let r=Sh(o.getImageData(0,0,64,64));return n.remove(),r}function sm(t){let e=[t.bgColor,t.fgColor,t.eyeColor,t.dotColor,...Qr.flatMap(o=>[t.eyeColors?.[o]?.outer,t.eyeColors?.[o]?.inner])],n=new Set;for(let o of e)typeof o=="object"&&o?.type==="image"&&n.add(o.src);return [...n]}var ur=null;function Po(t){let e=dt(t);if(e||typeof document>"u")return e;if(ur??=document.createElement("canvas").getContext("2d"),!ur)return null;ur.fillStyle="#010203",ur.fillStyle=t;let n=String(ur.fillStyle);return n==="#010203"?null:dt(n)}var Zu=t=>an(t.r,t.g,t.b),cm=(t,e)=>(Math.max(t,e)+.05)/(Math.min(t,e)+.05),mr=4.5,Ch=3,Ju=1.5,Ku={code:7,background:12},tm={r:255,g:255,b:255,a:1},em=(t,e)=>({r:t.r*t.a+e.r*(1-t.a),g:t.g*t.a+e.g*(1-t.a),b:t.b*t.a+e.b*(1-t.a),a:1});function wh(t,e={}){let n=e.imageTones,o=(d,p)=>{let h=typeof d=="object"&&d?.type==="image";return xh(d,p,n).map(g=>({color:g,picture:h}))},r=t.fgColor??Pt,a=Qr.flatMap(d=>{let p=t.eyeColors?.[d];return [...p?.outer?o(p.outer,Pt):[],...p?.inner?o(p.inner,Pt):[]]}),i=[...o(r,Pt),...o(t.eyeColor??r,Pt),...o(t.dotColor??r,Pt),...a],c=o(t.bgColor,yt),s=(c.length>0?c:[{color:"#ffffff",picture:false}]).map(d=>{let p=Po(d.color);return {color:p?em(p,tm):tm,picture:d.picture}}),l=i.flatMap(d=>{let p=Po(d.color);return p?[{color:p,picture:d.picture}]:[]}),u=Number.POSITIVE_INFINITY,m=mr,f=false;for(let d of l)for(let p of s){let h=Zu(em(d.color,p.color)),g=Zu(p.color),b=cm(h,g),_=p.picture?Ku.background:d.picture?Ku.code:mr;b/_<u/m&&(u=b,m=_),h>g&&(f=true);}return {ratio:Number.isFinite(u)?u:Number.POSITIVE_INFINITY,required:m,inverted:f}}function Eh(t,e){let{ratio:n,inverted:o,required:r}=wh(t,{imageTones:e});if(!Number.isFinite(n))return {checks:[],penalty:0,fails:false};let a=r/mr,i=r!==mr,c=Math.round(n*10)/10,s=[],l=0;return n>=r?s.push({id:"contrast",passed:true,message:`Contrast ${c}:1 between code and background`}):(l=n<Ju*a?60:n<Ch*a?30:10,s.push({id:"contrast",passed:false,message:i?`Low contrast for a picture (${c}:1); ${r}:1 or more scans reliably`:`Low contrast (${c}:1); 4.5:1 or more scans reliably`,fix:i?"Lower the picture's opacity over a darker underlay (dots) or a lighter one (background)":"Use a darker code color or a lighter background"})),o?(l+=10,s.push({id:"polarity",passed:false,message:"Light code on a dark background; some scanner apps can't read it",fix:"Use dark modules on a light background"})):s.push({id:"polarity",passed:true,message:"Dark code on a light background"}),{checks:s,penalty:l,fails:n<Ju*(r/mr)}}function Di(t){return Mt.QrCode.encodeText(t.value,Lt[Gt(t)]).getModules()}function Rh(t){let{imageSettings:e}=t;if(!e)return {check:null,penalty:0};let n=Di(t),o=we(n,t.size??_t,Ft(n.length,t.margin??Ct,t.shape),e);if(!o)return {check:null,penalty:0};let r=o.excavation??o,a=n.length,c=[[0,0],[a-8,0],[0,a-8]].some(([p,h])=>r.x<p+9&&r.x+r.w>p&&r.y<h+9&&r.y+r.h>h),s=a>21?a-9:null,l=s!==null&&r.x<s+5&&r.x+r.w>s&&r.y<s+5&&r.y+r.h>s;if(c||l)return {check:{id:"logo",passed:false,message:c?"The logo covers a corner eye":"The logo covers the small square near the bottom-right corner",fix:"Move the logo toward the center or make it smaller"},penalty:40};let u=r.w*r.h/(a*a),m=Gt(t),f=Math.round(u*100),d=uo({value:t.value,size:t.size??_t,margin:t.margin??Ct,level:m,shape:t.shape},e);return !d||d.worst<=d.budget?{check:{id:"logo",passed:true,message:`Logo covers ${f}% of the code; error correction repairs it with room to spare`},penalty:0}:{check:{id:"logo",passed:false,message:`Logo covers ${f}% of the code and spoils ${d.worst} codewords in one block, which repairs ${d.correctable}`,fix:d.level==="H"?"Use a smaller logo":"Switch error correction to H or use a smaller logo"},penalty:d.worst>d.correctable?25:10}}function Ph(t){let e=Pa(t.shape)?Ke(t.margin??Ct):t.margin??Ct,n=Di(t).length+2*e,o=e+(Ht(t.frame)?aa(t.frame)*n:0),r=Math.round(o*10)/10;return o>=4?{check:{id:"quiet-zone",passed:true,message:`Quiet zone of ${r} modules`},penalty:0}:o>=1.5?{check:{id:"quiet-zone",passed:true,message:`Quiet zone of ${r} modules (4 is ideal)`},penalty:0}:{check:{id:"quiet-zone",passed:false,message:"No quiet zone around the code",fix:"Leave clear space (about 10% of the code width) around it wherever you place it, or add a frame"},penalty:5}}function Ah(t){let e=t.cornerEyePattern??"gear";return e==="curly"?{check:{id:"eye-shape",passed:false,message:"Curly eyes fail strict decoders such as ZXing-based apps",fix:"Pick square, rounded or gear eyes"},penalty:40}:e==="circle"?{check:{id:"eye-shape",passed:false,message:"Circle eyes only read in lenient decoders; many apps miss them",fix:"Pick square, rounded or gear eyes"},penalty:20}:{check:{id:"eye-shape",passed:true,message:`No known decoder issues with ${e} eyes`},penalty:0}}function dr(t){return new Promise((e,n)=>{let o=new Image;o.crossOrigin="anonymous",o.onload=()=>e(o),o.onerror=()=>n(new Error("Could not load image")),o.src=t;})}var vh=`data:image/svg+xml,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 10"><rect width="10" height="10" rx="2" fill="#808080"/></svg>')}`;async function Lh(t){let{imageSettings:e}=t;if(!e||e.src.startsWith("data:"))return t;let n=vh;try{let o=await dr(e.src),{canvas:r,ctx:a}=Un(o.naturalWidth||256,o.naturalHeight||256);a.drawImage(o,0,0,r.width,r.height),n=r.toDataURL("image/png");}catch{}return {...t,imageSettings:{...e,src:n}}}async function Ih(t){let e=new Map;for(let r of sm(t))if(!r.startsWith("data:"))try{let a=await dr(r),{canvas:i,ctx:c}=Un(a.naturalWidth||256,a.naturalHeight||256);c.drawImage(a,0,0,i.width,i.height),e.set(r,i.toDataURL("image/png")),i.remove();}catch{e.set(r,null);}if(e.size===0)return t;let n=r=>{if(typeof r!="object"||r?.type!=="image")return r;let a=e.get(r.src);return a===void 0?r:a?{...r,src:a}:r.underlay??Pt},o=t.eyeColors?Object.fromEntries(Object.entries(t.eyeColors).map(([r,a])=>[r,a&&{outer:n(a.outer),inner:n(a.inner)}])):void 0;return {...t,bgColor:n(t.bgColor),fgColor:n(t.fgColor),eyeColor:n(t.eyeColor),dotColor:n(t.dotColor),...o&&{eyeColors:o}}}async function lm(t,e,n,o,r){let a=[],i=0,c=Eh(t,r);i+=c.penalty;let s=Rh(t);i+=s.penalty;let l=Ph(t);i+=l.penalty;let u=Ah(t);i+=u.penalty;let m=Ii(t),f=m?.kind==="eye"?null:m;f&&f.kind!=="sharp-dot-eye"&&(i+=10);let d=await Ni();Ue(o);let p=Di(t).length,h=p+2*Ft(p,t.margin??Ct,t.shape),g=[],b=false;for(let[M,C]of n.entries()){await rm(),Ue(o);let x=Oi(d,e,C,h,S=>Fi(S,t.value));i+=om(M,n.length,x),g.push(am(C,n,x)),M===n.length-1&&x==="fail"&&(b=true);}a.push(...g,...c.checks),s.check&&a.push(s.check),a.push(u.check,l.check),f&&a.push({id:"style-pair",passed:false,message:f.message,fix:f.fix});let _=b||c.fails,y=Math.max(0,Math.min(100,100-i));return _&&(y=Math.min(y,30)),{score:y,grade:im(y,_),checks:a}}function um(t){return [...t.sizes??nm].filter(e=>e>0).sort((e,n)=>e-n)}async function w5(t,e={}){ki();let{signal:n}=e,o=um(e),r=await Ih(await Lh(sn({...t,size:t.size??_t},Ro)));Ue(n);let a={};for(let u of sm(t))try{let m=await Mh(u);m&&(a[u]=m);}catch{}Ue(n);let i=await ce(r),c=await dr(i);Ue(n);let s=be(Ro,t.frame);return await lm(t,u=>{let m=u/Ro,f=s.width*m,d=s.height*m,p=Math.max(8,Math.round(u*.12)),{canvas:h,ctx:g}=Un(f+2*p,d+2*p);g.fillStyle="#ffffff",g.fillRect(0,0,h.width,h.height),g.drawImage(c,p,p,f,d);let b=g.getImageData(0,0,h.width,h.height);return h.remove(),b},o,n,a)}var E5=Ro;async function R5(t,e,n={}){let{width:o,height:r}=e;if(!(o>0&&r>0)||e.data.length<o*r*4)throw new Error("Pixels must be width \xD7 height \xD7 4 RGBA bytes");let a=um(n),i=t.size??_t,c=be(i,t.frame),s=o*i/c.width,l={data:Th(e),width:o,height:r};return await lm(t,m=>{let f=mm(l,m/s),d=Math.max(8,Math.round(m*.12));return Fh(f,d)},a,n.signal)}function Th(t){let{data:e,width:n,height:o}=t,r=new Uint8ClampedArray(n*o*4);for(let a=0;a<n*o*4;a+=4){let i=e[a+3]/255;for(let c=0;c<3;c++)r[a+c]=e[a+c]*i+255*(1-i);r[a+3]=255;}return r}function Fh(t,e){let n=t.width+2*e,o=t.height+2*e,r=new Uint8ClampedArray(n*o*4).fill(255);for(let a=0;a<t.height;a++)r.set(t.data.subarray(a*t.width*4,(a+1)*t.width*4),((a+e)*n+e)*4);return {data:r,width:n,height:o,colorSpace:"srgb"}}var Qe=(t,e)=>Math.hypot(t.x-e.x,t.y-e.y);function Eo(t,e){return .299*t[e]+.587*t[e+1]+.114*t[e+2]}function kh(t,e){let n=0;for(let c=0;c<256;c++)n+=c*t[c];let o=0,r=0,a=0,i=128;for(let c=0;c<256;c++){if(r+=t[c],r===0)continue;let s=e-r;if(s===0)break;o+=c*t[c];let l=o/r,u=(n-o)/s,m=r*s*(l-u)**2;m>a&&(a=m,i=c);}return i}async function Nh(t){if(!(t instanceof Blob))return t.complete||await new Promise(n=>{t.addEventListener("load",n,{once:true}),t.addEventListener("error",n,{once:true});}),t;let e=URL.createObjectURL(t);try{let n=await dr(e);return await n.decode?.().catch(()=>{}),n}finally{setTimeout(()=>URL.revokeObjectURL(e),1e3);}}async function P5(t,e={}){ki();let{signal:n}=e,o=[...e.sizes??nm].filter(Q=>Q>0).sort((Q,nt)=>Q-nt),r=await Ni(),a=await Nh(t);Ue(n);let i=a.naturalWidth||a.width,c=a.naturalHeight||a.height;if(!(i&&c))throw new Error("Could not read this image");let s=Math.min(1,1600/Math.max(i,c)),{canvas:l,ctx:u}=Un(i*s,c*s);u.fillStyle="#ffffff",u.fillRect(0,0,l.width,l.height),u.drawImage(a,0,0,l.width,l.height);let m=u.getImageData(0,0,l.width,l.height),f=r(m.data,m.width,m.height);if(Ue(n),!f){let Q=await ru(a,0,false);return l.remove(),typeof Q!="string"||Q==="NO_QR"?{data:null,version:null,score:0,grade:"fails",checks:[{id:"decode",passed:false,message:"No QR code found in this image",fix:"Try a sharper, well-lit, straight-on photo or a screenshot"}]}:{data:Q,version:null,score:55,grade:"risky",checks:[{id:"decode",passed:false,message:"Decoded only after cropping; the code is small or hard to find in this image",fix:"Make the code bigger relative to its surroundings"}]}}let{location:d,version:p}=f,h=17+4*p,g=(Qe(d.topLeftCorner,d.topRightCorner)+Qe(d.bottomLeftCorner,d.bottomRightCorner)+Qe(d.topLeftCorner,d.bottomLeftCorner)+Qe(d.topRightCorner,d.bottomRightCorner))/4,b=g/h,_=[d.topLeftCorner,d.topRightCorner,d.bottomRightCorner,d.bottomLeftCorner],y=Math.max(0,Math.floor(Math.min(..._.map(Q=>Q.x)))),M=Math.min(m.width,Math.ceil(Math.max(..._.map(Q=>Q.x)))),C=Math.max(0,Math.floor(Math.min(..._.map(Q=>Q.y)))),x=Math.min(m.height,Math.ceil(Math.max(..._.map(Q=>Q.y)))),S=[],E=0,w=new Array(256).fill(0),R=0;for(let Q=C;Q<x;Q++)for(let nt=y;nt<M;nt++){let Z=Math.round(Eo(m.data,(Q*m.width+nt)*4));w[Z]=w[Z]+1,R++;}let v=kh(w,R),A={dark:[0,0,0,0],light:[0,0,0,0]};for(let Q=C;Q<x;Q++)for(let nt=y;nt<M;nt++){let Z=(Q*m.width+nt)*4,bt=Eo(m.data,Z)<=v?A.dark:A.light;bt[0]=bt[0]+m.data[Z],bt[1]=bt[1]+m.data[Z+1],bt[2]=bt[2]+m.data[Z+2],bt[3]=bt[3]+1;}let L=Q=>{let nt=Math.max(Q[3],1);return an(Q[0]/nt,Q[1]/nt,Q[2]/nt)},T=L(A.dark),N=L(A.light),I=cm(T,N),G=Math.round(I*10)/10;I>=4.5?S.push({id:"contrast",passed:true,message:`Contrast ${G}:1 in the image`}):(E+=I<2?30:10,S.push({id:"contrast",passed:false,message:`Low contrast in the image (${G}:1)`,fix:"Use a darker code on a lighter background, or better lighting for photos"}));let O=[d.topLeftFinderPattern,d.topRightFinderPattern,d.bottomLeftFinderPattern].map(Q=>{let nt=Math.min(m.width-1,Math.max(0,Math.round(Q.x))),Z=Math.min(m.height-1,Math.max(0,Math.round(Q.y)));return Eo(m.data,(Z*m.width+nt)*4)}).filter(Q=>Q>v).length>=2;O?(E+=10,S.push({id:"polarity",passed:false,message:"Light code on a dark background; some scanner apps can't read it",fix:"Use dark modules on a light background"})):S.push({id:"polarity",passed:true,message:"Dark code on a light background"});let z=Math.max(2,Math.round(b*2)),et={minX:y-z,maxX:M+z,minY:C-z,maxY:x+z};if(et.minX<0||et.minY<0||et.maxX>m.width||et.maxY>m.height)S.push({id:"quiet-zone",passed:true,skipped:true,message:"The image is cropped too tight to check the quiet zone"});else {let Q=0,nt=0;for(let Z=et.minY;Z<et.maxY;Z++)for(let bt=et.minX;bt<et.maxX;bt++){if(bt>=y&&bt<M&&Z>=C&&Z<x)continue;let qn=Eo(m.data,(Z*m.width+bt)*4);(O?qn>v:qn<=v)&&Q++,nt++;}Q/Math.max(nt,1)>.12?(E+=10,S.push({id:"quiet-zone",passed:false,message:"Something dark touches the code; the quiet zone isn't clear",fix:"Leave clear space (about 4 modules) around the code"})):S.push({id:"quiet-zone",passed:true,message:"Clear space around the code"});}b<2?S.push({id:"resolution",passed:false,message:`Low resolution: about ${Math.round(b*10)/10} px per module`,fix:"Use a larger image, or export the code at a bigger size"}):S.push({id:"resolution",passed:true,message:`About ${Math.round(b)} px per module`});let ct=Math.round(b*4),F=Math.max(0,y-ct),H=Math.max(0,C-ct),W=Math.min(m.width,M+ct)-F,Rt=Math.min(m.height,x+ct)-H,qe=Q=>{let nt=Q/g,Z=Un(W*nt,Rt*nt);Z.ctx.drawImage(l,F,H,W,Rt,0,0,Z.canvas.width,Z.canvas.height);let bt=Z.ctx.getImageData(0,0,Z.canvas.width,Z.canvas.height);return Z.canvas.remove(),bt},Ut=[],ue=false;for(let[Q,nt]of o.entries()){await rm(),Ue(n);let Z=Oi(r,qe,nt,h,bt=>bt?.data===f.data);E+=om(Q,o.length,Z),Ut.push(am(nt,o,Z)),Q===o.length-1&&Z==="fail"&&(ue=true);}l.remove();let ze=Math.max(0,Math.min(100,100-E));return ue&&(ze=Math.min(ze,30)),{data:f.data,version:p,score:ze,grade:im(ze,ue),checks:[...Ut,...S]}}var Oh=[320];function mm(t,e){let n=Math.min(1,e),o=Math.max(1,Math.round(t.width*n)),r=Math.max(1,Math.round(t.height*n)),a=new Uint8ClampedArray(o*r*4),i=t.width/o,c=t.height/r;for(let s=0;s<r;s++){let l=Math.floor(s*c),u=Math.max(l+1,Math.min(t.height,Math.floor((s+1)*c)));for(let m=0;m<o;m++){let f=Math.floor(m*i),d=Math.max(f+1,Math.min(t.width,Math.floor((m+1)*i))),p=[0,0,0,0];for(let b=l;b<u;b++)for(let _=f;_<d;_++){let y=(b*t.width+_)*4;for(let M=0;M<4;M++)p[M]=p[M]+t.data[y+M];}let h=(u-l)*(d-f),g=(s*o+m)*4;for(let b=0;b<4;b++)a[g+b]=p[b]/h;}}return {data:a,width:o,height:r,colorSpace:"srgb"}}function Dh(t){try{return new TextDecoder("utf-8",{fatal:!0}).decode(Uint8Array.from(t.binaryData))}catch{return t.data}}async function A5(t,e,n={}){let{width:o,height:r}=t;if(!(o>0&&r>0)||t.data.length<o*r*4)throw new Error("Pixels must be width \xD7 height \xD7 4 RGBA bytes");let a=await Ni(),i={data:t.data instanceof Uint8ClampedArray?t.data:Uint8ClampedArray.from(t.data),width:o,height:r},c=a(i.data,o,r,{inversionAttempts:"dontInvert"});if(!c)return {data:null,version:null,passed:false};let s=Dh(c),{version:l,location:u}=c;if(!Fi(c,e))return {data:s,version:l,passed:false};let m=17+4*l,f=(Qe(u.topLeftCorner,u.topRightCorner)+Qe(u.bottomLeftCorner,u.bottomRightCorner)+Qe(u.topLeftCorner,u.bottomLeftCorner)+Qe(u.topRightCorner,u.bottomRightCorner))/4;for(let d of n.sizes??Oh)if(Oi(a,h=>mm(i,h/f),d,m,h=>Fi(h,e))!=="pass")return {data:s,version:l,passed:false};return {data:s,version:l,passed:true}}xe();var Bh=16,dm=.01;function Gh(t){let e=new Float64Array(256);for(let s of t)e[Math.min(255,Math.max(0,Math.round(s*255)))]++;let n=t.length,o=0;for(let s=0;s<256;s++)o+=s*e[s];let r=0,a=0,i=0,c=128;for(let s=0;s<256;s++){if(a+=e[s],a===0)continue;let l=n-a;if(l===0)break;r+=s*e[s];let u=r/a,m=(o-r)/l,f=a*l*(u-m)**2;f>i&&(i=f,c=s);}return (c+.5)/255}function Qh(t,e){let{width:n,height:o,data:r}=t,a=n*o,i=new Uint8Array(a),c=0;for(let d=0;d<a;d++)r[d*4+3]<128&&c++;if(e==="alpha"||e==="auto"&&c>a*.02&&c<a*.98){for(let d=0;d<a;d++)i[d]=r[d*4+3]>=128?1:0;return i}let l=new Float32Array(a);for(let d=0;d<a;d++){let p=r[d*4+3]/255,h=.2126*r[d*4]+.7152*r[d*4+1]+.0722*r[d*4+2];l[d]=1-(h*p+255*(1-p))/255;}let u=Gh(l);for(let d=0;d<a;d++)i[d]=l[d]>u?1:0;let m=0,f=0;for(let d=0;d<n;d++)for(let p of [0,o-1])m++,f+=i[p*n+d];for(let d=1;d<o-1;d++)for(let p of [0,n-1])m++,f+=i[d*n+p];if(f>m/2)for(let d=0;d<a;d++)i[d]=i[d]?0:1;return i}function fm(t,e,n,o){for(let r of [1,0]){let a=new Uint8Array(t.length);for(let i=0;i<t.length;i++){if(a[i]||t[i]!==r)continue;let c=[i];a[i]=1;let s=false;for(let u of c){let m=u%e,f=(u-m)/e;(m===0||f===0||m===e-1||f===n-1)&&(s=true);for(let[d,p]of [[m-1,f],[m+1,f],[m,f-1],[m,f+1]]){if(d<0||p<0||d>=e||p>=n)continue;let h=p*e+d;!a[h]&&t[h]===r&&(a[h]=1,c.push(h));}}if((r===1||!s)&&c.length<o)for(let u of c)t[u]=r?0:1;}}}function hm(t,e={}){let{width:n,height:o,data:r}=t;if(!(n>0&&o>0)||r.length<n*o*4)throw new Error("Silhouette pixels must be width \xD7 height \xD7 4 RGBA bytes");let a=Qh(t,e.mode??"auto"),i=a.reduce((S,E)=>S+E,0);fm(a,n,o,Math.max(16,i*dm));let c=n,s=o,l=-1,u=-1;for(let S=0;S<o;S++)for(let E=0;E<n;E++)a[S*n+E]&&(c=Math.min(c,E),s=Math.min(s,S),l=Math.max(l,E),u=Math.max(u,S));if(l<0)throw new Error("No shape found: use a picture with a dark or opaque shape on a light or clear background");let m=l-c+1,f=u-s+1;if(Math.max(m,f)<Bh)throw new Error("The shape is too small to trace; use a bigger picture");let p=Math.min(Math.max(Math.round(e.cells??Xt),ie),Xt)/Math.max(m,f),h=Math.max(ie,Math.round(m*p)),g=Math.max(ie,Math.round(f*p)),b=Math.max(1,Math.round(m*p)),_=Math.max(1,Math.round(f*p)),y=Math.floor((h-b)/2),M=Math.floor((g-_)/2),C=new Uint8Array(h*g);for(let S=0;S<_;S++){let E=s+Math.floor(S*f/_),w=Math.max(E+1,s+Math.floor((S+1)*f/_));for(let R=0;R<b;R++){let v=c+Math.floor(R*m/b),A=Math.max(v+1,c+Math.floor((R+1)*m/b)),L=0;for(let T=E;T<w;T++)for(let N=v;N<A;N++)L+=a[T*n+N];C[(S+M)*h+R+y]=L*2>=(w-E)*(A-v)?1:0;}}let x=C.reduce((S,E)=>S+E,0);if(fm(C,h,g,Math.max(4,x*dm)),!C.includes(1))throw new Error("The shape is too small to trace; use a bigger picture");return {type:"silhouette",width:h,height:g,cells:Array.from(C,S=>S?"1":"0").join("")}}var Bi=512;async function Uh(t){if(typeof t!="string"&&!(t instanceof Blob))return t.complete||await new Promise(n=>{t.addEventListener("load",n,{once:true}),t.addEventListener("error",n,{once:true});}),t;let e=typeof t=="string"?t:URL.createObjectURL(t);try{return await new Promise((n,o)=>{let r=new Image;r.crossOrigin="anonymous",r.onload=()=>n(r),r.onerror=()=>o(new Error("Could not load the picture")),r.src=e;})}finally{typeof t!="string"&&setTimeout(()=>URL.revokeObjectURL(e),1e3);}}async function qh(t,e={}){if(typeof document>"u")throw new Error("loadQRSilhouette needs a browser; pass decoded pixels to createQRSilhouette instead");let n=await Uh(t),o=n.naturalWidth||n.width||Bi,r=n.naturalHeight||n.height||Bi,a=Bi/Math.max(o,r),i=Math.max(1,Math.round(o*a)),c=Math.max(1,Math.round(r*a)),s=document.createElement("canvas");s.width=i,s.height=c;let l=s.getContext("2d",{willReadFrequently:true});if(!l)throw new Error("Could not get a canvas context");l.drawImage(n,0,0,i,c);let u;try{u=l.getImageData(0,0,i,c);}catch{throw new Error("Could not read the picture (cross-origin images need CORS); upload it instead")}finally{s.remove();}return hm(u,e)}ti();Ee();Vr();Bn();async function ce(t){let{QRCodeSVG:e}=await Promise.resolve().then(()=>(Ee(),Jl)),{renderToStaticMarkup:n}=await import('react-dom/server'),o=await import('react'),r={...t};if(t.imageSettings?.src)try{let p=await zh(t.imageSettings.src);r={...t,imageSettings:{...t.imageSettings,src:p}};}catch{let{imageSettings:p,...h}=t;r=h;}let{hideLogo:a,url:i,logo:c,scale:s,frameLabelMarkers:l,partMarkers:u,...m}=r,f=o.createElement(e,{...m,templateId:r.templateId,customTemplate:r.customTemplate}),d=n(f);return `data:image/svg+xml,${encodeURIComponent(d)}`}var zh=t=>new Promise((e,n)=>{if(t.startsWith("data:")){e(t);return}let o=new Image;o.crossOrigin="anonymous",o.onload=()=>{try{let r=document.createElement("canvas");r.width=o.naturalWidth||o.width,r.height=o.naturalHeight||o.height;let a=r.getContext("2d");if(!a){n(new Error("Could not get canvas context"));return}a.drawImage(o,0,0);let i=r.toDataURL("image/png");r.remove(),e(i);}catch(r){n(new Error(`Failed to convert image to base64: ${r}`));}},o.onerror=()=>{n(new Error(`Could not load image from ${t.slice(0,100)}... Check CORS settings or use a data URL.`));},o.src=t;});async function lr(t,e,n){let o=await ce(t),r=decodeURIComponent(o.replace("data:image/svg+xml,","")),a;try{let i=new TextEncoder().encode(r),c=Array.from(i,l=>String.fromCharCode(l)).join("");a=`data:image/svg+xml;base64,${btoa(c)}`;}catch(i){throw new Error(`Failed to encode SVG for canvas conversion: ${i}`)}return new Promise((i,c)=>{let s=document.createElement("canvas"),l=s.getContext("2d");if(!l){c(new Error("Could not get canvas context"));return}let u=new Image,{width:m,height:f}=be(t.size||_t,t.frame);s.width=Math.round(m),s.height=Math.round(f);let d=setTimeout(()=>{s.remove(),c(new Error("SVG load timeout - image may be too large or contain invalid data"));},3e4);u.onload=()=>{clearTimeout(d);try{if(e==="image/jpeg"&&(l.fillStyle="white",l.fillRect(0,0,s.width,s.height)),l.drawImage(u,0,0,s.width,s.height),n)i(s);else if(e==="image/webp")kr(s).then(jn).then(i,c).finally(()=>s.remove());else {let p=s.toDataURL(e,1);s.remove(),i(p);}}catch(p){clearTimeout(d),s.remove(),c(new Error(`Failed to draw SVG to canvas: ${p}`));}},u.onerror=()=>{clearTimeout(d),s.remove(),c(new Error("Could not load SVG"));},u.src=a;})}/**
27
27
  * @license QR Code generator library (TypeScript)
28
28
  * Copyright (c) Project Nayuki.
29
29
  * SPDX-License-Identifier: MIT
30
- */export{Sa as AUTO_LEVEL_LOGO_COVERAGE,pl as Arrow,ec as BODY_PATTERN,Jf as BUILT_IN_FRAME_SPECS,da as CORNER_EYE_DOT_PATTERNS,pa as CORNER_EYE_PATTERNS,Hn as CUSTOM_FRAME_STYLE,Tc as DEFAULT_ART_INTENSITY,No as DEFAULT_FRAME_TEXT,Ct as DEFAULT_MARGIN,gi as DOWNLOAD_FORMATS,hu as EPS_IMAGE_FILL_REASON,Qr as EYE_POSITIONS,cs as FRAME_COLOR_TOKENS,ws as FRAME_FONT_FAMILY,ve as FRAME_FONT_SCALE_MAX,$n as FRAME_FONT_SCALE_MIN,ra as FRAME_GAP_RATIO,is as FRAME_ICONS,Vo as FRAME_ICON_BOX,ss as FRAME_ICON_MAX_SEGMENTS,Gt as FRAME_IMPORT_LIMITS,Es as FRAME_LABEL_ATTRIBUTE,Mr as FRAME_SPEC_KIND,wr as FRAME_SPEC_LABEL_MAX_FONT,st as FRAME_SPEC_LIMITS,Cr as FRAME_SPEC_VERSION,ji as FRAME_STYLES,ee as FRAME_TEXT_MAX_LENGTH,Xn as FrameSpecError,Zo as GRADIENT_FRAME_DEFAULTS,xl as Halloween,Iu as LOGO_CLEANUP_MAX_SIDE,Wl as LOGO_EC_SAFETY,ac as LOGO_PADDING_MAX,zr as LOGO_PLATE_INSET,qr as LOGO_ROUNDED_RADIUS,nc as LOGO_SHAPES,xa as LOGO_SIZE_DEFAULT,Br as LOGO_SIZE_MAX,oc as LOGO_SIZE_MIN,il as MODULE_SCALE_FLOOR,Gr as MODULE_SCALE_MAX,tr as MODULE_SCALE_MIN,eh as OFFICIAL_FRAME_COLLECTIONS,Kf as OFFICIAL_FRAME_COUNT,th as OFFICIAL_FRAME_COUNTS,Ah as PIXEL_SCAN_SIZES,g5 as PIXEL_SCORE_MIN_CODE_WIDTH,p_ as PRESET_SIZES,ch as QRCode,ri as QRCodeSVG,xe as QR_ART_MAX_SAMPLE_SIZE,jr as QR_ART_MIN_LUMA_GAP,Jn as QR_ART_MODES,Fa as QR_ART_SAMPLE_SIZES,Zn as QR_ART_VARIANTS,Ma as QR_CIRCLE_QUIET_MIN,sc as QR_SHAPES,Vt as QR_SILHOUETTE_MAX_CELLS,ie as QR_SILHOUETTE_MIN_CELLS,Ca as QR_SILHOUETTE_MIN_SHARE,Js as RETIRED_CORNER_EYE_DOT_PATTERNS,tc as RETIRED_CORNER_EYE_PATTERNS,Hu as SCAN_CONTRAST_FAIL,gh as SCAN_CONTRAST_LOW,mr as SCAN_CONTRAST_MIN,Wu as SCAN_IMAGE_CONTRAST_MIN,Yu as SCAN_TEST_SIZES,Qu as SHARP_DOT_EYE_SAFE_BODIES,Gd as SUPPORTS_PATH2D,Ml as SquareBorder,wl as StandardBox,Rl as StrikedBox,Ya as TEMPLATES,Ou as WEAK_BODY_EYES,Bu as WEAK_DOTS,Nu as WEAK_DOT_EYES,Du as WEAK_EYES,Gu as WEAK_SHARP_DOT_EYES,C0 as WEBP_MAX_DIMENSION,Ws as angularGradientSchema,Wo as anyFrameSchema,B0 as baseTemplatePropsSchema,jn as blobToDataUrl,_a as bodyPatternSchema,kr as canvasToWebP,Ke as circleQuietZone,Jr as clampModuleScale,Ne as colorConfigSchema,v0 as colorTypeSchema,zl as convertImageSettingsToPixels,__ as copyQRCodeToClipboard,fa as cornerEyeDotPatternSchema,ga as cornerEyePatternSchema,kc as createQRArtImage,sm as createQRSilhouette,fs as customFrameSchema,nr as damagedCodewords,fi as decodePNGPixels,_l as defaultTemplate,le as downloadFile,mb as downloadImageData,db as downloadImageWithBoundingBox,Cf as downloadPrintEPS,Vb as downloadPrintPDF,Xb as downloadPrintSVG,g_ as downloadQRCode,ca as encodeWebPLossless,Co as epsToDataUrl,ic as errorLevelSchema,co as excavateModules,F0 as excavationSchema,Dr as eyeColorOverrideSchema,mc as eyeColorsSchema,As as frameLabels,hr as frameSchema,Mn as frameSpecColorSchema,nh as frameSpecHash,ms as frameSpecLabelSchema,Cn as frameSpecPadding,Ie as frameSpecPaintSchema,ds as frameSpecQrZone,Xe as frameSpecSchema,ls as frameSpecShapeSchema,Zi as frameStyleSchema,ei as generatePath,xg as getAllTemplates,er as getCodewordMap,L0 as getColorString,qd as getContrastLevel,Ud as getContrastRatio,ta as getCustomFrameLayout,wf as getDownloadFilename,_e as getFrameDimensions,oa as getFrameGapRatio,Xo as getFrameIconPath,je as getFrameLayout,Ps as getFrameSecondaryText,Ko as getFrameSpecGapRatio,Gm as getFrameSpecIssues,Rs as getFrameText,_5 as getImageScanScore,Ee as getImageSettings,ph as getImageTones,hh as getImageTonesFromPixels,Tt as getLayoutMargin,uo as getLogoBlockDamage,ah as getLogoSizeLimit,an as getLuminance,I0 as getNormalizedColor,So as getPrintLayout,Q1 as getQRArtColorIssue,Ua as getQRArtEyeColors,Zr as getQRArtVariant,lr as getQRAsCanvas,Mo as getQRAsEPS,mf as getQRAsPrintPDF,Wb as getQRAsPrintPDFBuffer,df as getQRAsPrintSVG,cb as getQRAsSVG,ce as getQRAsSVGDataUri,bu as getQRAsWebP,b_ as getQRCodeDataUrl,Ei as getQRData,A1 as getQRFunctionModules,lf as getQRModuleCount,m1 as getQRShapePath,c1 as getQRSilhouetteFit,y_ as getSVGString,bh as getScanContrast,p5 as getScanScore,b5 as getScanScoreFromPixels,wt as getSolidColor,Ri as getStylePairRisk,Al as getTemplate,Sg as getTemplateIds,la as getWebPCompression,Or as gradientStopSchema,jl as handleImageLoad,pu as hasImageFill,Qd as hexToRgb,Vs as imageFitSchema,Ys as imagePaintSchema,js as imagePositionCss,Xs as imagePositionSchema,rc as imageSettingsSchema,Vf as importFrameSvg,qt as isFrameActive,Fn as isGradient,ma as isImagePaint,Em as isLatin1Text,ka as isQRArtActive,Ra as isShapedCode,Uu as isWeakSharpPair,Os as isWebPFile,zs as linearGradientSchema,E1 as loadQRArtImage,kh as loadQRSilhouette,Hd as logoFitsBudget,O0 as logoOptionsSchema,$a as logoShapeSchema,Ut as mixFrameColors,Ht as normalizeColorConfig,T0 as pickableCornerEyeDotPatternSchema,k0 as pickableCornerEyePatternSchema,Us as qrArtImageSchema,Gs as qrArtModeSchema,ua as qrArtSchema,Qs as qrArtVariantSchema,uc as qrCodeShapeSchema,D0 as qrPropsSchema,cc as qrShapeSchema,lc as qrSilhouetteSchema,Hs as radialGradientSchema,Fu as removeLogoBackdrop,rh as removeLogoBackground,Ba as renderQRArt,Bt as resolveErrorLevel,Jo as resolveFrameSpec,Te as rgbToCmyk,Er as sanitizeFrameText,y5 as scanQRPixels,qs as solidColorSchema,fu as svgToEPS,G0 as templateConfigSchema,Q0 as templateDefinitionBaseSchema,bi as validateSize,sn as withQRSize};//# sourceMappingURL=index.mjs.map
30
+ */export{Ma as AUTO_LEVEL_LOGO_COVERAGE,Sl as Arrow,sc as BODY_PATTERN,ih as BUILT_IN_FRAME_SPECS,fa as CORNER_EYE_DOT_PATTERNS,ga as CORNER_EYE_PATTERNS,Hn as CUSTOM_FRAME_STYLE,Gc as DEFAULT_ART_INTENSITY,Oo as DEFAULT_FRAME_TEXT,Ct as DEFAULT_MARGIN,xi as DOWNLOAD_FORMATS,xu as EPS_IMAGE_FILL_REASON,Qr as EYE_POSITIONS,hs as FRAME_COLOR_TOKENS,Ls as FRAME_FONT_FAMILY,Ae as FRAME_FONT_SCALE_MAX,$n as FRAME_FONT_SCALE_MIN,oa as FRAME_GAP_RATIO,ds as FRAME_ICONS,Xo as FRAME_ICON_BOX,fs as FRAME_ICON_MAX_SEGMENTS,Qt as FRAME_IMPORT_LIMITS,Is as FRAME_LABEL_ATTRIBUTE,Mr as FRAME_SPEC_KIND,wr as FRAME_SPEC_LABEL_MAX_FONT,lt as FRAME_SPEC_LIMITS,Cr as FRAME_SPEC_VERSION,ns as FRAME_STYLES,ee as FRAME_TEXT_MAX_LENGTH,Xn as FrameSpecError,Jo as GRADIENT_FRAME_DEFAULTS,Pl as Halloween,Bu as LOGO_CLEANUP_MAX_SIDE,Kl as LOGO_EC_SAFETY,mc as LOGO_PADDING_MAX,zr as LOGO_PLATE_INSET,qr as LOGO_ROUNDED_RADIUS,cc as LOGO_SHAPES,Sa as LOGO_SIZE_DEFAULT,Br as LOGO_SIZE_MAX,uc as LOGO_SIZE_MIN,dl as MODULE_SCALE_FLOOR,Gr as MODULE_SCALE_MAX,tr as MODULE_SCALE_MIN,lh as OFFICIAL_FRAME_COLLECTIONS,sh as OFFICIAL_FRAME_COUNT,ch as OFFICIAL_FRAME_COUNTS,Oh as PIXEL_SCAN_SIZES,E5 as PIXEL_SCORE_MIN_CODE_WIDTH,w_ as PRESET_SIZES,gh as QRCode,ci as QRCodeSVG,$e as QR_ART_MAX_SAMPLE_SIZE,jr as QR_ART_MIN_LUMA_GAP,Jn as QR_ART_MODES,Fa as QR_ART_SAMPLE_SIZES,Zn as QR_ART_VARIANTS,Ca as QR_CIRCLE_QUIET_MIN,xl as QR_EYE_ATTRIBUTE,Id as QR_PARTS,Xa as QR_PART_ATTRIBUTE,fc as QR_SHAPES,Xt as QR_SILHOUETTE_MAX_CELLS,ie as QR_SILHOUETTE_MIN_CELLS,wa as QR_SILHOUETTE_MIN_SHARE,oc as RETIRED_CORNER_EYE_DOT_PATTERNS,ic as RETIRED_CORNER_EYE_PATTERNS,Ju as SCAN_CONTRAST_FAIL,Ch as SCAN_CONTRAST_LOW,mr as SCAN_CONTRAST_MIN,Ku as SCAN_IMAGE_CONTRAST_MIN,nm as SCAN_TEST_SIZES,Xu as SHARP_DOT_EYE_SAFE_BODIES,Xd as SUPPORTS_PATH2D,vl as SquareBorder,Il as StandardBox,Fl as StrikedBox,Ka as TEMPLATES,zu as WEAK_BODY_EYES,Wu as WEAK_DOTS,qu as WEAK_DOT_EYES,Hu as WEAK_EYES,Vu as WEAK_SHARP_DOT_EYES,I0 as WEBP_MAX_DIMENSION,Js as angularGradientSchema,Vo as anyFrameSchema,V0 as baseTemplatePropsSchema,jn as blobToDataUrl,ya as bodyPatternSchema,kr as canvasToWebP,Ke as circleQuietZone,Jr as clampModuleScale,ke as colorConfigSchema,D0 as colorTypeSchema,Zl as convertImageSettingsToPixels,P_ as copyQRCodeToClipboard,ha as cornerEyeDotPatternSchema,ba as cornerEyePatternSchema,Qc as createQRArtImage,hm as createQRSilhouette,ys as customFrameSchema,nr as damagedCodewords,_i as decodePNGPixels,wl as defaultTemplate,le as downloadFile,xb as downloadImageData,Sb as downloadImageWithBoundingBox,If as downloadPrintEPS,r_ as downloadPrintPDF,o_ as downloadPrintSVG,E_ as downloadQRCode,la as encodeWebPLossless,Co as epsToDataUrl,dc as errorLevelSchema,co as excavateModules,Q0 as excavationSchema,Dr as eyeColorOverrideSchema,bc as eyeColorsSchema,ks as frameLabels,hr as frameSchema,Mn as frameSpecColorSchema,uh as frameSpecHash,bs as frameSpecLabelSchema,Cn as frameSpecPadding,Le as frameSpecPaintSchema,_s as frameSpecQrZone,Xe as frameSpecSchema,ps as frameSpecShapeSchema,rs as frameStyleSchema,ii as generatePath,vg as getAllTemplates,er as getCodewordMap,B0 as getColorString,Zd as getContrastLevel,jd as getContrastRatio,ea as getCustomFrameLayout,Tf as getDownloadFilename,be as getFrameDimensions,aa as getFrameGapRatio,Yo as getFrameIconPath,je as getFrameLayout,Fs as getFrameSecondaryText,ta as getFrameSpecGapRatio,Xm as getFrameSpecIssues,Ts as getFrameText,P5 as getImageScanScore,we as getImageSettings,Mh as getImageTones,Sh as getImageTonesFromPixels,Ft as getLayoutMargin,uo as getLogoBlockDamage,fh as getLogoSizeLimit,an as getLuminance,G0 as getNormalizedColor,So as getPrintLayout,Y1 as getQRArtColorIssue,qa as getQRArtEyeColors,Zr as getQRArtVariant,lr as getQRAsCanvas,Mo as getQRAsEPS,yf as getQRAsPrintPDF,n_ as getQRAsPrintPDFBuffer,$f as getQRAsPrintSVG,_b as getQRAsSVG,ce as getQRAsSVGDataUri,Cu as getQRAsWebP,R_ as getQRCodeDataUrl,Li as getQRData,O1 as getQRFunctionModules,bf as getQRModuleCount,y1 as getQRShapePath,g1 as getQRSilhouetteFit,A_ as getSVGString,wh as getScanContrast,w5 as getScanScore,R5 as getScanScoreFromPixels,wt as getSolidColor,Ii as getStylePairRisk,Nl as getTemplate,Lg as getTemplateIds,ua as getWebPCompression,Or as gradientStopSchema,ru as handleImageLoad,Su as hasImageFill,Yd as hexToRgb,Ks as imageFitSchema,ec as imagePaintSchema,nc as imagePositionCss,tc as imagePositionSchema,lc as imageSettingsSchema,eh as importFrameSvg,Ht as isFrameActive,Tn as isGradient,da as isImagePaint,Fm as isLatin1Text,Na as isQRArtActive,Pa as isShapedCode,Yu as isWeakSharpPair,qs as isWebPFile,js as linearGradientSchema,F1 as loadQRArtImage,qh as loadQRSilhouette,Kd as logoFitsBudget,H0 as logoOptionsSchema,xa as logoShapeSchema,zt as mixFrameColors,Wt as normalizeColorConfig,Ya as partMarker,U0 as pickableCornerEyeDotPatternSchema,q0 as pickableCornerEyePatternSchema,Xs as qrArtImageSchema,Ws as qrArtModeSchema,ma as qrArtSchema,Vs as qrArtVariantSchema,gc as qrCodeShapeSchema,W0 as qrPropsSchema,hc as qrShapeSchema,pc as qrSilhouetteSchema,Zs as radialGradientSchema,Gu as removeLogoBackdrop,mh as removeLogoBackground,Ga as renderQRArt,Gt as resolveErrorLevel,Ko as resolveFrameSpec,Te as rgbToCmyk,Er as sanitizeFrameText,A5 as scanQRPixels,Ys as solidColorSchema,$u as svgToEPS,X0 as templateConfigSchema,Y0 as templateDefinitionBaseSchema,Si as validateSize,sn as withQRSize};//# sourceMappingURL=index.mjs.map
31
31
  //# sourceMappingURL=index.mjs.map