qrdx 0.0.61 → 0.0.62
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/README.md +2 -1
- package/dist/angular.js +7 -2
- package/dist/angular.js.map +1 -1
- package/dist/angular.mjs +7 -2
- package/dist/angular.mjs.map +1 -1
- package/dist/core.js +7 -7
- package/dist/core.js.map +1 -1
- package/dist/core.mjs +7 -7
- package/dist/core.mjs.map +1 -1
- package/dist/element.browser.mjs +6 -6
- package/dist/element.browser.mjs.map +1 -1
- package/dist/element.js +1 -1
- package/dist/element.js.map +1 -1
- package/dist/element.mjs +1 -1
- package/dist/element.mjs.map +1 -1
- package/dist/index.js +7 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +7 -7
- package/dist/index.mjs.map +1 -1
- package/dist/qr-code-canvas.js +1 -1
- package/dist/qr-code-canvas.js.map +1 -1
- package/dist/qr-code-canvas.mjs +1 -1
- package/dist/qr-code-canvas.mjs.map +1 -1
- package/dist/schemas.js +1 -1
- package/dist/schemas.js.map +1 -1
- package/dist/schemas.mjs +1 -1
- package/dist/schemas.mjs.map +1 -1
- package/dist/src/angular.d.ts +2 -1
- package/dist/src/element.d.ts +2 -0
- package/dist/src/element.d.ts.map +1 -1
- package/dist/src/helpers.d.ts +2 -2
- package/dist/src/helpers.d.ts.map +1 -1
- package/dist/src/logo-budget.d.ts +3 -1
- package/dist/src/logo-budget.d.ts.map +1 -1
- package/dist/src/looks.d.ts +2 -2
- package/dist/src/looks.d.ts.map +1 -1
- package/dist/src/plain.d.ts.map +1 -1
- package/dist/src/print.d.ts.map +1 -1
- package/dist/src/qr-code-canvas.d.ts.map +1 -1
- package/dist/src/qr-code-props.d.ts +1 -1
- package/dist/src/qr-code-props.d.ts.map +1 -1
- package/dist/src/scan-score.d.ts.map +1 -1
- package/dist/src/symbol.d.ts +13 -0
- package/dist/src/symbol.d.ts.map +1 -0
- package/dist/src/utils/print-shared.d.ts.map +1 -1
- package/dist/src/utils.d.ts +1 -0
- package/dist/src/utils.d.ts.map +1 -1
- package/dist/src/vue.d.ts.map +1 -1
- package/dist/types/index.js +1 -1
- package/dist/types/index.js.map +1 -1
- package/dist/types/index.mjs +1 -1
- package/dist/types/index.mjs.map +1 -1
- package/dist/types/qr.d.ts +2 -0
- package/dist/types/qr.d.ts.map +1 -1
- package/dist/vanilla.browser.mjs +16 -16
- package/dist/vanilla.browser.mjs.map +1 -1
- package/dist/vue.js +1 -1
- package/dist/vue.js.map +1 -1
- package/dist/vue.mjs +1 -1
- package/dist/vue.mjs.map +1 -1
- package/package.json +1 -1
- package/src/angular.ts +2 -0
- package/src/element.ts +3 -0
- package/src/helpers.ts +27 -10
- package/src/logo-budget.ts +9 -8
- package/src/looks.ts +17 -14
- package/src/plain.tsx +5 -7
- package/src/print.ts +3 -6
- package/src/qr-code-canvas.tsx +5 -7
- package/src/qr-code-props.ts +4 -0
- package/src/scan-score.ts +5 -4
- package/src/symbol.ts +27 -0
- package/src/utils/print-shared.ts +5 -9
- package/src/utils.tsx +9 -9
- package/src/vue.ts +1 -0
- package/types/qr.ts +6 -0
package/dist/element.browser.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
var Te;(i=>{class t{constructor(l,s,c,u){this.version=l;this.errorCorrectionLevel=s;if(l<t.MIN_VERSION||l>t.MAX_VERSION)throw new RangeError("Version value out of range");if(u<-1||u>7)throw new RangeError("Mask value out of range");this.size=l*4+17;let m=[];for(let p=0;p<this.size;p++)m.push(false);for(let p=0;p<this.size;p++)this.modules.push(m.slice()),this.isFunction.push(m.slice());this.drawFunctionPatterns();let d=this.addEccAndInterleave(c);if(this.drawCodewords(d),u==-1){let p=1e9;for(let b=0;b<8;b++){this.applyMask(b),this.drawFormatBits(b);let f=this.getPenaltyScore();f<p&&(u=b,p=f),this.applyMask(b);}}o(0<=u&&u<=7),this.mask=u,this.applyMask(u),this.drawFormatBits(u),this.isFunction=[];}version;errorCorrectionLevel;static encodeText(l,s){let c=i.QrSegment.makeSegments(l);return t.encodeSegments(c,s)}static encodeBinary(l,s){let c=i.QrSegment.makeBytes(l);return t.encodeSegments([c],s)}static encodeSegments(l,s,c=1,u=40,m=-1,d=true){if(!(t.MIN_VERSION<=c&&c<=u&&u<=t.MAX_VERSION)||m<-1||m>7)throw new RangeError("Invalid value");let p,b;for(p=c;;p++){let y=t.getNumDataCodewords(p,s)*8,x=r.getTotalBits(l,p);if(x<=y){b=x;break}if(p>=u)throw new RangeError("Data too long")}for(let y of [t.Ecc.MEDIUM,t.Ecc.QUARTILE,t.Ecc.HIGH])d&&b<=t.getNumDataCodewords(p,y)*8&&(s=y);let f=[];for(let y of l){e(y.mode.modeBits,4,f),e(y.numChars,y.mode.numCharCountBits(p),f);for(let x of y.getData())f.push(x);}o(f.length==b);let h=t.getNumDataCodewords(p,s)*8;o(f.length<=h),e(0,Math.min(4,h-f.length),f),e(0,(8-f.length%8)%8,f),o(f.length%8==0);for(let y=236;f.length<h;y^=253)e(y,8,f);let g=[];for(;g.length*8<f.length;)g.push(0);return f.forEach((y,x)=>g[x>>>3]|=y<<7-(x&7)),new t(p,s,g,m)}size;mask;modules=[];isFunction=[];getModule(l,s){return 0<=l&&l<this.size&&0<=s&&s<this.size&&this.modules[s][l]}getModules(){return this.modules}drawFunctionPatterns(){for(let c=0;c<this.size;c++)this.setFunctionModule(6,c,c%2==0),this.setFunctionModule(c,6,c%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);let l=this.getAlignmentPatternPositions(),s=l.length;for(let c=0;c<s;c++)for(let u=0;u<s;u++)c==0&&u==0||c==0&&u==s-1||c==s-1&&u==0||this.drawAlignmentPattern(l[c],l[u]);this.drawFormatBits(0),this.drawVersion();}drawFormatBits(l){let s=this.errorCorrectionLevel.formatBits<<3|l,c=s;for(let m=0;m<10;m++)c=c<<1^(c>>>9)*1335;let u=(s<<10|c)^21522;o(u>>>15==0);for(let m=0;m<=5;m++)this.setFunctionModule(8,m,n(u,m));this.setFunctionModule(8,7,n(u,6)),this.setFunctionModule(8,8,n(u,7)),this.setFunctionModule(7,8,n(u,8));for(let m=9;m<15;m++)this.setFunctionModule(14-m,8,n(u,m));for(let m=0;m<8;m++)this.setFunctionModule(this.size-1-m,8,n(u,m));for(let m=8;m<15;m++)this.setFunctionModule(8,this.size-15+m,n(u,m));this.setFunctionModule(8,this.size-8,true);}drawVersion(){if(this.version<7)return;let l=this.version;for(let c=0;c<12;c++)l=l<<1^(l>>>11)*7973;let s=this.version<<12|l;o(s>>>18==0);for(let c=0;c<18;c++){let u=n(s,c),m=this.size-11+c%3,d=Math.floor(c/3);this.setFunctionModule(m,d,u),this.setFunctionModule(d,m,u);}}drawFinderPattern(l,s){for(let c=-4;c<=4;c++)for(let u=-4;u<=4;u++){let m=Math.max(Math.abs(u),Math.abs(c)),d=l+u,p=s+c;0<=d&&d<this.size&&0<=p&&p<this.size&&this.setFunctionModule(d,p,m!=2&&m!=4);}}drawAlignmentPattern(l,s){for(let c=-2;c<=2;c++)for(let u=-2;u<=2;u++)this.setFunctionModule(l+u,s+c,Math.max(Math.abs(u),Math.abs(c))!=1);}setFunctionModule(l,s,c){this.modules[s][l]=c,this.isFunction[s][l]=true;}addEccAndInterleave(l){let s=this.version,c=this.errorCorrectionLevel;if(l.length!=t.getNumDataCodewords(s,c))throw new RangeError("Invalid argument");let u=t.NUM_ERROR_CORRECTION_BLOCKS[c.ordinal][s],m=t.ECC_CODEWORDS_PER_BLOCK[c.ordinal][s],d=Math.floor(t.getNumRawDataModules(s)/8),p=u-d%u,b=Math.floor(d/u),f=[],h=t.reedSolomonComputeDivisor(m);for(let y=0,x=0;y<u;y++){let C=l.slice(x,x+b-m+(y<p?0:1));x+=C.length;let w=t.reedSolomonComputeRemainder(C,h);y<p&&C.push(0),f.push(C.concat(w));}let g=[];for(let y=0;y<f[0].length;y++)f.forEach((x,C)=>{(y!=b-m||C>=p)&&g.push(x[y]);});return o(g.length==d),g}drawCodewords(l){if(l.length!=Math.floor(t.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let s=0;for(let c=this.size-1;c>=1;c-=2){c==6&&(c=5);for(let u=0;u<this.size;u++)for(let m=0;m<2;m++){let d=c-m,b=(c+1&2)==0?this.size-1-u:u;!this.isFunction[b][d]&&s<l.length*8&&(this.modules[b][d]=n(l[s>>>3],7-(s&7)),s++);}}o(s==l.length*8);}applyMask(l){if(l<0||l>7)throw new RangeError("Mask value out of range");for(let s=0;s<this.size;s++)for(let c=0;c<this.size;c++){let u;switch(l){case 0:u=(c+s)%2==0;break;case 1:u=s%2==0;break;case 2:u=c%3==0;break;case 3:u=(c+s)%3==0;break;case 4:u=(Math.floor(c/3)+Math.floor(s/2))%2==0;break;case 5:u=c*s%2+c*s%3==0;break;case 6:u=(c*s%2+c*s%3)%2==0;break;case 7:u=((c+s)%2+c*s%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[s][c]&&u&&(this.modules[s][c]=!this.modules[s][c]);}}getPenaltyScore(){let l=0;for(let m=0;m<this.size;m++){let d=false,p=0,b=[0,0,0,0,0,0,0];for(let f=0;f<this.size;f++)this.modules[m][f]==d?(p++,p==5?l+=t.PENALTY_N1:p>5&&l++):(this.finderPenaltyAddHistory(p,b),d||(l+=this.finderPenaltyCountPatterns(b)*t.PENALTY_N3),d=this.modules[m][f],p=1);l+=this.finderPenaltyTerminateAndCount(d,p,b)*t.PENALTY_N3;}for(let m=0;m<this.size;m++){let d=false,p=0,b=[0,0,0,0,0,0,0];for(let f=0;f<this.size;f++)this.modules[f][m]==d?(p++,p==5?l+=t.PENALTY_N1:p>5&&l++):(this.finderPenaltyAddHistory(p,b),d||(l+=this.finderPenaltyCountPatterns(b)*t.PENALTY_N3),d=this.modules[f][m],p=1);l+=this.finderPenaltyTerminateAndCount(d,p,b)*t.PENALTY_N3;}for(let m=0;m<this.size-1;m++)for(let d=0;d<this.size-1;d++){let p=this.modules[m][d];p==this.modules[m][d+1]&&p==this.modules[m+1][d]&&p==this.modules[m+1][d+1]&&(l+=t.PENALTY_N2);}let s=0;for(let m of this.modules)s=m.reduce((d,p)=>d+(p?1:0),s);let c=this.size*this.size,u=Math.ceil(Math.abs(s*20-c*10)/c)-1;return o(0<=u&&u<=9),l+=u*t.PENALTY_N4,o(0<=l&&l<=2568888),l}getAlignmentPatternPositions(){if(this.version==1)return [];{let l=Math.floor(this.version/7)+2,s=this.version==32?26:Math.ceil((this.version*4+4)/(l*2-2))*2,c=[6];for(let u=this.size-7;c.length<l;u-=s)c.splice(1,0,u);return c}}static getNumRawDataModules(l){if(l<t.MIN_VERSION||l>t.MAX_VERSION)throw new RangeError("Version number out of range");let s=(16*l+128)*l+64;if(l>=2){let c=Math.floor(l/7)+2;s-=(25*c-10)*c-55,l>=7&&(s-=36);}return o(208<=s&&s<=29648),s}static getNumDataCodewords(l,s){return Math.floor(t.getNumRawDataModules(l)/8)-t.ECC_CODEWORDS_PER_BLOCK[s.ordinal][l]*t.NUM_ERROR_CORRECTION_BLOCKS[s.ordinal][l]}static reedSolomonComputeDivisor(l){if(l<1||l>255)throw new RangeError("Degree out of range");let s=[];for(let u=0;u<l-1;u++)s.push(0);s.push(1);let c=1;for(let u=0;u<l;u++){for(let m=0;m<s.length;m++)s[m]=t.reedSolomonMultiply(s[m],c),m+1<s.length&&(s[m]^=s[m+1]);c=t.reedSolomonMultiply(c,2);}return s}static reedSolomonComputeRemainder(l,s){let c=s.map(u=>0);for(let u of l){let m=u^c.shift();c.push(0),s.forEach((d,p)=>c[p]^=t.reedSolomonMultiply(d,m));}return c}static reedSolomonMultiply(l,s){if(l>>>8||s>>>8)throw new RangeError("Byte out of range");let c=0;for(let u=7;u>=0;u--)c=c<<1^(c>>>7)*285,c^=(s>>>u&1)*l;return o(c>>>8==0),c}finderPenaltyCountPatterns(l){let s=l[1];o(s<=this.size*3);let c=s>0&&l[2]==s&&l[3]==s*3&&l[4]==s&&l[5]==s;return (c&&l[0]>=s*4&&l[6]>=s?1:0)+(c&&l[6]>=s*4&&l[0]>=s?1:0)}finderPenaltyTerminateAndCount(l,s,c){return l&&(this.finderPenaltyAddHistory(s,c),s=0),s+=this.size,this.finderPenaltyAddHistory(s,c),this.finderPenaltyCountPatterns(c)}finderPenaltyAddHistory(l,s){s[0]==0&&(l+=this.size),s.pop(),s.unshift(l);}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]]}i.QrCode=t;function e(a,l,s){if(l<0||l>31||a>>>l)throw new RangeError("Value out of range");for(let c=l-1;c>=0;c--)s.push(a>>>c&1);}function n(a,l){return (a>>>l&1)!=0}function o(a){if(!a)throw new Error("Assertion error")}class r{constructor(l,s,c){this.mode=l;this.numChars=s;this.bitData=c;if(s<0)throw new RangeError("Invalid argument");this.bitData=c.slice();}mode;numChars;bitData;static makeBytes(l){let s=[];for(let c of l)e(c,8,s);return new r(r.Mode.BYTE,l.length,s)}static makeNumeric(l){if(!r.isNumeric(l))throw new RangeError("String contains non-numeric characters");let s=[];for(let c=0;c<l.length;){let u=Math.min(l.length-c,3);e(parseInt(l.substr(c,u),10),u*3+1,s),c+=u;}return new r(r.Mode.NUMERIC,l.length,s)}static makeAlphanumeric(l){if(!r.isAlphanumeric(l))throw new RangeError("String contains unencodable characters in alphanumeric mode");let s=[],c;for(c=0;c+2<=l.length;c+=2){let u=r.ALPHANUMERIC_CHARSET.indexOf(l.charAt(c))*45;u+=r.ALPHANUMERIC_CHARSET.indexOf(l.charAt(c+1)),e(u,11,s);}return c<l.length&&e(r.ALPHANUMERIC_CHARSET.indexOf(l.charAt(c)),6,s),new r(r.Mode.ALPHANUMERIC,l.length,s)}static makeSegments(l){return l==""?[]:r.isNumeric(l)?[r.makeNumeric(l)]:r.isAlphanumeric(l)?[r.makeAlphanumeric(l)]:[r.makeBytes(r.toUtf8ByteArray(l))]}static makeEci(l){let s=[];if(l<0)throw new RangeError("ECI assignment value out of range");if(l<128)e(l,8,s);else if(l<16384)e(2,2,s),e(l,14,s);else if(l<1e6)e(6,3,s),e(l,21,s);else throw new RangeError("ECI assignment value out of range");return new r(r.Mode.ECI,0,s)}static isNumeric(l){return r.NUMERIC_REGEX.test(l)}static isAlphanumeric(l){return r.ALPHANUMERIC_REGEX.test(l)}getData(){return this.bitData.slice()}static getTotalBits(l,s){let c=0;for(let u of l){let m=u.mode.numCharCountBits(s);if(u.numChars>=1<<m)return 1/0;c+=4+m+u.bitData.length;}return c}static toUtf8ByteArray(l){l=encodeURI(l);let s=[];for(let c=0;c<l.length;c++)l.charAt(c)!="%"?s.push(l.charCodeAt(c)):(s.push(parseInt(l.substr(c+1,2),16)),c+=2);return s}static NUMERIC_REGEX=/^[0-9]*$/;static ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/;static ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:"}i.QrSegment=r;})(Te||={});(e=>{(o=>{class n{constructor(i,a){this.ordinal=i;this.formatBits=a;}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||={});})(Te||={});(e=>{(o=>{class n{constructor(i,a){this.modeBits=i;this.numBitsCharCount=a;}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(i){return this.numBitsCharCount[Math.floor((i+7)/17)]}}o.Mode=n;})(e.QrSegment||={});})(Te||={});var dt=Te;var wt={L:dt.QrCode.Ecc.LOW,M:dt.QrCode.Ecc.MEDIUM,Q:dt.QrCode.Ecc.QUARTILE,H:dt.QrCode.Ecc.HIGH},xt=128,an="Q",rt="#FFFFFF",ke="#000000";var Ht=0;var Gn=.1;function ut(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}function Lt(t,e="#000000"){return t?typeof t=="string"?{type:"solid",color:t}:t:{type:"solid",color:e}}function Ne(t){return !t||typeof t=="string"?false:t.type==="linear"||t.type==="radial"||t.type==="angular"}function ua(t){return typeof t=="object"&&t!==null&&t.type==="image"}var so=["logo","halftone"],ma={logo:["blend","badge"],halftone:["color","mono"]},lo=192;var da={x:"plus",pebble:"rounded",flower:"circle",beads:"circle",bubble:"circle",chain:"circle",petal:"leaf",drop:"rounded",squircle:"rounded"},Qn={pebble:"squircle",tag:"rounded",crest:"shield",doodle:"squircle",stamp:"notch"},Un={bevel:"square",notch:"square"};function ee(t,e){return typeof e=="string"&&Object.hasOwn(t,e)?t[e]:e}var sn=24;var Hn=.5,ln=1.5;var co=.5,fa=1,ha=.07;var pa=3,uo=64,mo=8,ga=.42;var ba=.5,_a=2,ya=.1,xa=.5,$a=.25,fo="#e5e7eb",cn="#d1d5db",ho=.3,Sa=.2,Ca=.1,wa=.4,Ra=.3,Ma="#000000";function U(t,e=3){let n=10**e;return Math.round(t*n)/n+0}function _(t,e=3){return String(U(t,e))}function P(t,...e){let n=t[0]??"";for(let o=0;o<e.length;o++){let r=e[o];n+=(typeof r=="number"?_(r):r)+(t[o+1]??"");}return n}var r0={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0},o0=/^[MmLlHhVvCcSsQqTtAaZz0-9.,+\-\s]*$/,po=/[+-]?(?:\d+\.?\d*|\.\d+)/y;function un(t,e=Number.POSITIVE_INFINITY){if(!o0.test(t))return null;let n=[],o=0,r=()=>{for(;o<t.length&&/[\s,]/.test(t[o]);)o++;},i=()=>{r(),po.lastIndex=o;let s=po.exec(t);if(!s)return null;let c=s[0],u=c.indexOf(".");if(u>=0&&c.length-u-1>e)return null;o=po.lastIndex;let m=Number(c);return Number.isFinite(m)?m:null},a=()=>{r();let s=t[o];return s==="0"||s==="1"?(o++,s==="1"?1:0):null},l=()=>(r(),o<t.length&&/[0-9.+-]/.test(t[o]));for(r();o<t.length;){let s=t[o],c=s.toUpperCase(),u=r0[c];if(u===void 0||n.length===0&&c!=="M")return null;if(o++,u===0){n.push({command:s,values:[]}),r();continue}let m=s,d=true;for(;d||l();){let p=[];for(let b=0;b<u;b++){let f=c==="A"&&(b===3||b===4)?a():i();if(f===null)return null;p.push(f);}n.push({command:m,values:p}),c==="M"&&(m=s==="M"?"L":"l"),d=false;}r();}return n}function Ea(t){let e=0;for(let{command:n}of t)e+=n.toUpperCase()==="A"?4:1;return e}function go(t,e=1,n=0,o=0){let r="";for(let{command:i,values:a}of t){let l=i.toUpperCase(),s=i===l,c=s?n:0,u=s?o:0,m;switch(l){case "Z":m=[];break;case "H":m=[_(a[0]*e+c)];break;case "V":m=[_(a[0]*e+u)];break;case "A":m=[_(Math.abs(a[0])*e),_(Math.abs(a[1])*e),_(a[2]),String(a[3]),String(a[4]),_(a[5]*e+c),_(a[6]*e+u)];break;default:m=a.map((d,p)=>_(d*e+(p%2===0?c:u)));}r+=i+m.join(" ");}return r}function Pa(t,e=.25){let n=[],o=[],r=[0,0],i=[0,0],a=()=>{o.length>2&&n.push(o),o=[];};for(let l of t)if(l.op==="M")a(),r=[l.x,l.y],i=r,o.push(r);else if(l.op==="L")i=[l.x,l.y],o.push(i);else if(l.op==="C"){let s=i,c=[l.x1,l.y1],u=[l.x2,l.y2],m=[l.x,l.y],d=Math.hypot(c[0]-s[0],c[1]-s[1])+Math.hypot(u[0]-c[0],u[1]-c[1])+Math.hypot(m[0]-u[0],m[1]-u[1]),p=Math.max(2,Math.min(64,Math.ceil(Math.sqrt(d/(4*e)))));for(let b=1;b<=p;b++){let f=b/p,h=1-f;o.push([h*h*h*s[0]+3*h*h*f*c[0]+3*h*f*f*u[0]+f*f*f*m[0],h*h*h*s[1]+3*h*h*f*c[1]+3*h*f*f*u[1]+f*f*f*m[1]]);}i=m;}else a(),i=r;return a(),n}function qn(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 i=o;o=[];for(let a=0;a<i.length;a++){let l=i[a],s=i[(a+i.length-1)%i.length],c=r(l),u=r(s);c>=0?(u<0&&o.push(Aa(s,l,u,c)),o.push(l)):u>=0&&o.push(Aa(s,l,u,c));}}return o.length>2?o:[]}function Aa(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 va(t){return t.filter(e=>e.length>2).map(e=>`M${e.map(([n,o])=>`${_(n)} ${_(o)}`).join("L")}Z`).join("")}function Ia(t){let e=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,r=Number.NEGATIVE_INFINITY,i=(a,l)=>{e=Math.min(e,a),n=Math.min(n,l),o=Math.max(o,a),r=Math.max(r,l);};for(let a of t)a.op==="C"?(i(a.x1,a.y1),i(a.x2,a.y2),i(a.x,a.y)):a.op!=="Z"&&i(a.x,a.y);return Number.isFinite(e)?{x0:e,y0:n,x1:o,y1:r}:null}var i0={amp:"&",lt:"<",gt:">",quot:'"',apos:"'"};function Ta(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 i0[n.toLowerCase()]??e})}var a0=60,bo=62,_o=47,s0=61,Fa=34,La=39,xo=/\s*/y,l0=/[^\s/>]*/y,c0=/[^\s>]*/y,u0=/[^\s=]*/y;function Oe(t,e,n){return t.lastIndex=n,t.test(e)?t.lastIndex:n}function m0(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("-->"),i=o("?>"),a=o("]]>"),l=o(">"),s,c=S=>{let $=t.charCodeAt(S);if($!==Fa&&$!==La)return S+1;let M=t.indexOf(t[S],S+1);return M<0?n:M+1},u=S=>{for(let $=S;$<n&&!s?.[$];$=c($)){let M=t.charCodeAt($);if(M===bo||M===_o&&t.charCodeAt($+1)===bo)return $}s??=new Uint8Array(n);for(let $=S;$<n&&!s[$];$=c($))s[$]=1;return -1},m=-1,d=-1,p=-1,b=-1,f=S=>{let $=S+1;if($<m||$>=d){m=$,d=Oe(l0,t,$),p=-1;for(let R=d;R>$;R--){let A=t.charCodeAt(R);if((R===d||A===Fa||A===La)&&(b=u(R),b>=0)){p=R;break}}}if(p<=$)return -1;let M=t.charCodeAt(b)===_o;return e.open(t.slice($,p),t.slice(p,b),M),b+(M?2:1)},h=-1,g=-1,y=-1,x=S=>{let $=S+2;if($<h||$>=g){h=$,g=Oe(c0,t,$);let M=Oe(xo,t,g);y=g>$&&t.charCodeAt(M)===bo?M:-1;}return y},C=S=>{if(t.startsWith("<!--",S)){let $=r(S+4);if($>=0)return $+3}if(t.startsWith("<?",S)){let $=i(S+2);if($>=0)return $+2}if(t.startsWith("<![CDATA[",S)){let $=a(S+9);if($>=0)return e.cdata(t.slice(S+9,$)),$+3}if(t.startsWith("<!",S)){let $=l(S+2);if($>=0)return $+1}if(t.charCodeAt(S+1)===_o){let $=x(S);return $<0?-1:(e.close(),$+1)}return f(S)},w=0;for(;w<n;)if(t.charCodeAt(w)===a0){let S=C(w);w=S<0?w+1:S;}else {let S=t.indexOf("<",w),$=S<0?n:S;e.text(t.slice(w,$)),w=$;}}function d0(t){let e={},n=0;for(;n<t.length;){let o=Oe(u0,t,n);if(o===n){n++;continue}let r=Oe(xo,t,o);if(t.charCodeAt(r)===s0){let i=Oe(xo,t,r+1),a=t[i],l=a==='"'||a==="'"?t.indexOf(a,i+1):-1;if(l>=0){e[t.slice(n,o)]=Ta(t.slice(i+1,l)),n=l+1;continue}}n=o;}return e}function Vn(t){let e={name:"#root",attrs:{},children:[],text:""},n=[e],o=()=>n.at(-1);m0(t,{open(i,a,l){let s=d0(a),c={name:i,attrs:s,children:[],text:""};o().children.push(c),l||n.push(c);},close(){n.length>1&&n.pop();},text(i){o().text+=Ta(i);},cdata(i){o().text+=i;}});let r=i=>{for(let a of i.children){if(a.name==="svg")return a;let l=r(a);if(l)return l}return null};return r(e)}var zn=[1,0,0,1,0,0];function pt(t,e){let[n,o,r,i,a,l]=t,[s,c,u,m,d,p]=e;return [n*s+r*c,o*s+i*c,n*u+r*m,o*u+i*m,n*d+r*p+a,o*d+i*p+l]}function ot(t,e,n){return [t[0]*e+t[2]*n+t[4],t[1]*e+t[3]*n+t[5]]}function $o(t){return Math.sqrt(Math.abs(t[0]*t[3]-t[1]*t[2]))}function jn(t){return t?(t.match(/[+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?/gi)??[]).map(Number):[]}function ne(t){let e=zn;if(!t)return e;for(let[,n,o]of t.matchAll(/(matrix|translate|scale|rotate|skewX|skewY)\s*\(([^)]*)\)/g)){let r=jn(o),i=zn;switch(n){case "matrix":r.length===6&&(i=r);break;case "translate":i=[1,0,0,1,r[0]??0,r[1]??0];break;case "scale":i=[r[0]??1,0,0,r[1]??r[0]??1,0,0];break;case "rotate":{let a=(r[0]??0)*Math.PI/180,l=Math.cos(a),s=Math.sin(a),[c,u]=[r[1]??0,r[2]??0];i=pt(pt([1,0,0,1,c,u],[l,s,-s,l,0,0]),[1,0,0,1,-c,-u]);break}case "skewX":i=[1,0,Math.tan((r[0]??0)*Math.PI/180),1,0,0];break;case "skewY":i=[1,Math.tan((r[0]??0)*Math.PI/180),0,1,0,0];break;}e=pt(e,i);}return e}var yo=/[+-]?(?:\d+\.?\d*|\.\d+)(?:[eE][+-]?\d+)?/y;function f0(t,e,n,o,r,i,a,l,s){if(t===l&&e===s)return [];let c=Math.abs(n),u=Math.abs(o);if(c===0||u===0)return [{op:"L",x:l,y:s}];let m=r*Math.PI/180,d=Math.cos(m),p=Math.sin(m),b=(t-l)/2,f=(e-s)/2,h=d*b+p*f,g=-p*b+d*f,y=h*h/(c*c)+g*g/(u*u);y>1&&(c*=Math.sqrt(y),u*=Math.sqrt(y));let x=c*c*u*u-c*c*g*g-u*u*h*h,C=c*c*g*g+u*u*h*h,w=(i===a?-1:1)*Math.sqrt(Math.max(0,x/C)),S=w*c*g/u,$=-w*u*h/c,M=d*S-p*$+(t+l)/2,R=p*S+d*$+(e+s)/2,A=(B,D,Q,nt)=>Math.atan2(B*nt-D*Q,B*Q+D*nt),v=A(1,0,(h-S)/c,(g-$)/u),I=A((h-S)/c,(g-$)/u,(-h-S)/c,(-g-$)/u);!a&&I>0?I-=2*Math.PI:a&&I<0&&(I+=2*Math.PI);let F=Math.max(1,Math.ceil(Math.abs(I)/(Math.PI/2)-1e-9)),k=I/F,N=4/3*Math.tan(k/4),L=(B,D)=>[M+c*d*B-u*p*D,R+c*p*B+u*d*D],W=[];for(let B=0;B<F;B++){let D=v+B*k,Q=D+k,[nt,St]=L(Math.cos(D)-N*Math.sin(D),Math.sin(D)+N*Math.cos(D)),[yt,Ct]=L(Math.cos(Q)+N*Math.sin(Q),Math.sin(Q)-N*Math.cos(Q)),[X,j]=B===F-1?[l,s]:L(Math.cos(Q),Math.sin(Q));W.push({op:"C",x1:nt,y1:St,x2:yt,y2:Ct,x:X,y:j});}return W}function re(t){let e=[],n=0,o=0,r=0,i=0,a=0,l="",s=null,c=null,u=()=>{for(;n<t.length&&/[\s,]/.test(t[n]);)n++;},m=()=>{u(),yo.lastIndex=n;let b=yo.exec(t);return b?(n=yo.lastIndex,Number(b[0])):null},d=()=>{u();let b=t[n];return b==="0"||b==="1"?(n++,b==="1"):null},p=b=>{let f=[];for(let h=0;h<b;h++){let g=m();if(g===null)return null;f.push(g);}return f};for(;u(),!(n>=t.length);){let b=t[n];if(/[MmLlHhVvCcSsQqTtAaZz]/.test(b))l=b,n++;else if(!l||l==="Z"||l==="z")break;let f=l===l.toLowerCase(),h=f?o:0,g=f?r:0,y=l.toUpperCase();if(y==="Z"){e.push({op:"Z"}),o=i,r=a,s=null,c=null;continue}if(y==="A"){let S=p(3),$=d(),M=d(),R=p(2);if(!(S&&R)||$===null||M===null)break;let[A,v,I]=S,F=R[0]+h,k=R[1]+g;e.push(...f0(o,r,A,v,I,$,M,F,k)),o=F,r=k,s=null,c=null;continue}let x={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2}[y]??0,C=p(x);if(!C)break;let w=C;switch(y){case "M":o=w[0]+h,r=w[1]+g,i=o,a=r,e.push({op:"M",x:o,y:r}),l=f?"l":"L",s=null,c=null;break;case "L":case "H":case "V":y!=="V"&&(o=w[0]+h),y==="V"?r=w[0]+g:y==="L"&&(r=w[1]+g),e.push({op:"L",x:o,y:r}),s=null,c=null;break;case "C":case "S":{let S,$;y==="C"?(S=[w[0]+h,w[1]+g],$=w.slice(2)):(S=s?[2*o-s[0],2*r-s[1]]:[o,r],$=w);let M=[$[0]+h,$[1]+g],R=[$[2]+h,$[3]+g];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,c=null;break}case "Q":case "T":{let S,$;y==="Q"?(S=[w[0]+h,w[1]+g],$=[w[2]+h,w[3]+g]):(S=c?[2*o-c[0],2*r-c[1]]:[o,r],$=[w[0]+h,w[1]+g]),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]=$,c=S,s=null;break}}}return e}var Wn=.5522847498;function mn(t,e,n,o){if(n<=0||o<=0)return [];let r=n*Wn,i=o*Wn;return [{op:"M",x:t+n,y:e},{op:"C",x1:t+n,y1:e+i,x2:t+r,y2:e+o,x:t,y:e+o},{op:"C",x1:t-r,y1:e+o,x2:t-n,y2:e+i,x:t-n,y:e},{op:"C",x1:t-n,y1:e-i,x2:t-r,y2:e-o,x:t,y:e-o},{op:"C",x1:t+r,y1:e-o,x2:t+n,y2:e-i,x:t+n,y:e},{op:"Z"}]}function De(t,e,n,o,r=0,i=0){if(n<=0||o<=0)return [];let a=Math.min(Math.max(r,0),n/2),l=Math.min(Math.max(i,0),o/2);if(a===0||l===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=a*Wn,c=l*Wn,u=t+n,m=e+o;return [{op:"M",x:t+a,y:e},{op:"L",x:u-a,y:e},{op:"C",x1:u-a+s,y1:e,x2:u,y2:e+l-c,x:u,y:e+l},{op:"L",x:u,y:m-l},{op:"C",x1:u,y1:m-l+c,x2:u-a+s,y2:m,x:u-a,y:m},{op:"L",x:t+a,y:m},{op:"C",x1:t+a-s,y1:m,x2:t,y2:m-l+c,x:t,y:m-l},{op:"L",x:t,y:e+l},{op:"C",x1:t,y1:e+l-c,x2:t+a-s,y2:e,x:t+a,y:e},{op:"Z"}]}var Na="qrdx.frame",Oa=1,Da="custom",it={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:sn},Ba=["wifi","star","heart","phone","headphones","calendar","user","chat","bag","bell","cup","card","check","info","home","pin","share","download","clock","snowflake","pumpkin","tree","sparkle","gift"],Zn=.95,h0=200,Ga=["frame","text","accent","background"],p0=/[\t\n\v\f\r\u0085\u2028\u2029]/g,g0=/[\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=sn){let n=t.slice(0,1e3).normalize("NFC").replace(p0," ").replace(g0,"").replace(/\s+/g," ").trim();return Array.from(n).slice(0,Math.max(0,e)).join("").trim()}var Xn=t=>Math.abs(t*1e3-Math.round(t*1e3))<1e-6;function Co(t){let e=Yn(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 b0(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 Yn(t){return t.qr.padding??t.qr.size*it.defaultPadding}var wo=.52,_0=.35;function y0(t){let e=t.fontSize??t.box.height*wo;return Math.min(e*ln,t.box.height*Zn)}var So=(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 ka(t){let e=Co(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[i,a,l]of o)for(let s=0;s<=8;s++){let c=l+Math.PI/2*(s/8);r.push([i+n*Math.cos(c),a+n*Math.sin(c)]);}return r}function x0([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 i=Math.min(o,n.width/2,n.height/2),a=Math.min(Math.max(t,n.x+i),n.x+n.width-i),l=Math.min(Math.max(e,n.y+i),n.y+n.height-i);return Math.hypot(t-a,e-l)<=i+.01}function $0(t){let e=0;return t.forEach(([n,o],r)=>{let[i,a]=t[(r+1)%t.length];e+=n*a-i*o;}),Math.abs(e)/2}function S0(t,e,n){let o=Co(e);if(!So(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 !ka(e).every(i=>x0(i,r,r.radius??0))}if(t.type==="circle"&&t.hole){let r=t.hole;return !ka(e).every(([i,a])=>Math.hypot(i-t.cx,a-t.cy)<=r+.01)}if(t.type==="polygon"){let r=qn(t.points,o);return r.length>2&&$0(r)>1e-6}return true}function Ro(t){let e=C0(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:i,x1:a,y1:l}=e.bounds;return {bounds:{x0:r-o,y0:i-o,x1:a+o,y1:l+o},segments:e.segments*2}}function C0(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=un(t.d,it.maxDecimals);return e?{bounds:Ia(re(t.d)),segments:Ea(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:h0}}}function Qa(t,e){let n=it,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:i}=t.artboard,a=Math.max(r,i)*.005,l={x0:-a,y0:-a,x1:r+a,y1:i+a},s=g=>g.x0>=l.x0&&g.y0>=l.y0&&g.x1<=l.x1&&g.y1<=l.y1,{qr:c}=t,u=Yn(t);c.plate!=="none"&&u<c.size*n.minPadding-1e-9&&e(`qr.padding must be at least ${n.minPadding*100}% of qr.size`,["qr","padding"]),c.size<Math.min(r,i)*n.minQrShare-1e-9&&e(`qr.size must be at least ${n.minQrShare*100}% of the artboard's shorter side`,["qr","size"]);let m=Co(t);(m.x0<-1e-9||m.y0<-1e-9||m.x1>r+1e-9||m.y1>i+1e-9)&&e("The code and its padding must sit inside the artboard",["qr"]),(c.radius??0)>(c.size+2*u)/2&&e("qr.radius is larger than half the plate",["qr","radius"]);let d=0,p=0;t.shapes.forEach((g,y)=>{let x=["shapes",y],{bounds:C,segments:w}=Ro(g);if(!C){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",[...x,"d"]);return}if(s(C)||e("The shape extends outside the artboard",x),g.type==="rect"&&g.hole){let{hole:S}=g;(S.x<g.x||S.y<g.y||S.x+S.width>g.x+g.width+1e-9||S.y+S.height>g.y+g.height+1e-9)&&e("The hole must sit inside its rect",[...x,"hole"]);}g.type==="circle"&&g.hole&&g.hole>=g.r&&e("The hole must be smaller than the circle",[...x,"hole"]),"stroke"in g&&g.stroke&&g.stroke.width>Math.min(r,i)*.1+1e-9&&e("A stroke may be at most 10% of the artboard's shorter side",[...x,"stroke","width"]),c.plate==="background"&&S0(g,t,C)&&e('With qr.plate "background", only background fills (or a ring whose hole holds the plate) may lie under the plate',x),d+=w,typeof g.fill=="object"&&"gradient"in g.fill&&(p+=(g.fill.gradient.steps??32)*w);}),d>n.maxSegments&&e(`The shapes have ${d} segments; the limit is ${n.maxSegments}`,["shapes"]),p>n.maxGradientWork&&e("Gradient fills are too detailed (fewer steps or simpler shapes)",["shapes"]);let b=[],f=new Set,h=new Set;t.labels.forEach((g,y)=>{let x=["labels",y];f.has(g.id)&&e(`Label id "${g.id}" is used twice`,[...x,"id"]),f.add(g.id),g.slot!=="fixed"&&(h.has(g.slot)&&e(`Only one label may use the ${g.slot} slot`,[...x,"slot"]),h.add(g.slot));let C=g.maxLength??n.maxTextLength;g.text!==dn(g.text,C)&&e(`Label text must be at most ${C} characters, trimmed, with no control or invisible characters (see sanitizeFrameText)`,[...x,"text"]);let w;if(g.type==="text"){w={x0:g.box.x,y0:g.box.y,x1:g.box.x+g.box.width,y1:g.box.y+g.box.height},g.fontSize!==void 0&&g.fontSize>g.box.height*Zn+1e-9&&e("fontSize may be at most 95% of the label's row height",[...x,"fontSize"]);let S=g.box.y+g.box.height/2,$=y0(g)*_0,M={x0:w.x0,x1:w.x1,y0:S-$,y1:S+$};(So(w,b0(t))||So(M,m))&&e("The label overlaps the code or its padding",[...x,"box"]);}else {let{cx:S,cy:$,radius:M}=g.curve,R=g.fontSize*ln*.6;w={x0:S-M-R,y0:$-M-R,x1:S+M+R,y1:$+M+R};let A=Math.hypot(Math.max(m.x0-S,0,S-m.x1),Math.max(m.y0-$,0,$-m.y1));Math.hypot(Math.max(Math.abs(m.x0-S),Math.abs(m.x1-S)),Math.max(Math.abs(m.y0-$),Math.abs(m.y1-$)))<=M-R||A>=M+R||e("The curved label crosses the code or its padding",[...x,"curve"]);}if(s(w)||e("The label extends outside the artboard",x),g.collapse){let S=g.collapse,$=S.y+S.height;(S.y<-1e-9||$>i+1e-9)&&e("The collapse band must sit inside the artboard",[...x,"collapse"]),$>m.y0+1e-6&&S.y<m.y1-1e-6&&e("The collapse band crosses the code or its padding",[...x,"collapse"]);for(let M of b)$>M.y+1e-6&&S.y<M.y+M.height-1e-6&&e("Collapse bands may not overlap",[...x,"collapse"]);b.push(S);}});}var gt=t=>t/255,fn=(t,e)=>(t[0]-e[0])**2+(t[1]-e[1])**2+(t[2]-e[2])**2,q=t=>.2126*t[0]+.7152*t[1]+.0722*t[2];function w0(t){let{width:e,height:n,data:o}=t,r=[0,e-1,(n-1)*e,n*e-1].map(a=>{let l=a*4;return {color:[gt(o[l]),gt(o[l+1]),gt(o[l+2])],alpha:o[l+3]/255}});if(r.some(a=>a.alpha<.9))return null;let i=r[0].color;return r.every(({color:a})=>fn(a,i)<.006)?i:null}function R0(t){let{width:e,height:n,data:o}=t,r=w0(t),i=new Float32Array(e*n);for(let a=0;a<i.length;a++){let l=a*4,s=o[l+3]/255;if(r&&s>0){let c=Math.sqrt(fn([gt(o[l]),gt(o[l+1]),gt(o[l+2])],r));s*=Math.min(1,Math.max(0,(c-.06)/.1));}i[a]=s;}return i}var M0=8,E0=.14,Ua=.006;function A0(t,e){let{width:n,height:o,data:r}=t,i=new Float64Array(4096),a=new Float64Array(4096*3),l=0;for(let p=0;p<e.length;p++){if(e[p]<.9)continue;let b=p*4,f=Math.floor(r[b]/16)*256+Math.floor(r[b+1]/16)*16+Math.floor(r[b+2]/16);i[f]+=1,a[f*3]+=gt(r[b]),a[f*3+1]+=gt(r[b+1]),a[f*3+2]+=gt(r[b+2]),l++;}if(l===0)return {palette:[],error:0};let s=[...i.keys()].filter(p=>i[p]>0).sort((p,b)=>i[b]-i[p]),c=[];for(let p of s){if(i[p]/l<Ua/2||c.length>=M0)break;let b=[a[p*3]/i[p],a[p*3+1]/i[p],a[p*3+2]/i[p]];c.every(f=>fn(f,b)>=E0**2)&&c.push(b);}let u=[],m=0;for(let p=0;p<3;p++){u=c.map(()=>({n:0,r:0,g:0,b:0,x:0,y:0})),m=0;for(let b=0;b<e.length;b++){if(e[b]<.9)continue;let f=b*4,h=[gt(r[f]),gt(r[f+1]),gt(r[f+2])],g=0,y=Number.POSITIVE_INFINITY;for(let[C,w]of c.entries()){let S=fn(h,w);S<y&&(y=S,g=C);}let x=u[g];x.n++,x.r+=h[0],x.g+=h[1],x.b+=h[2],x.x+=b%n,x.y+=Math.floor(b/n),m+=Math.sqrt(y);}for(let[b,f]of u.entries())f.n>0&&(c[b]=[f.r/f.n,f.g/f.n,f.b/f.n]);}return {palette:c.map((p,b)=>({color:p,area:u[b].n/l,cx:u[b].n?u[b].x/u[b].n+.5:n/2,cy:u[b].n?u[b].y/u[b].n+.5:o/2})).filter(p=>p.area>=Ua).sort((p,b)=>b.area-p.area),error:m/l}}function P0(t,e,n){let o=e+2,r=n+2,i=(m,d)=>m<=0||d<=0||m>e||d>n?0:t[(d-1)*e+(m-1)],a=new Map,l=new Map,s=m=>{let d=l.get(m);if(d)return d;let p=Math.floor(m/2),b=p%o,f=Math.floor(p/o),h=i(b,f),g=m%2===1,y=g?i(b,f+1):i(b+1,f),x=h===y?.5:Math.min(1,Math.max(0,(.5-h)/(y-h))),C=g?[b-.5,f-.5+x]:[b-.5+x,f-.5];return l.set(m,C),C},c=(m,d)=>{a.set(m,d);};for(let m=0;m<r-1;m++)for(let d=0;d<o-1;d++){let p=i(d,m)>=.5,b=i(d+1,m)>=.5,f=i(d+1,m+1)>=.5,h=i(d,m+1)>=.5,g=2*(m*o+d),y=2*((m+1)*o+d),x=2*(m*o+d)+1,C=2*(m*o+d+1)+1;switch((p?8:0)+(b?4:0)+(f?2:0)+(h?1:0)){case 1:c(y,x);break;case 2:c(C,y);break;case 3:c(C,x);break;case 4:c(g,C);break;case 5:{(i(d,m)+i(d+1,m)+i(d+1,m+1)+i(d,m+1))/4>=.5?(c(g,x),c(y,C)):(c(g,C),c(y,x));break}case 6:c(g,y);break;case 7:c(g,x);break;case 8:c(x,g);break;case 9:c(y,g);break;case 10:{(i(d,m)+i(d+1,m)+i(d+1,m+1)+i(d,m+1))/4>=.5?(c(x,y),c(C,g)):(c(x,g),c(C,y));break}case 11:c(C,g);break;case 12:c(x,C);break;case 13:c(y,C);break;case 14:c(x,y);break;}}let u=[];for(let m of a.keys()){if(!a.has(m))continue;let d=[],p=m;for(;p!==void 0&&a.has(p);){d.push(s(p));let b=a.get(p);a.delete(p),p=b;}d.length>=3&&u.push(d);}return u}function v0(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 Ha(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,i]=o.pop(),a=t[r],l=t[i],s=l[0]-a[0],c=l[1]-a[1],u=Math.hypot(s,c)||1,m=-1,d=e;for(let p=r+1;p<i;p++){let b=t[p],f=Math.abs(c*(b[0]-a[0])-s*(b[1]-a[1]))/u;f>d&&(d=f,m=p);}m>=0&&(n[m]=1,o.push([r,m],[m,i]));}return t.filter((r,i)=>n[i]===1)}function I0(t,e){let n=0,o=-1;for(let[a,l]of t.entries()){let s=(l[0]-t[0][0])**2+(l[1]-t[0][1])**2;s>o&&(o=s,n=a);}let r=Ha(t.slice(0,n+1),e),i=Ha([...t.slice(n),t[0]],e);return [...r.slice(0,-1),...i.slice(0,-1)]}var qt=t=>U(t,2);function F0(t,e){let n=t.length,o=(i,a)=>{let l=Math.hypot(a[0]-i[0],a[1]-i[1])||1,s=Math.min(.5,e/l);return [i[0]+(a[0]-i[0])*s,i[1]+(a[1]-i[1])*s]},r="";for(let i=0;i<n;i++){let a=t[i],l=o(a,t[(i-1+n)%n]),s=o(a,t[(i+1)%n]);r+=i===0?`M${qt(l[0])} ${qt(l[1])}`:`L${qt(l[0])} ${qt(l[1])}`,r+=`Q${qt(a[0])} ${qt(a[1])} ${qt(s[0])} ${qt(s[1])}`;}return `${r}Z`}function L0(t,e,n){let o="";for(let r of P0(t,e,n)){if(Math.abs(v0(r))<.8)continue;let i=I0(r,.18);i.length>=3&&(o+=F0(i,.9));}return o}var T0=.075;function qa(t){let{width:e,height:n,data:o}=t,r=R0(t),i=0;for(let f of r)i+=f;let{palette:a,error:l}=A0(t,r),s={width:e,height:n,palette:a,alpha:r,coverage:i/(e*n)};if(a.length===0||l>T0)return {...s,layers:[],photographic:a.length>0};let c=a.length,u=Array.from({length:c},()=>new Float32Array(e*n)),m=a.map(f=>f.color);for(let f=0;f<r.length;f++){let h=r[f];if(h<=0)continue;let g=f*4,y=[gt(o[g]),gt(o[g+1]),gt(o[g+2])],x=0,C=-1,w=Number.POSITIVE_INFINITY,S=Number.POSITIVE_INFINITY;for(let v=0;v<c;v++){let I=fn(y,m[v]);I<w?(C=x,S=w,x=v,w=I):I<S&&(C=v,S=I);}if(C<0||w<1e-6){u[x][f]=h;continue}let $=m[x],M=m[C],R=[M[0]-$[0],M[1]-$[1],M[2]-$[2]],A=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)));u[x][f]=h*(1-A),u[C][f]=h*A;}let d=[],p=new Float32Array(e*n),b=new Array(c);for(let f=c-1;f>=0;f--){let h=u[f];for(let g=0;g<p.length;g++)p[g]+=h[g];b[f]=p.slice();}for(let f=0;f<c;f++){let h=L0(b[f],e,n);h&&d.push({color:m[f],d:h});}return {...s,layers:d,photographic:false}}var{QrCode:Mo}=dt,k0={"1L":3,"1M":2,"1Q":1,"1H":1,"2L":2,"3L":1};function N0(t){let e=t*4+17,n=new Uint8Array(e*e),o=(a,l)=>{a>=0&&l>=0&&a<e&&l<e&&(n[l*e+a]=1);};for(let a=0;a<e;a++)o(6,a),o(a,6);for(let[a,l]of [[3,3],[e-4,3],[3,e-4]])for(let s=-4;s<=4;s++)for(let c=-4;c<=4;c++)o(a+c,l+s);let r=[];if(t>1){let a=Math.floor(t/7)+2,l=t===32?26:Math.ceil((t*4+4)/(a*2-2))*2;r.push(6);for(let s=e-7;r.length<a;s-=l)r.splice(1,0,s);}let i=r.length-1;for(let[a,l]of r.entries())for(let[s,c]of r.entries())if(!(a===0&&s===0||a===0&&s===i||a===i&&s===0))for(let u=-2;u<=2;u++)for(let m=-2;m<=2;m++)o(l+m,c+u);for(let a=0;a<=8;a++)o(8,a),o(a,8);for(let a=0;a<8;a++)o(e-1-a,8),o(8,e-1-a);if(t>=7)for(let a=0;a<18;a++){let l=e-11+a%3,s=Math.floor(a/3);o(l,s),o(s,l);}return n}function O0(t,e){let n=t*4+17,o=wt[e].ordinal,r=Mo.NUM_ERROR_CORRECTION_BLOCKS[o]?.[t]??0,i=Mo.ECC_CODEWORDS_PER_BLOCK[o]?.[t]??0,a=Math.floor(Mo.getNumRawDataModules(t)/8),l=r-a%r,s=Math.floor(a/r),c=Array.from({length:r},(C,w)=>s+(w<l?0:1)),u=[],m=[],d=s-i;for(let C=0;C<=s;C++)for(let w=0;w<r;w++)if(w<l){if(C===d)continue;u.push(w),m.push(C<d?C:C-1);}else u.push(w),m.push(C);if(u.length!==a)throw new Error(`Codeword map: interleave mismatch at version ${t}`);let p=N0(t),b=new Int16Array(n*n).fill(-1),f=new Int16Array(n*n).fill(-1),h=new Int8Array(n*n).fill(-1),g=a*8,y=0;for(let C=n-1;C>=1;C-=2){C===6&&(C=5);let w=(C+1&2)===0;for(let S=0;S<n;S++)for(let $=0;$<2;$++){let M=C-$,A=(w?n-1-S:S)*n+M;if(!p[A]&&y<g){let v=y>>>3;b[A]=u[v],f[A]=m[v],h[A]=7-(y&7),y++;}}}if(y!==g)throw new Error(`Codeword map: placement mismatch at version ${t}`);let x=k0[`${t}${e}`]??0;return {version:t,level:e,size:n,blocks:r,eccPerBlock:i,blockLengths:c,correctable:Math.floor((i-x)/2),block:b,codeword:f,bit:h}}var D0=8,oe=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=oe.get(n);if(o)return oe.delete(n),oe.set(n,o),o;let r=O0(t,e);if(oe.size>=D0){let i=oe.keys().next().value;i!==void 0&&oe.delete(i);}return oe.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 i=t.block[r]??-1;if(i<0)continue;let a=i*4096+t.codeword[r];o.has(a)||(o.add(a),n[i]=n[i]+1);}return n}var B0={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"778899",lightslategrey:"778899",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"ff0000",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32"},G0=Object.fromEntries(Object.entries(B0).map(([t,e])=>[t,[Number.parseInt(e.slice(0,2),16),Number.parseInt(e.slice(2,4),16),Number.parseInt(e.slice(4,6),16)]]));function za(t,e){let n=t.trim(),o=Number.parseFloat(n);return Number.isNaN(o)?Number.NaN:n.endsWith("%")?o/100*e:o}function tt(t){if(!t)return null;let e=t.trim().toLowerCase();if(e==="transparent")return {r:0,g:0,b:0,a:0};let n=G0[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(i=>i+i).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,i]=o[1].split("/"),a=r.split(/[\s,]+/).filter(Boolean);if(a.length!==(i===void 0&&a.length===4?4:3))return null;let l=i??a[3],[s,c,u]=a.slice(0,3).map(p=>za(p,255)),m=l===void 0?1:za(l,1);if([s,c,u,m].some(p=>Number.isNaN(p)))return null;let d=(p,b)=>Math.min(Math.max(p,0),b);return {r:d(s,255),g:d(c,255),b:d(u,255),a:d(m,1)}}return null}function hn(t,e,n){let o=t/255,r=e/255,i=n/255,a=1-Math.max(o,r,i);return a>=1?[0,0,0,1]:[U((1-o-a)/(1-a)),U((1-r-a)/(1-a)),U((1-i-a)/(1-a)),U(a)]}function Nt(t){return t.children}var Q0=t=>t==null?null:`${t}`;function Eo(t,e,n){let o=e??{},r=n;if("key"in o){let{key:i,...a}=o;i!==void 0&&(r=i),o=a;}return {type:t,props:o,key:Q0(r)}}function U0(t,e){let n=t;return {type:n.type,props:{...n.props,...e},key:n.key??null}}function H0(t,e,...n){let o={...e};return n.length>0&&(o.children=n.length===1?n[0]:n),Eo(t,o)}var q0={jsx:Eo,jsxs:Eo,createElement:H0,cloneElement:U0,Fragment:Nt},pn=q0;var Ao=t=>t===Nt?pn.Fragment:t;function E(t,e,n){return pn.jsx(Ao(t),e,n)}function ct(t,e,n){return pn.jsxs(Ao(t),e,n)}function Po(t,e,...n){return pn.createElement(Ao(t),e??null,...n)}function Be(t,e){return pn.cloneElement(t,e)}var z0=new Set([Symbol.for("react.element"),Symbol.for("react.transitional.element")]),Wa=Symbol.for("react.fragment");function tr(t){if(typeof t!="object"||t===null||Array.isArray(t))return false;let e=t;return e.$$typeof!==void 0&&!z0.has(e.$$typeof)?false:(typeof e.type=="string"||typeof e.type=="function"||e.type===Wa)&&typeof e.props=="object"&&e.props!==null}var er=t=>t===Nt||t===Wa;var W0=.6;var Ge=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 i=this.entries.keys().next().value;i!==void 0&&this.entries.delete(i);}return this.entries.set(e,r),r}},V0=new Ge(8);function j0(t){return V0.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 Fo(t){let{width:e,height:n,data:o}=t;if(!(Number.isInteger(e)&&Number.isInteger(n))||e<1||n<1||e>lo||n>lo||typeof o!="string")return null;try{let r=j0(o);return r.length===e*n*4?{width:e,height:n,data:r}:null}catch{return null}}function Ka(t){return !!(t&&so.includes(t.mode)&&t.image&&Fo(t.image))}function Lo(t){let e=ma[t.mode];return t.variant&&e.includes(t.variant)?t.variant:e[0]}function Z0(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 i=e-7;r.length<n;i-=o)r.splice(1,0,i);return r}function gn(t,e){let n=Z0(t,e),o=n.length-1,r=[];for(let[i,a]of n.entries())for(let[l,s]of n.entries())i===0&&l===0||i===0&&l===o||i===o&&l===0||r.push([a,s]);return r}var Rt=1,Pt=2,zt=3,Va=4,ja=new Map;function X0(t){let e=ja.get(t);if(e)return e;let n=t*4+17,o=new Uint8Array(n*n),r=(i,a,l,s,c)=>{for(let u=Math.max(0,a);u<Math.min(n,a+s);u++)for(let m=Math.max(0,i);m<Math.min(n,i+l);m++)o[u*n+m]=c;};r(6,0,1,n,Va),r(0,6,n,1,Va),r(0,8,9,1,zt),r(8,0,1,9,zt),r(n-8,8,8,1,zt),r(8,n-8,1,8,zt),t>=7&&(r(n-11,0,3,6,zt),r(0,n-11,6,3,zt));for(let[i,a]of gn(t,n))r(i-2,a-2,5,5,Pt);return r(0,0,8,8,Rt),r(n-8,0,8,8,Rt),r(0,n-8,8,8,Rt),ja.set(t,o),o}function Y0(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 rr(t,e){let n=tt(t);return !n||n.a===0?e:[n.r/255,n.g/255,n.b/255]}var ae=(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 Wt(t,e,n,o){let r=q(t);if(o?r<=n:r>=n)return t;let i=q(e);return Math.abs(r-i)<1e-6?e:ae(t,e,Math.min(1,Math.max(0,(r-n)/(r-i))))}var Ja=t=>Math.max(...t)-Math.min(...t),K0=(t,e)=>(t[0]-e[0])**2+(t[1]-e[1])**2+(t[2]-e[2])**2,vo=t=>t.toString(16).padStart(2,"0");function bt(t,e=1){let n=o=>Math.min(255,Math.round(Math.round(Math.min(Math.max(o,0),1)*255)/e)*e);return `#${vo(n(t[0]))}${vo(n(t[1]))}${vo(n(t[2]))}`}function J0(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 To=.3,Za=t=>1-Math.exp(-((t/2)**2)/(2*To**2)),tm=t=>J0(t/(2*To*Math.SQRT2))**2,em=(t,e,n)=>{let o=Math.min(1,Math.max(0,(n-t)/(e-t)));return o*o*(3-2*o)};function ko(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 ts(t,e){let{width:n,height:o,data:r}=t,i=new Float32Array(n*o*3),a=e??new Float32Array(n*o);for(let l=0;l<n*o;l++)i[l*3]=r[l*4]/255,i[l*3+1]=r[l*4+1]/255,i[l*3+2]=r[l*4+2]/255,e||(a[l]=r[l*4+3]/255);return {width:n,height:o,rgb:i,alpha:a}}function nm(t){let e=ts(t),{rgb:n,alpha:o}=e,r=new Float64Array(256),i=0;for(let m=0;m<o.length;m++){if(o[m]<.5)continue;let d=q([n[m*3],n[m*3+1],n[m*3+2]]);r[Math.min(255,Math.floor(d*256))]+=1,i++;}let a=m=>{let d=0;for(let p=0;p<256;p++)if(d+=r[p],d>=m*i)return p/255;return 1},l=i?a(.01):0,s=i?a(.99):1;s-l<.15&&(l=0,s=1);let c=Math.min(1.6,1/(s-l)),u=(l+s)/2;for(let m=0;m<o.length;m++){let d=[n[m*3],n[m*3+1],n[m*3+2]],p=q(d),b=.5+(p-u)*c;for(let f=0;f<3;f++)n[m*3+f]=Math.min(1,Math.max(0,b+(d[f]-p)*1.12));}return e}function es(t,e,n,o,r=1){let{width:i,height:a,rgb:l,alpha:s}=t,c=Math.min(Math.max(e-.5,0),i-1),u=Math.min(Math.max(n-.5,0),a-1),m=Math.floor(c),d=Math.floor(u),p=Math.min(m+1,i-1),b=Math.min(d+1,a-1),f=c-m,h=u-d,g=0,y=0,x=0,C=0,w=($,M,R)=>{let A=M*i+$,v=s[A]*R;g+=l[A*3]*v,y+=l[A*3+1]*v,x+=l[A*3+2]*v,C+=v;};if(w(m,d,(1-f)*(1-h)),w(p,d,f*(1-h)),w(m,b,(1-f)*h),w(p,b,f*h),C<=0)return o;let S=C*r;return [o[0]+(g/C-o[0])*S,o[1]+(y/C-o[1])*S,o[2]+(x/C-o[2])*S]}var rm=new Ge(4),om=new Ge(6),im=new Ge(6);function No(t,e){return om.get(t.image.data,()=>qa(e))}function ns(t,e,n){return im.get(t.image.data,()=>ts(e,n.alpha))}var at=t=>U(t,2),rs=t=>U(t,4),se=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,am(n,o,r));}toElements(e){return [...this.groups].map(([n,o],r)=>E("path",{d:o.join(""),fill:n},`${e}-${r}`))}};function am(t,e,n){let o=at(n*2),r=at(n);return `M${at(t-n)} ${at(e)}a${r} ${r} 0 1 0 ${o} 0a${r} ${r} 0 1 0 ${-o} 0z`}function ie(t,e,n,o,r){let i=Math.min(r,n/2,o/2);if(i<=0)return `M${at(t)} ${at(e)}h${at(n)}v${at(o)}h${at(-n)}z`;let a=at(i);return `M${at(t+i)} ${at(e)}h${at(n-2*i)}a${a} ${a} 0 0 1 ${a} ${a}v${at(o-2*i)}a${a} ${a} 0 0 1 ${-a} ${a}h${at(-(n-2*i))}a${a} ${a} 0 0 1 ${-a} ${-a}v${at(-(o-2*i))}a${a} ${a} 0 0 1 ${a} ${-a}z`}function os(t,e,n){let o="";for(let[r,i]of t){let a=(r-2+e)*n,l=(i-2+e)*n;o+=ie(a,l,5*n,5*n,n*.35),o+=ie(a+n,l+n,3*n,3*n,n*.15),o+=ie(a+2*n,l+2*n,n,n,n*.12);}return o}var sm={blend:1,badge:1,color:.9,mono:.7},lm=.35;function is(t,e,n){let o=Math.min(Math.max(t.intensity??W0,0),sm[Lo(t)]);return q(n)-q(e)>=lm?o:0}function cm(t){let{art:e,modules:n,version:o}=t,r=e.image&&Fo(e.image);if(!(r&&so.includes(e.mode)))return null;let i=n.length;if(i!==o*4+17)return null;let a=rr(t.fgColor,[0,0,0]),l=rr(t.bgColor,[1,1,1]),s=is(e,a,l);return s<=0?null:{art:e,image:r,modules:n,size:i,version:o,kinds:X0(o),margin:t.margin,pixelSize:t.pixelSize,t:s,fg:a,bg:l,variant:Lo(e),body:t.body}}function as(t){let e=cm(t);if(!e)return null;let n;return e.art.mode==="halftone"?n=e.variant==="mono"?pm(e):hm(e):n=e.variant==="badge"?wm(e):gm(e),E("g",{"data-qrdx-art":e.art.mode,"data-qrdx-art-variant":e.variant,children:n})}function um(t,e){return {margin:.42-.17*t+(e===3?.04:0),darkCap:.4+.3*t}}var ss=8.5,Xa=new Map;function Oo(t){let e=t*4+17,n=Xa.get(t);if(!n){let i=e*2,a=new Uint8Array(i*i),l=ss*2;for(let s=0;s<i;s++)for(let c=0;c<i;c++){let u=c<l||c>=i-l,m=s<l||s>=i-l;u&&m&&!(c>=i-l&&s>=i-l)&&(a[s*i+c]=1);}for(let[s,c]of gn(t,e))for(let u=(c-2)*2-1;u<(c+3)*2+1;u++)for(let m=(s-2)*2-1;m<(s+3)*2+1;m++)m>=0&&u>=0&&m<i&&u<i&&(a[u*i+m]=1);Xa.set(t,a),n=a;}let o=n,r=e*2;return (i,a)=>{let l=Math.floor(i*2),s=Math.floor(a*2);return l>=0&&s>=0&&l<r&&s<r&&o[s*r+l]===1}}function ls(t,e,n=false){let{image:o,size:r,kinds:i,fg:a,bg:l}=t,s=rm.get(t.art.image.data,()=>nm(o)),c=ko(o.width,o.height,r,"cover"),u=r*e,m=new Float32Array(u*u*3).fill(Number.NaN),p=1/(e*c.scale)>1.3?2:1,b=q(l)-.1*(q(l)-q(a)),f=Oo(t.version);for(let h=0;h<r;h++)for(let g=0;g<r;g++){let y=i[h*r+g],x=y===Rt||y===Pt;if(!(x&&!n))for(let C=0;C<e;C++)for(let w=0;w<e;w++){let S=0,$=0,M=0;for(let N=0;N<p;N++)for(let L=0;L<p;L++){let W=g+(w+(L+.5)/p)/e,B=h+(C+(N+.5)/p)/e,D=es(s,(W-c.offsetX)/c.scale,(B-c.offsetY)/c.scale,l);S+=D[0],$+=D[1],M+=D[2];}let R=p*p,A=[S/R,$/R,M/R],v=g+(w+.5)/e,I=h+(C+.5)/e,F=Math.min(v,I,r-v,r-I);F<1.5&&(A=ae(A,l,.35*(1-F/1.5))),n&&(x||f(v,I))&&(A=Wt(A,l,b,false));let k=((h*e+C)*u+g*e+w)*3;m[k]=A[0],m[k+1]=A[1],m[k+2]=A[2];}}return {n:e,count:u,rgb:m}}function mm(t,e,n){let{size:o,kinds:r,modules:i,fg:a,bg:l,t:s}=t,{n:c,count:u,rgb:m}=e,d=q(a),p=q(l),b=p-d,f=um(s,c),h=M=>.2126*m[M]+.7152*m[M+1]+.0722*m[M+2],g=new Float32Array(o*o),y=new Float32Array(o*o);for(let M=0;M<o;M++)for(let R=0;R<o;R++){let A=r[M*o+R];if(A===Rt){g[M*o+R]=p;continue}if(A===Pt){g[M*o+R]=i[M]?.[R]?d:p;continue}let v=0,I=0,F=0;for(let k=0;k<c;k++)for(let N=0;N<c;N++){let L=h(((M*c+k)*u+R*c+N)*3);v+=L,n.under[k*c+N]||(I+=L,F++);}g[M*o+R]=v/(c*c),y[M*o+R]=F?I/F:v/(c*c);}let x=o+1,C=new Float64Array(x*x);for(let M=0;M<o;M++)for(let R=0;R<o;R++)C[(M+1)*x+R+1]=g[M*o+R]+C[M*x+R+1]+C[(M+1)*x+R]-C[M*x+R];let w=2,S=(M,R)=>{let A=Math.max(0,M-w),v=Math.max(0,R-w),I=Math.min(o,M+w+1),F=Math.min(o,R+w+1);return (C[F*x+I]-C[v*x+I]-C[F*x+A]+C[v*x+A])/((I-A)*(F-v))},$=n.weight;for(let M=0;M<o;M++)for(let R=0;R<o;R++){let A=r[M*o+R];if(A===Rt||A===Pt)continue;let v=A===zt,I=(f.margin+(v?.08:0))*b,F=(f.darkCap-(v?.12:0))*b,k=($*((n.light-n.dark)/2)-I)/(1-$),N=S(R,M),L=y[M*o+R],W=!!i[M]?.[R],B=0,D=l;if(W){let Q=Math.min(N+k,d+F);L>Q&&(B=(L-Q)/Math.max(L-d,1e-6),D=a);}else {let Q=Math.max(N-k,p-F);L<Q&&(B=(Q-L)/Math.max(p-L,1e-6));}if(!(B<=0)){B=Math.min(1,B);for(let Q=0;Q<c;Q++)for(let nt=0;nt<c;nt++){let St=((M*c+Q)*u+R*c+nt)*3;for(let yt=0;yt<3;yt++)m[St+yt]+=(D[yt]-m[St+yt])*B;}}}}function cs(t,e,n,o){let{count:r}=e,i=new se;for(let s=0;s<r;s++){let c=0,u=n(s*r);for(let m=1;m<=r;m++){let d=m<r?n(s*r+m):null;(m===r||d!==u)&&(u&&i.cellRun(u,c,s,m-c),c=m,u=d);}}let a=t.pixelSize/e.n,l=at(t.margin*t.pixelSize);return E("g",{transform:`translate(${l} ${l}) scale(${rs(a)})`,children:i.toElements(o)},o)}function Do(t,e){let n=gn(t.version,t.size);return n.length===0?[]:[E("path",{d:os(n,t.margin,t.pixelSize),fill:e,fillRule:"evenodd"},"art-alignment")]}function us(t){let{image:e,size:n}=t;return Math.floor(Math.min(e.width,e.height)/n)>=4&&n<=45?4:3}var dm=t=>2*To*Math.sqrt(-2*Math.log(1-Math.min(t,.95)));function fm(t,e,n){let o=e+1,r=new Float64Array(o*o);for(let a=0;a<e;a++)for(let l=0;l<e;l++)r[(a+1)*o+l+1]=t[a*e+l]+r[a*o+l+1]+r[(a+1)*o+l]-r[a*o+l];let i=new Float32Array(e*e);for(let a=0;a<e;a++)for(let l=0;l<e;l++){let s=Math.max(0,l-n),c=Math.max(0,a-n),u=Math.min(e,l+n+1),m=Math.min(e,a+n+1);i[a*e+l]=(r[m*o+u]-r[c*o+u]-r[m*o+s]+r[c*o+s])/((u-s)*(m-c));}return i}function ms(t,e,n,o){let{size:r,kinds:i,modules:a,fg:l,bg:s}=t,c=q(l),u=q(s),m=u-c,d=fm(e,r,2),p=new Float32Array(r*r),b=new Float32Array(r*r).fill(Number.NaN);for(let f=0;f<r;f++)for(let h=0;h<r;h++){let g=f*r+h,y=i[g];if(y===Rt||y===Pt)continue;let x=y===zt,C=o.base+(x?.08:0),w=(o.margin+(x?.03:0))*m,S=(o.cap-(x?.04:0))*m,$=Za(C),M=Za(x?Math.max(o.max,.94):o.max),R=$*((o.dark+o.light)/2)+(1-$)*d[g],A=n[g],v=!!a[f]?.[h],I=v?o.dark:o.light,F=v?Math.min(R-w,c+S):Math.max(R+w,u-S),N=(v?A<=F:A>=F)?0:(A-F)/(A-I);N>M&&(N=M,b[g]=Math.min(u,Math.max(c,(F-M*I)/(1-M))));let L=v?A<=F-.06:A>=F+.06;o.skip&&L&&!x||(N=Math.max(N,$)),p[g]=N>0?dm(N):0;}return {diameter:p,surround:b}}function hm(t){let{size:e,kinds:n,modules:o,fg:r,bg:i,t:a,margin:l,pixelSize:s}=t,c=us(t),u=ls(t,c,true),m=q(r),d=q(i),p=m+.1*(d-m),b=d-.05*(d-m),{count:f,rgb:h}=u,g=(S,$,M,R)=>(($*c+R)*f+S*c+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===Rt||M===Pt){y[S*e+$]=M===Pt&&o[S]?.[$]?m:d;continue}let R=0;for(let A=0;A<c;A++)for(let v=0;v<c;v++){let I=g($,S,v,A);R+=.2126*h[I]+.7152*h[I+1]+.0722*h[I+2];}y[S*e+$]=R/(c*c);}let x=ms(t,y,y,{base:.6-.28*a,max:.86,dark:p,light:b,margin:.2-.1*a,cap:.4+.14*a,skip:false});for(let S=0;S<e;S++)for(let $=0;$<e;$++){let M=x.surround[S*e+$];if(Number.isNaN(M))continue;let R=y[S*e+$],v=M<R?r:i,I=Math.min(1,Math.abs(R-M)/Math.max(Math.abs(R-q(v)),1e-6));for(let F=0;F<c;F++)for(let k=0;k<c;k++){let N=g($,S,k,F);for(let L=0;L<3;L++)h[N+L]+=(v[L]-h[N+L])*I;}}let C=[cs(t,u,S=>{let $=S*3;return Number.isNaN(h[$])?null:bt([h[$],h[$+1],h[$+2]],8)},"art-photo")],w=new se;for(let S=0;S<e;S++)for(let $=0;$<e;$++){let M=x.diameter[S*e+$];if(!(M>0))continue;let R=0,A=0,v=0;for(let k=0;k<c;k++)for(let N=0;N<c;N++){let L=g($,S,N,k);R+=h[L],A+=h[L+1],v+=h[L+2];}let I=[R/(c*c),A/(c*c),v/(c*c)],F=o[S]?.[$]?Wt(I,r,p,true):Wt(I,i,b,false);w.circle(bt(F,10),($+l+.5)*s,(S+l+.5)*s,M/2*s);}return C.push(...w.toElements("art-dot"),...Do(t,bt(r))),C}function pm(t){let{size:e,kinds:n,modules:o,fg:r,bg:i}=t,a=us(t),l=ls(t,a),s=q(r),c=q(i),u=a%2===1?1:2,m=(a-u)/2,d=R=>R>=m&&R<m+u,p=[];for(let R=0;R<a;R++)for(let A=0;A<a;A++)p.push(d(A)&&d(R));mm(t,l,{weight:tm(u/a),dark:s,light:c,under:p});let{count:b,rgb:f}=l,h=new Float32Array(b*b),g=new Int8Array(b*b).fill(-1);for(let R=0;R<b*b;R++){let A=R*3;if(Number.isNaN(f[A])){h[R]=Number.NaN;continue}let v=(.2126*f[A]+.7152*f[A+1]+.0722*f[A+2]-s)/(c-s);h[R]=.5+(em(0,1,v)-.5)*1.15;}for(let R=0;R<e;R++)for(let A=0;A<e;A++){let v=n[R*e+A];if(!(v===Rt||v===Pt))for(let I=m;I<m+u;I++)for(let F=m;F<m+u;F++)g[(R*a+I)*b+A*a+F]=o[R]?.[A]?0:1;}let y=Oo(t.version);for(let R=0;R<b;R++)for(let A=0;A<b;A++){let v=R*b+A;g[v]<0&&y((A+.5)/a,(R+.5)/a)&&(g[v]=1);}let x=new Uint8Array(b*b),C=.3,w=0,S=0,$=(R,A,v)=>{if(R<0||R>=b||A>=b)return;let I=A*b+R;if(!Number.isNaN(h[I])){let F=Math.floor(R/a)===Math.floor(w/a)&&Math.floor(A/a)===Math.floor(S/a);h[I]+=F?v:v*C;}};for(let R=0;R<b;R++){let A=R%2===0?1:-1;for(let v=0;v<b;v++){let I=A===1?v:b-1-v,F=R*b+I,k=h[F];if(Number.isNaN(k))continue;let N=g[F]>=0?g[F]:k>=.5?1:0;x[F]=N===0?1:0;let L=Math.min(.75,Math.max(-0.75,k-N));w=I,S=R,$(I+A,R,L*7/16),$(I-A,R+1,L*3/16),$(I,R+1,L*5/16),$(I+A,R+1,L/16);}}let M=bt(r);return [cs(t,l,R=>x[R]?M:null,"art-halftone"),...Do(t,M)]}function Ya(t,e){let n=null,o=0;for(let r of t.palette){if(e&&K0(r.color,e)<.02)continue;let i=r.area*(.35+Ja(r.color))*(q(r.color)>.86?.05:1);i>o&&(o=i,n=r.color);}return n}function ds(t,e,n,o,r){let i;if(t.photographic){let a=new se,{width:l,height:s,rgb:c,alpha:u}=e;for(let m=0;m<s;m++){let d=0,p=null;for(let b=0;b<=l;b++){let f=m*l+b,h=b<l&&u[f]>=.5?bt(o([c[f*3],c[f*3+1],c[f*3+2]]),6):null;(b===l||h!==p)&&(p&&a.cellRun(p,d,m,b-d),d=b,p=h);}}i=a.toElements(`${r}-px`);}else i=t.layers.map((a,l)=>E("path",{d:a.d,fill:bt(o(a.color)),fillRule:"evenodd"},`${r}-${l}`));return E("g",{transform:`translate(${at(n.x)} ${at(n.y)}) scale(${rs(n.scale)})`,children:i},r)}function gm(t){let{art:e,image:n,size:o,kinds:r,modules:i,fg:a,bg:l,t:s,margin:c,pixelSize:u}=t,m=No(e,n),d=ns(e,n,m),p=ko(m.width,m.height,o,"contain"),b=Math.min(1,.3+1.4*s),f=L=>ae(l,L,b),h=bt(l),g=bt(a),y=[ds(m,d,{x:(c+p.offsetX)*u,y:(c+p.offsetY)*u,scale:p.scale*u},f,"art-logo")],x=ss,C=(L,W)=>ie((L+c)*u,(W+c)*u,(x+.4)*u,(x+.4)*u,1.2*u),w=gn(t.version,o).map(([L,W])=>ie((L-2.5+c)*u,(W-2.5+c)*u,6*u,6*u,u*.8)).join("");y.push(E("path",{d:C(-0.4,-0.4)+C(o-x,-0.4)+C(-0.4,o-x)+w,fill:h},"art-plates"));let S=Oo(t.version),$=q(l),M=q(a),R=new Float32Array(o*o),A=new Float32Array(o*o),v=new Array(o*o);for(let L=0;L<o;L++)for(let W=0;W<o;W++){let B=L*o+W,D=r[B];if(D===Rt||D===Pt){R[B]=D===Pt&&i[L]?.[W]?M:$;continue}let Q=1,nt=0,St=0,yt=0,Ct=0;for(let X=0;X<4;X++)for(let j=0;j<4;j++){let Kt=W+(j+.5)/4,Y=L+(X+.5)/4,Jt=S(Kt,Y)?l:es(d,(Kt-p.offsetX)/p.scale,(Y-p.offsetY)/p.scale,l,b),rn=q(Jt);Q=Math.min(Q,rn),nt+=rn,St+=Jt[0],yt+=Jt[1],Ct+=Jt[2];}R[B]=nt/16,A[B]=Q,v[B]=[St/16,yt/16,Ct/16];}let I=M+.08*($-M),F=$-.04*($-M),k=ms(t,R,R,{base:.74-.26*s,max:.9,dark:I,light:F,margin:.23-.1*s,cap:.4+.1*s,skip:s>=.7}),N=new se;for(let L=0;L<o;L++)for(let W=0;W<o;W++){let B=L*o+W,D=k.diameter[B],Q=!!i[L]?.[W];if(!(D>0)||!Q&&A[B]>=$-.02)continue;let nt=Q?Wt(v[B],a,I,true):Wt(v[B],l,F,false);N.circle(bt(nt,8),(W+c+.5)*u,(L+c+.5)*u,D/2*u);}return y.push(...N.toElements("art-dot")),y.push(...Do(t,g)),y}var bm={L:.5,M:.72,Q:.88,H:1},fs=.32,hs=.55,_m=.6,ym=2;function ps(t,e,n){let o=e>=1?t:t*e,r=e>=1?t/e:t,i=Math.max(.7,t*.09),a=o+2*i,l=r+2*i;return {logoW:o,logoH:r,plateW:a,plateH:l,radius:Math.min(a,l)*.26,cx:n/2,cy:n/2}}var gs=t=>({cx:t.cx,cy:t.cy,w:t.plateW,h:t.plateH,r:t.radius});function bs(t,e,n){return ys(e+.5,n+.5,t)<hs}function xm(t,e){let n=gs(t),o=hs+1,r=Math.max(0,Math.floor(t.cx-t.plateW/2-o)),i=Math.min(e-1,Math.ceil(t.cx+t.plateW/2+o)),a=Math.max(0,Math.floor(t.cy-t.plateH/2-o)),l=Math.min(e-1,Math.ceil(t.cy+t.plateH/2+o)),s=[];for(let c=a;c<=l;c++)for(let u=r;u<=i;u++)bs(n,u,c)&&s.push(c*e+u);return s}var $m=t=>Math.floor(t.correctable*_m);function Io(t,e,n){let o=ps(t,e,n.size),r=$m(n);return Jn(n,xm(o,n.size)).every(i=>i<=r)}function _s(t,e,n){if(Io(n,e,t))return n;let o=0,r=n;if(!Io(o,e,t))return -1;for(;r-o>1/64;){let i=(o+r)/2;Io(i,e,t)?o=i:r=i;}return o}var nr=new Map;function Sm(t,e){let n=`${t.version}${t.level}:${e.toFixed(3)}`,o=nr.get(n);return o===void 0&&(o=_s(t,e,fs*t.size),nr.size>=64&&nr.clear(),nr.set(n,o)),o}function Cm(t,e){let{size:n,t:o,modules:r,version:i}=t,a=Y0(r),l=(.18+.15*o)*bm[a],s=e.width/e.height,c=Math.min(fs,l)*n,u=Kn(i,a),m=Math.max(0,Sm(u,s));if(m<ym)return {wantedBox:c,maxBox:m,box:0,plate:null};let d=_s(u,s,Math.min(c,m));return d<0?{wantedBox:c,maxBox:m,box:0,plate:null}:{wantedBox:c,maxBox:m,box:d,plate:ps(d,s,n)}}function ys(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 xs(t,e){let{fg:n,bg:o,t:r}=t,i=q(n),a=q(o),l=Ya(e),s=Math.min(1,r/.6),c=l?Wt(l,n,i+.3*(a-i),true):n,u=ae(n,c,s),m=l?Ya(e,l):null,d=i+.42*(a-i),p=m&&q(m)<=d+.22?ae(n,Wt(m,n,d,true),s):u;return {body:u,inner:p}}function wm(t){let{art:e,image:n,size:o,kinds:r,modules:i,bg:a,margin:l,pixelSize:s,version:c}=t,u=No(e,n),m=Cm(t,u).plate,{body:d}=xs(t,u),p=bt(d),b=m&&gs(m),f=i.map(v=>[...v]);for(let v=0;v<o;v++)for(let I=0;I<o;I++){let F=r[v*o+I];(F===Pt||b&&F!==Rt&&bs(b,I,v))&&(f[v][I]=false);}let h=[],g=t.body?.(f);if(g)h.push(E("g",{fill:p,children:g},"art-body"));else {let v=new se;for(let I=0;I<o;I++)for(let F=0;F<o;F++)f[I]?.[F]&&r[I*o+F]!==Rt&&v.circle(p,(F+l+.5)*s,(I+l+.5)*s,.45*s);h.push(...v.toElements("art-body"));}let y=gn(c,o).filter(([v,I])=>!b||ys(v+.5,I+.5,b)>3.2);if(y.length>0&&h.push(E("path",{d:os(y,l,s),fill:p,fillRule:"evenodd"},"art-alignment")),!m)return h;let x=ns(e,n,u),C=(m.cx-m.plateW/2+l)*s,w=(m.cy-m.plateH/2+l)*s,S=m.plateW*s,$=m.plateH*s,M=m.radius*s,R=.1*s,A=ie(C,w,S,$,M);return h.push(E("path",{d:A,fill:bt(a)},"art-plate"),E("path",{d:A+ie(C+R,w+R,S-2*R,$-2*R,M-R),fill:bt(ae(a,d,.16)),fillRule:"evenodd"},"art-plate-ring"),ds(u,x,{x:(m.cx-m.logoW/2+l)*s,y:(m.cy-m.logoH/2+l)*s,scale:m.logoW/u.width*s},v=>v,"art-logo")),h}function $s(t){let{art:e}=t;if(e.mode!=="logo"||e.matchEyes===false)return null;let n=e.image&&Fo(e.image);if(!n)return null;let o=rr(t.fgColor,[0,0,0]),r=rr(t.bgColor,[1,1,1]),i=is(e,o,r);if(i<=0)return null;let a=No(e,n);if(a.palette.length===0)return null;if(Lo(e)==="badge"){let{body:b,inner:f}=xs({fg:o,bg:r,t:i},a),h={outer:bt(b),inner:bt(f)};return {topLeft:h,topRight:h,bottomLeft:h}}let l=q(o),s=q(r),c=Math.min(1,i/.6),u=t.version*4+17,m=ko(a.width,a.height,u,"contain"),d=.45*Math.max(a.width,a.height),p=(b,f)=>{let h=(b-m.offsetX)/m.scale,g=(f-m.offsetY)/m.scale,y=null,x=0;for(let w of a.palette){if(q(w.color)>.86)continue;let S=(w.cx-h)**2+(w.cy-g)**2,$=w.area*(.35+Ja(w.color))*Math.exp(-S/(2*d**2));$>x&&(x=$,y=w.color);}if(!y)return {};let C=Wt(y,o,l+.42*(s-l),true);return {inner:bt(ae(o,C,c))}};return {topLeft:p(3.5,3.5),topRight:p(u-3.5,3.5),bottomLeft:p(3.5,u-3.5)}}var Ss=t=>t*3+3&-4,Bo=(t,e)=>Math.floor((t*e+255*(255-e)+127)/255);function Cs(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=Ss(e),r=o*n,i=new Uint8Array(54+r),a=new DataView(i.buffer);i[0]=66,i[1]=77,a.setUint32(2,i.length,true),a.setUint32(10,54,true),a.setUint32(14,40,true),a.setInt32(18,e,true),a.setInt32(22,n,true),a.setUint16(26,1,true),a.setUint16(28,24,true),a.setUint32(30,0,true),a.setUint32(34,r,true),a.setInt32(38,2835,true),a.setInt32(42,2835,true);for(let l=0;l<n;l++){let s=l*e*4,c=54+(n-1-l)*o;for(let u=0;u<e;u++){let m=t[s+3],d=t[s],p=t[s+1],b=t[s+2];m===255?(i[c]=b,i[c+1]=p,i[c+2]=d):(i[c]=Bo(b,m),i[c+1]=Bo(p,m),i[c+2]=Bo(d,m)),s+=4,c+=3;}}return i}function ws(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+Ss(n)*o}function or(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=Cs(n,t.width,t.height);if(!ws(o))throw new Error("Could not write a BMP file");return new Blob([o],{type:"image/bmp"})}function G(t){if(t.length===0)return "";let[e,...n]=t;return `M${_(e[0])} ${_(e[1])}${n.map(([o,r])=>`L${_(o)} ${_(r)}`).join("")}Z`}function H(t,e,n){return `M${_(t-n)} ${_(e)}A${_(n)} ${_(n)} 0 1 1 ${_(t+n)} ${_(e)}A${_(n)} ${_(n)} 0 1 1 ${_(t-n)} ${_(e)}Z`}function T(t,e,n,o,r=0){let i=Math.min(n,o)/2,[a,l,s,c]=(typeof r=="number"?[r,r,r,r]:r).map(m=>Math.max(0,Math.min(m,i))),u=(m,d,p)=>m>0?`A${_(m)} ${_(m)} 0 0 1 ${_(d)} ${_(p)}`:"";return `M${_(t+a)} ${_(e)}H${_(t+n-l)}${u(l,t+n,e+l)}V${_(e+o-s)}${u(s,t+n-s,e+o)}H${_(t+c)}${u(c,t,e+o-c)}V${_(e+a)}${u(a,t+a,e)}Z`}function Go(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 Qe(t,e,n,o,r=-90){return Array.from({length:o},(i,a)=>{let l=(r+360/o*a)*Math.PI/180;return [t+n*Math.cos(l),e+n*Math.sin(l)]})}function Ue(t,e,n,o,r=5){return Array.from({length:r*2},(i,a)=>{let l=a%2===0?n:o,s=-Math.PI/2+Math.PI/r*a;return [t+l*Math.cos(s),e+l*Math.sin(s)]})}function He(t,e,n,o,r=4,i=64){return Array.from({length:i},(a,l)=>{let s=2*Math.PI*l/i,c=Math.cos(s),u=Math.sin(s);return [t+n*Math.sign(c)*Math.abs(c)**(2/r),e+o*Math.sign(u)*Math.abs(u)**(2/r)]})}function qe(t,e,n){let o=n/2,r=(i,a)=>`${_(t+i*o)} ${_(e+a*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 Rs(t,e,n,o){if(o===0)return t;let r=o*Math.PI/180,i=Math.cos(r),a=Math.sin(r);return t.map(([l,s])=>[e+(l-e)*i-(s-n)*a,n+(l-e)*a+(s-n)*i])}function ir(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 le(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)}function Qo(t,e,n,o,r){let i=Math.max(0,Math.min(r,Math.min(n,o)/2)),a=(l,s)=>`A${_(i)} ${_(i)} 0 0 0 ${_(l)} ${_(s)}`;return `M${_(t+i)} ${_(e)}H${_(t+n-i)}${a(t+n,e+i)}V${_(e+o-i)}${a(t+n-i,e+o)}H${_(t+i)}${a(t,e+o-i)}V${_(e+i)}${a(t+i,e)}Z`}function ar(t,e,n,o,r){let i=Math.max(0,Math.min(r,Math.min(n,o)/2));return G([[t+i,e],[t+n-i,e],[t+n-i,e+i],[t+n,e+i],[t+n,e+o-i],[t+n-i,e+o-i],[t+n-i,e+o],[t+i,e+o],[t+i,e+o-i],[t,e+o-i],[t,e+i],[t+i,e+i]])}function bn(t,e,n,o,r){let i=o,a=n/2,l=(a-i)*.55,s=(c,u)=>`${_(t+c)} ${_(e+u)}`;return `M${s(i,0)}C${s(i+l,0)} ${s(a-l,r)} ${s(a,r)}C${s(a+l,r)} ${s(n-i-l,0)} ${s(n-i,0)}A${_(i)} ${_(i)} 0 0 1 ${s(n,i)}C${s(n,i+l)} ${s(n-r,a-l)} ${s(n-r,a)}C${s(n-r,a+l)} ${s(n,n-i-l)} ${s(n,n-i)}A${_(i)} ${_(i)} 0 0 1 ${s(n-i,n)}C${s(n-i-l,n)} ${s(a+l,n-r)} ${s(a,n-r)}C${s(a-l,n-r)} ${s(i+l,n)} ${s(i,n)}A${_(i)} ${_(i)} 0 0 1 ${s(0,n-i)}C${s(0,n-i-l)} ${s(r,a+l)} ${s(r,a)}C${s(r,a-l)} ${s(0,i+l)} ${s(0,i)}A${_(i)} ${_(i)} 0 0 1 ${s(i,0)}Z`}function Uo(t,e,n,o,r,i){let a=n/2,l=(s,c)=>`${_(t+s)} ${_(e+c)}`;return `M${l(o,0)}H${_(t+n-o)}A${_(o)} ${_(o)} 0 0 1 ${l(n,o)}V${_(e+r)}C${l(n,r+1.55*i)} ${l(a+1.6*i,n)} ${l(a,n)}C${l(a-1.6*i,n)} ${l(0,r+1.55*i)} ${l(0,r)}V${_(e+o)}A${_(o)} ${_(o)} 0 0 1 ${l(o,0)}Z`}var Rm=["horizontal-line","liquid","liquid-horizontal","liquid-vertical","classy","classy-rounded","leaf","plus","hexagon","star","heart","random-dots","mosaic","octagon"];function Ms(t){return Rm.includes(t)}var Mm={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 Ho(t,e){if(t===void 0||!Number.isFinite(t))return 1;let n=e?Mm[e]??1:co;return Math.min(fa,Math.max(co,n,t))}function Em(t,e,n){return t<7&&e<7||t>=n-7&&e<7||t<7&&e>=n-7}function Am(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 i=e-7;r.length<n;i-=o)r.splice(1,0,i);return r}function qo(t){let e=(t-17)/4,n=Number.isInteger(e)?Am(e,t):[],o=n.length-1,r=[];for(let[i,a]of n.entries())for(let[l,s]of n.entries())i===0&&l===0||i===0&&l===o||i===o&&l===0||r.push([a,s]);return (i,a)=>r.some(([l,s])=>Math.abs(i-l)<=2&&Math.abs(a-s)<=2)}var Pm={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 vm(t,e,n,o,r,i){switch(t){case "horizontal-line":{let a=o*.43;return T(e-o/2,n-a,o,2*a)}case "leaf":{let a=o*.5;return T(e-a,n-a,2*a,2*a,[o*.4,o*.05,o*.4,o*.05])}case "plus":{let a=o*.22,l=o*.5;return G([[e-a,n-l],[e+a,n-l],[e+a,n-a],[e+l,n-a],[e+l,n+a],[e+a,n+a],[e+a,n+l],[e-a,n+l],[e-a,n+a],[e-l,n+a],[e-l,n-a],[e-a,n-a]])}case "hexagon":return G(Qe(e,n,o*.54,6));case "star":return G(Ue(e,n+o*.04,o*.62,o*.34));case "heart":return qe(e,n+o*.02,o*1.08);case "random-dots":return H(e,n,o*(.38+.15*ir(r,i)));case "mosaic":{let a=o*(.8+.14*ir(r,i,1))/2,l=[[e-a,n-a],[e+a,n-a],[e+a,n+a],[e-a,n+a]];return G(Rs(l,e,n,(ir(r,i,2)-.5)*16))}case "octagon":return G(Qe(e,n,o*.48/Math.cos(Math.PI/8),8,22.5));default:return H(e,n,o*.45)}}function Es(t,e){let{margin:n,pixelSize:o,pattern:r}=e,i=Ho(e.scale,r),a=t.length,l=e.plain?()=>false:qo(a),s=(f,h)=>!e.plain&&Em(f,h,a),c=(f,h)=>f>=0&&h>=0&&f<a&&h<a&&!!t[h]?.[f]&&!s(f,h),u=f=>(f+.5+n)*o,m=[],d=[],p=Pm[r];for(let f=0;f<a;f++)for(let h=0;h<a;h++){if(!c(h,f))continue;let g=u(h),y=u(f);if(l(h,f)){m.push(P`M${g-o/2} ${y-o/2}h${o}v${o}h${-o}z`);continue}if(!p){d.push(vm(r,g,y,o*i,h,f));continue}let x=o*p.thickness*i/2,C=p.horizontal&&c(h+1,f),w=p.horizontal&&c(h-1,f),S=p.vertical&&c(h,f-1),$=p.vertical&&c(h,f+1),R=[!(S||w),!(S||C),!($||C),!($||w)].map((A,v)=>A?x*p.radius(v):0);d.push(T(g-x,y-x,2*x,2*x,R)),2*x<o&&(C&&d.push(T(g,y-x,o,2*x)),$&&d.push(T(g-x,y,2*x,o)));}if(p?.fillets&&i===1){let f=o*.3;for(let h=0;h<a;h++)for(let g=0;g<a;g++){if(c(g,h)||s(g,h))continue;let y=u(g)-o/2,x=u(h)-o/2,C=y+o,w=x+o;c(g-1,h)&&c(g,h-1)&&c(g-1,h-1)&&d.push(P`M${y} ${x}h${f}A${f} ${f} 0 0 0 ${y} ${x+f}Z`),c(g+1,h)&&c(g,h-1)&&c(g+1,h-1)&&d.push(P`M${C} ${x}v${f}A${f} ${f} 0 0 0 ${C-f} ${x}Z`),c(g+1,h)&&c(g,h+1)&&c(g+1,h+1)&&d.push(P`M${C} ${w}h${-f}A${f} ${f} 0 0 0 ${C} ${w-f}Z`),c(g-1,h)&&c(g,h+1)&&c(g-1,h+1)&&d.push(P`M${y} ${w}v${-f}A${f} ${f} 0 0 0 ${y+f} ${w}Z`);}}let b=[];return d.length>0&&b.push(E("path",{d:d.join("")},"modules")),m.length>0&&b.push(E("path",{d:m.join("")},"alignment")),b}var zo=(t,e=0)=>{for(let n=e;n<t.length;n++)if(t[n]?.continue!==true)return true;return false};function Vt(t,e=[],n={}){return {...n,run(o){let r=t({value:o,issues:[]}),i=zo(r.issues);for(let a of e){if(a.hasLength){let s=r.value;if(r.issues.some(c=>c.continue===false)||s===null||s===void 0||s.length===void 0)continue}else if(i)continue;let l=r.issues.length;a.run(r),!i&&r.issues.length>l&&(i=zo(r.issues,l));}return r}}}function Im(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 ue=(t,e)=>({path:[],message:`Invalid input: expected ${t}, received ${Im(e)}`}),Fm={string:"characters",array:"items"};function Ot(t,e,n,o){let r=Fm[e],i=t?"Too big":"Too small",a=`${t?"<=":">="}${n}`;return {path:[],message:r?`${i}: expected ${e} to have ${a} ${r}`:`${i}: expected ${e} to be ${a}`,continue:o}}var Wo=t=>typeof t=="string"?`"${t}"`:`${t}`,Is=t=>typeof t=="object"&&t!==null&&!Array.isArray(t);function Xo(t,e,n){for(let o of n)o.path.unshift(e),t.push(o);}var Lm=t=>t>=55296&&t<=56319,Tm=t=>t>=56320&&t<=57343;function km(t){let e=t.length;for(let n=0;n<t.length-1;n++)Lm(t.charCodeAt(n))&&Tm(t.charCodeAt(n+1))&&(e--,n++);return e}var Fs=t=>Array.isArray(t)?"array":typeof t=="string"?"string":"unknown",xn=t=>({run(e){e.value<t&&e.issues.push(Ot(false,"number",t,true));}}),$n=t=>({run(e){e.value>t&&e.issues.push(Ot(true,"number",t,true));}}),Ve=(t,e="Invalid input")=>({run(n){t(n.value)||n.issues.push({path:[],message:e,continue:true});}}),Ls=t=>typeof t=="string"?km(t):t.length,Ts=t=>({hasLength:true,run(e){let n=e.value;Ls(n)<t&&e.issues.push(Ot(false,Fs(n),t,true));}}),Yo=t=>({hasLength:true,run(e){let n=e.value;Ls(n)>t&&e.issues.push(Ot(true,Fs(n),t,true));}}),ks=(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});}}),Nm={run(t){let e=t.value;Number.isInteger(e)?Number.isSafeInteger(e)||t.issues.push(e>0?Ot(true,"int",Number.MAX_SAFE_INTEGER,true):Ot(false,"int",Number.MIN_SAFE_INTEGER,true)):t.issues.push({...ue("int",e),continue:false});}},me=(...t)=>Vt(e=>{let n=e.value;return typeof n=="number"&&Number.isFinite(n)||e.issues.push(ue("number",n)),e},t),Ns=(...t)=>me(Nm,...t),sr=(...t)=>Vt(e=>(typeof e.value!="string"&&e.issues.push(ue("string",e.value)),e),t);function Et(t){let e=t.length===1?`Invalid input: expected ${Wo(t[0])}`:`Invalid option: expected one of ${t.map(Wo).join("|")}`;return Vt(n=>(t.includes(n.value)||n.issues.push({path:[],message:e}),n),[],{values:t})}var Mt=t=>Et([t]),V=t=>({optional:true,run:e=>e===void 0?{value:e,issues:[]}:t.run(e)});function J(t,e=[]){let n=Object.keys(t),o=new Set(n);return Vt(r=>{let i=r.value;if(!Is(i))return r.issues.push(ue("object",i)),r;let a={};for(let s of n){let c=t[s],u=c.run(i[s]),m=s in i;Xo(r.issues,s,u.issues),m||c.optional||u.issues.length>0||r.issues.push({path:[s],message:"Invalid input: expected nonoptional, received undefined"}),m&&(a[s]=u.value);}r.value=a;let l=[];for(let s in i)o.has(s)||l.push(s);return l.length>0&&r.issues.push({path:[],message:`Unrecognized key${l.length>1?"s":""}: ${l.map(Wo).join(", ")}`,continue:true}),r},e,{shape:t})}function Vo(t,e,n){let o=[];return e!==void 0&&o.push(Ts(e)),n!==void 0&&o.push(Yo(n)),Vt(r=>{let i=r.value;if(Array.isArray(i)&&n!==void 0&&i.length>n)return r.issues.push(Ot(true,"array",n,false)),r;if(!Array.isArray(i))return r.issues.push(ue("array",i)),r;let a=new Array(i.length);for(let l=0;l<i.length;l++){let s=t.run(i[l]);Xo(r.issues,l,s.issues),a[l]=s.value;}return r.value=a,r},o)}function jo(t){return Vt(e=>{let n=e.value;if(!Array.isArray(n))return e.issues.push(ue("tuple",n)),e;if(n.length<t.length)return e.issues.push(Ot(false,"array",t.length,void 0)),e;n.length>t.length&&e.issues.push(Ot(true,"array",t.length,void 0));let o=[];return t.forEach((r,i)=>{let a=r.run(n[i]);Xo(e.issues,i,a.issues),o[i]=a.value;}),e.value=o,e})}function We(t){return Vt(e=>{let n=[];for(let r of t){let i=r.run(e.value);if(i.issues.length===0)return i;n.push(i);}let o=n.filter(r=>!zo(r.issues));return o.length===1?o[0]:(e.issues.push({path:[],message:"Invalid input"}),e)})}function Os(t,e){let n=new Map;for(let r of e)for(let i of r.shape?.[t]?.values??[])n.set(i,r);let o=`Invalid discriminator value. Expected ${[...n.keys()].map(r=>`'${r}'`).join(" | ")}`;return Vt(r=>{let i=r.value;if(!Is(i))return r.issues.push(ue("object",i)),r;let a=n.get(i[t]);return a?a.run(i):(r.issues.push({path:[t],message:o}),r)})}var Om=Ve(Xn,`Numbers may have at most ${it.maxDecimals} decimals`),cr=[xn(-4e3),$n(it.maxCoordinate),Om],st=me(...cr),ft=me(...cr,Ve(t=>t>0,"Must be greater than 0")),lr=me(...cr,Ve(t=>t>=0,"Must not be negative")),yn=sr(ks(/^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/,"Use a #rgb or #rrggbb color")),As=We([Et(Ga),yn]),Ds=t=>J({mix:jo([t,t]),amount:me(xn(0),$n(1),Ve(Xn))}),ze=We([As,Ds(As)]),Dm=We([yn,Ds(We([Et(["frame","accent","background"]),yn]))]),ce=We([ze,J({gradient:J({from:ze,to:ze,direction:V(Et(["horizontal","vertical"])),steps:V(Ns(xn(2),$n(it.maxGradientSteps)))})})]),Zo=()=>({x:st,y:st,width:ft,height:ft}),_n=J({color:ze,width:ft}),Bm=Os("type",[J({type:Mt("rect"),...Zo(),radius:V(lr),fill:ce,hole:V(J({...Zo(),radius:V(lr)})),stroke:V(_n)}),J({type:Mt("circle"),cx:st,cy:st,r:ft,hole:V(ft),fill:ce,stroke:V(_n)}),J({type:Mt("ellipse"),cx:st,cy:st,rx:ft,ry:ft,fill:ce,stroke:V(_n)}),J({type:Mt("polygon"),points:Vo(jo([st,st]),3,it.maxPolygonPoints),fill:ce,stroke:V(_n)}),J({type:Mt("path"),d:sr(Ts(2),Yo(it.maxPathLength)),fill:ce,fillRule:V(Et(["nonzero","evenodd"])),stroke:V(_n)}),J({type:Mt("line"),x1:st,y1:st,x2:st,y2:st,width:ft,cap:V(Et(["butt","round"])),dash:V(jo([ft,ft])),fill:ce}),J({type:Mt("icon"),icon:Et(Ba),x:st,y:st,size:ft,fill:ce})]),Ps=()=>({id:sr(ks(/^[a-z][a-z0-9-]{0,31}$/)),slot:Et(["primary","secondary","fixed"]),text:sr(Yo(200)),maxLength:V(Ns(xn(1),$n(sn))),color:ze,weight:V(Et(["bold","regular"])),collapse:V(J({y:st,height:ft}))}),Gm=Os("type",[J({type:Mt("text"),...Ps(),box:J(Zo()),align:V(Et(["start","middle","end"])),fontSize:V(ft)}),J({type:Mt("curved"),...Ps(),curve:J({cx:st,cy:st,radius:ft,side:Et(["top","bottom"]),spread:V(me(xn(20),$n(300),Ve(Xn)))}),fontSize:ft})]),vs=me(...cr,Ve(t=>t>=it.minArtboard&&t<=it.maxArtboard,`Artboard sides must be ${it.minArtboard} to ${it.maxArtboard} units`)),Qm=J({kind:Mt(Na),version:Mt(Oa),artboard:J({width:vs,height:vs}),qr:J({x:st,y:st,size:ft,padding:V(lr),radius:V(lr),plate:V(Et(["opaque","background","none"]))}),colors:J({frame:yn,text:V(Dm),accent:V(yn)}),shapes:Vo(Bm,void 0,it.maxShapes),labels:Vo(Gm,void 0,it.maxLabels),bleed:V(We([Mt("none"),ze]))},[{run(t){Qa(t.value,(e,n=[])=>{t.issues.push({path:[...n],message:e,continue:true});});}}]);function Bs(t){let e=Qm.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 Gs=({path:t,message:e})=>t.length>0?`${t.join(".")}: ${e}`:e;var Qs=24,jt=(t,e,n,o)=>{let r=o*Math.PI/180;return [t+n*Math.cos(r),e+n*Math.sin(r)]},ur=([t,e])=>`${_(t)} ${_(e)}`;function je(t,e,n,o,r,i){let a=i-r>180?1:0;return `M${ur(jt(t,e,o,r))}A${_(o)} ${_(o)} 0 ${a} 1 ${ur(jt(t,e,o,i))}L${ur(jt(t,e,n,i))}A${_(n)} ${_(n)} 0 ${a} 0 ${ur(jt(t,e,n,r))}Z`}function Sn(t,e,n,o){return `M${_(t-n)} ${_(e)}A${_(n)} ${_(o)} 0 1 1 ${_(t+n)} ${_(e)}A${_(n)} ${_(o)} 0 1 1 ${_(t-n)} ${_(e)}Z`}function Um(t){let e=0;return t.forEach(([n,o],r)=>{let[i,a]=t[(r+1)%t.length];e+=n*a-i*o;}),e/2}function Us(t){return G(Um(t)<0?[...t].reverse():t)}function mr(t,e,n,o,r){let i=Math.hypot(n-t,o-e)||1,a=-(o-e)/i*(r/2),l=(n-t)/i*(r/2);return Us([[t+a,e+l],[n+a,o+l],[n-a,o-l],[t-a,e-l]])}var _t=(...t)=>({d:t.join(""),fillRule:"nonzero"}),Dt=(...t)=>({d:t.join(""),fillRule:"evenodd"});function Hm(){let t=[];for(let e of [0,60,120]){let[n,o]=jt(12,12,10.5,e+180),[r,i]=jt(12,12,10.5,e);t.push(mr(n,o,r,i,2));}for(let e=0;e<6;e++){let n=e*60,[o,r]=jt(12,12,6.2,n);for(let i of [-45,45]){let[a,l]=jt(o,r,3.6,n+i);t.push(mr(o,r,a,l,1.7));}}return _t(...t)}var qm={wifi:()=>_t(je(12,20,4.6,7.2,-135,-45),je(12,20,9.2,11.8,-135,-45),je(12,20,13.8,16.4,-135,-45),H(12,20,2.2)),star:()=>_t(G(Ue(12,12.8,11.6,4.8))),heart:()=>_t(qe(12,12.4,22)),phone:()=>Dt(T(6,1.5,12,21,2.6),T(7.8,4.2,8.4,13.4,.6),H(12,19.8,1.1)),headphones:()=>_t(je(12,13,7.6,9.8,-180,0),T(2,12,5,9.5,2),T(17,12,5,9.5,2)),calendar:()=>Dt(T(2.5,4,19,17.5,2.5),T(4.6,9,14.8,10.6,.8),T(7,11.4,2.6,2.6,.4),T(10.7,11.4,2.6,2.6,.4),T(14.4,11.4,2.6,2.6,.4),T(7,15.1,2.6,2.6,.4),T(10.7,15.1,2.6,2.6,.4),T(6.5,1.4,2.4,2.6,[1.2,1.2,0,0]),T(15.1,1.4,2.4,2.6,[1.2,1.2,0,0])),user:()=>_t(H(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:()=>Dt(T(2,3,20,14,4),G([[6.5,17],[11.5,17],[5.8,21.8]]),H(7.5,10,1.5),H(12,10,1.5),H(16.5,10,1.5)),bag:()=>_t(T(3.5,7.5,17,14.5,2),je(12,7.5,3.1,4.8,-180,0)),bell:()=>_t("M3.5 17.2A8.5 8.5 0 0 1 20.5 17.2Z",T(1.5,18.2,21,2.6,1.3),T(11.2,6.6,1.6,2.6,0),T(9.8,4.6,4.4,2.4,1.2)),cup:()=>_t("M4 6.5H17V13.5A6.5 6.5 0 0 1 4 13.5Z",je(17,10.2,1.7,3.6,-90,90),T(2,20.6,17,2,1),T(7,1.6,1.6,3.4,.8),T(11.6,1.6,1.6,3.4,.8)),card:()=>Dt(T(1.5,4.5,21,15,2.5),T(1.5,8,21,3,0),T(4.5,13.6,4.6,3.2,.6)),check:()=>Dt(H(12,12,10.5),G([[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:()=>Dt(H(12,12,10.5),H(12,7.2,1.6),T(10.6,10,2.8,8,.8)),home:()=>Dt(G([[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]]),T(10,14.5,4,7,[.6,.6,0,0])),pin:()=>Dt("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",H(12,9.5,3)),share:()=>_t(mr(6,12,18,5,1.8),mr(6,12,18,19,1.8),H(18,5,3.2),H(6,12,3.2),H(18,19,3.2)),download:()=>_t(T(10.6,2,2.8,9.5,0),G([[6,10],[18,10],[12,16.5]]),G([[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:()=>Dt(H(12,12,10.5),H(12,12,8.4),G([[11,5.4],[13,5.4],[13,11.3],[16.9,13.5],[15.9,15.2],[11,12.5]])),snowflake:Hm,pumpkin:()=>_t(Sn(7.8,14.6,5.8,6.9),Sn(16.2,14.6,5.8,6.9),Sn(12,14.6,4.8,7.4),T(10.9,3.4,2.2,4.6,.8),Us([[13,4.2],[17.2,3],[16.2,5.4],[13,6]])),tree:()=>_t(G([[12,1.5],[16.8,8.2],[7.2,8.2]]),G([[12,5.2],[19,13.6],[5,13.6]]),G([[12,9.4],[21.2,19.2],[2.8,19.2]]),T(10.4,18.6,3.2,3.9,.4)),sparkle:()=>_t(G(Ue(9.5,13.5,9,2.4,4)),G(Ue(19,5,4,1.1,4))),gift:()=>_t(T(3,11.2,7.8,10.6,1),T(13.2,11.2,7.8,10.6,1),T(2,7.4,8.8,3.2,1),T(13.2,7.4,8.8,3.2,1),Sn(8.8,4.8,2.9,1.9),Sn(15.2,4.8,2.9,1.9))};function Hs(t){return qm[t]()}function qs(t){return t===" "?.3:/[MWmw@%]/.test(t)?.92:/[A-Z0-9#&]/.test(t)?.72:/[il.,:;!'|1]/.test(t)?.32:.6}function Jo(t){let e=0;for(let n of t)e+=qs(n);return Math.max(e,1)}var Ko=t=>Math.round(Math.min(255,Math.max(0,t))).toString(16).padStart(2,"0");function dr(t,e,n){let o=tt(t)??{r:0,g:0,b:0},r=tt(e)??{r:255,g:255,b:255},i=Math.min(1,Math.max(0,n));return `#${Ko(o.r+(r.r-o.r)*i)}${Ko(o.g+(r.g-o.g)*i)}${Ko(o.b+(r.b-o.b)*i)}`}function zs(t,e,n,o,r,i,a,l){let s=[...t],c=r*.08,u=s.map(f=>qs(f)*r),m=u.reduce((f,h)=>f+h,0)+c*Math.max(0,s.length-1),d=i==="top"?o-r*.35:o+r*.35,p=[],b=0;return s.forEach((f,h)=>{let g=u[h],y=(b+g/2)/d;if(b+=g+c,f.trim()==="")return;let x=i==="top"?-Math.PI/2-m/2/d+y:Math.PI/2+m/2/d-y;p.push({text:f,x:e+d*Math.cos(x),y:n+d*Math.sin(x),fontSize:r,maxWidth:r*2,color:a,rotate:x*180/Math.PI+(i==="top"?90:-90),field:l});}),p}var fr=class extends Error{issues;constructor(e){super(`Invalid frame spec: ${e.slice(0,5).join("; ")}`),this.name="FrameSpecError",this.issues=e;}},Ws=new WeakMap;function Cn(t){if(t&&typeof t=="object"){let n=Ws.get(t);if(n)return n}if(t==null)throw new fr(['A "custom" frame needs a spec']);let e=Bs(t);if(!e.success)throw new fr(e.issues.map(Gs));return typeof t=="object"&&Ws.set(t,e.data),e.data}var zm=t=>{let e=tt(t);return !!(e&&e.a>=1)};function Wm(t,e){let n=ut(e,rt);return t.qr.plate==="none"?{color:n,plate:false}:zm(n)?{color:n,plate:true}:t.qr.plate==="background"?{color:n,plate:false}:{color:rt,plate:true}}function js(t,e,n=rt){let o=e.color||t.colors.frame,r=e.secondaryColor||t.colors.accent||o,i=s=>s==="frame"?o:s==="accent"?r:s==="background"?n:s,a=t.colors.text,l=e.textColor||(a===void 0?o:typeof a=="string"?a:dr(i(a.mix[0]),i(a.mix[1]),a.amount));return {frame:o,text:l,accent:r}}function Vm(t,e,n){let o=js(e,t,n),r=i=>{switch(i){case "frame":return o.frame;case "text":return o.text;case "accent":return o.accent;case "background":return n;default:return i}};return i=>typeof i=="string"?r(i):dr(r(i.mix[0]),r(i.mix[1]),i.amount)}function Vs(t,e,n=0,o=0){let r=un(t);return r?go(r,e,n,o):""}function jm(t,e,n,o){return `M${_(t-n)} ${_(e)}A${_(n)} ${_(o)} 0 1 1 ${_(t+n)} ${_(e)}A${_(n)} ${_(o)} 0 1 1 ${_(t-n)} ${_(e)}Z`}function Zm(t,e){let[n,o,r,i]=[t.x1*e,t.y1*e,t.x2*e,t.y2*e],a=Math.hypot(r-n,i-o),l=t.width*e/2,s=a>0?(r-n)/a:1,c=a>0?(i-o)/a:0,u=-c*l,m=s*l,d=(h,g)=>{let y=[n+s*h,o+c*h],x=[n+s*g,o+c*g];if(t.cap==="round"&&g-h>2*l){let C=[y[0]+s*l,y[1]+c*l],w=[x[0]-s*l,x[1]-c*l];return `M${_(C[0]-u)} ${_(C[1]-m)}L${_(w[0]-u)} ${_(w[1]-m)}A${_(l)} ${_(l)} 0 0 1 ${_(w[0]+u)} ${_(w[1]+m)}L${_(C[0]+u)} ${_(C[1]+m)}A${_(l)} ${_(l)} 0 0 1 ${_(C[0]-u)} ${_(C[1]-m)}Z`}return `M${_(y[0]-u)} ${_(y[1]-m)}L${_(x[0]-u)} ${_(x[1]-m)}L${_(x[0]+u)} ${_(x[1]+m)}L${_(y[0]+u)} ${_(y[1]+m)}Z`};if(!t.dash)return {type:"path",d:d(0,a),fillRule:"nonzero"};let p=t.dash[0]*e,b=p+t.dash[1]*e,f=[];for(let h=0;h+p<=a+1e-6;h+=b)f.push(d(h,h+p));return {type:"path",d:f.join(""),fillRule:"nonzero"}}function Xm(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:H(t.cx*e,t.cy*e,t.r*e)+(t.hole?H(t.cx*e,t.cy*e,t.hole*e):""),fillRule:t.hole?"evenodd":"nonzero"};case "ellipse":return {type:"path",d:jm(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:Vs(t.d,e),fillRule:t.fillRule??"nonzero"};case "line":return Zm(t,e);default:{let n=Hs(t.icon);return {type:"path",d:Vs(n.d,t.size*e/Qs,t.x*e,t.y*e),fillRule:n.fillRule}}}}function Ym(t){if(t.type==="rect"){let{x:e,y:n,width:o,height:r,radius:i,hole:a}=t;return [...De(e,n,o,r,i,i),...a?De(a.x,a.y,a.width,a.height,a.radius,a.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"}]:re(t.d)}function Km(t,e,n){let o=Ym(t),r=Pa(o,.2),i=t.type==="rect"?t.hole?"evenodd":"nonzero":t.type==="path"?t.fillRule??"nonzero":"nonzero",a=e.direction==="vertical",l=h=>a?h[1]:h[0],s=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY;for(let h of r)for(let g of h)s=Math.min(s,l(g)),c=Math.max(c,l(g));if(!(c>s))return [];let u=e.steps??32,m=n(e.from),d=n(e.to),p=c-s,b=p*.002,f=[];for(let h=0;h<u;h++){let g=s+p*h/u,y=Math.min(c,s+p*(h+1)/u+(h+1<u?b:0)),x=a?{x0:Number.NEGATIVE_INFINITY,x1:Number.POSITIVE_INFINITY,y0:g,y1:y}:{x0:g,x1:y,y0:Number.NEGATIVE_INFINITY,y1:Number.POSITIVE_INFINITY},C=r.map(w=>qn(w,x)).filter(w=>w.length>2);C.length!==0&&f.push({type:"path",d:va(C),fill:dr(m,d,(h+.5)/u),fillRule:i});}return f}function Jm(t,e,n){let o=Xm(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 i=Km(o,t.fill.gradient,n);return r?[...i,{...o,fill:"none",...r}]:i}return [{...o,fill:n(t.fill),...r}]}function t1(t,e){let n=Math.min(t.maxLength??it.maxTextLength,it.maxTextLength),o=t.slot==="primary"?e.text??t.text:t.slot==="secondary"?e.secondaryText??t.text:t.text;return dn(o,n)}function e1(t){return t===void 0||!Number.isFinite(t)?1:Math.min(ln,Math.max(Hn,t))}function n1(t,e,n,o,r,i){let a=r(t.color),l=t.weight==="regular"?{fontWeight:400}:{};if(t.type==="curved"){let{cx:f,cy:h,radius:g,side:y,spread:x=140}=t.curve,C=g*o*(x*Math.PI/180),w=Math.min(t.fontSize*o*n,C/(Jo(e)+.08*e.length));return zs(e,f*o,h*o,g*o,w,y,a,i).map(S=>({...S,...l}))}let s=t.box.x*o,c=t.box.y*o,u=t.box.width*o,m=t.box.height*o;if(!(m>0))return [];let d=(t.fontSize??t.box.height*wo)*o,p=Math.min(d*n,m*Zn,u/Jo(e)),b=t.align??"middle";return [{text:e,x:b==="start"?s:b==="end"?s+u:s+u/2,y:c+m/2+p*.35,fontSize:p,maxWidth:u,color:a,...b!=="middle"&&{align:b},...l,field:i}]}function r1(t){let e=0,n=0,o=0,r=0;return t.map(({command:i,values:a})=>{let l=i.toUpperCase(),s=i!==l;switch(l){case "Z":return e=o,n=r,{command:"Z",values:[]};case "H":return e=(s?e:0)+a[0],{command:"H",values:[e]};case "V":return n=(s?n:0)+a[0],{command:"V",values:[n]};case "A":return e=(s?e:0)+a[5],n=(s?n:0)+a[6],{command:"A",values:[...a.slice(0,5),e,n]};default:{let c=a.map((u,m)=>s?u+(m%2===0?e:n):u);return e=c.at(-2),n=c.at(-1),l==="M"&&(o=e,r=n),{command:l,values:c}}}})}function o1(t,e){let n=un(t);return n?go(r1(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((i,a)=>a%2===1?e(i):i)})):t}function i1(t,e){let n=(o,r)=>{let i=e(o);return {y:i,height:e(o+r)-i}};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:o1(t.d,e)};case "line":return {...t,y1:e(t.y1),y2:e(t.y2)};default:return {...t,y:e(t.y)}}}function a1(t,e){if(e.length===0)return t;let n=r=>{let i=r;for(let a of e)i-=Math.min(Math.max(r-a.y,0),a.height);return i},o=(r,i)=>e.some(a=>r>=a.y-1e-6&&i<=a.y+a.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:i}=Ro(r);return !(i&&o(i.y0,i.y1))}).map(r=>i1(r,n)),labels:t.labels.map(r=>{if(r.type==="curved")return {...r,curve:{...r.curve,cy:n(r.curve.cy)}};let i=n(r.box.y);return {...r,box:{...r.box,y:i,height:n(r.box.y+r.box.height)-i}}})}}function wn(t,e,n,o,r={}){let i=new Map(e.labels.map(h=>[h.id,t1(h,n)])),a=a1(e,e.labels.flatMap(h=>h.collapse&&!i.get(h.id)?[h.collapse]:[])),l=t/a.qr.size,s=Wm(a,o),c=Vm(n,a,s.color),u=a.shapes.flatMap(h=>Jm(h,l,c));if(s.plate){let h=Yn(a)*l;u.push({type:"rect",x:a.qr.x*l-h,y:a.qr.y*l-h,width:t+2*h,height:t+2*h,radius:(a.qr.radius??0)*l,fill:s.color});}let m=e1(n.fontScale),d=a.labels.flatMap(h=>{let g=i.get(h.id);if(!g)return [];let y=(h.slot==="fixed"?void 0:r[h.slot])??h.id;return n1(h,g,m,l,c,y)}),p=d[0],b=p&&p.rotate===void 0?p:null,f=a.bleed??"none";return {width:a.artboard.width*l,height:a.artboard.height*l,qrX:a.qr.x*l,qrY:a.qr.y*l,qrSize:t,shapes:u,label:b,extraLabels:b?d.slice(1):d,squareEdges:f!=="none",color:c(f==="none"?"frame":f)}}function Zs(t,e,n){return wn(t,Cn(e.spec),e,n)}var Xs={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 ti={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 Ys={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 Ks={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 Js={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 tl={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 el={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 nl={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 rl={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 hr={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 ol={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 il={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 al={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 sl={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 ll={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 cl={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 ul={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 ml={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 dl={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 lt=(t,e,n,o,r)=>({style:t,name:e,tags:r,labelOn:o,spec:n}),fl=[lt("banner-bottom","Banner",ti,"frame",["bottom","band"]),lt("banner-top","Top banner",Ys,"frame",["top","band"]),lt("banner-top-bottom","Two banners",Ks,"frame",["top","bottom","band"]),lt("border","Border",Js,"background",["square","outline"]),lt("rounded-border","Rounded",sl,"background",["border","outline"]),lt("gradient-border","Gradient",hr,"background",["border","colorful"]),lt("focus","Focus",rl,"background",["corners","brackets"]),lt("speech-bubble","Bubble",ll,"frame",["speech"]),lt("speech-bubble-top","Bubble top",cl,"frame",["speech"]),lt("chat-bubble","Chat",tl,"frame",["message","bubble"]),lt("circle","Circle",el,"frame",["round","ring","curved"]),lt("badge","Ribbon",Xs,"frame",["badge","banner"]),lt("sticker","Sticker",ul,"frame",["label"]),lt("polaroid","Polaroid",al,"frame",["photo","picture"]),lt("phone","Phone",il,"background",["mobile","screen"]),lt("ticket","Ticket",dl,"frame",["event","pass"]),lt("tag","Tag",ml,"frame",["price","label"]),lt("envelope","Envelope",nl,"frame",["mail","letter"]),lt("menu-card","Menu card",ol,"background",["menu","restaurant"])],M1=new Map(fl.map(t=>[t.style,t]));function E1(t){return M1.get(t)}Object.fromEntries(fl.map(t=>[t.style,t.spec]));({from:hr.colors.frame,to:hr.colors.accent});var A1={primary:"text",secondary:"secondaryText"};function hl(t,e,n){let o=E1(e.style)?.spec??ti;return wn(t,Cn(o),e,n,A1)}var ei="system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif";var P1="data-qrdx-frame-label";function Zt(t){return !!(t?.style&&t.style!=="none")}function Ze(t,e,n){return e.style===Da?Zs(t,e,n):hl(t,e,n)}function Rn(t,e){if(!Zt(e))return {width:t,height:t};let{width:n,height:o}=Ze(t,e);return {width:n,height:o}}var z=t=>U(t,2);function pl({x:t,y:e,width:n,height:o,radius:r}){let i=z(Math.min(r,n/2,o/2)),[a,l,s,c]=[z(t),z(e),z(n),z(o)];return i<=0?P`M${a} ${l}h${s}v${c}h${-s}z`:P`M${a+i} ${l}h${z(s-2*i)}a${i} ${i} 0 0 1 ${i} ${i}`+P`v${z(c-2*i)}a${i} ${i} 0 0 1 ${-i} ${i}`+P`h${z(-(s-2*i))}a${i} ${i} 0 0 1 ${-i} ${-i}`+P`v${z(-(c-2*i))}a${i} ${i} 0 0 1 ${i} ${-i}z`}function pr(t){return t.stroke&&t.strokeWidth?{stroke:t.stroke,strokeWidth:z(t.strokeWidth)}:{}}function gl(t,e){return t.type==="rect"&&t.hole?E("path",{d:pl(t)+pl(t.hole),fill:t.fill,fillRule:"evenodd",...pr(t)},e):t.type==="polygon"?E("polygon",{fill:t.fill,points:t.points.map(([n,o])=>`${z(n)},${z(o)}`).join(" "),...pr(t)},e):t.type==="path"?E("path",{d:t.d,fill:t.fill,...t.fillRule==="evenodd"&&{fillRule:"evenodd"},...pr(t)},e):Po("rect",{...pr(t),fill:t.fill,height:z(t.height),key:e,width:z(t.width),x:z(t.x),y:z(t.y),...t.radius>0&&{rx:z(t.radius),ry:z(t.radius)}})}function bl(t){return t.shapes.map((e,n)=>gl(e,n))}function _l(t,e){let{size:n,frame:o,bgColor:r,svgProps:i,markLabels:a}=e,l=Ze(n,o,r),s=v1(l),c=z(l.width),u=z(l.height);return ct("svg",{height:u,viewBox:`0 0 ${c} ${u}`,width:c,xmlns:"http://www.w3.org/2000/svg",...i,children:[E("g",{"data-qrdx-frame":o.style,children:l.shapes.map((m,d)=>gl(m,d))}),Be(t,{x:z(l.qrX),y:z(l.qrY),width:n,height:n}),s.map((m,d)=>E("text",{"data-max-width":z(m.maxWidth),fill:m.color,fontFamily:ei,fontSize:z(m.fontSize),fontWeight:m.fontWeight??700,textAnchor:m.align??"middle",x:z(m.x),y:z(m.y),...m.rotate&&{transform:`rotate(${z(m.rotate)} ${z(m.x)} ${z(m.y)})`},...a&&m.field&&{[P1]:m.field},children:m.text},d))]})}function v1(t){return [...t.label?[t.label]:[],...t.extraLabels??[]]}var I1={2:6,3:12};function yl(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 i=I1[o.length];for(let a=1;a<=i;a++){let l=a/i,s=1-l;if(o.length===2){let[c]=o;e.push([s*s*n[0]+2*s*l*c[0]+l*l*r[0],s*s*n[1]+2*s*l*c[1]+l*l*r[1]]);}else {let[c,u]=o;e.push([s*s*s*n[0]+3*s*s*l*c[0]+3*s*l*l*u[0]+l*l*l*r[0],s*s*s*n[1]+3*s*s*l*c[1]+3*s*l*l*u[1]+l*l*l*r[1]]);}}}n=r;}return e}function $l(t,e){let n=[];for(let o of t)for(let r=0;r<o.length;r++){let[i,a]=o[r],[l,s]=o[(r+1)%o.length];a<=e!=s<=e&&n.push(i+(e-a)/(s-a)*(l-i));}return n.sort((o,r)=>o-r)}function Sl(t,e){let n=0;for(let o of t)if(o<e)n++;else break;return n%2===1}function F1(t,e,n){return Sl($l(t,n),e)}function Cl(t){let e=new Map;return (n,o)=>{let r=e.get(o);return r||(r=$l(t,o),e.set(o,r)),Sl(r,n)}}function L1(t,e,n,o){let r=n[0]-t,i=n[1]-e,a=o[0]-n[0],l=o[1]-n[1],s=u=>Math.max(Math.abs(r+u*a),Math.abs(i+u*l)),c=Math.min(s(0),s(1));for(let[u,m]of [[i-r,a-l],[-(r+i),a+l]])if(m!==0){let d=u/m;d>0&&d<1&&(c=Math.min(c,s(d)));}return c}function T1(t,e,n){if(!F1(t,e,n))return 0;let o=Number.POSITIVE_INFINITY;for(let r of t)for(let i=0;i<r.length;i++)o=Math.min(o,L1(e,n,r[i],r[(i+1)%r.length]));return Number.isFinite(o)?o:0}function k1(t){let e=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,r=Number.NEGATIVE_INFINITY;for(let i of t)for(let[a,l]of i)e=Math.min(e,a),n=Math.min(n,l),o=Math.max(o,a),r=Math.max(r,l);return {x0:e,y0:n,x1:o,y1:r}}function wl(t){let e=t.map(yl),n=k1(e),o=n.x1-n.x0,r=n.y1-n.y0;if(!(o>0&&r>0))return null;let i=(b,f)=>{let h=Math.max(b-n.x0,n.x1-b,f-n.y0,n.y1-f);return h>0?T1(e,b,f)/(2*h):0},a={cx:n.x0+o/2,cy:n.y0+r/2,value:0};a.value=i(a.cx,a.cy);let l=32;for(let b=1;b<l;b++)for(let f=1;f<l;f++){let h=n.x0+o*f/l,g=n.y0+r*b/l,y=i(h,g);y>a.value&&(a={cx:h,cy:g,value:y});}let s=o/l,c=r/l;for(let b=0;b<6;b++){let f=a;for(let h=-2;h<=2;h++)for(let g=-2;g<=2;g++){let y=f.cx+s*g/2,x=f.cy+c*h/2,C=i(y,x);C>a.value&&(a={cx:y,cy:x,value:C});}s/=2,c/=2;}if(a.value<=0)return null;let m=.5/Math.max(a.cx-n.x0,n.x1-a.cx,a.cy-n.y0,n.y1-a.cy),d=([b,f])=>[.5+(b-a.cx)*m,.5+(f-a.cy)*m],p=t.map(b=>({start:d(b.start),segments:b.segments.map(f=>f.map(d))}));return {rings:p,polygons:p.map(yl),half:a.value}}function Rl(t,e){let n=([r,i])=>`${_(r*e)} ${_(i*e)}`,o="";for(let r of t.rings){o+=`M${n(r.start)}`;for(let i of r.segments){let a=i.length===1?"L":i.length===2?"Q":"C";o+=a+i.map(n).join(" ");}o+="Z";}return o}var N1={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]]]},xl;function Ml(){return xl??=wl([N1]),xl}function O1(t){let{width:e,height:n,cells:o}=t;return Number.isInteger(e)&&Number.isInteger(n)&&e>=mo&&n>=mo&&e<=uo&&n<=uo&&typeof o=="string"&&o.length===e*n&&/^[01]*$/.test(o)?(r,i)=>r>=0&&i>=0&&r<e&&i<n&&o[i*e+r]==="1":null}var Bt=([t,e])=>`${t},${e}`;function D1(t,e,n){let o=(s,c)=>t(s-1,c-1),r=new Map,i=(s,c)=>{for(let[u,m]of [[s,c],[c,s]]){let d=r.get(Bt(u))??[];d.push(m),r.set(Bt(u),d);}};for(let s=0;s<=n;s++)for(let c=0;c<=e;c++){let u=o(c,s),m=o(c+1,s),d=o(c+1,s+1),p=o(c,s+1),b=[c,s-.5],f=[c+.5,s],h=[c,s+.5],g=[c-.5,s];switch((u?8:0)+(m?4:0)+(d?2:0)+(p?1:0)){case 1:case 14:i(g,h);break;case 2:case 13:i(h,f);break;case 3:case 12:i(g,f);break;case 4:case 11:i(b,f);break;case 6:case 9:i(b,h);break;case 7:case 8:i(g,b);break;case 5:i(b,f),i(g,h);break;case 10:i(g,b),i(h,f);break;}}let a=[],l=new Set;for(let[s,c]of r){if(l.has(s)||c.length===0)continue;let[u,m]=s.split(",").map(Number),d=[[u,m]];l.add(s);let p=[u,m],b=c[0];for(;!l.has(Bt(b));){l.add(Bt(b)),d.push(b);let f=B1(r.get(Bt(b))??[],p,l);if(!f)break;p=b,b=f;}d.length>=3&&a.push(G1(d));}return a}function B1(t,e,n){let o=Bt(e);return t.find(r=>Bt(r)!==o&&!n.has(Bt(r)))??t.find(r=>Bt(r)!==o)}function G1(t){let e=[];for(let n=0;n<t.length;n++){let o=t[(n-1+t.length)%t.length],r=t[n],i=t[(n+1)%t.length],a=(r[0]-o[0])*(i[1]-r[1])-(r[1]-o[1])*(i[0]-r[0]);Math.abs(a)>1e-9&&e.push(r);}return e.length>=3?e:t}function Q1(t){let e=(i,a)=>[(i[0]+a[0])/2,(i[1]+a[1])/2],n=t.length,o=e(t[n-1],t[0]),r=t.map((i,a)=>[i,e(i,t[(a+1)%n])]);return {start:o,segments:r}}var Mn=new Map;function El(t){let e=`${t.width}x${t.height}:${t.cells}`,n=Mn.get(e);if(n)return n;let o=O1(t),r;if(!o)r={outline:null,problem:"invalid"};else if(t.cells.includes("1")){let i=D1(o,t.width,t.height),a=i.length>0?wl(i.map(Q1)):null;r=a&&2*a.half>=ga?{outline:a,problem:null}:{outline:null,problem:a?"thin":"empty"};}else r={outline:null,problem:"empty"};return Mn.size>16&&Mn.delete(Mn.keys().next().value),Mn.set(e,r),r}var U1=1,Al=.5,Pl=.5,H1=.5;function gr(t){return Math.max(t,pa)}function br(t){return t==="heart"?Ml():typeof t=="object"&&t?.type==="silhouette"?El(t).outline:null}function vl(t){return t==="circle"||br(t)!==null}function vt(t,e,n){if(n==="circle"){let a=gr(e),l=(t/2+a)*Math.SQRT2+U1;return Math.ceil(l-t/2)}let o=br(n);if(!o)return e;let r=gr(e),i=(t+2*(r+H1))/(2*o.half);return Math.ceil((i-t)/2-1e-9)}function Il(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 q1(t,e,n){let o=vt(e,n,"circle"),r=gr(n),i=e+2*o,a=i/2,l=a-Al-.5,s=Il(Number.parseInt(le(t),36)||1),c=o-r,u=o+e+r;return Array.from({length:i},(m,d)=>Array.from({length:i},(p,b)=>{let f=s()<Pl;return b>=c&&b<u&&d>=c&&d<u?false:f&&Math.hypot(b+.5-a,d+.5-a)<=l}))}var z1=Array.from({length:8},(t,e)=>{let n=e*Math.PI/4;return [Math.cos(n),Math.sin(n)]});function Fl(t,e,n,o){if(o==="circle")return q1(t,e,n);let r=br(o);if(!r)return null;let i=vt(e,n,o),a=gr(n),l=e+2*i,s=Cl(r.polygons),c=.5+Al,u=(b,f)=>{let h=b+.5,g=f+.5;return s(h/l,g/l)?z1.every(([y,x])=>s((h+y*c)/l,(g+x*c)/l)):false},m=Il(Number.parseInt(le(t),36)||1),d=i-a,p=i+e+a;return Array.from({length:l},(b,f)=>Array.from({length:l},(h,g)=>{let y=m()<Pl;return g>=d&&g<p&&f>=d&&f<p?false:y&&u(g,f)}))}function Ll(t,e){if(t==="circle")return {circle:e/2};let n=br(t);return n?{path:Rl(n,e)}:null}function W1(t){return t==="top-left"?0:t==="top-right"?1:3}function _r(t,e,n,o="circle",r="top-left"){let i=n*2,a=n,l=i/3;switch(o){case "leaf":case "leaf-reverse":case "drop":case "drop-reverse":{let s=W1(r),c=(s+2)%4,u=1.3*l,m=.7*l,d=b=>{switch(o){case "leaf":return b===s||b===c;case "leaf-reverse":return !(b===s||b===c);case "drop":return b===s;default:return b===c}},p=[0,1,2,3].map(b=>d(b)?m:u);return E("path",{d:T(t-n,e-n,i,i,p)})}case "extra-rounded":return E("path",{d:T(t-n,e-n,i,i,1.15*l)});case "plus":{let s=1.15*l,c=n;return E("path",{d:G([[t-s,e-c],[t+s,e-c],[t+s,e-s],[t+c,e-s],[t+c,e+s],[t+s,e+s],[t+s,e+c],[t-s,e+c],[t-s,e+s],[t-c,e+s],[t-c,e-s],[t-s,e-s]])})}case "cross-rounded":{let s=1.15*l,c=.5*l;return E("path",{d:T(t-n,e-s,i,2*s,c)+T(t-s,e-n,2*s,i,c)})}case "hexagon":return E("path",{d:G(Qe(t,e,1.72*l,6))});case "octagon":return E("path",{d:G(Qe(t,e,n/Math.cos(Math.PI/8),8,22.5))});case "flower":{let s=.6*l,c=.9*l;return E("path",{d:H(t-s,e-s,c)+H(t+s,e-s,c)+H(t+s,e+s,c)+H(t-s,e+s,c)+H(t,e,1.2*l)})}case "heart":return E("path",{d:qe(t,e+.12*l,3.5*l)});case "squircle":return E("path",{d:G(He(t,e,n,n,4,64))});case "dots":{let s=[];for(let c of [-1,0,1])for(let u of [-1,0,1])s.push(H(t+u*l*.82,e+c*l*.82,.58*l));return E("path",{d:s.join("")})}case "cushion":return E("path",{d:bn(t-n,e-n,i,.6*l,.15*l)});case "square":return E("rect",{height:_(i),transform:P`rotate(0,${t},${e})`,width:_(i),x:_(t-a),y:_(e-a)});case "rounded":return E("rect",{height:_(i),rx:_(n*.5),ry:_(n*.5),transform:P`rotate(0,${t},${e})`,width:_(i),x:_(t-a),y:_(e-a)});case "diamond":return E("path",{d:P`M ${t-a*.714286} ${e-a*.714286}v ${i*.714286}h ${i*.714286}v -${i*.714286}z`,transform:P`rotate(45,${t},${e})`});case "message":{let s=i/30,c=d=>(d-40)*s+t,u=d=>(d-40)*s+e,m=P`M ${c(25)} ${u(35.714285714285715)}v ${8.571428571428571*s}a ${10.714285714285714*s} ${10.714285714285714*s}, 0, 0, 0, ${10.714285714285714*s} ${10.714285714285714*s}h ${19.285714285714285*s}v -${19.285714285714285*s}a ${10.714285714285714*s} ${10.714285714285714*s}, 0, 0, 0, -${10.714285714285714*s} -${10.714285714285714*s}h -${8.571428571428571*s}a ${10.714285714285714*s} ${10.714285714285714*s}, 0, 0, 0, -${10.714285714285714*s} ${10.714285714285714*s}`;return E("path",{clipRule:"evenodd",d:m,transform:P`rotate(0,${t},${e})`})}case "message-reverse":{let s=i/30,c=d=>(d-40)*s+t,u=d=>(d-40)*s+e,m=P`M ${c(25)} ${u(35.714285714285715)}v ${8.571428571428571*s}a ${10.714285714285714*s} ${10.714285714285714*s}, 0, 0, 0, ${10.714285714285714*s} ${10.714285714285714*s}h ${19.285714285714285*s}v -${19.285714285714285*s}a ${10.714285714285714*s} ${10.714285714285714*s}, 0, 0, 0, -${10.714285714285714*s} -${10.714285714285714*s}h -${8.571428571428571*s}a ${10.714285714285714*s} ${10.714285714285714*s}, 0, 0, 0, -${10.714285714285714*s} ${10.714285714285714*s}`;return E("path",{clipRule:"evenodd",d:m,transform:P`rotate(-180,${t},${e})`})}case "diya":{let s=i/30,c=d=>(d-40)*s+t,u=d=>(d-40)*s+e,m=P`M ${c(25)} ${u(35.714285714285715)}v ${8.571428571428571*s}a ${10.714285714285714*s} ${10.714285714285714*s}, 0, 0, 0, ${10.714285714285714*s} ${10.714285714285714*s}h ${19.285714285714285*s}v -${19.285714285714285*s}a ${10.714285714285714*s} ${10.714285714285714*s}, 0, 0, 0, -${10.714285714285714*s} -${10.714285714285714*s}h -${8.571428571428571*s}H ${c(25)}z`;return E("path",{clipRule:"evenodd",d:m,transform:P`rotate(0,${t},${e})`})}case "diya-reverse":{let s=i/30,c=d=>(d-40)*s+t,u=d=>(d-40)*s+e,m=P`M ${c(25)} ${u(35.714285714285715)}v ${19.285714285714285*s}h ${19.285714285714285*s}a ${10.714285714285714*s} ${10.714285714285714*s}, 0, 0, 0, ${10.714285714285714*s} -${10.714285714285714*s}v -${19.285714285714285*s}h -${19.285714285714285*s}a ${10.714285714285714*s} ${10.714285714285714*s}, 0, 0, 0, -${10.714285714285714*s} ${10.714285714285714*s}z`;return E("path",{clipRule:"evenodd",d:m,transform:P`rotate(0,${t},${e})`})}case "rounded-triangle":{let s=i/21,c=d=>(d-40)*s+t,u=d=>(d-40)*s+e,m=P`M ${c(33.57142857142857)} ${u(29.285714285714285)}h ${12.857142857142856*s}c ${4.285714285714286*s} 0 ${4.285714285714286*s} ${4.285714285714286*s} ${4.285714285714286*s} ${4.285714285714286*s}v ${12.857142857142856*s}c 0 ${4.285714285714286*s} -${4.285714285714286*s} ${4.285714285714286*s} -${4.285714285714286*s} ${4.285714285714286*s}h -${12.857142857142856*s}c -${4.285714285714286*s} 0 -${4.285714285714286*s} -${4.285714285714286*s} -${4.285714285714286*s} -${4.285714285714286*s}v -${12.857142857142856*s}c 0 -${4.285714285714286*s} ${4.285714285714286*s} -${4.285714285714286*s} ${4.285714285714286*s} -${4.285714285714286*s}z`;return E("path",{d:m,transform:P`rotate(45,${t},${e})`})}case "star":{let s=i/27,c=d=>(d-40)*s+t,u=d=>(d-40)*s+e,m=P`M ${c(38.84615384615385)},${u(26.546153846153846)}c${.6692307692307691*s},-${1.0153846153846153*s},${2.215384615384615*s},-${1.0153846153846153*s},${2.884615384615384*s},0l${4.038461538461538*s},${6.069230769230768*s}c${.23076923076923075*s},${.3461538461538461*s},${.6*s},${.6*s},${1.0153846153846153*s},${.7153846153846153*s}l${7.223076923076922*s},${1.823076923076923*s}c${1.2*s},${.3*s},${1.6846153846153844*s},${1.7076923076923076*s},${.8999999999999999*s},${2.6538461538461533*s}l-${4.73076923076923*s},${5.584615384615384*s}c-${.2769230769230769*s},${.3230769230769231*s},-${.41538461538461535*s},${.7384615384615384*s},-${.3923076923076923*s},${1.1307692307692307*s}l${.4384615384615384*s},${7.199999999999999*s}c${.06923076923076922*s},${1.2*s},-${1.1769230769230767*s},${2.0769230769230766*s},-${2.3307692307692305*s},${1.6384615384615382*s}l-${6.9692307692307685*s},-${2.6076923076923073*s}c-${.3923076923076923*s},-${.16153846153846155*s},-${.8538461538461538*s},-${.16153846153846155*s},-${1.2461538461538462*s},0l-${6.9692307692307685*s},${2.6076923076923073*s}c-${1.1538461538461537*s},${.4384615384615384*s},-${2.4*s},-${.4384615384615384*s},-${2.3307692307692305*s},-${1.6384615384615382*s}l${.4384615384615384*s},-${7.199999999999999*s}c${.023076923076923075*s},-${.41538461538461535*s},-${.11538461538461538*s},-${.8307692307692307*s},-${.3923076923076923*s},-${1.1307692307692307*s}l-${4.73076923076923*s},-${5.584615384615384*s}c-${.7846153846153846*s},-${.923076923076923*s},-${.3230769230769231*s},-${2.3307692307692305*s},${.8999999999999999*s},-${2.6538461538461533*s}l${7.223076923076922*s},-${1.823076923076923*s}c${.41538461538461535*s},-${.11538461538461538*s},${.7846153846153846*s},-${.3461538461538461*s},${1.0153846153846153*s},-${.7153846153846153*s}l${4.038461538461538*s},-${6.069230769230768*s}z`;return E("path",{clipRule:"evenodd",d:m,transform:P`rotate(0,${t},${e})`})}case "banner":{let s=i/28;return E("g",{transform:P`translate(${t-40*s},${e-40*s}) scale(${_(s,6)})`,children:E("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 E("circle",{cx:_(t),cy:_(e),r:_(n),transform:P`rotate(0,${t},${e})`})}}function Xe(t,e,n,o){let r=t==="top-left"?0:t==="top-right"?1:3,i=(r+2)%4;return [0,1,2,3].map(a=>a===r||o&&a===i?n:e)}function Tl(t,e,n,o){let r=n/7,i=Math.max(0,(o+Math.SQRT2-2)*r);return G(Go(t,e,n,o*r))+G(Go(t+r,e+r,5*r,i))}function kl(t,e,n,o,r=false){let i=n/7,a=l=>r?Xe(o,0,l,true):Xe(o,l,0,true);return T(t,e,n,n,a(2.5*i))+T(t+i,e+i,5*i,5*i,a(1.5*i))}function V1(t,e,n,o){let r=n/7;return T(t,e,n,n,Xe(o,2.6*r,0,false))+T(t+r,e+r,5*r,5*r,Xe(o,1.6*r,0,false))}function j1(t,e,n){let o=n/7,r=t+n/2,i=e+n/2;return G(He(r,i,3.5*o,3.5*o,4,96))+G(He(r,i,2.5*o,2.5*o,4,96))}function Z1(t,e,n){let o=n/7,r=.12*o;return bn(t,e,n,1.4*o,r)+bn(t+o,e+o,5*o,.7*o,r)}function X1(t,e,n){let o=n/7;return Uo(t,e,n,.7*o,3.9*o,o)+Uo(t+o,e+o,5*o,.35*o,2.7*o,.8*o)}function Y1(t,e,n,o){let r=n/7;return T(t,e,n,n,Xe(o,.5*r,2.5*r,false))+T(t+r,e+r,5*r,5*r,Xe(o,.25*r,1.5*r,false))}function K1(t,e,n){return T(t+n,e+n,5*n,5*n,1.5*n)}function J1(t,e,n){return G(He(t,e,3.5*n,3.5*n,2.75,96))}function td(t,e,n){let o=n/7;return J1(t+n/2,e+n/2,o)+ar(t+o,e+o,5*o,5*o,.52*o)}function ed(t,e,n){let o=n/7;return Qo(t,e,n,n,1.15*o)+Qo(t+o,e+o,5*o,5*o,.74*o)}function nd(t,e,n){let o=n/7;return ar(t,e,n,n,.8*o)+ar(t+o,e+o,5*o,5*o,.52*o)}function ni(t,e,n,o){let[r,i,a,l]=o,s=(u,m)=>P`${t+u} ${e+m}`,c=(u,m,d)=>u[0]==="round"?P`A${u[1]} ${u[1]} 0 0 1 ${s(m,d)}`:P`L${s(m,d)}`;return P`M${s(r[1],0)}L${s(n-i[1],0)}`+c(i,n,i[1])+P`L${s(n,n-a[1])}`+c(a,n-a[1],n)+P`L${s(l[1],n)}`+c(l,0,n-l[1])+P`L${s(0,r[1])}`+c(r,r[1],0)+"Z"}function rd(t,e){let n=[0,1,2,3].map(r=>e(r)?["round",2.8*t]:["cut",1.6*t]),o=[0,1,2,3].map(r=>e(r)?["round",1.5*t]:["cut",1.01*t]);return [n,o]}function od(t,e,n,o){let r=n/7,i=o==="top-left"?0:o==="top-right"?1:3,a=(i+2)%4,[l,s]=rd(r,c=>c===i||c===a);return ni(t,e,n,l)+ni(t+r,e+r,5*r,s)}function id(t,e,n){let o=n/7;return ni(t,e,n,[["cut",1.6*o],["cut",1.6*o],["round",3*o],["round",3*o]])+K1(t,e,o)}function ad(t,e,n){let o=n/7;return P`M ${t} ${e}v ${n}h ${n}v -${n}z`+P`M ${t+o} ${e+o}h ${5*o}v ${5*o}h -${5*o}z`}function sd(t,e,n){let o=n/7,r=o*.875,i=o*.4375,a=P`M ${t+r} ${e}`+P`h ${n-2*r}`+P`a ${r} ${r} 0 0 1 ${r} ${r}`+P`v ${n-2*r}`+P`a ${r} ${r} 0 0 1 ${-r} ${r}`+P`h ${-(n-2*r)}`+P`a ${r} ${r} 0 0 1 ${-r} ${-r}`+P`v ${-(n-2*r)}`+P`a ${r} ${r} 0 0 1 ${r} ${-r}z`,l=P`M ${t+o+i} ${e+o}`+P`h ${5*o-2*i}`+P`a ${i} ${i} 0 0 1 ${i} ${i}`+P`v ${5*o-2*i}`+P`a ${i} ${i} 0 0 1 ${-i} ${i}`+P`h ${-(5*o-2*i)}`+P`a ${i} ${i} 0 0 1 ${-i} ${-i}`+P`v ${-(5*o-2*i)}`+P`a ${i} ${i} 0 0 1 ${i} ${-i}z`;return a+l}function ld(t,e,n){let o=t+n/2,r=e+n/2,i=U(n/2),a=U(n*(2.5/7));return P`M ${o-i} ${r}`+P`a ${i} ${i} 0 1 0 ${i*2} 0`+P`a ${i} ${i} 0 1 0 ${-i*2} 0z`+P`M ${o-a} ${r}`+P`a ${a} ${a} 0 1 1 ${a*2} 0`+P`a ${a} ${a} 0 1 1 ${-a*2} 0z`}function cd(t,e,n){let o=n/74.7002,r=l=>l*o+t,i=l=>l*o+e;return P`M${r(37.3496)} ${i(0)}C${r(39.2939)} ${i(0)} ${r(40.9948)} ${i(1.03842)} ${r(41.9287)} ${i(2.59082)}C${r(43.2293)} ${i(1.34013)} ${r(45.1347)} ${i(.780267)} ${r(47.0098)} ${i(1.28027)}C${r(48.8871)} ${i(1.78928)} ${r(50.261)} ${i(3.23767)} ${r(50.7578)} ${i(4.98438)}C${r(52.3454)} ${i(4.0996)} ${r(54.3432)} ${i(4.047)} ${r(56.0303)} ${i(5.01953)}C${r(57.7094)} ${i(5.98752)} ${r(58.6586)} ${i(7.73647)} ${r(58.6924)} ${i(9.5459)}C${r(60.4517)} ${i(9.10661)} ${r(62.3883)} ${i(9.57215)} ${r(63.7598)} ${i(10.9502)}C${r(65.1282)} ${i(12.3253)} ${r(65.5963)} ${i(14.2585)} ${r(65.1641)} ${i(16.0127)}C${r(66.974)} ${i(16.044)} ${r(68.7242)} ${i(16.9982)} ${r(69.7002)} ${i(18.6797)}C${r(70.6781)} ${i(20.3647)} ${r(70.6241)} ${i(22.3635)} ${r(69.7402)} ${i(23.9502)}C${r(71.4776)} ${i(24.4496)} ${r(72.9194)} ${i(25.8232)} ${r(73.4199)} ${i(27.7002)}C${r(73.927)} ${i(29.5707)} ${r(73.3661)} ${i(31.4794)} ${r(72.1104)} ${i(32.7822)}C${r(73.6621)} ${i(33.7163)} ${r(74.7002)} ${i(35.4166)} ${r(74.7002)} ${i(37.3604)}C${r(74.7001)} ${i(39.307)} ${r(73.6582)} ${i(41.0084)} ${r(72.1025)} ${i(41.9414)}C${r(73.357)} ${i(43.245)} ${r(73.9207)} ${i(45.1525)} ${r(73.4199)} ${i(47.0303)}C${r(72.9187)} ${i(48.9027)} ${r(71.4782)} ${i(50.2735)} ${r(69.7383)} ${i(50.7734)}C${r(70.6201)} ${i(52.3601)} ${r(70.6716)} ${i(54.3549)} ${r(69.7002)} ${i(56.04)}C${r(68.7237)} ${i(57.7225)} ${r(66.9721)} ${i(58.6729)} ${r(65.1611)} ${i(58.7031)}C${r(65.598)} ${i(60.4623)} ${r(65.131)} ${i(62.3982)} ${r(63.7598)} ${i(63.7695)}C${r(62.3847)} ${i(65.138)} ${r(60.4515)} ${i(65.6061)} ${r(58.6973)} ${i(65.1738)}C${r(58.6635)} ${i(66.9833)} ${r(57.7094)} ${i(68.7322)} ${r(56.0303)} ${i(69.7002)}C${r(54.3461)} ${i(70.6777)} ${r(52.348)} ${i(70.6248)} ${r(50.7617)} ${i(69.7422)}C${r(50.2643)} ${i(71.4831)} ${r(48.8896)} ${i(72.9284)} ${r(47.0098)} ${i(73.4297)}C${r(45.1389)} ${i(73.9368)} ${r(43.2296)} ${i(73.3763)} ${r(41.9268)} ${i(72.1201)}C${r(40.9927)} ${i(73.6717)} ${r(39.2932)} ${i(74.71)} ${r(37.3496)} ${i(74.71)}C${r(35.4051)} ${i(74.7098)} ${r(33.7042)} ${i(73.6711)} ${r(32.7705)} ${i(72.1182)}C${r(31.4697)} ${i(73.3758)} ${r(29.5597)} ${i(73.9418)} ${r(27.6797)} ${i(73.4404)}V${i(73.4502)}C${r(25.8065)} ${i(72.9422)} ${r(24.434)} ${i(71.4985)} ${r(23.9346)} ${i(69.7568)}C${r(22.3504)} ${i(70.6301)} ${r(20.3591)} ${i(70.6781)} ${r(18.6797)} ${i(69.71)}C${r(16.9957)} ${i(68.7391)} ${r(16.045)} ${i(66.9831)} ${r(16.0166)} ${i(65.168)}C${r(14.2547)} ${i(65.6091)} ${r(12.3134)} ${i(65.1435)} ${r(10.9395)} ${i(63.7695)}C${r(9.5687)} ${i(62.3919)} ${r(9.10168)} ${i(60.454)} ${r(9.53809)} ${i(58.6973)}C${r(7.72791)} ${i(58.6641)} ${r(5.97815)} ${i(57.71)} ${r(5.00977)} ${i(56.0303)}C${r(4.03552)} ${i(54.3517)} ${r(4.08377)} ${i(52.3649)} ${r(4.95801)} ${i(50.7812)}C${r(3.21705)} ${i(50.2839)} ${r(1.77087)} ${i(48.9101)} ${r(1.26953)} ${i(47.0303)}V${i(47.0205)}C${r(.762081)} ${i(45.1489)} ${r(1.32758)} ${i(43.2375)} ${r(2.58496)} ${i(41.9346)}C${r(1.03604)} ${i(41)} ${r(108484e-9)} ${i(39.3019)} ${r(0)} ${i(37.3604)}C${r(0)} ${i(35.4159)} ${r(1.03815)} ${i(33.7141)} ${r(2.59082)} ${i(32.7803)}C${r(1.34044)} ${i(31.4797)} ${r(.780389)} ${i(29.575)} ${r(1.28027)} ${i(27.7002)}C${r(1.78258)} ${i(25.8232)} ${r(3.22806)} ${i(24.4482)} ${r(4.97363)} ${i(23.9512)}C${r(4.08938)} ${i(22.3638)} ${r(4.03743)} ${i(20.3664)} ${r(5.00977)} ${i(18.6797)}C${r(5.97815)} ${i(16.9999)} ${r(7.72788)} ${i(16.0496)} ${r(9.53809)} ${i(16.0166)}C${r(9.10139)} ${i(14.2576)} ${r(9.56846)} ${i(12.3214)} ${r(10.9395)} ${i(10.9502)}C${r(12.3171)} ${i(9.57911)} ${r(14.2558)} ${i(9.11137)} ${r(16.0127)} ${i(9.54785)}C${r(16.0426)} ${i(7.73421)} ${r(16.9969)} ${i(5.97989)} ${r(18.6797)} ${i(5.00977)}C${r(20.3596)} ${i(4.03474)} ${r(22.3521)} ${i(4.08468)} ${r(23.9365)} ${i(4.96094)}C${r(24.4378)} ${i(3.22749)} ${r(25.8059)} ${i(1.7898)} ${r(27.6797)} ${i(1.29004)}C${r(29.5511)} ${i(.78264)} ${r(31.4617)} ${i(1.34357)} ${r(32.7646)} ${i(2.60059)}C${r(33.6971)} ${i(1.04268)} ${r(35.4013)} ${i(152405e-9)} ${r(37.3496)} ${i(0)}ZM${r(41.0615)} ${i(9.17578)}C${r(40.1006)} ${i(10.1057)} ${r(38.793)} ${i(10.6797)} ${r(37.3496)} ${i(10.6797)}C${r(35.9064)} ${i(10.6796)} ${r(34.5985)} ${i(10.1066)} ${r(33.6377)} ${i(9.17676)}C${r(32.9511)} ${i(10.3241)} ${r(31.8358)} ${i(11.2176)} ${r(30.4404)} ${i(11.5898)}C${r(29.0527)} ${i(11.9661)} ${r(27.6436)} ${i(11.7542)} ${r(26.4766)} ${i(11.1074)}C${r(26.1072)} ${i(12.3879)} ${r(25.2629)} ${i(13.5333)} ${r(24.0195)} ${i(14.25)}C${r(22.7695)} ${i(14.9754)} ${r(21.347)} ${i(15.1322)} ${r(20.0479)} ${i(14.8047)}C${r(20.0289)} ${i(16.1454)} ${r(19.5108)} ${i(17.4793)} ${r(18.4902)} ${i(18.5)}C${r(17.4696)} ${i(19.5158)} ${r(16.1409)} ${i(20.033)} ${r(14.8066)} ${i(20.0566)}C${r(15.1312)} ${i(21.3534)} ${r(14.9738)} ${i(22.7723)} ${r(14.25)} ${i(24.0195)}C${r(13.5243)} ${i(25.2699)} ${r(12.3701)} ${i(26.1148)} ${r(11.082)} ${i(26.4795)}C${r(11.7347)} ${i(27.6479)} ${r(11.9529)} ${i(29.062)} ${r(11.5801)} ${i(30.46)}C${r(11.2085)} ${i(31.8485)} ${r(10.3194)} ${i(32.9607)} ${r(9.17578)} ${i(33.6475)}C${r(10.106)} ${i(34.6084)} ${r(10.6797)} ${i(35.9167)} ${r(10.6797)} ${i(37.3604)}C${r(10.6796)} ${i(38.805)} ${r(10.1053)} ${i(40.1141)} ${r(9.17383)} ${i(41.0752)}C${r(10.3132)} ${i(41.7614)} ${r(11.1999)} ${i(42.871)} ${r(11.5703)} ${i(44.2598)}C${r(11.946)} ${i(45.6504)} ${r(11.7335)} ${i(47.0592)} ${r(11.0889)} ${i(48.2266)}C${r(12.377)} ${i(48.593)} ${r(13.5297)} ${i(49.441)} ${r(14.25)} ${i(50.6904)}C${r(14.9754)} ${i(51.9405)} ${r(15.1322)} ${i(53.3629)} ${r(14.8047)} ${i(54.6621)}C${r(16.142)} ${i(54.6835)} ${r(17.4721)} ${i(55.2016)} ${r(18.4902)} ${i(56.2197)}C${r(19.5097)} ${i(57.2441)} ${r(20.0278)} ${i(58.5787)} ${r(20.0479)} ${i(59.918)}C${r(21.3469)} ${i(59.5917)} ${r(22.7696)} ${i(59.7493)} ${r(24.0195)} ${i(60.4697)}C${r(25.2676)} ${i(61.1892)} ${r(26.1117)} ${i(62.3406)} ${r(26.4775)} ${i(63.627)}C${r(27.6424)} ${i(62.9822)} ${r(29.0498)} ${i(62.7688)} ${r(30.4404)} ${i(63.1396)}C${r(31.8284)} ${i(63.5112)} ${r(32.9402)} ${i(64.3999)} ${r(33.627)} ${i(65.543)}C${r(34.5887)} ${i(64.6072)} ${r(35.9012)} ${i(64.0304)} ${r(37.3496)} ${i(64.0303)}C${r(38.7912)} ${i(64.0303)} ${r(40.098)} ${i(64.6023)} ${r(41.0586)} ${i(65.5303)}C${r(41.7458)} ${i(64.3887)} ${r(42.8594)} ${i(63.5007)} ${r(44.25)} ${i(63.1299)}C${r(45.643)} ${i(62.7522)} ${r(47.057)} ${i(62.9676)} ${r(48.2266)} ${i(63.6201)}C${r(48.5931)} ${i(62.3323)} ${r(49.4413)} ${i(61.1801)} ${r(50.6904)} ${i(60.46)}C${r(51.9373)} ${i(59.7364)} ${r(53.3558)} ${i(59.5781)} ${r(54.6523)} ${i(59.9023)}C${r(54.6744)} ${i(58.5659)} ${r(55.1925)} ${i(57.2372)} ${r(56.21)} ${i(56.2197)}C${r(57.2339)} ${i(55.2007)} ${r(58.5676)} ${i(54.6816)} ${r(59.9062)} ${i(54.6611)}C${r(59.5835)} ${i(53.3649)} ${r(59.7414)} ${i(51.9468)} ${r(60.46)} ${i(50.7002)}C${r(61.1797)} ${i(49.4517)} ${r(62.3312)} ${i(48.6068)} ${r(63.6182)} ${i(48.2412)}C${r(62.9651)} ${i(47.0726)} ${r(62.7473)} ${i(45.658)} ${r(63.1201)} ${i(44.2598)}C${r(63.4916)} ${i(42.8718)} ${r(64.3794)} ${i(41.7591)} ${r(65.5225)} ${i(41.0723)}C${r(64.5929)} ${i(40.1115)} ${r(64.0206)} ${i(38.8033)} ${r(64.0205)} ${i(37.3604)}C${r(64.0205)} ${i(35.9186)} ${r(64.5915)} ${i(34.611)} ${r(65.5195)} ${i(33.6504)}C${r(64.3785)} ${i(32.9631)} ${r(63.4908)} ${i(31.8501)} ${r(63.1201)} ${i(30.46)}C${r(62.7421)} ${i(29.0656)} ${r(62.9572)} ${i(27.6498)} ${r(63.6113)} ${i(26.4795)}C${r(62.3272)} ${i(26.1115)} ${r(61.1784)} ${i(25.2657)} ${r(60.46)} ${i(24.0195)}C${r(59.7364)} ${i(22.7727)} ${r(59.5781)} ${i(21.3541)} ${r(59.9023)} ${i(20.0576)}C${r(58.5626)} ${i(20.038)} ${r(57.23)} ${i(19.52)} ${r(56.21)} ${i(18.5)}C${r(55.1931)} ${i(17.4783)} ${r(54.675)} ${i(16.1482)} ${r(54.6523)} ${i(14.8125)}C${r(53.3557)} ${i(15.1357)} ${r(51.9374)} ${i(14.9785)} ${r(50.6904)} ${i(14.2598)}C${r(49.4399)} ${i(13.5339)} ${r(48.5931)} ${i(12.3801)} ${r(48.2285)} ${i(11.0918)}C${r(47.0603)} ${i(11.7439)} ${r(45.6474)} ${i(11.9624)} ${r(44.25)} ${i(11.5898)}V${i(11.5801)}C${r(42.8613)} ${i(11.2085)} ${r(41.7483)} ${i(10.3196)} ${r(41.0615)} ${i(9.17578)}Z`}function ri(t){let e=t/70;return {scale:e,transform:(o,r)=>(o-5)*e+r}}function ud(t,e,n){let{scale:o,transform:r}=ri(n);return P`M ${r(5,t)} ${r(30,e)}v ${20*o}a ${25*o} ${25*o}, 0, 0, 0, ${25*o} ${25*o}h ${45*o}v -${45*o}a ${25*o} ${25*o}, 0, 0, 0, -${25*o} -${25*o}h -${20*o}H ${r(5,t)}zM ${r(30,t)} ${r(15,e)}h ${20*o}a ${15*o} ${15*o}, 0, 0, 1, ${15*o} ${15*o}v ${35*o}h -${35*o}a ${15*o} ${15*o}, 0, 0, 1, -${15*o} -${15*o}v -${35*o}z`}function md(t,e,n){let o=n/7,r=o*1.5,i=o*.75,a=P`M ${t+r} ${e}`+P`h ${n-2*r}`+P`a ${r} ${r} 0 0 1 ${r} ${r}`+P`v ${n-2*r}`+P`a ${r} ${r} 0 0 1 ${-r} ${r}`+P`h ${-(n-2*r)}`+P`a ${r} ${r} 0 0 1 ${-r} ${-r}`+P`v ${-(n-2*r)}`+P`a ${r} ${r} 0 0 1 ${r} ${-r}z`,l=P`M ${t+o+i} ${e+o}`+P`h ${5*o-2*i}`+P`a ${i} ${i} 0 0 1 ${i} ${i}`+P`v ${5*o-2*i}`+P`a ${i} ${i} 0 0 1 ${-i} ${i}`+P`h ${-(5*o-2*i)}`+P`a ${i} ${i} 0 0 1 ${-i} ${-i}`+P`v ${-(5*o-2*i)}`+P`a ${i} ${i} 0 0 1 ${i} ${-i}z`;return a+l}function dd(t,e,n){let{scale:o,transform:r}=ri(n);return P`M ${r(5,t)} ${r(40,e)}a ${35*o} ${35*o}, 0, 0, 0, ${35*o} ${35*o}h ${30*o}a ${5*o} ${5*o}, 0, 0, 0, ${5*o} -${5*o}v -${30*o}a ${35*o} ${35*o}, 0, 0, 0, -${35*o} -${35*o}a ${35*o} ${35*o}, 0, 0, 0, -${35*o} ${35*o}zM ${r(40,t)} ${r(15,e)}a ${25*o} ${25*o}, 0, 0, 1, ${25*o} ${25*o}v ${25*o}h -${25*o}a ${25*o} ${25*o}, 0, 0, 1, -${25*o} -${25*o}a ${25*o} ${25*o}, 0, 0, 1, ${25*o} -${25*o}z`}function fd(t,e,n){let{scale:o,transform:r}=ri(n);return P`M ${r(5,t)} ${r(30,e)}v ${20*o}a ${25*o} ${25*o}, 0, 0, 0, ${25*o} ${25*o}h ${45*o}v -${45*o}a ${25*o} ${25*o}, 0, 0, 0, -${25*o} -${25*o}h -${20*o}a ${25*o} ${25*o}, 0, 0, 0, -${25*o} ${25*o}M ${r(30,t)} ${r(15,e)}h ${20*o}a ${15*o} ${15*o}, 0, 0, 1, ${15*o} ${15*o}v ${35*o}h -${35*o}a ${15*o} ${15*o}, 0, 0, 1, -${15*o} -${15*o}v -${20*o}a ${15*o} ${15*o}, 0, 0, 1, ${15*o} -${15*o}z`}function hd(t,e,n){let o=n/70,r=t+n/2-40*o,i=e+n/2-40*o,a=(s,c)=>s*o+c;return P`M${a(35.19239999999999,r)} ${a(5.837547376725838,i)}C${a(37.69667692307692,r)} ${a(3.8737070690335305,i)}, ${a(41.218430769230764,r)} ${a(3.8737092228796843,i)}, ${a(43.722707692307694,r)} ${a(5.837547376725838,i)}L${a(46.62781538461539,r)} ${a(8.115648915187375,i)}L${a(50.23356923076923,r)} ${a(7.32361506903353,i)}C${a(53.342,r)} ${a(6.640824299802762,i)}, ${a(56.51483076923077,r)} ${a(8.168784299802759,i)}, ${a(57.91892307692308,r)} ${a(11.024719684418145,i)}L${a(59.54787692307692,r)} ${a(14.337679684418145,i)}L${a(63.14027692307692,r)} ${a(15.188578145956608,i)}C${a(66.23707692307693,r)} ${a(15.922091992110452,i)}, ${a(68.43270769230769,r)} ${a(18.675396607495067,i)}, ${a(68.45876923076924,r)} ${a(21.857768915187375,i)}L${a(68.48892307692307,r)} ${a(25.54931045364891,i)}L${a(71.35633846153846,r)} ${a(27.874602761341222,i)}C${a(73.82830769230769,r)} ${a(29.879187376725838,i)}, ${a(74.61187692307692,r)} ${a(33.312418145956606,i)}, ${a(73.25452307692306,r)} ${a(36.19103353057199,i)}L${a(71.68006153846153,r)} ${a(39.530141222879685,i)}L${a(73.25452307692306,r)} ${a(42.86924891518738,i)}C${a(74.61187692307692,r)} ${a(45.747864299802764,i)}, ${a(73.82830769230769,r)} ${a(49.18109506903353,i)}, ${a(71.35633846153846,r)} ${a(51.18567968441815,i)}L${a(68.48892307692307,r)} ${a(53.510971992110456,i)}L${a(68.45876923076924,r)} ${a(57.202664299802755,i)}C${a(68.43270769230769,r)} ${a(60.38497199211046,i)}, ${a(66.23707692307693,r)} ${a(63.13823353057199,i)}, ${a(63.14027692307692,r)} ${a(63.871833530572,i)}L${a(59.54787692307692,r)} ${a(64.72260276134121,i)}L${a(57.91892307692308,r)} ${a(68.03564891518737,i)}C${a(56.51483076923077,r)} ${a(70.89164891518737,i)}, ${a(53.342,r)} ${a(72.41958737672583,i)}, ${a(50.23356923076923,r)} ${a(71.7368181459566,i)}L${a(46.62781538461539,r)} ${a(70.94463353057199,i)}L${a(43.722707692307694,r)} ${a(73.22275660749506,i)}C${a(41.218430769230764,r)} ${a(75.18663353057198,i)}, ${a(37.69667692307692,r)} ${a(75.18663353057198,i)}, ${a(35.19239999999999,r)} ${a(73.22275660749506,i)}L${a(32.28729230769231,r)} ${a(70.94463353057199,i)}L${a(28.68153846153846,r)} ${a(71.7368181459566,i)}C${a(25.573215384615384,r)} ${a(72.41958737672583,i)}, ${a(22.400384615384613,r)} ${a(70.89164891518737,i)}, ${a(20.996141538461536,r)} ${a(68.03564891518737,i)}L${a(19.36720923076923,r)} ${a(64.72260276134121,i)}L${a(15.774852307692306,r)} ${a(63.871833530572,i)}C${a(12.67803076923077,r)} ${a(63.13823353057199,i)}, ${a(10.48237846153846,r)} ${a(60.38497199211046,i)}, ${a(10.45636,r)} ${a(57.202664299802755,i)}L${a(10.426163076923077,r)} ${a(53.510971992110456,i)}L${a(7.558747692307692,r)} ${a(51.18567968441815,i)}C${a(5.086880338461539,r)} ${a(49.18109506903353,i)}, ${a(4.303258769230769,r)} ${a(45.747864299802764,i)}, ${a(5.660599692307692,r)} ${a(42.86924891518738,i)}L${a(7.235153846153846,r)} ${a(39.530141222879685,i)}L${a(5.660599692307692,r)} ${a(36.19103353057199,i)}C${a(4.3032566153846155,r)} ${a(33.312418145956606,i)}, ${a(5.086885938461538,r)} ${a(29.879187376725838,i)}, ${a(7.558747692307692,r)} ${a(27.874602761341222,i)}L${a(10.426163076923077,r)} ${a(25.54931045364891,i)}L${a(10.45636,r)} ${a(21.857768915187375,i)}C${a(10.48237846153846,r)} ${a(18.67537506903353,i)}, ${a(12.678052307692308,r)} ${a(15.922091992110452,i)}, ${a(15.774852307692306,r)} ${a(15.188578145956608,i)}L${a(19.36720923076923,r)} ${a(14.337679684418145,i)}L${a(20.996141538461536,r)} ${a(11.024719684418145,i)}C${a(22.400384615384613,r)} ${a(8.168784299802759,i)}, ${a(25.573215384615384,r)} ${a(6.640824299802762,i)}, ${a(28.68153846153846,r)} ${a(7.32361506903353,i)}L${a(32.28729230769231,r)} ${a(8.115648915187375,i)}L${a(35.19239999999999,r)} ${a(5.837547376725838,i)}M${a(39.45766153846154,r)} ${a(13.665055069033532,i)}L${a(37.01498461538461,r)} ${a(15.58053506903353,i)}C${a(35.39098461538461,r)} ${a(16.854061222879682,i)}, ${a(33.282799999999995,r)} ${a(17.335251992110454,i)}, ${a(31.26701538461538,r)} ${a(16.892464299802757,i)}L${a(28.235046153846152,r)} ${a(16.22649506903353,i)}L${a(26.865415384615382,r)} ${a(19.012107376725837,i)}C${a(25.954812307692308,r)} ${a(20.864178145956608,i)}, ${a(24.264193846153844,r)} ${a(22.212399684418145,i)}, ${a(22.255926153846154,r)} ${a(22.688076607495066,i)}L${a(19.235393846153844,r)} ${a(23.40354122287968,i)}L${a(19.21,r)} ${a(26.507556607495065,i)}C${a(19.19313538461538,r)} ${a(28.57137199211045,i)}, ${a(18.25492,r)} ${a(30.519525838264297,i)}, ${a(16.651919999999997,r)} ${a(31.81937199211045,i)}L${a(14.240926153846154,r)} ${a(33.774633530572,i)}L${a(15.564830769230769,r)} ${a(36.58238737672584,i)}C${a(16.445064615384617,r)} ${a(38.44891045364892,i)}, ${a(16.445064615384617,r)} ${a(40.611371992110456,i)}, ${a(15.564830769230769,r)} ${a(42.47811045364892,i)}L${a(14.240926153846154,r)} ${a(45.28564891518738,i)}L${a(16.651919999999997,r)} ${a(47.240910453648915,i)}L${a(13.883236923076923,r)} ${a(50.654971992110454,i)}L${a(16.651919999999997,r)} ${a(47.240910453648915,i)}C${a(18.25492,r)} ${a(48.54075660749507,i)}, ${a(19.19313538461538,r)} ${a(50.4891258382643,i)}, ${a(19.21,r)} ${a(52.5527258382643,i)}L${a(19.235393846153844,r)} ${a(55.65684891518738,i)}L${a(22.255926153846154,r)} ${a(56.37235660749507,i)}C${a(24.264193846153844,r)} ${a(56.847925838264295,i)}, ${a(25.954812307692308,r)} ${a(58.196233530571995,i)}, ${a(26.865415384615382,r)} ${a(60.0483258382643,i)}L${a(28.235046153846152,r)} ${a(62.833895069033524,i)}L${a(31.26701538461538,r)} ${a(62.1679258382643,i)}C${a(33.282799999999995,r)} ${a(61.72509506903353,i)}, ${a(35.39098461538461,r)} ${a(62.20626429980276,i)}, ${a(37.01498461538461,r)} ${a(63.47983353057199,i)}L${a(39.45766153846154,r)} ${a(65.39524891518737,i)}L${a(41.90012307692308,r)} ${a(63.47983353057199,i)}C${a(43.524123076923075,r)} ${a(62.20626429980276,i)}, ${a(45.632307692307684,r)} ${a(61.72509506903353,i)}, ${a(47.6480923076923,r)} ${a(62.1679258382643,i)}L${a(50.68006153846154,r)} ${a(62.833895069033524,i)}L${a(52.049692307692304,r)} ${a(60.0483258382643,i)}C${a(52.960338461538456,r)} ${a(58.196233530571995,i)}, ${a(54.6508923076923,r)} ${a(56.847925838264295,i)}, ${a(56.65913846153846,r)} ${a(56.37235660749507,i)}L${a(59.67969230769231,r)} ${a(55.65684891518738,i)}L${a(59.70510769230769,r)} ${a(52.5527258382643,i)}C${a(59.72190769230769,r)} ${a(50.4891258382643,i)}, ${a(60.66012307692307,r)} ${a(48.54075660749507,i)}, ${a(62.263230769230766,r)} ${a(47.240910453648915,i)}L${a(64.67424615384616,r)} ${a(45.28564891518738,i)}L${a(63.35027692307692,r)} ${a(42.47811045364892,i)}C${a(62.47,r)} ${a(40.611371992110456,i)}, ${a(62.47,r)} ${a(38.44891045364892,i)}, ${a(63.35027692307692,r)} ${a(36.58238737672584,i)}L${a(64.67424615384616,r)} ${a(33.774633530572,i)}L${a(62.263230769230766,r)} ${a(31.81958737672584,i)}C${a(60.66012307692307,r)} ${a(30.519525838264297,i)}, ${a(59.72190769230769,r)} ${a(28.57137199211045,i)}, ${a(59.70510769230769,r)} ${a(26.507556607495065,i)}L${a(59.67969230769231,r)} ${a(23.40354122287968,i)}L${a(56.65913846153846,r)} ${a(22.688076607495066,i)}C${a(54.6508923076923,r)} ${a(22.212399684418145,i)}, ${a(52.960338461538456,r)} ${a(20.864178145956608,i)}, ${a(52.049692307692304,r)} ${a(19.012128915187375,i)}L${a(50.68006153846154,r)} ${a(16.22649506903353,i)}L${a(47.6480923076923,r)} ${a(16.892464299802757,i)}C${a(45.632307692307684,r)} ${a(17.335251992110454,i)}, ${a(43.524338461538456,r)} ${a(16.85408276134122,i)}, ${a(41.90012307692308,r)} ${a(15.58053506903353,i)}L${a(39.45766153846154,r)} ${a(13.665055069033532,i)}Z`}function yr(t,e,n,o,r="top-left"){switch(o){case "leaf":return kl(t,e,n,r);case "leaf-reverse":return kl(t,e,n,r,true);case "drop":return V1(t,e,n,r);case "octagon":return Tl(t,e,n,1.6);case "bevel":return Tl(t,e,n,1.1);case "squircle":return j1(t,e,n);case "cushion":return Z1(t,e,n);case "shield":return X1(t,e,n);case "petal":return Y1(t,e,n,r);case "porthole":return td(t,e,n);case "notch":return ed(t,e,n);case "plus":return nd(t,e,n);case "bud":return od(t,e,n,r);case "bowl":return id(t,e,n);case "gear":return cd(t,e,n);case "rounded":return sd(t,e,n);case "circle":return ld(t,e,n);case "diya":return ud(t,e,n);case "extra-rounded":return md(t,e,n);case "message":return dd(t,e,n);case "pointy":return fd(t,e,n);case "curly":return hd(t,e,n);default:return ad(t,e,n)}}var oi=.22,ii=.14;function Nl(t,e,n={}){if(t==="circle")return E("circle",{cx:_(e.x+e.w/2),cy:_(e.y+e.h/2),r:_(Math.min(e.w,e.h)/2),...n});let o=t==="rounded"?Math.min(e.w,e.h)*oi:0;return E("rect",{height:_(e.h),width:_(e.w),x:_(e.x),y:_(e.y),...o>0&&{rx:_(o),ry:_(o)},...n})}function pd(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 Ol(t,e){let n=t.shape??"square",o=t.plate,r=o?pd(e,ii):e,i=l=>E("image",{height:_(r.h),href:t.src,preserveAspectRatio:"none",width:_(r.w),x:_(r.x),y:_(r.y),...l&&{clipPath:`url(#${l})`}});if(n==="square"&&!o)return i();let a=n==="square"?void 0:`qrdx-logo-${le(`${n}|${_(r.x)}|${_(r.y)}|${_(r.w)}|${_(r.h)}`)}`;return ct("g",{children:[o&&Nl(n,e,{fill:o}),a&&E("clipPath",{id:a,children:Nl(n,r)}),i(a)]})}var gd=.6,bd=["L","M","Q","H"];function _d(t){let e=dt.QrCode.encodeText(t.value,wt[t.level]),n=bd[e.errorCorrectionLevel.ordinal]??t.level;return {code:t,cells:e.getModules(),layoutMargin:vt(e.size,t.margin,t.shape),map:Kn(e.version,n),level:n,version:e.version}}function yd(t,e){let{cells:n,map:o}=t,r=n.length,i=xr(n,t.code.size,t.layoutMargin,e);if(!i)return null;let a=i.excavation??{x:Math.floor(i.x),y:Math.floor(i.y),w:Math.ceil(i.x+i.w)-Math.floor(i.x),h:Math.ceil(i.y+i.h)-Math.floor(i.y)},l=[];for(let c=Math.max(0,a.y);c<Math.min(r,a.y+a.h);c++)for(let u=Math.max(0,a.x);u<Math.min(r,a.x+a.w);u++)l.push(c*r+u);let s=Jn(o,l);return {worst:Math.max(0,...s),correctable:o.correctable,budget:Math.floor(o.correctable*gd),level:t.level,version:t.version}}var xd=t=>!t||t.worst<=t.budget;function $d(t,e,n,o){let r=e.map(l=>_d({...t,level:l})),i=l=>{let s=o(l);return r.every(c=>xd(yd(c,s)))};if(i(n))return n;let a=t.size*.005;for(let l=n-a;l>0;l-=a)if(i(l))return l;return 0}function Dl(t,e){if(!e)return;let n=Math.floor(t.size*Gn),o=e.width||n,r=e.height||n,i=d=>{if(d===o)return e;let p=r*d/o;return {...e,width:d,height:p,...e.x!=null&&{x:e.x+(o-d)/2},...e.y!=null&&{y:e.y+(r-p)/2}}},a=t.level??an,l={value:t.value,size:t.size,margin:t.margin,shape:t.shape},s=d=>fe({...t,level:a,imageSettings:d}),c=d=>{let p=$d(l,[d],o,i);return p>0?i(p):void 0},u=s(e);if(u===a)return c(a);let m=c(u);return m&&s(m)===u?m:c(a)}var ai=t=>{let e=t/255;return e<=.04045?e/12.92:((e+.055)/1.055)**2.4},Sd=t=>255*(t<=.0031308?12.92*t:1.055*t**.4166666666666667-.055);function Ql({r:t,g:e,b:n}){let o=ai(t),r=ai(e),i=ai(n),a=Math.cbrt(.4122214708*o+.5363325363*r+.0514459929*i),l=Math.cbrt(.2119034982*o+.6806995451*r+.1073969566*i),s=Math.cbrt(.0883024619*o+.2817188376*r+.6299787005*i),c=1.9779984951*a-2.428592205*l+.4505937099*s,u=.0259040371*a+.7827717662*l-.808675766*s;return {l:.2104542553*a+.793617785*l-.0040720468*s,c:Math.hypot(c,u),h:Math.atan2(u,c)}}function si({l:t,c:e,h:n}){let o=e*Math.cos(n),r=e*Math.sin(n),i=(t+.3963377774*o+.2158037573*r)**3,a=(t-.1055613458*o-.0638541728*r)**3,l=(t-.0894841775*o-1.291485548*r)**3;return [4.0767416621*i-3.3077115913*a+.2309699292*l,-1.2684380046*i+2.6097574011*a-.3413193965*l,-0.0041960863*i-.7034186147*a+1.707614701*l]}var Bl=1e-7,Gl=t=>t.every(e=>e>=-Bl&&e<=1+Bl),Cd=20;function $r(t){let e=si(t);if(!Gl(e)){let i=0,a=t.c;for(let l=0;l<Cd;l++){let s=(i+a)/2;Gl(si({...t,c:s}))?i=s:a=s;}e=si({...t,c:i});}let[n=0,o=0,r=0]=e.map(i=>Math.round(Sd(Math.min(1,Math.max(0,i)))));return {r:n,g:o,b:r,a:1}}var wd="gear",Rd="circle";function pe(t,e){let n=t.eyeShapes?.[e];return {outer:ee(Qn,n?.outer??t.cornerEyePattern??wd),inner:ee(Un,n?.inner??t.cornerEyeDotPattern??Rd)}}function Cr(t,e,n,o){if(!(t&&Number.isFinite(t))||t<=0||vl(o)||n<=0)return 0;let r=Math.min(ba,_a*n/(e+2*n));return Math.min(t,r)}var mi=(t,e,n,o)=>Math.min(o,Math.max(n,typeof t=="number"&&Number.isFinite(t)?t:e)),Md=/^hsla?\(([^)]*)\)$/,Ed=/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:deg)?$/,Ad=/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)%?$/;function li(t,e){let n=t?.trim()??"";if(!Ad.test(n))return Number.NaN;let o=Number.parseFloat(n),r=n.endsWith("%")||e?o/100:o;return Math.min(1,Math.max(0,r))}function Pd(t){let e=Md.exec(t);if(!e)return null;let[n="",o]=(e[1]??"").split("/"),r=n.split(/[\s,]+/).filter(Boolean);if(r.length!==(o===void 0&&r.length===4?4:3))return null;let[i="",a,l,s]=r,c=li(a,true),u=li(l,true),m=li(o??s??"1",false),d=Number.parseFloat(i);if(!(Ed.test(i)&&[c,u,m].every(Number.isFinite)))return null;let p=c*Math.min(u,1-u),b=f=>{let h=(f+d/30)%12,g=h<0?h+12:h;return 255*(u-p*Math.max(-1,Math.min(g-3,9-g,1)))};return {r:b(0),g:b(8),b:b(4),a:m}}function fi(t){let e=t?.trim().toLowerCase()??"";return e==="none"?{r:0,g:0,b:0,a:0}:tt(e)??Pd(e)}function ci(t){return fi(t)?.a??1}function vd(t){let e=Lt(t,rt);return e.type==="solid"?ci(e.color)<1:e.type==="image"?ci(e.underlay??"transparent")<1:e.stops.some(n=>ci(n.color)<1)}var Ye=({r:t,g:e,b:n})=>[.2126*t+.7152*e+.0722*n,.299*t+.587*e+.114*n],di=Ye(tt(cn)),he=1e-9,Sr=(t,e,n)=>t.every((o,r)=>o>=e[r]-he&&o<=n[r]+he),Ul=({r:t,g:e,b:n})=>`#${[t,e,n].map(o=>Math.round(o).toString(16).padStart(2,"0")).join("")}`;function Hl(t){let e=fi(t.color||fo);return e&&e.a>0?Ul(e):fo}var Id=24,Fd=12;function Ld(t,e,n){if(Sr(Ye(t),e,n))return t;if(t.r===t.g&&t.g===t.b){let c=Math.min(Math.floor(Math.min(...n)+he),Math.max(t.r,Math.ceil(Math.max(...e)-he)));return c>=Math.max(...e)-he?{r:c,g:c,b:c,a:1}:null}let o=Ql(t),r=c=>{let u=$r({l:o.l,c,h:o.h}),m=Ye(u);if(Sr(m,e,n))return u;let d=m.some((g,y)=>g<e[y]),p=g=>Ye(g).every((y,x)=>d?y>=e[x]-he:y<=n[x]+he),b=o.l,f=d?1:0;for(let g=0;g<Id;g++){let y=(b+f)/2;p($r({l:y,c,h:o.h}))?f=y:b=y;}let h=$r({l:f,c,h:o.h});return Sr(Ye(h),e,n)?h:null},i=r(o.c);if(i)return i;let a=r(0);if(!a)return null;let l=0,s=o.c;for(let c=0;c<Fd;c++){let u=(l+s)/2,m=r(u);m?(l=u,a=m):s=u;}return a}var ui="or turn the halo off";function Td(t){let e=Lt(t,rt);if(e.type==="image")return {reason:"picture",message:"A halo isn't drawn on a picture background: on the picture's darker parts the rim makes the code unreadable",fix:`Use a background color, ${ui}`};if(vd(t))return {reason:"see-through",message:"A halo needs an opaque background: on a grey surface under a see-through code the rim makes it unreadable",fix:`Give the code an opaque background, ${ui}`};let n=(e.type==="solid"?[e.color]:e.stops.map(r=>r.color)).map(fi),o=[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY];for(let r of n){let i=r?Ye(r):[0,0];o[0]=Math.min(o[0],i[0]),o[1]=Math.min(o[1],i[1]);}return Sr(di,di,o)?o:{reason:"dark-background",message:`A halo needs a light background, at least as light as ${cn}: on a darker one the rim makes the code unreadable`,fix:`Lighten the background to ${cn} or lighter, ${ui}`}}function kd(t,e){let n=Td(e);if(!Array.isArray(n))return n;let o=Hl(t),r=Ld(tt(o),di,n);return {drawn:r?Ul(r):cn,picked:o}}function ql(t,e){if(!t)return null;let n=e?kd(t,e.bgColor):null;if(n&&!("drawn"in n))return null;let o=mi(t.width,$a,ya,xa);return {color:n?n.drawn:Hl(t),width:o}}function zl(t){if(!t)return null;let e=r=>mi(r,Sa,-ho,ho),n=e(t.dx),o=e(t.dy);return n===0&&o===0?null:{color:t.color||Ma,opacity:mi(t.opacity,Ra,Ca,wa),dx:n,dy:o}}var Wl="data-qrdx-part",Nd="data-qrdx-eye";function Vl(t,e,n){if(t)return n?{[Wl]:e,[Nd]:n}:{[Wl]:e}}var En=300;function Tt(t){return {id:t.id,name:t.name,description:t.description,spec:t.spec,wrapper:(e,n)=>{let o=Cn(t.spec),r=n?.fgColor,i=(typeof r=="string"?r:ut(r,""))||"black",a=wn(o.qr.size,o,{color:i}),{x:l,y:s,scale:c}=t.at;return E("svg",{height:En,id:"svgQrWrapper",style:{width:"100%",height:"100%"},viewBox:`0 0 ${En} ${En}`,width:En,xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",children:ct("g",{"data-qrdx-template":t.id,transform:`translate(${_(l)} ${_(s)})${c===1?"":` scale(${c})`}`,children:[bl(a),E("g",{fill:"none",transform:`translate(${_(a.qrX)} ${_(a.qrY)}) scale(${a.qrSize/En})`,children:e})]})})}}}var jl={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 Zl=Tt({id:"Arrow",name:"Arrow",description:"QR code with arrow",spec:jl,at:{x:47,y:95,scale:1}});var Xl={id:"default",name:"Default",description:"Simple QR code without decorative elements",wrapper:t=>E("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:E("g",{fill:"none",transform:"translate(9, 9) scale(0.95)",children:t})})};var Pn=593,Xt=296.5,An=146.5,nc=294.5,rc=231.228,oc="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",Dd="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",Bd="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",Yl="3cf27f17c00j3ch21n1ek00l1el3cj1vv1kd00n3cl3cn1q31q500p3cp1vx00r1kb3cs3aw1ej21p00t3ax3ay17b27h00w3b02g20yq01w2d611m01x3b52aa14i01y24i1bq0203bd3be1q21q60253bf39e39f39h14e2ae02d39j11i2da02e39l0ym02f39n2lt0sz03a39p2ix0vv03b39r2d511n39t03d27d17f03f39x39y21l1en03h3a03a11vt1kf03j37w37x1q11q703l37z1k903n1vz3821eh03p21r38714d03t11h03u2db38a0vp2j303w2lz38g03x0st2rk0n804o38l2oo0q404p38n2iw0vw04r36f36h2a814k04u36k36l1vs1kg04z36o36p1n41t405236q36x36y0ss2m005d3720n02rs05f3742uf0kd0633763772on0q506537834y2fz0yt06834z2d311p06935235424f1bt06c35621j1ep06d3581yn1hl06e35a1sv1nd06g35b1pz1q906h35d35e35g1ef21t06l35h1bj24p06m35k35l11f2dd06q35n0vn2j506s35p35q0pv2ox06u35s0mz2rt06v35t33h0k32up06w2x90hi08y2ud0ke08z33r2lp0t20922fx0yu0942a514m09624d1bu0983441yl1hm09a1vp1ki09b1px1qa09d34e1n11t609e1h91yy09g1ed21u09h1a227m0831492ai09l0yh2ga09n0sp2m209p0pt2oy09q0k12uq09s2xo0h52z209t31k0en0bt2780c319z0az0e831z0cq",Kl=52,Gd=240;function Jl(t){let e=0;return t.split(" ").map(n=>(e+=Number.parseInt(n,36),e/1e4))}var hi;function Qd(){if(!hi){let t=Jl(Dd),e=Jl(Bd),n=[];for(let o=0;o<Yl.length;o+=3){let r=Number.parseInt(Yl.slice(o,o+3),36);n.push({cx:t[Math.floor(r/Kl)],cy:e[r%Kl]});}hi=n;}return hi}function Ud(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 ic(t){let e=Qd(),n=Ud(t),o=()=>(n=(n*9301+49297)%233280,n/233280),r=e.map((i,a)=>a);for(let i=r.length-1;i>0;i--){let a=Math.floor(o()*(i+1));[r[i],r[a]]=[r[a],r[i]];}return r.slice(0,Gd).sort((i,a)=>i-a).map(i=>e[i])}var tc=300,Hd=49,qd=6;function ac(t,e){if(tc/e<=Hd+.5)return t;let n=An,o=An+tc,r=qd*e+e/2;return t.filter(({cx:i,cy:a})=>Math.max(n-i,i-o,n-a,a-o)>=r)}var sc="Scan the QR code * Scan the QR code * Scan the QR code * Scan the QR code *",vn=32,lc=3.5,zd=vn*Hn,cc=246.5,Gt=2*Math.PI*cc,bi=.36,ec=cc+bi*vn,pi=400;function Ke(t,e){return t===" "||/[il1|!']/.test(t)?e*.3:/[mwMW@%&]/.test(t)?e*.8:e*.6}function Wd(t){let e=t.slice(0,pi).split(" ").map(n=>dn(n,pi)).join(" ");return Array.from(e).slice(0,pi)}var Vd="\u2026",uc=1;function mc(t,e,n,o=false){return o&&e===t.length-1?uc*n:Ke(t[e],n)}function _i(t,e,n=false){let o=0;for(let r=0;r<t.length;r++)o+=mc(t,r,e,n);return o}function gi(t,e,n,o=false){return _i(t,e,o)+n*Math.max(0,t.length-1)+Ke(" ",e)+2*n<=Gt}var dc=t=>t.join("").split(" ").filter(Boolean),jd=(t,e)=>Array.from(Array.from({length:e},()=>t.join(" ")).join(" "));function fc(t,e,n){if(gi(t,e,n))return {chars:t,fontSize:e,letterSpacing:n};let o=Math.min(n,0),r=Math.min(e,zd),i=(f,h=false)=>{let g=_i(f,e,h)+Ke(" ",e),y=f.length+1,x=(Gt-g)/y;if(x>=o)return {chars:f,fontSize:e,letterSpacing:x,cut:h};let C=(Gt-o*y)/g*e;return C>=r?{chars:f,fontSize:C,letterSpacing:o,cut:h}:null},a=i(t);if(a)return a;let l=dc(t),s=hc(l);for(let f=l.length/s.length-1;f>=1;f--){let h=jd(s,f);if(gi(h,r,o))return i(h)??{chars:h,fontSize:r,letterSpacing:o}}let c=Gt-Ke(" ",r)-uc*r-2*o,u=0,m=0,d=0;for(let[f,h]of t.entries()){if(u+=Ke(h,r)+o,u>c)break;d=f+1,(d===t.length||t[d]===" ")&&(m=d);}let p=[...Zd(t.slice(0,m>0?m:d)),Vd];return (gi(p,e,n,true)?{chars:p,fontSize:e,letterSpacing:n,cut:true}:null)??i(p,true)??{chars:p,fontSize:r,letterSpacing:o,cut:true}}function Zd(t){let e=t.length;for(;e>0&&/[\s.,;:!?*·•\-–—]/u.test(t[e-1]);)e--;return t.slice(0,e)}function hc(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 Xd(t,e,n){let o=dc(t);if(o.length===0)return {chars:[],fontSize:e,letterSpacing:n};let r=Array.from(hc(o).join(" ")),i=_i(r,e)+Ke(" ",e),a=i+(r.length+1)*n,l=Math.min(n,0),s=null;for(let c of new Set([Math.floor(Gt/a),Math.ceil(Gt/a)])){if(c<1)continue;let u=(Gt-c*i)/(c*(r.length+1));if(u>=l&&(!s||Math.abs(u-n)<Math.abs(s.letterSpacing-n))){let m=Array.from({length:c},()=>r.join(""));s={chars:Array.from(m.join(" ")),fontSize:e,letterSpacing:u};}}return s??fc(r,e,n)}function pc(t,e){let{position:n,rotation:o}=e,r=Wd(t),i=e.fill==="repeat"?Xd(r,e.fontSize,e.letterSpacing):fc(r,e.fontSize,e.letterSpacing),{fontSize:a,letterSpacing:l}=i,s=[],c=0;for(let[f,h]of i.chars.entries()){let g=mc(i.chars,f,a,i.cut);s.push({char:h,along:c+g/2}),c+=g+l;}let u=c-(s.length>0?l:0),m=n!=="bottom",d=m?ec-bi*a:ec+bi*a,p=u/Gt*180,b=[];for(let{char:f,along:h}of s){if(f.trim()==="")continue;let g=h/Gt*360,y=m?o-p+g:o+180+p-g,x=y*Math.PI/180;b.push({char:f,x:U(Xt+d*Math.sin(x)),y:U(Xt-d*Math.cos(x)),rotate:U(m?y:y-180)});}return {text:i.chars.join(""),letters:b,fontSize:a===e.fontSize?a:U(a),letterSpacing:l}}var Je=(t,e)=>typeof t=="number"&&Number.isFinite(t)?t:e,gc={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=ut(e?.fgColor,"#000000"),r=ut(e?.bgColor,"#ffffff"),i=n?.pixelSize??9,a=U(i/2),l=ac(ic(n?.url??""),i),s=Je(e?.fontSize,vn),c=s>0?s:vn,u=typeof e?.customText=="string"?e.customText:sc,m=pc(u,{fontSize:c,letterSpacing:Je(e?.fontLetterSpacing,lc),position:e?.textPosition==="bottom"?"bottom":"top",rotation:Je(e?.textRotation,0),fill:e?.textFill==="repeat"?"repeat":"none"}),d=e?.textColor||"#ffffff",p=e?.fontFamily||ei,b=e?.fontWeight??900,f=Je(e?.strokeWidth,0),h=e?.strokeColor||"#000000",g=[{radius:Xt,width:Je(e?.outerStrokeWidth,f),color:e?.outerStrokeColor||h},{radius:rc,width:Je(e?.innerStrokeWidth,f),color:e?.innerStrokeColor||h}].filter(y=>y.width>0);return ct("svg",{height:Pn,id:"svgQrWrapper",style:{width:"100%",height:"100%"},viewBox:`0 0 ${Pn} ${Pn}`,width:Pn,xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",children:[E("circle",{cx:Xt,cy:Xt,fill:r,r:nc}),E("g",{fill:o,children:l.map((y,x)=>E("circle",{cx:y.cx,cy:y.cy,r:a},x))}),E("path",{d:oc,fill:e?.outerCircleColor||o}),g.map((y,x)=>E("circle",{cx:Xt,cy:Xt,fill:"none",r:y.radius,stroke:y.color,strokeWidth:y.width},x)),E("g",{"aria-hidden":"true",children:m.letters.map((y,x)=>E("text",{fill:d,fontFamily:p,fontSize:m.fontSize,fontWeight:b,textAnchor:"middle",transform:`rotate(${y.rotate} ${y.x} ${y.y})`,x:y.x,y:y.y,children:y.char},x))}),E("g",{transform:`translate(${An} ${An})`,children:t})]})}};var bc={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 _c=Tt({id:"Halloween",name:"Halloween",description:"QR code with Halloween theme",spec:bc,at:{x:38,y:10,scale:1}});var yc={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 xc=Tt({id:"SquareBorder",name:"Square Border",description:"QR code with square decorative border",spec:yc,at:{x:0,y:0,scale:300/316}});var $c={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 Sc=Tt({id:"StandardBox",name:"Standard Box",description:"QR code with standard box",spec:$c,at:{x:46,y:1,scale:1}});var Cc={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 wc=Tt({id:"StrikedBox",name:"Striked Box",description:"QR code with striked box",spec:Cc,at:{x:24,y:0,scale:1}});var yi={default:Xl,Arrow:Zl,StandardBox:Sc,SquareBorder:xc,StrikedBox:wc,Halloween:_c,DotRing:gc},Rc={FlamQR:"DotRing"},Mc=t=>{if(Object.hasOwn(yi,t))return yi[t];let e=Object.hasOwn(Rc,t)?Rc[t]:void 0;return e?yi[e]:void 0};var xi=t=>Math.round(Math.min(Math.max(t,0),255)).toString(16).padStart(2,"0");function vc(t){return `#${xi(t.r)}${xi(t.g)}${xi(t.b)}`}function tn(t){let e=tt(t);return !e||e.a>=1||e.a<=0?{color:t}:{color:vc(e),opacity:U(e.a,3)}}function wr(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 Ic={r:0,g:0,b:0,a:1};function ef(t){return [...t].map(e=>({offset:Math.min(Math.max(e.offset/100,0),1),color:tt(e.color)??Ic})).sort((e,n)=>e.offset-n.offset)}function $i(t,e){let n=t[0],o=t.at(-1);if(!(n&&o))return Ic;if(e<=n.offset)return n.color;if(e>=o.offset)return o.color;for(let r=0;r+1<t.length;r++){let i=t[r],a=t[r+1];if(e>=i.offset&&e<=a.offset){let l=a.offset-i.offset,s=l>0?(e-i.offset)/l:1,c=i.color.a+(a.color.a-i.color.a)*s,u=(m,d)=>{let p=m*i.color.a+(d*a.color.a-m*i.color.a)*s;return c>0?p/c:m+(d-m)*s};return {r:u(i.color.r,a.color.r),g:u(i.color.g,a.color.g),b:u(i.color.b,a.color.b),a:c}}}return o.color}var Ec=4,Ac=720,nf=2;function Fc(t,e,n,o,r){let i=ef(t);if(i.length===0)return {wedges:[]};let a=i[0].color.a,l=i.every(y=>Math.abs(y.color.a-a)<.002),s=[...new Set([0,...i.map(y=>y.offset),1])].sort((y,x)=>y-x),c=[];for(let y=0;y+1<s.length;y++){let x=s[y],C=s[y+1];if(C<=x)continue;let w=$i(i,x+1e-9),S=$i(i,C-1e-9),$=Math.max(Math.abs(w.r*w.a-S.r*S.a),Math.abs(w.g*w.a-S.g*S.a),Math.abs(w.b*w.a-S.b*S.a),Math.abs(w.a-S.a)*255),M=Math.ceil($/nf),R=Math.ceil((C-x)*360/Ec),A=Math.max(1,M,R);for(let v=0;v<A;v++)c.push([x+(C-x)*v/A,x+(C-x)*(v+1)/A]);}let u=c;if(c.length>Ac){let y=Math.ceil(c.length/Ac);u=[];for(let x=0;x<c.length;x+=y){let C=c.slice(x,x+y);u.push([C[0][0],C.at(-1)[1]]);}}let m=e-90,d=r/Math.cos(2*Ec/2*(Math.PI/180)),p=y=>{let x=y*Math.PI/180;return [_(n+d*Math.cos(x)),_(o+d*Math.sin(x))]},b=`${_(n)} ${_(o)}`,f=y=>U((y%360+360)%360,4),h=u.length-1,g=u.map(([y,x],C)=>{let w=$i(i,(y+x)/2),S=(x-y)*360,$=l&&C===0&&h>0?S:0,M=l&&C<h?S:0,R=m+y*360-$,A=m+x*360+M,[v,I]=p(R),[F,k]=p(A);return {d:`M${b}L${v} ${I}L${F} ${k}Z`,color:vc(w),...l||w.a>=1?{}:{opacity:U(w.a,3)},from:f(R),sweep:U(A-R,4)}});return l&&a<1?{wedges:g,opacity:U(a,3)}:{wedges:g}}function Pc(t,e,n,o){return (Math.atan2(o-e,n-t)*180/Math.PI%360+360)%360}function Lc(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]],i=Pc(t,e,n.x+n.width/2,n.y+n.height/2),a=0,l=0;for(let[s,c]of r){let u=Pc(t,e,s,c)-i;u>180?u-=360:u<=-180&&(u+=360),a=Math.min(a,u),l=Math.max(l,u);}return [i+a,i+l]}function Tc(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 rf(t,e){return t.slice().map((n,o)=>o<e.y||o>=e.y+e.h?n:n.map((r,i)=>i<e.x||i>=e.x+e.w?r:false))}function of(t,e,n){return t<7&&e<7||t>=n-7&&e<7||t<7&&e>=n-7}var af=.9;function Si(t,e){let{margin:n,pixelSize:o,pattern:r="circle",plain:i=false}=e;if(Ms(r))return Es(t,{margin:n,pixelSize:o,pattern:r,scale:e.scale,plain:i});let a=Ho(e.scale,r),l=[],s=t.length,c=o*.45,u=i?()=>false:qo(s);return t.forEach((m,d)=>{m.forEach((p,b)=>{if(p&&(i||!of(b,d,s))){let f=(b+.5+n)*o,h=(d+.5+n)*o,g=`${b}-${d}`,y=l.length;if(u(b,d)){l.push(E("rect",{height:_(o),width:_(o),x:_(f-o/2),y:_(h-o/2)},g));return}switch(r){case "circle":l.push(E("circle",{cx:_(f),cy:_(h),r:_(c),transform:P`rotate(0,${f},${h})`},g));break;case "circle-large":{let x=o*.5;l.push(E("circle",{cx:_(f),cy:_(h),r:_(x),transform:P`rotate(0,${f},${h})`},g));}break;case "small-square":{let x=o*.357143;l.push(E("path",{d:P`M ${f-x} ${h-x}v ${o*.714286}h ${o*.714286}v -${o*.714286}z`,transform:P`rotate(0,${f},${h})`},g));}break;case "diamond":{let x=o*.357143;l.push(E("path",{d:P`M ${f-x} ${h-x}v ${o*.714286}h ${o*.714286}v -${o*.714286}z`,transform:P`rotate(45,${f},${h})`},g));}break;case "circle-mixed":{let x=(b+d)%3===0?af:(b+d)%2===0?1:1.25,C=c*x;l.push(E("circle",{cx:_(f),cy:_(h),r:_(C),transform:P`rotate(0,${f},${h})`},g));}break;case "pacman":{let x=o*.5,C=o*.357143;l.push(E("path",{d:P`M ${f-x} ${h-C}v ${o*.714286}h ${x}a ${x*.5} ${x*.5}, 0, 0, 0, 0 -${o*.714286}h -${x}v -${o*.714286}z`,transform:P`rotate(${(b+d)%2===0?0:90},${f},${h})`},g));}break;case "rounded":{let x=o*.5,C=o*.2;l.push(E("rect",{height:_(o),rx:_(C),ry:_(C),transform:P`rotate(0,${f},${h})`,width:_(o),x:_(f-x),y:_(h-x)},g));}break;case "square":{let x=o*.5;l.push(E("rect",{height:_(o),transform:P`rotate(0,${f},${h})`,width:_(o),x:_(f-x),y:_(h-x)},g));}break;case "vertical-line":{let x=o*.714286,C=o;l.push(E("path",{d:P`M ${f-o*.5} ${h-x*.5}v ${x}h ${C}v -${x}z`,transform:P`rotate(90,${f},${h})`},g));}break;default:l.push(E("circle",{cx:_(f),cy:_(h),r:_(c),transform:P`rotate(0,${f},${h})`},g));}if(a!==1&&l.length>y){let x=l.pop();l.push(E("g",{transform:P`translate(${f},${h}) scale(${_(a,6)}) translate(${-f},${-h})`,children:x},g));}}});}),l}function sf(t,e){let n=t*Math.PI/180,o=e/2,r=e/2,i=Math.sqrt(e*e+e*e)/2,a=o-i*Math.cos(n),l=r-i*Math.sin(n),s=o+i*Math.cos(n),c=r+i*Math.sin(n);return {x1:a,y1:l,x2:s,y2:c}}function Ci(t,e){return `${t}-${le(JSON.stringify(e))}`}function lf(t,e,n,o,r){let i=t;if(t===0)switch(r){case "top-left":i=0;break;case "top-right":i=90;break;case "bottom-left":i=270;break;default:i=0;}let a=i*Math.PI/180,l=e+o/2,s=n+o/2,c=Math.sqrt(o*o+o*o)/2,u=l-c*Math.cos(a),m=s-c*Math.sin(a),d=l+c*Math.cos(a),p=s+c*Math.sin(a);return {x1:u,y1:m,x2:d,y2:p}}function Er(t,e){return e.map((n,o)=>{let{color:r,opacity:i}=tn(n.color);return E("stop",{offset:`${n.offset}%`,stopColor:r,stopOpacity:i},`${t}-stop-${o}`)})}function Nc(t,e,n,o,r,i){let a=Fc(e.stops,e.angle??0,n,o,r),l=a.wedges.map((s,c)=>E("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-${c}`));return E("pattern",{"data-qrdx-conic":`${_(n)} ${_(o)}`,height:_(i),id:t,patternUnits:"userSpaceOnUse",width:_(i),x:0,y:0,children:a.opacity===void 0?l:E("g",{opacity:a.opacity,children:l})},t)}function cf(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 uf=["xMin","xMid","xMax"],mf=["YMin","YMid","YMax"];function Oc(t,e,n){let o=e.scale??1,r=e.fit==="tile",i=r?n/4*o:n,a=e.underlay?tn(e.underlay):null,l=r?i:n*o,s=cf(e.position),c=r?0:s.x*(n-l),u=r?0:s.y*(n-l),m=r?"xMidYMid slice":`${uf[s.x*2]??"xMid"}${mf[s.y*2]??"YMid"} ${e.fit==="contain"?"meet":"slice"}`;return ct("pattern",{height:_(i),id:t,patternUnits:"userSpaceOnUse",width:_(i),x:0,y:0,children:[a&&E("rect",{fill:a.color,fillOpacity:a.opacity,height:_(i),width:_(i),x:0,y:0}),E("image",{height:_(l),href:e.src,opacity:(e.opacity??1)<1?e.opacity:void 0,preserveAspectRatio:m,width:_(l),x:_(c),y:_(u)})]},t)}var Dc=(t,e)=>Ci("img",[t,e]);function df(t,e,n,o,r,i,a){let l=Lt(t);if(l.type==="solid")return null;if(l.type==="image"){let c=Dc(l,a);return {id:c,element:Oc(c,l,a)}}let s=Ci(i,[l,e,n,o,r,...l.type==="angular"?[a]:[]]);if(l.type==="linear"){let c=l,u=c.angle??0,{x1:m,y1:d,x2:p,y2:b}=lf(u,e,n,o,r);return {id:s,element:E("linearGradient",{gradientUnits:"userSpaceOnUse",id:s,x1:_(m),x2:_(p),y1:_(d),y2:_(b),children:Er(s,c.stops)},s)}}if(l.type==="radial"){let c=l,u=e+o/2,m=n+o/2,d=o/2*.97;return {id:s,element:E("radialGradient",{cx:_(u),cy:_(m),fx:_(u),fy:_(m),gradientUnits:"userSpaceOnUse",id:s,r:_(d),children:Er(s,c.stops)},s)}}return l.type==="angular"?{id:s,element:Nc(s,l,e+o/2,n+o/2,o*.75,a)}:null}function Rr(t,e,n){let o=Lt(t);if(o.type==="solid")return null;if(o.type==="image"){let i=Dc(o,e);return {id:i,element:Oc(i,o,e)}}let r=Ci(n,[o,e]);if(o.type==="linear"){let i=o,a=i.angle??0,{x1:l,y1:s,x2:c,y2:u}=sf(a,e);return {id:r,element:E("linearGradient",{gradientUnits:"userSpaceOnUse",id:r,x1:_(l),x2:_(c),y1:_(s),y2:_(u),children:Er(r,i.stops)},r)}}if(o.type==="radial"){let i=o,a=e/2,l=e/2,s=e/2*.97;return {id:r,element:E("radialGradient",{cx:_(a),cy:_(l),fx:_(a),fy:_(l),gradientUnits:"userSpaceOnUse",id:r,r:_(s),children:Er(r,i.stops)},r)}}return o.type==="angular"?{id:r,element:Nc(r,o,e/2,e/2,e*.75,e)}:null}var Mr=t=>Ne(t)||ua(t);function kc(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 Qt(t,e,n){if(e)return {fill:`url(#${e})`};let o=Lt(t,n),r=o.type==="solid"?o.color:o.type==="image"?o.underlay??n:n,{color:i,opacity:a}=tn(r);return a===void 0?{fill:i}:{fill:i,fillOpacity:a}}function xr(t,e,n,o){if(o==null)return null;let r=t.length,i=Math.floor(e*Gn),a=(r+2*n)/e,l=(o.width||i)*a,s=(o.height||i)*a,c=o.x==null?r/2-l/2:o.x*a,u=o.y==null?r/2-s/2:o.y*a,m=null;if(o.excavate){let d=Math.max(0,o.padding??0)*a,p=Math.floor(c-d),b=Math.floor(u-d),f=Math.ceil(l+c+d-p),h=Math.ceil(s+u+d-b);m={x:p,y:b,w:f,h};}return {x:c,y:u,h:s,w:l,excavation:m}}function fe(t){let e=t.level??an,{imageSettings:n}=t,o=t.isOGContext&&n?.excavate&&(e==="L"||e==="M")?"Q":e;if(t.autoLevel&&n&&o!=="H"){let r=dt.QrCode.encodeText(t.value,wt[o]).getModules(),i=xr(r,t.size??xt,vt(r.length,t.margin??Ht,t.shape),n);i&&(i.excavation?i.excavation.w*i.excavation.h:i.w*i.h)/(r.length*r.length)>ha&&(o="H");}return o}function ff(t,e,n,o){let r=e/n,i=t.w*r,a=t.h*r,l=(t.x+o)*r,s=(t.y+o)*r;return {imgWidth:i,imgHeight:a,imgLeft:l,imgTop:s}}function en(t){let{value:e,size:n=xt,level:o=an,bgColor:r=rt,fgColor:i=ke,eyeColor:a,dotColor:l,bodyPattern:s="circle",cornerEyePattern:c="gear",cornerEyeDotPattern:u="circle",margin:m=Ht,isOGContext:d=false,imageSettings:p,templateId:b,customTemplate:f,customProps:h,frame:g,art:y,eyeColors:x,moduleScale:C,autoLevel:w,shape:S,eyeShapes:$,eyeGradient:M,bgRadius:R,backdrop:A,halo:v,shadow:I,frameLabelMarkers:F,partMarkers:k,...N}=t,L=ee(da,s),W=ee(Qn,c),B=ee(Un,u),D=Dl({value:e,size:n,margin:m,level:o,shape:S,autoLevel:w,isOGContext:d},p),Q=Zt(g),nt=Q?{}:N,St=O=>Q?_l(O,{size:n,frame:g,bgColor:r,svgProps:N,markLabels:F}):O,yt=fe({value:e,size:n,level:o,margin:m,imageSettings:D,isOGContext:d,autoLevel:w,shape:S}),Ct=dt.QrCode.encodeText(e,wt[yt]),X=Ct.getModules(),j=vt(X.length,m,S),Kt=Fl(e,X.length,m,S),Y=(O,ht)=>Vl(k,O,ht),Jt=Cr(R,X.length,j,S),rn=(O,ht)=>{let Ft=Ll(S,O);if(!Ft){if(Jt>0){let kt=_(Jt*O),At=A?tn(A):null;return ct(Nt,{children:[At&&E("rect",{"data-qrdx-look":"backdrop",fill:At.color,fillOpacity:At.opacity,height:O,width:O,x:0,y:0}),E("rect",{...ht,height:O,rx:kt,ry:kt,width:O,x:0,y:0,...Y("background")})]})}return E("rect",{...ht,height:O,width:O,x:0,y:0,...Y("background")})}return "circle"in Ft?E("circle",{cx:_(O/2),cy:_(O/2),...ht,r:_(O/2),...Y("background")}):E("path",{d:Ft.path,...ht,...Y("background")})},Wi=X.length+j*2,On=xr(X,n,j,D),$e=null;if(D!=null&&On!=null){On.excavation!=null&&(X=rf(X,On.excavation));let{imgWidth:O,imgHeight:ht,imgLeft:Ft,imgTop:kt}=ff(On,n,Wi,j);if(d){let At=D.shape??"square";$e=E("img",{alt:"Logo",src:D.src,style:{position:"absolute",left:`${_(Ft)}px`,top:`${_(kt)}px`,width:`${_(O)}px`,height:`${_(ht)}px`,...At!=="square"&&{borderRadius:At==="circle"?"50%":`${_(Math.min(O,ht)*oi)}px`},...D.plate&&{backgroundColor:D.plate,padding:`${_(O*ii)}px`,boxSizing:"border-box"}}});}else $e=Ol(D,{x:Ft,y:kt,w:O,h:ht}),k&&($e=Be($e,Y("logo")));}let mt=n/Wi,Vi=X.length,K=7*mt,Ur=1.5*mt,ji={fgColor:ut(i,ke),bgColor:ut(r,rt)},Se=Ka(y)?as({art:y,modules:X,version:Ct.version,margin:j,pixelSize:mt,...ji,body:O=>Si(O,{margin:j,pixelSize:mt,pattern:L,scale:C})}):null,Zi=Se&&k?Be(Se,Y("body")):Se,Xi=Se&&y?$s({art:y,version:Ct.version,...ji}):null,Yi=Se?null:Si(X,{margin:j,pixelSize:mt,pattern:L,scale:C}),Dn=Kt?Si(Kt,{margin:0,pixelSize:mt,pattern:L,scale:C,plain:true}):null,Bn=Lt(r,rt),Hr=Lt(i,ke),Ki=Mr(Bn)?Rr(Bn,n,"bg-color"):null,qr=Mr(Hr)?Rr(Hr,n,"fg-color"):null,t0=Qt(r,Ki?.id??null,rt),Ji=Qt(i,qr?.id??null,ke),ta=Zi?ct(Nt,{children:[Zi,Dn&&E("g",{...Ji,...Y("body"),children:Dn})]}):ct("g",{...Ji,...Y("body"),children:[Yi,Dn]}),Ce=j*mt,we=j*mt,Re=(Vi-7+j)*mt,Me=j*mt,Ee=j*mt,Ae=(Vi-7+j)*mt,te=ut(i,ke),Pe=O=>x?.[O]?.outer??Xi?.[O]?.outer??a,ve=O=>x?.[O]?.inner??Xi?.[O]?.inner??l,Ie=(O,ht,Ft,kt,At)=>{let Le=Lt(O,te);if(!Mr(Le))return null;if(M==="code"&&Ne(Le)){let ao=JSON.stringify(Le)===JSON.stringify(Hr);return Rr(Le,n,ao?"fg-color":At)}return df(Le,ht,Ft,K,kt,At,n)},zr=Ie(Pe("topLeft"),Ce,we,"top-left","corners-square-color-0-0"),Wr=Ie(Pe("topRight"),Re,Me,"top-right","corners-square-color-1-0"),Vr=Ie(Pe("bottomLeft"),Ee,Ae,"bottom-left","corners-square-color-0-1"),jr=Ie(ve("topLeft"),Ce,we,"top-left","corners-dot-color-0-0"),Zr=Ie(ve("topRight"),Re,Me,"top-right","corners-dot-color-1-0"),Xr=Ie(ve("bottomLeft"),Ee,Ae,"bottom-left","corners-dot-color-0-1"),ea=Qt(Pe("topLeft"),zr?.id??null,te),na=Qt(Pe("topRight"),Wr?.id??null,te),ra=Qt(Pe("bottomLeft"),Vr?.id??null,te),oa=Qt(ve("topLeft"),jr?.id??null,te),ia=Qt(ve("topRight"),Zr?.id??null,te),aa=Qt(ve("bottomLeft"),Xr?.id??null,te),Fe={cornerEyePattern:W,cornerEyeDotPattern:B,eyeShapes:$},Yr=yr(Ce,we,K,pe(Fe,"topLeft").outer,"top-left"),Kr=_r(Ce+K/2,we+K/2,Ur,pe(Fe,"topLeft").inner,"top-left"),Jr=yr(Re,Me,K,pe(Fe,"topRight").outer,"top-right"),to=_r(Re+K/2,Me+K/2,Ur,pe(Fe,"topRight").inner,"top-right"),eo=yr(Ee,Ae,K,pe(Fe,"bottomLeft").outer,"bottom-left"),no=_r(Ee+K/2,Ae+K/2,Ur,pe(Fe,"bottomLeft").inner,"bottom-left"),ro=ql(v,{bgColor:r}),on=zl(I),sa=O=>ct(Nt,{children:[Se?null:Yi,Dn,E("path",{d:Yr,fillRule:O}),Kr,E("path",{d:Jr,fillRule:O}),to,E("path",{d:eo,fillRule:O}),no]}),oo=null;if(ro){let{color:O}=ro;oo=E("g",{"data-qrdx-look":"halo",fill:O,stroke:O,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:_(2*ro.width*mt),children:sa("nonzero")});}let io=null;if(on){let{color:O}=tn(on.color);io=E("g",{"data-qrdx-look":"shadow",fill:O,opacity:_(on.opacity),transform:P`translate(${on.dx*mt},${on.dy*mt})`,children:sa("evenodd")});}let e0=ct(Nt,{children:[E("defs",{children:kc([Ki,qr,zr,Wr,Vr,jr,Zr,Xr])}),rn(n,t0),oo,io,ta,E("g",{...ea,...Y("eye-outer","top-left"),children:E("path",{d:Yr,fillRule:"evenodd",transform:P`rotate(0,${Ce+K/2},${we+K/2})`})}),E("g",{...oa,...Y("eye-centre","top-left"),children:Kr}),E("g",{...na,...Y("eye-outer","top-right"),children:E("path",{d:Jr,fillRule:"evenodd",transform:P`rotate(0,${Re+K/2},${Me+K/2})`})}),E("g",{...ia,...Y("eye-centre","top-right"),children:to}),E("g",{...ra,...Y("eye-outer","bottom-left"),children:E("path",{d:eo,fillRule:"evenodd",transform:P`rotate(0,${Ee+K/2},${Ae+K/2})`})}),E("g",{...aa,...Y("eye-centre","bottom-left"),children:no}),$e]}),la=f||(b?Mc(b):void 0);if(la){let ht=Mr(Bn)?Rr(Bn,300,"bg-color-template"):null,Ft=Qt(r,ht?.id??null,rt),kt=ct("svg",{height:300,viewBox:"0 0 300 300",width:300,xmlns:"http://www.w3.org/2000/svg",children:[E("defs",{children:kc([ht,qr,zr,Wr,Vr,jr,Zr,Xr])}),rn(300,Ft),ct("g",{transform:`scale(${_(300/n,6)})`,children:[oo,io,ta,E("g",{...ea,...Y("eye-outer","top-left"),children:E("path",{d:Yr,fillRule:"evenodd",transform:P`rotate(0,${Ce+K/2},${we+K/2})`})}),E("g",{...oa,...Y("eye-centre","top-left"),children:Kr}),E("g",{...na,...Y("eye-outer","top-right"),children:E("path",{d:Jr,fillRule:"evenodd",transform:P`rotate(0,${Re+K/2},${Me+K/2})`})}),E("g",{...ia,...Y("eye-centre","top-right"),children:to}),E("g",{...ra,...Y("eye-outer","bottom-left"),children:E("path",{d:eo,fillRule:"evenodd",transform:P`rotate(0,${Ee+K/2},${Ae+K/2})`})}),E("g",{...aa,...Y("eye-centre","bottom-left"),children:no}),$e]})]}),At=300/n,ao={pixelSize:mt*At,url:e},ca=la.wrapper(kt,{fgColor:i,bgColor:r,...h||{},...N},ao),n0={...ca?.props?.style||{},width:void 0,height:void 0,...nt.style};return St(Be(ca,{...nt,width:n,height:n,style:n0}))}return St(E("svg",{height:n,viewBox:`0 0 ${n} ${n}`,width:n,xmlns:"http://www.w3.org/2000/svg",...nt,children:e0}))}(()=>{try{new Path2D().addPath(new Path2D);}catch{return false}return true})();var Gc=(t,e)=>{if(!(Number.isInteger(t)&&Number.isInteger(e))||t<1||e<1||t>16384||e>16384)throw new RangeError(`GIF width and height must be whole numbers from 1 to 16384, got ${t} x ${e}`)},wi=(t,e)=>t>>6*(2-e)&63;function hf(t,e,n){Gc(e,n);let o=e*n;if(t.length!==o*4)throw new RangeError(`Expected ${o*4} RGBA bytes for ${e} x ${n}, got ${t.length}`);let r=new Map,i=false,a=false,l=false;for(let g=0;g<o;g++){let y=g*4,x=t[y+3];if(x<128){i=true,a||=x>0;continue}if(a||=x<255,!l){let C=t[y]<<16|t[y+1]<<8|t[y+2];r.has(C)||(r.set(C,r.size),l=r.size>256);}}let s=i?255:256,c=!l&&r.size<=s,u=new Uint8Array(o),m,d,p;if(c){d=[];for(let g of r.keys())d.push(g>>16&255,g>>8&255,g&255);m=r.size,p=(g,y,x)=>r.get(g<<16|y<<8|x);}else {let g=pf(t,o,s);d=g.palette,m=g.palette.length/3,p=(y,x,C)=>g.bucketIndex[Qc(y,x,C)];}let b=i?m:null;for(let g=0;g<o;g++){let y=g*4;t[y+3]<128?u[g]=b:u[g]=p(t[y],t[y+1],t[y+2]);}let f=m+(i?1:0),h=new Uint8Array(f*3);return h.set(d),i&&h.fill(255,m*3),{width:e,height:n,palette:h,indices:u,transparentIndex:b,colors:f,lossless:c&&!a}}var Qc=(t,e,n)=>t>>2<<12|e>>2<<6|n>>2;function pf(t,e,n){let o=new Uint32Array(262144),r=new Float64Array(262144),i=new Float64Array(262144),a=new Float64Array(262144);for(let d=0;d<e;d++){let p=d*4;if(t[p+3]<128)continue;let b=t[p],f=t[p+1],h=t[p+2],g=Qc(b,f,h);o[g]=o[g]+1,r[g]=r[g]+b,i[g]=i[g]+f,a[g]=a[g]+h;}let l=[];for(let d=0;d<262144;d++)o[d]>0&&l.push(d);let s=[{keys:l,pixels:l.reduce((d,p)=>d+o[p],0)}];for(;s.length<n;){let d=-1;for(let $=0;$<s.length;$++){let M=s[$];M.keys.length>1&&(d===-1||M.pixels>s[d].pixels)&&(d=$);}if(d===-1)break;let p=s[d],b=0,f=-1;for(let $ of [0,1,2]){let M=255,R=0;for(let A of p.keys){let v=wi(A,$);M=Math.min(M,v),R=Math.max(R,v);}R-M>f&&(f=R-M,b=$);}let h=[...p.keys].sort(($,M)=>wi($,b)-wi(M,b)||$-M),g=p.pixels/2,y=0,x=1;for(let $=0;$<h.length-1&&(y+=o[h[$]],x=$+1,!(y>=g));$++);let C=h.slice(0,x),w=h.slice(x),S=$=>$.reduce((M,R)=>M+o[R],0);s.splice(d,1,{keys:C,pixels:S(C)},{keys:w,pixels:S(w)});}let c=[];for(let d of s){let p=0,b=0,f=0;for(let h of d.keys)p+=r[h],b+=i[h],f+=a[h];c.push(Math.round(p/d.pixels),Math.round(b/d.pixels),Math.round(f/d.pixels));}let u=new Uint8Array(262144),m=c.length/3;for(let d of l){let p=o[d],b=r[d]/p,f=i[d]/p,h=a[d]/p,g=0,y=Number.POSITIVE_INFINITY;for(let x=0;x<m;x++){let C=b-c[x*3],w=f-c[x*3+1],S=h-c[x*3+2],$=C*C+w*w+S*S;$<y&&(y=$,g=x);}u[d]=g;}return {palette:c,bucketIndex:u}}var gf=t=>Math.max(1,Math.ceil(Math.log2(t))),Ar=class{buffer=new Uint8Array(1024);length=0;push(...e){this.ensure(e.length);for(let n of e)this.buffer[this.length++]=n;}u16(e){this.push(e&255,e>>8&255);}ascii(e){for(let n=0;n<e.length;n++)this.push(e.charCodeAt(n));}bytes(e){this.ensure(e.length),this.buffer.set(e,this.length),this.length+=e.length;}ensure(e){if(this.length+e<=this.buffer.length)return;let n=this.buffer.length;for(;n<this.length+e;)n*=2;let o=new Uint8Array(n);o.set(this.buffer.subarray(0,this.length)),this.buffer=o;}result(){return this.buffer.slice(0,this.length)}};function bf(t,e){let n=new Ar,o=1<<e,r=o+1,i=[],a=0,l=0,s=()=>{i.length>0&&(n.push(i.length,...i),i=[]);},c=f=>{i.push(f),i.length===255&&s();},u=(f,h)=>{for(a|=f<<l,l+=h;l>=8;)c(a&255),a>>>=8,l-=8;},m=new Int32Array(1048576),d=e+1,p=r+1;u(o,d);let b=t[0];for(let f=1;f<t.length;f++){let h=t[f],g=b<<8|h,y=m[g];if(y!==0){b=y-1;continue}u(b,d),p===4096?(u(o,d),m=new Int32Array(1048576),p=r+1,d=e+1):(p>=1<<d&&d++,m[g]=p+1,p++),b=h;}return u(b,d),u(r,d),l>0&&c(a&255),s(),n.result()}function _f(t){let{width:e,height:n,palette:o,indices:r,transparentIndex:i}=t;Gc(e,n);let a=o.length/3;if(!Number.isInteger(a)||a<1||a>256)throw new RangeError(`A GIF palette holds 1 to 256 colors, got ${o.length} bytes`);if(r.length!==e*n)throw new RangeError(`Expected ${e*n} palette indices for ${e} x ${n}, got ${r.length}`);if(i!==null&&!(Number.isInteger(i)&&i>=0&&i<a))throw new RangeError(`The transparent index ${i} isn't in a palette of ${a} colors`);for(let m=0;m<r.length;m++)if(r[m]>=a)throw new RangeError(`Pixel ${m} points at color ${r[m]}, past the palette of ${a}`);let l=gf(a),s=1<<l,c=Math.max(2,l),u=new Ar;return u.ascii("GIF89a"),u.u16(e),u.u16(n),u.push(240|l-1,0,0),u.bytes(o),u.bytes(new Uint8Array((s-a)*3)),i!==null&&u.push(33,249,4,1,0,0,i,0),u.push(44),u.u16(0),u.u16(0),u.u16(e),u.u16(n),u.push(0),u.push(c),u.bytes(bf(r,c)),u.push(0),u.push(59),u.result()}function Uc(t,e,n){let o=hf(t,e,n);return {file:_f(o),image:o}}function Hc(t){let{palette:e,indices:n,transparentIndex:o}=t,r=new Uint8ClampedArray(n.length*4);for(let i=0;i<n.length;i++){let a=n[i],l=i*4;r[l]=e[a*3],r[l+1]=e[a*3+1],r[l+2]=e[a*3+2],r[l+3]=a===o?0:255;}return r}var Bc="GIF89a";function qc(t){if(t.length<32)return false;for(let s=0;s<Bc.length;s++)if(t[s]!==Bc.charCodeAt(s))return false;let e=new DataView(t.buffer,t.byteOffset,t.byteLength),n=e.getUint16(6,true),o=e.getUint16(8,true),r=t[10];if(n<1||o<1||!(r&128))return false;let i=13+3*(1<<(r&7)+1);if(t.length<i)return false;let a=s=>{let c=s;for(;c<t.length;){let u=t[c];if(c+=1,u===0)return c;c+=u;}return -1},l=0;for(;i<t.length;){let s=t[i];if(s===59)return l===1&&i===t.length-1;if(s===33)i=a(i+2);else if(s===44){if(i+10>t.length||e.getUint16(i+5,true)!==n||e.getUint16(i+7,true)!==o||t[i+9]&128)return false;let c=t[i+10];if(c<2||c>8)return false;l+=1,i=a(i+11);}else return false;if(i===-1)return false}return false}var In="image/gif",vr=class extends Error{constructor(e){super(e),this.name="GIFScanError";}},Pr=255;function zc(t){let e=new Uint8ClampedArray(t.length);for(let n=0;n<t.length;n+=4){let o=t[n+3];for(let r=0;r<3;r++)e[n+r]=Math.round((t[n+r]*o+Pr*(Pr-o))/Pr);e[n+3]=Pr;}return e}function Wc(t,e,n){let o=Uint8ClampedArray.from(e.data),r=t(o,e.width,e.height,{inversionAttempts:"dontInvert"});if(!r)return false;if(r.data===n)return true;try{return new TextDecoder().decode(Uint8Array.from(r.binaryData))===n}catch{return false}}async function yf(t,e,n){let{width:o,height:r}=t,i=zc(t.data),a=zc(e.data);if(e.width===o&&e.height===r&&i.every((c,u)=>c===a[u]))return;let l;try{l=(await import('jsqr')).default;}catch{throw new vr("This design uses more colors than a GIF holds (256), and the reduced image could not be checked because jsqr is not available. Download a PNG instead.")}if(!Wc(l,{data:i,width:o,height:r},n))return;if(!Wc(l,{data:a,width:e.width,height:e.height},n))throw new vr("This design uses more colors than a GIF holds (256), and the reduced image would not scan. Download a PNG instead.")}async function xf(t,e){let{file:n,image:o}=Uc(t.data,t.width,t.height);if(!qc(n))throw new Error("Could not write a GIF file");return e!==void 0&&!o.lossless&&await yf(t,{data:Hc(o),width:t.width,height:t.height},e),{file:n,colors:o.colors,lossless:o.lossless}}async function Ir(t,e){let n=t.getContext("2d");if(!n)throw new Error("Could not get canvas context");let{data:o}=n.getImageData(0,0,t.width,t.height),{file:r}=await xf({data:o,width:t.width,height:t.height},e);return new Blob([r],{type:In})}var Fr=[16,32,48,256],be="image/vnd.microsoft.icon",ge=256,Ri=64,Fn=6,Ln=16,$f=[137,80,78,71,13,10,26,10],Sf=16,Vc=20,Cf=32,jc=t=>t.length>=Vc+4&&$f.every((e,n)=>t[n]===e),Zc=t=>{let e=new DataView(t.buffer,t.byteOffset,t.byteLength);return {width:e.getUint32(Sf),height:e.getUint32(Vc)}};function Mi(t){if(t.length<1||t.length>Ri)throw new RangeError(`An ICO holds 1 to ${Ri} images, got ${t.length}`);for(let{width:a,height:l,png:s}of t){let c=m=>Number.isInteger(m)&&m>=1&&m<=ge;if(!(c(a)&&c(l)))throw new RangeError(`ICO images must be whole numbers from 1 to ${ge} px, got ${a} x ${l}`);if(!jc(s))throw new RangeError("Every ICO image must be a PNG file");let u=Zc(s);if(u.width!==a||u.height!==l)throw new RangeError(`An ICO image says ${a} x ${l} but its PNG is ${u.width} x ${u.height}`)}let e=Fn+Ln*t.length,n=t.reduce((a,l)=>a+l.png.length,0),o=new Uint8Array(e+n),r=new DataView(o.buffer);r.setUint16(0,0,true),r.setUint16(2,1,true),r.setUint16(4,t.length,true);let i=e;return t.forEach(({width:a,height:l,png:s},c)=>{let u=Fn+Ln*c;o[u]=a===ge?0:a,o[u+1]=l===ge?0:l,o[u+2]=0,o[u+3]=0,r.setUint16(u+4,1,true),r.setUint16(u+6,Cf,true),r.setUint32(u+8,s.length,true),r.setUint32(u+12,i,true),o.set(s,i),i+=s.length;}),o}function Ei(t){if(t.length<Fn+Ln)return false;let e=new DataView(t.buffer,t.byteOffset,t.byteLength),n=e.getUint16(4,true);if(e.getUint16(0,true)!==0||e.getUint16(2,true)!==1||n<1||n>Ri||t.length<Fn+Ln*n)return false;for(let o=0;o<n;o++){let r=Fn+Ln*o,i=t[r]||ge,a=t[r+1]||ge,l=e.getUint32(r+8,true),s=e.getUint32(r+12,true);if(s+l>t.length)return false;let c=t.subarray(s,s+l);if(!jc(c))return false;let u=Zc(c);if(u.width!==i||u.height!==a)return false}return true}var Xc="data:image/png;base64,";function wf(t){let e=t.toDataURL("image/png");if(!e.startsWith(Xc))throw new Error("This browser can't write a PNG from a canvas");let n=atob(e.slice(Xc.length)),o=new Uint8Array(n.length);for(let r=0;r<n.length;r++)o[r]=n.charCodeAt(r);return o}function Ai(t){let e=Mi(t.map(n=>({width:n.width,height:n.height,png:wf(n)})));if(!Ei(e))throw new Error("Could not write an ICO file");return new Blob([e],{type:be})}function Yc(t){return Ai([t])}var Rf=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"]]),Mf=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"]]),Ef=new Set(["children","dangerouslySetInnerHTML","key","defaultValue","defaultChecked","innerHTML","suppressContentEditableWarning","suppressHydrationWarning","ref"]),Af=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"]),Pf=new Set(["autoFocus","multiple","muted"]),vf=new Set(["contentEditable","spellCheck","draggable","value","autoReverse","externalResourcesRequired","focusable","preserveAlpha"]),If=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(" ")),Kc=":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",Ff=new RegExp(`^[${Kc}][${Kc}\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`),Lr=/^[a-zA-Z][a-zA-Z:_.\-\d]*$/,Lf=/^[\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,Tf="javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')",kf=t=>Lf.test(t)?Tf:t,tu=new Set(["area","base","br","col","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"]),Nf=/["'&<>]/;function Pi(t){if(!Nf.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=""";break;case 38:r="&";break;case 39:r="'";break;case 60:r="<";break;case 62:r=">";break;default:continue}e+=t.slice(n,o)+r,n=o+1;}return e+t.slice(n)}var Ut=t=>typeof t=="function"||typeof t=="symbol",Jc=new Map,Of=t=>{let e=Jc.get(t);return e===void 0&&(e=t.replace(/([A-Z])/g,"-$1").toLowerCase().replace(/^ms-/,"-ms-"),Jc.set(t,e)),e};function Df(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 i=typeof o=="number"?o===0||If.has(n)?`${o}`:`${o}px`:`${o}`.trim();r=`${Of(n)}:${i}`;}e=e?`${e};${r}`:r;}return e}function Tr(t,e){if(e==null||Ef.has(t))return null;let n=Mf.get(t);if(n!==void 0)return Ut(e)||typeof e=="boolean"?null:{name:n,value:`${e}`};switch(t){case "style":{let r=Df(e);return r?{name:"style",value:r}:null}case "src":case "href":case "action":case "formAction":case "xlinkHref":return (t==="src"||t==="href")&&e===""||Ut(e)||typeof e=="boolean"?null:{name:t==="xlinkHref"?"xlink:href":t,value:kf(`${e}`)};case "capture":case "download":return e===true?{name:t,value:""}:e===false||Ut(e)?null:{name:t,value:`${e}`};case "cols":case "rows":case "size":case "span":return Ut(e)||Number.isNaN(Number(e))||!(e>=1)?null:{name:t,value:`${e}`};case "rowSpan":case "start":return Ut(e)||Number.isNaN(Number(e))?null:{name:t,value:`${e}`};}if(Pf.has(t))return e&&!Ut(e)?{name:t.toLowerCase(),value:""}:null;if(vf.has(t))return Ut(e)?null:{name:t,value:`${e}`};if(Af.has(t))return e&&!Ut(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=Rf.get(t)??t;if(!Ff.test(o)||Ut(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 eu="http://www.w3.org/2000/svg",nu="http://www.w3.org/1999/xhtml",Bf="http://www.w3.org/1999/xlink",Gf="http://www.w3.org/XML/1998/namespace",Qf="http://www.w3.org/2000/xmlns/";function Uf(t,e,n){e==="xmlns"||e.startsWith("xmlns:")?t.setAttributeNS(Qf,e,n):e.startsWith("xlink:")?t.setAttributeNS(Bf,e,n):e.startsWith("xml:")?t.setAttributeNS(Gf,e,n):t.setAttribute(e,n);}function Tn(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)Tn(t,s,n,o);return}if(!tr(e))throw new TypeError("qrdx: can't render this value as DOM nodes");let{type:r,props:i}=e;if(er(r)){Tn(t,i.children,n,o);return}if(typeof r=="function"){Tn(t,r(i),n,o);return}if(!Lr.test(r))throw new TypeError(`qrdx: invalid element name: ${r}`);let a=r==="svg"?eu:n,l=o.createElementNS(a,r);for(let s of Object.keys(i)){let c=Tr(s,i[s]);c&&Uf(l,c.name,c.value);}Tn(l,i.children,a===eu&&r==="foreignObject"?nu:a,o),t.appendChild(l);}function vi(t,e=document){let n=e.createDocumentFragment();return Tn(n,t,nu,e),n}function It(t){if(t==null||typeof t=="boolean")return "";if(typeof t=="string")return Pi(t);if(typeof t=="number"||typeof t=="bigint")return `${t}`;if(Array.isArray(t)){let e="";for(let n of t)e+=It(n);return e}if(!tr(t))throw new TypeError("qrdx: can't render this value as SVG markup");return Hf(t)}function Hf(t){let{type:e,props:n}=t;if(er(e))return It(n.children);if(typeof e=="function")return It(e(n));if(!Lr.test(e))throw new TypeError(`qrdx: invalid element name: ${e}`);let o=`<${e}`;for(let a of Object.keys(n)){let l=Tr(a,n[a]);l&&(o+=` ${l.name}="${Pi(l.value)}"`);}if(tu.has(e))return `${o}/>`;let r=n.dangerouslySetInnerHTML?.__html,i=r==null?It(n.children):`${r}`;return `${o}>${i}</${e}>`}function ru(t){return It(en(t))}var Ii=[17,18,0,1,2,3,4,5,16,6,7,8,9,10,11,12,13,14,15],qf=8,Fi=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 cu(t,e){let n=new Uint8Array(t.length),o=[];for(let c=0;c<t.length;c++)(t[c]??0)>0&&o.push(c);if(o.length===0)return n;if(o.length===1)return n[o[0]]=1,n;let r=o.length,i=2*r-1,a=new Float64Array(i),l=new Int32Array(i),s=new Uint8Array(i);for(let c=1;;c*=2){for(let f=0;f<r;f++)a[f]=Math.max(t[o[f]]??0,c);let u=Array.from({length:r},(f,h)=>h).sort((f,h)=>a[f]-a[h]||f-h),m=0,d=r,p=f=>m<r&&(d>=f||a[u[m]]<=a[d])?u[m++]:d++;for(let f=r;f<i;f++){let h=p(f),g=p(f);a[f]=a[h]+a[g],l[h]=f,l[g]=f;}s[i-1]=0;let b=0;for(let f=i-2;f>=0;f--){let h=s[l[f]]+1;s[f]=h,f<r&&h>b&&(b=h);}if(b<=e){for(let f=0;f<r;f++)n[o[f]]=s[f];return n}}}function zf(t,e){let n=0;for(let o=0;o<e;o++)n=n<<1|t>>o&1;return n}function uu(t){let e=new Uint16Array(16),n=0;for(let l of t)l>0&&(e[l]=e[l]+1,n++);let o=new Uint16Array(16),r=0;for(let l=1;l<=15;l++)r=r+e[l-1]<<1,o[l]=r;let i=new Uint16Array(t.length),a=new Uint8Array(t.length);return t.forEach((l,s)=>{if(l===0)return;let c=o[l];o[l]=c+1,i[s]=zf(c,l),a[s]=n===1?0:l;}),{lengths:t,codes:i,emitted:a}}function _e(t,e,n){t.write(e.codes[n],e.emitted[n]);}function Wf(t){let e=[],n=i=>e.push({code:i,extra:0,extraBits:0}),o=qf,r=0;for(;r<t.length;){let i=t[r],a=1;for(;r+a<t.length&&t[r+a]===i;)a++;r+=a;let l=a;if(i===0){for(;l>0;)if(l<3)for(;l>0;l--)n(0);else if(l<=10)e.push({code:17,extra:l-3,extraBits:3}),l=0;else {let s=Math.min(l,138);e.push({code:18,extra:s-11,extraBits:7}),l-=s;}continue}for(i!==o&&(n(i),o=i,l--);l>0;)if(l<3)for(;l>0;l--)n(i);else {let s=Math.min(l,6);e.push({code:16,extra:s-3,extraBits:2}),l-=s;}}return e}function Vf(t,e){let n=[];if(e.forEach((l,s)=>{l>0&&n.push(s);}),n.length<=2&&n.every(l=>l<256)){let[l=0,s]=n;t.write(1,1),t.write(n.length===2?1:0,1),l<2?(t.write(0,1),t.write(l,1)):(t.write(1,1),t.write(l,8)),s!==void 0&&t.write(s,8);return}let o=Wf(e),r=new Uint32Array(19);for(let l of o)r[l.code]=r[l.code]+1;let i=uu(cu(r,7)),a=Ii.length;for(;a>4&&i.lengths[Ii[a-1]]===0;)a--;t.write(0,1),t.write(a-4,4);for(let l=0;l<a;l++)t.write(i.lengths[Ii[l]],3);t.write(0,1);for(let l of o)_e(t,i,l.code),t.write(l.extra,l.extraBits);}function kr(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 ou(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 i=Math.min(4096,o-r),a=r>=1?ou(t,r,1,i):0,l=r>=e?ou(t,r,e,i):0;if(Math.max(a,l)>=3){l>=a?(n.copy(l,e===1?2:1),r+=l):(n.copy(a,2),r+=a);continue}n.literal(t[r]),r++;}}var au=20;function su(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 mu(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),i=false;for(let w=0;w<o;w++){let S=w*4,$=t[S],M=t[S+1],R=t[S+2],A=t[S+3];A!==255&&(i=true),r[w]=(A<<24|($-M&255)<<16|M<<8|R-M&255)>>>0;}let a=new Uint32Array(280),l=new Uint32Array(256),s=new Uint32Array(256),c=new Uint32Array(256),u=new Uint32Array(40);iu(r,e,{literal(w){a[w>>>8&255]++,l[w>>>16&255]++,s[w&255]++,c[w>>>24]++;},copy(w,S){a[256+kr(w).symbol]++,u[kr(S).symbol]++;}});let m=[a,l,s,c,u].map(w=>cu(w,15)),[d,p,b,f,h]=m.map(uu),g=new Fi(Math.ceil(o/4)+1024);g.write(47,8),g.write(e-1,14),g.write(n-1,14),g.write(i?1:0,1),g.write(0,3),g.write(1,1),g.write(2,2),g.write(0,1),g.write(0,1),g.write(0,1);for(let w of m)Vf(g,w);iu(r,e,{literal(w){_e(g,d,w>>>8&255),_e(g,p,w>>>16&255),_e(g,b,w&255),_e(g,f,w>>>24);},copy(w,S){let $=kr(w);_e(g,d,256+$.symbol),g.write($.extra,$.extraBits);let M=kr(S);_e(g,h,M.symbol),g.write(M.extra,M.extraBits);}});let y=g.finish(),x=y.length+(y.length&1),C=new Uint8Array(au+x);return su(C,0,"RIFF"),lu(C,4,C.length-8),su(C,8,"WEBPVP8L"),lu(C,16,y.length),C.set(y,au),C}function Li(t,e,n){return String.fromCharCode(...t.subarray(e,e+n))}function jf(t){return t.length>=12&&Li(t,0,4)==="RIFF"&&Li(t,8,4)==="WEBP"}function du(t){if(!jf(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 Zf(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 Nr(t,e={}){let n=e.quality!==void 0,o=n?Math.min(1,Math.max(0,Number(e.quality))):1,r=await Zf(t,"image/webp",o);if(r){let s=new Uint8Array(await r.arrayBuffer()),c=du(s);if(c==="lossless"||n&&c==="lossy")return new Blob([s],{type:"image/webp"})}let i=t.getContext("2d");if(!i)throw new Error("Could not get canvas context");let{data:a}=i.getImageData(0,0,t.width,t.height),l=mu(a,t.width,t.height);return new Blob([l],{type:"image/webp"})}var fu=32768;async function $t(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 ye(t){let e={...t};if(t.imageSettings?.src)try{let u=await Xf(t.imageSettings.src);e={...t,imageSettings:{...t.imageSettings,src:u}};}catch{let{imageSettings:u,...m}=t;e=m;}let{hideLogo:n,url:o,logo:r,scale:i,frameLabelMarkers:a,partMarkers:l,...s}=e,c=ru({...s,templateId:e.templateId,customTemplate:e.customTemplate});return `data:image/svg+xml,${encodeURIComponent(c)}`}var Xf=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 i=r.getContext("2d");if(!i){n(new Error("Could not get canvas context"));return}i.drawImage(o,0,0);let a=r.toDataURL("image/png");r.remove(),e(a);}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 xe(t,e,n){let o=await ye(t),r=decodeURIComponent(o.replace("data:image/svg+xml,","")),i;try{let a=new TextEncoder().encode(r),l=Array.from(a,c=>String.fromCharCode(c)).join("");i=`data:image/svg+xml;base64,${btoa(l)}`;}catch(a){throw new Error(`Failed to encode SVG for canvas conversion: ${a}`)}return new Promise((a,l)=>{let s=document.createElement("canvas"),c=s.getContext("2d");if(!c){l(new Error("Could not get canvas context"));return}let u=new Image,{width:m,height:d}=Rn(t.size||xt,t.frame);s.width=Math.round(m),s.height=Math.round(d);let p=setTimeout(()=>{s.remove(),l(new Error("SVG load timeout - image may be too large or contain invalid data"));},3e4);u.onload=()=>{clearTimeout(p);try{if(e==="image/jpeg"&&(c.fillStyle="white",c.fillRect(0,0,s.width,s.height)),c.drawImage(u,0,0,s.width,s.height),n)a(s);else if(e==="image/webp")Nr(s).then($t).then(a,l).finally(()=>s.remove());else if(e==="image/bmp")$t(or(s)).then(a,l).finally(()=>s.remove());else if(e===In)Ir(s,t.value).then($t).then(a,l).finally(()=>s.remove());else if(e===be||e==="image/x-icon")$t(Yc(s)).then(a,l).finally(()=>s.remove());else {let b=s.toDataURL(e,1);s.remove(),a(b);}}catch(b){clearTimeout(p),s.remove(),l(new Error(`Failed to draw SVG to canvas: ${b}`));}},u.onerror=()=>{clearTimeout(p),s.remove(),l(new Error("Could not load SVG"));},u.src=i;})}var hu=["gradientUnits","gradientTransform","spreadMethod"],Yf={linear:["x1","y1","x2","y2"],radial:["cx","cy","r","fx","fy","fr"]},Kf={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 Ti(t){return t.name==="linearGradient"?"linear":t.name==="radialGradient"?"radial":null}function Jf(t){let e=[],n=0;for(let o of t.children){if(o.name!=="stop")continue;let r=(o.attrs.offset??"0").trim(),i=Number.parseFloat(r),a=Number.isFinite(i)?r.endsWith("%")?i/100:i:0;n=Math.max(n,Math.min(Math.max(a,0),1));let l=pu(o,"stop-color")??"#000000",s=tt(l==="currentColor"?"#000000":l)??Kf,c=Number.parseFloat(pu(o,"stop-opacity")??"1");e.push({offset:n,color:Number.isFinite(c)?{...s,a:s.a*Math.min(Math.max(c,0),1)}:s});}return e}function bu(t){let e=new Map,n=r=>{let i=r.attrs.id;Ti(r)&&i&&!e.has(i)&&e.set(i,r);for(let a of r.children)n(a);};n(t);let o=new Map;for(let[r,i]of e){let a=Ti(i),l={},s=[],c=new Set,u=i;for(;u&&!c.has(u);){c.add(u);let m=Ti(u)===a?[...hu,...Yf[a]]:hu;for(let p of m){let b=u.attrs[p];l[p]===void 0&&b!==void 0&&(l[p]=b);}s.length===0&&(s=Jf(u));let d=u.attrs.href??u.attrs["xlink:href"];u=d?.startsWith("#")?e.get(d.slice(1)):void 0;}o.set(r,{kind:a,attrs:l,stops:s});}return o}function ki(t){let e=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,r=Number.NEGATIVE_INFINITY,i=(m,d)=>{e=Math.min(e,m),o=Math.max(o,m),n=Math.min(n,d),r=Math.max(r,d);},a=(m,d,p,b)=>{let f=-m+3*d-3*p+b,h=2*(m-2*d+p),g=d-m;if(Math.abs(f)<1e-12)return Math.abs(h)<1e-12?[]:[-g/h];let y=h*h-4*f*g;if(y<0)return [];let x=Math.sqrt(y);return [(-h+x)/(2*f),(-h-x)/(2*f)]},l=(m,d,p,b,f)=>{let h=1-m;return h*h*h*d+3*h*h*m*p+3*h*m*m*b+m**3*f},s=0,c=0,u=[0,0];for(let m of t)if(m.op==="M"&&(u=[m.x,m.y]),m.op==="M"||m.op==="L")i(m.x,m.y),s=m.x,c=m.y;else if(m.op==="C"){i(m.x,m.y);for(let d of [...a(s,m.x1,m.x2,m.x),...a(c,m.y1,m.y2,m.y)])d>0&&d<1&&i(l(d,s,m.x1,m.x2,m.x),l(d,c,m.y1,m.y2,m.y));s=m.x,c=m.y;}else [s,c]=u;return Number.isFinite(e)?{x:e,y:n,width:o-e,height:r-n}:null}var th=t=>t[0]*t[3]-t[1]*t[2];function nn(t){let e=th(t);if(!Number.isFinite(e)||Math.abs(e)<1e-12)return null;let[n,o,r,i,a,l]=t;return [i/e,-o/e,-r/e,n/e,(r*l-i*a)/e,(o*a-n*l)/e]}function _u(t,e,n){let{kind:o,attrs:r,stops:i}=t,a=i[0],l=i.at(-1);if(!(a&&l)||i.every(S=>S.color.a===0))return null;if(i.length===1)return a.color;let s=r.gradientUnits==="userSpaceOnUse",c=zn;if(!s){let S=ki(e);if(!S||S.width<=0||S.height<=0)return null;c=[S.width,0,0,S.height,S.x,S.y];}let u=pt(c,ne(r.gradientTransform));if(!nn(u))return l.color;let[m,d]=n,p=Math.sqrt((m*m+d*d)/2),b=(S,$)=>{let M=Number.parseFloat(S);return Number.isFinite(M)?S.trim().endsWith("%")?M/100*(s?$:1):M:null},f=(S,$,M)=>b(r[S]??$,M)??b($,M)??0;if(o==="linear"){let S=[f("x1","0%",m),f("y1","0%",d),f("x2","100%",m),f("y2","0%",d)],[$,M,R,A]=S;return $===R&&M===A?l.color:{kind:o,coords:S,matrix:u,stops:i}}let h=f("cx","50%",m),g=f("cy","50%",d),y=f("r","50%",p),x=r.fx===void 0?h:f("fx","50%",m),C=r.fy===void 0?g:f("fy","50%",d),w=Math.max(0,f("fr","0%",p));return y<0?null:y===0?l.color:{kind:o,coords:[x,C,w,h,g,y],matrix:u,stops:i}}function yu(t){return t.map(e=>_(e,6)).join(" ")}function eh(t,e){return (e==="cmyk"?hn(t.r,t.g,t.b):[t.r/255,t.g/255,t.b/255]).map(o=>_(o,4)).join(" ")}var gu=(t,e)=>`<< /FunctionType 2 /Domain [0 1] /C0 [${t}] /C1 [${e}] /N 1 >>`;function nh(t,e){let n=[],o=t.map(l=>U(l.offset,4)),r=t.map(l=>eh(l.color,e)),i=o[0],a=o.at(-1);if(i>0){let l=r[0];n.push({from:0,to:i,c0:l,c1:l});}for(let l=0;l+1<t.length;l++){let s=o[l],c=o[l+1];c>s&&n.push({from:s,to:c,c0:r[l],c1:r[l+1]});}if(a<1){let l=r.at(-1);n.push({from:a,to:1,c0:l,c1:l});}if(n.length===1){let[l]=n;return gu(l.c0,l.c1)}return ["<< /FunctionType 3 /Domain [0 1]",`/Functions [${n.map(l=>gu(l.c0,l.c1)).join(" ")}]`,`/Bounds [${n.slice(1).map(l=>_(l.from,4)).join(" ")}]`,`/Encode [${n.map(()=>"0 1").join(" ")}] >>`].join(" ")}function xu(t,e){return [`<< /ShadingType ${t.kind==="linear"?2:3}`,`/ColorSpace /Device${e==="cmyk"?"CMYK":"RGB"}`,`/Coords [${t.coords.map(n=>_(n,6)).join(" ")}]`,`/Function ${nh(t.stops,e)}`,"/Extend [true true] >>"].join(" ")}function rh(t,e){if(t.op==="Z")return t;if(t.op==="C"){let[r,i]=ot(e,t.x1,t.y1),[a,l]=ot(e,t.x2,t.y2),[s,c]=ot(e,t.x,t.y);return {op:"C",x1:r,y1:i,x2:a,y2:l,x:s,y:c}}let[n,o]=ot(e,t.x,t.y);return {op:t.op,x:n,y:o}}function Su(t){let e={round:1,bevel:2}[t.strokeLinejoin?.trim()??""],n={round:1,square:2}[t.strokeLinecap?.trim()??""];return {join:e??0,cap:n??0}}var $u={r:255,g:255,b:255,a:1},oh=/^url\(\s*#bg-color-/,Or=/^url\(\s*#([^)\s]+)\s*\)/,ih=new Set(["defs","clipPath","mask","pattern","linearGradient","radialGradient","symbol","title","desc","metadata","style","script","use","foreignObject"]);function et(t,e){let n=t.attrs.style;if(n)for(let o of n.split(";")){let[r,...i]=o.split(":");if(r?.trim()===e)return i.join(":").trim()}return t.attrs[e]}function Z(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 Ni(t,e){if((t.name==="linearGradient"||t.name==="radialGradient")&&t.attrs.id){let n=t.children.find(r=>r.name==="stop"),o=n&&(et(n,"stop-color")??"#000000");o&&e.set(t.attrs.id,o);}for(let n of t.children)Ni(n,e);return e}function Oi(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)Oi(n,e);return e}async function Cu(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),i=Math.min(1024/r,4);o.width=Math.round((n.naturalWidth||512)*i),o.height=Math.round((n.naturalHeight||512)*i);let a=o.getContext("2d");if(!a){e(null);return}a.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 wu(t,e){t.name==="clipPath"&&t.attrs.id&&e.set(t.attrs.id,t);for(let n of t.children)wu(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 ah(t,e){let[n,o]=e,r=(i,a)=>Z(t.attrs[i],a);switch(t.name){case "path":return re(t.attrs.d??"");case "rect":{let i=t.attrs.rx??t.attrs.ry,a=t.attrs.ry??t.attrs.rx;return De(r("x",n),r("y",o),r("width",n),r("height",o),Z(i,n),Z(a,o))}case "circle":{let i=r("r",Math.hypot(n,o)/Math.SQRT2);return mn(r("cx",n),r("cy",o),i,i)}case "ellipse":return mn(r("cx",n),r("cy",o),r("rx",n),r("ry",o));default:return []}}var Dr=class{gradients;shadings;clipPaths=new Map;patterns=new Map;backdrop=$u;paper=$u;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=Or.exec(e);if(n)return this.resolveColor(this.gradients.get(n[1]));let o=tt(e==="currentColor"?"#000000":e);return o&&o.a>0?o:null}shadedGradient(e){let n=e?Or.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 i=this.patternOf(e);if(i)return {pattern:i,alpha:r};let a=this.shadedGradient(e);if(a){let c=_u(a,n,o);if(!c)return null;if("coords"in c)return {gradient:c,alpha:r};let u={...c,a:c.a*r};return u.a>0?{color:u}:null}let l=this.resolveColor(e);if(!l)return null;let s={...l,a:l.a*r};return s.a>0?{color:s}:null}patternOf(e){let n=e?Or.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 wr(e,this.onPaper||o?this.paper:this.backdrop)}paintPattern(e,n,o,r){let i=ki(e);if(!i||i.width<=0||i.height<=0)return true;let[a,l]=n.viewport,s=Z(o.attrs.x,a),c=Z(o.attrs.y,l),u=Z(o.attrs.width,a),m=Z(o.attrs.height,l);if(!(u>0&&m>0))return true;let d=ne(o.attrs.patternTransform),p=nn(d);if(!p)return true;if(!this.beginClip(e,n.matrix,n.fillRule==="evenodd"))return false;let b=this.inConic;this.inConic=o.attrs["data-qrdx-conic"]!==void 0;try{let f=[ot(p,i.x,i.y),ot(p,i.x+i.width,i.y),ot(p,i.x,i.y+i.height),ot(p,i.x+i.width,i.y+i.height)],h=f.map(([F])=>F),g=f.map(([,F])=>F),y=Math.min(...h),x=Math.max(...h),C=Math.min(...g),w=Math.max(...g),S=Math.floor((y-s)/u),$=Math.ceil((x-s)/u)-1,M=Math.floor((C-c)/m),R=Math.ceil((w-c)/m)-1,A=($-S+1)*(R-M+1);if(A>4096)return !0;let v=(o.attrs["data-qrdx-conic"]??"").trim().split(/\s+/).map(Number),I=pt(n.matrix,d);for(let F=M;F<=R;F++)for(let k=S;k<=$;k++){let N=s+k*u,L=c+F*m,W=pt(I,[1,0,0,1,N,L]),B={x:y-N,y:C-L,width:x-y,height:w-C},D=v.length===2&&v.every(Number.isFinite)?Lc(v[0],v[1],B):null,Q=A>1&&this.beginClip([{op:"M",x:0,y:0},{op:"L",x:u,y:0},{op:"L",x:u,y:m},{op:"L",x:0,y:m},{op:"Z"}],W,!1);try{let nt={matrix:W,viewport:n.viewport,fill:"#000000",fillRule:"nonzero",stroke:"none",strokeWidth:1,fontSize:16,fontWeight:"normal",textAnchor:"start",fillOpacity:1,opacity:r},St=(yt,Ct)=>{for(let X of yt){if(X.name==="g"&&!X.attrs.transform){let j=Number.parseFloat(X.attrs.opacity??"1");St(X.children,{...Ct,opacity:(Ct.opacity??1)*(Number.isFinite(j)?j:1)});continue}if(D&&X.attrs["data-arc"]){let[j,Kt]=X.attrs["data-arc"].split(/\s+/).map(Number);if(!Tc([j,j+Kt],D))continue}this.walk(X,Ct);}};St(o.children,nt);}finally{Q&&this.endClip();}}}finally{this.inConic=b,this.endClip();}return true}paintBleed(e,n,o,r){if(!this.shadedGradient(o))return false;let[i,a]=this.viewportMatrix({...e,attrs:{...e.attrs,x:"0",y:"0"}},{...n,matrix:pt(n.matrix,ne(e.attrs.transform))}),l=nn(i);if(!l)return false;let[s,c,u,m]=r,p=[[s,c],[u,c],[u,m],[s,m]].map(([b,f])=>ot(l,b,f)).map(([b,f],h)=>({op:h===0?"M":"L",x:b,y:f}));return p.push({op:"Z"}),this.paint(p,{name:"rect",attrs:{},children:[],text:""},{...n,matrix:i,viewport:a,fill:o,fillRule:"nonzero",stroke:"none"}),true}beginClip(e,n,o){return false}endClip(){}clipOf(e,n){let o=et(e,"clip-path"),r=o?Or.exec(o)?.[1]:void 0,i=r?this.clipPaths.get(r):void 0;if(!i)return null;let a=[],l=false;for(let s of i.children){let c=ah(s,n.viewport);if(c.length===0)continue;let u=ne(s.attrs.transform),m=u[0]===1&&u[1]===0&&u[2]===0&&u[3]===1&&u[4]===0&&u[5]===0;a.push(...m?c:c.map(d=>rh(d,u))),l||=et(s,"clip-rule")==="evenodd";}return a.length>0?{segments:a,matrix:n.matrix,evenOdd:l}:null}viewportMatrix(e,n){let o=Z(e.attrs.x,n.viewport[0]),r=Z(e.attrs.y,n.viewport[1]),i=Z(e.attrs.width,n.viewport[0],n.viewport[0]),a=Z(e.attrs.height,n.viewport[1],n.viewport[1]),l=jn(e.attrs.viewBox);if(l.length!==4||!(l[2]&&l[3]))return [pt(n.matrix,[1,0,0,1,o,r]),[i,a]];let[s,c,u,m]=l,d=i/u,p=a/m,b=o,f=r;if((e.attrs.preserveAspectRatio??"").trim()!=="none"){let h=e.attrs.preserveAspectRatio?.includes("slice")?Math.max(d,p):Math.min(d,p);b+=(i-u*h)/2,f+=(a-m*h)/2,d=h,p=h;}return [pt(n.matrix,[d,0,0,p,b-s*d,f-c*p]),[u,m]]}walk(e,n,o=false){if(o&&(this.clipPaths=wu(e,new Map),this.patterns=Ru(e,new Map)),ih.has(e.name)||et(e,"display")==="none"||et(e,"visibility")==="hidden")return;let r=pt(n.matrix,ne(e.attrs.transform)),i=n.viewport;if(e.name==="svg"){let[d,p]=this.viewportMatrix(o?{...e,attrs:{...e.attrs,x:"0",y:"0"}}:e,{...n,matrix:r});r=d,i=p;}let a=et(e,"font-size"),l=Number.parseFloat(et(e,"opacity")??"1"),s=et(e,"fill-opacity"),c=s===void 0?n.fillOpacity??1:Number.parseFloat(s),u={fillOpacity:Number.isFinite(c)?Math.min(Math.max(c,0),1):1,opacity:(n.opacity??1)*(Number.isFinite(l)?Math.min(Math.max(l,0),1):1),matrix:r,viewport:i,fill:et(e,"fill")??n.fill,fillRule:et(e,"fill-rule")??n.fillRule,stroke:et(e,"stroke")??n.stroke,strokeWidth:et(e,"stroke-width")===void 0?n.strokeWidth:Z(et(e,"stroke-width"),i[0],1),strokeLinejoin:et(e,"stroke-linejoin")??n.strokeLinejoin,strokeLinecap:et(e,"stroke-linecap")??n.strokeLinecap,fontSize:a===void 0?n.fontSize:Z(a,16,16),fontWeight:et(e,"font-weight")??n.fontWeight,textAnchor:et(e,"text-anchor")??n.textAnchor},m=this.onPaper;(e.name==="rect"||e.name==="circle"||e.name==="path")&&oh.test(et(e,"fill")??"")&&(this.onPaper=true);try{let d=e.attrs["clip-path"]?this.clipOf(e,u):null;if(d&&this.beginClip(d.segments,d.matrix,d.evenOdd)){try{this.paintNode(e,u);}finally{this.endClip();}return}this.paintNode(e,u);}finally{this.onPaper=m;}}paintNode(e,n){let[o,r]=n.viewport,i=(a,l)=>Z(e.attrs[a],l);switch(e.name){case "path":this.paint(re(e.attrs.d??""),e,n);return;case "rect":{let a=e.attrs.rx??e.attrs.ry,l=e.attrs.ry??e.attrs.rx;this.paint(De(i("x",o),i("y",r),i("width",o),i("height",r),Z(a,o),Z(l,r)),e,n);return}case "circle":{let a=i("r",Math.hypot(o,r)/Math.SQRT2);this.paint(mn(i("cx",o),i("cy",r),a,a),e,n);return}case "ellipse":this.paint(mn(i("cx",o),i("cy",r),i("rx",o),i("ry",r)),e,n);return;case "line":this.paint([{op:"M",x:i("x1",o),y:i("y1",r)},{op:"L",x:i("x2",o),y:i("y2",r)}],e,{...n,fill:"none"});return;case "polygon":case "polyline":{let a=jn(e.attrs.points),l=[];for(let s=0;s+1<a.length;s+=2)l.push({op:s===0?"M":"L",x:a[s],y:a[s+1]});e.name==="polygon"&&l.length>0&&l.push({op:"Z"}),this.paint(l,e,n);return}case "text":this.text(e,n);return;case "image":this.image(e,n);return;default:for(let a of e.children)this.walk(a,n);}}};var Br=1e3;async function Di(t){let e=await ye(kn({...t,size:t.size??xt},Br));return decodeURIComponent(e.replace("data:image/svg+xml,",""))}function Bi(t){if(Zt(t.frame)){let e=Ze(Br,t.frame);return e.squareEdges?e.color:null}if(t.backdrop&&t.bgRadius){let e=dt.QrCode.encodeText(t.value,wt[fe(t)]).size,n=vt(e,t.margin??Ht,t.shape);if(Cr(t.bgRadius,e,n,t.shape)>0)return ut(t.backdrop,rt)}return ut(t.bgColor,rt)}function Gi(t,e){let n=Bi(t);if(!(n&&Ne(t.bgColor))||Zt(t.frame)||t.templateId||t.customTemplate)return n;let o=Vn(e)?.children.find(i=>i.name==="rect"),r=o&&et(o,"fill");return r?.startsWith("url(")?r:n}function Qi(t,e){let n={r:255,g:255,b:255,a:1},o=tt(ut(e.bgColor,rt));t.paper=n,t.background=o&&!Ne(e.bgColor)?o:null,t.backdrop=o?wr(o,n):n;}var Au=25.4,Mu=5,Eu=2e3,Gr=Br,sh=5,lh=2;function ch(t,e="mm"){return e==="in"?t*Au:t}function uh(t){let e=fe(t),n=dt.QrCode.encodeText(t.value,wt[e]).size;return n+vt(n,t.margin??Ht,t.shape)*2}function Pu(t,e){let n=ch(e.size,e.unit);if(!Number.isFinite(n)||n<Mu||n>Eu)throw new Error(`Print size must be between ${Mu} mm and ${Eu/1e3} m`);let o=Math.min(Math.max(e.bleed??0,0),20),r=n/Gr,i=Zt(t.frame)?Ze(Gr,t.frame):null,a=(i?.width??Gr)*r,l=(i?.height??Gr)*r,s=e.cropMarks?o+lh+sh+1:o,c=uh(t);return {codeWidth:n,trimWidth:a,trimHeight:l,bleed:o,pageWidth:a+2*s,pageHeight:l+2*s,trimX:s,trimY:s,moduleSize:n/c,moduleCount:c,maxScanDistance:n*10}}var mh=[137,80,78,71,13,10,26,10];async function Iu(t,e){let n=new Blob([t]).stream().pipeThrough(e);return new Uint8Array(await new Response(n).arrayBuffer())}async function Fu(t){return typeof CompressionStream>"u"?null:await Iu(t,new CompressionStream("deflate"))}async function dh(t){if(typeof DecompressionStream>"u")return null;try{return await Iu(t,new DecompressionStream("deflate"))}catch{return null}}var Ui=(t,e)=>t[e]*2**24+(t[e+1]<<16)+(t[e+2]<<8)+t[e+3]>>>0,vu={0:1,2:3,3:1,4:2,6:4};function fh(t,e,n){let o=t+e-n,r=Math.abs(o-t),i=Math.abs(o-e),a=Math.abs(o-n);return r<=i&&r<=a?t:i<=a?e:n}async function Lu(t){if(mh.some((f,h)=>t[h]!==f))return null;let e=8,n=0,o=0,r=-1,i=null,a=null,l=[];for(;e+8<=t.length;){let f=Ui(t,e),h=String.fromCharCode(...t.subarray(e+4,e+8)),g=t.subarray(e+8,e+8+f);if(e+=12+f,h==="IHDR"){n=Ui(g,0),o=Ui(g,4);let y=g[8];r=g[9];let x=g[12];if(y!==8||x!==0||!(r in vu))return null}else if(h==="PLTE")i=g;else if(h==="tRNS")a=g;else if(h==="IDAT")l.push(g);else if(h==="IEND")break}if(!(n&&o)||n*o>4096*4096)return null;let s=new Uint8Array(l.reduce((f,h)=>f+h.length,0)),c=0;for(let f of l)s.set(f,c),c+=f.length;let u=await dh(s),m=vu[r],d=n*m;if(!u||u.length<o*(d+1))return null;let p=new Uint8Array(o*d);for(let f=0;f<o;f++){let h=u[f*(d+1)],g=u.subarray(f*(d+1)+1,(f+1)*(d+1)),y=f*d;for(let x=0;x<d;x++){let C=x>=m?p[y+x-m]:0,w=f>0?p[y-d+x]:0,S=f>0&&x>=m?p[y-d+x-m]:0,$=g[x],M=0;h===1?M=C:h===2?M=w:h===3?M=C+w>>1:h===4&&(M=fh(C,w,S)),p[y+x]=$+M&255;}}let b=new Uint8Array(n*o*4);for(let f=0;f<n*o;f++){let h=f*4,g=f*m;if(r===3){let y=p[g];b[h]=i?.[y*3]??0,b[h+1]=i?.[y*3+1]??0,b[h+2]=i?.[y*3+2]??0,b[h+3]=a?.[y]??255;}else if(r===0||r===4){let y=p[g];b[h]=y,b[h+1]=y,b[h+2]=y,b[h+3]=r===4?p[g+1]:255;}else b[h]=p[g],b[h+1]=p[g+1],b[h+2]=p[g+2],b[h+3]=r===6?p[g+3]:255;}return {width:n,height:o,data:b}}var hh=25.4,Tu=72/hh,ph=50;function gh(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 bh(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],i=t[e+7]<<8|t[e+8],a=t[e+9];return {width:i,height:r,components:a,progressive:n===194}}e+=2+o;}return null}async function _h(t,e){let{width:n,height:o,data:r}=t,i=e?4:3,a=new Uint8Array(n*o*i);for(let s=0;s<n*o;s++){let c=r[s*4+3]/255,u=r[s*4]*c+255*(1-c),m=r[s*4+1]*c+255*(1-c),d=r[s*4+2]*c+255*(1-c);if(e){let[p,b,f,h]=hn(u,m,d);a.set([p*255,b*255,f*255,h*255].map(Math.round),s*i);}else a.set([Math.round(u),Math.round(m),Math.round(d)],s*i);}let l=await Fu(a);return {kind:"raw",width:n,height:o,components:i,bytes:l??a,compressed:!!l}}async function yh(t,e){let n=t;if(!/^data:image\/(png|jpe?g)[;,]/i.test(n)){let a=await Cu(n);if(!a)return null;n=a;}let o=gh(n);if(!o)return null;let r=bh(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 i=await Lu(o);return i?await _h(i,e):null}function xh(t){let e="",n=0,o=r=>{e+=r,n+=r.length,n>=76&&(e+=`
|
|
2
|
-
`,n=0);};for(let r=0;r<t.length;r+=4){let i=Math.min(4,t.length-r),a=0;for(let s=0;s<4;s++)a=a*256+(s<i?t[r+s]:0);if(a===0&&i===4){o("z");continue}let l=[];for(let s=0;s<5;s++)l.unshift(String.fromCharCode(a%85+33)),a=Math.floor(a/85);o(l.slice(0,i+1).join(""));}return `${e}~>`}var
|
|
1
|
+
var Le;(i=>{class t{constructor(l,s,c,u){this.version=l;this.errorCorrectionLevel=s;if(l<t.MIN_VERSION||l>t.MAX_VERSION)throw new RangeError("Version value out of range");if(u<-1||u>7)throw new RangeError("Mask value out of range");this.size=l*4+17;let m=[];for(let p=0;p<this.size;p++)m.push(false);for(let p=0;p<this.size;p++)this.modules.push(m.slice()),this.isFunction.push(m.slice());this.drawFunctionPatterns();let d=this.addEccAndInterleave(c);if(this.drawCodewords(d),u==-1){let p=1e9;for(let b=0;b<8;b++){this.applyMask(b),this.drawFormatBits(b);let f=this.getPenaltyScore();f<p&&(u=b,p=f),this.applyMask(b);}}o(0<=u&&u<=7),this.mask=u,this.applyMask(u),this.drawFormatBits(u),this.isFunction=[];}version;errorCorrectionLevel;static encodeText(l,s){let c=i.QrSegment.makeSegments(l);return t.encodeSegments(c,s)}static encodeBinary(l,s){let c=i.QrSegment.makeBytes(l);return t.encodeSegments([c],s)}static encodeSegments(l,s,c=1,u=40,m=-1,d=true){if(!(t.MIN_VERSION<=c&&c<=u&&u<=t.MAX_VERSION)||m<-1||m>7)throw new RangeError("Invalid value");let p,b;for(p=c;;p++){let y=t.getNumDataCodewords(p,s)*8,x=r.getTotalBits(l,p);if(x<=y){b=x;break}if(p>=u)throw new RangeError("Data too long")}for(let y of [t.Ecc.MEDIUM,t.Ecc.QUARTILE,t.Ecc.HIGH])d&&b<=t.getNumDataCodewords(p,y)*8&&(s=y);let f=[];for(let y of l){e(y.mode.modeBits,4,f),e(y.numChars,y.mode.numCharCountBits(p),f);for(let x of y.getData())f.push(x);}o(f.length==b);let h=t.getNumDataCodewords(p,s)*8;o(f.length<=h),e(0,Math.min(4,h-f.length),f),e(0,(8-f.length%8)%8,f),o(f.length%8==0);for(let y=236;f.length<h;y^=253)e(y,8,f);let g=[];for(;g.length*8<f.length;)g.push(0);return f.forEach((y,x)=>g[x>>>3]|=y<<7-(x&7)),new t(p,s,g,m)}size;mask;modules=[];isFunction=[];getModule(l,s){return 0<=l&&l<this.size&&0<=s&&s<this.size&&this.modules[s][l]}getModules(){return this.modules}drawFunctionPatterns(){for(let c=0;c<this.size;c++)this.setFunctionModule(6,c,c%2==0),this.setFunctionModule(c,6,c%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);let l=this.getAlignmentPatternPositions(),s=l.length;for(let c=0;c<s;c++)for(let u=0;u<s;u++)c==0&&u==0||c==0&&u==s-1||c==s-1&&u==0||this.drawAlignmentPattern(l[c],l[u]);this.drawFormatBits(0),this.drawVersion();}drawFormatBits(l){let s=this.errorCorrectionLevel.formatBits<<3|l,c=s;for(let m=0;m<10;m++)c=c<<1^(c>>>9)*1335;let u=(s<<10|c)^21522;o(u>>>15==0);for(let m=0;m<=5;m++)this.setFunctionModule(8,m,n(u,m));this.setFunctionModule(8,7,n(u,6)),this.setFunctionModule(8,8,n(u,7)),this.setFunctionModule(7,8,n(u,8));for(let m=9;m<15;m++)this.setFunctionModule(14-m,8,n(u,m));for(let m=0;m<8;m++)this.setFunctionModule(this.size-1-m,8,n(u,m));for(let m=8;m<15;m++)this.setFunctionModule(8,this.size-15+m,n(u,m));this.setFunctionModule(8,this.size-8,true);}drawVersion(){if(this.version<7)return;let l=this.version;for(let c=0;c<12;c++)l=l<<1^(l>>>11)*7973;let s=this.version<<12|l;o(s>>>18==0);for(let c=0;c<18;c++){let u=n(s,c),m=this.size-11+c%3,d=Math.floor(c/3);this.setFunctionModule(m,d,u),this.setFunctionModule(d,m,u);}}drawFinderPattern(l,s){for(let c=-4;c<=4;c++)for(let u=-4;u<=4;u++){let m=Math.max(Math.abs(u),Math.abs(c)),d=l+u,p=s+c;0<=d&&d<this.size&&0<=p&&p<this.size&&this.setFunctionModule(d,p,m!=2&&m!=4);}}drawAlignmentPattern(l,s){for(let c=-2;c<=2;c++)for(let u=-2;u<=2;u++)this.setFunctionModule(l+u,s+c,Math.max(Math.abs(u),Math.abs(c))!=1);}setFunctionModule(l,s,c){this.modules[s][l]=c,this.isFunction[s][l]=true;}addEccAndInterleave(l){let s=this.version,c=this.errorCorrectionLevel;if(l.length!=t.getNumDataCodewords(s,c))throw new RangeError("Invalid argument");let u=t.NUM_ERROR_CORRECTION_BLOCKS[c.ordinal][s],m=t.ECC_CODEWORDS_PER_BLOCK[c.ordinal][s],d=Math.floor(t.getNumRawDataModules(s)/8),p=u-d%u,b=Math.floor(d/u),f=[],h=t.reedSolomonComputeDivisor(m);for(let y=0,x=0;y<u;y++){let C=l.slice(x,x+b-m+(y<p?0:1));x+=C.length;let w=t.reedSolomonComputeRemainder(C,h);y<p&&C.push(0),f.push(C.concat(w));}let g=[];for(let y=0;y<f[0].length;y++)f.forEach((x,C)=>{(y!=b-m||C>=p)&&g.push(x[y]);});return o(g.length==d),g}drawCodewords(l){if(l.length!=Math.floor(t.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let s=0;for(let c=this.size-1;c>=1;c-=2){c==6&&(c=5);for(let u=0;u<this.size;u++)for(let m=0;m<2;m++){let d=c-m,b=(c+1&2)==0?this.size-1-u:u;!this.isFunction[b][d]&&s<l.length*8&&(this.modules[b][d]=n(l[s>>>3],7-(s&7)),s++);}}o(s==l.length*8);}applyMask(l){if(l<0||l>7)throw new RangeError("Mask value out of range");for(let s=0;s<this.size;s++)for(let c=0;c<this.size;c++){let u;switch(l){case 0:u=(c+s)%2==0;break;case 1:u=s%2==0;break;case 2:u=c%3==0;break;case 3:u=(c+s)%3==0;break;case 4:u=(Math.floor(c/3)+Math.floor(s/2))%2==0;break;case 5:u=c*s%2+c*s%3==0;break;case 6:u=(c*s%2+c*s%3)%2==0;break;case 7:u=((c+s)%2+c*s%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[s][c]&&u&&(this.modules[s][c]=!this.modules[s][c]);}}getPenaltyScore(){let l=0;for(let m=0;m<this.size;m++){let d=false,p=0,b=[0,0,0,0,0,0,0];for(let f=0;f<this.size;f++)this.modules[m][f]==d?(p++,p==5?l+=t.PENALTY_N1:p>5&&l++):(this.finderPenaltyAddHistory(p,b),d||(l+=this.finderPenaltyCountPatterns(b)*t.PENALTY_N3),d=this.modules[m][f],p=1);l+=this.finderPenaltyTerminateAndCount(d,p,b)*t.PENALTY_N3;}for(let m=0;m<this.size;m++){let d=false,p=0,b=[0,0,0,0,0,0,0];for(let f=0;f<this.size;f++)this.modules[f][m]==d?(p++,p==5?l+=t.PENALTY_N1:p>5&&l++):(this.finderPenaltyAddHistory(p,b),d||(l+=this.finderPenaltyCountPatterns(b)*t.PENALTY_N3),d=this.modules[f][m],p=1);l+=this.finderPenaltyTerminateAndCount(d,p,b)*t.PENALTY_N3;}for(let m=0;m<this.size-1;m++)for(let d=0;d<this.size-1;d++){let p=this.modules[m][d];p==this.modules[m][d+1]&&p==this.modules[m+1][d]&&p==this.modules[m+1][d+1]&&(l+=t.PENALTY_N2);}let s=0;for(let m of this.modules)s=m.reduce((d,p)=>d+(p?1:0),s);let c=this.size*this.size,u=Math.ceil(Math.abs(s*20-c*10)/c)-1;return o(0<=u&&u<=9),l+=u*t.PENALTY_N4,o(0<=l&&l<=2568888),l}getAlignmentPatternPositions(){if(this.version==1)return [];{let l=Math.floor(this.version/7)+2,s=this.version==32?26:Math.ceil((this.version*4+4)/(l*2-2))*2,c=[6];for(let u=this.size-7;c.length<l;u-=s)c.splice(1,0,u);return c}}static getNumRawDataModules(l){if(l<t.MIN_VERSION||l>t.MAX_VERSION)throw new RangeError("Version number out of range");let s=(16*l+128)*l+64;if(l>=2){let c=Math.floor(l/7)+2;s-=(25*c-10)*c-55,l>=7&&(s-=36);}return o(208<=s&&s<=29648),s}static getNumDataCodewords(l,s){return Math.floor(t.getNumRawDataModules(l)/8)-t.ECC_CODEWORDS_PER_BLOCK[s.ordinal][l]*t.NUM_ERROR_CORRECTION_BLOCKS[s.ordinal][l]}static reedSolomonComputeDivisor(l){if(l<1||l>255)throw new RangeError("Degree out of range");let s=[];for(let u=0;u<l-1;u++)s.push(0);s.push(1);let c=1;for(let u=0;u<l;u++){for(let m=0;m<s.length;m++)s[m]=t.reedSolomonMultiply(s[m],c),m+1<s.length&&(s[m]^=s[m+1]);c=t.reedSolomonMultiply(c,2);}return s}static reedSolomonComputeRemainder(l,s){let c=s.map(u=>0);for(let u of l){let m=u^c.shift();c.push(0),s.forEach((d,p)=>c[p]^=t.reedSolomonMultiply(d,m));}return c}static reedSolomonMultiply(l,s){if(l>>>8||s>>>8)throw new RangeError("Byte out of range");let c=0;for(let u=7;u>=0;u--)c=c<<1^(c>>>7)*285,c^=(s>>>u&1)*l;return o(c>>>8==0),c}finderPenaltyCountPatterns(l){let s=l[1];o(s<=this.size*3);let c=s>0&&l[2]==s&&l[3]==s*3&&l[4]==s&&l[5]==s;return (c&&l[0]>=s*4&&l[6]>=s?1:0)+(c&&l[6]>=s*4&&l[0]>=s?1:0)}finderPenaltyTerminateAndCount(l,s,c){return l&&(this.finderPenaltyAddHistory(s,c),s=0),s+=this.size,this.finderPenaltyAddHistory(s,c),this.finderPenaltyCountPatterns(c)}finderPenaltyAddHistory(l,s){s[0]==0&&(l+=this.size),s.pop(),s.unshift(l);}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]]}i.QrCode=t;function e(a,l,s){if(l<0||l>31||a>>>l)throw new RangeError("Value out of range");for(let c=l-1;c>=0;c--)s.push(a>>>c&1);}function n(a,l){return (a>>>l&1)!=0}function o(a){if(!a)throw new Error("Assertion error")}class r{constructor(l,s,c){this.mode=l;this.numChars=s;this.bitData=c;if(s<0)throw new RangeError("Invalid argument");this.bitData=c.slice();}mode;numChars;bitData;static makeBytes(l){let s=[];for(let c of l)e(c,8,s);return new r(r.Mode.BYTE,l.length,s)}static makeNumeric(l){if(!r.isNumeric(l))throw new RangeError("String contains non-numeric characters");let s=[];for(let c=0;c<l.length;){let u=Math.min(l.length-c,3);e(parseInt(l.substr(c,u),10),u*3+1,s),c+=u;}return new r(r.Mode.NUMERIC,l.length,s)}static makeAlphanumeric(l){if(!r.isAlphanumeric(l))throw new RangeError("String contains unencodable characters in alphanumeric mode");let s=[],c;for(c=0;c+2<=l.length;c+=2){let u=r.ALPHANUMERIC_CHARSET.indexOf(l.charAt(c))*45;u+=r.ALPHANUMERIC_CHARSET.indexOf(l.charAt(c+1)),e(u,11,s);}return c<l.length&&e(r.ALPHANUMERIC_CHARSET.indexOf(l.charAt(c)),6,s),new r(r.Mode.ALPHANUMERIC,l.length,s)}static makeSegments(l){return l==""?[]:r.isNumeric(l)?[r.makeNumeric(l)]:r.isAlphanumeric(l)?[r.makeAlphanumeric(l)]:[r.makeBytes(r.toUtf8ByteArray(l))]}static makeEci(l){let s=[];if(l<0)throw new RangeError("ECI assignment value out of range");if(l<128)e(l,8,s);else if(l<16384)e(2,2,s),e(l,14,s);else if(l<1e6)e(6,3,s),e(l,21,s);else throw new RangeError("ECI assignment value out of range");return new r(r.Mode.ECI,0,s)}static isNumeric(l){return r.NUMERIC_REGEX.test(l)}static isAlphanumeric(l){return r.ALPHANUMERIC_REGEX.test(l)}getData(){return this.bitData.slice()}static getTotalBits(l,s){let c=0;for(let u of l){let m=u.mode.numCharCountBits(s);if(u.numChars>=1<<m)return 1/0;c+=4+m+u.bitData.length;}return c}static toUtf8ByteArray(l){l=encodeURI(l);let s=[];for(let c=0;c<l.length;c++)l.charAt(c)!="%"?s.push(l.charCodeAt(c)):(s.push(parseInt(l.substr(c+1,2),16)),c+=2);return s}static NUMERIC_REGEX=/^[0-9]*$/;static ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/;static ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:"}i.QrSegment=r;})(Le||={});(e=>{(o=>{class n{constructor(i,a){this.ordinal=i;this.formatBits=a;}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||={});})(Le||={});(e=>{(o=>{class n{constructor(i,a){this.modeBits=i;this.numBitsCharCount=a;}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(i){return this.numBitsCharCount[Math.floor((i+7)/17)]}}o.Mode=n;})(e.QrSegment||={});})(Le||={});var Ct=Le;var Gn={L:Ct.QrCode.Ecc.LOW,M:Ct.QrCode.Ecc.MEDIUM,Q:Ct.QrCode.Ecc.QUARTILE,H:Ct.QrCode.Ecc.HIGH},$t=128,an="Q",et="#FFFFFF",Te="#000000";var zt=0;var Qn=.1;function mt(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}function Lt(t,e="#000000"){return t?typeof t=="string"?{type:"solid",color:t}:t:{type:"solid",color:e}}function ke(t){return !t||typeof t=="string"?false:t.type==="linear"||t.type==="radial"||t.type==="angular"}function da(t){return typeof t=="object"&&t!==null&&t.type==="image"}var lo=["logo","halftone"],fa={logo:["blend","badge"],halftone:["color","mono"]},co=192;var ha={x:"plus",pebble:"rounded",flower:"circle",beads:"circle",bubble:"circle",chain:"circle",petal:"leaf",drop:"rounded",squircle:"rounded"},Un={pebble:"squircle",tag:"rounded",crest:"shield",doodle:"squircle",stamp:"notch"},Hn={bevel:"square",notch:"square"};function te(t,e){return typeof e=="string"&&Object.hasOwn(t,e)?t[e]:e}var sn=24;var zn=.5,ln=1.5;var uo=.5,pa=1,ga=.07;var ba=3,mo=64,fo=8,_a=.42;var ya=.5,xa=2,$a=.1,Sa=.5,Ca=.25,ho="#e5e7eb",cn="#d1d5db",po=.3,wa=.2,Ma=.1,Ra=.4,Ea=.3,Aa="#000000";function Q(t,e=3){let n=10**e;return Math.round(t*n)/n+0}function _(t,e=3){return String(Q(t,e))}function P(t,...e){let n=t[0]??"";for(let o=0;o<e.length;o++){let r=e[o];n+=(typeof r=="number"?_(r):r)+(t[o+1]??"");}return n}var i0={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0},a0=/^[MmLlHhVvCcSsQqTtAaZz0-9.,+\-\s]*$/,go=/[+-]?(?:\d+\.?\d*|\.\d+)/y;function un(t,e=Number.POSITIVE_INFINITY){if(!a0.test(t))return null;let n=[],o=0,r=()=>{for(;o<t.length&&/[\s,]/.test(t[o]);)o++;},i=()=>{r(),go.lastIndex=o;let s=go.exec(t);if(!s)return null;let c=s[0],u=c.indexOf(".");if(u>=0&&c.length-u-1>e)return null;o=go.lastIndex;let m=Number(c);return Number.isFinite(m)?m:null},a=()=>{r();let s=t[o];return s==="0"||s==="1"?(o++,s==="1"?1:0):null},l=()=>(r(),o<t.length&&/[0-9.+-]/.test(t[o]));for(r();o<t.length;){let s=t[o],c=s.toUpperCase(),u=i0[c];if(u===void 0||n.length===0&&c!=="M")return null;if(o++,u===0){n.push({command:s,values:[]}),r();continue}let m=s,d=true;for(;d||l();){let p=[];for(let b=0;b<u;b++){let f=c==="A"&&(b===3||b===4)?a():i();if(f===null)return null;p.push(f);}n.push({command:m,values:p}),c==="M"&&(m=s==="M"?"L":"l"),d=false;}r();}return n}function Pa(t){let e=0;for(let{command:n}of t)e+=n.toUpperCase()==="A"?4:1;return e}function bo(t,e=1,n=0,o=0){let r="";for(let{command:i,values:a}of t){let l=i.toUpperCase(),s=i===l,c=s?n:0,u=s?o:0,m;switch(l){case "Z":m=[];break;case "H":m=[_(a[0]*e+c)];break;case "V":m=[_(a[0]*e+u)];break;case "A":m=[_(Math.abs(a[0])*e),_(Math.abs(a[1])*e),_(a[2]),String(a[3]),String(a[4]),_(a[5]*e+c),_(a[6]*e+u)];break;default:m=a.map((d,p)=>_(d*e+(p%2===0?c:u)));}r+=i+m.join(" ");}return r}function Ia(t,e=.25){let n=[],o=[],r=[0,0],i=[0,0],a=()=>{o.length>2&&n.push(o),o=[];};for(let l of t)if(l.op==="M")a(),r=[l.x,l.y],i=r,o.push(r);else if(l.op==="L")i=[l.x,l.y],o.push(i);else if(l.op==="C"){let s=i,c=[l.x1,l.y1],u=[l.x2,l.y2],m=[l.x,l.y],d=Math.hypot(c[0]-s[0],c[1]-s[1])+Math.hypot(u[0]-c[0],u[1]-c[1])+Math.hypot(m[0]-u[0],m[1]-u[1]),p=Math.max(2,Math.min(64,Math.ceil(Math.sqrt(d/(4*e)))));for(let b=1;b<=p;b++){let f=b/p,h=1-f;o.push([h*h*h*s[0]+3*h*h*f*c[0]+3*h*f*f*u[0]+f*f*f*m[0],h*h*h*s[1]+3*h*h*f*c[1]+3*h*f*f*u[1]+f*f*f*m[1]]);}i=m;}else a(),i=r;return a(),n}function qn(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 i=o;o=[];for(let a=0;a<i.length;a++){let l=i[a],s=i[(a+i.length-1)%i.length],c=r(l),u=r(s);c>=0?(u<0&&o.push(va(s,l,u,c)),o.push(l)):u>=0&&o.push(va(s,l,u,c));}}return o.length>2?o:[]}function va(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 Fa(t){return t.filter(e=>e.length>2).map(e=>`M${e.map(([n,o])=>`${_(n)} ${_(o)}`).join("L")}Z`).join("")}function La(t){let e=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,r=Number.NEGATIVE_INFINITY,i=(a,l)=>{e=Math.min(e,a),n=Math.min(n,l),o=Math.max(o,a),r=Math.max(r,l);};for(let a of t)a.op==="C"?(i(a.x1,a.y1),i(a.x2,a.y2),i(a.x,a.y)):a.op!=="Z"&&i(a.x,a.y);return Number.isFinite(e)?{x0:e,y0:n,x1:o,y1:r}:null}var s0={amp:"&",lt:"<",gt:">",quot:'"',apos:"'"};function Na(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 s0[n.toLowerCase()]??e})}var l0=60,_o=62,yo=47,c0=61,Ta=34,ka=39,$o=/\s*/y,u0=/[^\s/>]*/y,m0=/[^\s>]*/y,d0=/[^\s=]*/y;function Ne(t,e,n){return t.lastIndex=n,t.test(e)?t.lastIndex:n}function f0(t,e){let n=t.length,o=S=>{let $=Number.POSITIVE_INFINITY,R=-1;return M=>((M<$||R>=0&&R<M)&&($=M,R=t.indexOf(S,M)),R)},r=o("-->"),i=o("?>"),a=o("]]>"),l=o(">"),s,c=S=>{let $=t.charCodeAt(S);if($!==Ta&&$!==ka)return S+1;let R=t.indexOf(t[S],S+1);return R<0?n:R+1},u=S=>{for(let $=S;$<n&&!s?.[$];$=c($)){let R=t.charCodeAt($);if(R===_o||R===yo&&t.charCodeAt($+1)===_o)return $}s??=new Uint8Array(n);for(let $=S;$<n&&!s[$];$=c($))s[$]=1;return -1},m=-1,d=-1,p=-1,b=-1,f=S=>{let $=S+1;if($<m||$>=d){m=$,d=Ne(u0,t,$),p=-1;for(let M=d;M>$;M--){let A=t.charCodeAt(M);if((M===d||A===Ta||A===ka)&&(b=u(M),b>=0)){p=M;break}}}if(p<=$)return -1;let R=t.charCodeAt(b)===yo;return e.open(t.slice($,p),t.slice(p,b),R),b+(R?2:1)},h=-1,g=-1,y=-1,x=S=>{let $=S+2;if($<h||$>=g){h=$,g=Ne(m0,t,$);let R=Ne($o,t,g);y=g>$&&t.charCodeAt(R)===_o?R:-1;}return y},C=S=>{if(t.startsWith("<!--",S)){let $=r(S+4);if($>=0)return $+3}if(t.startsWith("<?",S)){let $=i(S+2);if($>=0)return $+2}if(t.startsWith("<![CDATA[",S)){let $=a(S+9);if($>=0)return e.cdata(t.slice(S+9,$)),$+3}if(t.startsWith("<!",S)){let $=l(S+2);if($>=0)return $+1}if(t.charCodeAt(S+1)===yo){let $=x(S);return $<0?-1:(e.close(),$+1)}return f(S)},w=0;for(;w<n;)if(t.charCodeAt(w)===l0){let S=C(w);w=S<0?w+1:S;}else {let S=t.indexOf("<",w),$=S<0?n:S;e.text(t.slice(w,$)),w=$;}}function h0(t){let e={},n=0;for(;n<t.length;){let o=Ne(d0,t,n);if(o===n){n++;continue}let r=Ne($o,t,o);if(t.charCodeAt(r)===c0){let i=Ne($o,t,r+1),a=t[i],l=a==='"'||a==="'"?t.indexOf(a,i+1):-1;if(l>=0){e[t.slice(n,o)]=Na(t.slice(i+1,l)),n=l+1;continue}}n=o;}return e}function jn(t){let e={name:"#root",attrs:{},children:[],text:""},n=[e],o=()=>n.at(-1);f0(t,{open(i,a,l){let s=h0(a),c={name:i,attrs:s,children:[],text:""};o().children.push(c),l||n.push(c);},close(){n.length>1&&n.pop();},text(i){o().text+=Na(i);},cdata(i){o().text+=i;}});let r=i=>{for(let a of i.children){if(a.name==="svg")return a;let l=r(a);if(l)return l}return null};return r(e)}var Wn=[1,0,0,1,0,0];function gt(t,e){let[n,o,r,i,a,l]=t,[s,c,u,m,d,p]=e;return [n*s+r*c,o*s+i*c,n*u+r*m,o*u+i*m,n*d+r*p+a,o*d+i*p+l]}function nt(t,e,n){return [t[0]*e+t[2]*n+t[4],t[1]*e+t[3]*n+t[5]]}function So(t){return Math.sqrt(Math.abs(t[0]*t[3]-t[1]*t[2]))}function Zn(t){return t?(t.match(/[+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?/gi)??[]).map(Number):[]}function ee(t){let e=Wn;if(!t)return e;for(let[,n,o]of t.matchAll(/(matrix|translate|scale|rotate|skewX|skewY)\s*\(([^)]*)\)/g)){let r=Zn(o),i=Wn;switch(n){case "matrix":r.length===6&&(i=r);break;case "translate":i=[1,0,0,1,r[0]??0,r[1]??0];break;case "scale":i=[r[0]??1,0,0,r[1]??r[0]??1,0,0];break;case "rotate":{let a=(r[0]??0)*Math.PI/180,l=Math.cos(a),s=Math.sin(a),[c,u]=[r[1]??0,r[2]??0];i=gt(gt([1,0,0,1,c,u],[l,s,-s,l,0,0]),[1,0,0,1,-c,-u]);break}case "skewX":i=[1,0,Math.tan((r[0]??0)*Math.PI/180),1,0,0];break;case "skewY":i=[1,Math.tan((r[0]??0)*Math.PI/180),0,1,0,0];break;}e=gt(e,i);}return e}var xo=/[+-]?(?:\d+\.?\d*|\.\d+)(?:[eE][+-]?\d+)?/y;function p0(t,e,n,o,r,i,a,l,s){if(t===l&&e===s)return [];let c=Math.abs(n),u=Math.abs(o);if(c===0||u===0)return [{op:"L",x:l,y:s}];let m=r*Math.PI/180,d=Math.cos(m),p=Math.sin(m),b=(t-l)/2,f=(e-s)/2,h=d*b+p*f,g=-p*b+d*f,y=h*h/(c*c)+g*g/(u*u);y>1&&(c*=Math.sqrt(y),u*=Math.sqrt(y));let x=c*c*u*u-c*c*g*g-u*u*h*h,C=c*c*g*g+u*u*h*h,w=(i===a?-1:1)*Math.sqrt(Math.max(0,x/C)),S=w*c*g/u,$=-w*u*h/c,R=d*S-p*$+(t+l)/2,M=p*S+d*$+(e+s)/2,A=(B,U,D,st)=>Math.atan2(B*st-U*D,B*D+U*st),v=A(1,0,(h-S)/c,(g-$)/u),I=A((h-S)/c,(g-$)/u,(-h-S)/c,(-g-$)/u);!a&&I>0?I-=2*Math.PI:a&&I<0&&(I+=2*Math.PI);let F=Math.max(1,Math.ceil(Math.abs(I)/(Math.PI/2)-1e-9)),N=I/F,k=4/3*Math.tan(N/4),L=(B,U)=>[R+c*d*B-u*p*U,M+c*p*B+u*d*U],z=[];for(let B=0;B<F;B++){let U=v+B*N,D=U+N,[st,xt]=L(Math.cos(U)-k*Math.sin(U),Math.sin(U)+k*Math.cos(U)),[ht,It]=L(Math.cos(D)+k*Math.sin(D),Math.sin(D)-k*Math.cos(D)),[ut,X]=B===F-1?[l,s]:L(Math.cos(D),Math.sin(D));z.push({op:"C",x1:st,y1:xt,x2:ht,y2:It,x:ut,y:X});}return z}function ne(t){let e=[],n=0,o=0,r=0,i=0,a=0,l="",s=null,c=null,u=()=>{for(;n<t.length&&/[\s,]/.test(t[n]);)n++;},m=()=>{u(),xo.lastIndex=n;let b=xo.exec(t);return b?(n=xo.lastIndex,Number(b[0])):null},d=()=>{u();let b=t[n];return b==="0"||b==="1"?(n++,b==="1"):null},p=b=>{let f=[];for(let h=0;h<b;h++){let g=m();if(g===null)return null;f.push(g);}return f};for(;u(),!(n>=t.length);){let b=t[n];if(/[MmLlHhVvCcSsQqTtAaZz]/.test(b))l=b,n++;else if(!l||l==="Z"||l==="z")break;let f=l===l.toLowerCase(),h=f?o:0,g=f?r:0,y=l.toUpperCase();if(y==="Z"){e.push({op:"Z"}),o=i,r=a,s=null,c=null;continue}if(y==="A"){let S=p(3),$=d(),R=d(),M=p(2);if(!(S&&M)||$===null||R===null)break;let[A,v,I]=S,F=M[0]+h,N=M[1]+g;e.push(...p0(o,r,A,v,I,$,R,F,N)),o=F,r=N,s=null,c=null;continue}let x={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2}[y]??0,C=p(x);if(!C)break;let w=C;switch(y){case "M":o=w[0]+h,r=w[1]+g,i=o,a=r,e.push({op:"M",x:o,y:r}),l=f?"l":"L",s=null,c=null;break;case "L":case "H":case "V":y!=="V"&&(o=w[0]+h),y==="V"?r=w[0]+g:y==="L"&&(r=w[1]+g),e.push({op:"L",x:o,y:r}),s=null,c=null;break;case "C":case "S":{let S,$;y==="C"?(S=[w[0]+h,w[1]+g],$=w.slice(2)):(S=s?[2*o-s[0],2*r-s[1]]:[o,r],$=w);let R=[$[0]+h,$[1]+g],M=[$[2]+h,$[3]+g];e.push({op:"C",x1:S[0],y1:S[1],x2:R[0],y2:R[1],x:M[0],y:M[1]}),[o,r]=M,s=R,c=null;break}case "Q":case "T":{let S,$;y==="Q"?(S=[w[0]+h,w[1]+g],$=[w[2]+h,w[3]+g]):(S=c?[2*o-c[0],2*r-c[1]]:[o,r],$=[w[0]+h,w[1]+g]),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]=$,c=S,s=null;break}}}return e}var Vn=.5522847498;function mn(t,e,n,o){if(n<=0||o<=0)return [];let r=n*Vn,i=o*Vn;return [{op:"M",x:t+n,y:e},{op:"C",x1:t+n,y1:e+i,x2:t+r,y2:e+o,x:t,y:e+o},{op:"C",x1:t-r,y1:e+o,x2:t-n,y2:e+i,x:t-n,y:e},{op:"C",x1:t-n,y1:e-i,x2:t-r,y2:e-o,x:t,y:e-o},{op:"C",x1:t+r,y1:e-o,x2:t+n,y2:e-i,x:t+n,y:e},{op:"Z"}]}function Oe(t,e,n,o,r=0,i=0){if(n<=0||o<=0)return [];let a=Math.min(Math.max(r,0),n/2),l=Math.min(Math.max(i,0),o/2);if(a===0||l===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=a*Vn,c=l*Vn,u=t+n,m=e+o;return [{op:"M",x:t+a,y:e},{op:"L",x:u-a,y:e},{op:"C",x1:u-a+s,y1:e,x2:u,y2:e+l-c,x:u,y:e+l},{op:"L",x:u,y:m-l},{op:"C",x1:u,y1:m-l+c,x2:u-a+s,y2:m,x:u-a,y:m},{op:"L",x:t+a,y:m},{op:"C",x1:t+a-s,y1:m,x2:t,y2:m-l+c,x:t,y:m-l},{op:"L",x:t,y:e+l},{op:"C",x1:t,y1:e+l-c,x2:t+a-s,y2:e,x:t+a,y:e},{op:"Z"}]}var Da="qrdx.frame",Ba=1,Ga="custom",rt={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:sn},Qa=["wifi","star","heart","phone","headphones","calendar","user","chat","bag","bell","cup","card","check","info","home","pin","share","download","clock","snowflake","pumpkin","tree","sparkle","gift"],Xn=.95,g0=200,Ua=["frame","text","accent","background"],b0=/[\t\n\v\f\r\u0085\u2028\u2029]/g,_0=/[\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=sn){let n=t.slice(0,1e3).normalize("NFC").replace(b0," ").replace(_0,"").replace(/\s+/g," ").trim();return Array.from(n).slice(0,Math.max(0,e)).join("").trim()}var Yn=t=>Math.abs(t*1e3-Math.round(t*1e3))<1e-6;function wo(t){let e=Kn(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 y0(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 Kn(t){return t.qr.padding??t.qr.size*rt.defaultPadding}var Mo=.52,x0=.35;function $0(t){let e=t.fontSize??t.box.height*Mo;return Math.min(e*ln,t.box.height*Xn)}var Co=(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 Oa(t){let e=wo(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[i,a,l]of o)for(let s=0;s<=8;s++){let c=l+Math.PI/2*(s/8);r.push([i+n*Math.cos(c),a+n*Math.sin(c)]);}return r}function S0([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 i=Math.min(o,n.width/2,n.height/2),a=Math.min(Math.max(t,n.x+i),n.x+n.width-i),l=Math.min(Math.max(e,n.y+i),n.y+n.height-i);return Math.hypot(t-a,e-l)<=i+.01}function C0(t){let e=0;return t.forEach(([n,o],r)=>{let[i,a]=t[(r+1)%t.length];e+=n*a-i*o;}),Math.abs(e)/2}function w0(t,e,n){let o=wo(e);if(!Co(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 !Oa(e).every(i=>S0(i,r,r.radius??0))}if(t.type==="circle"&&t.hole){let r=t.hole;return !Oa(e).every(([i,a])=>Math.hypot(i-t.cx,a-t.cy)<=r+.01)}if(t.type==="polygon"){let r=qn(t.points,o);return r.length>2&&C0(r)>1e-6}return true}function Ro(t){let e=M0(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:i,x1:a,y1:l}=e.bounds;return {bounds:{x0:r-o,y0:i-o,x1:a+o,y1:l+o},segments:e.segments*2}}function M0(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=un(t.d,rt.maxDecimals);return e?{bounds:La(ne(t.d)),segments:Pa(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:g0}}}function Ha(t,e){let n=rt,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:i}=t.artboard,a=Math.max(r,i)*.005,l={x0:-a,y0:-a,x1:r+a,y1:i+a},s=g=>g.x0>=l.x0&&g.y0>=l.y0&&g.x1<=l.x1&&g.y1<=l.y1,{qr:c}=t,u=Kn(t);c.plate!=="none"&&u<c.size*n.minPadding-1e-9&&e(`qr.padding must be at least ${n.minPadding*100}% of qr.size`,["qr","padding"]),c.size<Math.min(r,i)*n.minQrShare-1e-9&&e(`qr.size must be at least ${n.minQrShare*100}% of the artboard's shorter side`,["qr","size"]);let m=wo(t);(m.x0<-1e-9||m.y0<-1e-9||m.x1>r+1e-9||m.y1>i+1e-9)&&e("The code and its padding must sit inside the artboard",["qr"]),(c.radius??0)>(c.size+2*u)/2&&e("qr.radius is larger than half the plate",["qr","radius"]);let d=0,p=0;t.shapes.forEach((g,y)=>{let x=["shapes",y],{bounds:C,segments:w}=Ro(g);if(!C){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",[...x,"d"]);return}if(s(C)||e("The shape extends outside the artboard",x),g.type==="rect"&&g.hole){let{hole:S}=g;(S.x<g.x||S.y<g.y||S.x+S.width>g.x+g.width+1e-9||S.y+S.height>g.y+g.height+1e-9)&&e("The hole must sit inside its rect",[...x,"hole"]);}g.type==="circle"&&g.hole&&g.hole>=g.r&&e("The hole must be smaller than the circle",[...x,"hole"]),"stroke"in g&&g.stroke&&g.stroke.width>Math.min(r,i)*.1+1e-9&&e("A stroke may be at most 10% of the artboard's shorter side",[...x,"stroke","width"]),c.plate==="background"&&w0(g,t,C)&&e('With qr.plate "background", only background fills (or a ring whose hole holds the plate) may lie under the plate',x),d+=w,typeof g.fill=="object"&&"gradient"in g.fill&&(p+=(g.fill.gradient.steps??32)*w);}),d>n.maxSegments&&e(`The shapes have ${d} segments; the limit is ${n.maxSegments}`,["shapes"]),p>n.maxGradientWork&&e("Gradient fills are too detailed (fewer steps or simpler shapes)",["shapes"]);let b=[],f=new Set,h=new Set;t.labels.forEach((g,y)=>{let x=["labels",y];f.has(g.id)&&e(`Label id "${g.id}" is used twice`,[...x,"id"]),f.add(g.id),g.slot!=="fixed"&&(h.has(g.slot)&&e(`Only one label may use the ${g.slot} slot`,[...x,"slot"]),h.add(g.slot));let C=g.maxLength??n.maxTextLength;g.text!==dn(g.text,C)&&e(`Label text must be at most ${C} characters, trimmed, with no control or invisible characters (see sanitizeFrameText)`,[...x,"text"]);let w;if(g.type==="text"){w={x0:g.box.x,y0:g.box.y,x1:g.box.x+g.box.width,y1:g.box.y+g.box.height},g.fontSize!==void 0&&g.fontSize>g.box.height*Xn+1e-9&&e("fontSize may be at most 95% of the label's row height",[...x,"fontSize"]);let S=g.box.y+g.box.height/2,$=$0(g)*x0,R={x0:w.x0,x1:w.x1,y0:S-$,y1:S+$};(Co(w,y0(t))||Co(R,m))&&e("The label overlaps the code or its padding",[...x,"box"]);}else {let{cx:S,cy:$,radius:R}=g.curve,M=g.fontSize*ln*.6;w={x0:S-R-M,y0:$-R-M,x1:S+R+M,y1:$+R+M};let A=Math.hypot(Math.max(m.x0-S,0,S-m.x1),Math.max(m.y0-$,0,$-m.y1));Math.hypot(Math.max(Math.abs(m.x0-S),Math.abs(m.x1-S)),Math.max(Math.abs(m.y0-$),Math.abs(m.y1-$)))<=R-M||A>=R+M||e("The curved label crosses the code or its padding",[...x,"curve"]);}if(s(w)||e("The label extends outside the artboard",x),g.collapse){let S=g.collapse,$=S.y+S.height;(S.y<-1e-9||$>i+1e-9)&&e("The collapse band must sit inside the artboard",[...x,"collapse"]),$>m.y0+1e-6&&S.y<m.y1-1e-6&&e("The collapse band crosses the code or its padding",[...x,"collapse"]);for(let R of b)$>R.y+1e-6&&S.y<R.y+R.height-1e-6&&e("Collapse bands may not overlap",[...x,"collapse"]);b.push(S);}});}var bt=t=>t/255,fn=(t,e)=>(t[0]-e[0])**2+(t[1]-e[1])**2+(t[2]-e[2])**2,q=t=>.2126*t[0]+.7152*t[1]+.0722*t[2];function R0(t){let{width:e,height:n,data:o}=t,r=[0,e-1,(n-1)*e,n*e-1].map(a=>{let l=a*4;return {color:[bt(o[l]),bt(o[l+1]),bt(o[l+2])],alpha:o[l+3]/255}});if(r.some(a=>a.alpha<.9))return null;let i=r[0].color;return r.every(({color:a})=>fn(a,i)<.006)?i:null}function E0(t){let{width:e,height:n,data:o}=t,r=R0(t),i=new Float32Array(e*n);for(let a=0;a<i.length;a++){let l=a*4,s=o[l+3]/255;if(r&&s>0){let c=Math.sqrt(fn([bt(o[l]),bt(o[l+1]),bt(o[l+2])],r));s*=Math.min(1,Math.max(0,(c-.06)/.1));}i[a]=s;}return i}var A0=8,P0=.14,za=.006;function v0(t,e){let{width:n,height:o,data:r}=t,i=new Float64Array(4096),a=new Float64Array(4096*3),l=0;for(let p=0;p<e.length;p++){if(e[p]<.9)continue;let b=p*4,f=Math.floor(r[b]/16)*256+Math.floor(r[b+1]/16)*16+Math.floor(r[b+2]/16);i[f]+=1,a[f*3]+=bt(r[b]),a[f*3+1]+=bt(r[b+1]),a[f*3+2]+=bt(r[b+2]),l++;}if(l===0)return {palette:[],error:0};let s=[...i.keys()].filter(p=>i[p]>0).sort((p,b)=>i[b]-i[p]),c=[];for(let p of s){if(i[p]/l<za/2||c.length>=A0)break;let b=[a[p*3]/i[p],a[p*3+1]/i[p],a[p*3+2]/i[p]];c.every(f=>fn(f,b)>=P0**2)&&c.push(b);}let u=[],m=0;for(let p=0;p<3;p++){u=c.map(()=>({n:0,r:0,g:0,b:0,x:0,y:0})),m=0;for(let b=0;b<e.length;b++){if(e[b]<.9)continue;let f=b*4,h=[bt(r[f]),bt(r[f+1]),bt(r[f+2])],g=0,y=Number.POSITIVE_INFINITY;for(let[C,w]of c.entries()){let S=fn(h,w);S<y&&(y=S,g=C);}let x=u[g];x.n++,x.r+=h[0],x.g+=h[1],x.b+=h[2],x.x+=b%n,x.y+=Math.floor(b/n),m+=Math.sqrt(y);}for(let[b,f]of u.entries())f.n>0&&(c[b]=[f.r/f.n,f.g/f.n,f.b/f.n]);}return {palette:c.map((p,b)=>({color:p,area:u[b].n/l,cx:u[b].n?u[b].x/u[b].n+.5:n/2,cy:u[b].n?u[b].y/u[b].n+.5:o/2})).filter(p=>p.area>=za).sort((p,b)=>b.area-p.area),error:m/l}}function I0(t,e,n){let o=e+2,r=n+2,i=(m,d)=>m<=0||d<=0||m>e||d>n?0:t[(d-1)*e+(m-1)],a=new Map,l=new Map,s=m=>{let d=l.get(m);if(d)return d;let p=Math.floor(m/2),b=p%o,f=Math.floor(p/o),h=i(b,f),g=m%2===1,y=g?i(b,f+1):i(b+1,f),x=h===y?.5:Math.min(1,Math.max(0,(.5-h)/(y-h))),C=g?[b-.5,f-.5+x]:[b-.5+x,f-.5];return l.set(m,C),C},c=(m,d)=>{a.set(m,d);};for(let m=0;m<r-1;m++)for(let d=0;d<o-1;d++){let p=i(d,m)>=.5,b=i(d+1,m)>=.5,f=i(d+1,m+1)>=.5,h=i(d,m+1)>=.5,g=2*(m*o+d),y=2*((m+1)*o+d),x=2*(m*o+d)+1,C=2*(m*o+d+1)+1;switch((p?8:0)+(b?4:0)+(f?2:0)+(h?1:0)){case 1:c(y,x);break;case 2:c(C,y);break;case 3:c(C,x);break;case 4:c(g,C);break;case 5:{(i(d,m)+i(d+1,m)+i(d+1,m+1)+i(d,m+1))/4>=.5?(c(g,x),c(y,C)):(c(g,C),c(y,x));break}case 6:c(g,y);break;case 7:c(g,x);break;case 8:c(x,g);break;case 9:c(y,g);break;case 10:{(i(d,m)+i(d+1,m)+i(d+1,m+1)+i(d,m+1))/4>=.5?(c(x,y),c(C,g)):(c(x,g),c(C,y));break}case 11:c(C,g);break;case 12:c(x,C);break;case 13:c(y,C);break;case 14:c(x,y);break;}}let u=[];for(let m of a.keys()){if(!a.has(m))continue;let d=[],p=m;for(;p!==void 0&&a.has(p);){d.push(s(p));let b=a.get(p);a.delete(p),p=b;}d.length>=3&&u.push(d);}return u}function F0(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 qa(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,i]=o.pop(),a=t[r],l=t[i],s=l[0]-a[0],c=l[1]-a[1],u=Math.hypot(s,c)||1,m=-1,d=e;for(let p=r+1;p<i;p++){let b=t[p],f=Math.abs(c*(b[0]-a[0])-s*(b[1]-a[1]))/u;f>d&&(d=f,m=p);}m>=0&&(n[m]=1,o.push([r,m],[m,i]));}return t.filter((r,i)=>n[i]===1)}function L0(t,e){let n=0,o=-1;for(let[a,l]of t.entries()){let s=(l[0]-t[0][0])**2+(l[1]-t[0][1])**2;s>o&&(o=s,n=a);}let r=qa(t.slice(0,n+1),e),i=qa([...t.slice(n),t[0]],e);return [...r.slice(0,-1),...i.slice(0,-1)]}var qt=t=>Q(t,2);function T0(t,e){let n=t.length,o=(i,a)=>{let l=Math.hypot(a[0]-i[0],a[1]-i[1])||1,s=Math.min(.5,e/l);return [i[0]+(a[0]-i[0])*s,i[1]+(a[1]-i[1])*s]},r="";for(let i=0;i<n;i++){let a=t[i],l=o(a,t[(i-1+n)%n]),s=o(a,t[(i+1)%n]);r+=i===0?`M${qt(l[0])} ${qt(l[1])}`:`L${qt(l[0])} ${qt(l[1])}`,r+=`Q${qt(a[0])} ${qt(a[1])} ${qt(s[0])} ${qt(s[1])}`;}return `${r}Z`}function k0(t,e,n){let o="";for(let r of I0(t,e,n)){if(Math.abs(F0(r))<.8)continue;let i=L0(r,.18);i.length>=3&&(o+=T0(i,.9));}return o}var N0=.075;function Wa(t){let{width:e,height:n,data:o}=t,r=E0(t),i=0;for(let f of r)i+=f;let{palette:a,error:l}=v0(t,r),s={width:e,height:n,palette:a,alpha:r,coverage:i/(e*n)};if(a.length===0||l>N0)return {...s,layers:[],photographic:a.length>0};let c=a.length,u=Array.from({length:c},()=>new Float32Array(e*n)),m=a.map(f=>f.color);for(let f=0;f<r.length;f++){let h=r[f];if(h<=0)continue;let g=f*4,y=[bt(o[g]),bt(o[g+1]),bt(o[g+2])],x=0,C=-1,w=Number.POSITIVE_INFINITY,S=Number.POSITIVE_INFINITY;for(let v=0;v<c;v++){let I=fn(y,m[v]);I<w?(C=x,S=w,x=v,w=I):I<S&&(C=v,S=I);}if(C<0||w<1e-6){u[x][f]=h;continue}let $=m[x],R=m[C],M=[R[0]-$[0],R[1]-$[1],R[2]-$[2]],A=Math.min(1,Math.max(0,((y[0]-$[0])*M[0]+(y[1]-$[1])*M[1]+(y[2]-$[2])*M[2])/(M[0]**2+M[1]**2+M[2]**2)));u[x][f]=h*(1-A),u[C][f]=h*A;}let d=[],p=new Float32Array(e*n),b=new Array(c);for(let f=c-1;f>=0;f--){let h=u[f];for(let g=0;g<p.length;g++)p[g]+=h[g];b[f]=p.slice();}for(let f=0;f<c;f++){let h=k0(b[f],e,n);h&&d.push({color:m[f],d:h});}return {...s,layers:d,photographic:false}}var{QrCode:Eo}=Ct,O0={"1L":3,"1M":2,"1Q":1,"1H":1,"2L":2,"3L":1};function D0(t){let e=t*4+17,n=new Uint8Array(e*e),o=(a,l)=>{a>=0&&l>=0&&a<e&&l<e&&(n[l*e+a]=1);};for(let a=0;a<e;a++)o(6,a),o(a,6);for(let[a,l]of [[3,3],[e-4,3],[3,e-4]])for(let s=-4;s<=4;s++)for(let c=-4;c<=4;c++)o(a+c,l+s);let r=[];if(t>1){let a=Math.floor(t/7)+2,l=t===32?26:Math.ceil((t*4+4)/(a*2-2))*2;r.push(6);for(let s=e-7;r.length<a;s-=l)r.splice(1,0,s);}let i=r.length-1;for(let[a,l]of r.entries())for(let[s,c]of r.entries())if(!(a===0&&s===0||a===0&&s===i||a===i&&s===0))for(let u=-2;u<=2;u++)for(let m=-2;m<=2;m++)o(l+m,c+u);for(let a=0;a<=8;a++)o(8,a),o(a,8);for(let a=0;a<8;a++)o(e-1-a,8),o(8,e-1-a);if(t>=7)for(let a=0;a<18;a++){let l=e-11+a%3,s=Math.floor(a/3);o(l,s),o(s,l);}return n}function B0(t,e){let n=t*4+17,o=Gn[e].ordinal,r=Eo.NUM_ERROR_CORRECTION_BLOCKS[o]?.[t]??0,i=Eo.ECC_CODEWORDS_PER_BLOCK[o]?.[t]??0,a=Math.floor(Eo.getNumRawDataModules(t)/8),l=r-a%r,s=Math.floor(a/r),c=Array.from({length:r},(C,w)=>s+(w<l?0:1)),u=[],m=[],d=s-i;for(let C=0;C<=s;C++)for(let w=0;w<r;w++)if(w<l){if(C===d)continue;u.push(w),m.push(C<d?C:C-1);}else u.push(w),m.push(C);if(u.length!==a)throw new Error(`Codeword map: interleave mismatch at version ${t}`);let p=D0(t),b=new Int16Array(n*n).fill(-1),f=new Int16Array(n*n).fill(-1),h=new Int8Array(n*n).fill(-1),g=a*8,y=0;for(let C=n-1;C>=1;C-=2){C===6&&(C=5);let w=(C+1&2)===0;for(let S=0;S<n;S++)for(let $=0;$<2;$++){let R=C-$,A=(w?n-1-S:S)*n+R;if(!p[A]&&y<g){let v=y>>>3;b[A]=u[v],f[A]=m[v],h[A]=7-(y&7),y++;}}}if(y!==g)throw new Error(`Codeword map: placement mismatch at version ${t}`);let x=O0[`${t}${e}`]??0;return {version:t,level:e,size:n,blocks:r,eccPerBlock:i,blockLengths:c,correctable:Math.floor((i-x)/2),block:b,codeword:f,bit:h}}var G0=8,re=new Map;function Jn(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=re.get(n);if(o)return re.delete(n),re.set(n,o),o;let r=B0(t,e);if(re.size>=G0){let i=re.keys().next().value;i!==void 0&&re.delete(i);}return re.set(n,r),r}function tr(t,e){let n=new Array(t.blocks).fill(0),o=new Set;for(let r of e){let i=t.block[r]??-1;if(i<0)continue;let a=i*4096+t.codeword[r];o.has(a)||(o.add(a),n[i]=n[i]+1);}return n}var Q0={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"778899",lightslategrey:"778899",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"ff0000",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32"},U0=Object.fromEntries(Object.entries(Q0).map(([t,e])=>[t,[Number.parseInt(e.slice(0,2),16),Number.parseInt(e.slice(2,4),16),Number.parseInt(e.slice(4,6),16)]]));function Va(t,e){let n=t.trim(),o=Number.parseFloat(n);return Number.isNaN(o)?Number.NaN:n.endsWith("%")?o/100*e:o}function J(t){if(!t)return null;let e=t.trim().toLowerCase();if(e==="transparent")return {r:0,g:0,b:0,a:0};let n=U0[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(i=>i+i).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,i]=o[1].split("/"),a=r.split(/[\s,]+/).filter(Boolean);if(a.length!==(i===void 0&&a.length===4?4:3))return null;let l=i??a[3],[s,c,u]=a.slice(0,3).map(p=>Va(p,255)),m=l===void 0?1:Va(l,1);if([s,c,u,m].some(p=>Number.isNaN(p)))return null;let d=(p,b)=>Math.min(Math.max(p,0),b);return {r:d(s,255),g:d(c,255),b:d(u,255),a:d(m,1)}}return null}function hn(t,e,n){let o=t/255,r=e/255,i=n/255,a=1-Math.max(o,r,i);return a>=1?[0,0,0,1]:[Q((1-o-a)/(1-a)),Q((1-r-a)/(1-a)),Q((1-i-a)/(1-a)),Q(a)]}function Nt(t){return t.children}var H0=t=>t==null?null:`${t}`;function Ao(t,e,n){let o=e??{},r=n;if("key"in o){let{key:i,...a}=o;i!==void 0&&(r=i),o=a;}return {type:t,props:o,key:H0(r)}}function z0(t,e){let n=t;return {type:n.type,props:{...n.props,...e},key:n.key??null}}function q0(t,e,...n){let o={...e};return n.length>0&&(o.children=n.length===1?n[0]:n),Ao(t,o)}var W0={jsx:Ao,jsxs:Ao,createElement:q0,cloneElement:z0,Fragment:Nt},pn=W0;var Po=t=>t===Nt?pn.Fragment:t;function E(t,e,n){return pn.jsx(Po(t),e,n)}function ct(t,e,n){return pn.jsxs(Po(t),e,n)}function vo(t,e,...n){return pn.createElement(Po(t),e??null,...n)}function De(t,e){return pn.cloneElement(t,e)}var V0=new Set([Symbol.for("react.element"),Symbol.for("react.transitional.element")]),ja=Symbol.for("react.fragment");function er(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===ja)&&typeof e.props=="object"&&e.props!==null}var nr=t=>t===Nt||t===ja;var j0=.6;var Be=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 i=this.entries.keys().next().value;i!==void 0&&this.entries.delete(i);}return this.entries.set(e,r),r}},Z0=new Be(8);function X0(t){return Z0.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 Lo(t){let{width:e,height:n,data:o}=t;if(!(Number.isInteger(e)&&Number.isInteger(n))||e<1||n<1||e>co||n>co||typeof o!="string")return null;try{let r=X0(o);return r.length===e*n*4?{width:e,height:n,data:r}:null}catch{return null}}function ts(t){return !!(t&&lo.includes(t.mode)&&t.image&&Lo(t.image))}function To(t){let e=fa[t.mode];return t.variant&&e.includes(t.variant)?t.variant:e[0]}function Y0(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 i=e-7;r.length<n;i-=o)r.splice(1,0,i);return r}function gn(t,e){let n=Y0(t,e),o=n.length-1,r=[];for(let[i,a]of n.entries())for(let[l,s]of n.entries())i===0&&l===0||i===0&&l===o||i===o&&l===0||r.push([a,s]);return r}var wt=1,At=2,Wt=3,Za=4,Xa=new Map;function K0(t){let e=Xa.get(t);if(e)return e;let n=t*4+17,o=new Uint8Array(n*n),r=(i,a,l,s,c)=>{for(let u=Math.max(0,a);u<Math.min(n,a+s);u++)for(let m=Math.max(0,i);m<Math.min(n,i+l);m++)o[u*n+m]=c;};r(6,0,1,n,Za),r(0,6,n,1,Za),r(0,8,9,1,Wt),r(8,0,1,9,Wt),r(n-8,8,8,1,Wt),r(8,n-8,1,8,Wt),t>=7&&(r(n-11,0,3,6,Wt),r(0,n-11,6,3,Wt));for(let[i,a]of gn(t,n))r(i-2,a-2,5,5,At);return r(0,0,8,8,wt),r(n-8,0,8,8,wt),r(0,n-8,8,8,wt),Xa.set(t,o),o}function J0(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 or(t,e){let n=J(t);return !n||n.a===0?e:[n.r/255,n.g/255,n.b/255]}var ie=(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 Vt(t,e,n,o){let r=q(t);if(o?r<=n:r>=n)return t;let i=q(e);return Math.abs(r-i)<1e-6?e:ie(t,e,Math.min(1,Math.max(0,(r-n)/(r-i))))}var es=t=>Math.max(...t)-Math.min(...t),tm=(t,e)=>(t[0]-e[0])**2+(t[1]-e[1])**2+(t[2]-e[2])**2,Io=t=>t.toString(16).padStart(2,"0");function _t(t,e=1){let n=o=>Math.min(255,Math.round(Math.round(Math.min(Math.max(o,0),1)*255)/e)*e);return `#${Io(n(t[0]))}${Io(n(t[1]))}${Io(n(t[2]))}`}function em(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 ko=.3,Ya=t=>1-Math.exp(-((t/2)**2)/(2*ko**2)),nm=t=>em(t/(2*ko*Math.SQRT2))**2,rm=(t,e,n)=>{let o=Math.min(1,Math.max(0,(n-t)/(e-t)));return o*o*(3-2*o)};function No(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 ns(t,e){let{width:n,height:o,data:r}=t,i=new Float32Array(n*o*3),a=e??new Float32Array(n*o);for(let l=0;l<n*o;l++)i[l*3]=r[l*4]/255,i[l*3+1]=r[l*4+1]/255,i[l*3+2]=r[l*4+2]/255,e||(a[l]=r[l*4+3]/255);return {width:n,height:o,rgb:i,alpha:a}}function om(t){let e=ns(t),{rgb:n,alpha:o}=e,r=new Float64Array(256),i=0;for(let m=0;m<o.length;m++){if(o[m]<.5)continue;let d=q([n[m*3],n[m*3+1],n[m*3+2]]);r[Math.min(255,Math.floor(d*256))]+=1,i++;}let a=m=>{let d=0;for(let p=0;p<256;p++)if(d+=r[p],d>=m*i)return p/255;return 1},l=i?a(.01):0,s=i?a(.99):1;s-l<.15&&(l=0,s=1);let c=Math.min(1.6,1/(s-l)),u=(l+s)/2;for(let m=0;m<o.length;m++){let d=[n[m*3],n[m*3+1],n[m*3+2]],p=q(d),b=.5+(p-u)*c;for(let f=0;f<3;f++)n[m*3+f]=Math.min(1,Math.max(0,b+(d[f]-p)*1.12));}return e}function rs(t,e,n,o,r=1){let{width:i,height:a,rgb:l,alpha:s}=t,c=Math.min(Math.max(e-.5,0),i-1),u=Math.min(Math.max(n-.5,0),a-1),m=Math.floor(c),d=Math.floor(u),p=Math.min(m+1,i-1),b=Math.min(d+1,a-1),f=c-m,h=u-d,g=0,y=0,x=0,C=0,w=($,R,M)=>{let A=R*i+$,v=s[A]*M;g+=l[A*3]*v,y+=l[A*3+1]*v,x+=l[A*3+2]*v,C+=v;};if(w(m,d,(1-f)*(1-h)),w(p,d,f*(1-h)),w(m,b,(1-f)*h),w(p,b,f*h),C<=0)return o;let S=C*r;return [o[0]+(g/C-o[0])*S,o[1]+(y/C-o[1])*S,o[2]+(x/C-o[2])*S]}var im=new Be(4),am=new Be(6),sm=new Be(6);function Oo(t,e){return am.get(t.image.data,()=>Wa(e))}function os(t,e,n){return sm.get(t.image.data,()=>ns(e,n.alpha))}var ot=t=>Q(t,2),is=t=>Q(t,4),ae=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,lm(n,o,r));}toElements(e){return [...this.groups].map(([n,o],r)=>E("path",{d:o.join(""),fill:n},`${e}-${r}`))}};function lm(t,e,n){let o=ot(n*2),r=ot(n);return `M${ot(t-n)} ${ot(e)}a${r} ${r} 0 1 0 ${o} 0a${r} ${r} 0 1 0 ${-o} 0z`}function oe(t,e,n,o,r){let i=Math.min(r,n/2,o/2);if(i<=0)return `M${ot(t)} ${ot(e)}h${ot(n)}v${ot(o)}h${ot(-n)}z`;let a=ot(i);return `M${ot(t+i)} ${ot(e)}h${ot(n-2*i)}a${a} ${a} 0 0 1 ${a} ${a}v${ot(o-2*i)}a${a} ${a} 0 0 1 ${-a} ${a}h${ot(-(n-2*i))}a${a} ${a} 0 0 1 ${-a} ${-a}v${ot(-(o-2*i))}a${a} ${a} 0 0 1 ${a} ${-a}z`}function as(t,e,n){let o="";for(let[r,i]of t){let a=(r-2+e)*n,l=(i-2+e)*n;o+=oe(a,l,5*n,5*n,n*.35),o+=oe(a+n,l+n,3*n,3*n,n*.15),o+=oe(a+2*n,l+2*n,n,n,n*.12);}return o}var cm={blend:1,badge:1,color:.9,mono:.7},um=.35;function ss(t,e,n){let o=Math.min(Math.max(t.intensity??j0,0),cm[To(t)]);return q(n)-q(e)>=um?o:0}function mm(t){let{art:e,modules:n,version:o}=t,r=e.image&&Lo(e.image);if(!(r&&lo.includes(e.mode)))return null;let i=n.length;if(i!==o*4+17)return null;let a=or(t.fgColor,[0,0,0]),l=or(t.bgColor,[1,1,1]),s=ss(e,a,l);return s<=0?null:{art:e,image:r,modules:n,size:i,version:o,kinds:K0(o),margin:t.margin,pixelSize:t.pixelSize,t:s,fg:a,bg:l,variant:To(e),body:t.body}}function ls(t){let e=mm(t);if(!e)return null;let n;return e.art.mode==="halftone"?n=e.variant==="mono"?bm(e):gm(e):n=e.variant==="badge"?Rm(e):_m(e),E("g",{"data-qrdx-art":e.art.mode,"data-qrdx-art-variant":e.variant,children:n})}function dm(t,e){return {margin:.42-.17*t+(e===3?.04:0),darkCap:.4+.3*t}}var cs=8.5,Ka=new Map;function Do(t){let e=t*4+17,n=Ka.get(t);if(!n){let i=e*2,a=new Uint8Array(i*i),l=cs*2;for(let s=0;s<i;s++)for(let c=0;c<i;c++){let u=c<l||c>=i-l,m=s<l||s>=i-l;u&&m&&!(c>=i-l&&s>=i-l)&&(a[s*i+c]=1);}for(let[s,c]of gn(t,e))for(let u=(c-2)*2-1;u<(c+3)*2+1;u++)for(let m=(s-2)*2-1;m<(s+3)*2+1;m++)m>=0&&u>=0&&m<i&&u<i&&(a[u*i+m]=1);Ka.set(t,a),n=a;}let o=n,r=e*2;return (i,a)=>{let l=Math.floor(i*2),s=Math.floor(a*2);return l>=0&&s>=0&&l<r&&s<r&&o[s*r+l]===1}}function us(t,e,n=false){let{image:o,size:r,kinds:i,fg:a,bg:l}=t,s=im.get(t.art.image.data,()=>om(o)),c=No(o.width,o.height,r,"cover"),u=r*e,m=new Float32Array(u*u*3).fill(Number.NaN),p=1/(e*c.scale)>1.3?2:1,b=q(l)-.1*(q(l)-q(a)),f=Do(t.version);for(let h=0;h<r;h++)for(let g=0;g<r;g++){let y=i[h*r+g],x=y===wt||y===At;if(!(x&&!n))for(let C=0;C<e;C++)for(let w=0;w<e;w++){let S=0,$=0,R=0;for(let k=0;k<p;k++)for(let L=0;L<p;L++){let z=g+(w+(L+.5)/p)/e,B=h+(C+(k+.5)/p)/e,U=rs(s,(z-c.offsetX)/c.scale,(B-c.offsetY)/c.scale,l);S+=U[0],$+=U[1],R+=U[2];}let M=p*p,A=[S/M,$/M,R/M],v=g+(w+.5)/e,I=h+(C+.5)/e,F=Math.min(v,I,r-v,r-I);F<1.5&&(A=ie(A,l,.35*(1-F/1.5))),n&&(x||f(v,I))&&(A=Vt(A,l,b,false));let N=((h*e+C)*u+g*e+w)*3;m[N]=A[0],m[N+1]=A[1],m[N+2]=A[2];}}return {n:e,count:u,rgb:m}}function fm(t,e,n){let{size:o,kinds:r,modules:i,fg:a,bg:l,t:s}=t,{n:c,count:u,rgb:m}=e,d=q(a),p=q(l),b=p-d,f=dm(s,c),h=R=>.2126*m[R]+.7152*m[R+1]+.0722*m[R+2],g=new Float32Array(o*o),y=new Float32Array(o*o);for(let R=0;R<o;R++)for(let M=0;M<o;M++){let A=r[R*o+M];if(A===wt){g[R*o+M]=p;continue}if(A===At){g[R*o+M]=i[R]?.[M]?d:p;continue}let v=0,I=0,F=0;for(let N=0;N<c;N++)for(let k=0;k<c;k++){let L=h(((R*c+N)*u+M*c+k)*3);v+=L,n.under[N*c+k]||(I+=L,F++);}g[R*o+M]=v/(c*c),y[R*o+M]=F?I/F:v/(c*c);}let x=o+1,C=new Float64Array(x*x);for(let R=0;R<o;R++)for(let M=0;M<o;M++)C[(R+1)*x+M+1]=g[R*o+M]+C[R*x+M+1]+C[(R+1)*x+M]-C[R*x+M];let w=2,S=(R,M)=>{let A=Math.max(0,R-w),v=Math.max(0,M-w),I=Math.min(o,R+w+1),F=Math.min(o,M+w+1);return (C[F*x+I]-C[v*x+I]-C[F*x+A]+C[v*x+A])/((I-A)*(F-v))},$=n.weight;for(let R=0;R<o;R++)for(let M=0;M<o;M++){let A=r[R*o+M];if(A===wt||A===At)continue;let v=A===Wt,I=(f.margin+(v?.08:0))*b,F=(f.darkCap-(v?.12:0))*b,N=($*((n.light-n.dark)/2)-I)/(1-$),k=S(M,R),L=y[R*o+M],z=!!i[R]?.[M],B=0,U=l;if(z){let D=Math.min(k+N,d+F);L>D&&(B=(L-D)/Math.max(L-d,1e-6),U=a);}else {let D=Math.max(k-N,p-F);L<D&&(B=(D-L)/Math.max(p-L,1e-6));}if(!(B<=0)){B=Math.min(1,B);for(let D=0;D<c;D++)for(let st=0;st<c;st++){let xt=((R*c+D)*u+M*c+st)*3;for(let ht=0;ht<3;ht++)m[xt+ht]+=(U[ht]-m[xt+ht])*B;}}}}function ms(t,e,n,o){let{count:r}=e,i=new ae;for(let s=0;s<r;s++){let c=0,u=n(s*r);for(let m=1;m<=r;m++){let d=m<r?n(s*r+m):null;(m===r||d!==u)&&(u&&i.cellRun(u,c,s,m-c),c=m,u=d);}}let a=t.pixelSize/e.n,l=ot(t.margin*t.pixelSize);return E("g",{transform:`translate(${l} ${l}) scale(${is(a)})`,children:i.toElements(o)},o)}function Bo(t,e){let n=gn(t.version,t.size);return n.length===0?[]:[E("path",{d:as(n,t.margin,t.pixelSize),fill:e,fillRule:"evenodd"},"art-alignment")]}function ds(t){let{image:e,size:n}=t;return Math.floor(Math.min(e.width,e.height)/n)>=4&&n<=45?4:3}var hm=t=>2*ko*Math.sqrt(-2*Math.log(1-Math.min(t,.95)));function pm(t,e,n){let o=e+1,r=new Float64Array(o*o);for(let a=0;a<e;a++)for(let l=0;l<e;l++)r[(a+1)*o+l+1]=t[a*e+l]+r[a*o+l+1]+r[(a+1)*o+l]-r[a*o+l];let i=new Float32Array(e*e);for(let a=0;a<e;a++)for(let l=0;l<e;l++){let s=Math.max(0,l-n),c=Math.max(0,a-n),u=Math.min(e,l+n+1),m=Math.min(e,a+n+1);i[a*e+l]=(r[m*o+u]-r[c*o+u]-r[m*o+s]+r[c*o+s])/((u-s)*(m-c));}return i}function fs(t,e,n,o){let{size:r,kinds:i,modules:a,fg:l,bg:s}=t,c=q(l),u=q(s),m=u-c,d=pm(e,r,2),p=new Float32Array(r*r),b=new Float32Array(r*r).fill(Number.NaN);for(let f=0;f<r;f++)for(let h=0;h<r;h++){let g=f*r+h,y=i[g];if(y===wt||y===At)continue;let x=y===Wt,C=o.base+(x?.08:0),w=(o.margin+(x?.03:0))*m,S=(o.cap-(x?.04:0))*m,$=Ya(C),R=Ya(x?Math.max(o.max,.94):o.max),M=$*((o.dark+o.light)/2)+(1-$)*d[g],A=n[g],v=!!a[f]?.[h],I=v?o.dark:o.light,F=v?Math.min(M-w,c+S):Math.max(M+w,u-S),k=(v?A<=F:A>=F)?0:(A-F)/(A-I);k>R&&(k=R,b[g]=Math.min(u,Math.max(c,(F-R*I)/(1-R))));let L=v?A<=F-.06:A>=F+.06;o.skip&&L&&!x||(k=Math.max(k,$)),p[g]=k>0?hm(k):0;}return {diameter:p,surround:b}}function gm(t){let{size:e,kinds:n,modules:o,fg:r,bg:i,t:a,margin:l,pixelSize:s}=t,c=ds(t),u=us(t,c,true),m=q(r),d=q(i),p=m+.1*(d-m),b=d-.05*(d-m),{count:f,rgb:h}=u,g=(S,$,R,M)=>(($*c+M)*f+S*c+R)*3,y=new Float32Array(e*e);for(let S=0;S<e;S++)for(let $=0;$<e;$++){let R=n[S*e+$];if(R===wt||R===At){y[S*e+$]=R===At&&o[S]?.[$]?m:d;continue}let M=0;for(let A=0;A<c;A++)for(let v=0;v<c;v++){let I=g($,S,v,A);M+=.2126*h[I]+.7152*h[I+1]+.0722*h[I+2];}y[S*e+$]=M/(c*c);}let x=fs(t,y,y,{base:.6-.28*a,max:.86,dark:p,light:b,margin:.2-.1*a,cap:.4+.14*a,skip:false});for(let S=0;S<e;S++)for(let $=0;$<e;$++){let R=x.surround[S*e+$];if(Number.isNaN(R))continue;let M=y[S*e+$],v=R<M?r:i,I=Math.min(1,Math.abs(M-R)/Math.max(Math.abs(M-q(v)),1e-6));for(let F=0;F<c;F++)for(let N=0;N<c;N++){let k=g($,S,N,F);for(let L=0;L<3;L++)h[k+L]+=(v[L]-h[k+L])*I;}}let C=[ms(t,u,S=>{let $=S*3;return Number.isNaN(h[$])?null:_t([h[$],h[$+1],h[$+2]],8)},"art-photo")],w=new ae;for(let S=0;S<e;S++)for(let $=0;$<e;$++){let R=x.diameter[S*e+$];if(!(R>0))continue;let M=0,A=0,v=0;for(let N=0;N<c;N++)for(let k=0;k<c;k++){let L=g($,S,k,N);M+=h[L],A+=h[L+1],v+=h[L+2];}let I=[M/(c*c),A/(c*c),v/(c*c)],F=o[S]?.[$]?Vt(I,r,p,true):Vt(I,i,b,false);w.circle(_t(F,10),($+l+.5)*s,(S+l+.5)*s,R/2*s);}return C.push(...w.toElements("art-dot"),...Bo(t,_t(r))),C}function bm(t){let{size:e,kinds:n,modules:o,fg:r,bg:i}=t,a=ds(t),l=us(t,a),s=q(r),c=q(i),u=a%2===1?1:2,m=(a-u)/2,d=M=>M>=m&&M<m+u,p=[];for(let M=0;M<a;M++)for(let A=0;A<a;A++)p.push(d(A)&&d(M));fm(t,l,{weight:nm(u/a),dark:s,light:c,under:p});let{count:b,rgb:f}=l,h=new Float32Array(b*b),g=new Int8Array(b*b).fill(-1);for(let M=0;M<b*b;M++){let A=M*3;if(Number.isNaN(f[A])){h[M]=Number.NaN;continue}let v=(.2126*f[A]+.7152*f[A+1]+.0722*f[A+2]-s)/(c-s);h[M]=.5+(rm(0,1,v)-.5)*1.15;}for(let M=0;M<e;M++)for(let A=0;A<e;A++){let v=n[M*e+A];if(!(v===wt||v===At))for(let I=m;I<m+u;I++)for(let F=m;F<m+u;F++)g[(M*a+I)*b+A*a+F]=o[M]?.[A]?0:1;}let y=Do(t.version);for(let M=0;M<b;M++)for(let A=0;A<b;A++){let v=M*b+A;g[v]<0&&y((A+.5)/a,(M+.5)/a)&&(g[v]=1);}let x=new Uint8Array(b*b),C=.3,w=0,S=0,$=(M,A,v)=>{if(M<0||M>=b||A>=b)return;let I=A*b+M;if(!Number.isNaN(h[I])){let F=Math.floor(M/a)===Math.floor(w/a)&&Math.floor(A/a)===Math.floor(S/a);h[I]+=F?v:v*C;}};for(let M=0;M<b;M++){let A=M%2===0?1:-1;for(let v=0;v<b;v++){let I=A===1?v:b-1-v,F=M*b+I,N=h[F];if(Number.isNaN(N))continue;let k=g[F]>=0?g[F]:N>=.5?1:0;x[F]=k===0?1:0;let L=Math.min(.75,Math.max(-0.75,N-k));w=I,S=M,$(I+A,M,L*7/16),$(I-A,M+1,L*3/16),$(I,M+1,L*5/16),$(I+A,M+1,L/16);}}let R=_t(r);return [ms(t,l,M=>x[M]?R:null,"art-halftone"),...Bo(t,R)]}function Ja(t,e){let n=null,o=0;for(let r of t.palette){if(e&&tm(r.color,e)<.02)continue;let i=r.area*(.35+es(r.color))*(q(r.color)>.86?.05:1);i>o&&(o=i,n=r.color);}return n}function hs(t,e,n,o,r){let i;if(t.photographic){let a=new ae,{width:l,height:s,rgb:c,alpha:u}=e;for(let m=0;m<s;m++){let d=0,p=null;for(let b=0;b<=l;b++){let f=m*l+b,h=b<l&&u[f]>=.5?_t(o([c[f*3],c[f*3+1],c[f*3+2]]),6):null;(b===l||h!==p)&&(p&&a.cellRun(p,d,m,b-d),d=b,p=h);}}i=a.toElements(`${r}-px`);}else i=t.layers.map((a,l)=>E("path",{d:a.d,fill:_t(o(a.color)),fillRule:"evenodd"},`${r}-${l}`));return E("g",{transform:`translate(${ot(n.x)} ${ot(n.y)}) scale(${is(n.scale)})`,children:i},r)}function _m(t){let{art:e,image:n,size:o,kinds:r,modules:i,fg:a,bg:l,t:s,margin:c,pixelSize:u}=t,m=Oo(e,n),d=os(e,n,m),p=No(m.width,m.height,o,"contain"),b=Math.min(1,.3+1.4*s),f=L=>ie(l,L,b),h=_t(l),g=_t(a),y=[hs(m,d,{x:(c+p.offsetX)*u,y:(c+p.offsetY)*u,scale:p.scale*u},f,"art-logo")],x=cs,C=(L,z)=>oe((L+c)*u,(z+c)*u,(x+.4)*u,(x+.4)*u,1.2*u),w=gn(t.version,o).map(([L,z])=>oe((L-2.5+c)*u,(z-2.5+c)*u,6*u,6*u,u*.8)).join("");y.push(E("path",{d:C(-0.4,-0.4)+C(o-x,-0.4)+C(-0.4,o-x)+w,fill:h},"art-plates"));let S=Do(t.version),$=q(l),R=q(a),M=new Float32Array(o*o),A=new Float32Array(o*o),v=new Array(o*o);for(let L=0;L<o;L++)for(let z=0;z<o;z++){let B=L*o+z,U=r[B];if(U===wt||U===At){M[B]=U===At&&i[L]?.[z]?R:$;continue}let D=1,st=0,xt=0,ht=0,It=0;for(let ut=0;ut<4;ut++)for(let X=0;X<4;X++){let lt=z+(X+.5)/4,nn=L+(ut+.5)/4,j=S(lt,nn)?l:rs(d,(lt-p.offsetX)/p.scale,(nn-p.offsetY)/p.scale,l,b),rn=q(j);D=Math.min(D,rn),st+=rn,xt+=j[0],ht+=j[1],It+=j[2];}M[B]=st/16,A[B]=D,v[B]=[xt/16,ht/16,It/16];}let I=R+.08*($-R),F=$-.04*($-R),N=fs(t,M,M,{base:.74-.26*s,max:.9,dark:I,light:F,margin:.23-.1*s,cap:.4+.1*s,skip:s>=.7}),k=new ae;for(let L=0;L<o;L++)for(let z=0;z<o;z++){let B=L*o+z,U=N.diameter[B],D=!!i[L]?.[z];if(!(U>0)||!D&&A[B]>=$-.02)continue;let st=D?Vt(v[B],a,I,true):Vt(v[B],l,F,false);k.circle(_t(st,8),(z+c+.5)*u,(L+c+.5)*u,U/2*u);}return y.push(...k.toElements("art-dot")),y.push(...Bo(t,g)),y}var ym={L:.5,M:.72,Q:.88,H:1},ps=.32,gs=.55,xm=.6,$m=2;function bs(t,e,n){let o=e>=1?t:t*e,r=e>=1?t/e:t,i=Math.max(.7,t*.09),a=o+2*i,l=r+2*i;return {logoW:o,logoH:r,plateW:a,plateH:l,radius:Math.min(a,l)*.26,cx:n/2,cy:n/2}}var _s=t=>({cx:t.cx,cy:t.cy,w:t.plateW,h:t.plateH,r:t.radius});function ys(t,e,n){return $s(e+.5,n+.5,t)<gs}function Sm(t,e){let n=_s(t),o=gs+1,r=Math.max(0,Math.floor(t.cx-t.plateW/2-o)),i=Math.min(e-1,Math.ceil(t.cx+t.plateW/2+o)),a=Math.max(0,Math.floor(t.cy-t.plateH/2-o)),l=Math.min(e-1,Math.ceil(t.cy+t.plateH/2+o)),s=[];for(let c=a;c<=l;c++)for(let u=r;u<=i;u++)ys(n,u,c)&&s.push(c*e+u);return s}var Cm=t=>Math.floor(t.correctable*xm);function Fo(t,e,n){let o=bs(t,e,n.size),r=Cm(n);return tr(n,Sm(o,n.size)).every(i=>i<=r)}function xs(t,e,n){if(Fo(n,e,t))return n;let o=0,r=n;if(!Fo(o,e,t))return -1;for(;r-o>1/64;){let i=(o+r)/2;Fo(i,e,t)?o=i:r=i;}return o}var rr=new Map;function wm(t,e){let n=`${t.version}${t.level}:${e.toFixed(3)}`,o=rr.get(n);return o===void 0&&(o=xs(t,e,ps*t.size),rr.size>=64&&rr.clear(),rr.set(n,o)),o}function Mm(t,e){let{size:n,t:o,modules:r,version:i}=t,a=J0(r),l=(.18+.15*o)*ym[a],s=e.width/e.height,c=Math.min(ps,l)*n,u=Jn(i,a),m=Math.max(0,wm(u,s));if(m<$m)return {wantedBox:c,maxBox:m,box:0,plate:null};let d=xs(u,s,Math.min(c,m));return d<0?{wantedBox:c,maxBox:m,box:0,plate:null}:{wantedBox:c,maxBox:m,box:d,plate:bs(d,s,n)}}function $s(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 Ss(t,e){let{fg:n,bg:o,t:r}=t,i=q(n),a=q(o),l=Ja(e),s=Math.min(1,r/.6),c=l?Vt(l,n,i+.3*(a-i),true):n,u=ie(n,c,s),m=l?Ja(e,l):null,d=i+.42*(a-i),p=m&&q(m)<=d+.22?ie(n,Vt(m,n,d,true),s):u;return {body:u,inner:p}}function Rm(t){let{art:e,image:n,size:o,kinds:r,modules:i,bg:a,margin:l,pixelSize:s,version:c}=t,u=Oo(e,n),m=Mm(t,u).plate,{body:d}=Ss(t,u),p=_t(d),b=m&&_s(m),f=i.map(v=>[...v]);for(let v=0;v<o;v++)for(let I=0;I<o;I++){let F=r[v*o+I];(F===At||b&&F!==wt&&ys(b,I,v))&&(f[v][I]=false);}let h=[],g=t.body?.(f);if(g)h.push(E("g",{fill:p,children:g},"art-body"));else {let v=new ae;for(let I=0;I<o;I++)for(let F=0;F<o;F++)f[I]?.[F]&&r[I*o+F]!==wt&&v.circle(p,(F+l+.5)*s,(I+l+.5)*s,.45*s);h.push(...v.toElements("art-body"));}let y=gn(c,o).filter(([v,I])=>!b||$s(v+.5,I+.5,b)>3.2);if(y.length>0&&h.push(E("path",{d:as(y,l,s),fill:p,fillRule:"evenodd"},"art-alignment")),!m)return h;let x=os(e,n,u),C=(m.cx-m.plateW/2+l)*s,w=(m.cy-m.plateH/2+l)*s,S=m.plateW*s,$=m.plateH*s,R=m.radius*s,M=.1*s,A=oe(C,w,S,$,R);return h.push(E("path",{d:A,fill:_t(a)},"art-plate"),E("path",{d:A+oe(C+M,w+M,S-2*M,$-2*M,R-M),fill:_t(ie(a,d,.16)),fillRule:"evenodd"},"art-plate-ring"),hs(u,x,{x:(m.cx-m.logoW/2+l)*s,y:(m.cy-m.logoH/2+l)*s,scale:m.logoW/u.width*s},v=>v,"art-logo")),h}function Cs(t){let{art:e}=t;if(e.mode!=="logo"||e.matchEyes===false)return null;let n=e.image&&Lo(e.image);if(!n)return null;let o=or(t.fgColor,[0,0,0]),r=or(t.bgColor,[1,1,1]),i=ss(e,o,r);if(i<=0)return null;let a=Oo(e,n);if(a.palette.length===0)return null;if(To(e)==="badge"){let{body:b,inner:f}=Ss({fg:o,bg:r,t:i},a),h={outer:_t(b),inner:_t(f)};return {topLeft:h,topRight:h,bottomLeft:h}}let l=q(o),s=q(r),c=Math.min(1,i/.6),u=t.version*4+17,m=No(a.width,a.height,u,"contain"),d=.45*Math.max(a.width,a.height),p=(b,f)=>{let h=(b-m.offsetX)/m.scale,g=(f-m.offsetY)/m.scale,y=null,x=0;for(let w of a.palette){if(q(w.color)>.86)continue;let S=(w.cx-h)**2+(w.cy-g)**2,$=w.area*(.35+es(w.color))*Math.exp(-S/(2*d**2));$>x&&(x=$,y=w.color);}if(!y)return {};let C=Vt(y,o,l+.42*(s-l),true);return {inner:_t(ie(o,C,c))}};return {topLeft:p(3.5,3.5),topRight:p(u-3.5,3.5),bottomLeft:p(3.5,u-3.5)}}var ws=t=>t*3+3&-4,Go=(t,e)=>Math.floor((t*e+255*(255-e)+127)/255);function Ms(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=ws(e),r=o*n,i=new Uint8Array(54+r),a=new DataView(i.buffer);i[0]=66,i[1]=77,a.setUint32(2,i.length,true),a.setUint32(10,54,true),a.setUint32(14,40,true),a.setInt32(18,e,true),a.setInt32(22,n,true),a.setUint16(26,1,true),a.setUint16(28,24,true),a.setUint32(30,0,true),a.setUint32(34,r,true),a.setInt32(38,2835,true),a.setInt32(42,2835,true);for(let l=0;l<n;l++){let s=l*e*4,c=54+(n-1-l)*o;for(let u=0;u<e;u++){let m=t[s+3],d=t[s],p=t[s+1],b=t[s+2];m===255?(i[c]=b,i[c+1]=p,i[c+2]=d):(i[c]=Go(b,m),i[c+1]=Go(p,m),i[c+2]=Go(d,m)),s+=4,c+=3;}}return i}function Rs(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+ws(n)*o}function ir(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=Ms(n,t.width,t.height);if(!Rs(o))throw new Error("Could not write a BMP file");return new Blob([o],{type:"image/bmp"})}function G(t){if(t.length===0)return "";let[e,...n]=t;return `M${_(e[0])} ${_(e[1])}${n.map(([o,r])=>`L${_(o)} ${_(r)}`).join("")}Z`}function H(t,e,n){return `M${_(t-n)} ${_(e)}A${_(n)} ${_(n)} 0 1 1 ${_(t+n)} ${_(e)}A${_(n)} ${_(n)} 0 1 1 ${_(t-n)} ${_(e)}Z`}function T(t,e,n,o,r=0){let i=Math.min(n,o)/2,[a,l,s,c]=(typeof r=="number"?[r,r,r,r]:r).map(m=>Math.max(0,Math.min(m,i))),u=(m,d,p)=>m>0?`A${_(m)} ${_(m)} 0 0 1 ${_(d)} ${_(p)}`:"";return `M${_(t+a)} ${_(e)}H${_(t+n-l)}${u(l,t+n,e+l)}V${_(e+o-s)}${u(s,t+n-s,e+o)}H${_(t+c)}${u(c,t,e+o-c)}V${_(e+a)}${u(a,t+a,e)}Z`}function Qo(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 Ge(t,e,n,o,r=-90){return Array.from({length:o},(i,a)=>{let l=(r+360/o*a)*Math.PI/180;return [t+n*Math.cos(l),e+n*Math.sin(l)]})}function Qe(t,e,n,o,r=5){return Array.from({length:r*2},(i,a)=>{let l=a%2===0?n:o,s=-Math.PI/2+Math.PI/r*a;return [t+l*Math.cos(s),e+l*Math.sin(s)]})}function Ue(t,e,n,o,r=4,i=64){return Array.from({length:i},(a,l)=>{let s=2*Math.PI*l/i,c=Math.cos(s),u=Math.sin(s);return [t+n*Math.sign(c)*Math.abs(c)**(2/r),e+o*Math.sign(u)*Math.abs(u)**(2/r)]})}function He(t,e,n){let o=n/2,r=(i,a)=>`${_(t+i*o)} ${_(e+a*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 Es(t,e,n,o){if(o===0)return t;let r=o*Math.PI/180,i=Math.cos(r),a=Math.sin(r);return t.map(([l,s])=>[e+(l-e)*i-(s-n)*a,n+(l-e)*a+(s-n)*i])}function ar(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 se(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)}function Uo(t,e,n,o,r){let i=Math.max(0,Math.min(r,Math.min(n,o)/2)),a=(l,s)=>`A${_(i)} ${_(i)} 0 0 0 ${_(l)} ${_(s)}`;return `M${_(t+i)} ${_(e)}H${_(t+n-i)}${a(t+n,e+i)}V${_(e+o-i)}${a(t+n-i,e+o)}H${_(t+i)}${a(t,e+o-i)}V${_(e+i)}${a(t+i,e)}Z`}function sr(t,e,n,o,r){let i=Math.max(0,Math.min(r,Math.min(n,o)/2));return G([[t+i,e],[t+n-i,e],[t+n-i,e+i],[t+n,e+i],[t+n,e+o-i],[t+n-i,e+o-i],[t+n-i,e+o],[t+i,e+o],[t+i,e+o-i],[t,e+o-i],[t,e+i],[t+i,e+i]])}function bn(t,e,n,o,r){let i=o,a=n/2,l=(a-i)*.55,s=(c,u)=>`${_(t+c)} ${_(e+u)}`;return `M${s(i,0)}C${s(i+l,0)} ${s(a-l,r)} ${s(a,r)}C${s(a+l,r)} ${s(n-i-l,0)} ${s(n-i,0)}A${_(i)} ${_(i)} 0 0 1 ${s(n,i)}C${s(n,i+l)} ${s(n-r,a-l)} ${s(n-r,a)}C${s(n-r,a+l)} ${s(n,n-i-l)} ${s(n,n-i)}A${_(i)} ${_(i)} 0 0 1 ${s(n-i,n)}C${s(n-i-l,n)} ${s(a+l,n-r)} ${s(a,n-r)}C${s(a-l,n-r)} ${s(i+l,n)} ${s(i,n)}A${_(i)} ${_(i)} 0 0 1 ${s(0,n-i)}C${s(0,n-i-l)} ${s(r,a+l)} ${s(r,a)}C${s(r,a-l)} ${s(0,i+l)} ${s(0,i)}A${_(i)} ${_(i)} 0 0 1 ${s(i,0)}Z`}function Ho(t,e,n,o,r,i){let a=n/2,l=(s,c)=>`${_(t+s)} ${_(e+c)}`;return `M${l(o,0)}H${_(t+n-o)}A${_(o)} ${_(o)} 0 0 1 ${l(n,o)}V${_(e+r)}C${l(n,r+1.55*i)} ${l(a+1.6*i,n)} ${l(a,n)}C${l(a-1.6*i,n)} ${l(0,r+1.55*i)} ${l(0,r)}V${_(e+o)}A${_(o)} ${_(o)} 0 0 1 ${l(o,0)}Z`}var Em=["horizontal-line","liquid","liquid-horizontal","liquid-vertical","classy","classy-rounded","leaf","plus","hexagon","star","heart","random-dots","mosaic","octagon"];function As(t){return Em.includes(t)}var Am={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 zo(t,e){if(t===void 0||!Number.isFinite(t))return 1;let n=e?Am[e]??1:uo;return Math.min(pa,Math.max(uo,n,t))}function Pm(t,e,n){return t<7&&e<7||t>=n-7&&e<7||t<7&&e>=n-7}function vm(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 i=e-7;r.length<n;i-=o)r.splice(1,0,i);return r}function qo(t){let e=(t-17)/4,n=Number.isInteger(e)?vm(e,t):[],o=n.length-1,r=[];for(let[i,a]of n.entries())for(let[l,s]of n.entries())i===0&&l===0||i===0&&l===o||i===o&&l===0||r.push([a,s]);return (i,a)=>r.some(([l,s])=>Math.abs(i-l)<=2&&Math.abs(a-s)<=2)}var Im={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 Fm(t,e,n,o,r,i){switch(t){case "horizontal-line":{let a=o*.43;return T(e-o/2,n-a,o,2*a)}case "leaf":{let a=o*.5;return T(e-a,n-a,2*a,2*a,[o*.4,o*.05,o*.4,o*.05])}case "plus":{let a=o*.22,l=o*.5;return G([[e-a,n-l],[e+a,n-l],[e+a,n-a],[e+l,n-a],[e+l,n+a],[e+a,n+a],[e+a,n+l],[e-a,n+l],[e-a,n+a],[e-l,n+a],[e-l,n-a],[e-a,n-a]])}case "hexagon":return G(Ge(e,n,o*.54,6));case "star":return G(Qe(e,n+o*.04,o*.62,o*.34));case "heart":return He(e,n+o*.02,o*1.08);case "random-dots":return H(e,n,o*(.38+.15*ar(r,i)));case "mosaic":{let a=o*(.8+.14*ar(r,i,1))/2,l=[[e-a,n-a],[e+a,n-a],[e+a,n+a],[e-a,n+a]];return G(Es(l,e,n,(ar(r,i,2)-.5)*16))}case "octagon":return G(Ge(e,n,o*.48/Math.cos(Math.PI/8),8,22.5));default:return H(e,n,o*.45)}}function Ps(t,e){let{margin:n,pixelSize:o,pattern:r}=e,i=zo(e.scale,r),a=t.length,l=e.plain?()=>false:qo(a),s=(f,h)=>!e.plain&&Pm(f,h,a),c=(f,h)=>f>=0&&h>=0&&f<a&&h<a&&!!t[h]?.[f]&&!s(f,h),u=f=>(f+.5+n)*o,m=[],d=[],p=Im[r];for(let f=0;f<a;f++)for(let h=0;h<a;h++){if(!c(h,f))continue;let g=u(h),y=u(f);if(l(h,f)){m.push(P`M${g-o/2} ${y-o/2}h${o}v${o}h${-o}z`);continue}if(!p){d.push(Fm(r,g,y,o*i,h,f));continue}let x=o*p.thickness*i/2,C=p.horizontal&&c(h+1,f),w=p.horizontal&&c(h-1,f),S=p.vertical&&c(h,f-1),$=p.vertical&&c(h,f+1),M=[!(S||w),!(S||C),!($||C),!($||w)].map((A,v)=>A?x*p.radius(v):0);d.push(T(g-x,y-x,2*x,2*x,M)),2*x<o&&(C&&d.push(T(g,y-x,o,2*x)),$&&d.push(T(g-x,y,2*x,o)));}if(p?.fillets&&i===1){let f=o*.3;for(let h=0;h<a;h++)for(let g=0;g<a;g++){if(c(g,h)||s(g,h))continue;let y=u(g)-o/2,x=u(h)-o/2,C=y+o,w=x+o;c(g-1,h)&&c(g,h-1)&&c(g-1,h-1)&&d.push(P`M${y} ${x}h${f}A${f} ${f} 0 0 0 ${y} ${x+f}Z`),c(g+1,h)&&c(g,h-1)&&c(g+1,h-1)&&d.push(P`M${C} ${x}v${f}A${f} ${f} 0 0 0 ${C-f} ${x}Z`),c(g+1,h)&&c(g,h+1)&&c(g+1,h+1)&&d.push(P`M${C} ${w}h${-f}A${f} ${f} 0 0 0 ${C} ${w-f}Z`),c(g-1,h)&&c(g,h+1)&&c(g-1,h+1)&&d.push(P`M${y} ${w}v${-f}A${f} ${f} 0 0 0 ${y+f} ${w}Z`);}}let b=[];return d.length>0&&b.push(E("path",{d:d.join("")},"modules")),m.length>0&&b.push(E("path",{d:m.join("")},"alignment")),b}var Wo=(t,e=0)=>{for(let n=e;n<t.length;n++)if(t[n]?.continue!==true)return true;return false};function jt(t,e=[],n={}){return {...n,run(o){let r=t({value:o,issues:[]}),i=Wo(r.issues);for(let a of e){if(a.hasLength){let s=r.value;if(r.issues.some(c=>c.continue===false)||s===null||s===void 0||s.length===void 0)continue}else if(i)continue;let l=r.issues.length;a.run(r),!i&&r.issues.length>l&&(i=Wo(r.issues,l));}return r}}}function Lm(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 ce=(t,e)=>({path:[],message:`Invalid input: expected ${t}, received ${Lm(e)}`}),Tm={string:"characters",array:"items"};function Ot(t,e,n,o){let r=Tm[e],i=t?"Too big":"Too small",a=`${t?"<=":">="}${n}`;return {path:[],message:r?`${i}: expected ${e} to have ${a} ${r}`:`${i}: expected ${e} to be ${a}`,continue:o}}var Vo=t=>typeof t=="string"?`"${t}"`:`${t}`,Ls=t=>typeof t=="object"&&t!==null&&!Array.isArray(t);function Yo(t,e,n){for(let o of n)o.path.unshift(e),t.push(o);}var km=t=>t>=55296&&t<=56319,Nm=t=>t>=56320&&t<=57343;function Om(t){let e=t.length;for(let n=0;n<t.length-1;n++)km(t.charCodeAt(n))&&Nm(t.charCodeAt(n+1))&&(e--,n++);return e}var Ts=t=>Array.isArray(t)?"array":typeof t=="string"?"string":"unknown",xn=t=>({run(e){e.value<t&&e.issues.push(Ot(false,"number",t,true));}}),$n=t=>({run(e){e.value>t&&e.issues.push(Ot(true,"number",t,true));}}),We=(t,e="Invalid input")=>({run(n){t(n.value)||n.issues.push({path:[],message:e,continue:true});}}),ks=t=>typeof t=="string"?Om(t):t.length,Ns=t=>({hasLength:true,run(e){let n=e.value;ks(n)<t&&e.issues.push(Ot(false,Ts(n),t,true));}}),Ko=t=>({hasLength:true,run(e){let n=e.value;ks(n)>t&&e.issues.push(Ot(true,Ts(n),t,true));}}),Os=(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});}}),Dm={run(t){let e=t.value;Number.isInteger(e)?Number.isSafeInteger(e)||t.issues.push(e>0?Ot(true,"int",Number.MAX_SAFE_INTEGER,true):Ot(false,"int",Number.MIN_SAFE_INTEGER,true)):t.issues.push({...ce("int",e),continue:false});}},ue=(...t)=>jt(e=>{let n=e.value;return typeof n=="number"&&Number.isFinite(n)||e.issues.push(ce("number",n)),e},t),Ds=(...t)=>ue(Dm,...t),lr=(...t)=>jt(e=>(typeof e.value!="string"&&e.issues.push(ce("string",e.value)),e),t);function Rt(t){let e=t.length===1?`Invalid input: expected ${Vo(t[0])}`:`Invalid option: expected one of ${t.map(Vo).join("|")}`;return jt(n=>(t.includes(n.value)||n.issues.push({path:[],message:e}),n),[],{values:t})}var Mt=t=>Rt([t]),V=t=>({optional:true,run:e=>e===void 0?{value:e,issues:[]}:t.run(e)});function K(t,e=[]){let n=Object.keys(t),o=new Set(n);return jt(r=>{let i=r.value;if(!Ls(i))return r.issues.push(ce("object",i)),r;let a={};for(let s of n){let c=t[s],u=c.run(i[s]),m=s in i;Yo(r.issues,s,u.issues),m||c.optional||u.issues.length>0||r.issues.push({path:[s],message:"Invalid input: expected nonoptional, received undefined"}),m&&(a[s]=u.value);}r.value=a;let l=[];for(let s in i)o.has(s)||l.push(s);return l.length>0&&r.issues.push({path:[],message:`Unrecognized key${l.length>1?"s":""}: ${l.map(Vo).join(", ")}`,continue:true}),r},e,{shape:t})}function jo(t,e,n){let o=[];return e!==void 0&&o.push(Ns(e)),n!==void 0&&o.push(Ko(n)),jt(r=>{let i=r.value;if(Array.isArray(i)&&n!==void 0&&i.length>n)return r.issues.push(Ot(true,"array",n,false)),r;if(!Array.isArray(i))return r.issues.push(ce("array",i)),r;let a=new Array(i.length);for(let l=0;l<i.length;l++){let s=t.run(i[l]);Yo(r.issues,l,s.issues),a[l]=s.value;}return r.value=a,r},o)}function Zo(t){return jt(e=>{let n=e.value;if(!Array.isArray(n))return e.issues.push(ce("tuple",n)),e;if(n.length<t.length)return e.issues.push(Ot(false,"array",t.length,void 0)),e;n.length>t.length&&e.issues.push(Ot(true,"array",t.length,void 0));let o=[];return t.forEach((r,i)=>{let a=r.run(n[i]);Yo(e.issues,i,a.issues),o[i]=a.value;}),e.value=o,e})}function qe(t){return jt(e=>{let n=[];for(let r of t){let i=r.run(e.value);if(i.issues.length===0)return i;n.push(i);}let o=n.filter(r=>!Wo(r.issues));return o.length===1?o[0]:(e.issues.push({path:[],message:"Invalid input"}),e)})}function Bs(t,e){let n=new Map;for(let r of e)for(let i of r.shape?.[t]?.values??[])n.set(i,r);let o=`Invalid discriminator value. Expected ${[...n.keys()].map(r=>`'${r}'`).join(" | ")}`;return jt(r=>{let i=r.value;if(!Ls(i))return r.issues.push(ce("object",i)),r;let a=n.get(i[t]);return a?a.run(i):(r.issues.push({path:[t],message:o}),r)})}var Bm=We(Yn,`Numbers may have at most ${rt.maxDecimals} decimals`),ur=[xn(-4e3),$n(rt.maxCoordinate),Bm],it=ue(...ur),ft=ue(...ur,We(t=>t>0,"Must be greater than 0")),cr=ue(...ur,We(t=>t>=0,"Must not be negative")),yn=lr(Os(/^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/,"Use a #rgb or #rrggbb color")),vs=qe([Rt(Ua),yn]),Gs=t=>K({mix:Zo([t,t]),amount:ue(xn(0),$n(1),We(Yn))}),ze=qe([vs,Gs(vs)]),Gm=qe([yn,Gs(qe([Rt(["frame","accent","background"]),yn]))]),le=qe([ze,K({gradient:K({from:ze,to:ze,direction:V(Rt(["horizontal","vertical"])),steps:V(Ds(xn(2),$n(rt.maxGradientSteps)))})})]),Xo=()=>({x:it,y:it,width:ft,height:ft}),_n=K({color:ze,width:ft}),Qm=Bs("type",[K({type:Mt("rect"),...Xo(),radius:V(cr),fill:le,hole:V(K({...Xo(),radius:V(cr)})),stroke:V(_n)}),K({type:Mt("circle"),cx:it,cy:it,r:ft,hole:V(ft),fill:le,stroke:V(_n)}),K({type:Mt("ellipse"),cx:it,cy:it,rx:ft,ry:ft,fill:le,stroke:V(_n)}),K({type:Mt("polygon"),points:jo(Zo([it,it]),3,rt.maxPolygonPoints),fill:le,stroke:V(_n)}),K({type:Mt("path"),d:lr(Ns(2),Ko(rt.maxPathLength)),fill:le,fillRule:V(Rt(["nonzero","evenodd"])),stroke:V(_n)}),K({type:Mt("line"),x1:it,y1:it,x2:it,y2:it,width:ft,cap:V(Rt(["butt","round"])),dash:V(Zo([ft,ft])),fill:le}),K({type:Mt("icon"),icon:Rt(Qa),x:it,y:it,size:ft,fill:le})]),Is=()=>({id:lr(Os(/^[a-z][a-z0-9-]{0,31}$/)),slot:Rt(["primary","secondary","fixed"]),text:lr(Ko(200)),maxLength:V(Ds(xn(1),$n(sn))),color:ze,weight:V(Rt(["bold","regular"])),collapse:V(K({y:it,height:ft}))}),Um=Bs("type",[K({type:Mt("text"),...Is(),box:K(Xo()),align:V(Rt(["start","middle","end"])),fontSize:V(ft)}),K({type:Mt("curved"),...Is(),curve:K({cx:it,cy:it,radius:ft,side:Rt(["top","bottom"]),spread:V(ue(xn(20),$n(300),We(Yn)))}),fontSize:ft})]),Fs=ue(...ur,We(t=>t>=rt.minArtboard&&t<=rt.maxArtboard,`Artboard sides must be ${rt.minArtboard} to ${rt.maxArtboard} units`)),Hm=K({kind:Mt(Da),version:Mt(Ba),artboard:K({width:Fs,height:Fs}),qr:K({x:it,y:it,size:ft,padding:V(cr),radius:V(cr),plate:V(Rt(["opaque","background","none"]))}),colors:K({frame:yn,text:V(Gm),accent:V(yn)}),shapes:jo(Qm,void 0,rt.maxShapes),labels:jo(Um,void 0,rt.maxLabels),bleed:V(qe([Mt("none"),ze]))},[{run(t){Ha(t.value,(e,n=[])=>{t.issues.push({path:[...n],message:e,continue:true});});}}]);function Qs(t){let e=Hm.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 Us=({path:t,message:e})=>t.length>0?`${t.join(".")}: ${e}`:e;var Hs=24,Zt=(t,e,n,o)=>{let r=o*Math.PI/180;return [t+n*Math.cos(r),e+n*Math.sin(r)]},mr=([t,e])=>`${_(t)} ${_(e)}`;function Ve(t,e,n,o,r,i){let a=i-r>180?1:0;return `M${mr(Zt(t,e,o,r))}A${_(o)} ${_(o)} 0 ${a} 1 ${mr(Zt(t,e,o,i))}L${mr(Zt(t,e,n,i))}A${_(n)} ${_(n)} 0 ${a} 0 ${mr(Zt(t,e,n,r))}Z`}function Sn(t,e,n,o){return `M${_(t-n)} ${_(e)}A${_(n)} ${_(o)} 0 1 1 ${_(t+n)} ${_(e)}A${_(n)} ${_(o)} 0 1 1 ${_(t-n)} ${_(e)}Z`}function zm(t){let e=0;return t.forEach(([n,o],r)=>{let[i,a]=t[(r+1)%t.length];e+=n*a-i*o;}),e/2}function zs(t){return G(zm(t)<0?[...t].reverse():t)}function dr(t,e,n,o,r){let i=Math.hypot(n-t,o-e)||1,a=-(o-e)/i*(r/2),l=(n-t)/i*(r/2);return zs([[t+a,e+l],[n+a,o+l],[n-a,o-l],[t-a,e-l]])}var yt=(...t)=>({d:t.join(""),fillRule:"nonzero"}),Dt=(...t)=>({d:t.join(""),fillRule:"evenodd"});function qm(){let t=[];for(let e of [0,60,120]){let[n,o]=Zt(12,12,10.5,e+180),[r,i]=Zt(12,12,10.5,e);t.push(dr(n,o,r,i,2));}for(let e=0;e<6;e++){let n=e*60,[o,r]=Zt(12,12,6.2,n);for(let i of [-45,45]){let[a,l]=Zt(o,r,3.6,n+i);t.push(dr(o,r,a,l,1.7));}}return yt(...t)}var Wm={wifi:()=>yt(Ve(12,20,4.6,7.2,-135,-45),Ve(12,20,9.2,11.8,-135,-45),Ve(12,20,13.8,16.4,-135,-45),H(12,20,2.2)),star:()=>yt(G(Qe(12,12.8,11.6,4.8))),heart:()=>yt(He(12,12.4,22)),phone:()=>Dt(T(6,1.5,12,21,2.6),T(7.8,4.2,8.4,13.4,.6),H(12,19.8,1.1)),headphones:()=>yt(Ve(12,13,7.6,9.8,-180,0),T(2,12,5,9.5,2),T(17,12,5,9.5,2)),calendar:()=>Dt(T(2.5,4,19,17.5,2.5),T(4.6,9,14.8,10.6,.8),T(7,11.4,2.6,2.6,.4),T(10.7,11.4,2.6,2.6,.4),T(14.4,11.4,2.6,2.6,.4),T(7,15.1,2.6,2.6,.4),T(10.7,15.1,2.6,2.6,.4),T(6.5,1.4,2.4,2.6,[1.2,1.2,0,0]),T(15.1,1.4,2.4,2.6,[1.2,1.2,0,0])),user:()=>yt(H(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:()=>Dt(T(2,3,20,14,4),G([[6.5,17],[11.5,17],[5.8,21.8]]),H(7.5,10,1.5),H(12,10,1.5),H(16.5,10,1.5)),bag:()=>yt(T(3.5,7.5,17,14.5,2),Ve(12,7.5,3.1,4.8,-180,0)),bell:()=>yt("M3.5 17.2A8.5 8.5 0 0 1 20.5 17.2Z",T(1.5,18.2,21,2.6,1.3),T(11.2,6.6,1.6,2.6,0),T(9.8,4.6,4.4,2.4,1.2)),cup:()=>yt("M4 6.5H17V13.5A6.5 6.5 0 0 1 4 13.5Z",Ve(17,10.2,1.7,3.6,-90,90),T(2,20.6,17,2,1),T(7,1.6,1.6,3.4,.8),T(11.6,1.6,1.6,3.4,.8)),card:()=>Dt(T(1.5,4.5,21,15,2.5),T(1.5,8,21,3,0),T(4.5,13.6,4.6,3.2,.6)),check:()=>Dt(H(12,12,10.5),G([[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:()=>Dt(H(12,12,10.5),H(12,7.2,1.6),T(10.6,10,2.8,8,.8)),home:()=>Dt(G([[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]]),T(10,14.5,4,7,[.6,.6,0,0])),pin:()=>Dt("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",H(12,9.5,3)),share:()=>yt(dr(6,12,18,5,1.8),dr(6,12,18,19,1.8),H(18,5,3.2),H(6,12,3.2),H(18,19,3.2)),download:()=>yt(T(10.6,2,2.8,9.5,0),G([[6,10],[18,10],[12,16.5]]),G([[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:()=>Dt(H(12,12,10.5),H(12,12,8.4),G([[11,5.4],[13,5.4],[13,11.3],[16.9,13.5],[15.9,15.2],[11,12.5]])),snowflake:qm,pumpkin:()=>yt(Sn(7.8,14.6,5.8,6.9),Sn(16.2,14.6,5.8,6.9),Sn(12,14.6,4.8,7.4),T(10.9,3.4,2.2,4.6,.8),zs([[13,4.2],[17.2,3],[16.2,5.4],[13,6]])),tree:()=>yt(G([[12,1.5],[16.8,8.2],[7.2,8.2]]),G([[12,5.2],[19,13.6],[5,13.6]]),G([[12,9.4],[21.2,19.2],[2.8,19.2]]),T(10.4,18.6,3.2,3.9,.4)),sparkle:()=>yt(G(Qe(9.5,13.5,9,2.4,4)),G(Qe(19,5,4,1.1,4))),gift:()=>yt(T(3,11.2,7.8,10.6,1),T(13.2,11.2,7.8,10.6,1),T(2,7.4,8.8,3.2,1),T(13.2,7.4,8.8,3.2,1),Sn(8.8,4.8,2.9,1.9),Sn(15.2,4.8,2.9,1.9))};function qs(t){return Wm[t]()}function Ws(t){return t===" "?.3:/[MWmw@%]/.test(t)?.92:/[A-Z0-9#&]/.test(t)?.72:/[il.,:;!'|1]/.test(t)?.32:.6}function ti(t){let e=0;for(let n of t)e+=Ws(n);return Math.max(e,1)}var Jo=t=>Math.round(Math.min(255,Math.max(0,t))).toString(16).padStart(2,"0");function fr(t,e,n){let o=J(t)??{r:0,g:0,b:0},r=J(e)??{r:255,g:255,b:255},i=Math.min(1,Math.max(0,n));return `#${Jo(o.r+(r.r-o.r)*i)}${Jo(o.g+(r.g-o.g)*i)}${Jo(o.b+(r.b-o.b)*i)}`}function Vs(t,e,n,o,r,i,a,l){let s=[...t],c=r*.08,u=s.map(f=>Ws(f)*r),m=u.reduce((f,h)=>f+h,0)+c*Math.max(0,s.length-1),d=i==="top"?o-r*.35:o+r*.35,p=[],b=0;return s.forEach((f,h)=>{let g=u[h],y=(b+g/2)/d;if(b+=g+c,f.trim()==="")return;let x=i==="top"?-Math.PI/2-m/2/d+y:Math.PI/2+m/2/d-y;p.push({text:f,x:e+d*Math.cos(x),y:n+d*Math.sin(x),fontSize:r,maxWidth:r*2,color:a,rotate:x*180/Math.PI+(i==="top"?90:-90),field:l});}),p}var hr=class extends Error{issues;constructor(e){super(`Invalid frame spec: ${e.slice(0,5).join("; ")}`),this.name="FrameSpecError",this.issues=e;}},js=new WeakMap;function Cn(t){if(t&&typeof t=="object"){let n=js.get(t);if(n)return n}if(t==null)throw new hr(['A "custom" frame needs a spec']);let e=Qs(t);if(!e.success)throw new hr(e.issues.map(Us));return typeof t=="object"&&js.set(t,e.data),e.data}var Vm=t=>{let e=J(t);return !!(e&&e.a>=1)};function jm(t,e){let n=mt(e,et);return t.qr.plate==="none"?{color:n,plate:false}:Vm(n)?{color:n,plate:true}:t.qr.plate==="background"?{color:n,plate:false}:{color:et,plate:true}}function Xs(t,e,n=et){let o=e.color||t.colors.frame,r=e.secondaryColor||t.colors.accent||o,i=s=>s==="frame"?o:s==="accent"?r:s==="background"?n:s,a=t.colors.text,l=e.textColor||(a===void 0?o:typeof a=="string"?a:fr(i(a.mix[0]),i(a.mix[1]),a.amount));return {frame:o,text:l,accent:r}}function Zm(t,e,n){let o=Xs(e,t,n),r=i=>{switch(i){case "frame":return o.frame;case "text":return o.text;case "accent":return o.accent;case "background":return n;default:return i}};return i=>typeof i=="string"?r(i):fr(r(i.mix[0]),r(i.mix[1]),i.amount)}function Zs(t,e,n=0,o=0){let r=un(t);return r?bo(r,e,n,o):""}function Xm(t,e,n,o){return `M${_(t-n)} ${_(e)}A${_(n)} ${_(o)} 0 1 1 ${_(t+n)} ${_(e)}A${_(n)} ${_(o)} 0 1 1 ${_(t-n)} ${_(e)}Z`}function Ym(t,e){let[n,o,r,i]=[t.x1*e,t.y1*e,t.x2*e,t.y2*e],a=Math.hypot(r-n,i-o),l=t.width*e/2,s=a>0?(r-n)/a:1,c=a>0?(i-o)/a:0,u=-c*l,m=s*l,d=(h,g)=>{let y=[n+s*h,o+c*h],x=[n+s*g,o+c*g];if(t.cap==="round"&&g-h>2*l){let C=[y[0]+s*l,y[1]+c*l],w=[x[0]-s*l,x[1]-c*l];return `M${_(C[0]-u)} ${_(C[1]-m)}L${_(w[0]-u)} ${_(w[1]-m)}A${_(l)} ${_(l)} 0 0 1 ${_(w[0]+u)} ${_(w[1]+m)}L${_(C[0]+u)} ${_(C[1]+m)}A${_(l)} ${_(l)} 0 0 1 ${_(C[0]-u)} ${_(C[1]-m)}Z`}return `M${_(y[0]-u)} ${_(y[1]-m)}L${_(x[0]-u)} ${_(x[1]-m)}L${_(x[0]+u)} ${_(x[1]+m)}L${_(y[0]+u)} ${_(y[1]+m)}Z`};if(!t.dash)return {type:"path",d:d(0,a),fillRule:"nonzero"};let p=t.dash[0]*e,b=p+t.dash[1]*e,f=[];for(let h=0;h+p<=a+1e-6;h+=b)f.push(d(h,h+p));return {type:"path",d:f.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:H(t.cx*e,t.cy*e,t.r*e)+(t.hole?H(t.cx*e,t.cy*e,t.hole*e):""),fillRule:t.hole?"evenodd":"nonzero"};case "ellipse":return {type:"path",d:Xm(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:Zs(t.d,e),fillRule:t.fillRule??"nonzero"};case "line":return Ym(t,e);default:{let n=qs(t.icon);return {type:"path",d:Zs(n.d,t.size*e/Hs,t.x*e,t.y*e),fillRule:n.fillRule}}}}function Jm(t){if(t.type==="rect"){let{x:e,y:n,width:o,height:r,radius:i,hole:a}=t;return [...Oe(e,n,o,r,i,i),...a?Oe(a.x,a.y,a.width,a.height,a.radius,a.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"}]:ne(t.d)}function t1(t,e,n){let o=Jm(t),r=Ia(o,.2),i=t.type==="rect"?t.hole?"evenodd":"nonzero":t.type==="path"?t.fillRule??"nonzero":"nonzero",a=e.direction==="vertical",l=h=>a?h[1]:h[0],s=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY;for(let h of r)for(let g of h)s=Math.min(s,l(g)),c=Math.max(c,l(g));if(!(c>s))return [];let u=e.steps??32,m=n(e.from),d=n(e.to),p=c-s,b=p*.002,f=[];for(let h=0;h<u;h++){let g=s+p*h/u,y=Math.min(c,s+p*(h+1)/u+(h+1<u?b:0)),x=a?{x0:Number.NEGATIVE_INFINITY,x1:Number.POSITIVE_INFINITY,y0:g,y1:y}:{x0:g,x1:y,y0:Number.NEGATIVE_INFINITY,y1:Number.POSITIVE_INFINITY},C=r.map(w=>qn(w,x)).filter(w=>w.length>2);C.length!==0&&f.push({type:"path",d:Fa(C),fill:fr(m,d,(h+.5)/u),fillRule:i});}return f}function e1(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 i=t1(o,t.fill.gradient,n);return r?[...i,{...o,fill:"none",...r}]:i}return [{...o,fill:n(t.fill),...r}]}function n1(t,e){let n=Math.min(t.maxLength??rt.maxTextLength,rt.maxTextLength),o=t.slot==="primary"?e.text??t.text:t.slot==="secondary"?e.secondaryText??t.text:t.text;return dn(o,n)}function r1(t){return t===void 0||!Number.isFinite(t)?1:Math.min(ln,Math.max(zn,t))}function o1(t,e,n,o,r,i){let a=r(t.color),l=t.weight==="regular"?{fontWeight:400}:{};if(t.type==="curved"){let{cx:f,cy:h,radius:g,side:y,spread:x=140}=t.curve,C=g*o*(x*Math.PI/180),w=Math.min(t.fontSize*o*n,C/(ti(e)+.08*e.length));return Vs(e,f*o,h*o,g*o,w,y,a,i).map(S=>({...S,...l}))}let s=t.box.x*o,c=t.box.y*o,u=t.box.width*o,m=t.box.height*o;if(!(m>0))return [];let d=(t.fontSize??t.box.height*Mo)*o,p=Math.min(d*n,m*Xn,u/ti(e)),b=t.align??"middle";return [{text:e,x:b==="start"?s:b==="end"?s+u:s+u/2,y:c+m/2+p*.35,fontSize:p,maxWidth:u,color:a,...b!=="middle"&&{align:b},...l,field:i}]}function i1(t){let e=0,n=0,o=0,r=0;return t.map(({command:i,values:a})=>{let l=i.toUpperCase(),s=i!==l;switch(l){case "Z":return e=o,n=r,{command:"Z",values:[]};case "H":return e=(s?e:0)+a[0],{command:"H",values:[e]};case "V":return n=(s?n:0)+a[0],{command:"V",values:[n]};case "A":return e=(s?e:0)+a[5],n=(s?n:0)+a[6],{command:"A",values:[...a.slice(0,5),e,n]};default:{let c=a.map((u,m)=>s?u+(m%2===0?e:n):u);return e=c.at(-2),n=c.at(-1),l==="M"&&(o=e,r=n),{command:l,values:c}}}})}function a1(t,e){let n=un(t);return n?bo(i1(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((i,a)=>a%2===1?e(i):i)})):t}function s1(t,e){let n=(o,r)=>{let i=e(o);return {y:i,height:e(o+r)-i}};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:a1(t.d,e)};case "line":return {...t,y1:e(t.y1),y2:e(t.y2)};default:return {...t,y:e(t.y)}}}function l1(t,e){if(e.length===0)return t;let n=r=>{let i=r;for(let a of e)i-=Math.min(Math.max(r-a.y,0),a.height);return i},o=(r,i)=>e.some(a=>r>=a.y-1e-6&&i<=a.y+a.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:i}=Ro(r);return !(i&&o(i.y0,i.y1))}).map(r=>s1(r,n)),labels:t.labels.map(r=>{if(r.type==="curved")return {...r,curve:{...r.curve,cy:n(r.curve.cy)}};let i=n(r.box.y);return {...r,box:{...r.box,y:i,height:n(r.box.y+r.box.height)-i}}})}}function wn(t,e,n,o,r={}){let i=new Map(e.labels.map(h=>[h.id,n1(h,n)])),a=l1(e,e.labels.flatMap(h=>h.collapse&&!i.get(h.id)?[h.collapse]:[])),l=t/a.qr.size,s=jm(a,o),c=Zm(n,a,s.color),u=a.shapes.flatMap(h=>e1(h,l,c));if(s.plate){let h=Kn(a)*l;u.push({type:"rect",x:a.qr.x*l-h,y:a.qr.y*l-h,width:t+2*h,height:t+2*h,radius:(a.qr.radius??0)*l,fill:s.color});}let m=r1(n.fontScale),d=a.labels.flatMap(h=>{let g=i.get(h.id);if(!g)return [];let y=(h.slot==="fixed"?void 0:r[h.slot])??h.id;return o1(h,g,m,l,c,y)}),p=d[0],b=p&&p.rotate===void 0?p:null,f=a.bleed??"none";return {width:a.artboard.width*l,height:a.artboard.height*l,qrX:a.qr.x*l,qrY:a.qr.y*l,qrSize:t,shapes:u,label:b,extraLabels:b?d.slice(1):d,squareEdges:f!=="none",color:c(f==="none"?"frame":f)}}function Ys(t,e,n){return wn(t,Cn(e.spec),e,n)}var Ks={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 ei={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 Js={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 tl={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 el={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 nl={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 rl={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 ol={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 il={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 pr={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 al={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 sl={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 ll={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 cl={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 ul={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 ml={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 dl={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 fl={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 hl={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 at=(t,e,n,o,r)=>({style:t,name:e,tags:r,labelOn:o,spec:n}),pl=[at("banner-bottom","Banner",ei,"frame",["bottom","band"]),at("banner-top","Top banner",Js,"frame",["top","band"]),at("banner-top-bottom","Two banners",tl,"frame",["top","bottom","band"]),at("border","Border",el,"background",["square","outline"]),at("rounded-border","Rounded",cl,"background",["border","outline"]),at("gradient-border","Gradient",pr,"background",["border","colorful"]),at("focus","Focus",il,"background",["corners","brackets"]),at("speech-bubble","Bubble",ul,"frame",["speech"]),at("speech-bubble-top","Bubble top",ml,"frame",["speech"]),at("chat-bubble","Chat",nl,"frame",["message","bubble"]),at("circle","Circle",rl,"frame",["round","ring","curved"]),at("badge","Ribbon",Ks,"frame",["badge","banner"]),at("sticker","Sticker",dl,"frame",["label"]),at("polaroid","Polaroid",ll,"frame",["photo","picture"]),at("phone","Phone",sl,"background",["mobile","screen"]),at("ticket","Ticket",hl,"frame",["event","pass"]),at("tag","Tag",fl,"frame",["price","label"]),at("envelope","Envelope",ol,"frame",["mail","letter"]),at("menu-card","Menu card",al,"background",["menu","restaurant"])],A1=new Map(pl.map(t=>[t.style,t]));function P1(t){return A1.get(t)}Object.fromEntries(pl.map(t=>[t.style,t.spec]));({from:pr.colors.frame,to:pr.colors.accent});var v1={primary:"text",secondary:"secondaryText"};function gl(t,e,n){let o=P1(e.style)?.spec??ei;return wn(t,Cn(o),e,n,v1)}var ni="system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif";var I1="data-qrdx-frame-label";function Xt(t){return !!(t?.style&&t.style!=="none")}function je(t,e,n){return e.style===Ga?Ys(t,e,n):gl(t,e,n)}function Mn(t,e){if(!Xt(e))return {width:t,height:t};let{width:n,height:o}=je(t,e);return {width:n,height:o}}var W=t=>Q(t,2);function bl({x:t,y:e,width:n,height:o,radius:r}){let i=W(Math.min(r,n/2,o/2)),[a,l,s,c]=[W(t),W(e),W(n),W(o)];return i<=0?P`M${a} ${l}h${s}v${c}h${-s}z`:P`M${a+i} ${l}h${W(s-2*i)}a${i} ${i} 0 0 1 ${i} ${i}`+P`v${W(c-2*i)}a${i} ${i} 0 0 1 ${-i} ${i}`+P`h${W(-(s-2*i))}a${i} ${i} 0 0 1 ${-i} ${-i}`+P`v${W(-(c-2*i))}a${i} ${i} 0 0 1 ${i} ${-i}z`}function gr(t){return t.stroke&&t.strokeWidth?{stroke:t.stroke,strokeWidth:W(t.strokeWidth)}:{}}function _l(t,e){return t.type==="rect"&&t.hole?E("path",{d:bl(t)+bl(t.hole),fill:t.fill,fillRule:"evenodd",...gr(t)},e):t.type==="polygon"?E("polygon",{fill:t.fill,points:t.points.map(([n,o])=>`${W(n)},${W(o)}`).join(" "),...gr(t)},e):t.type==="path"?E("path",{d:t.d,fill:t.fill,...t.fillRule==="evenodd"&&{fillRule:"evenodd"},...gr(t)},e):vo("rect",{...gr(t),fill:t.fill,height:W(t.height),key:e,width:W(t.width),x:W(t.x),y:W(t.y),...t.radius>0&&{rx:W(t.radius),ry:W(t.radius)}})}function yl(t){return t.shapes.map((e,n)=>_l(e,n))}function xl(t,e){let{size:n,frame:o,bgColor:r,svgProps:i,markLabels:a}=e,l=je(n,o,r),s=F1(l),c=W(l.width),u=W(l.height);return ct("svg",{height:u,viewBox:`0 0 ${c} ${u}`,width:c,xmlns:"http://www.w3.org/2000/svg",...i,children:[E("g",{"data-qrdx-frame":o.style,children:l.shapes.map((m,d)=>_l(m,d))}),De(t,{x:W(l.qrX),y:W(l.qrY),width:n,height:n}),s.map((m,d)=>E("text",{"data-max-width":W(m.maxWidth),fill:m.color,fontFamily:ni,fontSize:W(m.fontSize),fontWeight:m.fontWeight??700,textAnchor:m.align??"middle",x:W(m.x),y:W(m.y),...m.rotate&&{transform:`rotate(${W(m.rotate)} ${W(m.x)} ${W(m.y)})`},...a&&m.field&&{[I1]:m.field},children:m.text},d))]})}function F1(t){return [...t.label?[t.label]:[],...t.extraLabels??[]]}var L1={2:6,3:12};function $l(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 i=L1[o.length];for(let a=1;a<=i;a++){let l=a/i,s=1-l;if(o.length===2){let[c]=o;e.push([s*s*n[0]+2*s*l*c[0]+l*l*r[0],s*s*n[1]+2*s*l*c[1]+l*l*r[1]]);}else {let[c,u]=o;e.push([s*s*s*n[0]+3*s*s*l*c[0]+3*s*l*l*u[0]+l*l*l*r[0],s*s*s*n[1]+3*s*s*l*c[1]+3*s*l*l*u[1]+l*l*l*r[1]]);}}}n=r;}return e}function Cl(t,e){let n=[];for(let o of t)for(let r=0;r<o.length;r++){let[i,a]=o[r],[l,s]=o[(r+1)%o.length];a<=e!=s<=e&&n.push(i+(e-a)/(s-a)*(l-i));}return n.sort((o,r)=>o-r)}function wl(t,e){let n=0;for(let o of t)if(o<e)n++;else break;return n%2===1}function T1(t,e,n){return wl(Cl(t,n),e)}function Ml(t){let e=new Map;return (n,o)=>{let r=e.get(o);return r||(r=Cl(t,o),e.set(o,r)),wl(r,n)}}function k1(t,e,n,o){let r=n[0]-t,i=n[1]-e,a=o[0]-n[0],l=o[1]-n[1],s=u=>Math.max(Math.abs(r+u*a),Math.abs(i+u*l)),c=Math.min(s(0),s(1));for(let[u,m]of [[i-r,a-l],[-(r+i),a+l]])if(m!==0){let d=u/m;d>0&&d<1&&(c=Math.min(c,s(d)));}return c}function N1(t,e,n){if(!T1(t,e,n))return 0;let o=Number.POSITIVE_INFINITY;for(let r of t)for(let i=0;i<r.length;i++)o=Math.min(o,k1(e,n,r[i],r[(i+1)%r.length]));return Number.isFinite(o)?o:0}function O1(t){let e=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,r=Number.NEGATIVE_INFINITY;for(let i of t)for(let[a,l]of i)e=Math.min(e,a),n=Math.min(n,l),o=Math.max(o,a),r=Math.max(r,l);return {x0:e,y0:n,x1:o,y1:r}}function Rl(t){let e=t.map($l),n=O1(e),o=n.x1-n.x0,r=n.y1-n.y0;if(!(o>0&&r>0))return null;let i=(b,f)=>{let h=Math.max(b-n.x0,n.x1-b,f-n.y0,n.y1-f);return h>0?N1(e,b,f)/(2*h):0},a={cx:n.x0+o/2,cy:n.y0+r/2,value:0};a.value=i(a.cx,a.cy);let l=32;for(let b=1;b<l;b++)for(let f=1;f<l;f++){let h=n.x0+o*f/l,g=n.y0+r*b/l,y=i(h,g);y>a.value&&(a={cx:h,cy:g,value:y});}let s=o/l,c=r/l;for(let b=0;b<6;b++){let f=a;for(let h=-2;h<=2;h++)for(let g=-2;g<=2;g++){let y=f.cx+s*g/2,x=f.cy+c*h/2,C=i(y,x);C>a.value&&(a={cx:y,cy:x,value:C});}s/=2,c/=2;}if(a.value<=0)return null;let m=.5/Math.max(a.cx-n.x0,n.x1-a.cx,a.cy-n.y0,n.y1-a.cy),d=([b,f])=>[.5+(b-a.cx)*m,.5+(f-a.cy)*m],p=t.map(b=>({start:d(b.start),segments:b.segments.map(f=>f.map(d))}));return {rings:p,polygons:p.map($l),half:a.value}}function El(t,e){let n=([r,i])=>`${_(r*e)} ${_(i*e)}`,o="";for(let r of t.rings){o+=`M${n(r.start)}`;for(let i of r.segments){let a=i.length===1?"L":i.length===2?"Q":"C";o+=a+i.map(n).join(" ");}o+="Z";}return o}var D1={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]]]},Sl;function Al(){return Sl??=Rl([D1]),Sl}function B1(t){let{width:e,height:n,cells:o}=t;return Number.isInteger(e)&&Number.isInteger(n)&&e>=fo&&n>=fo&&e<=mo&&n<=mo&&typeof o=="string"&&o.length===e*n&&/^[01]*$/.test(o)?(r,i)=>r>=0&&i>=0&&r<e&&i<n&&o[i*e+r]==="1":null}var Bt=([t,e])=>`${t},${e}`;function G1(t,e,n){let o=(s,c)=>t(s-1,c-1),r=new Map,i=(s,c)=>{for(let[u,m]of [[s,c],[c,s]]){let d=r.get(Bt(u))??[];d.push(m),r.set(Bt(u),d);}};for(let s=0;s<=n;s++)for(let c=0;c<=e;c++){let u=o(c,s),m=o(c+1,s),d=o(c+1,s+1),p=o(c,s+1),b=[c,s-.5],f=[c+.5,s],h=[c,s+.5],g=[c-.5,s];switch((u?8:0)+(m?4:0)+(d?2:0)+(p?1:0)){case 1:case 14:i(g,h);break;case 2:case 13:i(h,f);break;case 3:case 12:i(g,f);break;case 4:case 11:i(b,f);break;case 6:case 9:i(b,h);break;case 7:case 8:i(g,b);break;case 5:i(b,f),i(g,h);break;case 10:i(g,b),i(h,f);break;}}let a=[],l=new Set;for(let[s,c]of r){if(l.has(s)||c.length===0)continue;let[u,m]=s.split(",").map(Number),d=[[u,m]];l.add(s);let p=[u,m],b=c[0];for(;!l.has(Bt(b));){l.add(Bt(b)),d.push(b);let f=Q1(r.get(Bt(b))??[],p,l);if(!f)break;p=b,b=f;}d.length>=3&&a.push(U1(d));}return a}function Q1(t,e,n){let o=Bt(e);return t.find(r=>Bt(r)!==o&&!n.has(Bt(r)))??t.find(r=>Bt(r)!==o)}function U1(t){let e=[];for(let n=0;n<t.length;n++){let o=t[(n-1+t.length)%t.length],r=t[n],i=t[(n+1)%t.length],a=(r[0]-o[0])*(i[1]-r[1])-(r[1]-o[1])*(i[0]-r[0]);Math.abs(a)>1e-9&&e.push(r);}return e.length>=3?e:t}function H1(t){let e=(i,a)=>[(i[0]+a[0])/2,(i[1]+a[1])/2],n=t.length,o=e(t[n-1],t[0]),r=t.map((i,a)=>[i,e(i,t[(a+1)%n])]);return {start:o,segments:r}}var Rn=new Map;function Pl(t){let e=`${t.width}x${t.height}:${t.cells}`,n=Rn.get(e);if(n)return n;let o=B1(t),r;if(!o)r={outline:null,problem:"invalid"};else if(t.cells.includes("1")){let i=G1(o,t.width,t.height),a=i.length>0?Rl(i.map(H1)):null;r=a&&2*a.half>=_a?{outline:a,problem:null}:{outline:null,problem:a?"thin":"empty"};}else r={outline:null,problem:"empty"};return Rn.size>16&&Rn.delete(Rn.keys().next().value),Rn.set(e,r),r}var z1=1,vl=.5,Il=.5,q1=.5;function br(t){return Math.max(t,ba)}function _r(t){return t==="heart"?Al():typeof t=="object"&&t?.type==="silhouette"?Pl(t).outline:null}function Fl(t){return t==="circle"||_r(t)!==null}function Pt(t,e,n){if(n==="circle"){let a=br(e),l=(t/2+a)*Math.SQRT2+z1;return Math.ceil(l-t/2)}let o=_r(n);if(!o)return e;let r=br(e),i=(t+2*(r+q1))/(2*o.half);return Math.ceil((i-t)/2-1e-9)}function Ll(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 W1(t,e,n){let o=Pt(e,n,"circle"),r=br(n),i=e+2*o,a=i/2,l=a-vl-.5,s=Ll(Number.parseInt(se(t),36)||1),c=o-r,u=o+e+r;return Array.from({length:i},(m,d)=>Array.from({length:i},(p,b)=>{let f=s()<Il;return b>=c&&b<u&&d>=c&&d<u?false:f&&Math.hypot(b+.5-a,d+.5-a)<=l}))}var V1=Array.from({length:8},(t,e)=>{let n=e*Math.PI/4;return [Math.cos(n),Math.sin(n)]});function Tl(t,e,n,o){if(o==="circle")return W1(t,e,n);let r=_r(o);if(!r)return null;let i=Pt(e,n,o),a=br(n),l=e+2*i,s=Ml(r.polygons),c=.5+vl,u=(b,f)=>{let h=b+.5,g=f+.5;return s(h/l,g/l)?V1.every(([y,x])=>s((h+y*c)/l,(g+x*c)/l)):false},m=Ll(Number.parseInt(se(t),36)||1),d=i-a,p=i+e+a;return Array.from({length:l},(b,f)=>Array.from({length:l},(h,g)=>{let y=m()<Il;return g>=d&&g<p&&f>=d&&f<p?false:y&&u(g,f)}))}function kl(t,e){if(t==="circle")return {circle:e/2};let n=_r(t);return n?{path:El(n,e)}:null}function Gt(t,e,n){return Ct.QrCode.encodeSegments(Ct.QrSegment.makeSegments(t),Gn[e],Ct.QrCode.MIN_VERSION,Ct.QrCode.MAX_VERSION,-1,!n)}function j1(t){return t==="top-left"?0:t==="top-right"?1:3}function yr(t,e,n,o="circle",r="top-left"){let i=n*2,a=n,l=i/3;switch(o){case "leaf":case "leaf-reverse":case "drop":case "drop-reverse":{let s=j1(r),c=(s+2)%4,u=1.3*l,m=.7*l,d=b=>{switch(o){case "leaf":return b===s||b===c;case "leaf-reverse":return !(b===s||b===c);case "drop":return b===s;default:return b===c}},p=[0,1,2,3].map(b=>d(b)?m:u);return E("path",{d:T(t-n,e-n,i,i,p)})}case "extra-rounded":return E("path",{d:T(t-n,e-n,i,i,1.15*l)});case "plus":{let s=1.15*l,c=n;return E("path",{d:G([[t-s,e-c],[t+s,e-c],[t+s,e-s],[t+c,e-s],[t+c,e+s],[t+s,e+s],[t+s,e+c],[t-s,e+c],[t-s,e+s],[t-c,e+s],[t-c,e-s],[t-s,e-s]])})}case "cross-rounded":{let s=1.15*l,c=.5*l;return E("path",{d:T(t-n,e-s,i,2*s,c)+T(t-s,e-n,2*s,i,c)})}case "hexagon":return E("path",{d:G(Ge(t,e,1.72*l,6))});case "octagon":return E("path",{d:G(Ge(t,e,n/Math.cos(Math.PI/8),8,22.5))});case "flower":{let s=.6*l,c=.9*l;return E("path",{d:H(t-s,e-s,c)+H(t+s,e-s,c)+H(t+s,e+s,c)+H(t-s,e+s,c)+H(t,e,1.2*l)})}case "heart":return E("path",{d:He(t,e+.12*l,3.5*l)});case "squircle":return E("path",{d:G(Ue(t,e,n,n,4,64))});case "dots":{let s=[];for(let c of [-1,0,1])for(let u of [-1,0,1])s.push(H(t+u*l*.82,e+c*l*.82,.58*l));return E("path",{d:s.join("")})}case "cushion":return E("path",{d:bn(t-n,e-n,i,.6*l,.15*l)});case "square":return E("rect",{height:_(i),transform:P`rotate(0,${t},${e})`,width:_(i),x:_(t-a),y:_(e-a)});case "rounded":return E("rect",{height:_(i),rx:_(n*.5),ry:_(n*.5),transform:P`rotate(0,${t},${e})`,width:_(i),x:_(t-a),y:_(e-a)});case "diamond":return E("path",{d:P`M ${t-a*.714286} ${e-a*.714286}v ${i*.714286}h ${i*.714286}v -${i*.714286}z`,transform:P`rotate(45,${t},${e})`});case "message":{let s=i/30,c=d=>(d-40)*s+t,u=d=>(d-40)*s+e,m=P`M ${c(25)} ${u(35.714285714285715)}v ${8.571428571428571*s}a ${10.714285714285714*s} ${10.714285714285714*s}, 0, 0, 0, ${10.714285714285714*s} ${10.714285714285714*s}h ${19.285714285714285*s}v -${19.285714285714285*s}a ${10.714285714285714*s} ${10.714285714285714*s}, 0, 0, 0, -${10.714285714285714*s} -${10.714285714285714*s}h -${8.571428571428571*s}a ${10.714285714285714*s} ${10.714285714285714*s}, 0, 0, 0, -${10.714285714285714*s} ${10.714285714285714*s}`;return E("path",{clipRule:"evenodd",d:m,transform:P`rotate(0,${t},${e})`})}case "message-reverse":{let s=i/30,c=d=>(d-40)*s+t,u=d=>(d-40)*s+e,m=P`M ${c(25)} ${u(35.714285714285715)}v ${8.571428571428571*s}a ${10.714285714285714*s} ${10.714285714285714*s}, 0, 0, 0, ${10.714285714285714*s} ${10.714285714285714*s}h ${19.285714285714285*s}v -${19.285714285714285*s}a ${10.714285714285714*s} ${10.714285714285714*s}, 0, 0, 0, -${10.714285714285714*s} -${10.714285714285714*s}h -${8.571428571428571*s}a ${10.714285714285714*s} ${10.714285714285714*s}, 0, 0, 0, -${10.714285714285714*s} ${10.714285714285714*s}`;return E("path",{clipRule:"evenodd",d:m,transform:P`rotate(-180,${t},${e})`})}case "diya":{let s=i/30,c=d=>(d-40)*s+t,u=d=>(d-40)*s+e,m=P`M ${c(25)} ${u(35.714285714285715)}v ${8.571428571428571*s}a ${10.714285714285714*s} ${10.714285714285714*s}, 0, 0, 0, ${10.714285714285714*s} ${10.714285714285714*s}h ${19.285714285714285*s}v -${19.285714285714285*s}a ${10.714285714285714*s} ${10.714285714285714*s}, 0, 0, 0, -${10.714285714285714*s} -${10.714285714285714*s}h -${8.571428571428571*s}H ${c(25)}z`;return E("path",{clipRule:"evenodd",d:m,transform:P`rotate(0,${t},${e})`})}case "diya-reverse":{let s=i/30,c=d=>(d-40)*s+t,u=d=>(d-40)*s+e,m=P`M ${c(25)} ${u(35.714285714285715)}v ${19.285714285714285*s}h ${19.285714285714285*s}a ${10.714285714285714*s} ${10.714285714285714*s}, 0, 0, 0, ${10.714285714285714*s} -${10.714285714285714*s}v -${19.285714285714285*s}h -${19.285714285714285*s}a ${10.714285714285714*s} ${10.714285714285714*s}, 0, 0, 0, -${10.714285714285714*s} ${10.714285714285714*s}z`;return E("path",{clipRule:"evenodd",d:m,transform:P`rotate(0,${t},${e})`})}case "rounded-triangle":{let s=i/21,c=d=>(d-40)*s+t,u=d=>(d-40)*s+e,m=P`M ${c(33.57142857142857)} ${u(29.285714285714285)}h ${12.857142857142856*s}c ${4.285714285714286*s} 0 ${4.285714285714286*s} ${4.285714285714286*s} ${4.285714285714286*s} ${4.285714285714286*s}v ${12.857142857142856*s}c 0 ${4.285714285714286*s} -${4.285714285714286*s} ${4.285714285714286*s} -${4.285714285714286*s} ${4.285714285714286*s}h -${12.857142857142856*s}c -${4.285714285714286*s} 0 -${4.285714285714286*s} -${4.285714285714286*s} -${4.285714285714286*s} -${4.285714285714286*s}v -${12.857142857142856*s}c 0 -${4.285714285714286*s} ${4.285714285714286*s} -${4.285714285714286*s} ${4.285714285714286*s} -${4.285714285714286*s}z`;return E("path",{d:m,transform:P`rotate(45,${t},${e})`})}case "star":{let s=i/27,c=d=>(d-40)*s+t,u=d=>(d-40)*s+e,m=P`M ${c(38.84615384615385)},${u(26.546153846153846)}c${.6692307692307691*s},-${1.0153846153846153*s},${2.215384615384615*s},-${1.0153846153846153*s},${2.884615384615384*s},0l${4.038461538461538*s},${6.069230769230768*s}c${.23076923076923075*s},${.3461538461538461*s},${.6*s},${.6*s},${1.0153846153846153*s},${.7153846153846153*s}l${7.223076923076922*s},${1.823076923076923*s}c${1.2*s},${.3*s},${1.6846153846153844*s},${1.7076923076923076*s},${.8999999999999999*s},${2.6538461538461533*s}l-${4.73076923076923*s},${5.584615384615384*s}c-${.2769230769230769*s},${.3230769230769231*s},-${.41538461538461535*s},${.7384615384615384*s},-${.3923076923076923*s},${1.1307692307692307*s}l${.4384615384615384*s},${7.199999999999999*s}c${.06923076923076922*s},${1.2*s},-${1.1769230769230767*s},${2.0769230769230766*s},-${2.3307692307692305*s},${1.6384615384615382*s}l-${6.9692307692307685*s},-${2.6076923076923073*s}c-${.3923076923076923*s},-${.16153846153846155*s},-${.8538461538461538*s},-${.16153846153846155*s},-${1.2461538461538462*s},0l-${6.9692307692307685*s},${2.6076923076923073*s}c-${1.1538461538461537*s},${.4384615384615384*s},-${2.4*s},-${.4384615384615384*s},-${2.3307692307692305*s},-${1.6384615384615382*s}l${.4384615384615384*s},-${7.199999999999999*s}c${.023076923076923075*s},-${.41538461538461535*s},-${.11538461538461538*s},-${.8307692307692307*s},-${.3923076923076923*s},-${1.1307692307692307*s}l-${4.73076923076923*s},-${5.584615384615384*s}c-${.7846153846153846*s},-${.923076923076923*s},-${.3230769230769231*s},-${2.3307692307692305*s},${.8999999999999999*s},-${2.6538461538461533*s}l${7.223076923076922*s},-${1.823076923076923*s}c${.41538461538461535*s},-${.11538461538461538*s},${.7846153846153846*s},-${.3461538461538461*s},${1.0153846153846153*s},-${.7153846153846153*s}l${4.038461538461538*s},-${6.069230769230768*s}z`;return E("path",{clipRule:"evenodd",d:m,transform:P`rotate(0,${t},${e})`})}case "banner":{let s=i/28;return E("g",{transform:P`translate(${t-40*s},${e-40*s}) scale(${_(s,6)})`,children:E("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 E("circle",{cx:_(t),cy:_(e),r:_(n),transform:P`rotate(0,${t},${e})`})}}function Ze(t,e,n,o){let r=t==="top-left"?0:t==="top-right"?1:3,i=(r+2)%4;return [0,1,2,3].map(a=>a===r||o&&a===i?n:e)}function Nl(t,e,n,o){let r=n/7,i=Math.max(0,(o+Math.SQRT2-2)*r);return G(Qo(t,e,n,o*r))+G(Qo(t+r,e+r,5*r,i))}function Ol(t,e,n,o,r=false){let i=n/7,a=l=>r?Ze(o,0,l,true):Ze(o,l,0,true);return T(t,e,n,n,a(2.5*i))+T(t+i,e+i,5*i,5*i,a(1.5*i))}function Z1(t,e,n,o){let r=n/7;return T(t,e,n,n,Ze(o,2.6*r,0,false))+T(t+r,e+r,5*r,5*r,Ze(o,1.6*r,0,false))}function X1(t,e,n){let o=n/7,r=t+n/2,i=e+n/2;return G(Ue(r,i,3.5*o,3.5*o,4,96))+G(Ue(r,i,2.5*o,2.5*o,4,96))}function Y1(t,e,n){let o=n/7,r=.12*o;return bn(t,e,n,1.4*o,r)+bn(t+o,e+o,5*o,.7*o,r)}function K1(t,e,n){let o=n/7;return Ho(t,e,n,.7*o,3.9*o,o)+Ho(t+o,e+o,5*o,.35*o,2.7*o,.8*o)}function J1(t,e,n,o){let r=n/7;return T(t,e,n,n,Ze(o,.5*r,2.5*r,false))+T(t+r,e+r,5*r,5*r,Ze(o,.25*r,1.5*r,false))}function td(t,e,n){return T(t+n,e+n,5*n,5*n,1.5*n)}function ed(t,e,n){return G(Ue(t,e,3.5*n,3.5*n,2.75,96))}function nd(t,e,n){let o=n/7;return ed(t+n/2,e+n/2,o)+sr(t+o,e+o,5*o,5*o,.52*o)}function rd(t,e,n){let o=n/7;return Uo(t,e,n,n,1.15*o)+Uo(t+o,e+o,5*o,5*o,.74*o)}function od(t,e,n){let o=n/7;return sr(t,e,n,n,.8*o)+sr(t+o,e+o,5*o,5*o,.52*o)}function ri(t,e,n,o){let[r,i,a,l]=o,s=(u,m)=>P`${t+u} ${e+m}`,c=(u,m,d)=>u[0]==="round"?P`A${u[1]} ${u[1]} 0 0 1 ${s(m,d)}`:P`L${s(m,d)}`;return P`M${s(r[1],0)}L${s(n-i[1],0)}`+c(i,n,i[1])+P`L${s(n,n-a[1])}`+c(a,n-a[1],n)+P`L${s(l[1],n)}`+c(l,0,n-l[1])+P`L${s(0,r[1])}`+c(r,r[1],0)+"Z"}function id(t,e){let n=[0,1,2,3].map(r=>e(r)?["round",2.8*t]:["cut",1.6*t]),o=[0,1,2,3].map(r=>e(r)?["round",1.5*t]:["cut",1.01*t]);return [n,o]}function ad(t,e,n,o){let r=n/7,i=o==="top-left"?0:o==="top-right"?1:3,a=(i+2)%4,[l,s]=id(r,c=>c===i||c===a);return ri(t,e,n,l)+ri(t+r,e+r,5*r,s)}function sd(t,e,n){let o=n/7;return ri(t,e,n,[["cut",1.6*o],["cut",1.6*o],["round",3*o],["round",3*o]])+td(t,e,o)}function ld(t,e,n){let o=n/7;return P`M ${t} ${e}v ${n}h ${n}v -${n}z`+P`M ${t+o} ${e+o}h ${5*o}v ${5*o}h -${5*o}z`}function cd(t,e,n){let o=n/7,r=o*.875,i=o*.4375,a=P`M ${t+r} ${e}`+P`h ${n-2*r}`+P`a ${r} ${r} 0 0 1 ${r} ${r}`+P`v ${n-2*r}`+P`a ${r} ${r} 0 0 1 ${-r} ${r}`+P`h ${-(n-2*r)}`+P`a ${r} ${r} 0 0 1 ${-r} ${-r}`+P`v ${-(n-2*r)}`+P`a ${r} ${r} 0 0 1 ${r} ${-r}z`,l=P`M ${t+o+i} ${e+o}`+P`h ${5*o-2*i}`+P`a ${i} ${i} 0 0 1 ${i} ${i}`+P`v ${5*o-2*i}`+P`a ${i} ${i} 0 0 1 ${-i} ${i}`+P`h ${-(5*o-2*i)}`+P`a ${i} ${i} 0 0 1 ${-i} ${-i}`+P`v ${-(5*o-2*i)}`+P`a ${i} ${i} 0 0 1 ${i} ${-i}z`;return a+l}function ud(t,e,n){let o=t+n/2,r=e+n/2,i=Q(n/2),a=Q(n*(2.5/7));return P`M ${o-i} ${r}`+P`a ${i} ${i} 0 1 0 ${i*2} 0`+P`a ${i} ${i} 0 1 0 ${-i*2} 0z`+P`M ${o-a} ${r}`+P`a ${a} ${a} 0 1 1 ${a*2} 0`+P`a ${a} ${a} 0 1 1 ${-a*2} 0z`}function md(t,e,n){let o=n/74.7002,r=l=>l*o+t,i=l=>l*o+e;return P`M${r(37.3496)} ${i(0)}C${r(39.2939)} ${i(0)} ${r(40.9948)} ${i(1.03842)} ${r(41.9287)} ${i(2.59082)}C${r(43.2293)} ${i(1.34013)} ${r(45.1347)} ${i(.780267)} ${r(47.0098)} ${i(1.28027)}C${r(48.8871)} ${i(1.78928)} ${r(50.261)} ${i(3.23767)} ${r(50.7578)} ${i(4.98438)}C${r(52.3454)} ${i(4.0996)} ${r(54.3432)} ${i(4.047)} ${r(56.0303)} ${i(5.01953)}C${r(57.7094)} ${i(5.98752)} ${r(58.6586)} ${i(7.73647)} ${r(58.6924)} ${i(9.5459)}C${r(60.4517)} ${i(9.10661)} ${r(62.3883)} ${i(9.57215)} ${r(63.7598)} ${i(10.9502)}C${r(65.1282)} ${i(12.3253)} ${r(65.5963)} ${i(14.2585)} ${r(65.1641)} ${i(16.0127)}C${r(66.974)} ${i(16.044)} ${r(68.7242)} ${i(16.9982)} ${r(69.7002)} ${i(18.6797)}C${r(70.6781)} ${i(20.3647)} ${r(70.6241)} ${i(22.3635)} ${r(69.7402)} ${i(23.9502)}C${r(71.4776)} ${i(24.4496)} ${r(72.9194)} ${i(25.8232)} ${r(73.4199)} ${i(27.7002)}C${r(73.927)} ${i(29.5707)} ${r(73.3661)} ${i(31.4794)} ${r(72.1104)} ${i(32.7822)}C${r(73.6621)} ${i(33.7163)} ${r(74.7002)} ${i(35.4166)} ${r(74.7002)} ${i(37.3604)}C${r(74.7001)} ${i(39.307)} ${r(73.6582)} ${i(41.0084)} ${r(72.1025)} ${i(41.9414)}C${r(73.357)} ${i(43.245)} ${r(73.9207)} ${i(45.1525)} ${r(73.4199)} ${i(47.0303)}C${r(72.9187)} ${i(48.9027)} ${r(71.4782)} ${i(50.2735)} ${r(69.7383)} ${i(50.7734)}C${r(70.6201)} ${i(52.3601)} ${r(70.6716)} ${i(54.3549)} ${r(69.7002)} ${i(56.04)}C${r(68.7237)} ${i(57.7225)} ${r(66.9721)} ${i(58.6729)} ${r(65.1611)} ${i(58.7031)}C${r(65.598)} ${i(60.4623)} ${r(65.131)} ${i(62.3982)} ${r(63.7598)} ${i(63.7695)}C${r(62.3847)} ${i(65.138)} ${r(60.4515)} ${i(65.6061)} ${r(58.6973)} ${i(65.1738)}C${r(58.6635)} ${i(66.9833)} ${r(57.7094)} ${i(68.7322)} ${r(56.0303)} ${i(69.7002)}C${r(54.3461)} ${i(70.6777)} ${r(52.348)} ${i(70.6248)} ${r(50.7617)} ${i(69.7422)}C${r(50.2643)} ${i(71.4831)} ${r(48.8896)} ${i(72.9284)} ${r(47.0098)} ${i(73.4297)}C${r(45.1389)} ${i(73.9368)} ${r(43.2296)} ${i(73.3763)} ${r(41.9268)} ${i(72.1201)}C${r(40.9927)} ${i(73.6717)} ${r(39.2932)} ${i(74.71)} ${r(37.3496)} ${i(74.71)}C${r(35.4051)} ${i(74.7098)} ${r(33.7042)} ${i(73.6711)} ${r(32.7705)} ${i(72.1182)}C${r(31.4697)} ${i(73.3758)} ${r(29.5597)} ${i(73.9418)} ${r(27.6797)} ${i(73.4404)}V${i(73.4502)}C${r(25.8065)} ${i(72.9422)} ${r(24.434)} ${i(71.4985)} ${r(23.9346)} ${i(69.7568)}C${r(22.3504)} ${i(70.6301)} ${r(20.3591)} ${i(70.6781)} ${r(18.6797)} ${i(69.71)}C${r(16.9957)} ${i(68.7391)} ${r(16.045)} ${i(66.9831)} ${r(16.0166)} ${i(65.168)}C${r(14.2547)} ${i(65.6091)} ${r(12.3134)} ${i(65.1435)} ${r(10.9395)} ${i(63.7695)}C${r(9.5687)} ${i(62.3919)} ${r(9.10168)} ${i(60.454)} ${r(9.53809)} ${i(58.6973)}C${r(7.72791)} ${i(58.6641)} ${r(5.97815)} ${i(57.71)} ${r(5.00977)} ${i(56.0303)}C${r(4.03552)} ${i(54.3517)} ${r(4.08377)} ${i(52.3649)} ${r(4.95801)} ${i(50.7812)}C${r(3.21705)} ${i(50.2839)} ${r(1.77087)} ${i(48.9101)} ${r(1.26953)} ${i(47.0303)}V${i(47.0205)}C${r(.762081)} ${i(45.1489)} ${r(1.32758)} ${i(43.2375)} ${r(2.58496)} ${i(41.9346)}C${r(1.03604)} ${i(41)} ${r(108484e-9)} ${i(39.3019)} ${r(0)} ${i(37.3604)}C${r(0)} ${i(35.4159)} ${r(1.03815)} ${i(33.7141)} ${r(2.59082)} ${i(32.7803)}C${r(1.34044)} ${i(31.4797)} ${r(.780389)} ${i(29.575)} ${r(1.28027)} ${i(27.7002)}C${r(1.78258)} ${i(25.8232)} ${r(3.22806)} ${i(24.4482)} ${r(4.97363)} ${i(23.9512)}C${r(4.08938)} ${i(22.3638)} ${r(4.03743)} ${i(20.3664)} ${r(5.00977)} ${i(18.6797)}C${r(5.97815)} ${i(16.9999)} ${r(7.72788)} ${i(16.0496)} ${r(9.53809)} ${i(16.0166)}C${r(9.10139)} ${i(14.2576)} ${r(9.56846)} ${i(12.3214)} ${r(10.9395)} ${i(10.9502)}C${r(12.3171)} ${i(9.57911)} ${r(14.2558)} ${i(9.11137)} ${r(16.0127)} ${i(9.54785)}C${r(16.0426)} ${i(7.73421)} ${r(16.9969)} ${i(5.97989)} ${r(18.6797)} ${i(5.00977)}C${r(20.3596)} ${i(4.03474)} ${r(22.3521)} ${i(4.08468)} ${r(23.9365)} ${i(4.96094)}C${r(24.4378)} ${i(3.22749)} ${r(25.8059)} ${i(1.7898)} ${r(27.6797)} ${i(1.29004)}C${r(29.5511)} ${i(.78264)} ${r(31.4617)} ${i(1.34357)} ${r(32.7646)} ${i(2.60059)}C${r(33.6971)} ${i(1.04268)} ${r(35.4013)} ${i(152405e-9)} ${r(37.3496)} ${i(0)}ZM${r(41.0615)} ${i(9.17578)}C${r(40.1006)} ${i(10.1057)} ${r(38.793)} ${i(10.6797)} ${r(37.3496)} ${i(10.6797)}C${r(35.9064)} ${i(10.6796)} ${r(34.5985)} ${i(10.1066)} ${r(33.6377)} ${i(9.17676)}C${r(32.9511)} ${i(10.3241)} ${r(31.8358)} ${i(11.2176)} ${r(30.4404)} ${i(11.5898)}C${r(29.0527)} ${i(11.9661)} ${r(27.6436)} ${i(11.7542)} ${r(26.4766)} ${i(11.1074)}C${r(26.1072)} ${i(12.3879)} ${r(25.2629)} ${i(13.5333)} ${r(24.0195)} ${i(14.25)}C${r(22.7695)} ${i(14.9754)} ${r(21.347)} ${i(15.1322)} ${r(20.0479)} ${i(14.8047)}C${r(20.0289)} ${i(16.1454)} ${r(19.5108)} ${i(17.4793)} ${r(18.4902)} ${i(18.5)}C${r(17.4696)} ${i(19.5158)} ${r(16.1409)} ${i(20.033)} ${r(14.8066)} ${i(20.0566)}C${r(15.1312)} ${i(21.3534)} ${r(14.9738)} ${i(22.7723)} ${r(14.25)} ${i(24.0195)}C${r(13.5243)} ${i(25.2699)} ${r(12.3701)} ${i(26.1148)} ${r(11.082)} ${i(26.4795)}C${r(11.7347)} ${i(27.6479)} ${r(11.9529)} ${i(29.062)} ${r(11.5801)} ${i(30.46)}C${r(11.2085)} ${i(31.8485)} ${r(10.3194)} ${i(32.9607)} ${r(9.17578)} ${i(33.6475)}C${r(10.106)} ${i(34.6084)} ${r(10.6797)} ${i(35.9167)} ${r(10.6797)} ${i(37.3604)}C${r(10.6796)} ${i(38.805)} ${r(10.1053)} ${i(40.1141)} ${r(9.17383)} ${i(41.0752)}C${r(10.3132)} ${i(41.7614)} ${r(11.1999)} ${i(42.871)} ${r(11.5703)} ${i(44.2598)}C${r(11.946)} ${i(45.6504)} ${r(11.7335)} ${i(47.0592)} ${r(11.0889)} ${i(48.2266)}C${r(12.377)} ${i(48.593)} ${r(13.5297)} ${i(49.441)} ${r(14.25)} ${i(50.6904)}C${r(14.9754)} ${i(51.9405)} ${r(15.1322)} ${i(53.3629)} ${r(14.8047)} ${i(54.6621)}C${r(16.142)} ${i(54.6835)} ${r(17.4721)} ${i(55.2016)} ${r(18.4902)} ${i(56.2197)}C${r(19.5097)} ${i(57.2441)} ${r(20.0278)} ${i(58.5787)} ${r(20.0479)} ${i(59.918)}C${r(21.3469)} ${i(59.5917)} ${r(22.7696)} ${i(59.7493)} ${r(24.0195)} ${i(60.4697)}C${r(25.2676)} ${i(61.1892)} ${r(26.1117)} ${i(62.3406)} ${r(26.4775)} ${i(63.627)}C${r(27.6424)} ${i(62.9822)} ${r(29.0498)} ${i(62.7688)} ${r(30.4404)} ${i(63.1396)}C${r(31.8284)} ${i(63.5112)} ${r(32.9402)} ${i(64.3999)} ${r(33.627)} ${i(65.543)}C${r(34.5887)} ${i(64.6072)} ${r(35.9012)} ${i(64.0304)} ${r(37.3496)} ${i(64.0303)}C${r(38.7912)} ${i(64.0303)} ${r(40.098)} ${i(64.6023)} ${r(41.0586)} ${i(65.5303)}C${r(41.7458)} ${i(64.3887)} ${r(42.8594)} ${i(63.5007)} ${r(44.25)} ${i(63.1299)}C${r(45.643)} ${i(62.7522)} ${r(47.057)} ${i(62.9676)} ${r(48.2266)} ${i(63.6201)}C${r(48.5931)} ${i(62.3323)} ${r(49.4413)} ${i(61.1801)} ${r(50.6904)} ${i(60.46)}C${r(51.9373)} ${i(59.7364)} ${r(53.3558)} ${i(59.5781)} ${r(54.6523)} ${i(59.9023)}C${r(54.6744)} ${i(58.5659)} ${r(55.1925)} ${i(57.2372)} ${r(56.21)} ${i(56.2197)}C${r(57.2339)} ${i(55.2007)} ${r(58.5676)} ${i(54.6816)} ${r(59.9062)} ${i(54.6611)}C${r(59.5835)} ${i(53.3649)} ${r(59.7414)} ${i(51.9468)} ${r(60.46)} ${i(50.7002)}C${r(61.1797)} ${i(49.4517)} ${r(62.3312)} ${i(48.6068)} ${r(63.6182)} ${i(48.2412)}C${r(62.9651)} ${i(47.0726)} ${r(62.7473)} ${i(45.658)} ${r(63.1201)} ${i(44.2598)}C${r(63.4916)} ${i(42.8718)} ${r(64.3794)} ${i(41.7591)} ${r(65.5225)} ${i(41.0723)}C${r(64.5929)} ${i(40.1115)} ${r(64.0206)} ${i(38.8033)} ${r(64.0205)} ${i(37.3604)}C${r(64.0205)} ${i(35.9186)} ${r(64.5915)} ${i(34.611)} ${r(65.5195)} ${i(33.6504)}C${r(64.3785)} ${i(32.9631)} ${r(63.4908)} ${i(31.8501)} ${r(63.1201)} ${i(30.46)}C${r(62.7421)} ${i(29.0656)} ${r(62.9572)} ${i(27.6498)} ${r(63.6113)} ${i(26.4795)}C${r(62.3272)} ${i(26.1115)} ${r(61.1784)} ${i(25.2657)} ${r(60.46)} ${i(24.0195)}C${r(59.7364)} ${i(22.7727)} ${r(59.5781)} ${i(21.3541)} ${r(59.9023)} ${i(20.0576)}C${r(58.5626)} ${i(20.038)} ${r(57.23)} ${i(19.52)} ${r(56.21)} ${i(18.5)}C${r(55.1931)} ${i(17.4783)} ${r(54.675)} ${i(16.1482)} ${r(54.6523)} ${i(14.8125)}C${r(53.3557)} ${i(15.1357)} ${r(51.9374)} ${i(14.9785)} ${r(50.6904)} ${i(14.2598)}C${r(49.4399)} ${i(13.5339)} ${r(48.5931)} ${i(12.3801)} ${r(48.2285)} ${i(11.0918)}C${r(47.0603)} ${i(11.7439)} ${r(45.6474)} ${i(11.9624)} ${r(44.25)} ${i(11.5898)}V${i(11.5801)}C${r(42.8613)} ${i(11.2085)} ${r(41.7483)} ${i(10.3196)} ${r(41.0615)} ${i(9.17578)}Z`}function oi(t){let e=t/70;return {scale:e,transform:(o,r)=>(o-5)*e+r}}function dd(t,e,n){let{scale:o,transform:r}=oi(n);return P`M ${r(5,t)} ${r(30,e)}v ${20*o}a ${25*o} ${25*o}, 0, 0, 0, ${25*o} ${25*o}h ${45*o}v -${45*o}a ${25*o} ${25*o}, 0, 0, 0, -${25*o} -${25*o}h -${20*o}H ${r(5,t)}zM ${r(30,t)} ${r(15,e)}h ${20*o}a ${15*o} ${15*o}, 0, 0, 1, ${15*o} ${15*o}v ${35*o}h -${35*o}a ${15*o} ${15*o}, 0, 0, 1, -${15*o} -${15*o}v -${35*o}z`}function fd(t,e,n){let o=n/7,r=o*1.5,i=o*.75,a=P`M ${t+r} ${e}`+P`h ${n-2*r}`+P`a ${r} ${r} 0 0 1 ${r} ${r}`+P`v ${n-2*r}`+P`a ${r} ${r} 0 0 1 ${-r} ${r}`+P`h ${-(n-2*r)}`+P`a ${r} ${r} 0 0 1 ${-r} ${-r}`+P`v ${-(n-2*r)}`+P`a ${r} ${r} 0 0 1 ${r} ${-r}z`,l=P`M ${t+o+i} ${e+o}`+P`h ${5*o-2*i}`+P`a ${i} ${i} 0 0 1 ${i} ${i}`+P`v ${5*o-2*i}`+P`a ${i} ${i} 0 0 1 ${-i} ${i}`+P`h ${-(5*o-2*i)}`+P`a ${i} ${i} 0 0 1 ${-i} ${-i}`+P`v ${-(5*o-2*i)}`+P`a ${i} ${i} 0 0 1 ${i} ${-i}z`;return a+l}function hd(t,e,n){let{scale:o,transform:r}=oi(n);return P`M ${r(5,t)} ${r(40,e)}a ${35*o} ${35*o}, 0, 0, 0, ${35*o} ${35*o}h ${30*o}a ${5*o} ${5*o}, 0, 0, 0, ${5*o} -${5*o}v -${30*o}a ${35*o} ${35*o}, 0, 0, 0, -${35*o} -${35*o}a ${35*o} ${35*o}, 0, 0, 0, -${35*o} ${35*o}zM ${r(40,t)} ${r(15,e)}a ${25*o} ${25*o}, 0, 0, 1, ${25*o} ${25*o}v ${25*o}h -${25*o}a ${25*o} ${25*o}, 0, 0, 1, -${25*o} -${25*o}a ${25*o} ${25*o}, 0, 0, 1, ${25*o} -${25*o}z`}function pd(t,e,n){let{scale:o,transform:r}=oi(n);return P`M ${r(5,t)} ${r(30,e)}v ${20*o}a ${25*o} ${25*o}, 0, 0, 0, ${25*o} ${25*o}h ${45*o}v -${45*o}a ${25*o} ${25*o}, 0, 0, 0, -${25*o} -${25*o}h -${20*o}a ${25*o} ${25*o}, 0, 0, 0, -${25*o} ${25*o}M ${r(30,t)} ${r(15,e)}h ${20*o}a ${15*o} ${15*o}, 0, 0, 1, ${15*o} ${15*o}v ${35*o}h -${35*o}a ${15*o} ${15*o}, 0, 0, 1, -${15*o} -${15*o}v -${20*o}a ${15*o} ${15*o}, 0, 0, 1, ${15*o} -${15*o}z`}function gd(t,e,n){let o=n/70,r=t+n/2-40*o,i=e+n/2-40*o,a=(s,c)=>s*o+c;return P`M${a(35.19239999999999,r)} ${a(5.837547376725838,i)}C${a(37.69667692307692,r)} ${a(3.8737070690335305,i)}, ${a(41.218430769230764,r)} ${a(3.8737092228796843,i)}, ${a(43.722707692307694,r)} ${a(5.837547376725838,i)}L${a(46.62781538461539,r)} ${a(8.115648915187375,i)}L${a(50.23356923076923,r)} ${a(7.32361506903353,i)}C${a(53.342,r)} ${a(6.640824299802762,i)}, ${a(56.51483076923077,r)} ${a(8.168784299802759,i)}, ${a(57.91892307692308,r)} ${a(11.024719684418145,i)}L${a(59.54787692307692,r)} ${a(14.337679684418145,i)}L${a(63.14027692307692,r)} ${a(15.188578145956608,i)}C${a(66.23707692307693,r)} ${a(15.922091992110452,i)}, ${a(68.43270769230769,r)} ${a(18.675396607495067,i)}, ${a(68.45876923076924,r)} ${a(21.857768915187375,i)}L${a(68.48892307692307,r)} ${a(25.54931045364891,i)}L${a(71.35633846153846,r)} ${a(27.874602761341222,i)}C${a(73.82830769230769,r)} ${a(29.879187376725838,i)}, ${a(74.61187692307692,r)} ${a(33.312418145956606,i)}, ${a(73.25452307692306,r)} ${a(36.19103353057199,i)}L${a(71.68006153846153,r)} ${a(39.530141222879685,i)}L${a(73.25452307692306,r)} ${a(42.86924891518738,i)}C${a(74.61187692307692,r)} ${a(45.747864299802764,i)}, ${a(73.82830769230769,r)} ${a(49.18109506903353,i)}, ${a(71.35633846153846,r)} ${a(51.18567968441815,i)}L${a(68.48892307692307,r)} ${a(53.510971992110456,i)}L${a(68.45876923076924,r)} ${a(57.202664299802755,i)}C${a(68.43270769230769,r)} ${a(60.38497199211046,i)}, ${a(66.23707692307693,r)} ${a(63.13823353057199,i)}, ${a(63.14027692307692,r)} ${a(63.871833530572,i)}L${a(59.54787692307692,r)} ${a(64.72260276134121,i)}L${a(57.91892307692308,r)} ${a(68.03564891518737,i)}C${a(56.51483076923077,r)} ${a(70.89164891518737,i)}, ${a(53.342,r)} ${a(72.41958737672583,i)}, ${a(50.23356923076923,r)} ${a(71.7368181459566,i)}L${a(46.62781538461539,r)} ${a(70.94463353057199,i)}L${a(43.722707692307694,r)} ${a(73.22275660749506,i)}C${a(41.218430769230764,r)} ${a(75.18663353057198,i)}, ${a(37.69667692307692,r)} ${a(75.18663353057198,i)}, ${a(35.19239999999999,r)} ${a(73.22275660749506,i)}L${a(32.28729230769231,r)} ${a(70.94463353057199,i)}L${a(28.68153846153846,r)} ${a(71.7368181459566,i)}C${a(25.573215384615384,r)} ${a(72.41958737672583,i)}, ${a(22.400384615384613,r)} ${a(70.89164891518737,i)}, ${a(20.996141538461536,r)} ${a(68.03564891518737,i)}L${a(19.36720923076923,r)} ${a(64.72260276134121,i)}L${a(15.774852307692306,r)} ${a(63.871833530572,i)}C${a(12.67803076923077,r)} ${a(63.13823353057199,i)}, ${a(10.48237846153846,r)} ${a(60.38497199211046,i)}, ${a(10.45636,r)} ${a(57.202664299802755,i)}L${a(10.426163076923077,r)} ${a(53.510971992110456,i)}L${a(7.558747692307692,r)} ${a(51.18567968441815,i)}C${a(5.086880338461539,r)} ${a(49.18109506903353,i)}, ${a(4.303258769230769,r)} ${a(45.747864299802764,i)}, ${a(5.660599692307692,r)} ${a(42.86924891518738,i)}L${a(7.235153846153846,r)} ${a(39.530141222879685,i)}L${a(5.660599692307692,r)} ${a(36.19103353057199,i)}C${a(4.3032566153846155,r)} ${a(33.312418145956606,i)}, ${a(5.086885938461538,r)} ${a(29.879187376725838,i)}, ${a(7.558747692307692,r)} ${a(27.874602761341222,i)}L${a(10.426163076923077,r)} ${a(25.54931045364891,i)}L${a(10.45636,r)} ${a(21.857768915187375,i)}C${a(10.48237846153846,r)} ${a(18.67537506903353,i)}, ${a(12.678052307692308,r)} ${a(15.922091992110452,i)}, ${a(15.774852307692306,r)} ${a(15.188578145956608,i)}L${a(19.36720923076923,r)} ${a(14.337679684418145,i)}L${a(20.996141538461536,r)} ${a(11.024719684418145,i)}C${a(22.400384615384613,r)} ${a(8.168784299802759,i)}, ${a(25.573215384615384,r)} ${a(6.640824299802762,i)}, ${a(28.68153846153846,r)} ${a(7.32361506903353,i)}L${a(32.28729230769231,r)} ${a(8.115648915187375,i)}L${a(35.19239999999999,r)} ${a(5.837547376725838,i)}M${a(39.45766153846154,r)} ${a(13.665055069033532,i)}L${a(37.01498461538461,r)} ${a(15.58053506903353,i)}C${a(35.39098461538461,r)} ${a(16.854061222879682,i)}, ${a(33.282799999999995,r)} ${a(17.335251992110454,i)}, ${a(31.26701538461538,r)} ${a(16.892464299802757,i)}L${a(28.235046153846152,r)} ${a(16.22649506903353,i)}L${a(26.865415384615382,r)} ${a(19.012107376725837,i)}C${a(25.954812307692308,r)} ${a(20.864178145956608,i)}, ${a(24.264193846153844,r)} ${a(22.212399684418145,i)}, ${a(22.255926153846154,r)} ${a(22.688076607495066,i)}L${a(19.235393846153844,r)} ${a(23.40354122287968,i)}L${a(19.21,r)} ${a(26.507556607495065,i)}C${a(19.19313538461538,r)} ${a(28.57137199211045,i)}, ${a(18.25492,r)} ${a(30.519525838264297,i)}, ${a(16.651919999999997,r)} ${a(31.81937199211045,i)}L${a(14.240926153846154,r)} ${a(33.774633530572,i)}L${a(15.564830769230769,r)} ${a(36.58238737672584,i)}C${a(16.445064615384617,r)} ${a(38.44891045364892,i)}, ${a(16.445064615384617,r)} ${a(40.611371992110456,i)}, ${a(15.564830769230769,r)} ${a(42.47811045364892,i)}L${a(14.240926153846154,r)} ${a(45.28564891518738,i)}L${a(16.651919999999997,r)} ${a(47.240910453648915,i)}L${a(13.883236923076923,r)} ${a(50.654971992110454,i)}L${a(16.651919999999997,r)} ${a(47.240910453648915,i)}C${a(18.25492,r)} ${a(48.54075660749507,i)}, ${a(19.19313538461538,r)} ${a(50.4891258382643,i)}, ${a(19.21,r)} ${a(52.5527258382643,i)}L${a(19.235393846153844,r)} ${a(55.65684891518738,i)}L${a(22.255926153846154,r)} ${a(56.37235660749507,i)}C${a(24.264193846153844,r)} ${a(56.847925838264295,i)}, ${a(25.954812307692308,r)} ${a(58.196233530571995,i)}, ${a(26.865415384615382,r)} ${a(60.0483258382643,i)}L${a(28.235046153846152,r)} ${a(62.833895069033524,i)}L${a(31.26701538461538,r)} ${a(62.1679258382643,i)}C${a(33.282799999999995,r)} ${a(61.72509506903353,i)}, ${a(35.39098461538461,r)} ${a(62.20626429980276,i)}, ${a(37.01498461538461,r)} ${a(63.47983353057199,i)}L${a(39.45766153846154,r)} ${a(65.39524891518737,i)}L${a(41.90012307692308,r)} ${a(63.47983353057199,i)}C${a(43.524123076923075,r)} ${a(62.20626429980276,i)}, ${a(45.632307692307684,r)} ${a(61.72509506903353,i)}, ${a(47.6480923076923,r)} ${a(62.1679258382643,i)}L${a(50.68006153846154,r)} ${a(62.833895069033524,i)}L${a(52.049692307692304,r)} ${a(60.0483258382643,i)}C${a(52.960338461538456,r)} ${a(58.196233530571995,i)}, ${a(54.6508923076923,r)} ${a(56.847925838264295,i)}, ${a(56.65913846153846,r)} ${a(56.37235660749507,i)}L${a(59.67969230769231,r)} ${a(55.65684891518738,i)}L${a(59.70510769230769,r)} ${a(52.5527258382643,i)}C${a(59.72190769230769,r)} ${a(50.4891258382643,i)}, ${a(60.66012307692307,r)} ${a(48.54075660749507,i)}, ${a(62.263230769230766,r)} ${a(47.240910453648915,i)}L${a(64.67424615384616,r)} ${a(45.28564891518738,i)}L${a(63.35027692307692,r)} ${a(42.47811045364892,i)}C${a(62.47,r)} ${a(40.611371992110456,i)}, ${a(62.47,r)} ${a(38.44891045364892,i)}, ${a(63.35027692307692,r)} ${a(36.58238737672584,i)}L${a(64.67424615384616,r)} ${a(33.774633530572,i)}L${a(62.263230769230766,r)} ${a(31.81958737672584,i)}C${a(60.66012307692307,r)} ${a(30.519525838264297,i)}, ${a(59.72190769230769,r)} ${a(28.57137199211045,i)}, ${a(59.70510769230769,r)} ${a(26.507556607495065,i)}L${a(59.67969230769231,r)} ${a(23.40354122287968,i)}L${a(56.65913846153846,r)} ${a(22.688076607495066,i)}C${a(54.6508923076923,r)} ${a(22.212399684418145,i)}, ${a(52.960338461538456,r)} ${a(20.864178145956608,i)}, ${a(52.049692307692304,r)} ${a(19.012128915187375,i)}L${a(50.68006153846154,r)} ${a(16.22649506903353,i)}L${a(47.6480923076923,r)} ${a(16.892464299802757,i)}C${a(45.632307692307684,r)} ${a(17.335251992110454,i)}, ${a(43.524338461538456,r)} ${a(16.85408276134122,i)}, ${a(41.90012307692308,r)} ${a(15.58053506903353,i)}L${a(39.45766153846154,r)} ${a(13.665055069033532,i)}Z`}function xr(t,e,n,o,r="top-left"){switch(o){case "leaf":return Ol(t,e,n,r);case "leaf-reverse":return Ol(t,e,n,r,true);case "drop":return Z1(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 X1(t,e,n);case "cushion":return Y1(t,e,n);case "shield":return K1(t,e,n);case "petal":return J1(t,e,n,r);case "porthole":return nd(t,e,n);case "notch":return rd(t,e,n);case "plus":return od(t,e,n);case "bud":return ad(t,e,n,r);case "bowl":return sd(t,e,n);case "gear":return md(t,e,n);case "rounded":return cd(t,e,n);case "circle":return ud(t,e,n);case "diya":return dd(t,e,n);case "extra-rounded":return fd(t,e,n);case "message":return hd(t,e,n);case "pointy":return pd(t,e,n);case "curly":return gd(t,e,n);default:return ld(t,e,n)}}var ii=.22,ai=.14;function Dl(t,e,n={}){if(t==="circle")return E("circle",{cx:_(e.x+e.w/2),cy:_(e.y+e.h/2),r:_(Math.min(e.w,e.h)/2),...n});let o=t==="rounded"?Math.min(e.w,e.h)*ii:0;return E("rect",{height:_(e.h),width:_(e.w),x:_(e.x),y:_(e.y),...o>0&&{rx:_(o),ry:_(o)},...n})}function bd(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 Bl(t,e){let n=t.shape??"square",o=t.plate,r=o?bd(e,ai):e,i=l=>E("image",{height:_(r.h),href:t.src,preserveAspectRatio:"none",width:_(r.w),x:_(r.x),y:_(r.y),...l&&{clipPath:`url(#${l})`}});if(n==="square"&&!o)return i();let a=n==="square"?void 0:`qrdx-logo-${se(`${n}|${_(r.x)}|${_(r.y)}|${_(r.w)}|${_(r.h)}`)}`;return ct("g",{children:[o&&Dl(n,e,{fill:o}),a&&E("clipPath",{id:a,children:Dl(n,r)}),i(a)]})}var _d=.6,yd=["L","M","Q","H"];function xd(t){let e=Gt(t.value,t.level,t.exactLevel),n=yd[e.errorCorrectionLevel.ordinal]??t.level;return {code:t,cells:e.getModules(),layoutMargin:Pt(e.size,t.margin,t.shape),map:Jn(e.version,n),level:n,version:e.version}}function $d(t,e){let{cells:n,map:o}=t,r=n.length,i=$r(n,t.code.size,t.layoutMargin,e);if(!i)return null;let a=i.excavation??{x:Math.floor(i.x),y:Math.floor(i.y),w:Math.ceil(i.x+i.w)-Math.floor(i.x),h:Math.ceil(i.y+i.h)-Math.floor(i.y)},l=[];for(let c=Math.max(0,a.y);c<Math.min(r,a.y+a.h);c++)for(let u=Math.max(0,a.x);u<Math.min(r,a.x+a.w);u++)l.push(c*r+u);let s=tr(o,l);return {worst:Math.max(0,...s),correctable:o.correctable,budget:Math.floor(o.correctable*_d),level:t.level,version:t.version}}var Sd=t=>!t||t.worst<=t.budget;function Cd(t,e,n,o){let r=e.map(l=>xd({...t,level:l})),i=l=>{let s=o(l);return r.every(c=>Sd($d(c,s)))};if(i(n))return n;let a=t.size*.005;for(let l=n-a;l>0;l-=a)if(i(l))return l;return 0}function Gl(t,e){if(!e)return;let n=Math.floor(t.size*Qn),o=e.width||n,r=e.height||n,i=d=>{if(d===o)return e;let p=r*d/o;return {...e,width:d,height:p,...e.x!=null&&{x:e.x+(o-d)/2},...e.y!=null&&{y:e.y+(r-p)/2}}},a=t.level??an,l={value:t.value,size:t.size,margin:t.margin,shape:t.shape,exactLevel:t.exactLevel},s=d=>de({...t,level:a,imageSettings:d}),c=d=>{let p=Cd(l,[d],o,i);return p>0?i(p):void 0},u=s(e);if(u===a)return c(a);let m=c(u);return m&&s(m)===u?m:c(a)}var si=t=>{let e=t/255;return e<=.04045?e/12.92:((e+.055)/1.055)**2.4},wd=t=>255*(t<=.0031308?12.92*t:1.055*t**.4166666666666667-.055);function Hl({r:t,g:e,b:n}){let o=si(t),r=si(e),i=si(n),a=Math.cbrt(.4122214708*o+.5363325363*r+.0514459929*i),l=Math.cbrt(.2119034982*o+.6806995451*r+.1073969566*i),s=Math.cbrt(.0883024619*o+.2817188376*r+.6299787005*i),c=1.9779984951*a-2.428592205*l+.4505937099*s,u=.0259040371*a+.7827717662*l-.808675766*s;return {l:.2104542553*a+.793617785*l-.0040720468*s,c:Math.hypot(c,u),h:Math.atan2(u,c)}}function li({l:t,c:e,h:n}){let o=e*Math.cos(n),r=e*Math.sin(n),i=(t+.3963377774*o+.2158037573*r)**3,a=(t-.1055613458*o-.0638541728*r)**3,l=(t-.0894841775*o-1.291485548*r)**3;return [4.0767416621*i-3.3077115913*a+.2309699292*l,-1.2684380046*i+2.6097574011*a-.3413193965*l,-0.0041960863*i-.7034186147*a+1.707614701*l]}var Ql=1e-7,Ul=t=>t.every(e=>e>=-Ql&&e<=1+Ql),Md=20;function Sr(t){let e=li(t);if(!Ul(e)){let i=0,a=t.c;for(let l=0;l<Md;l++){let s=(i+a)/2;Ul(li({...t,c:s}))?i=s:a=s;}e=li({...t,c:i});}let[n=0,o=0,r=0]=e.map(i=>Math.round(wd(Math.min(1,Math.max(0,i)))));return {r:n,g:o,b:r,a:1}}var Rd="gear",Ed="circle";function he(t,e){let n=t.eyeShapes?.[e];return {outer:te(Un,n?.outer??t.cornerEyePattern??Rd),inner:te(Hn,n?.inner??t.cornerEyeDotPattern??Ed)}}function wr(t,e,n,o){if(!(t&&Number.isFinite(t))||t<=0||Fl(o)||n<=0)return 0;let r=Math.min(ya,xa*n/(e+2*n));return Math.min(t,r)}var di=(t,e,n,o)=>Math.min(o,Math.max(n,typeof t=="number"&&Number.isFinite(t)?t:e)),Ad=/^hsla?\(([^)]*)\)$/,Pd=/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:deg)?$/,vd=/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)%?$/;function ci(t,e){let n=t?.trim()??"";if(!vd.test(n))return Number.NaN;let o=Number.parseFloat(n),r=n.endsWith("%")||e?o/100:o;return Math.min(1,Math.max(0,r))}function Id(t){let e=Ad.exec(t);if(!e)return null;let[n="",o]=(e[1]??"").split("/"),r=n.split(/[\s,]+/).filter(Boolean);if(r.length!==(o===void 0&&r.length===4?4:3))return null;let[i="",a,l,s]=r,c=ci(a,true),u=ci(l,true),m=ci(o??s??"1",false),d=Number.parseFloat(i);if(!(Pd.test(i)&&[c,u,m].every(Number.isFinite)))return null;let p=c*Math.min(u,1-u),b=f=>{let h=(f+d/30)%12,g=h<0?h+12:h;return 255*(u-p*Math.max(-1,Math.min(g-3,9-g,1)))};return {r:b(0),g:b(8),b:b(4),a:m}}function hi(t){let e=t?.trim().toLowerCase()??"";return e==="none"?{r:0,g:0,b:0,a:0}:J(e)??Id(e)}function ui(t){return hi(t)?.a??1}function Fd(t){let e=Lt(t,et);return e.type==="solid"?ui(e.color)<1:e.type==="image"?ui(e.underlay??"transparent")<1:e.stops.some(n=>ui(n.color)<1)}var Xe=({r:t,g:e,b:n})=>[.2126*t+.7152*e+.0722*n,.299*t+.587*e+.114*n],fi=Xe(J(cn)),fe=1e-9,Cr=(t,e,n)=>t.every((o,r)=>o>=e[r]-fe&&o<=n[r]+fe),zl=({r:t,g:e,b:n})=>`#${[t,e,n].map(o=>Math.round(o).toString(16).padStart(2,"0")).join("")}`;function ql(t){let e=hi(t.color||ho);return e&&e.a>0?zl(e):ho}var Ld=24,Td=12;function kd(t,e,n){if(Cr(Xe(t),e,n))return t;if(t.r===t.g&&t.g===t.b){let c=Math.min(Math.floor(Math.min(...n)+fe),Math.max(t.r,Math.ceil(Math.max(...e)-fe)));return c>=Math.max(...e)-fe?{r:c,g:c,b:c,a:1}:null}let o=Hl(t),r=c=>{let u=Sr({l:o.l,c,h:o.h}),m=Xe(u);if(Cr(m,e,n))return u;let d=m.some((g,y)=>g<e[y]),p=g=>Xe(g).every((y,x)=>d?y>=e[x]-fe:y<=n[x]+fe),b=o.l,f=d?1:0;for(let g=0;g<Ld;g++){let y=(b+f)/2;p(Sr({l:y,c,h:o.h}))?f=y:b=y;}let h=Sr({l:f,c,h:o.h});return Cr(Xe(h),e,n)?h:null},i=r(o.c);if(i)return i;let a=r(0);if(!a)return null;let l=0,s=o.c;for(let c=0;c<Td;c++){let u=(l+s)/2,m=r(u);m?(l=u,a=m):s=u;}return a}var mi="or turn the halo off";function Nd(t){let e=Lt(t,et);if(e.type==="image")return {reason:"picture",message:"A halo isn't drawn on a picture background: on the picture's darker parts the rim makes the code unreadable",fix:`Use a background color, ${mi}`};if(Fd(t))return {reason:"see-through",message:"A halo needs an opaque background: on a grey surface under a see-through code the rim makes it unreadable",fix:`Give the code an opaque background, ${mi}`};let n=(e.type==="solid"?[e.color]:e.stops.map(r=>r.color)).map(hi),o=[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY];for(let r of n){let i=r?Xe(r):[0,0];o[0]=Math.min(o[0],i[0]),o[1]=Math.min(o[1],i[1]);}return Cr(fi,fi,o)?o:{reason:"dark-background",message:`A halo needs a light background, at least as light as ${cn}: on a darker one the rim makes the code unreadable`,fix:`Lighten the background to ${cn} or lighter, ${mi}`}}function Od(t,e){let n=Nd(e);if(!Array.isArray(n))return n;let o=ql(t),r=kd(J(o),fi,n);return {drawn:r?zl(r):cn,picked:o}}function Wl(t,e){if(!t)return null;let n=e?Od(t,e.bgColor):null;if(n&&!("drawn"in n))return null;let o=di(t.width,Ca,$a,Sa);return {color:n?n.drawn:ql(t),width:o}}function Vl(t){if(!t)return null;let e=r=>di(r,wa,-po,po),n=e(t.dx),o=e(t.dy);return n===0&&o===0?null:{color:t.color||Aa,opacity:di(t.opacity,Ea,Ma,Ra),dx:n,dy:o}}var jl="data-qrdx-part",Dd="data-qrdx-eye";function Zl(t,e,n){if(t)return n?{[jl]:e,[Dd]:n}:{[jl]:e}}var En=300;function Tt(t){return {id:t.id,name:t.name,description:t.description,spec:t.spec,wrapper:(e,n)=>{let o=Cn(t.spec),r=n?.fgColor,i=(typeof r=="string"?r:mt(r,""))||"black",a=wn(o.qr.size,o,{color:i}),{x:l,y:s,scale:c}=t.at;return E("svg",{height:En,id:"svgQrWrapper",style:{width:"100%",height:"100%"},viewBox:`0 0 ${En} ${En}`,width:En,xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",children:ct("g",{"data-qrdx-template":t.id,transform:`translate(${_(l)} ${_(s)})${c===1?"":` scale(${c})`}`,children:[yl(a),E("g",{fill:"none",transform:`translate(${_(a.qrX)} ${_(a.qrY)}) scale(${a.qrSize/En})`,children:e})]})})}}}var Xl={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 Yl=Tt({id:"Arrow",name:"Arrow",description:"QR code with arrow",spec:Xl,at:{x:47,y:95,scale:1}});var Kl={id:"default",name:"Default",description:"Simple QR code without decorative elements",wrapper:t=>E("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:E("g",{fill:"none",transform:"translate(9, 9) scale(0.95)",children:t})})};var Pn=593,Yt=296.5,An=146.5,oc=294.5,ic=231.228,ac="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",Gd="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",Qd="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",Jl="3cf27f17c00j3ch21n1ek00l1el3cj1vv1kd00n3cl3cn1q31q500p3cp1vx00r1kb3cs3aw1ej21p00t3ax3ay17b27h00w3b02g20yq01w2d611m01x3b52aa14i01y24i1bq0203bd3be1q21q60253bf39e39f39h14e2ae02d39j11i2da02e39l0ym02f39n2lt0sz03a39p2ix0vv03b39r2d511n39t03d27d17f03f39x39y21l1en03h3a03a11vt1kf03j37w37x1q11q703l37z1k903n1vz3821eh03p21r38714d03t11h03u2db38a0vp2j303w2lz38g03x0st2rk0n804o38l2oo0q404p38n2iw0vw04r36f36h2a814k04u36k36l1vs1kg04z36o36p1n41t405236q36x36y0ss2m005d3720n02rs05f3742uf0kd0633763772on0q506537834y2fz0yt06834z2d311p06935235424f1bt06c35621j1ep06d3581yn1hl06e35a1sv1nd06g35b1pz1q906h35d35e35g1ef21t06l35h1bj24p06m35k35l11f2dd06q35n0vn2j506s35p35q0pv2ox06u35s0mz2rt06v35t33h0k32up06w2x90hi08y2ud0ke08z33r2lp0t20922fx0yu0942a514m09624d1bu0983441yl1hm09a1vp1ki09b1px1qa09d34e1n11t609e1h91yy09g1ed21u09h1a227m0831492ai09l0yh2ga09n0sp2m209p0pt2oy09q0k12uq09s2xo0h52z209t31k0en0bt2780c319z0az0e831z0cq",tc=52,Ud=240;function ec(t){let e=0;return t.split(" ").map(n=>(e+=Number.parseInt(n,36),e/1e4))}var pi;function Hd(){if(!pi){let t=ec(Gd),e=ec(Qd),n=[];for(let o=0;o<Jl.length;o+=3){let r=Number.parseInt(Jl.slice(o,o+3),36);n.push({cx:t[Math.floor(r/tc)],cy:e[r%tc]});}pi=n;}return pi}function zd(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 sc(t){let e=Hd(),n=zd(t),o=()=>(n=(n*9301+49297)%233280,n/233280),r=e.map((i,a)=>a);for(let i=r.length-1;i>0;i--){let a=Math.floor(o()*(i+1));[r[i],r[a]]=[r[a],r[i]];}return r.slice(0,Ud).sort((i,a)=>i-a).map(i=>e[i])}var nc=300,qd=49,Wd=6;function lc(t,e){if(nc/e<=qd+.5)return t;let n=An,o=An+nc,r=Wd*e+e/2;return t.filter(({cx:i,cy:a})=>Math.max(n-i,i-o,n-a,a-o)>=r)}var cc="Scan the QR code * Scan the QR code * Scan the QR code * Scan the QR code *",vn=32,uc=3.5,Vd=vn*zn,mc=246.5,Qt=2*Math.PI*mc,_i=.36,rc=mc+_i*vn,gi=400;function Ye(t,e){return t===" "||/[il1|!']/.test(t)?e*.3:/[mwMW@%&]/.test(t)?e*.8:e*.6}function jd(t){let e=t.slice(0,gi).split(" ").map(n=>dn(n,gi)).join(" ");return Array.from(e).slice(0,gi)}var Zd="\u2026",dc=1;function fc(t,e,n,o=false){return o&&e===t.length-1?dc*n:Ye(t[e],n)}function yi(t,e,n=false){let o=0;for(let r=0;r<t.length;r++)o+=fc(t,r,e,n);return o}function bi(t,e,n,o=false){return yi(t,e,o)+n*Math.max(0,t.length-1)+Ye(" ",e)+2*n<=Qt}var hc=t=>t.join("").split(" ").filter(Boolean),Xd=(t,e)=>Array.from(Array.from({length:e},()=>t.join(" ")).join(" "));function pc(t,e,n){if(bi(t,e,n))return {chars:t,fontSize:e,letterSpacing:n};let o=Math.min(n,0),r=Math.min(e,Vd),i=(f,h=false)=>{let g=yi(f,e,h)+Ye(" ",e),y=f.length+1,x=(Qt-g)/y;if(x>=o)return {chars:f,fontSize:e,letterSpacing:x,cut:h};let C=(Qt-o*y)/g*e;return C>=r?{chars:f,fontSize:C,letterSpacing:o,cut:h}:null},a=i(t);if(a)return a;let l=hc(t),s=gc(l);for(let f=l.length/s.length-1;f>=1;f--){let h=Xd(s,f);if(bi(h,r,o))return i(h)??{chars:h,fontSize:r,letterSpacing:o}}let c=Qt-Ye(" ",r)-dc*r-2*o,u=0,m=0,d=0;for(let[f,h]of t.entries()){if(u+=Ye(h,r)+o,u>c)break;d=f+1,(d===t.length||t[d]===" ")&&(m=d);}let p=[...Yd(t.slice(0,m>0?m:d)),Zd];return (bi(p,e,n,true)?{chars:p,fontSize:e,letterSpacing:n,cut:true}:null)??i(p,true)??{chars:p,fontSize:r,letterSpacing:o,cut:true}}function Yd(t){let e=t.length;for(;e>0&&/[\s.,;:!?*·•\-–—]/u.test(t[e-1]);)e--;return t.slice(0,e)}function gc(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 Kd(t,e,n){let o=hc(t);if(o.length===0)return {chars:[],fontSize:e,letterSpacing:n};let r=Array.from(gc(o).join(" ")),i=yi(r,e)+Ye(" ",e),a=i+(r.length+1)*n,l=Math.min(n,0),s=null;for(let c of new Set([Math.floor(Qt/a),Math.ceil(Qt/a)])){if(c<1)continue;let u=(Qt-c*i)/(c*(r.length+1));if(u>=l&&(!s||Math.abs(u-n)<Math.abs(s.letterSpacing-n))){let m=Array.from({length:c},()=>r.join(""));s={chars:Array.from(m.join(" ")),fontSize:e,letterSpacing:u};}}return s??pc(r,e,n)}function bc(t,e){let{position:n,rotation:o}=e,r=jd(t),i=e.fill==="repeat"?Kd(r,e.fontSize,e.letterSpacing):pc(r,e.fontSize,e.letterSpacing),{fontSize:a,letterSpacing:l}=i,s=[],c=0;for(let[f,h]of i.chars.entries()){let g=fc(i.chars,f,a,i.cut);s.push({char:h,along:c+g/2}),c+=g+l;}let u=c-(s.length>0?l:0),m=n!=="bottom",d=m?rc-_i*a:rc+_i*a,p=u/Qt*180,b=[];for(let{char:f,along:h}of s){if(f.trim()==="")continue;let g=h/Qt*360,y=m?o-p+g:o+180+p-g,x=y*Math.PI/180;b.push({char:f,x:Q(Yt+d*Math.sin(x)),y:Q(Yt-d*Math.cos(x)),rotate:Q(m?y:y-180)});}return {text:i.chars.join(""),letters:b,fontSize:a===e.fontSize?a:Q(a),letterSpacing:l}}var Ke=(t,e)=>typeof t=="number"&&Number.isFinite(t)?t:e,_c={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=mt(e?.fgColor,"#000000"),r=mt(e?.bgColor,"#ffffff"),i=n?.pixelSize??9,a=Q(i/2),l=lc(sc(n?.url??""),i),s=Ke(e?.fontSize,vn),c=s>0?s:vn,u=typeof e?.customText=="string"?e.customText:cc,m=bc(u,{fontSize:c,letterSpacing:Ke(e?.fontLetterSpacing,uc),position:e?.textPosition==="bottom"?"bottom":"top",rotation:Ke(e?.textRotation,0),fill:e?.textFill==="repeat"?"repeat":"none"}),d=e?.textColor||"#ffffff",p=e?.fontFamily||ni,b=e?.fontWeight??900,f=Ke(e?.strokeWidth,0),h=e?.strokeColor||"#000000",g=[{radius:Yt,width:Ke(e?.outerStrokeWidth,f),color:e?.outerStrokeColor||h},{radius:ic,width:Ke(e?.innerStrokeWidth,f),color:e?.innerStrokeColor||h}].filter(y=>y.width>0);return ct("svg",{height:Pn,id:"svgQrWrapper",style:{width:"100%",height:"100%"},viewBox:`0 0 ${Pn} ${Pn}`,width:Pn,xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",children:[E("circle",{cx:Yt,cy:Yt,fill:r,r:oc}),E("g",{fill:o,children:l.map((y,x)=>E("circle",{cx:y.cx,cy:y.cy,r:a},x))}),E("path",{d:ac,fill:e?.outerCircleColor||o}),g.map((y,x)=>E("circle",{cx:Yt,cy:Yt,fill:"none",r:y.radius,stroke:y.color,strokeWidth:y.width},x)),E("g",{"aria-hidden":"true",children:m.letters.map((y,x)=>E("text",{fill:d,fontFamily:p,fontSize:m.fontSize,fontWeight:b,textAnchor:"middle",transform:`rotate(${y.rotate} ${y.x} ${y.y})`,x:y.x,y:y.y,children:y.char},x))}),E("g",{transform:`translate(${An} ${An})`,children:t})]})}};var yc={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 xc=Tt({id:"Halloween",name:"Halloween",description:"QR code with Halloween theme",spec:yc,at:{x:38,y:10,scale:1}});var $c={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 Sc=Tt({id:"SquareBorder",name:"Square Border",description:"QR code with square decorative border",spec:$c,at:{x:0,y:0,scale:300/316}});var Cc={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 wc=Tt({id:"StandardBox",name:"Standard Box",description:"QR code with standard box",spec:Cc,at:{x:46,y:1,scale:1}});var Mc={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 Rc=Tt({id:"StrikedBox",name:"Striked Box",description:"QR code with striked box",spec:Mc,at:{x:24,y:0,scale:1}});var xi={default:Kl,Arrow:Yl,StandardBox:wc,SquareBorder:Sc,StrikedBox:Rc,Halloween:xc,DotRing:_c},Ec={FlamQR:"DotRing"},Ac=t=>{if(Object.hasOwn(xi,t))return xi[t];let e=Object.hasOwn(Ec,t)?Ec[t]:void 0;return e?xi[e]:void 0};var $i=t=>Math.round(Math.min(Math.max(t,0),255)).toString(16).padStart(2,"0");function Fc(t){return `#${$i(t.r)}${$i(t.g)}${$i(t.b)}`}function Je(t){let e=J(t);return !e||e.a>=1||e.a<=0?{color:t}:{color:Fc(e),opacity:Q(e.a,3)}}function Mr(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 Lc={r:0,g:0,b:0,a:1};function rf(t){return [...t].map(e=>({offset:Math.min(Math.max(e.offset/100,0),1),color:J(e.color)??Lc})).sort((e,n)=>e.offset-n.offset)}function Si(t,e){let n=t[0],o=t.at(-1);if(!(n&&o))return Lc;if(e<=n.offset)return n.color;if(e>=o.offset)return o.color;for(let r=0;r+1<t.length;r++){let i=t[r],a=t[r+1];if(e>=i.offset&&e<=a.offset){let l=a.offset-i.offset,s=l>0?(e-i.offset)/l:1,c=i.color.a+(a.color.a-i.color.a)*s,u=(m,d)=>{let p=m*i.color.a+(d*a.color.a-m*i.color.a)*s;return c>0?p/c:m+(d-m)*s};return {r:u(i.color.r,a.color.r),g:u(i.color.g,a.color.g),b:u(i.color.b,a.color.b),a:c}}}return o.color}var Pc=4,vc=720,of=2;function Tc(t,e,n,o,r){let i=rf(t);if(i.length===0)return {wedges:[]};let a=i[0].color.a,l=i.every(y=>Math.abs(y.color.a-a)<.002),s=[...new Set([0,...i.map(y=>y.offset),1])].sort((y,x)=>y-x),c=[];for(let y=0;y+1<s.length;y++){let x=s[y],C=s[y+1];if(C<=x)continue;let w=Si(i,x+1e-9),S=Si(i,C-1e-9),$=Math.max(Math.abs(w.r*w.a-S.r*S.a),Math.abs(w.g*w.a-S.g*S.a),Math.abs(w.b*w.a-S.b*S.a),Math.abs(w.a-S.a)*255),R=Math.ceil($/of),M=Math.ceil((C-x)*360/Pc),A=Math.max(1,R,M);for(let v=0;v<A;v++)c.push([x+(C-x)*v/A,x+(C-x)*(v+1)/A]);}let u=c;if(c.length>vc){let y=Math.ceil(c.length/vc);u=[];for(let x=0;x<c.length;x+=y){let C=c.slice(x,x+y);u.push([C[0][0],C.at(-1)[1]]);}}let m=e-90,d=r/Math.cos(2*Pc/2*(Math.PI/180)),p=y=>{let x=y*Math.PI/180;return [_(n+d*Math.cos(x)),_(o+d*Math.sin(x))]},b=`${_(n)} ${_(o)}`,f=y=>Q((y%360+360)%360,4),h=u.length-1,g=u.map(([y,x],C)=>{let w=Si(i,(y+x)/2),S=(x-y)*360,$=l&&C===0&&h>0?S:0,R=l&&C<h?S:0,M=m+y*360-$,A=m+x*360+R,[v,I]=p(M),[F,N]=p(A);return {d:`M${b}L${v} ${I}L${F} ${N}Z`,color:Fc(w),...l||w.a>=1?{}:{opacity:Q(w.a,3)},from:f(M),sweep:Q(A-M,4)}});return l&&a<1?{wedges:g,opacity:Q(a,3)}:{wedges:g}}function Ic(t,e,n,o){return (Math.atan2(o-e,n-t)*180/Math.PI%360+360)%360}function kc(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]],i=Ic(t,e,n.x+n.width/2,n.y+n.height/2),a=0,l=0;for(let[s,c]of r){let u=Ic(t,e,s,c)-i;u>180?u-=360:u<=-180&&(u+=360),a=Math.min(a,u),l=Math.max(l,u);}return [i+a,i+l]}function Nc(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 af(t,e){return t.slice().map((n,o)=>o<e.y||o>=e.y+e.h?n:n.map((r,i)=>i<e.x||i>=e.x+e.w?r:false))}function sf(t,e,n){return t<7&&e<7||t>=n-7&&e<7||t<7&&e>=n-7}var lf=.9;function Ci(t,e){let{margin:n,pixelSize:o,pattern:r="circle",plain:i=false}=e;if(As(r))return Ps(t,{margin:n,pixelSize:o,pattern:r,scale:e.scale,plain:i});let a=zo(e.scale,r),l=[],s=t.length,c=o*.45,u=i?()=>false:qo(s);return t.forEach((m,d)=>{m.forEach((p,b)=>{if(p&&(i||!sf(b,d,s))){let f=(b+.5+n)*o,h=(d+.5+n)*o,g=`${b}-${d}`,y=l.length;if(u(b,d)){l.push(E("rect",{height:_(o),width:_(o),x:_(f-o/2),y:_(h-o/2)},g));return}switch(r){case "circle":l.push(E("circle",{cx:_(f),cy:_(h),r:_(c),transform:P`rotate(0,${f},${h})`},g));break;case "circle-large":{let x=o*.5;l.push(E("circle",{cx:_(f),cy:_(h),r:_(x),transform:P`rotate(0,${f},${h})`},g));}break;case "small-square":{let x=o*.357143;l.push(E("path",{d:P`M ${f-x} ${h-x}v ${o*.714286}h ${o*.714286}v -${o*.714286}z`,transform:P`rotate(0,${f},${h})`},g));}break;case "diamond":{let x=o*.357143;l.push(E("path",{d:P`M ${f-x} ${h-x}v ${o*.714286}h ${o*.714286}v -${o*.714286}z`,transform:P`rotate(45,${f},${h})`},g));}break;case "circle-mixed":{let x=(b+d)%3===0?lf:(b+d)%2===0?1:1.25,C=c*x;l.push(E("circle",{cx:_(f),cy:_(h),r:_(C),transform:P`rotate(0,${f},${h})`},g));}break;case "pacman":{let x=o*.5,C=o*.357143;l.push(E("path",{d:P`M ${f-x} ${h-C}v ${o*.714286}h ${x}a ${x*.5} ${x*.5}, 0, 0, 0, 0 -${o*.714286}h -${x}v -${o*.714286}z`,transform:P`rotate(${(b+d)%2===0?0:90},${f},${h})`},g));}break;case "rounded":{let x=o*.5,C=o*.2;l.push(E("rect",{height:_(o),rx:_(C),ry:_(C),transform:P`rotate(0,${f},${h})`,width:_(o),x:_(f-x),y:_(h-x)},g));}break;case "square":{let x=o*.5;l.push(E("rect",{height:_(o),transform:P`rotate(0,${f},${h})`,width:_(o),x:_(f-x),y:_(h-x)},g));}break;case "vertical-line":{let x=o*.714286,C=o;l.push(E("path",{d:P`M ${f-o*.5} ${h-x*.5}v ${x}h ${C}v -${x}z`,transform:P`rotate(90,${f},${h})`},g));}break;default:l.push(E("circle",{cx:_(f),cy:_(h),r:_(c),transform:P`rotate(0,${f},${h})`},g));}if(a!==1&&l.length>y){let x=l.pop();l.push(E("g",{transform:P`translate(${f},${h}) scale(${_(a,6)}) translate(${-f},${-h})`,children:x},g));}}});}),l}function cf(t,e){let n=t*Math.PI/180,o=e/2,r=e/2,i=Math.sqrt(e*e+e*e)/2,a=o-i*Math.cos(n),l=r-i*Math.sin(n),s=o+i*Math.cos(n),c=r+i*Math.sin(n);return {x1:a,y1:l,x2:s,y2:c}}function wi(t,e){return `${t}-${se(JSON.stringify(e))}`}function uf(t,e,n,o,r){let i=t;if(t===0)switch(r){case "top-left":i=0;break;case "top-right":i=90;break;case "bottom-left":i=270;break;default:i=0;}let a=i*Math.PI/180,l=e+o/2,s=n+o/2,c=Math.sqrt(o*o+o*o)/2,u=l-c*Math.cos(a),m=s-c*Math.sin(a),d=l+c*Math.cos(a),p=s+c*Math.sin(a);return {x1:u,y1:m,x2:d,y2:p}}function Ar(t,e){return e.map((n,o)=>{let{color:r,opacity:i}=Je(n.color);return E("stop",{offset:`${n.offset}%`,stopColor:r,stopOpacity:i},`${t}-stop-${o}`)})}function Dc(t,e,n,o,r,i){let a=Tc(e.stops,e.angle??0,n,o,r),l=a.wedges.map((s,c)=>E("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-${c}`));return E("pattern",{"data-qrdx-conic":`${_(n)} ${_(o)}`,height:_(i),id:t,patternUnits:"userSpaceOnUse",width:_(i),x:0,y:0,children:a.opacity===void 0?l:E("g",{opacity:a.opacity,children:l})},t)}function mf(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 df=["xMin","xMid","xMax"],ff=["YMin","YMid","YMax"];function Bc(t,e,n){let o=e.scale??1,r=e.fit==="tile",i=r?n/4*o:n,a=e.underlay?Je(e.underlay):null,l=r?i:n*o,s=mf(e.position),c=r?0:s.x*(n-l),u=r?0:s.y*(n-l),m=r?"xMidYMid slice":`${df[s.x*2]??"xMid"}${ff[s.y*2]??"YMid"} ${e.fit==="contain"?"meet":"slice"}`;return ct("pattern",{height:_(i),id:t,patternUnits:"userSpaceOnUse",width:_(i),x:0,y:0,children:[a&&E("rect",{fill:a.color,fillOpacity:a.opacity,height:_(i),width:_(i),x:0,y:0}),E("image",{height:_(l),href:e.src,opacity:(e.opacity??1)<1?e.opacity:void 0,preserveAspectRatio:m,width:_(l),x:_(c),y:_(u)})]},t)}var Gc=(t,e)=>wi("img",[t,e]);function hf(t,e,n,o,r,i,a){let l=Lt(t);if(l.type==="solid")return null;if(l.type==="image"){let c=Gc(l,a);return {id:c,element:Bc(c,l,a)}}let s=wi(i,[l,e,n,o,r,...l.type==="angular"?[a]:[]]);if(l.type==="linear"){let c=l,u=c.angle??0,{x1:m,y1:d,x2:p,y2:b}=uf(u,e,n,o,r);return {id:s,element:E("linearGradient",{gradientUnits:"userSpaceOnUse",id:s,x1:_(m),x2:_(p),y1:_(d),y2:_(b),children:Ar(s,c.stops)},s)}}if(l.type==="radial"){let c=l,u=e+o/2,m=n+o/2,d=o/2*.97;return {id:s,element:E("radialGradient",{cx:_(u),cy:_(m),fx:_(u),fy:_(m),gradientUnits:"userSpaceOnUse",id:s,r:_(d),children:Ar(s,c.stops)},s)}}return l.type==="angular"?{id:s,element:Dc(s,l,e+o/2,n+o/2,o*.75,a)}:null}function Rr(t,e,n){let o=Lt(t);if(o.type==="solid")return null;if(o.type==="image"){let i=Gc(o,e);return {id:i,element:Bc(i,o,e)}}let r=wi(n,[o,e]);if(o.type==="linear"){let i=o,a=i.angle??0,{x1:l,y1:s,x2:c,y2:u}=cf(a,e);return {id:r,element:E("linearGradient",{gradientUnits:"userSpaceOnUse",id:r,x1:_(l),x2:_(c),y1:_(s),y2:_(u),children:Ar(r,i.stops)},r)}}if(o.type==="radial"){let i=o,a=e/2,l=e/2,s=e/2*.97;return {id:r,element:E("radialGradient",{cx:_(a),cy:_(l),fx:_(a),fy:_(l),gradientUnits:"userSpaceOnUse",id:r,r:_(s),children:Ar(r,i.stops)},r)}}return o.type==="angular"?{id:r,element:Dc(r,o,e/2,e/2,e*.75,e)}:null}var Er=t=>ke(t)||da(t);function Oc(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 Ut(t,e,n){if(e)return {fill:`url(#${e})`};let o=Lt(t,n),r=o.type==="solid"?o.color:o.type==="image"?o.underlay??n:n,{color:i,opacity:a}=Je(r);return a===void 0?{fill:i}:{fill:i,fillOpacity:a}}function $r(t,e,n,o){if(o==null)return null;let r=t.length,i=Math.floor(e*Qn),a=(r+2*n)/e,l=(o.width||i)*a,s=(o.height||i)*a,c=o.x==null?r/2-l/2:o.x*a,u=o.y==null?r/2-s/2:o.y*a,m=null;if(o.excavate){let d=Math.max(0,o.padding??0)*a,p=Math.floor(c-d),b=Math.floor(u-d),f=Math.ceil(l+c+d-p),h=Math.ceil(s+u+d-b);m={x:p,y:b,w:f,h};}return {x:c,y:u,h:s,w:l,excavation:m}}function de(t){let e=t.level??an,{imageSettings:n}=t,o=t.isOGContext&&n?.excavate&&(e==="L"||e==="M")?"Q":e;if(t.autoLevel&&n&&o!=="H"){let r=Gt(t.value,o,t.exactLevel).getModules(),i=$r(r,t.size??$t,Pt(r.length,t.margin??zt,t.shape),n);i&&(i.excavation?i.excavation.w*i.excavation.h:i.w*i.h)/(r.length*r.length)>ga&&(o="H");}return o}function pf(t,e,n,o){let r=e/n,i=t.w*r,a=t.h*r,l=(t.x+o)*r,s=(t.y+o)*r;return {imgWidth:i,imgHeight:a,imgLeft:l,imgTop:s}}function tn(t){let{value:e,size:n=$t,level:o=an,bgColor:r=et,fgColor:i=Te,eyeColor:a,dotColor:l,bodyPattern:s="circle",cornerEyePattern:c="gear",cornerEyeDotPattern:u="circle",margin:m=zt,isOGContext:d=false,imageSettings:p,templateId:b,customTemplate:f,customProps:h,frame:g,art:y,eyeColors:x,moduleScale:C,autoLevel:w,exactLevel:S,shape:$,eyeShapes:R,eyeGradient:M,bgRadius:A,backdrop:v,halo:I,shadow:F,frameLabelMarkers:N,partMarkers:k,...L}=t,z=te(ha,s),B=te(Un,c),U=te(Hn,u),D=Gl({value:e,size:n,margin:m,level:o,shape:$,autoLevel:w,exactLevel:S,isOGContext:d},p),st=Xt(g),xt=st?{}:L,ht=O=>st?xl(O,{size:n,frame:g,bgColor:r,svgProps:L,markLabels:N}):O,It=de({value:e,size:n,level:o,margin:m,imageSettings:D,isOGContext:d,autoLevel:w,exactLevel:S,shape:$}),ut=Gt(e,It,S),X=ut.getModules(),lt=Pt(X.length,m,$),nn=Tl(e,X.length,m,$),j=(O,pt)=>Zl(k,O,pt),rn=wr(A,X.length,lt,$),Vi=(O,pt)=>{let Ft=kl($,O);if(!Ft){if(rn>0){let kt=_(rn*O),Et=v?Je(v):null;return ct(Nt,{children:[Et&&E("rect",{"data-qrdx-look":"backdrop",fill:Et.color,fillOpacity:Et.opacity,height:O,width:O,x:0,y:0}),E("rect",{...pt,height:O,rx:kt,ry:kt,width:O,x:0,y:0,...j("background")})]})}return E("rect",{...pt,height:O,width:O,x:0,y:0,...j("background")})}return "circle"in Ft?E("circle",{cx:_(O/2),cy:_(O/2),...pt,r:_(O/2),...j("background")}):E("path",{d:Ft.path,...pt,...j("background")})},ji=X.length+lt*2,On=$r(X,n,lt,D),xe=null;if(D!=null&&On!=null){On.excavation!=null&&(X=af(X,On.excavation));let{imgWidth:O,imgHeight:pt,imgLeft:Ft,imgTop:kt}=pf(On,n,ji,lt);if(d){let Et=D.shape??"square";xe=E("img",{alt:"Logo",src:D.src,style:{position:"absolute",left:`${_(Ft)}px`,top:`${_(kt)}px`,width:`${_(O)}px`,height:`${_(pt)}px`,...Et!=="square"&&{borderRadius:Et==="circle"?"50%":`${_(Math.min(O,pt)*ii)}px`},...D.plate&&{backgroundColor:D.plate,padding:`${_(O*ai)}px`,boxSizing:"border-box"}}});}else xe=Bl(D,{x:Ft,y:kt,w:O,h:pt}),k&&(xe=De(xe,j("logo")));}let dt=n/ji,Zi=X.length,Y=7*dt,Hr=1.5*dt,Xi={fgColor:mt(i,Te),bgColor:mt(r,et)},$e=ts(y)?ls({art:y,modules:X,version:ut.version,margin:lt,pixelSize:dt,...Xi,body:O=>Ci(O,{margin:lt,pixelSize:dt,pattern:z,scale:C})}):null,Yi=$e&&k?De($e,j("body")):$e,Ki=$e&&y?Cs({art:y,version:ut.version,...Xi}):null,Ji=$e?null:Ci(X,{margin:lt,pixelSize:dt,pattern:z,scale:C}),Dn=nn?Ci(nn,{margin:0,pixelSize:dt,pattern:z,scale:C,plain:true}):null,Bn=Lt(r,et),zr=Lt(i,Te),ta=Er(Bn)?Rr(Bn,n,"bg-color"):null,qr=Er(zr)?Rr(zr,n,"fg-color"):null,n0=Ut(r,ta?.id??null,et),ea=Ut(i,qr?.id??null,Te),na=Yi?ct(Nt,{children:[Yi,Dn&&E("g",{...ea,...j("body"),children:Dn})]}):ct("g",{...ea,...j("body"),children:[Ji,Dn]}),Se=lt*dt,Ce=lt*dt,we=(Zi-7+lt)*dt,Me=lt*dt,Re=lt*dt,Ee=(Zi-7+lt)*dt,Jt=mt(i,Te),Ae=O=>x?.[O]?.outer??Ki?.[O]?.outer??a,Pe=O=>x?.[O]?.inner??Ki?.[O]?.inner??l,ve=(O,pt,Ft,kt,Et)=>{let Fe=Lt(O,Jt);if(!Er(Fe))return null;if(M==="code"&&ke(Fe)){let so=JSON.stringify(Fe)===JSON.stringify(zr);return Rr(Fe,n,so?"fg-color":Et)}return hf(Fe,pt,Ft,Y,kt,Et,n)},Wr=ve(Ae("topLeft"),Se,Ce,"top-left","corners-square-color-0-0"),Vr=ve(Ae("topRight"),we,Me,"top-right","corners-square-color-1-0"),jr=ve(Ae("bottomLeft"),Re,Ee,"bottom-left","corners-square-color-0-1"),Zr=ve(Pe("topLeft"),Se,Ce,"top-left","corners-dot-color-0-0"),Xr=ve(Pe("topRight"),we,Me,"top-right","corners-dot-color-1-0"),Yr=ve(Pe("bottomLeft"),Re,Ee,"bottom-left","corners-dot-color-0-1"),ra=Ut(Ae("topLeft"),Wr?.id??null,Jt),oa=Ut(Ae("topRight"),Vr?.id??null,Jt),ia=Ut(Ae("bottomLeft"),jr?.id??null,Jt),aa=Ut(Pe("topLeft"),Zr?.id??null,Jt),sa=Ut(Pe("topRight"),Xr?.id??null,Jt),la=Ut(Pe("bottomLeft"),Yr?.id??null,Jt),Ie={cornerEyePattern:B,cornerEyeDotPattern:U,eyeShapes:R},Kr=xr(Se,Ce,Y,he(Ie,"topLeft").outer,"top-left"),Jr=yr(Se+Y/2,Ce+Y/2,Hr,he(Ie,"topLeft").inner,"top-left"),to=xr(we,Me,Y,he(Ie,"topRight").outer,"top-right"),eo=yr(we+Y/2,Me+Y/2,Hr,he(Ie,"topRight").inner,"top-right"),no=xr(Re,Ee,Y,he(Ie,"bottomLeft").outer,"bottom-left"),ro=yr(Re+Y/2,Ee+Y/2,Hr,he(Ie,"bottomLeft").inner,"bottom-left"),oo=Wl(I,{bgColor:r}),on=Vl(F),ca=O=>ct(Nt,{children:[$e?null:Ji,Dn,E("path",{d:Kr,fillRule:O}),Jr,E("path",{d:to,fillRule:O}),eo,E("path",{d:no,fillRule:O}),ro]}),io=null;if(oo){let{color:O}=oo;io=E("g",{"data-qrdx-look":"halo",fill:O,stroke:O,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:_(2*oo.width*dt),children:ca("nonzero")});}let ao=null;if(on){let{color:O}=Je(on.color);ao=E("g",{"data-qrdx-look":"shadow",fill:O,opacity:_(on.opacity),transform:P`translate(${on.dx*dt},${on.dy*dt})`,children:ca("evenodd")});}let r0=ct(Nt,{children:[E("defs",{children:Oc([ta,qr,Wr,Vr,jr,Zr,Xr,Yr])}),Vi(n,n0),io,ao,na,E("g",{...ra,...j("eye-outer","top-left"),children:E("path",{d:Kr,fillRule:"evenodd",transform:P`rotate(0,${Se+Y/2},${Ce+Y/2})`})}),E("g",{...aa,...j("eye-centre","top-left"),children:Jr}),E("g",{...oa,...j("eye-outer","top-right"),children:E("path",{d:to,fillRule:"evenodd",transform:P`rotate(0,${we+Y/2},${Me+Y/2})`})}),E("g",{...sa,...j("eye-centre","top-right"),children:eo}),E("g",{...ia,...j("eye-outer","bottom-left"),children:E("path",{d:no,fillRule:"evenodd",transform:P`rotate(0,${Re+Y/2},${Ee+Y/2})`})}),E("g",{...la,...j("eye-centre","bottom-left"),children:ro}),xe]}),ua=f||(b?Ac(b):void 0);if(ua){let pt=Er(Bn)?Rr(Bn,300,"bg-color-template"):null,Ft=Ut(r,pt?.id??null,et),kt=ct("svg",{height:300,viewBox:"0 0 300 300",width:300,xmlns:"http://www.w3.org/2000/svg",children:[E("defs",{children:Oc([pt,qr,Wr,Vr,jr,Zr,Xr,Yr])}),Vi(300,Ft),ct("g",{transform:`scale(${_(300/n,6)})`,children:[io,ao,na,E("g",{...ra,...j("eye-outer","top-left"),children:E("path",{d:Kr,fillRule:"evenodd",transform:P`rotate(0,${Se+Y/2},${Ce+Y/2})`})}),E("g",{...aa,...j("eye-centre","top-left"),children:Jr}),E("g",{...oa,...j("eye-outer","top-right"),children:E("path",{d:to,fillRule:"evenodd",transform:P`rotate(0,${we+Y/2},${Me+Y/2})`})}),E("g",{...sa,...j("eye-centre","top-right"),children:eo}),E("g",{...ia,...j("eye-outer","bottom-left"),children:E("path",{d:no,fillRule:"evenodd",transform:P`rotate(0,${Re+Y/2},${Ee+Y/2})`})}),E("g",{...la,...j("eye-centre","bottom-left"),children:ro}),xe]})]}),Et=300/n,so={pixelSize:dt*Et,url:e},ma=ua.wrapper(kt,{fgColor:i,bgColor:r,...h||{},...L},so),o0={...ma?.props?.style||{},width:void 0,height:void 0,...xt.style};return ht(De(ma,{...xt,width:n,height:n,style:o0}))}return ht(E("svg",{height:n,viewBox:`0 0 ${n} ${n}`,width:n,xmlns:"http://www.w3.org/2000/svg",...xt,children:r0}))}(()=>{try{new Path2D().addPath(new Path2D);}catch{return false}return true})();var Uc=(t,e)=>{if(!(Number.isInteger(t)&&Number.isInteger(e))||t<1||e<1||t>16384||e>16384)throw new RangeError(`GIF width and height must be whole numbers from 1 to 16384, got ${t} x ${e}`)},Mi=(t,e)=>t>>6*(2-e)&63;function gf(t,e,n){Uc(e,n);let o=e*n;if(t.length!==o*4)throw new RangeError(`Expected ${o*4} RGBA bytes for ${e} x ${n}, got ${t.length}`);let r=new Map,i=false,a=false,l=false;for(let g=0;g<o;g++){let y=g*4,x=t[y+3];if(x<128){i=true,a||=x>0;continue}if(a||=x<255,!l){let C=t[y]<<16|t[y+1]<<8|t[y+2];r.has(C)||(r.set(C,r.size),l=r.size>256);}}let s=i?255:256,c=!l&&r.size<=s,u=new Uint8Array(o),m,d,p;if(c){d=[];for(let g of r.keys())d.push(g>>16&255,g>>8&255,g&255);m=r.size,p=(g,y,x)=>r.get(g<<16|y<<8|x);}else {let g=bf(t,o,s);d=g.palette,m=g.palette.length/3,p=(y,x,C)=>g.bucketIndex[Hc(y,x,C)];}let b=i?m:null;for(let g=0;g<o;g++){let y=g*4;t[y+3]<128?u[g]=b:u[g]=p(t[y],t[y+1],t[y+2]);}let f=m+(i?1:0),h=new Uint8Array(f*3);return h.set(d),i&&h.fill(255,m*3),{width:e,height:n,palette:h,indices:u,transparentIndex:b,colors:f,lossless:c&&!a}}var Hc=(t,e,n)=>t>>2<<12|e>>2<<6|n>>2;function bf(t,e,n){let o=new Uint32Array(262144),r=new Float64Array(262144),i=new Float64Array(262144),a=new Float64Array(262144);for(let d=0;d<e;d++){let p=d*4;if(t[p+3]<128)continue;let b=t[p],f=t[p+1],h=t[p+2],g=Hc(b,f,h);o[g]=o[g]+1,r[g]=r[g]+b,i[g]=i[g]+f,a[g]=a[g]+h;}let l=[];for(let d=0;d<262144;d++)o[d]>0&&l.push(d);let s=[{keys:l,pixels:l.reduce((d,p)=>d+o[p],0)}];for(;s.length<n;){let d=-1;for(let $=0;$<s.length;$++){let R=s[$];R.keys.length>1&&(d===-1||R.pixels>s[d].pixels)&&(d=$);}if(d===-1)break;let p=s[d],b=0,f=-1;for(let $ of [0,1,2]){let R=255,M=0;for(let A of p.keys){let v=Mi(A,$);R=Math.min(R,v),M=Math.max(M,v);}M-R>f&&(f=M-R,b=$);}let h=[...p.keys].sort(($,R)=>Mi($,b)-Mi(R,b)||$-R),g=p.pixels/2,y=0,x=1;for(let $=0;$<h.length-1&&(y+=o[h[$]],x=$+1,!(y>=g));$++);let C=h.slice(0,x),w=h.slice(x),S=$=>$.reduce((R,M)=>R+o[M],0);s.splice(d,1,{keys:C,pixels:S(C)},{keys:w,pixels:S(w)});}let c=[];for(let d of s){let p=0,b=0,f=0;for(let h of d.keys)p+=r[h],b+=i[h],f+=a[h];c.push(Math.round(p/d.pixels),Math.round(b/d.pixels),Math.round(f/d.pixels));}let u=new Uint8Array(262144),m=c.length/3;for(let d of l){let p=o[d],b=r[d]/p,f=i[d]/p,h=a[d]/p,g=0,y=Number.POSITIVE_INFINITY;for(let x=0;x<m;x++){let C=b-c[x*3],w=f-c[x*3+1],S=h-c[x*3+2],$=C*C+w*w+S*S;$<y&&(y=$,g=x);}u[d]=g;}return {palette:c,bucketIndex:u}}var _f=t=>Math.max(1,Math.ceil(Math.log2(t))),Pr=class{buffer=new Uint8Array(1024);length=0;push(...e){this.ensure(e.length);for(let n of e)this.buffer[this.length++]=n;}u16(e){this.push(e&255,e>>8&255);}ascii(e){for(let n=0;n<e.length;n++)this.push(e.charCodeAt(n));}bytes(e){this.ensure(e.length),this.buffer.set(e,this.length),this.length+=e.length;}ensure(e){if(this.length+e<=this.buffer.length)return;let n=this.buffer.length;for(;n<this.length+e;)n*=2;let o=new Uint8Array(n);o.set(this.buffer.subarray(0,this.length)),this.buffer=o;}result(){return this.buffer.slice(0,this.length)}};function yf(t,e){let n=new Pr,o=1<<e,r=o+1,i=[],a=0,l=0,s=()=>{i.length>0&&(n.push(i.length,...i),i=[]);},c=f=>{i.push(f),i.length===255&&s();},u=(f,h)=>{for(a|=f<<l,l+=h;l>=8;)c(a&255),a>>>=8,l-=8;},m=new Int32Array(1048576),d=e+1,p=r+1;u(o,d);let b=t[0];for(let f=1;f<t.length;f++){let h=t[f],g=b<<8|h,y=m[g];if(y!==0){b=y-1;continue}u(b,d),p===4096?(u(o,d),m=new Int32Array(1048576),p=r+1,d=e+1):(p>=1<<d&&d++,m[g]=p+1,p++),b=h;}return u(b,d),u(r,d),l>0&&c(a&255),s(),n.result()}function xf(t){let{width:e,height:n,palette:o,indices:r,transparentIndex:i}=t;Uc(e,n);let a=o.length/3;if(!Number.isInteger(a)||a<1||a>256)throw new RangeError(`A GIF palette holds 1 to 256 colors, got ${o.length} bytes`);if(r.length!==e*n)throw new RangeError(`Expected ${e*n} palette indices for ${e} x ${n}, got ${r.length}`);if(i!==null&&!(Number.isInteger(i)&&i>=0&&i<a))throw new RangeError(`The transparent index ${i} isn't in a palette of ${a} colors`);for(let m=0;m<r.length;m++)if(r[m]>=a)throw new RangeError(`Pixel ${m} points at color ${r[m]}, past the palette of ${a}`);let l=_f(a),s=1<<l,c=Math.max(2,l),u=new Pr;return u.ascii("GIF89a"),u.u16(e),u.u16(n),u.push(240|l-1,0,0),u.bytes(o),u.bytes(new Uint8Array((s-a)*3)),i!==null&&u.push(33,249,4,1,0,0,i,0),u.push(44),u.u16(0),u.u16(0),u.u16(e),u.u16(n),u.push(0),u.push(c),u.bytes(yf(r,c)),u.push(0),u.push(59),u.result()}function zc(t,e,n){let o=gf(t,e,n);return {file:xf(o),image:o}}function qc(t){let{palette:e,indices:n,transparentIndex:o}=t,r=new Uint8ClampedArray(n.length*4);for(let i=0;i<n.length;i++){let a=n[i],l=i*4;r[l]=e[a*3],r[l+1]=e[a*3+1],r[l+2]=e[a*3+2],r[l+3]=a===o?0:255;}return r}var Qc="GIF89a";function Wc(t){if(t.length<32)return false;for(let s=0;s<Qc.length;s++)if(t[s]!==Qc.charCodeAt(s))return false;let e=new DataView(t.buffer,t.byteOffset,t.byteLength),n=e.getUint16(6,true),o=e.getUint16(8,true),r=t[10];if(n<1||o<1||!(r&128))return false;let i=13+3*(1<<(r&7)+1);if(t.length<i)return false;let a=s=>{let c=s;for(;c<t.length;){let u=t[c];if(c+=1,u===0)return c;c+=u;}return -1},l=0;for(;i<t.length;){let s=t[i];if(s===59)return l===1&&i===t.length-1;if(s===33)i=a(i+2);else if(s===44){if(i+10>t.length||e.getUint16(i+5,true)!==n||e.getUint16(i+7,true)!==o||t[i+9]&128)return false;let c=t[i+10];if(c<2||c>8)return false;l+=1,i=a(i+11);}else return false;if(i===-1)return false}return false}var In="image/gif",Ir=class extends Error{constructor(e){super(e),this.name="GIFScanError";}},vr=255;function Vc(t){let e=new Uint8ClampedArray(t.length);for(let n=0;n<t.length;n+=4){let o=t[n+3];for(let r=0;r<3;r++)e[n+r]=Math.round((t[n+r]*o+vr*(vr-o))/vr);e[n+3]=vr;}return e}function jc(t,e,n){let o=Uint8ClampedArray.from(e.data),r=t(o,e.width,e.height,{inversionAttempts:"dontInvert"});if(!r)return false;if(r.data===n)return true;try{return new TextDecoder().decode(Uint8Array.from(r.binaryData))===n}catch{return false}}async function $f(t,e,n){let{width:o,height:r}=t,i=Vc(t.data),a=Vc(e.data);if(e.width===o&&e.height===r&&i.every((c,u)=>c===a[u]))return;let l;try{l=(await import('jsqr')).default;}catch{throw new Ir("This design uses more colors than a GIF holds (256), and the reduced image could not be checked because jsqr is not available. Download a PNG instead.")}if(!jc(l,{data:i,width:o,height:r},n))return;if(!jc(l,{data:a,width:e.width,height:e.height},n))throw new Ir("This design uses more colors than a GIF holds (256), and the reduced image would not scan. Download a PNG instead.")}async function Sf(t,e){let{file:n,image:o}=zc(t.data,t.width,t.height);if(!Wc(n))throw new Error("Could not write a GIF file");return e!==void 0&&!o.lossless&&await $f(t,{data:qc(o),width:t.width,height:t.height},e),{file:n,colors:o.colors,lossless:o.lossless}}async function Fr(t,e){let n=t.getContext("2d");if(!n)throw new Error("Could not get canvas context");let{data:o}=n.getImageData(0,0,t.width,t.height),{file:r}=await Sf({data:o,width:t.width,height:t.height},e);return new Blob([r],{type:In})}var Lr=[16,32,48,256],ge="image/vnd.microsoft.icon",pe=256,Ri=64,Fn=6,Ln=16,Cf=[137,80,78,71,13,10,26,10],wf=16,Zc=20,Mf=32,Xc=t=>t.length>=Zc+4&&Cf.every((e,n)=>t[n]===e),Yc=t=>{let e=new DataView(t.buffer,t.byteOffset,t.byteLength);return {width:e.getUint32(wf),height:e.getUint32(Zc)}};function Ei(t){if(t.length<1||t.length>Ri)throw new RangeError(`An ICO holds 1 to ${Ri} images, got ${t.length}`);for(let{width:a,height:l,png:s}of t){let c=m=>Number.isInteger(m)&&m>=1&&m<=pe;if(!(c(a)&&c(l)))throw new RangeError(`ICO images must be whole numbers from 1 to ${pe} px, got ${a} x ${l}`);if(!Xc(s))throw new RangeError("Every ICO image must be a PNG file");let u=Yc(s);if(u.width!==a||u.height!==l)throw new RangeError(`An ICO image says ${a} x ${l} but its PNG is ${u.width} x ${u.height}`)}let e=Fn+Ln*t.length,n=t.reduce((a,l)=>a+l.png.length,0),o=new Uint8Array(e+n),r=new DataView(o.buffer);r.setUint16(0,0,true),r.setUint16(2,1,true),r.setUint16(4,t.length,true);let i=e;return t.forEach(({width:a,height:l,png:s},c)=>{let u=Fn+Ln*c;o[u]=a===pe?0:a,o[u+1]=l===pe?0:l,o[u+2]=0,o[u+3]=0,r.setUint16(u+4,1,true),r.setUint16(u+6,Mf,true),r.setUint32(u+8,s.length,true),r.setUint32(u+12,i,true),o.set(s,i),i+=s.length;}),o}function Ai(t){if(t.length<Fn+Ln)return false;let e=new DataView(t.buffer,t.byteOffset,t.byteLength),n=e.getUint16(4,true);if(e.getUint16(0,true)!==0||e.getUint16(2,true)!==1||n<1||n>Ri||t.length<Fn+Ln*n)return false;for(let o=0;o<n;o++){let r=Fn+Ln*o,i=t[r]||pe,a=t[r+1]||pe,l=e.getUint32(r+8,true),s=e.getUint32(r+12,true);if(s+l>t.length)return false;let c=t.subarray(s,s+l);if(!Xc(c))return false;let u=Yc(c);if(u.width!==i||u.height!==a)return false}return true}var Kc="data:image/png;base64,";function Rf(t){let e=t.toDataURL("image/png");if(!e.startsWith(Kc))throw new Error("This browser can't write a PNG from a canvas");let n=atob(e.slice(Kc.length)),o=new Uint8Array(n.length);for(let r=0;r<n.length;r++)o[r]=n.charCodeAt(r);return o}function Pi(t){let e=Ei(t.map(n=>({width:n.width,height:n.height,png:Rf(n)})));if(!Ai(e))throw new Error("Could not write an ICO file");return new Blob([e],{type:ge})}function Jc(t){return Pi([t])}var Ef=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"]]),Af=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"]]),Pf=new Set(["children","dangerouslySetInnerHTML","key","defaultValue","defaultChecked","innerHTML","suppressContentEditableWarning","suppressHydrationWarning","ref"]),vf=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"]),If=new Set(["autoFocus","multiple","muted"]),Ff=new Set(["contentEditable","spellCheck","draggable","value","autoReverse","externalResourcesRequired","focusable","preserveAlpha"]),Lf=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",Tf=new RegExp(`^[${tu}][${tu}\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`),Tr=/^[a-zA-Z][a-zA-Z:_.\-\d]*$/,kf=/^[\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,Nf="javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')",Of=t=>kf.test(t)?Nf:t,nu=new Set(["area","base","br","col","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"]),Df=/["'&<>]/;function vi(t){if(!Df.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=""";break;case 38:r="&";break;case 39:r="'";break;case 60:r="<";break;case 62:r=">";break;default:continue}e+=t.slice(n,o)+r,n=o+1;}return e+t.slice(n)}var Ht=t=>typeof t=="function"||typeof t=="symbol",eu=new Map,Bf=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 Gf(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 i=typeof o=="number"?o===0||Lf.has(n)?`${o}`:`${o}px`:`${o}`.trim();r=`${Bf(n)}:${i}`;}e=e?`${e};${r}`:r;}return e}function kr(t,e){if(e==null||Pf.has(t))return null;let n=Af.get(t);if(n!==void 0)return Ht(e)||typeof e=="boolean"?null:{name:n,value:`${e}`};switch(t){case "style":{let r=Gf(e);return r?{name:"style",value:r}:null}case "src":case "href":case "action":case "formAction":case "xlinkHref":return (t==="src"||t==="href")&&e===""||Ht(e)||typeof e=="boolean"?null:{name:t==="xlinkHref"?"xlink:href":t,value:Of(`${e}`)};case "capture":case "download":return e===true?{name:t,value:""}:e===false||Ht(e)?null:{name:t,value:`${e}`};case "cols":case "rows":case "size":case "span":return Ht(e)||Number.isNaN(Number(e))||!(e>=1)?null:{name:t,value:`${e}`};case "rowSpan":case "start":return Ht(e)||Number.isNaN(Number(e))?null:{name:t,value:`${e}`};}if(If.has(t))return e&&!Ht(e)?{name:t.toLowerCase(),value:""}:null;if(Ff.has(t))return Ht(e)?null:{name:t,value:`${e}`};if(vf.has(t))return e&&!Ht(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=Ef.get(t)??t;if(!Tf.test(o)||Ht(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",Qf="http://www.w3.org/1999/xlink",Uf="http://www.w3.org/XML/1998/namespace",Hf="http://www.w3.org/2000/xmlns/";function zf(t,e,n){e==="xmlns"||e.startsWith("xmlns:")?t.setAttributeNS(Hf,e,n):e.startsWith("xlink:")?t.setAttributeNS(Qf,e,n):e.startsWith("xml:")?t.setAttributeNS(Uf,e,n):t.setAttribute(e,n);}function Tn(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)Tn(t,s,n,o);return}if(!er(e))throw new TypeError("qrdx: can't render this value as DOM nodes");let{type:r,props:i}=e;if(nr(r)){Tn(t,i.children,n,o);return}if(typeof r=="function"){Tn(t,r(i),n,o);return}if(!Tr.test(r))throw new TypeError(`qrdx: invalid element name: ${r}`);let a=r==="svg"?ru:n,l=o.createElementNS(a,r);for(let s of Object.keys(i)){let c=kr(s,i[s]);c&&zf(l,c.name,c.value);}Tn(l,i.children,a===ru&&r==="foreignObject"?ou:a,o),t.appendChild(l);}function Ii(t,e=document){let n=e.createDocumentFragment();return Tn(n,t,ou,e),n}function vt(t){if(t==null||typeof t=="boolean")return "";if(typeof t=="string")return vi(t);if(typeof t=="number"||typeof t=="bigint")return `${t}`;if(Array.isArray(t)){let e="";for(let n of t)e+=vt(n);return e}if(!er(t))throw new TypeError("qrdx: can't render this value as SVG markup");return qf(t)}function qf(t){let{type:e,props:n}=t;if(nr(e))return vt(n.children);if(typeof e=="function")return vt(e(n));if(!Tr.test(e))throw new TypeError(`qrdx: invalid element name: ${e}`);let o=`<${e}`;for(let a of Object.keys(n)){let l=kr(a,n[a]);l&&(o+=` ${l.name}="${vi(l.value)}"`);}if(nu.has(e))return `${o}/>`;let r=n.dangerouslySetInnerHTML?.__html,i=r==null?vt(n.children):`${r}`;return `${o}>${i}</${e}>`}function iu(t){return vt(tn(t))}var Fi=[17,18,0,1,2,3,4,5,16,6,7,8,9,10,11,12,13,14,15],Wf=8,Li=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 mu(t,e){let n=new Uint8Array(t.length),o=[];for(let c=0;c<t.length;c++)(t[c]??0)>0&&o.push(c);if(o.length===0)return n;if(o.length===1)return n[o[0]]=1,n;let r=o.length,i=2*r-1,a=new Float64Array(i),l=new Int32Array(i),s=new Uint8Array(i);for(let c=1;;c*=2){for(let f=0;f<r;f++)a[f]=Math.max(t[o[f]]??0,c);let u=Array.from({length:r},(f,h)=>h).sort((f,h)=>a[f]-a[h]||f-h),m=0,d=r,p=f=>m<r&&(d>=f||a[u[m]]<=a[d])?u[m++]:d++;for(let f=r;f<i;f++){let h=p(f),g=p(f);a[f]=a[h]+a[g],l[h]=f,l[g]=f;}s[i-1]=0;let b=0;for(let f=i-2;f>=0;f--){let h=s[l[f]]+1;s[f]=h,f<r&&h>b&&(b=h);}if(b<=e){for(let f=0;f<r;f++)n[o[f]]=s[f];return n}}}function Vf(t,e){let n=0;for(let o=0;o<e;o++)n=n<<1|t>>o&1;return n}function du(t){let e=new Uint16Array(16),n=0;for(let l of t)l>0&&(e[l]=e[l]+1,n++);let o=new Uint16Array(16),r=0;for(let l=1;l<=15;l++)r=r+e[l-1]<<1,o[l]=r;let i=new Uint16Array(t.length),a=new Uint8Array(t.length);return t.forEach((l,s)=>{if(l===0)return;let c=o[l];o[l]=c+1,i[s]=Vf(c,l),a[s]=n===1?0:l;}),{lengths:t,codes:i,emitted:a}}function be(t,e,n){t.write(e.codes[n],e.emitted[n]);}function jf(t){let e=[],n=i=>e.push({code:i,extra:0,extraBits:0}),o=Wf,r=0;for(;r<t.length;){let i=t[r],a=1;for(;r+a<t.length&&t[r+a]===i;)a++;r+=a;let l=a;if(i===0){for(;l>0;)if(l<3)for(;l>0;l--)n(0);else if(l<=10)e.push({code:17,extra:l-3,extraBits:3}),l=0;else {let s=Math.min(l,138);e.push({code:18,extra:s-11,extraBits:7}),l-=s;}continue}for(i!==o&&(n(i),o=i,l--);l>0;)if(l<3)for(;l>0;l--)n(i);else {let s=Math.min(l,6);e.push({code:16,extra:s-3,extraBits:2}),l-=s;}}return e}function Zf(t,e){let n=[];if(e.forEach((l,s)=>{l>0&&n.push(s);}),n.length<=2&&n.every(l=>l<256)){let[l=0,s]=n;t.write(1,1),t.write(n.length===2?1:0,1),l<2?(t.write(0,1),t.write(l,1)):(t.write(1,1),t.write(l,8)),s!==void 0&&t.write(s,8);return}let o=jf(e),r=new Uint32Array(19);for(let l of o)r[l.code]=r[l.code]+1;let i=du(mu(r,7)),a=Fi.length;for(;a>4&&i.lengths[Fi[a-1]]===0;)a--;t.write(0,1),t.write(a-4,4);for(let l=0;l<a;l++)t.write(i.lengths[Fi[l]],3);t.write(0,1);for(let l of o)be(t,i,l.code),t.write(l.extra,l.extraBits);}function Nr(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 su(t,e,n){let o=t.length,r=0;for(;r<o;){let i=Math.min(4096,o-r),a=r>=1?au(t,r,1,i):0,l=r>=e?au(t,r,e,i):0;if(Math.max(a,l)>=3){l>=a?(n.copy(l,e===1?2:1),r+=l):(n.copy(a,2),r+=a);continue}n.literal(t[r]),r++;}}var lu=20;function cu(t,e,n){for(let o=0;o<n.length;o++)t[e+o]=n.charCodeAt(o);}function uu(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 fu(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),i=false;for(let w=0;w<o;w++){let S=w*4,$=t[S],R=t[S+1],M=t[S+2],A=t[S+3];A!==255&&(i=true),r[w]=(A<<24|($-R&255)<<16|R<<8|M-R&255)>>>0;}let a=new Uint32Array(280),l=new Uint32Array(256),s=new Uint32Array(256),c=new Uint32Array(256),u=new Uint32Array(40);su(r,e,{literal(w){a[w>>>8&255]++,l[w>>>16&255]++,s[w&255]++,c[w>>>24]++;},copy(w,S){a[256+Nr(w).symbol]++,u[Nr(S).symbol]++;}});let m=[a,l,s,c,u].map(w=>mu(w,15)),[d,p,b,f,h]=m.map(du),g=new Li(Math.ceil(o/4)+1024);g.write(47,8),g.write(e-1,14),g.write(n-1,14),g.write(i?1:0,1),g.write(0,3),g.write(1,1),g.write(2,2),g.write(0,1),g.write(0,1),g.write(0,1);for(let w of m)Zf(g,w);su(r,e,{literal(w){be(g,d,w>>>8&255),be(g,p,w>>>16&255),be(g,b,w&255),be(g,f,w>>>24);},copy(w,S){let $=Nr(w);be(g,d,256+$.symbol),g.write($.extra,$.extraBits);let R=Nr(S);be(g,h,R.symbol),g.write(R.extra,R.extraBits);}});let y=g.finish(),x=y.length+(y.length&1),C=new Uint8Array(lu+x);return cu(C,0,"RIFF"),uu(C,4,C.length-8),cu(C,8,"WEBPVP8L"),uu(C,16,y.length),C.set(y,lu),C}function Ti(t,e,n){return String.fromCharCode(...t.subarray(e,e+n))}function Xf(t){return t.length>=12&&Ti(t,0,4)==="RIFF"&&Ti(t,8,4)==="WEBP"}function hu(t){if(!Xf(t))return null;let e=12;for(;e+8<=t.length;){let n=Ti(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 Yf(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 Or(t,e={}){let n=e.quality!==void 0,o=n?Math.min(1,Math.max(0,Number(e.quality))):1,r=await Yf(t,"image/webp",o);if(r){let s=new Uint8Array(await r.arrayBuffer()),c=hu(s);if(c==="lossless"||n&&c==="lossy")return new Blob([s],{type:"image/webp"})}let i=t.getContext("2d");if(!i)throw new Error("Could not get canvas context");let{data:a}=i.getImageData(0,0,t.width,t.height),l=fu(a,t.width,t.height);return new Blob([l],{type:"image/webp"})}var pu=32768;async function St(t){let e=new Uint8Array(await t.arrayBuffer()),n="";for(let o=0;o<e.length;o+=pu)n+=String.fromCharCode(...e.subarray(o,o+pu));return `data:${t.type||"application/octet-stream"};base64,${btoa(n)}`}async function _e(t){let e={...t};if(t.imageSettings?.src)try{let u=await Kf(t.imageSettings.src);e={...t,imageSettings:{...t.imageSettings,src:u}};}catch{let{imageSettings:u,...m}=t;e=m;}let{hideLogo:n,url:o,logo:r,scale:i,frameLabelMarkers:a,partMarkers:l,...s}=e,c=iu({...s,templateId:e.templateId,customTemplate:e.customTemplate});return `data:image/svg+xml,${encodeURIComponent(c)}`}var Kf=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 i=r.getContext("2d");if(!i){n(new Error("Could not get canvas context"));return}i.drawImage(o,0,0);let a=r.toDataURL("image/png");r.remove(),e(a);}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 ye(t,e,n){let o=await _e(t),r=decodeURIComponent(o.replace("data:image/svg+xml,","")),i;try{let a=new TextEncoder().encode(r),l=Array.from(a,c=>String.fromCharCode(c)).join("");i=`data:image/svg+xml;base64,${btoa(l)}`;}catch(a){throw new Error(`Failed to encode SVG for canvas conversion: ${a}`)}return new Promise((a,l)=>{let s=document.createElement("canvas"),c=s.getContext("2d");if(!c){l(new Error("Could not get canvas context"));return}let u=new Image,{width:m,height:d}=Mn(t.size||$t,t.frame);s.width=Math.round(m),s.height=Math.round(d);let p=setTimeout(()=>{s.remove(),l(new Error("SVG load timeout - image may be too large or contain invalid data"));},3e4);u.onload=()=>{clearTimeout(p);try{if(e==="image/jpeg"&&(c.fillStyle="white",c.fillRect(0,0,s.width,s.height)),c.drawImage(u,0,0,s.width,s.height),n)a(s);else if(e==="image/webp")Or(s).then(St).then(a,l).finally(()=>s.remove());else if(e==="image/bmp")St(ir(s)).then(a,l).finally(()=>s.remove());else if(e===In)Fr(s,t.value).then(St).then(a,l).finally(()=>s.remove());else if(e===ge||e==="image/x-icon")St(Jc(s)).then(a,l).finally(()=>s.remove());else {let b=s.toDataURL(e,1);s.remove(),a(b);}}catch(b){clearTimeout(p),s.remove(),l(new Error(`Failed to draw SVG to canvas: ${b}`));}},u.onerror=()=>{clearTimeout(p),s.remove(),l(new Error("Could not load SVG"));},u.src=i;})}var gu=["gradientUnits","gradientTransform","spreadMethod"],Jf={linear:["x1","y1","x2","y2"],radial:["cx","cy","r","fx","fy","fr"]},th={r:0,g:0,b:0,a:1};function bu(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 ki(t){return t.name==="linearGradient"?"linear":t.name==="radialGradient"?"radial":null}function eh(t){let e=[],n=0;for(let o of t.children){if(o.name!=="stop")continue;let r=(o.attrs.offset??"0").trim(),i=Number.parseFloat(r),a=Number.isFinite(i)?r.endsWith("%")?i/100:i:0;n=Math.max(n,Math.min(Math.max(a,0),1));let l=bu(o,"stop-color")??"#000000",s=J(l==="currentColor"?"#000000":l)??th,c=Number.parseFloat(bu(o,"stop-opacity")??"1");e.push({offset:n,color:Number.isFinite(c)?{...s,a:s.a*Math.min(Math.max(c,0),1)}:s});}return e}function yu(t){let e=new Map,n=r=>{let i=r.attrs.id;ki(r)&&i&&!e.has(i)&&e.set(i,r);for(let a of r.children)n(a);};n(t);let o=new Map;for(let[r,i]of e){let a=ki(i),l={},s=[],c=new Set,u=i;for(;u&&!c.has(u);){c.add(u);let m=ki(u)===a?[...gu,...Jf[a]]:gu;for(let p of m){let b=u.attrs[p];l[p]===void 0&&b!==void 0&&(l[p]=b);}s.length===0&&(s=eh(u));let d=u.attrs.href??u.attrs["xlink:href"];u=d?.startsWith("#")?e.get(d.slice(1)):void 0;}o.set(r,{kind:a,attrs:l,stops:s});}return o}function Ni(t){let e=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,r=Number.NEGATIVE_INFINITY,i=(m,d)=>{e=Math.min(e,m),o=Math.max(o,m),n=Math.min(n,d),r=Math.max(r,d);},a=(m,d,p,b)=>{let f=-m+3*d-3*p+b,h=2*(m-2*d+p),g=d-m;if(Math.abs(f)<1e-12)return Math.abs(h)<1e-12?[]:[-g/h];let y=h*h-4*f*g;if(y<0)return [];let x=Math.sqrt(y);return [(-h+x)/(2*f),(-h-x)/(2*f)]},l=(m,d,p,b,f)=>{let h=1-m;return h*h*h*d+3*h*h*m*p+3*h*m*m*b+m**3*f},s=0,c=0,u=[0,0];for(let m of t)if(m.op==="M"&&(u=[m.x,m.y]),m.op==="M"||m.op==="L")i(m.x,m.y),s=m.x,c=m.y;else if(m.op==="C"){i(m.x,m.y);for(let d of [...a(s,m.x1,m.x2,m.x),...a(c,m.y1,m.y2,m.y)])d>0&&d<1&&i(l(d,s,m.x1,m.x2,m.x),l(d,c,m.y1,m.y2,m.y));s=m.x,c=m.y;}else [s,c]=u;return Number.isFinite(e)?{x:e,y:n,width:o-e,height:r-n}:null}var nh=t=>t[0]*t[3]-t[1]*t[2];function en(t){let e=nh(t);if(!Number.isFinite(e)||Math.abs(e)<1e-12)return null;let[n,o,r,i,a,l]=t;return [i/e,-o/e,-r/e,n/e,(r*l-i*a)/e,(o*a-n*l)/e]}function xu(t,e,n){let{kind:o,attrs:r,stops:i}=t,a=i[0],l=i.at(-1);if(!(a&&l)||i.every(S=>S.color.a===0))return null;if(i.length===1)return a.color;let s=r.gradientUnits==="userSpaceOnUse",c=Wn;if(!s){let S=Ni(e);if(!S||S.width<=0||S.height<=0)return null;c=[S.width,0,0,S.height,S.x,S.y];}let u=gt(c,ee(r.gradientTransform));if(!en(u))return l.color;let[m,d]=n,p=Math.sqrt((m*m+d*d)/2),b=(S,$)=>{let R=Number.parseFloat(S);return Number.isFinite(R)?S.trim().endsWith("%")?R/100*(s?$:1):R:null},f=(S,$,R)=>b(r[S]??$,R)??b($,R)??0;if(o==="linear"){let S=[f("x1","0%",m),f("y1","0%",d),f("x2","100%",m),f("y2","0%",d)],[$,R,M,A]=S;return $===M&&R===A?l.color:{kind:o,coords:S,matrix:u,stops:i}}let h=f("cx","50%",m),g=f("cy","50%",d),y=f("r","50%",p),x=r.fx===void 0?h:f("fx","50%",m),C=r.fy===void 0?g:f("fy","50%",d),w=Math.max(0,f("fr","0%",p));return y<0?null:y===0?l.color:{kind:o,coords:[x,C,w,h,g,y],matrix:u,stops:i}}function $u(t){return t.map(e=>_(e,6)).join(" ")}function rh(t,e){return (e==="cmyk"?hn(t.r,t.g,t.b):[t.r/255,t.g/255,t.b/255]).map(o=>_(o,4)).join(" ")}var _u=(t,e)=>`<< /FunctionType 2 /Domain [0 1] /C0 [${t}] /C1 [${e}] /N 1 >>`;function oh(t,e){let n=[],o=t.map(l=>Q(l.offset,4)),r=t.map(l=>rh(l.color,e)),i=o[0],a=o.at(-1);if(i>0){let l=r[0];n.push({from:0,to:i,c0:l,c1:l});}for(let l=0;l+1<t.length;l++){let s=o[l],c=o[l+1];c>s&&n.push({from:s,to:c,c0:r[l],c1:r[l+1]});}if(a<1){let l=r.at(-1);n.push({from:a,to:1,c0:l,c1:l});}if(n.length===1){let[l]=n;return _u(l.c0,l.c1)}return ["<< /FunctionType 3 /Domain [0 1]",`/Functions [${n.map(l=>_u(l.c0,l.c1)).join(" ")}]`,`/Bounds [${n.slice(1).map(l=>_(l.from,4)).join(" ")}]`,`/Encode [${n.map(()=>"0 1").join(" ")}] >>`].join(" ")}function Su(t,e){return [`<< /ShadingType ${t.kind==="linear"?2:3}`,`/ColorSpace /Device${e==="cmyk"?"CMYK":"RGB"}`,`/Coords [${t.coords.map(n=>_(n,6)).join(" ")}]`,`/Function ${oh(t.stops,e)}`,"/Extend [true true] >>"].join(" ")}function ih(t,e){if(t.op==="Z")return t;if(t.op==="C"){let[r,i]=nt(e,t.x1,t.y1),[a,l]=nt(e,t.x2,t.y2),[s,c]=nt(e,t.x,t.y);return {op:"C",x1:r,y1:i,x2:a,y2:l,x:s,y:c}}let[n,o]=nt(e,t.x,t.y);return {op:t.op,x:n,y:o}}function wu(t){let e={round:1,bevel:2}[t.strokeLinejoin?.trim()??""],n={round:1,square:2}[t.strokeLinecap?.trim()??""];return {join:e??0,cap:n??0}}var Cu={r:255,g:255,b:255,a:1},ah=/^url\(\s*#bg-color-/,Dr=/^url\(\s*#([^)\s]+)\s*\)/,sh=new Set(["defs","clipPath","mask","pattern","linearGradient","radialGradient","symbol","title","desc","metadata","style","script","use","foreignObject"]);function tt(t,e){let n=t.attrs.style;if(n)for(let o of n.split(";")){let[r,...i]=o.split(":");if(r?.trim()===e)return i.join(":").trim()}return t.attrs[e]}function Z(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 Oi(t,e){if((t.name==="linearGradient"||t.name==="radialGradient")&&t.attrs.id){let n=t.children.find(r=>r.name==="stop"),o=n&&(tt(n,"stop-color")??"#000000");o&&e.set(t.attrs.id,o);}for(let n of t.children)Oi(n,e);return e}function Di(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)Di(n,e);return e}async function Mu(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),i=Math.min(1024/r,4);o.width=Math.round((n.naturalWidth||512)*i),o.height=Math.round((n.naturalHeight||512)*i);let a=o.getContext("2d");if(!a){e(null);return}a.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 Ru(t,e){t.name==="clipPath"&&t.attrs.id&&e.set(t.attrs.id,t);for(let n of t.children)Ru(n,e);return e}function Eu(t,e){t.name==="pattern"&&t.attrs.id&&e.set(t.attrs.id,t);for(let n of t.children)Eu(n,e);return e}function lh(t,e){let[n,o]=e,r=(i,a)=>Z(t.attrs[i],a);switch(t.name){case "path":return ne(t.attrs.d??"");case "rect":{let i=t.attrs.rx??t.attrs.ry,a=t.attrs.ry??t.attrs.rx;return Oe(r("x",n),r("y",o),r("width",n),r("height",o),Z(i,n),Z(a,o))}case "circle":{let i=r("r",Math.hypot(n,o)/Math.SQRT2);return mn(r("cx",n),r("cy",o),i,i)}case "ellipse":return mn(r("cx",n),r("cy",o),r("rx",n),r("ry",o));default:return []}}var Br=class{gradients;shadings;clipPaths=new Map;patterns=new Map;backdrop=Cu;paper=Cu;background=null;onPaper=false;inConic=false;constructor(e,n=null){this.gradients=e,this.shadings=n;}resolveColor(e){if(!e||e==="none")return null;let n=Dr.exec(e);if(n)return this.resolveColor(this.gradients.get(n[1]));let o=J(e==="currentColor"?"#000000":e);return o&&o.a>0?o:null}shadedGradient(e){let n=e?Dr.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 i=this.patternOf(e);if(i)return {pattern:i,alpha:r};let a=this.shadedGradient(e);if(a){let c=xu(a,n,o);if(!c)return null;if("coords"in c)return {gradient:c,alpha:r};let u={...c,a:c.a*r};return u.a>0?{color:u}:null}let l=this.resolveColor(e);if(!l)return null;let s={...l,a:l.a*r};return s.a>0?{color:s}:null}patternOf(e){let n=e?Dr.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 Mr(e,this.onPaper||o?this.paper:this.backdrop)}paintPattern(e,n,o,r){let i=Ni(e);if(!i||i.width<=0||i.height<=0)return true;let[a,l]=n.viewport,s=Z(o.attrs.x,a),c=Z(o.attrs.y,l),u=Z(o.attrs.width,a),m=Z(o.attrs.height,l);if(!(u>0&&m>0))return true;let d=ee(o.attrs.patternTransform),p=en(d);if(!p)return true;if(!this.beginClip(e,n.matrix,n.fillRule==="evenodd"))return false;let b=this.inConic;this.inConic=o.attrs["data-qrdx-conic"]!==void 0;try{let f=[nt(p,i.x,i.y),nt(p,i.x+i.width,i.y),nt(p,i.x,i.y+i.height),nt(p,i.x+i.width,i.y+i.height)],h=f.map(([F])=>F),g=f.map(([,F])=>F),y=Math.min(...h),x=Math.max(...h),C=Math.min(...g),w=Math.max(...g),S=Math.floor((y-s)/u),$=Math.ceil((x-s)/u)-1,R=Math.floor((C-c)/m),M=Math.ceil((w-c)/m)-1,A=($-S+1)*(M-R+1);if(A>4096)return !0;let v=(o.attrs["data-qrdx-conic"]??"").trim().split(/\s+/).map(Number),I=gt(n.matrix,d);for(let F=R;F<=M;F++)for(let N=S;N<=$;N++){let k=s+N*u,L=c+F*m,z=gt(I,[1,0,0,1,k,L]),B={x:y-k,y:C-L,width:x-y,height:w-C},U=v.length===2&&v.every(Number.isFinite)?kc(v[0],v[1],B):null,D=A>1&&this.beginClip([{op:"M",x:0,y:0},{op:"L",x:u,y:0},{op:"L",x:u,y:m},{op:"L",x:0,y:m},{op:"Z"}],z,!1);try{let st={matrix:z,viewport:n.viewport,fill:"#000000",fillRule:"nonzero",stroke:"none",strokeWidth:1,fontSize:16,fontWeight:"normal",textAnchor:"start",fillOpacity:1,opacity:r},xt=(ht,It)=>{for(let ut of ht){if(ut.name==="g"&&!ut.attrs.transform){let X=Number.parseFloat(ut.attrs.opacity??"1");xt(ut.children,{...It,opacity:(It.opacity??1)*(Number.isFinite(X)?X:1)});continue}if(U&&ut.attrs["data-arc"]){let[X,lt]=ut.attrs["data-arc"].split(/\s+/).map(Number);if(!Nc([X,X+lt],U))continue}this.walk(ut,It);}};xt(o.children,st);}finally{D&&this.endClip();}}}finally{this.inConic=b,this.endClip();}return true}paintBleed(e,n,o,r){if(!this.shadedGradient(o))return false;let[i,a]=this.viewportMatrix({...e,attrs:{...e.attrs,x:"0",y:"0"}},{...n,matrix:gt(n.matrix,ee(e.attrs.transform))}),l=en(i);if(!l)return false;let[s,c,u,m]=r,p=[[s,c],[u,c],[u,m],[s,m]].map(([b,f])=>nt(l,b,f)).map(([b,f],h)=>({op:h===0?"M":"L",x:b,y:f}));return p.push({op:"Z"}),this.paint(p,{name:"rect",attrs:{},children:[],text:""},{...n,matrix:i,viewport:a,fill:o,fillRule:"nonzero",stroke:"none"}),true}beginClip(e,n,o){return false}endClip(){}clipOf(e,n){let o=tt(e,"clip-path"),r=o?Dr.exec(o)?.[1]:void 0,i=r?this.clipPaths.get(r):void 0;if(!i)return null;let a=[],l=false;for(let s of i.children){let c=lh(s,n.viewport);if(c.length===0)continue;let u=ee(s.attrs.transform),m=u[0]===1&&u[1]===0&&u[2]===0&&u[3]===1&&u[4]===0&&u[5]===0;a.push(...m?c:c.map(d=>ih(d,u))),l||=tt(s,"clip-rule")==="evenodd";}return a.length>0?{segments:a,matrix:n.matrix,evenOdd:l}:null}viewportMatrix(e,n){let o=Z(e.attrs.x,n.viewport[0]),r=Z(e.attrs.y,n.viewport[1]),i=Z(e.attrs.width,n.viewport[0],n.viewport[0]),a=Z(e.attrs.height,n.viewport[1],n.viewport[1]),l=Zn(e.attrs.viewBox);if(l.length!==4||!(l[2]&&l[3]))return [gt(n.matrix,[1,0,0,1,o,r]),[i,a]];let[s,c,u,m]=l,d=i/u,p=a/m,b=o,f=r;if((e.attrs.preserveAspectRatio??"").trim()!=="none"){let h=e.attrs.preserveAspectRatio?.includes("slice")?Math.max(d,p):Math.min(d,p);b+=(i-u*h)/2,f+=(a-m*h)/2,d=h,p=h;}return [gt(n.matrix,[d,0,0,p,b-s*d,f-c*p]),[u,m]]}walk(e,n,o=false){if(o&&(this.clipPaths=Ru(e,new Map),this.patterns=Eu(e,new Map)),sh.has(e.name)||tt(e,"display")==="none"||tt(e,"visibility")==="hidden")return;let r=gt(n.matrix,ee(e.attrs.transform)),i=n.viewport;if(e.name==="svg"){let[d,p]=this.viewportMatrix(o?{...e,attrs:{...e.attrs,x:"0",y:"0"}}:e,{...n,matrix:r});r=d,i=p;}let a=tt(e,"font-size"),l=Number.parseFloat(tt(e,"opacity")??"1"),s=tt(e,"fill-opacity"),c=s===void 0?n.fillOpacity??1:Number.parseFloat(s),u={fillOpacity:Number.isFinite(c)?Math.min(Math.max(c,0),1):1,opacity:(n.opacity??1)*(Number.isFinite(l)?Math.min(Math.max(l,0),1):1),matrix:r,viewport:i,fill:tt(e,"fill")??n.fill,fillRule:tt(e,"fill-rule")??n.fillRule,stroke:tt(e,"stroke")??n.stroke,strokeWidth:tt(e,"stroke-width")===void 0?n.strokeWidth:Z(tt(e,"stroke-width"),i[0],1),strokeLinejoin:tt(e,"stroke-linejoin")??n.strokeLinejoin,strokeLinecap:tt(e,"stroke-linecap")??n.strokeLinecap,fontSize:a===void 0?n.fontSize:Z(a,16,16),fontWeight:tt(e,"font-weight")??n.fontWeight,textAnchor:tt(e,"text-anchor")??n.textAnchor},m=this.onPaper;(e.name==="rect"||e.name==="circle"||e.name==="path")&&ah.test(tt(e,"fill")??"")&&(this.onPaper=true);try{let d=e.attrs["clip-path"]?this.clipOf(e,u):null;if(d&&this.beginClip(d.segments,d.matrix,d.evenOdd)){try{this.paintNode(e,u);}finally{this.endClip();}return}this.paintNode(e,u);}finally{this.onPaper=m;}}paintNode(e,n){let[o,r]=n.viewport,i=(a,l)=>Z(e.attrs[a],l);switch(e.name){case "path":this.paint(ne(e.attrs.d??""),e,n);return;case "rect":{let a=e.attrs.rx??e.attrs.ry,l=e.attrs.ry??e.attrs.rx;this.paint(Oe(i("x",o),i("y",r),i("width",o),i("height",r),Z(a,o),Z(l,r)),e,n);return}case "circle":{let a=i("r",Math.hypot(o,r)/Math.SQRT2);this.paint(mn(i("cx",o),i("cy",r),a,a),e,n);return}case "ellipse":this.paint(mn(i("cx",o),i("cy",r),i("rx",o),i("ry",r)),e,n);return;case "line":this.paint([{op:"M",x:i("x1",o),y:i("y1",r)},{op:"L",x:i("x2",o),y:i("y2",r)}],e,{...n,fill:"none"});return;case "polygon":case "polyline":{let a=Zn(e.attrs.points),l=[];for(let s=0;s+1<a.length;s+=2)l.push({op:s===0?"M":"L",x:a[s],y:a[s+1]});e.name==="polygon"&&l.length>0&&l.push({op:"Z"}),this.paint(l,e,n);return}case "text":this.text(e,n);return;case "image":this.image(e,n);return;default:for(let a of e.children)this.walk(a,n);}}};var Gr=1e3;async function Bi(t){let e=await _e(kn({...t,size:t.size??$t},Gr));return decodeURIComponent(e.replace("data:image/svg+xml,",""))}function Gi(t){if(Xt(t.frame)){let e=je(Gr,t.frame);return e.squareEdges?e.color:null}if(t.backdrop&&t.bgRadius){let e=Gt(t.value,de(t),t.exactLevel).size,n=Pt(e,t.margin??zt,t.shape);if(wr(t.bgRadius,e,n,t.shape)>0)return mt(t.backdrop,et)}return mt(t.bgColor,et)}function Qi(t,e){let n=Gi(t);if(!(n&&ke(t.bgColor))||Xt(t.frame)||t.templateId||t.customTemplate)return n;let o=jn(e)?.children.find(i=>i.name==="rect"),r=o&&tt(o,"fill");return r?.startsWith("url(")?r:n}function Ui(t,e){let n={r:255,g:255,b:255,a:1},o=J(mt(e.bgColor,et));t.paper=n,t.background=o&&!ke(e.bgColor)?o:null,t.backdrop=o?Mr(o,n):n;}var vu=25.4,Au=5,Pu=2e3,Qr=Gr,ch=5,uh=2;function mh(t,e="mm"){return e==="in"?t*vu:t}function dh(t){let e=de(t),n=Gt(t.value,e,t.exactLevel).size;return n+Pt(n,t.margin??zt,t.shape)*2}function Iu(t,e){let n=mh(e.size,e.unit);if(!Number.isFinite(n)||n<Au||n>Pu)throw new Error(`Print size must be between ${Au} mm and ${Pu/1e3} m`);let o=Math.min(Math.max(e.bleed??0,0),20),r=n/Qr,i=Xt(t.frame)?je(Qr,t.frame):null,a=(i?.width??Qr)*r,l=(i?.height??Qr)*r,s=e.cropMarks?o+uh+ch+1:o,c=dh(t);return {codeWidth:n,trimWidth:a,trimHeight:l,bleed:o,pageWidth:a+2*s,pageHeight:l+2*s,trimX:s,trimY:s,moduleSize:n/c,moduleCount:c,maxScanDistance:n*10}}var fh=[137,80,78,71,13,10,26,10];async function Lu(t,e){let n=new Blob([t]).stream().pipeThrough(e);return new Uint8Array(await new Response(n).arrayBuffer())}async function Tu(t){return typeof CompressionStream>"u"?null:await Lu(t,new CompressionStream("deflate"))}async function hh(t){if(typeof DecompressionStream>"u")return null;try{return await Lu(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,Fu={0:1,2:3,3:1,4:2,6:4};function ph(t,e,n){let o=t+e-n,r=Math.abs(o-t),i=Math.abs(o-e),a=Math.abs(o-n);return r<=i&&r<=a?t:i<=a?e:n}async function ku(t){if(fh.some((f,h)=>t[h]!==f))return null;let e=8,n=0,o=0,r=-1,i=null,a=null,l=[];for(;e+8<=t.length;){let f=Hi(t,e),h=String.fromCharCode(...t.subarray(e+4,e+8)),g=t.subarray(e+8,e+8+f);if(e+=12+f,h==="IHDR"){n=Hi(g,0),o=Hi(g,4);let y=g[8];r=g[9];let x=g[12];if(y!==8||x!==0||!(r in Fu))return null}else if(h==="PLTE")i=g;else if(h==="tRNS")a=g;else if(h==="IDAT")l.push(g);else if(h==="IEND")break}if(!(n&&o)||n*o>4096*4096)return null;let s=new Uint8Array(l.reduce((f,h)=>f+h.length,0)),c=0;for(let f of l)s.set(f,c),c+=f.length;let u=await hh(s),m=Fu[r],d=n*m;if(!u||u.length<o*(d+1))return null;let p=new Uint8Array(o*d);for(let f=0;f<o;f++){let h=u[f*(d+1)],g=u.subarray(f*(d+1)+1,(f+1)*(d+1)),y=f*d;for(let x=0;x<d;x++){let C=x>=m?p[y+x-m]:0,w=f>0?p[y-d+x]:0,S=f>0&&x>=m?p[y-d+x-m]:0,$=g[x],R=0;h===1?R=C:h===2?R=w:h===3?R=C+w>>1:h===4&&(R=ph(C,w,S)),p[y+x]=$+R&255;}}let b=new Uint8Array(n*o*4);for(let f=0;f<n*o;f++){let h=f*4,g=f*m;if(r===3){let y=p[g];b[h]=i?.[y*3]??0,b[h+1]=i?.[y*3+1]??0,b[h+2]=i?.[y*3+2]??0,b[h+3]=a?.[y]??255;}else if(r===0||r===4){let y=p[g];b[h]=y,b[h+1]=y,b[h+2]=y,b[h+3]=r===4?p[g+1]:255;}else b[h]=p[g],b[h+1]=p[g+1],b[h+2]=p[g+2],b[h+3]=r===6?p[g+3]:255;}return {width:n,height:o,data:b}}var gh=25.4,Nu=72/gh,bh=50;function _h(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 yh(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],i=t[e+7]<<8|t[e+8],a=t[e+9];return {width:i,height:r,components:a,progressive:n===194}}e+=2+o;}return null}async function xh(t,e){let{width:n,height:o,data:r}=t,i=e?4:3,a=new Uint8Array(n*o*i);for(let s=0;s<n*o;s++){let c=r[s*4+3]/255,u=r[s*4]*c+255*(1-c),m=r[s*4+1]*c+255*(1-c),d=r[s*4+2]*c+255*(1-c);if(e){let[p,b,f,h]=hn(u,m,d);a.set([p*255,b*255,f*255,h*255].map(Math.round),s*i);}else a.set([Math.round(u),Math.round(m),Math.round(d)],s*i);}let l=await Tu(a);return {kind:"raw",width:n,height:o,components:i,bytes:l??a,compressed:!!l}}async function $h(t,e){let n=t;if(!/^data:image\/(png|jpe?g)[;,]/i.test(n)){let a=await Mu(n);if(!a)return null;n=a;}let o=_h(n);if(!o)return null;let r=yh(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 i=await ku(o);return i?await xh(i,e):null}function Sh(t){let e="",n=0,o=r=>{e+=r,n+=r.length,n>=76&&(e+=`
|
|
2
|
+
`,n=0);};for(let r=0;r<t.length;r+=4){let i=Math.min(4,t.length-r),a=0;for(let s=0;s<4;s++)a=a*256+(s<i?t[r+s]:0);if(a===0&&i===4){o("z");continue}let l=[];for(let s=0;s<5;s++)l.unshift(String.fromCharCode(a%85+33)),a=Math.floor(a/85);o(l.slice(0,i+1).join(""));}return `${e}~>`}var Ch=`/qrdxdict 40 dict def
|
|
3
3
|
qrdxdict begin
|
|
4
4
|
/m {moveto} bind def
|
|
5
5
|
/l {lineto} bind def
|
|
@@ -20,11 +20,11 @@ qrdxdict begin
|
|
|
20
20
|
} bind def
|
|
21
21
|
/QRDX-Regular /Helvetica latin1
|
|
22
22
|
/QRDX-Bold /Helvetica-Bold latin1
|
|
23
|
-
end`;function
|
|
24
|
-
`));}};async function
|
|
25
|
-
`)}var Ch="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 wh(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 ku(t,e={}){if(wh(t))throw new Error(Ch);let n=Pu(t,{size:e.sizeMm??ph,unit:"mm",bleed:e.bleedMm}),o=await Di(t);return await Sh(o,{width:n.trimWidth*Tu,bleed:n.bleed*Tu,bleedColor:n.bleed>0?Gi(t,o):Bi(t),colorMode:e.colorMode,background:ut(t.bgColor,rt)})}function Nu(t){return `data:application/postscript;base64,${btoa(t)}`}var zi={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},gif:{mimeType:In,extension:"gif",vector:false},ico:{mimeType:be,extension:"ico",vector:false,sizes:Fr},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}};function Ou(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 kn(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 Yt(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=>(zi[t]??zi.png).mimeType;function Rh(t,e,n){let{extension:o,vector:r,sizes:i}=zi[t];if(r||i)return `qr-code.${o}`;let{width:a,height:l}=Rn(e.width,n);return `qr-code-${Math.round(a)}x${Math.round(l)}.${o}`}async function Bu(t,e={}){let n=await xe(t,"image/webp",true);try{return await Nr(n,e)}finally{n.remove();}}async function Gu(t){let e=await xe(t,"image/png",true);try{return or(e)}finally{e.remove();}}async function Qu(t){let e=await xe(t,"image/png",true);try{return await Ir(e,t.value)}finally{e.remove();}}async function Uu(t,e=Fr){let n=[];try{for(let o of e)n.push(await xe(kn({...t,frame:void 0},o),"image/png",!0));return Ai(n)}finally{for(let o of n)o.remove();}}var Mh=25.4/72;async function Hu(t){let e=await ku(t,{sizeMm:(t.size??xt)*Mh});return Nu(e)}async function qu(t){let e;try{({jsPDF:e}=await import('jspdf'));}catch(d){throw new Error(`PDF export needs the optional "jspdf" package. Install it with \`npm install jspdf\`. (${d})`)}let n=await ye(t),o=decodeURIComponent(n.replace("data:image/svg+xml,","")),r;try{let d=new TextEncoder().encode(o),p=Array.from(d,f=>String.fromCharCode(f)).join("");r=`data:image/svg+xml;base64,${btoa(p)}`;}catch(d){throw new Error(`Failed to encode SVG for PDF conversion: ${d}`)}let{width:i,height:a}=Rn(t.size||xt,t.frame),l=await new Promise((d,p)=>{let b=new Image,f=document.createElement("canvas");f.width=Math.round(i),f.height=Math.round(a);let h=f.getContext("2d");if(!h){p(new Error("Could not get canvas context"));return}let g=setTimeout(()=>{f.remove(),p(new Error("SVG load timeout - image may be too large or contain invalid data"));},3e4);b.onload=()=>{clearTimeout(g);try{h.drawImage(b,0,0,f.width,f.height),d(f);}catch(y){clearTimeout(g),f.remove(),p(new Error(`Failed to draw image to canvas: ${y}`));}},b.onerror=()=>{clearTimeout(g),f.remove(),p(new Error("Could not load SVG for PDF conversion"));},b.src=r;}),s=l.toDataURL("image/png",1),c=i*.264583,u=a*.264583,m=new e({orientation:c>u?"landscape":"portrait",unit:"mm",format:[c,u]});return m.addImage(s,"PNG",0,0,c,u),l.remove(),m.output("dataurlstring")}async function zu(t,e){let{format:n,size:o,filename:r,quality:i}=e,a=Ou(o.width,o.height);if(!a.isValid)throw new Error(a.error);let l=kn(t,o.width),s=r||Rh(n,o,t.frame);try{if(n==="svg"){let c=await ye(l);Yt(c,s);}else if(n==="pdf"){let c=await qu(l);Yt(c,s);}else if(n==="eps")Yt(await Hu(l),s);else if(n==="webp"){let c=await Bu(l,{quality:i});Yt(await $t(c),s);}else if(n==="bmp"){let c=await Gu(l);Yt(await $t(c),s);}else if(n==="gif"){let c=await Qu(l);Yt(await $t(c),s);}else if(n==="ico"){let c=await Uu(l);Yt(await $t(c),s);}else {let c=Du(n),u=await xe(l,c);if(typeof u=="string")Yt(u,s);else throw new Error("Failed to generate image data URL")}}catch(c){throw console.error(`Error downloading ${n.toUpperCase()}:`,c),c}}async function Wu(t,e,n,o={}){let r=Ou(n.width,n.height);if(!r.isValid)throw new Error(r.error);let i=kn(t,n.width);if(e==="svg")return await ye(i);if(e==="pdf")return await qu(i);if(e==="eps")return await Hu(i);if(e==="webp")return await $t(await Bu(i,o));if(e==="bmp")return await $t(await Gu(i));if(e==="gif")return await $t(await Qu(i));if(e==="ico")return await $t(await Uu(i));let a=Du(e),l=await xe(i,a);if(typeof l=="string")return l;throw new Error("Failed to generate QR code data URL")}var Qr={value:["value","string"],size:["size","number"],level:["level","level"],"fg-color":["fgColor","string"],"bg-color":["bgColor","string"],"eye-color":["eyeColor","string"],"dot-color":["dotColor","string"],"body-pattern":["bodyPattern","string"],"corner-eye-pattern":["cornerEyePattern","string"],"corner-eye-dot-pattern":["cornerEyeDotPattern","string"],margin:["margin","number"],"template-id":["templateId","string"],"module-scale":["moduleScale","number"],"auto-level":["autoLevel","boolean"],shape:["shape","string"],"eye-gradient":["eyeGradient","string"],"bg-radius":["bgRadius","number"],backdrop:["backdrop","string"]},Vu=[...Object.values(Qr).map(([t])=>t),"frame","imageSettings","eyeColors","eyeShapes","halo","shadow","art","customTemplate","customProps"],Eh=new Set(["L","M","Q","H"]),Ah="QR code",Xu=Symbol.for("qrdx.code-element"),Ph=/^[a-z][a-z0-9._]*(?:-[a-z0-9._]*)+$/,Yu=":host{display:inline-block}:host([hidden]){display:none}svg{display:block;max-width:100%;height:auto}";function vh(t,e){switch(t){case "number":{let n=e.trim()===""?Number.NaN:Number(e);return Number.isFinite(n)?n:void 0}case "level":{let n=e.trim().toUpperCase();return Eh.has(n)?n:void 0}case "boolean":return e!=="false";default:return e}}function Ku(t){let e={};for(let n of Object.keys(t))t[n]!==void 0&&t[n]!==null&&(e[n]=t[n]);return e}function Ih(t,e){let n=t["aria-label"];return e?.trim()||typeof n=="string"&&n.trim()||Ah}function Ju(t,e){return {...t,part:"svg",role:"img","aria-label":Ih(t,e)}}var ju=(t,e)=>{let n=e??t.size??xt;return {width:n,height:n}},Fh=typeof HTMLElement>"u"?class{}:HTMLElement,Nn=class t extends Fh{static observedAttributes=[...Object.keys(Qr),"label","props"];static[Xu]=true;#n;#e={};#a;#o;#t=null;#s="";#r=true;#l=false;static{for(let e of Vu)Object.defineProperty(t.prototype,e,{configurable:true,enumerable:true,get(){return this.#e[e]},set(n){this.#m(e,n);}});}constructor(){super(),this.#n=this.shadowRoot??this.attachShadow({mode:"open"});let e=null;for(let n of Array.from(this.#n.children))n.localName==="style"?e=n:n.localName==="svg"&&(this.#t=n);e||(e=this.ownerDocument.createElement("style"),e.textContent=Yu,this.#n.prepend(e));for(let n of [...Vu,"props","label"])if(Object.hasOwn(this,n)){let o=this[n];delete this[n],this[n]=o;}}connectedCallback(){this.#r&&this.#u();}attributeChangedCallback(e,n,o){if(n===o)return;if(e==="label"){this.#o=o??void 0,this.#i();return}if(e==="props"){this.#d(o);return}let r=Qr[e];if(r){let[i,a]=r;this.#m(i,o===null?void 0:vh(a,o));}}get props(){return this.#a}set props(e){if(typeof e=="string"){this.#d(e);return}this.#a=e??void 0,this.#i();}get label(){return this.#o}set label(e){this.#o=e??void 0,this.#i();}get options(){return Ku({...this.#a,...this.#e})}get svg(){return this.#r&&this.isConnected&&this.#u(),this.#t}toSVGString(){return It(en(this.#c()))}async toDataURL(e="png",n={}){let o=this.#c();return await Wu(o,e,ju(o,n.size),{quality:n.quality})}async download(e={}){let n=this.#c();return await zu(n,{format:e.format??"png",size:ju(n,e.size),filename:e.filename,quality:e.quality})}#c(){let e=this.options;if(!e.value)throw new Error(`qrdx: <${this.localName}> has no value`);return e}#m(e,n){if(n==null){if(!(e in this.#e))return;delete this.#e[e];}else {if(this.#e[e]===n)return;this.#e[e]=n;}this.#i();}#d(e){if(e===null||e.trim()===""){this.props=void 0;return}try{let n=JSON.parse(e);if(!n||typeof n!="object"||Array.isArray(n))throw new TypeError("props must be a JSON object");this.props=n;}catch(n){this.#h(n);}}#i(){this.#r=true,!this.#l&&(this.#l=true,queueMicrotask(()=>{this.#l=false,this.#r&&this.isConnected&&this.#u();}));}#u(){this.#r=false;let e=this.options;if(!e.value){this.#f();return}let n,o;try{n=en(Ju(e,this.#o)),o=It(n);}catch(i){this.#f(),this.#h(i);return}if(this.#t&&o===this.#s)return;let r=vi(n,this.ownerDocument).firstChild;this.#t?.parentNode===this.#n?this.#t.replaceWith(r):this.#n.append(r),this.#t=r,this.#s=o;}#f(){this.#t?.remove(),this.#t=null,this.#s="";}#h(e){let n=new CustomEvent("qrdx-error",{cancelable:true,detail:{error:e}});this.dispatchEvent(n)&&console.error(`qrdx: <${this.localName}> could not draw its code`,e);}},Zu;function v5(t="qrdx-code"){let e=globalThis.customElements;if(!e)return Nn;let n=e.get(t);if(n){if(Xu in n)return n;throw new Error(`qrdx: <${t}> is already defined by another element; pass defineQRdxCode another tag name`)}let o=Zu===void 0?Nn:class extends Nn{};return e.define(t,o),Zu??=t,o}var Lh=t=>t.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">");function Th(t){let e=[],n={...t};for(let[o,[r,i]]of Object.entries(Qr)){let a=t[r];(i==="number"&&typeof a=="number"||i==="boolean"&&typeof a=="boolean"||i!=="number"&&i!=="boolean"&&typeof a=="string")&&(delete n[r],i==="boolean"?a&&e.push([o,""]):e.push([o,String(a)]));}return {attributes:e,rest:n}}function I5(t,{tagName:e="qrdx-code",label:n}={}){if(!Ph.test(e))throw new Error(`qrdx: ${e} is not a custom element name`);let o=Ku(t),{attributes:r,rest:i}=Th(o),{customTemplate:a,...l}=i;n!==void 0&&r.push(["label",n]),Object.keys(l).length>0&&r.push(["props",JSON.stringify(l)]);let s=r.map(([u,m])=>m===""?` ${u}`:` ${u}="${Lh(m)}"`).join(""),c=o.value?It(en(Ju(o,n))):"";return `<${e}${s}><template shadowrootmode="open"><style>${Yu}</style>${c}</template></${e}>`}/**
|
|
23
|
+
end`;function zi(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 qi=class extends Br{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,i]=hn(e.r,e.g,e.b);return `${_(n)} ${_(o)} ${_(r)} ${_(i)} cmyk`}return `${_(e.r/255)} ${_(e.g/255)} ${_(e.b/255)} rg`}tracePath(e,n){let o=["n"],r=false;for(let i of e)if(i.op==="M"||i.op==="L"&&!r){let[a,l]=nt(n,i.x,i.y);o.push(`${_(a)} ${_(l)} m`),r=true;}else if(i.op==="L"){let[a,l]=nt(n,i.x,i.y);o.push(`${_(a)} ${_(l)} l`);}else if(i.op==="C"){if(!r)continue;let[a,l]=nt(n,i.x1,i.y1),[s,c]=nt(n,i.x2,i.y2),[u,m]=nt(n,i.x,i.y);o.push(`${_(a)} ${_(l)} ${_(s)} ${_(c)} ${_(u)} ${_(m)} c`);}else r&&o.push("h");return o.join(" ")}beginClip(e,n,o){return this.out.push(`gsave ${this.tracePath(e,n)} ${o?"eoclip":"clip"} n`),true}endClip(){this.out.push("grestore");}rect(e,n,o,r,i){this.out.push(`${this.color(e)} n ${_(n)} ${_(o)} m ${_(n+r)} ${_(o)} l ${_(n+r)} ${_(o+i)} l ${_(n)} ${_(o+i)} l h f`);}shade(e,n,o){let r=gt(n.matrix,o.matrix);if(!en(r))return;let i=Su(o,this.cmyk?"cmyk":"rgb"),a=this.shadingNames.get(i);a||(a=`Sh${this.shadingNames.size}`,this.shadingNames.set(i,a)),this.usesLevel3=true;let l=n.fillRule==="evenodd"?"eoclip":"clip";this.out.push(`gsave ${this.tracePath(e,n.matrix)} ${l} n [${$u(r)}] concat ${a} shfill grestore`);}paint(e,n,o){if(e.length===0)return;let r=o.opacity??1;if(r<=0)return;let i=this.resolveFill(o.fill,e,o.viewport,(o.fillOpacity??1)*r);i&&"pattern"in i?this.paintPattern(e,o,i.pattern,i.alpha):i&&"gradient"in i&&this.shade(e,o,{...i.gradient,stops:i.gradient.stops.map(m=>({...m,color:this.flatten({...m.color,a:m.color.a*i.alpha})}))});let a=i&&"color"in i?this.flatten(i.color):null,l=o.strokeWidth>0?this.resolveColor(o.stroke):null,s=l&&this.flatten({...l,a:l.a*r});if(!(a||s))return;let c=this.tracePath(e,o.matrix),u=o.fillRule==="evenodd"?"ef":"f";if(a&&s?this.out.push(`gsave ${this.color(a)} ${c} ${u} grestore`):a&&this.out.push(`${this.color(a)} ${c} ${u}`),s){let m=`${this.color(s)} ${_(o.strokeWidth*So(o.matrix))} w ${c} s`,{join:d,cap:p}=wu(o);this.out.push(d||p?`gsave ${d} setlinejoin ${p} setlinecap ${m} grestore`:m);}}text(e,n){let o=e.text.replace(/\s+/g," ").trim(),r=this.resolveColor(n.fill);if(!(o&&r))return;let i=So(n.matrix),[a,l]=nt(n.matrix,Z(e.attrs.x,n.viewport[0]),Z(e.attrs.y,n.viewport[1])),c=n.fontWeight==="bold"||Number.parseInt(n.fontWeight,10)>=600?"/QRDX-Bold":"/QRDX-Regular",u=_(n.fontSize*i),m=Number.parseFloat(e.attrs["data-max-width"]??""),d=m>0?` dup stringwidth pop dup ${_(m*i)} gt {${_(m*i)} exch div ${u} mul ${c} findfont exch scalefont setfont} {pop} ifelse`:"",p=n.textAnchor==="middle"?" dup stringwidth pop 2 div neg 0 rmoveto":n.textAnchor==="end"?" dup stringwidth pop neg 0 rmoveto":"",b=Math.atan2(n.matrix[1],n.matrix[0])*180/Math.PI;if(Math.abs(b)>.01){this.out.push(`gsave ${this.color(r)} ${c} findfont ${u} scalefont setfont ${_(a)} ${_(l)} translate ${_(b)} rotate ${zi(o)}${d} 0 0 moveto${p} show grestore`);return}this.out.push(`gsave ${this.color(r)} ${c} findfont ${u} scalefont setfont ${zi(o)}${d} ${_(a)} ${_(l)} moveto${p} 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 i=Z(e.attrs.x,n.viewport[0]),a=Z(e.attrs.y,n.viewport[1]),l=Z(e.attrs.width,n.viewport[0]),s=Z(e.attrs.height,n.viewport[1]);if(l<=0||s<=0)return;let[c,u]=nt(n.matrix,i,a),[m,d]=nt(n.matrix,i+l,a+s),{components:p}=r,b=p===1?"/DeviceGray":p===4?"/DeviceCMYK":"/DeviceRGB",f=Array.from({length:p},()=>"0 1").join(" "),h="/ASCII85Decode filter";r.kind==="jpeg"?(h+=" /DCTDecode filter",r.progressive&&(this.usesLevel3=true)):r.compressed&&(h+=" /FlateDecode filter",this.usesLevel3=true),this.out.push(["gsave",`${_(Math.min(c,m))} ${_(Math.min(u,d))} translate ${_(Math.abs(m-c))} ${_(Math.abs(d-u))} scale`,`${b} setcolorspace`,`<< /ImageType 1 /Width ${r.width} /Height ${r.height} /BitsPerComponent 8 /Decode [${f}] /ImageMatrix [${r.width} 0 0 -${r.height} 0 ${r.height}] /DataSource currentfile ${h} >> image`,Sh(r.bytes),"grestore"].join(`
|
|
24
|
+
`));}};async function wh(t,e={}){let n=jn(t);if(!n)throw new Error("Could not read the SVG to convert to EPS");let o=Z(n.attrs.width,0,0)||512,r=Z(n.attrs.height,0,0)||o,i=e.width??o;if(!(Number.isFinite(i)&&i>0))throw new Error("EPS width must be a positive number of points");let a=i/o,l=r*a,s=Math.max(0,e.bleed??0),c=i+2*s,u=l+2*s,m=e.colorMode==="cmyk",d=new Map;for(let y of Di(n,new Set)){let x=await $h(y,m);x&&d.set(y,x);}let p=new qi(m,Oi(n,new Map),yu(n),d);Ui(p,{bgColor:e.background??"#ffffff"});let f={matrix:gt([1,0,0,-1,s,u-s],[a,0,0,a,0,0]),viewport:[o,r],fill:"#000000",fillRule:"nonzero",stroke:"none",strokeWidth:1,fontSize:16,fontWeight:"normal",textAnchor:"start"},h=s>0?e.bleedColor??void 0:void 0;if(!(h&&p.paintBleed(n,f,h,[0,0,c,u]))){let y=h?p.resolveColor(h):null;y&&p.rect(y,0,0,c,u);}p.walk(n,f,true);let g=(e.title??"QR code").replace(/[^\x20-\x7e]/g,"?");return ["%!PS-Adobe-3.0 EPSF-3.0",`%%BoundingBox: 0 0 ${Math.ceil(c)} ${Math.ceil(u)}`,`%%HiResBoundingBox: 0 0 ${_(c)} ${_(u)}`,`%%Title: ${zi(g)}`,"%%Creator: qrdx",`%%LanguageLevel: ${p.usesLevel3?3:2}`,"%%DocumentData: Clean7Bit","%%EndComments","%%BeginProlog",Ch,"%%EndProlog","qrdxdict begin",...Array.from(p.shadingNames,([y,x])=>`/${x} ${y} def`),"gsave",...p.out,"grestore","end","showpage","%%Trailer","%%EOF",""].join(`
|
|
25
|
+
`)}var Mh="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 Rh(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 Ou(t,e={}){if(Rh(t))throw new Error(Mh);let n=Iu(t,{size:e.sizeMm??bh,unit:"mm",bleed:e.bleedMm}),o=await Bi(t);return await wh(o,{width:n.trimWidth*Nu,bleed:n.bleed*Nu,bleedColor:n.bleed>0?Qi(t,o):Gi(t),colorMode:e.colorMode,background:mt(t.bgColor,et)})}function Du(t){return `data:application/postscript;base64,${btoa(t)}`}var Wi={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},gif:{mimeType:In,extension:"gif",vector:false},ico:{mimeType:ge,extension:"ico",vector:false,sizes:Lr},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}};function Bu(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 kn(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 Gu=t=>(Wi[t]??Wi.png).mimeType;function Eh(t,e,n){let{extension:o,vector:r,sizes:i}=Wi[t];if(r||i)return `qr-code.${o}`;let{width:a,height:l}=Mn(e.width,n);return `qr-code-${Math.round(a)}x${Math.round(l)}.${o}`}async function Qu(t,e={}){let n=await ye(t,"image/webp",true);try{return await Or(n,e)}finally{n.remove();}}async function Uu(t){let e=await ye(t,"image/png",true);try{return ir(e)}finally{e.remove();}}async function Hu(t){let e=await ye(t,"image/png",true);try{return await Fr(e,t.value)}finally{e.remove();}}async function zu(t,e=Lr){let n=[];try{for(let o of e)n.push(await ye(kn({...t,frame:void 0},o),"image/png",!0));return Pi(n)}finally{for(let o of n)o.remove();}}var Ah=25.4/72;async function qu(t){let e=await Ou(t,{sizeMm:(t.size??$t)*Ah});return Du(e)}async function Wu(t){let e;try{({jsPDF:e}=await import('jspdf'));}catch(d){throw new Error(`PDF export needs the optional "jspdf" package. Install it with \`npm install jspdf\`. (${d})`)}let n=await _e(t),o=decodeURIComponent(n.replace("data:image/svg+xml,","")),r;try{let d=new TextEncoder().encode(o),p=Array.from(d,f=>String.fromCharCode(f)).join("");r=`data:image/svg+xml;base64,${btoa(p)}`;}catch(d){throw new Error(`Failed to encode SVG for PDF conversion: ${d}`)}let{width:i,height:a}=Mn(t.size||$t,t.frame),l=await new Promise((d,p)=>{let b=new Image,f=document.createElement("canvas");f.width=Math.round(i),f.height=Math.round(a);let h=f.getContext("2d");if(!h){p(new Error("Could not get canvas context"));return}let g=setTimeout(()=>{f.remove(),p(new Error("SVG load timeout - image may be too large or contain invalid data"));},3e4);b.onload=()=>{clearTimeout(g);try{h.drawImage(b,0,0,f.width,f.height),d(f);}catch(y){clearTimeout(g),f.remove(),p(new Error(`Failed to draw image to canvas: ${y}`));}},b.onerror=()=>{clearTimeout(g),f.remove(),p(new Error("Could not load SVG for PDF conversion"));},b.src=r;}),s=l.toDataURL("image/png",1),c=i*.264583,u=a*.264583,m=new e({orientation:c>u?"landscape":"portrait",unit:"mm",format:[c,u]});return m.addImage(s,"PNG",0,0,c,u),l.remove(),m.output("dataurlstring")}async function Vu(t,e){let{format:n,size:o,filename:r,quality:i}=e,a=Bu(o.width,o.height);if(!a.isValid)throw new Error(a.error);let l=kn(t,o.width),s=r||Eh(n,o,t.frame);try{if(n==="svg"){let c=await _e(l);Kt(c,s);}else if(n==="pdf"){let c=await Wu(l);Kt(c,s);}else if(n==="eps")Kt(await qu(l),s);else if(n==="webp"){let c=await Qu(l,{quality:i});Kt(await St(c),s);}else if(n==="bmp"){let c=await Uu(l);Kt(await St(c),s);}else if(n==="gif"){let c=await Hu(l);Kt(await St(c),s);}else if(n==="ico"){let c=await zu(l);Kt(await St(c),s);}else {let c=Gu(n),u=await ye(l,c);if(typeof u=="string")Kt(u,s);else throw new Error("Failed to generate image data URL")}}catch(c){throw console.error(`Error downloading ${n.toUpperCase()}:`,c),c}}async function ju(t,e,n,o={}){let r=Bu(n.width,n.height);if(!r.isValid)throw new Error(r.error);let i=kn(t,n.width);if(e==="svg")return await _e(i);if(e==="pdf")return await Wu(i);if(e==="eps")return await qu(i);if(e==="webp")return await St(await Qu(i,o));if(e==="bmp")return await St(await Uu(i));if(e==="gif")return await St(await Hu(i));if(e==="ico")return await St(await zu(i));let a=Gu(e),l=await ye(i,a);if(typeof l=="string")return l;throw new Error("Failed to generate QR code data URL")}var Ur={value:["value","string"],size:["size","number"],level:["level","level"],"fg-color":["fgColor","string"],"bg-color":["bgColor","string"],"eye-color":["eyeColor","string"],"dot-color":["dotColor","string"],"body-pattern":["bodyPattern","string"],"corner-eye-pattern":["cornerEyePattern","string"],"corner-eye-dot-pattern":["cornerEyeDotPattern","string"],margin:["margin","number"],"template-id":["templateId","string"],"module-scale":["moduleScale","number"],"auto-level":["autoLevel","boolean"],"exact-level":["exactLevel","boolean"],shape:["shape","string"],"eye-gradient":["eyeGradient","string"],"bg-radius":["bgRadius","number"],backdrop:["backdrop","string"]},Zu=[...Object.values(Ur).map(([t])=>t),"frame","imageSettings","eyeColors","eyeShapes","halo","shadow","art","customTemplate","customProps"],Ph=new Set(["L","M","Q","H"]),vh="QR code",Ku=Symbol.for("qrdx.code-element"),Ih=/^[a-z][a-z0-9._]*(?:-[a-z0-9._]*)+$/,Ju=":host{display:inline-block}:host([hidden]){display:none}svg{display:block;max-width:100%;height:auto}";function Fh(t,e){switch(t){case "number":{let n=e.trim()===""?Number.NaN:Number(e);return Number.isFinite(n)?n:void 0}case "level":{let n=e.trim().toUpperCase();return Ph.has(n)?n:void 0}case "boolean":return e!=="false";default:return e}}function t0(t){let e={};for(let n of Object.keys(t))t[n]!==void 0&&t[n]!==null&&(e[n]=t[n]);return e}function Lh(t,e){let n=t["aria-label"];return e?.trim()||typeof n=="string"&&n.trim()||vh}function e0(t,e){return {...t,part:"svg",role:"img","aria-label":Lh(t,e)}}var Xu=(t,e)=>{let n=e??t.size??$t;return {width:n,height:n}},Th=typeof HTMLElement>"u"?class{}:HTMLElement,Nn=class t extends Th{static observedAttributes=[...Object.keys(Ur),"label","props"];static[Ku]=true;#n;#e={};#a;#o;#t=null;#s="";#r=true;#l=false;static{for(let e of Zu)Object.defineProperty(t.prototype,e,{configurable:true,enumerable:true,get(){return this.#e[e]},set(n){this.#m(e,n);}});}constructor(){super(),this.#n=this.shadowRoot??this.attachShadow({mode:"open"});let e=null;for(let n of Array.from(this.#n.children))n.localName==="style"?e=n:n.localName==="svg"&&(this.#t=n);e||(e=this.ownerDocument.createElement("style"),e.textContent=Ju,this.#n.prepend(e));for(let n of [...Zu,"props","label"])if(Object.hasOwn(this,n)){let o=this[n];delete this[n],this[n]=o;}}connectedCallback(){this.#r&&this.#u();}attributeChangedCallback(e,n,o){if(n===o)return;if(e==="label"){this.#o=o??void 0,this.#i();return}if(e==="props"){this.#d(o);return}let r=Ur[e];if(r){let[i,a]=r;this.#m(i,o===null?void 0:Fh(a,o));}}get props(){return this.#a}set props(e){if(typeof e=="string"){this.#d(e);return}this.#a=e??void 0,this.#i();}get label(){return this.#o}set label(e){this.#o=e??void 0,this.#i();}get options(){return t0({...this.#a,...this.#e})}get svg(){return this.#r&&this.isConnected&&this.#u(),this.#t}toSVGString(){return vt(tn(this.#c()))}async toDataURL(e="png",n={}){let o=this.#c();return await ju(o,e,Xu(o,n.size),{quality:n.quality})}async download(e={}){let n=this.#c();return await Vu(n,{format:e.format??"png",size:Xu(n,e.size),filename:e.filename,quality:e.quality})}#c(){let e=this.options;if(!e.value)throw new Error(`qrdx: <${this.localName}> has no value`);return e}#m(e,n){if(n==null){if(!(e in this.#e))return;delete this.#e[e];}else {if(this.#e[e]===n)return;this.#e[e]=n;}this.#i();}#d(e){if(e===null||e.trim()===""){this.props=void 0;return}try{let n=JSON.parse(e);if(!n||typeof n!="object"||Array.isArray(n))throw new TypeError("props must be a JSON object");this.props=n;}catch(n){this.#h(n);}}#i(){this.#r=true,!this.#l&&(this.#l=true,queueMicrotask(()=>{this.#l=false,this.#r&&this.isConnected&&this.#u();}));}#u(){this.#r=false;let e=this.options;if(!e.value){this.#f();return}let n,o;try{n=tn(e0(e,this.#o)),o=vt(n);}catch(i){this.#f(),this.#h(i);return}if(this.#t&&o===this.#s)return;let r=Ii(n,this.ownerDocument).firstChild;this.#t?.parentNode===this.#n?this.#t.replaceWith(r):this.#n.append(r),this.#t=r,this.#s=o;}#f(){this.#t?.remove(),this.#t=null,this.#s="";}#h(e){let n=new CustomEvent("qrdx-error",{cancelable:true,detail:{error:e}});this.dispatchEvent(n)&&console.error(`qrdx: <${this.localName}> could not draw its code`,e);}},Yu;function k5(t="qrdx-code"){let e=globalThis.customElements;if(!e)return Nn;let n=e.get(t);if(n){if(Ku in n)return n;throw new Error(`qrdx: <${t}> is already defined by another element; pass defineQRdxCode another tag name`)}let o=Yu===void 0?Nn:class extends Nn{};return e.define(t,o),Yu??=t,o}var kh=t=>t.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">");function Nh(t){let e=[],n={...t};for(let[o,[r,i]]of Object.entries(Ur)){let a=t[r];(i==="number"&&typeof a=="number"||i==="boolean"&&typeof a=="boolean"||i!=="number"&&i!=="boolean"&&typeof a=="string")&&(delete n[r],i==="boolean"?a&&e.push([o,""]):e.push([o,String(a)]));}return {attributes:e,rest:n}}function N5(t,{tagName:e="qrdx-code",label:n}={}){if(!Ih.test(e))throw new Error(`qrdx: ${e} is not a custom element name`);let o=t0(t),{attributes:r,rest:i}=Nh(o),{customTemplate:a,...l}=i;n!==void 0&&r.push(["label",n]),Object.keys(l).length>0&&r.push(["props",JSON.stringify(l)]);let s=r.map(([u,m])=>m===""?` ${u}`:` ${u}="${kh(m)}"`).join(""),c=o.value?vt(tn(e0(o,n))):"";return `<${e}${s}><template shadowrootmode="open"><style>${Ju}</style>${c}</template></${e}>`}/**
|
|
26
26
|
* @license QR Code generator library (TypeScript)
|
|
27
27
|
* Copyright (c) Project Nayuki.
|
|
28
28
|
* SPDX-License-Identifier: MIT
|
|
29
|
-
*/export{
|
|
29
|
+
*/export{Ju as QRDX_CODE_STYLES,Nn as QRdxCodeElement,k5 as defineQRdxCode,N5 as toQRdxCodeHTML};//# sourceMappingURL=element.browser.mjs.map
|
|
30
30
|
//# sourceMappingURL=element.browser.mjs.map
|