qrdx 0.0.56 → 0.0.57

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.js CHANGED
@@ -1,6 +1,6 @@
1
- 'use strict';var react=require('react'),jsxRuntime=require('react/jsx-runtime'),schemas_js=require('./schemas.js'),framesIndex_js=require('./frames-index.js'),framesOfficial_js=require('./frames-official.js'),qrCodeCanvas_js=require('./qr-code-canvas.js');function Ht(t){return t.children}var R0=t=>t==null?null:`${t}`;function Io(t,e,n){let o=e??{},r=n;if("key"in o){let{key:a,...i}=o;a!==void 0&&(r=a),o=i;}return {type:t,props:o,key:R0(r)}}function E0(t,e){let n=t;return {type:n.type,props:{...n.props,...e},key:n.key??null}}function A0(t,e,...n){let o={...e};return n.length>0&&(o.children=n.length===1?n[0]:n),Io(t,o)}var P0={jsx:Io,jsxs:Io,createElement:A0,cloneElement:E0,Fragment:Ht},ue=P0;function br(t,e){let n=ue;ue=t;try{return e()}finally{ue=n;}}var To=t=>t===Ht?ue.Fragment:t;function v(t,e,n){return ue.jsx(To(t),e,n)}function St(t,e,n){return ue.jsxs(To(t),e,n)}function yr(t,e,...n){return ue.createElement(To(t),e??null,...n)}function rn(t,e){return ue.cloneElement(t,e)}var v0=new Set([Symbol.for("react.element"),Symbol.for("react.transitional.element")]),rs=Symbol.for("react.fragment");function Ae(t){if(typeof t!="object"||t===null||Array.isArray(t))return false;let e=t;return e.$$typeof!==void 0&&!v0.has(e.$$typeof)?false:(typeof e.type=="string"||typeof e.type=="function"||e.type===rs)&&typeof e.props=="object"&&e.props!==null}var on=t=>t===Ht||t===rs;var an;(a=>{class t{constructor(c,s,l,m){this.version=c;this.errorCorrectionLevel=s;if(c<t.MIN_VERSION||c>t.MAX_VERSION)throw new RangeError("Version value out of range");if(m<-1||m>7)throw new RangeError("Mask value out of range");this.size=c*4+17;let u=[];for(let d=0;d<this.size;d++)u.push(false);for(let d=0;d<this.size;d++)this.modules.push(u.slice()),this.isFunction.push(u.slice());this.drawFunctionPatterns();let f=this.addEccAndInterleave(l);if(this.drawCodewords(f),m==-1){let d=1e9;for(let g=0;g<8;g++){this.applyMask(g),this.drawFormatBits(g);let h=this.getPenaltyScore();h<d&&(m=g,d=h),this.applyMask(g);}}o(0<=m&&m<=7),this.mask=m,this.applyMask(m),this.drawFormatBits(m),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,m=40,u=-1,f=true){if(!(t.MIN_VERSION<=l&&l<=m&&m<=t.MAX_VERSION)||u<-1||u>7)throw new RangeError("Invalid value");let d,g;for(d=l;;d++){let y=t.getNumDataCodewords(d,s)*8,_=r.getTotalBits(c,d);if(_<=y){g=_;break}if(d>=m)throw new RangeError("Data too long")}for(let y of [t.Ecc.MEDIUM,t.Ecc.QUARTILE,t.Ecc.HIGH])f&&g<=t.getNumDataCodewords(d,y)*8&&(s=y);let h=[];for(let y of c){e(y.mode.modeBits,4,h),e(y.numChars,y.mode.numCharCountBits(d),h);for(let _ of y.getData())h.push(_);}o(h.length==g);let p=t.getNumDataCodewords(d,s)*8;o(h.length<=p),e(0,Math.min(4,p-h.length),h),e(0,(8-h.length%8)%8,h),o(h.length%8==0);for(let y=236;h.length<p;y^=253)e(y,8,h);let b=[];for(;b.length*8<h.length;)b.push(0);return h.forEach((y,_)=>b[_>>>3]|=y<<7-(_&7)),new t(d,s,b,u)}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 m=0;m<s;m++)l==0&&m==0||l==0&&m==s-1||l==s-1&&m==0||this.drawAlignmentPattern(c[l],c[m]);this.drawFormatBits(0),this.drawVersion();}drawFormatBits(c){let s=this.errorCorrectionLevel.formatBits<<3|c,l=s;for(let u=0;u<10;u++)l=l<<1^(l>>>9)*1335;let m=(s<<10|l)^21522;o(m>>>15==0);for(let u=0;u<=5;u++)this.setFunctionModule(8,u,n(m,u));this.setFunctionModule(8,7,n(m,6)),this.setFunctionModule(8,8,n(m,7)),this.setFunctionModule(7,8,n(m,8));for(let u=9;u<15;u++)this.setFunctionModule(14-u,8,n(m,u));for(let u=0;u<8;u++)this.setFunctionModule(this.size-1-u,8,n(m,u));for(let u=8;u<15;u++)this.setFunctionModule(8,this.size-15+u,n(m,u));this.setFunctionModule(8,this.size-8,true);}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 m=n(s,l),u=this.size-11+l%3,f=Math.floor(l/3);this.setFunctionModule(u,f,m),this.setFunctionModule(f,u,m);}}drawFinderPattern(c,s){for(let l=-4;l<=4;l++)for(let m=-4;m<=4;m++){let u=Math.max(Math.abs(m),Math.abs(l)),f=c+m,d=s+l;0<=f&&f<this.size&&0<=d&&d<this.size&&this.setFunctionModule(f,d,u!=2&&u!=4);}}drawAlignmentPattern(c,s){for(let l=-2;l<=2;l++)for(let m=-2;m<=2;m++)this.setFunctionModule(c+m,s+l,Math.max(Math.abs(m),Math.abs(l))!=1);}setFunctionModule(c,s,l){this.modules[s][c]=l,this.isFunction[s][c]=true;}addEccAndInterleave(c){let s=this.version,l=this.errorCorrectionLevel;if(c.length!=t.getNumDataCodewords(s,l))throw new RangeError("Invalid argument");let m=t.NUM_ERROR_CORRECTION_BLOCKS[l.ordinal][s],u=t.ECC_CODEWORDS_PER_BLOCK[l.ordinal][s],f=Math.floor(t.getNumRawDataModules(s)/8),d=m-f%m,g=Math.floor(f/m),h=[],p=t.reedSolomonComputeDivisor(u);for(let y=0,_=0;y<m;y++){let w=c.slice(_,_+g-u+(y<d?0:1));_+=w.length;let C=t.reedSolomonComputeRemainder(w,p);y<d&&w.push(0),h.push(w.concat(C));}let b=[];for(let y=0;y<h[0].length;y++)h.forEach((_,w)=>{(y!=g-u||w>=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 m=0;m<this.size;m++)for(let u=0;u<2;u++){let f=l-u,g=(l+1&2)==0?this.size-1-m:m;!this.isFunction[g][f]&&s<c.length*8&&(this.modules[g][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 m;switch(c){case 0:m=(l+s)%2==0;break;case 1:m=s%2==0;break;case 2:m=l%3==0;break;case 3:m=(l+s)%3==0;break;case 4:m=(Math.floor(l/3)+Math.floor(s/2))%2==0;break;case 5:m=l*s%2+l*s%3==0;break;case 6:m=(l*s%2+l*s%3)%2==0;break;case 7:m=((l+s)%2+l*s%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[s][l]&&m&&(this.modules[s][l]=!this.modules[s][l]);}}getPenaltyScore(){let c=0;for(let u=0;u<this.size;u++){let f=false,d=0,g=[0,0,0,0,0,0,0];for(let h=0;h<this.size;h++)this.modules[u][h]==f?(d++,d==5?c+=t.PENALTY_N1:d>5&&c++):(this.finderPenaltyAddHistory(d,g),f||(c+=this.finderPenaltyCountPatterns(g)*t.PENALTY_N3),f=this.modules[u][h],d=1);c+=this.finderPenaltyTerminateAndCount(f,d,g)*t.PENALTY_N3;}for(let u=0;u<this.size;u++){let f=false,d=0,g=[0,0,0,0,0,0,0];for(let h=0;h<this.size;h++)this.modules[h][u]==f?(d++,d==5?c+=t.PENALTY_N1:d>5&&c++):(this.finderPenaltyAddHistory(d,g),f||(c+=this.finderPenaltyCountPatterns(g)*t.PENALTY_N3),f=this.modules[h][u],d=1);c+=this.finderPenaltyTerminateAndCount(f,d,g)*t.PENALTY_N3;}for(let u=0;u<this.size-1;u++)for(let f=0;f<this.size-1;f++){let d=this.modules[u][f];d==this.modules[u][f+1]&&d==this.modules[u+1][f]&&d==this.modules[u+1][f+1]&&(c+=t.PENALTY_N2);}let s=0;for(let u of this.modules)s=u.reduce((f,d)=>f+(d?1:0),s);let l=this.size*this.size,m=Math.ceil(Math.abs(s*20-l*10)/l)-1;return o(0<=m&&m<=9),c+=m*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 m=this.size-7;l.length<c;m-=s)l.splice(1,0,m);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 m=0;m<c-1;m++)s.push(0);s.push(1);let l=1;for(let m=0;m<c;m++){for(let u=0;u<s.length;u++)s[u]=t.reedSolomonMultiply(s[u],l),u+1<s.length&&(s[u]^=s[u+1]);l=t.reedSolomonMultiply(l,2);}return s}static reedSolomonComputeRemainder(c,s){let l=s.map(m=>0);for(let m of c){let u=m^l.shift();l.push(0),s.forEach((f,d)=>l[d]^=t.reedSolomonMultiply(f,u));}return l}static reedSolomonMultiply(c,s){if(c>>>8||s>>>8)throw new RangeError("Byte out of range");let l=0;for(let m=7;m>=0;m--)l=l<<1^(l>>>7)*285,l^=(s>>>m&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 m=Math.min(c.length-l,3);e(parseInt(c.substr(l,m),10),m*3+1,s),l+=m;}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 m=r.ALPHANUMERIC_CHARSET.indexOf(c.charAt(l))*45;m+=r.ALPHANUMERIC_CHARSET.indexOf(c.charAt(l+1)),e(m,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 m of c){let u=m.mode.numCharCountBits(s);if(m.numChars>=1<<u)return 1/0;l+=4+u+m.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;})(an||={});(e=>{(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;})(e.QrCode||={});})(an||={});(e=>{(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;})(e.QrSegment||={});})(an||={});var gt=an;var Rt={L:gt.QrCode.Ecc.LOW,M:gt.QrCode.Ecc.MEDIUM,Q:gt.QrCode.Ecc.QUARTILE,H:gt.QrCode.Ecc.HIGH},ut=128,Vt="Q",bt="#FFFFFF",Ct="#000000";var dt=0;var _r=.1;var xr=["logo","halftone"],No={logo:["blend","badge"],halftone:["color","mono"]},Tn=192,L0=["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"],F0=["diamond","star","banner"],k0=["square","rounded","gear","circle","diya","extra-rounded","message","pointy","leaf","drop","octagon","bevel","squircle","cushion","shield","petal","leaf-reverse"],I0=["curly"],T0=["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"],N0=["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"],te=24,Oo="Scan me",Nn=.5,sn=1.5,O0=["square","rounded","circle"],D0=.1,Do=.3,Bo=.25,B0=2,$r=.5,Qo=1,Go=.07,Q0=["square","circle","heart"],Uo=3,Pe=64,me=8,zo=.42,Sr=["topLeft","topRight","bottomLeft"];function j(t,e=3){let n=10**e;return Math.round(t*n)/n+0}function x(t,e=3){return String(j(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"?x(r):r)+(t[o+1]??"");}return n}var G0={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0},U0=/^[MmLlHhVvCcSsQqTtAaZz0-9.,+\-\s]*$/,qo=/[+-]?(?:\d+\.?\d*|\.\d+)/y;function On(t,e=Number.POSITIVE_INFINITY){if(!U0.test(t))return null;let n=[],o=0,r=()=>{for(;o<t.length&&/[\s,]/.test(t[o]);)o++;},a=()=>{r(),qo.lastIndex=o;let s=qo.exec(t);if(!s)return null;let l=s[0],m=l.indexOf(".");if(m>=0&&l.length-m-1>e)return null;o=qo.lastIndex;let u=Number(l);return Number.isFinite(u)?u: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(),m=G0[l];if(m===void 0||n.length===0&&l!=="M")return null;if(o++,m===0){n.push({command:s,values:[]}),r();continue}let u=s,f=true;for(;f||c();){let d=[];for(let g=0;g<m;g++){let h=l==="A"&&(g===3||g===4)?i():a();if(h===null)return null;d.push(h);}n.push({command:u,values:d}),l==="M"&&(u=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 Wo(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,m=s?o:0,u;switch(c){case "Z":u=[];break;case "H":u=[x(i[0]*e+l)];break;case "V":u=[x(i[0]*e+m)];break;case "A":u=[x(Math.abs(i[0])*e),x(Math.abs(i[1])*e),x(i[2]),String(i[3]),String(i[4]),x(i[5]*e+l),x(i[6]*e+m)];break;default:u=i.map((f,d)=>x(f*e+(d%2===0?l:m)));}r+=a+u.join(" ");}return r}function wr(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],m=[c.x2,c.y2],u=[c.x,c.y],f=Math.hypot(l[0]-s[0],l[1]-s[1])+Math.hypot(m[0]-l[0],m[1]-l[1])+Math.hypot(u[0]-m[0],u[1]-m[1]),d=Math.max(2,Math.min(64,Math.ceil(Math.sqrt(f/(4*e)))));for(let g=1;g<=d;g++){let h=g/d,p=1-h;o.push([p*p*p*s[0]+3*p*p*h*l[0]+3*p*h*h*m[0]+h*h*h*u[0],p*p*p*s[1]+3*p*p*h*l[1]+3*p*h*h*m[1]+h*h*h*u[1]]);}a=u;}else i(),a=r;return i(),n}function cn(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),m=r(s);l>=0?(m<0&&o.push(as(s,c,m,l)),o.push(c)):m>=0&&o.push(as(s,c,m,l));}}return o.length>2?o:[]}function as(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 is(t){return t.filter(e=>e.length>2).map(e=>`M${e.map(([n,o])=>`${x(n)} ${x(o)}`).join("L")}Z`).join("")}function ve(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 z0={amp:"&",lt:"<",gt:">",quot:'"',apos:"'"};function ls(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 z0[n.toLowerCase()]??e})}var q0=60,Ho=62,Vo=47,W0=61,ss=34,cs=39,Xo=/\s*/y,H0=/[^\s/>]*/y,V0=/[^\s>]*/y,j0=/[^\s=]*/y;function ln(t,e,n){return t.lastIndex=n,t.test(e)?t.lastIndex:n}function X0(t,e){let n=t.length,o=S=>{let $=Number.POSITIVE_INFINITY,M=-1;return R=>((R<$||M>=0&&M<R)&&($=R,M=t.indexOf(S,R)),M)},r=o("-->"),a=o("?>"),i=o("]]>"),c=o(">"),s,l=S=>{let $=t.charCodeAt(S);if($!==ss&&$!==cs)return S+1;let M=t.indexOf(t[S],S+1);return M<0?n:M+1},m=S=>{for(let $=S;$<n&&!s?.[$];$=l($)){let M=t.charCodeAt($);if(M===Ho||M===Vo&&t.charCodeAt($+1)===Ho)return $}s??=new Uint8Array(n);for(let $=S;$<n&&!s[$];$=l($))s[$]=1;return -1},u=-1,f=-1,d=-1,g=-1,h=S=>{let $=S+1;if($<u||$>=f){u=$,f=ln(H0,t,$),d=-1;for(let R=f;R>$;R--){let E=t.charCodeAt(R);if((R===f||E===ss||E===cs)&&(g=m(R),g>=0)){d=R;break}}}if(d<=$)return -1;let M=t.charCodeAt(g)===Vo;return e.open(t.slice($,d),t.slice(d,g),M),g+(M?2:1)},p=-1,b=-1,y=-1,_=S=>{let $=S+2;if($<p||$>=b){p=$,b=ln(V0,t,$);let M=ln(Xo,t,b);y=b>$&&t.charCodeAt(M)===Ho?M:-1;}return y},w=S=>{if(t.startsWith("<!--",S)){let $=r(S+4);if($>=0)return $+3}if(t.startsWith("<?",S)){let $=a(S+2);if($>=0)return $+2}if(t.startsWith("<![CDATA[",S)){let $=i(S+9);if($>=0)return e.cdata(t.slice(S+9,$)),$+3}if(t.startsWith("<!",S)){let $=c(S+2);if($>=0)return $+1}if(t.charCodeAt(S+1)===Vo){let $=_(S);return $<0?-1:(e.close(),$+1)}return h(S)},C=0;for(;C<n;)if(t.charCodeAt(C)===q0){let S=w(C);C=S<0?C+1:S;}else {let S=t.indexOf("<",C),$=S<0?n:S;e.text(t.slice(C,$)),C=$;}}function Z0(t){let e={},n=0;for(;n<t.length;){let o=ln(j0,t,n);if(o===n){n++;continue}let r=ln(Xo,t,o);if(t.charCodeAt(r)===W0){let a=ln(Xo,t,r+1),i=t[a],c=i==='"'||i==="'"?t.indexOf(i,a+1):-1;if(c>=0){e[t.slice(n,o)]=ls(t.slice(a+1,c)),n=c+1;continue}}n=o;}return e}function de(t){let e={name:"#root",attrs:{},children:[],text:""},n=[e],o=()=>n.at(-1);X0(t,{open(a,i,c){let s=Z0(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+=ls(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)}var un=[1,0,0,1,0,0];function st(t,e){let[n,o,r,a,i,c]=t,[s,l,m,u,f,d]=e;return [n*s+r*l,o*s+a*l,n*m+r*u,o*m+a*u,n*f+r*d+i,o*f+a*d+c]}function W(t,e,n){return [t[0]*e+t[2]*n+t[4],t[1]*e+t[3]*n+t[5]]}function mn(t){return Math.sqrt(Math.abs(t[0]*t[3]-t[1]*t[2]))}function jt(t){return t?(t.match(/[+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?/gi)??[]).map(Number):[]}function Nt(t){let e=un;if(!t)return e;for(let[,n,o]of t.matchAll(/(matrix|translate|scale|rotate|skewX|skewY)\s*\(([^)]*)\)/g)){let r=jt(o),a=un;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,m]=[r[1]??0,r[2]??0];a=st(st([1,0,0,1,l,m],[c,s,-s,c,0,0]),[1,0,0,1,-l,-m]);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=st(e,a);}return e}var jo=/[+-]?(?:\d+\.?\d*|\.\d+)(?:[eE][+-]?\d+)?/y;function Y0(t,e,n,o,r,a,i,c,s){if(t===c&&e===s)return [];let l=Math.abs(n),m=Math.abs(o);if(l===0||m===0)return [{op:"L",x:c,y:s}];let u=r*Math.PI/180,f=Math.cos(u),d=Math.sin(u),g=(t-c)/2,h=(e-s)/2,p=f*g+d*h,b=-d*g+f*h,y=p*p/(l*l)+b*b/(m*m);y>1&&(l*=Math.sqrt(y),m*=Math.sqrt(y));let _=l*l*m*m-l*l*b*b-m*m*p*p,w=l*l*b*b+m*m*p*p,C=(a===i?-1:1)*Math.sqrt(Math.max(0,_/w)),S=C*l*b/m,$=-C*m*p/l,M=f*S-d*$+(t+c)/2,R=d*S+f*$+(e+s)/2,E=(q,O,G,J)=>Math.atan2(q*J-O*G,q*G+O*J),P=E(1,0,(p-S)/l,(b-$)/m),L=E((p-S)/l,(b-$)/m,(-p-S)/l,(-b-$)/m);!i&&L>0?L-=2*Math.PI:i&&L<0&&(L+=2*Math.PI);let F=Math.max(1,Math.ceil(Math.abs(L)/(Math.PI/2)-1e-9)),I=L/F,N=4/3*Math.tan(I/4),k=(q,O)=>[M+l*f*q-m*d*O,R+l*d*q+m*f*O],B=[];for(let q=0;q<F;q++){let O=P+q*I,G=O+I,[J,pt]=k(Math.cos(O)-N*Math.sin(O),Math.sin(O)+N*Math.cos(O)),[at,T]=k(Math.cos(G)+N*Math.sin(G),Math.sin(G)-N*Math.cos(G)),[U,z]=q===F-1?[c,s]:k(Math.cos(G),Math.sin(G));B.push({op:"C",x1:J,y1:pt,x2:at,y2:T,x:U,y:z});}return B}function ee(t){let e=[],n=0,o=0,r=0,a=0,i=0,c="",s=null,l=null,m=()=>{for(;n<t.length&&/[\s,]/.test(t[n]);)n++;},u=()=>{m(),jo.lastIndex=n;let g=jo.exec(t);return g?(n=jo.lastIndex,Number(g[0])):null},f=()=>{m();let g=t[n];return g==="0"||g==="1"?(n++,g==="1"):null},d=g=>{let h=[];for(let p=0;p<g;p++){let b=u();if(b===null)return null;h.push(b);}return h};for(;m(),!(n>=t.length);){let g=t[n];if(/[MmLlHhVvCcSsQqTtAaZz]/.test(g))c=g,n++;else if(!c||c==="Z"||c==="z")break;let h=c===c.toLowerCase(),p=h?o:0,b=h?r:0,y=c.toUpperCase();if(y==="Z"){e.push({op:"Z"}),o=a,r=i,s=null,l=null;continue}if(y==="A"){let S=d(3),$=f(),M=f(),R=d(2);if(!(S&&R)||$===null||M===null)break;let[E,P,L]=S,F=R[0]+p,I=R[1]+b;e.push(...Y0(o,r,E,P,L,$,M,F,I)),o=F,r=I,s=null,l=null;continue}let _={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2}[y]??0,w=d(_);if(!w)break;let C=w;switch(y){case "M":o=C[0]+p,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":y!=="V"&&(o=C[0]+p),y==="V"?r=C[0]+b:y==="L"&&(r=C[1]+b),e.push({op:"L",x:o,y:r}),s=null,l=null;break;case "C":case "S":{let S,$;y==="C"?(S=[C[0]+p,C[1]+b],$=C.slice(2)):(S=s?[2*o-s[0],2*r-s[1]]:[o,r],$=C);let M=[$[0]+p,$[1]+b],R=[$[2]+p,$[3]+b];e.push({op:"C",x1:S[0],y1:S[1],x2:M[0],y2:M[1],x:R[0],y:R[1]}),[o,r]=R,s=M,l=null;break}case "Q":case "T":{let S,$;y==="Q"?(S=[C[0]+p,C[1]+b],$=[C[2]+p,C[3]+b]):(S=l?[2*o-l[0],2*r-l[1]]:[o,r],$=[C[0]+p,C[1]+b]),e.push({op:"C",x1:o+2/3*(S[0]-o),y1:r+2/3*(S[1]-r),x2:$[0]+2/3*(S[0]-$[0]),y2:$[1]+2/3*(S[1]-$[1]),x:$[0],y:$[1]}),[o,r]=$,l=S,s=null;break}}}return e}var Cr=.5522847498;function Xt(t,e,n,o){if(n<=0||o<=0)return [];let r=n*Cr,a=o*Cr;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 Zt(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*Cr,l=c*Cr,m=t+n,u=e+o;return [{op:"M",x:t+i,y:e},{op:"L",x:m-i,y:e},{op:"C",x1:m-i+s,y1:e,x2:m,y2:e+c-l,x:m,y:e+c},{op:"L",x:m,y:u-c},{op:"C",x1:m,y1:u-c+l,x2:m-i+s,y2:u,x:m-i,y:u},{op:"L",x:t+i,y:u},{op:"C",x1:t+i-s,y1:u,x2:t,y2:u-c+l,x:t,y:u-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 Dn="qrdx.frame",Bn=1,Qn="custom",ot={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:te},Yo=["wifi","star","heart","phone","headphones","calendar","user","chat","bag","bell","cup","card","check","info","home","pin","share","download","clock","snowflake","pumpkin","tree","sparkle","gift"],Gn=.95,ms=200,Ko=["frame","text","accent","background"],K0=/[\t\n\v\f\r\u0085\u2028\u2029]/g,J0=/[\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;function dn(t,e=te){let n=t.slice(0,1e3).normalize("NFC").replace(K0," ").replace(J0,"").replace(/\s+/g," ").trim();return Array.from(n).slice(0,Math.max(0,e)).join("").trim()}function tm(t){for(let e of t)if((e.codePointAt(0)??0)>255)return false;return true}var Mr=t=>Math.abs(t*1e3-Math.round(t*1e3))<1e-6;function Rr(t){let e=fn(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 em(t){return {x0:t.qr.x,y0:t.qr.y,x1:t.qr.x+t.qr.size,y1:t.qr.y+t.qr.size}}function fn(t){return t.qr.padding??t.qr.size*ot.defaultPadding}var Jo=.52,nm=.35;function rm(t){let e=t.fontSize??t.box.height*Jo;return Math.min(e*sn,t.box.height*Gn)}var Zo=(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;function us(t){let e=Rr(t),n=Math.min(t.qr.radius??0,(e.x1-e.x0)/2,(e.y1-e.y0)/2),o=[[e.x0+n,e.y0+n,Math.PI],[e.x1-n,e.y0+n,-Math.PI/2],[e.x1-n,e.y1-n,0],[e.x0+n,e.y1-n,Math.PI/2]],r=[];for(let[a,i,c]of o)for(let s=0;s<=8;s++){let l=c+Math.PI/2*(s/8);r.push([a+n*Math.cos(l),i+n*Math.sin(l)]);}return r}function om([t,e],n,o){if(t<n.x-.01||e<n.y-.01||t>n.x+n.width+.01||e>n.y+n.height+.01)return false;let a=Math.min(o,n.width/2,n.height/2),i=Math.min(Math.max(t,n.x+a),n.x+n.width-a),c=Math.min(Math.max(e,n.y+a),n.y+n.height-a);return Math.hypot(t-i,e-c)<=a+.01}function am(t){let e=0;return t.forEach(([n,o],r)=>{let[a,i]=t[(r+1)%t.length];e+=n*i-a*o;}),Math.abs(e)/2}function im(t,e,n){let o=Rr(e);if(!Zo(n,o))return false;if("stroke"in t&&t.stroke)return true;if(t.fill==="background")return false;if(t.type==="rect"&&t.hole){let{hole:r}=t;return !us(e).every(a=>om(a,r,r.radius??0))}if(t.type==="circle"&&t.hole){let r=t.hole;return !us(e).every(([a,i])=>Math.hypot(a-t.cx,i-t.cy)<=r+.01)}if(t.type==="polygon"){let r=cn(t.points,o);return r.length>2&&am(r)>1e-6}return true}function ta(t){let e=sm(t),n="stroke"in t?t.stroke:void 0;if(!(n&&e.bounds))return e;let o=t.type==="circle"||t.type==="ellipse"?n.width/2:t.type==="rect"?n.width*Math.SQRT2/2:n.width*2,{x0:r,y0:a,x1:i,y1:c}=e.bounds;return {bounds:{x0:r-o,y0:a-o,x1:i+o,y1:c+o},segments:e.segments*2}}function sm(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=On(t.d,ot.maxDecimals);return e?{bounds:ve(ee(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:ms}}}function ds(t,e){let n=ot,o=new TextEncoder().encode(JSON.stringify(t)).length;if(o>n.maxBytes){e(`The spec is ${o} bytes; the limit is ${n.maxBytes}`);return}let{width:r,height:a}=t.artboard,i=Math.max(r,a)*.005,c={x0:-i,y0:-i,x1:r+i,y1:a+i},s=b=>b.x0>=c.x0&&b.y0>=c.y0&&b.x1<=c.x1&&b.y1<=c.y1,{qr:l}=t,m=fn(t);l.plate!=="none"&&m<l.size*n.minPadding-1e-9&&e(`qr.padding must be at least ${n.minPadding*100}% of qr.size`,["qr","padding"]),l.size<Math.min(r,a)*n.minQrShare-1e-9&&e(`qr.size must be at least ${n.minQrShare*100}% of the artboard's shorter side`,["qr","size"]);let u=Rr(t);(u.x0<-1e-9||u.y0<-1e-9||u.x1>r+1e-9||u.y1>a+1e-9)&&e("The code and its padding must sit inside the artboard",["qr"]),(l.radius??0)>(l.size+2*m)/2&&e("qr.radius is larger than half the plate",["qr","radius"]);let f=0,d=0;t.shapes.forEach((b,y)=>{let _=["shapes",y],{bounds:w,segments:C}=ta(b);if(!w){e("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",[..._,"d"]);return}if(s(w)||e("The shape extends outside the artboard",_),b.type==="rect"&&b.hole){let{hole:S}=b;(S.x<b.x||S.y<b.y||S.x+S.width>b.x+b.width+1e-9||S.y+S.height>b.y+b.height+1e-9)&&e("The hole must sit inside its rect",[..._,"hole"]);}b.type==="circle"&&b.hole&&b.hole>=b.r&&e("The hole must be smaller than the circle",[..._,"hole"]),"stroke"in b&&b.stroke&&b.stroke.width>Math.min(r,a)*.1+1e-9&&e("A stroke may be at most 10% of the artboard's shorter side",[..._,"stroke","width"]),l.plate==="background"&&im(b,t,w)&&e('With qr.plate "background", only background fills (or a ring whose hole holds the plate) may lie under the plate',_),f+=C,typeof b.fill=="object"&&"gradient"in b.fill&&(d+=(b.fill.gradient.steps??32)*C);}),f>n.maxSegments&&e(`The shapes have ${f} segments; the limit is ${n.maxSegments}`,["shapes"]),d>n.maxGradientWork&&e("Gradient fills are too detailed (fewer steps or simpler shapes)",["shapes"]);let g=[],h=new Set,p=new Set;t.labels.forEach((b,y)=>{let _=["labels",y];h.has(b.id)&&e(`Label id "${b.id}" is used twice`,[..._,"id"]),h.add(b.id),b.slot!=="fixed"&&(p.has(b.slot)&&e(`Only one label may use the ${b.slot} slot`,[..._,"slot"]),p.add(b.slot));let w=b.maxLength??n.maxTextLength;b.text!==dn(b.text,w)&&e(`Label text must be at most ${w} characters, trimmed, with no control or invisible characters (see sanitizeFrameText)`,[..._,"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*Gn+1e-9&&e("fontSize may be at most 95% of the label's row height",[..._,"fontSize"]);let S=b.box.y+b.box.height/2,$=rm(b)*nm,M={x0:C.x0,x1:C.x1,y0:S-$,y1:S+$};(Zo(C,em(t))||Zo(M,u))&&e("The label overlaps the code or its padding",[..._,"box"]);}else {let{cx:S,cy:$,radius:M}=b.curve,R=b.fontSize*sn*.6;C={x0:S-M-R,y0:$-M-R,x1:S+M+R,y1:$+M+R};let E=Math.hypot(Math.max(u.x0-S,0,S-u.x1),Math.max(u.y0-$,0,$-u.y1));Math.hypot(Math.max(Math.abs(u.x0-S),Math.abs(u.x1-S)),Math.max(Math.abs(u.y0-$),Math.abs(u.y1-$)))<=M-R||E>=M+R||e("The curved label crosses the code or its padding",[..._,"curve"]);}if(s(C)||e("The label extends outside the artboard",_),b.collapse){let S=b.collapse,$=S.y+S.height;(S.y<-1e-9||$>a+1e-9)&&e("The collapse band must sit inside the artboard",[..._,"collapse"]),$>u.y0+1e-6&&S.y<u.y1-1e-6&&e("The collapse band crosses the code or its padding",[..._,"collapse"]);for(let M of g)$>M.y+1e-6&&S.y<M.y+M.height-1e-6&&e("Collapse bands may not overlap",[..._,"collapse"]);g.push(S);}});}var ea=(t,e=0)=>{for(let n=e;n<t.length;n++)if(t[n]?.continue!==true)return true;return false};function fe(t,e=[],n={}){return {...n,run(o){let r=t({value:o,issues:[]}),a=ea(r.issues);for(let i of e){if(i.hasLength){let s=r.value;if(r.issues.some(l=>l.continue===false)||s===null||s===void 0||s.length===void 0)continue}else if(a)continue;let c=r.issues.length;i.run(r),!a&&r.issues.length>c&&(a=ea(r.issues,c));}return r}}}function cm(t){if(typeof t=="number")return Number.isNaN(t)?"NaN":Number.isFinite(t)?"number":String(t);if(t===null)return "null";if(Array.isArray(t))return "array";if(typeof t=="object"){let e=t.constructor;if(Object.getPrototypeOf(t)!==Object.prototype&&"constructor"in t&&e)return e.name}return typeof t}var Fe=(t,e)=>({path:[],message:`Invalid input: expected ${t}, received ${cm(e)}`}),lm={string:"characters",array:"items"};function ne(t,e,n,o){let r=lm[e],a=t?"Too big":"Too small",i=`${t?"<=":">="}${n}`;return {path:[],message:r?`${a}: expected ${e} to have ${i} ${r}`:`${a}: expected ${e} to be ${i}`,continue:o}}var na=t=>typeof t=="string"?`"${t}"`:`${t}`,gs=t=>typeof t=="object"&&t!==null&&!Array.isArray(t);function ia(t,e,n){for(let o of n)o.path.unshift(e),t.push(o);}var um=t=>t>=55296&&t<=56319,mm=t=>t>=56320&&t<=57343;function dm(t){let e=t.length;for(let n=0;n<t.length-1;n++)um(t.charCodeAt(n))&&mm(t.charCodeAt(n+1))&&(e--,n++);return e}var bs=t=>Array.isArray(t)?"array":typeof t=="string"?"string":"unknown",qn=t=>({run(e){e.value<t&&e.issues.push(ne(false,"number",t,true));}}),Wn=t=>({run(e){e.value>t&&e.issues.push(ne(true,"number",t,true));}}),gn=(t,e="Invalid input")=>({run(n){t(n.value)||n.issues.push({path:[],message:e,continue:true});}}),ys=t=>typeof t=="string"?dm(t):t.length,_s=t=>({hasLength:true,run(e){let n=e.value;ys(n)<t&&e.issues.push(ne(false,bs(n),t,true));}}),sa=t=>({hasLength:true,run(e){let n=e.value;ys(n)>t&&e.issues.push(ne(true,bs(n),t,true));}}),xs=(t,e)=>({run(n){t.lastIndex=0,t.test(n.value)||n.issues.push({path:[],message:e??`Invalid string: must match pattern ${t}`,continue:true});}}),fm={run(t){let e=t.value;Number.isInteger(e)?Number.isSafeInteger(e)||t.issues.push(e>0?ne(true,"int",Number.MAX_SAFE_INTEGER,true):ne(false,"int",Number.MIN_SAFE_INTEGER,true)):t.issues.push({...Fe("int",e),continue:false});}},ke=(...t)=>fe(e=>{let n=e.value;return typeof n=="number"&&Number.isFinite(n)||e.issues.push(Fe("number",n)),e},t),$s=(...t)=>ke(fm,...t),Er=(...t)=>fe(e=>(typeof e.value!="string"&&e.issues.push(Fe("string",e.value)),e),t);function Dt(t){let e=t.length===1?`Invalid input: expected ${na(t[0])}`:`Invalid option: expected one of ${t.map(na).join("|")}`;return fe(n=>(t.includes(n.value)||n.issues.push({path:[],message:e}),n),[],{values:t})}var Ot=t=>Dt([t]),it=t=>({optional:true,run:e=>e===void 0?{value:e,issues:[]}:t.run(e)});function ft(t,e=[]){let n=Object.keys(t),o=new Set(n);return fe(r=>{let a=r.value;if(!gs(a))return r.issues.push(Fe("object",a)),r;let i={};for(let s of n){let l=t[s],m=l.run(a[s]),u=s in a;ia(r.issues,s,m.issues),u||l.optional||m.issues.length>0||r.issues.push({path:[s],message:"Invalid input: expected nonoptional, received undefined"}),u&&(i[s]=m.value);}r.value=i;let c=[];for(let s in a)o.has(s)||c.push(s);return c.length>0&&r.issues.push({path:[],message:`Unrecognized key${c.length>1?"s":""}: ${c.map(na).join(", ")}`,continue:true}),r},e,{shape:t})}function ra(t,e,n){let o=[];return e!==void 0&&o.push(_s(e)),n!==void 0&&o.push(sa(n)),fe(r=>{let a=r.value;if(Array.isArray(a)&&n!==void 0&&a.length>n)return r.issues.push(ne(true,"array",n,false)),r;if(!Array.isArray(a))return r.issues.push(Fe("array",a)),r;let i=new Array(a.length);for(let c=0;c<a.length;c++){let s=t.run(a[c]);ia(r.issues,c,s.issues),i[c]=s.value;}return r.value=i,r},o)}function oa(t){return fe(e=>{let n=e.value;if(!Array.isArray(n))return e.issues.push(Fe("tuple",n)),e;if(n.length<t.length)return e.issues.push(ne(false,"array",t.length,void 0)),e;n.length>t.length&&e.issues.push(ne(true,"array",t.length,void 0));let o=[];return t.forEach((r,a)=>{let i=r.run(n[a]);ia(e.issues,a,i.issues),o[a]=i.value;}),e.value=o,e})}function pn(t){return fe(e=>{let n=[];for(let r of t){let a=r.run(e.value);if(a.issues.length===0)return a;n.push(a);}let o=n.filter(r=>!ea(r.issues));return o.length===1?o[0]:(e.issues.push({path:[],message:"Invalid input"}),e)})}function Ss(t,e){let n=new Map;for(let r of e)for(let a of r.shape?.[t]?.values??[])n.set(a,r);let o=`Invalid discriminator value. Expected ${[...n.keys()].map(r=>`'${r}'`).join(" | ")}`;return fe(r=>{let a=r.value;if(!gs(a))return r.issues.push(Fe("object",a)),r;let i=n.get(a[t]);return i?i.run(a):(r.issues.push({path:[t],message:o}),r)})}var hm=gn(Mr,`Numbers may have at most ${ot.maxDecimals} decimals`),Pr=[qn(-ot.maxCoordinate),Wn(ot.maxCoordinate),hm],_t=ke(...Pr),Mt=ke(...Pr,gn(t=>t>0,"Must be greater than 0")),Ar=ke(...Pr,gn(t=>t>=0,"Must not be negative")),zn=Er(xs(/^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/,"Use a #rgb or #rrggbb color")),fs=pn([Dt(Ko),zn]),ws=t=>ft({mix:oa([t,t]),amount:ke(qn(0),Wn(1),gn(Mr))}),hn=pn([fs,ws(fs)]),pm=pn([zn,ws(pn([Dt(["frame","accent","background"]),zn]))]),Le=pn([hn,ft({gradient:ft({from:hn,to:hn,direction:it(Dt(["horizontal","vertical"])),steps:it($s(qn(2),Wn(ot.maxGradientSteps)))})})]),aa=()=>({x:_t,y:_t,width:Mt,height:Mt}),Un=ft({color:hn,width:Mt}),gm=Ss("type",[ft({type:Ot("rect"),...aa(),radius:it(Ar),fill:Le,hole:it(ft({...aa(),radius:it(Ar)})),stroke:it(Un)}),ft({type:Ot("circle"),cx:_t,cy:_t,r:Mt,hole:it(Mt),fill:Le,stroke:it(Un)}),ft({type:Ot("ellipse"),cx:_t,cy:_t,rx:Mt,ry:Mt,fill:Le,stroke:it(Un)}),ft({type:Ot("polygon"),points:ra(oa([_t,_t]),3,ot.maxPolygonPoints),fill:Le,stroke:it(Un)}),ft({type:Ot("path"),d:Er(_s(2),sa(ot.maxPathLength)),fill:Le,fillRule:it(Dt(["nonzero","evenodd"])),stroke:it(Un)}),ft({type:Ot("line"),x1:_t,y1:_t,x2:_t,y2:_t,width:Mt,cap:it(Dt(["butt","round"])),dash:it(oa([Mt,Mt])),fill:Le}),ft({type:Ot("icon"),icon:Dt(Yo),x:_t,y:_t,size:Mt,fill:Le})]),hs=()=>({id:Er(xs(/^[a-z][a-z0-9-]{0,31}$/)),slot:Dt(["primary","secondary","fixed"]),text:Er(sa(200)),maxLength:it($s(qn(1),Wn(te))),color:hn,weight:it(Dt(["bold","regular"])),collapse:it(ft({y:_t,height:Mt}))}),bm=Ss("type",[ft({type:Ot("text"),...hs(),box:ft(aa()),align:it(Dt(["start","middle","end"])),fontSize:it(Mt)}),ft({type:Ot("curved"),...hs(),curve:ft({cx:_t,cy:_t,radius:Mt,side:Dt(["top","bottom"]),spread:it(ke(qn(20),Wn(300),gn(Mr)))}),fontSize:Mt})]),ps=ke(...Pr,gn(t=>t>=ot.minArtboard&&t<=ot.maxArtboard,`Artboard sides must be ${ot.minArtboard} to ${ot.maxArtboard} units`)),ym=ft({kind:Ot(Dn),version:Ot(Bn),artboard:ft({width:ps,height:ps}),qr:ft({x:_t,y:_t,size:Mt,padding:it(Ar),radius:it(Ar),plate:it(Dt(["opaque","background","none"]))}),colors:ft({frame:zn,text:it(pm),accent:it(zn)}),shapes:ra(gm,void 0,ot.maxShapes),labels:ra(bm,void 0,ot.maxLabels),bleed:it(pn([Ot("none"),hn]))},[{run(t){ds(t.value,(e,n=[])=>{t.issues.push({path:[...n],message:e,continue:true});});}}]);function vr(t){let e=ym.run(t);return e.issues.length===0?{success:true,data:e.value}:{success:false,issues:e.issues.map(({path:n,message:o})=>({path:n,message:o}))}}var Cs=({path:t,message:e})=>t.length>0?`${t.join(".")}: ${e}`:e;function K(t){if(t.length===0)return "";let[e,...n]=t;return `M${x(e[0])} ${x(e[1])}${n.map(([o,r])=>`L${x(o)} ${x(r)}`).join("")}Z`}function X(t,e,n){return `M${x(t-n)} ${x(e)}A${x(n)} ${x(n)} 0 1 1 ${x(t+n)} ${x(e)}A${x(n)} ${x(n)} 0 1 1 ${x(t-n)} ${x(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(u=>Math.max(0,Math.min(u,a))),m=(u,f,d)=>u>0?`A${x(u)} ${x(u)} 0 0 1 ${x(f)} ${x(d)}`:"";return `M${x(t+i)} ${x(e)}H${x(t+n-c)}${m(c,t+n,e+c)}V${x(e+o-s)}${m(s,t+n-s,e+o)}H${x(t+l)}${m(l,t,e+o-l)}V${x(e+i)}${m(i,t+i,e)}Z`}function bn(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 yn(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 Hn(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),m=Math.sin(s);return [t+n*Math.sign(l)*Math.abs(l)**(2/r),e+o*Math.sign(m)*Math.abs(m)**(2/r)]})}function _n(t,e,n){let o=n/2,r=(a,i)=>`${x(t+a*o)} ${x(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 Ms(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 Lr(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 Ie(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 ca=24,he=(t,e,n,o)=>{let r=o*Math.PI/180;return [t+n*Math.cos(r),e+n*Math.sin(r)]},Fr=([t,e])=>`${x(t)} ${x(e)}`;function xn(t,e,n,o,r,a){let i=a-r>180?1:0;return `M${Fr(he(t,e,o,r))}A${x(o)} ${x(o)} 0 ${i} 1 ${Fr(he(t,e,o,a))}L${Fr(he(t,e,n,a))}A${x(n)} ${x(n)} 0 ${i} 0 ${Fr(he(t,e,n,r))}Z`}function Vn(t,e,n,o){return `M${x(t-n)} ${x(e)}A${x(n)} ${x(o)} 0 1 1 ${x(t+n)} ${x(e)}A${x(n)} ${x(o)} 0 1 1 ${x(t-n)} ${x(e)}Z`}function _m(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 Rs(t){return K(_m(t)<0?[...t].reverse():t)}function kr(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 Rs([[t+i,e+c],[n+i,o+c],[n-i,o-c],[t-i,e-c]])}var Et=(...t)=>({d:t.join(""),fillRule:"nonzero"}),re=(...t)=>({d:t.join(""),fillRule:"evenodd"});function xm(){let t=[];for(let e of [0,60,120]){let[n,o]=he(12,12,10.5,e+180),[r,a]=he(12,12,10.5,e);t.push(kr(n,o,r,a,2));}for(let e=0;e<6;e++){let n=e*60,[o,r]=he(12,12,6.2,n);for(let a of [-45,45]){let[i,c]=he(o,r,3.6,n+a);t.push(kr(o,r,i,c,1.7));}}return Et(...t)}var $m={wifi:()=>Et(xn(12,20,4.6,7.2,-135,-45),xn(12,20,9.2,11.8,-135,-45),xn(12,20,13.8,16.4,-135,-45),X(12,20,2.2)),star:()=>Et(K(yn(12,12.8,11.6,4.8))),heart:()=>Et(_n(12,12.4,22)),phone:()=>re(D(6,1.5,12,21,2.6),D(7.8,4.2,8.4,13.4,.6),X(12,19.8,1.1)),headphones:()=>Et(xn(12,13,7.6,9.8,-180,0),D(2,12,5,9.5,2),D(17,12,5,9.5,2)),calendar:()=>re(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:()=>Et(X(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:()=>re(D(2,3,20,14,4),K([[6.5,17],[11.5,17],[5.8,21.8]]),X(7.5,10,1.5),X(12,10,1.5),X(16.5,10,1.5)),bag:()=>Et(D(3.5,7.5,17,14.5,2),xn(12,7.5,3.1,4.8,-180,0)),bell:()=>Et("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:()=>Et("M4 6.5H17V13.5A6.5 6.5 0 0 1 4 13.5Z",xn(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:()=>re(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:()=>re(X(12,12,10.5),K([[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:()=>re(X(12,12,10.5),X(12,7.2,1.6),D(10.6,10,2.8,8,.8)),home:()=>re(K([[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:()=>re("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",X(12,9.5,3)),share:()=>Et(kr(6,12,18,5,1.8),kr(6,12,18,19,1.8),X(18,5,3.2),X(6,12,3.2),X(18,19,3.2)),download:()=>Et(D(10.6,2,2.8,9.5,0),K([[6,10],[18,10],[12,16.5]]),K([[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:()=>re(X(12,12,10.5),X(12,12,8.4),K([[11,5.4],[13,5.4],[13,11.3],[16.9,13.5],[15.9,15.2],[11,12.5]])),snowflake:xm,pumpkin:()=>Et(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),Rs([[13,4.2],[17.2,3],[16.2,5.4],[13,6]])),tree:()=>Et(K([[12,1.5],[16.8,8.2],[7.2,8.2]]),K([[12,5.2],[19,13.6],[5,13.6]]),K([[12,9.4],[21.2,19.2],[2.8,19.2]]),D(10.4,18.6,3.2,3.9,.4)),sparkle:()=>Et(K(yn(9.5,13.5,9,2.4,4)),K(yn(19,5,4,1.1,4))),gift:()=>Et(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 la(t){return $m[t]()}var Sm={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 Es(t,e){let n=t.trim(),o=Number.parseFloat(n);return Number.isNaN(o)?Number.NaN:n.endsWith("%")?o/100*e:o}function lt(t){if(!t)return null;let e=t.trim().toLowerCase();if(e==="transparent")return {r:0,g:0,b:0,a:0};let n=Sm[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,m]=i.slice(0,3).map(d=>Es(d,255)),u=c===void 0?1:Es(c,1);if([s,l,m,u].some(d=>Number.isNaN(d)))return null;let f=(d,g)=>Math.min(Math.max(d,0),g);return {r:f(s,255),g:f(l,255),b:f(m,255),a:f(u,1)}}return null}function pe(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]:[j((1-o-i)/(1-i)),j((1-r-i)/(1-i)),j((1-a-i)/(1-i)),j(i)]}function As(t){return t===" "?.3:/[MWmw@%]/.test(t)?.92:/[A-Z0-9#&]/.test(t)?.72:/[il.,:;!'|1]/.test(t)?.32:.6}function ma(t){let e=0;for(let n of t)e+=As(n);return Math.max(e,1)}var ua=t=>Math.round(Math.min(255,Math.max(0,t))).toString(16).padStart(2,"0");function jn(t,e,n){let o=lt(t)??{r:0,g:0,b:0},r=lt(e)??{r:255,g:255,b:255},a=Math.min(1,Math.max(0,n));return `#${ua(o.r+(r.r-o.r)*a)}${ua(o.g+(r.g-o.g)*a)}${ua(o.b+(r.b-o.b)*a)}`}function Ps(t,e,n,o,r,a,i,c){let s=[...t],l=r*.08,m=s.map(h=>As(h)*r),u=m.reduce((h,p)=>h+p,0)+l*Math.max(0,s.length-1),f=a==="top"?o-r*.35:o+r*.35,d=[],g=0;return s.forEach((h,p)=>{let b=m[p],y=(g+b/2)/f;if(g+=b+l,h.trim()==="")return;let _=a==="top"?-Math.PI/2-u/2/f+y:Math.PI/2+u/2/f-y;d.push({text:h,x:e+f*Math.cos(_),y:n+f*Math.sin(_),fontSize:r,maxWidth:r*2,color:i,rotate:_*180/Math.PI+(a==="top"?90:-90),field:c});}),d}function yt(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 Xn=class extends Error{issues;constructor(e){super(`Invalid frame spec: ${e.slice(0,5).join("; ")}`),this.name="FrameSpecError",this.issues=e;}},vs=new WeakMap;function Te(t){if(t&&typeof t=="object"){let n=vs.get(t);if(n)return n}if(t==null)throw new Xn(['A "custom" frame needs a spec']);let e=vr(t);if(!e.success)throw new Xn(e.issues.map(Cs));return typeof t=="object"&&vs.set(t,e.data),e.data}function da(t){let e=Te(t);return fn(e)/e.qr.size}var wm=t=>{let e=lt(t);return !!(e&&e.a>=1)};function Cm(t,e){let n=yt(e,bt);return t.qr.plate==="none"?{color:n,plate:false}:wm(n)?{color:n,plate:true}:t.qr.plate==="background"?{color:n,plate:false}:{color:bt,plate:true}}function Ir(t,e,n=bt){let o=e.color||t.colors.frame,r=e.secondaryColor||t.colors.accent||o,a=s=>s==="frame"?o:s==="accent"?r:s==="background"?n:s,i=t.colors.text,c=e.textColor||(i===void 0?o:typeof i=="string"?i:jn(a(i.mix[0]),a(i.mix[1]),i.amount));return {frame:o,text:c,accent:r}}function Mm(t,e,n){let o=Ir(e,t,n),r=a=>{switch(a){case "frame":return o.frame;case "text":return o.text;case "accent":return o.accent;case "background":return n;default:return a}};return a=>typeof a=="string"?r(a):jn(r(a.mix[0]),r(a.mix[1]),a.amount)}function Ls(t,e,n=0,o=0){let r=On(t);return r?Wo(r,e,n,o):""}function Rm(t,e,n,o){return `M${x(t-n)} ${x(e)}A${x(n)} ${x(o)} 0 1 1 ${x(t+n)} ${x(e)}A${x(n)} ${x(o)} 0 1 1 ${x(t-n)} ${x(e)}Z`}function Em(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,m=-l*c,u=s*c,f=(p,b)=>{let y=[n+s*p,o+l*p],_=[n+s*b,o+l*b];if(t.cap==="round"&&b-p>2*c){let w=[y[0]+s*c,y[1]+l*c],C=[_[0]-s*c,_[1]-l*c];return `M${x(w[0]-m)} ${x(w[1]-u)}L${x(C[0]-m)} ${x(C[1]-u)}A${x(c)} ${x(c)} 0 0 1 ${x(C[0]+m)} ${x(C[1]+u)}L${x(w[0]+m)} ${x(w[1]+u)}A${x(c)} ${x(c)} 0 0 1 ${x(w[0]-m)} ${x(w[1]-u)}Z`}return `M${x(y[0]-m)} ${x(y[1]-u)}L${x(_[0]-m)} ${x(_[1]-u)}L${x(_[0]+m)} ${x(_[1]+u)}L${x(y[0]+m)} ${x(y[1]+u)}Z`};if(!t.dash)return {type:"path",d:f(0,i),fillRule:"nonzero"};let d=t.dash[0]*e,g=d+t.dash[1]*e,h=[];for(let p=0;p+d<=i+1e-6;p+=g)h.push(f(p,p+d));return {type:"path",d:h.join(""),fillRule:"nonzero"}}function Am(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:X(t.cx*e,t.cy*e,t.r*e)+(t.hole?X(t.cx*e,t.cy*e,t.hole*e):""),fillRule:t.hole?"evenodd":"nonzero"};case "ellipse":return {type:"path",d:Rm(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:Ls(t.d,e),fillRule:t.fillRule??"nonzero"};case "line":return Em(t,e);default:{let n=la(t.icon);return {type:"path",d:Ls(n.d,t.size*e/ca,t.x*e,t.y*e),fillRule:n.fillRule}}}}function Pm(t){if(t.type==="rect"){let{x:e,y:n,width:o,height:r,radius:a,hole:i}=t;return [...Zt(e,n,o,r,a,a),...i?Zt(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"}]:ee(t.d)}function vm(t,e,n){let o=Pm(t),r=wr(o,.2),a=t.type==="rect"?t.hole?"evenodd":"nonzero":t.type==="path"?t.fillRule??"nonzero":"nonzero",i=e.direction==="vertical",c=p=>i?p[1]:p[0],s=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY;for(let p of r)for(let b of p)s=Math.min(s,c(b)),l=Math.max(l,c(b));if(!(l>s))return [];let m=e.steps??32,u=n(e.from),f=n(e.to),d=l-s,g=d*.002,h=[];for(let p=0;p<m;p++){let b=s+d*p/m,y=Math.min(l,s+d*(p+1)/m+(p+1<m?g:0)),_=i?{x0:Number.NEGATIVE_INFINITY,x1:Number.POSITIVE_INFINITY,y0:b,y1:y}:{x0:b,x1:y,y0:Number.NEGATIVE_INFINITY,y1:Number.POSITIVE_INFINITY},w=r.map(C=>cn(C,_)).filter(C=>C.length>2);w.length!==0&&h.push({type:"path",d:is(w),fill:jn(u,f,(p+.5)/m),fillRule:a});}return h}function Lm(t,e,n){let o=Am(t,e),r="stroke"in t&&t.stroke?{stroke:n(t.stroke.color),strokeWidth:t.stroke.width*e}:void 0;if(typeof t.fill=="object"&&"gradient"in t.fill){let a=vm(o,t.fill.gradient,n);return r?[...a,{...o,fill:"none",...r}]:a}return [{...o,fill:n(t.fill),...r}]}function Fm(t,e){let n=Math.min(t.maxLength??ot.maxTextLength,ot.maxTextLength),o=t.slot==="primary"?e.text??t.text:t.slot==="secondary"?e.secondaryText??t.text:t.text;return dn(o,n)}function km(t){return t===void 0||!Number.isFinite(t)?1:Math.min(sn,Math.max(Nn,t))}function Im(t,e,n,o,r,a){let i=r(t.color),c=t.weight==="regular"?{fontWeight:400}:{};if(t.type==="curved"){let{cx:h,cy:p,radius:b,side:y,spread:_=140}=t.curve,w=b*o*(_*Math.PI/180),C=Math.min(t.fontSize*o*n,w/(ma(e)+.08*e.length));return Ps(e,h*o,p*o,b*o,C,y,i,a).map(S=>({...S,...c}))}let s=t.box.x*o,l=t.box.y*o,m=t.box.width*o,u=t.box.height*o;if(!(u>0))return [];let f=(t.fontSize??t.box.height*Jo)*o,d=Math.min(f*n,u*Gn,m/ma(e)),g=t.align??"middle";return [{text:e,x:g==="start"?s:g==="end"?s+m:s+m/2,y:l+u/2+d*.35,fontSize:d,maxWidth:m,color:i,...g!=="middle"&&{align:g},...c,field:a}]}function Tm(t){let e=0,n=0,o=0,r=0;return t.map(({command:a,values:i})=>{let c=a.toUpperCase(),s=a!==c;switch(c){case "Z":return e=o,n=r,{command:"Z",values:[]};case "H":return e=(s?e:0)+i[0],{command:"H",values:[e]};case "V":return n=(s?n:0)+i[0],{command:"V",values:[n]};case "A":return e=(s?e:0)+i[5],n=(s?n:0)+i[6],{command:"A",values:[...i.slice(0,5),e,n]};default:{let l=i.map((m,u)=>s?m+(u%2===0?e:n):m);return e=l.at(-2),n=l.at(-1),c==="M"&&(o=e,r=n),{command:c,values:l}}}})}function Nm(t,e){let n=On(t);return n?Wo(Tm(n).map(({command:o,values:r})=>o==="V"?{command:o,values:[e(r[0])]}:o==="H"||o==="Z"?{command:o,values:r}:o==="A"?{command:o,values:[...r.slice(0,6),e(r[6])]}:{command:o,values:r.map((a,i)=>i%2===1?e(a):a)})):t}function Om(t,e){let n=(o,r)=>{let a=e(o);return {y:a,height:e(o+r)-a}};switch(t.type){case "rect":return {...t,...n(t.y,t.height),...t.hole&&{hole:{...t.hole,...n(t.hole.y,t.hole.height)}}};case "circle":case "ellipse":return {...t,cy:e(t.cy)};case "polygon":return {...t,points:t.points.map(([o,r])=>[o,e(r)])};case "path":return {...t,d:Nm(t.d,e)};case "line":return {...t,y1:e(t.y1),y2:e(t.y2)};default:return {...t,y:e(t.y)}}}function Dm(t,e){if(e.length===0)return t;let n=r=>{let a=r;for(let i of e)a-=Math.min(Math.max(r-i.y,0),i.height);return a},o=(r,a)=>e.some(i=>r>=i.y-1e-6&&a<=i.y+i.height+1e-6);return {...t,artboard:{...t.artboard,height:n(t.artboard.height)},qr:{...t.qr,y:n(t.qr.y)},shapes:t.shapes.filter(r=>{let{bounds:a}=ta(r);return !(a&&o(a.y0,a.y1))}).map(r=>Om(r,n)),labels:t.labels.map(r=>{if(r.type==="curved")return {...r,curve:{...r.curve,cy:n(r.curve.cy)}};let a=n(r.box.y);return {...r,box:{...r.box,y:a,height:n(r.box.y+r.box.height)-a}}})}}function Zn(t,e,n,o,r={}){let a=new Map(e.labels.map(p=>[p.id,Fm(p,n)])),i=Dm(e,e.labels.flatMap(p=>p.collapse&&!a.get(p.id)?[p.collapse]:[])),c=t/i.qr.size,s=Cm(i,o),l=Mm(n,i,s.color),m=i.shapes.flatMap(p=>Lm(p,c,l));if(s.plate){let p=fn(i)*c;m.push({type:"rect",x:i.qr.x*c-p,y:i.qr.y*c-p,width:t+2*p,height:t+2*p,radius:(i.qr.radius??0)*c,fill:s.color});}let u=km(n.fontScale),f=i.labels.flatMap(p=>{let b=a.get(p.id);if(!b)return [];let y=(p.slot==="fixed"?void 0:r[p.slot])??p.id;return Im(p,b,u,c,l,y)}),d=f[0],g=d&&d.rotate===void 0?d:null,h=i.bleed??"none";return {width:i.artboard.width*c,height:i.artboard.height*c,qrX:i.qr.x*c,qrY:i.qr.y*c,qrSize:t,shapes:m,label:g,extraLabels:g?f.slice(1):f,squareEdges:h!=="none",color:l(h==="none"?"frame":h)}}function fa(t,e,n){return Zn(t,Te(e.spec),e,n)}var Fs={kind:"qrdx.frame",version:1,artboard:{width:1600,height:1470},qr:{x:300,y:120,size:1e3,padding:70,radius:10,plate:"background"},colors:{frame:"#000000",text:"#FFFFFF"},shapes:[{type:"polygon",points:[[0,1250],[190,1250],[190,1470],[0,1470],[50.4,1360]],fill:{mix:["frame","#000000"],amount:.28}},{type:"polygon",points:[[1600,1250],[1549.6,1360],[1600,1470],[1410,1470],[1410,1250]],fill:{mix:["frame","#000000"],amount:.28}},{type:"polygon",points:[[90,1420],[170,1470],[90,1470]],fill:{mix:["frame","#000000"],amount:.5}},{type:"polygon",points:[[1510,1420],[1510,1470],[1430,1470]],fill:{mix:["frame","#000000"],amount:.5}},{type:"rect",x:220,y:40,width:1160,height:1160,radius:20,fill:"background"},{type:"rect",x:180,y:0,width:1240,height:1240,radius:60,fill:"frame",hole:{x:220,y:40,width:1160,height:1160,radius:20}},{type:"rect",x:90,y:1200,width:1420,height:220,fill:"frame"}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:170,y:1200,width:1260,height:220}}]};var ha={kind:"qrdx.frame",version:1,artboard:{width:1240,height:1420},qr:{x:120,y:120,size:1e3,padding:70,plate:"background"},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 ks={kind:"qrdx.frame",version:1,artboard:{width:1240,height:1420},qr:{x:120,y:300,size:1e3,padding:70,plate:"background"},colors:{frame:"#000000",text:"#FFFFFF"},shapes:[{type:"rect",x:40,y:220,width:1160,height:1160,fill:"background"},{type:"rect",x:0,y:0,width:1240,height:1420,fill:"frame",hole:{x:40,y:220,width:1160,height:1160}}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:120,y:0,width:1e3,height:220}}],bleed:"frame"};var Is={kind:"qrdx.frame",version:1,artboard:{width:1240,height:1600},qr:{x:120,y:300,size:1e3,padding:70,plate:"background"},colors:{frame:"#000000",text:"#FFFFFF"},shapes:[{type:"rect",x:40,y:220,width:1160,height:1160,fill:"background"},{type:"rect",x:0,y:0,width:1240,height:1600,fill:"frame",hole:{x:40,y:220,width:1160,height:1160}}],labels:[{type:"text",id:"top",slot:"primary",text:"Scan me",color:"text",box:{x:120,y:0,width:1e3,height:220}},{type:"text",id:"bottom",slot:"secondary",text:"",color:"text",box:{x:120,y:1380,width:1e3,height:220}}],bleed:"frame"};var Ts={kind:"qrdx.frame",version:1,artboard:{width:1240,height:1340},qr:{x:120,y:120,size:1e3,padding:40,plate:"background"},colors:{frame:"#000000"},shapes:[{type:"rect",x:40,y:40,width:1160,height:1260,fill:"background"},{type:"rect",x:0,y:0,width:1240,height:1340,fill:"frame",hole:{x:40,y:40,width:1160,height:1260}}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:120,y:1120,width:1e3,height:180},collapse:{y:1200,height:100}}],bleed:"frame"};var Ns={kind:"qrdx.frame",version:1,artboard:{width:1240,height:1530},qr:{x:120,y:120,size:1e3,padding:80,radius:80},colors:{frame:"#000000",text:"#FFFFFF"},shapes:[{type:"rect",x:0,y:0,width:1240,height:1400,radius:120,fill:"frame"},{type:"path",d:"M161.2 1380L62 1530Q198.4 1458.5 396.8 1380Z",fill:"frame"}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:120,y:1200,width:1e3,height:200},collapse:{y:1220,height:160}}]};var Os={kind:"qrdx.frame",version:1,artboard:{width:1978.214,height:1978.214},qr:{x:489.107,y:489.107,size:1e3,padding:50,plate:"background"},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 Ds={kind:"qrdx.frame",version:1,artboard:{width:1320,height:1558},qr:{x:160,y:130,size:1e3,padding:60},colors:{frame:"#000000",text:"#FFFFFF"},shapes:[{type:"rect",x:0,y:370,width:1320,height:1188,fill:{mix:["frame","#FFFFFF"],amount:.45}},{type:"polygon",points:[[0,370],[660,0],[1320,370]],fill:{mix:["frame","#FFFFFF"],amount:.25}},{type:"rect",x:80,y:50,width:1160,height:1268,fill:"background"},{type:"rect",x:68,y:38,width:1184,height:1280,fill:"frame",hole:{x:80,y:50,width:1160,height:1268}},{type:"polygon",points:[[0,1178],[660,1318],[1320,1178],[1320,1558],[0,1558]],fill:"frame"}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:160,y:1318,width:1e3,height:220}}]};var Bs={kind:"qrdx.frame",version:1,artboard:{width:1230,height:1430},qr:{x:115,y:115,size:1e3,padding:70,plate:"background"},colors:{frame:"#000000"},shapes:[{type:"rect",x:0,y:0,width:1230,height:1430,fill:"background"},{type:"polygon",points:[[0,0],[200,0],[200,35],[35,35],[35,200],[0,200]],fill:"frame"},{type:"polygon",points:[[1230,0],[1030,0],[1030,35],[1195,35],[1195,200],[1230,200]],fill:"frame"},{type:"polygon",points:[[1230,1230],[1030,1230],[1030,1195],[1195,1195],[1195,1030],[1230,1030]],fill:"frame"},{type:"polygon",points:[[0,1230],[200,1230],[200,1195],[35,1195],[35,1030],[0,1030]],fill:"frame"}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:80,y:1210,width:1070,height:200},collapse:{y:1230,height:200}}]};var Tr={kind:"qrdx.frame",version:1,artboard:{width:1260,height:1360},qr:{x:130,y:130,size:1e3,padding:40,plate:"background"},colors:{frame:"#7c3aed",text:{mix:["frame","accent"],amount:.5},accent:"#db2777"},shapes:[{type:"rect",x:50,y:50,width:1160,height:1260,radius:50,fill:"background"},{type:"rect",x:0,y:0,width:1260,height:1360,radius:100,fill:{gradient:{from:"frame",to:"accent",direction:"horizontal",steps:48}},hole:{x:50,y:50,width:1160,height:1260,radius:50}}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:130,y:1130,width:1e3,height:180},collapse:{y:1210,height:100}}]};var Qs={kind:"qrdx.frame",version:1,artboard:{width:1260,height:1460},qr:{x:130,y:260,size:1e3,padding:46,plate:"background"},colors:{frame:"#000000"},shapes:[{type:"rect",x:0,y:0,width:1260,height:1460,radius:30,fill:"background"},{type:"rect",x:0,y:0,width:1260,height:1460,radius:30,fill:"frame",hole:{x:22,y:22,width:1216,height:1416,radius:8}},{type:"rect",x:45,y:45,width:1170,height:1370,fill:"frame",hole:{x:53,y:53,width:1154,height:1354}},{type:"rect",x:378,y:181,width:504,height:8,fill:"frame"},{type:"polygon",points:[[630,163],[652,185],[630,207],[608,185]],fill:"frame"}],labels:[{type:"text",id:"title",slot:"primary",text:"Scan me",color:"text",box:{x:130,y:30,width:1e3,height:170},collapse:{y:84,height:130}},{type:"text",id:"footer",slot:"secondary",text:"",color:"text",box:{x:130,y:1270,width:1e3,height:160},collapse:{y:1306,height:70}}]};var Gs={kind:"qrdx.frame",version:1,artboard:{width:1260,height:1610},qr:{x:130,y:250,size:1e3,padding:75,radius:55},colors:{frame:"#000000"},shapes:[{type:"rect",x:0,y:0,width:1260,height:1610,radius:170,fill:"frame"},{type:"rect",x:50,y:170,width:1160,height:1290,radius:60,fill:"background"},{type:"rect",x:520,y:67,width:220,height:36,radius:18,fill:"background"},{type:"rect",x:480,y:1520,width:300,height:30,radius:15,fill:"background"}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:130,y:1290,width:1e3,height:170},collapse:{y:1330,height:130}}]};var Us={kind:"qrdx.frame",version:1,artboard:{width:1325,height:1555},qr:{x:150,y:150,size:1e3,padding:80},colors:{frame:"#000000",text:"#FFFFFF"},shapes:[{type:"rect",x:25,y:25,width:1300,height:1530,radius:15,fill:{mix:["frame","#FFFFFF"],amount:.72}},{type:"rect",x:0,y:0,width:1300,height:1530,radius:15,fill:"frame"}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:150,y:1260,width:1e3,height:240}}]};var zs={kind:"qrdx.frame",version:1,artboard:{width:1240,height:1340},qr:{x:120,y:120,size:1e3,padding:40,plate:"background"},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:1120,width:1e3,height:180},collapse:{y:1200,height:100}}]};var qs={kind:"qrdx.frame",version:1,artboard:{width:1240,height:1565},qr:{x:120,y:120,size:1e3,padding:70,radius:20,plate:"background"},colors:{frame:"#000000",text:"#FFFFFF"},shapes:[{type:"rect",x:40,y:40,width:1160,height:1160,radius:30,fill:"background"},{type:"rect",x:0,y:0,width:1240,height:1240,radius:70,fill:"frame",hole:{x:40,y:40,width:1160,height:1160,radius:30}},{type:"polygon",points:[[540,1385],[620,1265],[700,1385]],fill:"frame"},{type:"rect",x:0,y:1345,width:1240,height:220,radius:110,fill:"frame"}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:120,y:1345,width:1e3,height:220}}]};var Ws={kind:"qrdx.frame",version:1,artboard:{width:1240,height:1565},qr:{x:120,y:445,size:1e3,padding:70,radius:20,plate:"background"},colors:{frame:"#000000",text:"#FFFFFF"},shapes:[{type:"rect",x:0,y:0,width:1240,height:220,radius:110,fill:"frame"},{type:"polygon",points:[[540,180],[700,180],[620,300]],fill:"frame"},{type:"rect",x:40,y:365,width:1160,height:1160,radius:30,fill:"background"},{type:"rect",x:0,y:325,width:1240,height:1240,radius:70,fill:"frame",hole:{x:40,y:365,width:1160,height:1160,radius:30}}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:120,y:0,width:1e3,height:220}}]};var Hs={kind:"qrdx.frame",version:1,artboard:{width:1420,height:1590},qr:{x:195,y:195,size:1e3,padding:80},colors:{frame:"#000000",text:"#FFFFFF"},shapes:[{type:"rect",x:30,y:30,width:1390,height:1560,radius:155,fill:{mix:["frame","#FFFFFF"],amount:.7}},{type:"rect",x:0,y:0,width:1390,height:1560,radius:155,fill:"#FFFFFF"},{type:"rect",x:25,y:25,width:1340,height:1510,radius:130,fill:"frame"},{type:"rect",x:95,y:95,width:1200,height:1200,radius:40,fill:"background"}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:175,y:1295,width:1040,height:240},collapse:{y:1365,height:170}}]};var Vs={kind:"qrdx.frame",version:1,artboard:{width:1280,height:1620},qr:{x:140,y:320,size:1e3,padding:80,radius:20},colors:{frame:"#000000",text:"#FFFFFF"},shapes:[{type:"path",d:"M140 0H1140L1280 140V1580A40 40 0 0 1 1240 1620H40A40 40 0 0 1 0 1580V140ZM600 115.2A40 40 0 1 1 680 115.2A40 40 0 1 1 600 115.2Z",fill:"frame",fillRule:"evenodd"},{type:"path",d:"M572 115.2A68 68 0 1 1 708 115.2A68 68 0 1 1 572 115.2ZM600 115.2A40 40 0 1 1 680 115.2A40 40 0 1 1 600 115.2Z",fill:{mix:["frame","#FFFFFF"],amount:.35},fillRule:"evenodd"}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:140,y:1400,width:1e3,height:220},collapse:{y:1420,height:160}}]};var js={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 xt=(t,e,n,o,r)=>({style:t,name:e,tags:r,labelOn:o,spec:n}),pa=[xt("banner-bottom","Banner",ha,"frame",["bottom","band"]),xt("banner-top","Top banner",ks,"frame",["top","band"]),xt("banner-top-bottom","Two banners",Is,"frame",["top","bottom","band"]),xt("border","Border",Ts,"background",["square","outline"]),xt("rounded-border","Rounded",zs,"background",["border","outline"]),xt("gradient-border","Gradient",Tr,"background",["border","colorful"]),xt("focus","Focus",Bs,"background",["corners","brackets"]),xt("speech-bubble","Bubble",qs,"frame",["speech"]),xt("speech-bubble-top","Bubble top",Ws,"frame",["speech"]),xt("chat-bubble","Chat",Ns,"frame",["message","bubble"]),xt("circle","Circle",Os,"frame",["round","ring","curved"]),xt("badge","Ribbon",Fs,"frame",["badge","banner"]),xt("sticker","Sticker",Hs,"frame",["label"]),xt("polaroid","Polaroid",Us,"frame",["photo","picture"]),xt("phone","Phone",Gs,"background",["mobile","screen"]),xt("ticket","Ticket",js,"frame",["event","pass"]),xt("tag","Tag",Vs,"frame",["price","label"]),xt("envelope","Envelope",Ds,"frame",["mail","letter"]),xt("menu-card","Menu card",Qs,"background",["menu","restaurant"])],o1=new Map(pa.map(t=>[t.style,t]));function ga(t){return o1.get(t)}var a1=Object.fromEntries(pa.map(t=>[t.style,t.spec])),i1={from:Tr.colors.frame,to:Tr.colors.accent};function Nr(t){return !t||t.style==="none"?null:t.style===Qn?t.spec??null:ga(t.style)?.spec??null}function s1(t){let e=Nr(t);return t&&typeof e?.colors?.frame=="string"?Ir(e,t):null}var c1={primary:"text",secondary:"secondaryText"};function Xs(t,e,n){let o=ga(e.style)?.spec??ha;return Zn(t,Te(o),e,n,c1)}var Dr="system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif",Ys=.08,Ks="data-qrdx-frame-label";function It(t){return !!(t?.style&&t.style!=="none")}function ba(t){let e=Nr(t);return e?da(e):Ys}function l1(t){return (t.text??Oo).trim().slice(0,te)}function u1(t){return (t.secondaryText??"").trim().slice(0,te)}function Ne(t,e,n){return e.style===Qn?fa(t,e,n):Xs(t,e,n)}function oe(t,e){if(!It(e))return {width:t,height:t};let{width:n,height:o}=Ne(t,e);return {width:n,height:o}}var tt=t=>j(t,2);function Zs({x:t,y:e,width:n,height:o,radius:r}){let a=tt(Math.min(r,n/2,o/2)),[i,c,s,l]=[tt(t),tt(e),tt(n),tt(o)];return a<=0?A`M${i} ${c}h${s}v${l}h${-s}z`:A`M${i+a} ${c}h${tt(s-2*a)}a${a} ${a} 0 0 1 ${a} ${a}`+A`v${tt(l-2*a)}a${a} ${a} 0 0 1 ${-a} ${a}`+A`h${tt(-(s-2*a))}a${a} ${a} 0 0 1 ${-a} ${-a}`+A`v${tt(-(l-2*a))}a${a} ${a} 0 0 1 ${a} ${-a}z`}function Or(t){return t.stroke&&t.strokeWidth?{stroke:t.stroke,strokeWidth:tt(t.strokeWidth)}:{}}function Js(t,e){return t.type==="rect"&&t.hole?v("path",{d:Zs(t)+Zs(t.hole),fill:t.fill,fillRule:"evenodd",...Or(t)},e):t.type==="polygon"?v("polygon",{fill:t.fill,points:t.points.map(([n,o])=>`${tt(n)},${tt(o)}`).join(" "),...Or(t)},e):t.type==="path"?v("path",{d:t.d,fill:t.fill,...t.fillRule==="evenodd"&&{fillRule:"evenodd"},...Or(t)},e):yr("rect",{...Or(t),fill:t.fill,height:tt(t.height),key:e,width:tt(t.width),x:tt(t.x),y:tt(t.y),...t.radius>0&&{rx:tt(t.radius),ry:tt(t.radius)}})}function tc(t){return t.shapes.map((e,n)=>Js(e,n))}function Br(t,e){let{size:n,frame:o,bgColor:r,svgProps:a,markLabels:i}=e,c=Ne(n,o,r),s=ec(c),l=tt(c.width),m=tt(c.height);return St("svg",{height:m,viewBox:`0 0 ${l} ${m}`,width:l,xmlns:"http://www.w3.org/2000/svg",...a,children:[v("g",{"data-qrdx-frame":o.style,children:c.shapes.map((u,f)=>Js(u,f))}),rn(t,{x:tt(c.qrX),y:tt(c.qrY),width:n,height:n}),s.map((u,f)=>v("text",{"data-max-width":tt(u.maxWidth),fill:u.color,fontFamily:Dr,fontSize:tt(u.fontSize),fontWeight:u.fontWeight??700,textAnchor:u.align??"middle",x:tt(u.x),y:tt(u.y),...u.rotate&&{transform:`rotate(${tt(u.rotate)} ${tt(u.x)} ${tt(u.y)})`},...i&&u.field&&{[Ks]:u.field},children:u.text},f))]})}function ec(t){return [...t.label?[t.label]:[],...t.extraLabels??[]]}var Qr=.22,Gr=.14;function nc(t,e,n={}){if(t==="circle")return v("circle",{cx:x(e.x+e.w/2),cy:x(e.y+e.h/2),r:x(Math.min(e.w,e.h)/2),...n});let o=t==="rounded"?Math.min(e.w,e.h)*Qr:0;return v("rect",{height:x(e.h),width:x(e.w),x:x(e.x),y:x(e.y),...o>0&&{rx:x(o),ry:x(o)},...n})}function m1(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 Ur(t,e){let n=t.shape??"square",o=t.plate,r=o?m1(e,Gr):e,a=c=>v("image",{height:x(r.h),href:t.src,preserveAspectRatio:"none",width:x(r.w),x:x(r.x),y:x(r.y),...c&&{clipPath:`url(#${c})`}});if(n==="square"&&!o)return a();let i=n==="square"?void 0:`qrdx-logo-${Ie(`${n}|${x(r.x)}|${x(r.y)}|${x(r.w)}|${x(r.h)}`)}`;return St("g",{children:[o&&nc(n,e,{fill:o}),i&&v("clipPath",{id:i,children:nc(n,r)}),a(i)]})}var{QrCode:ya}=gt,d1={"1L":3,"1M":2,"1Q":1,"1H":1,"2L":2,"3L":1};function f1(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 m=-2;m<=2;m++)for(let u=-2;u<=2;u++)o(c+u,l+m);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 h1(t,e){let n=t*4+17,o=Rt[e].ordinal,r=ya.NUM_ERROR_CORRECTION_BLOCKS[o]?.[t]??0,a=ya.ECC_CODEWORDS_PER_BLOCK[o]?.[t]??0,i=Math.floor(ya.getNumRawDataModules(t)/8),c=r-i%r,s=Math.floor(i/r),l=Array.from({length:r},(w,C)=>s+(C<c?0:1)),m=[],u=[],f=s-a;for(let w=0;w<=s;w++)for(let C=0;C<r;C++)if(C<c){if(w===f)continue;m.push(C),u.push(w<f?w:w-1);}else m.push(C),u.push(w);if(m.length!==i)throw new Error(`Codeword map: interleave mismatch at version ${t}`);let d=f1(t),g=new Int16Array(n*n).fill(-1),h=new Int16Array(n*n).fill(-1),p=new Int8Array(n*n).fill(-1),b=i*8,y=0;for(let w=n-1;w>=1;w-=2){w===6&&(w=5);let C=(w+1&2)===0;for(let S=0;S<n;S++)for(let $=0;$<2;$++){let M=w-$,E=(C?n-1-S:S)*n+M;if(!d[E]&&y<b){let P=y>>>3;g[E]=m[P],h[E]=u[P],p[E]=7-(y&7),y++;}}}if(y!==b)throw new Error(`Codeword map: placement mismatch at version ${t}`);let _=d1[`${t}${e}`]??0;return {version:t,level:e,size:n,blocks:r,eccPerBlock:a,blockLengths:l,correctable:Math.floor((a-_)/2),block:g,codeword:h,bit:p}}var p1=8,Oe=new Map;function Yn(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=Oe.get(n);if(o)return Oe.delete(n),Oe.set(n,o),o;let r=h1(t,e);if(Oe.size>=p1){let a=Oe.keys().next().value;a!==void 0&&Oe.delete(a);}return Oe.set(n,r),r}function Kn(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 g1={2:6,3:12};function rc(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=g1[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,m]=o;e.push([s*s*s*n[0]+3*s*s*c*l[0]+3*s*c*c*m[0]+c*c*c*r[0],s*s*s*n[1]+3*s*s*c*l[1]+3*s*c*c*m[1]+c*c*c*r[1]]);}}}n=r;}return e}function ac(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 ic(t,e){let n=0;for(let o of t)if(o<e)n++;else break;return n%2===1}function b1(t,e,n){return ic(ac(t,n),e)}function sc(t){let e=new Map;return (n,o)=>{let r=e.get(o);return r||(r=ac(t,o),e.set(o,r)),ic(r,n)}}function y1(t,e,n,o){let r=n[0]-t,a=n[1]-e,i=o[0]-n[0],c=o[1]-n[1],s=m=>Math.max(Math.abs(r+m*i),Math.abs(a+m*c)),l=Math.min(s(0),s(1));for(let[m,u]of [[a-r,i-c],[-(r+a),i+c]])if(u!==0){let f=m/u;f>0&&f<1&&(l=Math.min(l,s(f)));}return l}function _1(t,e,n){if(!b1(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,y1(e,n,r[a],r[(a+1)%r.length]));return Number.isFinite(o)?o:0}function x1(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(rc),n=x1(e),o=n.x1-n.x0,r=n.y1-n.y0;if(!(o>0&&r>0))return null;let a=(g,h)=>{let p=Math.max(g-n.x0,n.x1-g,h-n.y0,n.y1-h);return p>0?_1(e,g,h)/(2*p):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 g=1;g<c;g++)for(let h=1;h<c;h++){let p=n.x0+o*h/c,b=n.y0+r*g/c,y=a(p,b);y>i.value&&(i={cx:p,cy:b,value:y});}let s=o/c,l=r/c;for(let g=0;g<6;g++){let h=i;for(let p=-2;p<=2;p++)for(let b=-2;b<=2;b++){let y=h.cx+s*b/2,_=h.cy+l*p/2,w=a(y,_);w>i.value&&(i={cx:y,cy:_,value:w});}s/=2,l/=2;}if(i.value<=0)return null;let u=.5/Math.max(i.cx-n.x0,n.x1-i.cx,i.cy-n.y0,n.y1-i.cy),f=([g,h])=>[.5+(g-i.cx)*u,.5+(h-i.cy)*u],d=t.map(g=>({start:f(g.start),segments:g.segments.map(h=>h.map(f))}));return {rings:d,polygons:d.map(rc),half:i.value}}function lc(t,e){let n=([r,a])=>`${x(r*e)} ${x(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}var $1={start:[0,-0.58],segments:[[[.2,-0.92],[1,-0.97],[1,-0.3]],[[1,.3],[.62,.6],[0,.92]],[[-0.62,.6],[-1,.3],[-1,-0.3]],[[-1,-0.97],[-0.2,-0.92],[0,-0.58]]]},oc;function uc(){return oc??=cc([$1]),oc}function S1(t){let{width:e,height:n,cells:o}=t;return Number.isInteger(e)&&Number.isInteger(n)&&e>=me&&n>=me&&e<=Pe&&n<=Pe&&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}var ae=([t,e])=>`${t},${e}`;function w1(t,e,n){let o=(s,l)=>t(s-1,l-1),r=new Map,a=(s,l)=>{for(let[m,u]of [[s,l],[l,s]]){let f=r.get(ae(m))??[];f.push(u),r.set(ae(m),f);}};for(let s=0;s<=n;s++)for(let l=0;l<=e;l++){let m=o(l,s),u=o(l+1,s),f=o(l+1,s+1),d=o(l,s+1),g=[l,s-.5],h=[l+.5,s],p=[l,s+.5],b=[l-.5,s];switch((m?8:0)+(u?4:0)+(f?2:0)+(d?1:0)){case 1:case 14:a(b,p);break;case 2:case 13:a(p,h);break;case 3:case 12:a(b,h);break;case 4:case 11:a(g,h);break;case 6:case 9:a(g,p);break;case 7:case 8:a(b,g);break;case 5:a(g,h),a(b,p);break;case 10:a(b,g),a(p,h);break;}}let i=[],c=new Set;for(let[s,l]of r){if(c.has(s)||l.length===0)continue;let[m,u]=s.split(",").map(Number),f=[[m,u]];c.add(s);let d=[m,u],g=l[0];for(;!c.has(ae(g));){c.add(ae(g)),f.push(g);let h=C1(r.get(ae(g))??[],d,c);if(!h)break;d=g,g=h;}f.length>=3&&i.push(M1(f));}return i}function C1(t,e,n){let o=ae(e);return t.find(r=>ae(r)!==o&&!n.has(ae(r)))??t.find(r=>ae(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 R1(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}}var Jn=new Map;function _a(t){let e=`${t.width}x${t.height}:${t.cells}`,n=Jn.get(e);if(n)return n;let o=S1(t),r;if(!o)r={outline:null,problem:"invalid"};else if(t.cells.includes("1")){let a=w1(o,t.width,t.height),i=a.length>0?cc(a.map(R1)):null;r=i&&2*i.half>=zo?{outline:i,problem:null}:{outline:null,problem:i?"thin":"empty"};}else r={outline:null,problem:"empty"};return Jn.size>16&&Jn.delete(Jn.keys().next().value),Jn.set(e,r),r}var E1=1,mc=.5,dc=.5,A1=.5;function De(t){return Math.max(t,Uo)}function zr(t){return t==="heart"?uc():typeof t=="object"&&t?.type==="silhouette"?_a(t).outline:null}function xa(t){return t==="circle"||zr(t)!==null}var 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."};function v1(t){let{outline:e,problem:n}=_a(t);if(e&&!n)return {ok:true,share:2*e.half};let o=n??"invalid";return {ok:false,reason:o,message:P1[o]}}function At(t,e,n){if(n==="circle"){let i=De(e),c=(t/2+i)*Math.SQRT2+E1;return Math.ceil(c-t/2)}let o=zr(n);if(!o)return e;let r=De(e),a=(t+2*(r+A1))/(2*o.half);return Math.ceil((a-t)/2-1e-9)}function fc(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=At(e,n,"circle"),r=De(n),a=e+2*o,i=a/2,c=i-mc-.5,s=fc(Number.parseInt(Ie(t),36)||1),l=o-r,m=o+e+r;return Array.from({length:a},(u,f)=>Array.from({length:a},(d,g)=>{let h=s()<dc;return g>=l&&g<m&&f>=l&&f<m?false:h&&Math.hypot(g+.5-i,f+.5-i)<=c}))}var F1=Array.from({length:8},(t,e)=>{let n=e*Math.PI/4;return [Math.cos(n),Math.sin(n)]});function hc(t,e,n,o){if(o==="circle")return L1(t,e,n);let r=zr(o);if(!r)return null;let a=At(e,n,o),i=De(n),c=e+2*a,s=sc(r.polygons),l=.5+mc,m=(g,h)=>{let p=g+.5,b=h+.5;return s(p/c,b/c)?F1.every(([y,_])=>s((p+y*l)/c,(b+_*l)/c)):false},u=fc(Number.parseInt(Ie(t),36)||1),f=a-i,d=a+e+i;return Array.from({length:c},(g,h)=>Array.from({length:c},(p,b)=>{let y=u()<dc;return b>=f&&b<d&&h>=f&&h<d?false:y&&m(b,h)}))}function $a(t,e){if(t==="circle")return {circle:e/2};let n=zr(t);return n?{path:lc(n,e)}:null}function k1(t,e){let n=$a(t,e);return n?"circle"in n?X(e/2,e/2,n.circle):n.path:null}function Bt(t,e="#000000"){return t?typeof t=="string"?{type:"solid",color:t}:t:{type:"solid",color:e}}function $n(t){return !t||typeof t=="string"?false:t.type==="linear"||t.type==="radial"||t.type==="angular"}function Sa(t){return typeof t=="object"&&t!==null&&t.type==="image"}function I1(t,e="#000000"){let n=Bt(t,e);return n.type==="solid"?n.color:n.type==="image"?n.underlay||e:n.stops[0]?.color||e}function pc(t="center"){let[e,n]=t.split("-");return t==="center"?"center":n?`${n} ${e}`:e==="top"||e==="bottom"?`center ${e}`:`${e} center`}function T1(t){if(!t)return "#000000";if(typeof t=="string")return t;let e=Bt(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")}")`} ${pc(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 Pt=t=>t/255,tr=(t,e)=>(t[0]-e[0])**2+(t[1]-e[1])**2+(t[2]-e[2])**2,Z=t=>.2126*t[0]+.7152*t[1]+.0722*t[2];function wa(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:[Pt(o[c]),Pt(o[c+1]),Pt(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})=>tr(i,a)<.006)?a:null}function N1(t){let{width:e,height:n,data:o}=t,r=wa(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(tr([Pt(o[c]),Pt(o[c+1]),Pt(o[c+2])],r));s*=Math.min(1,Math.max(0,(l-.06)/.1));}a[i]=s;}return a}var O1=8,D1=.14,gc=.006;function B1(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 g=d*4,h=Math.floor(r[g]/16)*256+Math.floor(r[g+1]/16)*16+Math.floor(r[g+2]/16);a[h]+=1,i[h*3]+=Pt(r[g]),i[h*3+1]+=Pt(r[g+1]),i[h*3+2]+=Pt(r[g+2]),c++;}if(c===0)return {palette:[],error:0};let s=[...a.keys()].filter(d=>a[d]>0).sort((d,g)=>a[g]-a[d]),l=[];for(let d of s){if(a[d]/c<gc/2||l.length>=O1)break;let g=[i[d*3]/a[d],i[d*3+1]/a[d],i[d*3+2]/a[d]];l.every(h=>tr(h,g)>=D1**2)&&l.push(g);}let m=[],u=0;for(let d=0;d<3;d++){m=l.map(()=>({n:0,r:0,g:0,b:0,x:0,y:0})),u=0;for(let g=0;g<e.length;g++){if(e[g]<.9)continue;let h=g*4,p=[Pt(r[h]),Pt(r[h+1]),Pt(r[h+2])],b=0,y=Number.POSITIVE_INFINITY;for(let[w,C]of l.entries()){let S=tr(p,C);S<y&&(y=S,b=w);}let _=m[b];_.n++,_.r+=p[0],_.g+=p[1],_.b+=p[2],_.x+=g%n,_.y+=Math.floor(g/n),u+=Math.sqrt(y);}for(let[g,h]of m.entries())h.n>0&&(l[g]=[h.r/h.n,h.g/h.n,h.b/h.n]);}return {palette:l.map((d,g)=>({color:d,area:m[g].n/c,cx:m[g].n?m[g].x/m[g].n+.5:n/2,cy:m[g].n?m[g].y/m[g].n+.5:o/2})).filter(d=>d.area>=gc).sort((d,g)=>g.area-d.area),error:u/c}}function Q1(t,e,n){let o=e+2,r=n+2,a=(u,f)=>u<=0||f<=0||u>e||f>n?0:t[(f-1)*e+(u-1)],i=new Map,c=new Map,s=u=>{let f=c.get(u);if(f)return f;let d=Math.floor(u/2),g=d%o,h=Math.floor(d/o),p=a(g,h),b=u%2===1,y=b?a(g,h+1):a(g+1,h),_=p===y?.5:Math.min(1,Math.max(0,(.5-p)/(y-p))),w=b?[g-.5,h-.5+_]:[g-.5+_,h-.5];return c.set(u,w),w},l=(u,f)=>{i.set(u,f);};for(let u=0;u<r-1;u++)for(let f=0;f<o-1;f++){let d=a(f,u)>=.5,g=a(f+1,u)>=.5,h=a(f+1,u+1)>=.5,p=a(f,u+1)>=.5,b=2*(u*o+f),y=2*((u+1)*o+f),_=2*(u*o+f)+1,w=2*(u*o+f+1)+1;switch((d?8:0)+(g?4:0)+(h?2:0)+(p?1:0)){case 1:l(y,_);break;case 2:l(w,y);break;case 3:l(w,_);break;case 4:l(b,w);break;case 5:{(a(f,u)+a(f+1,u)+a(f+1,u+1)+a(f,u+1))/4>=.5?(l(b,_),l(y,w)):(l(b,w),l(y,_));break}case 6:l(b,y);break;case 7:l(b,_);break;case 8:l(_,b);break;case 9:l(y,b);break;case 10:{(a(f,u)+a(f+1,u)+a(f+1,u+1)+a(f,u+1))/4>=.5?(l(_,y),l(w,b)):(l(_,b),l(w,y));break}case 11:l(w,b);break;case 12:l(_,w);break;case 13:l(y,w);break;case 14:l(_,y);break;}}let m=[];for(let u of i.keys()){if(!i.has(u))continue;let f=[],d=u;for(;d!==void 0&&i.has(d);){f.push(s(d));let g=i.get(d);i.delete(d),d=g;}f.length>=3&&m.push(f);}return m}function G1(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 bc(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],m=Math.hypot(s,l)||1,u=-1,f=e;for(let d=r+1;d<a;d++){let g=t[d],h=Math.abs(l*(g[0]-i[0])-s*(g[1]-i[1]))/m;h>f&&(f=h,u=d);}u>=0&&(n[u]=1,o.push([r,u],[u,a]));}return t.filter((r,a)=>n[a]===1)}function U1(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=bc(t.slice(0,n+1),e),a=bc([...t.slice(n),t[0]],e);return [...r.slice(0,-1),...a.slice(0,-1)]}var ge=t=>j(t,2);function z1(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${ge(c[0])} ${ge(c[1])}`:`L${ge(c[0])} ${ge(c[1])}`,r+=`Q${ge(i[0])} ${ge(i[1])} ${ge(s[0])} ${ge(s[1])}`;}return `${r}Z`}function q1(t,e,n){let o="";for(let r of Q1(t,e,n)){if(Math.abs(G1(r))<.8)continue;let a=U1(r,.18);a.length>=3&&(o+=z1(a,.9));}return o}var W1=.075;function yc(t){let{width:e,height:n,data:o}=t,r=N1(t),a=0;for(let h of r)a+=h;let{palette:i,error:c}=B1(t,r),s={width:e,height:n,palette:i,alpha:r,coverage:a/(e*n)};if(i.length===0||c>W1)return {...s,layers:[],photographic:i.length>0};let l=i.length,m=Array.from({length:l},()=>new Float32Array(e*n)),u=i.map(h=>h.color);for(let h=0;h<r.length;h++){let p=r[h];if(p<=0)continue;let b=h*4,y=[Pt(o[b]),Pt(o[b+1]),Pt(o[b+2])],_=0,w=-1,C=Number.POSITIVE_INFINITY,S=Number.POSITIVE_INFINITY;for(let P=0;P<l;P++){let L=tr(y,u[P]);L<C?(w=_,S=C,_=P,C=L):L<S&&(w=P,S=L);}if(w<0||C<1e-6){m[_][h]=p;continue}let $=u[_],M=u[w],R=[M[0]-$[0],M[1]-$[1],M[2]-$[2]],E=Math.min(1,Math.max(0,((y[0]-$[0])*R[0]+(y[1]-$[1])*R[1]+(y[2]-$[2])*R[2])/(R[0]**2+R[1]**2+R[2]**2)));m[_][h]=p*(1-E),m[w][h]=p*E;}let f=[],d=new Float32Array(e*n),g=new Array(l);for(let h=l-1;h>=0;h--){let p=m[h];for(let b=0;b<d.length;b++)d[b]+=p[b];g[h]=d.slice();}for(let h=0;h<l;h++){let p=q1(g[h],e,n);p&&f.push({color:u[h],d:p});}return {...s,layers:f,photographic:false}}var Cc=.6,Ra={logo:160,halftone:160};function H1(t){let e="";for(let o=0;o<t.length;o+=32768)e+=String.fromCharCode(...t.subarray(o,o+32768));return btoa(e)}var Sn=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}},V1=new Sn(8);function j1(t){return V1.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 Ea(t){let{width:e,height:n,data:o}=t;if(!(Number.isInteger(e)&&Number.isInteger(n))||e<1||n<1||e>Tn||n>Tn||typeof o!="string")return null;try{let r=j1(o);return r.length===e*n*4?{width:e,height:n,data:r}:null}catch{return null}}function Mc(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,m=Math.min(Math.max(Math.round(e.maxSize??Ra.halftone),1),Tn),u=Math.min(1,m/Math.max(s,l)),f=Math.max(1,Math.round(s*u)),d=Math.max(1,Math.round(l*u)),g=new Uint8Array(f*d*4);for(let h=0;h<d;h++){let p=Math.floor(h*l/d),b=Math.max(p+1,Math.floor((h+1)*l/d));for(let y=0;y<f;y++){let _=Math.floor(y*s/f),w=Math.max(_+1,Math.floor((y+1)*s/f)),C=0,S=0,$=0,M=0,R=0;for(let P=p;P<b;P++)for(let L=_;L<w;L++){let F=((P+c)*n+L+i)*4,I=r[F+3]/255;C+=r[F]*I,S+=r[F+1]*I,$+=r[F+2]*I,M+=I,R++;}let E=(h*f+y)*4;g[E]=M>0?Math.round(C/M):0,g[E+1]=M>0?Math.round(S/M):0,g[E+2]=M>0?Math.round($/M):0,g[E+3]=Math.round(M/R*255);}}return {width:f,height:d,data:H1(g)}}async function X1(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 Z1(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??Ra[n],r=await X1(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)),m=Math.max(1,Math.round(i*s)),u=document.createElement("canvas");u.width=l,u.height=m;let f=u.getContext("2d",{willReadFrequently:true});if(!f)throw new Error("Could not get a canvas context");f.imageSmoothingQuality="high",f.drawImage(r,0,0,l,m);let d;try{d=f.getImageData(0,0,l,m);}catch{throw new Error("Could not read the art image (cross-origin images need CORS); upload it instead")}finally{u.remove();}return Mc(d,{maxSize:o,square:c})}function Aa(t){return !!(t&&xr.includes(t.mode)&&t.image&&Ea(t.image))}function Hr(t){let e=No[t.mode];return t.variant&&e.includes(t.variant)?t.variant:e[0]}function Y1(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 er(t,e){let n=Y1(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}var K1=0,Qt=1,Gt=2,be=3,_c=4,xc=new Map;function Rc(t){let e=xc.get(t);if(e)return e;let n=t*4+17,o=new Uint8Array(n*n),r=(a,i,c,s,l)=>{for(let m=Math.max(0,i);m<Math.min(n,i+s);m++)for(let u=Math.max(0,a);u<Math.min(n,a+c);u++)o[m*n+u]=l;};r(6,0,1,n,_c),r(0,6,n,1,_c),r(0,8,9,1,be),r(8,0,1,9,be),r(n-8,8,8,1,be),r(8,n-8,1,8,be),t>=7&&(r(n-11,0,3,6,be),r(0,n-11,6,3,be));for(let[a,i]of er(t,n))r(a-2,i-2,5,5,Gt);return r(0,0,8,8,Qt),r(n-8,0,8,8,Qt),r(0,n-8,8,8,Qt),xc.set(t,o),o}function J1(t){let e=t*4+17,n=Rc(t);return Array.from({length:e},(o,r)=>Array.from({length:e},(a,i)=>n[r*e+i]!==K1))}function td(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 wn(t,e){let n=lt(t);return !n||n.a===0?e:[n.r/255,n.g/255,n.b/255]}var Qe=(t,e,n)=>[t[0]+(e[0]-t[0])*n,t[1]+(e[1]-t[1])*n,t[2]+(e[2]-t[2])*n];function ye(t,e,n,o){let r=Z(t);if(o?r<=n:r>=n)return t;let a=Z(e);return Math.abs(r-a)<1e-6?e:Qe(t,e,Math.min(1,Math.max(0,(r-n)/(r-a))))}var Ec=t=>Math.max(...t)-Math.min(...t),ed=(t,e)=>(t[0]-e[0])**2+(t[1]-e[1])**2+(t[2]-e[2])**2,Ca=t=>t.toString(16).padStart(2,"0");function vt(t,e=1){let n=o=>Math.min(255,Math.round(Math.round(Math.min(Math.max(o,0),1)*255)/e)*e);return `#${Ca(n(t[0]))}${Ca(n(t[1]))}${Ca(n(t[2]))}`}function nd(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}var Pa=.3,$c=t=>1-Math.exp(-((t/2)**2)/(2*Pa**2)),rd=t=>nd(t/(2*Pa*Math.SQRT2))**2,od=(t,e,n)=>{let o=Math.min(1,Math.max(0,(n-t)/(e-t)));return o*o*(3-2*o)};function va(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 Ac(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 ad(t){let e=Ac(t),{rgb:n,alpha:o}=e,r=new Float64Array(256),a=0;for(let u=0;u<o.length;u++){if(o[u]<.5)continue;let f=Z([n[u*3],n[u*3+1],n[u*3+2]]);r[Math.min(255,Math.floor(f*256))]+=1,a++;}let i=u=>{let f=0;for(let d=0;d<256;d++)if(f+=r[d],f>=u*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)),m=(c+s)/2;for(let u=0;u<o.length;u++){let f=[n[u*3],n[u*3+1],n[u*3+2]],d=Z(f),g=.5+(d-m)*l;for(let h=0;h<3;h++)n[u*3+h]=Math.min(1,Math.max(0,g+(f[h]-d)*1.12));}return e}function Pc(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),m=Math.min(Math.max(n-.5,0),i-1),u=Math.floor(l),f=Math.floor(m),d=Math.min(u+1,a-1),g=Math.min(f+1,i-1),h=l-u,p=m-f,b=0,y=0,_=0,w=0,C=($,M,R)=>{let E=M*a+$,P=s[E]*R;b+=c[E*3]*P,y+=c[E*3+1]*P,_+=c[E*3+2]*P,w+=P;};if(C(u,f,(1-h)*(1-p)),C(d,f,h*(1-p)),C(u,g,(1-h)*p),C(d,g,h*p),w<=0)return o;let S=w*r;return [o[0]+(b/w-o[0])*S,o[1]+(y/w-o[1])*S,o[2]+(_/w-o[2])*S]}var id=new Sn(4),sd=new Sn(6),cd=new Sn(6);function La(t,e){return sd.get(t.image.data,()=>yc(e))}function vc(t,e,n){return cd.get(t.image.data,()=>Ac(e,n.alpha))}var $t=t=>j(t,2),Lc=t=>j(t,4),Ge=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,ld(n,o,r));}toElements(e){return [...this.groups].map(([n,o],r)=>v("path",{d:o.join(""),fill:n},`${e}-${r}`))}};function ld(t,e,n){let o=$t(n*2),r=$t(n);return `M${$t(t-n)} ${$t(e)}a${r} ${r} 0 1 0 ${o} 0a${r} ${r} 0 1 0 ${-o} 0z`}function Be(t,e,n,o,r){let a=Math.min(r,n/2,o/2);if(a<=0)return `M${$t(t)} ${$t(e)}h${$t(n)}v${$t(o)}h${$t(-n)}z`;let i=$t(a);return `M${$t(t+a)} ${$t(e)}h${$t(n-2*a)}a${i} ${i} 0 0 1 ${i} ${i}v${$t(o-2*a)}a${i} ${i} 0 0 1 ${-i} ${i}h${$t(-(n-2*a))}a${i} ${i} 0 0 1 ${-i} ${-i}v${$t(-(o-2*a))}a${i} ${i} 0 0 1 ${i} ${-i}z`}function Fc(t,e,n){let o="";for(let[r,a]of t){let i=(r-2+e)*n,c=(a-2+e)*n;o+=Be(i,c,5*n,5*n,n*.35),o+=Be(i+n,c+n,3*n,3*n,n*.15),o+=Be(i+2*n,c+2*n,n,n,n*.12);}return o}var ud={blend:1,badge:1,color:.9,mono:.7},Wr=.35;function md(t,e){let n=wn(t,[0,0,0]),o=wn(e,[1,1,1]),r=Z(o)-Z(n);return r>=Wr?null:r<=-Wr?"inverted":"low-contrast"}function kc(t,e,n){let o=Math.min(Math.max(t.intensity??Cc,0),ud[Hr(t)]);return Z(n)-Z(e)>=Wr?o:0}function dd(t){let{art:e,modules:n,version:o}=t,r=e.image&&Ea(e.image);if(!(r&&xr.includes(e.mode)))return null;let a=n.length;if(a!==o*4+17)return null;let i=wn(t.fgColor,[0,0,0]),c=wn(t.bgColor,[1,1,1]),s=kc(e,i,c);return s<=0?null:{art:e,image:r,modules:n,size:a,version:o,kinds:Rc(o),margin:t.margin,pixelSize:t.pixelSize,t:s,fg:i,bg:c,variant:Hr(e),body:t.body}}function Fa(t){let e=dd(t);if(!e)return null;let n;return e.art.mode==="halftone"?n=e.variant==="mono"?yd(e):bd(e):n=e.variant==="badge"?Ed(e):_d(e),v("g",{"data-qrdx-art":e.art.mode,"data-qrdx-art-variant":e.variant,children:n})}function fd(t,e){return {margin:.42-.17*t+(e===3?.04:0),darkCap:.4+.3*t}}var Ic=8.5,Sc=new Map;function ka(t){let e=t*4+17,n=Sc.get(t);if(!n){let a=e*2,i=new Uint8Array(a*a),c=Ic*2;for(let s=0;s<a;s++)for(let l=0;l<a;l++){let m=l<c||l>=a-c,u=s<c||s>=a-c;m&&u&&!(l>=a-c&&s>=a-c)&&(i[s*a+l]=1);}for(let[s,l]of er(t,e))for(let m=(l-2)*2-1;m<(l+3)*2+1;m++)for(let u=(s-2)*2-1;u<(s+3)*2+1;u++)u>=0&&m>=0&&u<a&&m<a&&(i[m*a+u]=1);Sc.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 Tc(t,e,n=false){let{image:o,size:r,kinds:a,fg:i,bg:c}=t,s=id.get(t.art.image.data,()=>ad(o)),l=va(o.width,o.height,r,"cover"),m=r*e,u=new Float32Array(m*m*3).fill(Number.NaN),d=1/(e*l.scale)>1.3?2:1,g=Z(c)-.1*(Z(c)-Z(i)),h=ka(t.version);for(let p=0;p<r;p++)for(let b=0;b<r;b++){let y=a[p*r+b],_=y===Qt||y===Gt;if(!(_&&!n))for(let w=0;w<e;w++)for(let C=0;C<e;C++){let S=0,$=0,M=0;for(let N=0;N<d;N++)for(let k=0;k<d;k++){let B=b+(C+(k+.5)/d)/e,q=p+(w+(N+.5)/d)/e,O=Pc(s,(B-l.offsetX)/l.scale,(q-l.offsetY)/l.scale,c);S+=O[0],$+=O[1],M+=O[2];}let R=d*d,E=[S/R,$/R,M/R],P=b+(C+.5)/e,L=p+(w+.5)/e,F=Math.min(P,L,r-P,r-L);F<1.5&&(E=Qe(E,c,.35*(1-F/1.5))),n&&(_||h(P,L))&&(E=ye(E,c,g,false));let I=((p*e+w)*m+b*e+C)*3;u[I]=E[0],u[I+1]=E[1],u[I+2]=E[2];}}return {n:e,count:m,rgb:u}}function hd(t,e,n){let{size:o,kinds:r,modules:a,fg:i,bg:c,t:s}=t,{n:l,count:m,rgb:u}=e,f=Z(i),d=Z(c),g=d-f,h=fd(s,l),p=M=>.2126*u[M]+.7152*u[M+1]+.0722*u[M+2],b=new Float32Array(o*o),y=new Float32Array(o*o);for(let M=0;M<o;M++)for(let R=0;R<o;R++){let E=r[M*o+R];if(E===Qt){b[M*o+R]=d;continue}if(E===Gt){b[M*o+R]=a[M]?.[R]?f:d;continue}let P=0,L=0,F=0;for(let I=0;I<l;I++)for(let N=0;N<l;N++){let k=p(((M*l+I)*m+R*l+N)*3);P+=k,n.under[I*l+N]||(L+=k,F++);}b[M*o+R]=P/(l*l),y[M*o+R]=F?L/F:P/(l*l);}let _=o+1,w=new Float64Array(_*_);for(let M=0;M<o;M++)for(let R=0;R<o;R++)w[(M+1)*_+R+1]=b[M*o+R]+w[M*_+R+1]+w[(M+1)*_+R]-w[M*_+R];let C=2,S=(M,R)=>{let E=Math.max(0,M-C),P=Math.max(0,R-C),L=Math.min(o,M+C+1),F=Math.min(o,R+C+1);return (w[F*_+L]-w[P*_+L]-w[F*_+E]+w[P*_+E])/((L-E)*(F-P))},$=n.weight;for(let M=0;M<o;M++)for(let R=0;R<o;R++){let E=r[M*o+R];if(E===Qt||E===Gt)continue;let P=E===be,L=(h.margin+(P?.08:0))*g,F=(h.darkCap-(P?.12:0))*g,I=($*((n.light-n.dark)/2)-L)/(1-$),N=S(R,M),k=y[M*o+R],B=!!a[M]?.[R],q=0,O=c;if(B){let G=Math.min(N+I,f+F);k>G&&(q=(k-G)/Math.max(k-f,1e-6),O=i);}else {let G=Math.max(N-I,d-F);k<G&&(q=(G-k)/Math.max(d-k,1e-6));}if(!(q<=0)){q=Math.min(1,q);for(let G=0;G<l;G++)for(let J=0;J<l;J++){let pt=((M*l+G)*m+R*l+J)*3;for(let at=0;at<3;at++)u[pt+at]+=(O[at]-u[pt+at])*q;}}}}function Nc(t,e,n,o){let{count:r}=e,a=new Ge;for(let s=0;s<r;s++){let l=0,m=n(s*r);for(let u=1;u<=r;u++){let f=u<r?n(s*r+u):null;(u===r||f!==m)&&(m&&a.cellRun(m,l,s,u-l),l=u,m=f);}}let i=t.pixelSize/e.n,c=$t(t.margin*t.pixelSize);return v("g",{transform:`translate(${c} ${c}) scale(${Lc(i)})`,children:a.toElements(o)},o)}function Ia(t,e){let n=er(t.version,t.size);return n.length===0?[]:[v("path",{d:Fc(n,t.margin,t.pixelSize),fill:e,fillRule:"evenodd"},"art-alignment")]}function Oc(t){let{image:e,size:n}=t;return Math.floor(Math.min(e.width,e.height)/n)>=4&&n<=45?4:3}var pd=t=>2*Pa*Math.sqrt(-2*Math.log(1-Math.min(t,.95)));function gd(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),m=Math.min(e,c+n+1),u=Math.min(e,i+n+1);a[i*e+c]=(r[u*o+m]-r[l*o+m]-r[u*o+s]+r[l*o+s])/((m-s)*(u-l));}return a}function Dc(t,e,n,o){let{size:r,kinds:a,modules:i,fg:c,bg:s}=t,l=Z(c),m=Z(s),u=m-l,f=gd(e,r,2),d=new Float32Array(r*r),g=new Float32Array(r*r).fill(Number.NaN);for(let h=0;h<r;h++)for(let p=0;p<r;p++){let b=h*r+p,y=a[b];if(y===Qt||y===Gt)continue;let _=y===be,w=o.base+(_?.08:0),C=(o.margin+(_?.03:0))*u,S=(o.cap-(_?.04:0))*u,$=$c(w),M=$c(_?Math.max(o.max,.94):o.max),R=$*((o.dark+o.light)/2)+(1-$)*f[b],E=n[b],P=!!i[h]?.[p],L=P?o.dark:o.light,F=P?Math.min(R-C,l+S):Math.max(R+C,m-S),N=(P?E<=F:E>=F)?0:(E-F)/(E-L);N>M&&(N=M,g[b]=Math.min(m,Math.max(l,(F-M*L)/(1-M))));let k=P?E<=F-.06:E>=F+.06;o.skip&&k&&!_||(N=Math.max(N,$)),d[b]=N>0?pd(N):0;}return {diameter:d,surround:g}}function bd(t){let{size:e,kinds:n,modules:o,fg:r,bg:a,t:i,margin:c,pixelSize:s}=t,l=Oc(t),m=Tc(t,l,true),u=Z(r),f=Z(a),d=u+.1*(f-u),g=f-.05*(f-u),{count:h,rgb:p}=m,b=(S,$,M,R)=>(($*l+R)*h+S*l+M)*3,y=new Float32Array(e*e);for(let S=0;S<e;S++)for(let $=0;$<e;$++){let M=n[S*e+$];if(M===Qt||M===Gt){y[S*e+$]=M===Gt&&o[S]?.[$]?u:f;continue}let R=0;for(let E=0;E<l;E++)for(let P=0;P<l;P++){let L=b($,S,P,E);R+=.2126*p[L]+.7152*p[L+1]+.0722*p[L+2];}y[S*e+$]=R/(l*l);}let _=Dc(t,y,y,{base:.6-.28*i,max:.86,dark:d,light:g,margin:.2-.1*i,cap:.4+.14*i,skip:false});for(let S=0;S<e;S++)for(let $=0;$<e;$++){let M=_.surround[S*e+$];if(Number.isNaN(M))continue;let R=y[S*e+$],P=M<R?r:a,L=Math.min(1,Math.abs(R-M)/Math.max(Math.abs(R-Z(P)),1e-6));for(let F=0;F<l;F++)for(let I=0;I<l;I++){let N=b($,S,I,F);for(let k=0;k<3;k++)p[N+k]+=(P[k]-p[N+k])*L;}}let w=[Nc(t,m,S=>{let $=S*3;return Number.isNaN(p[$])?null:vt([p[$],p[$+1],p[$+2]],8)},"art-photo")],C=new Ge;for(let S=0;S<e;S++)for(let $=0;$<e;$++){let M=_.diameter[S*e+$];if(!(M>0))continue;let R=0,E=0,P=0;for(let I=0;I<l;I++)for(let N=0;N<l;N++){let k=b($,S,N,I);R+=p[k],E+=p[k+1],P+=p[k+2];}let L=[R/(l*l),E/(l*l),P/(l*l)],F=o[S]?.[$]?ye(L,r,d,true):ye(L,a,g,false);C.circle(vt(F,10),($+c+.5)*s,(S+c+.5)*s,M/2*s);}return w.push(...C.toElements("art-dot"),...Ia(t,vt(r))),w}function yd(t){let{size:e,kinds:n,modules:o,fg:r,bg:a}=t,i=Oc(t),c=Tc(t,i),s=Z(r),l=Z(a),m=i%2===1?1:2,u=(i-m)/2,f=R=>R>=u&&R<u+m,d=[];for(let R=0;R<i;R++)for(let E=0;E<i;E++)d.push(f(E)&&f(R));hd(t,c,{weight:rd(m/i),dark:s,light:l,under:d});let{count:g,rgb:h}=c,p=new Float32Array(g*g),b=new Int8Array(g*g).fill(-1);for(let R=0;R<g*g;R++){let E=R*3;if(Number.isNaN(h[E])){p[R]=Number.NaN;continue}let P=(.2126*h[E]+.7152*h[E+1]+.0722*h[E+2]-s)/(l-s);p[R]=.5+(od(0,1,P)-.5)*1.15;}for(let R=0;R<e;R++)for(let E=0;E<e;E++){let P=n[R*e+E];if(!(P===Qt||P===Gt))for(let L=u;L<u+m;L++)for(let F=u;F<u+m;F++)b[(R*i+L)*g+E*i+F]=o[R]?.[E]?0:1;}let y=ka(t.version);for(let R=0;R<g;R++)for(let E=0;E<g;E++){let P=R*g+E;b[P]<0&&y((E+.5)/i,(R+.5)/i)&&(b[P]=1);}let _=new Uint8Array(g*g),w=.3,C=0,S=0,$=(R,E,P)=>{if(R<0||R>=g||E>=g)return;let L=E*g+R;if(!Number.isNaN(p[L])){let F=Math.floor(R/i)===Math.floor(C/i)&&Math.floor(E/i)===Math.floor(S/i);p[L]+=F?P:P*w;}};for(let R=0;R<g;R++){let E=R%2===0?1:-1;for(let P=0;P<g;P++){let L=E===1?P:g-1-P,F=R*g+L,I=p[F];if(Number.isNaN(I))continue;let N=b[F]>=0?b[F]:I>=.5?1:0;_[F]=N===0?1:0;let k=Math.min(.75,Math.max(-0.75,I-N));C=L,S=R,$(L+E,R,k*7/16),$(L-E,R+1,k*3/16),$(L,R+1,k*5/16),$(L+E,R+1,k/16);}}let M=vt(r);return [Nc(t,c,R=>_[R]?M:null,"art-halftone"),...Ia(t,M)]}function wc(t,e){let n=null,o=0;for(let r of t.palette){if(e&&ed(r.color,e)<.02)continue;let a=r.area*(.35+Ec(r.color))*(Z(r.color)>.86?.05:1);a>o&&(o=a,n=r.color);}return n}function Bc(t,e,n,o,r){let a;if(t.photographic){let i=new Ge,{width:c,height:s,rgb:l,alpha:m}=e;for(let u=0;u<s;u++){let f=0,d=null;for(let g=0;g<=c;g++){let h=u*c+g,p=g<c&&m[h]>=.5?vt(o([l[h*3],l[h*3+1],l[h*3+2]]),6):null;(g===c||p!==d)&&(d&&i.cellRun(d,f,u,g-f),f=g,d=p);}}a=i.toElements(`${r}-px`);}else a=t.layers.map((i,c)=>v("path",{d:i.d,fill:vt(o(i.color)),fillRule:"evenodd"},`${r}-${c}`));return v("g",{transform:`translate(${$t(n.x)} ${$t(n.y)}) scale(${Lc(n.scale)})`,children:a},r)}function _d(t){let{art:e,image:n,size:o,kinds:r,modules:a,fg:i,bg:c,t:s,margin:l,pixelSize:m}=t,u=La(e,n),f=vc(e,n,u),d=va(u.width,u.height,o,"contain"),g=Math.min(1,.3+1.4*s),h=k=>Qe(c,k,g),p=vt(c),b=vt(i),y=[Bc(u,f,{x:(l+d.offsetX)*m,y:(l+d.offsetY)*m,scale:d.scale*m},h,"art-logo")],_=Ic,w=(k,B)=>Be((k+l)*m,(B+l)*m,(_+.4)*m,(_+.4)*m,1.2*m),C=er(t.version,o).map(([k,B])=>Be((k-2.5+l)*m,(B-2.5+l)*m,6*m,6*m,m*.8)).join("");y.push(v("path",{d:w(-0.4,-0.4)+w(o-_,-0.4)+w(-0.4,o-_)+C,fill:p},"art-plates"));let S=ka(t.version),$=Z(c),M=Z(i),R=new Float32Array(o*o),E=new Float32Array(o*o),P=new Array(o*o);for(let k=0;k<o;k++)for(let B=0;B<o;B++){let q=k*o+B,O=r[q];if(O===Qt||O===Gt){R[q]=O===Gt&&a[k]?.[B]?M:$;continue}let G=1,J=0,pt=0,at=0,T=0;for(let U=0;U<4;U++)for(let z=0;z<4;z++){let wt=B+(z+.5)/4,Me=k+(U+.5)/4,kt=S(wt,Me)?c:Pc(f,(wt-d.offsetX)/d.scale,(Me-d.offsetY)/d.scale,c,g),Jt=Z(kt);G=Math.min(G,Jt),J+=Jt,pt+=kt[0],at+=kt[1],T+=kt[2];}R[q]=J/16,E[q]=G,P[q]=[pt/16,at/16,T/16];}let L=M+.08*($-M),F=$-.04*($-M),I=Dc(t,R,R,{base:.74-.26*s,max:.9,dark:L,light:F,margin:.23-.1*s,cap:.4+.1*s,skip:s>=.7}),N=new Ge;for(let k=0;k<o;k++)for(let B=0;B<o;B++){let q=k*o+B,O=I.diameter[q],G=!!a[k]?.[B];if(!(O>0)||!G&&E[q]>=$-.02)continue;let J=G?ye(P[q],i,L,true):ye(P[q],c,F,false);N.circle(vt(J,8),(B+l+.5)*m,(k+l+.5)*m,O/2*m);}return y.push(...N.toElements("art-dot")),y.push(...Ia(t,b)),y}var xd={L:.5,M:.72,Q:.88,H:1},Qc=.32,Gc=.55,$d=.6,Sd=2;function Uc(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}}var zc=t=>({cx:t.cx,cy:t.cy,w:t.plateW,h:t.plateH,r:t.radius});function qc(t,e,n){return Hc(e+.5,n+.5,t)<Gc}function wd(t,e){let n=zc(t),o=Gc+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 m=r;m<=a;m++)qc(n,m,l)&&s.push(l*e+m);return s}var Cd=t=>Math.floor(t.correctable*$d);function Ma(t,e,n){let o=Uc(t,e,n.size),r=Cd(n);return Kn(n,wd(o,n.size)).every(a=>a<=r)}function Wc(t,e,n){if(Ma(n,e,t))return n;let o=0,r=n;if(!Ma(o,e,t))return -1;for(;r-o>1/64;){let a=(o+r)/2;Ma(a,e,t)?o=a:r=a;}return o}var qr=new Map;function Md(t,e){let n=`${t.version}${t.level}:${e.toFixed(3)}`,o=qr.get(n);return o===void 0&&(o=Wc(t,e,Qc*t.size),qr.size>=64&&qr.clear(),qr.set(n,o)),o}function Rd(t,e){let{size:n,t:o,modules:r,version:a}=t,i=td(r),c=(.18+.15*o)*xd[i],s=e.width/e.height,l=Math.min(Qc,c)*n,m=Yn(a,i),u=Math.max(0,Md(m,s));if(u<Sd)return {wantedBox:l,maxBox:u,box:0,plate:null};let f=Wc(m,s,Math.min(l,u));return f<0?{wantedBox:l,maxBox:u,box:0,plate:null}:{wantedBox:l,maxBox:u,box:f,plate:Uc(f,s,n)}}function Hc(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 Vc(t,e){let{fg:n,bg:o,t:r}=t,a=Z(n),i=Z(o),c=wc(e),s=Math.min(1,r/.6),l=c?ye(c,n,a+.3*(i-a),true):n,m=Qe(n,l,s),u=c?wc(e,c):null,f=a+.42*(i-a),d=u&&Z(u)<=f+.22?Qe(n,ye(u,n,f,true),s):m;return {body:m,inner:d}}function Ed(t){let{art:e,image:n,size:o,kinds:r,modules:a,bg:i,margin:c,pixelSize:s,version:l}=t,m=La(e,n),u=Rd(t,m).plate,{body:f}=Vc(t,m),d=vt(f),g=u&&zc(u),h=a.map(P=>[...P]);for(let P=0;P<o;P++)for(let L=0;L<o;L++){let F=r[P*o+L];(F===Gt||g&&F!==Qt&&qc(g,L,P))&&(h[P][L]=false);}let p=[],b=t.body?.(h);if(b)p.push(v("g",{fill:d,children:b},"art-body"));else {let P=new Ge;for(let L=0;L<o;L++)for(let F=0;F<o;F++)h[L]?.[F]&&r[L*o+F]!==Qt&&P.circle(d,(F+c+.5)*s,(L+c+.5)*s,.45*s);p.push(...P.toElements("art-body"));}let y=er(l,o).filter(([P,L])=>!g||Hc(P+.5,L+.5,g)>3.2);if(y.length>0&&p.push(v("path",{d:Fc(y,c,s),fill:d,fillRule:"evenodd"},"art-alignment")),!u)return p;let _=vc(e,n,m),w=(u.cx-u.plateW/2+c)*s,C=(u.cy-u.plateH/2+c)*s,S=u.plateW*s,$=u.plateH*s,M=u.radius*s,R=.1*s,E=Be(w,C,S,$,M);return p.push(v("path",{d:E,fill:vt(i)},"art-plate"),v("path",{d:E+Be(w+R,C+R,S-2*R,$-2*R,M-R),fill:vt(Qe(i,f,.16)),fillRule:"evenodd"},"art-plate-ring"),Bc(m,_,{x:(u.cx-u.logoW/2+c)*s,y:(u.cy-u.logoH/2+c)*s,scale:u.logoW/m.width*s},P=>P,"art-logo")),p}function Ta(t){let{art:e}=t;if(e.mode!=="logo"||e.matchEyes===false)return null;let n=e.image&&Ea(e.image);if(!n)return null;let o=wn(t.fgColor,[0,0,0]),r=wn(t.bgColor,[1,1,1]),a=kc(e,o,r);if(a<=0)return null;let i=La(e,n);if(i.palette.length===0)return null;if(Hr(e)==="badge"){let{body:g,inner:h}=Vc({fg:o,bg:r,t:a},i),p={outer:vt(g),inner:vt(h)};return {topLeft:p,topRight:p,bottomLeft:p}}let c=Z(o),s=Z(r),l=Math.min(1,a/.6),m=t.version*4+17,u=va(i.width,i.height,m,"contain"),f=.45*Math.max(i.width,i.height),d=(g,h)=>{let p=(g-u.offsetX)/u.scale,b=(h-u.offsetY)/u.scale,y=null,_=0;for(let C of i.palette){if(Z(C.color)>.86)continue;let S=(C.cx-p)**2+(C.cy-b)**2,$=C.area*(.35+Ec(C.color))*Math.exp(-S/(2*f**2));$>_&&(_=$,y=C.color);}if(!y)return {};let w=ye(y,o,c+.42*(s-c),true);return {inner:vt(Qe(o,w,l))}};return {topLeft:d(3.5,3.5),topRight:d(m-3.5,3.5),bottomLeft:d(3.5,m-3.5)}}var Ad=["horizontal-line","liquid","liquid-horizontal","liquid-vertical","classy","classy-rounded","leaf","plus","hexagon","star","heart","random-dots","mosaic","octagon"];function jc(t){return Ad.includes(t)}var Xc={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};function Vr(t,e){if(t===void 0||!Number.isFinite(t))return 1;let n=e?Xc[e]??1:$r;return Math.min(Qo,Math.max($r,n,t))}function Pd(t,e,n){return t<7&&e<7||t>=n-7&&e<7||t<7&&e>=n-7}function vd(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 Na(t){let e=(t-17)/4,n=Number.isInteger(e)?vd(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)}var Ld={liquid:{horizontal:true,vertical:true,thickness:1,radius:()=>1,fillets:true},"liquid-horizontal":{horizontal:true,vertical:false,thickness:.86,radius:()=>1,fillets:false},"liquid-vertical":{horizontal:false,vertical:true,thickness:.86,radius:()=>1,fillets:false},classy:{horizontal:true,vertical:true,thickness:1,radius:t=>t===0||t===2?1:0,fillets:false},"classy-rounded":{horizontal:true,vertical:true,thickness:1,radius:t=>t===0||t===2?1:.4,fillets:false}};function Fd(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 K([[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 K(bn(e,n,o*.54,6));case "star":return K(yn(e,n+o*.04,o*.62,o*.34));case "heart":return _n(e,n+o*.02,o*1.08);case "random-dots":return X(e,n,o*(.38+.15*Lr(r,a)));case "mosaic":{let i=o*(.8+.14*Lr(r,a,1))/2,c=[[e-i,n-i],[e+i,n-i],[e+i,n+i],[e-i,n+i]];return K(Ms(c,e,n,(Lr(r,a,2)-.5)*16))}case "octagon":return K(bn(e,n,o*.48/Math.cos(Math.PI/8),8,22.5));default:return X(e,n,o*.45)}}function Zc(t,e){let{margin:n,pixelSize:o,pattern:r}=e,a=Vr(e.scale,r),i=t.length,c=e.plain?()=>false:Na(i),s=(h,p)=>!e.plain&&Pd(h,p,i),l=(h,p)=>h>=0&&p>=0&&h<i&&p<i&&!!t[p]?.[h]&&!s(h,p),m=h=>(h+.5+n)*o,u=[],f=[],d=Ld[r];for(let h=0;h<i;h++)for(let p=0;p<i;p++){if(!l(p,h))continue;let b=m(p),y=m(h);if(c(p,h)){u.push(A`M${b-o/2} ${y-o/2}h${o}v${o}h${-o}z`);continue}if(!d){f.push(Fd(r,b,y,o*a,p,h));continue}let _=o*d.thickness*a/2,w=d.horizontal&&l(p+1,h),C=d.horizontal&&l(p-1,h),S=d.vertical&&l(p,h-1),$=d.vertical&&l(p,h+1),R=[!(S||C),!(S||w),!($||w),!($||C)].map((E,P)=>E?_*d.radius(P):0);f.push(D(b-_,y-_,2*_,2*_,R)),2*_<o&&(w&&f.push(D(b,y-_,o,2*_)),$&&f.push(D(b-_,y,2*_,o)));}if(d?.fillets&&a===1){let h=o*.3;for(let p=0;p<i;p++)for(let b=0;b<i;b++){if(l(b,p)||s(b,p))continue;let y=m(b)-o/2,_=m(p)-o/2,w=y+o,C=_+o;l(b-1,p)&&l(b,p-1)&&l(b-1,p-1)&&f.push(A`M${y} ${_}h${h}A${h} ${h} 0 0 0 ${y} ${_+h}Z`),l(b+1,p)&&l(b,p-1)&&l(b+1,p-1)&&f.push(A`M${w} ${_}v${h}A${h} ${h} 0 0 0 ${w-h} ${_}Z`),l(b+1,p)&&l(b,p+1)&&l(b+1,p+1)&&f.push(A`M${w} ${C}h${-h}A${h} ${h} 0 0 0 ${w} ${C-h}Z`),l(b-1,p)&&l(b,p+1)&&l(b-1,p+1)&&f.push(A`M${y} ${C}v${-h}A${h} ${h} 0 0 0 ${y+h} ${C}Z`);}}let g=[];return f.length>0&&g.push(v("path",{d:f.join("")},"modules")),u.length>0&&g.push(v("path",{d:u.join("")},"alignment")),g}function kd(t){return t==="top-left"?0:t==="top-right"?1:3}function jr(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=kd(r),l=(s+2)%4,m=1.3*c,u=.7*c,f=g=>{switch(o){case "leaf":return g===s||g===l;case "leaf-reverse":return !(g===s||g===l);case "drop":return g===s;default:return g===l}},d=[0,1,2,3].map(g=>f(g)?u:m);return v("path",{d:D(t-n,e-n,a,a,d)})}case "extra-rounded":return v("path",{d:D(t-n,e-n,a,a,1.15*c)});case "plus":{let s=1.15*c,l=n;return v("path",{d:K([[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 v("path",{d:D(t-n,e-s,a,2*s,l)+D(t-s,e-n,2*s,a,l)})}case "hexagon":return v("path",{d:K(bn(t,e,1.72*c,6))});case "octagon":return v("path",{d:K(bn(t,e,n/Math.cos(Math.PI/8),8,22.5))});case "flower":{let s=.6*c,l=.9*c;return v("path",{d:X(t-s,e-s,l)+X(t+s,e-s,l)+X(t+s,e+s,l)+X(t-s,e+s,l)+X(t,e,1.2*c)})}case "heart":return v("path",{d:_n(t,e+.12*c,3.5*c)});case "squircle":return v("path",{d:K(Hn(t,e,n,n,4,64))});case "dots":{let s=[];for(let l of [-1,0,1])for(let m of [-1,0,1])s.push(X(t+m*c*.82,e+l*c*.82,.58*c));return v("path",{d:s.join("")})}case "square":return v("rect",{height:x(a),transform:A`rotate(0,${t},${e})`,width:x(a),x:x(t-i),y:x(e-i)});case "rounded":return v("rect",{height:x(a),rx:x(n*.5),ry:x(n*.5),transform:A`rotate(0,${t},${e})`,width:x(a),x:x(t-i),y:x(e-i)});case "diamond":return v("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,m=f=>(f-40)*s+e,u=A`M ${l(25)} ${m(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 v("path",{clipRule:"evenodd",d:u,transform:A`rotate(0,${t},${e})`})}case "message-reverse":{let s=a/30,l=f=>(f-40)*s+t,m=f=>(f-40)*s+e,u=A`M ${l(25)} ${m(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 v("path",{clipRule:"evenodd",d:u,transform:A`rotate(-180,${t},${e})`})}case "diya":{let s=a/30,l=f=>(f-40)*s+t,m=f=>(f-40)*s+e,u=A`M ${l(25)} ${m(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 v("path",{clipRule:"evenodd",d:u,transform:A`rotate(0,${t},${e})`})}case "diya-reverse":{let s=a/30,l=f=>(f-40)*s+t,m=f=>(f-40)*s+e,u=A`M ${l(25)} ${m(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 v("path",{clipRule:"evenodd",d:u,transform:A`rotate(0,${t},${e})`})}case "rounded-triangle":{let s=a/21,l=f=>(f-40)*s+t,m=f=>(f-40)*s+e,u=A`M ${l(33.57142857142857)} ${m(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 v("path",{d:u,transform:A`rotate(45,${t},${e})`})}case "star":{let s=a/27,l=f=>(f-40)*s+t,m=f=>(f-40)*s+e,u=A`M ${l(38.84615384615385)},${m(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 v("path",{clipRule:"evenodd",d:u,transform:A`rotate(0,${t},${e})`})}case "banner":{let s=a/28;return v("g",{transform:A`translate(${t-40*s},${e-40*s}) scale(${x(s,6)})`,children:v("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 v("circle",{cx:x(t),cy:x(e),r:x(n),transform:A`rotate(0,${t},${e})`})}}function Cn(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 Yc(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 Kc(t,e,n,o){let r=n/7,a=Math.max(0,(o+Math.SQRT2-2)*r);return K(Yc(t,e,n,o*r))+K(Yc(t+r,e+r,5*r,a))}function Jc(t,e,n,o,r=false){let a=n/7,i=c=>r?Cn(o,0,c,true):Cn(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 Id(t,e,n,o){let r=n/7;return D(t,e,n,n,Cn(o,2.6*r,0,false))+D(t+r,e+r,5*r,5*r,Cn(o,1.6*r,0,false))}function Td(t,e,n){let o=n/7,r=t+n/2,a=e+n/2;return K(Hn(r,a,3.5*o,3.5*o,4,96))+K(Hn(r,a,2.5*o,2.5*o,4,96))}function tl(t,e,n,o,r){let a=o,i=n/2,c=(i-a)*.55,s=(l,m)=>A`${t+l} ${e+m}`;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 Nd(t,e,n){let o=n/7,r=.12*o;return tl(t,e,n,1.4*o,r)+tl(t+o,e+o,5*o,.7*o,r)}function el(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 Od(t,e,n){let o=n/7;return el(t,e,n,.7*o,3.9*o,o)+el(t+o,e+o,5*o,.35*o,2.7*o,.8*o)}function Dd(t,e,n,o){let r=n/7;return D(t,e,n,n,Cn(o,.5*r,2.5*r,false))+D(t+r,e+r,5*r,5*r,Cn(o,.25*r,1.5*r,false))}function Bd(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 Qd(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 Gd(t,e,n){let o=t+n/2,r=e+n/2,a=j(n/2),i=j(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 Ud(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 Oa(t){let e=t/70;return {scale:e,transform:(o,r)=>(o-5)*e+r}}function zd(t,e,n){let{scale:o,transform:r}=Oa(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 qd(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 Wd(t,e,n){let{scale:o,transform:r}=Oa(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 Hd(t,e,n){let{scale:o,transform:r}=Oa(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 Vd(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 Xr(t,e,n,o,r="top-left"){switch(o){case "leaf":return Jc(t,e,n,r);case "leaf-reverse":return Jc(t,e,n,r,true);case "drop":return Id(t,e,n,r);case "octagon":return Kc(t,e,n,1.6);case "bevel":return Kc(t,e,n,1.1);case "squircle":return Td(t,e,n);case "cushion":return Nd(t,e,n);case "shield":return Od(t,e,n);case "petal":return Dd(t,e,n,r);case "gear":return Ud(t,e,n);case "rounded":return Qd(t,e,n);case "circle":return Gd(t,e,n);case "diya":return zd(t,e,n);case "extra-rounded":return qd(t,e,n);case "message":return Wd(t,e,n);case "pointy":return Hd(t,e,n);case "curly":return Vd(t,e,n);default:return Bd(t,e,n)}}var Da="data-qrdx-part",nl="data-qrdx-eye",jd=["eye-outer","eye-centre","body","logo","background"];function Ba(t,e,n){if(t)return n?{[Da]:e,[nl]:n}:{[Da]:e}}var nr=300;function Yt(t){return {id:t.id,name:t.name,description:t.description,spec:t.spec,wrapper:(e,n)=>{let o=Te(t.spec),r=n?.fgColor,a=(typeof r=="string"?r:yt(r,""))||"black",i=Zn(o.qr.size,o,{color:a}),{x:c,y:s,scale:l}=t.at;return v("svg",{height:nr,id:"svgQrWrapper",style:{width:"100%",height:"100%"},viewBox:`0 0 ${nr} ${nr}`,width:nr,xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",children:St("g",{"data-qrdx-template":t.id,transform:`translate(${x(c)} ${x(s)})${l===1?"":` scale(${l})`}`,children:[tc(i),v("g",{fill:"none",transform:`translate(${x(i.qrX)} ${x(i.qrY)}) scale(${i.qrSize/nr})`,children:e})]})})}}}var rl={kind:"qrdx.frame",version:1,artboard:{width:185,height:178},qr:{x:35,y:0,size:150,padding:0,plate:"none"},colors:{frame:"#000000"},shapes:[{type:"path",d:"M26.57 80.23h0c0.12 -2.06 0.31 -4.19 0.49 -6.25s0.48 -4.13 0.85 -6.13s0.79 -4 1.27 -5.95a30.21 30.21 0 0 1 1.94 -5.28h0c0.06 -0.18 0.13 -0.43 0.19 -0.67a3.55 3.55 0 0 0 -2.8 -4.19l-0.18 -0.06a1.85 1.85 0 0 0 -0.54 -0.06c-0.19 0 -0.31 -0.06 -0.49 -0.06s-0.61 -0.06 -0.91 -0.06c-0.61 0 -1.21 0.06 -1.82 0.06c-1.21 0.12 -2.37 0.25 -3.52 0.43a62.08 62.08 0 0 0 -6.8 1.45a58.45 58.45 0 0 0 -6.43 2.31c-1 0.42 -2.07 1 -3.1 1.4s-2 1.09 -3 1.57a0.76 0.76 0 0 0 0.54 1.4h0.07c1.09 -0.24 2.12 -0.55 3.15 -0.79s2.13 -0.48 3.16 -0.61A46 46 0 0 1 15 58c1.34 -0.06 2.73 -0.06 4.07 -0.06a62.58 62.58 0 0 0 -7.23 10.43a85.58 85.58 0 0 0 -6.55 15.36a107.86 107.86 0 0 0 -5 32.53a104.06 104.06 0 0 0 5 32.29a90.47 90.47 0 0 0 15.54 28.52a0.94 0.94 0 0 0 1.27 0.19a0.89 0.89 0 0 0 0.18 -1.28h0a87.24 87.24 0 0 1 -13.89 -28.28A102.85 102.85 0 0 1 11 85.87a82.15 82.15 0 0 1 6.68 -14a51.58 51.58 0 0 1 5.71 -7.76c0 1.21 0 2.36 0.06 3.58c0.12 2.18 0.24 4.31 0.48 6.43s0.49 4.25 0.85 6.37a1 1 0 0 0 0.91 0.85A1.37 1.37 0 0 0 26.57 80.23Z",fill:"frame"}],labels:[]};var ol=Yt({id:"Arrow",name:"Arrow",description:"QR code with arrow",spec:rl,at:{x:47,y:95,scale:1}});var al={id:"default",name:"Default",description:"Simple QR code without decorative elements",wrapper:t=>v("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:v("g",{fill:"none",transform:"translate(9, 9) scale(0.95)",children:t})})};var or=593,_e=296.5,rr=146.5,ml=294.5,dl=231.228,fl="M296.5 0C460.252 -7.15782e-06 593 132.748 593 296.5C593 460.252 460.253 593 296.5 593C132.748 593 7.15782e-06 460.252 0 296.5C-7.15788e-06 132.748 132.748 7.15788e-06 296.5 0ZM296.5 527.728C424.204 527.728 527.728 424.204 527.728 296.5C527.728 168.796 424.204 65.2713 296.5 65.2713C168.796 65.2713 65.2714 168.796 65.2714 296.5C65.2714 424.204 168.796 527.728 296.5 527.728Z",Zd="iaa2 1z3g 1z0y 1z18 1z18 1we8 2mq 1uta 47y 1rx4 73u 1rx4 73u 1rxe 73u 1rx4 73u 1rxe 73u 1rx4 73u 1rxe 73u 1rx4 73u 1rzm 71m 1rzm 71m 1rzc 73u okq 13ce 744 1rx4 744 1rwu 744 1rx4 744 1rx4 73u 1rx4 744 1rx4 73u 1rx4 73u 1rx4 744 1rx4 73u 1rxe 73u 1rx4 73u 1rx4 744 1rzm 71c 1rzm 73u 1rxe 73u 1rx4 744 1rx4 73u 1rx4 73u 1rxe 73u 1rx4 618 12m 1rxe 73u 1z0y 1z18 1z0y 1z18 1z0y 1z18 1z18",Yd="hqpr 5 1z36 1z0y 1z18 1z18 1z0y 1z0y 1a7w otc 1z0y 1z18 1z0y 1z18 1z0y 1z1i 1z0o 1z18 1z0y 1z3q 1z0y 1z18 1z0y 1z18 1z0y 1z18 1z0y 1z18 1z0y 1z18 1z0y 1lk8 dgq 1z18 1z18 1z3g 1z0y 1z0y 1z18 1z18 1z0y 1z0y 1z18 1yx2 3w 1z18 60o 1t0a 1z18 1z0y 1z18 1z0y",il="3cf27f17c00j3ch21n1ek00l1el3cj1vv1kd00n3cl3cn1q31q500p3cp1vx00r1kb3cs3aw1ej21p00t3ax3ay17b27h00w3b02g20yq01w2d611m01x3b52aa14i01y24i1bq0203bd3be1q21q60253bf39e39f39h14e2ae02d39j11i2da02e39l0ym02f39n2lt0sz03a39p2ix0vv03b39r2d511n39t03d27d17f03f39x39y21l1en03h3a03a11vt1kf03j37w37x1q11q703l37z1k903n1vz3821eh03p21r38714d03t11h03u2db38a0vp2j303w2lz38g03x0st2rk0n804o38l2oo0q404p38n2iw0vw04r36f36h2a814k04u36k36l1vs1kg04z36o36p1n41t405236q36x36y0ss2m005d3720n02rs05f3742uf0kd0633763772on0q506537834y2fz0yt06834z2d311p06935235424f1bt06c35621j1ep06d3581yn1hl06e35a1sv1nd06g35b1pz1q906h35d35e35g1ef21t06l35h1bj24p06m35k35l11f2dd06q35n0vn2j506s35p35q0pv2ox06u35s0mz2rt06v35t33h0k32up06w2x90hi08y2ud0ke08z33r2lp0t20922fx0yu0942a514m09624d1bu0983441yl1hm09a1vp1ki09b1px1qa09d34e1n11t609e1h91yy09g1ed21u09h1a227m0831492ai09l0yh2ga09n0sp2m209p0pt2oy09q0k12uq09s2xo0h52z209t31k0en0bt2780c319z0az0e831z0cq",sl=52,Kd=240;function cl(t){let e=0;return t.split(" ").map(n=>(e+=Number.parseInt(n,36),e/1e4))}var Qa;function Jd(){if(!Qa){let t=cl(Zd),e=cl(Yd),n=[];for(let o=0;o<il.length;o+=3){let r=Number.parseInt(il.slice(o,o+3),36);n.push({cx:t[Math.floor(r/sl)],cy:e[r%sl]});}Qa=n;}return Qa}function tf(t){let e=0;for(let n=0;n<t.length;n++)e=e*32-e+t.charCodeAt(n),e%=2147483647;return Math.abs(e)}function hl(t){let e=Jd(),n=tf(t),o=()=>(n=(n*9301+49297)%233280,n/233280),r=e.map((a,i)=>i);for(let a=r.length-1;a>0;a--){let i=Math.floor(o()*(a+1));[r[a],r[i]]=[r[i],r[a]];}return r.slice(0,Kd).sort((a,i)=>a-i).map(a=>e[a])}var ll=300,ef=49,nf=6;function pl(t,e){if(ll/e<=ef+.5)return t;let n=rr,o=rr+ll,r=nf*e+e/2;return t.filter(({cx:a,cy:i})=>Math.max(n-a,a-o,n-i,i-o)>=r)}var gl="Scan the QR code * Scan the QR code * Scan the QR code * Scan the QR code *",ar=32,bl=3.5,rf=ar*Nn,yl=246.5,ie=2*Math.PI*yl,za=.36,ul=yl+za*ar,Ga=400;function Mn(t,e){return t===" "||/[il1|!']/.test(t)?e*.3:/[mwMW@%&]/.test(t)?e*.8:e*.6}function of(t){let e=t.slice(0,Ga).split(" ").map(n=>dn(n,Ga)).join(" ");return Array.from(e).slice(0,Ga)}var af="\u2026",_l=1;function xl(t,e,n,o=false){return o&&e===t.length-1?_l*n:Mn(t[e],n)}function qa(t,e,n=false){let o=0;for(let r=0;r<t.length;r++)o+=xl(t,r,e,n);return o}function Ua(t,e,n,o=false){return qa(t,e,o)+n*Math.max(0,t.length-1)+Mn(" ",e)+2*n<=ie}var $l=t=>t.join("").split(" ").filter(Boolean),sf=(t,e)=>Array.from(Array.from({length:e},()=>t.join(" ")).join(" "));function Sl(t,e,n){if(Ua(t,e,n))return {chars:t,fontSize:e,letterSpacing:n};let o=Math.min(n,0),r=Math.min(e,rf),a=(h,p=false)=>{let b=qa(h,e,p)+Mn(" ",e),y=h.length+1,_=(ie-b)/y;if(_>=o)return {chars:h,fontSize:e,letterSpacing:_,cut:p};let w=(ie-o*y)/b*e;return w>=r?{chars:h,fontSize:w,letterSpacing:o,cut:p}:null},i=a(t);if(i)return i;let c=$l(t),s=wl(c);for(let h=c.length/s.length-1;h>=1;h--){let p=sf(s,h);if(Ua(p,r,o))return a(p)??{chars:p,fontSize:r,letterSpacing:o}}let l=ie-Mn(" ",r)-_l*r-2*o,m=0,u=0,f=0;for(let[h,p]of t.entries()){if(m+=Mn(p,r)+o,m>l)break;f=h+1,(f===t.length||t[f]===" ")&&(u=f);}let d=[...cf(t.slice(0,u>0?u:f)),af];return (Ua(d,e,n,true)?{chars:d,fontSize:e,letterSpacing:n,cut:true}:null)??a(d,true)??{chars:d,fontSize:r,letterSpacing:o,cut:true}}function cf(t){let e=t.length;for(;e>0&&/[\s.,;:!?*·•\-–—]/u.test(t[e-1]);)e--;return t.slice(0,e)}function wl(t){for(let e=1;e<t.length;e++)if(t.length%e===0&&t.every((n,o)=>n===t[o%e]))return t.slice(0,e);return t}function lf(t,e,n){let o=$l(t);if(o.length===0)return {chars:[],fontSize:e,letterSpacing:n};let r=Array.from(wl(o).join(" ")),a=qa(r,e)+Mn(" ",e),i=a+(r.length+1)*n,c=Math.min(n,0),s=null;for(let l of new Set([Math.floor(ie/i),Math.ceil(ie/i)])){if(l<1)continue;let m=(ie-l*a)/(l*(r.length+1));if(m>=c&&(!s||Math.abs(m-n)<Math.abs(s.letterSpacing-n))){let u=Array.from({length:l},()=>r.join(""));s={chars:Array.from(u.join(" ")),fontSize:e,letterSpacing:m};}}return s??Sl(r,e,n)}function Cl(t,e){let{position:n,rotation:o}=e,r=of(t),a=e.fill==="repeat"?lf(r,e.fontSize,e.letterSpacing):Sl(r,e.fontSize,e.letterSpacing),{fontSize:i,letterSpacing:c}=a,s=[],l=0;for(let[h,p]of a.chars.entries()){let b=xl(a.chars,h,i,a.cut);s.push({char:p,along:l+b/2}),l+=b+c;}let m=l-(s.length>0?c:0),u=n!=="bottom",f=u?ul-za*i:ul+za*i,d=m/ie*180,g=[];for(let{char:h,along:p}of s){if(h.trim()==="")continue;let b=p/ie*360,y=u?o-d+b:o+180+d-b,_=y*Math.PI/180;g.push({char:h,x:j(_e+f*Math.sin(_)),y:j(_e-f*Math.cos(_)),rotate:j(u?y:y-180)});}return {text:a.chars.join(""),letters:g,fontSize:i===e.fontSize?i:j(i),letterSpacing:c}}var Rn=(t,e)=>typeof t=="number"&&Number.isFinite(t)?t:e,Ml={id:"DotRing",name:"Dot Ring",description:"A round code in a ring of dots of its own for every link, with text along the ring",wrapper:(t,e,n)=>{let o=yt(e?.fgColor,"#000000"),r=yt(e?.bgColor,"#ffffff"),a=n?.pixelSize??9,i=j(a/2),c=pl(hl(n?.url??""),a),s=Rn(e?.fontSize,ar),l=s>0?s:ar,m=typeof e?.customText=="string"?e.customText:gl,u=Cl(m,{fontSize:l,letterSpacing:Rn(e?.fontLetterSpacing,bl),position:e?.textPosition==="bottom"?"bottom":"top",rotation:Rn(e?.textRotation,0),fill:e?.textFill==="repeat"?"repeat":"none"}),f=e?.textColor||"#ffffff",d=e?.fontFamily||Dr,g=e?.fontWeight??900,h=Rn(e?.strokeWidth,0),p=e?.strokeColor||"#000000",b=[{radius:_e,width:Rn(e?.outerStrokeWidth,h),color:e?.outerStrokeColor||p},{radius:dl,width:Rn(e?.innerStrokeWidth,h),color:e?.innerStrokeColor||p}].filter(y=>y.width>0);return St("svg",{height:or,id:"svgQrWrapper",style:{width:"100%",height:"100%"},viewBox:`0 0 ${or} ${or}`,width:or,xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",children:[v("circle",{cx:_e,cy:_e,fill:r,r:ml}),v("g",{fill:o,children:c.map((y,_)=>v("circle",{cx:y.cx,cy:y.cy,r:i},_))}),v("path",{d:fl,fill:e?.outerCircleColor||o}),b.map((y,_)=>v("circle",{cx:_e,cy:_e,fill:"none",r:y.radius,stroke:y.color,strokeWidth:y.width},_)),v("g",{"aria-hidden":"true",children:u.letters.map((y,_)=>v("text",{fill:f,fontFamily:d,fontSize:u.fontSize,fontWeight:g,textAnchor:"middle",transform:`rotate(${y.rotate} ${y.x} ${y.y})`,x:y.x,y:y.y,children:y.char},_))}),v("g",{transform:`translate(${rr} ${rr})`,children:t})]})}};var Rl={kind:"qrdx.frame",version:1,artboard:{width:220,height:277},qr:{x:52,y:122,size:114,padding:0,plate:"none"},colors:{frame:"#000000"},shapes:[{type:"circle",cx:110,cy:167.682,r:99.318,fill:"#FFFFFF",stroke:{color:"#F89941",width:20}},{type:"ellipse",cx:139.989,cy:67.895,rx:35.445,ry:48.442,fill:"#F89941"},{type:"path",d:"M159.937 69.076C159.937 82.657 156.092 94.845 150.005 103.57C143.912 112.304 135.736 117.381 126.992 117.381C118.247 117.381 110.072 112.304 103.979 103.57C97.891 94.845 94.047 82.657 94.047 69.076C94.047 55.495 97.891 43.308 103.979 34.582C110.072 25.849 118.247 20.771 126.992 20.771C135.736 20.771 143.912 25.849 150.005 34.582C156.092 43.308 159.937 55.495 159.937 69.076Z",fill:"#F89941",stroke:{color:"#E78249",width:5}},{type:"ellipse",cx:126.072,cy:69.487,rx:34.051,ry:50.662,fill:"#F89941"},{type:"path",d:"M143.396 69.667C143.396 82.739 139.562 94.472 133.488 102.874C127.412 111.279 119.235 116.2 110.451 116.2C101.666 116.2 93.489 111.279 87.413 102.874C81.34 94.472 77.506 82.739 77.506 69.667C77.506 56.595 81.34 44.862 87.413 36.46C93.489 28.055 101.666 23.134 110.451 23.134C119.235 23.134 127.412 28.055 133.488 36.46C139.562 44.862 143.396 56.595 143.396 69.667Z",fill:"#F89941",stroke:{color:"#E78249",width:5}},{type:"ellipse",cx:106.316,cy:70.849,rx:33.673,ry:47.851,fill:"#F89941"},{type:"ellipse",cx:78.743,cy:68.448,rx:35.445,ry:48.442,fill:"#F89941"},{type:"path",d:"M58.794 69.63C58.794 83.211 62.639 95.399 68.726 104.124C74.819 112.858 82.995 117.935 91.739 117.935C100.484 117.935 108.659 112.858 114.753 104.124C120.84 95.399 124.685 83.211 124.685 69.63C124.685 56.049 120.84 43.861 114.753 35.136C108.659 26.402 100.484 21.325 91.739 21.325C82.995 21.325 74.819 26.402 68.726 35.136C62.639 43.861 58.794 56.049 58.794 69.63Z",fill:"#F89941",stroke:{color:"#E78249",width:5}},{type:"ellipse",cx:91.744,cy:69.763,rx:32.944,ry:50.385,fill:"#F89941"},{type:"path",d:"M75.335 70.221C75.335 83.293 79.169 95.025 85.243 103.427C91.319 111.833 99.496 116.753 108.281 116.753C117.065 116.753 125.242 111.833 131.318 103.427C137.392 95.025 141.226 83.293 141.226 70.221C141.226 57.148 137.392 45.416 131.318 37.014C125.242 28.609 117.065 23.688 108.281 23.688C99.496 23.688 91.319 28.609 85.243 37.014C79.169 45.416 75.335 57.148 75.335 70.221Z",fill:"#F89941",stroke:{color:"#E78249",width:5}},{type:"ellipse",cx:111.677,cy:70.871,rx:32.39,ry:47.616,fill:"#F89941"},{type:"ellipse",cx:106.971,cy:71.425,rx:33.221,ry:47.616,fill:"#F89941"},{type:"path",d:"M130.85 46.678C137.21 42.252 138.538 40.633 139.867 39.014C139.867 39.014 141.806 43.824 141.88 46.357C141.954 48.89 141.712 50.147 139.248 51.647C136.783 53.146 127.406 53.045 122.083 52.975C121.31 52.5 122.72 52.337 130.85 46.678Z",fill:"#000000"},{type:"path",d:"M87.765 46.512C81.392 42.141 80.058 40.548 78.724 38.954C78.724 38.954 76.783 45.836 76.758 46.822C76.733 47.808 76.657 50.805 80.247 52C83.837 53.194 91.234 52.772 96.551 52.727C97.322 52.265 95.912 52.099 87.765 46.512Z",fill:"#000000"},{type:"path",d:"M132 90.5C139.156 83.16 141.5 78.283 143.351 72.935C144.24 70.367 134.909 72.043 130 72.935C129.276 73.066 127.751 76.915 127 77C126.182 77.093 123.841 73.076 123 73.086C121.725 73.101 119.727 73.086 117.875 73.429C117.345 74.365 118.367 77.575 117.875 78.283C117.321 78.283 113.796 77.26 113.242 76.43C112.689 74.492 112.949 73.363 112.118 72.532C109.555 72.908 110.023 72.657 107.412 73.086C106.768 73.192 105.09 77.721 104.441 77.82C103.615 77.945 100.644 74.009 99.809 74.114C98.747 74.248 96.821 74.468 95.64 74.577C95.126 74.624 95.554 77.502 95.177 78.283C94.898 78.862 91.426 77.892 90.5 77.5C90.037 76.502 89.844 74.558 89 74.577C83 74.114 81.4 73.843 75.575 70.871C75.575 70.871 74.5 80 83 89C91.5 98 119.127 103.706 132 90.5Z",fill:"#000000"},{type:"path",d:"M107.238 7.252C109.192 1.731 114.678 0.363 117.935 0L120.377 1.816C121.158 2.397 121.842 2.409 122.331 3.257C122.331 4.225 118.337 5.42 114.429 6.582C109.545 8.035 111.482 17.053 114.429 19.281C115.401 20.015 115.524 19.964 117.966 19.964C120.029 19.964 122.387 18.247 123.566 17.353C123.566 17.353 123.861 20.257 121.798 21.478C119.735 22.698 115.578 21.858 115.608 21.966C116.493 23.918 118.89 22.489 120.029 23.336C119.346 23.336 118.556 24.289 116.198 24.533C114.672 24.58 114.135 24.533 112.956 23.918C111.777 23.304 111.482 22.87 110.893 22.14C108.83 23.36 110.893 25.431 110.893 25.431C110.893 25.431 106.472 25.851 105.587 23.918C105.264 23.212 105.882 22.14 105.587 21.966C103.819 22.454 102.935 23.481 99.373 22.87C96.312 22.344 97.102 18.321 96.451 17.353C99.381 18.079 97.131 20.039 101.327 19.964C112.838 19.758 104.796 14.153 107.238 7.252Z",fill:"#5D725F"}],labels:[]};var El=Yt({id:"Halloween",name:"Halloween",description:"QR code with Halloween theme",spec:Rl,at:{x:38,y:10,scale:1}});var Al={kind:"qrdx.frame",version:1,artboard:{width:316,height:316},qr:{x:20,y:20,size:276,padding:0,plate:"none"},colors:{frame:"#000000"},shapes:[{type:"path",d:"M308 8H8v300h300V8ZM0 0v316h316V0H0Z",fill:"frame",fillRule:"evenodd"}],labels:[]};var Pl=Yt({id:"SquareBorder",name:"Square Border",description:"QR code with square decorative border",spec:Al,at:{x:0,y:0,scale:300/316}});var vl={kind:"qrdx.frame",version:1,artboard:{width:208,height:298},qr:{x:14,y:14,size:180,padding:0,plate:"none"},colors:{frame:"#000000"},shapes:[{type:"path",d:"M197 0.7h-186a10.25 10.25 0 0 0 -10.2 10.12v186A10.13 10.13 0 0 0 11 207H197a10.13 10.13 0 0 0 10.12 -10.12v-186A10.13 10.13 0 0 0 197 0.7Zm2.36 193.05a5.46 5.46 0 0 1 -5.47 5.47H14.16a5.46 5.46 0 0 1 -5.47 -5.47V13.93a5.46 5.46 0 0 1 5.47 -5.47H193.91a5.46 5.46 0 0 1 5.47 5.47Z",fill:"frame"},{type:"path",d:"M197.54 237.81H127.61a2.29 2.29 0 0 1 -1.62 -0.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 0.67H10.09A9.15 9.15 0 0 0 0.93 247v41.17a9.16 9.16 0 0 0 9.16 9.16H197.61a9.09 9.09 0 0 0 9.09 -9.16V247A9.16 9.16 0 0 0 197.54 237.81Z",fill:"frame"}],labels:[]};var Ll=Yt({id:"StandardBox",name:"Standard Box",description:"QR code with standard box",spec:vl,at:{x:46,y:1,scale:1}});var Fl={kind:"qrdx.frame",version:1,artboard:{width:252,height:300},qr:{x:40,y:38,size:174,padding:0,plate:"none"},colors:{frame:"#000000"},shapes:[{type:"path",d:"M171.11 290.77l-7.28 4.88a2.16 2.16 0 0 0 -0.57 3a2.21 2.21 0 0 0 1.77 0.92a2.4 2.4 0 0 0 1.2 -0.35l7.28 -4.88a2.14 2.14 0 0 0 -2.4 -3.54Z",fill:"#22071b"},{type:"path",d:"M242.85 227.52l-7.28 4.87a2.16 2.16 0 0 0 -0.57 3a2.21 2.21 0 0 0 1.77 0.92a1.86 1.86 0 0 0 1.2 -0.35l7.28 -4.88a2.13 2.13 0 1 0 -2.4 -3.53Z",fill:"#22071b"},{type:"path",d:"M17 176.34l-9.11 6.08a2.15 2.15 0 0 0 -0.57 3a2.19 2.19 0 0 0 1.77 0.92a2.14 2.14 0 0 0 1.2 -0.35l9.12 -6.08A2.14 2.14 0 0 0 17 176.34Z",fill:"#22071b"},{type:"path",d:"M17 269.08l-9.11 6.07a2.15 2.15 0 0 0 -0.57 3a2.19 2.19 0 0 0 1.77 0.92a2.92 2.92 0 0 0 1.2 -0.35l9.12 -6.08A2.14 2.14 0 0 0 17 269.08Z",fill:"#22071b"},{type:"path",d:"M123 10.1a2.4 2.4 0 0 0 1.14 -0.35l7.7 -5.16a2.13 2.13 0 0 0 -2.4 -3.53l-7.64 5.15a2.15 2.15 0 0 0 -0.56 3A2.19 2.19 0 0 0 123 10.1Z",fill:"#22071b"},{type:"path",d:"M251.54 54.77a2.14 2.14 0 0 0 -3 -0.56l-17.1 11.45V31.31a10.18 10.18 0 0 0 -10.18 -10.18H113.22l-10.39 7a2.4 2.4 0 0 1 -1.2 0.35a2.21 2.21 0 0 1 -1.77 -0.92a2.15 2.15 0 0 1 0.57 -3l1.41 -0.92l13.64 -8.76a2.1 2.1 0 1 0 -2.26 -3.54L98 21.2h-8.13l-10.39 7a2.37 2.37 0 0 1 -1.2 0.35a2.19 2.19 0 0 1 -1.76 -0.92a2.15 2.15 0 0 1 0.56 -3L100 9.25a2.13 2.13 0 1 0 -2.4 -3.53l-23 15.48H34.2A10.18 10.18 0 0 0 24 31.38v28L7.34 70.46a2.09 2.09 0 0 0 -0.57 3a2 2 0 0 0 1.77 0.92a2.58 2.58 0 0 0 1.2 -0.35l14.35 -9.54l3.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 -0.56 3a2 2 0 0 0 1.77 0.92a2.34 2.34 0 0 0 1.2 -0.36l7.35 -4.94A2.13 2.13 0 0 1 28.69 84l-4.46 3v65.66L1.05 168.07a2.15 2.15 0 0 0 -0.57 3a2 2 0 0 0 1.77 0.92a2.37 2.37 0 0 0 1.2 -0.35l25 -16.75a2 2 0 0 1 2.62 0.77a2.16 2.16 0 0 1 -0.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 -0.57 3a2.06 2.06 0 0 0 1.77 0.92a2.38 2.38 0 0 0 1.2 -0.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 -0.56 3a2 2 0 0 0 1.76 0.91a2.37 2.37 0 0 0 1.2 -0.35l30.54 -20.28a2.15 2.15 0 0 1 3 0.56a2.1 2.1 0 0 1 -0.57 3l-14.21 9.54H193l-4.6 3a2.16 2.16 0 0 0 -0.63 3a2.11 2.11 0 0 0 1.76 1a2 2 0 0 0 1.13 -0.36L213 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 0.35a2.19 2.19 0 0 1 -1.77 -0.92a2.15 2.15 0 0 1 0.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 0.36a2.22 2.22 0 0 1 -1.76 -0.92a2.15 2.15 0 0 1 0.56 -3l6.72 -4.52l13.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 0.36a2.22 2.22 0 0 1 -1.76 -0.92a2.15 2.15 0 0 1 0.56 -3l6.72 -4.52l19.43 -13.08A2.05 2.05 0 0 0 251.54 54.77ZM213 216.07h-172a5.23 5.23 0 0 1 -5.23 -5.24V38.94a5.22 5.22 0 0 1 5.23 -5.23H213a5.22 5.22 0 0 1 5.23 5.23V210.83h0.07A5.22 5.22 0 0 1 213 216.07Z",fill:"#22071b"},{type:"path",d:"M246.45 139.8l-7.28 4.88a2.15 2.15 0 0 0 -0.56 3a2.22 2.22 0 0 0 1.76 0.92a2.44 2.44 0 0 0 1.21 -0.36l7.28 -4.87a2.14 2.14 0 0 0 -2.41 -3.54Z",fill:"#22071b"}],labels:[]};var kl=Yt({id:"StrikedBox",name:"Striked Box",description:"QR code with striked box",spec:Fl,at:{x:24,y:0,scale:1}});var ir={default:al,Arrow:ol,StandardBox:Ll,SquareBorder:Pl,StrikedBox:kl,Halloween:El,DotRing:Ml},Il={FlamQR:"DotRing"},Zr=t=>{if(Object.hasOwn(ir,t))return ir[t];let e=Object.hasOwn(Il,t)?Il[t]:void 0;return e?ir[e]:void 0},oy=()=>Object.values(ir),ay=()=>Object.keys(ir);var Wa=t=>Math.round(Math.min(Math.max(t,0),255)).toString(16).padStart(2,"0");function Dl(t){return `#${Wa(t.r)}${Wa(t.g)}${Wa(t.b)}`}function Yr(t){let e=lt(t);return !e||e.a>=1||e.a<=0?{color:t}:{color:Dl(e),opacity:j(e.a,3)}}function Kr(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}}var Bl={r:0,g:0,b:0,a:1};function hf(t){return [...t].map(e=>({offset:Math.min(Math.max(e.offset/100,0),1),color:lt(e.color)??Bl})).sort((e,n)=>e.offset-n.offset)}function Ha(t,e){let n=t[0],o=t.at(-1);if(!(n&&o))return Bl;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,m=(u,f)=>{let d=u*a.color.a+(f*i.color.a-u*a.color.a)*s;return l>0?d/l:u+(f-u)*s};return {r:m(a.color.r,i.color.r),g:m(a.color.g,i.color.g),b:m(a.color.b,i.color.b),a:l}}}return o.color}var Tl=4,Nl=720,pf=2;function Ql(t,e,n,o,r){let a=hf(t);if(a.length===0)return {wedges:[]};let i=a[0].color.a,c=a.every(y=>Math.abs(y.color.a-i)<.002),s=[...new Set([0,...a.map(y=>y.offset),1])].sort((y,_)=>y-_),l=[];for(let y=0;y+1<s.length;y++){let _=s[y],w=s[y+1];if(w<=_)continue;let C=Ha(a,_+1e-9),S=Ha(a,w-1e-9),$=Math.max(Math.abs(C.r*C.a-S.r*S.a),Math.abs(C.g*C.a-S.g*S.a),Math.abs(C.b*C.a-S.b*S.a),Math.abs(C.a-S.a)*255),M=Math.ceil($/pf),R=Math.ceil((w-_)*360/Tl),E=Math.max(1,M,R);for(let P=0;P<E;P++)l.push([_+(w-_)*P/E,_+(w-_)*(P+1)/E]);}let m=l;if(l.length>Nl){let y=Math.ceil(l.length/Nl);m=[];for(let _=0;_<l.length;_+=y){let w=l.slice(_,_+y);m.push([w[0][0],w.at(-1)[1]]);}}let u=e-90,f=r/Math.cos(2*Tl/2*(Math.PI/180)),d=y=>{let _=y*Math.PI/180;return [x(n+f*Math.cos(_)),x(o+f*Math.sin(_))]},g=`${x(n)} ${x(o)}`,h=y=>j((y%360+360)%360,4),p=m.length-1,b=m.map(([y,_],w)=>{let C=Ha(a,(y+_)/2),S=(_-y)*360,$=c&&w===0&&p>0?S:0,M=c&&w<p?S:0,R=u+y*360-$,E=u+_*360+M,[P,L]=d(R),[F,I]=d(E);return {d:`M${g}L${P} ${L}L${F} ${I}Z`,color:Dl(C),...c||C.a>=1?{}:{opacity:j(C.a,3)},from:h(R),sweep:j(E-R,4)}});return c&&i<1?{wedges:b,opacity:j(i,3)}:{wedges:b}}function Ol(t,e,n,o){return (Math.atan2(o-e,n-t)*180/Math.PI%360+360)%360}function Gl(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=Ol(t,e,n.x+n.width/2,n.y+n.height/2),i=0,c=0;for(let[s,l]of r){let m=Ol(t,e,s,l)-a;m>180?m-=360:m<=-180&&(m+=360),i=Math.min(i,m),c=Math.max(c,m);}return [a+i,a+c]}function Ul(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}function Xa(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 Wl(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 gf(t,e,n){return t<7&&e<7||t>=n-7&&e<7||t<7&&e>=n-7}var bf=.9;function Va(t,e){let{margin:n,pixelSize:o,pattern:r="circle",plain:a=false}=e;if(jc(r))return Zc(t,{margin:n,pixelSize:o,pattern:r,scale:e.scale,plain:a});let i=Vr(e.scale,r),c=[],s=t.length,l=o*.45,m=a?()=>false:Na(s);return t.forEach((u,f)=>{u.forEach((d,g)=>{if(d&&(a||!gf(g,f,s))){let h=(g+.5+n)*o,p=(f+.5+n)*o,b=`${g}-${f}`,y=c.length;if(m(g,f)){c.push(v("rect",{height:x(o),width:x(o),x:x(h-o/2),y:x(p-o/2)},b));return}switch(r){case "circle":c.push(v("circle",{cx:x(h),cy:x(p),r:x(l),transform:A`rotate(0,${h},${p})`},b));break;case "circle-large":{let _=o*.5;c.push(v("circle",{cx:x(h),cy:x(p),r:x(_),transform:A`rotate(0,${h},${p})`},b));}break;case "small-square":{let _=o*.357143;c.push(v("path",{d:A`M ${h-_} ${p-_}v ${o*.714286}h ${o*.714286}v -${o*.714286}z`,transform:A`rotate(0,${h},${p})`},b));}break;case "diamond":{let _=o*.357143;c.push(v("path",{d:A`M ${h-_} ${p-_}v ${o*.714286}h ${o*.714286}v -${o*.714286}z`,transform:A`rotate(45,${h},${p})`},b));}break;case "circle-mixed":{let _=(g+f)%3===0?bf:(g+f)%2===0?1:1.25,w=l*_;c.push(v("circle",{cx:x(h),cy:x(p),r:x(w),transform:A`rotate(0,${h},${p})`},b));}break;case "pacman":{let _=o*.5,w=o*.357143;c.push(v("path",{d:A`M ${h-_} ${p-w}v ${o*.714286}h ${_}a ${_*.5} ${_*.5}, 0, 0, 0, 0 -${o*.714286}h -${_}v -${o*.714286}z`,transform:A`rotate(${(g+f)%2===0?0:90},${h},${p})`},b));}break;case "rounded":{let _=o*.5,w=o*.2;c.push(v("rect",{height:x(o),rx:x(w),ry:x(w),transform:A`rotate(0,${h},${p})`,width:x(o),x:x(h-_),y:x(p-_)},b));}break;case "square":{let _=o*.5;c.push(v("rect",{height:x(o),transform:A`rotate(0,${h},${p})`,width:x(o),x:x(h-_),y:x(p-_)},b));}break;case "vertical-line":{let _=o*.714286,w=o;c.push(v("path",{d:A`M ${h-o*.5} ${p-_*.5}v ${_}h ${w}v -${_}z`,transform:A`rotate(90,${h},${p})`},b));}break;default:c.push(v("circle",{cx:x(h),cy:x(p),r:x(l),transform:A`rotate(0,${h},${p})`},b));}if(i!==1&&c.length>y){let _=c.pop();c.push(v("g",{transform:A`translate(${h},${p}) scale(${x(i,6)}) translate(${-h},${-p})`,children:_},b));}}});}),c}function yf(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 Za(t,e){return `${t}-${Ie(JSON.stringify(e))}`}function _f(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,m=c-l*Math.cos(i),u=s-l*Math.sin(i),f=c+l*Math.cos(i),d=s+l*Math.sin(i);return {x1:m,y1:u,x2:f,y2:d}}function to(t,e){return e.map((n,o)=>{let{color:r,opacity:a}=Yr(n.color);return v("stop",{offset:`${n.offset}%`,stopColor:r,stopOpacity:a},`${t}-stop-${o}`)})}function Hl(t,e,n,o,r,a){let i=Ql(e.stops,e.angle??0,n,o,r),c=i.wedges.map((s,l)=>v("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 v("pattern",{"data-qrdx-conic":`${x(n)} ${x(o)}`,height:x(a),id:t,patternUnits:"userSpaceOnUse",width:x(a),x:0,y:0,children:i.opacity===void 0?c:v("g",{opacity:i.opacity,children:c})},t)}function xf(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}}var $f=["xMin","xMid","xMax"],Sf=["YMin","YMid","YMax"];function Vl(t,e,n){let o=e.scale??1,r=e.fit==="tile",a=r?n/4*o:n,i=e.underlay?Yr(e.underlay):null,c=r?a:n*o,s=xf(e.position),l=r?0:s.x*(n-c),m=r?0:s.y*(n-c),u=r?"xMidYMid slice":`${$f[s.x*2]??"xMid"}${Sf[s.y*2]??"YMid"} ${e.fit==="contain"?"meet":"slice"}`;return St("pattern",{height:x(a),id:t,patternUnits:"userSpaceOnUse",width:x(a),x:0,y:0,children:[i&&v("rect",{fill:i.color,fillOpacity:i.opacity,height:x(a),width:x(a),x:0,y:0}),v("image",{height:x(c),href:e.src,opacity:(e.opacity??1)<1?e.opacity:void 0,preserveAspectRatio:u,width:x(c),x:x(l),y:x(m)})]},t)}var jl=(t,e)=>Za("img",[t,e]);function wf(t,e,n,o,r,a,i){let c=Bt(t);if(c.type==="solid")return null;if(c.type==="image"){let l=jl(c,i);return {id:l,element:Vl(l,c,i)}}let s=Za(a,[c,e,n,o,r,...c.type==="angular"?[i]:[]]);if(c.type==="linear"){let l=c,m=l.angle??0,{x1:u,y1:f,x2:d,y2:g}=_f(m,e,n,o,r);return {id:s,element:v("linearGradient",{gradientUnits:"userSpaceOnUse",id:s,x1:x(u),x2:x(d),y1:x(f),y2:x(g),children:to(s,l.stops)},s)}}if(c.type==="radial"){let l=c,m=e+o/2,u=n+o/2,f=o/2*.97;return {id:s,element:v("radialGradient",{cx:x(m),cy:x(u),fx:x(m),fy:x(u),gradientUnits:"userSpaceOnUse",id:s,r:x(f),children:to(s,l.stops)},s)}}return c.type==="angular"?{id:s,element:Hl(s,c,e+o/2,n+o/2,o*.75,i)}:null}function ja(t,e,n){let o=Bt(t);if(o.type==="solid")return null;if(o.type==="image"){let a=jl(o,e);return {id:a,element:Vl(a,o,e)}}let r=Za(n,[o,e]);if(o.type==="linear"){let a=o,i=a.angle??0,{x1:c,y1:s,x2:l,y2:m}=yf(i,e);return {id:r,element:v("linearGradient",{gradientUnits:"userSpaceOnUse",id:r,x1:x(c),x2:x(l),y1:x(s),y2:x(m),children:to(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:v("radialGradient",{cx:x(i),cy:x(c),fx:x(i),fy:x(c),gradientUnits:"userSpaceOnUse",id:r,r:x(s),children:to(r,a.stops)},r)}}return o.type==="angular"?{id:r,element:Hl(r,o,e/2,e/2,e*.75,e)}:null}var Jr=t=>$n(t)||Sa(t);function zl(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 se(t,e,n){if(e)return {fill:`url(#${e})`};let o=Bt(t,n),r=o.type==="solid"?o.color:o.type==="image"?o.underlay??n:n,{color:a,opacity:i}=Yr(r);return i===void 0?{fill:a}:{fill:a,fillOpacity:i}}function xe(t,e,n,o){if(o==null)return null;let r=t.length,a=Math.floor(e*_r),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,m=o.y==null?r/2-s/2:o.y*i,u=null;if(o.excavate){let f=Math.max(0,o.padding??0)*i,d=Math.floor(l-f),g=Math.floor(m-f),h=Math.ceil(c+l+f-d),p=Math.ceil(s+m+f-g);u={x:d,y:g,w:h,h:p};}return {x:l,y:m,h:s,w:c,excavation:u}}function Tt(t){let e=t.level??Vt,{imageSettings:n}=t,o=t.isOGContext&&n?.excavate&&(e==="L"||e==="M")?"Q":e;if(t.autoLevel&&n&&o!=="H"){let r=gt.QrCode.encodeText(t.value,Rt[o]).getModules(),a=xe(r,t.size??ut,At(r.length,t.margin??dt,t.shape),n);a&&(a.excavation?a.excavation.w*a.excavation.h:a.w*a.h)/(r.length*r.length)>Go&&(o="H");}return o}function Cf(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 sr(t){let{value:e,size:n=ut,level:o=Vt,bgColor:r=bt,fgColor:a=Ct,eyeColor:i,dotColor:c,bodyPattern:s="circle",cornerEyePattern:l="gear",cornerEyeDotPattern:m="circle",margin:u=dt,isOGContext:f=false,imageSettings:d,templateId:g,customTemplate:h,customProps:p,frame:b,art:y,eyeColors:_,moduleScale:w,autoLevel:C,shape:S,frameLabelMarkers:$,partMarkers:M,...R}=t,E=eo({value:e,size:n,margin:u,level:o,shape:S,autoLevel:C,isOGContext:f},d),P=It(b),L=P?{}:R,F=rt=>P?Br(rt,{size:n,frame:b,bgColor:r,svgProps:R,markLabels:$}):rt,I=Tt({value:e,size:n,level:o,margin:u,imageSettings:E,isOGContext:f,autoLevel:C,shape:S}),N=gt.QrCode.encodeText(e,Rt[I]),k=N.getModules(),B=At(k.length,u,S),q=hc(e,k.length,u,S),O=(rt,Lt)=>Ba(M,rt,Lt),G=(rt,Lt)=>{let Wt=$a(S,rt);return Wt?"circle"in Wt?v("circle",{cx:x(rt/2),cy:x(rt/2),...Lt,r:x(rt/2),...O("background")}):v("path",{d:Wt.path,...Lt,...O("background")}):v("rect",{...Lt,height:rt,width:rt,x:0,y:0,...O("background")})},J=k.length+B*2,pt=xe(k,n,B,E),at=null;if(E!=null&&pt!=null){pt.excavation!=null&&(k=Xa(k,pt.excavation));let{imgWidth:rt,imgHeight:Lt,imgLeft:Wt,imgTop:en}=Cf(pt,n,J,B);if(f){let nn=E.shape??"square";at=v("img",{alt:"Logo",src:E.src,style:{position:"absolute",left:`${x(Wt)}px`,top:`${x(en)}px`,width:`${x(rt)}px`,height:`${x(Lt)}px`,...nn!=="square"&&{borderRadius:nn==="circle"?"50%":`${x(Math.min(rt,Lt)*Qr)}px`},...E.plate&&{backgroundColor:E.plate,padding:`${x(rt*Gr)}px`,boxSizing:"border-box"}}});}else at=Ur(E,{x:Wt,y:en,w:rt,h:Lt}),M&&(at=rn(at,O("logo")));}let T=n/J,U=k.length,z=7*T,wt=1.5*T,Me={fgColor:yt(a,Ct),bgColor:yt(r,bt)},kt=Aa(y)?Fa({art:y,modules:k,version:N.version,margin:B,pixelSize:T,...Me,body:rt=>Va(rt,{margin:B,pixelSize:T,pattern:s,scale:w})}):null,Jt=kt&&M?rn(kt,O("body")):kt,Re=kt&&y?Ta({art:y,version:N.version,...Me}):null,Q=kt?null:Va(k,{margin:B,pixelSize:T,pattern:s,scale:w}),et=q?Va(q,{margin:0,pixelSize:T,pattern:s,scale:w,plain:true}):null,V=Bt(r,bt),mt=Bt(a,Ct),In=Jr(V)?ja(V,n,"bg-color"):null,Ro=Jr(mt)?ja(mt,n,"fg-color"):null,S0=se(r,In?.id??null,bt),Gi=se(a,Ro?.id??null,Ct),Ui=Jt?St(Ht,{children:[Jt,et&&v("g",{...Gi,...O("body"),children:et})]}):St("g",{...Gi,...O("body"),children:[Q,et]}),He=B*T,Ve=B*T,je=(U-7+B)*T,Xe=B*T,Ze=B*T,Ye=(U-7+B)*T,Ee=yt(a,Ct),Ke=rt=>_?.[rt]?.outer??Re?.[rt]?.outer??i,Je=rt=>_?.[rt]?.inner??Re?.[rt]?.inner??c,tn=(rt,Lt,Wt,en,nn)=>{let ko=Bt(rt,Ee);return Jr(ko)?wf(ko,Lt,Wt,z,en,nn,n):null},Eo=tn(Ke("topLeft"),He,Ve,"top-left","corners-square-color-0-0"),Ao=tn(Ke("topRight"),je,Xe,"top-right","corners-square-color-1-0"),Po=tn(Ke("bottomLeft"),Ze,Ye,"bottom-left","corners-square-color-0-1"),vo=tn(Je("topLeft"),He,Ve,"top-left","corners-dot-color-0-0"),Lo=tn(Je("topRight"),je,Xe,"top-right","corners-dot-color-1-0"),Fo=tn(Je("bottomLeft"),Ze,Ye,"bottom-left","corners-dot-color-0-1"),zi=se(Ke("topLeft"),Eo?.id??null,Ee),qi=se(Ke("topRight"),Ao?.id??null,Ee),Wi=se(Ke("bottomLeft"),Po?.id??null,Ee),Hi=se(Je("topLeft"),vo?.id??null,Ee),Vi=se(Je("topRight"),Lo?.id??null,Ee),ji=se(Je("bottomLeft"),Fo?.id??null,Ee),Xi=Xr(He,Ve,z,l,"top-left"),Zi=jr(He+z/2,Ve+z/2,wt,m,"top-left"),Yi=Xr(je,Xe,z,l,"top-right"),Ki=jr(je+z/2,Xe+z/2,wt,m,"top-right"),Ji=Xr(Ze,Ye,z,l,"bottom-left"),ts=jr(Ze+z/2,Ye+z/2,wt,m,"bottom-left"),w0=St(Ht,{children:[v("defs",{children:zl([In,Ro,Eo,Ao,Po,vo,Lo,Fo])}),G(n,S0),Ui,v("g",{...zi,...O("eye-outer","top-left"),children:v("path",{d:Xi,fillRule:"evenodd",transform:A`rotate(0,${He+z/2},${Ve+z/2})`})}),v("g",{...Hi,...O("eye-centre","top-left"),children:Zi}),v("g",{...qi,...O("eye-outer","top-right"),children:v("path",{d:Yi,fillRule:"evenodd",transform:A`rotate(0,${je+z/2},${Xe+z/2})`})}),v("g",{...Vi,...O("eye-centre","top-right"),children:Ki}),v("g",{...Wi,...O("eye-outer","bottom-left"),children:v("path",{d:Ji,fillRule:"evenodd",transform:A`rotate(0,${Ze+z/2},${Ye+z/2})`})}),v("g",{...ji,...O("eye-centre","bottom-left"),children:ts}),at]}),es=h||(g?Zr(g):void 0);if(es){let Lt=Jr(V)?ja(V,300,"bg-color-template"):null,Wt=se(r,Lt?.id??null,bt),en=St("svg",{height:300,viewBox:"0 0 300 300",width:300,xmlns:"http://www.w3.org/2000/svg",children:[v("defs",{children:zl([Lt,Ro,Eo,Ao,Po,vo,Lo,Fo])}),G(300,Wt),St("g",{transform:`scale(${x(300/n,6)})`,children:[Ui,v("g",{...zi,...O("eye-outer","top-left"),children:v("path",{d:Xi,fillRule:"evenodd",transform:A`rotate(0,${He+z/2},${Ve+z/2})`})}),v("g",{...Hi,...O("eye-centre","top-left"),children:Zi}),v("g",{...qi,...O("eye-outer","top-right"),children:v("path",{d:Yi,fillRule:"evenodd",transform:A`rotate(0,${je+z/2},${Xe+z/2})`})}),v("g",{...Vi,...O("eye-centre","top-right"),children:Ki}),v("g",{...Wi,...O("eye-outer","bottom-left"),children:v("path",{d:Ji,fillRule:"evenodd",transform:A`rotate(0,${Ze+z/2},${Ye+z/2})`})}),v("g",{...ji,...O("eye-centre","bottom-left"),children:ts}),at]})]}),nn=300/n,C0={pixelSize:T*nn,url:e},ns=es.wrapper(en,{fgColor:a,bgColor:r,...p||{},...R},C0),M0={...ns?.props?.style||{},width:void 0,height:void 0,...L.style};return F(rn(ns,{...L,width:n,height:n,style:M0}))}return F(v("svg",{height:n,viewBox:`0 0 ${n} ${n}`,width:n,xmlns:"http://www.w3.org/2000/svg",...L,children:w0}))}var Ly=(()=>{try{new Path2D().addPath(new Path2D);}catch{return false}return true})(),Fy=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},En=(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},ql=t=>{let e=lt(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)}},ky=(t,e)=>{let n=ql(t),o=ql(e);if(!(n&&o))return 1;let r=En(n.r,n.g,n.b),a=En(o.r,o.g,o.b),i=Math.max(r,a),c=Math.min(r,a);return (i+.05)/(c+.05)},Iy=t=>t>=7?{level:"AAA",warning:false,message:"Excellent contrast"}:t>=4.5?{level:"AA",warning:false,message:"Good contrast"}:t>=3?{level:"AA Large",warning:true,message:"Low contrast - may be difficult to scan"}:{level:"Fail",warning:true,message:"Poor contrast - QR code may not scan properly"};var Xl=.6,Mf=["L","M","Q","H"];function Zl(t){let e=gt.QrCode.encodeText(t.value,Rt[t.level]),n=Mf[e.errorCorrectionLevel.ordinal]??t.level;return {code:t,cells:e.getModules(),layoutMargin:At(e.size,t.margin,t.shape),map:Yn(e.version,n),level:n,version:e.version}}function Yl(t,e){let{cells:n,map:o}=t,r=n.length,a=xe(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 m=Math.max(0,i.x);m<Math.min(r,i.x+i.w);m++)c.push(l*r+m);let s=Kn(o,c);return {worst:Math.max(0,...s),correctable:o.correctable,budget:Math.floor(o.correctable*Xl),level:t.level,version:t.version}}function no(t,e){return Yl(Zl(t),e)}var Kl=t=>!t||t.worst<=t.budget;function Rf(t,e){return Kl(no(t,e))}function Ya(t,e,n,o){let r=e.map(c=>Zl({...t,level:c})),a=c=>{let s=o(c);return r.every(l=>Kl(Yl(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 eo(t,e){if(!e)return;let n=Math.floor(t.size*_r),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??Vt,c={value:t.value,size:t.size,margin:t.margin,shape:t.shape},s=f=>Tt({...t,level:i,imageSettings:f}),l=f=>{let d=Ya(c,[f],o,a);return d>0?a(d):void 0},m=s(e);if(m===i)return l(i);let u=l(m);return u&&s(u)===m?u:l(i)}async function Ka(t){let{value:e,size:n=ut,level:o=Vt,bgColor:r=bt,fgColor:a=Ct,margin:i=dt,imageSettings:c,eyeColor:s,dotColor:l,bodyPattern:m,cornerEyePattern:u,cornerEyeDotPattern:f,isOGContext:d,templateId:g,customTemplate:h,customProps:p,frame:b,art:y,eyeColors:_,moduleScale:w,frameLabelMarkers:C,partMarkers:S,autoLevel:$,...M}=t,R=eo({value:e,size:n,margin:i,level:o,autoLevel:$},c),E=Tt({value:e,size:n,level:o,margin:i,imageSettings:R,autoLevel:$}),P=gt.QrCode.encodeText(e,Rt[E]).getModules(),L=P.length+i*2,F=xe(P,n,i,R),I=null;if(R!=null&&F!=null){F.excavation!=null&&(P=Xa(P,F.excavation));let k=R.src.startsWith("data:")?R.src:await fetch(`https://wsrv.nl/?url=${encodeURIComponent(R.src)}&w=100&h=100&encoding=base64`).then(B=>{if(!B.ok)throw new Error(`Failed to load QR logo (${B.status}): ${R.src}`);return B.text()});I={settings:{...R,src:k},box:{x:F.x+i,y:F.y+i,w:F.w,h:F.h}};}let N=Wl(P,i);return {size:n,numCells:L,fgPath:N,bgColor:r,fgColor:a,frame:b,svgProps:M,logo:I}}function Ja(t){let{size:e,numCells:n,fgPath:o,bgColor:r,fgColor:a,frame:i,svgProps:c,logo:s}=t,l=It(i),m=s?Ur(s.settings,s.box):v(Ht,{}),u=St("svg",{height:e,viewBox:`0 0 ${n} ${n}`,width:e,xmlns:"http://www.w3.org/2000/svg",...l?{}:c,children:[v("path",{d:`M0,0 h${n}v${n}H0z`,fill:yt(r,bt),shapeRendering:"crispEdges"}),v("path",{d:o,fill:yt(a,Ct),shapeRendering:"crispEdges"}),m]});return l&&i?Br(u,{size:e,frame:i,bgColor:r,svgProps:c}):u}async function Ef(t){return Ja(await Ka(t))}var ro={jsx:jsxRuntime.jsx,jsxs:jsxRuntime.jsxs,createElement:react.createElement,cloneElement:react.cloneElement,Fragment:react.Fragment};async function o_(t){let e=await Ka(t);return br(ro,()=>Ja(e))}var d_=(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);},kf=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 m=[1,.8,.6,.4,.2,.1];for(let u of m){let f=Math.floor(t.naturalWidth*e*u/s),d=Math.floor(t.naturalHeight*e*u/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 g=l.getImageData(0,0,f,d);try{let h=r(g.data,f,d);if(h?.data){a(h);return}}catch(h){console.error("QR Detection error:",h);}}catch(g){console.error("Canvas drawing error:",g);}}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 kf(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 f_(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);}var If=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["maskType","mask-type"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Tf=new Map([["className","class"],["tabIndex","tabindex"],["dir","dir"],["role","role"],["viewBox","viewBox"],["width","width"],["height","height"],["xlinkActuate","xlink:actuate"],["xlinkArcrole","xlink:arcrole"],["xlinkRole","xlink:role"],["xlinkShow","xlink:show"],["xlinkTitle","xlink:title"],["xlinkType","xlink:type"],["xmlBase","xml:base"],["xmlLang","xml:lang"],["xmlSpace","xml:space"]]),Nf=new Set(["children","dangerouslySetInnerHTML","key","defaultValue","defaultChecked","innerHTML","suppressContentEditableWarning","suppressHydrationWarning","ref"]),Of=new Set(["inert","allowFullScreen","async","autoPlay","controls","credentialless","default","defer","disabled","disablePictureInPicture","disableRemotePlayback","formNoValidate","hidden","loop","noModule","noValidate","open","playsInline","readOnly","required","reversed","scoped","seamless","itemScope"]),Df=new Set(["autoFocus","multiple","muted"]),Bf=new Set(["contentEditable","spellCheck","draggable","value","autoReverse","externalResourcesRequired","focusable","preserveAlpha"]),Qf=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" ")),tu=":A-Z_a-z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD",Gf=new RegExp(`^[${tu}][${tu}\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`),oo=/^[a-zA-Z][a-zA-Z:_.\-\d]*$/,Uf=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i,zf="javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')",qf=t=>Uf.test(t)?zf:t,nu=new Set(["area","base","br","col","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"]),Wf=/["'&<>]/;function ti(t){if(!Wf.test(t))return t;let e="",n=0;for(let o=0;o<t.length;o++){let r;switch(t.charCodeAt(o)){case 34:r="&quot;";break;case 38:r="&amp;";break;case 39:r="&#x27;";break;case 60:r="&lt;";break;case 62:r="&gt;";break;default:continue}e+=t.slice(n,o)+r,n=o+1;}return e+t.slice(n)}var ce=t=>typeof t=="function"||typeof t=="symbol",eu=new Map,Hf=t=>{let e=eu.get(t);return e===void 0&&(e=t.replace(/([A-Z])/g,"-$1").toLowerCase().replace(/^ms-/,"-ms-"),eu.set(t,e)),e};function Vf(t){if(typeof t=="string")return t;if(typeof t!="object"||t===null)return "";let e="";for(let n of Object.keys(t)){let o=t[n];if(o==null||typeof o=="boolean"||o==="")continue;let r;if(n.startsWith("--"))r=`${n}:${`${o}`.trim()}`;else {let a=typeof o=="number"?o===0||Qf.has(n)?`${o}`:`${o}px`:`${o}`.trim();r=`${Hf(n)}:${a}`;}e=e?`${e};${r}`:r;}return e}function An(t,e){if(e==null||Nf.has(t))return null;let n=Tf.get(t);if(n!==void 0)return ce(e)||typeof e=="boolean"?null:{name:n,value:`${e}`};switch(t){case "style":{let r=Vf(e);return r?{name:"style",value:r}:null}case "src":case "href":case "action":case "formAction":case "xlinkHref":return (t==="src"||t==="href")&&e===""||ce(e)||typeof e=="boolean"?null:{name:t==="xlinkHref"?"xlink:href":t,value:qf(`${e}`)};case "capture":case "download":return e===true?{name:t,value:""}:e===false||ce(e)?null:{name:t,value:`${e}`};case "cols":case "rows":case "size":case "span":return ce(e)||Number.isNaN(Number(e))||!(e>=1)?null:{name:t,value:`${e}`};case "rowSpan":case "start":return ce(e)||Number.isNaN(Number(e))?null:{name:t,value:`${e}`};}if(Df.has(t))return e&&!ce(e)?{name:t.toLowerCase(),value:""}:null;if(Bf.has(t))return ce(e)?null:{name:t,value:`${e}`};if(Of.has(t))return e&&!ce(e)?{name:t,value:""}:null;if(t.length>2&&(t[0]==="o"||t[0]==="O")&&(t[1]==="n"||t[1]==="N"))return null;let o=If.get(t)??t;if(!Gf.test(o)||ce(e))return null;if(typeof e=="boolean"){let r=o.toLowerCase().slice(0,5);if(r!=="data-"&&r!=="aria-")return null}return {name:o,value:`${e}`}}var ru="http://www.w3.org/2000/svg",ou="http://www.w3.org/1999/xhtml",jf="http://www.w3.org/1999/xlink",Xf="http://www.w3.org/XML/1998/namespace",Zf="http://www.w3.org/2000/xmlns/";function Yf(t,e,n){e==="xmlns"||e.startsWith("xmlns:")?t.setAttributeNS(Zf,e,n):e.startsWith("xlink:")?t.setAttributeNS(jf,e,n):e.startsWith("xml:")?t.setAttributeNS(Xf,e,n):t.setAttribute(e,n);}function cr(t,e,n,o){if(e==null||typeof e=="boolean")return;if(typeof e=="string"||typeof e=="number"||typeof e=="bigint"){t.appendChild(o.createTextNode(`${e}`));return}if(Array.isArray(e)){for(let s of e)cr(t,s,n,o);return}if(!Ae(e))throw new TypeError("qrdx: can't render this value as DOM nodes");let{type:r,props:a}=e;if(on(r)){cr(t,a.children,n,o);return}if(typeof r=="function"){cr(t,r(a),n,o);return}if(!oo.test(r))throw new TypeError(`qrdx: invalid element name: ${r}`);let i=r==="svg"?ru:n,c=o.createElementNS(i,r);for(let s of Object.keys(a)){let l=An(s,a[s]);l&&Yf(c,l.name,l.value);}cr(c,a.children,i===ru&&r==="foreignObject"?ou:i,o),t.appendChild(c);}function ei(t,e=document){let n=e.createDocumentFragment();return cr(n,t,ou,e),n}function ze(t){if(t==null||typeof t=="boolean")return "";if(typeof t=="string")return ti(t);if(typeof t=="number"||typeof t=="bigint")return `${t}`;if(Array.isArray(t)){let e="";for(let n of t)e+=ze(n);return e}if(!Ae(t))throw new TypeError("qrdx: can't render this value as SVG markup");return Kf(t)}function Kf(t){let{type:e,props:n}=t;if(on(e))return ze(n.children);if(typeof e=="function")return ze(e(n));if(!oo.test(e))throw new TypeError(`qrdx: invalid element name: ${e}`);let o=`<${e}`;for(let i of Object.keys(n)){let c=An(i,n[i]);c&&(o+=` ${c.name}="${ti(c.value)}"`);}if(nu.has(e))return `${o}/>`;let r=n.dangerouslySetInnerHTML?.__html,a=r==null?ze(n.children):`${r}`;return `${o}>${a}</${e}>`}function ni(t){return ze(sr(t))}function Jf(t,e=document){return ei(sr(t),e).firstChild}var th=16384;var ri=[17,18,0,1,2,3,4,5,16,6,7,8,9,10,11,12,13,14,15],eh=8,oi=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 uu(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 m=Array.from({length:r},(h,p)=>p).sort((h,p)=>i[h]-i[p]||h-p),u=0,f=r,d=h=>u<r&&(f>=h||i[m[u]]<=i[f])?m[u++]:f++;for(let h=r;h<a;h++){let p=d(h),b=d(h);i[h]=i[p]+i[b],c[p]=h,c[b]=h;}s[a-1]=0;let g=0;for(let h=a-2;h>=0;h--){let p=s[c[h]]+1;s[h]=p,h<r&&p>g&&(g=p);}if(g<=e){for(let h=0;h<r;h++)n[o[h]]=s[h];return n}}}function nh(t,e){let n=0;for(let o=0;o<e;o++)n=n<<1|t>>o&1;return n}function mu(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]=nh(l,c),i[s]=n===1?0:c;}),{lengths:t,codes:a,emitted:i}}function qe(t,e,n){t.write(e.codes[n],e.emitted[n]);}function rh(t){let e=[],n=a=>e.push({code:a,extra:0,extraBits:0}),o=eh,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 oh(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=rh(e),r=new Uint32Array(19);for(let c of o)r[c.code]=r[c.code]+1;let a=mu(uu(r,7)),i=ri.length;for(;i>4&&a.lengths[ri[i-1]]===0;)i--;t.write(0,1),t.write(i-4,4);for(let c=0;c<i;c++)t.write(a.lengths[ri[c]],3);t.write(0,1);for(let c of o)qe(t,a,c.code),t.write(c.extra,c.extraBits);}function ao(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 au(t,e,n,o){let r=0;for(;r<o&&t[e+r]===t[e+r-n];)r++;return r}function iu(t,e,n){let o=t.length,r=0;for(;r<o;){let a=Math.min(4096,o-r),i=r>=1?au(t,r,1,a):0,c=r>=e?au(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 su=20;function cu(t,e,n){for(let o=0;o<n.length;o++)t[e+o]=n.charCodeAt(o);}function lu(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 ii(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 S=C*4,$=t[S],M=t[S+1],R=t[S+2],E=t[S+3];E!==255&&(a=true),r[C]=(E<<24|($-M&255)<<16|M<<8|R-M&255)>>>0;}let i=new Uint32Array(280),c=new Uint32Array(256),s=new Uint32Array(256),l=new Uint32Array(256),m=new Uint32Array(40);iu(r,e,{literal(C){i[C>>>8&255]++,c[C>>>16&255]++,s[C&255]++,l[C>>>24]++;},copy(C,S){i[256+ao(C).symbol]++,m[ao(S).symbol]++;}});let u=[i,c,s,l,m].map(C=>uu(C,15)),[f,d,g,h,p]=u.map(mu),b=new oi(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 u)oh(b,C);iu(r,e,{literal(C){qe(b,f,C>>>8&255),qe(b,d,C>>>16&255),qe(b,g,C&255),qe(b,h,C>>>24);},copy(C,S){let $=ao(C);qe(b,f,256+$.symbol),b.write($.extra,$.extraBits);let M=ao(S);qe(b,p,M.symbol),b.write(M.extra,M.extraBits);}});let y=b.finish(),_=y.length+(y.length&1),w=new Uint8Array(su+_);return cu(w,0,"RIFF"),lu(w,4,w.length-8),cu(w,8,"WEBPVP8L"),lu(w,16,y.length),w.set(y,su),w}function ai(t,e,n){return String.fromCharCode(...t.subarray(e,e+n))}function du(t){return t.length>=12&&ai(t,0,4)==="RIFF"&&ai(t,8,4)==="WEBP"}function si(t){if(!du(t))return null;let e=12;for(;e+8<=t.length;){let n=ai(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 ah(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 io(t,e={}){let n=e.quality!==void 0,o=n?Math.min(1,Math.max(0,Number(e.quality))):1,r=await ah(t,"image/webp",o);if(r){let s=new Uint8Array(await r.arrayBuffer()),l=si(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=ii(i,t.width,t.height);return new Blob([c],{type:"image/webp"})}var fu=32768;async function lr(t){let e=new Uint8Array(await t.arrayBuffer()),n="";for(let o=0;o<e.length;o+=fu)n+=String.fromCharCode(...e.subarray(o,o+fu));return `data:${t.type||"application/octet-stream"};base64,${btoa(n)}`}async function Ut(t){let e={...t};if(t.imageSettings?.src)try{let m=await ih(t.imageSettings.src);e={...t,imageSettings:{...t.imageSettings,src:m}};}catch{let{imageSettings:m,...u}=t;e=u;}let{hideLogo:n,url:o,logo:r,scale:a,frameLabelMarkers:i,partMarkers:c,...s}=e,l=ni({...s,templateId:e.templateId,customTemplate:e.customTemplate});return `data:image/svg+xml,${encodeURIComponent(l)}`}var ih=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 Pn(t,e,n){let o=await Ut(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 m=new Image,{width:u,height:f}=oe(t.size||ut,t.frame);s.width=Math.round(u),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);m.onload=()=>{clearTimeout(d);try{if(e==="image/jpeg"&&(l.fillStyle="white",l.fillRect(0,0,s.width,s.height)),l.drawImage(m,0,0,s.width,s.height),n)i(s);else if(e==="image/webp")io(s).then(lr).then(i,c).finally(()=>s.remove());else {let g=s.toDataURL(e,1);s.remove(),i(g);}}catch(g){clearTimeout(d),s.remove(),c(new Error(`Failed to draw SVG to canvas: ${g}`));}},m.onerror=()=>{clearTimeout(d),s.remove(),c(new Error("Could not load SVG"));},m.src=a;})}var hu=["gradientUnits","gradientTransform","spreadMethod"],sh={linear:["x1","y1","x2","y2"],radial:["cx","cy","r","fx","fy","fr"]},ch={r:0,g:0,b:0,a:1};function pu(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 ci(t){return t.name==="linearGradient"?"linear":t.name==="radialGradient"?"radial":null}function lh(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=pu(o,"stop-color")??"#000000",s=lt(c==="currentColor"?"#000000":c)??ch,l=Number.parseFloat(pu(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 so(t){let e=new Map,n=r=>{let a=r.attrs.id;ci(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=ci(a),c={},s=[],l=new Set,m=a;for(;m&&!l.has(m);){l.add(m);let u=ci(m)===i?[...hu,...sh[i]]:hu;for(let d of u){let g=m.attrs[d];c[d]===void 0&&g!==void 0&&(c[d]=g);}s.length===0&&(s=lh(m));let f=m.attrs.href??m.attrs["xlink:href"];m=f?.startsWith("#")?e.get(f.slice(1)):void 0;}o.set(r,{kind:i,attrs:c,stops:s});}return o}function li(t){let e=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,r=Number.NEGATIVE_INFINITY,a=(u,f)=>{e=Math.min(e,u),o=Math.max(o,u),n=Math.min(n,f),r=Math.max(r,f);},i=(u,f,d,g)=>{let h=-u+3*f-3*d+g,p=2*(u-2*f+d),b=f-u;if(Math.abs(h)<1e-12)return Math.abs(p)<1e-12?[]:[-b/p];let y=p*p-4*h*b;if(y<0)return [];let _=Math.sqrt(y);return [(-p+_)/(2*h),(-p-_)/(2*h)]},c=(u,f,d,g,h)=>{let p=1-u;return p*p*p*f+3*p*p*u*d+3*p*u*u*g+u**3*h},s=0,l=0,m=[0,0];for(let u of t)if(u.op==="M"&&(m=[u.x,u.y]),u.op==="M"||u.op==="L")a(u.x,u.y),s=u.x,l=u.y;else if(u.op==="C"){a(u.x,u.y);for(let f of [...i(s,u.x1,u.x2,u.x),...i(l,u.y1,u.y2,u.y)])f>0&&f<1&&a(c(f,s,u.x1,u.x2,u.x),c(f,l,u.y1,u.y2,u.y));s=u.x,l=u.y;}else [s,l]=m;return Number.isFinite(e)?{x:e,y:n,width:o-e,height:r-n}:null}var uh=t=>t[0]*t[3]-t[1]*t[2];function $e(t){let e=uh(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 bu(t,e,n){let{kind:o,attrs:r,stops:a}=t,i=a[0],c=a.at(-1);if(!(i&&c)||a.every(S=>S.color.a===0))return null;if(a.length===1)return i.color;let s=r.gradientUnits==="userSpaceOnUse",l=un;if(!s){let S=li(e);if(!S||S.width<=0||S.height<=0)return null;l=[S.width,0,0,S.height,S.x,S.y];}let m=st(l,Nt(r.gradientTransform));if(!$e(m))return c.color;let[u,f]=n,d=Math.sqrt((u*u+f*f)/2),g=(S,$)=>{let M=Number.parseFloat(S);return Number.isFinite(M)?S.trim().endsWith("%")?M/100*(s?$:1):M:null},h=(S,$,M)=>g(r[S]??$,M)??g($,M)??0;if(o==="linear"){let S=[h("x1","0%",u),h("y1","0%",f),h("x2","100%",u),h("y2","0%",f)],[$,M,R,E]=S;return $===R&&M===E?c.color:{kind:o,coords:S,matrix:m,stops:a}}let p=h("cx","50%",u),b=h("cy","50%",f),y=h("r","50%",d),_=r.fx===void 0?p:h("fx","50%",u),w=r.fy===void 0?b:h("fy","50%",f),C=Math.max(0,h("fr","0%",d));return y<0?null:y===0?c.color:{kind:o,coords:[_,w,C,p,b,y],matrix:m,stops:a}}function co(t){return t.map(e=>x(e,6)).join(" ")}function mh(t,e){return (e==="cmyk"?pe(t.r,t.g,t.b):[t.r/255,t.g/255,t.b/255]).map(o=>x(o,4)).join(" ")}var gu=(t,e)=>`<< /FunctionType 2 /Domain [0 1] /C0 [${t}] /C1 [${e}] /N 1 >>`;function dh(t,e){let n=[],o=t.map(c=>j(c.offset,4)),r=t.map(c=>mh(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 gu(c.c0,c.c1)}return ["<< /FunctionType 3 /Domain [0 1]",`/Functions [${n.map(c=>gu(c.c0,c.c1)).join(" ")}]`,`/Bounds [${n.slice(1).map(c=>x(c.from,4)).join(" ")}]`,`/Encode [${n.map(()=>"0 1").join(" ")}] >>`].join(" ")}function lo(t,e){return [`<< /ShadingType ${t.kind==="linear"?2:3}`,`/ColorSpace /Device${e==="cmyk"?"CMYK":"RGB"}`,`/Coords [${t.coords.map(n=>x(n,6)).join(" ")}]`,`/Function ${dh(t.stops,e)}`,"/Extend [true true] >>"].join(" ")}function fh(t,e){if(t.op==="Z")return t;if(t.op==="C"){let[r,a]=W(e,t.x1,t.y1),[i,c]=W(e,t.x2,t.y2),[s,l]=W(e,t.x,t.y);return {op:"C",x1:r,y1:a,x2:i,y2:c,x:s,y:l}}let[n,o]=W(e,t.x,t.y);return {op:t.op,x:n,y:o}}var yu={r:255,g:255,b:255,a:1},hh=/^url\(\s*#bg-color-/,uo=/^url\(\s*#([^)\s]+)\s*\)/,ph=new Set(["defs","clipPath","mask","pattern","linearGradient","radialGradient","symbol","title","desc","metadata","style","script","use","foreignObject"]);function Y(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 H(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 ur(t,e){if((t.name==="linearGradient"||t.name==="radialGradient")&&t.attrs.id){let n=t.children.find(r=>r.name==="stop"),o=n&&(Y(n,"stop-color")??"#000000");o&&e.set(t.attrs.id,o);}for(let n of t.children)ur(n,e);return e}function mr(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)mr(n,e);return e}function mo(t){return /^data:image\/png[;,]/i.test(t)?"PNG":/^data:image\/jpe?g[;,]/i.test(t)?"JPEG":null}async function fo(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 _u(t,e,n){let o={x:H(t.attrs.x,e[0]),y:H(t.attrs.y,e[1]),width:H(t.attrs.width,e[0]),height:H(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,m=n.height*s,u=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)*u("x"),y:o.y+(o.height-m)*u("y"),width:l,height:m},clip:c?o:null}}function xu(t,e){t.name==="clipPath"&&t.attrs.id&&e.set(t.attrs.id,t);for(let n of t.children)xu(n,e);return e}function $u(t,e){t.name==="pattern"&&t.attrs.id&&e.set(t.attrs.id,t);for(let n of t.children)$u(n,e);return e}function gh(t,e){let[n,o]=e,r=(a,i)=>H(t.attrs[a],i);switch(t.name){case "path":return ee(t.attrs.d??"");case "rect":{let a=t.attrs.rx??t.attrs.ry,i=t.attrs.ry??t.attrs.rx;return Zt(r("x",n),r("y",o),r("width",n),r("height",o),H(a,n),H(i,o))}case "circle":{let a=r("r",Math.hypot(n,o)/Math.SQRT2);return Xt(r("cx",n),r("cy",o),a,a)}case "ellipse":return Xt(r("cx",n),r("cy",o),r("rx",n),r("ry",o));default:return []}}var vn=class{gradients;shadings;clipPaths=new Map;patterns=new Map;backdrop=yu;paper=yu;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=uo.exec(e);if(n)return this.resolveColor(this.gradients.get(n[1]));let o=lt(e==="currentColor"?"#000000":e);return o&&o.a>0?o:null}shadedGradient(e){let n=e?uo.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=bu(i,n,o);if(!l)return null;if("coords"in l)return {gradient:l,alpha:r};let m={...l,a:l.a*r};return m.a>0?{color:m}: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?uo.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 Kr(e,this.onPaper||o?this.paper:this.backdrop)}paintPattern(e,n,o,r){let a=li(e);if(!a||a.width<=0||a.height<=0)return true;let[i,c]=n.viewport,s=H(o.attrs.x,i),l=H(o.attrs.y,c),m=H(o.attrs.width,i),u=H(o.attrs.height,c);if(!(m>0&&u>0))return true;let f=Nt(o.attrs.patternTransform),d=$e(f);if(!d)return true;if(!this.beginClip(e,n.matrix,n.fillRule==="evenodd"))return false;let g=this.inConic;this.inConic=o.attrs["data-qrdx-conic"]!==void 0;try{let h=[W(d,a.x,a.y),W(d,a.x+a.width,a.y),W(d,a.x,a.y+a.height),W(d,a.x+a.width,a.y+a.height)],p=h.map(([F])=>F),b=h.map(([,F])=>F),y=Math.min(...p),_=Math.max(...p),w=Math.min(...b),C=Math.max(...b),S=Math.floor((y-s)/m),$=Math.ceil((_-s)/m)-1,M=Math.floor((w-l)/u),R=Math.ceil((C-l)/u)-1,E=($-S+1)*(R-M+1);if(E>4096)return !0;let P=(o.attrs["data-qrdx-conic"]??"").trim().split(/\s+/).map(Number),L=st(n.matrix,f);for(let F=M;F<=R;F++)for(let I=S;I<=$;I++){let N=s+I*m,k=l+F*u,B=st(L,[1,0,0,1,N,k]),q={x:y-N,y:w-k,width:_-y,height:C-w},O=P.length===2&&P.every(Number.isFinite)?Gl(P[0],P[1],q):null,G=E>1&&this.beginClip([{op:"M",x:0,y:0},{op:"L",x:m,y:0},{op:"L",x:m,y:u},{op:"L",x:0,y:u},{op:"Z"}],B,!1);try{let J={matrix:B,viewport:n.viewport,fill:"#000000",fillRule:"nonzero",stroke:"none",strokeWidth:1,fontSize:16,fontWeight:"normal",textAnchor:"start",fillOpacity:1,opacity:r},pt=(at,T)=>{for(let U of at){if(U.name==="g"&&!U.attrs.transform){let z=Number.parseFloat(U.attrs.opacity??"1");pt(U.children,{...T,opacity:(T.opacity??1)*(Number.isFinite(z)?z:1)});continue}if(O&&U.attrs["data-arc"]){let[z,wt]=U.attrs["data-arc"].split(/\s+/).map(Number);if(!Ul([z,z+wt],O))continue}this.walk(U,T);}};pt(o.children,J);}finally{G&&this.endClip();}}}finally{this.inConic=g,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:st(n.matrix,Nt(e.attrs.transform))}),c=$e(a);if(!c)return false;let[s,l,m,u]=r,d=[[s,l],[m,l],[m,u],[s,u]].map(([g,h])=>W(c,g,h)).map(([g,h],p)=>({op:p===0?"M":"L",x:g,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=Y(e,"clip-path"),r=o?uo.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=gh(s,n.viewport);if(l.length===0)continue;let m=Nt(s.attrs.transform),u=m[0]===1&&m[1]===0&&m[2]===0&&m[3]===1&&m[4]===0&&m[5]===0;i.push(...u?l:l.map(f=>fh(f,m))),c||=Y(s,"clip-rule")==="evenodd";}return i.length>0?{segments:i,matrix:n.matrix,evenOdd:c}:null}viewportMatrix(e,n){let o=H(e.attrs.x,n.viewport[0]),r=H(e.attrs.y,n.viewport[1]),a=H(e.attrs.width,n.viewport[0],n.viewport[0]),i=H(e.attrs.height,n.viewport[1],n.viewport[1]),c=jt(e.attrs.viewBox);if(c.length!==4||!(c[2]&&c[3]))return [st(n.matrix,[1,0,0,1,o,r]),[a,i]];let[s,l,m,u]=c,f=a/m,d=i/u,g=o,h=r;if((e.attrs.preserveAspectRatio??"").trim()!=="none"){let p=e.attrs.preserveAspectRatio?.includes("slice")?Math.max(f,d):Math.min(f,d);g+=(a-m*p)/2,h+=(i-u*p)/2,f=p,d=p;}return [st(n.matrix,[f,0,0,d,g-s*f,h-l*d]),[m,u]]}walk(e,n,o=false){if(o&&(this.clipPaths=xu(e,new Map),this.patterns=$u(e,new Map)),ph.has(e.name)||Y(e,"display")==="none"||Y(e,"visibility")==="hidden")return;let r=st(n.matrix,Nt(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=Y(e,"font-size"),c=Number.parseFloat(Y(e,"opacity")??"1"),s=Y(e,"fill-opacity"),l=s===void 0?n.fillOpacity??1:Number.parseFloat(s),m={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:Y(e,"fill")??n.fill,fillRule:Y(e,"fill-rule")??n.fillRule,stroke:Y(e,"stroke")??n.stroke,strokeWidth:Y(e,"stroke-width")===void 0?n.strokeWidth:H(Y(e,"stroke-width"),a[0],1),fontSize:i===void 0?n.fontSize:H(i,16,16),fontWeight:Y(e,"font-weight")??n.fontWeight,textAnchor:Y(e,"text-anchor")??n.textAnchor},u=this.onPaper;(e.name==="rect"||e.name==="circle"||e.name==="path")&&hh.test(Y(e,"fill")??"")&&(this.onPaper=true);try{let f=e.attrs["clip-path"]?this.clipOf(e,m):null;if(f&&this.beginClip(f.segments,f.matrix,f.evenOdd)){try{this.paintNode(e,m);}finally{this.endClip();}return}this.paintNode(e,m);}finally{this.onPaper=u;}}paintNode(e,n){let[o,r]=n.viewport,a=(i,c)=>H(e.attrs[i],c);switch(e.name){case "path":this.paint(ee(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(Zt(a("x",o),a("y",r),a("width",o),a("height",r),H(i,o),H(c,r)),e,n);return}case "circle":{let i=a("r",Math.hypot(o,r)/Math.SQRT2);this.paint(Xt(a("cx",o),a("cy",r),i,i),e,n);return}case "ellipse":this.paint(Xt(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=jt(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 ho=1e3;async function dr(t){let e=await Ut(We({...t,size:t.size??ut},ho));return decodeURIComponent(e.replace("data:image/svg+xml,",""))}function ui(t){if(It(t.frame)){let e=Ne(ho,t.frame);return e.squareEdges?e.color:null}return yt(t.bgColor,bt)}function po(t,e){let n=ui(t);if(!(n&&$n(t.bgColor))||It(t.frame)||t.templateId||t.customTemplate)return n;let o=de(e)?.children.find(a=>a.name==="rect"),r=o&&Y(o,"fill");return r?.startsWith("url(")?r:n}function go(t,e){let n={r:255,g:255,b:255,a:1},o=lt(yt(e.bgColor,bt));t.paper=n,t.background=o&&!$n(e.bgColor)?o:null,t.backdrop=o?Kr(o,n):n;}var bo=25.4,Su=5,wu=2e3,le=ho,mi=5,Cu=2,yh=.25*(bo/72);function _h(t,e="mm"){return e==="in"?t*bo:t}function xh(t){let e=Tt(t),n=gt.QrCode.encodeText(t.value,Rt[e]).size;return n+At(n,t.margin??dt,t.shape)*2}function yo(t,e){let n=_h(e.size,e.unit);if(!Number.isFinite(n)||n<Su||n>wu)throw new Error(`Print size must be between ${Su} mm and ${wu/1e3} m`);let o=Math.min(Math.max(e.bleed??0,0),20),r=n/le,a=It(t.frame)?Ne(le,t.frame):null,i=(a?.width??le)*r,c=(a?.height??le)*r,s=e.cropMarks?o+Cu+mi+1:o,l=xh(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 di=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}`);});}},fi=class extends vn{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]=pe(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]=W(n,r.x,r.y);this.pdf.moveTo(a,i),o=true;}else if(r.op==="L"){let[a,i]=W(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]=W(n,r.x1,r.y1),[c,s]=W(n,r.x2,r.y2),[l,m]=W(n,r.x,r.y);this.pdf.curveTo(a,i,c,s,l,m);}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=st(i,st(n.matrix,o.matrix));if(!(this.shadingResources&&$e(c)))return;let s=this.shadingResources.name(lo(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(`${co(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:u,alpha:f}=this.opaqueGradient(a.gradient,a.alpha);this.withAlpha(f,1,()=>this.shade(e,o,u));}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 m=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*mn(o.matrix))),this.tracePath(e,o.matrix),c&&l?m?this.pdf.fillStrokeEvenOdd():this.pdf.fillStroke():c?m?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=mn(n.matrix),[i,c]=W(n.matrix,H(e.attrs.x,n.viewport[0]),H(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/bo);this.pdf.setFontSize(l);let m=Number.parseFloat(e.attrs["data-max-width"]??"");if(m>0){let d=m*a,g=this.pdf.getTextWidth(o);g>d&&(l*=d/g,this.pdf.setFontSize(l));}this.setColor("text",r);let u=Math.atan2(n.matrix[1],n.matrix[0]);if(Math.abs(u)>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(u),c-d*Math.sin(u),{angle:-u*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&&(mo(o)?o:this.images.get(o)),a=r&&mo(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 p=this.pdf.getImageProperties(r);c={width:p.width,height:p.height};}catch{c=null;}let s=_u(e,n.viewport,c);if(!s)return;let{draw:l,clip:m}=s,[u,f]=W(n.matrix,l.x,l.y),[d,g]=W(n.matrix,l.x+l.width,l.y+l.height),h=m!==null&&this.beginClip([{op:"M",x:m.x,y:m.y},{op:"L",x:m.x+m.width,y:m.y},{op:"L",x:m.x+m.width,y:m.y+m.height},{op:"L",x:m.x,y:m.y+m.height},{op:"Z"}],n.matrix,false);try{this.withAlpha(n.opacity??1,1,()=>{this.pdf.addImage(r,a,Math.min(u,d),Math.min(f,g),Math.abs(d-u),Math.abs(g-f),i);});}finally{h&&this.endClip();}}};function $h(t,e,n){let{trimX:o,trimY:r,trimWidth:a,trimHeight:i,bleed:c}=n,s=c+Cu,l=o,m=o+a,u=r,f=r+i;e.setRegistrationColor(),t.setLineWidth(yh);for(let d of [l,m]){let g=d===l?-1:1;for(let h of [u,f]){let p=h===u?-1:1;t.line(d+g*s,h,d+g*(s+mi),h),t.line(d,h+p*s,d,h+p*(s+mi));}}}async function Sh(t,e){return (await Mu(t,e)).output("dataurlstring")}async function f5(t,e){return (await Mu(t,e)).output("arraybuffer")}async function Mu(t,e){let n=yo(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 dr(t),a=de(r);if(!a)throw new Error("Failed to render the QR code for printing");let i=new Map;for(let b of mr(a,new Set))if(!mo(b)){let y=await fo(b);y&&i.set(b,y);}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=so(a),l=s.size>0?di.attach(c):null,m=new fi(c,e.colorMode==="cmyk",ur(a,new Map),l?{gradients:s,resources:l}:null,i);go(m,t);let u=n.codeWidth/le,f=H(a.attrs.width,le,le),d=H(a.attrs.height,le,le),g={matrix:st([1,0,0,1,n.trimX,n.trimY],[u,0,0,u,0,0]),viewport:[f,d],fill:"#000000",fillRule:"nonzero",stroke:"none",strokeWidth:1,fontSize:16,fontWeight:"normal",textAnchor:"start"},h=n.bleed>0?po(t,r):null,p=[n.trimX-n.bleed,n.trimY-n.bleed,n.trimX+n.trimWidth+n.bleed,n.trimY+n.trimHeight+n.bleed];if(!(h&&m.paintBleed(a,g,h,p))){let b=h?m.resolveColor(h):null;b&&(m.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 m.walk(a,g,true),e.cropMarks&&$h(c,m,n),c}async function wh(t,e){let n=yo(t,{size:e.size,unit:e.unit}),o=await dr(t),r=e.unit??"mm",a=s=>`${x(r==="in"?s/bo: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 h5(t,e){let n=await Sh(t,e);Kt(n,e.filename??"qr-code-print.pdf");}async function p5(t,e){let n=await wh(t,e);Kt(`data:image/svg+xml;charset=utf-8,${encodeURIComponent(n)}`,e.filename??"qr-code-print.svg");}var Ch=[137,80,78,71,13,10,26,10];async function Eu(t,e){let n=new Blob([t]).stream().pipeThrough(e);return new Uint8Array(await new Response(n).arrayBuffer())}async function Au(t){return typeof CompressionStream>"u"?null:await Eu(t,new CompressionStream("deflate"))}async function Mh(t){if(typeof DecompressionStream>"u")return null;try{return await Eu(t,new DecompressionStream("deflate"))}catch{return null}}var hi=(t,e)=>t[e]*2**24+(t[e+1]<<16)+(t[e+2]<<8)+t[e+3]>>>0,Ru={0:1,2:3,3:1,4:2,6:4};function Rh(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 pi(t){if(Ch.some((h,p)=>t[p]!==h))return null;let e=8,n=0,o=0,r=-1,a=null,i=null,c=[];for(;e+8<=t.length;){let h=hi(t,e),p=String.fromCharCode(...t.subarray(e+4,e+8)),b=t.subarray(e+8,e+8+h);if(e+=12+h,p==="IHDR"){n=hi(b,0),o=hi(b,4);let y=b[8];r=b[9];let _=b[12];if(y!==8||_!==0||!(r in Ru))return null}else if(p==="PLTE")a=b;else if(p==="tRNS")i=b;else if(p==="IDAT")c.push(b);else if(p==="IEND")break}if(!(n&&o)||n*o>4096*4096)return null;let s=new Uint8Array(c.reduce((h,p)=>h+p.length,0)),l=0;for(let h of c)s.set(h,l),l+=h.length;let m=await Mh(s),u=Ru[r],f=n*u;if(!m||m.length<o*(f+1))return null;let d=new Uint8Array(o*f);for(let h=0;h<o;h++){let p=m[h*(f+1)],b=m.subarray(h*(f+1)+1,(h+1)*(f+1)),y=h*f;for(let _=0;_<f;_++){let w=_>=u?d[y+_-u]:0,C=h>0?d[y-f+_]:0,S=h>0&&_>=u?d[y-f+_-u]:0,$=b[_],M=0;p===1?M=w:p===2?M=C:p===3?M=w+C>>1:p===4&&(M=Rh(w,C,S)),d[y+_]=$+M&255;}}let g=new Uint8Array(n*o*4);for(let h=0;h<n*o;h++){let p=h*4,b=h*u;if(r===3){let y=d[b];g[p]=a?.[y*3]??0,g[p+1]=a?.[y*3+1]??0,g[p+2]=a?.[y*3+2]??0,g[p+3]=i?.[y]??255;}else if(r===0||r===4){let y=d[b];g[p]=y,g[p+1]=y,g[p+2]=y,g[p+3]=r===4?d[b+1]:255;}else g[p]=d[b],g[p+1]=d[b+1],g[p+2]=d[b+2],g[p+3]=r===6?d[b+3]:255;}return {width:n,height:o,data:g}}var Eh=25.4,Pu=72/Eh,Ah=50;function Ph(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 vh(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 Lh(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,m=r[s*4]*l+255*(1-l),u=r[s*4+1]*l+255*(1-l),f=r[s*4+2]*l+255*(1-l);if(e){let[d,g,h,p]=pe(m,u,f);i.set([d*255,g*255,h*255,p*255].map(Math.round),s*a);}else i.set([Math.round(m),Math.round(u),Math.round(f)],s*a);}let c=await Au(i);return {kind:"raw",width:n,height:o,components:a,bytes:c??i,compressed:!!c}}async function Fh(t,e){let n=t;if(!/^data:image\/(png|jpe?g)[;,]/i.test(n)){let i=await fo(n);if(!i)return null;n=i;}let o=Ph(n);if(!o)return null;let r=vh(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 pi(o);return a?await Lh(a,e):null}function kh(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 Ih=`/qrdxdict 40 dict def
1
+ 'use strict';var react=require('react'),jsxRuntime=require('react/jsx-runtime'),schemas_js=require('./schemas.js'),framesIndex_js=require('./frames-index.js'),framesOfficial_js=require('./frames-official.js'),qrCodeCanvas_js=require('./qr-code-canvas.js');function Vt(t){return t.children}var F0=t=>t==null?null:`${t}`;function To(t,e,n){let o=e??{},r=n;if("key"in o){let{key:a,...i}=o;a!==void 0&&(r=a),o=i;}return {type:t,props:o,key:F0(r)}}function I0(t,e){let n=t;return {type:n.type,props:{...n.props,...e},key:n.key??null}}function k0(t,e,...n){let o={...e};return n.length>0&&(o.children=n.length===1?n[0]:n),To(t,o)}var T0={jsx:To,jsxs:To,createElement:k0,cloneElement:I0,Fragment:Vt},ue=T0;function br(t,e){let n=ue;ue=t;try{return e()}finally{ue=n;}}var No=t=>t===Vt?ue.Fragment:t;function v(t,e,n){return ue.jsx(No(t),e,n)}function St(t,e,n){return ue.jsxs(No(t),e,n)}function yr(t,e,...n){return ue.createElement(No(t),e??null,...n)}function an(t,e){return ue.cloneElement(t,e)}var N0=new Set([Symbol.for("react.element"),Symbol.for("react.transitional.element")]),ss=Symbol.for("react.fragment");function Pe(t){if(typeof t!="object"||t===null||Array.isArray(t))return false;let e=t;return e.$$typeof!==void 0&&!N0.has(e.$$typeof)?false:(typeof e.type=="string"||typeof e.type=="function"||e.type===ss)&&typeof e.props=="object"&&e.props!==null}var sn=t=>t===Vt||t===ss;var cn;(a=>{class t{constructor(c,s,l,m){this.version=c;this.errorCorrectionLevel=s;if(c<t.MIN_VERSION||c>t.MAX_VERSION)throw new RangeError("Version value out of range");if(m<-1||m>7)throw new RangeError("Mask value out of range");this.size=c*4+17;let u=[];for(let d=0;d<this.size;d++)u.push(false);for(let d=0;d<this.size;d++)this.modules.push(u.slice()),this.isFunction.push(u.slice());this.drawFunctionPatterns();let f=this.addEccAndInterleave(l);if(this.drawCodewords(f),m==-1){let d=1e9;for(let g=0;g<8;g++){this.applyMask(g),this.drawFormatBits(g);let h=this.getPenaltyScore();h<d&&(m=g,d=h),this.applyMask(g);}}o(0<=m&&m<=7),this.mask=m,this.applyMask(m),this.drawFormatBits(m),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,m=40,u=-1,f=true){if(!(t.MIN_VERSION<=l&&l<=m&&m<=t.MAX_VERSION)||u<-1||u>7)throw new RangeError("Invalid value");let d,g;for(d=l;;d++){let y=t.getNumDataCodewords(d,s)*8,_=r.getTotalBits(c,d);if(_<=y){g=_;break}if(d>=m)throw new RangeError("Data too long")}for(let y of [t.Ecc.MEDIUM,t.Ecc.QUARTILE,t.Ecc.HIGH])f&&g<=t.getNumDataCodewords(d,y)*8&&(s=y);let h=[];for(let y of c){e(y.mode.modeBits,4,h),e(y.numChars,y.mode.numCharCountBits(d),h);for(let _ of y.getData())h.push(_);}o(h.length==g);let p=t.getNumDataCodewords(d,s)*8;o(h.length<=p),e(0,Math.min(4,p-h.length),h),e(0,(8-h.length%8)%8,h),o(h.length%8==0);for(let y=236;h.length<p;y^=253)e(y,8,h);let b=[];for(;b.length*8<h.length;)b.push(0);return h.forEach((y,_)=>b[_>>>3]|=y<<7-(_&7)),new t(d,s,b,u)}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 m=0;m<s;m++)l==0&&m==0||l==0&&m==s-1||l==s-1&&m==0||this.drawAlignmentPattern(c[l],c[m]);this.drawFormatBits(0),this.drawVersion();}drawFormatBits(c){let s=this.errorCorrectionLevel.formatBits<<3|c,l=s;for(let u=0;u<10;u++)l=l<<1^(l>>>9)*1335;let m=(s<<10|l)^21522;o(m>>>15==0);for(let u=0;u<=5;u++)this.setFunctionModule(8,u,n(m,u));this.setFunctionModule(8,7,n(m,6)),this.setFunctionModule(8,8,n(m,7)),this.setFunctionModule(7,8,n(m,8));for(let u=9;u<15;u++)this.setFunctionModule(14-u,8,n(m,u));for(let u=0;u<8;u++)this.setFunctionModule(this.size-1-u,8,n(m,u));for(let u=8;u<15;u++)this.setFunctionModule(8,this.size-15+u,n(m,u));this.setFunctionModule(8,this.size-8,true);}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 m=n(s,l),u=this.size-11+l%3,f=Math.floor(l/3);this.setFunctionModule(u,f,m),this.setFunctionModule(f,u,m);}}drawFinderPattern(c,s){for(let l=-4;l<=4;l++)for(let m=-4;m<=4;m++){let u=Math.max(Math.abs(m),Math.abs(l)),f=c+m,d=s+l;0<=f&&f<this.size&&0<=d&&d<this.size&&this.setFunctionModule(f,d,u!=2&&u!=4);}}drawAlignmentPattern(c,s){for(let l=-2;l<=2;l++)for(let m=-2;m<=2;m++)this.setFunctionModule(c+m,s+l,Math.max(Math.abs(m),Math.abs(l))!=1);}setFunctionModule(c,s,l){this.modules[s][c]=l,this.isFunction[s][c]=true;}addEccAndInterleave(c){let s=this.version,l=this.errorCorrectionLevel;if(c.length!=t.getNumDataCodewords(s,l))throw new RangeError("Invalid argument");let m=t.NUM_ERROR_CORRECTION_BLOCKS[l.ordinal][s],u=t.ECC_CODEWORDS_PER_BLOCK[l.ordinal][s],f=Math.floor(t.getNumRawDataModules(s)/8),d=m-f%m,g=Math.floor(f/m),h=[],p=t.reedSolomonComputeDivisor(u);for(let y=0,_=0;y<m;y++){let w=c.slice(_,_+g-u+(y<d?0:1));_+=w.length;let M=t.reedSolomonComputeRemainder(w,p);y<d&&w.push(0),h.push(w.concat(M));}let b=[];for(let y=0;y<h[0].length;y++)h.forEach((_,w)=>{(y!=g-u||w>=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 m=0;m<this.size;m++)for(let u=0;u<2;u++){let f=l-u,g=(l+1&2)==0?this.size-1-m:m;!this.isFunction[g][f]&&s<c.length*8&&(this.modules[g][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 m;switch(c){case 0:m=(l+s)%2==0;break;case 1:m=s%2==0;break;case 2:m=l%3==0;break;case 3:m=(l+s)%3==0;break;case 4:m=(Math.floor(l/3)+Math.floor(s/2))%2==0;break;case 5:m=l*s%2+l*s%3==0;break;case 6:m=(l*s%2+l*s%3)%2==0;break;case 7:m=((l+s)%2+l*s%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[s][l]&&m&&(this.modules[s][l]=!this.modules[s][l]);}}getPenaltyScore(){let c=0;for(let u=0;u<this.size;u++){let f=false,d=0,g=[0,0,0,0,0,0,0];for(let h=0;h<this.size;h++)this.modules[u][h]==f?(d++,d==5?c+=t.PENALTY_N1:d>5&&c++):(this.finderPenaltyAddHistory(d,g),f||(c+=this.finderPenaltyCountPatterns(g)*t.PENALTY_N3),f=this.modules[u][h],d=1);c+=this.finderPenaltyTerminateAndCount(f,d,g)*t.PENALTY_N3;}for(let u=0;u<this.size;u++){let f=false,d=0,g=[0,0,0,0,0,0,0];for(let h=0;h<this.size;h++)this.modules[h][u]==f?(d++,d==5?c+=t.PENALTY_N1:d>5&&c++):(this.finderPenaltyAddHistory(d,g),f||(c+=this.finderPenaltyCountPatterns(g)*t.PENALTY_N3),f=this.modules[h][u],d=1);c+=this.finderPenaltyTerminateAndCount(f,d,g)*t.PENALTY_N3;}for(let u=0;u<this.size-1;u++)for(let f=0;f<this.size-1;f++){let d=this.modules[u][f];d==this.modules[u][f+1]&&d==this.modules[u+1][f]&&d==this.modules[u+1][f+1]&&(c+=t.PENALTY_N2);}let s=0;for(let u of this.modules)s=u.reduce((f,d)=>f+(d?1:0),s);let l=this.size*this.size,m=Math.ceil(Math.abs(s*20-l*10)/l)-1;return o(0<=m&&m<=9),c+=m*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 m=this.size-7;l.length<c;m-=s)l.splice(1,0,m);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 m=0;m<c-1;m++)s.push(0);s.push(1);let l=1;for(let m=0;m<c;m++){for(let u=0;u<s.length;u++)s[u]=t.reedSolomonMultiply(s[u],l),u+1<s.length&&(s[u]^=s[u+1]);l=t.reedSolomonMultiply(l,2);}return s}static reedSolomonComputeRemainder(c,s){let l=s.map(m=>0);for(let m of c){let u=m^l.shift();l.push(0),s.forEach((f,d)=>l[d]^=t.reedSolomonMultiply(f,u));}return l}static reedSolomonMultiply(c,s){if(c>>>8||s>>>8)throw new RangeError("Byte out of range");let l=0;for(let m=7;m>=0;m--)l=l<<1^(l>>>7)*285,l^=(s>>>m&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 m=Math.min(c.length-l,3);e(parseInt(c.substr(l,m),10),m*3+1,s),l+=m;}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 m=r.ALPHANUMERIC_CHARSET.indexOf(c.charAt(l))*45;m+=r.ALPHANUMERIC_CHARSET.indexOf(c.charAt(l+1)),e(m,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 m of c){let u=m.mode.numCharCountBits(s);if(m.numChars>=1<<u)return 1/0;l+=4+u+m.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;})(cn||={});(e=>{(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;})(e.QrCode||={});})(cn||={});(e=>{(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;})(e.QrSegment||={});})(cn||={});var gt=cn;var Rt={L:gt.QrCode.Ecc.LOW,M:gt.QrCode.Ecc.MEDIUM,Q:gt.QrCode.Ecc.QUARTILE,H:gt.QrCode.Ecc.HIGH},ut=128,jt="Q",bt="#FFFFFF",Mt="#000000";var dt=0;var _r=.1;var xr=["logo","halftone"],Oo={logo:["blend","badge"],halftone:["color","mono"]},Nn=192,O0=["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"],D0=["diamond","star","banner"],B0=["square","rounded","gear","circle","diya","extra-rounded","message","pointy","leaf","drop","octagon","bevel","squircle","cushion","shield","petal","leaf-reverse"],Q0=["curly"],G0=["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"],U0=["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"],te=24,Do="Scan me",On=.5,ln=1.5,z0=["square","rounded","circle"],q0=.1,Bo=.3,Qo=.25,W0=2,$r=.5,Go=1,Uo=.07,H0=["square","circle","heart"],zo=3,ve=64,me=8,qo=.42,Sr=["topLeft","topRight","bottomLeft"];function j(t,e=3){let n=10**e;return Math.round(t*n)/n+0}function x(t,e=3){return String(j(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"?x(r):r)+(t[o+1]??"");}return n}var V0={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0},j0=/^[MmLlHhVvCcSsQqTtAaZz0-9.,+\-\s]*$/,Wo=/[+-]?(?:\d+\.?\d*|\.\d+)/y;function Dn(t,e=Number.POSITIVE_INFINITY){if(!j0.test(t))return null;let n=[],o=0,r=()=>{for(;o<t.length&&/[\s,]/.test(t[o]);)o++;},a=()=>{r(),Wo.lastIndex=o;let s=Wo.exec(t);if(!s)return null;let l=s[0],m=l.indexOf(".");if(m>=0&&l.length-m-1>e)return null;o=Wo.lastIndex;let u=Number(l);return Number.isFinite(u)?u: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(),m=V0[l];if(m===void 0||n.length===0&&l!=="M")return null;if(o++,m===0){n.push({command:s,values:[]}),r();continue}let u=s,f=true;for(;f||c();){let d=[];for(let g=0;g<m;g++){let h=l==="A"&&(g===3||g===4)?i():a();if(h===null)return null;d.push(h);}n.push({command:u,values:d}),l==="M"&&(u=s==="M"?"L":"l"),f=false;}r();}return n}function cs(t){let e=0;for(let{command:n}of t)e+=n.toUpperCase()==="A"?4:1;return e}function Ho(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,m=s?o:0,u;switch(c){case "Z":u=[];break;case "H":u=[x(i[0]*e+l)];break;case "V":u=[x(i[0]*e+m)];break;case "A":u=[x(Math.abs(i[0])*e),x(Math.abs(i[1])*e),x(i[2]),String(i[3]),String(i[4]),x(i[5]*e+l),x(i[6]*e+m)];break;default:u=i.map((f,d)=>x(f*e+(d%2===0?l:m)));}r+=a+u.join(" ");}return r}function wr(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],m=[c.x2,c.y2],u=[c.x,c.y],f=Math.hypot(l[0]-s[0],l[1]-s[1])+Math.hypot(m[0]-l[0],m[1]-l[1])+Math.hypot(u[0]-m[0],u[1]-m[1]),d=Math.max(2,Math.min(64,Math.ceil(Math.sqrt(f/(4*e)))));for(let g=1;g<=d;g++){let h=g/d,p=1-h;o.push([p*p*p*s[0]+3*p*p*h*l[0]+3*p*h*h*m[0]+h*h*h*u[0],p*p*p*s[1]+3*p*p*h*l[1]+3*p*h*h*m[1]+h*h*h*u[1]]);}a=u;}else i(),a=r;return i(),n}function un(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),m=r(s);l>=0?(m<0&&o.push(ls(s,c,m,l)),o.push(c)):m>=0&&o.push(ls(s,c,m,l));}}return o.length>2?o:[]}function ls(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 us(t){return t.filter(e=>e.length>2).map(e=>`M${e.map(([n,o])=>`${x(n)} ${x(o)}`).join("L")}Z`).join("")}function Le(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 Z0={amp:"&",lt:"<",gt:">",quot:'"',apos:"'"};function fs(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 Z0[n.toLowerCase()]??e})}var X0=60,Vo=62,jo=47,Y0=61,ms=34,ds=39,Xo=/\s*/y,K0=/[^\s/>]*/y,J0=/[^\s>]*/y,tm=/[^\s=]*/y;function mn(t,e,n){return t.lastIndex=n,t.test(e)?t.lastIndex:n}function em(t,e){let n=t.length,o=S=>{let $=Number.POSITIVE_INFINITY,C=-1;return R=>((R<$||C>=0&&C<R)&&($=R,C=t.indexOf(S,R)),C)},r=o("-->"),a=o("?>"),i=o("]]>"),c=o(">"),s,l=S=>{let $=t.charCodeAt(S);if($!==ms&&$!==ds)return S+1;let C=t.indexOf(t[S],S+1);return C<0?n:C+1},m=S=>{for(let $=S;$<n&&!s?.[$];$=l($)){let C=t.charCodeAt($);if(C===Vo||C===jo&&t.charCodeAt($+1)===Vo)return $}s??=new Uint8Array(n);for(let $=S;$<n&&!s[$];$=l($))s[$]=1;return -1},u=-1,f=-1,d=-1,g=-1,h=S=>{let $=S+1;if($<u||$>=f){u=$,f=mn(K0,t,$),d=-1;for(let R=f;R>$;R--){let E=t.charCodeAt(R);if((R===f||E===ms||E===ds)&&(g=m(R),g>=0)){d=R;break}}}if(d<=$)return -1;let C=t.charCodeAt(g)===jo;return e.open(t.slice($,d),t.slice(d,g),C),g+(C?2:1)},p=-1,b=-1,y=-1,_=S=>{let $=S+2;if($<p||$>=b){p=$,b=mn(J0,t,$);let C=mn(Xo,t,b);y=b>$&&t.charCodeAt(C)===Vo?C:-1;}return y},w=S=>{if(t.startsWith("<!--",S)){let $=r(S+4);if($>=0)return $+3}if(t.startsWith("<?",S)){let $=a(S+2);if($>=0)return $+2}if(t.startsWith("<![CDATA[",S)){let $=i(S+9);if($>=0)return e.cdata(t.slice(S+9,$)),$+3}if(t.startsWith("<!",S)){let $=c(S+2);if($>=0)return $+1}if(t.charCodeAt(S+1)===jo){let $=_(S);return $<0?-1:(e.close(),$+1)}return h(S)},M=0;for(;M<n;)if(t.charCodeAt(M)===X0){let S=w(M);M=S<0?M+1:S;}else {let S=t.indexOf("<",M),$=S<0?n:S;e.text(t.slice(M,$)),M=$;}}function nm(t){let e={},n=0;for(;n<t.length;){let o=mn(tm,t,n);if(o===n){n++;continue}let r=mn(Xo,t,o);if(t.charCodeAt(r)===Y0){let a=mn(Xo,t,r+1),i=t[a],c=i==='"'||i==="'"?t.indexOf(i,a+1):-1;if(c>=0){e[t.slice(n,o)]=fs(t.slice(a+1,c)),n=c+1;continue}}n=o;}return e}function de(t){let e={name:"#root",attrs:{},children:[],text:""},n=[e],o=()=>n.at(-1);em(t,{open(a,i,c){let s=nm(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+=fs(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)}var dn=[1,0,0,1,0,0];function st(t,e){let[n,o,r,a,i,c]=t,[s,l,m,u,f,d]=e;return [n*s+r*l,o*s+a*l,n*m+r*u,o*m+a*u,n*f+r*d+i,o*f+a*d+c]}function W(t,e,n){return [t[0]*e+t[2]*n+t[4],t[1]*e+t[3]*n+t[5]]}function fn(t){return Math.sqrt(Math.abs(t[0]*t[3]-t[1]*t[2]))}function Zt(t){return t?(t.match(/[+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?/gi)??[]).map(Number):[]}function Nt(t){let e=dn;if(!t)return e;for(let[,n,o]of t.matchAll(/(matrix|translate|scale|rotate|skewX|skewY)\s*\(([^)]*)\)/g)){let r=Zt(o),a=dn;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,m]=[r[1]??0,r[2]??0];a=st(st([1,0,0,1,l,m],[c,s,-s,c,0,0]),[1,0,0,1,-l,-m]);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=st(e,a);}return e}var Zo=/[+-]?(?:\d+\.?\d*|\.\d+)(?:[eE][+-]?\d+)?/y;function rm(t,e,n,o,r,a,i,c,s){if(t===c&&e===s)return [];let l=Math.abs(n),m=Math.abs(o);if(l===0||m===0)return [{op:"L",x:c,y:s}];let u=r*Math.PI/180,f=Math.cos(u),d=Math.sin(u),g=(t-c)/2,h=(e-s)/2,p=f*g+d*h,b=-d*g+f*h,y=p*p/(l*l)+b*b/(m*m);y>1&&(l*=Math.sqrt(y),m*=Math.sqrt(y));let _=l*l*m*m-l*l*b*b-m*m*p*p,w=l*l*b*b+m*m*p*p,M=(a===i?-1:1)*Math.sqrt(Math.max(0,_/w)),S=M*l*b/m,$=-M*m*p/l,C=f*S-d*$+(t+c)/2,R=d*S+f*$+(e+s)/2,E=(q,O,G,J)=>Math.atan2(q*J-O*G,q*G+O*J),P=E(1,0,(p-S)/l,(b-$)/m),L=E((p-S)/l,(b-$)/m,(-p-S)/l,(-b-$)/m);!i&&L>0?L-=2*Math.PI:i&&L<0&&(L+=2*Math.PI);let F=Math.max(1,Math.ceil(Math.abs(L)/(Math.PI/2)-1e-9)),k=L/F,N=4/3*Math.tan(k/4),I=(q,O)=>[C+l*f*q-m*d*O,R+l*d*q+m*f*O],B=[];for(let q=0;q<F;q++){let O=P+q*k,G=O+k,[J,pt]=I(Math.cos(O)-N*Math.sin(O),Math.sin(O)+N*Math.cos(O)),[at,T]=I(Math.cos(G)+N*Math.sin(G),Math.sin(G)-N*Math.cos(G)),[U,z]=q===F-1?[c,s]:I(Math.cos(G),Math.sin(G));B.push({op:"C",x1:J,y1:pt,x2:at,y2:T,x:U,y:z});}return B}function ee(t){let e=[],n=0,o=0,r=0,a=0,i=0,c="",s=null,l=null,m=()=>{for(;n<t.length&&/[\s,]/.test(t[n]);)n++;},u=()=>{m(),Zo.lastIndex=n;let g=Zo.exec(t);return g?(n=Zo.lastIndex,Number(g[0])):null},f=()=>{m();let g=t[n];return g==="0"||g==="1"?(n++,g==="1"):null},d=g=>{let h=[];for(let p=0;p<g;p++){let b=u();if(b===null)return null;h.push(b);}return h};for(;m(),!(n>=t.length);){let g=t[n];if(/[MmLlHhVvCcSsQqTtAaZz]/.test(g))c=g,n++;else if(!c||c==="Z"||c==="z")break;let h=c===c.toLowerCase(),p=h?o:0,b=h?r:0,y=c.toUpperCase();if(y==="Z"){e.push({op:"Z"}),o=a,r=i,s=null,l=null;continue}if(y==="A"){let S=d(3),$=f(),C=f(),R=d(2);if(!(S&&R)||$===null||C===null)break;let[E,P,L]=S,F=R[0]+p,k=R[1]+b;e.push(...rm(o,r,E,P,L,$,C,F,k)),o=F,r=k,s=null,l=null;continue}let _={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2}[y]??0,w=d(_);if(!w)break;let M=w;switch(y){case "M":o=M[0]+p,r=M[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":y!=="V"&&(o=M[0]+p),y==="V"?r=M[0]+b:y==="L"&&(r=M[1]+b),e.push({op:"L",x:o,y:r}),s=null,l=null;break;case "C":case "S":{let S,$;y==="C"?(S=[M[0]+p,M[1]+b],$=M.slice(2)):(S=s?[2*o-s[0],2*r-s[1]]:[o,r],$=M);let C=[$[0]+p,$[1]+b],R=[$[2]+p,$[3]+b];e.push({op:"C",x1:S[0],y1:S[1],x2:C[0],y2:C[1],x:R[0],y:R[1]}),[o,r]=R,s=C,l=null;break}case "Q":case "T":{let S,$;y==="Q"?(S=[M[0]+p,M[1]+b],$=[M[2]+p,M[3]+b]):(S=l?[2*o-l[0],2*r-l[1]]:[o,r],$=[M[0]+p,M[1]+b]),e.push({op:"C",x1:o+2/3*(S[0]-o),y1:r+2/3*(S[1]-r),x2:$[0]+2/3*(S[0]-$[0]),y2:$[1]+2/3*(S[1]-$[1]),x:$[0],y:$[1]}),[o,r]=$,l=S,s=null;break}}}return e}var Mr=.5522847498;function Xt(t,e,n,o){if(n<=0||o<=0)return [];let r=n*Mr,a=o*Mr;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 Yt(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*Mr,l=c*Mr,m=t+n,u=e+o;return [{op:"M",x:t+i,y:e},{op:"L",x:m-i,y:e},{op:"C",x1:m-i+s,y1:e,x2:m,y2:e+c-l,x:m,y:e+c},{op:"L",x:m,y:u-c},{op:"C",x1:m,y1:u-c+l,x2:m-i+s,y2:u,x:m-i,y:u},{op:"L",x:t+i,y:u},{op:"C",x1:t+i-s,y1:u,x2:t,y2:u-c+l,x:t,y:u-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 Bn="qrdx.frame",Qn=1,Gn="custom",ot={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:te},Ko=["wifi","star","heart","phone","headphones","calendar","user","chat","bag","bell","cup","card","check","info","home","pin","share","download","clock","snowflake","pumpkin","tree","sparkle","gift"],Un=.95,ps=200,Jo=["frame","text","accent","background"],om=/[\t\n\v\f\r\u0085\u2028\u2029]/g,am=/[\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;function hn(t,e=te){let n=t.slice(0,1e3).normalize("NFC").replace(om," ").replace(am,"").replace(/\s+/g," ").trim();return Array.from(n).slice(0,Math.max(0,e)).join("").trim()}function im(t){for(let e of t)if((e.codePointAt(0)??0)>255)return false;return true}var Cr=t=>Math.abs(t*1e3-Math.round(t*1e3))<1e-6;function Rr(t){let e=pn(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 sm(t){return {x0:t.qr.x,y0:t.qr.y,x1:t.qr.x+t.qr.size,y1:t.qr.y+t.qr.size}}function pn(t){return t.qr.padding??t.qr.size*ot.defaultPadding}var ta=.52,cm=.35;function lm(t){let e=t.fontSize??t.box.height*ta;return Math.min(e*ln,t.box.height*Un)}var Yo=(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;function hs(t){let e=Rr(t),n=Math.min(t.qr.radius??0,(e.x1-e.x0)/2,(e.y1-e.y0)/2),o=[[e.x0+n,e.y0+n,Math.PI],[e.x1-n,e.y0+n,-Math.PI/2],[e.x1-n,e.y1-n,0],[e.x0+n,e.y1-n,Math.PI/2]],r=[];for(let[a,i,c]of o)for(let s=0;s<=8;s++){let l=c+Math.PI/2*(s/8);r.push([a+n*Math.cos(l),i+n*Math.sin(l)]);}return r}function um([t,e],n,o){if(t<n.x-.01||e<n.y-.01||t>n.x+n.width+.01||e>n.y+n.height+.01)return false;let a=Math.min(o,n.width/2,n.height/2),i=Math.min(Math.max(t,n.x+a),n.x+n.width-a),c=Math.min(Math.max(e,n.y+a),n.y+n.height-a);return Math.hypot(t-i,e-c)<=a+.01}function mm(t){let e=0;return t.forEach(([n,o],r)=>{let[a,i]=t[(r+1)%t.length];e+=n*i-a*o;}),Math.abs(e)/2}function dm(t,e,n){let o=Rr(e);if(!Yo(n,o))return false;if("stroke"in t&&t.stroke)return true;if(t.fill==="background")return false;if(t.type==="rect"&&t.hole){let{hole:r}=t;return !hs(e).every(a=>um(a,r,r.radius??0))}if(t.type==="circle"&&t.hole){let r=t.hole;return !hs(e).every(([a,i])=>Math.hypot(a-t.cx,i-t.cy)<=r+.01)}if(t.type==="polygon"){let r=un(t.points,o);return r.length>2&&mm(r)>1e-6}return true}function ea(t){let e=fm(t),n="stroke"in t?t.stroke:void 0;if(!(n&&e.bounds))return e;let o=t.type==="circle"||t.type==="ellipse"?n.width/2:t.type==="rect"?n.width*Math.SQRT2/2:n.width*2,{x0:r,y0:a,x1:i,y1:c}=e.bounds;return {bounds:{x0:r-o,y0:a-o,x1:i+o,y1:c+o},segments:e.segments*2}}function fm(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=Dn(t.d,ot.maxDecimals);return e?{bounds:Le(ee(t.d)),segments:cs(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:ps}}}function gs(t,e){let n=ot,o=new TextEncoder().encode(JSON.stringify(t)).length;if(o>n.maxBytes){e(`The spec is ${o} bytes; the limit is ${n.maxBytes}`);return}let{width:r,height:a}=t.artboard,i=Math.max(r,a)*.005,c={x0:-i,y0:-i,x1:r+i,y1:a+i},s=b=>b.x0>=c.x0&&b.y0>=c.y0&&b.x1<=c.x1&&b.y1<=c.y1,{qr:l}=t,m=pn(t);l.plate!=="none"&&m<l.size*n.minPadding-1e-9&&e(`qr.padding must be at least ${n.minPadding*100}% of qr.size`,["qr","padding"]),l.size<Math.min(r,a)*n.minQrShare-1e-9&&e(`qr.size must be at least ${n.minQrShare*100}% of the artboard's shorter side`,["qr","size"]);let u=Rr(t);(u.x0<-1e-9||u.y0<-1e-9||u.x1>r+1e-9||u.y1>a+1e-9)&&e("The code and its padding must sit inside the artboard",["qr"]),(l.radius??0)>(l.size+2*m)/2&&e("qr.radius is larger than half the plate",["qr","radius"]);let f=0,d=0;t.shapes.forEach((b,y)=>{let _=["shapes",y],{bounds:w,segments:M}=ea(b);if(!w){e("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",[..._,"d"]);return}if(s(w)||e("The shape extends outside the artboard",_),b.type==="rect"&&b.hole){let{hole:S}=b;(S.x<b.x||S.y<b.y||S.x+S.width>b.x+b.width+1e-9||S.y+S.height>b.y+b.height+1e-9)&&e("The hole must sit inside its rect",[..._,"hole"]);}b.type==="circle"&&b.hole&&b.hole>=b.r&&e("The hole must be smaller than the circle",[..._,"hole"]),"stroke"in b&&b.stroke&&b.stroke.width>Math.min(r,a)*.1+1e-9&&e("A stroke may be at most 10% of the artboard's shorter side",[..._,"stroke","width"]),l.plate==="background"&&dm(b,t,w)&&e('With qr.plate "background", only background fills (or a ring whose hole holds the plate) may lie under the plate',_),f+=M,typeof b.fill=="object"&&"gradient"in b.fill&&(d+=(b.fill.gradient.steps??32)*M);}),f>n.maxSegments&&e(`The shapes have ${f} segments; the limit is ${n.maxSegments}`,["shapes"]),d>n.maxGradientWork&&e("Gradient fills are too detailed (fewer steps or simpler shapes)",["shapes"]);let g=[],h=new Set,p=new Set;t.labels.forEach((b,y)=>{let _=["labels",y];h.has(b.id)&&e(`Label id "${b.id}" is used twice`,[..._,"id"]),h.add(b.id),b.slot!=="fixed"&&(p.has(b.slot)&&e(`Only one label may use the ${b.slot} slot`,[..._,"slot"]),p.add(b.slot));let w=b.maxLength??n.maxTextLength;b.text!==hn(b.text,w)&&e(`Label text must be at most ${w} characters, trimmed, with no control or invisible characters (see sanitizeFrameText)`,[..._,"text"]);let M;if(b.type==="text"){M={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*Un+1e-9&&e("fontSize may be at most 95% of the label's row height",[..._,"fontSize"]);let S=b.box.y+b.box.height/2,$=lm(b)*cm,C={x0:M.x0,x1:M.x1,y0:S-$,y1:S+$};(Yo(M,sm(t))||Yo(C,u))&&e("The label overlaps the code or its padding",[..._,"box"]);}else {let{cx:S,cy:$,radius:C}=b.curve,R=b.fontSize*ln*.6;M={x0:S-C-R,y0:$-C-R,x1:S+C+R,y1:$+C+R};let E=Math.hypot(Math.max(u.x0-S,0,S-u.x1),Math.max(u.y0-$,0,$-u.y1));Math.hypot(Math.max(Math.abs(u.x0-S),Math.abs(u.x1-S)),Math.max(Math.abs(u.y0-$),Math.abs(u.y1-$)))<=C-R||E>=C+R||e("The curved label crosses the code or its padding",[..._,"curve"]);}if(s(M)||e("The label extends outside the artboard",_),b.collapse){let S=b.collapse,$=S.y+S.height;(S.y<-1e-9||$>a+1e-9)&&e("The collapse band must sit inside the artboard",[..._,"collapse"]),$>u.y0+1e-6&&S.y<u.y1-1e-6&&e("The collapse band crosses the code or its padding",[..._,"collapse"]);for(let C of g)$>C.y+1e-6&&S.y<C.y+C.height-1e-6&&e("Collapse bands may not overlap",[..._,"collapse"]);g.push(S);}});}var na=(t,e=0)=>{for(let n=e;n<t.length;n++)if(t[n]?.continue!==true)return true;return false};function fe(t,e=[],n={}){return {...n,run(o){let r=t({value:o,issues:[]}),a=na(r.issues);for(let i of e){if(i.hasLength){let s=r.value;if(r.issues.some(l=>l.continue===false)||s===null||s===void 0||s.length===void 0)continue}else if(a)continue;let c=r.issues.length;i.run(r),!a&&r.issues.length>c&&(a=na(r.issues,c));}return r}}}function hm(t){if(typeof t=="number")return Number.isNaN(t)?"NaN":Number.isFinite(t)?"number":String(t);if(t===null)return "null";if(Array.isArray(t))return "array";if(typeof t=="object"){let e=t.constructor;if(Object.getPrototypeOf(t)!==Object.prototype&&"constructor"in t&&e)return e.name}return typeof t}var Ie=(t,e)=>({path:[],message:`Invalid input: expected ${t}, received ${hm(e)}`}),pm={string:"characters",array:"items"};function ne(t,e,n,o){let r=pm[e],a=t?"Too big":"Too small",i=`${t?"<=":">="}${n}`;return {path:[],message:r?`${a}: expected ${e} to have ${i} ${r}`:`${a}: expected ${e} to be ${i}`,continue:o}}var ra=t=>typeof t=="string"?`"${t}"`:`${t}`,xs=t=>typeof t=="object"&&t!==null&&!Array.isArray(t);function sa(t,e,n){for(let o of n)o.path.unshift(e),t.push(o);}var gm=t=>t>=55296&&t<=56319,bm=t=>t>=56320&&t<=57343;function ym(t){let e=t.length;for(let n=0;n<t.length-1;n++)gm(t.charCodeAt(n))&&bm(t.charCodeAt(n+1))&&(e--,n++);return e}var $s=t=>Array.isArray(t)?"array":typeof t=="string"?"string":"unknown",Wn=t=>({run(e){e.value<t&&e.issues.push(ne(false,"number",t,true));}}),Hn=t=>({run(e){e.value>t&&e.issues.push(ne(true,"number",t,true));}}),yn=(t,e="Invalid input")=>({run(n){t(n.value)||n.issues.push({path:[],message:e,continue:true});}}),Ss=t=>typeof t=="string"?ym(t):t.length,ws=t=>({hasLength:true,run(e){let n=e.value;Ss(n)<t&&e.issues.push(ne(false,$s(n),t,true));}}),ca=t=>({hasLength:true,run(e){let n=e.value;Ss(n)>t&&e.issues.push(ne(true,$s(n),t,true));}}),Ms=(t,e)=>({run(n){t.lastIndex=0,t.test(n.value)||n.issues.push({path:[],message:e??`Invalid string: must match pattern ${t}`,continue:true});}}),_m={run(t){let e=t.value;Number.isInteger(e)?Number.isSafeInteger(e)||t.issues.push(e>0?ne(true,"int",Number.MAX_SAFE_INTEGER,true):ne(false,"int",Number.MIN_SAFE_INTEGER,true)):t.issues.push({...Ie("int",e),continue:false});}},ke=(...t)=>fe(e=>{let n=e.value;return typeof n=="number"&&Number.isFinite(n)||e.issues.push(Ie("number",n)),e},t),Cs=(...t)=>ke(_m,...t),Er=(...t)=>fe(e=>(typeof e.value!="string"&&e.issues.push(Ie("string",e.value)),e),t);function Dt(t){let e=t.length===1?`Invalid input: expected ${ra(t[0])}`:`Invalid option: expected one of ${t.map(ra).join("|")}`;return fe(n=>(t.includes(n.value)||n.issues.push({path:[],message:e}),n),[],{values:t})}var Ot=t=>Dt([t]),it=t=>({optional:true,run:e=>e===void 0?{value:e,issues:[]}:t.run(e)});function ft(t,e=[]){let n=Object.keys(t),o=new Set(n);return fe(r=>{let a=r.value;if(!xs(a))return r.issues.push(Ie("object",a)),r;let i={};for(let s of n){let l=t[s],m=l.run(a[s]),u=s in a;sa(r.issues,s,m.issues),u||l.optional||m.issues.length>0||r.issues.push({path:[s],message:"Invalid input: expected nonoptional, received undefined"}),u&&(i[s]=m.value);}r.value=i;let c=[];for(let s in a)o.has(s)||c.push(s);return c.length>0&&r.issues.push({path:[],message:`Unrecognized key${c.length>1?"s":""}: ${c.map(ra).join(", ")}`,continue:true}),r},e,{shape:t})}function oa(t,e,n){let o=[];return e!==void 0&&o.push(ws(e)),n!==void 0&&o.push(ca(n)),fe(r=>{let a=r.value;if(Array.isArray(a)&&n!==void 0&&a.length>n)return r.issues.push(ne(true,"array",n,false)),r;if(!Array.isArray(a))return r.issues.push(Ie("array",a)),r;let i=new Array(a.length);for(let c=0;c<a.length;c++){let s=t.run(a[c]);sa(r.issues,c,s.issues),i[c]=s.value;}return r.value=i,r},o)}function aa(t){return fe(e=>{let n=e.value;if(!Array.isArray(n))return e.issues.push(Ie("tuple",n)),e;if(n.length<t.length)return e.issues.push(ne(false,"array",t.length,void 0)),e;n.length>t.length&&e.issues.push(ne(true,"array",t.length,void 0));let o=[];return t.forEach((r,a)=>{let i=r.run(n[a]);sa(e.issues,a,i.issues),o[a]=i.value;}),e.value=o,e})}function bn(t){return fe(e=>{let n=[];for(let r of t){let a=r.run(e.value);if(a.issues.length===0)return a;n.push(a);}let o=n.filter(r=>!na(r.issues));return o.length===1?o[0]:(e.issues.push({path:[],message:"Invalid input"}),e)})}function Rs(t,e){let n=new Map;for(let r of e)for(let a of r.shape?.[t]?.values??[])n.set(a,r);let o=`Invalid discriminator value. Expected ${[...n.keys()].map(r=>`'${r}'`).join(" | ")}`;return fe(r=>{let a=r.value;if(!xs(a))return r.issues.push(Ie("object",a)),r;let i=n.get(a[t]);return i?i.run(a):(r.issues.push({path:[t],message:o}),r)})}var xm=yn(Cr,`Numbers may have at most ${ot.maxDecimals} decimals`),Pr=[Wn(-ot.maxCoordinate),Hn(ot.maxCoordinate),xm],_t=ke(...Pr),Ct=ke(...Pr,yn(t=>t>0,"Must be greater than 0")),Ar=ke(...Pr,yn(t=>t>=0,"Must not be negative")),qn=Er(Ms(/^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/,"Use a #rgb or #rrggbb color")),bs=bn([Dt(Jo),qn]),Es=t=>ft({mix:aa([t,t]),amount:ke(Wn(0),Hn(1),yn(Cr))}),gn=bn([bs,Es(bs)]),$m=bn([qn,Es(bn([Dt(["frame","accent","background"]),qn]))]),Fe=bn([gn,ft({gradient:ft({from:gn,to:gn,direction:it(Dt(["horizontal","vertical"])),steps:it(Cs(Wn(2),Hn(ot.maxGradientSteps)))})})]),ia=()=>({x:_t,y:_t,width:Ct,height:Ct}),zn=ft({color:gn,width:Ct}),Sm=Rs("type",[ft({type:Ot("rect"),...ia(),radius:it(Ar),fill:Fe,hole:it(ft({...ia(),radius:it(Ar)})),stroke:it(zn)}),ft({type:Ot("circle"),cx:_t,cy:_t,r:Ct,hole:it(Ct),fill:Fe,stroke:it(zn)}),ft({type:Ot("ellipse"),cx:_t,cy:_t,rx:Ct,ry:Ct,fill:Fe,stroke:it(zn)}),ft({type:Ot("polygon"),points:oa(aa([_t,_t]),3,ot.maxPolygonPoints),fill:Fe,stroke:it(zn)}),ft({type:Ot("path"),d:Er(ws(2),ca(ot.maxPathLength)),fill:Fe,fillRule:it(Dt(["nonzero","evenodd"])),stroke:it(zn)}),ft({type:Ot("line"),x1:_t,y1:_t,x2:_t,y2:_t,width:Ct,cap:it(Dt(["butt","round"])),dash:it(aa([Ct,Ct])),fill:Fe}),ft({type:Ot("icon"),icon:Dt(Ko),x:_t,y:_t,size:Ct,fill:Fe})]),ys=()=>({id:Er(Ms(/^[a-z][a-z0-9-]{0,31}$/)),slot:Dt(["primary","secondary","fixed"]),text:Er(ca(200)),maxLength:it(Cs(Wn(1),Hn(te))),color:gn,weight:it(Dt(["bold","regular"])),collapse:it(ft({y:_t,height:Ct}))}),wm=Rs("type",[ft({type:Ot("text"),...ys(),box:ft(ia()),align:it(Dt(["start","middle","end"])),fontSize:it(Ct)}),ft({type:Ot("curved"),...ys(),curve:ft({cx:_t,cy:_t,radius:Ct,side:Dt(["top","bottom"]),spread:it(ke(Wn(20),Hn(300),yn(Cr)))}),fontSize:Ct})]),_s=ke(...Pr,yn(t=>t>=ot.minArtboard&&t<=ot.maxArtboard,`Artboard sides must be ${ot.minArtboard} to ${ot.maxArtboard} units`)),Mm=ft({kind:Ot(Bn),version:Ot(Qn),artboard:ft({width:_s,height:_s}),qr:ft({x:_t,y:_t,size:Ct,padding:it(Ar),radius:it(Ar),plate:it(Dt(["opaque","background","none"]))}),colors:ft({frame:qn,text:it($m),accent:it(qn)}),shapes:oa(Sm,void 0,ot.maxShapes),labels:oa(wm,void 0,ot.maxLabels),bleed:it(bn([Ot("none"),gn]))},[{run(t){gs(t.value,(e,n=[])=>{t.issues.push({path:[...n],message:e,continue:true});});}}]);function vr(t){let e=Mm.run(t);return e.issues.length===0?{success:true,data:e.value}:{success:false,issues:e.issues.map(({path:n,message:o})=>({path:n,message:o}))}}var As=({path:t,message:e})=>t.length>0?`${t.join(".")}: ${e}`:e;function K(t){if(t.length===0)return "";let[e,...n]=t;return `M${x(e[0])} ${x(e[1])}${n.map(([o,r])=>`L${x(o)} ${x(r)}`).join("")}Z`}function Z(t,e,n){return `M${x(t-n)} ${x(e)}A${x(n)} ${x(n)} 0 1 1 ${x(t+n)} ${x(e)}A${x(n)} ${x(n)} 0 1 1 ${x(t-n)} ${x(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(u=>Math.max(0,Math.min(u,a))),m=(u,f,d)=>u>0?`A${x(u)} ${x(u)} 0 0 1 ${x(f)} ${x(d)}`:"";return `M${x(t+i)} ${x(e)}H${x(t+n-c)}${m(c,t+n,e+c)}V${x(e+o-s)}${m(s,t+n-s,e+o)}H${x(t+l)}${m(l,t,e+o-l)}V${x(e+i)}${m(i,t+i,e)}Z`}function _n(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 xn(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 Vn(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),m=Math.sin(s);return [t+n*Math.sign(l)*Math.abs(l)**(2/r),e+o*Math.sign(m)*Math.abs(m)**(2/r)]})}function $n(t,e,n){let o=n/2,r=(a,i)=>`${x(t+a*o)} ${x(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 Ps(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 Lr(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 Te(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 la=24,he=(t,e,n,o)=>{let r=o*Math.PI/180;return [t+n*Math.cos(r),e+n*Math.sin(r)]},Fr=([t,e])=>`${x(t)} ${x(e)}`;function Sn(t,e,n,o,r,a){let i=a-r>180?1:0;return `M${Fr(he(t,e,o,r))}A${x(o)} ${x(o)} 0 ${i} 1 ${Fr(he(t,e,o,a))}L${Fr(he(t,e,n,a))}A${x(n)} ${x(n)} 0 ${i} 0 ${Fr(he(t,e,n,r))}Z`}function jn(t,e,n,o){return `M${x(t-n)} ${x(e)}A${x(n)} ${x(o)} 0 1 1 ${x(t+n)} ${x(e)}A${x(n)} ${x(o)} 0 1 1 ${x(t-n)} ${x(e)}Z`}function Cm(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 vs(t){return K(Cm(t)<0?[...t].reverse():t)}function Ir(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 vs([[t+i,e+c],[n+i,o+c],[n-i,o-c],[t-i,e-c]])}var Et=(...t)=>({d:t.join(""),fillRule:"nonzero"}),re=(...t)=>({d:t.join(""),fillRule:"evenodd"});function Rm(){let t=[];for(let e of [0,60,120]){let[n,o]=he(12,12,10.5,e+180),[r,a]=he(12,12,10.5,e);t.push(Ir(n,o,r,a,2));}for(let e=0;e<6;e++){let n=e*60,[o,r]=he(12,12,6.2,n);for(let a of [-45,45]){let[i,c]=he(o,r,3.6,n+a);t.push(Ir(o,r,i,c,1.7));}}return Et(...t)}var Em={wifi:()=>Et(Sn(12,20,4.6,7.2,-135,-45),Sn(12,20,9.2,11.8,-135,-45),Sn(12,20,13.8,16.4,-135,-45),Z(12,20,2.2)),star:()=>Et(K(xn(12,12.8,11.6,4.8))),heart:()=>Et($n(12,12.4,22)),phone:()=>re(D(6,1.5,12,21,2.6),D(7.8,4.2,8.4,13.4,.6),Z(12,19.8,1.1)),headphones:()=>Et(Sn(12,13,7.6,9.8,-180,0),D(2,12,5,9.5,2),D(17,12,5,9.5,2)),calendar:()=>re(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:()=>Et(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:()=>re(D(2,3,20,14,4),K([[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:()=>Et(D(3.5,7.5,17,14.5,2),Sn(12,7.5,3.1,4.8,-180,0)),bell:()=>Et("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:()=>Et("M4 6.5H17V13.5A6.5 6.5 0 0 1 4 13.5Z",Sn(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:()=>re(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:()=>re(Z(12,12,10.5),K([[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:()=>re(Z(12,12,10.5),Z(12,7.2,1.6),D(10.6,10,2.8,8,.8)),home:()=>re(K([[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:()=>re("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:()=>Et(Ir(6,12,18,5,1.8),Ir(6,12,18,19,1.8),Z(18,5,3.2),Z(6,12,3.2),Z(18,19,3.2)),download:()=>Et(D(10.6,2,2.8,9.5,0),K([[6,10],[18,10],[12,16.5]]),K([[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:()=>re(Z(12,12,10.5),Z(12,12,8.4),K([[11,5.4],[13,5.4],[13,11.3],[16.9,13.5],[15.9,15.2],[11,12.5]])),snowflake:Rm,pumpkin:()=>Et(jn(7.8,14.6,5.8,6.9),jn(16.2,14.6,5.8,6.9),jn(12,14.6,4.8,7.4),D(10.9,3.4,2.2,4.6,.8),vs([[13,4.2],[17.2,3],[16.2,5.4],[13,6]])),tree:()=>Et(K([[12,1.5],[16.8,8.2],[7.2,8.2]]),K([[12,5.2],[19,13.6],[5,13.6]]),K([[12,9.4],[21.2,19.2],[2.8,19.2]]),D(10.4,18.6,3.2,3.9,.4)),sparkle:()=>Et(K(xn(9.5,13.5,9,2.4,4)),K(xn(19,5,4,1.1,4))),gift:()=>Et(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),jn(8.8,4.8,2.9,1.9),jn(15.2,4.8,2.9,1.9))};function ua(t){return Em[t]()}var Am={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 Ls(t,e){let n=t.trim(),o=Number.parseFloat(n);return Number.isNaN(o)?Number.NaN:n.endsWith("%")?o/100*e:o}function lt(t){if(!t)return null;let e=t.trim().toLowerCase();if(e==="transparent")return {r:0,g:0,b:0,a:0};let n=Am[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,m]=i.slice(0,3).map(d=>Ls(d,255)),u=c===void 0?1:Ls(c,1);if([s,l,m,u].some(d=>Number.isNaN(d)))return null;let f=(d,g)=>Math.min(Math.max(d,0),g);return {r:f(s,255),g:f(l,255),b:f(m,255),a:f(u,1)}}return null}function pe(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]:[j((1-o-i)/(1-i)),j((1-r-i)/(1-i)),j((1-a-i)/(1-i)),j(i)]}function Fs(t){return t===" "?.3:/[MWmw@%]/.test(t)?.92:/[A-Z0-9#&]/.test(t)?.72:/[il.,:;!'|1]/.test(t)?.32:.6}function da(t){let e=0;for(let n of t)e+=Fs(n);return Math.max(e,1)}var ma=t=>Math.round(Math.min(255,Math.max(0,t))).toString(16).padStart(2,"0");function Zn(t,e,n){let o=lt(t)??{r:0,g:0,b:0},r=lt(e)??{r:255,g:255,b:255},a=Math.min(1,Math.max(0,n));return `#${ma(o.r+(r.r-o.r)*a)}${ma(o.g+(r.g-o.g)*a)}${ma(o.b+(r.b-o.b)*a)}`}function Is(t,e,n,o,r,a,i,c){let s=[...t],l=r*.08,m=s.map(h=>Fs(h)*r),u=m.reduce((h,p)=>h+p,0)+l*Math.max(0,s.length-1),f=a==="top"?o-r*.35:o+r*.35,d=[],g=0;return s.forEach((h,p)=>{let b=m[p],y=(g+b/2)/f;if(g+=b+l,h.trim()==="")return;let _=a==="top"?-Math.PI/2-u/2/f+y:Math.PI/2+u/2/f-y;d.push({text:h,x:e+f*Math.cos(_),y:n+f*Math.sin(_),fontSize:r,maxWidth:r*2,color:i,rotate:_*180/Math.PI+(a==="top"?90:-90),field:c});}),d}function yt(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 Xn=class extends Error{issues;constructor(e){super(`Invalid frame spec: ${e.slice(0,5).join("; ")}`),this.name="FrameSpecError",this.issues=e;}},ks=new WeakMap;function Ne(t){if(t&&typeof t=="object"){let n=ks.get(t);if(n)return n}if(t==null)throw new Xn(['A "custom" frame needs a spec']);let e=vr(t);if(!e.success)throw new Xn(e.issues.map(As));return typeof t=="object"&&ks.set(t,e.data),e.data}function fa(t){let e=Ne(t);return pn(e)/e.qr.size}var Pm=t=>{let e=lt(t);return !!(e&&e.a>=1)};function vm(t,e){let n=yt(e,bt);return t.qr.plate==="none"?{color:n,plate:false}:Pm(n)?{color:n,plate:true}:t.qr.plate==="background"?{color:n,plate:false}:{color:bt,plate:true}}function kr(t,e,n=bt){let o=e.color||t.colors.frame,r=e.secondaryColor||t.colors.accent||o,a=s=>s==="frame"?o:s==="accent"?r:s==="background"?n:s,i=t.colors.text,c=e.textColor||(i===void 0?o:typeof i=="string"?i:Zn(a(i.mix[0]),a(i.mix[1]),i.amount));return {frame:o,text:c,accent:r}}function Lm(t,e,n){let o=kr(e,t,n),r=a=>{switch(a){case "frame":return o.frame;case "text":return o.text;case "accent":return o.accent;case "background":return n;default:return a}};return a=>typeof a=="string"?r(a):Zn(r(a.mix[0]),r(a.mix[1]),a.amount)}function Ts(t,e,n=0,o=0){let r=Dn(t);return r?Ho(r,e,n,o):""}function Fm(t,e,n,o){return `M${x(t-n)} ${x(e)}A${x(n)} ${x(o)} 0 1 1 ${x(t+n)} ${x(e)}A${x(n)} ${x(o)} 0 1 1 ${x(t-n)} ${x(e)}Z`}function Im(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,m=-l*c,u=s*c,f=(p,b)=>{let y=[n+s*p,o+l*p],_=[n+s*b,o+l*b];if(t.cap==="round"&&b-p>2*c){let w=[y[0]+s*c,y[1]+l*c],M=[_[0]-s*c,_[1]-l*c];return `M${x(w[0]-m)} ${x(w[1]-u)}L${x(M[0]-m)} ${x(M[1]-u)}A${x(c)} ${x(c)} 0 0 1 ${x(M[0]+m)} ${x(M[1]+u)}L${x(w[0]+m)} ${x(w[1]+u)}A${x(c)} ${x(c)} 0 0 1 ${x(w[0]-m)} ${x(w[1]-u)}Z`}return `M${x(y[0]-m)} ${x(y[1]-u)}L${x(_[0]-m)} ${x(_[1]-u)}L${x(_[0]+m)} ${x(_[1]+u)}L${x(y[0]+m)} ${x(y[1]+u)}Z`};if(!t.dash)return {type:"path",d:f(0,i),fillRule:"nonzero"};let d=t.dash[0]*e,g=d+t.dash[1]*e,h=[];for(let p=0;p+d<=i+1e-6;p+=g)h.push(f(p,p+d));return {type:"path",d:h.join(""),fillRule:"nonzero"}}function km(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:Fm(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:Ts(t.d,e),fillRule:t.fillRule??"nonzero"};case "line":return Im(t,e);default:{let n=ua(t.icon);return {type:"path",d:Ts(n.d,t.size*e/la,t.x*e,t.y*e),fillRule:n.fillRule}}}}function Tm(t){if(t.type==="rect"){let{x:e,y:n,width:o,height:r,radius:a,hole:i}=t;return [...Yt(e,n,o,r,a,a),...i?Yt(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"}]:ee(t.d)}function Nm(t,e,n){let o=Tm(t),r=wr(o,.2),a=t.type==="rect"?t.hole?"evenodd":"nonzero":t.type==="path"?t.fillRule??"nonzero":"nonzero",i=e.direction==="vertical",c=p=>i?p[1]:p[0],s=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY;for(let p of r)for(let b of p)s=Math.min(s,c(b)),l=Math.max(l,c(b));if(!(l>s))return [];let m=e.steps??32,u=n(e.from),f=n(e.to),d=l-s,g=d*.002,h=[];for(let p=0;p<m;p++){let b=s+d*p/m,y=Math.min(l,s+d*(p+1)/m+(p+1<m?g:0)),_=i?{x0:Number.NEGATIVE_INFINITY,x1:Number.POSITIVE_INFINITY,y0:b,y1:y}:{x0:b,x1:y,y0:Number.NEGATIVE_INFINITY,y1:Number.POSITIVE_INFINITY},w=r.map(M=>un(M,_)).filter(M=>M.length>2);w.length!==0&&h.push({type:"path",d:us(w),fill:Zn(u,f,(p+.5)/m),fillRule:a});}return h}function Om(t,e,n){let o=km(t,e),r="stroke"in t&&t.stroke?{stroke:n(t.stroke.color),strokeWidth:t.stroke.width*e}:void 0;if(typeof t.fill=="object"&&"gradient"in t.fill){let a=Nm(o,t.fill.gradient,n);return r?[...a,{...o,fill:"none",...r}]:a}return [{...o,fill:n(t.fill),...r}]}function Dm(t,e){let n=Math.min(t.maxLength??ot.maxTextLength,ot.maxTextLength),o=t.slot==="primary"?e.text??t.text:t.slot==="secondary"?e.secondaryText??t.text:t.text;return hn(o,n)}function Bm(t){return t===void 0||!Number.isFinite(t)?1:Math.min(ln,Math.max(On,t))}function Qm(t,e,n,o,r,a){let i=r(t.color),c=t.weight==="regular"?{fontWeight:400}:{};if(t.type==="curved"){let{cx:h,cy:p,radius:b,side:y,spread:_=140}=t.curve,w=b*o*(_*Math.PI/180),M=Math.min(t.fontSize*o*n,w/(da(e)+.08*e.length));return Is(e,h*o,p*o,b*o,M,y,i,a).map(S=>({...S,...c}))}let s=t.box.x*o,l=t.box.y*o,m=t.box.width*o,u=t.box.height*o;if(!(u>0))return [];let f=(t.fontSize??t.box.height*ta)*o,d=Math.min(f*n,u*Un,m/da(e)),g=t.align??"middle";return [{text:e,x:g==="start"?s:g==="end"?s+m:s+m/2,y:l+u/2+d*.35,fontSize:d,maxWidth:m,color:i,...g!=="middle"&&{align:g},...c,field:a}]}function Gm(t){let e=0,n=0,o=0,r=0;return t.map(({command:a,values:i})=>{let c=a.toUpperCase(),s=a!==c;switch(c){case "Z":return e=o,n=r,{command:"Z",values:[]};case "H":return e=(s?e:0)+i[0],{command:"H",values:[e]};case "V":return n=(s?n:0)+i[0],{command:"V",values:[n]};case "A":return e=(s?e:0)+i[5],n=(s?n:0)+i[6],{command:"A",values:[...i.slice(0,5),e,n]};default:{let l=i.map((m,u)=>s?m+(u%2===0?e:n):m);return e=l.at(-2),n=l.at(-1),c==="M"&&(o=e,r=n),{command:c,values:l}}}})}function Um(t,e){let n=Dn(t);return n?Ho(Gm(n).map(({command:o,values:r})=>o==="V"?{command:o,values:[e(r[0])]}:o==="H"||o==="Z"?{command:o,values:r}:o==="A"?{command:o,values:[...r.slice(0,6),e(r[6])]}:{command:o,values:r.map((a,i)=>i%2===1?e(a):a)})):t}function zm(t,e){let n=(o,r)=>{let a=e(o);return {y:a,height:e(o+r)-a}};switch(t.type){case "rect":return {...t,...n(t.y,t.height),...t.hole&&{hole:{...t.hole,...n(t.hole.y,t.hole.height)}}};case "circle":case "ellipse":return {...t,cy:e(t.cy)};case "polygon":return {...t,points:t.points.map(([o,r])=>[o,e(r)])};case "path":return {...t,d:Um(t.d,e)};case "line":return {...t,y1:e(t.y1),y2:e(t.y2)};default:return {...t,y:e(t.y)}}}function qm(t,e){if(e.length===0)return t;let n=r=>{let a=r;for(let i of e)a-=Math.min(Math.max(r-i.y,0),i.height);return a},o=(r,a)=>e.some(i=>r>=i.y-1e-6&&a<=i.y+i.height+1e-6);return {...t,artboard:{...t.artboard,height:n(t.artboard.height)},qr:{...t.qr,y:n(t.qr.y)},shapes:t.shapes.filter(r=>{let{bounds:a}=ea(r);return !(a&&o(a.y0,a.y1))}).map(r=>zm(r,n)),labels:t.labels.map(r=>{if(r.type==="curved")return {...r,curve:{...r.curve,cy:n(r.curve.cy)}};let a=n(r.box.y);return {...r,box:{...r.box,y:a,height:n(r.box.y+r.box.height)-a}}})}}function Yn(t,e,n,o,r={}){let a=new Map(e.labels.map(p=>[p.id,Dm(p,n)])),i=qm(e,e.labels.flatMap(p=>p.collapse&&!a.get(p.id)?[p.collapse]:[])),c=t/i.qr.size,s=vm(i,o),l=Lm(n,i,s.color),m=i.shapes.flatMap(p=>Om(p,c,l));if(s.plate){let p=pn(i)*c;m.push({type:"rect",x:i.qr.x*c-p,y:i.qr.y*c-p,width:t+2*p,height:t+2*p,radius:(i.qr.radius??0)*c,fill:s.color});}let u=Bm(n.fontScale),f=i.labels.flatMap(p=>{let b=a.get(p.id);if(!b)return [];let y=(p.slot==="fixed"?void 0:r[p.slot])??p.id;return Qm(p,b,u,c,l,y)}),d=f[0],g=d&&d.rotate===void 0?d:null,h=i.bleed??"none";return {width:i.artboard.width*c,height:i.artboard.height*c,qrX:i.qr.x*c,qrY:i.qr.y*c,qrSize:t,shapes:m,label:g,extraLabels:g?f.slice(1):f,squareEdges:h!=="none",color:l(h==="none"?"frame":h)}}function ha(t,e,n){return Yn(t,Ne(e.spec),e,n)}var Ns={kind:"qrdx.frame",version:1,artboard:{width:1600,height:1470},qr:{x:300,y:120,size:1e3,padding:70,radius:10,plate:"background"},colors:{frame:"#000000",text:"#FFFFFF"},shapes:[{type:"polygon",points:[[0,1250],[190,1250],[190,1470],[0,1470],[50.4,1360]],fill:{mix:["frame","#000000"],amount:.28}},{type:"polygon",points:[[1600,1250],[1549.6,1360],[1600,1470],[1410,1470],[1410,1250]],fill:{mix:["frame","#000000"],amount:.28}},{type:"polygon",points:[[90,1420],[170,1470],[90,1470]],fill:{mix:["frame","#000000"],amount:.5}},{type:"polygon",points:[[1510,1420],[1510,1470],[1430,1470]],fill:{mix:["frame","#000000"],amount:.5}},{type:"rect",x:220,y:40,width:1160,height:1160,radius:20,fill:"background"},{type:"rect",x:180,y:0,width:1240,height:1240,radius:60,fill:"frame",hole:{x:220,y:40,width:1160,height:1160,radius:20}},{type:"rect",x:90,y:1200,width:1420,height:220,fill:"frame"}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:170,y:1200,width:1260,height:220}}]};var pa={kind:"qrdx.frame",version:1,artboard:{width:1240,height:1420},qr:{x:120,y:120,size:1e3,padding:70,plate:"background"},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 Os={kind:"qrdx.frame",version:1,artboard:{width:1240,height:1420},qr:{x:120,y:300,size:1e3,padding:70,plate:"background"},colors:{frame:"#000000",text:"#FFFFFF"},shapes:[{type:"rect",x:40,y:220,width:1160,height:1160,fill:"background"},{type:"rect",x:0,y:0,width:1240,height:1420,fill:"frame",hole:{x:40,y:220,width:1160,height:1160}}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:120,y:0,width:1e3,height:220}}],bleed:"frame"};var Ds={kind:"qrdx.frame",version:1,artboard:{width:1240,height:1600},qr:{x:120,y:300,size:1e3,padding:70,plate:"background"},colors:{frame:"#000000",text:"#FFFFFF"},shapes:[{type:"rect",x:40,y:220,width:1160,height:1160,fill:"background"},{type:"rect",x:0,y:0,width:1240,height:1600,fill:"frame",hole:{x:40,y:220,width:1160,height:1160}}],labels:[{type:"text",id:"top",slot:"primary",text:"Scan me",color:"text",box:{x:120,y:0,width:1e3,height:220}},{type:"text",id:"bottom",slot:"secondary",text:"",color:"text",box:{x:120,y:1380,width:1e3,height:220}}],bleed:"frame"};var Bs={kind:"qrdx.frame",version:1,artboard:{width:1240,height:1340},qr:{x:120,y:120,size:1e3,padding:40,plate:"background"},colors:{frame:"#000000"},shapes:[{type:"rect",x:40,y:40,width:1160,height:1260,fill:"background"},{type:"rect",x:0,y:0,width:1240,height:1340,fill:"frame",hole:{x:40,y:40,width:1160,height:1260}}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:120,y:1120,width:1e3,height:180},collapse:{y:1200,height:100}}],bleed:"frame"};var Qs={kind:"qrdx.frame",version:1,artboard:{width:1240,height:1530},qr:{x:120,y:120,size:1e3,padding:80,radius:80},colors:{frame:"#000000",text:"#FFFFFF"},shapes:[{type:"rect",x:0,y:0,width:1240,height:1400,radius:120,fill:"frame"},{type:"path",d:"M161.2 1380L62 1530Q198.4 1458.5 396.8 1380Z",fill:"frame"}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:120,y:1200,width:1e3,height:200},collapse:{y:1220,height:160}}]};var Gs={kind:"qrdx.frame",version:1,artboard:{width:1978.214,height:1978.214},qr:{x:489.107,y:489.107,size:1e3,padding:50,plate:"background"},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 Us={kind:"qrdx.frame",version:1,artboard:{width:1320,height:1558},qr:{x:160,y:130,size:1e3,padding:60},colors:{frame:"#000000",text:"#FFFFFF"},shapes:[{type:"rect",x:0,y:370,width:1320,height:1188,fill:{mix:["frame","#FFFFFF"],amount:.45}},{type:"polygon",points:[[0,370],[660,0],[1320,370]],fill:{mix:["frame","#FFFFFF"],amount:.25}},{type:"rect",x:80,y:50,width:1160,height:1268,fill:"background"},{type:"rect",x:68,y:38,width:1184,height:1280,fill:"frame",hole:{x:80,y:50,width:1160,height:1268}},{type:"polygon",points:[[0,1178],[660,1318],[1320,1178],[1320,1558],[0,1558]],fill:"frame"}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:160,y:1318,width:1e3,height:220}}]};var zs={kind:"qrdx.frame",version:1,artboard:{width:1230,height:1430},qr:{x:115,y:115,size:1e3,padding:70,plate:"background"},colors:{frame:"#000000"},shapes:[{type:"rect",x:0,y:0,width:1230,height:1430,fill:"background"},{type:"polygon",points:[[0,0],[200,0],[200,35],[35,35],[35,200],[0,200]],fill:"frame"},{type:"polygon",points:[[1230,0],[1030,0],[1030,35],[1195,35],[1195,200],[1230,200]],fill:"frame"},{type:"polygon",points:[[1230,1230],[1030,1230],[1030,1195],[1195,1195],[1195,1030],[1230,1030]],fill:"frame"},{type:"polygon",points:[[0,1230],[200,1230],[200,1195],[35,1195],[35,1030],[0,1030]],fill:"frame"}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:80,y:1210,width:1070,height:200},collapse:{y:1230,height:200}}]};var Tr={kind:"qrdx.frame",version:1,artboard:{width:1260,height:1360},qr:{x:130,y:130,size:1e3,padding:40,plate:"background"},colors:{frame:"#7c3aed",text:{mix:["frame","accent"],amount:.5},accent:"#db2777"},shapes:[{type:"rect",x:50,y:50,width:1160,height:1260,radius:50,fill:"background"},{type:"rect",x:0,y:0,width:1260,height:1360,radius:100,fill:{gradient:{from:"frame",to:"accent",direction:"horizontal",steps:48}},hole:{x:50,y:50,width:1160,height:1260,radius:50}}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:130,y:1130,width:1e3,height:180},collapse:{y:1210,height:100}}]};var qs={kind:"qrdx.frame",version:1,artboard:{width:1260,height:1460},qr:{x:130,y:260,size:1e3,padding:46,plate:"background"},colors:{frame:"#000000"},shapes:[{type:"rect",x:0,y:0,width:1260,height:1460,radius:30,fill:"background"},{type:"rect",x:0,y:0,width:1260,height:1460,radius:30,fill:"frame",hole:{x:22,y:22,width:1216,height:1416,radius:8}},{type:"rect",x:45,y:45,width:1170,height:1370,fill:"frame",hole:{x:53,y:53,width:1154,height:1354}},{type:"rect",x:378,y:181,width:504,height:8,fill:"frame"},{type:"polygon",points:[[630,163],[652,185],[630,207],[608,185]],fill:"frame"}],labels:[{type:"text",id:"title",slot:"primary",text:"Scan me",color:"text",box:{x:130,y:30,width:1e3,height:170},collapse:{y:84,height:130}},{type:"text",id:"footer",slot:"secondary",text:"",color:"text",box:{x:130,y:1270,width:1e3,height:160},collapse:{y:1306,height:70}}]};var Ws={kind:"qrdx.frame",version:1,artboard:{width:1260,height:1610},qr:{x:130,y:250,size:1e3,padding:75,radius:55},colors:{frame:"#000000"},shapes:[{type:"rect",x:0,y:0,width:1260,height:1610,radius:170,fill:"frame"},{type:"rect",x:50,y:170,width:1160,height:1290,radius:60,fill:"background"},{type:"rect",x:520,y:67,width:220,height:36,radius:18,fill:"background"},{type:"rect",x:480,y:1520,width:300,height:30,radius:15,fill:"background"}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:130,y:1290,width:1e3,height:170},collapse:{y:1330,height:130}}]};var Hs={kind:"qrdx.frame",version:1,artboard:{width:1325,height:1555},qr:{x:150,y:150,size:1e3,padding:80},colors:{frame:"#000000",text:"#FFFFFF"},shapes:[{type:"rect",x:25,y:25,width:1300,height:1530,radius:15,fill:{mix:["frame","#FFFFFF"],amount:.72}},{type:"rect",x:0,y:0,width:1300,height:1530,radius:15,fill:"frame"}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:150,y:1260,width:1e3,height:240}}]};var Vs={kind:"qrdx.frame",version:1,artboard:{width:1240,height:1340},qr:{x:120,y:120,size:1e3,padding:40,plate:"background"},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:1120,width:1e3,height:180},collapse:{y:1200,height:100}}]};var js={kind:"qrdx.frame",version:1,artboard:{width:1240,height:1565},qr:{x:120,y:120,size:1e3,padding:70,radius:20,plate:"background"},colors:{frame:"#000000",text:"#FFFFFF"},shapes:[{type:"rect",x:40,y:40,width:1160,height:1160,radius:30,fill:"background"},{type:"rect",x:0,y:0,width:1240,height:1240,radius:70,fill:"frame",hole:{x:40,y:40,width:1160,height:1160,radius:30}},{type:"polygon",points:[[540,1385],[620,1265],[700,1385]],fill:"frame"},{type:"rect",x:0,y:1345,width:1240,height:220,radius:110,fill:"frame"}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:120,y:1345,width:1e3,height:220}}]};var Zs={kind:"qrdx.frame",version:1,artboard:{width:1240,height:1565},qr:{x:120,y:445,size:1e3,padding:70,radius:20,plate:"background"},colors:{frame:"#000000",text:"#FFFFFF"},shapes:[{type:"rect",x:0,y:0,width:1240,height:220,radius:110,fill:"frame"},{type:"polygon",points:[[540,180],[700,180],[620,300]],fill:"frame"},{type:"rect",x:40,y:365,width:1160,height:1160,radius:30,fill:"background"},{type:"rect",x:0,y:325,width:1240,height:1240,radius:70,fill:"frame",hole:{x:40,y:365,width:1160,height:1160,radius:30}}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:120,y:0,width:1e3,height:220}}]};var Xs={kind:"qrdx.frame",version:1,artboard:{width:1420,height:1590},qr:{x:195,y:195,size:1e3,padding:80},colors:{frame:"#000000",text:"#FFFFFF"},shapes:[{type:"rect",x:30,y:30,width:1390,height:1560,radius:155,fill:{mix:["frame","#FFFFFF"],amount:.7}},{type:"rect",x:0,y:0,width:1390,height:1560,radius:155,fill:"#FFFFFF"},{type:"rect",x:25,y:25,width:1340,height:1510,radius:130,fill:"frame"},{type:"rect",x:95,y:95,width:1200,height:1200,radius:40,fill:"background"}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:175,y:1295,width:1040,height:240},collapse:{y:1365,height:170}}]};var Ys={kind:"qrdx.frame",version:1,artboard:{width:1280,height:1620},qr:{x:140,y:320,size:1e3,padding:80,radius:20},colors:{frame:"#000000",text:"#FFFFFF"},shapes:[{type:"path",d:"M140 0H1140L1280 140V1580A40 40 0 0 1 1240 1620H40A40 40 0 0 1 0 1580V140ZM600 115.2A40 40 0 1 1 680 115.2A40 40 0 1 1 600 115.2Z",fill:"frame",fillRule:"evenodd"},{type:"path",d:"M572 115.2A68 68 0 1 1 708 115.2A68 68 0 1 1 572 115.2ZM600 115.2A40 40 0 1 1 680 115.2A40 40 0 1 1 600 115.2Z",fill:{mix:["frame","#FFFFFF"],amount:.35},fillRule:"evenodd"}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:140,y:1400,width:1e3,height:220},collapse:{y:1420,height:160}}]};var Ks={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 xt=(t,e,n,o,r)=>({style:t,name:e,tags:r,labelOn:o,spec:n}),ga=[xt("banner-bottom","Banner",pa,"frame",["bottom","band"]),xt("banner-top","Top banner",Os,"frame",["top","band"]),xt("banner-top-bottom","Two banners",Ds,"frame",["top","bottom","band"]),xt("border","Border",Bs,"background",["square","outline"]),xt("rounded-border","Rounded",Vs,"background",["border","outline"]),xt("gradient-border","Gradient",Tr,"background",["border","colorful"]),xt("focus","Focus",zs,"background",["corners","brackets"]),xt("speech-bubble","Bubble",js,"frame",["speech"]),xt("speech-bubble-top","Bubble top",Zs,"frame",["speech"]),xt("chat-bubble","Chat",Qs,"frame",["message","bubble"]),xt("circle","Circle",Gs,"frame",["round","ring","curved"]),xt("badge","Ribbon",Ns,"frame",["badge","banner"]),xt("sticker","Sticker",Xs,"frame",["label"]),xt("polaroid","Polaroid",Hs,"frame",["photo","picture"]),xt("phone","Phone",Ws,"background",["mobile","screen"]),xt("ticket","Ticket",Ks,"frame",["event","pass"]),xt("tag","Tag",Ys,"frame",["price","label"]),xt("envelope","Envelope",Us,"frame",["mail","letter"]),xt("menu-card","Menu card",qs,"background",["menu","restaurant"])],u1=new Map(ga.map(t=>[t.style,t]));function ba(t){return u1.get(t)}var m1=Object.fromEntries(ga.map(t=>[t.style,t.spec])),d1={from:Tr.colors.frame,to:Tr.colors.accent};function Nr(t){return !t||t.style==="none"?null:t.style===Gn?t.spec??null:ba(t.style)?.spec??null}function f1(t){let e=Nr(t);return t&&typeof e?.colors?.frame=="string"?kr(e,t):null}var h1={primary:"text",secondary:"secondaryText"};function Js(t,e,n){let o=ba(e.style)?.spec??pa;return Yn(t,Ne(o),e,n,h1)}var Dr="system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif",ec=.08,nc="data-qrdx-frame-label";function kt(t){return !!(t?.style&&t.style!=="none")}function ya(t){let e=Nr(t);return e?fa(e):ec}function p1(t){return (t.text??Do).trim().slice(0,te)}function g1(t){return (t.secondaryText??"").trim().slice(0,te)}function Oe(t,e,n){return e.style===Gn?ha(t,e,n):Js(t,e,n)}function oe(t,e){if(!kt(e))return {width:t,height:t};let{width:n,height:o}=Oe(t,e);return {width:n,height:o}}var tt=t=>j(t,2);function tc({x:t,y:e,width:n,height:o,radius:r}){let a=tt(Math.min(r,n/2,o/2)),[i,c,s,l]=[tt(t),tt(e),tt(n),tt(o)];return a<=0?A`M${i} ${c}h${s}v${l}h${-s}z`:A`M${i+a} ${c}h${tt(s-2*a)}a${a} ${a} 0 0 1 ${a} ${a}`+A`v${tt(l-2*a)}a${a} ${a} 0 0 1 ${-a} ${a}`+A`h${tt(-(s-2*a))}a${a} ${a} 0 0 1 ${-a} ${-a}`+A`v${tt(-(l-2*a))}a${a} ${a} 0 0 1 ${a} ${-a}z`}function Or(t){return t.stroke&&t.strokeWidth?{stroke:t.stroke,strokeWidth:tt(t.strokeWidth)}:{}}function rc(t,e){return t.type==="rect"&&t.hole?v("path",{d:tc(t)+tc(t.hole),fill:t.fill,fillRule:"evenodd",...Or(t)},e):t.type==="polygon"?v("polygon",{fill:t.fill,points:t.points.map(([n,o])=>`${tt(n)},${tt(o)}`).join(" "),...Or(t)},e):t.type==="path"?v("path",{d:t.d,fill:t.fill,...t.fillRule==="evenodd"&&{fillRule:"evenodd"},...Or(t)},e):yr("rect",{...Or(t),fill:t.fill,height:tt(t.height),key:e,width:tt(t.width),x:tt(t.x),y:tt(t.y),...t.radius>0&&{rx:tt(t.radius),ry:tt(t.radius)}})}function oc(t){return t.shapes.map((e,n)=>rc(e,n))}function Br(t,e){let{size:n,frame:o,bgColor:r,svgProps:a,markLabels:i}=e,c=Oe(n,o,r),s=ac(c),l=tt(c.width),m=tt(c.height);return St("svg",{height:m,viewBox:`0 0 ${l} ${m}`,width:l,xmlns:"http://www.w3.org/2000/svg",...a,children:[v("g",{"data-qrdx-frame":o.style,children:c.shapes.map((u,f)=>rc(u,f))}),an(t,{x:tt(c.qrX),y:tt(c.qrY),width:n,height:n}),s.map((u,f)=>v("text",{"data-max-width":tt(u.maxWidth),fill:u.color,fontFamily:Dr,fontSize:tt(u.fontSize),fontWeight:u.fontWeight??700,textAnchor:u.align??"middle",x:tt(u.x),y:tt(u.y),...u.rotate&&{transform:`rotate(${tt(u.rotate)} ${tt(u.x)} ${tt(u.y)})`},...i&&u.field&&{[nc]:u.field},children:u.text},f))]})}function ac(t){return [...t.label?[t.label]:[],...t.extraLabels??[]]}var Qr=.22,Gr=.14;function ic(t,e,n={}){if(t==="circle")return v("circle",{cx:x(e.x+e.w/2),cy:x(e.y+e.h/2),r:x(Math.min(e.w,e.h)/2),...n});let o=t==="rounded"?Math.min(e.w,e.h)*Qr:0;return v("rect",{height:x(e.h),width:x(e.w),x:x(e.x),y:x(e.y),...o>0&&{rx:x(o),ry:x(o)},...n})}function b1(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 Ur(t,e){let n=t.shape??"square",o=t.plate,r=o?b1(e,Gr):e,a=c=>v("image",{height:x(r.h),href:t.src,preserveAspectRatio:"none",width:x(r.w),x:x(r.x),y:x(r.y),...c&&{clipPath:`url(#${c})`}});if(n==="square"&&!o)return a();let i=n==="square"?void 0:`qrdx-logo-${Te(`${n}|${x(r.x)}|${x(r.y)}|${x(r.w)}|${x(r.h)}`)}`;return St("g",{children:[o&&ic(n,e,{fill:o}),i&&v("clipPath",{id:i,children:ic(n,r)}),a(i)]})}var{QrCode:_a}=gt,y1={"1L":3,"1M":2,"1Q":1,"1H":1,"2L":2,"3L":1};function _1(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 m=-2;m<=2;m++)for(let u=-2;u<=2;u++)o(c+u,l+m);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 x1(t,e){let n=t*4+17,o=Rt[e].ordinal,r=_a.NUM_ERROR_CORRECTION_BLOCKS[o]?.[t]??0,a=_a.ECC_CODEWORDS_PER_BLOCK[o]?.[t]??0,i=Math.floor(_a.getNumRawDataModules(t)/8),c=r-i%r,s=Math.floor(i/r),l=Array.from({length:r},(w,M)=>s+(M<c?0:1)),m=[],u=[],f=s-a;for(let w=0;w<=s;w++)for(let M=0;M<r;M++)if(M<c){if(w===f)continue;m.push(M),u.push(w<f?w:w-1);}else m.push(M),u.push(w);if(m.length!==i)throw new Error(`Codeword map: interleave mismatch at version ${t}`);let d=_1(t),g=new Int16Array(n*n).fill(-1),h=new Int16Array(n*n).fill(-1),p=new Int8Array(n*n).fill(-1),b=i*8,y=0;for(let w=n-1;w>=1;w-=2){w===6&&(w=5);let M=(w+1&2)===0;for(let S=0;S<n;S++)for(let $=0;$<2;$++){let C=w-$,E=(M?n-1-S:S)*n+C;if(!d[E]&&y<b){let P=y>>>3;g[E]=m[P],h[E]=u[P],p[E]=7-(y&7),y++;}}}if(y!==b)throw new Error(`Codeword map: placement mismatch at version ${t}`);let _=y1[`${t}${e}`]??0;return {version:t,level:e,size:n,blocks:r,eccPerBlock:a,blockLengths:l,correctable:Math.floor((a-_)/2),block:g,codeword:h,bit:p}}var $1=8,De=new Map;function Kn(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=De.get(n);if(o)return De.delete(n),De.set(n,o),o;let r=x1(t,e);if(De.size>=$1){let a=De.keys().next().value;a!==void 0&&De.delete(a);}return De.set(n,r),r}function Jn(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 S1={2:6,3:12};function sc(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=S1[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,m]=o;e.push([s*s*s*n[0]+3*s*s*c*l[0]+3*s*c*c*m[0]+c*c*c*r[0],s*s*s*n[1]+3*s*s*c*l[1]+3*s*c*c*m[1]+c*c*c*r[1]]);}}}n=r;}return e}function lc(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 uc(t,e){let n=0;for(let o of t)if(o<e)n++;else break;return n%2===1}function w1(t,e,n){return uc(lc(t,n),e)}function mc(t){let e=new Map;return (n,o)=>{let r=e.get(o);return r||(r=lc(t,o),e.set(o,r)),uc(r,n)}}function M1(t,e,n,o){let r=n[0]-t,a=n[1]-e,i=o[0]-n[0],c=o[1]-n[1],s=m=>Math.max(Math.abs(r+m*i),Math.abs(a+m*c)),l=Math.min(s(0),s(1));for(let[m,u]of [[a-r,i-c],[-(r+a),i+c]])if(u!==0){let f=m/u;f>0&&f<1&&(l=Math.min(l,s(f)));}return l}function C1(t,e,n){if(!w1(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,M1(e,n,r[a],r[(a+1)%r.length]));return Number.isFinite(o)?o:0}function R1(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 dc(t){let e=t.map(sc),n=R1(e),o=n.x1-n.x0,r=n.y1-n.y0;if(!(o>0&&r>0))return null;let a=(g,h)=>{let p=Math.max(g-n.x0,n.x1-g,h-n.y0,n.y1-h);return p>0?C1(e,g,h)/(2*p):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 g=1;g<c;g++)for(let h=1;h<c;h++){let p=n.x0+o*h/c,b=n.y0+r*g/c,y=a(p,b);y>i.value&&(i={cx:p,cy:b,value:y});}let s=o/c,l=r/c;for(let g=0;g<6;g++){let h=i;for(let p=-2;p<=2;p++)for(let b=-2;b<=2;b++){let y=h.cx+s*b/2,_=h.cy+l*p/2,w=a(y,_);w>i.value&&(i={cx:y,cy:_,value:w});}s/=2,l/=2;}if(i.value<=0)return null;let u=.5/Math.max(i.cx-n.x0,n.x1-i.cx,i.cy-n.y0,n.y1-i.cy),f=([g,h])=>[.5+(g-i.cx)*u,.5+(h-i.cy)*u],d=t.map(g=>({start:f(g.start),segments:g.segments.map(h=>h.map(f))}));return {rings:d,polygons:d.map(sc),half:i.value}}function fc(t,e){let n=([r,a])=>`${x(r*e)} ${x(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}var E1={start:[0,-0.58],segments:[[[.2,-0.92],[1,-0.97],[1,-0.3]],[[1,.3],[.62,.6],[0,.92]],[[-0.62,.6],[-1,.3],[-1,-0.3]],[[-1,-0.97],[-0.2,-0.92],[0,-0.58]]]},cc;function hc(){return cc??=dc([E1]),cc}function A1(t){let{width:e,height:n,cells:o}=t;return Number.isInteger(e)&&Number.isInteger(n)&&e>=me&&n>=me&&e<=ve&&n<=ve&&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}var ae=([t,e])=>`${t},${e}`;function P1(t,e,n){let o=(s,l)=>t(s-1,l-1),r=new Map,a=(s,l)=>{for(let[m,u]of [[s,l],[l,s]]){let f=r.get(ae(m))??[];f.push(u),r.set(ae(m),f);}};for(let s=0;s<=n;s++)for(let l=0;l<=e;l++){let m=o(l,s),u=o(l+1,s),f=o(l+1,s+1),d=o(l,s+1),g=[l,s-.5],h=[l+.5,s],p=[l,s+.5],b=[l-.5,s];switch((m?8:0)+(u?4:0)+(f?2:0)+(d?1:0)){case 1:case 14:a(b,p);break;case 2:case 13:a(p,h);break;case 3:case 12:a(b,h);break;case 4:case 11:a(g,h);break;case 6:case 9:a(g,p);break;case 7:case 8:a(b,g);break;case 5:a(g,h),a(b,p);break;case 10:a(b,g),a(p,h);break;}}let i=[],c=new Set;for(let[s,l]of r){if(c.has(s)||l.length===0)continue;let[m,u]=s.split(",").map(Number),f=[[m,u]];c.add(s);let d=[m,u],g=l[0];for(;!c.has(ae(g));){c.add(ae(g)),f.push(g);let h=v1(r.get(ae(g))??[],d,c);if(!h)break;d=g,g=h;}f.length>=3&&i.push(L1(f));}return i}function v1(t,e,n){let o=ae(e);return t.find(r=>ae(r)!==o&&!n.has(ae(r)))??t.find(r=>ae(r)!==o)}function L1(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 F1(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}}var tr=new Map;function xa(t){let e=`${t.width}x${t.height}:${t.cells}`,n=tr.get(e);if(n)return n;let o=A1(t),r;if(!o)r={outline:null,problem:"invalid"};else if(t.cells.includes("1")){let a=P1(o,t.width,t.height),i=a.length>0?dc(a.map(F1)):null;r=i&&2*i.half>=qo?{outline:i,problem:null}:{outline:null,problem:i?"thin":"empty"};}else r={outline:null,problem:"empty"};return tr.size>16&&tr.delete(tr.keys().next().value),tr.set(e,r),r}var I1=1,pc=.5,gc=.5,k1=.5;function Be(t){return Math.max(t,zo)}function zr(t){return t==="heart"?hc():typeof t=="object"&&t?.type==="silhouette"?xa(t).outline:null}function $a(t){return t==="circle"||zr(t)!==null}var T1={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."};function N1(t){let{outline:e,problem:n}=xa(t);if(e&&!n)return {ok:true,share:2*e.half};let o=n??"invalid";return {ok:false,reason:o,message:T1[o]}}function At(t,e,n){if(n==="circle"){let i=Be(e),c=(t/2+i)*Math.SQRT2+I1;return Math.ceil(c-t/2)}let o=zr(n);if(!o)return e;let r=Be(e),a=(t+2*(r+k1))/(2*o.half);return Math.ceil((a-t)/2-1e-9)}function bc(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 O1(t,e,n){let o=At(e,n,"circle"),r=Be(n),a=e+2*o,i=a/2,c=i-pc-.5,s=bc(Number.parseInt(Te(t),36)||1),l=o-r,m=o+e+r;return Array.from({length:a},(u,f)=>Array.from({length:a},(d,g)=>{let h=s()<gc;return g>=l&&g<m&&f>=l&&f<m?false:h&&Math.hypot(g+.5-i,f+.5-i)<=c}))}var D1=Array.from({length:8},(t,e)=>{let n=e*Math.PI/4;return [Math.cos(n),Math.sin(n)]});function yc(t,e,n,o){if(o==="circle")return O1(t,e,n);let r=zr(o);if(!r)return null;let a=At(e,n,o),i=Be(n),c=e+2*a,s=mc(r.polygons),l=.5+pc,m=(g,h)=>{let p=g+.5,b=h+.5;return s(p/c,b/c)?D1.every(([y,_])=>s((p+y*l)/c,(b+_*l)/c)):false},u=bc(Number.parseInt(Te(t),36)||1),f=a-i,d=a+e+i;return Array.from({length:c},(g,h)=>Array.from({length:c},(p,b)=>{let y=u()<gc;return b>=f&&b<d&&h>=f&&h<d?false:y&&m(b,h)}))}function Sa(t,e){if(t==="circle")return {circle:e/2};let n=zr(t);return n?{path:fc(n,e)}:null}function B1(t,e){let n=Sa(t,e);return n?"circle"in n?Z(e/2,e/2,n.circle):n.path:null}function Bt(t,e="#000000"){return t?typeof t=="string"?{type:"solid",color:t}:t:{type:"solid",color:e}}function wn(t){return !t||typeof t=="string"?false:t.type==="linear"||t.type==="radial"||t.type==="angular"}function wa(t){return typeof t=="object"&&t!==null&&t.type==="image"}function Q1(t,e="#000000"){let n=Bt(t,e);return n.type==="solid"?n.color:n.type==="image"?n.underlay||e:n.stops[0]?.color||e}function _c(t="center"){let[e,n]=t.split("-");return t==="center"?"center":n?`${n} ${e}`:e==="top"||e==="bottom"?`center ${e}`:`${e} center`}function G1(t){if(!t)return "#000000";if(typeof t=="string")return t;let e=Bt(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")}")`} ${_c(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 Pt=t=>t/255,er=(t,e)=>(t[0]-e[0])**2+(t[1]-e[1])**2+(t[2]-e[2])**2,X=t=>.2126*t[0]+.7152*t[1]+.0722*t[2];function Ma(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:[Pt(o[c]),Pt(o[c+1]),Pt(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})=>er(i,a)<.006)?a:null}function U1(t){let{width:e,height:n,data:o}=t,r=Ma(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(er([Pt(o[c]),Pt(o[c+1]),Pt(o[c+2])],r));s*=Math.min(1,Math.max(0,(l-.06)/.1));}a[i]=s;}return a}var z1=8,q1=.14,xc=.006;function W1(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 g=d*4,h=Math.floor(r[g]/16)*256+Math.floor(r[g+1]/16)*16+Math.floor(r[g+2]/16);a[h]+=1,i[h*3]+=Pt(r[g]),i[h*3+1]+=Pt(r[g+1]),i[h*3+2]+=Pt(r[g+2]),c++;}if(c===0)return {palette:[],error:0};let s=[...a.keys()].filter(d=>a[d]>0).sort((d,g)=>a[g]-a[d]),l=[];for(let d of s){if(a[d]/c<xc/2||l.length>=z1)break;let g=[i[d*3]/a[d],i[d*3+1]/a[d],i[d*3+2]/a[d]];l.every(h=>er(h,g)>=q1**2)&&l.push(g);}let m=[],u=0;for(let d=0;d<3;d++){m=l.map(()=>({n:0,r:0,g:0,b:0,x:0,y:0})),u=0;for(let g=0;g<e.length;g++){if(e[g]<.9)continue;let h=g*4,p=[Pt(r[h]),Pt(r[h+1]),Pt(r[h+2])],b=0,y=Number.POSITIVE_INFINITY;for(let[w,M]of l.entries()){let S=er(p,M);S<y&&(y=S,b=w);}let _=m[b];_.n++,_.r+=p[0],_.g+=p[1],_.b+=p[2],_.x+=g%n,_.y+=Math.floor(g/n),u+=Math.sqrt(y);}for(let[g,h]of m.entries())h.n>0&&(l[g]=[h.r/h.n,h.g/h.n,h.b/h.n]);}return {palette:l.map((d,g)=>({color:d,area:m[g].n/c,cx:m[g].n?m[g].x/m[g].n+.5:n/2,cy:m[g].n?m[g].y/m[g].n+.5:o/2})).filter(d=>d.area>=xc).sort((d,g)=>g.area-d.area),error:u/c}}function H1(t,e,n){let o=e+2,r=n+2,a=(u,f)=>u<=0||f<=0||u>e||f>n?0:t[(f-1)*e+(u-1)],i=new Map,c=new Map,s=u=>{let f=c.get(u);if(f)return f;let d=Math.floor(u/2),g=d%o,h=Math.floor(d/o),p=a(g,h),b=u%2===1,y=b?a(g,h+1):a(g+1,h),_=p===y?.5:Math.min(1,Math.max(0,(.5-p)/(y-p))),w=b?[g-.5,h-.5+_]:[g-.5+_,h-.5];return c.set(u,w),w},l=(u,f)=>{i.set(u,f);};for(let u=0;u<r-1;u++)for(let f=0;f<o-1;f++){let d=a(f,u)>=.5,g=a(f+1,u)>=.5,h=a(f+1,u+1)>=.5,p=a(f,u+1)>=.5,b=2*(u*o+f),y=2*((u+1)*o+f),_=2*(u*o+f)+1,w=2*(u*o+f+1)+1;switch((d?8:0)+(g?4:0)+(h?2:0)+(p?1:0)){case 1:l(y,_);break;case 2:l(w,y);break;case 3:l(w,_);break;case 4:l(b,w);break;case 5:{(a(f,u)+a(f+1,u)+a(f+1,u+1)+a(f,u+1))/4>=.5?(l(b,_),l(y,w)):(l(b,w),l(y,_));break}case 6:l(b,y);break;case 7:l(b,_);break;case 8:l(_,b);break;case 9:l(y,b);break;case 10:{(a(f,u)+a(f+1,u)+a(f+1,u+1)+a(f,u+1))/4>=.5?(l(_,y),l(w,b)):(l(_,b),l(w,y));break}case 11:l(w,b);break;case 12:l(_,w);break;case 13:l(y,w);break;case 14:l(_,y);break;}}let m=[];for(let u of i.keys()){if(!i.has(u))continue;let f=[],d=u;for(;d!==void 0&&i.has(d);){f.push(s(d));let g=i.get(d);i.delete(d),d=g;}f.length>=3&&m.push(f);}return m}function V1(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 $c(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],m=Math.hypot(s,l)||1,u=-1,f=e;for(let d=r+1;d<a;d++){let g=t[d],h=Math.abs(l*(g[0]-i[0])-s*(g[1]-i[1]))/m;h>f&&(f=h,u=d);}u>=0&&(n[u]=1,o.push([r,u],[u,a]));}return t.filter((r,a)=>n[a]===1)}function j1(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=$c(t.slice(0,n+1),e),a=$c([...t.slice(n),t[0]],e);return [...r.slice(0,-1),...a.slice(0,-1)]}var ge=t=>j(t,2);function Z1(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${ge(c[0])} ${ge(c[1])}`:`L${ge(c[0])} ${ge(c[1])}`,r+=`Q${ge(i[0])} ${ge(i[1])} ${ge(s[0])} ${ge(s[1])}`;}return `${r}Z`}function X1(t,e,n){let o="";for(let r of H1(t,e,n)){if(Math.abs(V1(r))<.8)continue;let a=j1(r,.18);a.length>=3&&(o+=Z1(a,.9));}return o}var Y1=.075;function Sc(t){let{width:e,height:n,data:o}=t,r=U1(t),a=0;for(let h of r)a+=h;let{palette:i,error:c}=W1(t,r),s={width:e,height:n,palette:i,alpha:r,coverage:a/(e*n)};if(i.length===0||c>Y1)return {...s,layers:[],photographic:i.length>0};let l=i.length,m=Array.from({length:l},()=>new Float32Array(e*n)),u=i.map(h=>h.color);for(let h=0;h<r.length;h++){let p=r[h];if(p<=0)continue;let b=h*4,y=[Pt(o[b]),Pt(o[b+1]),Pt(o[b+2])],_=0,w=-1,M=Number.POSITIVE_INFINITY,S=Number.POSITIVE_INFINITY;for(let P=0;P<l;P++){let L=er(y,u[P]);L<M?(w=_,S=M,_=P,M=L):L<S&&(w=P,S=L);}if(w<0||M<1e-6){m[_][h]=p;continue}let $=u[_],C=u[w],R=[C[0]-$[0],C[1]-$[1],C[2]-$[2]],E=Math.min(1,Math.max(0,((y[0]-$[0])*R[0]+(y[1]-$[1])*R[1]+(y[2]-$[2])*R[2])/(R[0]**2+R[1]**2+R[2]**2)));m[_][h]=p*(1-E),m[w][h]=p*E;}let f=[],d=new Float32Array(e*n),g=new Array(l);for(let h=l-1;h>=0;h--){let p=m[h];for(let b=0;b<d.length;b++)d[b]+=p[b];g[h]=d.slice();}for(let h=0;h<l;h++){let p=X1(g[h],e,n);p&&f.push({color:u[h],d:p});}return {...s,layers:f,photographic:false}}var Ac=.6,Ea={logo:160,halftone:160};function K1(t){let e="";for(let o=0;o<t.length;o+=32768)e+=String.fromCharCode(...t.subarray(o,o+32768));return btoa(e)}var Mn=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}},J1=new Mn(8);function td(t){return J1.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 Aa(t){let{width:e,height:n,data:o}=t;if(!(Number.isInteger(e)&&Number.isInteger(n))||e<1||n<1||e>Nn||n>Nn||typeof o!="string")return null;try{let r=td(o);return r.length===e*n*4?{width:e,height:n,data:r}:null}catch{return null}}function Pc(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,m=Math.min(Math.max(Math.round(e.maxSize??Ea.halftone),1),Nn),u=Math.min(1,m/Math.max(s,l)),f=Math.max(1,Math.round(s*u)),d=Math.max(1,Math.round(l*u)),g=new Uint8Array(f*d*4);for(let h=0;h<d;h++){let p=Math.floor(h*l/d),b=Math.max(p+1,Math.floor((h+1)*l/d));for(let y=0;y<f;y++){let _=Math.floor(y*s/f),w=Math.max(_+1,Math.floor((y+1)*s/f)),M=0,S=0,$=0,C=0,R=0;for(let P=p;P<b;P++)for(let L=_;L<w;L++){let F=((P+c)*n+L+i)*4,k=r[F+3]/255;M+=r[F]*k,S+=r[F+1]*k,$+=r[F+2]*k,C+=k,R++;}let E=(h*f+y)*4;g[E]=C>0?Math.round(M/C):0,g[E+1]=C>0?Math.round(S/C):0,g[E+2]=C>0?Math.round($/C):0,g[E+3]=Math.round(C/R*255);}}return {width:f,height:d,data:K1(g)}}async function ed(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 nd(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??Ea[n],r=await ed(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)),m=Math.max(1,Math.round(i*s)),u=document.createElement("canvas");u.width=l,u.height=m;let f=u.getContext("2d",{willReadFrequently:true});if(!f)throw new Error("Could not get a canvas context");f.imageSmoothingQuality="high",f.drawImage(r,0,0,l,m);let d;try{d=f.getImageData(0,0,l,m);}catch{throw new Error("Could not read the art image (cross-origin images need CORS); upload it instead")}finally{u.remove();}return Pc(d,{maxSize:o,square:c})}function Pa(t){return !!(t&&xr.includes(t.mode)&&t.image&&Aa(t.image))}function Hr(t){let e=Oo[t.mode];return t.variant&&e.includes(t.variant)?t.variant:e[0]}function rd(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 nr(t,e){let n=rd(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}var od=0,Qt=1,Gt=2,be=3,wc=4,Mc=new Map;function vc(t){let e=Mc.get(t);if(e)return e;let n=t*4+17,o=new Uint8Array(n*n),r=(a,i,c,s,l)=>{for(let m=Math.max(0,i);m<Math.min(n,i+s);m++)for(let u=Math.max(0,a);u<Math.min(n,a+c);u++)o[m*n+u]=l;};r(6,0,1,n,wc),r(0,6,n,1,wc),r(0,8,9,1,be),r(8,0,1,9,be),r(n-8,8,8,1,be),r(8,n-8,1,8,be),t>=7&&(r(n-11,0,3,6,be),r(0,n-11,6,3,be));for(let[a,i]of nr(t,n))r(a-2,i-2,5,5,Gt);return r(0,0,8,8,Qt),r(n-8,0,8,8,Qt),r(0,n-8,8,8,Qt),Mc.set(t,o),o}function ad(t){let e=t*4+17,n=vc(t);return Array.from({length:e},(o,r)=>Array.from({length:e},(a,i)=>n[r*e+i]!==od))}function id(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 Cn(t,e){let n=lt(t);return !n||n.a===0?e:[n.r/255,n.g/255,n.b/255]}var Ge=(t,e,n)=>[t[0]+(e[0]-t[0])*n,t[1]+(e[1]-t[1])*n,t[2]+(e[2]-t[2])*n];function ye(t,e,n,o){let r=X(t);if(o?r<=n:r>=n)return t;let a=X(e);return Math.abs(r-a)<1e-6?e:Ge(t,e,Math.min(1,Math.max(0,(r-n)/(r-a))))}var Lc=t=>Math.max(...t)-Math.min(...t),sd=(t,e)=>(t[0]-e[0])**2+(t[1]-e[1])**2+(t[2]-e[2])**2,Ca=t=>t.toString(16).padStart(2,"0");function vt(t,e=1){let n=o=>Math.min(255,Math.round(Math.round(Math.min(Math.max(o,0),1)*255)/e)*e);return `#${Ca(n(t[0]))}${Ca(n(t[1]))}${Ca(n(t[2]))}`}function cd(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}var va=.3,Cc=t=>1-Math.exp(-((t/2)**2)/(2*va**2)),ld=t=>cd(t/(2*va*Math.SQRT2))**2,ud=(t,e,n)=>{let o=Math.min(1,Math.max(0,(n-t)/(e-t)));return o*o*(3-2*o)};function La(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 Fc(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 md(t){let e=Fc(t),{rgb:n,alpha:o}=e,r=new Float64Array(256),a=0;for(let u=0;u<o.length;u++){if(o[u]<.5)continue;let f=X([n[u*3],n[u*3+1],n[u*3+2]]);r[Math.min(255,Math.floor(f*256))]+=1,a++;}let i=u=>{let f=0;for(let d=0;d<256;d++)if(f+=r[d],f>=u*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)),m=(c+s)/2;for(let u=0;u<o.length;u++){let f=[n[u*3],n[u*3+1],n[u*3+2]],d=X(f),g=.5+(d-m)*l;for(let h=0;h<3;h++)n[u*3+h]=Math.min(1,Math.max(0,g+(f[h]-d)*1.12));}return e}function Ic(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),m=Math.min(Math.max(n-.5,0),i-1),u=Math.floor(l),f=Math.floor(m),d=Math.min(u+1,a-1),g=Math.min(f+1,i-1),h=l-u,p=m-f,b=0,y=0,_=0,w=0,M=($,C,R)=>{let E=C*a+$,P=s[E]*R;b+=c[E*3]*P,y+=c[E*3+1]*P,_+=c[E*3+2]*P,w+=P;};if(M(u,f,(1-h)*(1-p)),M(d,f,h*(1-p)),M(u,g,(1-h)*p),M(d,g,h*p),w<=0)return o;let S=w*r;return [o[0]+(b/w-o[0])*S,o[1]+(y/w-o[1])*S,o[2]+(_/w-o[2])*S]}var dd=new Mn(4),fd=new Mn(6),hd=new Mn(6);function Fa(t,e){return fd.get(t.image.data,()=>Sc(e))}function kc(t,e,n){return hd.get(t.image.data,()=>Fc(e,n.alpha))}var $t=t=>j(t,2),Tc=t=>j(t,4),Ue=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,pd(n,o,r));}toElements(e){return [...this.groups].map(([n,o],r)=>v("path",{d:o.join(""),fill:n},`${e}-${r}`))}};function pd(t,e,n){let o=$t(n*2),r=$t(n);return `M${$t(t-n)} ${$t(e)}a${r} ${r} 0 1 0 ${o} 0a${r} ${r} 0 1 0 ${-o} 0z`}function Qe(t,e,n,o,r){let a=Math.min(r,n/2,o/2);if(a<=0)return `M${$t(t)} ${$t(e)}h${$t(n)}v${$t(o)}h${$t(-n)}z`;let i=$t(a);return `M${$t(t+a)} ${$t(e)}h${$t(n-2*a)}a${i} ${i} 0 0 1 ${i} ${i}v${$t(o-2*a)}a${i} ${i} 0 0 1 ${-i} ${i}h${$t(-(n-2*a))}a${i} ${i} 0 0 1 ${-i} ${-i}v${$t(-(o-2*a))}a${i} ${i} 0 0 1 ${i} ${-i}z`}function Nc(t,e,n){let o="";for(let[r,a]of t){let i=(r-2+e)*n,c=(a-2+e)*n;o+=Qe(i,c,5*n,5*n,n*.35),o+=Qe(i+n,c+n,3*n,3*n,n*.15),o+=Qe(i+2*n,c+2*n,n,n,n*.12);}return o}var gd={blend:1,badge:1,color:.9,mono:.7},Wr=.35;function bd(t,e){let n=Cn(t,[0,0,0]),o=Cn(e,[1,1,1]),r=X(o)-X(n);return r>=Wr?null:r<=-Wr?"inverted":"low-contrast"}function Oc(t,e,n){let o=Math.min(Math.max(t.intensity??Ac,0),gd[Hr(t)]);return X(n)-X(e)>=Wr?o:0}function yd(t){let{art:e,modules:n,version:o}=t,r=e.image&&Aa(e.image);if(!(r&&xr.includes(e.mode)))return null;let a=n.length;if(a!==o*4+17)return null;let i=Cn(t.fgColor,[0,0,0]),c=Cn(t.bgColor,[1,1,1]),s=Oc(e,i,c);return s<=0?null:{art:e,image:r,modules:n,size:a,version:o,kinds:vc(o),margin:t.margin,pixelSize:t.pixelSize,t:s,fg:i,bg:c,variant:Hr(e),body:t.body}}function Ia(t){let e=yd(t);if(!e)return null;let n;return e.art.mode==="halftone"?n=e.variant==="mono"?Md(e):wd(e):n=e.variant==="badge"?Id(e):Cd(e),v("g",{"data-qrdx-art":e.art.mode,"data-qrdx-art-variant":e.variant,children:n})}function _d(t,e){return {margin:.42-.17*t+(e===3?.04:0),darkCap:.4+.3*t}}var Dc=8.5,Rc=new Map;function ka(t){let e=t*4+17,n=Rc.get(t);if(!n){let a=e*2,i=new Uint8Array(a*a),c=Dc*2;for(let s=0;s<a;s++)for(let l=0;l<a;l++){let m=l<c||l>=a-c,u=s<c||s>=a-c;m&&u&&!(l>=a-c&&s>=a-c)&&(i[s*a+l]=1);}for(let[s,l]of nr(t,e))for(let m=(l-2)*2-1;m<(l+3)*2+1;m++)for(let u=(s-2)*2-1;u<(s+3)*2+1;u++)u>=0&&m>=0&&u<a&&m<a&&(i[m*a+u]=1);Rc.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 Bc(t,e,n=false){let{image:o,size:r,kinds:a,fg:i,bg:c}=t,s=dd.get(t.art.image.data,()=>md(o)),l=La(o.width,o.height,r,"cover"),m=r*e,u=new Float32Array(m*m*3).fill(Number.NaN),d=1/(e*l.scale)>1.3?2:1,g=X(c)-.1*(X(c)-X(i)),h=ka(t.version);for(let p=0;p<r;p++)for(let b=0;b<r;b++){let y=a[p*r+b],_=y===Qt||y===Gt;if(!(_&&!n))for(let w=0;w<e;w++)for(let M=0;M<e;M++){let S=0,$=0,C=0;for(let N=0;N<d;N++)for(let I=0;I<d;I++){let B=b+(M+(I+.5)/d)/e,q=p+(w+(N+.5)/d)/e,O=Ic(s,(B-l.offsetX)/l.scale,(q-l.offsetY)/l.scale,c);S+=O[0],$+=O[1],C+=O[2];}let R=d*d,E=[S/R,$/R,C/R],P=b+(M+.5)/e,L=p+(w+.5)/e,F=Math.min(P,L,r-P,r-L);F<1.5&&(E=Ge(E,c,.35*(1-F/1.5))),n&&(_||h(P,L))&&(E=ye(E,c,g,false));let k=((p*e+w)*m+b*e+M)*3;u[k]=E[0],u[k+1]=E[1],u[k+2]=E[2];}}return {n:e,count:m,rgb:u}}function xd(t,e,n){let{size:o,kinds:r,modules:a,fg:i,bg:c,t:s}=t,{n:l,count:m,rgb:u}=e,f=X(i),d=X(c),g=d-f,h=_d(s,l),p=C=>.2126*u[C]+.7152*u[C+1]+.0722*u[C+2],b=new Float32Array(o*o),y=new Float32Array(o*o);for(let C=0;C<o;C++)for(let R=0;R<o;R++){let E=r[C*o+R];if(E===Qt){b[C*o+R]=d;continue}if(E===Gt){b[C*o+R]=a[C]?.[R]?f:d;continue}let P=0,L=0,F=0;for(let k=0;k<l;k++)for(let N=0;N<l;N++){let I=p(((C*l+k)*m+R*l+N)*3);P+=I,n.under[k*l+N]||(L+=I,F++);}b[C*o+R]=P/(l*l),y[C*o+R]=F?L/F:P/(l*l);}let _=o+1,w=new Float64Array(_*_);for(let C=0;C<o;C++)for(let R=0;R<o;R++)w[(C+1)*_+R+1]=b[C*o+R]+w[C*_+R+1]+w[(C+1)*_+R]-w[C*_+R];let M=2,S=(C,R)=>{let E=Math.max(0,C-M),P=Math.max(0,R-M),L=Math.min(o,C+M+1),F=Math.min(o,R+M+1);return (w[F*_+L]-w[P*_+L]-w[F*_+E]+w[P*_+E])/((L-E)*(F-P))},$=n.weight;for(let C=0;C<o;C++)for(let R=0;R<o;R++){let E=r[C*o+R];if(E===Qt||E===Gt)continue;let P=E===be,L=(h.margin+(P?.08:0))*g,F=(h.darkCap-(P?.12:0))*g,k=($*((n.light-n.dark)/2)-L)/(1-$),N=S(R,C),I=y[C*o+R],B=!!a[C]?.[R],q=0,O=c;if(B){let G=Math.min(N+k,f+F);I>G&&(q=(I-G)/Math.max(I-f,1e-6),O=i);}else {let G=Math.max(N-k,d-F);I<G&&(q=(G-I)/Math.max(d-I,1e-6));}if(!(q<=0)){q=Math.min(1,q);for(let G=0;G<l;G++)for(let J=0;J<l;J++){let pt=((C*l+G)*m+R*l+J)*3;for(let at=0;at<3;at++)u[pt+at]+=(O[at]-u[pt+at])*q;}}}}function Qc(t,e,n,o){let{count:r}=e,a=new Ue;for(let s=0;s<r;s++){let l=0,m=n(s*r);for(let u=1;u<=r;u++){let f=u<r?n(s*r+u):null;(u===r||f!==m)&&(m&&a.cellRun(m,l,s,u-l),l=u,m=f);}}let i=t.pixelSize/e.n,c=$t(t.margin*t.pixelSize);return v("g",{transform:`translate(${c} ${c}) scale(${Tc(i)})`,children:a.toElements(o)},o)}function Ta(t,e){let n=nr(t.version,t.size);return n.length===0?[]:[v("path",{d:Nc(n,t.margin,t.pixelSize),fill:e,fillRule:"evenodd"},"art-alignment")]}function Gc(t){let{image:e,size:n}=t;return Math.floor(Math.min(e.width,e.height)/n)>=4&&n<=45?4:3}var $d=t=>2*va*Math.sqrt(-2*Math.log(1-Math.min(t,.95)));function Sd(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),m=Math.min(e,c+n+1),u=Math.min(e,i+n+1);a[i*e+c]=(r[u*o+m]-r[l*o+m]-r[u*o+s]+r[l*o+s])/((m-s)*(u-l));}return a}function Uc(t,e,n,o){let{size:r,kinds:a,modules:i,fg:c,bg:s}=t,l=X(c),m=X(s),u=m-l,f=Sd(e,r,2),d=new Float32Array(r*r),g=new Float32Array(r*r).fill(Number.NaN);for(let h=0;h<r;h++)for(let p=0;p<r;p++){let b=h*r+p,y=a[b];if(y===Qt||y===Gt)continue;let _=y===be,w=o.base+(_?.08:0),M=(o.margin+(_?.03:0))*u,S=(o.cap-(_?.04:0))*u,$=Cc(w),C=Cc(_?Math.max(o.max,.94):o.max),R=$*((o.dark+o.light)/2)+(1-$)*f[b],E=n[b],P=!!i[h]?.[p],L=P?o.dark:o.light,F=P?Math.min(R-M,l+S):Math.max(R+M,m-S),N=(P?E<=F:E>=F)?0:(E-F)/(E-L);N>C&&(N=C,g[b]=Math.min(m,Math.max(l,(F-C*L)/(1-C))));let I=P?E<=F-.06:E>=F+.06;o.skip&&I&&!_||(N=Math.max(N,$)),d[b]=N>0?$d(N):0;}return {diameter:d,surround:g}}function wd(t){let{size:e,kinds:n,modules:o,fg:r,bg:a,t:i,margin:c,pixelSize:s}=t,l=Gc(t),m=Bc(t,l,true),u=X(r),f=X(a),d=u+.1*(f-u),g=f-.05*(f-u),{count:h,rgb:p}=m,b=(S,$,C,R)=>(($*l+R)*h+S*l+C)*3,y=new Float32Array(e*e);for(let S=0;S<e;S++)for(let $=0;$<e;$++){let C=n[S*e+$];if(C===Qt||C===Gt){y[S*e+$]=C===Gt&&o[S]?.[$]?u:f;continue}let R=0;for(let E=0;E<l;E++)for(let P=0;P<l;P++){let L=b($,S,P,E);R+=.2126*p[L]+.7152*p[L+1]+.0722*p[L+2];}y[S*e+$]=R/(l*l);}let _=Uc(t,y,y,{base:.6-.28*i,max:.86,dark:d,light:g,margin:.2-.1*i,cap:.4+.14*i,skip:false});for(let S=0;S<e;S++)for(let $=0;$<e;$++){let C=_.surround[S*e+$];if(Number.isNaN(C))continue;let R=y[S*e+$],P=C<R?r:a,L=Math.min(1,Math.abs(R-C)/Math.max(Math.abs(R-X(P)),1e-6));for(let F=0;F<l;F++)for(let k=0;k<l;k++){let N=b($,S,k,F);for(let I=0;I<3;I++)p[N+I]+=(P[I]-p[N+I])*L;}}let w=[Qc(t,m,S=>{let $=S*3;return Number.isNaN(p[$])?null:vt([p[$],p[$+1],p[$+2]],8)},"art-photo")],M=new Ue;for(let S=0;S<e;S++)for(let $=0;$<e;$++){let C=_.diameter[S*e+$];if(!(C>0))continue;let R=0,E=0,P=0;for(let k=0;k<l;k++)for(let N=0;N<l;N++){let I=b($,S,N,k);R+=p[I],E+=p[I+1],P+=p[I+2];}let L=[R/(l*l),E/(l*l),P/(l*l)],F=o[S]?.[$]?ye(L,r,d,true):ye(L,a,g,false);M.circle(vt(F,10),($+c+.5)*s,(S+c+.5)*s,C/2*s);}return w.push(...M.toElements("art-dot"),...Ta(t,vt(r))),w}function Md(t){let{size:e,kinds:n,modules:o,fg:r,bg:a}=t,i=Gc(t),c=Bc(t,i),s=X(r),l=X(a),m=i%2===1?1:2,u=(i-m)/2,f=R=>R>=u&&R<u+m,d=[];for(let R=0;R<i;R++)for(let E=0;E<i;E++)d.push(f(E)&&f(R));xd(t,c,{weight:ld(m/i),dark:s,light:l,under:d});let{count:g,rgb:h}=c,p=new Float32Array(g*g),b=new Int8Array(g*g).fill(-1);for(let R=0;R<g*g;R++){let E=R*3;if(Number.isNaN(h[E])){p[R]=Number.NaN;continue}let P=(.2126*h[E]+.7152*h[E+1]+.0722*h[E+2]-s)/(l-s);p[R]=.5+(ud(0,1,P)-.5)*1.15;}for(let R=0;R<e;R++)for(let E=0;E<e;E++){let P=n[R*e+E];if(!(P===Qt||P===Gt))for(let L=u;L<u+m;L++)for(let F=u;F<u+m;F++)b[(R*i+L)*g+E*i+F]=o[R]?.[E]?0:1;}let y=ka(t.version);for(let R=0;R<g;R++)for(let E=0;E<g;E++){let P=R*g+E;b[P]<0&&y((E+.5)/i,(R+.5)/i)&&(b[P]=1);}let _=new Uint8Array(g*g),w=.3,M=0,S=0,$=(R,E,P)=>{if(R<0||R>=g||E>=g)return;let L=E*g+R;if(!Number.isNaN(p[L])){let F=Math.floor(R/i)===Math.floor(M/i)&&Math.floor(E/i)===Math.floor(S/i);p[L]+=F?P:P*w;}};for(let R=0;R<g;R++){let E=R%2===0?1:-1;for(let P=0;P<g;P++){let L=E===1?P:g-1-P,F=R*g+L,k=p[F];if(Number.isNaN(k))continue;let N=b[F]>=0?b[F]:k>=.5?1:0;_[F]=N===0?1:0;let I=Math.min(.75,Math.max(-0.75,k-N));M=L,S=R,$(L+E,R,I*7/16),$(L-E,R+1,I*3/16),$(L,R+1,I*5/16),$(L+E,R+1,I/16);}}let C=vt(r);return [Qc(t,c,R=>_[R]?C:null,"art-halftone"),...Ta(t,C)]}function Ec(t,e){let n=null,o=0;for(let r of t.palette){if(e&&sd(r.color,e)<.02)continue;let a=r.area*(.35+Lc(r.color))*(X(r.color)>.86?.05:1);a>o&&(o=a,n=r.color);}return n}function zc(t,e,n,o,r){let a;if(t.photographic){let i=new Ue,{width:c,height:s,rgb:l,alpha:m}=e;for(let u=0;u<s;u++){let f=0,d=null;for(let g=0;g<=c;g++){let h=u*c+g,p=g<c&&m[h]>=.5?vt(o([l[h*3],l[h*3+1],l[h*3+2]]),6):null;(g===c||p!==d)&&(d&&i.cellRun(d,f,u,g-f),f=g,d=p);}}a=i.toElements(`${r}-px`);}else a=t.layers.map((i,c)=>v("path",{d:i.d,fill:vt(o(i.color)),fillRule:"evenodd"},`${r}-${c}`));return v("g",{transform:`translate(${$t(n.x)} ${$t(n.y)}) scale(${Tc(n.scale)})`,children:a},r)}function Cd(t){let{art:e,image:n,size:o,kinds:r,modules:a,fg:i,bg:c,t:s,margin:l,pixelSize:m}=t,u=Fa(e,n),f=kc(e,n,u),d=La(u.width,u.height,o,"contain"),g=Math.min(1,.3+1.4*s),h=I=>Ge(c,I,g),p=vt(c),b=vt(i),y=[zc(u,f,{x:(l+d.offsetX)*m,y:(l+d.offsetY)*m,scale:d.scale*m},h,"art-logo")],_=Dc,w=(I,B)=>Qe((I+l)*m,(B+l)*m,(_+.4)*m,(_+.4)*m,1.2*m),M=nr(t.version,o).map(([I,B])=>Qe((I-2.5+l)*m,(B-2.5+l)*m,6*m,6*m,m*.8)).join("");y.push(v("path",{d:w(-0.4,-0.4)+w(o-_,-0.4)+w(-0.4,o-_)+M,fill:p},"art-plates"));let S=ka(t.version),$=X(c),C=X(i),R=new Float32Array(o*o),E=new Float32Array(o*o),P=new Array(o*o);for(let I=0;I<o;I++)for(let B=0;B<o;B++){let q=I*o+B,O=r[q];if(O===Qt||O===Gt){R[q]=O===Gt&&a[I]?.[B]?C:$;continue}let G=1,J=0,pt=0,at=0,T=0;for(let U=0;U<4;U++)for(let z=0;z<4;z++){let wt=B+(z+.5)/4,Re=I+(U+.5)/4,It=S(wt,Re)?c:Ic(f,(wt-d.offsetX)/d.scale,(Re-d.offsetY)/d.scale,c,g),Jt=X(It);G=Math.min(G,Jt),J+=Jt,pt+=It[0],at+=It[1],T+=It[2];}R[q]=J/16,E[q]=G,P[q]=[pt/16,at/16,T/16];}let L=C+.08*($-C),F=$-.04*($-C),k=Uc(t,R,R,{base:.74-.26*s,max:.9,dark:L,light:F,margin:.23-.1*s,cap:.4+.1*s,skip:s>=.7}),N=new Ue;for(let I=0;I<o;I++)for(let B=0;B<o;B++){let q=I*o+B,O=k.diameter[q],G=!!a[I]?.[B];if(!(O>0)||!G&&E[q]>=$-.02)continue;let J=G?ye(P[q],i,L,true):ye(P[q],c,F,false);N.circle(vt(J,8),(B+l+.5)*m,(I+l+.5)*m,O/2*m);}return y.push(...N.toElements("art-dot")),y.push(...Ta(t,b)),y}var Rd={L:.5,M:.72,Q:.88,H:1},qc=.32,Wc=.55,Ed=.6,Ad=2;function Hc(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}}var Vc=t=>({cx:t.cx,cy:t.cy,w:t.plateW,h:t.plateH,r:t.radius});function jc(t,e,n){return Xc(e+.5,n+.5,t)<Wc}function Pd(t,e){let n=Vc(t),o=Wc+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 m=r;m<=a;m++)jc(n,m,l)&&s.push(l*e+m);return s}var vd=t=>Math.floor(t.correctable*Ed);function Ra(t,e,n){let o=Hc(t,e,n.size),r=vd(n);return Jn(n,Pd(o,n.size)).every(a=>a<=r)}function Zc(t,e,n){if(Ra(n,e,t))return n;let o=0,r=n;if(!Ra(o,e,t))return -1;for(;r-o>1/64;){let a=(o+r)/2;Ra(a,e,t)?o=a:r=a;}return o}var qr=new Map;function Ld(t,e){let n=`${t.version}${t.level}:${e.toFixed(3)}`,o=qr.get(n);return o===void 0&&(o=Zc(t,e,qc*t.size),qr.size>=64&&qr.clear(),qr.set(n,o)),o}function Fd(t,e){let{size:n,t:o,modules:r,version:a}=t,i=id(r),c=(.18+.15*o)*Rd[i],s=e.width/e.height,l=Math.min(qc,c)*n,m=Kn(a,i),u=Math.max(0,Ld(m,s));if(u<Ad)return {wantedBox:l,maxBox:u,box:0,plate:null};let f=Zc(m,s,Math.min(l,u));return f<0?{wantedBox:l,maxBox:u,box:0,plate:null}:{wantedBox:l,maxBox:u,box:f,plate:Hc(f,s,n)}}function Xc(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 Yc(t,e){let{fg:n,bg:o,t:r}=t,a=X(n),i=X(o),c=Ec(e),s=Math.min(1,r/.6),l=c?ye(c,n,a+.3*(i-a),true):n,m=Ge(n,l,s),u=c?Ec(e,c):null,f=a+.42*(i-a),d=u&&X(u)<=f+.22?Ge(n,ye(u,n,f,true),s):m;return {body:m,inner:d}}function Id(t){let{art:e,image:n,size:o,kinds:r,modules:a,bg:i,margin:c,pixelSize:s,version:l}=t,m=Fa(e,n),u=Fd(t,m).plate,{body:f}=Yc(t,m),d=vt(f),g=u&&Vc(u),h=a.map(P=>[...P]);for(let P=0;P<o;P++)for(let L=0;L<o;L++){let F=r[P*o+L];(F===Gt||g&&F!==Qt&&jc(g,L,P))&&(h[P][L]=false);}let p=[],b=t.body?.(h);if(b)p.push(v("g",{fill:d,children:b},"art-body"));else {let P=new Ue;for(let L=0;L<o;L++)for(let F=0;F<o;F++)h[L]?.[F]&&r[L*o+F]!==Qt&&P.circle(d,(F+c+.5)*s,(L+c+.5)*s,.45*s);p.push(...P.toElements("art-body"));}let y=nr(l,o).filter(([P,L])=>!g||Xc(P+.5,L+.5,g)>3.2);if(y.length>0&&p.push(v("path",{d:Nc(y,c,s),fill:d,fillRule:"evenodd"},"art-alignment")),!u)return p;let _=kc(e,n,m),w=(u.cx-u.plateW/2+c)*s,M=(u.cy-u.plateH/2+c)*s,S=u.plateW*s,$=u.plateH*s,C=u.radius*s,R=.1*s,E=Qe(w,M,S,$,C);return p.push(v("path",{d:E,fill:vt(i)},"art-plate"),v("path",{d:E+Qe(w+R,M+R,S-2*R,$-2*R,C-R),fill:vt(Ge(i,f,.16)),fillRule:"evenodd"},"art-plate-ring"),zc(m,_,{x:(u.cx-u.logoW/2+c)*s,y:(u.cy-u.logoH/2+c)*s,scale:u.logoW/m.width*s},P=>P,"art-logo")),p}function Na(t){let{art:e}=t;if(e.mode!=="logo"||e.matchEyes===false)return null;let n=e.image&&Aa(e.image);if(!n)return null;let o=Cn(t.fgColor,[0,0,0]),r=Cn(t.bgColor,[1,1,1]),a=Oc(e,o,r);if(a<=0)return null;let i=Fa(e,n);if(i.palette.length===0)return null;if(Hr(e)==="badge"){let{body:g,inner:h}=Yc({fg:o,bg:r,t:a},i),p={outer:vt(g),inner:vt(h)};return {topLeft:p,topRight:p,bottomLeft:p}}let c=X(o),s=X(r),l=Math.min(1,a/.6),m=t.version*4+17,u=La(i.width,i.height,m,"contain"),f=.45*Math.max(i.width,i.height),d=(g,h)=>{let p=(g-u.offsetX)/u.scale,b=(h-u.offsetY)/u.scale,y=null,_=0;for(let M of i.palette){if(X(M.color)>.86)continue;let S=(M.cx-p)**2+(M.cy-b)**2,$=M.area*(.35+Lc(M.color))*Math.exp(-S/(2*f**2));$>_&&(_=$,y=M.color);}if(!y)return {};let w=ye(y,o,c+.42*(s-c),true);return {inner:vt(Ge(o,w,l))}};return {topLeft:d(3.5,3.5),topRight:d(m-3.5,3.5),bottomLeft:d(3.5,m-3.5)}}var kd=["horizontal-line","liquid","liquid-horizontal","liquid-vertical","classy","classy-rounded","leaf","plus","hexagon","star","heart","random-dots","mosaic","octagon"];function Kc(t){return kd.includes(t)}var Jc={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};function Vr(t,e){if(t===void 0||!Number.isFinite(t))return 1;let n=e?Jc[e]??1:$r;return Math.min(Go,Math.max($r,n,t))}function Td(t,e,n){return t<7&&e<7||t>=n-7&&e<7||t<7&&e>=n-7}function Nd(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 Oa(t){let e=(t-17)/4,n=Number.isInteger(e)?Nd(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)}var Od={liquid:{horizontal:true,vertical:true,thickness:1,radius:()=>1,fillets:true},"liquid-horizontal":{horizontal:true,vertical:false,thickness:.86,radius:()=>1,fillets:false},"liquid-vertical":{horizontal:false,vertical:true,thickness:.86,radius:()=>1,fillets:false},classy:{horizontal:true,vertical:true,thickness:1,radius:t=>t===0||t===2?1:0,fillets:false},"classy-rounded":{horizontal:true,vertical:true,thickness:1,radius:t=>t===0||t===2?1:.4,fillets:false}};function Dd(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 K([[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 K(_n(e,n,o*.54,6));case "star":return K(xn(e,n+o*.04,o*.62,o*.34));case "heart":return $n(e,n+o*.02,o*1.08);case "random-dots":return Z(e,n,o*(.38+.15*Lr(r,a)));case "mosaic":{let i=o*(.8+.14*Lr(r,a,1))/2,c=[[e-i,n-i],[e+i,n-i],[e+i,n+i],[e-i,n+i]];return K(Ps(c,e,n,(Lr(r,a,2)-.5)*16))}case "octagon":return K(_n(e,n,o*.48/Math.cos(Math.PI/8),8,22.5));default:return Z(e,n,o*.45)}}function tl(t,e){let{margin:n,pixelSize:o,pattern:r}=e,a=Vr(e.scale,r),i=t.length,c=e.plain?()=>false:Oa(i),s=(h,p)=>!e.plain&&Td(h,p,i),l=(h,p)=>h>=0&&p>=0&&h<i&&p<i&&!!t[p]?.[h]&&!s(h,p),m=h=>(h+.5+n)*o,u=[],f=[],d=Od[r];for(let h=0;h<i;h++)for(let p=0;p<i;p++){if(!l(p,h))continue;let b=m(p),y=m(h);if(c(p,h)){u.push(A`M${b-o/2} ${y-o/2}h${o}v${o}h${-o}z`);continue}if(!d){f.push(Dd(r,b,y,o*a,p,h));continue}let _=o*d.thickness*a/2,w=d.horizontal&&l(p+1,h),M=d.horizontal&&l(p-1,h),S=d.vertical&&l(p,h-1),$=d.vertical&&l(p,h+1),R=[!(S||M),!(S||w),!($||w),!($||M)].map((E,P)=>E?_*d.radius(P):0);f.push(D(b-_,y-_,2*_,2*_,R)),2*_<o&&(w&&f.push(D(b,y-_,o,2*_)),$&&f.push(D(b-_,y,2*_,o)));}if(d?.fillets&&a===1){let h=o*.3;for(let p=0;p<i;p++)for(let b=0;b<i;b++){if(l(b,p)||s(b,p))continue;let y=m(b)-o/2,_=m(p)-o/2,w=y+o,M=_+o;l(b-1,p)&&l(b,p-1)&&l(b-1,p-1)&&f.push(A`M${y} ${_}h${h}A${h} ${h} 0 0 0 ${y} ${_+h}Z`),l(b+1,p)&&l(b,p-1)&&l(b+1,p-1)&&f.push(A`M${w} ${_}v${h}A${h} ${h} 0 0 0 ${w-h} ${_}Z`),l(b+1,p)&&l(b,p+1)&&l(b+1,p+1)&&f.push(A`M${w} ${M}h${-h}A${h} ${h} 0 0 0 ${w} ${M-h}Z`),l(b-1,p)&&l(b,p+1)&&l(b-1,p+1)&&f.push(A`M${y} ${M}v${-h}A${h} ${h} 0 0 0 ${y+h} ${M}Z`);}}let g=[];return f.length>0&&g.push(v("path",{d:f.join("")},"modules")),u.length>0&&g.push(v("path",{d:u.join("")},"alignment")),g}function Bd(t){return t==="top-left"?0:t==="top-right"?1:3}function jr(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,m=1.3*c,u=.7*c,f=g=>{switch(o){case "leaf":return g===s||g===l;case "leaf-reverse":return !(g===s||g===l);case "drop":return g===s;default:return g===l}},d=[0,1,2,3].map(g=>f(g)?u:m);return v("path",{d:D(t-n,e-n,a,a,d)})}case "extra-rounded":return v("path",{d:D(t-n,e-n,a,a,1.15*c)});case "plus":{let s=1.15*c,l=n;return v("path",{d:K([[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 v("path",{d:D(t-n,e-s,a,2*s,l)+D(t-s,e-n,2*s,a,l)})}case "hexagon":return v("path",{d:K(_n(t,e,1.72*c,6))});case "octagon":return v("path",{d:K(_n(t,e,n/Math.cos(Math.PI/8),8,22.5))});case "flower":{let s=.6*c,l=.9*c;return v("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 v("path",{d:$n(t,e+.12*c,3.5*c)});case "squircle":return v("path",{d:K(Vn(t,e,n,n,4,64))});case "dots":{let s=[];for(let l of [-1,0,1])for(let m of [-1,0,1])s.push(Z(t+m*c*.82,e+l*c*.82,.58*c));return v("path",{d:s.join("")})}case "square":return v("rect",{height:x(a),transform:A`rotate(0,${t},${e})`,width:x(a),x:x(t-i),y:x(e-i)});case "rounded":return v("rect",{height:x(a),rx:x(n*.5),ry:x(n*.5),transform:A`rotate(0,${t},${e})`,width:x(a),x:x(t-i),y:x(e-i)});case "diamond":return v("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,m=f=>(f-40)*s+e,u=A`M ${l(25)} ${m(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 v("path",{clipRule:"evenodd",d:u,transform:A`rotate(0,${t},${e})`})}case "message-reverse":{let s=a/30,l=f=>(f-40)*s+t,m=f=>(f-40)*s+e,u=A`M ${l(25)} ${m(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 v("path",{clipRule:"evenodd",d:u,transform:A`rotate(-180,${t},${e})`})}case "diya":{let s=a/30,l=f=>(f-40)*s+t,m=f=>(f-40)*s+e,u=A`M ${l(25)} ${m(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 v("path",{clipRule:"evenodd",d:u,transform:A`rotate(0,${t},${e})`})}case "diya-reverse":{let s=a/30,l=f=>(f-40)*s+t,m=f=>(f-40)*s+e,u=A`M ${l(25)} ${m(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 v("path",{clipRule:"evenodd",d:u,transform:A`rotate(0,${t},${e})`})}case "rounded-triangle":{let s=a/21,l=f=>(f-40)*s+t,m=f=>(f-40)*s+e,u=A`M ${l(33.57142857142857)} ${m(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 v("path",{d:u,transform:A`rotate(45,${t},${e})`})}case "star":{let s=a/27,l=f=>(f-40)*s+t,m=f=>(f-40)*s+e,u=A`M ${l(38.84615384615385)},${m(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 v("path",{clipRule:"evenodd",d:u,transform:A`rotate(0,${t},${e})`})}case "banner":{let s=a/28;return v("g",{transform:A`translate(${t-40*s},${e-40*s}) scale(${x(s,6)})`,children:v("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 v("circle",{cx:x(t),cy:x(e),r:x(n),transform:A`rotate(0,${t},${e})`})}}function Rn(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 el(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 nl(t,e,n,o){let r=n/7,a=Math.max(0,(o+Math.SQRT2-2)*r);return K(el(t,e,n,o*r))+K(el(t+r,e+r,5*r,a))}function rl(t,e,n,o,r=false){let a=n/7,i=c=>r?Rn(o,0,c,true):Rn(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 Qd(t,e,n,o){let r=n/7;return D(t,e,n,n,Rn(o,2.6*r,0,false))+D(t+r,e+r,5*r,5*r,Rn(o,1.6*r,0,false))}function Gd(t,e,n){let o=n/7,r=t+n/2,a=e+n/2;return K(Vn(r,a,3.5*o,3.5*o,4,96))+K(Vn(r,a,2.5*o,2.5*o,4,96))}function ol(t,e,n,o,r){let a=o,i=n/2,c=(i-a)*.55,s=(l,m)=>A`${t+l} ${e+m}`;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 Ud(t,e,n){let o=n/7,r=.12*o;return ol(t,e,n,1.4*o,r)+ol(t+o,e+o,5*o,.7*o,r)}function al(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 zd(t,e,n){let o=n/7;return al(t,e,n,.7*o,3.9*o,o)+al(t+o,e+o,5*o,.35*o,2.7*o,.8*o)}function qd(t,e,n,o){let r=n/7;return D(t,e,n,n,Rn(o,.5*r,2.5*r,false))+D(t+r,e+r,5*r,5*r,Rn(o,.25*r,1.5*r,false))}function Wd(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 Hd(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 Vd(t,e,n){let o=t+n/2,r=e+n/2,a=j(n/2),i=j(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 jd(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 Da(t){let e=t/70;return {scale:e,transform:(o,r)=>(o-5)*e+r}}function Zd(t,e,n){let{scale:o,transform:r}=Da(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 Xd(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 Yd(t,e,n){let{scale:o,transform:r}=Da(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 Kd(t,e,n){let{scale:o,transform:r}=Da(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 Jd(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 Zr(t,e,n,o,r="top-left"){switch(o){case "leaf":return rl(t,e,n,r);case "leaf-reverse":return rl(t,e,n,r,true);case "drop":return Qd(t,e,n,r);case "octagon":return nl(t,e,n,1.6);case "bevel":return nl(t,e,n,1.1);case "squircle":return Gd(t,e,n);case "cushion":return Ud(t,e,n);case "shield":return zd(t,e,n);case "petal":return qd(t,e,n,r);case "gear":return jd(t,e,n);case "rounded":return Hd(t,e,n);case "circle":return Vd(t,e,n);case "diya":return Zd(t,e,n);case "extra-rounded":return Xd(t,e,n);case "message":return Yd(t,e,n);case "pointy":return Kd(t,e,n);case "curly":return Jd(t,e,n);default:return Wd(t,e,n)}}var Ba="data-qrdx-part",il="data-qrdx-eye",tf=["eye-outer","eye-centre","body","logo","background"];function Qa(t,e,n){if(t)return n?{[Ba]:e,[il]:n}:{[Ba]:e}}var rr=300;function Kt(t){return {id:t.id,name:t.name,description:t.description,spec:t.spec,wrapper:(e,n)=>{let o=Ne(t.spec),r=n?.fgColor,a=(typeof r=="string"?r:yt(r,""))||"black",i=Yn(o.qr.size,o,{color:a}),{x:c,y:s,scale:l}=t.at;return v("svg",{height:rr,id:"svgQrWrapper",style:{width:"100%",height:"100%"},viewBox:`0 0 ${rr} ${rr}`,width:rr,xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",children:St("g",{"data-qrdx-template":t.id,transform:`translate(${x(c)} ${x(s)})${l===1?"":` scale(${l})`}`,children:[oc(i),v("g",{fill:"none",transform:`translate(${x(i.qrX)} ${x(i.qrY)}) scale(${i.qrSize/rr})`,children:e})]})})}}}var sl={kind:"qrdx.frame",version:1,artboard:{width:185,height:178},qr:{x:35,y:0,size:150,padding:0,plate:"none"},colors:{frame:"#000000"},shapes:[{type:"path",d:"M26.57 80.23h0c0.12 -2.06 0.31 -4.19 0.49 -6.25s0.48 -4.13 0.85 -6.13s0.79 -4 1.27 -5.95a30.21 30.21 0 0 1 1.94 -5.28h0c0.06 -0.18 0.13 -0.43 0.19 -0.67a3.55 3.55 0 0 0 -2.8 -4.19l-0.18 -0.06a1.85 1.85 0 0 0 -0.54 -0.06c-0.19 0 -0.31 -0.06 -0.49 -0.06s-0.61 -0.06 -0.91 -0.06c-0.61 0 -1.21 0.06 -1.82 0.06c-1.21 0.12 -2.37 0.25 -3.52 0.43a62.08 62.08 0 0 0 -6.8 1.45a58.45 58.45 0 0 0 -6.43 2.31c-1 0.42 -2.07 1 -3.1 1.4s-2 1.09 -3 1.57a0.76 0.76 0 0 0 0.54 1.4h0.07c1.09 -0.24 2.12 -0.55 3.15 -0.79s2.13 -0.48 3.16 -0.61A46 46 0 0 1 15 58c1.34 -0.06 2.73 -0.06 4.07 -0.06a62.58 62.58 0 0 0 -7.23 10.43a85.58 85.58 0 0 0 -6.55 15.36a107.86 107.86 0 0 0 -5 32.53a104.06 104.06 0 0 0 5 32.29a90.47 90.47 0 0 0 15.54 28.52a0.94 0.94 0 0 0 1.27 0.19a0.89 0.89 0 0 0 0.18 -1.28h0a87.24 87.24 0 0 1 -13.89 -28.28A102.85 102.85 0 0 1 11 85.87a82.15 82.15 0 0 1 6.68 -14a51.58 51.58 0 0 1 5.71 -7.76c0 1.21 0 2.36 0.06 3.58c0.12 2.18 0.24 4.31 0.48 6.43s0.49 4.25 0.85 6.37a1 1 0 0 0 0.91 0.85A1.37 1.37 0 0 0 26.57 80.23Z",fill:"frame"}],labels:[]};var cl=Kt({id:"Arrow",name:"Arrow",description:"QR code with arrow",spec:sl,at:{x:47,y:95,scale:1}});var ll={id:"default",name:"Default",description:"Simple QR code without decorative elements",wrapper:t=>v("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:v("g",{fill:"none",transform:"translate(9, 9) scale(0.95)",children:t})})};var ar=593,_e=296.5,or=146.5,pl=294.5,gl=231.228,bl="M296.5 0C460.252 -7.15782e-06 593 132.748 593 296.5C593 460.252 460.253 593 296.5 593C132.748 593 7.15782e-06 460.252 0 296.5C-7.15788e-06 132.748 132.748 7.15788e-06 296.5 0ZM296.5 527.728C424.204 527.728 527.728 424.204 527.728 296.5C527.728 168.796 424.204 65.2713 296.5 65.2713C168.796 65.2713 65.2714 168.796 65.2714 296.5C65.2714 424.204 168.796 527.728 296.5 527.728Z",nf="iaa2 1z3g 1z0y 1z18 1z18 1we8 2mq 1uta 47y 1rx4 73u 1rx4 73u 1rxe 73u 1rx4 73u 1rxe 73u 1rx4 73u 1rxe 73u 1rx4 73u 1rzm 71m 1rzm 71m 1rzc 73u okq 13ce 744 1rx4 744 1rwu 744 1rx4 744 1rx4 73u 1rx4 744 1rx4 73u 1rx4 73u 1rx4 744 1rx4 73u 1rxe 73u 1rx4 73u 1rx4 744 1rzm 71c 1rzm 73u 1rxe 73u 1rx4 744 1rx4 73u 1rx4 73u 1rxe 73u 1rx4 618 12m 1rxe 73u 1z0y 1z18 1z0y 1z18 1z0y 1z18 1z18",rf="hqpr 5 1z36 1z0y 1z18 1z18 1z0y 1z0y 1a7w otc 1z0y 1z18 1z0y 1z18 1z0y 1z1i 1z0o 1z18 1z0y 1z3q 1z0y 1z18 1z0y 1z18 1z0y 1z18 1z0y 1z18 1z0y 1z18 1z0y 1lk8 dgq 1z18 1z18 1z3g 1z0y 1z0y 1z18 1z18 1z0y 1z0y 1z18 1yx2 3w 1z18 60o 1t0a 1z18 1z0y 1z18 1z0y",ul="3cf27f17c00j3ch21n1ek00l1el3cj1vv1kd00n3cl3cn1q31q500p3cp1vx00r1kb3cs3aw1ej21p00t3ax3ay17b27h00w3b02g20yq01w2d611m01x3b52aa14i01y24i1bq0203bd3be1q21q60253bf39e39f39h14e2ae02d39j11i2da02e39l0ym02f39n2lt0sz03a39p2ix0vv03b39r2d511n39t03d27d17f03f39x39y21l1en03h3a03a11vt1kf03j37w37x1q11q703l37z1k903n1vz3821eh03p21r38714d03t11h03u2db38a0vp2j303w2lz38g03x0st2rk0n804o38l2oo0q404p38n2iw0vw04r36f36h2a814k04u36k36l1vs1kg04z36o36p1n41t405236q36x36y0ss2m005d3720n02rs05f3742uf0kd0633763772on0q506537834y2fz0yt06834z2d311p06935235424f1bt06c35621j1ep06d3581yn1hl06e35a1sv1nd06g35b1pz1q906h35d35e35g1ef21t06l35h1bj24p06m35k35l11f2dd06q35n0vn2j506s35p35q0pv2ox06u35s0mz2rt06v35t33h0k32up06w2x90hi08y2ud0ke08z33r2lp0t20922fx0yu0942a514m09624d1bu0983441yl1hm09a1vp1ki09b1px1qa09d34e1n11t609e1h91yy09g1ed21u09h1a227m0831492ai09l0yh2ga09n0sp2m209p0pt2oy09q0k12uq09s2xo0h52z209t31k0en0bt2780c319z0az0e831z0cq",ml=52,of=240;function dl(t){let e=0;return t.split(" ").map(n=>(e+=Number.parseInt(n,36),e/1e4))}var Ga;function af(){if(!Ga){let t=dl(nf),e=dl(rf),n=[];for(let o=0;o<ul.length;o+=3){let r=Number.parseInt(ul.slice(o,o+3),36);n.push({cx:t[Math.floor(r/ml)],cy:e[r%ml]});}Ga=n;}return Ga}function sf(t){let e=0;for(let n=0;n<t.length;n++)e=e*32-e+t.charCodeAt(n),e%=2147483647;return Math.abs(e)}function yl(t){let e=af(),n=sf(t),o=()=>(n=(n*9301+49297)%233280,n/233280),r=e.map((a,i)=>i);for(let a=r.length-1;a>0;a--){let i=Math.floor(o()*(a+1));[r[a],r[i]]=[r[i],r[a]];}return r.slice(0,of).sort((a,i)=>a-i).map(a=>e[a])}var fl=300,cf=49,lf=6;function _l(t,e){if(fl/e<=cf+.5)return t;let n=or,o=or+fl,r=lf*e+e/2;return t.filter(({cx:a,cy:i})=>Math.max(n-a,a-o,n-i,i-o)>=r)}var xl="Scan the QR code * Scan the QR code * Scan the QR code * Scan the QR code *",ir=32,$l=3.5,uf=ir*On,Sl=246.5,ie=2*Math.PI*Sl,qa=.36,hl=Sl+qa*ir,Ua=400;function En(t,e){return t===" "||/[il1|!']/.test(t)?e*.3:/[mwMW@%&]/.test(t)?e*.8:e*.6}function mf(t){let e=t.slice(0,Ua).split(" ").map(n=>hn(n,Ua)).join(" ");return Array.from(e).slice(0,Ua)}var df="\u2026",wl=1;function Ml(t,e,n,o=false){return o&&e===t.length-1?wl*n:En(t[e],n)}function Wa(t,e,n=false){let o=0;for(let r=0;r<t.length;r++)o+=Ml(t,r,e,n);return o}function za(t,e,n,o=false){return Wa(t,e,o)+n*Math.max(0,t.length-1)+En(" ",e)+2*n<=ie}var Cl=t=>t.join("").split(" ").filter(Boolean),ff=(t,e)=>Array.from(Array.from({length:e},()=>t.join(" ")).join(" "));function Rl(t,e,n){if(za(t,e,n))return {chars:t,fontSize:e,letterSpacing:n};let o=Math.min(n,0),r=Math.min(e,uf),a=(h,p=false)=>{let b=Wa(h,e,p)+En(" ",e),y=h.length+1,_=(ie-b)/y;if(_>=o)return {chars:h,fontSize:e,letterSpacing:_,cut:p};let w=(ie-o*y)/b*e;return w>=r?{chars:h,fontSize:w,letterSpacing:o,cut:p}:null},i=a(t);if(i)return i;let c=Cl(t),s=El(c);for(let h=c.length/s.length-1;h>=1;h--){let p=ff(s,h);if(za(p,r,o))return a(p)??{chars:p,fontSize:r,letterSpacing:o}}let l=ie-En(" ",r)-wl*r-2*o,m=0,u=0,f=0;for(let[h,p]of t.entries()){if(m+=En(p,r)+o,m>l)break;f=h+1,(f===t.length||t[f]===" ")&&(u=f);}let d=[...hf(t.slice(0,u>0?u:f)),df];return (za(d,e,n,true)?{chars:d,fontSize:e,letterSpacing:n,cut:true}:null)??a(d,true)??{chars:d,fontSize:r,letterSpacing:o,cut:true}}function hf(t){let e=t.length;for(;e>0&&/[\s.,;:!?*·•\-–—]/u.test(t[e-1]);)e--;return t.slice(0,e)}function El(t){for(let e=1;e<t.length;e++)if(t.length%e===0&&t.every((n,o)=>n===t[o%e]))return t.slice(0,e);return t}function pf(t,e,n){let o=Cl(t);if(o.length===0)return {chars:[],fontSize:e,letterSpacing:n};let r=Array.from(El(o).join(" ")),a=Wa(r,e)+En(" ",e),i=a+(r.length+1)*n,c=Math.min(n,0),s=null;for(let l of new Set([Math.floor(ie/i),Math.ceil(ie/i)])){if(l<1)continue;let m=(ie-l*a)/(l*(r.length+1));if(m>=c&&(!s||Math.abs(m-n)<Math.abs(s.letterSpacing-n))){let u=Array.from({length:l},()=>r.join(""));s={chars:Array.from(u.join(" ")),fontSize:e,letterSpacing:m};}}return s??Rl(r,e,n)}function Al(t,e){let{position:n,rotation:o}=e,r=mf(t),a=e.fill==="repeat"?pf(r,e.fontSize,e.letterSpacing):Rl(r,e.fontSize,e.letterSpacing),{fontSize:i,letterSpacing:c}=a,s=[],l=0;for(let[h,p]of a.chars.entries()){let b=Ml(a.chars,h,i,a.cut);s.push({char:p,along:l+b/2}),l+=b+c;}let m=l-(s.length>0?c:0),u=n!=="bottom",f=u?hl-qa*i:hl+qa*i,d=m/ie*180,g=[];for(let{char:h,along:p}of s){if(h.trim()==="")continue;let b=p/ie*360,y=u?o-d+b:o+180+d-b,_=y*Math.PI/180;g.push({char:h,x:j(_e+f*Math.sin(_)),y:j(_e-f*Math.cos(_)),rotate:j(u?y:y-180)});}return {text:a.chars.join(""),letters:g,fontSize:i===e.fontSize?i:j(i),letterSpacing:c}}var An=(t,e)=>typeof t=="number"&&Number.isFinite(t)?t:e,Pl={id:"DotRing",name:"Dot Ring",description:"A round code in a ring of dots of its own for every link, with text along the ring",wrapper:(t,e,n)=>{let o=yt(e?.fgColor,"#000000"),r=yt(e?.bgColor,"#ffffff"),a=n?.pixelSize??9,i=j(a/2),c=_l(yl(n?.url??""),a),s=An(e?.fontSize,ir),l=s>0?s:ir,m=typeof e?.customText=="string"?e.customText:xl,u=Al(m,{fontSize:l,letterSpacing:An(e?.fontLetterSpacing,$l),position:e?.textPosition==="bottom"?"bottom":"top",rotation:An(e?.textRotation,0),fill:e?.textFill==="repeat"?"repeat":"none"}),f=e?.textColor||"#ffffff",d=e?.fontFamily||Dr,g=e?.fontWeight??900,h=An(e?.strokeWidth,0),p=e?.strokeColor||"#000000",b=[{radius:_e,width:An(e?.outerStrokeWidth,h),color:e?.outerStrokeColor||p},{radius:gl,width:An(e?.innerStrokeWidth,h),color:e?.innerStrokeColor||p}].filter(y=>y.width>0);return St("svg",{height:ar,id:"svgQrWrapper",style:{width:"100%",height:"100%"},viewBox:`0 0 ${ar} ${ar}`,width:ar,xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",children:[v("circle",{cx:_e,cy:_e,fill:r,r:pl}),v("g",{fill:o,children:c.map((y,_)=>v("circle",{cx:y.cx,cy:y.cy,r:i},_))}),v("path",{d:bl,fill:e?.outerCircleColor||o}),b.map((y,_)=>v("circle",{cx:_e,cy:_e,fill:"none",r:y.radius,stroke:y.color,strokeWidth:y.width},_)),v("g",{"aria-hidden":"true",children:u.letters.map((y,_)=>v("text",{fill:f,fontFamily:d,fontSize:u.fontSize,fontWeight:g,textAnchor:"middle",transform:`rotate(${y.rotate} ${y.x} ${y.y})`,x:y.x,y:y.y,children:y.char},_))}),v("g",{transform:`translate(${or} ${or})`,children:t})]})}};var vl={kind:"qrdx.frame",version:1,artboard:{width:220,height:277},qr:{x:52,y:122,size:114,padding:0,plate:"none"},colors:{frame:"#000000"},shapes:[{type:"circle",cx:110,cy:167.682,r:99.318,fill:"#FFFFFF",stroke:{color:"#F89941",width:20}},{type:"ellipse",cx:139.989,cy:67.895,rx:35.445,ry:48.442,fill:"#F89941"},{type:"path",d:"M159.937 69.076C159.937 82.657 156.092 94.845 150.005 103.57C143.912 112.304 135.736 117.381 126.992 117.381C118.247 117.381 110.072 112.304 103.979 103.57C97.891 94.845 94.047 82.657 94.047 69.076C94.047 55.495 97.891 43.308 103.979 34.582C110.072 25.849 118.247 20.771 126.992 20.771C135.736 20.771 143.912 25.849 150.005 34.582C156.092 43.308 159.937 55.495 159.937 69.076Z",fill:"#F89941",stroke:{color:"#E78249",width:5}},{type:"ellipse",cx:126.072,cy:69.487,rx:34.051,ry:50.662,fill:"#F89941"},{type:"path",d:"M143.396 69.667C143.396 82.739 139.562 94.472 133.488 102.874C127.412 111.279 119.235 116.2 110.451 116.2C101.666 116.2 93.489 111.279 87.413 102.874C81.34 94.472 77.506 82.739 77.506 69.667C77.506 56.595 81.34 44.862 87.413 36.46C93.489 28.055 101.666 23.134 110.451 23.134C119.235 23.134 127.412 28.055 133.488 36.46C139.562 44.862 143.396 56.595 143.396 69.667Z",fill:"#F89941",stroke:{color:"#E78249",width:5}},{type:"ellipse",cx:106.316,cy:70.849,rx:33.673,ry:47.851,fill:"#F89941"},{type:"ellipse",cx:78.743,cy:68.448,rx:35.445,ry:48.442,fill:"#F89941"},{type:"path",d:"M58.794 69.63C58.794 83.211 62.639 95.399 68.726 104.124C74.819 112.858 82.995 117.935 91.739 117.935C100.484 117.935 108.659 112.858 114.753 104.124C120.84 95.399 124.685 83.211 124.685 69.63C124.685 56.049 120.84 43.861 114.753 35.136C108.659 26.402 100.484 21.325 91.739 21.325C82.995 21.325 74.819 26.402 68.726 35.136C62.639 43.861 58.794 56.049 58.794 69.63Z",fill:"#F89941",stroke:{color:"#E78249",width:5}},{type:"ellipse",cx:91.744,cy:69.763,rx:32.944,ry:50.385,fill:"#F89941"},{type:"path",d:"M75.335 70.221C75.335 83.293 79.169 95.025 85.243 103.427C91.319 111.833 99.496 116.753 108.281 116.753C117.065 116.753 125.242 111.833 131.318 103.427C137.392 95.025 141.226 83.293 141.226 70.221C141.226 57.148 137.392 45.416 131.318 37.014C125.242 28.609 117.065 23.688 108.281 23.688C99.496 23.688 91.319 28.609 85.243 37.014C79.169 45.416 75.335 57.148 75.335 70.221Z",fill:"#F89941",stroke:{color:"#E78249",width:5}},{type:"ellipse",cx:111.677,cy:70.871,rx:32.39,ry:47.616,fill:"#F89941"},{type:"ellipse",cx:106.971,cy:71.425,rx:33.221,ry:47.616,fill:"#F89941"},{type:"path",d:"M130.85 46.678C137.21 42.252 138.538 40.633 139.867 39.014C139.867 39.014 141.806 43.824 141.88 46.357C141.954 48.89 141.712 50.147 139.248 51.647C136.783 53.146 127.406 53.045 122.083 52.975C121.31 52.5 122.72 52.337 130.85 46.678Z",fill:"#000000"},{type:"path",d:"M87.765 46.512C81.392 42.141 80.058 40.548 78.724 38.954C78.724 38.954 76.783 45.836 76.758 46.822C76.733 47.808 76.657 50.805 80.247 52C83.837 53.194 91.234 52.772 96.551 52.727C97.322 52.265 95.912 52.099 87.765 46.512Z",fill:"#000000"},{type:"path",d:"M132 90.5C139.156 83.16 141.5 78.283 143.351 72.935C144.24 70.367 134.909 72.043 130 72.935C129.276 73.066 127.751 76.915 127 77C126.182 77.093 123.841 73.076 123 73.086C121.725 73.101 119.727 73.086 117.875 73.429C117.345 74.365 118.367 77.575 117.875 78.283C117.321 78.283 113.796 77.26 113.242 76.43C112.689 74.492 112.949 73.363 112.118 72.532C109.555 72.908 110.023 72.657 107.412 73.086C106.768 73.192 105.09 77.721 104.441 77.82C103.615 77.945 100.644 74.009 99.809 74.114C98.747 74.248 96.821 74.468 95.64 74.577C95.126 74.624 95.554 77.502 95.177 78.283C94.898 78.862 91.426 77.892 90.5 77.5C90.037 76.502 89.844 74.558 89 74.577C83 74.114 81.4 73.843 75.575 70.871C75.575 70.871 74.5 80 83 89C91.5 98 119.127 103.706 132 90.5Z",fill:"#000000"},{type:"path",d:"M107.238 7.252C109.192 1.731 114.678 0.363 117.935 0L120.377 1.816C121.158 2.397 121.842 2.409 122.331 3.257C122.331 4.225 118.337 5.42 114.429 6.582C109.545 8.035 111.482 17.053 114.429 19.281C115.401 20.015 115.524 19.964 117.966 19.964C120.029 19.964 122.387 18.247 123.566 17.353C123.566 17.353 123.861 20.257 121.798 21.478C119.735 22.698 115.578 21.858 115.608 21.966C116.493 23.918 118.89 22.489 120.029 23.336C119.346 23.336 118.556 24.289 116.198 24.533C114.672 24.58 114.135 24.533 112.956 23.918C111.777 23.304 111.482 22.87 110.893 22.14C108.83 23.36 110.893 25.431 110.893 25.431C110.893 25.431 106.472 25.851 105.587 23.918C105.264 23.212 105.882 22.14 105.587 21.966C103.819 22.454 102.935 23.481 99.373 22.87C96.312 22.344 97.102 18.321 96.451 17.353C99.381 18.079 97.131 20.039 101.327 19.964C112.838 19.758 104.796 14.153 107.238 7.252Z",fill:"#5D725F"}],labels:[]};var Ll=Kt({id:"Halloween",name:"Halloween",description:"QR code with Halloween theme",spec:vl,at:{x:38,y:10,scale:1}});var Fl={kind:"qrdx.frame",version:1,artboard:{width:316,height:316},qr:{x:20,y:20,size:276,padding:0,plate:"none"},colors:{frame:"#000000"},shapes:[{type:"path",d:"M308 8H8v300h300V8ZM0 0v316h316V0H0Z",fill:"frame",fillRule:"evenodd"}],labels:[]};var Il=Kt({id:"SquareBorder",name:"Square Border",description:"QR code with square decorative border",spec:Fl,at:{x:0,y:0,scale:300/316}});var kl={kind:"qrdx.frame",version:1,artboard:{width:208,height:298},qr:{x:14,y:14,size:180,padding:0,plate:"none"},colors:{frame:"#000000"},shapes:[{type:"path",d:"M197 0.7h-186a10.25 10.25 0 0 0 -10.2 10.12v186A10.13 10.13 0 0 0 11 207H197a10.13 10.13 0 0 0 10.12 -10.12v-186A10.13 10.13 0 0 0 197 0.7Zm2.36 193.05a5.46 5.46 0 0 1 -5.47 5.47H14.16a5.46 5.46 0 0 1 -5.47 -5.47V13.93a5.46 5.46 0 0 1 5.47 -5.47H193.91a5.46 5.46 0 0 1 5.47 5.47Z",fill:"frame"},{type:"path",d:"M197.54 237.81H127.61a2.29 2.29 0 0 1 -1.62 -0.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 0.67H10.09A9.15 9.15 0 0 0 0.93 247v41.17a9.16 9.16 0 0 0 9.16 9.16H197.61a9.09 9.09 0 0 0 9.09 -9.16V247A9.16 9.16 0 0 0 197.54 237.81Z",fill:"frame"}],labels:[]};var Tl=Kt({id:"StandardBox",name:"Standard Box",description:"QR code with standard box",spec:kl,at:{x:46,y:1,scale:1}});var Nl={kind:"qrdx.frame",version:1,artboard:{width:252,height:300},qr:{x:40,y:38,size:174,padding:0,plate:"none"},colors:{frame:"#000000"},shapes:[{type:"path",d:"M171.11 290.77l-7.28 4.88a2.16 2.16 0 0 0 -0.57 3a2.21 2.21 0 0 0 1.77 0.92a2.4 2.4 0 0 0 1.2 -0.35l7.28 -4.88a2.14 2.14 0 0 0 -2.4 -3.54Z",fill:"#22071b"},{type:"path",d:"M242.85 227.52l-7.28 4.87a2.16 2.16 0 0 0 -0.57 3a2.21 2.21 0 0 0 1.77 0.92a1.86 1.86 0 0 0 1.2 -0.35l7.28 -4.88a2.13 2.13 0 1 0 -2.4 -3.53Z",fill:"#22071b"},{type:"path",d:"M17 176.34l-9.11 6.08a2.15 2.15 0 0 0 -0.57 3a2.19 2.19 0 0 0 1.77 0.92a2.14 2.14 0 0 0 1.2 -0.35l9.12 -6.08A2.14 2.14 0 0 0 17 176.34Z",fill:"#22071b"},{type:"path",d:"M17 269.08l-9.11 6.07a2.15 2.15 0 0 0 -0.57 3a2.19 2.19 0 0 0 1.77 0.92a2.92 2.92 0 0 0 1.2 -0.35l9.12 -6.08A2.14 2.14 0 0 0 17 269.08Z",fill:"#22071b"},{type:"path",d:"M123 10.1a2.4 2.4 0 0 0 1.14 -0.35l7.7 -5.16a2.13 2.13 0 0 0 -2.4 -3.53l-7.64 5.15a2.15 2.15 0 0 0 -0.56 3A2.19 2.19 0 0 0 123 10.1Z",fill:"#22071b"},{type:"path",d:"M251.54 54.77a2.14 2.14 0 0 0 -3 -0.56l-17.1 11.45V31.31a10.18 10.18 0 0 0 -10.18 -10.18H113.22l-10.39 7a2.4 2.4 0 0 1 -1.2 0.35a2.21 2.21 0 0 1 -1.77 -0.92a2.15 2.15 0 0 1 0.57 -3l1.41 -0.92l13.64 -8.76a2.1 2.1 0 1 0 -2.26 -3.54L98 21.2h-8.13l-10.39 7a2.37 2.37 0 0 1 -1.2 0.35a2.19 2.19 0 0 1 -1.76 -0.92a2.15 2.15 0 0 1 0.56 -3L100 9.25a2.13 2.13 0 1 0 -2.4 -3.53l-23 15.48H34.2A10.18 10.18 0 0 0 24 31.38v28L7.34 70.46a2.09 2.09 0 0 0 -0.57 3a2 2 0 0 0 1.77 0.92a2.58 2.58 0 0 0 1.2 -0.35l14.35 -9.54l3.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 -0.56 3a2 2 0 0 0 1.77 0.92a2.34 2.34 0 0 0 1.2 -0.36l7.35 -4.94A2.13 2.13 0 0 1 28.69 84l-4.46 3v65.66L1.05 168.07a2.15 2.15 0 0 0 -0.57 3a2 2 0 0 0 1.77 0.92a2.37 2.37 0 0 0 1.2 -0.35l25 -16.75a2 2 0 0 1 2.62 0.77a2.16 2.16 0 0 1 -0.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 -0.57 3a2.06 2.06 0 0 0 1.77 0.92a2.38 2.38 0 0 0 1.2 -0.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 -0.56 3a2 2 0 0 0 1.76 0.91a2.37 2.37 0 0 0 1.2 -0.35l30.54 -20.28a2.15 2.15 0 0 1 3 0.56a2.1 2.1 0 0 1 -0.57 3l-14.21 9.54H193l-4.6 3a2.16 2.16 0 0 0 -0.63 3a2.11 2.11 0 0 0 1.76 1a2 2 0 0 0 1.13 -0.36L213 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 0.35a2.19 2.19 0 0 1 -1.77 -0.92a2.15 2.15 0 0 1 0.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 0.36a2.22 2.22 0 0 1 -1.76 -0.92a2.15 2.15 0 0 1 0.56 -3l6.72 -4.52l13.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 0.36a2.22 2.22 0 0 1 -1.76 -0.92a2.15 2.15 0 0 1 0.56 -3l6.72 -4.52l19.43 -13.08A2.05 2.05 0 0 0 251.54 54.77ZM213 216.07h-172a5.23 5.23 0 0 1 -5.23 -5.24V38.94a5.22 5.22 0 0 1 5.23 -5.23H213a5.22 5.22 0 0 1 5.23 5.23V210.83h0.07A5.22 5.22 0 0 1 213 216.07Z",fill:"#22071b"},{type:"path",d:"M246.45 139.8l-7.28 4.88a2.15 2.15 0 0 0 -0.56 3a2.22 2.22 0 0 0 1.76 0.92a2.44 2.44 0 0 0 1.21 -0.36l7.28 -4.87a2.14 2.14 0 0 0 -2.41 -3.54Z",fill:"#22071b"}],labels:[]};var Ol=Kt({id:"StrikedBox",name:"Striked Box",description:"QR code with striked box",spec:Nl,at:{x:24,y:0,scale:1}});var sr={default:ll,Arrow:cl,StandardBox:Tl,SquareBorder:Il,StrikedBox:Ol,Halloween:Ll,DotRing:Pl},Dl={FlamQR:"DotRing"},Xr=t=>{if(Object.hasOwn(sr,t))return sr[t];let e=Object.hasOwn(Dl,t)?Dl[t]:void 0;return e?sr[e]:void 0},my=()=>Object.values(sr),dy=()=>Object.keys(sr);var Ha=t=>Math.round(Math.min(Math.max(t,0),255)).toString(16).padStart(2,"0");function Ul(t){return `#${Ha(t.r)}${Ha(t.g)}${Ha(t.b)}`}function Yr(t){let e=lt(t);return !e||e.a>=1||e.a<=0?{color:t}:{color:Ul(e),opacity:j(e.a,3)}}function Kr(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}}var zl={r:0,g:0,b:0,a:1};function xf(t){return [...t].map(e=>({offset:Math.min(Math.max(e.offset/100,0),1),color:lt(e.color)??zl})).sort((e,n)=>e.offset-n.offset)}function Va(t,e){let n=t[0],o=t.at(-1);if(!(n&&o))return zl;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,m=(u,f)=>{let d=u*a.color.a+(f*i.color.a-u*a.color.a)*s;return l>0?d/l:u+(f-u)*s};return {r:m(a.color.r,i.color.r),g:m(a.color.g,i.color.g),b:m(a.color.b,i.color.b),a:l}}}return o.color}var Bl=4,Ql=720,$f=2;function ql(t,e,n,o,r){let a=xf(t);if(a.length===0)return {wedges:[]};let i=a[0].color.a,c=a.every(y=>Math.abs(y.color.a-i)<.002),s=[...new Set([0,...a.map(y=>y.offset),1])].sort((y,_)=>y-_),l=[];for(let y=0;y+1<s.length;y++){let _=s[y],w=s[y+1];if(w<=_)continue;let M=Va(a,_+1e-9),S=Va(a,w-1e-9),$=Math.max(Math.abs(M.r*M.a-S.r*S.a),Math.abs(M.g*M.a-S.g*S.a),Math.abs(M.b*M.a-S.b*S.a),Math.abs(M.a-S.a)*255),C=Math.ceil($/$f),R=Math.ceil((w-_)*360/Bl),E=Math.max(1,C,R);for(let P=0;P<E;P++)l.push([_+(w-_)*P/E,_+(w-_)*(P+1)/E]);}let m=l;if(l.length>Ql){let y=Math.ceil(l.length/Ql);m=[];for(let _=0;_<l.length;_+=y){let w=l.slice(_,_+y);m.push([w[0][0],w.at(-1)[1]]);}}let u=e-90,f=r/Math.cos(2*Bl/2*(Math.PI/180)),d=y=>{let _=y*Math.PI/180;return [x(n+f*Math.cos(_)),x(o+f*Math.sin(_))]},g=`${x(n)} ${x(o)}`,h=y=>j((y%360+360)%360,4),p=m.length-1,b=m.map(([y,_],w)=>{let M=Va(a,(y+_)/2),S=(_-y)*360,$=c&&w===0&&p>0?S:0,C=c&&w<p?S:0,R=u+y*360-$,E=u+_*360+C,[P,L]=d(R),[F,k]=d(E);return {d:`M${g}L${P} ${L}L${F} ${k}Z`,color:Ul(M),...c||M.a>=1?{}:{opacity:j(M.a,3)},from:h(R),sweep:j(E-R,4)}});return c&&i<1?{wedges:b,opacity:j(i,3)}:{wedges:b}}function Gl(t,e,n,o){return (Math.atan2(o-e,n-t)*180/Math.PI%360+360)%360}function Wl(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=Gl(t,e,n.x+n.width/2,n.y+n.height/2),i=0,c=0;for(let[s,l]of r){let m=Gl(t,e,s,l)-a;m>180?m-=360:m<=-180&&(m+=360),i=Math.min(i,m),c=Math.max(c,m);}return [a+i,a+c]}function Hl(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}function Xa(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 Zl(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 Sf(t,e,n){return t<7&&e<7||t>=n-7&&e<7||t<7&&e>=n-7}var wf=.9;function ja(t,e){let{margin:n,pixelSize:o,pattern:r="circle",plain:a=false}=e;if(Kc(r))return tl(t,{margin:n,pixelSize:o,pattern:r,scale:e.scale,plain:a});let i=Vr(e.scale,r),c=[],s=t.length,l=o*.45,m=a?()=>false:Oa(s);return t.forEach((u,f)=>{u.forEach((d,g)=>{if(d&&(a||!Sf(g,f,s))){let h=(g+.5+n)*o,p=(f+.5+n)*o,b=`${g}-${f}`,y=c.length;if(m(g,f)){c.push(v("rect",{height:x(o),width:x(o),x:x(h-o/2),y:x(p-o/2)},b));return}switch(r){case "circle":c.push(v("circle",{cx:x(h),cy:x(p),r:x(l),transform:A`rotate(0,${h},${p})`},b));break;case "circle-large":{let _=o*.5;c.push(v("circle",{cx:x(h),cy:x(p),r:x(_),transform:A`rotate(0,${h},${p})`},b));}break;case "small-square":{let _=o*.357143;c.push(v("path",{d:A`M ${h-_} ${p-_}v ${o*.714286}h ${o*.714286}v -${o*.714286}z`,transform:A`rotate(0,${h},${p})`},b));}break;case "diamond":{let _=o*.357143;c.push(v("path",{d:A`M ${h-_} ${p-_}v ${o*.714286}h ${o*.714286}v -${o*.714286}z`,transform:A`rotate(45,${h},${p})`},b));}break;case "circle-mixed":{let _=(g+f)%3===0?wf:(g+f)%2===0?1:1.25,w=l*_;c.push(v("circle",{cx:x(h),cy:x(p),r:x(w),transform:A`rotate(0,${h},${p})`},b));}break;case "pacman":{let _=o*.5,w=o*.357143;c.push(v("path",{d:A`M ${h-_} ${p-w}v ${o*.714286}h ${_}a ${_*.5} ${_*.5}, 0, 0, 0, 0 -${o*.714286}h -${_}v -${o*.714286}z`,transform:A`rotate(${(g+f)%2===0?0:90},${h},${p})`},b));}break;case "rounded":{let _=o*.5,w=o*.2;c.push(v("rect",{height:x(o),rx:x(w),ry:x(w),transform:A`rotate(0,${h},${p})`,width:x(o),x:x(h-_),y:x(p-_)},b));}break;case "square":{let _=o*.5;c.push(v("rect",{height:x(o),transform:A`rotate(0,${h},${p})`,width:x(o),x:x(h-_),y:x(p-_)},b));}break;case "vertical-line":{let _=o*.714286,w=o;c.push(v("path",{d:A`M ${h-o*.5} ${p-_*.5}v ${_}h ${w}v -${_}z`,transform:A`rotate(90,${h},${p})`},b));}break;default:c.push(v("circle",{cx:x(h),cy:x(p),r:x(l),transform:A`rotate(0,${h},${p})`},b));}if(i!==1&&c.length>y){let _=c.pop();c.push(v("g",{transform:A`translate(${h},${p}) scale(${x(i,6)}) translate(${-h},${-p})`,children:_},b));}}});}),c}function Mf(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 Ya(t,e){return `${t}-${Te(JSON.stringify(e))}`}function Cf(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,m=c-l*Math.cos(i),u=s-l*Math.sin(i),f=c+l*Math.cos(i),d=s+l*Math.sin(i);return {x1:m,y1:u,x2:f,y2:d}}function to(t,e){return e.map((n,o)=>{let{color:r,opacity:a}=Yr(n.color);return v("stop",{offset:`${n.offset}%`,stopColor:r,stopOpacity:a},`${t}-stop-${o}`)})}function Xl(t,e,n,o,r,a){let i=ql(e.stops,e.angle??0,n,o,r),c=i.wedges.map((s,l)=>v("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 v("pattern",{"data-qrdx-conic":`${x(n)} ${x(o)}`,height:x(a),id:t,patternUnits:"userSpaceOnUse",width:x(a),x:0,y:0,children:i.opacity===void 0?c:v("g",{opacity:i.opacity,children:c})},t)}function Rf(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}}var Ef=["xMin","xMid","xMax"],Af=["YMin","YMid","YMax"];function Yl(t,e,n){let o=e.scale??1,r=e.fit==="tile",a=r?n/4*o:n,i=e.underlay?Yr(e.underlay):null,c=r?a:n*o,s=Rf(e.position),l=r?0:s.x*(n-c),m=r?0:s.y*(n-c),u=r?"xMidYMid slice":`${Ef[s.x*2]??"xMid"}${Af[s.y*2]??"YMid"} ${e.fit==="contain"?"meet":"slice"}`;return St("pattern",{height:x(a),id:t,patternUnits:"userSpaceOnUse",width:x(a),x:0,y:0,children:[i&&v("rect",{fill:i.color,fillOpacity:i.opacity,height:x(a),width:x(a),x:0,y:0}),v("image",{height:x(c),href:e.src,opacity:(e.opacity??1)<1?e.opacity:void 0,preserveAspectRatio:u,width:x(c),x:x(l),y:x(m)})]},t)}var Kl=(t,e)=>Ya("img",[t,e]);function Pf(t,e,n,o,r,a,i){let c=Bt(t);if(c.type==="solid")return null;if(c.type==="image"){let l=Kl(c,i);return {id:l,element:Yl(l,c,i)}}let s=Ya(a,[c,e,n,o,r,...c.type==="angular"?[i]:[]]);if(c.type==="linear"){let l=c,m=l.angle??0,{x1:u,y1:f,x2:d,y2:g}=Cf(m,e,n,o,r);return {id:s,element:v("linearGradient",{gradientUnits:"userSpaceOnUse",id:s,x1:x(u),x2:x(d),y1:x(f),y2:x(g),children:to(s,l.stops)},s)}}if(c.type==="radial"){let l=c,m=e+o/2,u=n+o/2,f=o/2*.97;return {id:s,element:v("radialGradient",{cx:x(m),cy:x(u),fx:x(m),fy:x(u),gradientUnits:"userSpaceOnUse",id:s,r:x(f),children:to(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 Za(t,e,n){let o=Bt(t);if(o.type==="solid")return null;if(o.type==="image"){let a=Kl(o,e);return {id:a,element:Yl(a,o,e)}}let r=Ya(n,[o,e]);if(o.type==="linear"){let a=o,i=a.angle??0,{x1:c,y1:s,x2:l,y2:m}=Mf(i,e);return {id:r,element:v("linearGradient",{gradientUnits:"userSpaceOnUse",id:r,x1:x(c),x2:x(l),y1:x(s),y2:x(m),children:to(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:v("radialGradient",{cx:x(i),cy:x(c),fx:x(i),fy:x(c),gradientUnits:"userSpaceOnUse",id:r,r:x(s),children:to(r,a.stops)},r)}}return o.type==="angular"?{id:r,element:Xl(r,o,e/2,e/2,e*.75,e)}:null}var Jr=t=>wn(t)||wa(t);function Vl(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 se(t,e,n){if(e)return {fill:`url(#${e})`};let o=Bt(t,n),r=o.type==="solid"?o.color:o.type==="image"?o.underlay??n:n,{color:a,opacity:i}=Yr(r);return i===void 0?{fill:a}:{fill:a,fillOpacity:i}}function xe(t,e,n,o){if(o==null)return null;let r=t.length,a=Math.floor(e*_r),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,m=o.y==null?r/2-s/2:o.y*i,u=null;if(o.excavate){let f=Math.max(0,o.padding??0)*i,d=Math.floor(l-f),g=Math.floor(m-f),h=Math.ceil(c+l+f-d),p=Math.ceil(s+m+f-g);u={x:d,y:g,w:h,h:p};}return {x:l,y:m,h:s,w:c,excavation:u}}function Tt(t){let e=t.level??jt,{imageSettings:n}=t,o=t.isOGContext&&n?.excavate&&(e==="L"||e==="M")?"Q":e;if(t.autoLevel&&n&&o!=="H"){let r=gt.QrCode.encodeText(t.value,Rt[o]).getModules(),a=xe(r,t.size??ut,At(r.length,t.margin??dt,t.shape),n);a&&(a.excavation?a.excavation.w*a.excavation.h:a.w*a.h)/(r.length*r.length)>Uo&&(o="H");}return o}function vf(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 cr(t){let{value:e,size:n=ut,level:o=jt,bgColor:r=bt,fgColor:a=Mt,eyeColor:i,dotColor:c,bodyPattern:s="circle",cornerEyePattern:l="gear",cornerEyeDotPattern:m="circle",margin:u=dt,isOGContext:f=false,imageSettings:d,templateId:g,customTemplate:h,customProps:p,frame:b,art:y,eyeColors:_,moduleScale:w,autoLevel:M,shape:S,frameLabelMarkers:$,partMarkers:C,...R}=t,E=eo({value:e,size:n,margin:u,level:o,shape:S,autoLevel:M,isOGContext:f},d),P=kt(b),L=P?{}:R,F=rt=>P?Br(rt,{size:n,frame:b,bgColor:r,svgProps:R,markLabels:$}):rt,k=Tt({value:e,size:n,level:o,margin:u,imageSettings:E,isOGContext:f,autoLevel:M,shape:S}),N=gt.QrCode.encodeText(e,Rt[k]),I=N.getModules(),B=At(I.length,u,S),q=yc(e,I.length,u,S),O=(rt,Lt)=>Qa(C,rt,Lt),G=(rt,Lt)=>{let Ht=Sa(S,rt);return Ht?"circle"in Ht?v("circle",{cx:x(rt/2),cy:x(rt/2),...Lt,r:x(rt/2),...O("background")}):v("path",{d:Ht.path,...Lt,...O("background")}):v("rect",{...Lt,height:rt,width:rt,x:0,y:0,...O("background")})},J=I.length+B*2,pt=xe(I,n,B,E),at=null;if(E!=null&&pt!=null){pt.excavation!=null&&(I=Xa(I,pt.excavation));let{imgWidth:rt,imgHeight:Lt,imgLeft:Ht,imgTop:rn}=vf(pt,n,J,B);if(f){let on=E.shape??"square";at=v("img",{alt:"Logo",src:E.src,style:{position:"absolute",left:`${x(Ht)}px`,top:`${x(rn)}px`,width:`${x(rt)}px`,height:`${x(Lt)}px`,...on!=="square"&&{borderRadius:on==="circle"?"50%":`${x(Math.min(rt,Lt)*Qr)}px`},...E.plate&&{backgroundColor:E.plate,padding:`${x(rt*Gr)}px`,boxSizing:"border-box"}}});}else at=Ur(E,{x:Ht,y:rn,w:rt,h:Lt}),C&&(at=an(at,O("logo")));}let T=n/J,U=I.length,z=7*T,wt=1.5*T,Re={fgColor:yt(a,Mt),bgColor:yt(r,bt)},It=Pa(y)?Ia({art:y,modules:I,version:N.version,margin:B,pixelSize:T,...Re,body:rt=>ja(rt,{margin:B,pixelSize:T,pattern:s,scale:w})}):null,Jt=It&&C?an(It,O("body")):It,Ee=It&&y?Na({art:y,version:N.version,...Re}):null,Q=It?null:ja(I,{margin:B,pixelSize:T,pattern:s,scale:w}),et=q?ja(q,{margin:0,pixelSize:T,pattern:s,scale:w,plain:true}):null,V=Bt(r,bt),mt=Bt(a,Mt),Tn=Jr(V)?Za(V,n,"bg-color"):null,Eo=Jr(mt)?Za(mt,n,"fg-color"):null,A0=se(r,Tn?.id??null,bt),Wi=se(a,Eo?.id??null,Mt),Hi=Jt?St(Vt,{children:[Jt,et&&v("g",{...Wi,...O("body"),children:et})]}):St("g",{...Wi,...O("body"),children:[Q,et]}),je=B*T,Ze=B*T,Xe=(U-7+B)*T,Ye=B*T,Ke=B*T,Je=(U-7+B)*T,Ae=yt(a,Mt),tn=rt=>_?.[rt]?.outer??Ee?.[rt]?.outer??i,en=rt=>_?.[rt]?.inner??Ee?.[rt]?.inner??c,nn=(rt,Lt,Ht,rn,on)=>{let ko=Bt(rt,Ae);return Jr(ko)?Pf(ko,Lt,Ht,z,rn,on,n):null},Ao=nn(tn("topLeft"),je,Ze,"top-left","corners-square-color-0-0"),Po=nn(tn("topRight"),Xe,Ye,"top-right","corners-square-color-1-0"),vo=nn(tn("bottomLeft"),Ke,Je,"bottom-left","corners-square-color-0-1"),Lo=nn(en("topLeft"),je,Ze,"top-left","corners-dot-color-0-0"),Fo=nn(en("topRight"),Xe,Ye,"top-right","corners-dot-color-1-0"),Io=nn(en("bottomLeft"),Ke,Je,"bottom-left","corners-dot-color-0-1"),Vi=se(tn("topLeft"),Ao?.id??null,Ae),ji=se(tn("topRight"),Po?.id??null,Ae),Zi=se(tn("bottomLeft"),vo?.id??null,Ae),Xi=se(en("topLeft"),Lo?.id??null,Ae),Yi=se(en("topRight"),Fo?.id??null,Ae),Ki=se(en("bottomLeft"),Io?.id??null,Ae),Ji=Zr(je,Ze,z,l,"top-left"),ts=jr(je+z/2,Ze+z/2,wt,m,"top-left"),es=Zr(Xe,Ye,z,l,"top-right"),ns=jr(Xe+z/2,Ye+z/2,wt,m,"top-right"),rs=Zr(Ke,Je,z,l,"bottom-left"),os=jr(Ke+z/2,Je+z/2,wt,m,"bottom-left"),P0=St(Vt,{children:[v("defs",{children:Vl([Tn,Eo,Ao,Po,vo,Lo,Fo,Io])}),G(n,A0),Hi,v("g",{...Vi,...O("eye-outer","top-left"),children:v("path",{d:Ji,fillRule:"evenodd",transform:A`rotate(0,${je+z/2},${Ze+z/2})`})}),v("g",{...Xi,...O("eye-centre","top-left"),children:ts}),v("g",{...ji,...O("eye-outer","top-right"),children:v("path",{d:es,fillRule:"evenodd",transform:A`rotate(0,${Xe+z/2},${Ye+z/2})`})}),v("g",{...Yi,...O("eye-centre","top-right"),children:ns}),v("g",{...Zi,...O("eye-outer","bottom-left"),children:v("path",{d:rs,fillRule:"evenodd",transform:A`rotate(0,${Ke+z/2},${Je+z/2})`})}),v("g",{...Ki,...O("eye-centre","bottom-left"),children:os}),at]}),as=h||(g?Xr(g):void 0);if(as){let Lt=Jr(V)?Za(V,300,"bg-color-template"):null,Ht=se(r,Lt?.id??null,bt),rn=St("svg",{height:300,viewBox:"0 0 300 300",width:300,xmlns:"http://www.w3.org/2000/svg",children:[v("defs",{children:Vl([Lt,Eo,Ao,Po,vo,Lo,Fo,Io])}),G(300,Ht),St("g",{transform:`scale(${x(300/n,6)})`,children:[Hi,v("g",{...Vi,...O("eye-outer","top-left"),children:v("path",{d:Ji,fillRule:"evenodd",transform:A`rotate(0,${je+z/2},${Ze+z/2})`})}),v("g",{...Xi,...O("eye-centre","top-left"),children:ts}),v("g",{...ji,...O("eye-outer","top-right"),children:v("path",{d:es,fillRule:"evenodd",transform:A`rotate(0,${Xe+z/2},${Ye+z/2})`})}),v("g",{...Yi,...O("eye-centre","top-right"),children:ns}),v("g",{...Zi,...O("eye-outer","bottom-left"),children:v("path",{d:rs,fillRule:"evenodd",transform:A`rotate(0,${Ke+z/2},${Je+z/2})`})}),v("g",{...Ki,...O("eye-centre","bottom-left"),children:os}),at]})]}),on=300/n,v0={pixelSize:T*on,url:e},is=as.wrapper(rn,{fgColor:a,bgColor:r,...p||{},...R},v0),L0={...is?.props?.style||{},width:void 0,height:void 0,...L.style};return F(an(is,{...L,width:n,height:n,style:L0}))}return F(v("svg",{height:n,viewBox:`0 0 ${n} ${n}`,width:n,xmlns:"http://www.w3.org/2000/svg",...L,children:P0}))}var Dy=(()=>{try{new Path2D().addPath(new Path2D);}catch{return false}return true})(),By=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},Pn=(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},jl=t=>{let e=lt(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)}},Qy=(t,e)=>{let n=jl(t),o=jl(e);if(!(n&&o))return 1;let r=Pn(n.r,n.g,n.b),a=Pn(o.r,o.g,o.b),i=Math.max(r,a),c=Math.min(r,a);return (i+.05)/(c+.05)},Gy=t=>t>=7?{level:"AAA",warning:false,message:"Excellent contrast"}:t>=4.5?{level:"AA",warning:false,message:"Good contrast"}:t>=3?{level:"AA Large",warning:true,message:"Low contrast - may be difficult to scan"}:{level:"Fail",warning:true,message:"Poor contrast - QR code may not scan properly"};var Jl=.6,Lf=["L","M","Q","H"];function tu(t){let e=gt.QrCode.encodeText(t.value,Rt[t.level]),n=Lf[e.errorCorrectionLevel.ordinal]??t.level;return {code:t,cells:e.getModules(),layoutMargin:At(e.size,t.margin,t.shape),map:Kn(e.version,n),level:n,version:e.version}}function eu(t,e){let{cells:n,map:o}=t,r=n.length,a=xe(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 m=Math.max(0,i.x);m<Math.min(r,i.x+i.w);m++)c.push(l*r+m);let s=Jn(o,c);return {worst:Math.max(0,...s),correctable:o.correctable,budget:Math.floor(o.correctable*Jl),level:t.level,version:t.version}}function no(t,e){return eu(tu(t),e)}var nu=t=>!t||t.worst<=t.budget;function Ff(t,e){return nu(no(t,e))}function Ka(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 eo(t,e){if(!e)return;let n=Math.floor(t.size*_r),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??jt,c={value:t.value,size:t.size,margin:t.margin,shape:t.shape},s=f=>Tt({...t,level:i,imageSettings:f}),l=f=>{let d=Ka(c,[f],o,a);return d>0?a(d):void 0},m=s(e);if(m===i)return l(i);let u=l(m);return u&&s(u)===m?u:l(i)}async function Ja(t){let{value:e,size:n=ut,level:o=jt,bgColor:r=bt,fgColor:a=Mt,margin:i=dt,imageSettings:c,eyeColor:s,dotColor:l,bodyPattern:m,cornerEyePattern:u,cornerEyeDotPattern:f,isOGContext:d,templateId:g,customTemplate:h,customProps:p,frame:b,art:y,eyeColors:_,moduleScale:w,frameLabelMarkers:M,partMarkers:S,autoLevel:$,...C}=t,R=eo({value:e,size:n,margin:i,level:o,autoLevel:$},c),E=Tt({value:e,size:n,level:o,margin:i,imageSettings:R,autoLevel:$}),P=gt.QrCode.encodeText(e,Rt[E]).getModules(),L=P.length+i*2,F=xe(P,n,i,R),k=null;if(R!=null&&F!=null){F.excavation!=null&&(P=Xa(P,F.excavation));let I=R.src.startsWith("data:")?R.src:await fetch(`https://wsrv.nl/?url=${encodeURIComponent(R.src)}&w=100&h=100&encoding=base64`).then(B=>{if(!B.ok)throw new Error(`Failed to load QR logo (${B.status}): ${R.src}`);return B.text()});k={settings:{...R,src:I},box:{x:F.x+i,y:F.y+i,w:F.w,h:F.h}};}let N=Zl(P,i);return {size:n,numCells:L,fgPath:N,bgColor:r,fgColor:a,frame:b,svgProps:C,logo:k}}function ti(t){let{size:e,numCells:n,fgPath:o,bgColor:r,fgColor:a,frame:i,svgProps:c,logo:s}=t,l=kt(i),m=s?Ur(s.settings,s.box):v(Vt,{}),u=St("svg",{height:e,viewBox:`0 0 ${n} ${n}`,width:e,xmlns:"http://www.w3.org/2000/svg",...l?{}:c,children:[v("path",{d:`M0,0 h${n}v${n}H0z`,fill:yt(r,bt),shapeRendering:"crispEdges"}),v("path",{d:o,fill:yt(a,Mt),shapeRendering:"crispEdges"}),m]});return l&&i?Br(u,{size:e,frame:i,bgColor:r,svgProps:c}):u}async function If(t){return ti(await Ja(t))}var ro={jsx:jsxRuntime.jsx,jsxs:jsxRuntime.jsxs,createElement:react.createElement,cloneElement:react.cloneElement,Fragment:react.Fragment};async function m_(t){let e=await Ja(t);return br(ro,()=>ti(e))}var Bf=16384;var ru=t=>t*3+3&-4,ei=(t,e)=>Math.floor((t*e+255*(255-e)+127)/255);function ni(t,e,n){if(!(Number.isInteger(e)&&Number.isInteger(n))||e<1||n<1||e>16384||n>16384)throw new RangeError(`BMP width and height must be whole numbers from 1 to 16384, got ${e} x ${n}`);if(t.length!==e*n*4)throw new RangeError(`Expected ${e*n*4} RGBA bytes for ${e} x ${n}, got ${t.length}`);let o=ru(e),r=o*n,a=new Uint8Array(54+r),i=new DataView(a.buffer);a[0]=66,a[1]=77,i.setUint32(2,a.length,true),i.setUint32(10,54,true),i.setUint32(14,40,true),i.setInt32(18,e,true),i.setInt32(22,n,true),i.setUint16(26,1,true),i.setUint16(28,24,true),i.setUint32(30,0,true),i.setUint32(34,r,true),i.setInt32(38,2835,true),i.setInt32(42,2835,true);for(let c=0;c<n;c++){let s=c*e*4,l=54+(n-1-c)*o;for(let m=0;m<e;m++){let u=t[s+3],f=t[s],d=t[s+1],g=t[s+2];u===255?(a[l]=g,a[l+1]=d,a[l+2]=f):(a[l]=ei(g,u),a[l+1]=ei(d,u),a[l+2]=ei(f,u)),s+=4,l+=3;}}return a}function ri(t){if(t.length<54||t[0]!==66||t[1]!==77)return false;let e=new DataView(t.buffer,t.byteOffset,t.byteLength),n=e.getInt32(18,true),o=e.getInt32(22,true);return e.getUint32(2,true)===t.length&&e.getUint32(10,true)===54&&e.getUint32(14,true)===40&&n>0&&o>0&&e.getUint16(26,true)===1&&e.getUint16(28,true)===24&&e.getUint32(30,true)===0&&t.length===54+ru(n)*o}function oo(t){let e=t.getContext("2d");if(!e)throw new Error("Could not get canvas context");let{data:n}=e.getImageData(0,0,t.width,t.height),o=ni(n,t.width,t.height);if(!ri(o))throw new Error("Could not write a BMP file");return new Blob([o],{type:"image/bmp"})}var w_=(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);},Qf=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 m=[1,.8,.6,.4,.2,.1];for(let u of m){let f=Math.floor(t.naturalWidth*e*u/s),d=Math.floor(t.naturalHeight*e*u/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 g=l.getImageData(0,0,f,d);try{let h=r(g.data,f,d);if(h?.data){a(h);return}}catch(h){console.error("QR Detection error:",h);}}catch(g){console.error("Canvas drawing error:",g);}}a(null);});}})},ou=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 Qf(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 M_(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);}var Gf=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["maskType","mask-type"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Uf=new Map([["className","class"],["tabIndex","tabindex"],["dir","dir"],["role","role"],["viewBox","viewBox"],["width","width"],["height","height"],["xlinkActuate","xlink:actuate"],["xlinkArcrole","xlink:arcrole"],["xlinkRole","xlink:role"],["xlinkShow","xlink:show"],["xlinkTitle","xlink:title"],["xlinkType","xlink:type"],["xmlBase","xml:base"],["xmlLang","xml:lang"],["xmlSpace","xml:space"]]),zf=new Set(["children","dangerouslySetInnerHTML","key","defaultValue","defaultChecked","innerHTML","suppressContentEditableWarning","suppressHydrationWarning","ref"]),qf=new Set(["inert","allowFullScreen","async","autoPlay","controls","credentialless","default","defer","disabled","disablePictureInPicture","disableRemotePlayback","formNoValidate","hidden","loop","noModule","noValidate","open","playsInline","readOnly","required","reversed","scoped","seamless","itemScope"]),Wf=new Set(["autoFocus","multiple","muted"]),Hf=new Set(["contentEditable","spellCheck","draggable","value","autoReverse","externalResourcesRequired","focusable","preserveAlpha"]),Vf=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" ")),au=":A-Z_a-z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD",jf=new RegExp(`^[${au}][${au}\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`),ao=/^[a-zA-Z][a-zA-Z:_.\-\d]*$/,Zf=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i,Xf="javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')",Yf=t=>Zf.test(t)?Xf:t,su=new Set(["area","base","br","col","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"]),Kf=/["'&<>]/;function oi(t){if(!Kf.test(t))return t;let e="",n=0;for(let o=0;o<t.length;o++){let r;switch(t.charCodeAt(o)){case 34:r="&quot;";break;case 38:r="&amp;";break;case 39:r="&#x27;";break;case 60:r="&lt;";break;case 62:r="&gt;";break;default:continue}e+=t.slice(n,o)+r,n=o+1;}return e+t.slice(n)}var ce=t=>typeof t=="function"||typeof t=="symbol",iu=new Map,Jf=t=>{let e=iu.get(t);return e===void 0&&(e=t.replace(/([A-Z])/g,"-$1").toLowerCase().replace(/^ms-/,"-ms-"),iu.set(t,e)),e};function th(t){if(typeof t=="string")return t;if(typeof t!="object"||t===null)return "";let e="";for(let n of Object.keys(t)){let o=t[n];if(o==null||typeof o=="boolean"||o==="")continue;let r;if(n.startsWith("--"))r=`${n}:${`${o}`.trim()}`;else {let a=typeof o=="number"?o===0||Vf.has(n)?`${o}`:`${o}px`:`${o}`.trim();r=`${Jf(n)}:${a}`;}e=e?`${e};${r}`:r;}return e}function vn(t,e){if(e==null||zf.has(t))return null;let n=Uf.get(t);if(n!==void 0)return ce(e)||typeof e=="boolean"?null:{name:n,value:`${e}`};switch(t){case "style":{let r=th(e);return r?{name:"style",value:r}:null}case "src":case "href":case "action":case "formAction":case "xlinkHref":return (t==="src"||t==="href")&&e===""||ce(e)||typeof e=="boolean"?null:{name:t==="xlinkHref"?"xlink:href":t,value:Yf(`${e}`)};case "capture":case "download":return e===true?{name:t,value:""}:e===false||ce(e)?null:{name:t,value:`${e}`};case "cols":case "rows":case "size":case "span":return ce(e)||Number.isNaN(Number(e))||!(e>=1)?null:{name:t,value:`${e}`};case "rowSpan":case "start":return ce(e)||Number.isNaN(Number(e))?null:{name:t,value:`${e}`};}if(Wf.has(t))return e&&!ce(e)?{name:t.toLowerCase(),value:""}:null;if(Hf.has(t))return ce(e)?null:{name:t,value:`${e}`};if(qf.has(t))return e&&!ce(e)?{name:t,value:""}:null;if(t.length>2&&(t[0]==="o"||t[0]==="O")&&(t[1]==="n"||t[1]==="N"))return null;let o=Gf.get(t)??t;if(!jf.test(o)||ce(e))return null;if(typeof e=="boolean"){let r=o.toLowerCase().slice(0,5);if(r!=="data-"&&r!=="aria-")return null}return {name:o,value:`${e}`}}var cu="http://www.w3.org/2000/svg",lu="http://www.w3.org/1999/xhtml",eh="http://www.w3.org/1999/xlink",nh="http://www.w3.org/XML/1998/namespace",rh="http://www.w3.org/2000/xmlns/";function oh(t,e,n){e==="xmlns"||e.startsWith("xmlns:")?t.setAttributeNS(rh,e,n):e.startsWith("xlink:")?t.setAttributeNS(eh,e,n):e.startsWith("xml:")?t.setAttributeNS(nh,e,n):t.setAttribute(e,n);}function lr(t,e,n,o){if(e==null||typeof e=="boolean")return;if(typeof e=="string"||typeof e=="number"||typeof e=="bigint"){t.appendChild(o.createTextNode(`${e}`));return}if(Array.isArray(e)){for(let s of e)lr(t,s,n,o);return}if(!Pe(e))throw new TypeError("qrdx: can't render this value as DOM nodes");let{type:r,props:a}=e;if(sn(r)){lr(t,a.children,n,o);return}if(typeof r=="function"){lr(t,r(a),n,o);return}if(!ao.test(r))throw new TypeError(`qrdx: invalid element name: ${r}`);let i=r==="svg"?cu:n,c=o.createElementNS(i,r);for(let s of Object.keys(a)){let l=vn(s,a[s]);l&&oh(c,l.name,l.value);}lr(c,a.children,i===cu&&r==="foreignObject"?lu:i,o),t.appendChild(c);}function ai(t,e=document){let n=e.createDocumentFragment();return lr(n,t,lu,e),n}function qe(t){if(t==null||typeof t=="boolean")return "";if(typeof t=="string")return oi(t);if(typeof t=="number"||typeof t=="bigint")return `${t}`;if(Array.isArray(t)){let e="";for(let n of t)e+=qe(n);return e}if(!Pe(t))throw new TypeError("qrdx: can't render this value as SVG markup");return ah(t)}function ah(t){let{type:e,props:n}=t;if(sn(e))return qe(n.children);if(typeof e=="function")return qe(e(n));if(!ao.test(e))throw new TypeError(`qrdx: invalid element name: ${e}`);let o=`<${e}`;for(let i of Object.keys(n)){let c=vn(i,n[i]);c&&(o+=` ${c.name}="${oi(c.value)}"`);}if(su.has(e))return `${o}/>`;let r=n.dangerouslySetInnerHTML?.__html,a=r==null?qe(n.children):`${r}`;return `${o}>${a}</${e}>`}function ii(t){return qe(cr(t))}function ih(t,e=document){return ai(cr(t),e).firstChild}var sh=16384;var si=[17,18,0,1,2,3,4,5,16,6,7,8,9,10,11,12,13,14,15],ch=8,ci=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 pu(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 m=Array.from({length:r},(h,p)=>p).sort((h,p)=>i[h]-i[p]||h-p),u=0,f=r,d=h=>u<r&&(f>=h||i[m[u]]<=i[f])?m[u++]:f++;for(let h=r;h<a;h++){let p=d(h),b=d(h);i[h]=i[p]+i[b],c[p]=h,c[b]=h;}s[a-1]=0;let g=0;for(let h=a-2;h>=0;h--){let p=s[c[h]]+1;s[h]=p,h<r&&p>g&&(g=p);}if(g<=e){for(let h=0;h<r;h++)n[o[h]]=s[h];return n}}}function lh(t,e){let n=0;for(let o=0;o<e;o++)n=n<<1|t>>o&1;return n}function gu(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]=lh(l,c),i[s]=n===1?0:c;}),{lengths:t,codes:a,emitted:i}}function We(t,e,n){t.write(e.codes[n],e.emitted[n]);}function uh(t){let e=[],n=a=>e.push({code:a,extra:0,extraBits:0}),o=ch,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 mh(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=uh(e),r=new Uint32Array(19);for(let c of o)r[c.code]=r[c.code]+1;let a=gu(pu(r,7)),i=si.length;for(;i>4&&a.lengths[si[i-1]]===0;)i--;t.write(0,1),t.write(i-4,4);for(let c=0;c<i;c++)t.write(a.lengths[si[c]],3);t.write(0,1);for(let c of o)We(t,a,c.code),t.write(c.extra,c.extraBits);}function io(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 uu(t,e,n,o){let r=0;for(;r<o&&t[e+r]===t[e+r-n];)r++;return r}function mu(t,e,n){let o=t.length,r=0;for(;r<o;){let a=Math.min(4096,o-r),i=r>=1?uu(t,r,1,a):0,c=r>=e?uu(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 du=20;function fu(t,e,n){for(let o=0;o<n.length;o++)t[e+o]=n.charCodeAt(o);}function hu(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 ui(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 M=0;M<o;M++){let S=M*4,$=t[S],C=t[S+1],R=t[S+2],E=t[S+3];E!==255&&(a=true),r[M]=(E<<24|($-C&255)<<16|C<<8|R-C&255)>>>0;}let i=new Uint32Array(280),c=new Uint32Array(256),s=new Uint32Array(256),l=new Uint32Array(256),m=new Uint32Array(40);mu(r,e,{literal(M){i[M>>>8&255]++,c[M>>>16&255]++,s[M&255]++,l[M>>>24]++;},copy(M,S){i[256+io(M).symbol]++,m[io(S).symbol]++;}});let u=[i,c,s,l,m].map(M=>pu(M,15)),[f,d,g,h,p]=u.map(gu),b=new ci(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 M of u)mh(b,M);mu(r,e,{literal(M){We(b,f,M>>>8&255),We(b,d,M>>>16&255),We(b,g,M&255),We(b,h,M>>>24);},copy(M,S){let $=io(M);We(b,f,256+$.symbol),b.write($.extra,$.extraBits);let C=io(S);We(b,p,C.symbol),b.write(C.extra,C.extraBits);}});let y=b.finish(),_=y.length+(y.length&1),w=new Uint8Array(du+_);return fu(w,0,"RIFF"),hu(w,4,w.length-8),fu(w,8,"WEBPVP8L"),hu(w,16,y.length),w.set(y,du),w}function li(t,e,n){return String.fromCharCode(...t.subarray(e,e+n))}function bu(t){return t.length>=12&&li(t,0,4)==="RIFF"&&li(t,8,4)==="WEBP"}function mi(t){if(!bu(t))return null;let e=12;for(;e+8<=t.length;){let n=li(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 dh(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 so(t,e={}){let n=e.quality!==void 0,o=n?Math.min(1,Math.max(0,Number(e.quality))):1,r=await dh(t,"image/webp",o);if(r){let s=new Uint8Array(await r.arrayBuffer()),l=mi(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=ui(i,t.width,t.height);return new Blob([c],{type:"image/webp"})}var yu=32768;async function $e(t){let e=new Uint8Array(await t.arrayBuffer()),n="";for(let o=0;o<e.length;o+=yu)n+=String.fromCharCode(...e.subarray(o,o+yu));return `data:${t.type||"application/octet-stream"};base64,${btoa(n)}`}async function Ut(t){let e={...t};if(t.imageSettings?.src)try{let m=await fh(t.imageSettings.src);e={...t,imageSettings:{...t.imageSettings,src:m}};}catch{let{imageSettings:m,...u}=t;e=u;}let{hideLogo:n,url:o,logo:r,scale:a,frameLabelMarkers:i,partMarkers:c,...s}=e,l=ii({...s,templateId:e.templateId,customTemplate:e.customTemplate});return `data:image/svg+xml,${encodeURIComponent(l)}`}var fh=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 He(t,e,n){let o=await Ut(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 m=new Image,{width:u,height:f}=oe(t.size||ut,t.frame);s.width=Math.round(u),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);m.onload=()=>{clearTimeout(d);try{if(e==="image/jpeg"&&(l.fillStyle="white",l.fillRect(0,0,s.width,s.height)),l.drawImage(m,0,0,s.width,s.height),n)i(s);else if(e==="image/webp")so(s).then($e).then(i,c).finally(()=>s.remove());else if(e==="image/bmp")$e(oo(s)).then(i,c).finally(()=>s.remove());else {let g=s.toDataURL(e,1);s.remove(),i(g);}}catch(g){clearTimeout(d),s.remove(),c(new Error(`Failed to draw SVG to canvas: ${g}`));}},m.onerror=()=>{clearTimeout(d),s.remove(),c(new Error("Could not load SVG"));},m.src=a;})}var _u=["gradientUnits","gradientTransform","spreadMethod"],hh={linear:["x1","y1","x2","y2"],radial:["cx","cy","r","fx","fy","fr"]},ph={r:0,g:0,b:0,a:1};function xu(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 di(t){return t.name==="linearGradient"?"linear":t.name==="radialGradient"?"radial":null}function gh(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=xu(o,"stop-color")??"#000000",s=lt(c==="currentColor"?"#000000":c)??ph,l=Number.parseFloat(xu(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 co(t){let e=new Map,n=r=>{let a=r.attrs.id;di(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=di(a),c={},s=[],l=new Set,m=a;for(;m&&!l.has(m);){l.add(m);let u=di(m)===i?[..._u,...hh[i]]:_u;for(let d of u){let g=m.attrs[d];c[d]===void 0&&g!==void 0&&(c[d]=g);}s.length===0&&(s=gh(m));let f=m.attrs.href??m.attrs["xlink:href"];m=f?.startsWith("#")?e.get(f.slice(1)):void 0;}o.set(r,{kind:i,attrs:c,stops:s});}return o}function fi(t){let e=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,r=Number.NEGATIVE_INFINITY,a=(u,f)=>{e=Math.min(e,u),o=Math.max(o,u),n=Math.min(n,f),r=Math.max(r,f);},i=(u,f,d,g)=>{let h=-u+3*f-3*d+g,p=2*(u-2*f+d),b=f-u;if(Math.abs(h)<1e-12)return Math.abs(p)<1e-12?[]:[-b/p];let y=p*p-4*h*b;if(y<0)return [];let _=Math.sqrt(y);return [(-p+_)/(2*h),(-p-_)/(2*h)]},c=(u,f,d,g,h)=>{let p=1-u;return p*p*p*f+3*p*p*u*d+3*p*u*u*g+u**3*h},s=0,l=0,m=[0,0];for(let u of t)if(u.op==="M"&&(m=[u.x,u.y]),u.op==="M"||u.op==="L")a(u.x,u.y),s=u.x,l=u.y;else if(u.op==="C"){a(u.x,u.y);for(let f of [...i(s,u.x1,u.x2,u.x),...i(l,u.y1,u.y2,u.y)])f>0&&f<1&&a(c(f,s,u.x1,u.x2,u.x),c(f,l,u.y1,u.y2,u.y));s=u.x,l=u.y;}else [s,l]=m;return Number.isFinite(e)?{x:e,y:n,width:o-e,height:r-n}:null}var bh=t=>t[0]*t[3]-t[1]*t[2];function Se(t){let e=bh(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(S=>S.color.a===0))return null;if(a.length===1)return i.color;let s=r.gradientUnits==="userSpaceOnUse",l=dn;if(!s){let S=fi(e);if(!S||S.width<=0||S.height<=0)return null;l=[S.width,0,0,S.height,S.x,S.y];}let m=st(l,Nt(r.gradientTransform));if(!Se(m))return c.color;let[u,f]=n,d=Math.sqrt((u*u+f*f)/2),g=(S,$)=>{let C=Number.parseFloat(S);return Number.isFinite(C)?S.trim().endsWith("%")?C/100*(s?$:1):C:null},h=(S,$,C)=>g(r[S]??$,C)??g($,C)??0;if(o==="linear"){let S=[h("x1","0%",u),h("y1","0%",f),h("x2","100%",u),h("y2","0%",f)],[$,C,R,E]=S;return $===R&&C===E?c.color:{kind:o,coords:S,matrix:m,stops:a}}let p=h("cx","50%",u),b=h("cy","50%",f),y=h("r","50%",d),_=r.fx===void 0?p:h("fx","50%",u),w=r.fy===void 0?b:h("fy","50%",f),M=Math.max(0,h("fr","0%",d));return y<0?null:y===0?c.color:{kind:o,coords:[_,w,M,p,b,y],matrix:m,stops:a}}function lo(t){return t.map(e=>x(e,6)).join(" ")}function yh(t,e){return (e==="cmyk"?pe(t.r,t.g,t.b):[t.r/255,t.g/255,t.b/255]).map(o=>x(o,4)).join(" ")}var $u=(t,e)=>`<< /FunctionType 2 /Domain [0 1] /C0 [${t}] /C1 [${e}] /N 1 >>`;function _h(t,e){let n=[],o=t.map(c=>j(c.offset,4)),r=t.map(c=>yh(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 $u(c.c0,c.c1)}return ["<< /FunctionType 3 /Domain [0 1]",`/Functions [${n.map(c=>$u(c.c0,c.c1)).join(" ")}]`,`/Bounds [${n.slice(1).map(c=>x(c.from,4)).join(" ")}]`,`/Encode [${n.map(()=>"0 1").join(" ")}] >>`].join(" ")}function uo(t,e){return [`<< /ShadingType ${t.kind==="linear"?2:3}`,`/ColorSpace /Device${e==="cmyk"?"CMYK":"RGB"}`,`/Coords [${t.coords.map(n=>x(n,6)).join(" ")}]`,`/Function ${_h(t.stops,e)}`,"/Extend [true true] >>"].join(" ")}function xh(t,e){if(t.op==="Z")return t;if(t.op==="C"){let[r,a]=W(e,t.x1,t.y1),[i,c]=W(e,t.x2,t.y2),[s,l]=W(e,t.x,t.y);return {op:"C",x1:r,y1:a,x2:i,y2:c,x:s,y:l}}let[n,o]=W(e,t.x,t.y);return {op:t.op,x:n,y:o}}var wu={r:255,g:255,b:255,a:1},$h=/^url\(\s*#bg-color-/,mo=/^url\(\s*#([^)\s]+)\s*\)/,Sh=new Set(["defs","clipPath","mask","pattern","linearGradient","radialGradient","symbol","title","desc","metadata","style","script","use","foreignObject"]);function Y(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 H(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 ur(t,e){if((t.name==="linearGradient"||t.name==="radialGradient")&&t.attrs.id){let n=t.children.find(r=>r.name==="stop"),o=n&&(Y(n,"stop-color")??"#000000");o&&e.set(t.attrs.id,o);}for(let n of t.children)ur(n,e);return e}function mr(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)mr(n,e);return e}function fo(t){return /^data:image\/png[;,]/i.test(t)?"PNG":/^data:image\/jpe?g[;,]/i.test(t)?"JPEG":null}async function ho(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 Mu(t,e,n){let o={x:H(t.attrs.x,e[0]),y:H(t.attrs.y,e[1]),width:H(t.attrs.width,e[0]),height:H(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,m=n.height*s,u=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)*u("x"),y:o.y+(o.height-m)*u("y"),width:l,height:m},clip:c?o:null}}function Cu(t,e){t.name==="clipPath"&&t.attrs.id&&e.set(t.attrs.id,t);for(let n of t.children)Cu(n,e);return e}function Ru(t,e){t.name==="pattern"&&t.attrs.id&&e.set(t.attrs.id,t);for(let n of t.children)Ru(n,e);return e}function wh(t,e){let[n,o]=e,r=(a,i)=>H(t.attrs[a],i);switch(t.name){case "path":return ee(t.attrs.d??"");case "rect":{let a=t.attrs.rx??t.attrs.ry,i=t.attrs.ry??t.attrs.rx;return Yt(r("x",n),r("y",o),r("width",n),r("height",o),H(a,n),H(i,o))}case "circle":{let a=r("r",Math.hypot(n,o)/Math.SQRT2);return Xt(r("cx",n),r("cy",o),a,a)}case "ellipse":return Xt(r("cx",n),r("cy",o),r("rx",n),r("ry",o));default:return []}}var Ln=class{gradients;shadings;clipPaths=new Map;patterns=new Map;backdrop=wu;paper=wu;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=mo.exec(e);if(n)return this.resolveColor(this.gradients.get(n[1]));let o=lt(e==="currentColor"?"#000000":e);return o&&o.a>0?o:null}shadedGradient(e){let n=e?mo.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 m={...l,a:l.a*r};return m.a>0?{color:m}: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?mo.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 Kr(e,this.onPaper||o?this.paper:this.backdrop)}paintPattern(e,n,o,r){let a=fi(e);if(!a||a.width<=0||a.height<=0)return true;let[i,c]=n.viewport,s=H(o.attrs.x,i),l=H(o.attrs.y,c),m=H(o.attrs.width,i),u=H(o.attrs.height,c);if(!(m>0&&u>0))return true;let f=Nt(o.attrs.patternTransform),d=Se(f);if(!d)return true;if(!this.beginClip(e,n.matrix,n.fillRule==="evenodd"))return false;let g=this.inConic;this.inConic=o.attrs["data-qrdx-conic"]!==void 0;try{let h=[W(d,a.x,a.y),W(d,a.x+a.width,a.y),W(d,a.x,a.y+a.height),W(d,a.x+a.width,a.y+a.height)],p=h.map(([F])=>F),b=h.map(([,F])=>F),y=Math.min(...p),_=Math.max(...p),w=Math.min(...b),M=Math.max(...b),S=Math.floor((y-s)/m),$=Math.ceil((_-s)/m)-1,C=Math.floor((w-l)/u),R=Math.ceil((M-l)/u)-1,E=($-S+1)*(R-C+1);if(E>4096)return !0;let P=(o.attrs["data-qrdx-conic"]??"").trim().split(/\s+/).map(Number),L=st(n.matrix,f);for(let F=C;F<=R;F++)for(let k=S;k<=$;k++){let N=s+k*m,I=l+F*u,B=st(L,[1,0,0,1,N,I]),q={x:y-N,y:w-I,width:_-y,height:M-w},O=P.length===2&&P.every(Number.isFinite)?Wl(P[0],P[1],q):null,G=E>1&&this.beginClip([{op:"M",x:0,y:0},{op:"L",x:m,y:0},{op:"L",x:m,y:u},{op:"L",x:0,y:u},{op:"Z"}],B,!1);try{let J={matrix:B,viewport:n.viewport,fill:"#000000",fillRule:"nonzero",stroke:"none",strokeWidth:1,fontSize:16,fontWeight:"normal",textAnchor:"start",fillOpacity:1,opacity:r},pt=(at,T)=>{for(let U of at){if(U.name==="g"&&!U.attrs.transform){let z=Number.parseFloat(U.attrs.opacity??"1");pt(U.children,{...T,opacity:(T.opacity??1)*(Number.isFinite(z)?z:1)});continue}if(O&&U.attrs["data-arc"]){let[z,wt]=U.attrs["data-arc"].split(/\s+/).map(Number);if(!Hl([z,z+wt],O))continue}this.walk(U,T);}};pt(o.children,J);}finally{G&&this.endClip();}}}finally{this.inConic=g,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:st(n.matrix,Nt(e.attrs.transform))}),c=Se(a);if(!c)return false;let[s,l,m,u]=r,d=[[s,l],[m,l],[m,u],[s,u]].map(([g,h])=>W(c,g,h)).map(([g,h],p)=>({op:p===0?"M":"L",x:g,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=Y(e,"clip-path"),r=o?mo.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=wh(s,n.viewport);if(l.length===0)continue;let m=Nt(s.attrs.transform),u=m[0]===1&&m[1]===0&&m[2]===0&&m[3]===1&&m[4]===0&&m[5]===0;i.push(...u?l:l.map(f=>xh(f,m))),c||=Y(s,"clip-rule")==="evenodd";}return i.length>0?{segments:i,matrix:n.matrix,evenOdd:c}:null}viewportMatrix(e,n){let o=H(e.attrs.x,n.viewport[0]),r=H(e.attrs.y,n.viewport[1]),a=H(e.attrs.width,n.viewport[0],n.viewport[0]),i=H(e.attrs.height,n.viewport[1],n.viewport[1]),c=Zt(e.attrs.viewBox);if(c.length!==4||!(c[2]&&c[3]))return [st(n.matrix,[1,0,0,1,o,r]),[a,i]];let[s,l,m,u]=c,f=a/m,d=i/u,g=o,h=r;if((e.attrs.preserveAspectRatio??"").trim()!=="none"){let p=e.attrs.preserveAspectRatio?.includes("slice")?Math.max(f,d):Math.min(f,d);g+=(a-m*p)/2,h+=(i-u*p)/2,f=p,d=p;}return [st(n.matrix,[f,0,0,d,g-s*f,h-l*d]),[m,u]]}walk(e,n,o=false){if(o&&(this.clipPaths=Cu(e,new Map),this.patterns=Ru(e,new Map)),Sh.has(e.name)||Y(e,"display")==="none"||Y(e,"visibility")==="hidden")return;let r=st(n.matrix,Nt(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=Y(e,"font-size"),c=Number.parseFloat(Y(e,"opacity")??"1"),s=Y(e,"fill-opacity"),l=s===void 0?n.fillOpacity??1:Number.parseFloat(s),m={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:Y(e,"fill")??n.fill,fillRule:Y(e,"fill-rule")??n.fillRule,stroke:Y(e,"stroke")??n.stroke,strokeWidth:Y(e,"stroke-width")===void 0?n.strokeWidth:H(Y(e,"stroke-width"),a[0],1),fontSize:i===void 0?n.fontSize:H(i,16,16),fontWeight:Y(e,"font-weight")??n.fontWeight,textAnchor:Y(e,"text-anchor")??n.textAnchor},u=this.onPaper;(e.name==="rect"||e.name==="circle"||e.name==="path")&&$h.test(Y(e,"fill")??"")&&(this.onPaper=true);try{let f=e.attrs["clip-path"]?this.clipOf(e,m):null;if(f&&this.beginClip(f.segments,f.matrix,f.evenOdd)){try{this.paintNode(e,m);}finally{this.endClip();}return}this.paintNode(e,m);}finally{this.onPaper=u;}}paintNode(e,n){let[o,r]=n.viewport,a=(i,c)=>H(e.attrs[i],c);switch(e.name){case "path":this.paint(ee(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(Yt(a("x",o),a("y",r),a("width",o),a("height",r),H(i,o),H(c,r)),e,n);return}case "circle":{let i=a("r",Math.hypot(o,r)/Math.SQRT2);this.paint(Xt(a("cx",o),a("cy",r),i,i),e,n);return}case "ellipse":this.paint(Xt(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=Zt(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 po=1e3;async function dr(t){let e=await Ut(Ve({...t,size:t.size??ut},po));return decodeURIComponent(e.replace("data:image/svg+xml,",""))}function hi(t){if(kt(t.frame)){let e=Oe(po,t.frame);return e.squareEdges?e.color:null}return yt(t.bgColor,bt)}function go(t,e){let n=hi(t);if(!(n&&wn(t.bgColor))||kt(t.frame)||t.templateId||t.customTemplate)return n;let o=de(e)?.children.find(a=>a.name==="rect"),r=o&&Y(o,"fill");return r?.startsWith("url(")?r:n}function bo(t,e){let n={r:255,g:255,b:255,a:1},o=lt(yt(e.bgColor,bt));t.paper=n,t.background=o&&!wn(e.bgColor)?o:null,t.backdrop=o?Kr(o,n):n;}var yo=25.4,Eu=5,Au=2e3,le=po,pi=5,Pu=2,Ch=.25*(yo/72);function Rh(t,e="mm"){return e==="in"?t*yo:t}function Eh(t){let e=Tt(t),n=gt.QrCode.encodeText(t.value,Rt[e]).size;return n+At(n,t.margin??dt,t.shape)*2}function _o(t,e){let n=Rh(e.size,e.unit);if(!Number.isFinite(n)||n<Eu||n>Au)throw new Error(`Print size must be between ${Eu} mm and ${Au/1e3} m`);let o=Math.min(Math.max(e.bleed??0,0),20),r=n/le,a=kt(t.frame)?Oe(le,t.frame):null,i=(a?.width??le)*r,c=(a?.height??le)*r,s=e.cropMarks?o+Pu+pi+1:o,l=Eh(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 gi=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}`);});}},bi=class extends Ln{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]=pe(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]=W(n,r.x,r.y);this.pdf.moveTo(a,i),o=true;}else if(r.op==="L"){let[a,i]=W(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]=W(n,r.x1,r.y1),[c,s]=W(n,r.x2,r.y2),[l,m]=W(n,r.x,r.y);this.pdf.curveTo(a,i,c,s,l,m);}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=st(i,st(n.matrix,o.matrix));if(!(this.shadingResources&&Se(c)))return;let s=this.shadingResources.name(uo(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(`${lo(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:u,alpha:f}=this.opaqueGradient(a.gradient,a.alpha);this.withAlpha(f,1,()=>this.shade(e,o,u));}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 m=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*fn(o.matrix))),this.tracePath(e,o.matrix),c&&l?m?this.pdf.fillStrokeEvenOdd():this.pdf.fillStroke():c?m?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=fn(n.matrix),[i,c]=W(n.matrix,H(e.attrs.x,n.viewport[0]),H(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/yo);this.pdf.setFontSize(l);let m=Number.parseFloat(e.attrs["data-max-width"]??"");if(m>0){let d=m*a,g=this.pdf.getTextWidth(o);g>d&&(l*=d/g,this.pdf.setFontSize(l));}this.setColor("text",r);let u=Math.atan2(n.matrix[1],n.matrix[0]);if(Math.abs(u)>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(u),c-d*Math.sin(u),{angle:-u*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&&(fo(o)?o:this.images.get(o)),a=r&&fo(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 p=this.pdf.getImageProperties(r);c={width:p.width,height:p.height};}catch{c=null;}let s=Mu(e,n.viewport,c);if(!s)return;let{draw:l,clip:m}=s,[u,f]=W(n.matrix,l.x,l.y),[d,g]=W(n.matrix,l.x+l.width,l.y+l.height),h=m!==null&&this.beginClip([{op:"M",x:m.x,y:m.y},{op:"L",x:m.x+m.width,y:m.y},{op:"L",x:m.x+m.width,y:m.y+m.height},{op:"L",x:m.x,y:m.y+m.height},{op:"Z"}],n.matrix,false);try{this.withAlpha(n.opacity??1,1,()=>{this.pdf.addImage(r,a,Math.min(u,d),Math.min(f,g),Math.abs(d-u),Math.abs(g-f),i);});}finally{h&&this.endClip();}}};function Ah(t,e,n){let{trimX:o,trimY:r,trimWidth:a,trimHeight:i,bleed:c}=n,s=c+Pu,l=o,m=o+a,u=r,f=r+i;e.setRegistrationColor(),t.setLineWidth(Ch);for(let d of [l,m]){let g=d===l?-1:1;for(let h of [u,f]){let p=h===u?-1:1;t.line(d+g*s,h,d+g*(s+pi),h),t.line(d,h+p*s,d,h+p*(s+pi));}}}async function Ph(t,e){return (await vu(t,e)).output("dataurlstring")}async function C5(t,e){return (await vu(t,e)).output("arraybuffer")}async function vu(t,e){let n=_o(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 dr(t),a=de(r);if(!a)throw new Error("Failed to render the QR code for printing");let i=new Map;for(let b of mr(a,new Set))if(!fo(b)){let y=await ho(b);y&&i.set(b,y);}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=co(a),l=s.size>0?gi.attach(c):null,m=new bi(c,e.colorMode==="cmyk",ur(a,new Map),l?{gradients:s,resources:l}:null,i);bo(m,t);let u=n.codeWidth/le,f=H(a.attrs.width,le,le),d=H(a.attrs.height,le,le),g={matrix:st([1,0,0,1,n.trimX,n.trimY],[u,0,0,u,0,0]),viewport:[f,d],fill:"#000000",fillRule:"nonzero",stroke:"none",strokeWidth:1,fontSize:16,fontWeight:"normal",textAnchor:"start"},h=n.bleed>0?go(t,r):null,p=[n.trimX-n.bleed,n.trimY-n.bleed,n.trimX+n.trimWidth+n.bleed,n.trimY+n.trimHeight+n.bleed];if(!(h&&m.paintBleed(a,g,h,p))){let b=h?m.resolveColor(h):null;b&&(m.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 m.walk(a,g,true),e.cropMarks&&Ah(c,m,n),c}async function vh(t,e){let n=_o(t,{size:e.size,unit:e.unit}),o=await dr(t),r=e.unit??"mm",a=s=>`${x(r==="in"?s/yo: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 R5(t,e){let n=await Ph(t,e);zt(n,e.filename??"qr-code-print.pdf");}async function E5(t,e){let n=await vh(t,e);zt(`data:image/svg+xml;charset=utf-8,${encodeURIComponent(n)}`,e.filename??"qr-code-print.svg");}var Lh=[137,80,78,71,13,10,26,10];async function Fu(t,e){let n=new Blob([t]).stream().pipeThrough(e);return new Uint8Array(await new Response(n).arrayBuffer())}async function Iu(t){return typeof CompressionStream>"u"?null:await Fu(t,new CompressionStream("deflate"))}async function Fh(t){if(typeof DecompressionStream>"u")return null;try{return await Fu(t,new DecompressionStream("deflate"))}catch{return null}}var yi=(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 Ih(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(Lh.some((h,p)=>t[p]!==h))return null;let e=8,n=0,o=0,r=-1,a=null,i=null,c=[];for(;e+8<=t.length;){let h=yi(t,e),p=String.fromCharCode(...t.subarray(e+4,e+8)),b=t.subarray(e+8,e+8+h);if(e+=12+h,p==="IHDR"){n=yi(b,0),o=yi(b,4);let y=b[8];r=b[9];let _=b[12];if(y!==8||_!==0||!(r in Lu))return null}else if(p==="PLTE")a=b;else if(p==="tRNS")i=b;else if(p==="IDAT")c.push(b);else if(p==="IEND")break}if(!(n&&o)||n*o>4096*4096)return null;let s=new Uint8Array(c.reduce((h,p)=>h+p.length,0)),l=0;for(let h of c)s.set(h,l),l+=h.length;let m=await Fh(s),u=Lu[r],f=n*u;if(!m||m.length<o*(f+1))return null;let d=new Uint8Array(o*f);for(let h=0;h<o;h++){let p=m[h*(f+1)],b=m.subarray(h*(f+1)+1,(h+1)*(f+1)),y=h*f;for(let _=0;_<f;_++){let w=_>=u?d[y+_-u]:0,M=h>0?d[y-f+_]:0,S=h>0&&_>=u?d[y-f+_-u]:0,$=b[_],C=0;p===1?C=w:p===2?C=M:p===3?C=w+M>>1:p===4&&(C=Ih(w,M,S)),d[y+_]=$+C&255;}}let g=new Uint8Array(n*o*4);for(let h=0;h<n*o;h++){let p=h*4,b=h*u;if(r===3){let y=d[b];g[p]=a?.[y*3]??0,g[p+1]=a?.[y*3+1]??0,g[p+2]=a?.[y*3+2]??0,g[p+3]=i?.[y]??255;}else if(r===0||r===4){let y=d[b];g[p]=y,g[p+1]=y,g[p+2]=y,g[p+3]=r===4?d[b+1]:255;}else g[p]=d[b],g[p+1]=d[b+1],g[p+2]=d[b+2],g[p+3]=r===6?d[b+3]:255;}return {width:n,height:o,data:g}}var kh=25.4,ku=72/kh,Th=50;function Nh(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 Oh(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 Dh(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,m=r[s*4]*l+255*(1-l),u=r[s*4+1]*l+255*(1-l),f=r[s*4+2]*l+255*(1-l);if(e){let[d,g,h,p]=pe(m,u,f);i.set([d*255,g*255,h*255,p*255].map(Math.round),s*a);}else i.set([Math.round(m),Math.round(u),Math.round(f)],s*a);}let c=await Iu(i);return {kind:"raw",width:n,height:o,components:a,bytes:c??i,compressed:!!c}}async function Bh(t,e){let n=t;if(!/^data:image\/(png|jpe?g)[;,]/i.test(n)){let i=await ho(n);if(!i)return null;n=i;}let o=Nh(n);if(!o)return null;let r=Oh(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 Dh(a,e):null}function Qh(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 Gh=`/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 gi(t){let e="(";for(let n of t){let o=n.codePointAt(0)??63;n==="("||n===")"||n==="\\"?e+=`\\${n}`:n==="\u2026"?e+="...":o>=32&&o<127?e+=n:o>=160&&o<=255?e+=`\\${o.toString(8).padStart(3,"0")}`:e+="?";}return `${e})`}var bi=class extends vn{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]=pe(e.r,e.g,e.b);return `${x(n)} ${x(o)} ${x(r)} ${x(a)} cmyk`}return `${x(e.r/255)} ${x(e.g/255)} ${x(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]=W(n,a.x,a.y);o.push(`${x(i)} ${x(c)} m`),r=true;}else if(a.op==="L"){let[i,c]=W(n,a.x,a.y);o.push(`${x(i)} ${x(c)} l`);}else if(a.op==="C"){if(!r)continue;let[i,c]=W(n,a.x1,a.y1),[s,l]=W(n,a.x2,a.y2),[m,u]=W(n,a.x,a.y);o.push(`${x(i)} ${x(c)} ${x(s)} ${x(l)} ${x(m)} ${x(u)} 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 ${x(n)} ${x(o)} m ${x(n+r)} ${x(o)} l ${x(n+r)} ${x(o+a)} l ${x(n)} ${x(o+a)} l h f`);}shade(e,n,o){let r=st(n.matrix,o.matrix);if(!$e(r))return;let a=lo(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 [${co(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(u=>({...u,color:this.flatten({...u.color,a:u.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),m=o.fillRule==="evenodd"?"ef":"f";i&&s?this.out.push(`gsave ${this.color(i)} ${l} ${m} grestore`):i&&this.out.push(`${this.color(i)} ${l} ${m}`),s&&this.out.push(`${this.color(s)} ${x(o.strokeWidth*mn(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=mn(n.matrix),[i,c]=W(n.matrix,H(e.attrs.x,n.viewport[0]),H(e.attrs.y,n.viewport[1])),l=n.fontWeight==="bold"||Number.parseInt(n.fontWeight,10)>=600?"/QRDX-Bold":"/QRDX-Regular",m=x(n.fontSize*a),u=Number.parseFloat(e.attrs["data-max-width"]??""),f=u>0?` dup stringwidth pop dup ${x(u*a)} gt {${x(u*a)} exch div ${m} 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":"",g=Math.atan2(n.matrix[1],n.matrix[0])*180/Math.PI;if(Math.abs(g)>.01){this.out.push(`gsave ${this.color(r)} ${l} findfont ${m} scalefont setfont ${x(i)} ${x(c)} translate ${x(g)} rotate ${gi(o)}${f} 0 0 moveto${d} show grestore`);return}this.out.push(`gsave ${this.color(r)} ${l} findfont ${m} scalefont setfont ${gi(o)}${f} ${x(i)} ${x(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=H(e.attrs.x,n.viewport[0]),i=H(e.attrs.y,n.viewport[1]),c=H(e.attrs.width,n.viewport[0]),s=H(e.attrs.height,n.viewport[1]);if(c<=0||s<=0)return;let[l,m]=W(n.matrix,a,i),[u,f]=W(n.matrix,a+c,i+s),{components:d}=r,g=d===1?"/DeviceGray":d===4?"/DeviceCMYK":"/DeviceRGB",h=Array.from({length:d},()=>"0 1").join(" "),p="/ASCII85Decode filter";r.kind==="jpeg"?(p+=" /DCTDecode filter",r.progressive&&(this.usesLevel3=true)):r.compressed&&(p+=" /FlateDecode filter",this.usesLevel3=true),this.out.push(["gsave",`${x(Math.min(l,u))} ${x(Math.min(m,f))} translate ${x(Math.abs(u-l))} ${x(Math.abs(f-m))} scale`,`${g} 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 ${p} >> image`,kh(r.bytes),"grestore"].join(`
25
- `));}};async function vu(t,e={}){let n=de(t);if(!n)throw new Error("Could not read the SVG to convert to EPS");let o=H(n.attrs.width,0,0)||512,r=H(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,m=c+2*s,u=e.colorMode==="cmyk",f=new Map;for(let y of mr(n,new Set)){let _=await Fh(y,u);_&&f.set(y,_);}let d=new bi(u,ur(n,new Map),so(n),f);go(d,{bgColor:e.background??"#ffffff"});let h={matrix:st([1,0,0,-1,s,m-s],[i,0,0,i,0,0]),viewport:[o,r],fill:"#000000",fillRule:"nonzero",stroke:"none",strokeWidth:1,fontSize:16,fontWeight:"normal",textAnchor:"start"},p=s>0?e.bleedColor??void 0:void 0;if(!(p&&d.paintBleed(n,h,p,[0,0,l,m]))){let y=p?d.resolveColor(p):null;y&&d.rect(y,0,0,l,m);}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(m)}`,`%%HiResBoundingBox: 0 0 ${x(l)} ${x(m)}`,`%%Title: ${gi(b)}`,"%%Creator: qrdx",`%%LanguageLevel: ${d.usesLevel3?3:2}`,"%%DocumentData: Clean7Bit","%%EndComments","%%BeginProlog",Ih,"%%EndProlog","qrdxdict begin",...Array.from(d.shadingNames,([y,_])=>`/${_} ${y} def`),"gsave",...d.out,"grestore","end","showpage","%%Trailer","%%EOF",""].join(`
26
- `)}var Lu="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 Fu(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 _o(t,e={}){if(Fu(t))throw new Error(Lu);let n=yo(t,{size:e.sizeMm??Ah,unit:"mm",bleed:e.bleedMm}),o=await dr(t);return await vu(o,{width:n.trimWidth*Pu,bleed:n.bleed*Pu,bleedColor:n.bleed>0?po(t,o):ui(t),colorMode:e.colorMode,background:yt(t.bgColor,bt)})}function xo(t){return `data:application/postscript;base64,${btoa(t)}`}async function Th(t,e={}){let n=await _o(t,e);Kt(xo(n),e.filename??"qr-code-print.eps");}var yi={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}},N5={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 _i(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 We(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 Kt(t,e){let n=document.createElement("a");n.href=t,n.download=e,document.body.appendChild(n),n.click(),document.body.removeChild(n);}var ku=t=>(yi[t]??yi.png).mimeType;function Nh(t,e,n){let{extension:o,vector:r}=yi[t];if(r)return `qr-code.${o}`;let{width:a,height:i}=oe(e.width,n);return `qr-code-${Math.round(a)}x${Math.round(i)}.${o}`}async function Iu(t,e={}){let n=await Pn(t,"image/webp",true);try{return await io(n,e)}finally{n.remove();}}var Oh=25.4/72;async function Tu(t){let e=await _o(t,{sizeMm:(t.size??ut)*Oh});return xo(e)}async function Nu(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 Ut(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}=oe(t.size||ut,t.frame),c=await new Promise((f,d)=>{let g=new Image,h=document.createElement("canvas");h.width=Math.round(a),h.height=Math.round(i);let p=h.getContext("2d");if(!p){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);g.onload=()=>{clearTimeout(b);try{p.drawImage(g,0,0,h.width,h.height),f(h);}catch(y){clearTimeout(b),h.remove(),d(new Error(`Failed to draw image to canvas: ${y}`));}},g.onerror=()=>{clearTimeout(b),h.remove(),d(new Error("Could not load SVG for PDF conversion"));},g.src=r;}),s=c.toDataURL("image/png",1),l=a*.264583,m=i*.264583,u=new e({orientation:l>m?"landscape":"portrait",unit:"mm",format:[l,m]});return u.addImage(s,"PNG",0,0,l,m),c.remove(),u.output("dataurlstring")}async function O5(t,e){let{format:n,size:o,filename:r,quality:a}=e,i=_i(o.width,o.height);if(!i.isValid)throw new Error(i.error);let c=We(t,o.width),s=r||Nh(n,o,t.frame);try{if(n==="svg"){let l=await Ut(c);Kt(l,s);}else if(n==="pdf"){let l=await Nu(c);Kt(l,s);}else if(n==="eps")Kt(await Tu(c),s);else if(n==="webp"){let l=await Iu(c,{quality:a});Kt(await lr(l),s);}else {let l=ku(n),m=await Pn(c,l);if(typeof m=="string")Kt(m,s);else throw new Error("Failed to generate image data URL")}}catch(l){throw console.error(`Error downloading ${n.toUpperCase()}:`,l),l}}async function D5(t,e,n,o={}){let r=_i(n.width,n.height);if(!r.isValid)throw new Error(r.error);let a=We(t,n.width);if(e==="svg")return await Ut(a);if(e==="pdf")return await Nu(a);if(e==="eps")return await Tu(a);if(e==="webp")return await lr(await Iu(a,o));let i=ku(e),c=await Pn(a,i);if(typeof c=="string")return c;throw new Error("Failed to generate QR code data URL")}async function B5(t,e={width:ut,height:ut}){try{let n=_i(e.width,e.height);if(!n.isValid)throw new Error(n.error);let o=We(t,e.width),r=Pn(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 Q5(t){let e=await Ut(t);return decodeURIComponent(e.replace("data:image/svg+xml,",""))}var Ft={maxBytes:2e5,maxElements:500,maxDepth:16,maxInputSegments:4e3,maxColors:8,artboardSide:1e3,decimals:1,padding:.06},nt=class extends Error{},Dh={script:t=>`Removed ${ht(t,"script")}`,style:t=>`Removed ${ht(t,"style sheet")}: colors set with CSS classes are lost. Export with presentation attributes (Illustrator: Styling \u2192 Presentation Attributes)`,"foreign-object":t=>`Removed ${ht(t,"foreignObject element")}`,image:t=>`Removed ${ht(t,"image")}: frames are vector shapes only`,use:t=>`Removed ${ht(t,"<use> reference")}: ungroup or detach symbols before exporting`,text:t=>`Removed ${ht(t,"text element")}: add text as labels in the frame editor`,effects:t=>`Removed ${ht(t,"filter, mask, clip path or pattern")}`,animation:t=>`Removed ${ht(t,"animation")}`,unknown:t=>`Removed ${ht(t,"unsupported element")}`,"nested-svg":t=>`Removed ${ht(t,"nested <svg>")}: flatten it first`,handlers:t=>`Removed ${ht(t,"event handler attribute")}`,links:t=>`Removed ${ht(t,"link")} (href)`,"external-paint":t=>`Removed ${ht(t,"fill or stroke")} that referenced something outside the file`,gradient:t=>`Flattened ${ht(t,"gradient")} to its first color: add gradients in the frame editor`,opacity:t=>`Made ${ht(t,"semi-transparent shape")} opaque (print files have no transparency)`,"invalid-paint":t=>`${ht(t,"color")} couldn't be read and fell back to the parent color`,stroke:t=>`Removed ${ht(t,"stroke")} on paths, polygons or polylines: outline strokes before exporting (Figma: Outline stroke)`,dash:t=>`Drew ${ht(t,"dashed stroke")} as solid`,clipped:t=>`Cut ${ht(t,"shape")} at the edge of the artboard`,outside:t=>`Removed ${ht(t,"shape")} outside the artboard`,colors:t=>`Merged ${ht(t,"color")} with similar ones (${Ft.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 ht(t,e){return `${t} ${e}${t===1?"":"s"}`}var wi=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:Dh[e](n)}))}},Bh=/^\s*<\?xml\s[^?>]*\?>/,xi=/[A-Za-z_][\w:.-]*/y,$i=/<\/([A-Za-z_][\w:.-]*)\s*>/y,$o=/\s*/y,Qh=/[A-Za-z_:][\w:.-]*/y,Gh=/[^"<]*/y,Uh=/[^'<]*/y;function Ln(t,e,n){return t.lastIndex=n,t.test(e)?t.lastIndex:n}function Ou(t,e){let n=Ln($o,t,e),o=Ln(Qh,t,n);if(n===e||o===n)return -1;let r=Ln($o,t,o);if(t[r]!=="=")return -1;let a=Ln($o,t,r+1),i=t[a];if(i!=='"'&&i!=="'")return -1;let s=Ln(i==='"'?Gh:Uh,t,a+1);return t[s]===i?s+1:-1}function zh(t,e){let n=Ln($o,t,e);return t[n]===">"?{end:n+1,selfClosing:false}:t.startsWith("/>",n)?{end:n+2,selfClosing:true}:null}function qh(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 nt("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 nt("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 nt("The SVG has an unclosed declaration");r=l+2;continue}if(t.startsWith("<!",r))throw new nt("DOCTYPE and other declarations are not allowed");if(t[r+1]==="/"){$i.lastIndex=r;let l=$i.exec(t);if(!l)throw new nt("The SVG has a malformed closing tag");if(e.pop()!==l[1])throw new nt(`The SVG closes <${l[1]}> out of order`);r=$i.lastIndex;continue}xi.lastIndex=r+1;let i=xi.exec(t);if(!i)throw new nt("The SVG has a malformed tag");let c=xi.lastIndex;for(let l=Ou(t,c);l>=0;l=Ou(t,c))c=l;let s=zh(t,c);if(!s)throw new nt(`The SVG has a malformed <${i[0]}> tag (attributes must be quoted and may not contain "<")`);if(n++,n>Ft.maxElements)throw new nt(`The SVG has more than ${Ft.maxElements} elements`);if(o||(o=i[0]),!s.selfClosing&&(e.push(i[0]),e.length>Ft.maxDepth))throw new nt(`The SVG nests elements more than ${Ft.maxDepth} deep`);r=s.end;}if(e.length>0)throw new nt(`The SVG doesn't close <${e.at(-1)}>`);return o}function Wh(t){if(typeof t!="string")throw new nt("Expected SVG markup as a string");let e=new TextEncoder().encode(t).length;if(e>Ft.maxBytes)throw new nt(`The SVG is ${Math.ceil(e/1e3)} KB; the limit is ${Ft.maxBytes/1e3} KB`);if(/<!(?:DOCTYPE|ENTITY|ATTLIST|ELEMENT|NOTATION)/i.test(t))throw new nt("DOCTYPE and entity declarations are not allowed");let n=t.replace(Bh,"");if(n.includes("<?"))throw new nt("Processing instructions (such as xml-stylesheet) are not allowed");if(qh(n)!=="svg")throw new nt("The file must start with an <svg> element");return n}var Si=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 Ci(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"),Ci(c,e,n,o)):(o.add("external-paint"),null)}let a=lt(r==="currentColor"?e.color:r);return a?a.a<=0?null:`#${Si(a.r)}${Si(a.g)}${Si(a.b)}`:(o.add("invalid-paint"),null)}function Hh(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(Y(i,"stop-color"));c&&o.set(r,c);}return o}function Du(t,e){return t.map(n=>{if(n.op==="Z")return n;if(n.op==="C"){let[a,i]=W(e,n.x1,n.y1),[c,s]=W(e,n.x2,n.y2),[l,m]=W(e,n.x,n.y);return {op:"C",x1:a,y1:i,x2:c,y2:s,x:l,y:m}}let[o,r]=W(e,n.x,n.y);return {op:n.op,x:o,y:r}})}function Vh(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 Ri(t){return t.length<3?[]:[...t.map(([e,n],o)=>({op:o===0?"M":"L",x:e,y:n})),{op:"Z"}]}var Se=t=>Number.isFinite(t);function ct(t,e,n=0){let o=Number.parseFloat(t.attrs[e]??"");return Se(o)?o:n}function Bu(t){switch(t.name){case "path":return ee(t.attrs.d??"");case "rect":{let e=t.attrs.rx??t.attrs.ry,n=t.attrs.ry??t.attrs.rx;return Zt(ct(t,"x"),ct(t,"y"),ct(t,"width"),ct(t,"height"),Number.parseFloat(e??"0")||0,Number.parseFloat(n??"0")||0)}case "circle":{let e=ct(t,"r");return Xt(ct(t,"cx"),ct(t,"cy"),e,e)}case "ellipse":return Xt(ct(t,"cx"),ct(t,"cy"),ct(t,"rx"),ct(t,"ry"));case "polygon":case "polyline":{let e=jt(t.attrs.points),n=[];for(let o=0;o+1<e.length;o+=2)n.push([e[o],e[o+1]]);return Ri(n)}default:return []}}function jh(t,e){let n=e/2;switch(t.name){case "rect":{let o=ct(t,"x"),r=ct(t,"y"),a=ct(t,"width"),i=ct(t,"height"),c=Number.parseFloat(t.attrs.rx??t.attrs.ry??"0")||0,s=Zt(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,...Zt(o+n,r+n,a-e,i-e,l,l)]}case "circle":case "ellipse":{let o=ct(t,"cx"),r=ct(t,"cy"),a=t.name==="circle"?ct(t,"r"):ct(t,"rx"),i=t.name==="circle"?ct(t,"r"):ct(t,"ry"),c=Xt(o,r,a+n,i+n);return a<=n||i<=n?c:[...c,...Xt(o,r,a-n,i-n)]}case "line":{let[o,r,a,i]=["x1","y1","x2","y2"].map(u=>ct(t,u)),c=Math.hypot(a-o,i-r);if(c===0)return [];let s=-(i-r)/c*n,l=(a-o)/c*n,m=[[o+s,r+l],[a+s,i+l],[a-s,i-l],[o-s,r-l]];return Ri(Vh(m)<0?m.reverse():m)}default:return null}}var Xh=new Set(["path","rect","circle","ellipse","polygon","polyline","line"]),Zh=new Set(["defs","linearGradient","radialGradient","stop","title","desc","metadata"]),Yh={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"},Kh=/^(?:qrdx[-_ ]?)?qr(?:[-_ ]?code)?$/i;function Gu(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 Uu(t,e,n,o,r){if(Gu(t,o),zt(Y(t,"display"))==="none"||zt(Y(t,"visibility"))==="hidden")return;let a=Number.parseFloat(Y(t,"opacity")??"1"),i=zt(Y(t,"fill-rule")),c=Number.parseFloat(zt(Y(t,"stroke-width"))??""),s={matrix:st(e.matrix,Nt(t.attrs.transform)),fill:zt(Y(t,"fill"))??e.fill,fillRule:i==="evenodd"||i==="nonzero"?i:e.fillRule,stroke:zt(Y(t,"stroke"))??e.stroke,strokeWidth:Se(c)&&c>=0?c:e.strokeWidth,color:zt(Y(t,"color"))??e.color,opacity:e.opacity*(Se(a)?a:1)};for(let l of t.children){if(Zh.has(l.name))continue;let m=Yh[l.name];if(m){o.add(m);continue}if(l.name==="svg"){o.add("nested-svg");continue}if(l.name==="g"||l.name==="a"){Uu(l,s,n,o,r);continue}if(!Xh.has(l.name)){o.add("unknown");continue}Jh(l,s,n,o,r);}}function Jh(t,e,n,o,r){if(Gu(t,o),zt(Y(t,"display"))==="none"||zt(Y(t,"visibility"))==="hidden")return;let a=st(e.matrix,Nt(t.attrs.transform));if(t.name==="rect"&&Kh.test(t.attrs.id??"")&&!r.qrBox){r.qrBox=ve(Du(Bu(t),a));return}let i=p=>zt(Y(t,p)),c=e.opacity*Number.parseFloat(i("opacity")??"1"),s=Number.parseFloat(i("fill-opacity")??"1"),l=Number.parseFloat(i("stroke-opacity")??"1"),m=i("fill-rule"),u={...e,fill:i("fill")??e.fill,fillRule:m==="evenodd"||m==="nonzero"?m:e.fillRule,stroke:i("stroke")??e.stroke,color:i("color")??e.color},f=Number.parseFloat(i("stroke-width")??""),d=Se(f)&&f>=0?f:e.strokeWidth,g=(p,b,y)=>{if(p.length!==0){if(r.segments+=p.length,r.segments>Ft.maxInputSegments)throw new nt(`The SVG has more than ${Ft.maxInputSegments} path segments; simplify it`);r.shapes.push({segments:Du(p,a),fill:b,fillRule:y});}},h=p=>{let b=(Se(c)?c:1)*(Se(p)?p:1);return b<=0?false:(b<1&&o.add("opacity"),true)};if(t.name!=="line"){let p=Ci(u.fill,u,n,o);p&&h(s)&&g(Bu(t),p,u.fillRule);}if(d>0&&u.stroke!=="none"){let p=Ci(u.stroke,u,n,o);if(p&&h(l)){let b=jh(t,d);b?((i("stroke-dasharray")??"none")!=="none"&&o.add("dash"),g(b,p,t.name==="line"?"nonzero":"evenodd")):o.add("stroke");}}}function tp(t,e){let n=l=>{let m=10**e;return Math.round(l*m)/m+0},o=l=>x(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 m=n(l.x),u=n(l.y);if(l.op==="M")r+=`m${o(m-a)} ${o(u-i)}`,c=m,s=u;else if(l.op==="L"){if(m===a&&u===i)continue;r+=u===i?`h${o(m-a)}`:m===a?`v${o(u-i)}`:`l${o(m-a)} ${o(u-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(m-a)} ${o(u-i)}`;a=m,i=u;}return r}var ep=(t,e)=>t.x0<e.x1&&e.x0<t.x1&&t.y0<e.y1&&e.y0<t.y1;function np(t){let e=[];for(let n of t){let o=ve(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=>ep(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 rp(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 g=d+1;g<i.length;g++){let h=Mi(i[d]),p=Mi(i[g]),b=Math.hypot(h[0]-p[0],h[1]-p[1],h[2]-p[2]);b<s&&(s=b,c=[i[d],i[g]]);}let[l,m]=c,[u,f]=(o.get(l)??0)>=(o.get(m)??0)?[l,m]:[m,l];o.set(u,(o.get(u)??0)+(o.get(f)??0)),o.delete(f);for(let[d,g]of r)g===f&&r.set(d,u);a++;}return a>0&&n.add("colors",a),r}var Qu=t=>{let[e,n,o]=Mi(t);return .2126*e+.7152*n+.0722*o>235};function op(t,e={}){let n=new wi;try{let o=Wh(t),r=de(o);if(!r)throw new nt("No <svg> element found");let a=jt(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=ct(r,"width"),l=ct(r,"height")),!(Se(s)&&Se(l)&&s>0&&l>0))throw new nt("The SVG needs a viewBox (or a width and height)");let u=Ft.artboardSide/Math.max(s,l),f=Math.round(s*u*10)/10,d=Math.round(l*u*10)/10;if(Math.min(f,d)<ot.minArtboard)throw new nt("The artboard is too narrow: its sides may differ by 20 times at most");let g=[u,0,0,u,-i*u,-c*u],h={shapes:[],qrBox:null,segments:0};Uu(r,{matrix:g,fill:"#000000",fillRule:"nonzero",stroke:"none",strokeWidth:1,color:"#000000",opacity:1},Hh(r),n,h);let p={x0:0,y0:0,x1:f,y1:d},b=Math.max(f,d)*.004,y=[],_=0,w=0;for(let T of h.shapes){let U=ve(T.segments);if(!U||U.x1<=0||U.y1<=0||U.x0>=f||U.y0>=d){_++;continue}if(U.x0<-b||U.y0<-b||U.x1>f+b||U.y1>d+b){let z=wr(T.segments,.25).map(wt=>cn(wt,p)).filter(wt=>wt.length>2);if(z.length===0){_++;continue}w++,y.push({...T,segments:z.flatMap(wt=>Ri(wt))});}else y.push(T);}if(_>0&&n.add("outside",_),w>0&&n.add("clipped",w),y.length===0)throw new nt("The SVG has no filled shapes to use");let C=rp(y,Ft.maxColors,n);for(let T of y)T.fill=C.get(T.fill)??T.fill;let S=new Map,$=new Map;for(let T of y){let U=ve(T.segments);S.set(T.fill,(S.get(T.fill)??0)+(U.x1-U.x0)*(U.y1-U.y0)),$.set(T.fill,($.get(T.fill)??0)+1);}let M=[...S.keys()].sort((T,U)=>Number(Qu(T))-Number(Qu(U))||S.get(U)-S.get(T)),R=M[0],E=M[1],P=T=>T===R?"frame":T===E?"accent":T,L=h.qrBox;if(!L&&e.qr){let[T,U]=W(g,e.qr.x,e.qr.y);L={x0:T,y0:U,x1:T+e.qr.size*u,y1:U+e.qr.size*u};}let F,I,N;L?(F=Math.min(L.x1-L.x0,L.y1-L.y0),I=(L.x0+L.x1-F)/2,N=(L.y0+L.y1-F)/2):(n.add("qr-placed"),F=Math.min(f,d)*.6,I=(f-F)/2,N=(d-F)/2);let k=T=>Math.round(T*10)/10+0;if(F=Math.floor(F*10)/10,I=k(I),N=k(N),F<Math.min(f,d)*ot.minQrShare)throw new nt("The QR area must be at least half the frame's shorter side");let B=Math.min(I,N,f-I-F,d-N-F);if(B<F*ot.minPadding-1e-9)throw new nt("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??Ft.padding,ot.minPadding),.2),O=Math.floor(Math.min(F*q,B)*10)/10,G=np(y);if(G.length>ot.maxShapes)throw new nt(`The artwork has ${G.length} separate shapes; the limit is ${ot.maxShapes}. Combine shapes of the same color first`);let J={kind:Dn,version:Bn,artboard:{width:f,height:d},qr:{x:I,y:N,size:F,padding:O},colors:{frame:R,...E&&{accent:E}},shapes:G.map(T=>({type:"path",d:tp(T.segments,Ft.decimals),fill:P(T.fill),...T.fillRule==="evenodd"&&{fillRule:"evenodd"}})),labels:[]},pt=vr(J);if(!pt.success){let T=pt.issues[0];throw new nt(`The converted frame doesn't fit the frame format: ${T?.message??"invalid"}`)}let at=M.map(T=>({color:T,ref:T===R?"frame":T===E?"accent":"fixed",shapes:$.get(T)??0}));return {ok:!0,spec:pt.data,warnings:n.list(),palette:at}}catch(o){return {ok:false,error:o instanceof nt?o.message:`Could not read the SVG (${o instanceof Error?o.name:"error"})`,warnings:n.list()}}}var ap=1013,ip={"call-to-action":105,holidays:283,seasons:60,"food-drink":71,shopping:64,"beauty-wellness":26,events:77,places:71,"real-estate":35,automotive:27,"health-learning":48,"sports-fitness":36,business:82,nonprofit:28};var sp=[{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:"beauty-wellness",label:"Beauty & wellness"},{id:"events",label:"Events & weddings"},{id:"places",label:"Places & Wi-Fi"},{id:"real-estate",label:"Real estate"},{id:"automotive",label:"Cars & parking"},{id:"health-learning",label:"Health & learning"},{id:"sports-fitness",label:"Sports & fitness"},{id:"business",label:"Business & social"},{id:"nonprofit",label:"Nonprofits & community"}];function Ei(t){return Array.isArray(t)?`[${t.map(Ei).join(",")}]`:t&&typeof t=="object"?`{${Object.keys(t).filter(n=>t[n]!==void 0).sort().map(n=>`${JSON.stringify(n)}:${Ei(t[n])}`).join(",")}}`:JSON.stringify(t)}function cp(t){let e=Ei(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")}function lp(t,e){return gt.QrCode.encodeText(t,Rt[e??Vt]).size}function zu(t,e,n,o=n.size*(e?.size??Bo)){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=lp(n.value,n.level),c=At(i,n.margin,n.shape),s=n.size/(i+2*c);if(e.padding&&(r.padding=e.padding*s),a){let l=i*s,m=u=>Math.min(Math.max((u??.5)*l-o/2,0),l-o);r.x=m(e.x),r.y=m(e.y);}return r}function qu(t,e,n,o){let r=n.level??Vt,a=r;o&&(a=Tt({...n,imageSettings:zu(t,e,n),autoLevel:o}));let i=s=>{let l=u=>zu(t,e,{...n,level:s},u),m=Ya(n,[s],l().width,l);return m>0?l(m):void 0};if(a===r)return i(r);let c=i(a);return c&&Tt({...n,imageSettings:c,autoLevel:o})===a?c:i(r)}function up({value:t,level:e,margin:n,shape:o,autoLevel:r,logoOptions:a}){let c=qu("data:,",{...a,size:Do},{value:`${t}`,size:1024,margin:n??dt,level:e,shape:o},r);return c?c.width/1024:0}function Ai({value:t,size:e=1024,fgColor:n,bgColor:o,eyeColor:r,dotColor:a,bodyPattern:i,hideLogo:c,logo:s,logoOptions:l,margin:m,cornerEyePattern:u,cornerEyeDotPattern:f,level:d,templateId:g,frame:h,eyeColors:p,moduleScale:b,autoLevel:y,shape:_}){let w={value:`${t}`,size:e,margin:m??dt,level:d,shape:_},C=!c&&s?qu(s,l,w,y):void 0;return {value:w.value,bgColor:o,fgColor:n,eyeColor:r,dotColor:a,bodyPattern:i,cornerEyePattern:u,cornerEyeDotPattern:f,level:d,templateId:g,size:e,margin:m,...h&&{frame:h},...p&&{eyeColors:p},...b!==void 0&&{moduleScale:b},...y&&{autoLevel:y},..._&&_!=="square"&&{shape:_},...C&&{imageSettings:C}}}var Wu=.06,Hu=.16,Vu=512;function ju(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=wa({width:e,height:n,data:o});if(!r)return null;let a=d=>{let g=d*4;return Math.hypot(o[g]/255-r[0],o[g+1]/255-r[1],o[g+2]/255-r[2])},i=new Uint8Array(e*n),c=new Int32Array(e*n),s=0,l=0,m=d=>{i[d]||o[d*4+3]===0||a(d)>=Hu||(i[d]=1,c[l++]=d);};for(let d=0;d<e;d++)m(d),m((n-1)*e+d);for(let d=0;d<n;d++)m(d*e),m(d*e+e-1);for(;s<l;){let d=c[s++],g=d%e;g>0&&m(d-1),g<e-1&&m(d+1),d>=e&&m(d-e),d<(n-1)*e&&m(d+e);}let u=new Uint8ClampedArray(o),f=r;for(let d=0;d<e*n;d++){if(!i[d])continue;let g=Math.min(1,Math.max(0,(a(d)-Wu)/(Hu-Wu))),h=d*4;if(u[h+3]=Math.round(o[h+3]*g),g>0&&g<1)for(let p=0;p<3;p++){let y=(o[h+p]/255-(1-g)*f[p])/g;u[h+p]=Math.round(Math.min(1,Math.max(0,y))*255);}}return {width:e,height:n,data:u}}async function mp(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,Vu/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=ju(c);return s?(c.data.set(s.data),i.putImageData(c,0,0),a.toDataURL("image/png")):null}catch{return null}finally{a.remove();}}var dp={value:true,size:true,level:true,bgColor:true,fgColor:true,eyeColor:true,dotColor:true,bodyPattern:true,cornerEyePattern:true,cornerEyeDotPattern:true,margin:true,style:true,imageSettings:true,isOGContext:true,templateId:true,customTemplate:true,customProps:true,frame:true,art:true,eyeColors:true,moduleScale:true,autoLevel:true,shape:true,frameLabelMarkers:true,partMarkers:true,hideLogo:true,logo:true,logoOptions:true,scale:true};function fp(t){let e={};for(let n of Object.keys(t))Object.hasOwn(dp,n)||(e[n]=t[n]);return e}function So(t){return Ai({value:t.value,fgColor:t.fgColor,hideLogo:t.hideLogo,bgColor:t.bgColor,eyeColor:t.eyeColor,dotColor:t.dotColor,bodyPattern:t.bodyPattern,cornerEyePattern:t.cornerEyePattern,cornerEyeDotPattern:t.cornerEyeDotPattern,level:t.level,templateId:t.templateId,logo:t.logo,logoOptions:t.logoOptions,margin:t.margin??dt,autoLevel:t.autoLevel,shape:t.shape})}function wo(t,e){let{size:n=ut,scale:o=1,level:r,style:a,customTemplate:i,customProps:c,frame:s,art:l,eyeColors:m,moduleScale:u,autoLevel:f,shape:d,frameLabelMarkers:g,partMarkers:h}=t,p=n*o,b=p/e.size,y=e.imageSettings&&{...e.imageSettings,height:e.imageSettings.height*b,width:e.imageSettings.width*b,...e.imageSettings.x!=null&&{x:e.imageSettings.x*b},...e.imageSettings.y!=null&&{y:e.imageSettings.y*b},...e.imageSettings.padding!=null&&{padding:e.imageSettings.padding*b}};return {art:l,bgColor:e.bgColor,bodyPattern:e.bodyPattern,cornerEyeDotPattern:e.cornerEyeDotPattern,cornerEyePattern:e.cornerEyePattern,customProps:c,customTemplate:i,dotColor:e.dotColor,eyeColor:e.eyeColor,fgColor:e.fgColor,frame:s,level:r||e.level,margin:e.margin,...m&&{eyeColors:m},...u!==void 0&&{moduleScale:u},...f&&{autoLevel:f},...d&&d!=="square"&&{shape:d},...g&&{frameLabelMarkers:g},...h&&{partMarkers:h},size:p,style:a,templateId:e.templateId,value:e.value,...y&&{imageSettings:y},...fp(t)}}function hp(t){return wo(t,So(t))}function Xu(t,e){let n=[],o=r=>{if(r==null||typeof r=="boolean")return;if(typeof r=="string"||typeof r=="number"||typeof r=="bigint"){n.push(`${r}`);return}if(Array.isArray(r)){for(let l of r)o(l);return}if(!Ae(r))throw new TypeError("qrdx: can't render this value");let{type:a,props:i,key:c}=r;if(on(a)){o(i.children);return}if(typeof a=="function"){o(a(i));return}let s={};for(let l of Object.keys(i)){let m=An(l,i[l]);m&&(s[m.name]=m.value);}n.push(e(a,s,Xu(i.children,e),c));};return o(t),n}var Zu={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"]},Yu={diamond:["square"],pacman:["rounded"],"small-square":["square","rounded"]},Ku=["circle","curly"],Ju=["diamond","banner","star"],t0={circle:["square","rounded","diya","extra-rounded","message","pointy","leaf","leaf-reverse","drop","bevel","squircle","cushion","shield","petal"]},qt=["square","liquid","classy","classy-rounded"],e0={"circle/rounded":qt,"circle/extra-rounded":qt,"circle/message":[...qt,"leaf"],"circle/pointy":qt,"circle/leaf-reverse":qt,"circle/drop":qt,"circle/bevel":[...qt,"leaf"],"circle/squircle":[...qt,"circle","diamond","circle-mixed","rounded","horizontal-line","leaf","heart","mosaic","octagon"],"circle/cushion":qt,"circle/shield":[...qt,"rounded","horizontal-line","leaf"],"circle/petal":qt};function n0(t,e,n){return (t0[t]?.includes(e)??false)&&!e0[`${t}/${e}`]?.includes(n)}function Pi(t){let e=t.bodyPattern??"circle",n=t.cornerEyePattern??"gear",o=t.cornerEyeDotPattern??"circle";return Zu[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"}:Yu[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"}:Ju.includes(o)?{kind:"dot",message:`${o} centres are missed in sharp renders and up close`,fix:"Pick a square, rounded or circle centre"}:Ku.includes(n)?{kind:"eye",message:`${n} eyes only read in lenient decoders`,fix:"Pick square, rounded or gear eyes"}:n0(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}var Fn=300,fr=t=>{let e=typeof t=="number"?t:Number.parseFloat(String(t));return Number.isFinite(e)?e:void 0};function pp(t){let e=fr(t.x)??0,n=fr(t.y)??0,o=jt(typeof t.viewBox=="string"?t.viewBox:void 0),r=fr(t.width),a=fr(t.height);if(o.length!==4||!(o[2]&&o[3]&&r&&a))return [1,0,0,1,e,n];let[i,c,s,l]=o,m=Math.min(r/s,a/l);return [m,0,0,m,e+(r-s*m)/2-i*m,n+(a-l*m)/2-c*m]}function vi(t,e,n,o){if(t===e)return n;if(Array.isArray(t)){for(let c of t){let s=vi(c,e,n,false);if(s)return s}return null}let r=t;if(!r||typeof r!="object"||!r.props)return null;let{props:a}=r,i=st(n,Nt(typeof a.transform=="string"?a.transform:void 0));return r.type==="svg"&&!o&&(i=st(i,pp(a))),vi(a.children,e,i,false)}function Li(t){let e=t.customTemplate||(t.templateId?Zr(t.templateId):void 0);if(!e)return 1;let n={type:"svg",props:{height:Fn,viewBox:`0 0 ${Fn} ${Fn}`,width:Fn},key:null},o;try{o=e.wrapper(n,{fgColor:typeof t.fgColor=="string"?t.fgColor:void 0,bgColor:typeof t.bgColor=="string"?t.bgColor:void 0,...t.customProps??{}},{pixelSize:10,url:t.value});}catch{return 1}let r=o?.props;if(!r)return 1;let a=jt(typeof r.viewBox=="string"?r.viewBox:void 0),i=a.length===4?a[2]:fr(r.width),c=vi(o,n,un,true);if(!(c&&i))return 1;let[s,l]=W(c,0,0),[m,u]=W(c,Fn,Fn),d=Math.min(Math.abs(m-s),Math.abs(u-l))/i;return d>0&&d<=1?d:1}var l0=[96,160,320],ki=640;function Ti(){if(typeof document>"u")throw new Error("Scan scoring needs a browser (canvas + image decoding)")}function Ce(t){if(t?.aborted)throw new DOMException("Scan scoring was aborted","AbortError")}var u0=()=>new Promise(t=>setTimeout(t,0));async function Ni(){let{default:t}=await import('jsqr');return t}function Ii(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 gp(t,e,n=.7){let{data:o,width:r,height:a}=t;for(let m=0;m<o.length;m+=4)for(let u=0;u<3;u++)o[m+u]=128+(o[m+u]-128)*n;let i=Math.max(1,Math.round(e*.25)),c=2*i+1,s=new Float32Array(r*a*3),l=m=>{let u=m?a:r,f=m?r:a,d=m?r:1,g=m?1:r;for(let h=0;h<u;h++){let p=h*d,b=0,y=0,_=0;for(let w=-i;w<=i;w++){let C=(p+Math.min(Math.max(w,0),f-1)*g)*4;b+=o[C],y+=o[C+1],_+=o[C+2];}for(let w=0;w<f;w++){let C=(p+w*g)*3;s[C]=b/c,s[C+1]=y/c,s[C+2]=_/c;let S=(p+Math.max(w-i,0)*g)*4,$=(p+Math.min(w+i+1,f-1)*g)*4;b=b-o[S]+o[$],y=y-o[S+1]+o[$+1],_=_-o[S+2]+o[$+2];}}for(let h=0,p=0;h<r*a*3;h+=3,p+=4)o[p]=s[h],o[p+1]=s[h+1],o[p+2]=s[h+2];};for(let m=0;m<2;m++)l(true),l(false);}function kn(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 bp=[.9,1,1.1];function Oi(t,e,n,o,r){let a=0;for(let i of bp){let c=n*i,s=e(c);gp(s,c/o),r(t(s.data,s.width,s.height))&&a++;}return a>=2?"pass":a===1?"fragile":"fail"}var Fi={small:"small print or far away",medium:"typical phone distance",large:"close up"};function yp(t,e){return t===e[0]&&e.length>1?Fi.small:t===e.at(-1)?Fi.large:Fi.medium}function m0(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 d0(t,e,n){let o=`${t} px (${yp(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 f0(t,e){return e?"fails":t>=85?"great":t>=65?"ok":"risky"}function _p(t,e,n){let o=Bt(t,e);if(o.type==="solid")return [o.color];if(o.type!=="image")return o.stops.map(c=>c.color);let r=o.underlay?Mo(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=Mo(c);if(!s)return [];let l={...s,a:s.a*i};if(!r)return [r0(l)];let m=l.a+r.a*(1-l.a),u=(f,d)=>m>0?(f*l.a+d*r.a*(1-l.a))/m:0;return [r0({r:u(l.r,r.r),g:u(l.g,r.g),b:u(l.b,r.b),a:m})]})}var r0=({r:t,g:e,b:n,a:o})=>`rgba(${Math.round(t)}, ${Math.round(e)}, ${Math.round(n)}, ${Math.round(o*1e3)/1e3})`;function xp(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:En(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 $p(t){Ti();let e=await gr(t),{canvas:n,ctx:o}=kn(64,64);o.drawImage(e,0,0,64,64);let r=xp(o.getImageData(0,0,64,64));return n.remove(),r}function h0(t){let e=[t.bgColor,t.fgColor,t.eyeColor,t.dotColor,...Sr.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 hr=null;function Mo(t){let e=lt(t);if(e||typeof document>"u")return e;if(hr??=document.createElement("canvas").getContext("2d"),!hr)return null;hr.fillStyle="#010203",hr.fillStyle=t;let n=String(hr.fillStyle);return n==="#010203"?null:lt(n)}var o0=t=>En(t.r,t.g,t.b),p0=(t,e)=>(Math.max(t,e)+.05)/(Math.min(t,e)+.05),pr=4.5,Sp=3,a0=1.5,i0={code:7,background:12},s0={r:255,g:255,b:255,a:1},c0=(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 wp(t,e={}){let n=e.imageTones,o=(d,g)=>{let h=typeof d=="object"&&d?.type==="image";return _p(d,g,n).map(p=>({color:p,picture:h}))},r=t.fgColor??Ct,a=Sr.flatMap(d=>{let g=t.eyeColors?.[d];return [...g?.outer?o(g.outer,Ct):[],...g?.inner?o(g.inner,Ct):[]]}),i=[...o(r,Ct),...o(t.eyeColor??r,Ct),...o(t.dotColor??r,Ct),...a],c=o(t.bgColor,bt),s=(c.length>0?c:[{color:"#ffffff",picture:false}]).map(d=>{let g=Mo(d.color);return {color:g?c0(g,s0):s0,picture:d.picture}}),l=i.flatMap(d=>{let g=Mo(d.color);return g?[{color:g,picture:d.picture}]:[]}),m=Number.POSITIVE_INFINITY,u=pr,f=false;for(let d of l)for(let g of s){let h=o0(c0(d.color,g.color)),p=o0(g.color),b=p0(h,p),y=g.picture?i0.background:d.picture?i0.code:pr;b/y<m/u&&(m=b,u=y),h>p&&(f=true);}return {ratio:Number.isFinite(m)?m:Number.POSITIVE_INFINITY,required:u,inverted:f}}function Cp(t,e){let{ratio:n,inverted:o,required:r}=wp(t,{imageTones:e});if(!Number.isFinite(n))return {checks:[],penalty:0,fails:false};let a=r/pr,i=r!==pr,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<a0*a?60:n<Sp*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<a0*(r/pr)}}function Di(t){return gt.QrCode.encodeText(t.value,Rt[Tt(t)]).getModules()}function Mp(t){let{imageSettings:e}=t;if(!e)return {check:null,penalty:0};let n=Di(t),o=xe(n,t.size??ut,At(n.length,t.margin??dt,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(([g,h])=>r.x<g+9&&r.x+r.w>g&&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 m=r.w*r.h/(a*a),u=Tt(t),f=Math.round(m*100),d=no({value:t.value,size:t.size??ut,margin:t.margin??dt,level:u,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 Rp(t){let e=xa(t.shape)?De(t.margin??dt):t.margin??dt,n=Di(t).length+2*e,o=e+(It(t.frame)?ba(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 Ep(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 gr(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 Ap=`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 Pp(t){let{imageSettings:e}=t;if(!e||e.src.startsWith("data:"))return t;let n=Ap;try{let o=await gr(e.src),{canvas:r,ctx:a}=kn(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 vp(t){let e=new Map;for(let r of h0(t))if(!r.startsWith("data:"))try{let a=await gr(r),{canvas:i,ctx:c}=kn(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??Ct},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 g0(t,e,n,o,r){let a=[],i=0,c=Cp(t,r);i+=c.penalty;let s=Mp(t);i+=s.penalty;let l=Rp(t);i+=l.penalty;let m=Ep(t);i+=m.penalty;let u=Pi(t),f=u?.kind==="eye"?null:u;f&&f.kind!=="sharp-dot-eye"&&(i+=10);let d=await Ni();Ce(o);let g=Di(t).length,h=g+2*At(g,t.margin??dt,t.shape),p=[],b=false;for(let[w,C]of n.entries()){await u0(),Ce(o);let S=Oi(d,e,C,h,$=>Ii($,t.value));i+=m0(w,n.length,S),p.push(d0(C,n,S)),w===n.length-1&&S==="fail"&&(b=true);}a.push(...p,...c.checks),s.check&&a.push(s.check),a.push(m.check,l.check),f&&a.push({id:"style-pair",passed:false,message:f.message,fix:f.fix});let y=b||c.fails,_=Math.max(0,Math.min(100,100-i));return y&&(_=Math.min(_,30)),{score:_,grade:f0(_,y),checks:a}}function b0(t){return [...t.sizes??l0].filter(e=>e>0).sort((e,n)=>e-n)}async function F3(t,e={}){Ti();let{signal:n}=e,o=b0(e),r=ki/Li(t),a=await vp(await Pp(We({...t,size:t.size??ut},r)));Ce(n);let i={};for(let u of h0(t))try{let f=await $p(u);f&&(i[u]=f);}catch{}Ce(n);let c=await Ut(a),s=await gr(c);Ce(n);let l=oe(r,t.frame);return await g0(t,u=>{let f=u/ki,d=l.width*f,g=l.height*f,h=Math.max(8,Math.round(u*.12)),{canvas:p,ctx:b}=kn(d+2*h,g+2*h);b.fillStyle="#ffffff",b.fillRect(0,0,p.width,p.height),b.drawImage(s,h,h,d,g);let y=b.getImageData(0,0,p.width,p.height);return p.remove(),y},o,n,i)}var k3=ki;async function I3(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=b0(n),i=t.size??ut,c=oe(i,t.frame),s=o*i*Li(t)/c.width,l={data:Lp(e),width:o,height:r};return await g0(t,u=>{let f=y0(l,u/s),d=Math.max(8,Math.round(u*.12));return Fp(f,d)},a,n.signal)}function Lp(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 Fp(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 we=(t,e)=>Math.hypot(t.x-e.x,t.y-e.y);function Co(t,e){return .299*t[e]+.587*t[e+1]+.114*t[e+2]}function kp(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,m=(n-o)/s,u=r*s*(l-m)**2;u>a&&(a=u,i=c);}return i}async function Ip(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 gr(e);return await n.decode?.().catch(()=>{}),n}finally{setTimeout(()=>URL.revokeObjectURL(e),1e3);}}async function T3(t,e={}){Ti();let{signal:n}=e,o=[...e.sizes??l0].filter(Q=>Q>0).sort((Q,et)=>Q-et),r=await Ni(),a=await Ip(t);Ce(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:m}=kn(i*s,c*s);m.fillStyle="#ffffff",m.fillRect(0,0,l.width,l.height),m.drawImage(a,0,0,l.width,l.height);let u=m.getImageData(0,0,l.width,l.height),f=r(u.data,u.width,u.height);if(Ce(n),!f){let Q=await Jl(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:g}=f,h=17+4*g,p=(we(d.topLeftCorner,d.topRightCorner)+we(d.bottomLeftCorner,d.bottomRightCorner)+we(d.topLeftCorner,d.bottomLeftCorner)+we(d.topRightCorner,d.bottomRightCorner))/4,b=p/h,y=[d.topLeftCorner,d.topRightCorner,d.bottomRightCorner,d.bottomLeftCorner],_=Math.max(0,Math.floor(Math.min(...y.map(Q=>Q.x)))),w=Math.min(u.width,Math.ceil(Math.max(...y.map(Q=>Q.x)))),C=Math.max(0,Math.floor(Math.min(...y.map(Q=>Q.y)))),S=Math.min(u.height,Math.ceil(Math.max(...y.map(Q=>Q.y)))),$=[],M=0,R=new Array(256).fill(0),E=0;for(let Q=C;Q<S;Q++)for(let et=_;et<w;et++){let V=Math.round(Co(u.data,(Q*u.width+et)*4));R[V]=R[V]+1,E++;}let P=kp(R,E),L={dark:[0,0,0,0],light:[0,0,0,0]};for(let Q=C;Q<S;Q++)for(let et=_;et<w;et++){let V=(Q*u.width+et)*4,mt=Co(u.data,V)<=P?L.dark:L.light;mt[0]=mt[0]+u.data[V],mt[1]=mt[1]+u.data[V+1],mt[2]=mt[2]+u.data[V+2],mt[3]=mt[3]+1;}let F=Q=>{let et=Math.max(Q[3],1);return En(Q[0]/et,Q[1]/et,Q[2]/et)},I=F(L.dark),N=F(L.light),k=p0(I,N),B=Math.round(k*10)/10;k>=4.5?$.push({id:"contrast",passed:true,message:`Contrast ${B}:1 in the image`}):(M+=k<2?30:10,$.push({id:"contrast",passed:false,message:`Low contrast in the image (${B}: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 et=Math.min(u.width-1,Math.max(0,Math.round(Q.x))),V=Math.min(u.height-1,Math.max(0,Math.round(Q.y)));return Co(u.data,(V*u.width+et)*4)}).filter(Q=>Q>P).length>=2;O?(M+=10,$.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"})):$.push({id:"polarity",passed:true,message:"Dark code on a light background"});let G=Math.max(2,Math.round(b*2)),J={minX:_-G,maxX:w+G,minY:C-G,maxY:S+G};if(J.minX<0||J.minY<0||J.maxX>u.width||J.maxY>u.height)$.push({id:"quiet-zone",passed:true,skipped:true,message:"The image is cropped too tight to check the quiet zone"});else {let Q=0,et=0;for(let V=J.minY;V<J.maxY;V++)for(let mt=J.minX;mt<J.maxX;mt++){if(mt>=_&&mt<w&&V>=C&&V<S)continue;let In=Co(u.data,(V*u.width+mt)*4);(O?In>P:In<=P)&&Q++,et++;}Q/Math.max(et,1)>.12?(M+=10,$.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"})):$.push({id:"quiet-zone",passed:true,message:"Clear space around the code"});}b<2?$.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"}):$.push({id:"resolution",passed:true,message:`About ${Math.round(b)} px per module`});let at=Math.round(b*4),T=Math.max(0,_-at),U=Math.max(0,C-at),z=Math.min(u.width,w+at)-T,wt=Math.min(u.height,S+at)-U,Me=Q=>{let et=Q/p,V=kn(z*et,wt*et);V.ctx.drawImage(l,T,U,z,wt,0,0,V.canvas.width,V.canvas.height);let mt=V.ctx.getImageData(0,0,V.canvas.width,V.canvas.height);return V.canvas.remove(),mt},kt=[],Jt=false;for(let[Q,et]of o.entries()){await u0(),Ce(n);let V=Oi(r,Me,et,h,mt=>mt?.data===f.data);M+=m0(Q,o.length,V),kt.push(d0(et,o,V)),Q===o.length-1&&V==="fail"&&(Jt=true);}l.remove();let Re=Math.max(0,Math.min(100,100-M));return Jt&&(Re=Math.min(Re,30)),{data:f.data,version:g,score:Re,grade:f0(Re,Jt),checks:[...kt,...$]}}var Tp=[320];function y0(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),m=Math.max(l+1,Math.min(t.height,Math.floor((s+1)*c)));for(let u=0;u<o;u++){let f=Math.floor(u*i),d=Math.max(f+1,Math.min(t.width,Math.floor((u+1)*i))),g=0,h=0,p=0,b=0;for(let w=l;w<m;w++)for(let C=f;C<d;C++){let S=(w*t.width+C)*4;g+=t.data[S],h+=t.data[S+1],p+=t.data[S+2],b+=t.data[S+3];}let y=(m-l)*(d-f),_=(s*o+u)*4;a[_]=g/y,a[_+1]=h/y,a[_+2]=p/y,a[_+3]=b/y;}}return {data:a,width:o,height:r,colorSpace:"srgb"}}function Np(t){try{return new TextDecoder("utf-8",{fatal:!0}).decode(Uint8Array.from(t.binaryData))}catch{return t.data}}async function N3(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=Np(c),{version:l,location:m}=c;if(!Ii(c,e))return {data:s,version:l,passed:false};let u=17+4*l,f=(we(m.topLeftCorner,m.topRightCorner)+we(m.bottomLeftCorner,m.bottomRightCorner)+we(m.topLeftCorner,m.bottomLeftCorner)+we(m.topRightCorner,m.bottomRightCorner))/4;for(let d of n.sizes??Tp)if(Oi(a,h=>y0(i,h/f),d,u,h=>Ii(h,e))!=="pass")return {data:s,version:l,passed:false};return {data:s,version:l,passed:true}}var Op=16,_0=.01;function Dp(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 m=r/a,u=(o-r)/l,f=a*l*(m-u)**2;f>i&&(i=f,c=s);}return (c+.5)/255}function Bp(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 g=r[d*4+3]/255,h=.2126*r[d*4]+.7152*r[d*4+1]+.0722*r[d*4+2];l[d]=1-(h*g+255*(1-g))/255;}let m=Dp(l);for(let d=0;d<a;d++)i[d]=l[d]>m?1:0;let u=0,f=0;for(let d=0;d<n;d++)for(let g of [0,o-1])u++,f+=i[g*n+d];for(let d=1;d<o-1;d++)for(let g of [0,n-1])u++,f+=i[d*n+g];if(f>u/2)for(let d=0;d<a;d++)i[d]=i[d]?0:1;return i}function x0(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 m of c){let u=m%e,f=(m-u)/e;(u===0||f===0||u===e-1||f===n-1)&&(s=true);for(let[d,g]of [[u-1,f],[u+1,f],[u,f-1],[u,f+1]]){if(d<0||g<0||d>=e||g>=n)continue;let h=g*e+d;!a[h]&&t[h]===r&&(a[h]=1,c.push(h));}}if((r===1||!s)&&c.length<o)for(let m of c)t[m]=r?0:1;}}}function $0(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=Bp(t,e.mode??"auto"),i=a.reduce(($,M)=>$+M,0);x0(a,n,o,Math.max(16,i*_0));let c=n,s=o,l=-1,m=-1;for(let $=0;$<o;$++)for(let M=0;M<n;M++)a[$*n+M]&&(c=Math.min(c,M),s=Math.min(s,$),l=Math.max(l,M),m=Math.max(m,$));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 u=l-c+1,f=m-s+1;if(Math.max(u,f)<Op)throw new Error("The shape is too small to trace; use a bigger picture");let g=Math.min(Math.max(Math.round(e.cells??Pe),me),Pe)/Math.max(u,f),h=Math.max(me,Math.round(u*g)),p=Math.max(me,Math.round(f*g)),b=Math.max(1,Math.round(u*g)),y=Math.max(1,Math.round(f*g)),_=Math.floor((h-b)/2),w=Math.floor((p-y)/2),C=new Uint8Array(h*p);for(let $=0;$<y;$++){let M=s+Math.floor($*f/y),R=Math.max(M+1,s+Math.floor(($+1)*f/y));for(let E=0;E<b;E++){let P=c+Math.floor(E*u/b),L=Math.max(P+1,c+Math.floor((E+1)*u/b)),F=0;for(let I=M;I<R;I++)for(let N=P;N<L;N++)F+=a[I*n+N];C[($+w)*h+E+_]=F*2>=(R-M)*(L-P)?1:0;}}let S=C.reduce(($,M)=>$+M,0);if(x0(C,h,p,Math.max(4,S*_0)),!C.includes(1))throw new Error("The shape is too small to trace; use a bigger picture");return {type:"silhouette",width:h,height:p,cells:Array.from(C,$=>$?"1":"0").join("")}}var Bi=512;async function Qp(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 Gp(t,e={}){if(typeof document>"u")throw new Error("loadQRSilhouette needs a browser; pass decoded pixels to createQRSilhouette instead");let n=await Qp(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 m;try{m=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 $0(m,e)}function Qi(t){return br(ro,()=>sr(t))}var qp=react.memo(t=>{let{value:e,fgColor:n,hideLogo:o,logo:r,logoOptions:a,bgColor:i,eyeColor:c,dotColor:s,bodyPattern:l,cornerEyePattern:m,cornerEyeDotPattern:u,level:f,margin:d=dt,templateId:g,autoLevel:h,shape:p}=t,b=react.useMemo(()=>So(t),[e,n,o,r,a,d,h,p,i,c,s,l,m,u,f,g]);return jsxRuntime.jsx(Qi,{...wo(t,b)})});qp.displayName="QRCode";/**
24
+ end`;function xi(t){let e="(";for(let n of t){let o=n.codePointAt(0)??63;n==="("||n===")"||n==="\\"?e+=`\\${n}`:n==="\u2026"?e+="...":o>=32&&o<127?e+=n:o>=160&&o<=255?e+=`\\${o.toString(8).padStart(3,"0")}`:e+="?";}return `${e})`}var $i=class extends Ln{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]=pe(e.r,e.g,e.b);return `${x(n)} ${x(o)} ${x(r)} ${x(a)} cmyk`}return `${x(e.r/255)} ${x(e.g/255)} ${x(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]=W(n,a.x,a.y);o.push(`${x(i)} ${x(c)} m`),r=true;}else if(a.op==="L"){let[i,c]=W(n,a.x,a.y);o.push(`${x(i)} ${x(c)} l`);}else if(a.op==="C"){if(!r)continue;let[i,c]=W(n,a.x1,a.y1),[s,l]=W(n,a.x2,a.y2),[m,u]=W(n,a.x,a.y);o.push(`${x(i)} ${x(c)} ${x(s)} ${x(l)} ${x(m)} ${x(u)} 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 ${x(n)} ${x(o)} m ${x(n+r)} ${x(o)} l ${x(n+r)} ${x(o+a)} l ${x(n)} ${x(o+a)} l h f`);}shade(e,n,o){let r=st(n.matrix,o.matrix);if(!Se(r))return;let a=uo(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 [${lo(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(u=>({...u,color:this.flatten({...u.color,a:u.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),m=o.fillRule==="evenodd"?"ef":"f";i&&s?this.out.push(`gsave ${this.color(i)} ${l} ${m} grestore`):i&&this.out.push(`${this.color(i)} ${l} ${m}`),s&&this.out.push(`${this.color(s)} ${x(o.strokeWidth*fn(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=fn(n.matrix),[i,c]=W(n.matrix,H(e.attrs.x,n.viewport[0]),H(e.attrs.y,n.viewport[1])),l=n.fontWeight==="bold"||Number.parseInt(n.fontWeight,10)>=600?"/QRDX-Bold":"/QRDX-Regular",m=x(n.fontSize*a),u=Number.parseFloat(e.attrs["data-max-width"]??""),f=u>0?` dup stringwidth pop dup ${x(u*a)} gt {${x(u*a)} exch div ${m} 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":"",g=Math.atan2(n.matrix[1],n.matrix[0])*180/Math.PI;if(Math.abs(g)>.01){this.out.push(`gsave ${this.color(r)} ${l} findfont ${m} scalefont setfont ${x(i)} ${x(c)} translate ${x(g)} rotate ${xi(o)}${f} 0 0 moveto${d} show grestore`);return}this.out.push(`gsave ${this.color(r)} ${l} findfont ${m} scalefont setfont ${xi(o)}${f} ${x(i)} ${x(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=H(e.attrs.x,n.viewport[0]),i=H(e.attrs.y,n.viewport[1]),c=H(e.attrs.width,n.viewport[0]),s=H(e.attrs.height,n.viewport[1]);if(c<=0||s<=0)return;let[l,m]=W(n.matrix,a,i),[u,f]=W(n.matrix,a+c,i+s),{components:d}=r,g=d===1?"/DeviceGray":d===4?"/DeviceCMYK":"/DeviceRGB",h=Array.from({length:d},()=>"0 1").join(" "),p="/ASCII85Decode filter";r.kind==="jpeg"?(p+=" /DCTDecode filter",r.progressive&&(this.usesLevel3=true)):r.compressed&&(p+=" /FlateDecode filter",this.usesLevel3=true),this.out.push(["gsave",`${x(Math.min(l,u))} ${x(Math.min(m,f))} translate ${x(Math.abs(u-l))} ${x(Math.abs(f-m))} scale`,`${g} 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 ${p} >> image`,Qh(r.bytes),"grestore"].join(`
25
+ `));}};async function Tu(t,e={}){let n=de(t);if(!n)throw new Error("Could not read the SVG to convert to EPS");let o=H(n.attrs.width,0,0)||512,r=H(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,m=c+2*s,u=e.colorMode==="cmyk",f=new Map;for(let y of mr(n,new Set)){let _=await Bh(y,u);_&&f.set(y,_);}let d=new $i(u,ur(n,new Map),co(n),f);bo(d,{bgColor:e.background??"#ffffff"});let h={matrix:st([1,0,0,-1,s,m-s],[i,0,0,i,0,0]),viewport:[o,r],fill:"#000000",fillRule:"nonzero",stroke:"none",strokeWidth:1,fontSize:16,fontWeight:"normal",textAnchor:"start"},p=s>0?e.bleedColor??void 0:void 0;if(!(p&&d.paintBleed(n,h,p,[0,0,l,m]))){let y=p?d.resolveColor(p):null;y&&d.rect(y,0,0,l,m);}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(m)}`,`%%HiResBoundingBox: 0 0 ${x(l)} ${x(m)}`,`%%Title: ${xi(b)}`,"%%Creator: qrdx",`%%LanguageLevel: ${d.usesLevel3?3:2}`,"%%DocumentData: Clean7Bit","%%EndComments","%%BeginProlog",Gh,"%%EndProlog","qrdxdict begin",...Array.from(d.shadingNames,([y,_])=>`/${_} ${y} def`),"gsave",...d.out,"grestore","end","showpage","%%Trailer","%%EOF",""].join(`
26
+ `)}var Nu="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 Ou(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 xo(t,e={}){if(Ou(t))throw new Error(Nu);let n=_o(t,{size:e.sizeMm??Th,unit:"mm",bleed:e.bleedMm}),o=await dr(t);return await Tu(o,{width:n.trimWidth*ku,bleed:n.bleed*ku,bleedColor:n.bleed>0?go(t,o):hi(t),colorMode:e.colorMode,background:yt(t.bgColor,bt)})}function $o(t){return `data:application/postscript;base64,${btoa(t)}`}async function Uh(t,e={}){let n=await xo(t,e);zt($o(n),e.filename??"qr-code-print.eps");}var Si={png:{mimeType:"image/png",extension:"png",vector:false},jpg:{mimeType:"image/jpeg",extension:"jpg",vector:false},webp:{mimeType:"image/webp",extension:"webp",vector:false},bmp:{mimeType:"image/bmp",extension:"bmp",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}},Z5={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 wi(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 Ve(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 zt(t,e){let n=document.createElement("a");n.href=t,n.download=e,document.body.appendChild(n),n.click(),document.body.removeChild(n);}var Du=t=>(Si[t]??Si.png).mimeType;function zh(t,e,n){let{extension:o,vector:r}=Si[t];if(r)return `qr-code.${o}`;let{width:a,height:i}=oe(e.width,n);return `qr-code-${Math.round(a)}x${Math.round(i)}.${o}`}async function Bu(t,e={}){let n=await He(t,"image/webp",true);try{return await so(n,e)}finally{n.remove();}}async function Qu(t){let e=await He(t,"image/png",true);try{return oo(e)}finally{e.remove();}}var qh=25.4/72;async function Gu(t){let e=await xo(t,{sizeMm:(t.size??ut)*qh});return $o(e)}async function Uu(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 Ut(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}=oe(t.size||ut,t.frame),c=await new Promise((f,d)=>{let g=new Image,h=document.createElement("canvas");h.width=Math.round(a),h.height=Math.round(i);let p=h.getContext("2d");if(!p){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);g.onload=()=>{clearTimeout(b);try{p.drawImage(g,0,0,h.width,h.height),f(h);}catch(y){clearTimeout(b),h.remove(),d(new Error(`Failed to draw image to canvas: ${y}`));}},g.onerror=()=>{clearTimeout(b),h.remove(),d(new Error("Could not load SVG for PDF conversion"));},g.src=r;}),s=c.toDataURL("image/png",1),l=a*.264583,m=i*.264583,u=new e({orientation:l>m?"landscape":"portrait",unit:"mm",format:[l,m]});return u.addImage(s,"PNG",0,0,l,m),c.remove(),u.output("dataurlstring")}async function X5(t,e){let{format:n,size:o,filename:r,quality:a}=e,i=wi(o.width,o.height);if(!i.isValid)throw new Error(i.error);let c=Ve(t,o.width),s=r||zh(n,o,t.frame);try{if(n==="svg"){let l=await Ut(c);zt(l,s);}else if(n==="pdf"){let l=await Uu(c);zt(l,s);}else if(n==="eps")zt(await Gu(c),s);else if(n==="webp"){let l=await Bu(c,{quality:a});zt(await $e(l),s);}else if(n==="bmp"){let l=await Qu(c);zt(await $e(l),s);}else {let l=Du(n),m=await He(c,l);if(typeof m=="string")zt(m,s);else throw new Error("Failed to generate image data URL")}}catch(l){throw console.error(`Error downloading ${n.toUpperCase()}:`,l),l}}async function Y5(t,e,n,o={}){let r=wi(n.width,n.height);if(!r.isValid)throw new Error(r.error);let a=Ve(t,n.width);if(e==="svg")return await Ut(a);if(e==="pdf")return await Uu(a);if(e==="eps")return await Gu(a);if(e==="webp")return await $e(await Bu(a,o));if(e==="bmp")return await $e(await Qu(a));let i=Du(e),c=await He(a,i);if(typeof c=="string")return c;throw new Error("Failed to generate QR code data URL")}async function K5(t,e={width:ut,height:ut}){try{let n=wi(e.width,e.height);if(!n.isValid)throw new Error(n.error);let o=Ve(t,e.width),r=He(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 J5(t){let e=await Ut(t);return decodeURIComponent(e.replace("data:image/svg+xml,",""))}var Ft={maxBytes:2e5,maxElements:500,maxDepth:16,maxInputSegments:4e3,maxColors:8,artboardSide:1e3,decimals:1,padding:.06},nt=class extends Error{},Wh={script:t=>`Removed ${ht(t,"script")}`,style:t=>`Removed ${ht(t,"style sheet")}: colors set with CSS classes are lost. Export with presentation attributes (Illustrator: Styling \u2192 Presentation Attributes)`,"foreign-object":t=>`Removed ${ht(t,"foreignObject element")}`,image:t=>`Removed ${ht(t,"image")}: frames are vector shapes only`,use:t=>`Removed ${ht(t,"<use> reference")}: ungroup or detach symbols before exporting`,text:t=>`Removed ${ht(t,"text element")}: add text as labels in the frame editor`,effects:t=>`Removed ${ht(t,"filter, mask, clip path or pattern")}`,animation:t=>`Removed ${ht(t,"animation")}`,unknown:t=>`Removed ${ht(t,"unsupported element")}`,"nested-svg":t=>`Removed ${ht(t,"nested <svg>")}: flatten it first`,handlers:t=>`Removed ${ht(t,"event handler attribute")}`,links:t=>`Removed ${ht(t,"link")} (href)`,"external-paint":t=>`Removed ${ht(t,"fill or stroke")} that referenced something outside the file`,gradient:t=>`Flattened ${ht(t,"gradient")} to its first color: add gradients in the frame editor`,opacity:t=>`Made ${ht(t,"semi-transparent shape")} opaque (print files have no transparency)`,"invalid-paint":t=>`${ht(t,"color")} couldn't be read and fell back to the parent color`,stroke:t=>`Removed ${ht(t,"stroke")} on paths, polygons or polylines: outline strokes before exporting (Figma: Outline stroke)`,dash:t=>`Drew ${ht(t,"dashed stroke")} as solid`,clipped:t=>`Cut ${ht(t,"shape")} at the edge of the artboard`,outside:t=>`Removed ${ht(t,"shape")} outside the artboard`,colors:t=>`Merged ${ht(t,"color")} with similar ones (${Ft.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 ht(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:Wh[e](n)}))}},Hh=/^\s*<\?xml\s[^?>]*\?>/,Mi=/[A-Za-z_][\w:.-]*/y,Ci=/<\/([A-Za-z_][\w:.-]*)\s*>/y,So=/\s*/y,Vh=/[A-Za-z_:][\w:.-]*/y,jh=/[^"<]*/y,Zh=/[^'<]*/y;function Fn(t,e,n){return t.lastIndex=n,t.test(e)?t.lastIndex:n}function zu(t,e){let n=Fn(So,t,e),o=Fn(Vh,t,n);if(n===e||o===n)return -1;let r=Fn(So,t,o);if(t[r]!=="=")return -1;let a=Fn(So,t,r+1),i=t[a];if(i!=='"'&&i!=="'")return -1;let s=Fn(i==='"'?jh:Zh,t,a+1);return t[s]===i?s+1:-1}function Xh(t,e){let n=Fn(So,t,e);return t[n]===">"?{end:n+1,selfClosing:false}:t.startsWith("/>",n)?{end:n+2,selfClosing:true}:null}function Yh(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 nt("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 nt("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 nt("The SVG has an unclosed declaration");r=l+2;continue}if(t.startsWith("<!",r))throw new nt("DOCTYPE and other declarations are not allowed");if(t[r+1]==="/"){Ci.lastIndex=r;let l=Ci.exec(t);if(!l)throw new nt("The SVG has a malformed closing tag");if(e.pop()!==l[1])throw new nt(`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 nt("The SVG has a malformed tag");let c=Mi.lastIndex;for(let l=zu(t,c);l>=0;l=zu(t,c))c=l;let s=Xh(t,c);if(!s)throw new nt(`The SVG has a malformed <${i[0]}> tag (attributes must be quoted and may not contain "<")`);if(n++,n>Ft.maxElements)throw new nt(`The SVG has more than ${Ft.maxElements} elements`);if(o||(o=i[0]),!s.selfClosing&&(e.push(i[0]),e.length>Ft.maxDepth))throw new nt(`The SVG nests elements more than ${Ft.maxDepth} deep`);r=s.end;}if(e.length>0)throw new nt(`The SVG doesn't close <${e.at(-1)}>`);return o}function Kh(t){if(typeof t!="string")throw new nt("Expected SVG markup as a string");let e=new TextEncoder().encode(t).length;if(e>Ft.maxBytes)throw new nt(`The SVG is ${Math.ceil(e/1e3)} KB; the limit is ${Ft.maxBytes/1e3} KB`);if(/<!(?:DOCTYPE|ENTITY|ATTLIST|ELEMENT|NOTATION)/i.test(t))throw new nt("DOCTYPE and entity declarations are not allowed");let n=t.replace(Hh,"");if(n.includes("<?"))throw new nt("Processing instructions (such as xml-stylesheet) are not allowed");if(Yh(n)!=="svg")throw new nt("The file must start with an <svg> element");return n}var Ri=t=>Math.round(Math.min(255,Math.max(0,t))).toString(16).padStart(2,"0");function qt(t){let e=t?.replace(/!important/i,"").trim();return e===""||e==="inherit"?void 0:e}function Ai(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"),Ai(c,e,n,o)):(o.add("external-paint"),null)}let a=lt(r==="currentColor"?e.color:r);return a?a.a<=0?null:`#${Ri(a.r)}${Ri(a.g)}${Ri(a.b)}`:(o.add("invalid-paint"),null)}function Jh(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&&qt(Y(i,"stop-color"));c&&o.set(r,c);}return o}function qu(t,e){return t.map(n=>{if(n.op==="Z")return n;if(n.op==="C"){let[a,i]=W(e,n.x1,n.y1),[c,s]=W(e,n.x2,n.y2),[l,m]=W(e,n.x,n.y);return {op:"C",x1:a,y1:i,x2:c,y2:s,x:l,y:m}}let[o,r]=W(e,n.x,n.y);return {op:n.op,x:o,y:r}})}function tp(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 vi(t){return t.length<3?[]:[...t.map(([e,n],o)=>({op:o===0?"M":"L",x:e,y:n})),{op:"Z"}]}var we=t=>Number.isFinite(t);function ct(t,e,n=0){let o=Number.parseFloat(t.attrs[e]??"");return we(o)?o:n}function Wu(t){switch(t.name){case "path":return ee(t.attrs.d??"");case "rect":{let e=t.attrs.rx??t.attrs.ry,n=t.attrs.ry??t.attrs.rx;return Yt(ct(t,"x"),ct(t,"y"),ct(t,"width"),ct(t,"height"),Number.parseFloat(e??"0")||0,Number.parseFloat(n??"0")||0)}case "circle":{let e=ct(t,"r");return Xt(ct(t,"cx"),ct(t,"cy"),e,e)}case "ellipse":return Xt(ct(t,"cx"),ct(t,"cy"),ct(t,"rx"),ct(t,"ry"));case "polygon":case "polyline":{let e=Zt(t.attrs.points),n=[];for(let o=0;o+1<e.length;o+=2)n.push([e[o],e[o+1]]);return vi(n)}default:return []}}function ep(t,e){let n=e/2;switch(t.name){case "rect":{let o=ct(t,"x"),r=ct(t,"y"),a=ct(t,"width"),i=ct(t,"height"),c=Number.parseFloat(t.attrs.rx??t.attrs.ry??"0")||0,s=Yt(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,...Yt(o+n,r+n,a-e,i-e,l,l)]}case "circle":case "ellipse":{let o=ct(t,"cx"),r=ct(t,"cy"),a=t.name==="circle"?ct(t,"r"):ct(t,"rx"),i=t.name==="circle"?ct(t,"r"):ct(t,"ry"),c=Xt(o,r,a+n,i+n);return a<=n||i<=n?c:[...c,...Xt(o,r,a-n,i-n)]}case "line":{let[o,r,a,i]=["x1","y1","x2","y2"].map(u=>ct(t,u)),c=Math.hypot(a-o,i-r);if(c===0)return [];let s=-(i-r)/c*n,l=(a-o)/c*n,m=[[o+s,r+l],[a+s,i+l],[a-s,i-l],[o-s,r-l]];return vi(tp(m)<0?m.reverse():m)}default:return null}}var np=new Set(["path","rect","circle","ellipse","polygon","polyline","line"]),rp=new Set(["defs","linearGradient","radialGradient","stop","title","desc","metadata"]),op={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"},ap=/^(?:qrdx[-_ ]?)?qr(?:[-_ ]?code)?$/i;function Vu(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 ju(t,e,n,o,r){if(Vu(t,o),qt(Y(t,"display"))==="none"||qt(Y(t,"visibility"))==="hidden")return;let a=Number.parseFloat(Y(t,"opacity")??"1"),i=qt(Y(t,"fill-rule")),c=Number.parseFloat(qt(Y(t,"stroke-width"))??""),s={matrix:st(e.matrix,Nt(t.attrs.transform)),fill:qt(Y(t,"fill"))??e.fill,fillRule:i==="evenodd"||i==="nonzero"?i:e.fillRule,stroke:qt(Y(t,"stroke"))??e.stroke,strokeWidth:we(c)&&c>=0?c:e.strokeWidth,color:qt(Y(t,"color"))??e.color,opacity:e.opacity*(we(a)?a:1)};for(let l of t.children){if(rp.has(l.name))continue;let m=op[l.name];if(m){o.add(m);continue}if(l.name==="svg"){o.add("nested-svg");continue}if(l.name==="g"||l.name==="a"){ju(l,s,n,o,r);continue}if(!np.has(l.name)){o.add("unknown");continue}ip(l,s,n,o,r);}}function ip(t,e,n,o,r){if(Vu(t,o),qt(Y(t,"display"))==="none"||qt(Y(t,"visibility"))==="hidden")return;let a=st(e.matrix,Nt(t.attrs.transform));if(t.name==="rect"&&ap.test(t.attrs.id??"")&&!r.qrBox){r.qrBox=Le(qu(Wu(t),a));return}let i=p=>qt(Y(t,p)),c=e.opacity*Number.parseFloat(i("opacity")??"1"),s=Number.parseFloat(i("fill-opacity")??"1"),l=Number.parseFloat(i("stroke-opacity")??"1"),m=i("fill-rule"),u={...e,fill:i("fill")??e.fill,fillRule:m==="evenodd"||m==="nonzero"?m:e.fillRule,stroke:i("stroke")??e.stroke,color:i("color")??e.color},f=Number.parseFloat(i("stroke-width")??""),d=we(f)&&f>=0?f:e.strokeWidth,g=(p,b,y)=>{if(p.length!==0){if(r.segments+=p.length,r.segments>Ft.maxInputSegments)throw new nt(`The SVG has more than ${Ft.maxInputSegments} path segments; simplify it`);r.shapes.push({segments:qu(p,a),fill:b,fillRule:y});}},h=p=>{let b=(we(c)?c:1)*(we(p)?p:1);return b<=0?false:(b<1&&o.add("opacity"),true)};if(t.name!=="line"){let p=Ai(u.fill,u,n,o);p&&h(s)&&g(Wu(t),p,u.fillRule);}if(d>0&&u.stroke!=="none"){let p=Ai(u.stroke,u,n,o);if(p&&h(l)){let b=ep(t,d);b?((i("stroke-dasharray")??"none")!=="none"&&o.add("dash"),g(b,p,t.name==="line"?"nonzero":"evenodd")):o.add("stroke");}}}function sp(t,e){let n=l=>{let m=10**e;return Math.round(l*m)/m+0},o=l=>x(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 m=n(l.x),u=n(l.y);if(l.op==="M")r+=`m${o(m-a)} ${o(u-i)}`,c=m,s=u;else if(l.op==="L"){if(m===a&&u===i)continue;r+=u===i?`h${o(m-a)}`:m===a?`v${o(u-i)}`:`l${o(m-a)} ${o(u-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(m-a)} ${o(u-i)}`;a=m,i=u;}return r}var cp=(t,e)=>t.x0<e.x1&&e.x0<t.x1&&t.y0<e.y1&&e.y0<t.y1;function lp(t){let e=[];for(let n of t){let o=Le(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=>cp(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 up(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 g=d+1;g<i.length;g++){let h=Pi(i[d]),p=Pi(i[g]),b=Math.hypot(h[0]-p[0],h[1]-p[1],h[2]-p[2]);b<s&&(s=b,c=[i[d],i[g]]);}let[l,m]=c,[u,f]=(o.get(l)??0)>=(o.get(m)??0)?[l,m]:[m,l];o.set(u,(o.get(u)??0)+(o.get(f)??0)),o.delete(f);for(let[d,g]of r)g===f&&r.set(d,u);a++;}return a>0&&n.add("colors",a),r}var Hu=t=>{let[e,n,o]=Pi(t);return .2126*e+.7152*n+.0722*o>235};function mp(t,e={}){let n=new Ei;try{let o=Kh(t),r=de(o);if(!r)throw new nt("No <svg> element found");let a=Zt(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=ct(r,"width"),l=ct(r,"height")),!(we(s)&&we(l)&&s>0&&l>0))throw new nt("The SVG needs a viewBox (or a width and height)");let u=Ft.artboardSide/Math.max(s,l),f=Math.round(s*u*10)/10,d=Math.round(l*u*10)/10;if(Math.min(f,d)<ot.minArtboard)throw new nt("The artboard is too narrow: its sides may differ by 20 times at most");let g=[u,0,0,u,-i*u,-c*u],h={shapes:[],qrBox:null,segments:0};ju(r,{matrix:g,fill:"#000000",fillRule:"nonzero",stroke:"none",strokeWidth:1,color:"#000000",opacity:1},Jh(r),n,h);let p={x0:0,y0:0,x1:f,y1:d},b=Math.max(f,d)*.004,y=[],_=0,w=0;for(let T of h.shapes){let U=Le(T.segments);if(!U||U.x1<=0||U.y1<=0||U.x0>=f||U.y0>=d){_++;continue}if(U.x0<-b||U.y0<-b||U.x1>f+b||U.y1>d+b){let z=wr(T.segments,.25).map(wt=>un(wt,p)).filter(wt=>wt.length>2);if(z.length===0){_++;continue}w++,y.push({...T,segments:z.flatMap(wt=>vi(wt))});}else y.push(T);}if(_>0&&n.add("outside",_),w>0&&n.add("clipped",w),y.length===0)throw new nt("The SVG has no filled shapes to use");let M=up(y,Ft.maxColors,n);for(let T of y)T.fill=M.get(T.fill)??T.fill;let S=new Map,$=new Map;for(let T of y){let U=Le(T.segments);S.set(T.fill,(S.get(T.fill)??0)+(U.x1-U.x0)*(U.y1-U.y0)),$.set(T.fill,($.get(T.fill)??0)+1);}let C=[...S.keys()].sort((T,U)=>Number(Hu(T))-Number(Hu(U))||S.get(U)-S.get(T)),R=C[0],E=C[1],P=T=>T===R?"frame":T===E?"accent":T,L=h.qrBox;if(!L&&e.qr){let[T,U]=W(g,e.qr.x,e.qr.y);L={x0:T,y0:U,x1:T+e.qr.size*u,y1:U+e.qr.size*u};}let F,k,N;L?(F=Math.min(L.x1-L.x0,L.y1-L.y0),k=(L.x0+L.x1-F)/2,N=(L.y0+L.y1-F)/2):(n.add("qr-placed"),F=Math.min(f,d)*.6,k=(f-F)/2,N=(d-F)/2);let I=T=>Math.round(T*10)/10+0;if(F=Math.floor(F*10)/10,k=I(k),N=I(N),F<Math.min(f,d)*ot.minQrShare)throw new nt("The QR area must be at least half the frame's shorter side");let B=Math.min(k,N,f-k-F,d-N-F);if(B<F*ot.minPadding-1e-9)throw new nt("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??Ft.padding,ot.minPadding),.2),O=Math.floor(Math.min(F*q,B)*10)/10,G=lp(y);if(G.length>ot.maxShapes)throw new nt(`The artwork has ${G.length} separate shapes; the limit is ${ot.maxShapes}. Combine shapes of the same color first`);let J={kind:Bn,version:Qn,artboard:{width:f,height:d},qr:{x:k,y:N,size:F,padding:O},colors:{frame:R,...E&&{accent:E}},shapes:G.map(T=>({type:"path",d:sp(T.segments,Ft.decimals),fill:P(T.fill),...T.fillRule==="evenodd"&&{fillRule:"evenodd"}})),labels:[]},pt=vr(J);if(!pt.success){let T=pt.issues[0];throw new nt(`The converted frame doesn't fit the frame format: ${T?.message??"invalid"}`)}let at=C.map(T=>({color:T,ref:T===R?"frame":T===E?"accent":"fixed",shapes:$.get(T)??0}));return {ok:!0,spec:pt.data,warnings:n.list(),palette:at}}catch(o){return {ok:false,error:o instanceof nt?o.message:`Could not read the SVG (${o instanceof Error?o.name:"error"})`,warnings:n.list()}}}var dp=1013,fp={"call-to-action":105,holidays:283,seasons:60,"food-drink":71,shopping:64,"beauty-wellness":26,events:77,places:71,"real-estate":35,automotive:27,"health-learning":48,"sports-fitness":36,business:82,nonprofit:28};var hp=[{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:"beauty-wellness",label:"Beauty & wellness"},{id:"events",label:"Events & weddings"},{id:"places",label:"Places & Wi-Fi"},{id:"real-estate",label:"Real estate"},{id:"automotive",label:"Cars & parking"},{id:"health-learning",label:"Health & learning"},{id:"sports-fitness",label:"Sports & fitness"},{id:"business",label:"Business & social"},{id:"nonprofit",label:"Nonprofits & community"}];function Li(t){return Array.isArray(t)?`[${t.map(Li).join(",")}]`:t&&typeof t=="object"?`{${Object.keys(t).filter(n=>t[n]!==void 0).sort().map(n=>`${JSON.stringify(n)}:${Li(t[n])}`).join(",")}}`:JSON.stringify(t)}function pp(t){let e=Li(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")}function gp(t,e){return gt.QrCode.encodeText(t,Rt[e??jt]).size}function Zu(t,e,n,o=n.size*(e?.size??Qo)){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=gp(n.value,n.level),c=At(i,n.margin,n.shape),s=n.size/(i+2*c);if(e.padding&&(r.padding=e.padding*s),a){let l=i*s,m=u=>Math.min(Math.max((u??.5)*l-o/2,0),l-o);r.x=m(e.x),r.y=m(e.y);}return r}function Xu(t,e,n,o){let r=n.level??jt,a=r;o&&(a=Tt({...n,imageSettings:Zu(t,e,n),autoLevel:o}));let i=s=>{let l=u=>Zu(t,e,{...n,level:s},u),m=Ka(n,[s],l().width,l);return m>0?l(m):void 0};if(a===r)return i(r);let c=i(a);return c&&Tt({...n,imageSettings:c,autoLevel:o})===a?c:i(r)}function bp({value:t,level:e,margin:n,shape:o,autoLevel:r,logoOptions:a}){let c=Xu("data:,",{...a,size:Bo},{value:`${t}`,size:1024,margin:n??dt,level:e,shape:o},r);return c?c.width/1024:0}function Fi({value:t,size:e=1024,fgColor:n,bgColor:o,eyeColor:r,dotColor:a,bodyPattern:i,hideLogo:c,logo:s,logoOptions:l,margin:m,cornerEyePattern:u,cornerEyeDotPattern:f,level:d,templateId:g,frame:h,eyeColors:p,moduleScale:b,autoLevel:y,shape:_}){let w={value:`${t}`,size:e,margin:m??dt,level:d,shape:_},M=!c&&s?Xu(s,l,w,y):void 0;return {value:w.value,bgColor:o,fgColor:n,eyeColor:r,dotColor:a,bodyPattern:i,cornerEyePattern:u,cornerEyeDotPattern:f,level:d,templateId:g,size:e,margin:m,...h&&{frame:h},...p&&{eyeColors:p},...b!==void 0&&{moduleScale:b},...y&&{autoLevel:y},..._&&_!=="square"&&{shape:_},...M&&{imageSettings:M}}}var Yu=.06,Ku=.16,Ju=512;function t0(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=Ma({width:e,height:n,data:o});if(!r)return null;let a=d=>{let g=d*4;return Math.hypot(o[g]/255-r[0],o[g+1]/255-r[1],o[g+2]/255-r[2])},i=new Uint8Array(e*n),c=new Int32Array(e*n),s=0,l=0,m=d=>{i[d]||o[d*4+3]===0||a(d)>=Ku||(i[d]=1,c[l++]=d);};for(let d=0;d<e;d++)m(d),m((n-1)*e+d);for(let d=0;d<n;d++)m(d*e),m(d*e+e-1);for(;s<l;){let d=c[s++],g=d%e;g>0&&m(d-1),g<e-1&&m(d+1),d>=e&&m(d-e),d<(n-1)*e&&m(d+e);}let u=new Uint8ClampedArray(o),f=r;for(let d=0;d<e*n;d++){if(!i[d])continue;let g=Math.min(1,Math.max(0,(a(d)-Yu)/(Ku-Yu))),h=d*4;if(u[h+3]=Math.round(o[h+3]*g),g>0&&g<1)for(let p=0;p<3;p++){let y=(o[h+p]/255-(1-g)*f[p])/g;u[h+p]=Math.round(Math.min(1,Math.max(0,y))*255);}}return {width:e,height:n,data:u}}async function yp(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,Ju/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=t0(c);return s?(c.data.set(s.data),i.putImageData(c,0,0),a.toDataURL("image/png")):null}catch{return null}finally{a.remove();}}var _p={value:true,size:true,level:true,bgColor:true,fgColor:true,eyeColor:true,dotColor:true,bodyPattern:true,cornerEyePattern:true,cornerEyeDotPattern:true,margin:true,style:true,imageSettings:true,isOGContext:true,templateId:true,customTemplate:true,customProps:true,frame:true,art:true,eyeColors:true,moduleScale:true,autoLevel:true,shape:true,frameLabelMarkers:true,partMarkers:true,hideLogo:true,logo:true,logoOptions:true,scale:true};function xp(t){let e={};for(let n of Object.keys(t))Object.hasOwn(_p,n)||(e[n]=t[n]);return e}function wo(t){return Fi({value:t.value,fgColor:t.fgColor,hideLogo:t.hideLogo,bgColor:t.bgColor,eyeColor:t.eyeColor,dotColor:t.dotColor,bodyPattern:t.bodyPattern,cornerEyePattern:t.cornerEyePattern,cornerEyeDotPattern:t.cornerEyeDotPattern,level:t.level,templateId:t.templateId,logo:t.logo,logoOptions:t.logoOptions,margin:t.margin??dt,autoLevel:t.autoLevel,shape:t.shape})}function Mo(t,e){let{size:n=ut,scale:o=1,level:r,style:a,customTemplate:i,customProps:c,frame:s,art:l,eyeColors:m,moduleScale:u,autoLevel:f,shape:d,frameLabelMarkers:g,partMarkers:h}=t,p=n*o,b=p/e.size,y=e.imageSettings&&{...e.imageSettings,height:e.imageSettings.height*b,width:e.imageSettings.width*b,...e.imageSettings.x!=null&&{x:e.imageSettings.x*b},...e.imageSettings.y!=null&&{y:e.imageSettings.y*b},...e.imageSettings.padding!=null&&{padding:e.imageSettings.padding*b}};return {art:l,bgColor:e.bgColor,bodyPattern:e.bodyPattern,cornerEyeDotPattern:e.cornerEyeDotPattern,cornerEyePattern:e.cornerEyePattern,customProps:c,customTemplate:i,dotColor:e.dotColor,eyeColor:e.eyeColor,fgColor:e.fgColor,frame:s,level:r||e.level,margin:e.margin,...m&&{eyeColors:m},...u!==void 0&&{moduleScale:u},...f&&{autoLevel:f},...d&&d!=="square"&&{shape:d},...g&&{frameLabelMarkers:g},...h&&{partMarkers:h},size:p,style:a,templateId:e.templateId,value:e.value,...y&&{imageSettings:y},...xp(t)}}function $p(t){return Mo(t,wo(t))}function e0(t,e){let n=[],o=r=>{if(r==null||typeof r=="boolean")return;if(typeof r=="string"||typeof r=="number"||typeof r=="bigint"){n.push(`${r}`);return}if(Array.isArray(r)){for(let l of r)o(l);return}if(!Pe(r))throw new TypeError("qrdx: can't render this value");let{type:a,props:i,key:c}=r;if(sn(a)){o(i.children);return}if(typeof a=="function"){o(a(i));return}let s={};for(let l of Object.keys(i)){let m=vn(l,i[l]);m&&(s[m.name]=m.value);}n.push(e(a,s,e0(i.children,e),c));};return o(t),n}var n0={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"]},r0={diamond:["square"],pacman:["rounded"],"small-square":["square","rounded"]},o0=["circle","curly"],a0=["diamond","banner","star"],i0={circle:["square","rounded","diya","extra-rounded","message","pointy","leaf","leaf-reverse","drop","bevel","squircle","cushion","shield","petal"]},Wt=["square","liquid","classy","classy-rounded"],s0={"circle/rounded":Wt,"circle/extra-rounded":Wt,"circle/message":[...Wt,"leaf"],"circle/pointy":Wt,"circle/leaf-reverse":Wt,"circle/drop":Wt,"circle/bevel":[...Wt,"leaf"],"circle/squircle":[...Wt,"circle","diamond","circle-mixed","rounded","horizontal-line","leaf","heart","mosaic","octagon"],"circle/cushion":Wt,"circle/shield":[...Wt,"rounded","horizontal-line","leaf"],"circle/petal":Wt};function c0(t,e,n){return (i0[t]?.includes(e)??false)&&!s0[`${t}/${e}`]?.includes(n)}function Ii(t){let e=t.bodyPattern??"circle",n=t.cornerEyePattern??"gear",o=t.cornerEyeDotPattern??"circle";return n0[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"}:r0[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"}:a0.includes(o)?{kind:"dot",message:`${o} centres are missed in sharp renders and up close`,fix:"Pick a square, rounded or circle centre"}:o0.includes(n)?{kind:"eye",message:`${n} eyes only read in lenient decoders`,fix:"Pick square, rounded or gear eyes"}:c0(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}var In=300,fr=t=>{let e=typeof t=="number"?t:Number.parseFloat(String(t));return Number.isFinite(e)?e:void 0};function Sp(t){let e=fr(t.x)??0,n=fr(t.y)??0,o=Zt(typeof t.viewBox=="string"?t.viewBox:void 0),r=fr(t.width),a=fr(t.height);if(o.length!==4||!(o[2]&&o[3]&&r&&a))return [1,0,0,1,e,n];let[i,c,s,l]=o,m=Math.min(r/s,a/l);return [m,0,0,m,e+(r-s*m)/2-i*m,n+(a-l*m)/2-c*m]}function ki(t,e,n,o){if(t===e)return n;if(Array.isArray(t)){for(let c of t){let s=ki(c,e,n,false);if(s)return s}return null}let r=t;if(!r||typeof r!="object"||!r.props)return null;let{props:a}=r,i=st(n,Nt(typeof a.transform=="string"?a.transform:void 0));return r.type==="svg"&&!o&&(i=st(i,Sp(a))),ki(a.children,e,i,false)}function Ti(t){let e=t.customTemplate||(t.templateId?Xr(t.templateId):void 0);if(!e)return 1;let n={type:"svg",props:{height:In,viewBox:`0 0 ${In} ${In}`,width:In},key:null},o;try{o=e.wrapper(n,{fgColor:typeof t.fgColor=="string"?t.fgColor:void 0,bgColor:typeof t.bgColor=="string"?t.bgColor:void 0,...t.customProps??{}},{pixelSize:10,url:t.value});}catch{return 1}let r=o?.props;if(!r)return 1;let a=Zt(typeof r.viewBox=="string"?r.viewBox:void 0),i=a.length===4?a[2]:fr(r.width),c=ki(o,n,dn,true);if(!(c&&i))return 1;let[s,l]=W(c,0,0),[m,u]=W(c,In,In),d=Math.min(Math.abs(m-s),Math.abs(u-l))/i;return d>0&&d<=1?d:1}var p0=[96,160,320],Oi=640;function Bi(){if(typeof document>"u")throw new Error("Scan scoring needs a browser (canvas + image decoding)")}function Ce(t){if(t?.aborted)throw new DOMException("Scan scoring was aborted","AbortError")}var g0=()=>new Promise(t=>setTimeout(t,0));async function Qi(){let{default:t}=await import('jsqr');return t}function Di(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 wp(t,e,n=.7){let{data:o,width:r,height:a}=t;for(let m=0;m<o.length;m+=4)for(let u=0;u<3;u++)o[m+u]=128+(o[m+u]-128)*n;let i=Math.max(1,Math.round(e*.25)),c=2*i+1,s=new Float32Array(r*a*3),l=m=>{let u=m?a:r,f=m?r:a,d=m?r:1,g=m?1:r;for(let h=0;h<u;h++){let p=h*d,b=0,y=0,_=0;for(let w=-i;w<=i;w++){let M=(p+Math.min(Math.max(w,0),f-1)*g)*4;b+=o[M],y+=o[M+1],_+=o[M+2];}for(let w=0;w<f;w++){let M=(p+w*g)*3;s[M]=b/c,s[M+1]=y/c,s[M+2]=_/c;let S=(p+Math.max(w-i,0)*g)*4,$=(p+Math.min(w+i+1,f-1)*g)*4;b=b-o[S]+o[$],y=y-o[S+1]+o[$+1],_=_-o[S+2]+o[$+2];}}for(let h=0,p=0;h<r*a*3;h+=3,p+=4)o[p]=s[h],o[p+1]=s[h+1],o[p+2]=s[h+2];};for(let m=0;m<2;m++)l(true),l(false);}function kn(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 Mp=[.9,1,1.1];function Gi(t,e,n,o,r){let a=0;for(let i of Mp){let c=n*i,s=e(c);wp(s,c/o),r(t(s.data,s.width,s.height))&&a++;}return a>=2?"pass":a===1?"fragile":"fail"}var Ni={small:"small print or far away",medium:"typical phone distance",large:"close up"};function Cp(t,e){return t===e[0]&&e.length>1?Ni.small:t===e.at(-1)?Ni.large:Ni.medium}function b0(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 y0(t,e,n){let o=`${t} px (${Cp(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 _0(t,e){return e?"fails":t>=85?"great":t>=65?"ok":"risky"}function Rp(t,e,n){let o=Bt(t,e);if(o.type==="solid")return [o.color];if(o.type!=="image")return o.stops.map(c=>c.color);let r=o.underlay?Ro(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=Ro(c);if(!s)return [];let l={...s,a:s.a*i};if(!r)return [l0(l)];let m=l.a+r.a*(1-l.a),u=(f,d)=>m>0?(f*l.a+d*r.a*(1-l.a))/m:0;return [l0({r:u(l.r,r.r),g:u(l.g,r.g),b:u(l.b,r.b),a:m})]})}var l0=({r:t,g:e,b:n,a:o})=>`rgba(${Math.round(t)}, ${Math.round(e)}, ${Math.round(n)}, ${Math.round(o*1e3)/1e3})`;function Ep(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:Pn(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 Ap(t){Bi();let e=await gr(t),{canvas:n,ctx:o}=kn(64,64);o.drawImage(e,0,0,64,64);let r=Ep(o.getImageData(0,0,64,64));return n.remove(),r}function x0(t){let e=[t.bgColor,t.fgColor,t.eyeColor,t.dotColor,...Sr.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 hr=null;function Ro(t){let e=lt(t);if(e||typeof document>"u")return e;if(hr??=document.createElement("canvas").getContext("2d"),!hr)return null;hr.fillStyle="#010203",hr.fillStyle=t;let n=String(hr.fillStyle);return n==="#010203"?null:lt(n)}var u0=t=>Pn(t.r,t.g,t.b),$0=(t,e)=>(Math.max(t,e)+.05)/(Math.min(t,e)+.05),pr=4.5,Pp=3,m0=1.5,d0={code:7,background:12},f0={r:255,g:255,b:255,a:1},h0=(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 vp(t,e={}){let n=e.imageTones,o=(d,g)=>{let h=typeof d=="object"&&d?.type==="image";return Rp(d,g,n).map(p=>({color:p,picture:h}))},r=t.fgColor??Mt,a=Sr.flatMap(d=>{let g=t.eyeColors?.[d];return [...g?.outer?o(g.outer,Mt):[],...g?.inner?o(g.inner,Mt):[]]}),i=[...o(r,Mt),...o(t.eyeColor??r,Mt),...o(t.dotColor??r,Mt),...a],c=o(t.bgColor,bt),s=(c.length>0?c:[{color:"#ffffff",picture:false}]).map(d=>{let g=Ro(d.color);return {color:g?h0(g,f0):f0,picture:d.picture}}),l=i.flatMap(d=>{let g=Ro(d.color);return g?[{color:g,picture:d.picture}]:[]}),m=Number.POSITIVE_INFINITY,u=pr,f=false;for(let d of l)for(let g of s){let h=u0(h0(d.color,g.color)),p=u0(g.color),b=$0(h,p),y=g.picture?d0.background:d.picture?d0.code:pr;b/y<m/u&&(m=b,u=y),h>p&&(f=true);}return {ratio:Number.isFinite(m)?m:Number.POSITIVE_INFINITY,required:u,inverted:f}}function Lp(t,e){let{ratio:n,inverted:o,required:r}=vp(t,{imageTones:e});if(!Number.isFinite(n))return {checks:[],penalty:0,fails:false};let a=r/pr,i=r!==pr,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<m0*a?60:n<Pp*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<m0*(r/pr)}}function Ui(t){return gt.QrCode.encodeText(t.value,Rt[Tt(t)]).getModules()}function Fp(t){let{imageSettings:e}=t;if(!e)return {check:null,penalty:0};let n=Ui(t),o=xe(n,t.size??ut,At(n.length,t.margin??dt,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(([g,h])=>r.x<g+9&&r.x+r.w>g&&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 m=r.w*r.h/(a*a),u=Tt(t),f=Math.round(m*100),d=no({value:t.value,size:t.size??ut,margin:t.margin??dt,level:u,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 Ip(t){let e=$a(t.shape)?Be(t.margin??dt):t.margin??dt,n=Ui(t).length+2*e,o=e+(kt(t.frame)?ya(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 kp(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 gr(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 Tp=`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 Np(t){let{imageSettings:e}=t;if(!e||e.src.startsWith("data:"))return t;let n=Tp;try{let o=await gr(e.src),{canvas:r,ctx:a}=kn(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 Op(t){let e=new Map;for(let r of x0(t))if(!r.startsWith("data:"))try{let a=await gr(r),{canvas:i,ctx:c}=kn(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??Mt},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 S0(t,e,n,o,r){let a=[],i=0,c=Lp(t,r);i+=c.penalty;let s=Fp(t);i+=s.penalty;let l=Ip(t);i+=l.penalty;let m=kp(t);i+=m.penalty;let u=Ii(t),f=u?.kind==="eye"?null:u;f&&f.kind!=="sharp-dot-eye"&&(i+=10);let d=await Qi();Ce(o);let g=Ui(t).length,h=g+2*At(g,t.margin??dt,t.shape),p=[],b=false;for(let[w,M]of n.entries()){await g0(),Ce(o);let S=Gi(d,e,M,h,$=>Di($,t.value));i+=b0(w,n.length,S),p.push(y0(M,n,S)),w===n.length-1&&S==="fail"&&(b=true);}a.push(...p,...c.checks),s.check&&a.push(s.check),a.push(m.check,l.check),f&&a.push({id:"style-pair",passed:false,message:f.message,fix:f.fix});let y=b||c.fails,_=Math.max(0,Math.min(100,100-i));return y&&(_=Math.min(_,30)),{score:_,grade:_0(_,y),checks:a}}function w0(t){return [...t.sizes??p0].filter(e=>e>0).sort((e,n)=>e-n)}async function W3(t,e={}){Bi();let{signal:n}=e,o=w0(e),r=Oi/Ti(t),a=await Op(await Np(Ve({...t,size:t.size??ut},r)));Ce(n);let i={};for(let u of x0(t))try{let f=await Ap(u);f&&(i[u]=f);}catch{}Ce(n);let c=await Ut(a),s=await gr(c);Ce(n);let l=oe(r,t.frame);return await S0(t,u=>{let f=u/Oi,d=l.width*f,g=l.height*f,h=Math.max(8,Math.round(u*.12)),{canvas:p,ctx:b}=kn(d+2*h,g+2*h);b.fillStyle="#ffffff",b.fillRect(0,0,p.width,p.height),b.drawImage(s,h,h,d,g);let y=b.getImageData(0,0,p.width,p.height);return p.remove(),y},o,n,i)}var H3=Oi;async function V3(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=w0(n),i=t.size??ut,c=oe(i,t.frame),s=o*i*Ti(t)/c.width,l={data:Dp(e),width:o,height:r};return await S0(t,u=>{let f=M0(l,u/s),d=Math.max(8,Math.round(u*.12));return Bp(f,d)},a,n.signal)}function Dp(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 Bp(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 Me=(t,e)=>Math.hypot(t.x-e.x,t.y-e.y);function Co(t,e){return .299*t[e]+.587*t[e+1]+.114*t[e+2]}function Qp(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,m=(n-o)/s,u=r*s*(l-m)**2;u>a&&(a=u,i=c);}return i}async function Gp(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 gr(e);return await n.decode?.().catch(()=>{}),n}finally{setTimeout(()=>URL.revokeObjectURL(e),1e3);}}async function j3(t,e={}){Bi();let{signal:n}=e,o=[...e.sizes??p0].filter(Q=>Q>0).sort((Q,et)=>Q-et),r=await Qi(),a=await Gp(t);Ce(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:m}=kn(i*s,c*s);m.fillStyle="#ffffff",m.fillRect(0,0,l.width,l.height),m.drawImage(a,0,0,l.width,l.height);let u=m.getImageData(0,0,l.width,l.height),f=r(u.data,u.width,u.height);if(Ce(n),!f){let Q=await ou(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:g}=f,h=17+4*g,p=(Me(d.topLeftCorner,d.topRightCorner)+Me(d.bottomLeftCorner,d.bottomRightCorner)+Me(d.topLeftCorner,d.bottomLeftCorner)+Me(d.topRightCorner,d.bottomRightCorner))/4,b=p/h,y=[d.topLeftCorner,d.topRightCorner,d.bottomRightCorner,d.bottomLeftCorner],_=Math.max(0,Math.floor(Math.min(...y.map(Q=>Q.x)))),w=Math.min(u.width,Math.ceil(Math.max(...y.map(Q=>Q.x)))),M=Math.max(0,Math.floor(Math.min(...y.map(Q=>Q.y)))),S=Math.min(u.height,Math.ceil(Math.max(...y.map(Q=>Q.y)))),$=[],C=0,R=new Array(256).fill(0),E=0;for(let Q=M;Q<S;Q++)for(let et=_;et<w;et++){let V=Math.round(Co(u.data,(Q*u.width+et)*4));R[V]=R[V]+1,E++;}let P=Qp(R,E),L={dark:[0,0,0,0],light:[0,0,0,0]};for(let Q=M;Q<S;Q++)for(let et=_;et<w;et++){let V=(Q*u.width+et)*4,mt=Co(u.data,V)<=P?L.dark:L.light;mt[0]=mt[0]+u.data[V],mt[1]=mt[1]+u.data[V+1],mt[2]=mt[2]+u.data[V+2],mt[3]=mt[3]+1;}let F=Q=>{let et=Math.max(Q[3],1);return Pn(Q[0]/et,Q[1]/et,Q[2]/et)},k=F(L.dark),N=F(L.light),I=$0(k,N),B=Math.round(I*10)/10;I>=4.5?$.push({id:"contrast",passed:true,message:`Contrast ${B}:1 in the image`}):(C+=I<2?30:10,$.push({id:"contrast",passed:false,message:`Low contrast in the image (${B}: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 et=Math.min(u.width-1,Math.max(0,Math.round(Q.x))),V=Math.min(u.height-1,Math.max(0,Math.round(Q.y)));return Co(u.data,(V*u.width+et)*4)}).filter(Q=>Q>P).length>=2;O?(C+=10,$.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"})):$.push({id:"polarity",passed:true,message:"Dark code on a light background"});let G=Math.max(2,Math.round(b*2)),J={minX:_-G,maxX:w+G,minY:M-G,maxY:S+G};if(J.minX<0||J.minY<0||J.maxX>u.width||J.maxY>u.height)$.push({id:"quiet-zone",passed:true,skipped:true,message:"The image is cropped too tight to check the quiet zone"});else {let Q=0,et=0;for(let V=J.minY;V<J.maxY;V++)for(let mt=J.minX;mt<J.maxX;mt++){if(mt>=_&&mt<w&&V>=M&&V<S)continue;let Tn=Co(u.data,(V*u.width+mt)*4);(O?Tn>P:Tn<=P)&&Q++,et++;}Q/Math.max(et,1)>.12?(C+=10,$.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"})):$.push({id:"quiet-zone",passed:true,message:"Clear space around the code"});}b<2?$.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"}):$.push({id:"resolution",passed:true,message:`About ${Math.round(b)} px per module`});let at=Math.round(b*4),T=Math.max(0,_-at),U=Math.max(0,M-at),z=Math.min(u.width,w+at)-T,wt=Math.min(u.height,S+at)-U,Re=Q=>{let et=Q/p,V=kn(z*et,wt*et);V.ctx.drawImage(l,T,U,z,wt,0,0,V.canvas.width,V.canvas.height);let mt=V.ctx.getImageData(0,0,V.canvas.width,V.canvas.height);return V.canvas.remove(),mt},It=[],Jt=false;for(let[Q,et]of o.entries()){await g0(),Ce(n);let V=Gi(r,Re,et,h,mt=>mt?.data===f.data);C+=b0(Q,o.length,V),It.push(y0(et,o,V)),Q===o.length-1&&V==="fail"&&(Jt=true);}l.remove();let Ee=Math.max(0,Math.min(100,100-C));return Jt&&(Ee=Math.min(Ee,30)),{data:f.data,version:g,score:Ee,grade:_0(Ee,Jt),checks:[...It,...$]}}var Up=[320];function M0(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),m=Math.max(l+1,Math.min(t.height,Math.floor((s+1)*c)));for(let u=0;u<o;u++){let f=Math.floor(u*i),d=Math.max(f+1,Math.min(t.width,Math.floor((u+1)*i))),g=0,h=0,p=0,b=0;for(let w=l;w<m;w++)for(let M=f;M<d;M++){let S=(w*t.width+M)*4;g+=t.data[S],h+=t.data[S+1],p+=t.data[S+2],b+=t.data[S+3];}let y=(m-l)*(d-f),_=(s*o+u)*4;a[_]=g/y,a[_+1]=h/y,a[_+2]=p/y,a[_+3]=b/y;}}return {data:a,width:o,height:r,colorSpace:"srgb"}}function zp(t){try{return new TextDecoder("utf-8",{fatal:!0}).decode(Uint8Array.from(t.binaryData))}catch{return t.data}}async function Z3(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 Qi(),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=zp(c),{version:l,location:m}=c;if(!Di(c,e))return {data:s,version:l,passed:false};let u=17+4*l,f=(Me(m.topLeftCorner,m.topRightCorner)+Me(m.bottomLeftCorner,m.bottomRightCorner)+Me(m.topLeftCorner,m.bottomLeftCorner)+Me(m.topRightCorner,m.bottomRightCorner))/4;for(let d of n.sizes??Up)if(Gi(a,h=>M0(i,h/f),d,u,h=>Di(h,e))!=="pass")return {data:s,version:l,passed:false};return {data:s,version:l,passed:true}}var qp=16,C0=.01;function Wp(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 m=r/a,u=(o-r)/l,f=a*l*(m-u)**2;f>i&&(i=f,c=s);}return (c+.5)/255}function Hp(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 g=r[d*4+3]/255,h=.2126*r[d*4]+.7152*r[d*4+1]+.0722*r[d*4+2];l[d]=1-(h*g+255*(1-g))/255;}let m=Wp(l);for(let d=0;d<a;d++)i[d]=l[d]>m?1:0;let u=0,f=0;for(let d=0;d<n;d++)for(let g of [0,o-1])u++,f+=i[g*n+d];for(let d=1;d<o-1;d++)for(let g of [0,n-1])u++,f+=i[d*n+g];if(f>u/2)for(let d=0;d<a;d++)i[d]=i[d]?0:1;return i}function R0(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 m of c){let u=m%e,f=(m-u)/e;(u===0||f===0||u===e-1||f===n-1)&&(s=true);for(let[d,g]of [[u-1,f],[u+1,f],[u,f-1],[u,f+1]]){if(d<0||g<0||d>=e||g>=n)continue;let h=g*e+d;!a[h]&&t[h]===r&&(a[h]=1,c.push(h));}}if((r===1||!s)&&c.length<o)for(let m of c)t[m]=r?0:1;}}}function E0(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=Hp(t,e.mode??"auto"),i=a.reduce(($,C)=>$+C,0);R0(a,n,o,Math.max(16,i*C0));let c=n,s=o,l=-1,m=-1;for(let $=0;$<o;$++)for(let C=0;C<n;C++)a[$*n+C]&&(c=Math.min(c,C),s=Math.min(s,$),l=Math.max(l,C),m=Math.max(m,$));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 u=l-c+1,f=m-s+1;if(Math.max(u,f)<qp)throw new Error("The shape is too small to trace; use a bigger picture");let g=Math.min(Math.max(Math.round(e.cells??ve),me),ve)/Math.max(u,f),h=Math.max(me,Math.round(u*g)),p=Math.max(me,Math.round(f*g)),b=Math.max(1,Math.round(u*g)),y=Math.max(1,Math.round(f*g)),_=Math.floor((h-b)/2),w=Math.floor((p-y)/2),M=new Uint8Array(h*p);for(let $=0;$<y;$++){let C=s+Math.floor($*f/y),R=Math.max(C+1,s+Math.floor(($+1)*f/y));for(let E=0;E<b;E++){let P=c+Math.floor(E*u/b),L=Math.max(P+1,c+Math.floor((E+1)*u/b)),F=0;for(let k=C;k<R;k++)for(let N=P;N<L;N++)F+=a[k*n+N];M[($+w)*h+E+_]=F*2>=(R-C)*(L-P)?1:0;}}let S=M.reduce(($,C)=>$+C,0);if(R0(M,h,p,Math.max(4,S*C0)),!M.includes(1))throw new Error("The shape is too small to trace; use a bigger picture");return {type:"silhouette",width:h,height:p,cells:Array.from(M,$=>$?"1":"0").join("")}}var zi=512;async function Vp(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 jp(t,e={}){if(typeof document>"u")throw new Error("loadQRSilhouette needs a browser; pass decoded pixels to createQRSilhouette instead");let n=await Vp(t),o=n.naturalWidth||n.width||zi,r=n.naturalHeight||n.height||zi,a=zi/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 m;try{m=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 E0(m,e)}function qi(t){return br(ro,()=>cr(t))}var Yp=react.memo(t=>{let{value:e,fgColor:n,hideLogo:o,logo:r,logoOptions:a,bgColor:i,eyeColor:c,dotColor:s,bodyPattern:l,cornerEyePattern:m,cornerEyeDotPattern:u,level:f,margin:d=dt,templateId:g,autoLevel:h,shape:p}=t,b=react.useMemo(()=>wo(t),[e,n,o,r,a,d,h,p,i,c,s,l,m,u,f,g]);return jsxRuntime.jsx(qi,{...Mo(t,b)})});Yp.displayName="QRCode";/**
27
27
  * @license QR Code generator library (TypeScript)
28
28
  * Copyright (c) Project Nayuki.
29
29
  * SPDX-License-Identifier: MIT
30
- */Object.defineProperty(exports,"angularGradientSchema",{enumerable:true,get:function(){return schemas_js.angularGradientSchema}});Object.defineProperty(exports,"anyFrameSchema",{enumerable:true,get:function(){return schemas_js.anyFrameSchema}});Object.defineProperty(exports,"baseTemplatePropsSchema",{enumerable:true,get:function(){return schemas_js.baseTemplatePropsSchema}});Object.defineProperty(exports,"bodyPatternSchema",{enumerable:true,get:function(){return schemas_js.bodyPatternSchema}});Object.defineProperty(exports,"colorConfigSchema",{enumerable:true,get:function(){return schemas_js.colorConfigSchema}});Object.defineProperty(exports,"colorTypeSchema",{enumerable:true,get:function(){return schemas_js.colorTypeSchema}});Object.defineProperty(exports,"cornerEyeDotPatternSchema",{enumerable:true,get:function(){return schemas_js.cornerEyeDotPatternSchema}});Object.defineProperty(exports,"cornerEyePatternSchema",{enumerable:true,get:function(){return schemas_js.cornerEyePatternSchema}});Object.defineProperty(exports,"customFrameSchema",{enumerable:true,get:function(){return schemas_js.customFrameSchema}});Object.defineProperty(exports,"errorLevelSchema",{enumerable:true,get:function(){return schemas_js.errorLevelSchema}});Object.defineProperty(exports,"excavationSchema",{enumerable:true,get:function(){return schemas_js.excavationSchema}});Object.defineProperty(exports,"eyeColorOverrideSchema",{enumerable:true,get:function(){return schemas_js.eyeColorOverrideSchema}});Object.defineProperty(exports,"eyeColorsSchema",{enumerable:true,get:function(){return schemas_js.eyeColorsSchema}});Object.defineProperty(exports,"frameSchema",{enumerable:true,get:function(){return schemas_js.frameSchema}});Object.defineProperty(exports,"frameSpecColorSchema",{enumerable:true,get:function(){return schemas_js.frameSpecColorSchema}});Object.defineProperty(exports,"frameSpecLabelSchema",{enumerable:true,get:function(){return schemas_js.frameSpecLabelSchema}});Object.defineProperty(exports,"frameSpecPaintSchema",{enumerable:true,get:function(){return schemas_js.frameSpecPaintSchema}});Object.defineProperty(exports,"frameSpecSchema",{enumerable:true,get:function(){return schemas_js.frameSpecSchema}});Object.defineProperty(exports,"frameSpecShapeSchema",{enumerable:true,get:function(){return schemas_js.frameSpecShapeSchema}});Object.defineProperty(exports,"frameStyleSchema",{enumerable:true,get:function(){return schemas_js.frameStyleSchema}});Object.defineProperty(exports,"getFrameSpecIssues",{enumerable:true,get:function(){return schemas_js.getFrameSpecIssues}});Object.defineProperty(exports,"gradientStopSchema",{enumerable:true,get:function(){return schemas_js.gradientStopSchema}});Object.defineProperty(exports,"imageFitSchema",{enumerable:true,get:function(){return schemas_js.imageFitSchema}});Object.defineProperty(exports,"imagePaintSchema",{enumerable:true,get:function(){return schemas_js.imagePaintSchema}});Object.defineProperty(exports,"imagePositionSchema",{enumerable:true,get:function(){return schemas_js.imagePositionSchema}});Object.defineProperty(exports,"imageSettingsSchema",{enumerable:true,get:function(){return schemas_js.imageSettingsSchema}});Object.defineProperty(exports,"linearGradientSchema",{enumerable:true,get:function(){return schemas_js.linearGradientSchema}});Object.defineProperty(exports,"logoOptionsSchema",{enumerable:true,get:function(){return schemas_js.logoOptionsSchema}});Object.defineProperty(exports,"logoShapeSchema",{enumerable:true,get:function(){return schemas_js.logoShapeSchema}});Object.defineProperty(exports,"pickableCornerEyeDotPatternSchema",{enumerable:true,get:function(){return schemas_js.pickableCornerEyeDotPatternSchema}});Object.defineProperty(exports,"pickableCornerEyePatternSchema",{enumerable:true,get:function(){return schemas_js.pickableCornerEyePatternSchema}});Object.defineProperty(exports,"qrArtImageSchema",{enumerable:true,get:function(){return schemas_js.qrArtImageSchema}});Object.defineProperty(exports,"qrArtModeSchema",{enumerable:true,get:function(){return schemas_js.qrArtModeSchema}});Object.defineProperty(exports,"qrArtSchema",{enumerable:true,get:function(){return schemas_js.qrArtSchema}});Object.defineProperty(exports,"qrArtVariantSchema",{enumerable:true,get:function(){return schemas_js.qrArtVariantSchema}});Object.defineProperty(exports,"qrCodeShapeSchema",{enumerable:true,get:function(){return schemas_js.qrCodeShapeSchema}});Object.defineProperty(exports,"qrPropsSchema",{enumerable:true,get:function(){return schemas_js.qrPropsSchema}});Object.defineProperty(exports,"qrShapeSchema",{enumerable:true,get:function(){return schemas_js.qrShapeSchema}});Object.defineProperty(exports,"qrSilhouetteSchema",{enumerable:true,get:function(){return schemas_js.qrSilhouetteSchema}});Object.defineProperty(exports,"radialGradientSchema",{enumerable:true,get:function(){return schemas_js.radialGradientSchema}});Object.defineProperty(exports,"solidColorSchema",{enumerable:true,get:function(){return schemas_js.solidColorSchema}});Object.defineProperty(exports,"templateConfigSchema",{enumerable:true,get:function(){return schemas_js.templateConfigSchema}});Object.defineProperty(exports,"templateDefinitionBaseSchema",{enumerable:true,get:function(){return schemas_js.templateDefinitionBaseSchema}});Object.defineProperty(exports,"OFFICIAL_FRAME_INDEX",{enumerable:true,get:function(){return framesIndex_js.OFFICIAL_FRAME_INDEX}});Object.defineProperty(exports,"OFFICIAL_FRAMES",{enumerable:true,get:function(){return framesOfficial_js.OFFICIAL_FRAMES}});Object.defineProperty(exports,"getOfficialFrame",{enumerable:true,get:function(){return framesOfficial_js.getOfficialFrame}});Object.defineProperty(exports,"QRCodeCanvas",{enumerable:true,get:function(){return qrCodeCanvas_js.QRCodeCanvas}});exports.AUTO_LEVEL_LOGO_COVERAGE=Go;exports.Arrow=ol;exports.BODY_PATTERN=T0;exports.BUILT_IN_FRAMES=pa;exports.BUILT_IN_FRAME_SPECS=a1;exports.CORNER_EYE_DOT_PATTERNS=L0;exports.CORNER_EYE_PATTERNS=k0;exports.CUSTOM_FRAME_STYLE=Qn;exports.DEFAULT_ART_INTENSITY=Cc;exports.DEFAULT_FRAME_TEXT=Oo;exports.DEFAULT_MARGIN=dt;exports.DEFAULT_SIZE=ut;exports.DOWNLOAD_FORMATS=yi;exports.DotRing=Ml;exports.EPS_IMAGE_FILL_REASON=Lu;exports.EYE_POSITIONS=Sr;exports.FRAME_COLOR_TOKENS=Ko;exports.FRAME_FONT_FAMILY=Dr;exports.FRAME_FONT_SCALE_MAX=sn;exports.FRAME_FONT_SCALE_MIN=Nn;exports.FRAME_GAP_RATIO=Ys;exports.FRAME_ICONS=Yo;exports.FRAME_ICON_BOX=ca;exports.FRAME_ICON_MAX_SEGMENTS=ms;exports.FRAME_IMPORT_LIMITS=Ft;exports.FRAME_LABEL_ATTRIBUTE=Ks;exports.FRAME_SPEC_KIND=Dn;exports.FRAME_SPEC_LABEL_MAX_FONT=Gn;exports.FRAME_SPEC_LIMITS=ot;exports.FRAME_SPEC_VERSION=Bn;exports.FRAME_STYLES=N0;exports.FRAME_TEXT_MAX_LENGTH=te;exports.Fragment=Ht;exports.FrameSpecError=Xn;exports.GRADIENT_FRAME_DEFAULTS=i1;exports.Halloween=El;exports.LOGO_CLEANUP_MAX_SIDE=Vu;exports.LOGO_EC_SAFETY=Xl;exports.LOGO_PADDING_MAX=B0;exports.LOGO_PLATE_INSET=Gr;exports.LOGO_ROUNDED_RADIUS=Qr;exports.LOGO_SHAPES=O0;exports.LOGO_SIZE_DEFAULT=Bo;exports.LOGO_SIZE_MAX=Do;exports.LOGO_SIZE_MIN=D0;exports.MODULE_SCALE_FLOOR=Xc;exports.MODULE_SCALE_MAX=Qo;exports.MODULE_SCALE_MIN=$r;exports.OFFICIAL_FRAME_COLLECTIONS=sp;exports.OFFICIAL_FRAME_COUNT=ap;exports.OFFICIAL_FRAME_COUNTS=ip;exports.PIXEL_SCAN_SIZES=Tp;exports.PIXEL_SCORE_MIN_CODE_WIDTH=k3;exports.PRESET_SIZES=N5;exports.QRCode=qp;exports.QRCodeSVG=Qi;exports.QR_ART_MAX_SAMPLE_SIZE=Tn;exports.QR_ART_MIN_LUMA_GAP=Wr;exports.QR_ART_MODES=xr;exports.QR_ART_SAMPLE_SIZES=Ra;exports.QR_ART_VARIANTS=No;exports.QR_CIRCLE_QUIET_MIN=Uo;exports.QR_EYE_ATTRIBUTE=nl;exports.QR_PARTS=jd;exports.QR_PART_ATTRIBUTE=Da;exports.QR_SHAPES=Q0;exports.QR_SILHOUETTE_MAX_CELLS=Pe;exports.QR_SILHOUETTE_MIN_CELLS=me;exports.QR_SILHOUETTE_MIN_SHARE=zo;exports.RETIRED_CORNER_EYE_DOT_PATTERNS=F0;exports.RETIRED_CORNER_EYE_PATTERNS=I0;exports.SCAN_CONTRAST_FAIL=a0;exports.SCAN_CONTRAST_LOW=Sp;exports.SCAN_CONTRAST_MIN=pr;exports.SCAN_IMAGE_CONTRAST_MIN=i0;exports.SCAN_TEST_SIZES=l0;exports.SHARP_DOT_EYE_SAFE_BODIES=e0;exports.SUPPORTS_PATH2D=Ly;exports.SquareBorder=Pl;exports.StandardBox=Ll;exports.StrikedBox=kl;exports.TEMPLATES=ir;exports.WEAK_BODY_EYES=Yu;exports.WEAK_DOTS=Ju;exports.WEAK_DOT_EYES=Zu;exports.WEAK_EYES=Ku;exports.WEAK_SHARP_DOT_EYES=t0;exports.WEBP_MAX_DIMENSION=th;exports.blobToDataUrl=lr;exports.canvasToWebP=io;exports.circleQuietZone=De;exports.clampModuleScale=Vr;exports.convertImageSettingsToPixels=Cf;exports.copyQRCodeToClipboard=B5;exports.createQRArtImage=Mc;exports.createQRCodeTree=sr;exports.createQRSilhouette=$0;exports.damagedCodewords=Kn;exports.decodePNGPixels=pi;exports.defaultTemplate=al;exports.downloadFile=Kt;exports.downloadImageData=d_;exports.downloadImageWithBoundingBox=f_;exports.downloadPrintEPS=Th;exports.downloadPrintPDF=h5;exports.downloadPrintSVG=p5;exports.downloadQRCode=O5;exports.encodeWebPLossless=ii;exports.epsToDataUrl=xo;exports.excavateModules=Xa;exports.frameLabels=ec;exports.frameSpecHash=cp;exports.frameSpecOf=Nr;exports.frameSpecPadding=fn;exports.frameSpecQrZone=Rr;exports.generatePath=Wl;exports.getAllTemplates=oy;exports.getBuiltInFrame=ga;exports.getCodewordMap=Yn;exports.getColorString=I1;exports.getContrastLevel=Iy;exports.getContrastRatio=ky;exports.getCustomFrameLayout=fa;exports.getDownloadFilename=Nh;exports.getFrameColors=s1;exports.getFrameDimensions=oe;exports.getFrameGapRatio=ba;exports.getFrameIconPath=la;exports.getFrameLayout=Ne;exports.getFrameSecondaryText=u1;exports.getFrameSpecColors=Ir;exports.getFrameSpecGapRatio=da;exports.getFrameText=l1;exports.getImageScanScore=T3;exports.getImageSettings=xe;exports.getImageTones=$p;exports.getImageTonesFromPixels=xp;exports.getLayoutMargin=At;exports.getLogoBlockDamage=no;exports.getLogoSizeLimit=up;exports.getLuminance=En;exports.getNormalizedColor=T1;exports.getPrintLayout=yo;exports.getQRArtColorIssue=md;exports.getQRArtEyeColors=Ta;exports.getQRArtVariant=Hr;exports.getQRAsCanvas=Pn;exports.getQRAsEPS=_o;exports.getQRAsPrintPDF=Sh;exports.getQRAsPrintPDFBuffer=f5;exports.getQRAsPrintSVG=wh;exports.getQRAsSVG=o_;exports.getQRAsSVGDataUri=Ut;exports.getQRAsSVGNode=Ef;exports.getQRAsWebP=Iu;exports.getQRCodeData=So;exports.getQRCodeDataUrl=D5;exports.getQRCodeSVGProps=wo;exports.getQRData=Ai;exports.getQRFunctionModules=J1;exports.getQRModuleCount=xh;exports.getQRShapePath=k1;exports.getQRSilhouetteFit=v1;exports.getSVGString=Q5;exports.getScanContrast=wp;exports.getScanScore=F3;exports.getScanScoreFromPixels=I3;exports.getSolidColor=yt;exports.getStylePairRisk=Pi;exports.getTemplate=Zr;exports.getTemplateIds=ay;exports.getWebPCompression=si;exports.h=yr;exports.handleImageLoad=Jl;exports.hasImageFill=Fu;exports.hexToRgb=Fy;exports.imagePositionCss=pc;exports.importFrameSvg=op;exports.isFrameActive=It;exports.isGradient=$n;exports.isImagePaint=Sa;exports.isLatin1Text=tm;exports.isQRArtActive=Aa;exports.isQRNode=Ae;exports.isShapedCode=xa;exports.isWeakSharpPair=n0;exports.isWebPFile=du;exports.loadQRArtImage=Z1;exports.loadQRSilhouette=Gp;exports.logoFitsBudget=Rf;exports.mixFrameColors=jn;exports.normalizeColorConfig=Bt;exports.partMarker=Ba;exports.removeLogoBackdrop=ju;exports.removeLogoBackground=mp;exports.renderQRArt=Fa;exports.renderToDOM=ei;exports.renderToString=ze;exports.resolveErrorLevel=Tt;exports.resolveFrameSpec=Te;exports.resolveQRCodeProps=hp;exports.rgbToCmyk=pe;exports.sanitizeFrameText=dn;exports.scanQRPixels=N3;exports.svgToEPS=vu;exports.toHyperscript=Xu;exports.toSVGElement=Jf;exports.toSVGString=ni;exports.validateSize=_i;exports.withQRSize=We;//# sourceMappingURL=index.js.map
30
+ */Object.defineProperty(exports,"angularGradientSchema",{enumerable:true,get:function(){return schemas_js.angularGradientSchema}});Object.defineProperty(exports,"anyFrameSchema",{enumerable:true,get:function(){return schemas_js.anyFrameSchema}});Object.defineProperty(exports,"baseTemplatePropsSchema",{enumerable:true,get:function(){return schemas_js.baseTemplatePropsSchema}});Object.defineProperty(exports,"bodyPatternSchema",{enumerable:true,get:function(){return schemas_js.bodyPatternSchema}});Object.defineProperty(exports,"colorConfigSchema",{enumerable:true,get:function(){return schemas_js.colorConfigSchema}});Object.defineProperty(exports,"colorTypeSchema",{enumerable:true,get:function(){return schemas_js.colorTypeSchema}});Object.defineProperty(exports,"cornerEyeDotPatternSchema",{enumerable:true,get:function(){return schemas_js.cornerEyeDotPatternSchema}});Object.defineProperty(exports,"cornerEyePatternSchema",{enumerable:true,get:function(){return schemas_js.cornerEyePatternSchema}});Object.defineProperty(exports,"customFrameSchema",{enumerable:true,get:function(){return schemas_js.customFrameSchema}});Object.defineProperty(exports,"errorLevelSchema",{enumerable:true,get:function(){return schemas_js.errorLevelSchema}});Object.defineProperty(exports,"excavationSchema",{enumerable:true,get:function(){return schemas_js.excavationSchema}});Object.defineProperty(exports,"eyeColorOverrideSchema",{enumerable:true,get:function(){return schemas_js.eyeColorOverrideSchema}});Object.defineProperty(exports,"eyeColorsSchema",{enumerable:true,get:function(){return schemas_js.eyeColorsSchema}});Object.defineProperty(exports,"frameSchema",{enumerable:true,get:function(){return schemas_js.frameSchema}});Object.defineProperty(exports,"frameSpecColorSchema",{enumerable:true,get:function(){return schemas_js.frameSpecColorSchema}});Object.defineProperty(exports,"frameSpecLabelSchema",{enumerable:true,get:function(){return schemas_js.frameSpecLabelSchema}});Object.defineProperty(exports,"frameSpecPaintSchema",{enumerable:true,get:function(){return schemas_js.frameSpecPaintSchema}});Object.defineProperty(exports,"frameSpecSchema",{enumerable:true,get:function(){return schemas_js.frameSpecSchema}});Object.defineProperty(exports,"frameSpecShapeSchema",{enumerable:true,get:function(){return schemas_js.frameSpecShapeSchema}});Object.defineProperty(exports,"frameStyleSchema",{enumerable:true,get:function(){return schemas_js.frameStyleSchema}});Object.defineProperty(exports,"getFrameSpecIssues",{enumerable:true,get:function(){return schemas_js.getFrameSpecIssues}});Object.defineProperty(exports,"gradientStopSchema",{enumerable:true,get:function(){return schemas_js.gradientStopSchema}});Object.defineProperty(exports,"imageFitSchema",{enumerable:true,get:function(){return schemas_js.imageFitSchema}});Object.defineProperty(exports,"imagePaintSchema",{enumerable:true,get:function(){return schemas_js.imagePaintSchema}});Object.defineProperty(exports,"imagePositionSchema",{enumerable:true,get:function(){return schemas_js.imagePositionSchema}});Object.defineProperty(exports,"imageSettingsSchema",{enumerable:true,get:function(){return schemas_js.imageSettingsSchema}});Object.defineProperty(exports,"linearGradientSchema",{enumerable:true,get:function(){return schemas_js.linearGradientSchema}});Object.defineProperty(exports,"logoOptionsSchema",{enumerable:true,get:function(){return schemas_js.logoOptionsSchema}});Object.defineProperty(exports,"logoShapeSchema",{enumerable:true,get:function(){return schemas_js.logoShapeSchema}});Object.defineProperty(exports,"pickableCornerEyeDotPatternSchema",{enumerable:true,get:function(){return schemas_js.pickableCornerEyeDotPatternSchema}});Object.defineProperty(exports,"pickableCornerEyePatternSchema",{enumerable:true,get:function(){return schemas_js.pickableCornerEyePatternSchema}});Object.defineProperty(exports,"qrArtImageSchema",{enumerable:true,get:function(){return schemas_js.qrArtImageSchema}});Object.defineProperty(exports,"qrArtModeSchema",{enumerable:true,get:function(){return schemas_js.qrArtModeSchema}});Object.defineProperty(exports,"qrArtSchema",{enumerable:true,get:function(){return schemas_js.qrArtSchema}});Object.defineProperty(exports,"qrArtVariantSchema",{enumerable:true,get:function(){return schemas_js.qrArtVariantSchema}});Object.defineProperty(exports,"qrCodeShapeSchema",{enumerable:true,get:function(){return schemas_js.qrCodeShapeSchema}});Object.defineProperty(exports,"qrPropsSchema",{enumerable:true,get:function(){return schemas_js.qrPropsSchema}});Object.defineProperty(exports,"qrShapeSchema",{enumerable:true,get:function(){return schemas_js.qrShapeSchema}});Object.defineProperty(exports,"qrSilhouetteSchema",{enumerable:true,get:function(){return schemas_js.qrSilhouetteSchema}});Object.defineProperty(exports,"radialGradientSchema",{enumerable:true,get:function(){return schemas_js.radialGradientSchema}});Object.defineProperty(exports,"solidColorSchema",{enumerable:true,get:function(){return schemas_js.solidColorSchema}});Object.defineProperty(exports,"templateConfigSchema",{enumerable:true,get:function(){return schemas_js.templateConfigSchema}});Object.defineProperty(exports,"templateDefinitionBaseSchema",{enumerable:true,get:function(){return schemas_js.templateDefinitionBaseSchema}});Object.defineProperty(exports,"OFFICIAL_FRAME_INDEX",{enumerable:true,get:function(){return framesIndex_js.OFFICIAL_FRAME_INDEX}});Object.defineProperty(exports,"OFFICIAL_FRAMES",{enumerable:true,get:function(){return framesOfficial_js.OFFICIAL_FRAMES}});Object.defineProperty(exports,"getOfficialFrame",{enumerable:true,get:function(){return framesOfficial_js.getOfficialFrame}});Object.defineProperty(exports,"QRCodeCanvas",{enumerable:true,get:function(){return qrCodeCanvas_js.QRCodeCanvas}});exports.AUTO_LEVEL_LOGO_COVERAGE=Uo;exports.Arrow=cl;exports.BMP_MAX_DIMENSION=Bf;exports.BODY_PATTERN=G0;exports.BUILT_IN_FRAMES=ga;exports.BUILT_IN_FRAME_SPECS=m1;exports.CORNER_EYE_DOT_PATTERNS=O0;exports.CORNER_EYE_PATTERNS=B0;exports.CUSTOM_FRAME_STYLE=Gn;exports.DEFAULT_ART_INTENSITY=Ac;exports.DEFAULT_FRAME_TEXT=Do;exports.DEFAULT_MARGIN=dt;exports.DEFAULT_SIZE=ut;exports.DOWNLOAD_FORMATS=Si;exports.DotRing=Pl;exports.EPS_IMAGE_FILL_REASON=Nu;exports.EYE_POSITIONS=Sr;exports.FRAME_COLOR_TOKENS=Jo;exports.FRAME_FONT_FAMILY=Dr;exports.FRAME_FONT_SCALE_MAX=ln;exports.FRAME_FONT_SCALE_MIN=On;exports.FRAME_GAP_RATIO=ec;exports.FRAME_ICONS=Ko;exports.FRAME_ICON_BOX=la;exports.FRAME_ICON_MAX_SEGMENTS=ps;exports.FRAME_IMPORT_LIMITS=Ft;exports.FRAME_LABEL_ATTRIBUTE=nc;exports.FRAME_SPEC_KIND=Bn;exports.FRAME_SPEC_LABEL_MAX_FONT=Un;exports.FRAME_SPEC_LIMITS=ot;exports.FRAME_SPEC_VERSION=Qn;exports.FRAME_STYLES=U0;exports.FRAME_TEXT_MAX_LENGTH=te;exports.Fragment=Vt;exports.FrameSpecError=Xn;exports.GRADIENT_FRAME_DEFAULTS=d1;exports.Halloween=Ll;exports.LOGO_CLEANUP_MAX_SIDE=Ju;exports.LOGO_EC_SAFETY=Jl;exports.LOGO_PADDING_MAX=W0;exports.LOGO_PLATE_INSET=Gr;exports.LOGO_ROUNDED_RADIUS=Qr;exports.LOGO_SHAPES=z0;exports.LOGO_SIZE_DEFAULT=Qo;exports.LOGO_SIZE_MAX=Bo;exports.LOGO_SIZE_MIN=q0;exports.MODULE_SCALE_FLOOR=Jc;exports.MODULE_SCALE_MAX=Go;exports.MODULE_SCALE_MIN=$r;exports.OFFICIAL_FRAME_COLLECTIONS=hp;exports.OFFICIAL_FRAME_COUNT=dp;exports.OFFICIAL_FRAME_COUNTS=fp;exports.PIXEL_SCAN_SIZES=Up;exports.PIXEL_SCORE_MIN_CODE_WIDTH=H3;exports.PRESET_SIZES=Z5;exports.QRCode=Yp;exports.QRCodeSVG=qi;exports.QR_ART_MAX_SAMPLE_SIZE=Nn;exports.QR_ART_MIN_LUMA_GAP=Wr;exports.QR_ART_MODES=xr;exports.QR_ART_SAMPLE_SIZES=Ea;exports.QR_ART_VARIANTS=Oo;exports.QR_CIRCLE_QUIET_MIN=zo;exports.QR_EYE_ATTRIBUTE=il;exports.QR_PARTS=tf;exports.QR_PART_ATTRIBUTE=Ba;exports.QR_SHAPES=H0;exports.QR_SILHOUETTE_MAX_CELLS=ve;exports.QR_SILHOUETTE_MIN_CELLS=me;exports.QR_SILHOUETTE_MIN_SHARE=qo;exports.RETIRED_CORNER_EYE_DOT_PATTERNS=D0;exports.RETIRED_CORNER_EYE_PATTERNS=Q0;exports.SCAN_CONTRAST_FAIL=m0;exports.SCAN_CONTRAST_LOW=Pp;exports.SCAN_CONTRAST_MIN=pr;exports.SCAN_IMAGE_CONTRAST_MIN=d0;exports.SCAN_TEST_SIZES=p0;exports.SHARP_DOT_EYE_SAFE_BODIES=s0;exports.SUPPORTS_PATH2D=Dy;exports.SquareBorder=Il;exports.StandardBox=Tl;exports.StrikedBox=Ol;exports.TEMPLATES=sr;exports.WEAK_BODY_EYES=r0;exports.WEAK_DOTS=a0;exports.WEAK_DOT_EYES=n0;exports.WEAK_EYES=o0;exports.WEAK_SHARP_DOT_EYES=i0;exports.WEBP_MAX_DIMENSION=sh;exports.blobToDataUrl=$e;exports.canvasToBMP=oo;exports.canvasToWebP=so;exports.circleQuietZone=Be;exports.clampModuleScale=Vr;exports.convertImageSettingsToPixels=vf;exports.copyQRCodeToClipboard=K5;exports.createQRArtImage=Pc;exports.createQRCodeTree=cr;exports.createQRSilhouette=E0;exports.damagedCodewords=Jn;exports.decodePNGPixels=_i;exports.defaultTemplate=ll;exports.downloadFile=zt;exports.downloadImageData=w_;exports.downloadImageWithBoundingBox=M_;exports.downloadPrintEPS=Uh;exports.downloadPrintPDF=R5;exports.downloadPrintSVG=E5;exports.downloadQRCode=X5;exports.encodeBMP=ni;exports.encodeWebPLossless=ui;exports.epsToDataUrl=$o;exports.excavateModules=Xa;exports.frameLabels=ac;exports.frameSpecHash=pp;exports.frameSpecOf=Nr;exports.frameSpecPadding=pn;exports.frameSpecQrZone=Rr;exports.generatePath=Zl;exports.getAllTemplates=my;exports.getBuiltInFrame=ba;exports.getCodewordMap=Kn;exports.getColorString=Q1;exports.getContrastLevel=Gy;exports.getContrastRatio=Qy;exports.getCustomFrameLayout=ha;exports.getDownloadFilename=zh;exports.getFrameColors=f1;exports.getFrameDimensions=oe;exports.getFrameGapRatio=ya;exports.getFrameIconPath=ua;exports.getFrameLayout=Oe;exports.getFrameSecondaryText=g1;exports.getFrameSpecColors=kr;exports.getFrameSpecGapRatio=fa;exports.getFrameText=p1;exports.getImageScanScore=j3;exports.getImageSettings=xe;exports.getImageTones=Ap;exports.getImageTonesFromPixels=Ep;exports.getLayoutMargin=At;exports.getLogoBlockDamage=no;exports.getLogoSizeLimit=bp;exports.getLuminance=Pn;exports.getNormalizedColor=G1;exports.getPrintLayout=_o;exports.getQRArtColorIssue=bd;exports.getQRArtEyeColors=Na;exports.getQRArtVariant=Hr;exports.getQRAsBMP=Qu;exports.getQRAsCanvas=He;exports.getQRAsEPS=xo;exports.getQRAsPrintPDF=Ph;exports.getQRAsPrintPDFBuffer=C5;exports.getQRAsPrintSVG=vh;exports.getQRAsSVG=m_;exports.getQRAsSVGDataUri=Ut;exports.getQRAsSVGNode=If;exports.getQRAsWebP=Bu;exports.getQRCodeData=wo;exports.getQRCodeDataUrl=Y5;exports.getQRCodeSVGProps=Mo;exports.getQRData=Fi;exports.getQRFunctionModules=ad;exports.getQRModuleCount=Eh;exports.getQRShapePath=B1;exports.getQRSilhouetteFit=N1;exports.getSVGString=J5;exports.getScanContrast=vp;exports.getScanScore=W3;exports.getScanScoreFromPixels=V3;exports.getSolidColor=yt;exports.getStylePairRisk=Ii;exports.getTemplate=Xr;exports.getTemplateIds=dy;exports.getWebPCompression=mi;exports.h=yr;exports.handleImageLoad=ou;exports.hasImageFill=Ou;exports.hexToRgb=By;exports.imagePositionCss=_c;exports.importFrameSvg=mp;exports.isBMPFile=ri;exports.isFrameActive=kt;exports.isGradient=wn;exports.isImagePaint=wa;exports.isLatin1Text=im;exports.isQRArtActive=Pa;exports.isQRNode=Pe;exports.isShapedCode=$a;exports.isWeakSharpPair=c0;exports.isWebPFile=bu;exports.loadQRArtImage=nd;exports.loadQRSilhouette=jp;exports.logoFitsBudget=Ff;exports.mixFrameColors=Zn;exports.normalizeColorConfig=Bt;exports.partMarker=Qa;exports.removeLogoBackdrop=t0;exports.removeLogoBackground=yp;exports.renderQRArt=Ia;exports.renderToDOM=ai;exports.renderToString=qe;exports.resolveErrorLevel=Tt;exports.resolveFrameSpec=Ne;exports.resolveQRCodeProps=$p;exports.rgbToCmyk=pe;exports.sanitizeFrameText=hn;exports.scanQRPixels=Z3;exports.svgToEPS=Tu;exports.toHyperscript=e0;exports.toSVGElement=ih;exports.toSVGString=ii;exports.validateSize=wi;exports.withQRSize=Ve;//# sourceMappingURL=index.js.map
31
31
  //# sourceMappingURL=index.js.map