qrdx 0.0.60 → 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 +3 -2
- 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/node.js +2 -2
- package/dist/node.js.map +1 -1
- package/dist/node.mjs +2 -2
- package/dist/node.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/api.d.ts +2 -3
- package/dist/src/api.d.ts.map +1 -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 +2 -8
- 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/qr-code-svg.d.ts +2 -3
- package/dist/src/qr-code-svg.d.ts.map +1 -1
- package/dist/src/qr-code.d.ts +2 -2
- package/dist/src/qr-code.d.ts.map +1 -1
- package/dist/src/qr-frame-svg.d.ts +2 -3
- package/dist/src/qr-frame-svg.d.ts.map +1 -1
- package/dist/src/rasterize.d.ts +8 -0
- package/dist/src/rasterize.d.ts.map +1 -1
- package/dist/src/react-elements.d.ts.map +1 -1
- package/dist/src/scan-score.d.ts +34 -0
- 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/types/react.d.ts +21 -3
- package/dist/types/react.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 +4 -6
- package/src/angular.ts +2 -0
- package/src/api.tsx +3 -4
- 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 +39 -34
- package/src/qr-code-props.ts +4 -0
- package/src/qr-code-svg.tsx +3 -4
- package/src/qr-code.tsx +7 -5
- package/src/qr-frame-svg.tsx +3 -4
- package/src/rasterize.ts +14 -1
- package/src/react-elements.ts +40 -2
- package/src/scan-score.ts +225 -51
- 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/types/react.ts +22 -3
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
'use strict';var react=require('react'),jsxRuntime=require('react/jsx-runtime'),schemas_js=require('./schemas.js'),framesIndex_js=require('./frames-index.js'),framesOfficial_js=require('./frames-official.js'),qrCodeCanvas_js=require('./qr-code-canvas.js');function Gt(t){return t.children}var Rd=t=>t==null?null:`${t}`;function va(t,e,n){let o=e??{},r=n;if("key"in o){let{key:a,...i}=o;a!==void 0&&(r=a),o=i;}return {type:t,props:o,key:Rd(r)}}function Md(t,e){let n=t;return {type:n.type,props:{...n.props,...e},key:n.key??null}}function Ed(t,e,...n){let o={...e};return n.length>0&&(o.children=n.length===1?n[0]:n),va(t,o)}var Ad={jsx:va,jsxs:va,createElement:Ed,cloneElement:Md,Fragment:Gt},_e=Ad;function $n(t,e){let n=_e;_e=t;try{return e()}finally{_e=n;}}var La=t=>t===Gt?_e.Fragment:t;function A(t,e,n){return _e.jsx(La(t),e,n)}function $t(t,e,n){return _e.jsxs(La(t),e,n)}function qr(t,e,...n){return _e.createElement(La(t),e??null,...n)}function Ne(t,e){return _e.cloneElement(t,e)}var Pd=new Set([Symbol.for("react.element"),Symbol.for("react.transitional.element")]),Fl=Symbol.for("react.fragment");function Oe(t){if(typeof t!="object"||t===null||Array.isArray(t))return false;let e=t;return e.$$typeof!==void 0&&!Pd.has(e.$$typeof)?false:(typeof e.type=="string"||typeof e.type=="function"||e.type===Fl)&&typeof e.props=="object"&&e.props!==null}var Sn=t=>t===Gt||t===Fl;var wn;(a=>{class t{constructor(s,l,c,u){this.version=s;this.errorCorrectionLevel=l;if(s<t.MIN_VERSION||s>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=s*4+17;let m=[];for(let d=0;d<this.size;d++)m.push(false);for(let d=0;d<this.size;d++)this.modules.push(m.slice()),this.isFunction.push(m.slice());this.drawFunctionPatterns();let f=this.addEccAndInterleave(c);if(this.drawCodewords(f),u==-1){let d=1e9;for(let g=0;g<8;g++){this.applyMask(g),this.drawFormatBits(g);let h=this.getPenaltyScore();h<d&&(u=g,d=h),this.applyMask(g);}}o(0<=u&&u<=7),this.mask=u,this.applyMask(u),this.drawFormatBits(u),this.isFunction=[];}version;errorCorrectionLevel;static encodeText(s,l){let c=a.QrSegment.makeSegments(s);return t.encodeSegments(c,l)}static encodeBinary(s,l){let c=a.QrSegment.makeBytes(s);return t.encodeSegments([c],l)}static encodeSegments(s,l,c=1,u=40,m=-1,f=true){if(!(t.MIN_VERSION<=c&&c<=u&&u<=t.MAX_VERSION)||m<-1||m>7)throw new RangeError("Invalid value");let d,g;for(d=c;;d++){let _=t.getNumDataCodewords(d,l)*8,y=r.getTotalBits(s,d);if(y<=_){g=y;break}if(d>=u)throw new RangeError("Data too long")}for(let _ of [t.Ecc.MEDIUM,t.Ecc.QUARTILE,t.Ecc.HIGH])f&&g<=t.getNumDataCodewords(d,_)*8&&(l=_);let h=[];for(let _ of s){e(_.mode.modeBits,4,h),e(_.numChars,_.mode.numCharCountBits(d),h);for(let y of _.getData())h.push(y);}o(h.length==g);let p=t.getNumDataCodewords(d,l)*8;o(h.length<=p),e(0,Math.min(4,p-h.length),h),e(0,(8-h.length%8)%8,h),o(h.length%8==0);for(let _=236;h.length<p;_^=253)e(_,8,h);let b=[];for(;b.length*8<h.length;)b.push(0);return h.forEach((_,y)=>b[y>>>3]|=_<<7-(y&7)),new t(d,l,b,m)}size;mask;modules=[];isFunction=[];getModule(s,l){return 0<=s&&s<this.size&&0<=l&&l<this.size&&this.modules[l][s]}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 s=this.getAlignmentPatternPositions(),l=s.length;for(let c=0;c<l;c++)for(let u=0;u<l;u++)c==0&&u==0||c==0&&u==l-1||c==l-1&&u==0||this.drawAlignmentPattern(s[c],s[u]);this.drawFormatBits(0),this.drawVersion();}drawFormatBits(s){let l=this.errorCorrectionLevel.formatBits<<3|s,c=l;for(let m=0;m<10;m++)c=c<<1^(c>>>9)*1335;let u=(l<<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 s=this.version;for(let c=0;c<12;c++)s=s<<1^(s>>>11)*7973;let l=this.version<<12|s;o(l>>>18==0);for(let c=0;c<18;c++){let u=n(l,c),m=this.size-11+c%3,f=Math.floor(c/3);this.setFunctionModule(m,f,u),this.setFunctionModule(f,m,u);}}drawFinderPattern(s,l){for(let c=-4;c<=4;c++)for(let u=-4;u<=4;u++){let m=Math.max(Math.abs(u),Math.abs(c)),f=s+u,d=l+c;0<=f&&f<this.size&&0<=d&&d<this.size&&this.setFunctionModule(f,d,m!=2&&m!=4);}}drawAlignmentPattern(s,l){for(let c=-2;c<=2;c++)for(let u=-2;u<=2;u++)this.setFunctionModule(s+u,l+c,Math.max(Math.abs(u),Math.abs(c))!=1);}setFunctionModule(s,l,c){this.modules[l][s]=c,this.isFunction[l][s]=true;}addEccAndInterleave(s){let l=this.version,c=this.errorCorrectionLevel;if(s.length!=t.getNumDataCodewords(l,c))throw new RangeError("Invalid argument");let u=t.NUM_ERROR_CORRECTION_BLOCKS[c.ordinal][l],m=t.ECC_CODEWORDS_PER_BLOCK[c.ordinal][l],f=Math.floor(t.getNumRawDataModules(l)/8),d=u-f%u,g=Math.floor(f/u),h=[],p=t.reedSolomonComputeDivisor(m);for(let _=0,y=0;_<u;_++){let w=s.slice(y,y+g-m+(_<d?0:1));y+=w.length;let C=t.reedSolomonComputeRemainder(w,p);_<d&&w.push(0),h.push(w.concat(C));}let b=[];for(let _=0;_<h[0].length;_++)h.forEach((y,w)=>{(_!=g-m||w>=d)&&b.push(y[_]);});return o(b.length==f),b}drawCodewords(s){if(s.length!=Math.floor(t.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let l=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 f=c-m,g=(c+1&2)==0?this.size-1-u:u;!this.isFunction[g][f]&&l<s.length*8&&(this.modules[g][f]=n(s[l>>>3],7-(l&7)),l++);}}o(l==s.length*8);}applyMask(s){if(s<0||s>7)throw new RangeError("Mask value out of range");for(let l=0;l<this.size;l++)for(let c=0;c<this.size;c++){let u;switch(s){case 0:u=(c+l)%2==0;break;case 1:u=l%2==0;break;case 2:u=c%3==0;break;case 3:u=(c+l)%3==0;break;case 4:u=(Math.floor(c/3)+Math.floor(l/2))%2==0;break;case 5:u=c*l%2+c*l%3==0;break;case 6:u=(c*l%2+c*l%3)%2==0;break;case 7:u=((c+l)%2+c*l%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[l][c]&&u&&(this.modules[l][c]=!this.modules[l][c]);}}getPenaltyScore(){let s=0;for(let m=0;m<this.size;m++){let f=false,d=0,g=[0,0,0,0,0,0,0];for(let h=0;h<this.size;h++)this.modules[m][h]==f?(d++,d==5?s+=t.PENALTY_N1:d>5&&s++):(this.finderPenaltyAddHistory(d,g),f||(s+=this.finderPenaltyCountPatterns(g)*t.PENALTY_N3),f=this.modules[m][h],d=1);s+=this.finderPenaltyTerminateAndCount(f,d,g)*t.PENALTY_N3;}for(let m=0;m<this.size;m++){let f=false,d=0,g=[0,0,0,0,0,0,0];for(let h=0;h<this.size;h++)this.modules[h][m]==f?(d++,d==5?s+=t.PENALTY_N1:d>5&&s++):(this.finderPenaltyAddHistory(d,g),f||(s+=this.finderPenaltyCountPatterns(g)*t.PENALTY_N3),f=this.modules[h][m],d=1);s+=this.finderPenaltyTerminateAndCount(f,d,g)*t.PENALTY_N3;}for(let m=0;m<this.size-1;m++)for(let f=0;f<this.size-1;f++){let d=this.modules[m][f];d==this.modules[m][f+1]&&d==this.modules[m+1][f]&&d==this.modules[m+1][f+1]&&(s+=t.PENALTY_N2);}let l=0;for(let m of this.modules)l=m.reduce((f,d)=>f+(d?1:0),l);let c=this.size*this.size,u=Math.ceil(Math.abs(l*20-c*10)/c)-1;return o(0<=u&&u<=9),s+=u*t.PENALTY_N4,o(0<=s&&s<=2568888),s}getAlignmentPatternPositions(){if(this.version==1)return [];{let s=Math.floor(this.version/7)+2,l=this.version==32?26:Math.ceil((this.version*4+4)/(s*2-2))*2,c=[6];for(let u=this.size-7;c.length<s;u-=l)c.splice(1,0,u);return c}}static getNumRawDataModules(s){if(s<t.MIN_VERSION||s>t.MAX_VERSION)throw new RangeError("Version number out of range");let l=(16*s+128)*s+64;if(s>=2){let c=Math.floor(s/7)+2;l-=(25*c-10)*c-55,s>=7&&(l-=36);}return o(208<=l&&l<=29648),l}static getNumDataCodewords(s,l){return Math.floor(t.getNumRawDataModules(s)/8)-t.ECC_CODEWORDS_PER_BLOCK[l.ordinal][s]*t.NUM_ERROR_CORRECTION_BLOCKS[l.ordinal][s]}static reedSolomonComputeDivisor(s){if(s<1||s>255)throw new RangeError("Degree out of range");let l=[];for(let u=0;u<s-1;u++)l.push(0);l.push(1);let c=1;for(let u=0;u<s;u++){for(let m=0;m<l.length;m++)l[m]=t.reedSolomonMultiply(l[m],c),m+1<l.length&&(l[m]^=l[m+1]);c=t.reedSolomonMultiply(c,2);}return l}static reedSolomonComputeRemainder(s,l){let c=l.map(u=>0);for(let u of s){let m=u^c.shift();c.push(0),l.forEach((f,d)=>c[d]^=t.reedSolomonMultiply(f,m));}return c}static reedSolomonMultiply(s,l){if(s>>>8||l>>>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^=(l>>>u&1)*s;return o(c>>>8==0),c}finderPenaltyCountPatterns(s){let l=s[1];o(l<=this.size*3);let c=l>0&&s[2]==l&&s[3]==l*3&&s[4]==l&&s[5]==l;return (c&&s[0]>=l*4&&s[6]>=l?1:0)+(c&&s[6]>=l*4&&s[0]>=l?1:0)}finderPenaltyTerminateAndCount(s,l,c){return s&&(this.finderPenaltyAddHistory(l,c),l=0),l+=this.size,this.finderPenaltyAddHistory(l,c),this.finderPenaltyCountPatterns(c)}finderPenaltyAddHistory(s,l){l[0]==0&&(s+=this.size),l.pop(),l.unshift(s);}static MIN_VERSION=1;static MAX_VERSION=40;static PENALTY_N1=3;static PENALTY_N2=3;static PENALTY_N3=40;static PENALTY_N4=10;static ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]];static NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]]}a.QrCode=t;function e(i,s,l){if(s<0||s>31||i>>>s)throw new RangeError("Value out of range");for(let c=s-1;c>=0;c--)l.push(i>>>c&1);}function n(i,s){return (i>>>s&1)!=0}function o(i){if(!i)throw new Error("Assertion error")}class r{constructor(s,l,c){this.mode=s;this.numChars=l;this.bitData=c;if(l<0)throw new RangeError("Invalid argument");this.bitData=c.slice();}mode;numChars;bitData;static makeBytes(s){let l=[];for(let c of s)e(c,8,l);return new r(r.Mode.BYTE,s.length,l)}static makeNumeric(s){if(!r.isNumeric(s))throw new RangeError("String contains non-numeric characters");let l=[];for(let c=0;c<s.length;){let u=Math.min(s.length-c,3);e(parseInt(s.substr(c,u),10),u*3+1,l),c+=u;}return new r(r.Mode.NUMERIC,s.length,l)}static makeAlphanumeric(s){if(!r.isAlphanumeric(s))throw new RangeError("String contains unencodable characters in alphanumeric mode");let l=[],c;for(c=0;c+2<=s.length;c+=2){let u=r.ALPHANUMERIC_CHARSET.indexOf(s.charAt(c))*45;u+=r.ALPHANUMERIC_CHARSET.indexOf(s.charAt(c+1)),e(u,11,l);}return c<s.length&&e(r.ALPHANUMERIC_CHARSET.indexOf(s.charAt(c)),6,l),new r(r.Mode.ALPHANUMERIC,s.length,l)}static makeSegments(s){return s==""?[]:r.isNumeric(s)?[r.makeNumeric(s)]:r.isAlphanumeric(s)?[r.makeAlphanumeric(s)]:[r.makeBytes(r.toUtf8ByteArray(s))]}static makeEci(s){let l=[];if(s<0)throw new RangeError("ECI assignment value out of range");if(s<128)e(s,8,l);else if(s<16384)e(2,2,l),e(s,14,l);else if(s<1e6)e(6,3,l),e(s,21,l);else throw new RangeError("ECI assignment value out of range");return new r(r.Mode.ECI,0,l)}static isNumeric(s){return r.NUMERIC_REGEX.test(s)}static isAlphanumeric(s){return r.ALPHANUMERIC_REGEX.test(s)}getData(){return this.bitData.slice()}static getTotalBits(s,l){let c=0;for(let u of s){let m=u.mode.numCharCountBits(l);if(u.numChars>=1<<m)return 1/0;c+=4+m+u.bitData.length;}return c}static toUtf8ByteArray(s){s=encodeURI(s);let l=[];for(let c=0;c<s.length;c++)s.charAt(c)!="%"?l.push(s.charCodeAt(c)):(l.push(parseInt(s.substr(c+1,2),16)),c+=2);return l}static NUMERIC_REGEX=/^[0-9]*$/;static ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/;static ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:"}a.QrSegment=r;})(wn||={});(e=>{(o=>{class n{constructor(a,i){this.ordinal=a;this.formatBits=i;}ordinal;formatBits;static LOW=new n(0,1);static MEDIUM=new n(1,0);static QUARTILE=new n(2,3);static HIGH=new n(3,2)}o.Ecc=n;})(e.QrCode||={});})(wn||={});(e=>{(o=>{class n{constructor(a,i){this.modeBits=a;this.numBitsCharCount=i;}modeBits;numBitsCharCount;static NUMERIC=new n(1,[10,12,14]);static ALPHANUMERIC=new n(2,[9,11,13]);static BYTE=new n(4,[8,16,16]);static KANJI=new n(8,[8,10,12]);static ECI=new n(7,[0,0,0]);numCharCountBits(a){return this.numBitsCharCount[Math.floor((a+7)/17)]}}o.Mode=n;})(e.QrSegment||={});})(wn||={});var dt=wn;var St={L:dt.QrCode.Ecc.LOW,M:dt.QrCode.Ecc.MEDIUM,Q:dt.QrCode.Ecc.QUARTILE,H:dt.QrCode.Ecc.HIGH},it=128,Jt="Q",ft="#FFFFFF",Mt="#000000";var pt=0;var Vr=.1;var jr=["logo","halftone"],Ta={logo:["blend","badge"],halftone:["color","mono"]},nr=192,Id=["square","rounded","circle","message","message-reverse","diya","diya-reverse","rounded-triangle","leaf","drop","plus","cross-rounded","hexagon","octagon","flower","heart","squircle","dots","extra-rounded","leaf-reverse","drop-reverse","cushion"],vd=["diamond","star","banner"],Ld=["square","rounded","gear","circle","diya","extra-rounded","message","pointy","leaf","drop","octagon","bevel","squircle","cushion","shield","petal","leaf-reverse","porthole","notch","plus","bud","bowl"],Td=["curly"],kd=["circle","circle-large","square","diamond","circle-mixed","pacman","rounded","small-square","vertical-line","horizontal-line","liquid","liquid-horizontal","liquid-vertical","classy","classy-rounded","leaf","plus","hexagon","star","heart","random-dots","mosaic","octagon"],rr={x:"plus",pebble:"rounded",flower:"circle",beads:"circle",bubble:"circle",chain:"circle",petal:"leaf",drop:"rounded",squircle:"rounded"},De={pebble:"squircle",tag:"rounded",crest:"shield",doodle:"squircle",stamp:"notch"},Be={bevel:"square",notch:"square"};function Qt(t,e){return typeof e=="string"&&Object.hasOwn(t,e)?t[e]:e}var Fd=["none","banner-bottom","banner-top","border","rounded-border","speech-bubble","banner-top-bottom","speech-bubble-top","chat-bubble","circle","polaroid","phone","ticket","badge","envelope","tag","menu-card","sticker","gradient-border","focus"],se=24,ka="Scan me",or=.5,Cn=1.5,Nd=["square","rounded","circle"],Od=.1,Fa=.3,Na=.25,Dd=2,Xr=.5,Oa=1,Da=.07,Bd=["square","circle","heart"],Ba=3,Ge=64,ye=8,Ga=.42,Qe=["topLeft","topRight","bottomLeft"],Yr=.5,Qa=2,Ua=.1,Ha=.5,za=.25,Zr="#e5e7eb",Ue="#d1d5db",Kr=.3,Wa=.2,qa=.1,Va=.4,ja=.3,Xa="#000000",Gd=["corner","code"];function J(t,e=3){let n=10**e;return Math.round(t*n)/n+0}function x(t,e=3){return String(J(t,e))}function I(t,...e){let n=t[0]??"";for(let o=0;o<e.length;o++){let r=e[o];n+=(typeof r=="number"?x(r):r)+(t[o+1]??"");}return n}var Qd={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0},Ud=/^[MmLlHhVvCcSsQqTtAaZz0-9.,+\-\s]*$/,Ya=/[+-]?(?:\d+\.?\d*|\.\d+)/y;function ar(t,e=Number.POSITIVE_INFINITY){if(!Ud.test(t))return null;let n=[],o=0,r=()=>{for(;o<t.length&&/[\s,]/.test(t[o]);)o++;},a=()=>{r(),Ya.lastIndex=o;let l=Ya.exec(t);if(!l)return null;let c=l[0],u=c.indexOf(".");if(u>=0&&c.length-u-1>e)return null;o=Ya.lastIndex;let m=Number(c);return Number.isFinite(m)?m:null},i=()=>{r();let l=t[o];return l==="0"||l==="1"?(o++,l==="1"?1:0):null},s=()=>(r(),o<t.length&&/[0-9.+-]/.test(t[o]));for(r();o<t.length;){let l=t[o],c=l.toUpperCase(),u=Qd[c];if(u===void 0||n.length===0&&c!=="M")return null;if(o++,u===0){n.push({command:l,values:[]}),r();continue}let m=l,f=true;for(;f||s();){let d=[];for(let g=0;g<u;g++){let h=c==="A"&&(g===3||g===4)?i():a();if(h===null)return null;d.push(h);}n.push({command:m,values:d}),c==="M"&&(m=l==="M"?"L":"l"),f=false;}r();}return n}function Nl(t){let e=0;for(let{command:n}of t)e+=n.toUpperCase()==="A"?4:1;return e}function Za(t,e=1,n=0,o=0){let r="";for(let{command:a,values:i}of t){let s=a.toUpperCase(),l=a===s,c=l?n:0,u=l?o:0,m;switch(s){case "Z":m=[];break;case "H":m=[x(i[0]*e+c)];break;case "V":m=[x(i[0]*e+u)];break;case "A":m=[x(Math.abs(i[0])*e),x(Math.abs(i[1])*e),x(i[2]),String(i[3]),String(i[4]),x(i[5]*e+c),x(i[6]*e+u)];break;default:m=i.map((f,d)=>x(f*e+(d%2===0?c:u)));}r+=a+m.join(" ");}return r}function Jr(t,e=.25){let n=[],o=[],r=[0,0],a=[0,0],i=()=>{o.length>2&&n.push(o),o=[];};for(let s of t)if(s.op==="M")i(),r=[s.x,s.y],a=r,o.push(r);else if(s.op==="L")a=[s.x,s.y],o.push(a);else if(s.op==="C"){let l=a,c=[s.x1,s.y1],u=[s.x2,s.y2],m=[s.x,s.y],f=Math.hypot(c[0]-l[0],c[1]-l[1])+Math.hypot(u[0]-c[0],u[1]-c[1])+Math.hypot(m[0]-u[0],m[1]-u[1]),d=Math.max(2,Math.min(64,Math.ceil(Math.sqrt(f/(4*e)))));for(let g=1;g<=d;g++){let h=g/d,p=1-h;o.push([p*p*p*l[0]+3*p*p*h*c[0]+3*p*h*h*u[0]+h*h*h*m[0],p*p*p*l[1]+3*p*p*h*c[1]+3*p*h*h*u[1]+h*h*h*m[1]]);}a=m;}else i(),a=r;return i(),n}function Rn(t,e){let n=[r=>r[0]-e.x0,r=>e.x1-r[0],r=>r[1]-e.y0,r=>e.y1-r[1]],o=t;for(let r of n){if(o.length===0)break;let a=o;o=[];for(let i=0;i<a.length;i++){let s=a[i],l=a[(i+a.length-1)%a.length],c=r(s),u=r(l);c>=0?(u<0&&o.push(Ol(l,s,u,c)),o.push(s)):u>=0&&o.push(Ol(l,s,u,c));}}return o.length>2?o:[]}function Ol(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 Dl(t){return t.filter(e=>e.length>2).map(e=>`M${e.map(([n,o])=>`${x(n)} ${x(o)}`).join("L")}Z`).join("")}function He(t){let e=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,r=Number.NEGATIVE_INFINITY,a=(i,s)=>{e=Math.min(e,i),n=Math.min(n,s),o=Math.max(o,i),r=Math.max(r,s);};for(let i of t)i.op==="C"?(a(i.x1,i.y1),a(i.x2,i.y2),a(i.x,i.y)):i.op!=="Z"&&a(i.x,i.y);return Number.isFinite(e)?{x0:e,y0:n,x1:o,y1:r}:null}var Hd={amp:"&",lt:"<",gt:">",quot:'"',apos:"'"};function Ql(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 Hd[n.toLowerCase()]??e})}var zd=60,Ka=62,Ja=47,Wd=61,Bl=34,Gl=39,ei=/\s*/y,qd=/[^\s/>]*/y,Vd=/[^\s>]*/y,jd=/[^\s=]*/y;function Mn(t,e,n){return t.lastIndex=n,t.test(e)?t.lastIndex:n}function Xd(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("-->"),a=o("?>"),i=o("]]>"),s=o(">"),l,c=S=>{let $=t.charCodeAt(S);if($!==Bl&&$!==Gl)return S+1;let R=t.indexOf(t[S],S+1);return R<0?n:R+1},u=S=>{for(let $=S;$<n&&!l?.[$];$=c($)){let R=t.charCodeAt($);if(R===Ka||R===Ja&&t.charCodeAt($+1)===Ka)return $}l??=new Uint8Array(n);for(let $=S;$<n&&!l[$];$=c($))l[$]=1;return -1},m=-1,f=-1,d=-1,g=-1,h=S=>{let $=S+1;if($<m||$>=f){m=$,f=Mn(qd,t,$),d=-1;for(let M=f;M>$;M--){let E=t.charCodeAt(M);if((M===f||E===Bl||E===Gl)&&(g=u(M),g>=0)){d=M;break}}}if(d<=$)return -1;let R=t.charCodeAt(g)===Ja;return e.open(t.slice($,d),t.slice(d,g),R),g+(R?2:1)},p=-1,b=-1,_=-1,y=S=>{let $=S+2;if($<p||$>=b){p=$,b=Mn(Vd,t,$);let R=Mn(ei,t,b);_=b>$&&t.charCodeAt(R)===Ka?R:-1;}return _},w=S=>{if(t.startsWith("<!--",S)){let $=r(S+4);if($>=0)return $+3}if(t.startsWith("<?",S)){let $=a(S+2);if($>=0)return $+2}if(t.startsWith("<![CDATA[",S)){let $=i(S+9);if($>=0)return e.cdata(t.slice(S+9,$)),$+3}if(t.startsWith("<!",S)){let $=s(S+2);if($>=0)return $+1}if(t.charCodeAt(S+1)===Ja){let $=y(S);return $<0?-1:(e.close(),$+1)}return h(S)},C=0;for(;C<n;)if(t.charCodeAt(C)===zd){let S=w(C);C=S<0?C+1:S;}else {let S=t.indexOf("<",C),$=S<0?n:S;e.text(t.slice(C,$)),C=$;}}function Yd(t){let e={},n=0;for(;n<t.length;){let o=Mn(jd,t,n);if(o===n){n++;continue}let r=Mn(ei,t,o);if(t.charCodeAt(r)===Wd){let a=Mn(ei,t,r+1),i=t[a],s=i==='"'||i==="'"?t.indexOf(i,a+1):-1;if(s>=0){e[t.slice(n,o)]=Ql(t.slice(a+1,s)),n=s+1;continue}}n=o;}return e}function xe(t){let e={name:"#root",attrs:{},children:[],text:""},n=[e],o=()=>n.at(-1);Xd(t,{open(a,i,s){let l=Yd(i),c={name:a,attrs:l,children:[],text:""};o().children.push(c),s||n.push(c);},close(){n.length>1&&n.pop();},text(a){o().text+=Ql(a);},cdata(a){o().text+=a;}});let r=a=>{for(let i of a.children){if(i.name==="svg")return i;let s=r(i);if(s)return s}return null};return r(e)}var En=[1,0,0,1,0,0];function mt(t,e){let[n,o,r,a,i,s]=t,[l,c,u,m,f,d]=e;return [n*l+r*c,o*l+a*c,n*u+r*m,o*u+a*m,n*f+r*d+i,o*f+a*d+s]}function q(t,e,n){return [t[0]*e+t[2]*n+t[4],t[1]*e+t[3]*n+t[5]]}function An(t){return Math.sqrt(Math.abs(t[0]*t[3]-t[1]*t[2]))}function te(t){return t?(t.match(/[+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?/gi)??[]).map(Number):[]}function Ut(t){let e=En;if(!t)return e;for(let[,n,o]of t.matchAll(/(matrix|translate|scale|rotate|skewX|skewY)\s*\(([^)]*)\)/g)){let r=te(o),a=En;switch(n){case "matrix":r.length===6&&(a=r);break;case "translate":a=[1,0,0,1,r[0]??0,r[1]??0];break;case "scale":a=[r[0]??1,0,0,r[1]??r[0]??1,0,0];break;case "rotate":{let i=(r[0]??0)*Math.PI/180,s=Math.cos(i),l=Math.sin(i),[c,u]=[r[1]??0,r[2]??0];a=mt(mt([1,0,0,1,c,u],[s,l,-l,s,0,0]),[1,0,0,1,-c,-u]);break}case "skewX":a=[1,0,Math.tan((r[0]??0)*Math.PI/180),1,0,0];break;case "skewY":a=[1,Math.tan((r[0]??0)*Math.PI/180),0,1,0,0];break;}e=mt(e,a);}return e}var ti=/[+-]?(?:\d+\.?\d*|\.\d+)(?:[eE][+-]?\d+)?/y;function Zd(t,e,n,o,r,a,i,s,l){if(t===s&&e===l)return [];let c=Math.abs(n),u=Math.abs(o);if(c===0||u===0)return [{op:"L",x:s,y:l}];let m=r*Math.PI/180,f=Math.cos(m),d=Math.sin(m),g=(t-s)/2,h=(e-l)/2,p=f*g+d*h,b=-d*g+f*h,_=p*p/(c*c)+b*b/(u*u);_>1&&(c*=Math.sqrt(_),u*=Math.sqrt(_));let y=c*c*u*u-c*c*b*b-u*u*p*p,w=c*c*b*b+u*u*p*p,C=(a===i?-1:1)*Math.sqrt(Math.max(0,y/w)),S=C*c*b/u,$=-C*u*p/c,R=f*S-d*$+(t+s)/2,M=d*S+f*$+(e+l)/2,E=(W,D,U,X)=>Math.atan2(W*X-D*U,W*U+D*X),P=E(1,0,(p-S)/c,(b-$)/u),v=E((p-S)/c,(b-$)/u,(-p-S)/c,(-b-$)/u);!i&&v>0?v-=2*Math.PI:i&&v<0&&(v+=2*Math.PI);let L=Math.max(1,Math.ceil(Math.abs(v)/(Math.PI/2)-1e-9)),F=v/L,k=4/3*Math.tan(F/4),T=(W,D)=>[R+c*f*W-u*d*D,M+c*d*W+u*f*D],z=[];for(let W=0;W<L;W++){let D=P+W*F,U=D+F,[X,xt]=T(Math.cos(D)-k*Math.sin(D),Math.sin(D)+k*Math.cos(D)),[lt,N]=T(Math.cos(U)+k*Math.sin(U),Math.sin(U)-k*Math.cos(U)),[B,Z]=W===L-1?[s,l]:T(Math.cos(U),Math.sin(U));z.push({op:"C",x1:X,y1:xt,x2:lt,y2:N,x:B,y:Z});}return z}function le(t){let e=[],n=0,o=0,r=0,a=0,i=0,s="",l=null,c=null,u=()=>{for(;n<t.length&&/[\s,]/.test(t[n]);)n++;},m=()=>{u(),ti.lastIndex=n;let g=ti.exec(t);return g?(n=ti.lastIndex,Number(g[0])):null},f=()=>{u();let g=t[n];return g==="0"||g==="1"?(n++,g==="1"):null},d=g=>{let h=[];for(let p=0;p<g;p++){let b=m();if(b===null)return null;h.push(b);}return h};for(;u(),!(n>=t.length);){let g=t[n];if(/[MmLlHhVvCcSsQqTtAaZz]/.test(g))s=g,n++;else if(!s||s==="Z"||s==="z")break;let h=s===s.toLowerCase(),p=h?o:0,b=h?r:0,_=s.toUpperCase();if(_==="Z"){e.push({op:"Z"}),o=a,r=i,l=null,c=null;continue}if(_==="A"){let S=d(3),$=f(),R=f(),M=d(2);if(!(S&&M)||$===null||R===null)break;let[E,P,v]=S,L=M[0]+p,F=M[1]+b;e.push(...Zd(o,r,E,P,v,$,R,L,F)),o=L,r=F,l=null,c=null;continue}let y={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2}[_]??0,w=d(y);if(!w)break;let C=w;switch(_){case "M":o=C[0]+p,r=C[1]+b,a=o,i=r,e.push({op:"M",x:o,y:r}),s=h?"l":"L",l=null,c=null;break;case "L":case "H":case "V":_!=="V"&&(o=C[0]+p),_==="V"?r=C[0]+b:_==="L"&&(r=C[1]+b),e.push({op:"L",x:o,y:r}),l=null,c=null;break;case "C":case "S":{let S,$;_==="C"?(S=[C[0]+p,C[1]+b],$=C.slice(2)):(S=l?[2*o-l[0],2*r-l[1]]:[o,r],$=C);let R=[$[0]+p,$[1]+b],M=[$[2]+p,$[3]+b];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,l=R,c=null;break}case "Q":case "T":{let S,$;_==="Q"?(S=[C[0]+p,C[1]+b],$=[C[2]+p,C[3]+b]):(S=c?[2*o-c[0],2*r-c[1]]:[o,r],$=[C[0]+p,C[1]+b]),e.push({op:"C",x1:o+2/3*(S[0]-o),y1:r+2/3*(S[1]-r),x2:$[0]+2/3*(S[0]-$[0]),y2:$[1]+2/3*(S[1]-$[1]),x:$[0],y:$[1]}),[o,r]=$,c=S,l=null;break}}}return e}var to=.5522847498;function ee(t,e,n,o){if(n<=0||o<=0)return [];let r=n*to,a=o*to;return [{op:"M",x:t+n,y:e},{op:"C",x1:t+n,y1:e+a,x2:t+r,y2:e+o,x:t,y:e+o},{op:"C",x1:t-r,y1:e+o,x2:t-n,y2:e+a,x:t-n,y:e},{op:"C",x1:t-n,y1:e-a,x2:t-r,y2:e-o,x:t,y:e-o},{op:"C",x1:t+r,y1:e-o,x2:t+n,y2:e-a,x:t+n,y:e},{op:"Z"}]}function ne(t,e,n,o,r=0,a=0){if(n<=0||o<=0)return [];let i=Math.min(Math.max(r,0),n/2),s=Math.min(Math.max(a,0),o/2);if(i===0||s===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 l=i*to,c=s*to,u=t+n,m=e+o;return [{op:"M",x:t+i,y:e},{op:"L",x:u-i,y:e},{op:"C",x1:u-i+l,y1:e,x2:u,y2:e+s-c,x:u,y:e+s},{op:"L",x:u,y:m-s},{op:"C",x1:u,y1:m-s+c,x2:u-i+l,y2:m,x:u-i,y:m},{op:"L",x:t+i,y:m},{op:"C",x1:t+i-l,y1:m,x2:t,y2:m-s+c,x:t,y:m-s},{op:"L",x:t,y:e+s},{op:"C",x1:t,y1:e+s-c,x2:t+i-l,y2:e,x:t+i,y:e},{op:"Z"}]}var ir="qrdx.frame",sr=1,lr="custom",ot={minArtboard:50,maxArtboard:2e3,maxCoordinate:4e3,maxDecimals:3,maxShapes:64,maxLabels:8,maxPolygonPoints:256,maxPathLength:16e3,maxSegments:2e3,maxGradientSteps:64,maxGradientWork:16e3,maxBytes:32768,minQrShare:.5,minPadding:.04,defaultPadding:.08,maxTextLength:se},ri=["wifi","star","heart","phone","headphones","calendar","user","chat","bag","bell","cup","card","check","info","home","pin","share","download","clock","snowflake","pumpkin","tree","sparkle","gift"],cr=.95,Hl=200,oi=["frame","text","accent","background"],Kd=/[\t\n\v\f\r\u0085\u2028\u2029]/g,Jd=/[\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 Pn(t,e=se){let n=t.slice(0,1e3).normalize("NFC").replace(Kd," ").replace(Jd,"").replace(/\s+/g," ").trim();return Array.from(n).slice(0,Math.max(0,e)).join("").trim()}function tf(t){for(let e of t)if((e.codePointAt(0)??0)>255)return false;return true}var eo=t=>Math.abs(t*1e3-Math.round(t*1e3))<1e-6;function no(t){let e=In(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 ef(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 In(t){return t.qr.padding??t.qr.size*ot.defaultPadding}var ai=.52,nf=.35;function rf(t){let e=t.fontSize??t.box.height*ai;return Math.min(e*Cn,t.box.height*cr)}var ni=(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 Ul(t){let e=no(t),n=Math.min(t.qr.radius??0,(e.x1-e.x0)/2,(e.y1-e.y0)/2),o=[[e.x0+n,e.y0+n,Math.PI],[e.x1-n,e.y0+n,-Math.PI/2],[e.x1-n,e.y1-n,0],[e.x0+n,e.y1-n,Math.PI/2]],r=[];for(let[a,i,s]of o)for(let l=0;l<=8;l++){let c=s+Math.PI/2*(l/8);r.push([a+n*Math.cos(c),i+n*Math.sin(c)]);}return r}function of([t,e],n,o){if(t<n.x-.01||e<n.y-.01||t>n.x+n.width+.01||e>n.y+n.height+.01)return false;let a=Math.min(o,n.width/2,n.height/2),i=Math.min(Math.max(t,n.x+a),n.x+n.width-a),s=Math.min(Math.max(e,n.y+a),n.y+n.height-a);return Math.hypot(t-i,e-s)<=a+.01}function af(t){let e=0;return t.forEach(([n,o],r)=>{let[a,i]=t[(r+1)%t.length];e+=n*i-a*o;}),Math.abs(e)/2}function sf(t,e,n){let o=no(e);if(!ni(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 !Ul(e).every(a=>of(a,r,r.radius??0))}if(t.type==="circle"&&t.hole){let r=t.hole;return !Ul(e).every(([a,i])=>Math.hypot(a-t.cx,i-t.cy)<=r+.01)}if(t.type==="polygon"){let r=Rn(t.points,o);return r.length>2&&af(r)>1e-6}return true}function ii(t){let e=lf(t),n="stroke"in t?t.stroke:void 0;if(!(n&&e.bounds))return e;let o=t.type==="circle"||t.type==="ellipse"?n.width/2:t.type==="rect"?n.width*Math.SQRT2/2:n.width*2,{x0:r,y0:a,x1:i,y1:s}=e.bounds;return {bounds:{x0:r-o,y0:a-o,x1:i+o,y1:s+o},segments:e.segments*2}}function lf(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=ar(t.d,ot.maxDecimals);return e?{bounds:He(le(t.d)),segments:Nl(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:Hl}}}function zl(t,e){let n=ot,o=new TextEncoder().encode(JSON.stringify(t)).length;if(o>n.maxBytes){e(`The spec is ${o} bytes; the limit is ${n.maxBytes}`);return}let{width:r,height:a}=t.artboard,i=Math.max(r,a)*.005,s={x0:-i,y0:-i,x1:r+i,y1:a+i},l=b=>b.x0>=s.x0&&b.y0>=s.y0&&b.x1<=s.x1&&b.y1<=s.y1,{qr:c}=t,u=In(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,a)*n.minQrShare-1e-9&&e(`qr.size must be at least ${n.minQrShare*100}% of the artboard's shorter side`,["qr","size"]);let m=no(t);(m.x0<-1e-9||m.y0<-1e-9||m.x1>r+1e-9||m.y1>a+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 f=0,d=0;t.shapes.forEach((b,_)=>{let y=["shapes",_],{bounds:w,segments:C}=ii(b);if(!w){e("Path data must use only M L H V C S Q T A Z, plain numbers (up to 3 decimals) and start with M",[...y,"d"]);return}if(l(w)||e("The shape extends outside the artboard",y),b.type==="rect"&&b.hole){let{hole:S}=b;(S.x<b.x||S.y<b.y||S.x+S.width>b.x+b.width+1e-9||S.y+S.height>b.y+b.height+1e-9)&&e("The hole must sit inside its rect",[...y,"hole"]);}b.type==="circle"&&b.hole&&b.hole>=b.r&&e("The hole must be smaller than the circle",[...y,"hole"]),"stroke"in b&&b.stroke&&b.stroke.width>Math.min(r,a)*.1+1e-9&&e("A stroke may be at most 10% of the artboard's shorter side",[...y,"stroke","width"]),c.plate==="background"&&sf(b,t,w)&&e('With qr.plate "background", only background fills (or a ring whose hole holds the plate) may lie under the plate',y),f+=C,typeof b.fill=="object"&&"gradient"in b.fill&&(d+=(b.fill.gradient.steps??32)*C);}),f>n.maxSegments&&e(`The shapes have ${f} segments; the limit is ${n.maxSegments}`,["shapes"]),d>n.maxGradientWork&&e("Gradient fills are too detailed (fewer steps or simpler shapes)",["shapes"]);let g=[],h=new Set,p=new Set;t.labels.forEach((b,_)=>{let y=["labels",_];h.has(b.id)&&e(`Label id "${b.id}" is used twice`,[...y,"id"]),h.add(b.id),b.slot!=="fixed"&&(p.has(b.slot)&&e(`Only one label may use the ${b.slot} slot`,[...y,"slot"]),p.add(b.slot));let w=b.maxLength??n.maxTextLength;b.text!==Pn(b.text,w)&&e(`Label text must be at most ${w} characters, trimmed, with no control or invisible characters (see sanitizeFrameText)`,[...y,"text"]);let C;if(b.type==="text"){C={x0:b.box.x,y0:b.box.y,x1:b.box.x+b.box.width,y1:b.box.y+b.box.height},b.fontSize!==void 0&&b.fontSize>b.box.height*cr+1e-9&&e("fontSize may be at most 95% of the label's row height",[...y,"fontSize"]);let S=b.box.y+b.box.height/2,$=rf(b)*nf,R={x0:C.x0,x1:C.x1,y0:S-$,y1:S+$};(ni(C,ef(t))||ni(R,m))&&e("The label overlaps the code or its padding",[...y,"box"]);}else {let{cx:S,cy:$,radius:R}=b.curve,M=b.fontSize*Cn*.6;C={x0:S-R-M,y0:$-R-M,x1:S+R+M,y1:$+R+M};let E=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||E>=R+M||e("The curved label crosses the code or its padding",[...y,"curve"]);}if(l(C)||e("The label extends outside the artboard",y),b.collapse){let S=b.collapse,$=S.y+S.height;(S.y<-1e-9||$>a+1e-9)&&e("The collapse band must sit inside the artboard",[...y,"collapse"]),$>m.y0+1e-6&&S.y<m.y1-1e-6&&e("The collapse band crosses the code or its padding",[...y,"collapse"]);for(let R of g)$>R.y+1e-6&&S.y<R.y+R.height-1e-6&&e("Collapse bands may not overlap",[...y,"collapse"]);g.push(S);}});}var si=(t,e=0)=>{for(let n=e;n<t.length;n++)if(t[n]?.continue!==true)return true;return false};function $e(t,e=[],n={}){return {...n,run(o){let r=t({value:o,issues:[]}),a=si(r.issues);for(let i of e){if(i.hasLength){let l=r.value;if(r.issues.some(c=>c.continue===false)||l===null||l===void 0||l.length===void 0)continue}else if(a)continue;let s=r.issues.length;i.run(r),!a&&r.issues.length>s&&(a=si(r.issues,s));}return r}}}function cf(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 We=(t,e)=>({path:[],message:`Invalid input: expected ${t}, received ${cf(e)}`}),uf={string:"characters",array:"items"};function ce(t,e,n,o){let r=uf[e],a=t?"Too big":"Too small",i=`${t?"<=":">="}${n}`;return {path:[],message:r?`${a}: expected ${e} to have ${i} ${r}`:`${a}: expected ${e} to be ${i}`,continue:o}}var li=t=>typeof t=="string"?`"${t}"`:`${t}`,jl=t=>typeof t=="object"&&t!==null&&!Array.isArray(t);function di(t,e,n){for(let o of n)o.path.unshift(e),t.push(o);}var mf=t=>t>=55296&&t<=56319,df=t=>t>=56320&&t<=57343;function ff(t){let e=t.length;for(let n=0;n<t.length-1;n++)mf(t.charCodeAt(n))&&df(t.charCodeAt(n+1))&&(e--,n++);return e}var Xl=t=>Array.isArray(t)?"array":typeof t=="string"?"string":"unknown",dr=t=>({run(e){e.value<t&&e.issues.push(ce(false,"number",t,true));}}),fr=t=>({run(e){e.value>t&&e.issues.push(ce(true,"number",t,true));}}),Tn=(t,e="Invalid input")=>({run(n){t(n.value)||n.issues.push({path:[],message:e,continue:true});}}),Yl=t=>typeof t=="string"?ff(t):t.length,Zl=t=>({hasLength:true,run(e){let n=e.value;Yl(n)<t&&e.issues.push(ce(false,Xl(n),t,true));}}),fi=t=>({hasLength:true,run(e){let n=e.value;Yl(n)>t&&e.issues.push(ce(true,Xl(n),t,true));}}),Kl=(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});}}),hf={run(t){let e=t.value;Number.isInteger(e)?Number.isSafeInteger(e)||t.issues.push(e>0?ce(true,"int",Number.MAX_SAFE_INTEGER,true):ce(false,"int",Number.MIN_SAFE_INTEGER,true)):t.issues.push({...We("int",e),continue:false});}},qe=(...t)=>$e(e=>{let n=e.value;return typeof n=="number"&&Number.isFinite(n)||e.issues.push(We("number",n)),e},t),Jl=(...t)=>qe(hf,...t),ro=(...t)=>$e(e=>(typeof e.value!="string"&&e.issues.push(We("string",e.value)),e),t);function zt(t){let e=t.length===1?`Invalid input: expected ${li(t[0])}`:`Invalid option: expected one of ${t.map(li).join("|")}`;return $e(n=>(t.includes(n.value)||n.issues.push({path:[],message:e}),n),[],{values:t})}var Ht=t=>zt([t]),st=t=>({optional:true,run:e=>e===void 0?{value:e,issues:[]}:t.run(e)});function bt(t,e=[]){let n=Object.keys(t),o=new Set(n);return $e(r=>{let a=r.value;if(!jl(a))return r.issues.push(We("object",a)),r;let i={};for(let l of n){let c=t[l],u=c.run(a[l]),m=l in a;di(r.issues,l,u.issues),m||c.optional||u.issues.length>0||r.issues.push({path:[l],message:"Invalid input: expected nonoptional, received undefined"}),m&&(i[l]=u.value);}r.value=i;let s=[];for(let l in a)o.has(l)||s.push(l);return s.length>0&&r.issues.push({path:[],message:`Unrecognized key${s.length>1?"s":""}: ${s.map(li).join(", ")}`,continue:true}),r},e,{shape:t})}function ci(t,e,n){let o=[];return e!==void 0&&o.push(Zl(e)),n!==void 0&&o.push(fi(n)),$e(r=>{let a=r.value;if(Array.isArray(a)&&n!==void 0&&a.length>n)return r.issues.push(ce(true,"array",n,false)),r;if(!Array.isArray(a))return r.issues.push(We("array",a)),r;let i=new Array(a.length);for(let s=0;s<a.length;s++){let l=t.run(a[s]);di(r.issues,s,l.issues),i[s]=l.value;}return r.value=i,r},o)}function ui(t){return $e(e=>{let n=e.value;if(!Array.isArray(n))return e.issues.push(We("tuple",n)),e;if(n.length<t.length)return e.issues.push(ce(false,"array",t.length,void 0)),e;n.length>t.length&&e.issues.push(ce(true,"array",t.length,void 0));let o=[];return t.forEach((r,a)=>{let i=r.run(n[a]);di(e.issues,a,i.issues),o[a]=i.value;}),e.value=o,e})}function Ln(t){return $e(e=>{let n=[];for(let r of t){let a=r.run(e.value);if(a.issues.length===0)return a;n.push(a);}let o=n.filter(r=>!si(r.issues));return o.length===1?o[0]:(e.issues.push({path:[],message:"Invalid input"}),e)})}function tc(t,e){let n=new Map;for(let r of e)for(let a of r.shape?.[t]?.values??[])n.set(a,r);let o=`Invalid discriminator value. Expected ${[...n.keys()].map(r=>`'${r}'`).join(" | ")}`;return $e(r=>{let a=r.value;if(!jl(a))return r.issues.push(We("object",a)),r;let i=n.get(a[t]);return i?i.run(a):(r.issues.push({path:[t],message:o}),r)})}var pf=Tn(eo,`Numbers may have at most ${ot.maxDecimals} decimals`),ao=[dr(-ot.maxCoordinate),fr(ot.maxCoordinate),pf],wt=qe(...ao),It=qe(...ao,Tn(t=>t>0,"Must be greater than 0")),oo=qe(...ao,Tn(t=>t>=0,"Must not be negative")),mr=ro(Kl(/^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/,"Use a #rgb or #rrggbb color")),Wl=Ln([zt(oi),mr]),ec=t=>bt({mix:ui([t,t]),amount:qe(dr(0),fr(1),Tn(eo))}),vn=Ln([Wl,ec(Wl)]),gf=Ln([mr,ec(Ln([zt(["frame","accent","background"]),mr]))]),ze=Ln([vn,bt({gradient:bt({from:vn,to:vn,direction:st(zt(["horizontal","vertical"])),steps:st(Jl(dr(2),fr(ot.maxGradientSteps)))})})]),mi=()=>({x:wt,y:wt,width:It,height:It}),ur=bt({color:vn,width:It}),bf=tc("type",[bt({type:Ht("rect"),...mi(),radius:st(oo),fill:ze,hole:st(bt({...mi(),radius:st(oo)})),stroke:st(ur)}),bt({type:Ht("circle"),cx:wt,cy:wt,r:It,hole:st(It),fill:ze,stroke:st(ur)}),bt({type:Ht("ellipse"),cx:wt,cy:wt,rx:It,ry:It,fill:ze,stroke:st(ur)}),bt({type:Ht("polygon"),points:ci(ui([wt,wt]),3,ot.maxPolygonPoints),fill:ze,stroke:st(ur)}),bt({type:Ht("path"),d:ro(Zl(2),fi(ot.maxPathLength)),fill:ze,fillRule:st(zt(["nonzero","evenodd"])),stroke:st(ur)}),bt({type:Ht("line"),x1:wt,y1:wt,x2:wt,y2:wt,width:It,cap:st(zt(["butt","round"])),dash:st(ui([It,It])),fill:ze}),bt({type:Ht("icon"),icon:zt(ri),x:wt,y:wt,size:It,fill:ze})]),ql=()=>({id:ro(Kl(/^[a-z][a-z0-9-]{0,31}$/)),slot:zt(["primary","secondary","fixed"]),text:ro(fi(200)),maxLength:st(Jl(dr(1),fr(se))),color:vn,weight:st(zt(["bold","regular"])),collapse:st(bt({y:wt,height:It}))}),_f=tc("type",[bt({type:Ht("text"),...ql(),box:bt(mi()),align:st(zt(["start","middle","end"])),fontSize:st(It)}),bt({type:Ht("curved"),...ql(),curve:bt({cx:wt,cy:wt,radius:It,side:zt(["top","bottom"]),spread:st(qe(dr(20),fr(300),Tn(eo)))}),fontSize:It})]),Vl=qe(...ao,Tn(t=>t>=ot.minArtboard&&t<=ot.maxArtboard,`Artboard sides must be ${ot.minArtboard} to ${ot.maxArtboard} units`)),yf=bt({kind:Ht(ir),version:Ht(sr),artboard:bt({width:Vl,height:Vl}),qr:bt({x:wt,y:wt,size:It,padding:st(oo),radius:st(oo),plate:st(zt(["opaque","background","none"]))}),colors:bt({frame:mr,text:st(gf),accent:st(mr)}),shapes:ci(bf,void 0,ot.maxShapes),labels:ci(_f,void 0,ot.maxLabels),bleed:st(Ln([Ht("none"),vn]))},[{run(t){zl(t.value,(e,n=[])=>{t.issues.push({path:[...n],message:e,continue:true});});}}]);function io(t){let e=yf.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 nc=({path:t,message:e})=>t.length>0?`${t.join(".")}: ${e}`:e;function Y(t){if(t.length===0)return "";let[e,...n]=t;return `M${x(e[0])} ${x(e[1])}${n.map(([o,r])=>`L${x(o)} ${x(r)}`).join("")}Z`}function tt(t,e,n){return `M${x(t-n)} ${x(e)}A${x(n)} ${x(n)} 0 1 1 ${x(t+n)} ${x(e)}A${x(n)} ${x(n)} 0 1 1 ${x(t-n)} ${x(e)}Z`}function O(t,e,n,o,r=0){let a=Math.min(n,o)/2,[i,s,l,c]=(typeof r=="number"?[r,r,r,r]:r).map(m=>Math.max(0,Math.min(m,a))),u=(m,f,d)=>m>0?`A${x(m)} ${x(m)} 0 0 1 ${x(f)} ${x(d)}`:"";return `M${x(t+i)} ${x(e)}H${x(t+n-s)}${u(s,t+n,e+s)}V${x(e+o-l)}${u(l,t+n-l,e+o)}H${x(t+c)}${u(c,t,e+o-c)}V${x(e+i)}${u(i,t+i,e)}Z`}function hi(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 kn(t,e,n,o,r=-90){return Array.from({length:o},(a,i)=>{let s=(r+360/o*i)*Math.PI/180;return [t+n*Math.cos(s),e+n*Math.sin(s)]})}function Fn(t,e,n,o,r=5){return Array.from({length:r*2},(a,i)=>{let s=i%2===0?n:o,l=-Math.PI/2+Math.PI/r*i;return [t+s*Math.cos(l),e+s*Math.sin(l)]})}function Nn(t,e,n,o,r=4,a=64){return Array.from({length:a},(i,s)=>{let l=2*Math.PI*s/a,c=Math.cos(l),u=Math.sin(l);return [t+n*Math.sign(c)*Math.abs(c)**(2/r),e+o*Math.sign(u)*Math.abs(u)**(2/r)]})}function On(t,e,n){let o=n/2,r=(a,i)=>`${x(t+a*o)} ${x(e+i*o)}`;return `M${r(0,-0.52)}C${r(.18,-0.92)} ${r(.98,-0.94)} ${r(1,-0.34)}C${r(1,.12)} ${r(.5,.48)} ${r(0,.92)}C${r(-0.5,.48)} ${r(-1,.12)} ${r(-1,-0.34)}C${r(-0.98,-0.94)} ${r(-0.18,-0.92)} ${r(0,-0.52)}Z`}function rc(t,e,n,o){if(o===0)return t;let r=o*Math.PI/180,a=Math.cos(r),i=Math.sin(r);return t.map(([s,l])=>[e+(s-e)*a-(l-n)*i,n+(s-e)*i+(l-n)*a])}function so(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 Ve(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 pi(t,e,n,o,r){let a=Math.max(0,Math.min(r,Math.min(n,o)/2)),i=(s,l)=>`A${x(a)} ${x(a)} 0 0 0 ${x(s)} ${x(l)}`;return `M${x(t+a)} ${x(e)}H${x(t+n-a)}${i(t+n,e+a)}V${x(e+o-a)}${i(t+n-a,e+o)}H${x(t+a)}${i(t,e+o-a)}V${x(e+a)}${i(t+a,e)}Z`}function lo(t,e,n,o,r){let a=Math.max(0,Math.min(r,Math.min(n,o)/2));return Y([[t+a,e],[t+n-a,e],[t+n-a,e+a],[t+n,e+a],[t+n,e+o-a],[t+n-a,e+o-a],[t+n-a,e+o],[t+a,e+o],[t+a,e+o-a],[t,e+o-a],[t,e+a],[t+a,e+a]])}function hr(t,e,n,o,r){let a=o,i=n/2,s=(i-a)*.55,l=(c,u)=>`${x(t+c)} ${x(e+u)}`;return `M${l(a,0)}C${l(a+s,0)} ${l(i-s,r)} ${l(i,r)}C${l(i+s,r)} ${l(n-a-s,0)} ${l(n-a,0)}A${x(a)} ${x(a)} 0 0 1 ${l(n,a)}C${l(n,a+s)} ${l(n-r,i-s)} ${l(n-r,i)}C${l(n-r,i+s)} ${l(n,n-a-s)} ${l(n,n-a)}A${x(a)} ${x(a)} 0 0 1 ${l(n-a,n)}C${l(n-a-s,n)} ${l(i+s,n-r)} ${l(i,n-r)}C${l(i-s,n-r)} ${l(a+s,n)} ${l(a,n)}A${x(a)} ${x(a)} 0 0 1 ${l(0,n-a)}C${l(0,n-a-s)} ${l(r,i+s)} ${l(r,i)}C${l(r,i-s)} ${l(0,a+s)} ${l(0,a)}A${x(a)} ${x(a)} 0 0 1 ${l(a,0)}Z`}function gi(t,e,n,o,r,a){let i=n/2,s=(l,c)=>`${x(t+l)} ${x(e+c)}`;return `M${s(o,0)}H${x(t+n-o)}A${x(o)} ${x(o)} 0 0 1 ${s(n,o)}V${x(e+r)}C${s(n,r+1.55*a)} ${s(i+1.6*a,n)} ${s(i,n)}C${s(i-1.6*a,n)} ${s(0,r+1.55*a)} ${s(0,r)}V${x(e+o)}A${x(o)} ${x(o)} 0 0 1 ${s(o,0)}Z`}var bi=24,Se=(t,e,n,o)=>{let r=o*Math.PI/180;return [t+n*Math.cos(r),e+n*Math.sin(r)]},co=([t,e])=>`${x(t)} ${x(e)}`;function Dn(t,e,n,o,r,a){let i=a-r>180?1:0;return `M${co(Se(t,e,o,r))}A${x(o)} ${x(o)} 0 ${i} 1 ${co(Se(t,e,o,a))}L${co(Se(t,e,n,a))}A${x(n)} ${x(n)} 0 ${i} 0 ${co(Se(t,e,n,r))}Z`}function pr(t,e,n,o){return `M${x(t-n)} ${x(e)}A${x(n)} ${x(o)} 0 1 1 ${x(t+n)} ${x(e)}A${x(n)} ${x(o)} 0 1 1 ${x(t-n)} ${x(e)}Z`}function xf(t){let e=0;return t.forEach(([n,o],r)=>{let[a,i]=t[(r+1)%t.length];e+=n*i-a*o;}),e/2}function oc(t){return Y(xf(t)<0?[...t].reverse():t)}function uo(t,e,n,o,r){let a=Math.hypot(n-t,o-e)||1,i=-(o-e)/a*(r/2),s=(n-t)/a*(r/2);return oc([[t+i,e+s],[n+i,o+s],[n-i,o-s],[t-i,e-s]])}var Lt=(...t)=>({d:t.join(""),fillRule:"nonzero"}),ue=(...t)=>({d:t.join(""),fillRule:"evenodd"});function $f(){let t=[];for(let e of [0,60,120]){let[n,o]=Se(12,12,10.5,e+180),[r,a]=Se(12,12,10.5,e);t.push(uo(n,o,r,a,2));}for(let e=0;e<6;e++){let n=e*60,[o,r]=Se(12,12,6.2,n);for(let a of [-45,45]){let[i,s]=Se(o,r,3.6,n+a);t.push(uo(o,r,i,s,1.7));}}return Lt(...t)}var Sf={wifi:()=>Lt(Dn(12,20,4.6,7.2,-135,-45),Dn(12,20,9.2,11.8,-135,-45),Dn(12,20,13.8,16.4,-135,-45),tt(12,20,2.2)),star:()=>Lt(Y(Fn(12,12.8,11.6,4.8))),heart:()=>Lt(On(12,12.4,22)),phone:()=>ue(O(6,1.5,12,21,2.6),O(7.8,4.2,8.4,13.4,.6),tt(12,19.8,1.1)),headphones:()=>Lt(Dn(12,13,7.6,9.8,-180,0),O(2,12,5,9.5,2),O(17,12,5,9.5,2)),calendar:()=>ue(O(2.5,4,19,17.5,2.5),O(4.6,9,14.8,10.6,.8),O(7,11.4,2.6,2.6,.4),O(10.7,11.4,2.6,2.6,.4),O(14.4,11.4,2.6,2.6,.4),O(7,15.1,2.6,2.6,.4),O(10.7,15.1,2.6,2.6,.4),O(6.5,1.4,2.4,2.6,[1.2,1.2,0,0]),O(15.1,1.4,2.4,2.6,[1.2,1.2,0,0])),user:()=>Lt(tt(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:()=>ue(O(2,3,20,14,4),Y([[6.5,17],[11.5,17],[5.8,21.8]]),tt(7.5,10,1.5),tt(12,10,1.5),tt(16.5,10,1.5)),bag:()=>Lt(O(3.5,7.5,17,14.5,2),Dn(12,7.5,3.1,4.8,-180,0)),bell:()=>Lt("M3.5 17.2A8.5 8.5 0 0 1 20.5 17.2Z",O(1.5,18.2,21,2.6,1.3),O(11.2,6.6,1.6,2.6,0),O(9.8,4.6,4.4,2.4,1.2)),cup:()=>Lt("M4 6.5H17V13.5A6.5 6.5 0 0 1 4 13.5Z",Dn(17,10.2,1.7,3.6,-90,90),O(2,20.6,17,2,1),O(7,1.6,1.6,3.4,.8),O(11.6,1.6,1.6,3.4,.8)),card:()=>ue(O(1.5,4.5,21,15,2.5),O(1.5,8,21,3,0),O(4.5,13.6,4.6,3.2,.6)),check:()=>ue(tt(12,12,10.5),Y([[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:()=>ue(tt(12,12,10.5),tt(12,7.2,1.6),O(10.6,10,2.8,8,.8)),home:()=>ue(Y([[12,2.5],[22.5,11.5],[19.5,11.5],[19.5,21.5],[4.5,21.5],[4.5,11.5],[1.5,11.5]]),O(10,14.5,4,7,[.6,.6,0,0])),pin:()=>ue("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",tt(12,9.5,3)),share:()=>Lt(uo(6,12,18,5,1.8),uo(6,12,18,19,1.8),tt(18,5,3.2),tt(6,12,3.2),tt(18,19,3.2)),download:()=>Lt(O(10.6,2,2.8,9.5,0),Y([[6,10],[18,10],[12,16.5]]),Y([[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:()=>ue(tt(12,12,10.5),tt(12,12,8.4),Y([[11,5.4],[13,5.4],[13,11.3],[16.9,13.5],[15.9,15.2],[11,12.5]])),snowflake:$f,pumpkin:()=>Lt(pr(7.8,14.6,5.8,6.9),pr(16.2,14.6,5.8,6.9),pr(12,14.6,4.8,7.4),O(10.9,3.4,2.2,4.6,.8),oc([[13,4.2],[17.2,3],[16.2,5.4],[13,6]])),tree:()=>Lt(Y([[12,1.5],[16.8,8.2],[7.2,8.2]]),Y([[12,5.2],[19,13.6],[5,13.6]]),Y([[12,9.4],[21.2,19.2],[2.8,19.2]]),O(10.4,18.6,3.2,3.9,.4)),sparkle:()=>Lt(Y(Fn(9.5,13.5,9,2.4,4)),Y(Fn(19,5,4,1.1,4))),gift:()=>Lt(O(3,11.2,7.8,10.6,1),O(13.2,11.2,7.8,10.6,1),O(2,7.4,8.8,3.2,1),O(13.2,7.4,8.8,3.2,1),pr(8.8,4.8,2.9,1.9),pr(15.2,4.8,2.9,1.9))};function _i(t){return Sf[t]()}var wf={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"},Cf=Object.fromEntries(Object.entries(wf).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 ac(t,e){let n=t.trim(),o=Number.parseFloat(n);return Number.isNaN(o)?Number.NaN:n.endsWith("%")?o/100*e:o}function at(t){if(!t)return null;let e=t.trim().toLowerCase();if(e==="transparent")return {r:0,g:0,b:0,a:0};let n=Cf[e];if(n)return {r:n[0],g:n[1],b:n[2],a:1};if(e.startsWith("#")){let r=e.slice(1);return (r.length===3||r.length===4)&&(r=r.split("").map(a=>a+a).join("")),/^[0-9a-f]{6}([0-9a-f]{2})?$/.test(r)?{r:Number.parseInt(r.slice(0,2),16),g:Number.parseInt(r.slice(2,4),16),b:Number.parseInt(r.slice(4,6),16),a:r.length===8?Number.parseInt(r.slice(6,8),16)/255:1}:null}let o=/^rgba?\(([^)]*)\)$/.exec(e);if(o){let[r,a]=o[1].split("/"),i=r.split(/[\s,]+/).filter(Boolean);if(i.length!==(a===void 0&&i.length===4?4:3))return null;let s=a??i[3],[l,c,u]=i.slice(0,3).map(d=>ac(d,255)),m=s===void 0?1:ac(s,1);if([l,c,u,m].some(d=>Number.isNaN(d)))return null;let f=(d,g)=>Math.min(Math.max(d,0),g);return {r:f(l,255),g:f(c,255),b:f(u,255),a:f(m,1)}}return null}function we(t,e,n){let o=t/255,r=e/255,a=n/255,i=1-Math.max(o,r,a);return i>=1?[0,0,0,1]:[J((1-o-i)/(1-i)),J((1-r-i)/(1-i)),J((1-a-i)/(1-i)),J(i)]}function ic(t){return t===" "?.3:/[MWmw@%]/.test(t)?.92:/[A-Z0-9#&]/.test(t)?.72:/[il.,:;!'|1]/.test(t)?.32:.6}function xi(t){let e=0;for(let n of t)e+=ic(n);return Math.max(e,1)}var yi=t=>Math.round(Math.min(255,Math.max(0,t))).toString(16).padStart(2,"0");function gr(t,e,n){let o=at(t)??{r:0,g:0,b:0},r=at(e)??{r:255,g:255,b:255},a=Math.min(1,Math.max(0,n));return `#${yi(o.r+(r.r-o.r)*a)}${yi(o.g+(r.g-o.g)*a)}${yi(o.b+(r.b-o.b)*a)}`}function sc(t,e,n,o,r,a,i,s){let l=[...t],c=r*.08,u=l.map(h=>ic(h)*r),m=u.reduce((h,p)=>h+p,0)+c*Math.max(0,l.length-1),f=a==="top"?o-r*.35:o+r*.35,d=[],g=0;return l.forEach((h,p)=>{let b=u[p],_=(g+b/2)/f;if(g+=b+c,h.trim()==="")return;let y=a==="top"?-Math.PI/2-m/2/f+_:Math.PI/2+m/2/f-_;d.push({text:h,x:e+f*Math.cos(y),y:n+f*Math.sin(y),fontSize:r,maxWidth:r*2,color:i,rotate:y*180/Math.PI+(a==="top"?90:-90),field:s});}),d}function _t(t,e="#000000"){return t?typeof t=="string"?t:t.type==="solid"?t.color:t.type==="image"?t.underlay||e:(t.type==="linear"||t.type==="radial"||t.type==="angular")&&t.stops[0]?.color||e:e}var br=class extends Error{issues;constructor(e){super(`Invalid frame spec: ${e.slice(0,5).join("; ")}`),this.name="FrameSpecError",this.issues=e;}},lc=new WeakMap;function je(t){if(t&&typeof t=="object"){let n=lc.get(t);if(n)return n}if(t==null)throw new br(['A "custom" frame needs a spec']);let e=io(t);if(!e.success)throw new br(e.issues.map(nc));return typeof t=="object"&&lc.set(t,e.data),e.data}function $i(t){let e=je(t);return In(e)/e.qr.size}var Rf=t=>{let e=at(t);return !!(e&&e.a>=1)};function Mf(t,e){let n=_t(e,ft);return t.qr.plate==="none"?{color:n,plate:false}:Rf(n)?{color:n,plate:true}:t.qr.plate==="background"?{color:n,plate:false}:{color:ft,plate:true}}function mo(t,e,n=ft){let o=e.color||t.colors.frame,r=e.secondaryColor||t.colors.accent||o,a=l=>l==="frame"?o:l==="accent"?r:l==="background"?n:l,i=t.colors.text,s=e.textColor||(i===void 0?o:typeof i=="string"?i:gr(a(i.mix[0]),a(i.mix[1]),i.amount));return {frame:o,text:s,accent:r}}function Ef(t,e,n){let o=mo(e,t,n),r=a=>{switch(a){case "frame":return o.frame;case "text":return o.text;case "accent":return o.accent;case "background":return n;default:return a}};return a=>typeof a=="string"?r(a):gr(r(a.mix[0]),r(a.mix[1]),a.amount)}function cc(t,e,n=0,o=0){let r=ar(t);return r?Za(r,e,n,o):""}function Af(t,e,n,o){return `M${x(t-n)} ${x(e)}A${x(n)} ${x(o)} 0 1 1 ${x(t+n)} ${x(e)}A${x(n)} ${x(o)} 0 1 1 ${x(t-n)} ${x(e)}Z`}function Pf(t,e){let[n,o,r,a]=[t.x1*e,t.y1*e,t.x2*e,t.y2*e],i=Math.hypot(r-n,a-o),s=t.width*e/2,l=i>0?(r-n)/i:1,c=i>0?(a-o)/i:0,u=-c*s,m=l*s,f=(p,b)=>{let _=[n+l*p,o+c*p],y=[n+l*b,o+c*b];if(t.cap==="round"&&b-p>2*s){let w=[_[0]+l*s,_[1]+c*s],C=[y[0]-l*s,y[1]-c*s];return `M${x(w[0]-u)} ${x(w[1]-m)}L${x(C[0]-u)} ${x(C[1]-m)}A${x(s)} ${x(s)} 0 0 1 ${x(C[0]+u)} ${x(C[1]+m)}L${x(w[0]+u)} ${x(w[1]+m)}A${x(s)} ${x(s)} 0 0 1 ${x(w[0]-u)} ${x(w[1]-m)}Z`}return `M${x(_[0]-u)} ${x(_[1]-m)}L${x(y[0]-u)} ${x(y[1]-m)}L${x(y[0]+u)} ${x(y[1]+m)}L${x(_[0]+u)} ${x(_[1]+m)}Z`};if(!t.dash)return {type:"path",d:f(0,i),fillRule:"nonzero"};let d=t.dash[0]*e,g=d+t.dash[1]*e,h=[];for(let p=0;p+d<=i+1e-6;p+=g)h.push(f(p,p+d));return {type:"path",d:h.join(""),fillRule:"nonzero"}}function If(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:tt(t.cx*e,t.cy*e,t.r*e)+(t.hole?tt(t.cx*e,t.cy*e,t.hole*e):""),fillRule:t.hole?"evenodd":"nonzero"};case "ellipse":return {type:"path",d:Af(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:cc(t.d,e),fillRule:t.fillRule??"nonzero"};case "line":return Pf(t,e);default:{let n=_i(t.icon);return {type:"path",d:cc(n.d,t.size*e/bi,t.x*e,t.y*e),fillRule:n.fillRule}}}}function vf(t){if(t.type==="rect"){let{x:e,y:n,width:o,height:r,radius:a,hole:i}=t;return [...ne(e,n,o,r,a,a),...i?ne(i.x,i.y,i.width,i.height,i.radius,i.radius):[]]}return t.type==="polygon"?[...t.points.map(([e,n],o)=>o===0?{op:"M",x:e,y:n}:{op:"L",x:e,y:n}),{op:"Z"}]:le(t.d)}function Lf(t,e,n){let o=vf(t),r=Jr(o,.2),a=t.type==="rect"?t.hole?"evenodd":"nonzero":t.type==="path"?t.fillRule??"nonzero":"nonzero",i=e.direction==="vertical",s=p=>i?p[1]:p[0],l=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY;for(let p of r)for(let b of p)l=Math.min(l,s(b)),c=Math.max(c,s(b));if(!(c>l))return [];let u=e.steps??32,m=n(e.from),f=n(e.to),d=c-l,g=d*.002,h=[];for(let p=0;p<u;p++){let b=l+d*p/u,_=Math.min(c,l+d*(p+1)/u+(p+1<u?g:0)),y=i?{x0:Number.NEGATIVE_INFINITY,x1:Number.POSITIVE_INFINITY,y0:b,y1:_}:{x0:b,x1:_,y0:Number.NEGATIVE_INFINITY,y1:Number.POSITIVE_INFINITY},w=r.map(C=>Rn(C,y)).filter(C=>C.length>2);w.length!==0&&h.push({type:"path",d:Dl(w),fill:gr(m,f,(p+.5)/u),fillRule:a});}return h}function Tf(t,e,n){let o=If(t,e),r="stroke"in t&&t.stroke?{stroke:n(t.stroke.color),strokeWidth:t.stroke.width*e}:void 0;if(typeof t.fill=="object"&&"gradient"in t.fill){let a=Lf(o,t.fill.gradient,n);return r?[...a,{...o,fill:"none",...r}]:a}return [{...o,fill:n(t.fill),...r}]}function kf(t,e){let n=Math.min(t.maxLength??ot.maxTextLength,ot.maxTextLength),o=t.slot==="primary"?e.text??t.text:t.slot==="secondary"?e.secondaryText??t.text:t.text;return Pn(o,n)}function Ff(t){return t===void 0||!Number.isFinite(t)?1:Math.min(Cn,Math.max(or,t))}function Nf(t,e,n,o,r,a){let i=r(t.color),s=t.weight==="regular"?{fontWeight:400}:{};if(t.type==="curved"){let{cx:h,cy:p,radius:b,side:_,spread:y=140}=t.curve,w=b*o*(y*Math.PI/180),C=Math.min(t.fontSize*o*n,w/(xi(e)+.08*e.length));return sc(e,h*o,p*o,b*o,C,_,i,a).map(S=>({...S,...s}))}let l=t.box.x*o,c=t.box.y*o,u=t.box.width*o,m=t.box.height*o;if(!(m>0))return [];let f=(t.fontSize??t.box.height*ai)*o,d=Math.min(f*n,m*cr,u/xi(e)),g=t.align??"middle";return [{text:e,x:g==="start"?l:g==="end"?l+u:l+u/2,y:c+m/2+d*.35,fontSize:d,maxWidth:u,color:i,...g!=="middle"&&{align:g},...s,field:a}]}function Of(t){let e=0,n=0,o=0,r=0;return t.map(({command:a,values:i})=>{let s=a.toUpperCase(),l=a!==s;switch(s){case "Z":return e=o,n=r,{command:"Z",values:[]};case "H":return e=(l?e:0)+i[0],{command:"H",values:[e]};case "V":return n=(l?n:0)+i[0],{command:"V",values:[n]};case "A":return e=(l?e:0)+i[5],n=(l?n:0)+i[6],{command:"A",values:[...i.slice(0,5),e,n]};default:{let c=i.map((u,m)=>l?u+(m%2===0?e:n):u);return e=c.at(-2),n=c.at(-1),s==="M"&&(o=e,r=n),{command:s,values:c}}}})}function Df(t,e){let n=ar(t);return n?Za(Of(n).map(({command:o,values:r})=>o==="V"?{command:o,values:[e(r[0])]}:o==="H"||o==="Z"?{command:o,values:r}:o==="A"?{command:o,values:[...r.slice(0,6),e(r[6])]}:{command:o,values:r.map((a,i)=>i%2===1?e(a):a)})):t}function Bf(t,e){let n=(o,r)=>{let a=e(o);return {y:a,height:e(o+r)-a}};switch(t.type){case "rect":return {...t,...n(t.y,t.height),...t.hole&&{hole:{...t.hole,...n(t.hole.y,t.hole.height)}}};case "circle":case "ellipse":return {...t,cy:e(t.cy)};case "polygon":return {...t,points:t.points.map(([o,r])=>[o,e(r)])};case "path":return {...t,d:Df(t.d,e)};case "line":return {...t,y1:e(t.y1),y2:e(t.y2)};default:return {...t,y:e(t.y)}}}function Gf(t,e){if(e.length===0)return t;let n=r=>{let a=r;for(let i of e)a-=Math.min(Math.max(r-i.y,0),i.height);return a},o=(r,a)=>e.some(i=>r>=i.y-1e-6&&a<=i.y+i.height+1e-6);return {...t,artboard:{...t.artboard,height:n(t.artboard.height)},qr:{...t.qr,y:n(t.qr.y)},shapes:t.shapes.filter(r=>{let{bounds:a}=ii(r);return !(a&&o(a.y0,a.y1))}).map(r=>Bf(r,n)),labels:t.labels.map(r=>{if(r.type==="curved")return {...r,curve:{...r.curve,cy:n(r.curve.cy)}};let a=n(r.box.y);return {...r,box:{...r.box,y:a,height:n(r.box.y+r.box.height)-a}}})}}function _r(t,e,n,o,r={}){let a=new Map(e.labels.map(p=>[p.id,kf(p,n)])),i=Gf(e,e.labels.flatMap(p=>p.collapse&&!a.get(p.id)?[p.collapse]:[])),s=t/i.qr.size,l=Mf(i,o),c=Ef(n,i,l.color),u=i.shapes.flatMap(p=>Tf(p,s,c));if(l.plate){let p=In(i)*s;u.push({type:"rect",x:i.qr.x*s-p,y:i.qr.y*s-p,width:t+2*p,height:t+2*p,radius:(i.qr.radius??0)*s,fill:l.color});}let m=Ff(n.fontScale),f=i.labels.flatMap(p=>{let b=a.get(p.id);if(!b)return [];let _=(p.slot==="fixed"?void 0:r[p.slot])??p.id;return Nf(p,b,m,s,c,_)}),d=f[0],g=d&&d.rotate===void 0?d:null,h=i.bleed??"none";return {width:i.artboard.width*s,height:i.artboard.height*s,qrX:i.qr.x*s,qrY:i.qr.y*s,qrSize:t,shapes:u,label:g,extraLabels:g?f.slice(1):f,squareEdges:h!=="none",color:c(h==="none"?"frame":h)}}function Si(t,e,n){return _r(t,je(e.spec),e,n)}var uc={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 wi={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 mc={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 dc={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 fc={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 hc={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 pc={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 gc={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 bc={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 fo={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 _c={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 yc={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 xc={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 $c={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 Sc={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 wc={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 Cc={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 Rc={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 Mc={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 Ct=(t,e,n,o,r)=>({style:t,name:e,tags:r,labelOn:o,spec:n}),Ci=[Ct("banner-bottom","Banner",wi,"frame",["bottom","band"]),Ct("banner-top","Top banner",mc,"frame",["top","band"]),Ct("banner-top-bottom","Two banners",dc,"frame",["top","bottom","band"]),Ct("border","Border",fc,"background",["square","outline"]),Ct("rounded-border","Rounded",$c,"background",["border","outline"]),Ct("gradient-border","Gradient",fo,"background",["border","colorful"]),Ct("focus","Focus",bc,"background",["corners","brackets"]),Ct("speech-bubble","Bubble",Sc,"frame",["speech"]),Ct("speech-bubble-top","Bubble top",wc,"frame",["speech"]),Ct("chat-bubble","Chat",hc,"frame",["message","bubble"]),Ct("circle","Circle",pc,"frame",["round","ring","curved"]),Ct("badge","Ribbon",uc,"frame",["badge","banner"]),Ct("sticker","Sticker",Cc,"frame",["label"]),Ct("polaroid","Polaroid",xc,"frame",["photo","picture"]),Ct("phone","Phone",yc,"background",["mobile","screen"]),Ct("ticket","Ticket",Mc,"frame",["event","pass"]),Ct("tag","Tag",Rc,"frame",["price","label"]),Ct("envelope","Envelope",gc,"frame",["mail","letter"]),Ct("menu-card","Menu card",_c,"background",["menu","restaurant"])],i1=new Map(Ci.map(t=>[t.style,t]));function Ri(t){return i1.get(t)}var s1=Object.fromEntries(Ci.map(t=>[t.style,t.spec])),l1={from:fo.colors.frame,to:fo.colors.accent};function ho(t){return !t||t.style==="none"?null:t.style===lr?t.spec??null:Ri(t.style)?.spec??null}function c1(t){let e=ho(t);return t&&typeof e?.colors?.frame=="string"?mo(e,t):null}var u1={primary:"text",secondary:"secondaryText"};function Ec(t,e,n){let o=Ri(e.style)?.spec??wi;return _r(t,je(o),e,n,u1)}var go="system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif",Pc=.08,Ic="data-qrdx-frame-label";function Nt(t){return !!(t?.style&&t.style!=="none")}function Mi(t){let e=ho(t);return e?$i(e):Pc}function m1(t){return (t.text??ka).trim().slice(0,se)}function d1(t){return (t.secondaryText??"").trim().slice(0,se)}function Xe(t,e,n){return e.style===lr?Si(t,e,n):Ec(t,e,n)}function me(t,e){if(!Nt(e))return {width:t,height:t};let{width:n,height:o}=Xe(t,e);return {width:n,height:o}}var nt=t=>J(t,2);function Ac({x:t,y:e,width:n,height:o,radius:r}){let a=nt(Math.min(r,n/2,o/2)),[i,s,l,c]=[nt(t),nt(e),nt(n),nt(o)];return a<=0?I`M${i} ${s}h${l}v${c}h${-l}z`:I`M${i+a} ${s}h${nt(l-2*a)}a${a} ${a} 0 0 1 ${a} ${a}`+I`v${nt(c-2*a)}a${a} ${a} 0 0 1 ${-a} ${a}`+I`h${nt(-(l-2*a))}a${a} ${a} 0 0 1 ${-a} ${-a}`+I`v${nt(-(c-2*a))}a${a} ${a} 0 0 1 ${a} ${-a}z`}function po(t){return t.stroke&&t.strokeWidth?{stroke:t.stroke,strokeWidth:nt(t.strokeWidth)}:{}}function vc(t,e){return t.type==="rect"&&t.hole?A("path",{d:Ac(t)+Ac(t.hole),fill:t.fill,fillRule:"evenodd",...po(t)},e):t.type==="polygon"?A("polygon",{fill:t.fill,points:t.points.map(([n,o])=>`${nt(n)},${nt(o)}`).join(" "),...po(t)},e):t.type==="path"?A("path",{d:t.d,fill:t.fill,...t.fillRule==="evenodd"&&{fillRule:"evenodd"},...po(t)},e):qr("rect",{...po(t),fill:t.fill,height:nt(t.height),key:e,width:nt(t.width),x:nt(t.x),y:nt(t.y),...t.radius>0&&{rx:nt(t.radius),ry:nt(t.radius)}})}function Lc(t){return t.shapes.map((e,n)=>vc(e,n))}function yr(t,e){let{size:n,frame:o,bgColor:r,svgProps:a,markLabels:i}=e,s=Xe(n,o,r),l=Tc(s),c=nt(s.width),u=nt(s.height);return $t("svg",{height:u,viewBox:`0 0 ${c} ${u}`,width:c,xmlns:"http://www.w3.org/2000/svg",...a,children:[A("g",{"data-qrdx-frame":o.style,children:s.shapes.map((m,f)=>vc(m,f))}),Ne(t,{x:nt(s.qrX),y:nt(s.qrY),width:n,height:n}),l.map((m,f)=>A("text",{"data-max-width":nt(m.maxWidth),fill:m.color,fontFamily:go,fontSize:nt(m.fontSize),fontWeight:m.fontWeight??700,textAnchor:m.align??"middle",x:nt(m.x),y:nt(m.y),...m.rotate&&{transform:`rotate(${nt(m.rotate)} ${nt(m.x)} ${nt(m.y)})`},...i&&m.field&&{[Ic]:m.field},children:m.text},f))]})}function Ei(t){let{frame:e,size:n=it,bgColor:o,slot:r,svgProps:a}=t,i=r??A("svg",{height:n,viewBox:`0 0 ${n} ${n}`,width:n,xmlns:"http://www.w3.org/2000/svg"});return Nt(e)?yr(i,{size:n,frame:e,bgColor:o,svgProps:a}):A("svg",{height:n,viewBox:`0 0 ${n} ${n}`,width:n,xmlns:"http://www.w3.org/2000/svg",...a,children:Ne(i,{x:0,y:0,width:n,height:n})})}function Tc(t){return [...t.label?[t.label]:[],...t.extraLabels??[]]}var bo=.22,_o=.14;function kc(t,e,n={}){if(t==="circle")return A("circle",{cx:x(e.x+e.w/2),cy:x(e.y+e.h/2),r:x(Math.min(e.w,e.h)/2),...n});let o=t==="rounded"?Math.min(e.w,e.h)*bo:0;return A("rect",{height:x(e.h),width:x(e.w),x:x(e.x),y:x(e.y),...o>0&&{rx:x(o),ry:x(o)},...n})}function f1(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 yo(t,e){let n=t.shape??"square",o=t.plate,r=o?f1(e,_o):e,a=s=>A("image",{height:x(r.h),href:t.src,preserveAspectRatio:"none",width:x(r.w),x:x(r.x),y:x(r.y),...s&&{clipPath:`url(#${s})`}});if(n==="square"&&!o)return a();let i=n==="square"?void 0:`qrdx-logo-${Ve(`${n}|${x(r.x)}|${x(r.y)}|${x(r.w)}|${x(r.h)}`)}`;return $t("g",{children:[o&&kc(n,e,{fill:o}),i&&A("clipPath",{id:i,children:kc(n,r)}),a(i)]})}var{QrCode:Ai}=dt,h1={"1L":3,"1M":2,"1Q":1,"1H":1,"2L":2,"3L":1};function p1(t){let e=t*4+17,n=new Uint8Array(e*e),o=(i,s)=>{i>=0&&s>=0&&i<e&&s<e&&(n[s*e+i]=1);};for(let i=0;i<e;i++)o(6,i),o(i,6);for(let[i,s]of [[3,3],[e-4,3],[3,e-4]])for(let l=-4;l<=4;l++)for(let c=-4;c<=4;c++)o(i+c,s+l);let r=[];if(t>1){let i=Math.floor(t/7)+2,s=t===32?26:Math.ceil((t*4+4)/(i*2-2))*2;r.push(6);for(let l=e-7;r.length<i;l-=s)r.splice(1,0,l);}let a=r.length-1;for(let[i,s]of r.entries())for(let[l,c]of r.entries())if(!(i===0&&l===0||i===0&&l===a||i===a&&l===0))for(let u=-2;u<=2;u++)for(let m=-2;m<=2;m++)o(s+m,c+u);for(let i=0;i<=8;i++)o(8,i),o(i,8);for(let i=0;i<8;i++)o(e-1-i,8),o(8,e-1-i);if(t>=7)for(let i=0;i<18;i++){let s=e-11+i%3,l=Math.floor(i/3);o(s,l),o(l,s);}return n}function g1(t,e){let n=t*4+17,o=St[e].ordinal,r=Ai.NUM_ERROR_CORRECTION_BLOCKS[o]?.[t]??0,a=Ai.ECC_CODEWORDS_PER_BLOCK[o]?.[t]??0,i=Math.floor(Ai.getNumRawDataModules(t)/8),s=r-i%r,l=Math.floor(i/r),c=Array.from({length:r},(w,C)=>l+(C<s?0:1)),u=[],m=[],f=l-a;for(let w=0;w<=l;w++)for(let C=0;C<r;C++)if(C<s){if(w===f)continue;u.push(C),m.push(w<f?w:w-1);}else u.push(C),m.push(w);if(u.length!==i)throw new Error(`Codeword map: interleave mismatch at version ${t}`);let d=p1(t),g=new Int16Array(n*n).fill(-1),h=new Int16Array(n*n).fill(-1),p=new Int8Array(n*n).fill(-1),b=i*8,_=0;for(let w=n-1;w>=1;w-=2){w===6&&(w=5);let C=(w+1&2)===0;for(let S=0;S<n;S++)for(let $=0;$<2;$++){let R=w-$,E=(C?n-1-S:S)*n+R;if(!d[E]&&_<b){let P=_>>>3;g[E]=u[P],h[E]=m[P],p[E]=7-(_&7),_++;}}}if(_!==b)throw new Error(`Codeword map: placement mismatch at version ${t}`);let y=h1[`${t}${e}`]??0;return {version:t,level:e,size:n,blocks:r,eccPerBlock:a,blockLengths:c,correctable:Math.floor((a-y)/2),block:g,codeword:h,bit:p}}var b1=8,Ye=new Map;function xr(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=Ye.get(n);if(o)return Ye.delete(n),Ye.set(n,o),o;let r=g1(t,e);if(Ye.size>=b1){let a=Ye.keys().next().value;a!==void 0&&Ye.delete(a);}return Ye.set(n,r),r}function $r(t,e){let n=new Array(t.blocks).fill(0),o=new Set;for(let r of e){let a=t.block[r]??-1;if(a<0)continue;let i=a*4096+t.codeword[r];o.has(i)||(o.add(i),n[a]=n[a]+1);}return n}var _1={2:6,3:12};function Fc(t){let e=[t.start],n=t.start;for(let o of t.segments){let r=o.at(-1);if(o.length===1)e.push(r);else {let a=_1[o.length];for(let i=1;i<=a;i++){let s=i/a,l=1-s;if(o.length===2){let[c]=o;e.push([l*l*n[0]+2*l*s*c[0]+s*s*r[0],l*l*n[1]+2*l*s*c[1]+s*s*r[1]]);}else {let[c,u]=o;e.push([l*l*l*n[0]+3*l*l*s*c[0]+3*l*s*s*u[0]+s*s*s*r[0],l*l*l*n[1]+3*l*l*s*c[1]+3*l*s*s*u[1]+s*s*s*r[1]]);}}}n=r;}return e}function Oc(t,e){let n=[];for(let o of t)for(let r=0;r<o.length;r++){let[a,i]=o[r],[s,l]=o[(r+1)%o.length];i<=e!=l<=e&&n.push(a+(e-i)/(l-i)*(s-a));}return n.sort((o,r)=>o-r)}function Dc(t,e){let n=0;for(let o of t)if(o<e)n++;else break;return n%2===1}function y1(t,e,n){return Dc(Oc(t,n),e)}function Bc(t){let e=new Map;return (n,o)=>{let r=e.get(o);return r||(r=Oc(t,o),e.set(o,r)),Dc(r,n)}}function x1(t,e,n,o){let r=n[0]-t,a=n[1]-e,i=o[0]-n[0],s=o[1]-n[1],l=u=>Math.max(Math.abs(r+u*i),Math.abs(a+u*s)),c=Math.min(l(0),l(1));for(let[u,m]of [[a-r,i-s],[-(r+a),i+s]])if(m!==0){let f=u/m;f>0&&f<1&&(c=Math.min(c,l(f)));}return c}function $1(t,e,n){if(!y1(t,e,n))return 0;let o=Number.POSITIVE_INFINITY;for(let r of t)for(let a=0;a<r.length;a++)o=Math.min(o,x1(e,n,r[a],r[(a+1)%r.length]));return Number.isFinite(o)?o:0}function S1(t){let e=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,r=Number.NEGATIVE_INFINITY;for(let a of t)for(let[i,s]of a)e=Math.min(e,i),n=Math.min(n,s),o=Math.max(o,i),r=Math.max(r,s);return {x0:e,y0:n,x1:o,y1:r}}function Gc(t){let e=t.map(Fc),n=S1(e),o=n.x1-n.x0,r=n.y1-n.y0;if(!(o>0&&r>0))return null;let a=(g,h)=>{let p=Math.max(g-n.x0,n.x1-g,h-n.y0,n.y1-h);return p>0?$1(e,g,h)/(2*p):0},i={cx:n.x0+o/2,cy:n.y0+r/2,value:0};i.value=a(i.cx,i.cy);let s=32;for(let g=1;g<s;g++)for(let h=1;h<s;h++){let p=n.x0+o*h/s,b=n.y0+r*g/s,_=a(p,b);_>i.value&&(i={cx:p,cy:b,value:_});}let l=o/s,c=r/s;for(let g=0;g<6;g++){let h=i;for(let p=-2;p<=2;p++)for(let b=-2;b<=2;b++){let _=h.cx+l*b/2,y=h.cy+c*p/2,w=a(_,y);w>i.value&&(i={cx:_,cy:y,value:w});}l/=2,c/=2;}if(i.value<=0)return null;let m=.5/Math.max(i.cx-n.x0,n.x1-i.cx,i.cy-n.y0,n.y1-i.cy),f=([g,h])=>[.5+(g-i.cx)*m,.5+(h-i.cy)*m],d=t.map(g=>({start:f(g.start),segments:g.segments.map(h=>h.map(f))}));return {rings:d,polygons:d.map(Fc),half:i.value}}function Qc(t,e){let n=([r,a])=>`${x(r*e)} ${x(a*e)}`,o="";for(let r of t.rings){o+=`M${n(r.start)}`;for(let a of r.segments){let i=a.length===1?"L":a.length===2?"Q":"C";o+=i+a.map(n).join(" ");}o+="Z";}return o}var w1={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]]]},Nc;function Uc(){return Nc??=Gc([w1]),Nc}function C1(t){let{width:e,height:n,cells:o}=t;return Number.isInteger(e)&&Number.isInteger(n)&&e>=ye&&n>=ye&&e<=Ge&&n<=Ge&&typeof o=="string"&&o.length===e*n&&/^[01]*$/.test(o)?(r,a)=>r>=0&&a>=0&&r<e&&a<n&&o[a*e+r]==="1":null}var de=([t,e])=>`${t},${e}`;function R1(t,e,n){let o=(l,c)=>t(l-1,c-1),r=new Map,a=(l,c)=>{for(let[u,m]of [[l,c],[c,l]]){let f=r.get(de(u))??[];f.push(m),r.set(de(u),f);}};for(let l=0;l<=n;l++)for(let c=0;c<=e;c++){let u=o(c,l),m=o(c+1,l),f=o(c+1,l+1),d=o(c,l+1),g=[c,l-.5],h=[c+.5,l],p=[c,l+.5],b=[c-.5,l];switch((u?8:0)+(m?4:0)+(f?2:0)+(d?1:0)){case 1:case 14:a(b,p);break;case 2:case 13:a(p,h);break;case 3:case 12:a(b,h);break;case 4:case 11:a(g,h);break;case 6:case 9:a(g,p);break;case 7:case 8:a(b,g);break;case 5:a(g,h),a(b,p);break;case 10:a(b,g),a(p,h);break;}}let i=[],s=new Set;for(let[l,c]of r){if(s.has(l)||c.length===0)continue;let[u,m]=l.split(",").map(Number),f=[[u,m]];s.add(l);let d=[u,m],g=c[0];for(;!s.has(de(g));){s.add(de(g)),f.push(g);let h=M1(r.get(de(g))??[],d,s);if(!h)break;d=g,g=h;}f.length>=3&&i.push(E1(f));}return i}function M1(t,e,n){let o=de(e);return t.find(r=>de(r)!==o&&!n.has(de(r)))??t.find(r=>de(r)!==o)}function E1(t){let e=[];for(let n=0;n<t.length;n++){let o=t[(n-1+t.length)%t.length],r=t[n],a=t[(n+1)%t.length],i=(r[0]-o[0])*(a[1]-r[1])-(r[1]-o[1])*(a[0]-r[0]);Math.abs(i)>1e-9&&e.push(r);}return e.length>=3?e:t}function A1(t){let e=(a,i)=>[(a[0]+i[0])/2,(a[1]+i[1])/2],n=t.length,o=e(t[n-1],t[0]),r=t.map((a,i)=>[a,e(a,t[(i+1)%n])]);return {start:o,segments:r}}var Sr=new Map;function Pi(t){let e=`${t.width}x${t.height}:${t.cells}`,n=Sr.get(e);if(n)return n;let o=C1(t),r;if(!o)r={outline:null,problem:"invalid"};else if(t.cells.includes("1")){let a=R1(o,t.width,t.height),i=a.length>0?Gc(a.map(A1)):null;r=i&&2*i.half>=Ga?{outline:i,problem:null}:{outline:null,problem:i?"thin":"empty"};}else r={outline:null,problem:"empty"};return Sr.size>16&&Sr.delete(Sr.keys().next().value),Sr.set(e,r),r}var P1=1,Hc=.5,zc=.5,I1=.5;function Ze(t){return Math.max(t,Ba)}function xo(t){return t==="heart"?Uc():typeof t=="object"&&t?.type==="silhouette"?Pi(t).outline:null}function wr(t){return t==="circle"||xo(t)!==null}var v1={invalid:"This silhouette isn't a valid shape grid.",empty:"No shape found: use a picture with a dark or opaque shape on a light or clear background.",thin:"This shape is too thin to hold the code with its quiet zone. Try a rounder, fuller shape."};function L1(t){let{outline:e,problem:n}=Pi(t);if(e&&!n)return {ok:true,share:2*e.half};let o=n??"invalid";return {ok:false,reason:o,message:v1[o]}}function Et(t,e,n){if(n==="circle"){let i=Ze(e),s=(t/2+i)*Math.SQRT2+P1;return Math.ceil(s-t/2)}let o=xo(n);if(!o)return e;let r=Ze(e),a=(t+2*(r+I1))/(2*o.half);return Math.ceil((a-t)/2-1e-9)}function Wc(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 T1(t,e,n){let o=Et(e,n,"circle"),r=Ze(n),a=e+2*o,i=a/2,s=i-Hc-.5,l=Wc(Number.parseInt(Ve(t),36)||1),c=o-r,u=o+e+r;return Array.from({length:a},(m,f)=>Array.from({length:a},(d,g)=>{let h=l()<zc;return g>=c&&g<u&&f>=c&&f<u?false:h&&Math.hypot(g+.5-i,f+.5-i)<=s}))}var k1=Array.from({length:8},(t,e)=>{let n=e*Math.PI/4;return [Math.cos(n),Math.sin(n)]});function qc(t,e,n,o){if(o==="circle")return T1(t,e,n);let r=xo(o);if(!r)return null;let a=Et(e,n,o),i=Ze(n),s=e+2*a,l=Bc(r.polygons),c=.5+Hc,u=(g,h)=>{let p=g+.5,b=h+.5;return l(p/s,b/s)?k1.every(([_,y])=>l((p+_*c)/s,(b+y*c)/s)):false},m=Wc(Number.parseInt(Ve(t),36)||1),f=a-i,d=a+e+i;return Array.from({length:s},(g,h)=>Array.from({length:s},(p,b)=>{let _=m()<zc;return b>=f&&b<d&&h>=f&&h<d?false:_&&u(b,h)}))}function Ii(t,e){if(t==="circle")return {circle:e/2};let n=xo(t);return n?{path:Qc(n,e)}:null}function F1(t,e){let n=Ii(t,e);return n?"circle"in n?tt(e/2,e/2,n.circle):n.path:null}function Tt(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 vi(t){return typeof t=="object"&&t!==null&&t.type==="image"}function N1(t,e="#000000"){let n=Tt(t,e);return n.type==="solid"?n.color:n.type==="image"?n.underlay||e:n.stops[0]?.color||e}function Vc(t="center"){let[e,n]=t.split("-");return t==="center"?"center":n?`${n} ${e}`:e==="top"||e==="bottom"?`center ${e}`:`${e} center`}function O1(t){if(!t)return "#000000";if(typeof t=="string")return t;let e=Tt(t);if(e.type==="solid")return e.color;if(e.type==="image"){let r=e.fit==="tile"?`${25*(e.scale??1)}% auto`:(e.scale??1)===1?e.fit==="contain"?"contain":"cover":`${100*(e.scale??1)}% auto`,a=e.fit==="tile"?"repeat":"no-repeat";return `${`url("${e.src.replace(/"/g,"%22")}")`} ${Vc(e.position)} / ${r} ${a}, ${e.underlay??"transparent"}`}let o=[...e.stops].sort((r,a)=>r.offset-a.offset).map(r=>`${r.color} ${r.offset}%`).join(", ");return e.type==="linear"?`linear-gradient(${(e.angle??0)+90}deg, ${o})`:e.type==="angular"?`conic-gradient(from ${e.angle??0}deg, ${o})`:`radial-gradient(circle, ${o})`}var kt=t=>t/255,Cr=(t,e)=>(t[0]-e[0])**2+(t[1]-e[1])**2+(t[2]-e[2])**2,et=t=>.2126*t[0]+.7152*t[1]+.0722*t[2];function Li(t){let{width:e,height:n,data:o}=t,r=[0,e-1,(n-1)*e,n*e-1].map(i=>{let s=i*4;return {color:[kt(o[s]),kt(o[s+1]),kt(o[s+2])],alpha:o[s+3]/255}});if(r.some(i=>i.alpha<.9))return null;let a=r[0].color;return r.every(({color:i})=>Cr(i,a)<.006)?a:null}function D1(t){let{width:e,height:n,data:o}=t,r=Li(t),a=new Float32Array(e*n);for(let i=0;i<a.length;i++){let s=i*4,l=o[s+3]/255;if(r&&l>0){let c=Math.sqrt(Cr([kt(o[s]),kt(o[s+1]),kt(o[s+2])],r));l*=Math.min(1,Math.max(0,(c-.06)/.1));}a[i]=l;}return a}var B1=8,G1=.14,jc=.006;function Q1(t,e){let{width:n,height:o,data:r}=t,a=new Float64Array(4096),i=new Float64Array(4096*3),s=0;for(let d=0;d<e.length;d++){if(e[d]<.9)continue;let g=d*4,h=Math.floor(r[g]/16)*256+Math.floor(r[g+1]/16)*16+Math.floor(r[g+2]/16);a[h]+=1,i[h*3]+=kt(r[g]),i[h*3+1]+=kt(r[g+1]),i[h*3+2]+=kt(r[g+2]),s++;}if(s===0)return {palette:[],error:0};let l=[...a.keys()].filter(d=>a[d]>0).sort((d,g)=>a[g]-a[d]),c=[];for(let d of l){if(a[d]/s<jc/2||c.length>=B1)break;let g=[i[d*3]/a[d],i[d*3+1]/a[d],i[d*3+2]/a[d]];c.every(h=>Cr(h,g)>=G1**2)&&c.push(g);}let u=[],m=0;for(let d=0;d<3;d++){u=c.map(()=>({n:0,r:0,g:0,b:0,x:0,y:0})),m=0;for(let g=0;g<e.length;g++){if(e[g]<.9)continue;let h=g*4,p=[kt(r[h]),kt(r[h+1]),kt(r[h+2])],b=0,_=Number.POSITIVE_INFINITY;for(let[w,C]of c.entries()){let S=Cr(p,C);S<_&&(_=S,b=w);}let y=u[b];y.n++,y.r+=p[0],y.g+=p[1],y.b+=p[2],y.x+=g%n,y.y+=Math.floor(g/n),m+=Math.sqrt(_);}for(let[g,h]of u.entries())h.n>0&&(c[g]=[h.r/h.n,h.g/h.n,h.b/h.n]);}return {palette:c.map((d,g)=>({color:d,area:u[g].n/s,cx:u[g].n?u[g].x/u[g].n+.5:n/2,cy:u[g].n?u[g].y/u[g].n+.5:o/2})).filter(d=>d.area>=jc).sort((d,g)=>g.area-d.area),error:m/s}}function U1(t,e,n){let o=e+2,r=n+2,a=(m,f)=>m<=0||f<=0||m>e||f>n?0:t[(f-1)*e+(m-1)],i=new Map,s=new Map,l=m=>{let f=s.get(m);if(f)return f;let d=Math.floor(m/2),g=d%o,h=Math.floor(d/o),p=a(g,h),b=m%2===1,_=b?a(g,h+1):a(g+1,h),y=p===_?.5:Math.min(1,Math.max(0,(.5-p)/(_-p))),w=b?[g-.5,h-.5+y]:[g-.5+y,h-.5];return s.set(m,w),w},c=(m,f)=>{i.set(m,f);};for(let m=0;m<r-1;m++)for(let f=0;f<o-1;f++){let d=a(f,m)>=.5,g=a(f+1,m)>=.5,h=a(f+1,m+1)>=.5,p=a(f,m+1)>=.5,b=2*(m*o+f),_=2*((m+1)*o+f),y=2*(m*o+f)+1,w=2*(m*o+f+1)+1;switch((d?8:0)+(g?4:0)+(h?2:0)+(p?1:0)){case 1:c(_,y);break;case 2:c(w,_);break;case 3:c(w,y);break;case 4:c(b,w);break;case 5:{(a(f,m)+a(f+1,m)+a(f+1,m+1)+a(f,m+1))/4>=.5?(c(b,y),c(_,w)):(c(b,w),c(_,y));break}case 6:c(b,_);break;case 7:c(b,y);break;case 8:c(y,b);break;case 9:c(_,b);break;case 10:{(a(f,m)+a(f+1,m)+a(f+1,m+1)+a(f,m+1))/4>=.5?(c(y,_),c(w,b)):(c(y,b),c(w,_));break}case 11:c(w,b);break;case 12:c(y,w);break;case 13:c(_,w);break;case 14:c(y,_);break;}}let u=[];for(let m of i.keys()){if(!i.has(m))continue;let f=[],d=m;for(;d!==void 0&&i.has(d);){f.push(l(d));let g=i.get(d);i.delete(d),d=g;}f.length>=3&&u.push(f);}return u}function H1(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 Xc(t,e){if(t.length<=2)return t;let n=new Uint8Array(t.length);n[0]=1,n[t.length-1]=1;let o=[[0,t.length-1]];for(;o.length>0;){let[r,a]=o.pop(),i=t[r],s=t[a],l=s[0]-i[0],c=s[1]-i[1],u=Math.hypot(l,c)||1,m=-1,f=e;for(let d=r+1;d<a;d++){let g=t[d],h=Math.abs(c*(g[0]-i[0])-l*(g[1]-i[1]))/u;h>f&&(f=h,m=d);}m>=0&&(n[m]=1,o.push([r,m],[m,a]));}return t.filter((r,a)=>n[a]===1)}function z1(t,e){let n=0,o=-1;for(let[i,s]of t.entries()){let l=(s[0]-t[0][0])**2+(s[1]-t[0][1])**2;l>o&&(o=l,n=i);}let r=Xc(t.slice(0,n+1),e),a=Xc([...t.slice(n),t[0]],e);return [...r.slice(0,-1),...a.slice(0,-1)]}var Ce=t=>J(t,2);function W1(t,e){let n=t.length,o=(a,i)=>{let s=Math.hypot(i[0]-a[0],i[1]-a[1])||1,l=Math.min(.5,e/s);return [a[0]+(i[0]-a[0])*l,a[1]+(i[1]-a[1])*l]},r="";for(let a=0;a<n;a++){let i=t[a],s=o(i,t[(a-1+n)%n]),l=o(i,t[(a+1)%n]);r+=a===0?`M${Ce(s[0])} ${Ce(s[1])}`:`L${Ce(s[0])} ${Ce(s[1])}`,r+=`Q${Ce(i[0])} ${Ce(i[1])} ${Ce(l[0])} ${Ce(l[1])}`;}return `${r}Z`}function q1(t,e,n){let o="";for(let r of U1(t,e,n)){if(Math.abs(H1(r))<.8)continue;let a=z1(r,.18);a.length>=3&&(o+=W1(a,.9));}return o}var V1=.075;function Yc(t){let{width:e,height:n,data:o}=t,r=D1(t),a=0;for(let h of r)a+=h;let{palette:i,error:s}=Q1(t,r),l={width:e,height:n,palette:i,alpha:r,coverage:a/(e*n)};if(i.length===0||s>V1)return {...l,layers:[],photographic:i.length>0};let c=i.length,u=Array.from({length:c},()=>new Float32Array(e*n)),m=i.map(h=>h.color);for(let h=0;h<r.length;h++){let p=r[h];if(p<=0)continue;let b=h*4,_=[kt(o[b]),kt(o[b+1]),kt(o[b+2])],y=0,w=-1,C=Number.POSITIVE_INFINITY,S=Number.POSITIVE_INFINITY;for(let P=0;P<c;P++){let v=Cr(_,m[P]);v<C?(w=y,S=C,y=P,C=v):v<S&&(w=P,S=v);}if(w<0||C<1e-6){u[y][h]=p;continue}let $=m[y],R=m[w],M=[R[0]-$[0],R[1]-$[1],R[2]-$[2]],E=Math.min(1,Math.max(0,((_[0]-$[0])*M[0]+(_[1]-$[1])*M[1]+(_[2]-$[2])*M[2])/(M[0]**2+M[1]**2+M[2]**2)));u[y][h]=p*(1-E),u[w][h]=p*E;}let f=[],d=new Float32Array(e*n),g=new Array(c);for(let h=c-1;h>=0;h--){let p=u[h];for(let b=0;b<d.length;b++)d[b]+=p[b];g[h]=d.slice();}for(let h=0;h<c;h++){let p=q1(g[h],e,n);p&&f.push({color:m[h],d:p});}return {...l,layers:f,photographic:false}}var nu=.6,Fi={logo:160,halftone:160};function j1(t){let e="";for(let o=0;o<t.length;o+=32768)e+=String.fromCharCode(...t.subarray(o,o+32768));return btoa(e)}var Bn=class{entries=new Map;limit;constructor(e){this.limit=e;}get(e,n){let o=this.entries.get(e);if(o!==void 0)return this.entries.delete(e),this.entries.set(e,o),o;let r=n();if(this.entries.size>=this.limit){let a=this.entries.keys().next().value;a!==void 0&&this.entries.delete(a);}return this.entries.set(e,r),r}},X1=new Bn(8);function Y1(t){return X1.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 Ni(t){let{width:e,height:n,data:o}=t;if(!(Number.isInteger(e)&&Number.isInteger(n))||e<1||n<1||e>nr||n>nr||typeof o!="string")return null;try{let r=Y1(o);return r.length===e*n*4?{width:e,height:n,data:r}:null}catch{return null}}function ru(t,e={}){let{width:n,height:o,data:r}=t;if(!(n>0&&o>0)||r.length<n*o*4)throw new Error("Art image pixels must be width \xD7 height \xD7 4 RGBA bytes");let a=Math.min(n,o),i=e.square?Math.floor((n-a)/2):0,s=e.square?Math.floor((o-a)/2):0,l=e.square?a:n,c=e.square?a:o,u=Math.min(Math.max(Math.round(e.maxSize??Fi.halftone),1),nr),m=Math.min(1,u/Math.max(l,c)),f=Math.max(1,Math.round(l*m)),d=Math.max(1,Math.round(c*m)),g=new Uint8Array(f*d*4);for(let h=0;h<d;h++){let p=Math.floor(h*c/d),b=Math.max(p+1,Math.floor((h+1)*c/d));for(let _=0;_<f;_++){let y=Math.floor(_*l/f),w=Math.max(y+1,Math.floor((_+1)*l/f)),C=0,S=0,$=0,R=0,M=0;for(let P=p;P<b;P++)for(let v=y;v<w;v++){let L=((P+s)*n+v+i)*4,F=r[L+3]/255;C+=r[L]*F,S+=r[L+1]*F,$+=r[L+2]*F,R+=F,M++;}let E=(h*f+_)*4;g[E]=R>0?Math.round(C/R):0,g[E+1]=R>0?Math.round(S/R):0,g[E+2]=R>0?Math.round($/R):0,g[E+3]=Math.round(R/M*255);}}return {width:f,height:d,data:j1(g)}}async function Z1(t){if(typeof t!="string"&&!(t instanceof Blob))return t.complete||await new Promise(n=>{t.addEventListener("load",n,{once:true}),t.addEventListener("error",n,{once:true});}),t;let e=typeof t=="string"?t:URL.createObjectURL(t);try{return await new Promise((n,o)=>{let r=new Image;r.crossOrigin="anonymous",r.onload=()=>n(r),r.onerror=()=>o(new Error("Could not load the art image")),r.src=e;})}finally{typeof t!="string"&&setTimeout(()=>URL.revokeObjectURL(e),1e3);}}async function K1(t,e={}){if(typeof document>"u")throw new Error("loadQRArtImage needs a browser; pass decoded pixels to createQRArtImage instead");let n=e.mode??"halftone",o=e.maxSize??Fi[n],r=await Z1(t),a=r.naturalWidth||r.width||o,i=r.naturalHeight||r.height||o,s=n==="halftone",l=Math.min(1,o*4/(s?Math.min(a,i):Math.max(a,i))),c=Math.max(1,Math.round(a*l)),u=Math.max(1,Math.round(i*l)),m=document.createElement("canvas");m.width=c,m.height=u;let f=m.getContext("2d",{willReadFrequently:true});if(!f)throw new Error("Could not get a canvas context");f.imageSmoothingQuality="high",f.drawImage(r,0,0,c,u);let d;try{d=f.getImageData(0,0,c,u);}catch{throw new Error("Could not read the art image (cross-origin images need CORS); upload it instead")}finally{m.remove();}return ru(d,{maxSize:o,square:s})}function Oi(t){return !!(t&&jr.includes(t.mode)&&t.image&&Ni(t.image))}function wo(t){let e=Ta[t.mode];return t.variant&&e.includes(t.variant)?t.variant:e[0]}function J1(t,e){if(t===1)return [];let n=Math.floor(t/7)+2,o=t===32?26:Math.ceil((t*4+4)/(n*2-2))*2,r=[6];for(let a=e-7;r.length<n;a-=o)r.splice(1,0,a);return r}function Rr(t,e){let n=J1(t,e),o=n.length-1,r=[];for(let[a,i]of n.entries())for(let[s,l]of n.entries())a===0&&s===0||a===0&&s===o||a===o&&s===0||r.push([i,l]);return r}var th=0,Wt=1,Vt=2,Re=3,Zc=4,Kc=new Map;function ou(t){let e=Kc.get(t);if(e)return e;let n=t*4+17,o=new Uint8Array(n*n),r=(a,i,s,l,c)=>{for(let u=Math.max(0,i);u<Math.min(n,i+l);u++)for(let m=Math.max(0,a);m<Math.min(n,a+s);m++)o[u*n+m]=c;};r(6,0,1,n,Zc),r(0,6,n,1,Zc),r(0,8,9,1,Re),r(8,0,1,9,Re),r(n-8,8,8,1,Re),r(8,n-8,1,8,Re),t>=7&&(r(n-11,0,3,6,Re),r(0,n-11,6,3,Re));for(let[a,i]of Rr(t,n))r(a-2,i-2,5,5,Vt);return r(0,0,8,8,Wt),r(n-8,0,8,8,Wt),r(0,n-8,8,8,Wt),Kc.set(t,o),o}function eh(t){let e=t*4+17,n=ou(t);return Array.from({length:e},(o,r)=>Array.from({length:e},(a,i)=>n[r*e+i]!==th))}function nh(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 Gn(t,e){let n=at(t);return !n||n.a===0?e:[n.r/255,n.g/255,n.b/255]}var tn=(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 Me(t,e,n,o){let r=et(t);if(o?r<=n:r>=n)return t;let a=et(e);return Math.abs(r-a)<1e-6?e:tn(t,e,Math.min(1,Math.max(0,(r-n)/(r-a))))}var au=t=>Math.max(...t)-Math.min(...t),rh=(t,e)=>(t[0]-e[0])**2+(t[1]-e[1])**2+(t[2]-e[2])**2,Ti=t=>t.toString(16).padStart(2,"0");function Ft(t,e=1){let n=o=>Math.min(255,Math.round(Math.round(Math.min(Math.max(o,0),1)*255)/e)*e);return `#${Ti(n(t[0]))}${Ti(n(t[1]))}${Ti(n(t[2]))}`}function oh(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 Di=.3,Jc=t=>1-Math.exp(-((t/2)**2)/(2*Di**2)),ah=t=>oh(t/(2*Di*Math.SQRT2))**2,ih=(t,e,n)=>{let o=Math.min(1,Math.max(0,(n-t)/(e-t)));return o*o*(3-2*o)};function Bi(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 iu(t,e){let{width:n,height:o,data:r}=t,a=new Float32Array(n*o*3),i=e??new Float32Array(n*o);for(let s=0;s<n*o;s++)a[s*3]=r[s*4]/255,a[s*3+1]=r[s*4+1]/255,a[s*3+2]=r[s*4+2]/255,e||(i[s]=r[s*4+3]/255);return {width:n,height:o,rgb:a,alpha:i}}function sh(t){let e=iu(t),{rgb:n,alpha:o}=e,r=new Float64Array(256),a=0;for(let m=0;m<o.length;m++){if(o[m]<.5)continue;let f=et([n[m*3],n[m*3+1],n[m*3+2]]);r[Math.min(255,Math.floor(f*256))]+=1,a++;}let i=m=>{let f=0;for(let d=0;d<256;d++)if(f+=r[d],f>=m*a)return d/255;return 1},s=a?i(.01):0,l=a?i(.99):1;l-s<.15&&(s=0,l=1);let c=Math.min(1.6,1/(l-s)),u=(s+l)/2;for(let m=0;m<o.length;m++){let f=[n[m*3],n[m*3+1],n[m*3+2]],d=et(f),g=.5+(d-u)*c;for(let h=0;h<3;h++)n[m*3+h]=Math.min(1,Math.max(0,g+(f[h]-d)*1.12));}return e}function su(t,e,n,o,r=1){let{width:a,height:i,rgb:s,alpha:l}=t,c=Math.min(Math.max(e-.5,0),a-1),u=Math.min(Math.max(n-.5,0),i-1),m=Math.floor(c),f=Math.floor(u),d=Math.min(m+1,a-1),g=Math.min(f+1,i-1),h=c-m,p=u-f,b=0,_=0,y=0,w=0,C=($,R,M)=>{let E=R*a+$,P=l[E]*M;b+=s[E*3]*P,_+=s[E*3+1]*P,y+=s[E*3+2]*P,w+=P;};if(C(m,f,(1-h)*(1-p)),C(d,f,h*(1-p)),C(m,g,(1-h)*p),C(d,g,h*p),w<=0)return o;let S=w*r;return [o[0]+(b/w-o[0])*S,o[1]+(_/w-o[1])*S,o[2]+(y/w-o[2])*S]}var lh=new Bn(4),ch=new Bn(6),uh=new Bn(6);function Gi(t,e){return ch.get(t.image.data,()=>Yc(e))}function lu(t,e,n){return uh.get(t.image.data,()=>iu(e,n.alpha))}var Rt=t=>J(t,2),cu=t=>J(t,4),en=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,mh(n,o,r));}toElements(e){return [...this.groups].map(([n,o],r)=>A("path",{d:o.join(""),fill:n},`${e}-${r}`))}};function mh(t,e,n){let o=Rt(n*2),r=Rt(n);return `M${Rt(t-n)} ${Rt(e)}a${r} ${r} 0 1 0 ${o} 0a${r} ${r} 0 1 0 ${-o} 0z`}function Je(t,e,n,o,r){let a=Math.min(r,n/2,o/2);if(a<=0)return `M${Rt(t)} ${Rt(e)}h${Rt(n)}v${Rt(o)}h${Rt(-n)}z`;let i=Rt(a);return `M${Rt(t+a)} ${Rt(e)}h${Rt(n-2*a)}a${i} ${i} 0 0 1 ${i} ${i}v${Rt(o-2*a)}a${i} ${i} 0 0 1 ${-i} ${i}h${Rt(-(n-2*a))}a${i} ${i} 0 0 1 ${-i} ${-i}v${Rt(-(o-2*a))}a${i} ${i} 0 0 1 ${i} ${-i}z`}function uu(t,e,n){let o="";for(let[r,a]of t){let i=(r-2+e)*n,s=(a-2+e)*n;o+=Je(i,s,5*n,5*n,n*.35),o+=Je(i+n,s+n,3*n,3*n,n*.15),o+=Je(i+2*n,s+2*n,n,n,n*.12);}return o}var dh={blend:1,badge:1,color:.9,mono:.7},So=.35;function fh(t,e){let n=Gn(t,[0,0,0]),o=Gn(e,[1,1,1]),r=et(o)-et(n);return r>=So?null:r<=-So?"inverted":"low-contrast"}function mu(t,e,n){let o=Math.min(Math.max(t.intensity??nu,0),dh[wo(t)]);return et(n)-et(e)>=So?o:0}function hh(t){let{art:e,modules:n,version:o}=t,r=e.image&&Ni(e.image);if(!(r&&jr.includes(e.mode)))return null;let a=n.length;if(a!==o*4+17)return null;let i=Gn(t.fgColor,[0,0,0]),s=Gn(t.bgColor,[1,1,1]),l=mu(e,i,s);return l<=0?null:{art:e,image:r,modules:n,size:a,version:o,kinds:ou(o),margin:t.margin,pixelSize:t.pixelSize,t:l,fg:i,bg:s,variant:wo(e),body:t.body}}function Qi(t){let e=hh(t);if(!e)return null;let n;return e.art.mode==="halftone"?n=e.variant==="mono"?xh(e):yh(e):n=e.variant==="badge"?Ph(e):$h(e),A("g",{"data-qrdx-art":e.art.mode,"data-qrdx-art-variant":e.variant,children:n})}function ph(t,e){return {margin:.42-.17*t+(e===3?.04:0),darkCap:.4+.3*t}}var du=8.5,tu=new Map;function Ui(t){let e=t*4+17,n=tu.get(t);if(!n){let a=e*2,i=new Uint8Array(a*a),s=du*2;for(let l=0;l<a;l++)for(let c=0;c<a;c++){let u=c<s||c>=a-s,m=l<s||l>=a-s;u&&m&&!(c>=a-s&&l>=a-s)&&(i[l*a+c]=1);}for(let[l,c]of Rr(t,e))for(let u=(c-2)*2-1;u<(c+3)*2+1;u++)for(let m=(l-2)*2-1;m<(l+3)*2+1;m++)m>=0&&u>=0&&m<a&&u<a&&(i[u*a+m]=1);tu.set(t,i),n=i;}let o=n,r=e*2;return (a,i)=>{let s=Math.floor(a*2),l=Math.floor(i*2);return s>=0&&l>=0&&s<r&&l<r&&o[l*r+s]===1}}function fu(t,e,n=false){let{image:o,size:r,kinds:a,fg:i,bg:s}=t,l=lh.get(t.art.image.data,()=>sh(o)),c=Bi(o.width,o.height,r,"cover"),u=r*e,m=new Float32Array(u*u*3).fill(Number.NaN),d=1/(e*c.scale)>1.3?2:1,g=et(s)-.1*(et(s)-et(i)),h=Ui(t.version);for(let p=0;p<r;p++)for(let b=0;b<r;b++){let _=a[p*r+b],y=_===Wt||_===Vt;if(!(y&&!n))for(let w=0;w<e;w++)for(let C=0;C<e;C++){let S=0,$=0,R=0;for(let k=0;k<d;k++)for(let T=0;T<d;T++){let z=b+(C+(T+.5)/d)/e,W=p+(w+(k+.5)/d)/e,D=su(l,(z-c.offsetX)/c.scale,(W-c.offsetY)/c.scale,s);S+=D[0],$+=D[1],R+=D[2];}let M=d*d,E=[S/M,$/M,R/M],P=b+(C+.5)/e,v=p+(w+.5)/e,L=Math.min(P,v,r-P,r-v);L<1.5&&(E=tn(E,s,.35*(1-L/1.5))),n&&(y||h(P,v))&&(E=Me(E,s,g,false));let F=((p*e+w)*u+b*e+C)*3;m[F]=E[0],m[F+1]=E[1],m[F+2]=E[2];}}return {n:e,count:u,rgb:m}}function gh(t,e,n){let{size:o,kinds:r,modules:a,fg:i,bg:s,t:l}=t,{n:c,count:u,rgb:m}=e,f=et(i),d=et(s),g=d-f,h=ph(l,c),p=R=>.2126*m[R]+.7152*m[R+1]+.0722*m[R+2],b=new Float32Array(o*o),_=new Float32Array(o*o);for(let R=0;R<o;R++)for(let M=0;M<o;M++){let E=r[R*o+M];if(E===Wt){b[R*o+M]=d;continue}if(E===Vt){b[R*o+M]=a[R]?.[M]?f:d;continue}let P=0,v=0,L=0;for(let F=0;F<c;F++)for(let k=0;k<c;k++){let T=p(((R*c+F)*u+M*c+k)*3);P+=T,n.under[F*c+k]||(v+=T,L++);}b[R*o+M]=P/(c*c),_[R*o+M]=L?v/L:P/(c*c);}let y=o+1,w=new Float64Array(y*y);for(let R=0;R<o;R++)for(let M=0;M<o;M++)w[(R+1)*y+M+1]=b[R*o+M]+w[R*y+M+1]+w[(R+1)*y+M]-w[R*y+M];let C=2,S=(R,M)=>{let E=Math.max(0,R-C),P=Math.max(0,M-C),v=Math.min(o,R+C+1),L=Math.min(o,M+C+1);return (w[L*y+v]-w[P*y+v]-w[L*y+E]+w[P*y+E])/((v-E)*(L-P))},$=n.weight;for(let R=0;R<o;R++)for(let M=0;M<o;M++){let E=r[R*o+M];if(E===Wt||E===Vt)continue;let P=E===Re,v=(h.margin+(P?.08:0))*g,L=(h.darkCap-(P?.12:0))*g,F=($*((n.light-n.dark)/2)-v)/(1-$),k=S(M,R),T=_[R*o+M],z=!!a[R]?.[M],W=0,D=s;if(z){let U=Math.min(k+F,f+L);T>U&&(W=(T-U)/Math.max(T-f,1e-6),D=i);}else {let U=Math.max(k-F,d-L);T<U&&(W=(U-T)/Math.max(d-T,1e-6));}if(!(W<=0)){W=Math.min(1,W);for(let U=0;U<c;U++)for(let X=0;X<c;X++){let xt=((R*c+U)*u+M*c+X)*3;for(let lt=0;lt<3;lt++)m[xt+lt]+=(D[lt]-m[xt+lt])*W;}}}}function hu(t,e,n,o){let{count:r}=e,a=new en;for(let l=0;l<r;l++){let c=0,u=n(l*r);for(let m=1;m<=r;m++){let f=m<r?n(l*r+m):null;(m===r||f!==u)&&(u&&a.cellRun(u,c,l,m-c),c=m,u=f);}}let i=t.pixelSize/e.n,s=Rt(t.margin*t.pixelSize);return A("g",{transform:`translate(${s} ${s}) scale(${cu(i)})`,children:a.toElements(o)},o)}function Hi(t,e){let n=Rr(t.version,t.size);return n.length===0?[]:[A("path",{d:uu(n,t.margin,t.pixelSize),fill:e,fillRule:"evenodd"},"art-alignment")]}function pu(t){let{image:e,size:n}=t;return Math.floor(Math.min(e.width,e.height)/n)>=4&&n<=45?4:3}var bh=t=>2*Di*Math.sqrt(-2*Math.log(1-Math.min(t,.95)));function _h(t,e,n){let o=e+1,r=new Float64Array(o*o);for(let i=0;i<e;i++)for(let s=0;s<e;s++)r[(i+1)*o+s+1]=t[i*e+s]+r[i*o+s+1]+r[(i+1)*o+s]-r[i*o+s];let a=new Float32Array(e*e);for(let i=0;i<e;i++)for(let s=0;s<e;s++){let l=Math.max(0,s-n),c=Math.max(0,i-n),u=Math.min(e,s+n+1),m=Math.min(e,i+n+1);a[i*e+s]=(r[m*o+u]-r[c*o+u]-r[m*o+l]+r[c*o+l])/((u-l)*(m-c));}return a}function gu(t,e,n,o){let{size:r,kinds:a,modules:i,fg:s,bg:l}=t,c=et(s),u=et(l),m=u-c,f=_h(e,r,2),d=new Float32Array(r*r),g=new Float32Array(r*r).fill(Number.NaN);for(let h=0;h<r;h++)for(let p=0;p<r;p++){let b=h*r+p,_=a[b];if(_===Wt||_===Vt)continue;let y=_===Re,w=o.base+(y?.08:0),C=(o.margin+(y?.03:0))*m,S=(o.cap-(y?.04:0))*m,$=Jc(w),R=Jc(y?Math.max(o.max,.94):o.max),M=$*((o.dark+o.light)/2)+(1-$)*f[b],E=n[b],P=!!i[h]?.[p],v=P?o.dark:o.light,L=P?Math.min(M-C,c+S):Math.max(M+C,u-S),k=(P?E<=L:E>=L)?0:(E-L)/(E-v);k>R&&(k=R,g[b]=Math.min(u,Math.max(c,(L-R*v)/(1-R))));let T=P?E<=L-.06:E>=L+.06;o.skip&&T&&!y||(k=Math.max(k,$)),d[b]=k>0?bh(k):0;}return {diameter:d,surround:g}}function yh(t){let{size:e,kinds:n,modules:o,fg:r,bg:a,t:i,margin:s,pixelSize:l}=t,c=pu(t),u=fu(t,c,true),m=et(r),f=et(a),d=m+.1*(f-m),g=f-.05*(f-m),{count:h,rgb:p}=u,b=(S,$,R,M)=>(($*c+M)*h+S*c+R)*3,_=new Float32Array(e*e);for(let S=0;S<e;S++)for(let $=0;$<e;$++){let R=n[S*e+$];if(R===Wt||R===Vt){_[S*e+$]=R===Vt&&o[S]?.[$]?m:f;continue}let M=0;for(let E=0;E<c;E++)for(let P=0;P<c;P++){let v=b($,S,P,E);M+=.2126*p[v]+.7152*p[v+1]+.0722*p[v+2];}_[S*e+$]=M/(c*c);}let y=gu(t,_,_,{base:.6-.28*i,max:.86,dark:d,light:g,margin:.2-.1*i,cap:.4+.14*i,skip:false});for(let S=0;S<e;S++)for(let $=0;$<e;$++){let R=y.surround[S*e+$];if(Number.isNaN(R))continue;let M=_[S*e+$],P=R<M?r:a,v=Math.min(1,Math.abs(M-R)/Math.max(Math.abs(M-et(P)),1e-6));for(let L=0;L<c;L++)for(let F=0;F<c;F++){let k=b($,S,F,L);for(let T=0;T<3;T++)p[k+T]+=(P[T]-p[k+T])*v;}}let w=[hu(t,u,S=>{let $=S*3;return Number.isNaN(p[$])?null:Ft([p[$],p[$+1],p[$+2]],8)},"art-photo")],C=new en;for(let S=0;S<e;S++)for(let $=0;$<e;$++){let R=y.diameter[S*e+$];if(!(R>0))continue;let M=0,E=0,P=0;for(let F=0;F<c;F++)for(let k=0;k<c;k++){let T=b($,S,k,F);M+=p[T],E+=p[T+1],P+=p[T+2];}let v=[M/(c*c),E/(c*c),P/(c*c)],L=o[S]?.[$]?Me(v,r,d,true):Me(v,a,g,false);C.circle(Ft(L,10),($+s+.5)*l,(S+s+.5)*l,R/2*l);}return w.push(...C.toElements("art-dot"),...Hi(t,Ft(r))),w}function xh(t){let{size:e,kinds:n,modules:o,fg:r,bg:a}=t,i=pu(t),s=fu(t,i),l=et(r),c=et(a),u=i%2===1?1:2,m=(i-u)/2,f=M=>M>=m&&M<m+u,d=[];for(let M=0;M<i;M++)for(let E=0;E<i;E++)d.push(f(E)&&f(M));gh(t,s,{weight:ah(u/i),dark:l,light:c,under:d});let{count:g,rgb:h}=s,p=new Float32Array(g*g),b=new Int8Array(g*g).fill(-1);for(let M=0;M<g*g;M++){let E=M*3;if(Number.isNaN(h[E])){p[M]=Number.NaN;continue}let P=(.2126*h[E]+.7152*h[E+1]+.0722*h[E+2]-l)/(c-l);p[M]=.5+(ih(0,1,P)-.5)*1.15;}for(let M=0;M<e;M++)for(let E=0;E<e;E++){let P=n[M*e+E];if(!(P===Wt||P===Vt))for(let v=m;v<m+u;v++)for(let L=m;L<m+u;L++)b[(M*i+v)*g+E*i+L]=o[M]?.[E]?0:1;}let _=Ui(t.version);for(let M=0;M<g;M++)for(let E=0;E<g;E++){let P=M*g+E;b[P]<0&&_((E+.5)/i,(M+.5)/i)&&(b[P]=1);}let y=new Uint8Array(g*g),w=.3,C=0,S=0,$=(M,E,P)=>{if(M<0||M>=g||E>=g)return;let v=E*g+M;if(!Number.isNaN(p[v])){let L=Math.floor(M/i)===Math.floor(C/i)&&Math.floor(E/i)===Math.floor(S/i);p[v]+=L?P:P*w;}};for(let M=0;M<g;M++){let E=M%2===0?1:-1;for(let P=0;P<g;P++){let v=E===1?P:g-1-P,L=M*g+v,F=p[L];if(Number.isNaN(F))continue;let k=b[L]>=0?b[L]:F>=.5?1:0;y[L]=k===0?1:0;let T=Math.min(.75,Math.max(-0.75,F-k));C=v,S=M,$(v+E,M,T*7/16),$(v-E,M+1,T*3/16),$(v,M+1,T*5/16),$(v+E,M+1,T/16);}}let R=Ft(r);return [hu(t,s,M=>y[M]?R:null,"art-halftone"),...Hi(t,R)]}function eu(t,e){let n=null,o=0;for(let r of t.palette){if(e&&rh(r.color,e)<.02)continue;let a=r.area*(.35+au(r.color))*(et(r.color)>.86?.05:1);a>o&&(o=a,n=r.color);}return n}function bu(t,e,n,o,r){let a;if(t.photographic){let i=new en,{width:s,height:l,rgb:c,alpha:u}=e;for(let m=0;m<l;m++){let f=0,d=null;for(let g=0;g<=s;g++){let h=m*s+g,p=g<s&&u[h]>=.5?Ft(o([c[h*3],c[h*3+1],c[h*3+2]]),6):null;(g===s||p!==d)&&(d&&i.cellRun(d,f,m,g-f),f=g,d=p);}}a=i.toElements(`${r}-px`);}else a=t.layers.map((i,s)=>A("path",{d:i.d,fill:Ft(o(i.color)),fillRule:"evenodd"},`${r}-${s}`));return A("g",{transform:`translate(${Rt(n.x)} ${Rt(n.y)}) scale(${cu(n.scale)})`,children:a},r)}function $h(t){let{art:e,image:n,size:o,kinds:r,modules:a,fg:i,bg:s,t:l,margin:c,pixelSize:u}=t,m=Gi(e,n),f=lu(e,n,m),d=Bi(m.width,m.height,o,"contain"),g=Math.min(1,.3+1.4*l),h=T=>tn(s,T,g),p=Ft(s),b=Ft(i),_=[bu(m,f,{x:(c+d.offsetX)*u,y:(c+d.offsetY)*u,scale:d.scale*u},h,"art-logo")],y=du,w=(T,z)=>Je((T+c)*u,(z+c)*u,(y+.4)*u,(y+.4)*u,1.2*u),C=Rr(t.version,o).map(([T,z])=>Je((T-2.5+c)*u,(z-2.5+c)*u,6*u,6*u,u*.8)).join("");_.push(A("path",{d:w(-0.4,-0.4)+w(o-y,-0.4)+w(-0.4,o-y)+C,fill:p},"art-plates"));let S=Ui(t.version),$=et(s),R=et(i),M=new Float32Array(o*o),E=new Float32Array(o*o),P=new Array(o*o);for(let T=0;T<o;T++)for(let z=0;z<o;z++){let W=T*o+z,D=r[W];if(D===Wt||D===Vt){M[W]=D===Vt&&a[T]?.[z]?R:$;continue}let U=1,X=0,xt=0,lt=0,N=0;for(let B=0;B<4;B++)for(let Z=0;Z<4;Z++){let Pt=z+(Z+.5)/4,ct=T+(B+.5)/4,Zt=S(Pt,ct)?s:su(f,(Pt-d.offsetX)/d.scale,(ct-d.offsetY)/d.scale,s,g),ae=et(Zt);U=Math.min(U,ae),X+=ae,xt+=Zt[0],lt+=Zt[1],N+=Zt[2];}M[W]=X/16,E[W]=U,P[W]=[xt/16,lt/16,N/16];}let v=R+.08*($-R),L=$-.04*($-R),F=gu(t,M,M,{base:.74-.26*l,max:.9,dark:v,light:L,margin:.23-.1*l,cap:.4+.1*l,skip:l>=.7}),k=new en;for(let T=0;T<o;T++)for(let z=0;z<o;z++){let W=T*o+z,D=F.diameter[W],U=!!a[T]?.[z];if(!(D>0)||!U&&E[W]>=$-.02)continue;let X=U?Me(P[W],i,v,true):Me(P[W],s,L,false);k.circle(Ft(X,8),(z+c+.5)*u,(T+c+.5)*u,D/2*u);}return _.push(...k.toElements("art-dot")),_.push(...Hi(t,b)),_}var Sh={L:.5,M:.72,Q:.88,H:1},_u=.32,yu=.55,wh=.6,Ch=2;function xu(t,e,n){let o=e>=1?t:t*e,r=e>=1?t/e:t,a=Math.max(.7,t*.09),i=o+2*a,s=r+2*a;return {logoW:o,logoH:r,plateW:i,plateH:s,radius:Math.min(i,s)*.26,cx:n/2,cy:n/2}}var $u=t=>({cx:t.cx,cy:t.cy,w:t.plateW,h:t.plateH,r:t.radius});function Su(t,e,n){return Cu(e+.5,n+.5,t)<yu}function Rh(t,e){let n=$u(t),o=yu+1,r=Math.max(0,Math.floor(t.cx-t.plateW/2-o)),a=Math.min(e-1,Math.ceil(t.cx+t.plateW/2+o)),i=Math.max(0,Math.floor(t.cy-t.plateH/2-o)),s=Math.min(e-1,Math.ceil(t.cy+t.plateH/2+o)),l=[];for(let c=i;c<=s;c++)for(let u=r;u<=a;u++)Su(n,u,c)&&l.push(c*e+u);return l}var Mh=t=>Math.floor(t.correctable*wh);function ki(t,e,n){let o=xu(t,e,n.size),r=Mh(n);return $r(n,Rh(o,n.size)).every(a=>a<=r)}function wu(t,e,n){if(ki(n,e,t))return n;let o=0,r=n;if(!ki(o,e,t))return -1;for(;r-o>1/64;){let a=(o+r)/2;ki(a,e,t)?o=a:r=a;}return o}var $o=new Map;function Eh(t,e){let n=`${t.version}${t.level}:${e.toFixed(3)}`,o=$o.get(n);return o===void 0&&(o=wu(t,e,_u*t.size),$o.size>=64&&$o.clear(),$o.set(n,o)),o}function Ah(t,e){let{size:n,t:o,modules:r,version:a}=t,i=nh(r),s=(.18+.15*o)*Sh[i],l=e.width/e.height,c=Math.min(_u,s)*n,u=xr(a,i),m=Math.max(0,Eh(u,l));if(m<Ch)return {wantedBox:c,maxBox:m,box:0,plate:null};let f=wu(u,l,Math.min(c,m));return f<0?{wantedBox:c,maxBox:m,box:0,plate:null}:{wantedBox:c,maxBox:m,box:f,plate:xu(f,l,n)}}function Cu(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 Ru(t,e){let{fg:n,bg:o,t:r}=t,a=et(n),i=et(o),s=eu(e),l=Math.min(1,r/.6),c=s?Me(s,n,a+.3*(i-a),true):n,u=tn(n,c,l),m=s?eu(e,s):null,f=a+.42*(i-a),d=m&&et(m)<=f+.22?tn(n,Me(m,n,f,true),l):u;return {body:u,inner:d}}function Ph(t){let{art:e,image:n,size:o,kinds:r,modules:a,bg:i,margin:s,pixelSize:l,version:c}=t,u=Gi(e,n),m=Ah(t,u).plate,{body:f}=Ru(t,u),d=Ft(f),g=m&&$u(m),h=a.map(P=>[...P]);for(let P=0;P<o;P++)for(let v=0;v<o;v++){let L=r[P*o+v];(L===Vt||g&&L!==Wt&&Su(g,v,P))&&(h[P][v]=false);}let p=[],b=t.body?.(h);if(b)p.push(A("g",{fill:d,children:b},"art-body"));else {let P=new en;for(let v=0;v<o;v++)for(let L=0;L<o;L++)h[v]?.[L]&&r[v*o+L]!==Wt&&P.circle(d,(L+s+.5)*l,(v+s+.5)*l,.45*l);p.push(...P.toElements("art-body"));}let _=Rr(c,o).filter(([P,v])=>!g||Cu(P+.5,v+.5,g)>3.2);if(_.length>0&&p.push(A("path",{d:uu(_,s,l),fill:d,fillRule:"evenodd"},"art-alignment")),!m)return p;let y=lu(e,n,u),w=(m.cx-m.plateW/2+s)*l,C=(m.cy-m.plateH/2+s)*l,S=m.plateW*l,$=m.plateH*l,R=m.radius*l,M=.1*l,E=Je(w,C,S,$,R);return p.push(A("path",{d:E,fill:Ft(i)},"art-plate"),A("path",{d:E+Je(w+M,C+M,S-2*M,$-2*M,R-M),fill:Ft(tn(i,f,.16)),fillRule:"evenodd"},"art-plate-ring"),bu(u,y,{x:(m.cx-m.logoW/2+s)*l,y:(m.cy-m.logoH/2+s)*l,scale:m.logoW/u.width*l},P=>P,"art-logo")),p}function zi(t){let{art:e}=t;if(e.mode!=="logo"||e.matchEyes===false)return null;let n=e.image&&Ni(e.image);if(!n)return null;let o=Gn(t.fgColor,[0,0,0]),r=Gn(t.bgColor,[1,1,1]),a=mu(e,o,r);if(a<=0)return null;let i=Gi(e,n);if(i.palette.length===0)return null;if(wo(e)==="badge"){let{body:g,inner:h}=Ru({fg:o,bg:r,t:a},i),p={outer:Ft(g),inner:Ft(h)};return {topLeft:p,topRight:p,bottomLeft:p}}let s=et(o),l=et(r),c=Math.min(1,a/.6),u=t.version*4+17,m=Bi(i.width,i.height,u,"contain"),f=.45*Math.max(i.width,i.height),d=(g,h)=>{let p=(g-m.offsetX)/m.scale,b=(h-m.offsetY)/m.scale,_=null,y=0;for(let C of i.palette){if(et(C.color)>.86)continue;let S=(C.cx-p)**2+(C.cy-b)**2,$=C.area*(.35+au(C.color))*Math.exp(-S/(2*f**2));$>y&&(y=$,_=C.color);}if(!_)return {};let w=Me(_,o,s+.42*(l-s),true);return {inner:Ft(tn(o,w,c))}};return {topLeft:d(3.5,3.5),topRight:d(u-3.5,3.5),bottomLeft:d(3.5,u-3.5)}}var Ih=["horizontal-line","liquid","liquid-horizontal","liquid-vertical","classy","classy-rounded","leaf","plus","hexagon","star","heart","random-dots","mosaic","octagon"];function Mu(t){return Ih.includes(t)}var Eu={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 Co(t,e){if(t===void 0||!Number.isFinite(t))return 1;let n=e?Eu[e]??1:Xr;return Math.min(Oa,Math.max(Xr,n,t))}function vh(t,e,n){return t<7&&e<7||t>=n-7&&e<7||t<7&&e>=n-7}function Lh(t,e){if(t===1)return [];let n=Math.floor(t/7)+2,o=t===32?26:Math.ceil((t*4+4)/(n*2-2))*2,r=[6];for(let a=e-7;r.length<n;a-=o)r.splice(1,0,a);return r}function Wi(t){let e=(t-17)/4,n=Number.isInteger(e)?Lh(e,t):[],o=n.length-1,r=[];for(let[a,i]of n.entries())for(let[s,l]of n.entries())a===0&&s===0||a===0&&s===o||a===o&&s===0||r.push([i,l]);return (a,i)=>r.some(([s,l])=>Math.abs(a-s)<=2&&Math.abs(i-l)<=2)}var Th={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 kh(t,e,n,o,r,a){switch(t){case "horizontal-line":{let i=o*.43;return O(e-o/2,n-i,o,2*i)}case "leaf":{let i=o*.5;return O(e-i,n-i,2*i,2*i,[o*.4,o*.05,o*.4,o*.05])}case "plus":{let i=o*.22,s=o*.5;return Y([[e-i,n-s],[e+i,n-s],[e+i,n-i],[e+s,n-i],[e+s,n+i],[e+i,n+i],[e+i,n+s],[e-i,n+s],[e-i,n+i],[e-s,n+i],[e-s,n-i],[e-i,n-i]])}case "hexagon":return Y(kn(e,n,o*.54,6));case "star":return Y(Fn(e,n+o*.04,o*.62,o*.34));case "heart":return On(e,n+o*.02,o*1.08);case "random-dots":return tt(e,n,o*(.38+.15*so(r,a)));case "mosaic":{let i=o*(.8+.14*so(r,a,1))/2,s=[[e-i,n-i],[e+i,n-i],[e+i,n+i],[e-i,n+i]];return Y(rc(s,e,n,(so(r,a,2)-.5)*16))}case "octagon":return Y(kn(e,n,o*.48/Math.cos(Math.PI/8),8,22.5));default:return tt(e,n,o*.45)}}function Au(t,e){let{margin:n,pixelSize:o,pattern:r}=e,a=Co(e.scale,r),i=t.length,s=e.plain?()=>false:Wi(i),l=(h,p)=>!e.plain&&vh(h,p,i),c=(h,p)=>h>=0&&p>=0&&h<i&&p<i&&!!t[p]?.[h]&&!l(h,p),u=h=>(h+.5+n)*o,m=[],f=[],d=Th[r];for(let h=0;h<i;h++)for(let p=0;p<i;p++){if(!c(p,h))continue;let b=u(p),_=u(h);if(s(p,h)){m.push(I`M${b-o/2} ${_-o/2}h${o}v${o}h${-o}z`);continue}if(!d){f.push(kh(r,b,_,o*a,p,h));continue}let y=o*d.thickness*a/2,w=d.horizontal&&c(p+1,h),C=d.horizontal&&c(p-1,h),S=d.vertical&&c(p,h-1),$=d.vertical&&c(p,h+1),M=[!(S||C),!(S||w),!($||w),!($||C)].map((E,P)=>E?y*d.radius(P):0);f.push(O(b-y,_-y,2*y,2*y,M)),2*y<o&&(w&&f.push(O(b,_-y,o,2*y)),$&&f.push(O(b-y,_,2*y,o)));}if(d?.fillets&&a===1){let h=o*.3;for(let p=0;p<i;p++)for(let b=0;b<i;b++){if(c(b,p)||l(b,p))continue;let _=u(b)-o/2,y=u(p)-o/2,w=_+o,C=y+o;c(b-1,p)&&c(b,p-1)&&c(b-1,p-1)&&f.push(I`M${_} ${y}h${h}A${h} ${h} 0 0 0 ${_} ${y+h}Z`),c(b+1,p)&&c(b,p-1)&&c(b+1,p-1)&&f.push(I`M${w} ${y}v${h}A${h} ${h} 0 0 0 ${w-h} ${y}Z`),c(b+1,p)&&c(b,p+1)&&c(b+1,p+1)&&f.push(I`M${w} ${C}h${-h}A${h} ${h} 0 0 0 ${w} ${C-h}Z`),c(b-1,p)&&c(b,p+1)&&c(b-1,p+1)&&f.push(I`M${_} ${C}v${-h}A${h} ${h} 0 0 0 ${_+h} ${C}Z`);}}let g=[];return f.length>0&&g.push(A("path",{d:f.join("")},"modules")),m.length>0&&g.push(A("path",{d:m.join("")},"alignment")),g}function Fh(t){return t==="top-left"?0:t==="top-right"?1:3}function Ro(t,e,n,o="circle",r="top-left"){let a=n*2,i=n,s=a/3;switch(o){case "leaf":case "leaf-reverse":case "drop":case "drop-reverse":{let l=Fh(r),c=(l+2)%4,u=1.3*s,m=.7*s,f=g=>{switch(o){case "leaf":return g===l||g===c;case "leaf-reverse":return !(g===l||g===c);case "drop":return g===l;default:return g===c}},d=[0,1,2,3].map(g=>f(g)?m:u);return A("path",{d:O(t-n,e-n,a,a,d)})}case "extra-rounded":return A("path",{d:O(t-n,e-n,a,a,1.15*s)});case "plus":{let l=1.15*s,c=n;return A("path",{d:Y([[t-l,e-c],[t+l,e-c],[t+l,e-l],[t+c,e-l],[t+c,e+l],[t+l,e+l],[t+l,e+c],[t-l,e+c],[t-l,e+l],[t-c,e+l],[t-c,e-l],[t-l,e-l]])})}case "cross-rounded":{let l=1.15*s,c=.5*s;return A("path",{d:O(t-n,e-l,a,2*l,c)+O(t-l,e-n,2*l,a,c)})}case "hexagon":return A("path",{d:Y(kn(t,e,1.72*s,6))});case "octagon":return A("path",{d:Y(kn(t,e,n/Math.cos(Math.PI/8),8,22.5))});case "flower":{let l=.6*s,c=.9*s;return A("path",{d:tt(t-l,e-l,c)+tt(t+l,e-l,c)+tt(t+l,e+l,c)+tt(t-l,e+l,c)+tt(t,e,1.2*s)})}case "heart":return A("path",{d:On(t,e+.12*s,3.5*s)});case "squircle":return A("path",{d:Y(Nn(t,e,n,n,4,64))});case "dots":{let l=[];for(let c of [-1,0,1])for(let u of [-1,0,1])l.push(tt(t+u*s*.82,e+c*s*.82,.58*s));return A("path",{d:l.join("")})}case "cushion":return A("path",{d:hr(t-n,e-n,a,.6*s,.15*s)});case "square":return A("rect",{height:x(a),transform:I`rotate(0,${t},${e})`,width:x(a),x:x(t-i),y:x(e-i)});case "rounded":return A("rect",{height:x(a),rx:x(n*.5),ry:x(n*.5),transform:I`rotate(0,${t},${e})`,width:x(a),x:x(t-i),y:x(e-i)});case "diamond":return A("path",{d:I`M ${t-i*.714286} ${e-i*.714286}v ${a*.714286}h ${a*.714286}v -${a*.714286}z`,transform:I`rotate(45,${t},${e})`});case "message":{let l=a/30,c=f=>(f-40)*l+t,u=f=>(f-40)*l+e,m=I`M ${c(25)} ${u(35.714285714285715)}v ${8.571428571428571*l}a ${10.714285714285714*l} ${10.714285714285714*l}, 0, 0, 0, ${10.714285714285714*l} ${10.714285714285714*l}h ${19.285714285714285*l}v -${19.285714285714285*l}a ${10.714285714285714*l} ${10.714285714285714*l}, 0, 0, 0, -${10.714285714285714*l} -${10.714285714285714*l}h -${8.571428571428571*l}a ${10.714285714285714*l} ${10.714285714285714*l}, 0, 0, 0, -${10.714285714285714*l} ${10.714285714285714*l}`;return A("path",{clipRule:"evenodd",d:m,transform:I`rotate(0,${t},${e})`})}case "message-reverse":{let l=a/30,c=f=>(f-40)*l+t,u=f=>(f-40)*l+e,m=I`M ${c(25)} ${u(35.714285714285715)}v ${8.571428571428571*l}a ${10.714285714285714*l} ${10.714285714285714*l}, 0, 0, 0, ${10.714285714285714*l} ${10.714285714285714*l}h ${19.285714285714285*l}v -${19.285714285714285*l}a ${10.714285714285714*l} ${10.714285714285714*l}, 0, 0, 0, -${10.714285714285714*l} -${10.714285714285714*l}h -${8.571428571428571*l}a ${10.714285714285714*l} ${10.714285714285714*l}, 0, 0, 0, -${10.714285714285714*l} ${10.714285714285714*l}`;return A("path",{clipRule:"evenodd",d:m,transform:I`rotate(-180,${t},${e})`})}case "diya":{let l=a/30,c=f=>(f-40)*l+t,u=f=>(f-40)*l+e,m=I`M ${c(25)} ${u(35.714285714285715)}v ${8.571428571428571*l}a ${10.714285714285714*l} ${10.714285714285714*l}, 0, 0, 0, ${10.714285714285714*l} ${10.714285714285714*l}h ${19.285714285714285*l}v -${19.285714285714285*l}a ${10.714285714285714*l} ${10.714285714285714*l}, 0, 0, 0, -${10.714285714285714*l} -${10.714285714285714*l}h -${8.571428571428571*l}H ${c(25)}z`;return A("path",{clipRule:"evenodd",d:m,transform:I`rotate(0,${t},${e})`})}case "diya-reverse":{let l=a/30,c=f=>(f-40)*l+t,u=f=>(f-40)*l+e,m=I`M ${c(25)} ${u(35.714285714285715)}v ${19.285714285714285*l}h ${19.285714285714285*l}a ${10.714285714285714*l} ${10.714285714285714*l}, 0, 0, 0, ${10.714285714285714*l} -${10.714285714285714*l}v -${19.285714285714285*l}h -${19.285714285714285*l}a ${10.714285714285714*l} ${10.714285714285714*l}, 0, 0, 0, -${10.714285714285714*l} ${10.714285714285714*l}z`;return A("path",{clipRule:"evenodd",d:m,transform:I`rotate(0,${t},${e})`})}case "rounded-triangle":{let l=a/21,c=f=>(f-40)*l+t,u=f=>(f-40)*l+e,m=I`M ${c(33.57142857142857)} ${u(29.285714285714285)}h ${12.857142857142856*l}c ${4.285714285714286*l} 0 ${4.285714285714286*l} ${4.285714285714286*l} ${4.285714285714286*l} ${4.285714285714286*l}v ${12.857142857142856*l}c 0 ${4.285714285714286*l} -${4.285714285714286*l} ${4.285714285714286*l} -${4.285714285714286*l} ${4.285714285714286*l}h -${12.857142857142856*l}c -${4.285714285714286*l} 0 -${4.285714285714286*l} -${4.285714285714286*l} -${4.285714285714286*l} -${4.285714285714286*l}v -${12.857142857142856*l}c 0 -${4.285714285714286*l} ${4.285714285714286*l} -${4.285714285714286*l} ${4.285714285714286*l} -${4.285714285714286*l}z`;return A("path",{d:m,transform:I`rotate(45,${t},${e})`})}case "star":{let l=a/27,c=f=>(f-40)*l+t,u=f=>(f-40)*l+e,m=I`M ${c(38.84615384615385)},${u(26.546153846153846)}c${.6692307692307691*l},-${1.0153846153846153*l},${2.215384615384615*l},-${1.0153846153846153*l},${2.884615384615384*l},0l${4.038461538461538*l},${6.069230769230768*l}c${.23076923076923075*l},${.3461538461538461*l},${.6*l},${.6*l},${1.0153846153846153*l},${.7153846153846153*l}l${7.223076923076922*l},${1.823076923076923*l}c${1.2*l},${.3*l},${1.6846153846153844*l},${1.7076923076923076*l},${.8999999999999999*l},${2.6538461538461533*l}l-${4.73076923076923*l},${5.584615384615384*l}c-${.2769230769230769*l},${.3230769230769231*l},-${.41538461538461535*l},${.7384615384615384*l},-${.3923076923076923*l},${1.1307692307692307*l}l${.4384615384615384*l},${7.199999999999999*l}c${.06923076923076922*l},${1.2*l},-${1.1769230769230767*l},${2.0769230769230766*l},-${2.3307692307692305*l},${1.6384615384615382*l}l-${6.9692307692307685*l},-${2.6076923076923073*l}c-${.3923076923076923*l},-${.16153846153846155*l},-${.8538461538461538*l},-${.16153846153846155*l},-${1.2461538461538462*l},0l-${6.9692307692307685*l},${2.6076923076923073*l}c-${1.1538461538461537*l},${.4384615384615384*l},-${2.4*l},-${.4384615384615384*l},-${2.3307692307692305*l},-${1.6384615384615382*l}l${.4384615384615384*l},-${7.199999999999999*l}c${.023076923076923075*l},-${.41538461538461535*l},-${.11538461538461538*l},-${.8307692307692307*l},-${.3923076923076923*l},-${1.1307692307692307*l}l-${4.73076923076923*l},-${5.584615384615384*l}c-${.7846153846153846*l},-${.923076923076923*l},-${.3230769230769231*l},-${2.3307692307692305*l},${.8999999999999999*l},-${2.6538461538461533*l}l${7.223076923076922*l},-${1.823076923076923*l}c${.41538461538461535*l},-${.11538461538461538*l},${.7846153846153846*l},-${.3461538461538461*l},${1.0153846153846153*l},-${.7153846153846153*l}l${4.038461538461538*l},-${6.069230769230768*l}z`;return A("path",{clipRule:"evenodd",d:m,transform:I`rotate(0,${t},${e})`})}case "banner":{let l=a/28;return A("g",{transform:I`translate(${t-40*l},${e-40*l}) scale(${x(l,6)})`,children:A("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 A("circle",{cx:x(t),cy:x(e),r:x(n),transform:I`rotate(0,${t},${e})`})}}function Qn(t,e,n,o){let r=t==="top-left"?0:t==="top-right"?1:3,a=(r+2)%4;return [0,1,2,3].map(i=>i===r||o&&i===a?n:e)}function Pu(t,e,n,o){let r=n/7,a=Math.max(0,(o+Math.SQRT2-2)*r);return Y(hi(t,e,n,o*r))+Y(hi(t+r,e+r,5*r,a))}function Iu(t,e,n,o,r=false){let a=n/7,i=s=>r?Qn(o,0,s,true):Qn(o,s,0,true);return O(t,e,n,n,i(2.5*a))+O(t+a,e+a,5*a,5*a,i(1.5*a))}function Nh(t,e,n,o){let r=n/7;return O(t,e,n,n,Qn(o,2.6*r,0,false))+O(t+r,e+r,5*r,5*r,Qn(o,1.6*r,0,false))}function Oh(t,e,n){let o=n/7,r=t+n/2,a=e+n/2;return Y(Nn(r,a,3.5*o,3.5*o,4,96))+Y(Nn(r,a,2.5*o,2.5*o,4,96))}function Dh(t,e,n){let o=n/7,r=.12*o;return hr(t,e,n,1.4*o,r)+hr(t+o,e+o,5*o,.7*o,r)}function Bh(t,e,n){let o=n/7;return gi(t,e,n,.7*o,3.9*o,o)+gi(t+o,e+o,5*o,.35*o,2.7*o,.8*o)}function Gh(t,e,n,o){let r=n/7;return O(t,e,n,n,Qn(o,.5*r,2.5*r,false))+O(t+r,e+r,5*r,5*r,Qn(o,.25*r,1.5*r,false))}function Qh(t,e,n){return O(t+n,e+n,5*n,5*n,1.5*n)}function Uh(t,e,n){return Y(Nn(t,e,3.5*n,3.5*n,2.75,96))}function Hh(t,e,n){let o=n/7;return Uh(t+n/2,e+n/2,o)+lo(t+o,e+o,5*o,5*o,.52*o)}function zh(t,e,n){let o=n/7;return pi(t,e,n,n,1.15*o)+pi(t+o,e+o,5*o,5*o,.74*o)}function Wh(t,e,n){let o=n/7;return lo(t,e,n,n,.8*o)+lo(t+o,e+o,5*o,5*o,.52*o)}function qi(t,e,n,o){let[r,a,i,s]=o,l=(u,m)=>I`${t+u} ${e+m}`,c=(u,m,f)=>u[0]==="round"?I`A${u[1]} ${u[1]} 0 0 1 ${l(m,f)}`:I`L${l(m,f)}`;return I`M${l(r[1],0)}L${l(n-a[1],0)}`+c(a,n,a[1])+I`L${l(n,n-i[1])}`+c(i,n-i[1],n)+I`L${l(s[1],n)}`+c(s,0,n-s[1])+I`L${l(0,r[1])}`+c(r,r[1],0)+"Z"}function qh(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 Vh(t,e,n,o){let r=n/7,a=o==="top-left"?0:o==="top-right"?1:3,i=(a+2)%4,[s,l]=qh(r,c=>c===a||c===i);return qi(t,e,n,s)+qi(t+r,e+r,5*r,l)}function jh(t,e,n){let o=n/7;return qi(t,e,n,[["cut",1.6*o],["cut",1.6*o],["round",3*o],["round",3*o]])+Qh(t,e,o)}function Xh(t,e,n){let o=n/7;return I`M ${t} ${e}v ${n}h ${n}v -${n}z`+I`M ${t+o} ${e+o}h ${5*o}v ${5*o}h -${5*o}z`}function Yh(t,e,n){let o=n/7,r=o*.875,a=o*.4375,i=I`M ${t+r} ${e}`+I`h ${n-2*r}`+I`a ${r} ${r} 0 0 1 ${r} ${r}`+I`v ${n-2*r}`+I`a ${r} ${r} 0 0 1 ${-r} ${r}`+I`h ${-(n-2*r)}`+I`a ${r} ${r} 0 0 1 ${-r} ${-r}`+I`v ${-(n-2*r)}`+I`a ${r} ${r} 0 0 1 ${r} ${-r}z`,s=I`M ${t+o+a} ${e+o}`+I`h ${5*o-2*a}`+I`a ${a} ${a} 0 0 1 ${a} ${a}`+I`v ${5*o-2*a}`+I`a ${a} ${a} 0 0 1 ${-a} ${a}`+I`h ${-(5*o-2*a)}`+I`a ${a} ${a} 0 0 1 ${-a} ${-a}`+I`v ${-(5*o-2*a)}`+I`a ${a} ${a} 0 0 1 ${a} ${-a}z`;return i+s}function Zh(t,e,n){let o=t+n/2,r=e+n/2,a=J(n/2),i=J(n*(2.5/7));return I`M ${o-a} ${r}`+I`a ${a} ${a} 0 1 0 ${a*2} 0`+I`a ${a} ${a} 0 1 0 ${-a*2} 0z`+I`M ${o-i} ${r}`+I`a ${i} ${i} 0 1 1 ${i*2} 0`+I`a ${i} ${i} 0 1 1 ${-i*2} 0z`}function Kh(t,e,n){let o=n/74.7002,r=s=>s*o+t,a=s=>s*o+e;return I`M${r(37.3496)} ${a(0)}C${r(39.2939)} ${a(0)} ${r(40.9948)} ${a(1.03842)} ${r(41.9287)} ${a(2.59082)}C${r(43.2293)} ${a(1.34013)} ${r(45.1347)} ${a(.780267)} ${r(47.0098)} ${a(1.28027)}C${r(48.8871)} ${a(1.78928)} ${r(50.261)} ${a(3.23767)} ${r(50.7578)} ${a(4.98438)}C${r(52.3454)} ${a(4.0996)} ${r(54.3432)} ${a(4.047)} ${r(56.0303)} ${a(5.01953)}C${r(57.7094)} ${a(5.98752)} ${r(58.6586)} ${a(7.73647)} ${r(58.6924)} ${a(9.5459)}C${r(60.4517)} ${a(9.10661)} ${r(62.3883)} ${a(9.57215)} ${r(63.7598)} ${a(10.9502)}C${r(65.1282)} ${a(12.3253)} ${r(65.5963)} ${a(14.2585)} ${r(65.1641)} ${a(16.0127)}C${r(66.974)} ${a(16.044)} ${r(68.7242)} ${a(16.9982)} ${r(69.7002)} ${a(18.6797)}C${r(70.6781)} ${a(20.3647)} ${r(70.6241)} ${a(22.3635)} ${r(69.7402)} ${a(23.9502)}C${r(71.4776)} ${a(24.4496)} ${r(72.9194)} ${a(25.8232)} ${r(73.4199)} ${a(27.7002)}C${r(73.927)} ${a(29.5707)} ${r(73.3661)} ${a(31.4794)} ${r(72.1104)} ${a(32.7822)}C${r(73.6621)} ${a(33.7163)} ${r(74.7002)} ${a(35.4166)} ${r(74.7002)} ${a(37.3604)}C${r(74.7001)} ${a(39.307)} ${r(73.6582)} ${a(41.0084)} ${r(72.1025)} ${a(41.9414)}C${r(73.357)} ${a(43.245)} ${r(73.9207)} ${a(45.1525)} ${r(73.4199)} ${a(47.0303)}C${r(72.9187)} ${a(48.9027)} ${r(71.4782)} ${a(50.2735)} ${r(69.7383)} ${a(50.7734)}C${r(70.6201)} ${a(52.3601)} ${r(70.6716)} ${a(54.3549)} ${r(69.7002)} ${a(56.04)}C${r(68.7237)} ${a(57.7225)} ${r(66.9721)} ${a(58.6729)} ${r(65.1611)} ${a(58.7031)}C${r(65.598)} ${a(60.4623)} ${r(65.131)} ${a(62.3982)} ${r(63.7598)} ${a(63.7695)}C${r(62.3847)} ${a(65.138)} ${r(60.4515)} ${a(65.6061)} ${r(58.6973)} ${a(65.1738)}C${r(58.6635)} ${a(66.9833)} ${r(57.7094)} ${a(68.7322)} ${r(56.0303)} ${a(69.7002)}C${r(54.3461)} ${a(70.6777)} ${r(52.348)} ${a(70.6248)} ${r(50.7617)} ${a(69.7422)}C${r(50.2643)} ${a(71.4831)} ${r(48.8896)} ${a(72.9284)} ${r(47.0098)} ${a(73.4297)}C${r(45.1389)} ${a(73.9368)} ${r(43.2296)} ${a(73.3763)} ${r(41.9268)} ${a(72.1201)}C${r(40.9927)} ${a(73.6717)} ${r(39.2932)} ${a(74.71)} ${r(37.3496)} ${a(74.71)}C${r(35.4051)} ${a(74.7098)} ${r(33.7042)} ${a(73.6711)} ${r(32.7705)} ${a(72.1182)}C${r(31.4697)} ${a(73.3758)} ${r(29.5597)} ${a(73.9418)} ${r(27.6797)} ${a(73.4404)}V${a(73.4502)}C${r(25.8065)} ${a(72.9422)} ${r(24.434)} ${a(71.4985)} ${r(23.9346)} ${a(69.7568)}C${r(22.3504)} ${a(70.6301)} ${r(20.3591)} ${a(70.6781)} ${r(18.6797)} ${a(69.71)}C${r(16.9957)} ${a(68.7391)} ${r(16.045)} ${a(66.9831)} ${r(16.0166)} ${a(65.168)}C${r(14.2547)} ${a(65.6091)} ${r(12.3134)} ${a(65.1435)} ${r(10.9395)} ${a(63.7695)}C${r(9.5687)} ${a(62.3919)} ${r(9.10168)} ${a(60.454)} ${r(9.53809)} ${a(58.6973)}C${r(7.72791)} ${a(58.6641)} ${r(5.97815)} ${a(57.71)} ${r(5.00977)} ${a(56.0303)}C${r(4.03552)} ${a(54.3517)} ${r(4.08377)} ${a(52.3649)} ${r(4.95801)} ${a(50.7812)}C${r(3.21705)} ${a(50.2839)} ${r(1.77087)} ${a(48.9101)} ${r(1.26953)} ${a(47.0303)}V${a(47.0205)}C${r(.762081)} ${a(45.1489)} ${r(1.32758)} ${a(43.2375)} ${r(2.58496)} ${a(41.9346)}C${r(1.03604)} ${a(41)} ${r(108484e-9)} ${a(39.3019)} ${r(0)} ${a(37.3604)}C${r(0)} ${a(35.4159)} ${r(1.03815)} ${a(33.7141)} ${r(2.59082)} ${a(32.7803)}C${r(1.34044)} ${a(31.4797)} ${r(.780389)} ${a(29.575)} ${r(1.28027)} ${a(27.7002)}C${r(1.78258)} ${a(25.8232)} ${r(3.22806)} ${a(24.4482)} ${r(4.97363)} ${a(23.9512)}C${r(4.08938)} ${a(22.3638)} ${r(4.03743)} ${a(20.3664)} ${r(5.00977)} ${a(18.6797)}C${r(5.97815)} ${a(16.9999)} ${r(7.72788)} ${a(16.0496)} ${r(9.53809)} ${a(16.0166)}C${r(9.10139)} ${a(14.2576)} ${r(9.56846)} ${a(12.3214)} ${r(10.9395)} ${a(10.9502)}C${r(12.3171)} ${a(9.57911)} ${r(14.2558)} ${a(9.11137)} ${r(16.0127)} ${a(9.54785)}C${r(16.0426)} ${a(7.73421)} ${r(16.9969)} ${a(5.97989)} ${r(18.6797)} ${a(5.00977)}C${r(20.3596)} ${a(4.03474)} ${r(22.3521)} ${a(4.08468)} ${r(23.9365)} ${a(4.96094)}C${r(24.4378)} ${a(3.22749)} ${r(25.8059)} ${a(1.7898)} ${r(27.6797)} ${a(1.29004)}C${r(29.5511)} ${a(.78264)} ${r(31.4617)} ${a(1.34357)} ${r(32.7646)} ${a(2.60059)}C${r(33.6971)} ${a(1.04268)} ${r(35.4013)} ${a(152405e-9)} ${r(37.3496)} ${a(0)}ZM${r(41.0615)} ${a(9.17578)}C${r(40.1006)} ${a(10.1057)} ${r(38.793)} ${a(10.6797)} ${r(37.3496)} ${a(10.6797)}C${r(35.9064)} ${a(10.6796)} ${r(34.5985)} ${a(10.1066)} ${r(33.6377)} ${a(9.17676)}C${r(32.9511)} ${a(10.3241)} ${r(31.8358)} ${a(11.2176)} ${r(30.4404)} ${a(11.5898)}C${r(29.0527)} ${a(11.9661)} ${r(27.6436)} ${a(11.7542)} ${r(26.4766)} ${a(11.1074)}C${r(26.1072)} ${a(12.3879)} ${r(25.2629)} ${a(13.5333)} ${r(24.0195)} ${a(14.25)}C${r(22.7695)} ${a(14.9754)} ${r(21.347)} ${a(15.1322)} ${r(20.0479)} ${a(14.8047)}C${r(20.0289)} ${a(16.1454)} ${r(19.5108)} ${a(17.4793)} ${r(18.4902)} ${a(18.5)}C${r(17.4696)} ${a(19.5158)} ${r(16.1409)} ${a(20.033)} ${r(14.8066)} ${a(20.0566)}C${r(15.1312)} ${a(21.3534)} ${r(14.9738)} ${a(22.7723)} ${r(14.25)} ${a(24.0195)}C${r(13.5243)} ${a(25.2699)} ${r(12.3701)} ${a(26.1148)} ${r(11.082)} ${a(26.4795)}C${r(11.7347)} ${a(27.6479)} ${r(11.9529)} ${a(29.062)} ${r(11.5801)} ${a(30.46)}C${r(11.2085)} ${a(31.8485)} ${r(10.3194)} ${a(32.9607)} ${r(9.17578)} ${a(33.6475)}C${r(10.106)} ${a(34.6084)} ${r(10.6797)} ${a(35.9167)} ${r(10.6797)} ${a(37.3604)}C${r(10.6796)} ${a(38.805)} ${r(10.1053)} ${a(40.1141)} ${r(9.17383)} ${a(41.0752)}C${r(10.3132)} ${a(41.7614)} ${r(11.1999)} ${a(42.871)} ${r(11.5703)} ${a(44.2598)}C${r(11.946)} ${a(45.6504)} ${r(11.7335)} ${a(47.0592)} ${r(11.0889)} ${a(48.2266)}C${r(12.377)} ${a(48.593)} ${r(13.5297)} ${a(49.441)} ${r(14.25)} ${a(50.6904)}C${r(14.9754)} ${a(51.9405)} ${r(15.1322)} ${a(53.3629)} ${r(14.8047)} ${a(54.6621)}C${r(16.142)} ${a(54.6835)} ${r(17.4721)} ${a(55.2016)} ${r(18.4902)} ${a(56.2197)}C${r(19.5097)} ${a(57.2441)} ${r(20.0278)} ${a(58.5787)} ${r(20.0479)} ${a(59.918)}C${r(21.3469)} ${a(59.5917)} ${r(22.7696)} ${a(59.7493)} ${r(24.0195)} ${a(60.4697)}C${r(25.2676)} ${a(61.1892)} ${r(26.1117)} ${a(62.3406)} ${r(26.4775)} ${a(63.627)}C${r(27.6424)} ${a(62.9822)} ${r(29.0498)} ${a(62.7688)} ${r(30.4404)} ${a(63.1396)}C${r(31.8284)} ${a(63.5112)} ${r(32.9402)} ${a(64.3999)} ${r(33.627)} ${a(65.543)}C${r(34.5887)} ${a(64.6072)} ${r(35.9012)} ${a(64.0304)} ${r(37.3496)} ${a(64.0303)}C${r(38.7912)} ${a(64.0303)} ${r(40.098)} ${a(64.6023)} ${r(41.0586)} ${a(65.5303)}C${r(41.7458)} ${a(64.3887)} ${r(42.8594)} ${a(63.5007)} ${r(44.25)} ${a(63.1299)}C${r(45.643)} ${a(62.7522)} ${r(47.057)} ${a(62.9676)} ${r(48.2266)} ${a(63.6201)}C${r(48.5931)} ${a(62.3323)} ${r(49.4413)} ${a(61.1801)} ${r(50.6904)} ${a(60.46)}C${r(51.9373)} ${a(59.7364)} ${r(53.3558)} ${a(59.5781)} ${r(54.6523)} ${a(59.9023)}C${r(54.6744)} ${a(58.5659)} ${r(55.1925)} ${a(57.2372)} ${r(56.21)} ${a(56.2197)}C${r(57.2339)} ${a(55.2007)} ${r(58.5676)} ${a(54.6816)} ${r(59.9062)} ${a(54.6611)}C${r(59.5835)} ${a(53.3649)} ${r(59.7414)} ${a(51.9468)} ${r(60.46)} ${a(50.7002)}C${r(61.1797)} ${a(49.4517)} ${r(62.3312)} ${a(48.6068)} ${r(63.6182)} ${a(48.2412)}C${r(62.9651)} ${a(47.0726)} ${r(62.7473)} ${a(45.658)} ${r(63.1201)} ${a(44.2598)}C${r(63.4916)} ${a(42.8718)} ${r(64.3794)} ${a(41.7591)} ${r(65.5225)} ${a(41.0723)}C${r(64.5929)} ${a(40.1115)} ${r(64.0206)} ${a(38.8033)} ${r(64.0205)} ${a(37.3604)}C${r(64.0205)} ${a(35.9186)} ${r(64.5915)} ${a(34.611)} ${r(65.5195)} ${a(33.6504)}C${r(64.3785)} ${a(32.9631)} ${r(63.4908)} ${a(31.8501)} ${r(63.1201)} ${a(30.46)}C${r(62.7421)} ${a(29.0656)} ${r(62.9572)} ${a(27.6498)} ${r(63.6113)} ${a(26.4795)}C${r(62.3272)} ${a(26.1115)} ${r(61.1784)} ${a(25.2657)} ${r(60.46)} ${a(24.0195)}C${r(59.7364)} ${a(22.7727)} ${r(59.5781)} ${a(21.3541)} ${r(59.9023)} ${a(20.0576)}C${r(58.5626)} ${a(20.038)} ${r(57.23)} ${a(19.52)} ${r(56.21)} ${a(18.5)}C${r(55.1931)} ${a(17.4783)} ${r(54.675)} ${a(16.1482)} ${r(54.6523)} ${a(14.8125)}C${r(53.3557)} ${a(15.1357)} ${r(51.9374)} ${a(14.9785)} ${r(50.6904)} ${a(14.2598)}C${r(49.4399)} ${a(13.5339)} ${r(48.5931)} ${a(12.3801)} ${r(48.2285)} ${a(11.0918)}C${r(47.0603)} ${a(11.7439)} ${r(45.6474)} ${a(11.9624)} ${r(44.25)} ${a(11.5898)}V${a(11.5801)}C${r(42.8613)} ${a(11.2085)} ${r(41.7483)} ${a(10.3196)} ${r(41.0615)} ${a(9.17578)}Z`}function Vi(t){let e=t/70;return {scale:e,transform:(o,r)=>(o-5)*e+r}}function Jh(t,e,n){let{scale:o,transform:r}=Vi(n);return I`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 tp(t,e,n){let o=n/7,r=o*1.5,a=o*.75,i=I`M ${t+r} ${e}`+I`h ${n-2*r}`+I`a ${r} ${r} 0 0 1 ${r} ${r}`+I`v ${n-2*r}`+I`a ${r} ${r} 0 0 1 ${-r} ${r}`+I`h ${-(n-2*r)}`+I`a ${r} ${r} 0 0 1 ${-r} ${-r}`+I`v ${-(n-2*r)}`+I`a ${r} ${r} 0 0 1 ${r} ${-r}z`,s=I`M ${t+o+a} ${e+o}`+I`h ${5*o-2*a}`+I`a ${a} ${a} 0 0 1 ${a} ${a}`+I`v ${5*o-2*a}`+I`a ${a} ${a} 0 0 1 ${-a} ${a}`+I`h ${-(5*o-2*a)}`+I`a ${a} ${a} 0 0 1 ${-a} ${-a}`+I`v ${-(5*o-2*a)}`+I`a ${a} ${a} 0 0 1 ${a} ${-a}z`;return i+s}function ep(t,e,n){let{scale:o,transform:r}=Vi(n);return I`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 np(t,e,n){let{scale:o,transform:r}=Vi(n);return I`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 rp(t,e,n){let o=n/70,r=t+n/2-40*o,a=e+n/2-40*o,i=(l,c)=>l*o+c;return I`M${i(35.19239999999999,r)} ${i(5.837547376725838,a)}C${i(37.69667692307692,r)} ${i(3.8737070690335305,a)}, ${i(41.218430769230764,r)} ${i(3.8737092228796843,a)}, ${i(43.722707692307694,r)} ${i(5.837547376725838,a)}L${i(46.62781538461539,r)} ${i(8.115648915187375,a)}L${i(50.23356923076923,r)} ${i(7.32361506903353,a)}C${i(53.342,r)} ${i(6.640824299802762,a)}, ${i(56.51483076923077,r)} ${i(8.168784299802759,a)}, ${i(57.91892307692308,r)} ${i(11.024719684418145,a)}L${i(59.54787692307692,r)} ${i(14.337679684418145,a)}L${i(63.14027692307692,r)} ${i(15.188578145956608,a)}C${i(66.23707692307693,r)} ${i(15.922091992110452,a)}, ${i(68.43270769230769,r)} ${i(18.675396607495067,a)}, ${i(68.45876923076924,r)} ${i(21.857768915187375,a)}L${i(68.48892307692307,r)} ${i(25.54931045364891,a)}L${i(71.35633846153846,r)} ${i(27.874602761341222,a)}C${i(73.82830769230769,r)} ${i(29.879187376725838,a)}, ${i(74.61187692307692,r)} ${i(33.312418145956606,a)}, ${i(73.25452307692306,r)} ${i(36.19103353057199,a)}L${i(71.68006153846153,r)} ${i(39.530141222879685,a)}L${i(73.25452307692306,r)} ${i(42.86924891518738,a)}C${i(74.61187692307692,r)} ${i(45.747864299802764,a)}, ${i(73.82830769230769,r)} ${i(49.18109506903353,a)}, ${i(71.35633846153846,r)} ${i(51.18567968441815,a)}L${i(68.48892307692307,r)} ${i(53.510971992110456,a)}L${i(68.45876923076924,r)} ${i(57.202664299802755,a)}C${i(68.43270769230769,r)} ${i(60.38497199211046,a)}, ${i(66.23707692307693,r)} ${i(63.13823353057199,a)}, ${i(63.14027692307692,r)} ${i(63.871833530572,a)}L${i(59.54787692307692,r)} ${i(64.72260276134121,a)}L${i(57.91892307692308,r)} ${i(68.03564891518737,a)}C${i(56.51483076923077,r)} ${i(70.89164891518737,a)}, ${i(53.342,r)} ${i(72.41958737672583,a)}, ${i(50.23356923076923,r)} ${i(71.7368181459566,a)}L${i(46.62781538461539,r)} ${i(70.94463353057199,a)}L${i(43.722707692307694,r)} ${i(73.22275660749506,a)}C${i(41.218430769230764,r)} ${i(75.18663353057198,a)}, ${i(37.69667692307692,r)} ${i(75.18663353057198,a)}, ${i(35.19239999999999,r)} ${i(73.22275660749506,a)}L${i(32.28729230769231,r)} ${i(70.94463353057199,a)}L${i(28.68153846153846,r)} ${i(71.7368181459566,a)}C${i(25.573215384615384,r)} ${i(72.41958737672583,a)}, ${i(22.400384615384613,r)} ${i(70.89164891518737,a)}, ${i(20.996141538461536,r)} ${i(68.03564891518737,a)}L${i(19.36720923076923,r)} ${i(64.72260276134121,a)}L${i(15.774852307692306,r)} ${i(63.871833530572,a)}C${i(12.67803076923077,r)} ${i(63.13823353057199,a)}, ${i(10.48237846153846,r)} ${i(60.38497199211046,a)}, ${i(10.45636,r)} ${i(57.202664299802755,a)}L${i(10.426163076923077,r)} ${i(53.510971992110456,a)}L${i(7.558747692307692,r)} ${i(51.18567968441815,a)}C${i(5.086880338461539,r)} ${i(49.18109506903353,a)}, ${i(4.303258769230769,r)} ${i(45.747864299802764,a)}, ${i(5.660599692307692,r)} ${i(42.86924891518738,a)}L${i(7.235153846153846,r)} ${i(39.530141222879685,a)}L${i(5.660599692307692,r)} ${i(36.19103353057199,a)}C${i(4.3032566153846155,r)} ${i(33.312418145956606,a)}, ${i(5.086885938461538,r)} ${i(29.879187376725838,a)}, ${i(7.558747692307692,r)} ${i(27.874602761341222,a)}L${i(10.426163076923077,r)} ${i(25.54931045364891,a)}L${i(10.45636,r)} ${i(21.857768915187375,a)}C${i(10.48237846153846,r)} ${i(18.67537506903353,a)}, ${i(12.678052307692308,r)} ${i(15.922091992110452,a)}, ${i(15.774852307692306,r)} ${i(15.188578145956608,a)}L${i(19.36720923076923,r)} ${i(14.337679684418145,a)}L${i(20.996141538461536,r)} ${i(11.024719684418145,a)}C${i(22.400384615384613,r)} ${i(8.168784299802759,a)}, ${i(25.573215384615384,r)} ${i(6.640824299802762,a)}, ${i(28.68153846153846,r)} ${i(7.32361506903353,a)}L${i(32.28729230769231,r)} ${i(8.115648915187375,a)}L${i(35.19239999999999,r)} ${i(5.837547376725838,a)}M${i(39.45766153846154,r)} ${i(13.665055069033532,a)}L${i(37.01498461538461,r)} ${i(15.58053506903353,a)}C${i(35.39098461538461,r)} ${i(16.854061222879682,a)}, ${i(33.282799999999995,r)} ${i(17.335251992110454,a)}, ${i(31.26701538461538,r)} ${i(16.892464299802757,a)}L${i(28.235046153846152,r)} ${i(16.22649506903353,a)}L${i(26.865415384615382,r)} ${i(19.012107376725837,a)}C${i(25.954812307692308,r)} ${i(20.864178145956608,a)}, ${i(24.264193846153844,r)} ${i(22.212399684418145,a)}, ${i(22.255926153846154,r)} ${i(22.688076607495066,a)}L${i(19.235393846153844,r)} ${i(23.40354122287968,a)}L${i(19.21,r)} ${i(26.507556607495065,a)}C${i(19.19313538461538,r)} ${i(28.57137199211045,a)}, ${i(18.25492,r)} ${i(30.519525838264297,a)}, ${i(16.651919999999997,r)} ${i(31.81937199211045,a)}L${i(14.240926153846154,r)} ${i(33.774633530572,a)}L${i(15.564830769230769,r)} ${i(36.58238737672584,a)}C${i(16.445064615384617,r)} ${i(38.44891045364892,a)}, ${i(16.445064615384617,r)} ${i(40.611371992110456,a)}, ${i(15.564830769230769,r)} ${i(42.47811045364892,a)}L${i(14.240926153846154,r)} ${i(45.28564891518738,a)}L${i(16.651919999999997,r)} ${i(47.240910453648915,a)}L${i(13.883236923076923,r)} ${i(50.654971992110454,a)}L${i(16.651919999999997,r)} ${i(47.240910453648915,a)}C${i(18.25492,r)} ${i(48.54075660749507,a)}, ${i(19.19313538461538,r)} ${i(50.4891258382643,a)}, ${i(19.21,r)} ${i(52.5527258382643,a)}L${i(19.235393846153844,r)} ${i(55.65684891518738,a)}L${i(22.255926153846154,r)} ${i(56.37235660749507,a)}C${i(24.264193846153844,r)} ${i(56.847925838264295,a)}, ${i(25.954812307692308,r)} ${i(58.196233530571995,a)}, ${i(26.865415384615382,r)} ${i(60.0483258382643,a)}L${i(28.235046153846152,r)} ${i(62.833895069033524,a)}L${i(31.26701538461538,r)} ${i(62.1679258382643,a)}C${i(33.282799999999995,r)} ${i(61.72509506903353,a)}, ${i(35.39098461538461,r)} ${i(62.20626429980276,a)}, ${i(37.01498461538461,r)} ${i(63.47983353057199,a)}L${i(39.45766153846154,r)} ${i(65.39524891518737,a)}L${i(41.90012307692308,r)} ${i(63.47983353057199,a)}C${i(43.524123076923075,r)} ${i(62.20626429980276,a)}, ${i(45.632307692307684,r)} ${i(61.72509506903353,a)}, ${i(47.6480923076923,r)} ${i(62.1679258382643,a)}L${i(50.68006153846154,r)} ${i(62.833895069033524,a)}L${i(52.049692307692304,r)} ${i(60.0483258382643,a)}C${i(52.960338461538456,r)} ${i(58.196233530571995,a)}, ${i(54.6508923076923,r)} ${i(56.847925838264295,a)}, ${i(56.65913846153846,r)} ${i(56.37235660749507,a)}L${i(59.67969230769231,r)} ${i(55.65684891518738,a)}L${i(59.70510769230769,r)} ${i(52.5527258382643,a)}C${i(59.72190769230769,r)} ${i(50.4891258382643,a)}, ${i(60.66012307692307,r)} ${i(48.54075660749507,a)}, ${i(62.263230769230766,r)} ${i(47.240910453648915,a)}L${i(64.67424615384616,r)} ${i(45.28564891518738,a)}L${i(63.35027692307692,r)} ${i(42.47811045364892,a)}C${i(62.47,r)} ${i(40.611371992110456,a)}, ${i(62.47,r)} ${i(38.44891045364892,a)}, ${i(63.35027692307692,r)} ${i(36.58238737672584,a)}L${i(64.67424615384616,r)} ${i(33.774633530572,a)}L${i(62.263230769230766,r)} ${i(31.81958737672584,a)}C${i(60.66012307692307,r)} ${i(30.519525838264297,a)}, ${i(59.72190769230769,r)} ${i(28.57137199211045,a)}, ${i(59.70510769230769,r)} ${i(26.507556607495065,a)}L${i(59.67969230769231,r)} ${i(23.40354122287968,a)}L${i(56.65913846153846,r)} ${i(22.688076607495066,a)}C${i(54.6508923076923,r)} ${i(22.212399684418145,a)}, ${i(52.960338461538456,r)} ${i(20.864178145956608,a)}, ${i(52.049692307692304,r)} ${i(19.012128915187375,a)}L${i(50.68006153846154,r)} ${i(16.22649506903353,a)}L${i(47.6480923076923,r)} ${i(16.892464299802757,a)}C${i(45.632307692307684,r)} ${i(17.335251992110454,a)}, ${i(43.524338461538456,r)} ${i(16.85408276134122,a)}, ${i(41.90012307692308,r)} ${i(15.58053506903353,a)}L${i(39.45766153846154,r)} ${i(13.665055069033532,a)}Z`}function Mo(t,e,n,o,r="top-left"){switch(o){case "leaf":return Iu(t,e,n,r);case "leaf-reverse":return Iu(t,e,n,r,true);case "drop":return Nh(t,e,n,r);case "octagon":return Pu(t,e,n,1.6);case "bevel":return Pu(t,e,n,1.1);case "squircle":return Oh(t,e,n);case "cushion":return Dh(t,e,n);case "shield":return Bh(t,e,n);case "petal":return Gh(t,e,n,r);case "porthole":return Hh(t,e,n);case "notch":return zh(t,e,n);case "plus":return Wh(t,e,n);case "bud":return Vh(t,e,n,r);case "bowl":return jh(t,e,n);case "gear":return Kh(t,e,n);case "rounded":return Yh(t,e,n);case "circle":return Zh(t,e,n);case "diya":return Jh(t,e,n);case "extra-rounded":return tp(t,e,n);case "message":return ep(t,e,n);case "pointy":return np(t,e,n);case "curly":return rp(t,e,n);default:return Xh(t,e,n)}}var vu={diamond:["square","rounded","diya","extra-rounded","message","pointy","leaf","leaf-reverse","drop","bevel","squircle","cushion","shield","petal"],banner:["square","rounded","diya","leaf"],square:["curly"],diya:["curly"],message:["curly"]},Lu={diamond:["square"],pacman:["rounded"],"small-square":["square","rounded"]},Tu=["circle","curly"],ku=["diamond","banner","star"],Fu={circle:["square","rounded","diya","extra-rounded","message","pointy","leaf","leaf-reverse","drop","bevel","squircle","cushion","shield","petal"]},jt=["square","liquid","classy","classy-rounded"],Nu={"circle/rounded":jt,"circle/extra-rounded":jt,"circle/message":[...jt,"leaf"],"circle/pointy":jt,"circle/leaf-reverse":jt,"circle/drop":jt,"circle/bevel":[...jt,"leaf"],"circle/squircle":[...jt,"circle","diamond","circle-mixed","rounded","horizontal-line","leaf","heart","mosaic","octagon"],"circle/cushion":jt,"circle/shield":[...jt,"rounded","horizontal-line","leaf"],"circle/petal":jt};function Ou(t,e,n){return (Fu[t]?.includes(e)??false)&&!Nu[`${t}/${e}`]?.includes(n)}function ji(t){let e=Qt(rr,t.bodyPattern??"circle"),n=Qt(De,t.cornerEyePattern??"gear"),o=Qt(Be,t.cornerEyeDotPattern??"circle");return vu[o]?.includes(n)?{kind:"dot-eye",message:`${o} centres in ${n} eyes are missed by strict decoders`,fix:"Pick a square, rounded or circle centre, or another eye shape"}:Lu[e]?.includes(n)?{kind:"body-eye",message:`${e} dots next to ${n} eyes are missed up close`,fix:"Pick a fuller dot shape or another eye shape"}:ku.includes(o)?{kind:"dot",message:`${o} centres are missed in sharp renders and up close`,fix:"Pick a square, rounded or circle centre"}:Tu.includes(n)?{kind:"eye",message:`${n} eyes only read in lenient decoders`,fix:"Pick square, rounded or gear eyes"}:Ou(o,n,e)?{kind:"sharp-dot-eye",message:`${o} centres in ${n} eyes are missed by some decoders on screens and in sharp prints`,fix:"Pick a rounded centre, or gear or octagon eyes"}:null}var Xi=t=>{let e=t/255;return e<=.04045?e/12.92:((e+.055)/1.055)**2.4},op=t=>255*(t<=.0031308?12.92*t:1.055*t**.4166666666666667-.055);function Gu({r:t,g:e,b:n}){let o=Xi(t),r=Xi(e),a=Xi(n),i=Math.cbrt(.4122214708*o+.5363325363*r+.0514459929*a),s=Math.cbrt(.2119034982*o+.6806995451*r+.1073969566*a),l=Math.cbrt(.0883024619*o+.2817188376*r+.6299787005*a),c=1.9779984951*i-2.428592205*s+.4505937099*l,u=.0259040371*i+.7827717662*s-.808675766*l;return {l:.2104542553*i+.793617785*s-.0040720468*l,c:Math.hypot(c,u),h:Math.atan2(u,c)}}function Yi({l:t,c:e,h:n}){let o=e*Math.cos(n),r=e*Math.sin(n),a=(t+.3963377774*o+.2158037573*r)**3,i=(t-.1055613458*o-.0638541728*r)**3,s=(t-.0894841775*o-1.291485548*r)**3;return [4.0767416621*a-3.3077115913*i+.2309699292*s,-1.2684380046*a+2.6097574011*i-.3413193965*s,-0.0041960863*a-.7034186147*i+1.707614701*s]}var Du=1e-7,Bu=t=>t.every(e=>e>=-Du&&e<=1+Du),ap=20;function Eo(t){let e=Yi(t);if(!Bu(e)){let a=0,i=t.c;for(let s=0;s<ap;s++){let l=(a+i)/2;Bu(Yi({...t,c:l}))?a=l:i=l;}e=Yi({...t,c:a});}let[n=0,o=0,r=0]=e.map(a=>Math.round(op(Math.min(1,Math.max(0,a)))));return {r:n,g:o,b:r,a:1}}var Uu="gear",ip="circle";function re(t,e){let n=t.eyeShapes?.[e];return {outer:Qt(De,n?.outer??t.cornerEyePattern??Uu),inner:Qt(Be,n?.inner??t.cornerEyeDotPattern??ip)}}var sp=["curly","circle"];function ts(t){let e=Qe.map(n=>re(t,n));for(let n of sp)if(e.some(o=>o.outer===n))return n;return e[0]?.outer??Uu}var Qu=["dot-eye","body-eye","dot","sharp-dot-eye","eye"];function es(t){let e=null,n=new Set;for(let o of Qe){let{outer:r,inner:a}=re(t,o),i=`${r}/${a}`;if(n.has(i))continue;n.add(i);let s=ji({bodyPattern:t.bodyPattern,cornerEyePattern:r,cornerEyeDotPattern:a});s&&(!e||Qu.indexOf(s.kind)<Qu.indexOf(e.kind))&&(e=s);}return e}function Hn(t,e,n,o){if(!(t&&Number.isFinite(t))||t<=0||wr(o)||n<=0)return 0;let r=Math.min(Yr,Qa*n/(e+2*n));return Math.min(t,r)}function lp(t){let{value:e,level:n,shape:o,autoLevel:r,isOGContext:a}=t,i=t.size??it,s=t.margin??pt,l=zn({value:`${e}`,size:i,margin:s,level:n,shape:o,autoLevel:r,isOGContext:a},t.imageSettings),c=At({value:`${e}`,size:i,level:n,margin:s,imageSettings:l,isOGContext:a,autoLevel:r,shape:o}),u=dt.QrCode.encodeText(`${e}`,St[c]).size;return Hn(Yr,u,s,o)}var Ji=(t,e,n,o)=>Math.min(o,Math.max(n,typeof t=="number"&&Number.isFinite(t)?t:e)),cp=/^hsla?\(([^)]*)\)$/,up=/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:deg)?$/,mp=/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)%?$/;function Zi(t,e){let n=t?.trim()??"";if(!mp.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 dp(t){let e=cp.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[a="",i,s,l]=r,c=Zi(i,true),u=Zi(s,true),m=Zi(o??l??"1",false),f=Number.parseFloat(a);if(!(up.test(a)&&[c,u,m].every(Number.isFinite)))return null;let d=c*Math.min(u,1-u),g=h=>{let p=(h+f/30)%12,b=p<0?p+12:p;return 255*(u-d*Math.max(-1,Math.min(b-3,9-b,1)))};return {r:g(0),g:g(8),b:g(4),a:m}}function vo(t){let e=t?.trim().toLowerCase()??"";return e==="none"?{r:0,g:0,b:0,a:0}:at(e)??dp(e)}function Ao(t){return vo(t)?.a??1}function Hu(t){let e=Tt(t,ft);return e.type==="solid"?Ao(e.color)<1:e.type==="image"?Ao(e.underlay??"transparent")<1:e.stops.some(n=>Ao(n.color)<1)}var Un=({r:t,g:e,b:n})=>[.2126*t+.7152*e+.0722*n,.299*t+.587*e+.114*n],Io=Un(at(Ue)),rn=1e-9,Po=(t,e,n)=>t.every((o,r)=>o>=e[r]-rn&&o<=n[r]+rn),ns=({r:t,g:e,b:n})=>`#${[t,e,n].map(o=>Math.round(o).toString(16).padStart(2,"0")).join("")}`;function zu(t){let e=vo(t.color||Zr);return e&&e.a>0?ns(e):Zr}var fp=24,hp=12;function Wu(t,e,n){if(Po(Un(t),e,n))return t;if(t.r===t.g&&t.g===t.b){let c=Math.min(Math.floor(Math.min(...n)+rn),Math.max(t.r,Math.ceil(Math.max(...e)-rn)));return c>=Math.max(...e)-rn?{r:c,g:c,b:c,a:1}:null}let o=Gu(t),r=c=>{let u=Eo({l:o.l,c,h:o.h}),m=Un(u);if(Po(m,e,n))return u;let f=m.some((b,_)=>b<e[_]),d=b=>Un(b).every((_,y)=>f?_>=e[y]-rn:_<=n[y]+rn),g=o.l,h=f?1:0;for(let b=0;b<fp;b++){let _=(g+h)/2;d(Eo({l:_,c,h:o.h}))?h=_:g=_;}let p=Eo({l:h,c,h:o.h});return Po(Un(p),e,n)?p:null},a=r(o.c);if(a)return a;let i=r(0);if(!i)return null;let s=0,l=o.c;for(let c=0;c<hp;c++){let u=(s+l)/2,m=r(u);m?(s=u,i=m):l=u;}return i}var Ki="or turn the halo off";function qu(t){let e=Tt(t,ft);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, ${Ki}`};if(Hu(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, ${Ki}`};let n=(e.type==="solid"?[e.color]:e.stops.map(r=>r.color)).map(vo),o=[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY];for(let r of n){let a=r?Un(r):[0,0];o[0]=Math.min(o[0],a[0]),o[1]=Math.min(o[1],a[1]);}return Po(Io,Io,o)?o:{reason:"dark-background",message:`A halo needs a light background, at least as light as ${Ue}: on a darker one the rim makes the code unreadable`,fix:`Lighten the background to ${Ue} or lighter, ${Ki}`}}function rs(t,e){let n=qu(e);if(!Array.isArray(n))return n;let o=zu(t),r=Wu(at(o),Io,n);return {drawn:r?ns(r):Ue,picked:o}}function pp(t,e){let n=rs({color:t},e);return "drawn"in n?n.drawn:null}function gp(t,e,n=4){let o=qu(e),r=vo(t);if(!(Array.isArray(o)&&r))return [];let a=new Set;for(let i=0;i<n;i++){let s=i/n,l=Io.map((u,m)=>u+s*((o[m]??u)-u)),c=Wu({...r,a:1},l,o);c&&a.add(ns(c));}return [...a]}function os(t){if(!t.halo)return null;let e=rs(t.halo,t.bgColor);return "drawn"in e?e.drawn===e.picked?null:{reason:"adjusted",color:e.drawn,message:`Halo drawn as ${e.drawn} instead of ${e.picked} so the code still scans: a rim must read no lighter than the background and at least as light as ${Ue}`,fix:`To have it drawn as picked, choose a color in that range, such as ${e.drawn}`}:e}function Mr(t,e){if(!t)return null;let n=e?rs(t,e.bgColor):null;if(n&&!("drawn"in n))return null;let o=Ji(t.width,za,Ua,Ha);return {color:n?n.drawn:zu(t),width:o}}function as(t){if(!t)return null;let e=r=>Ji(r,Wa,-Kr,Kr),n=e(t.dx),o=e(t.dy);return n===0&&o===0?null:{color:t.color||Xa,opacity:Ji(t.opacity,ja,qa,Va),dx:n,dy:o}}var is="data-qrdx-part",Vu="data-qrdx-eye",bp=["eye-outer","eye-centre","body","logo","background"];function ss(t,e,n){if(t)return n?{[is]:e,[Vu]:n}:{[is]:e}}var Er=300;function oe(t){return {id:t.id,name:t.name,description:t.description,spec:t.spec,wrapper:(e,n)=>{let o=je(t.spec),r=n?.fgColor,a=(typeof r=="string"?r:_t(r,""))||"black",i=_r(o.qr.size,o,{color:a}),{x:s,y:l,scale:c}=t.at;return A("svg",{height:Er,id:"svgQrWrapper",style:{width:"100%",height:"100%"},viewBox:`0 0 ${Er} ${Er}`,width:Er,xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",children:$t("g",{"data-qrdx-template":t.id,transform:`translate(${x(s)} ${x(l)})${c===1?"":` scale(${c})`}`,children:[Lc(i),A("g",{fill:"none",transform:`translate(${x(i.qrX)} ${x(i.qrY)}) scale(${i.qrSize/Er})`,children:e})]})})}}}var ju={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 Xu=oe({id:"Arrow",name:"Arrow",description:"QR code with arrow",spec:ju,at:{x:47,y:95,scale:1}});var Yu={id:"default",name:"Default",description:"Simple QR code without decorative elements",wrapper:t=>A("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:A("g",{fill:"none",transform:"translate(9, 9) scale(0.95)",children:t})})};var Pr=593,Ee=296.5,Ar=146.5,n0=294.5,r0=231.228,o0="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",yp="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",xp="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",Zu="3cf27f17c00j3ch21n1ek00l1el3cj1vv1kd00n3cl3cn1q31q500p3cp1vx00r1kb3cs3aw1ej21p00t3ax3ay17b27h00w3b02g20yq01w2d611m01x3b52aa14i01y24i1bq0203bd3be1q21q60253bf39e39f39h14e2ae02d39j11i2da02e39l0ym02f39n2lt0sz03a39p2ix0vv03b39r2d511n39t03d27d17f03f39x39y21l1en03h3a03a11vt1kf03j37w37x1q11q703l37z1k903n1vz3821eh03p21r38714d03t11h03u2db38a0vp2j303w2lz38g03x0st2rk0n804o38l2oo0q404p38n2iw0vw04r36f36h2a814k04u36k36l1vs1kg04z36o36p1n41t405236q36x36y0ss2m005d3720n02rs05f3742uf0kd0633763772on0q506537834y2fz0yt06834z2d311p06935235424f1bt06c35621j1ep06d3581yn1hl06e35a1sv1nd06g35b1pz1q906h35d35e35g1ef21t06l35h1bj24p06m35k35l11f2dd06q35n0vn2j506s35p35q0pv2ox06u35s0mz2rt06v35t33h0k32up06w2x90hi08y2ud0ke08z33r2lp0t20922fx0yu0942a514m09624d1bu0983441yl1hm09a1vp1ki09b1px1qa09d34e1n11t609e1h91yy09g1ed21u09h1a227m0831492ai09l0yh2ga09n0sp2m209p0pt2oy09q0k12uq09s2xo0h52z209t31k0en0bt2780c319z0az0e831z0cq",Ku=52,$p=240;function Ju(t){let e=0;return t.split(" ").map(n=>(e+=Number.parseInt(n,36),e/1e4))}var ls;function Sp(){if(!ls){let t=Ju(yp),e=Ju(xp),n=[];for(let o=0;o<Zu.length;o+=3){let r=Number.parseInt(Zu.slice(o,o+3),36);n.push({cx:t[Math.floor(r/Ku)],cy:e[r%Ku]});}ls=n;}return ls}function wp(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 a0(t){let e=Sp(),n=wp(t),o=()=>(n=(n*9301+49297)%233280,n/233280),r=e.map((a,i)=>i);for(let a=r.length-1;a>0;a--){let i=Math.floor(o()*(a+1));[r[a],r[i]]=[r[i],r[a]];}return r.slice(0,$p).sort((a,i)=>a-i).map(a=>e[a])}var t0=300,Cp=49,Rp=6;function i0(t,e){if(t0/e<=Cp+.5)return t;let n=Ar,o=Ar+t0,r=Rp*e+e/2;return t.filter(({cx:a,cy:i})=>Math.max(n-a,a-o,n-i,i-o)>=r)}var s0="Scan the QR code * Scan the QR code * Scan the QR code * Scan the QR code *",Ir=32,l0=3.5,Mp=Ir*or,c0=246.5,fe=2*Math.PI*c0,ms=.36,e0=c0+ms*Ir,cs=400;function Wn(t,e){return t===" "||/[il1|!']/.test(t)?e*.3:/[mwMW@%&]/.test(t)?e*.8:e*.6}function Ep(t){let e=t.slice(0,cs).split(" ").map(n=>Pn(n,cs)).join(" ");return Array.from(e).slice(0,cs)}var Ap="\u2026",u0=1;function m0(t,e,n,o=false){return o&&e===t.length-1?u0*n:Wn(t[e],n)}function ds(t,e,n=false){let o=0;for(let r=0;r<t.length;r++)o+=m0(t,r,e,n);return o}function us(t,e,n,o=false){return ds(t,e,o)+n*Math.max(0,t.length-1)+Wn(" ",e)+2*n<=fe}var d0=t=>t.join("").split(" ").filter(Boolean),Pp=(t,e)=>Array.from(Array.from({length:e},()=>t.join(" ")).join(" "));function f0(t,e,n){if(us(t,e,n))return {chars:t,fontSize:e,letterSpacing:n};let o=Math.min(n,0),r=Math.min(e,Mp),a=(h,p=false)=>{let b=ds(h,e,p)+Wn(" ",e),_=h.length+1,y=(fe-b)/_;if(y>=o)return {chars:h,fontSize:e,letterSpacing:y,cut:p};let w=(fe-o*_)/b*e;return w>=r?{chars:h,fontSize:w,letterSpacing:o,cut:p}:null},i=a(t);if(i)return i;let s=d0(t),l=h0(s);for(let h=s.length/l.length-1;h>=1;h--){let p=Pp(l,h);if(us(p,r,o))return a(p)??{chars:p,fontSize:r,letterSpacing:o}}let c=fe-Wn(" ",r)-u0*r-2*o,u=0,m=0,f=0;for(let[h,p]of t.entries()){if(u+=Wn(p,r)+o,u>c)break;f=h+1,(f===t.length||t[f]===" ")&&(m=f);}let d=[...Ip(t.slice(0,m>0?m:f)),Ap];return (us(d,e,n,true)?{chars:d,fontSize:e,letterSpacing:n,cut:true}:null)??a(d,true)??{chars:d,fontSize:r,letterSpacing:o,cut:true}}function Ip(t){let e=t.length;for(;e>0&&/[\s.,;:!?*·•\-–—]/u.test(t[e-1]);)e--;return t.slice(0,e)}function h0(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 vp(t,e,n){let o=d0(t);if(o.length===0)return {chars:[],fontSize:e,letterSpacing:n};let r=Array.from(h0(o).join(" ")),a=ds(r,e)+Wn(" ",e),i=a+(r.length+1)*n,s=Math.min(n,0),l=null;for(let c of new Set([Math.floor(fe/i),Math.ceil(fe/i)])){if(c<1)continue;let u=(fe-c*a)/(c*(r.length+1));if(u>=s&&(!l||Math.abs(u-n)<Math.abs(l.letterSpacing-n))){let m=Array.from({length:c},()=>r.join(""));l={chars:Array.from(m.join(" ")),fontSize:e,letterSpacing:u};}}return l??f0(r,e,n)}function p0(t,e){let{position:n,rotation:o}=e,r=Ep(t),a=e.fill==="repeat"?vp(r,e.fontSize,e.letterSpacing):f0(r,e.fontSize,e.letterSpacing),{fontSize:i,letterSpacing:s}=a,l=[],c=0;for(let[h,p]of a.chars.entries()){let b=m0(a.chars,h,i,a.cut);l.push({char:p,along:c+b/2}),c+=b+s;}let u=c-(l.length>0?s:0),m=n!=="bottom",f=m?e0-ms*i:e0+ms*i,d=u/fe*180,g=[];for(let{char:h,along:p}of l){if(h.trim()==="")continue;let b=p/fe*360,_=m?o-d+b:o+180+d-b,y=_*Math.PI/180;g.push({char:h,x:J(Ee+f*Math.sin(y)),y:J(Ee-f*Math.cos(y)),rotate:J(m?_:_-180)});}return {text:a.chars.join(""),letters:g,fontSize:i===e.fontSize?i:J(i),letterSpacing:s}}var qn=(t,e)=>typeof t=="number"&&Number.isFinite(t)?t:e,g0={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=_t(e?.fgColor,"#000000"),r=_t(e?.bgColor,"#ffffff"),a=n?.pixelSize??9,i=J(a/2),s=i0(a0(n?.url??""),a),l=qn(e?.fontSize,Ir),c=l>0?l:Ir,u=typeof e?.customText=="string"?e.customText:s0,m=p0(u,{fontSize:c,letterSpacing:qn(e?.fontLetterSpacing,l0),position:e?.textPosition==="bottom"?"bottom":"top",rotation:qn(e?.textRotation,0),fill:e?.textFill==="repeat"?"repeat":"none"}),f=e?.textColor||"#ffffff",d=e?.fontFamily||go,g=e?.fontWeight??900,h=qn(e?.strokeWidth,0),p=e?.strokeColor||"#000000",b=[{radius:Ee,width:qn(e?.outerStrokeWidth,h),color:e?.outerStrokeColor||p},{radius:r0,width:qn(e?.innerStrokeWidth,h),color:e?.innerStrokeColor||p}].filter(_=>_.width>0);return $t("svg",{height:Pr,id:"svgQrWrapper",style:{width:"100%",height:"100%"},viewBox:`0 0 ${Pr} ${Pr}`,width:Pr,xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",children:[A("circle",{cx:Ee,cy:Ee,fill:r,r:n0}),A("g",{fill:o,children:s.map((_,y)=>A("circle",{cx:_.cx,cy:_.cy,r:i},y))}),A("path",{d:o0,fill:e?.outerCircleColor||o}),b.map((_,y)=>A("circle",{cx:Ee,cy:Ee,fill:"none",r:_.radius,stroke:_.color,strokeWidth:_.width},y)),A("g",{"aria-hidden":"true",children:m.letters.map((_,y)=>A("text",{fill:f,fontFamily:d,fontSize:m.fontSize,fontWeight:g,textAnchor:"middle",transform:`rotate(${_.rotate} ${_.x} ${_.y})`,x:_.x,y:_.y,children:_.char},y))}),A("g",{transform:`translate(${Ar} ${Ar})`,children:t})]})}};var b0={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 _0=oe({id:"Halloween",name:"Halloween",description:"QR code with Halloween theme",spec:b0,at:{x:38,y:10,scale:1}});var y0={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 x0=oe({id:"SquareBorder",name:"Square Border",description:"QR code with square decorative border",spec:y0,at:{x:0,y:0,scale:300/316}});var $0={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 S0=oe({id:"StandardBox",name:"Standard Box",description:"QR code with standard box",spec:$0,at:{x:46,y:1,scale:1}});var w0={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 C0=oe({id:"StrikedBox",name:"Striked Box",description:"QR code with striked box",spec:w0,at:{x:24,y:0,scale:1}});var vr={default:Yu,Arrow:Xu,StandardBox:S0,SquareBorder:x0,StrikedBox:C0,Halloween:_0,DotRing:g0},R0={FlamQR:"DotRing"},Lo=t=>{if(Object.hasOwn(vr,t))return vr[t];let e=Object.hasOwn(R0,t)?R0[t]:void 0;return e?vr[e]:void 0},n3=()=>Object.values(vr),r3=()=>Object.keys(vr);var fs=t=>Math.round(Math.min(Math.max(t,0),255)).toString(16).padStart(2,"0");function P0(t){return `#${fs(t.r)}${fs(t.g)}${fs(t.b)}`}function Vn(t){let e=at(t);return !e||e.a>=1||e.a<=0?{color:t}:{color:P0(e),opacity:J(e.a,3)}}function To(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 I0={r:0,g:0,b:0,a:1};function Np(t){return [...t].map(e=>({offset:Math.min(Math.max(e.offset/100,0),1),color:at(e.color)??I0})).sort((e,n)=>e.offset-n.offset)}function hs(t,e){let n=t[0],o=t.at(-1);if(!(n&&o))return I0;if(e<=n.offset)return n.color;if(e>=o.offset)return o.color;for(let r=0;r+1<t.length;r++){let a=t[r],i=t[r+1];if(e>=a.offset&&e<=i.offset){let s=i.offset-a.offset,l=s>0?(e-a.offset)/s:1,c=a.color.a+(i.color.a-a.color.a)*l,u=(m,f)=>{let d=m*a.color.a+(f*i.color.a-m*a.color.a)*l;return c>0?d/c:m+(f-m)*l};return {r:u(a.color.r,i.color.r),g:u(a.color.g,i.color.g),b:u(a.color.b,i.color.b),a:c}}}return o.color}var M0=4,E0=720,Op=2;function v0(t,e,n,o,r){let a=Np(t);if(a.length===0)return {wedges:[]};let i=a[0].color.a,s=a.every(_=>Math.abs(_.color.a-i)<.002),l=[...new Set([0,...a.map(_=>_.offset),1])].sort((_,y)=>_-y),c=[];for(let _=0;_+1<l.length;_++){let y=l[_],w=l[_+1];if(w<=y)continue;let C=hs(a,y+1e-9),S=hs(a,w-1e-9),$=Math.max(Math.abs(C.r*C.a-S.r*S.a),Math.abs(C.g*C.a-S.g*S.a),Math.abs(C.b*C.a-S.b*S.a),Math.abs(C.a-S.a)*255),R=Math.ceil($/Op),M=Math.ceil((w-y)*360/M0),E=Math.max(1,R,M);for(let P=0;P<E;P++)c.push([y+(w-y)*P/E,y+(w-y)*(P+1)/E]);}let u=c;if(c.length>E0){let _=Math.ceil(c.length/E0);u=[];for(let y=0;y<c.length;y+=_){let w=c.slice(y,y+_);u.push([w[0][0],w.at(-1)[1]]);}}let m=e-90,f=r/Math.cos(2*M0/2*(Math.PI/180)),d=_=>{let y=_*Math.PI/180;return [x(n+f*Math.cos(y)),x(o+f*Math.sin(y))]},g=`${x(n)} ${x(o)}`,h=_=>J((_%360+360)%360,4),p=u.length-1,b=u.map(([_,y],w)=>{let C=hs(a,(_+y)/2),S=(y-_)*360,$=s&&w===0&&p>0?S:0,R=s&&w<p?S:0,M=m+_*360-$,E=m+y*360+R,[P,v]=d(M),[L,F]=d(E);return {d:`M${g}L${P} ${v}L${L} ${F}Z`,color:P0(C),...s||C.a>=1?{}:{opacity:J(C.a,3)},from:h(M),sweep:J(E-M,4)}});return s&&i<1?{wedges:b,opacity:J(i,3)}:{wedges:b}}function A0(t,e,n,o){return (Math.atan2(o-e,n-t)*180/Math.PI%360+360)%360}function L0(t,e,n){if(t>=n.x-1e-6&&t<=n.x+n.width+1e-6&&e>=n.y-1e-6&&e<=n.y+n.height+1e-6)return null;let r=[[n.x,n.y],[n.x+n.width,n.y],[n.x,n.y+n.height],[n.x+n.width,n.y+n.height]],a=A0(t,e,n.x+n.width/2,n.y+n.height/2),i=0,s=0;for(let[l,c]of r){let u=A0(t,e,l,c)-a;u>180?u-=360:u<=-180&&(u+=360),i=Math.min(i,u),s=Math.max(s,u);}return [a+i,a+s]}function T0(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 gs(t,e){return t.slice().map((n,o)=>o<e.y||o>=e.y+e.h?n:n.map((r,a)=>a<e.x||a>=e.x+e.w?r:false))}function N0(t,e=0){let n=[];return t.forEach((o,r)=>{let a=null;o.forEach((i,s)=>{if(!i&&a!==null){n.push(I`M${a+e} ${r+e}h${s-a}v1H${a+e}z`),a=null;return}if(s===o.length-1){if(!i)return;a===null?n.push(I`M${s+e},${r+e} h1v1H${s+e}z`):n.push(I`M${a+e},${r+e} h${s+1-a}v1H${a+e}z`);return}i&&a===null&&(a=s);});}),n.join("")}function Dp(t,e,n){return t<7&&e<7||t>=n-7&&e<7||t<7&&e>=n-7}var Bp=.9;function ps(t,e){let{margin:n,pixelSize:o,pattern:r="circle",plain:a=false}=e;if(Mu(r))return Au(t,{margin:n,pixelSize:o,pattern:r,scale:e.scale,plain:a});let i=Co(e.scale,r),s=[],l=t.length,c=o*.45,u=a?()=>false:Wi(l);return t.forEach((m,f)=>{m.forEach((d,g)=>{if(d&&(a||!Dp(g,f,l))){let h=(g+.5+n)*o,p=(f+.5+n)*o,b=`${g}-${f}`,_=s.length;if(u(g,f)){s.push(A("rect",{height:x(o),width:x(o),x:x(h-o/2),y:x(p-o/2)},b));return}switch(r){case "circle":s.push(A("circle",{cx:x(h),cy:x(p),r:x(c),transform:I`rotate(0,${h},${p})`},b));break;case "circle-large":{let y=o*.5;s.push(A("circle",{cx:x(h),cy:x(p),r:x(y),transform:I`rotate(0,${h},${p})`},b));}break;case "small-square":{let y=o*.357143;s.push(A("path",{d:I`M ${h-y} ${p-y}v ${o*.714286}h ${o*.714286}v -${o*.714286}z`,transform:I`rotate(0,${h},${p})`},b));}break;case "diamond":{let y=o*.357143;s.push(A("path",{d:I`M ${h-y} ${p-y}v ${o*.714286}h ${o*.714286}v -${o*.714286}z`,transform:I`rotate(45,${h},${p})`},b));}break;case "circle-mixed":{let y=(g+f)%3===0?Bp:(g+f)%2===0?1:1.25,w=c*y;s.push(A("circle",{cx:x(h),cy:x(p),r:x(w),transform:I`rotate(0,${h},${p})`},b));}break;case "pacman":{let y=o*.5,w=o*.357143;s.push(A("path",{d:I`M ${h-y} ${p-w}v ${o*.714286}h ${y}a ${y*.5} ${y*.5}, 0, 0, 0, 0 -${o*.714286}h -${y}v -${o*.714286}z`,transform:I`rotate(${(g+f)%2===0?0:90},${h},${p})`},b));}break;case "rounded":{let y=o*.5,w=o*.2;s.push(A("rect",{height:x(o),rx:x(w),ry:x(w),transform:I`rotate(0,${h},${p})`,width:x(o),x:x(h-y),y:x(p-y)},b));}break;case "square":{let y=o*.5;s.push(A("rect",{height:x(o),transform:I`rotate(0,${h},${p})`,width:x(o),x:x(h-y),y:x(p-y)},b));}break;case "vertical-line":{let y=o*.714286,w=o;s.push(A("path",{d:I`M ${h-o*.5} ${p-y*.5}v ${y}h ${w}v -${y}z`,transform:I`rotate(90,${h},${p})`},b));}break;default:s.push(A("circle",{cx:x(h),cy:x(p),r:x(c),transform:I`rotate(0,${h},${p})`},b));}if(i!==1&&s.length>_){let y=s.pop();s.push(A("g",{transform:I`translate(${h},${p}) scale(${x(i,6)}) translate(${-h},${-p})`,children:y},b));}}});}),s}function Gp(t,e){let n=t*Math.PI/180,o=e/2,r=e/2,a=Math.sqrt(e*e+e*e)/2,i=o-a*Math.cos(n),s=r-a*Math.sin(n),l=o+a*Math.cos(n),c=r+a*Math.sin(n);return {x1:i,y1:s,x2:l,y2:c}}function bs(t,e){return `${t}-${Ve(JSON.stringify(e))}`}function Qp(t,e,n,o,r){let a=t;if(t===0)switch(r){case "top-left":a=0;break;case "top-right":a=90;break;case "bottom-left":a=270;break;default:a=0;}let i=a*Math.PI/180,s=e+o/2,l=n+o/2,c=Math.sqrt(o*o+o*o)/2,u=s-c*Math.cos(i),m=l-c*Math.sin(i),f=s+c*Math.cos(i),d=l+c*Math.sin(i);return {x1:u,y1:m,x2:f,y2:d}}function No(t,e){return e.map((n,o)=>{let{color:r,opacity:a}=Vn(n.color);return A("stop",{offset:`${n.offset}%`,stopColor:r,stopOpacity:a},`${t}-stop-${o}`)})}function O0(t,e,n,o,r,a){let i=v0(e.stops,e.angle??0,n,o,r),s=i.wedges.map((l,c)=>A("path",{d:l.d,"data-arc":`${l.from} ${l.sweep}`,fill:l.color,fillOpacity:l.opacity,shapeRendering:l.opacity===void 0?void 0:"crispEdges"},`${t}-w-${c}`));return A("pattern",{"data-qrdx-conic":`${x(n)} ${x(o)}`,height:x(a),id:t,patternUnits:"userSpaceOnUse",width:x(a),x:0,y:0,children:i.opacity===void 0?s:A("g",{opacity:i.opacity,children:s})},t)}function Up(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 Hp=["xMin","xMid","xMax"],zp=["YMin","YMid","YMax"];function D0(t,e,n){let o=e.scale??1,r=e.fit==="tile",a=r?n/4*o:n,i=e.underlay?Vn(e.underlay):null,s=r?a:n*o,l=Up(e.position),c=r?0:l.x*(n-s),u=r?0:l.y*(n-s),m=r?"xMidYMid slice":`${Hp[l.x*2]??"xMid"}${zp[l.y*2]??"YMid"} ${e.fit==="contain"?"meet":"slice"}`;return $t("pattern",{height:x(a),id:t,patternUnits:"userSpaceOnUse",width:x(a),x:0,y:0,children:[i&&A("rect",{fill:i.color,fillOpacity:i.opacity,height:x(a),width:x(a),x:0,y:0}),A("image",{height:x(s),href:e.src,opacity:(e.opacity??1)<1?e.opacity:void 0,preserveAspectRatio:m,width:x(s),x:x(c),y:x(u)})]},t)}var B0=(t,e)=>bs("img",[t,e]);function Wp(t,e,n,o,r,a,i){let s=Tt(t);if(s.type==="solid")return null;if(s.type==="image"){let c=B0(s,i);return {id:c,element:D0(c,s,i)}}let l=bs(a,[s,e,n,o,r,...s.type==="angular"?[i]:[]]);if(s.type==="linear"){let c=s,u=c.angle??0,{x1:m,y1:f,x2:d,y2:g}=Qp(u,e,n,o,r);return {id:l,element:A("linearGradient",{gradientUnits:"userSpaceOnUse",id:l,x1:x(m),x2:x(d),y1:x(f),y2:x(g),children:No(l,c.stops)},l)}}if(s.type==="radial"){let c=s,u=e+o/2,m=n+o/2,f=o/2*.97;return {id:l,element:A("radialGradient",{cx:x(u),cy:x(m),fx:x(u),fy:x(m),gradientUnits:"userSpaceOnUse",id:l,r:x(f),children:No(l,c.stops)},l)}}return s.type==="angular"?{id:l,element:O0(l,s,e+o/2,n+o/2,o*.75,i)}:null}function ko(t,e,n){let o=Tt(t);if(o.type==="solid")return null;if(o.type==="image"){let a=B0(o,e);return {id:a,element:D0(a,o,e)}}let r=bs(n,[o,e]);if(o.type==="linear"){let a=o,i=a.angle??0,{x1:s,y1:l,x2:c,y2:u}=Gp(i,e);return {id:r,element:A("linearGradient",{gradientUnits:"userSpaceOnUse",id:r,x1:x(s),x2:x(c),y1:x(l),y2:x(u),children:No(r,a.stops)},r)}}if(o.type==="radial"){let a=o,i=e/2,s=e/2,l=e/2*.97;return {id:r,element:A("radialGradient",{cx:x(i),cy:x(s),fx:x(i),fy:x(s),gradientUnits:"userSpaceOnUse",id:r,r:x(l),children:No(r,a.stops)},r)}}return o.type==="angular"?{id:r,element:O0(r,o,e/2,e/2,e*.75,e)}:null}var Fo=t=>Ke(t)||vi(t);function k0(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 he(t,e,n){if(e)return {fill:`url(#${e})`};let o=Tt(t,n),r=o.type==="solid"?o.color:o.type==="image"?o.underlay??n:n,{color:a,opacity:i}=Vn(r);return i===void 0?{fill:a}:{fill:a,fillOpacity:i}}function Ae(t,e,n,o){if(o==null)return null;let r=t.length,a=Math.floor(e*Vr),i=(r+2*n)/e,s=(o.width||a)*i,l=(o.height||a)*i,c=o.x==null?r/2-s/2:o.x*i,u=o.y==null?r/2-l/2:o.y*i,m=null;if(o.excavate){let f=Math.max(0,o.padding??0)*i,d=Math.floor(c-f),g=Math.floor(u-f),h=Math.ceil(s+c+f-d),p=Math.ceil(l+u+f-g);m={x:d,y:g,w:h,h:p};}return {x:c,y:u,h:l,w:s,excavation:m}}function At(t){let e=t.level??Jt,{imageSettings:n}=t,o=t.isOGContext&&n?.excavate&&(e==="L"||e==="M")?"Q":e;if(t.autoLevel&&n&&o!=="H"){let r=dt.QrCode.encodeText(t.value,St[o]).getModules(),a=Ae(r,t.size??it,Et(r.length,t.margin??pt,t.shape),n);a&&(a.excavation?a.excavation.w*a.excavation.h:a.w*a.h)/(r.length*r.length)>Da&&(o="H");}return o}function qp(t,e,n,o){let r=e/n,a=t.w*r,i=t.h*r,s=(t.x+o)*r,l=(t.y+o)*r;return {imgWidth:a,imgHeight:i,imgLeft:s,imgTop:l}}function Lr(t){let{value:e,size:n=it,level:o=Jt,bgColor:r=ft,fgColor:a=Mt,eyeColor:i,dotColor:s,bodyPattern:l="circle",cornerEyePattern:c="gear",cornerEyeDotPattern:u="circle",margin:m=pt,isOGContext:f=false,imageSettings:d,templateId:g,customTemplate:h,customProps:p,frame:b,art:_,eyeColors:y,moduleScale:w,autoLevel:C,shape:S,eyeShapes:$,eyeGradient:R,bgRadius:M,backdrop:E,halo:P,shadow:v,frameLabelMarkers:L,partMarkers:F,...k}=t,T=Qt(rr,l),z=Qt(De,c),W=Qt(Be,u),D=zn({value:e,size:n,margin:m,level:o,shape:S,autoLevel:C,isOGContext:f},d),U=Nt(b),X=U?{}:k,xt=H=>U?yr(H,{size:n,frame:b,bgColor:r,svgProps:k,markLabels:L}):H,lt=At({value:e,size:n,level:o,margin:m,imageSettings:D,isOGContext:f,autoLevel:C,shape:S}),N=dt.QrCode.encodeText(e,St[lt]),B=N.getModules(),Z=Et(B.length,m,S),Pt=qc(e,B.length,m,S),ct=(H,vt)=>ss(F,H,vt),Zt=Hn(M,B.length,Z,S),ae=(H,vt)=>{let Kt=Ii(S,H);if(!Kt){if(Zt>0){let ie=x(Zt*H),qt=E?Vn(E):null;return $t(Gt,{children:[qt&&A("rect",{"data-qrdx-look":"backdrop",fill:qt.color,fillOpacity:qt.opacity,height:H,width:H,x:0,y:0}),A("rect",{...vt,height:H,rx:ie,ry:ie,width:H,x:0,y:0,...ct("background")})]})}return A("rect",{...vt,height:H,width:H,x:0,y:0,...ct("background")})}return "circle"in Kt?A("circle",{cx:x(H/2),cy:x(H/2),...vt,r:x(H/2),...ct("background")}):A("path",{d:Kt.path,...vt,...ct("background")})},ke=B.length+Z*2,G=Ae(B,n,Z,D),K=null;if(D!=null&&G!=null){G.excavation!=null&&(B=gs(B,G.excavation));let{imgWidth:H,imgHeight:vt,imgLeft:Kt,imgTop:ie}=qp(G,n,ke,Z);if(f){let qt=D.shape??"square";K=A("img",{alt:"Logo",src:D.src,style:{position:"absolute",left:`${x(Kt)}px`,top:`${x(ie)}px`,width:`${x(H)}px`,height:`${x(vt)}px`,...qt!=="square"&&{borderRadius:qt==="circle"?"50%":`${x(Math.min(H,vt)*bo)}px`},...D.plate&&{backgroundColor:D.plate,padding:`${x(H*_o)}px`,boxSizing:"border-box"}}});}else K=yo(D,{x:Kt,y:ie,w:H,h:vt}),F&&(K=Ne(K,ct("logo")));}let Q=n/ke,gt=B.length,ut=7*Q,da=1.5*Q,yl={fgColor:_t(a,Mt),bgColor:_t(r,ft)},cn=Oi(_)?Qi({art:_,modules:B,version:N.version,margin:Z,pixelSize:Q,...yl,body:H=>ps(H,{margin:Z,pixelSize:Q,pattern:T,scale:w})}):null,xl=cn&&F?Ne(cn,ct("body")):cn,$l=cn&&_?zi({art:_,version:N.version,...yl}):null,Sl=cn?null:ps(B,{margin:Z,pixelSize:Q,pattern:T,scale:w}),zr=Pt?ps(Pt,{margin:0,pixelSize:Q,pattern:T,scale:w,plain:true}):null,Wr=Tt(r,ft),fa=Tt(a,Mt),wl=Fo(Wr)?ko(Wr,n,"bg-color"):null,ha=Fo(fa)?ko(fa,n,"fg-color"):null,Sd=he(r,wl?.id??null,ft),Cl=he(a,ha?.id??null,Mt),Rl=xl?$t(Gt,{children:[xl,zr&&A("g",{...Cl,...ct("body"),children:zr})]}):$t("g",{...Cl,...ct("body"),children:[Sl,zr]}),un=Z*Q,mn=Z*Q,dn=(gt-7+Z)*Q,fn=Z*Q,hn=Z*Q,pn=(gt-7+Z)*Q,Fe=_t(a,Mt),gn=H=>y?.[H]?.outer??$l?.[H]?.outer??i,bn=H=>y?.[H]?.inner??$l?.[H]?.inner??s,_n=(H,vt,Kt,ie,qt)=>{let xn=Tt(H,Fe);if(!Fo(xn))return null;if(R==="code"&&Ke(xn)){let Ia=JSON.stringify(xn)===JSON.stringify(fa);return ko(xn,n,Ia?"fg-color":qt)}return Wp(xn,vt,Kt,ut,ie,qt,n)},pa=_n(gn("topLeft"),un,mn,"top-left","corners-square-color-0-0"),ga=_n(gn("topRight"),dn,fn,"top-right","corners-square-color-1-0"),ba=_n(gn("bottomLeft"),hn,pn,"bottom-left","corners-square-color-0-1"),_a=_n(bn("topLeft"),un,mn,"top-left","corners-dot-color-0-0"),ya=_n(bn("topRight"),dn,fn,"top-right","corners-dot-color-1-0"),xa=_n(bn("bottomLeft"),hn,pn,"bottom-left","corners-dot-color-0-1"),Ml=he(gn("topLeft"),pa?.id??null,Fe),El=he(gn("topRight"),ga?.id??null,Fe),Al=he(gn("bottomLeft"),ba?.id??null,Fe),Pl=he(bn("topLeft"),_a?.id??null,Fe),Il=he(bn("topRight"),ya?.id??null,Fe),vl=he(bn("bottomLeft"),xa?.id??null,Fe),yn={cornerEyePattern:z,cornerEyeDotPattern:W,eyeShapes:$},$a=Mo(un,mn,ut,re(yn,"topLeft").outer,"top-left"),Sa=Ro(un+ut/2,mn+ut/2,da,re(yn,"topLeft").inner,"top-left"),wa=Mo(dn,fn,ut,re(yn,"topRight").outer,"top-right"),Ca=Ro(dn+ut/2,fn+ut/2,da,re(yn,"topRight").inner,"top-right"),Ra=Mo(hn,pn,ut,re(yn,"bottomLeft").outer,"bottom-left"),Ma=Ro(hn+ut/2,pn+ut/2,da,re(yn,"bottomLeft").inner,"bottom-left"),Ea=Mr(P,{bgColor:r}),er=as(v),Ll=H=>$t(Gt,{children:[cn?null:Sl,zr,A("path",{d:$a,fillRule:H}),Sa,A("path",{d:wa,fillRule:H}),Ca,A("path",{d:Ra,fillRule:H}),Ma]}),Aa=null;if(Ea){let{color:H}=Ea;Aa=A("g",{"data-qrdx-look":"halo",fill:H,stroke:H,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:x(2*Ea.width*Q),children:Ll("nonzero")});}let Pa=null;if(er){let{color:H}=Vn(er.color);Pa=A("g",{"data-qrdx-look":"shadow",fill:H,opacity:x(er.opacity),transform:I`translate(${er.dx*Q},${er.dy*Q})`,children:Ll("evenodd")});}let wd=$t(Gt,{children:[A("defs",{children:k0([wl,ha,pa,ga,ba,_a,ya,xa])}),ae(n,Sd),Aa,Pa,Rl,A("g",{...Ml,...ct("eye-outer","top-left"),children:A("path",{d:$a,fillRule:"evenodd",transform:I`rotate(0,${un+ut/2},${mn+ut/2})`})}),A("g",{...Pl,...ct("eye-centre","top-left"),children:Sa}),A("g",{...El,...ct("eye-outer","top-right"),children:A("path",{d:wa,fillRule:"evenodd",transform:I`rotate(0,${dn+ut/2},${fn+ut/2})`})}),A("g",{...Il,...ct("eye-centre","top-right"),children:Ca}),A("g",{...Al,...ct("eye-outer","bottom-left"),children:A("path",{d:Ra,fillRule:"evenodd",transform:I`rotate(0,${hn+ut/2},${pn+ut/2})`})}),A("g",{...vl,...ct("eye-centre","bottom-left"),children:Ma}),K]}),Tl=h||(g?Lo(g):void 0);if(Tl){let vt=Fo(Wr)?ko(Wr,300,"bg-color-template"):null,Kt=he(r,vt?.id??null,ft),ie=$t("svg",{height:300,viewBox:"0 0 300 300",width:300,xmlns:"http://www.w3.org/2000/svg",children:[A("defs",{children:k0([vt,ha,pa,ga,ba,_a,ya,xa])}),ae(300,Kt),$t("g",{transform:`scale(${x(300/n,6)})`,children:[Aa,Pa,Rl,A("g",{...Ml,...ct("eye-outer","top-left"),children:A("path",{d:$a,fillRule:"evenodd",transform:I`rotate(0,${un+ut/2},${mn+ut/2})`})}),A("g",{...Pl,...ct("eye-centre","top-left"),children:Sa}),A("g",{...El,...ct("eye-outer","top-right"),children:A("path",{d:wa,fillRule:"evenodd",transform:I`rotate(0,${dn+ut/2},${fn+ut/2})`})}),A("g",{...Il,...ct("eye-centre","top-right"),children:Ca}),A("g",{...Al,...ct("eye-outer","bottom-left"),children:A("path",{d:Ra,fillRule:"evenodd",transform:I`rotate(0,${hn+ut/2},${pn+ut/2})`})}),A("g",{...vl,...ct("eye-centre","bottom-left"),children:Ma}),K]})]}),qt=300/n,Ia={pixelSize:Q*qt,url:e},kl=Tl.wrapper(ie,{fgColor:a,bgColor:r,...p||{},...k},Ia),Cd={...kl?.props?.style||{},width:void 0,height:void 0,...X.style};return xt(Ne(kl,{...X,width:n,height:n,style:Cd}))}return xt(A("svg",{height:n,viewBox:`0 0 ${n} ${n}`,width:n,xmlns:"http://www.w3.org/2000/svg",...X,children:wd}))}var I3=(()=>{try{new Path2D().addPath(new Path2D);}catch{return false}return true})(),v3=t=>{let e=t.trim().replace(/^#/,"");e.length===3||e.length===4?e=e.slice(0,3).split("").map(o=>o+o).join(""):e.length===8&&(e=e.slice(0,6));let n=/^([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return n?{r:Number.parseInt(n[1],16),g:Number.parseInt(n[2],16),b:Number.parseInt(n[3],16)}:null},jn=(t,e,n)=>{let[o,r,a]=[t,e,n].map(i=>(i/=255,i<=.03928?i/12.92:((i+.055)/1.055)**2.4));return .2126*o+.7152*r+.0722*a},F0=t=>{let e=at(t);if(!e)return null;let n=o=>o*e.a+255*(1-e.a);return {r:n(e.r),g:n(e.g),b:n(e.b)}},L3=(t,e)=>{let n=F0(t),o=F0(e);if(!(n&&o))return 1;let r=jn(n.r,n.g,n.b),a=jn(o.r,o.g,o.b),i=Math.max(r,a),s=Math.min(r,a);return (i+.05)/(s+.05)},T3=t=>t>=7?{level:"AAA",warning:false,message:"Excellent contrast"}:t>=4.5?{level:"AA",warning:false,message:"Good contrast"}:t>=3?{level:"AA Large",warning:true,message:"Low contrast - may be difficult to scan"}:{level:"Fail",warning:true,message:"Poor contrast - QR code may not scan properly"};var G0=.6,Vp=["L","M","Q","H"];function Q0(t){let e=dt.QrCode.encodeText(t.value,St[t.level]),n=Vp[e.errorCorrectionLevel.ordinal]??t.level;return {code:t,cells:e.getModules(),layoutMargin:Et(e.size,t.margin,t.shape),map:xr(e.version,n),level:n,version:e.version}}function U0(t,e){let{cells:n,map:o}=t,r=n.length,a=Ae(n,t.code.size,t.layoutMargin,e);if(!a)return null;let i=a.excavation??{x:Math.floor(a.x),y:Math.floor(a.y),w:Math.ceil(a.x+a.w)-Math.floor(a.x),h:Math.ceil(a.y+a.h)-Math.floor(a.y)},s=[];for(let c=Math.max(0,i.y);c<Math.min(r,i.y+i.h);c++)for(let u=Math.max(0,i.x);u<Math.min(r,i.x+i.w);u++)s.push(c*r+u);let l=$r(o,s);return {worst:Math.max(0,...l),correctable:o.correctable,budget:Math.floor(o.correctable*G0),level:t.level,version:t.version}}function Oo(t,e){return U0(Q0(t),e)}var H0=t=>!t||t.worst<=t.budget;function jp(t,e){return H0(Oo(t,e))}function _s(t,e,n,o){let r=e.map(s=>Q0({...t,level:s})),a=s=>{let l=o(s);return r.every(c=>H0(U0(c,l)))};if(a(n))return n;let i=t.size*.005;for(let s=n-i;s>0;s-=i)if(a(s))return s;return 0}function zn(t,e){if(!e)return;let n=Math.floor(t.size*Vr),o=e.width||n,r=e.height||n,a=f=>{if(f===o)return e;let d=r*f/o;return {...e,width:f,height:d,...e.x!=null&&{x:e.x+(o-f)/2},...e.y!=null&&{y:e.y+(r-d)/2}}},i=t.level??Jt,s={value:t.value,size:t.size,margin:t.margin,shape:t.shape},l=f=>At({...t,level:i,imageSettings:f}),c=f=>{let d=_s(s,[f],o,a);return d>0?a(d):void 0},u=l(e);if(u===i)return c(i);let m=c(u);return m&&l(m)===u?m:c(i)}async function ys(t){let{value:e,size:n=it,level:o=Jt,bgColor:r=ft,fgColor:a=Mt,margin:i=pt,imageSettings:s,eyeColor:l,dotColor:c,bodyPattern:u,cornerEyePattern:m,cornerEyeDotPattern:f,isOGContext:d,templateId:g,customTemplate:h,customProps:p,frame:b,art:_,eyeColors:y,moduleScale:w,eyeShapes:C,eyeGradient:S,bgRadius:$,backdrop:R,halo:M,shadow:E,frameLabelMarkers:P,partMarkers:v,autoLevel:L,...F}=t,k=zn({value:e,size:n,margin:i,level:o,autoLevel:L},s),T=At({value:e,size:n,level:o,margin:i,imageSettings:k,autoLevel:L}),z=dt.QrCode.encodeText(e,St[T]).getModules(),W=z.length+i*2,D=Ae(z,n,i,k),U=null;if(k!=null&&D!=null){D.excavation!=null&&(z=gs(z,D.excavation));let xt=k.src.startsWith("data:")?k.src:await fetch(`https://wsrv.nl/?url=${encodeURIComponent(k.src)}&w=100&h=100&encoding=base64`).then(lt=>{if(!lt.ok)throw new Error(`Failed to load QR logo (${lt.status}): ${k.src}`);return lt.text()});U={settings:{...k,src:xt},box:{x:D.x+i,y:D.y+i,w:D.w,h:D.h}};}let X=N0(z,i);return {size:n,numCells:W,fgPath:X,bgColor:r,fgColor:a,frame:b,svgProps:F,logo:U}}function xs(t){let{size:e,numCells:n,fgPath:o,bgColor:r,fgColor:a,frame:i,svgProps:s,logo:l}=t,c=Nt(i),u=l?yo(l.settings,l.box):A(Gt,{}),m=$t("svg",{height:e,viewBox:`0 0 ${n} ${n}`,width:e,xmlns:"http://www.w3.org/2000/svg",...c?{}:s,children:[A("path",{d:`M0,0 h${n}v${n}H0z`,fill:_t(r,ft),shapeRendering:"crispEdges"}),A("path",{d:o,fill:_t(a,Mt),shapeRendering:"crispEdges"}),u]});return c&&i?yr(m,{size:e,frame:i,bgColor:r,svgProps:s}):m}async function Xp(t){return xs(await ys(t))}var Xn={jsx:jsxRuntime.jsx,jsxs:jsxRuntime.jsxs,createElement:react.createElement,cloneElement:react.cloneElement,Fragment:react.Fragment};async function r4(t){let e=await ys(t);return $n(Xn,()=>xs(e))}var eg=16384;var z0=t=>t*3+3&-4,$s=(t,e)=>Math.floor((t*e+255*(255-e)+127)/255);function Ss(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=z0(e),r=o*n,a=new Uint8Array(54+r),i=new DataView(a.buffer);a[0]=66,a[1]=77,i.setUint32(2,a.length,true),i.setUint32(10,54,true),i.setUint32(14,40,true),i.setInt32(18,e,true),i.setInt32(22,n,true),i.setUint16(26,1,true),i.setUint16(28,24,true),i.setUint32(30,0,true),i.setUint32(34,r,true),i.setInt32(38,2835,true),i.setInt32(42,2835,true);for(let s=0;s<n;s++){let l=s*e*4,c=54+(n-1-s)*o;for(let u=0;u<e;u++){let m=t[l+3],f=t[l],d=t[l+1],g=t[l+2];m===255?(a[c]=g,a[c+1]=d,a[c+2]=f):(a[c]=$s(g,m),a[c+1]=$s(d,m),a[c+2]=$s(f,m)),l+=4,c+=3;}}return a}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+z0(n)*o}function Do(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=Ss(n,t.width,t.height);if(!ws(o))throw new Error("Could not write a BMP file");return new Blob([o],{type:"image/bmp"})}var p4=(t,e,n,o)=>{let r=document.createElement("canvas");r.width=e,r.height=n;let a=r.getContext("2d");if(!a)return;a.putImageData(t,0,0);let i=r.toDataURL("image/png"),s=document.createElement("a");s.href=i,s.download=o,document.body.appendChild(s),s.click(),document.body.removeChild(s);},ng=async(t,e,n,o)=>{let{default:r}=await import('jsqr');return new Promise(a=>{t.complete?i():(t.onload=()=>i(),t.onerror=()=>a(null));function i(){let s=document.createElement("canvas");requestAnimationFrame(()=>{if(!(t.naturalWidth&&t.naturalHeight)){a(null);return}let l=t.naturalWidth/t.naturalHeight<=.33||t.naturalWidth/t.naturalHeight>=3?Math.sqrt(t.naturalWidth*t.naturalHeight/12e5):t.naturalWidth/t.naturalHeight<=.5||t.naturalWidth/t.naturalHeight>=2?Math.sqrt(t.naturalWidth*t.naturalHeight/9e5):Math.sqrt(t.naturalWidth*t.naturalHeight/64e4),c=s.getContext("2d",{willReadFrequently:true});if(!c){a(null);return}let u=[1,.8,.6,.4,.2,.1];for(let m of u){let f=Math.floor(t.naturalWidth*e*m/l),d=Math.floor(t.naturalHeight*e*m/l);s.width=f,s.height=d,c.clearRect(0,0,f,d),c.imageSmoothingEnabled=true,c.imageSmoothingQuality="high";try{c.drawImage(t,Math.floor(n),Math.floor(o),Math.floor(t.naturalWidth*e),Math.floor(t.naturalHeight*e),0,0,f,d);let g=c.getImageData(0,0,f,d);try{let h=r(g.data,f,d);if(h?.data){a(h);return}}catch(h){console.error("QR Detection error:",h);}}catch(g){console.error("Canvas drawing error:",g);}}a(null);});}})},W0=async(t,e,n=false)=>{if(!t)return "NO_QR";await new Promise(r=>setTimeout(r,100));let o=[{dx:0,dy:0,ratio:1},{dx:0,dy:t.naturalHeight*.35,ratio:.65},{dx:t.naturalWidth*.35,dy:t.naturalHeight*.35,ratio:.65},{dx:t.naturalWidth*.35,dy:0,ratio:.65},{dx:t.naturalWidth*.35/2,dy:t.naturalHeight*.35/2,ratio:.65}];for(let r of o)try{let a=await ng(t,r.ratio,r.dx,r.dy);if(a?.data)return n?a:a.data}catch(a){console.warn("QR decode error:",a);}return "NO_QR"};function g4(t,e,n){if(!(t&&e)||e.length!==4)return;let o=document.createElement("canvas");o.width=t.naturalWidth,o.height=t.naturalHeight;let r=o.getContext("2d");if(!r)return;r.drawImage(t,0,0),r.save(),r.strokeStyle="#ff0000",r.lineWidth=Math.max(5,Math.min(t.naturalWidth,t.naturalHeight)/200),r.shadowColor="transparent",r.shadowBlur=0,r.beginPath(),r.moveTo(e[0].x,e[0].y),r.lineTo(e[1].x,e[1].y),r.lineTo(e[3].x,e[3].y),r.lineTo(e[2].x,e[2].y),r.closePath(),r.stroke(),r.fillStyle="#ff0000",e.forEach((s,l)=>{r.fillRect(s.x-3,s.y-3,6,6),r.fillStyle="#ffffff",r.font="16px Arial",r.fillText(`${l}`,s.x+5,s.y-5),r.fillStyle="#ff0000";}),r.restore();let a=o.toDataURL("image/png"),i=document.createElement("a");i.href=a,i.download=n,document.body.appendChild(i),i.click(),document.body.removeChild(i);}var rg=256,og=16384,ag=128;var V0=(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}`)},Cs=(t,e)=>t>>6*(2-e)&63;function j0(t,e,n){V0(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,a=false,i=false,s=false;for(let b=0;b<o;b++){let _=b*4,y=t[_+3];if(y<128){a=true,i||=y>0;continue}if(i||=y<255,!s){let w=t[_]<<16|t[_+1]<<8|t[_+2];r.has(w)||(r.set(w,r.size),s=r.size>256);}}let l=a?255:256,c=!s&&r.size<=l,u=new Uint8Array(o),m,f,d;if(c){f=[];for(let b of r.keys())f.push(b>>16&255,b>>8&255,b&255);m=r.size,d=(b,_,y)=>r.get(b<<16|_<<8|y);}else {let b=ig(t,o,l);f=b.palette,m=b.palette.length/3,d=(_,y,w)=>b.bucketIndex[X0(_,y,w)];}let g=a?m:null;for(let b=0;b<o;b++){let _=b*4;t[_+3]<128?u[b]=g:u[b]=d(t[_],t[_+1],t[_+2]);}let h=m+(a?1:0),p=new Uint8Array(h*3);return p.set(f),a&&p.fill(255,m*3),{width:e,height:n,palette:p,indices:u,transparentIndex:g,colors:h,lossless:c&&!i}}var X0=(t,e,n)=>t>>2<<12|e>>2<<6|n>>2;function ig(t,e,n){let o=new Uint32Array(262144),r=new Float64Array(262144),a=new Float64Array(262144),i=new Float64Array(262144);for(let f=0;f<e;f++){let d=f*4;if(t[d+3]<128)continue;let g=t[d],h=t[d+1],p=t[d+2],b=X0(g,h,p);o[b]=o[b]+1,r[b]=r[b]+g,a[b]=a[b]+h,i[b]=i[b]+p;}let s=[];for(let f=0;f<262144;f++)o[f]>0&&s.push(f);let l=[{keys:s,pixels:s.reduce((f,d)=>f+o[d],0)}];for(;l.length<n;){let f=-1;for(let $=0;$<l.length;$++){let R=l[$];R.keys.length>1&&(f===-1||R.pixels>l[f].pixels)&&(f=$);}if(f===-1)break;let d=l[f],g=0,h=-1;for(let $ of [0,1,2]){let R=255,M=0;for(let E of d.keys){let P=Cs(E,$);R=Math.min(R,P),M=Math.max(M,P);}M-R>h&&(h=M-R,g=$);}let p=[...d.keys].sort(($,R)=>Cs($,g)-Cs(R,g)||$-R),b=d.pixels/2,_=0,y=1;for(let $=0;$<p.length-1&&(_+=o[p[$]],y=$+1,!(_>=b));$++);let w=p.slice(0,y),C=p.slice(y),S=$=>$.reduce((R,M)=>R+o[M],0);l.splice(f,1,{keys:w,pixels:S(w)},{keys:C,pixels:S(C)});}let c=[];for(let f of l){let d=0,g=0,h=0;for(let p of f.keys)d+=r[p],g+=a[p],h+=i[p];c.push(Math.round(d/f.pixels),Math.round(g/f.pixels),Math.round(h/f.pixels));}let u=new Uint8Array(262144),m=c.length/3;for(let f of s){let d=o[f],g=r[f]/d,h=a[f]/d,p=i[f]/d,b=0,_=Number.POSITIVE_INFINITY;for(let y=0;y<m;y++){let w=g-c[y*3],C=h-c[y*3+1],S=p-c[y*3+2],$=w*w+C*C+S*S;$<_&&(_=$,b=y);}u[f]=b;}return {palette:c,bucketIndex:u}}var sg=t=>Math.max(1,Math.ceil(Math.log2(t))),Bo=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 lg(t,e){let n=new Bo,o=1<<e,r=o+1,a=[],i=0,s=0,l=()=>{a.length>0&&(n.push(a.length,...a),a=[]);},c=h=>{a.push(h),a.length===255&&l();},u=(h,p)=>{for(i|=h<<s,s+=p;s>=8;)c(i&255),i>>>=8,s-=8;},m=new Int32Array(1048576),f=e+1,d=r+1;u(o,f);let g=t[0];for(let h=1;h<t.length;h++){let p=t[h],b=g<<8|p,_=m[b];if(_!==0){g=_-1;continue}u(g,f),d===4096?(u(o,f),m=new Int32Array(1048576),d=r+1,f=e+1):(d>=1<<f&&f++,m[b]=d+1,d++),g=p;}return u(g,f),u(r,f),s>0&&c(i&255),l(),n.result()}function Y0(t){let{width:e,height:n,palette:o,indices:r,transparentIndex:a}=t;V0(e,n);let i=o.length/3;if(!Number.isInteger(i)||i<1||i>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(a!==null&&!(Number.isInteger(a)&&a>=0&&a<i))throw new RangeError(`The transparent index ${a} isn't in a palette of ${i} colors`);for(let m=0;m<r.length;m++)if(r[m]>=i)throw new RangeError(`Pixel ${m} points at color ${r[m]}, past the palette of ${i}`);let s=sg(i),l=1<<s,c=Math.max(2,s),u=new Bo;return u.ascii("GIF89a"),u.u16(e),u.u16(n),u.push(240|s-1,0,0),u.bytes(o),u.bytes(new Uint8Array((l-i)*3)),a!==null&&u.push(33,249,4,1,0,0,a,0),u.push(44),u.u16(0),u.u16(0),u.u16(e),u.u16(n),u.push(0),u.push(c),u.bytes(lg(r,c)),u.push(0),u.push(59),u.result()}function Rs(t,e,n){let o=j0(t,e,n);return {file:Y0(o),image:o}}function Ms(t){let{palette:e,indices:n,transparentIndex:o}=t,r=new Uint8ClampedArray(n.length*4);for(let a=0;a<n.length;a++){let i=n[a],s=a*4;r[s]=e[i*3],r[s+1]=e[i*3+1],r[s+2]=e[i*3+2],r[s+3]=i===o?0:255;}return r}var q0="GIF89a";function Es(t){if(t.length<32)return false;for(let l=0;l<q0.length;l++)if(t[l]!==q0.charCodeAt(l))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 a=13+3*(1<<(r&7)+1);if(t.length<a)return false;let i=l=>{let c=l;for(;c<t.length;){let u=t[c];if(c+=1,u===0)return c;c+=u;}return -1},s=0;for(;a<t.length;){let l=t[a];if(l===59)return s===1&&a===t.length-1;if(l===33)a=i(a+2);else if(l===44){if(a+10>t.length||e.getUint16(a+5,true)!==n||e.getUint16(a+7,true)!==o||t[a+9]&128)return false;let c=t[a+10];if(c<2||c>8)return false;s+=1,a=i(a+11);}else return false;if(a===-1)return false}return false}var Tr="image/gif",Qo=class extends Error{constructor(e){super(e),this.name="GIFScanError";}},Go=255;function Z0(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+Go*(Go-o))/Go);e[n+3]=Go;}return e}function K0(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 cg(t,e,n){let{width:o,height:r}=t,a=Z0(t.data),i=Z0(e.data);if(e.width===o&&e.height===r&&a.every((c,u)=>c===i[u]))return;let s;try{s=(await import('jsqr')).default;}catch{throw new Qo("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(!K0(s,{data:a,width:o,height:r},n))return;if(!K0(s,{data:i,width:e.width,height:e.height},n))throw new Qo("This design uses more colors than a GIF holds (256), and the reduced image would not scan. Download a PNG instead.")}async function ug(t,e){let{file:n,image:o}=Rs(t.data,t.width,t.height);if(!Es(n))throw new Error("Could not write a GIF file");return e!==void 0&&!o.lossless&&await cg(t,{data:Ms(o),width:t.width,height:t.height},e),{file:n,colors:o.colors,lossless:o.lossless}}async function Uo(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 ug({data:o,width:t.width,height:t.height},e);return new Blob([r],{type:Tr})}var Ho=[16,32,48,256],an="image/vnd.microsoft.icon",on=256,As=64,kr=6,Fr=16,mg=[137,80,78,71,13,10,26,10],dg=16,J0=20,fg=32,tm=t=>t.length>=J0+4&&mg.every((e,n)=>t[n]===e),em=t=>{let e=new DataView(t.buffer,t.byteOffset,t.byteLength);return {width:e.getUint32(dg),height:e.getUint32(J0)}};function Ps(t){if(t.length<1||t.length>As)throw new RangeError(`An ICO holds 1 to ${As} images, got ${t.length}`);for(let{width:i,height:s,png:l}of t){let c=m=>Number.isInteger(m)&&m>=1&&m<=on;if(!(c(i)&&c(s)))throw new RangeError(`ICO images must be whole numbers from 1 to ${on} px, got ${i} x ${s}`);if(!tm(l))throw new RangeError("Every ICO image must be a PNG file");let u=em(l);if(u.width!==i||u.height!==s)throw new RangeError(`An ICO image says ${i} x ${s} but its PNG is ${u.width} x ${u.height}`)}let e=kr+Fr*t.length,n=t.reduce((i,s)=>i+s.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 a=e;return t.forEach(({width:i,height:s,png:l},c)=>{let u=kr+Fr*c;o[u]=i===on?0:i,o[u+1]=s===on?0:s,o[u+2]=0,o[u+3]=0,r.setUint16(u+4,1,true),r.setUint16(u+6,fg,true),r.setUint32(u+8,l.length,true),r.setUint32(u+12,a,true),o.set(l,a),a+=l.length;}),o}function Is(t){if(t.length<kr+Fr)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>As||t.length<kr+Fr*n)return false;for(let o=0;o<n;o++){let r=kr+Fr*o,a=t[r]||on,i=t[r+1]||on,s=e.getUint32(r+8,true),l=e.getUint32(r+12,true);if(l+s>t.length)return false;let c=t.subarray(l,l+s);if(!tm(c))return false;let u=em(c);if(u.width!==a||u.height!==i)return false}return true}var nm="data:image/png;base64,";function hg(t){let e=t.toDataURL("image/png");if(!e.startsWith(nm))throw new Error("This browser can't write a PNG from a canvas");let n=atob(e.slice(nm.length)),o=new Uint8Array(n.length);for(let r=0;r<n.length;r++)o[r]=n.charCodeAt(r);return o}function vs(t){let e=Ps(t.map(n=>({width:n.width,height:n.height,png:hg(n)})));if(!Is(e))throw new Error("Could not write an ICO file");return new Blob([e],{type:an})}function rm(t){return vs([t])}var pg=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"]]),gg=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"]]),bg=new Set(["children","dangerouslySetInnerHTML","key","defaultValue","defaultChecked","innerHTML","suppressContentEditableWarning","suppressHydrationWarning","ref"]),_g=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"]),yg=new Set(["autoFocus","multiple","muted"]),xg=new Set(["contentEditable","spellCheck","draggable","value","autoReverse","externalResourcesRequired","focusable","preserveAlpha"]),$g=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(" ")),om=":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",Sg=new RegExp(`^[${om}][${om}\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`),zo=/^[a-zA-Z][a-zA-Z:_.\-\d]*$/,wg=/^[\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,Cg="javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')",Rg=t=>wg.test(t)?Cg:t,im=new Set(["area","base","br","col","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"]),Mg=/["'&<>]/;function Ls(t){if(!Mg.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 pe=t=>typeof t=="function"||typeof t=="symbol",am=new Map,Eg=t=>{let e=am.get(t);return e===void 0&&(e=t.replace(/([A-Z])/g,"-$1").toLowerCase().replace(/^ms-/,"-ms-"),am.set(t,e)),e};function Ag(t){if(typeof t=="string")return t;if(typeof t!="object"||t===null)return "";let e="";for(let n of Object.keys(t)){let o=t[n];if(o==null||typeof o=="boolean"||o==="")continue;let r;if(n.startsWith("--"))r=`${n}:${`${o}`.trim()}`;else {let a=typeof o=="number"?o===0||$g.has(n)?`${o}`:`${o}px`:`${o}`.trim();r=`${Eg(n)}:${a}`;}e=e?`${e};${r}`:r;}return e}function Yn(t,e){if(e==null||bg.has(t))return null;let n=gg.get(t);if(n!==void 0)return pe(e)||typeof e=="boolean"?null:{name:n,value:`${e}`};switch(t){case "style":{let r=Ag(e);return r?{name:"style",value:r}:null}case "src":case "href":case "action":case "formAction":case "xlinkHref":return (t==="src"||t==="href")&&e===""||pe(e)||typeof e=="boolean"?null:{name:t==="xlinkHref"?"xlink:href":t,value:Rg(`${e}`)};case "capture":case "download":return e===true?{name:t,value:""}:e===false||pe(e)?null:{name:t,value:`${e}`};case "cols":case "rows":case "size":case "span":return pe(e)||Number.isNaN(Number(e))||!(e>=1)?null:{name:t,value:`${e}`};case "rowSpan":case "start":return pe(e)||Number.isNaN(Number(e))?null:{name:t,value:`${e}`};}if(yg.has(t))return e&&!pe(e)?{name:t.toLowerCase(),value:""}:null;if(xg.has(t))return pe(e)?null:{name:t,value:`${e}`};if(_g.has(t))return e&&!pe(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=pg.get(t)??t;if(!Sg.test(o)||pe(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 sm="http://www.w3.org/2000/svg",lm="http://www.w3.org/1999/xhtml",Pg="http://www.w3.org/1999/xlink",Ig="http://www.w3.org/XML/1998/namespace",vg="http://www.w3.org/2000/xmlns/";function Lg(t,e,n){e==="xmlns"||e.startsWith("xmlns:")?t.setAttributeNS(vg,e,n):e.startsWith("xlink:")?t.setAttributeNS(Pg,e,n):e.startsWith("xml:")?t.setAttributeNS(Ig,e,n):t.setAttribute(e,n);}function Nr(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 l of e)Nr(t,l,n,o);return}if(!Oe(e))throw new TypeError("qrdx: can't render this value as DOM nodes");let{type:r,props:a}=e;if(Sn(r)){Nr(t,a.children,n,o);return}if(typeof r=="function"){Nr(t,r(a),n,o);return}if(!zo.test(r))throw new TypeError(`qrdx: invalid element name: ${r}`);let i=r==="svg"?sm:n,s=o.createElementNS(i,r);for(let l of Object.keys(a)){let c=Yn(l,a[l]);c&&Lg(s,c.name,c.value);}Nr(s,a.children,i===sm&&r==="foreignObject"?lm:i,o),t.appendChild(s);}function Ts(t,e=document){let n=e.createDocumentFragment();return Nr(n,t,lm,e),n}function sn(t){if(t==null||typeof t=="boolean")return "";if(typeof t=="string")return Ls(t);if(typeof t=="number"||typeof t=="bigint")return `${t}`;if(Array.isArray(t)){let e="";for(let n of t)e+=sn(n);return e}if(!Oe(t))throw new TypeError("qrdx: can't render this value as SVG markup");return Tg(t)}function Tg(t){let{type:e,props:n}=t;if(Sn(e))return sn(n.children);if(typeof e=="function")return sn(e(n));if(!zo.test(e))throw new TypeError(`qrdx: invalid element name: ${e}`);let o=`<${e}`;for(let i of Object.keys(n)){let s=Yn(i,n[i]);s&&(o+=` ${s.name}="${Ls(s.value)}"`);}if(im.has(e))return `${o}/>`;let r=n.dangerouslySetInnerHTML?.__html,a=r==null?sn(n.children):`${r}`;return `${o}>${a}</${e}>`}function ks(t){return sn(Lr(t))}function kg(t,e=document){return Ts(Lr(t),e).firstChild}var Fg=16384;var Fs=[17,18,0,1,2,3,4,5,16,6,7,8,9,10,11,12,13,14,15],Ng=8,Ns=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 hm(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,a=2*r-1,i=new Float64Array(a),s=new Int32Array(a),l=new Uint8Array(a);for(let c=1;;c*=2){for(let h=0;h<r;h++)i[h]=Math.max(t[o[h]]??0,c);let u=Array.from({length:r},(h,p)=>p).sort((h,p)=>i[h]-i[p]||h-p),m=0,f=r,d=h=>m<r&&(f>=h||i[u[m]]<=i[f])?u[m++]:f++;for(let h=r;h<a;h++){let p=d(h),b=d(h);i[h]=i[p]+i[b],s[p]=h,s[b]=h;}l[a-1]=0;let g=0;for(let h=a-2;h>=0;h--){let p=l[s[h]]+1;l[h]=p,h<r&&p>g&&(g=p);}if(g<=e){for(let h=0;h<r;h++)n[o[h]]=l[h];return n}}}function Og(t,e){let n=0;for(let o=0;o<e;o++)n=n<<1|t>>o&1;return n}function pm(t){let e=new Uint16Array(16),n=0;for(let s of t)s>0&&(e[s]=e[s]+1,n++);let o=new Uint16Array(16),r=0;for(let s=1;s<=15;s++)r=r+e[s-1]<<1,o[s]=r;let a=new Uint16Array(t.length),i=new Uint8Array(t.length);return t.forEach((s,l)=>{if(s===0)return;let c=o[s];o[s]=c+1,a[l]=Og(c,s),i[l]=n===1?0:s;}),{lengths:t,codes:a,emitted:i}}function ln(t,e,n){t.write(e.codes[n],e.emitted[n]);}function Dg(t){let e=[],n=a=>e.push({code:a,extra:0,extraBits:0}),o=Ng,r=0;for(;r<t.length;){let a=t[r],i=1;for(;r+i<t.length&&t[r+i]===a;)i++;r+=i;let s=i;if(a===0){for(;s>0;)if(s<3)for(;s>0;s--)n(0);else if(s<=10)e.push({code:17,extra:s-3,extraBits:3}),s=0;else {let l=Math.min(s,138);e.push({code:18,extra:l-11,extraBits:7}),s-=l;}continue}for(a!==o&&(n(a),o=a,s--);s>0;)if(s<3)for(;s>0;s--)n(a);else {let l=Math.min(s,6);e.push({code:16,extra:l-3,extraBits:2}),s-=l;}}return e}function Bg(t,e){let n=[];if(e.forEach((s,l)=>{s>0&&n.push(l);}),n.length<=2&&n.every(s=>s<256)){let[s=0,l]=n;t.write(1,1),t.write(n.length===2?1:0,1),s<2?(t.write(0,1),t.write(s,1)):(t.write(1,1),t.write(s,8)),l!==void 0&&t.write(l,8);return}let o=Dg(e),r=new Uint32Array(19);for(let s of o)r[s.code]=r[s.code]+1;let a=pm(hm(r,7)),i=Fs.length;for(;i>4&&a.lengths[Fs[i-1]]===0;)i--;t.write(0,1),t.write(i-4,4);for(let s=0;s<i;s++)t.write(a.lengths[Fs[s]],3);t.write(0,1);for(let s of o)ln(t,a,s.code),t.write(s.extra,s.extraBits);}function Wo(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 cm(t,e,n,o){let r=0;for(;r<o&&t[e+r]===t[e+r-n];)r++;return r}function um(t,e,n){let o=t.length,r=0;for(;r<o;){let a=Math.min(4096,o-r),i=r>=1?cm(t,r,1,a):0,s=r>=e?cm(t,r,e,a):0;if(Math.max(i,s)>=3){s>=i?(n.copy(s,e===1?2:1),r+=s):(n.copy(i,2),r+=i);continue}n.literal(t[r]),r++;}}var mm=20;function dm(t,e,n){for(let o=0;o<n.length;o++)t[e+o]=n.charCodeAt(o);}function fm(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 Ds(t,e,n){if(!(Number.isInteger(e)&&Number.isInteger(n))||e<1||n<1||e>16384||n>16384)throw new RangeError(`WebP images are 1 to 16384 pixels wide and high (got ${e} \xD7 ${n})`);let o=e*n;if(t.length<o*4)throw new RangeError(`Expected ${o*4} bytes of RGBA for ${e} \xD7 ${n}, got ${t.length}`);let r=new Uint32Array(o),a=false;for(let C=0;C<o;C++){let S=C*4,$=t[S],R=t[S+1],M=t[S+2],E=t[S+3];E!==255&&(a=true),r[C]=(E<<24|($-R&255)<<16|R<<8|M-R&255)>>>0;}let i=new Uint32Array(280),s=new Uint32Array(256),l=new Uint32Array(256),c=new Uint32Array(256),u=new Uint32Array(40);um(r,e,{literal(C){i[C>>>8&255]++,s[C>>>16&255]++,l[C&255]++,c[C>>>24]++;},copy(C,S){i[256+Wo(C).symbol]++,u[Wo(S).symbol]++;}});let m=[i,s,l,c,u].map(C=>hm(C,15)),[f,d,g,h,p]=m.map(pm),b=new Ns(Math.ceil(o/4)+1024);b.write(47,8),b.write(e-1,14),b.write(n-1,14),b.write(a?1:0,1),b.write(0,3),b.write(1,1),b.write(2,2),b.write(0,1),b.write(0,1),b.write(0,1);for(let C of m)Bg(b,C);um(r,e,{literal(C){ln(b,f,C>>>8&255),ln(b,d,C>>>16&255),ln(b,g,C&255),ln(b,h,C>>>24);},copy(C,S){let $=Wo(C);ln(b,f,256+$.symbol),b.write($.extra,$.extraBits);let R=Wo(S);ln(b,p,R.symbol),b.write(R.extra,R.extraBits);}});let _=b.finish(),y=_.length+(_.length&1),w=new Uint8Array(mm+y);return dm(w,0,"RIFF"),fm(w,4,w.length-8),dm(w,8,"WEBPVP8L"),fm(w,16,_.length),w.set(_,mm),w}function Os(t,e,n){return String.fromCharCode(...t.subarray(e,e+n))}function gm(t){return t.length>=12&&Os(t,0,4)==="RIFF"&&Os(t,8,4)==="WEBP"}function Bs(t){if(!gm(t))return null;let e=12;for(;e+8<=t.length;){let n=Os(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 Gg(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 qo(t,e={}){let n=e.quality!==void 0,o=n?Math.min(1,Math.max(0,Number(e.quality))):1,r=await Gg(t,"image/webp",o);if(r){let l=new Uint8Array(await r.arrayBuffer()),c=Bs(l);if(c==="lossless"||n&&c==="lossy")return new Blob([l],{type:"image/webp"})}let a=t.getContext("2d");if(!a)throw new Error("Could not get canvas context");let{data:i}=a.getImageData(0,0,t.width,t.height),s=Ds(i,t.width,t.height);return new Blob([s],{type:"image/webp"})}var bm=32768;async function Ot(t){let e=new Uint8Array(await t.arrayBuffer()),n="";for(let o=0;o<e.length;o+=bm)n+=String.fromCharCode(...e.subarray(o,o+bm));return `data:${t.type||"application/octet-stream"};base64,${btoa(n)}`}async function Xt(t){let e={...t};if(t.imageSettings?.src)try{let u=await Qg(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:a,frameLabelMarkers:i,partMarkers:s,...l}=e,c=ks({...l,templateId:e.templateId,customTemplate:e.customTemplate});return `data:image/svg+xml,${encodeURIComponent(c)}`}var Qg=t=>new Promise((e,n)=>{if(t.startsWith("data:")){e(t);return}let o=new Image;o.crossOrigin="anonymous",o.onload=()=>{try{let r=document.createElement("canvas");r.width=o.naturalWidth||o.width,r.height=o.naturalHeight||o.height;let a=r.getContext("2d");if(!a){n(new Error("Could not get canvas context"));return}a.drawImage(o,0,0);let i=r.toDataURL("image/png");r.remove(),e(i);}catch(r){n(new Error(`Failed to convert image to base64: ${r}`));}},o.onerror=()=>{n(new Error(`Could not load image from ${t.slice(0,100)}... Check CORS settings or use a data URL.`));},o.src=t;});async function ge(t,e,n){let o=await Xt(t),r=decodeURIComponent(o.replace("data:image/svg+xml,","")),a;try{let i=new TextEncoder().encode(r),s=Array.from(i,c=>String.fromCharCode(c)).join("");a=`data:image/svg+xml;base64,${btoa(s)}`;}catch(i){throw new Error(`Failed to encode SVG for canvas conversion: ${i}`)}return new Promise((i,s)=>{let l=document.createElement("canvas"),c=l.getContext("2d");if(!c){s(new Error("Could not get canvas context"));return}let u=new Image,{width:m,height:f}=me(t.size||it,t.frame);l.width=Math.round(m),l.height=Math.round(f);let d=setTimeout(()=>{l.remove(),s(new Error("SVG load timeout - image may be too large or contain invalid data"));},3e4);u.onload=()=>{clearTimeout(d);try{if(e==="image/jpeg"&&(c.fillStyle="white",c.fillRect(0,0,l.width,l.height)),c.drawImage(u,0,0,l.width,l.height),n)i(l);else if(e==="image/webp")qo(l).then(Ot).then(i,s).finally(()=>l.remove());else if(e==="image/bmp")Ot(Do(l)).then(i,s).finally(()=>l.remove());else if(e===Tr)Uo(l,t.value).then(Ot).then(i,s).finally(()=>l.remove());else if(e===an||e==="image/x-icon")Ot(rm(l)).then(i,s).finally(()=>l.remove());else {let g=l.toDataURL(e,1);l.remove(),i(g);}}catch(g){clearTimeout(d),l.remove(),s(new Error(`Failed to draw SVG to canvas: ${g}`));}},u.onerror=()=>{clearTimeout(d),l.remove(),s(new Error("Could not load SVG"));},u.src=a;})}var _m=["gradientUnits","gradientTransform","spreadMethod"],Ug={linear:["x1","y1","x2","y2"],radial:["cx","cy","r","fx","fy","fr"]},Hg={r:0,g:0,b:0,a:1};function ym(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 Gs(t){return t.name==="linearGradient"?"linear":t.name==="radialGradient"?"radial":null}function zg(t){let e=[],n=0;for(let o of t.children){if(o.name!=="stop")continue;let r=(o.attrs.offset??"0").trim(),a=Number.parseFloat(r),i=Number.isFinite(a)?r.endsWith("%")?a/100:a:0;n=Math.max(n,Math.min(Math.max(i,0),1));let s=ym(o,"stop-color")??"#000000",l=at(s==="currentColor"?"#000000":s)??Hg,c=Number.parseFloat(ym(o,"stop-opacity")??"1");e.push({offset:n,color:Number.isFinite(c)?{...l,a:l.a*Math.min(Math.max(c,0),1)}:l});}return e}function Vo(t){let e=new Map,n=r=>{let a=r.attrs.id;Gs(r)&&a&&!e.has(a)&&e.set(a,r);for(let i of r.children)n(i);};n(t);let o=new Map;for(let[r,a]of e){let i=Gs(a),s={},l=[],c=new Set,u=a;for(;u&&!c.has(u);){c.add(u);let m=Gs(u)===i?[..._m,...Ug[i]]:_m;for(let d of m){let g=u.attrs[d];s[d]===void 0&&g!==void 0&&(s[d]=g);}l.length===0&&(l=zg(u));let f=u.attrs.href??u.attrs["xlink:href"];u=f?.startsWith("#")?e.get(f.slice(1)):void 0;}o.set(r,{kind:i,attrs:s,stops:l});}return o}function Qs(t){let e=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,r=Number.NEGATIVE_INFINITY,a=(m,f)=>{e=Math.min(e,m),o=Math.max(o,m),n=Math.min(n,f),r=Math.max(r,f);},i=(m,f,d,g)=>{let h=-m+3*f-3*d+g,p=2*(m-2*f+d),b=f-m;if(Math.abs(h)<1e-12)return Math.abs(p)<1e-12?[]:[-b/p];let _=p*p-4*h*b;if(_<0)return [];let y=Math.sqrt(_);return [(-p+y)/(2*h),(-p-y)/(2*h)]},s=(m,f,d,g,h)=>{let p=1-m;return p*p*p*f+3*p*p*m*d+3*p*m*m*g+m**3*h},l=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")a(m.x,m.y),l=m.x,c=m.y;else if(m.op==="C"){a(m.x,m.y);for(let f of [...i(l,m.x1,m.x2,m.x),...i(c,m.y1,m.y2,m.y)])f>0&&f<1&&a(s(f,l,m.x1,m.x2,m.x),s(f,c,m.y1,m.y2,m.y));l=m.x,c=m.y;}else [l,c]=u;return Number.isFinite(e)?{x:e,y:n,width:o-e,height:r-n}:null}var Wg=t=>t[0]*t[3]-t[1]*t[2];function Pe(t){let e=Wg(t);if(!Number.isFinite(e)||Math.abs(e)<1e-12)return null;let[n,o,r,a,i,s]=t;return [a/e,-o/e,-r/e,n/e,(r*s-a*i)/e,(o*i-n*s)/e]}function $m(t,e,n){let{kind:o,attrs:r,stops:a}=t,i=a[0],s=a.at(-1);if(!(i&&s)||a.every(S=>S.color.a===0))return null;if(a.length===1)return i.color;let l=r.gradientUnits==="userSpaceOnUse",c=En;if(!l){let S=Qs(e);if(!S||S.width<=0||S.height<=0)return null;c=[S.width,0,0,S.height,S.x,S.y];}let u=mt(c,Ut(r.gradientTransform));if(!Pe(u))return s.color;let[m,f]=n,d=Math.sqrt((m*m+f*f)/2),g=(S,$)=>{let R=Number.parseFloat(S);return Number.isFinite(R)?S.trim().endsWith("%")?R/100*(l?$:1):R:null},h=(S,$,R)=>g(r[S]??$,R)??g($,R)??0;if(o==="linear"){let S=[h("x1","0%",m),h("y1","0%",f),h("x2","100%",m),h("y2","0%",f)],[$,R,M,E]=S;return $===M&&R===E?s.color:{kind:o,coords:S,matrix:u,stops:a}}let p=h("cx","50%",m),b=h("cy","50%",f),_=h("r","50%",d),y=r.fx===void 0?p:h("fx","50%",m),w=r.fy===void 0?b:h("fy","50%",f),C=Math.max(0,h("fr","0%",d));return _<0?null:_===0?s.color:{kind:o,coords:[y,w,C,p,b,_],matrix:u,stops:a}}function jo(t){return t.map(e=>x(e,6)).join(" ")}function qg(t,e){return (e==="cmyk"?we(t.r,t.g,t.b):[t.r/255,t.g/255,t.b/255]).map(o=>x(o,4)).join(" ")}var xm=(t,e)=>`<< /FunctionType 2 /Domain [0 1] /C0 [${t}] /C1 [${e}] /N 1 >>`;function Vg(t,e){let n=[],o=t.map(s=>J(s.offset,4)),r=t.map(s=>qg(s.color,e)),a=o[0],i=o.at(-1);if(a>0){let s=r[0];n.push({from:0,to:a,c0:s,c1:s});}for(let s=0;s+1<t.length;s++){let l=o[s],c=o[s+1];c>l&&n.push({from:l,to:c,c0:r[s],c1:r[s+1]});}if(i<1){let s=r.at(-1);n.push({from:i,to:1,c0:s,c1:s});}if(n.length===1){let[s]=n;return xm(s.c0,s.c1)}return ["<< /FunctionType 3 /Domain [0 1]",`/Functions [${n.map(s=>xm(s.c0,s.c1)).join(" ")}]`,`/Bounds [${n.slice(1).map(s=>x(s.from,4)).join(" ")}]`,`/Encode [${n.map(()=>"0 1").join(" ")}] >>`].join(" ")}function Xo(t,e){return [`<< /ShadingType ${t.kind==="linear"?2:3}`,`/ColorSpace /Device${e==="cmyk"?"CMYK":"RGB"}`,`/Coords [${t.coords.map(n=>x(n,6)).join(" ")}]`,`/Function ${Vg(t.stops,e)}`,"/Extend [true true] >>"].join(" ")}function jg(t,e){if(t.op==="Z")return t;if(t.op==="C"){let[r,a]=q(e,t.x1,t.y1),[i,s]=q(e,t.x2,t.y2),[l,c]=q(e,t.x,t.y);return {op:"C",x1:r,y1:a,x2:i,y2:s,x:l,y:c}}let[n,o]=q(e,t.x,t.y);return {op:t.op,x:n,y:o}}function Zo(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 Sm={r:255,g:255,b:255,a:1},Xg=/^url\(\s*#bg-color-/,Yo=/^url\(\s*#([^)\s]+)\s*\)/,Yg=new Set(["defs","clipPath","mask","pattern","linearGradient","radialGradient","symbol","title","desc","metadata","style","script","use","foreignObject"]);function j(t,e){let n=t.attrs.style;if(n)for(let o of n.split(";")){let[r,...a]=o.split(":");if(r?.trim()===e)return a.join(":").trim()}return t.attrs[e]}function V(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 Or(t,e){if((t.name==="linearGradient"||t.name==="radialGradient")&&t.attrs.id){let n=t.children.find(r=>r.name==="stop"),o=n&&(j(n,"stop-color")??"#000000");o&&e.set(t.attrs.id,o);}for(let n of t.children)Or(n,e);return e}function Dr(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)Dr(n,e);return e}function Ko(t){return /^data:image\/png[;,]/i.test(t)?"PNG":/^data:image\/jpe?g[;,]/i.test(t)?"JPEG":null}async function Jo(t){return typeof document>"u"||typeof Image>"u"?null:await new Promise(e=>{let n=new Image;n.crossOrigin="anonymous",n.onload=()=>{let o=document.createElement("canvas"),r=Math.max(n.naturalWidth||512,n.naturalHeight||512),a=Math.min(1024/r,4);o.width=Math.round((n.naturalWidth||512)*a),o.height=Math.round((n.naturalHeight||512)*a);let i=o.getContext("2d");if(!i){e(null);return}i.drawImage(n,0,0,o.width,o.height);try{e(o.toDataURL("image/png"));}catch{e(null);}},n.onerror=()=>e(null),n.src=t;})}function wm(t,e,n){let o={x:V(t.attrs.x,e[0]),y:V(t.attrs.y,e[1]),width:V(t.attrs.width,e[0]),height:V(t.attrs.height,e[1])};if(o.width<=0||o.height<=0)return null;let r=(t.attrs.preserveAspectRatio??"").trim();if(!r||r.startsWith("none")||!n||!(n.width>0&&n.height>0))return {draw:o,clip:null};let[a="xMidYMid",i="meet"]=r.split(/\s+/),s=i==="slice",l=(s?Math.max:Math.min)(o.width/n.width,o.height/n.height),c=n.width*l,u=n.height*l,m=f=>{let d=f==="x"?a.slice(0,4):a.slice(4);return d.endsWith("Min")?0:d.endsWith("Max")?1:.5};return {draw:{x:o.x+(o.width-c)*m("x"),y:o.y+(o.height-u)*m("y"),width:c,height:u},clip:s?o:null}}function Cm(t,e){t.name==="clipPath"&&t.attrs.id&&e.set(t.attrs.id,t);for(let n of t.children)Cm(n,e);return e}function Rm(t,e){t.name==="pattern"&&t.attrs.id&&e.set(t.attrs.id,t);for(let n of t.children)Rm(n,e);return e}function Zg(t,e){let[n,o]=e,r=(a,i)=>V(t.attrs[a],i);switch(t.name){case "path":return le(t.attrs.d??"");case "rect":{let a=t.attrs.rx??t.attrs.ry,i=t.attrs.ry??t.attrs.rx;return ne(r("x",n),r("y",o),r("width",n),r("height",o),V(a,n),V(i,o))}case "circle":{let a=r("r",Math.hypot(n,o)/Math.SQRT2);return ee(r("cx",n),r("cy",o),a,a)}case "ellipse":return ee(r("cx",n),r("cy",o),r("rx",n),r("ry",o));default:return []}}var Zn=class{gradients;shadings;clipPaths=new Map;patterns=new Map;backdrop=Sm;paper=Sm;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=Yo.exec(e);if(n)return this.resolveColor(this.gradients.get(n[1]));let o=at(e==="currentColor"?"#000000":e);return o&&o.a>0?o:null}shadedGradient(e){let n=e?Yo.exec(e)?.[1]:void 0;return n?this.shadings?.get(n):void 0}resolveFill(e,n,o,r=1){if(r<=0)return null;let a=this.patternOf(e);if(a)return {pattern:a,alpha:r};let i=this.shadedGradient(e);if(i){let c=$m(i,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 s=this.resolveColor(e);if(!s)return null;let l={...s,a:s.a*r};return l.a>0?{color:l}:null}patternOf(e){let n=e?Yo.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 To(e,this.onPaper||o?this.paper:this.backdrop)}paintPattern(e,n,o,r){let a=Qs(e);if(!a||a.width<=0||a.height<=0)return true;let[i,s]=n.viewport,l=V(o.attrs.x,i),c=V(o.attrs.y,s),u=V(o.attrs.width,i),m=V(o.attrs.height,s);if(!(u>0&&m>0))return true;let f=Ut(o.attrs.patternTransform),d=Pe(f);if(!d)return true;if(!this.beginClip(e,n.matrix,n.fillRule==="evenodd"))return false;let g=this.inConic;this.inConic=o.attrs["data-qrdx-conic"]!==void 0;try{let h=[q(d,a.x,a.y),q(d,a.x+a.width,a.y),q(d,a.x,a.y+a.height),q(d,a.x+a.width,a.y+a.height)],p=h.map(([L])=>L),b=h.map(([,L])=>L),_=Math.min(...p),y=Math.max(...p),w=Math.min(...b),C=Math.max(...b),S=Math.floor((_-l)/u),$=Math.ceil((y-l)/u)-1,R=Math.floor((w-c)/m),M=Math.ceil((C-c)/m)-1,E=($-S+1)*(M-R+1);if(E>4096)return !0;let P=(o.attrs["data-qrdx-conic"]??"").trim().split(/\s+/).map(Number),v=mt(n.matrix,f);for(let L=R;L<=M;L++)for(let F=S;F<=$;F++){let k=l+F*u,T=c+L*m,z=mt(v,[1,0,0,1,k,T]),W={x:_-k,y:w-T,width:y-_,height:C-w},D=P.length===2&&P.every(Number.isFinite)?L0(P[0],P[1],W):null,U=E>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 X={matrix:z,viewport:n.viewport,fill:"#000000",fillRule:"nonzero",stroke:"none",strokeWidth:1,fontSize:16,fontWeight:"normal",textAnchor:"start",fillOpacity:1,opacity:r},xt=(lt,N)=>{for(let B of lt){if(B.name==="g"&&!B.attrs.transform){let Z=Number.parseFloat(B.attrs.opacity??"1");xt(B.children,{...N,opacity:(N.opacity??1)*(Number.isFinite(Z)?Z:1)});continue}if(D&&B.attrs["data-arc"]){let[Z,Pt]=B.attrs["data-arc"].split(/\s+/).map(Number);if(!T0([Z,Z+Pt],D))continue}this.walk(B,N);}};xt(o.children,X);}finally{U&&this.endClip();}}}finally{this.inConic=g,this.endClip();}return true}paintBleed(e,n,o,r){if(!this.shadedGradient(o))return false;let[a,i]=this.viewportMatrix({...e,attrs:{...e.attrs,x:"0",y:"0"}},{...n,matrix:mt(n.matrix,Ut(e.attrs.transform))}),s=Pe(a);if(!s)return false;let[l,c,u,m]=r,d=[[l,c],[u,c],[u,m],[l,m]].map(([g,h])=>q(s,g,h)).map(([g,h],p)=>({op:p===0?"M":"L",x:g,y:h}));return d.push({op:"Z"}),this.paint(d,{name:"rect",attrs:{},children:[],text:""},{...n,matrix:a,viewport:i,fill:o,fillRule:"nonzero",stroke:"none"}),true}beginClip(e,n,o){return false}endClip(){}clipOf(e,n){let o=j(e,"clip-path"),r=o?Yo.exec(o)?.[1]:void 0,a=r?this.clipPaths.get(r):void 0;if(!a)return null;let i=[],s=false;for(let l of a.children){let c=Zg(l,n.viewport);if(c.length===0)continue;let u=Ut(l.attrs.transform),m=u[0]===1&&u[1]===0&&u[2]===0&&u[3]===1&&u[4]===0&&u[5]===0;i.push(...m?c:c.map(f=>jg(f,u))),s||=j(l,"clip-rule")==="evenodd";}return i.length>0?{segments:i,matrix:n.matrix,evenOdd:s}:null}viewportMatrix(e,n){let o=V(e.attrs.x,n.viewport[0]),r=V(e.attrs.y,n.viewport[1]),a=V(e.attrs.width,n.viewport[0],n.viewport[0]),i=V(e.attrs.height,n.viewport[1],n.viewport[1]),s=te(e.attrs.viewBox);if(s.length!==4||!(s[2]&&s[3]))return [mt(n.matrix,[1,0,0,1,o,r]),[a,i]];let[l,c,u,m]=s,f=a/u,d=i/m,g=o,h=r;if((e.attrs.preserveAspectRatio??"").trim()!=="none"){let p=e.attrs.preserveAspectRatio?.includes("slice")?Math.max(f,d):Math.min(f,d);g+=(a-u*p)/2,h+=(i-m*p)/2,f=p,d=p;}return [mt(n.matrix,[f,0,0,d,g-l*f,h-c*d]),[u,m]]}walk(e,n,o=false){if(o&&(this.clipPaths=Cm(e,new Map),this.patterns=Rm(e,new Map)),Yg.has(e.name)||j(e,"display")==="none"||j(e,"visibility")==="hidden")return;let r=mt(n.matrix,Ut(e.attrs.transform)),a=n.viewport;if(e.name==="svg"){let[f,d]=this.viewportMatrix(o?{...e,attrs:{...e.attrs,x:"0",y:"0"}}:e,{...n,matrix:r});r=f,a=d;}let i=j(e,"font-size"),s=Number.parseFloat(j(e,"opacity")??"1"),l=j(e,"fill-opacity"),c=l===void 0?n.fillOpacity??1:Number.parseFloat(l),u={fillOpacity:Number.isFinite(c)?Math.min(Math.max(c,0),1):1,opacity:(n.opacity??1)*(Number.isFinite(s)?Math.min(Math.max(s,0),1):1),matrix:r,viewport:a,fill:j(e,"fill")??n.fill,fillRule:j(e,"fill-rule")??n.fillRule,stroke:j(e,"stroke")??n.stroke,strokeWidth:j(e,"stroke-width")===void 0?n.strokeWidth:V(j(e,"stroke-width"),a[0],1),strokeLinejoin:j(e,"stroke-linejoin")??n.strokeLinejoin,strokeLinecap:j(e,"stroke-linecap")??n.strokeLinecap,fontSize:i===void 0?n.fontSize:V(i,16,16),fontWeight:j(e,"font-weight")??n.fontWeight,textAnchor:j(e,"text-anchor")??n.textAnchor},m=this.onPaper;(e.name==="rect"||e.name==="circle"||e.name==="path")&&Xg.test(j(e,"fill")??"")&&(this.onPaper=true);try{let f=e.attrs["clip-path"]?this.clipOf(e,u):null;if(f&&this.beginClip(f.segments,f.matrix,f.evenOdd)){try{this.paintNode(e,u);}finally{this.endClip();}return}this.paintNode(e,u);}finally{this.onPaper=m;}}paintNode(e,n){let[o,r]=n.viewport,a=(i,s)=>V(e.attrs[i],s);switch(e.name){case "path":this.paint(le(e.attrs.d??""),e,n);return;case "rect":{let i=e.attrs.rx??e.attrs.ry,s=e.attrs.ry??e.attrs.rx;this.paint(ne(a("x",o),a("y",r),a("width",o),a("height",r),V(i,o),V(s,r)),e,n);return}case "circle":{let i=a("r",Math.hypot(o,r)/Math.SQRT2);this.paint(ee(a("cx",o),a("cy",r),i,i),e,n);return}case "ellipse":this.paint(ee(a("cx",o),a("cy",r),a("rx",o),a("ry",r)),e,n);return;case "line":this.paint([{op:"M",x:a("x1",o),y:a("y1",r)},{op:"L",x:a("x2",o),y:a("y2",r)}],e,{...n,fill:"none"});return;case "polygon":case "polyline":{let i=te(e.attrs.points),s=[];for(let l=0;l+1<i.length;l+=2)s.push({op:l===0?"M":"L",x:i[l],y:i[l+1]});e.name==="polygon"&&s.length>0&&s.push({op:"Z"}),this.paint(s,e,n);return}case "text":this.text(e,n);return;case "image":this.image(e,n);return;default:for(let i of e.children)this.walk(i,n);}}};var ta=1e3;async function Br(t){let e=await Xt(Ie({...t,size:t.size??it},ta));return decodeURIComponent(e.replace("data:image/svg+xml,",""))}function Us(t){if(Nt(t.frame)){let e=Xe(ta,t.frame);return e.squareEdges?e.color:null}if(t.backdrop&&t.bgRadius){let e=dt.QrCode.encodeText(t.value,St[At(t)]).size,n=Et(e,t.margin??pt,t.shape);if(Hn(t.bgRadius,e,n,t.shape)>0)return _t(t.backdrop,ft)}return _t(t.bgColor,ft)}function ea(t,e){let n=Us(t);if(!(n&&Ke(t.bgColor))||Nt(t.frame)||t.templateId||t.customTemplate)return n;let o=xe(e)?.children.find(a=>a.name==="rect"),r=o&&j(o,"fill");return r?.startsWith("url(")?r:n}function na(t,e){let n={r:255,g:255,b:255,a:1},o=at(_t(e.bgColor,ft));t.paper=n,t.background=o&&!Ke(e.bgColor)?o:null,t.backdrop=o?To(o,n):n;}var ra=25.4,Mm=5,Em=2e3,be=ta,Hs=5,Am=2,Jg=.25*(ra/72);function t2(t,e="mm"){return e==="in"?t*ra:t}function e2(t){let e=At(t),n=dt.QrCode.encodeText(t.value,St[e]).size;return n+Et(n,t.margin??pt,t.shape)*2}function oa(t,e){let n=t2(e.size,e.unit);if(!Number.isFinite(n)||n<Mm||n>Em)throw new Error(`Print size must be between ${Mm} mm and ${Em/1e3} m`);let o=Math.min(Math.max(e.bleed??0,0),20),r=n/be,a=Nt(t.frame)?Xe(be,t.frame):null,i=(a?.width??be)*r,s=(a?.height??be)*r,l=e.cropMarks?o+Am+Hs+1:o,c=e2(t);return {codeWidth:n,trimWidth:i,trimHeight:s,bleed:o,pageWidth:i+2*l,pageHeight:s+2*l,trimX:l,trimY:l,moduleSize:n/c,moduleCount:c,maxScanDistance:n*10}}var zs=class t{pdf;internals;names=new Map;constructor(e,n){this.pdf=e,this.internals=n;}static attach(e){let n=e.internal;return typeof e.advancedAPI!="function"||typeof e.addShadingPattern!="function"||typeof n.write!="function"||typeof n.events?.subscribe!="function"?null:new t(e,n)}name(e){let n=this.names.get(e);return n||(this.names.size===0&&this.install(),n=`Sh${this.names.size}`,this.names.set(e,n)),n}install(){this.pdf.advancedAPI(e=>{e.addShadingPattern("qrdx-shadings",{});}),this.internals.events.subscribe("putShadingPatternDict",()=>{for(let[e,n]of this.names)this.internals.write(`/${n} ${e}`);});}},Ws=class extends Zn{pdf;cmyk;images;shadingResources;constructor(e,n,o,r,a){super(o,r?.gradients??null),this.pdf=e,this.cmyk=n,this.images=a,this.shadingResources=r?.resources??null;}setColor(e,n){let o=e==="fill"?this.pdf.setFillColor.bind(this.pdf):e==="draw"?this.pdf.setDrawColor.bind(this.pdf):this.pdf.setTextColor.bind(this.pdf);if(this.cmyk){let[r,a,i,s]=we(n.r,n.g,n.b);o(r,a,i,s);}else o(Math.round(n.r),Math.round(n.g),Math.round(n.b));}setRegistrationColor(){this.cmyk?this.pdf.setDrawColor(1,1,1,1):this.pdf.setDrawColor(0,0,0);}tracePath(e,n){let o=false;for(let r of e)if(r.op==="M"){let[a,i]=q(n,r.x,r.y);this.pdf.moveTo(a,i),o=true;}else if(r.op==="L"){let[a,i]=q(n,r.x,r.y);o?this.pdf.lineTo(a,i):(this.pdf.moveTo(a,i),o=true);}else if(r.op==="C"){let[a,i]=q(n,r.x1,r.y1),[s,l]=q(n,r.x2,r.y2),[c,u]=q(n,r.x,r.y);this.pdf.curveTo(a,i,s,l,c,u);}else o&&this.pdf.close();}shade(e,n,o){let r=this.pdf.internal,a=r.scaleFactor,i=[a,0,0,-a,0,r.pageSize.getHeight()*a],s=mt(i,mt(n.matrix,o.matrix));if(!(this.shadingResources&&Pe(s)))return;let l=this.shadingResources.name(Xo(o,this.cmyk?"cmyk":"rgb"));this.pdf.saveGraphicsState(),this.tracePath(e,n.matrix),this.pdf.clip(n.fillRule==="evenodd"?"evenodd":void 0),this.pdf.discardPath(),r.write(`${jo(s)} cm /${l} sh`),this.pdf.restoreGraphicsState();}beginClip(e,n,o){return this.pdf.saveGraphicsState(),this.tracePath(e,n),this.pdf.clip(o?"evenodd":void 0),this.pdf.discardPath(),true}endClip(){this.pdf.restoreGraphicsState();}withAlpha(e,n,o){if(e>=1&&n>=1){o();return}this.pdf.saveGraphicsState();let r=this.pdf.GState;this.pdf.setGState(new r({opacity:e,"stroke-opacity":n}));try{o();}finally{this.pdf.restoreGraphicsState();}}opaqueGradient(e,n){let o=e.stops[0]?.color.a??1;return e.stops.every(a=>Math.abs(a.color.a-o)<.002)?{gradient:{...e,stops:e.stops.map(a=>({...a,color:{...a.color,a:1}}))},alpha:o*n}:{gradient:{...e,stops:e.stops.map(a=>({...a,color:this.flatten({...a.color,a:a.color.a*n})}))},alpha:1}}paint(e,n,o){if(e.length===0)return;let r=o.opacity??1;if(r<=0)return;let a=this.resolveFill(o.fill,e,o.viewport,(o.fillOpacity??1)*r);if(a&&"pattern"in a)this.paintPattern(e,o,a.pattern,a.alpha);else if(a&&"gradient"in a){let{gradient:m,alpha:f}=this.opaqueGradient(a.gradient,a.alpha);this.withAlpha(f,1,()=>this.shade(e,o,m));}let i=a&&"color"in a?a.color:null,s=i&&this.inConic?this.flatten(i):i,l=o.strokeWidth>0?this.resolveColor(o.stroke):null,c=l&&{...l,a:l.a*r};if(!(s||c))return;let u=o.fillRule==="evenodd";this.withAlpha(s?.a??1,c?.a??1,()=>{s&&this.setColor("fill",s);let m=c?Zo(o):{join:0,cap:0};c&&(this.setColor("draw",c),this.pdf.setLineWidth(o.strokeWidth*An(o.matrix)),(m.join||m.cap)&&(this.pdf.setLineJoin(m.join),this.pdf.setLineCap(m.cap))),this.tracePath(e,o.matrix),s&&c?u?this.pdf.fillStrokeEvenOdd():this.pdf.fillStroke():s?u?this.pdf.fillEvenOdd():this.pdf.fill():this.pdf.stroke(),(m.join||m.cap)&&(this.pdf.setLineJoin(0),this.pdf.setLineCap(0));});}text(e,n){let o=e.text.replace(/\s+/g," ").trim(),r=this.resolveColor(n.fill);if(!(o&&r))return;let a=An(n.matrix),[i,s]=q(n.matrix,V(e.attrs.x,n.viewport[0]),V(e.attrs.y,n.viewport[1])),l=n.fontWeight==="bold"||Number.parseInt(n.fontWeight,10)>=600;this.pdf.setFont("helvetica",l?"bold":"normal");let c=n.fontSize*a*(72/ra);this.pdf.setFontSize(c);let u=Number.parseFloat(e.attrs["data-max-width"]??"");if(u>0){let d=u*a,g=this.pdf.getTextWidth(o);g>d&&(c*=d/g,this.pdf.setFontSize(c));}this.setColor("text",r);let m=Math.atan2(n.matrix[1],n.matrix[0]);if(Math.abs(m)>2e-4){let d=n.textAnchor==="middle"?this.pdf.getTextWidth(o)/2:n.textAnchor==="end"?this.pdf.getTextWidth(o):0;this.pdf.text(o,i-d*Math.cos(m),s-d*Math.sin(m),{angle:-m*180/Math.PI,baseline:"alphabetic"});return}let f=n.textAnchor==="middle"?"center":n.textAnchor==="end"?"right":"left";this.pdf.text(o,i,s,{align:f,baseline:"alphabetic"});}aliases=new Map;image(e,n){let o=e.attrs.href??e.attrs["xlink:href"],r=o&&(Ko(o)?o:this.images.get(o)),a=r&&Ko(r);if(!(r&&a))return;let i=this.aliases.get(r);i||(i=`qrdx-image-${this.aliases.size}`,this.aliases.set(r,i));let s=null;if(e.attrs.preserveAspectRatio)try{let p=this.pdf.getImageProperties(r);s={width:p.width,height:p.height};}catch{s=null;}let l=wm(e,n.viewport,s);if(!l)return;let{draw:c,clip:u}=l,[m,f]=q(n.matrix,c.x,c.y),[d,g]=q(n.matrix,c.x+c.width,c.y+c.height),h=u!==null&&this.beginClip([{op:"M",x:u.x,y:u.y},{op:"L",x:u.x+u.width,y:u.y},{op:"L",x:u.x+u.width,y:u.y+u.height},{op:"L",x:u.x,y:u.y+u.height},{op:"Z"}],n.matrix,false);try{this.withAlpha(n.opacity??1,1,()=>{this.pdf.addImage(r,a,Math.min(m,d),Math.min(f,g),Math.abs(d-m),Math.abs(g-f),i);});}finally{h&&this.endClip();}}};function n2(t,e,n){let{trimX:o,trimY:r,trimWidth:a,trimHeight:i,bleed:s}=n,l=s+Am,c=o,u=o+a,m=r,f=r+i;e.setRegistrationColor(),t.setLineWidth(Jg);for(let d of [c,u]){let g=d===c?-1:1;for(let h of [m,f]){let p=h===m?-1:1;t.line(d+g*l,h,d+g*(l+Hs),h),t.line(d,h+p*l,d,h+p*(l+Hs));}}}async function r2(t,e){return (await Pm(t,e)).output("dataurlstring")}async function vx(t,e){return (await Pm(t,e)).output("arraybuffer")}async function Pm(t,e){let n=oa(t,e),o;try{({jsPDF:o}=await import('jspdf'));}catch(b){throw new Error(`PDF export needs the optional "jspdf" package. Install it with \`npm install jspdf\`. (${b})`)}let r=await Br(t),a=xe(r);if(!a)throw new Error("Failed to render the QR code for printing");let i=new Map;for(let b of Dr(a,new Set))if(!Ko(b)){let _=await Jo(b);_&&i.set(b,_);}let s=new o({orientation:n.pageWidth>n.pageHeight?"landscape":"portrait",unit:"mm",format:[n.pageWidth,n.pageHeight],compress:true,floatPrecision:3});s.setProperties({title:"QR code",creator:"qrdx"});let l=Vo(a),c=l.size>0?zs.attach(s):null,u=new Ws(s,e.colorMode==="cmyk",Or(a,new Map),c?{gradients:l,resources:c}:null,i);na(u,t);let m=n.codeWidth/be,f=V(a.attrs.width,be,be),d=V(a.attrs.height,be,be),g={matrix:mt([1,0,0,1,n.trimX,n.trimY],[m,0,0,m,0,0]),viewport:[f,d],fill:"#000000",fillRule:"nonzero",stroke:"none",strokeWidth:1,fontSize:16,fontWeight:"normal",textAnchor:"start"},h=n.bleed>0?ea(t,r):null,p=[n.trimX-n.bleed,n.trimY-n.bleed,n.trimX+n.trimWidth+n.bleed,n.trimY+n.trimHeight+n.bleed];if(!(h&&u.paintBleed(a,g,h,p))){let b=h?u.resolveColor(h):null;b&&(u.setColor("fill",b),s.rect(n.trimX-n.bleed,n.trimY-n.bleed,n.trimWidth+2*n.bleed,n.trimHeight+2*n.bleed,"F"));}return u.walk(a,g,true),e.cropMarks&&n2(s,u,n),s}async function o2(t,e){let n=oa(t,{size:e.size,unit:e.unit}),o=await Br(t),r=e.unit??"mm",a=l=>`${x(r==="in"?l/ra:l)}${r}`,i=/^<svg\b[^>]*>/.exec(o)?.[0];if(!i)throw new Error("Failed to render the QR code for printing");return `<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
${i.replace(/\swidth="[^"]*"/,` width="${a(n.trimWidth)}"`).replace(/\sheight="[^"]*"/,` height="${a(n.trimHeight)}"`)}${o.slice(i.length)}`}async function
|
|
3
|
-
`,n=0);};for(let r=0;r<
|
|
1
|
+
'use strict';var react=require('react'),schemas_js=require('./schemas.js'),framesIndex_js=require('./frames-index.js'),framesOfficial_js=require('./frames-official.js'),qrCodeCanvas_js=require('./qr-code-canvas.js');function Be(e){return e.children}var kd=e=>e==null?null:`${e}`;function Fa(e,t,n){let o=t??{},r=n;if("key"in o){let{key:a,...i}=o;a!==void 0&&(r=a),o=i;}return {type:e,props:o,key:kd(r)}}function Fd(e,t){let n=e;return {type:n.type,props:{...n.props,...t},key:n.key??null}}function Nd(e,t,...n){let o={...t};return n.length>0&&(o.children=n.length===1?n[0]:n),Fa(e,o)}var Od={jsx:Fa,jsxs:Fa,createElement:Nd,cloneElement:Fd,Fragment:Be},bt=Od;function $n(e,t){let n=bt;bt=e;try{return t()}finally{bt=n;}}var Na=e=>e===Be?bt.Fragment:e;function A(e,t,n){return bt.jsx(Na(e),t,n)}function $e(e,t,n){return bt.jsxs(Na(e),t,n)}function Vr(e,t,...n){return bt.createElement(Na(e),t??null,...n)}function Nt(e,t){return bt.cloneElement(e,t)}var Dd=new Set([Symbol.for("react.element"),Symbol.for("react.transitional.element")]),Gl=Symbol.for("react.fragment");function Ot(e){if(typeof e!="object"||e===null||Array.isArray(e))return false;let t=e;return t.$$typeof!==void 0&&!Dd.has(t.$$typeof)?false:(typeof t.type=="string"||typeof t.type=="function"||t.type===Gl)&&typeof t.props=="object"&&t.props!==null}var Sn=e=>e===Be||e===Gl;var wn;(a=>{class e{constructor(s,l,c,u){this.version=s;this.errorCorrectionLevel=l;if(s<e.MIN_VERSION||s>e.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=s*4+17;let m=[];for(let d=0;d<this.size;d++)m.push(false);for(let d=0;d<this.size;d++)this.modules.push(m.slice()),this.isFunction.push(m.slice());this.drawFunctionPatterns();let f=this.addEccAndInterleave(c);if(this.drawCodewords(f),u==-1){let d=1e9;for(let g=0;g<8;g++){this.applyMask(g),this.drawFormatBits(g);let h=this.getPenaltyScore();h<d&&(u=g,d=h),this.applyMask(g);}}o(0<=u&&u<=7),this.mask=u,this.applyMask(u),this.drawFormatBits(u),this.isFunction=[];}version;errorCorrectionLevel;static encodeText(s,l){let c=a.QrSegment.makeSegments(s);return e.encodeSegments(c,l)}static encodeBinary(s,l){let c=a.QrSegment.makeBytes(s);return e.encodeSegments([c],l)}static encodeSegments(s,l,c=1,u=40,m=-1,f=true){if(!(e.MIN_VERSION<=c&&c<=u&&u<=e.MAX_VERSION)||m<-1||m>7)throw new RangeError("Invalid value");let d,g;for(d=c;;d++){let _=e.getNumDataCodewords(d,l)*8,y=r.getTotalBits(s,d);if(y<=_){g=y;break}if(d>=u)throw new RangeError("Data too long")}for(let _ of [e.Ecc.MEDIUM,e.Ecc.QUARTILE,e.Ecc.HIGH])f&&g<=e.getNumDataCodewords(d,_)*8&&(l=_);let h=[];for(let _ of s){t(_.mode.modeBits,4,h),t(_.numChars,_.mode.numCharCountBits(d),h);for(let y of _.getData())h.push(y);}o(h.length==g);let p=e.getNumDataCodewords(d,l)*8;o(h.length<=p),t(0,Math.min(4,p-h.length),h),t(0,(8-h.length%8)%8,h),o(h.length%8==0);for(let _=236;h.length<p;_^=253)t(_,8,h);let b=[];for(;b.length*8<h.length;)b.push(0);return h.forEach((_,y)=>b[y>>>3]|=_<<7-(y&7)),new e(d,l,b,m)}size;mask;modules=[];isFunction=[];getModule(s,l){return 0<=s&&s<this.size&&0<=l&&l<this.size&&this.modules[l][s]}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 s=this.getAlignmentPatternPositions(),l=s.length;for(let c=0;c<l;c++)for(let u=0;u<l;u++)c==0&&u==0||c==0&&u==l-1||c==l-1&&u==0||this.drawAlignmentPattern(s[c],s[u]);this.drawFormatBits(0),this.drawVersion();}drawFormatBits(s){let l=this.errorCorrectionLevel.formatBits<<3|s,c=l;for(let m=0;m<10;m++)c=c<<1^(c>>>9)*1335;let u=(l<<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 s=this.version;for(let c=0;c<12;c++)s=s<<1^(s>>>11)*7973;let l=this.version<<12|s;o(l>>>18==0);for(let c=0;c<18;c++){let u=n(l,c),m=this.size-11+c%3,f=Math.floor(c/3);this.setFunctionModule(m,f,u),this.setFunctionModule(f,m,u);}}drawFinderPattern(s,l){for(let c=-4;c<=4;c++)for(let u=-4;u<=4;u++){let m=Math.max(Math.abs(u),Math.abs(c)),f=s+u,d=l+c;0<=f&&f<this.size&&0<=d&&d<this.size&&this.setFunctionModule(f,d,m!=2&&m!=4);}}drawAlignmentPattern(s,l){for(let c=-2;c<=2;c++)for(let u=-2;u<=2;u++)this.setFunctionModule(s+u,l+c,Math.max(Math.abs(u),Math.abs(c))!=1);}setFunctionModule(s,l,c){this.modules[l][s]=c,this.isFunction[l][s]=true;}addEccAndInterleave(s){let l=this.version,c=this.errorCorrectionLevel;if(s.length!=e.getNumDataCodewords(l,c))throw new RangeError("Invalid argument");let u=e.NUM_ERROR_CORRECTION_BLOCKS[c.ordinal][l],m=e.ECC_CODEWORDS_PER_BLOCK[c.ordinal][l],f=Math.floor(e.getNumRawDataModules(l)/8),d=u-f%u,g=Math.floor(f/u),h=[],p=e.reedSolomonComputeDivisor(m);for(let _=0,y=0;_<u;_++){let w=s.slice(y,y+g-m+(_<d?0:1));y+=w.length;let C=e.reedSolomonComputeRemainder(w,p);_<d&&w.push(0),h.push(w.concat(C));}let b=[];for(let _=0;_<h[0].length;_++)h.forEach((y,w)=>{(_!=g-m||w>=d)&&b.push(y[_]);});return o(b.length==f),b}drawCodewords(s){if(s.length!=Math.floor(e.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let l=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 f=c-m,g=(c+1&2)==0?this.size-1-u:u;!this.isFunction[g][f]&&l<s.length*8&&(this.modules[g][f]=n(s[l>>>3],7-(l&7)),l++);}}o(l==s.length*8);}applyMask(s){if(s<0||s>7)throw new RangeError("Mask value out of range");for(let l=0;l<this.size;l++)for(let c=0;c<this.size;c++){let u;switch(s){case 0:u=(c+l)%2==0;break;case 1:u=l%2==0;break;case 2:u=c%3==0;break;case 3:u=(c+l)%3==0;break;case 4:u=(Math.floor(c/3)+Math.floor(l/2))%2==0;break;case 5:u=c*l%2+c*l%3==0;break;case 6:u=(c*l%2+c*l%3)%2==0;break;case 7:u=((c+l)%2+c*l%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[l][c]&&u&&(this.modules[l][c]=!this.modules[l][c]);}}getPenaltyScore(){let s=0;for(let m=0;m<this.size;m++){let f=false,d=0,g=[0,0,0,0,0,0,0];for(let h=0;h<this.size;h++)this.modules[m][h]==f?(d++,d==5?s+=e.PENALTY_N1:d>5&&s++):(this.finderPenaltyAddHistory(d,g),f||(s+=this.finderPenaltyCountPatterns(g)*e.PENALTY_N3),f=this.modules[m][h],d=1);s+=this.finderPenaltyTerminateAndCount(f,d,g)*e.PENALTY_N3;}for(let m=0;m<this.size;m++){let f=false,d=0,g=[0,0,0,0,0,0,0];for(let h=0;h<this.size;h++)this.modules[h][m]==f?(d++,d==5?s+=e.PENALTY_N1:d>5&&s++):(this.finderPenaltyAddHistory(d,g),f||(s+=this.finderPenaltyCountPatterns(g)*e.PENALTY_N3),f=this.modules[h][m],d=1);s+=this.finderPenaltyTerminateAndCount(f,d,g)*e.PENALTY_N3;}for(let m=0;m<this.size-1;m++)for(let f=0;f<this.size-1;f++){let d=this.modules[m][f];d==this.modules[m][f+1]&&d==this.modules[m+1][f]&&d==this.modules[m+1][f+1]&&(s+=e.PENALTY_N2);}let l=0;for(let m of this.modules)l=m.reduce((f,d)=>f+(d?1:0),l);let c=this.size*this.size,u=Math.ceil(Math.abs(l*20-c*10)/c)-1;return o(0<=u&&u<=9),s+=u*e.PENALTY_N4,o(0<=s&&s<=2568888),s}getAlignmentPatternPositions(){if(this.version==1)return [];{let s=Math.floor(this.version/7)+2,l=this.version==32?26:Math.ceil((this.version*4+4)/(s*2-2))*2,c=[6];for(let u=this.size-7;c.length<s;u-=l)c.splice(1,0,u);return c}}static getNumRawDataModules(s){if(s<e.MIN_VERSION||s>e.MAX_VERSION)throw new RangeError("Version number out of range");let l=(16*s+128)*s+64;if(s>=2){let c=Math.floor(s/7)+2;l-=(25*c-10)*c-55,s>=7&&(l-=36);}return o(208<=l&&l<=29648),l}static getNumDataCodewords(s,l){return Math.floor(e.getNumRawDataModules(s)/8)-e.ECC_CODEWORDS_PER_BLOCK[l.ordinal][s]*e.NUM_ERROR_CORRECTION_BLOCKS[l.ordinal][s]}static reedSolomonComputeDivisor(s){if(s<1||s>255)throw new RangeError("Degree out of range");let l=[];for(let u=0;u<s-1;u++)l.push(0);l.push(1);let c=1;for(let u=0;u<s;u++){for(let m=0;m<l.length;m++)l[m]=e.reedSolomonMultiply(l[m],c),m+1<l.length&&(l[m]^=l[m+1]);c=e.reedSolomonMultiply(c,2);}return l}static reedSolomonComputeRemainder(s,l){let c=l.map(u=>0);for(let u of s){let m=u^c.shift();c.push(0),l.forEach((f,d)=>c[d]^=e.reedSolomonMultiply(f,m));}return c}static reedSolomonMultiply(s,l){if(s>>>8||l>>>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^=(l>>>u&1)*s;return o(c>>>8==0),c}finderPenaltyCountPatterns(s){let l=s[1];o(l<=this.size*3);let c=l>0&&s[2]==l&&s[3]==l*3&&s[4]==l&&s[5]==l;return (c&&s[0]>=l*4&&s[6]>=l?1:0)+(c&&s[6]>=l*4&&s[0]>=l?1:0)}finderPenaltyTerminateAndCount(s,l,c){return s&&(this.finderPenaltyAddHistory(l,c),l=0),l+=this.size,this.finderPenaltyAddHistory(l,c),this.finderPenaltyCountPatterns(c)}finderPenaltyAddHistory(s,l){l[0]==0&&(s+=this.size),l.pop(),l.unshift(s);}static MIN_VERSION=1;static MAX_VERSION=40;static PENALTY_N1=3;static PENALTY_N2=3;static PENALTY_N3=40;static PENALTY_N4=10;static ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]];static NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]]}a.QrCode=e;function t(i,s,l){if(s<0||s>31||i>>>s)throw new RangeError("Value out of range");for(let c=s-1;c>=0;c--)l.push(i>>>c&1);}function n(i,s){return (i>>>s&1)!=0}function o(i){if(!i)throw new Error("Assertion error")}class r{constructor(s,l,c){this.mode=s;this.numChars=l;this.bitData=c;if(l<0)throw new RangeError("Invalid argument");this.bitData=c.slice();}mode;numChars;bitData;static makeBytes(s){let l=[];for(let c of s)t(c,8,l);return new r(r.Mode.BYTE,s.length,l)}static makeNumeric(s){if(!r.isNumeric(s))throw new RangeError("String contains non-numeric characters");let l=[];for(let c=0;c<s.length;){let u=Math.min(s.length-c,3);t(parseInt(s.substr(c,u),10),u*3+1,l),c+=u;}return new r(r.Mode.NUMERIC,s.length,l)}static makeAlphanumeric(s){if(!r.isAlphanumeric(s))throw new RangeError("String contains unencodable characters in alphanumeric mode");let l=[],c;for(c=0;c+2<=s.length;c+=2){let u=r.ALPHANUMERIC_CHARSET.indexOf(s.charAt(c))*45;u+=r.ALPHANUMERIC_CHARSET.indexOf(s.charAt(c+1)),t(u,11,l);}return c<s.length&&t(r.ALPHANUMERIC_CHARSET.indexOf(s.charAt(c)),6,l),new r(r.Mode.ALPHANUMERIC,s.length,l)}static makeSegments(s){return s==""?[]:r.isNumeric(s)?[r.makeNumeric(s)]:r.isAlphanumeric(s)?[r.makeAlphanumeric(s)]:[r.makeBytes(r.toUtf8ByteArray(s))]}static makeEci(s){let l=[];if(s<0)throw new RangeError("ECI assignment value out of range");if(s<128)t(s,8,l);else if(s<16384)t(2,2,l),t(s,14,l);else if(s<1e6)t(6,3,l),t(s,21,l);else throw new RangeError("ECI assignment value out of range");return new r(r.Mode.ECI,0,l)}static isNumeric(s){return r.NUMERIC_REGEX.test(s)}static isAlphanumeric(s){return r.ALPHANUMERIC_REGEX.test(s)}getData(){return this.bitData.slice()}static getTotalBits(s,l){let c=0;for(let u of s){let m=u.mode.numCharCountBits(l);if(u.numChars>=1<<m)return 1/0;c+=4+m+u.bitData.length;}return c}static toUtf8ByteArray(s){s=encodeURI(s);let l=[];for(let c=0;c<s.length;c++)s.charAt(c)!="%"?l.push(s.charCodeAt(c)):(l.push(parseInt(s.substr(c+1,2),16)),c+=2);return l}static NUMERIC_REGEX=/^[0-9]*$/;static ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/;static ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:"}a.QrSegment=r;})(wn||={});(t=>{(o=>{class n{constructor(a,i){this.ordinal=a;this.formatBits=i;}ordinal;formatBits;static LOW=new n(0,1);static MEDIUM=new n(1,0);static QUARTILE=new n(2,3);static HIGH=new n(3,2)}o.Ecc=n;})(t.QrCode||={});})(wn||={});(t=>{(o=>{class n{constructor(a,i){this.modeBits=a;this.numBitsCharCount=i;}modeBits;numBitsCharCount;static NUMERIC=new n(1,[10,12,14]);static ALPHANUMERIC=new n(2,[9,11,13]);static BYTE=new n(4,[8,16,16]);static KANJI=new n(8,[8,10,12]);static ECI=new n(7,[0,0,0]);numCharCountBits(a){return this.numBitsCharCount[Math.floor((a+7)/17)]}}o.Mode=n;})(t.QrSegment||={});})(wn||={});var Ge=wn;var jr={L:Ge.QrCode.Ecc.LOW,M:Ge.QrCode.Ecc.MEDIUM,Q:Ge.QrCode.Ecc.QUARTILE,H:Ge.QrCode.Ecc.HIGH},ce=128,Ke="Q",fe="#FFFFFF",Re="#000000";var pe=0;var Xr=.1;var Yr=["logo","halftone"],Oa={logo:["blend","badge"],halftone:["color","mono"]},rr=192,Bd=["square","rounded","circle","message","message-reverse","diya","diya-reverse","rounded-triangle","leaf","drop","plus","cross-rounded","hexagon","octagon","flower","heart","squircle","dots","extra-rounded","leaf-reverse","drop-reverse","cushion"],Gd=["diamond","star","banner"],Qd=["square","rounded","gear","circle","diya","extra-rounded","message","pointy","leaf","drop","octagon","bevel","squircle","cushion","shield","petal","leaf-reverse","porthole","notch","plus","bud","bowl"],Ud=["curly"],Hd=["circle","circle-large","square","diamond","circle-mixed","pacman","rounded","small-square","vertical-line","horizontal-line","liquid","liquid-horizontal","liquid-vertical","classy","classy-rounded","leaf","plus","hexagon","star","heart","random-dots","mosaic","octagon"],or={x:"plus",pebble:"rounded",flower:"circle",beads:"circle",bubble:"circle",chain:"circle",petal:"leaf",drop:"rounded",squircle:"rounded"},Dt={pebble:"squircle",tag:"rounded",crest:"shield",doodle:"squircle",stamp:"notch"},Bt={bevel:"square",notch:"square"};function Qe(e,t){return typeof t=="string"&&Object.hasOwn(e,t)?e[t]:t}var zd=["none","banner-bottom","banner-top","border","rounded-border","speech-bubble","banner-top-bottom","speech-bubble-top","chat-bubble","circle","polaroid","phone","ticket","badge","envelope","tag","menu-card","sticker","gradient-border","focus"],it=24,Da="Scan me",ar=.5,Cn=1.5,Wd=["square","rounded","circle"],qd=.1,Ba=.3,Ga=.25,Vd=2,Zr=.5,Qa=1,Ua=.07,jd=["square","circle","heart"],Ha=3,Gt=64,_t=8,za=.42,Qt=["topLeft","topRight","bottomLeft"],Kr=.5,Wa=2,qa=.1,Va=.5,ja=.25,Jr="#e5e7eb",Ut="#d1d5db",eo=.3,Xa=.2,Ya=.1,Za=.4,Ka=.3,Ja="#000000",Xd=["corner","code"];function K(e,t=3){let n=10**t;return Math.round(e*n)/n+0}function x(e,t=3){return String(K(e,t))}function v(e,...t){let n=e[0]??"";for(let o=0;o<t.length;o++){let r=t[o];n+=(typeof r=="number"?x(r):r)+(e[o+1]??"");}return n}var Yd={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0},Zd=/^[MmLlHhVvCcSsQqTtAaZz0-9.,+\-\s]*$/,ei=/[+-]?(?:\d+\.?\d*|\.\d+)/y;function ir(e,t=Number.POSITIVE_INFINITY){if(!Zd.test(e))return null;let n=[],o=0,r=()=>{for(;o<e.length&&/[\s,]/.test(e[o]);)o++;},a=()=>{r(),ei.lastIndex=o;let l=ei.exec(e);if(!l)return null;let c=l[0],u=c.indexOf(".");if(u>=0&&c.length-u-1>t)return null;o=ei.lastIndex;let m=Number(c);return Number.isFinite(m)?m:null},i=()=>{r();let l=e[o];return l==="0"||l==="1"?(o++,l==="1"?1:0):null},s=()=>(r(),o<e.length&&/[0-9.+-]/.test(e[o]));for(r();o<e.length;){let l=e[o],c=l.toUpperCase(),u=Yd[c];if(u===void 0||n.length===0&&c!=="M")return null;if(o++,u===0){n.push({command:l,values:[]}),r();continue}let m=l,f=true;for(;f||s();){let d=[];for(let g=0;g<u;g++){let h=c==="A"&&(g===3||g===4)?i():a();if(h===null)return null;d.push(h);}n.push({command:m,values:d}),c==="M"&&(m=l==="M"?"L":"l"),f=false;}r();}return n}function Ql(e){let t=0;for(let{command:n}of e)t+=n.toUpperCase()==="A"?4:1;return t}function ti(e,t=1,n=0,o=0){let r="";for(let{command:a,values:i}of e){let s=a.toUpperCase(),l=a===s,c=l?n:0,u=l?o:0,m;switch(s){case "Z":m=[];break;case "H":m=[x(i[0]*t+c)];break;case "V":m=[x(i[0]*t+u)];break;case "A":m=[x(Math.abs(i[0])*t),x(Math.abs(i[1])*t),x(i[2]),String(i[3]),String(i[4]),x(i[5]*t+c),x(i[6]*t+u)];break;default:m=i.map((f,d)=>x(f*t+(d%2===0?c:u)));}r+=a+m.join(" ");}return r}function to(e,t=.25){let n=[],o=[],r=[0,0],a=[0,0],i=()=>{o.length>2&&n.push(o),o=[];};for(let s of e)if(s.op==="M")i(),r=[s.x,s.y],a=r,o.push(r);else if(s.op==="L")a=[s.x,s.y],o.push(a);else if(s.op==="C"){let l=a,c=[s.x1,s.y1],u=[s.x2,s.y2],m=[s.x,s.y],f=Math.hypot(c[0]-l[0],c[1]-l[1])+Math.hypot(u[0]-c[0],u[1]-c[1])+Math.hypot(m[0]-u[0],m[1]-u[1]),d=Math.max(2,Math.min(64,Math.ceil(Math.sqrt(f/(4*t)))));for(let g=1;g<=d;g++){let h=g/d,p=1-h;o.push([p*p*p*l[0]+3*p*p*h*c[0]+3*p*h*h*u[0]+h*h*h*m[0],p*p*p*l[1]+3*p*p*h*c[1]+3*p*h*h*u[1]+h*h*h*m[1]]);}a=m;}else i(),a=r;return i(),n}function Rn(e,t){let n=[r=>r[0]-t.x0,r=>t.x1-r[0],r=>r[1]-t.y0,r=>t.y1-r[1]],o=e;for(let r of n){if(o.length===0)break;let a=o;o=[];for(let i=0;i<a.length;i++){let s=a[i],l=a[(i+a.length-1)%a.length],c=r(s),u=r(l);c>=0?(u<0&&o.push(Ul(l,s,u,c)),o.push(s)):u>=0&&o.push(Ul(l,s,u,c));}}return o.length>2?o:[]}function Ul(e,t,n,o){let r=n/(n-o);return [e[0]+(t[0]-e[0])*r,e[1]+(t[1]-e[1])*r]}function Hl(e){return e.filter(t=>t.length>2).map(t=>`M${t.map(([n,o])=>`${x(n)} ${x(o)}`).join("L")}Z`).join("")}function Ht(e){let t=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,r=Number.NEGATIVE_INFINITY,a=(i,s)=>{t=Math.min(t,i),n=Math.min(n,s),o=Math.max(o,i),r=Math.max(r,s);};for(let i of e)i.op==="C"?(a(i.x1,i.y1),a(i.x2,i.y2),a(i.x,i.y)):i.op!=="Z"&&a(i.x,i.y);return Number.isFinite(t)?{x0:t,y0:n,x1:o,y1:r}:null}var Kd={amp:"&",lt:"<",gt:">",quot:'"',apos:"'"};function ql(e){return e.replace(/&(#x[0-9a-f]+|#\d+|[a-z]+);/gi,(t,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):t}return Kd[n.toLowerCase()]??t})}var Jd=60,ni=62,ri=47,ef=61,zl=34,Wl=39,ai=/\s*/y,tf=/[^\s/>]*/y,nf=/[^\s>]*/y,rf=/[^\s=]*/y;function Mn(e,t,n){return e.lastIndex=n,e.test(t)?e.lastIndex:n}function of(e,t){let n=e.length,o=S=>{let $=Number.POSITIVE_INFINITY,R=-1;return M=>((M<$||R>=0&&R<M)&&($=M,R=e.indexOf(S,M)),R)},r=o("-->"),a=o("?>"),i=o("]]>"),s=o(">"),l,c=S=>{let $=e.charCodeAt(S);if($!==zl&&$!==Wl)return S+1;let R=e.indexOf(e[S],S+1);return R<0?n:R+1},u=S=>{for(let $=S;$<n&&!l?.[$];$=c($)){let R=e.charCodeAt($);if(R===ni||R===ri&&e.charCodeAt($+1)===ni)return $}l??=new Uint8Array(n);for(let $=S;$<n&&!l[$];$=c($))l[$]=1;return -1},m=-1,f=-1,d=-1,g=-1,h=S=>{let $=S+1;if($<m||$>=f){m=$,f=Mn(tf,e,$),d=-1;for(let M=f;M>$;M--){let E=e.charCodeAt(M);if((M===f||E===zl||E===Wl)&&(g=u(M),g>=0)){d=M;break}}}if(d<=$)return -1;let R=e.charCodeAt(g)===ri;return t.open(e.slice($,d),e.slice(d,g),R),g+(R?2:1)},p=-1,b=-1,_=-1,y=S=>{let $=S+2;if($<p||$>=b){p=$,b=Mn(nf,e,$);let R=Mn(ai,e,b);_=b>$&&e.charCodeAt(R)===ni?R:-1;}return _},w=S=>{if(e.startsWith("<!--",S)){let $=r(S+4);if($>=0)return $+3}if(e.startsWith("<?",S)){let $=a(S+2);if($>=0)return $+2}if(e.startsWith("<![CDATA[",S)){let $=i(S+9);if($>=0)return t.cdata(e.slice(S+9,$)),$+3}if(e.startsWith("<!",S)){let $=s(S+2);if($>=0)return $+1}if(e.charCodeAt(S+1)===ri){let $=y(S);return $<0?-1:(t.close(),$+1)}return h(S)},C=0;for(;C<n;)if(e.charCodeAt(C)===Jd){let S=w(C);C=S<0?C+1:S;}else {let S=e.indexOf("<",C),$=S<0?n:S;t.text(e.slice(C,$)),C=$;}}function af(e){let t={},n=0;for(;n<e.length;){let o=Mn(rf,e,n);if(o===n){n++;continue}let r=Mn(ai,e,o);if(e.charCodeAt(r)===ef){let a=Mn(ai,e,r+1),i=e[a],s=i==='"'||i==="'"?e.indexOf(i,a+1):-1;if(s>=0){t[e.slice(n,o)]=ql(e.slice(a+1,s)),n=s+1;continue}}n=o;}return t}function yt(e){let t={name:"#root",attrs:{},children:[],text:""},n=[t],o=()=>n.at(-1);of(e,{open(a,i,s){let l=af(i),c={name:a,attrs:l,children:[],text:""};o().children.push(c),s||n.push(c);},close(){n.length>1&&n.pop();},text(a){o().text+=ql(a);},cdata(a){o().text+=a;}});let r=a=>{for(let i of a.children){if(i.name==="svg")return i;let s=r(i);if(s)return s}return null};return r(t)}var En=[1,0,0,1,0,0];function me(e,t){let[n,o,r,a,i,s]=e,[l,c,u,m,f,d]=t;return [n*l+r*c,o*l+a*c,n*u+r*m,o*u+a*m,n*f+r*d+i,o*f+a*d+s]}function W(e,t,n){return [e[0]*t+e[2]*n+e[4],e[1]*t+e[3]*n+e[5]]}function An(e){return Math.sqrt(Math.abs(e[0]*e[3]-e[1]*e[2]))}function Je(e){return e?(e.match(/[+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?/gi)??[]).map(Number):[]}function Ue(e){let t=En;if(!e)return t;for(let[,n,o]of e.matchAll(/(matrix|translate|scale|rotate|skewX|skewY)\s*\(([^)]*)\)/g)){let r=Je(o),a=En;switch(n){case "matrix":r.length===6&&(a=r);break;case "translate":a=[1,0,0,1,r[0]??0,r[1]??0];break;case "scale":a=[r[0]??1,0,0,r[1]??r[0]??1,0,0];break;case "rotate":{let i=(r[0]??0)*Math.PI/180,s=Math.cos(i),l=Math.sin(i),[c,u]=[r[1]??0,r[2]??0];a=me(me([1,0,0,1,c,u],[s,l,-l,s,0,0]),[1,0,0,1,-c,-u]);break}case "skewX":a=[1,0,Math.tan((r[0]??0)*Math.PI/180),1,0,0];break;case "skewY":a=[1,Math.tan((r[0]??0)*Math.PI/180),0,1,0,0];break;}t=me(t,a);}return t}var oi=/[+-]?(?:\d+\.?\d*|\.\d+)(?:[eE][+-]?\d+)?/y;function sf(e,t,n,o,r,a,i,s,l){if(e===s&&t===l)return [];let c=Math.abs(n),u=Math.abs(o);if(c===0||u===0)return [{op:"L",x:s,y:l}];let m=r*Math.PI/180,f=Math.cos(m),d=Math.sin(m),g=(e-s)/2,h=(t-l)/2,p=f*g+d*h,b=-d*g+f*h,_=p*p/(c*c)+b*b/(u*u);_>1&&(c*=Math.sqrt(_),u*=Math.sqrt(_));let y=c*c*u*u-c*c*b*b-u*u*p*p,w=c*c*b*b+u*u*p*p,C=(a===i?-1:1)*Math.sqrt(Math.max(0,y/w)),S=C*c*b/u,$=-C*u*p/c,R=f*S-d*$+(e+s)/2,M=d*S+f*$+(t+l)/2,E=(G,z,O,Y)=>Math.atan2(G*Y-z*O,G*O+z*Y),P=E(1,0,(p-S)/c,(b-$)/u),I=E((p-S)/c,(b-$)/u,(-p-S)/c,(-b-$)/u);!i&&I>0?I-=2*Math.PI:i&&I<0&&(I+=2*Math.PI);let L=Math.max(1,Math.ceil(Math.abs(I)/(Math.PI/2)-1e-9)),k=I/L,F=4/3*Math.tan(k/4),T=(G,z)=>[R+c*f*G-u*d*z,M+c*d*G+u*f*z],H=[];for(let G=0;G<L;G++){let z=P+G*k,O=z+k,[Y,be]=T(Math.cos(z)-F*Math.sin(z),Math.sin(z)+F*Math.cos(z)),[de,N]=T(Math.cos(O)+F*Math.sin(O),Math.sin(O)-F*Math.cos(O)),[Q,re]=G===L-1?[s,l]:T(Math.cos(O),Math.sin(O));H.push({op:"C",x1:Y,y1:be,x2:de,y2:N,x:Q,y:re});}return H}function st(e){let t=[],n=0,o=0,r=0,a=0,i=0,s="",l=null,c=null,u=()=>{for(;n<e.length&&/[\s,]/.test(e[n]);)n++;},m=()=>{u(),oi.lastIndex=n;let g=oi.exec(e);return g?(n=oi.lastIndex,Number(g[0])):null},f=()=>{u();let g=e[n];return g==="0"||g==="1"?(n++,g==="1"):null},d=g=>{let h=[];for(let p=0;p<g;p++){let b=m();if(b===null)return null;h.push(b);}return h};for(;u(),!(n>=e.length);){let g=e[n];if(/[MmLlHhVvCcSsQqTtAaZz]/.test(g))s=g,n++;else if(!s||s==="Z"||s==="z")break;let h=s===s.toLowerCase(),p=h?o:0,b=h?r:0,_=s.toUpperCase();if(_==="Z"){t.push({op:"Z"}),o=a,r=i,l=null,c=null;continue}if(_==="A"){let S=d(3),$=f(),R=f(),M=d(2);if(!(S&&M)||$===null||R===null)break;let[E,P,I]=S,L=M[0]+p,k=M[1]+b;t.push(...sf(o,r,E,P,I,$,R,L,k)),o=L,r=k,l=null,c=null;continue}let y={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2}[_]??0,w=d(y);if(!w)break;let C=w;switch(_){case "M":o=C[0]+p,r=C[1]+b,a=o,i=r,t.push({op:"M",x:o,y:r}),s=h?"l":"L",l=null,c=null;break;case "L":case "H":case "V":_!=="V"&&(o=C[0]+p),_==="V"?r=C[0]+b:_==="L"&&(r=C[1]+b),t.push({op:"L",x:o,y:r}),l=null,c=null;break;case "C":case "S":{let S,$;_==="C"?(S=[C[0]+p,C[1]+b],$=C.slice(2)):(S=l?[2*o-l[0],2*r-l[1]]:[o,r],$=C);let R=[$[0]+p,$[1]+b],M=[$[2]+p,$[3]+b];t.push({op:"C",x1:S[0],y1:S[1],x2:R[0],y2:R[1],x:M[0],y:M[1]}),[o,r]=M,l=R,c=null;break}case "Q":case "T":{let S,$;_==="Q"?(S=[C[0]+p,C[1]+b],$=[C[2]+p,C[3]+b]):(S=c?[2*o-c[0],2*r-c[1]]:[o,r],$=[C[0]+p,C[1]+b]),t.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,l=null;break}}}return t}var no=.5522847498;function et(e,t,n,o){if(n<=0||o<=0)return [];let r=n*no,a=o*no;return [{op:"M",x:e+n,y:t},{op:"C",x1:e+n,y1:t+a,x2:e+r,y2:t+o,x:e,y:t+o},{op:"C",x1:e-r,y1:t+o,x2:e-n,y2:t+a,x:e-n,y:t},{op:"C",x1:e-n,y1:t-a,x2:e-r,y2:t-o,x:e,y:t-o},{op:"C",x1:e+r,y1:t-o,x2:e+n,y2:t-a,x:e+n,y:t},{op:"Z"}]}function tt(e,t,n,o,r=0,a=0){if(n<=0||o<=0)return [];let i=Math.min(Math.max(r,0),n/2),s=Math.min(Math.max(a,0),o/2);if(i===0||s===0)return [{op:"M",x:e,y:t},{op:"L",x:e+n,y:t},{op:"L",x:e+n,y:t+o},{op:"L",x:e,y:t+o},{op:"Z"}];let l=i*no,c=s*no,u=e+n,m=t+o;return [{op:"M",x:e+i,y:t},{op:"L",x:u-i,y:t},{op:"C",x1:u-i+l,y1:t,x2:u,y2:t+s-c,x:u,y:t+s},{op:"L",x:u,y:m-s},{op:"C",x1:u,y1:m-s+c,x2:u-i+l,y2:m,x:u-i,y:m},{op:"L",x:e+i,y:m},{op:"C",x1:e+i-l,y1:m,x2:e,y2:m-s+c,x:e,y:m-s},{op:"L",x:e,y:t+s},{op:"C",x1:e,y1:t+s-c,x2:e+i-l,y2:t,x:e+i,y:t},{op:"Z"}]}var sr="qrdx.frame",lr=1,cr="custom",se={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:it},si=["wifi","star","heart","phone","headphones","calendar","user","chat","bag","bell","cup","card","check","info","home","pin","share","download","clock","snowflake","pumpkin","tree","sparkle","gift"],ur=.95,jl=200,li=["frame","text","accent","background"],lf=/[\t\n\v\f\r\u0085\u2028\u2029]/g,cf=/[\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 Pn(e,t=it){let n=e.slice(0,1e3).normalize("NFC").replace(lf," ").replace(cf,"").replace(/\s+/g," ").trim();return Array.from(n).slice(0,Math.max(0,t)).join("").trim()}function uf(e){for(let t of e)if((t.codePointAt(0)??0)>255)return false;return true}var ro=e=>Math.abs(e*1e3-Math.round(e*1e3))<1e-6;function oo(e){let t=vn(e);return {x0:e.qr.x-t,y0:e.qr.y-t,x1:e.qr.x+e.qr.size+t,y1:e.qr.y+e.qr.size+t}}function mf(e){return {x0:e.qr.x,y0:e.qr.y,x1:e.qr.x+e.qr.size,y1:e.qr.y+e.qr.size}}function vn(e){return e.qr.padding??e.qr.size*se.defaultPadding}var ci=.52,df=.35;function ff(e){let t=e.fontSize??e.box.height*ci;return Math.min(t*Cn,e.box.height*ur)}var ii=(e,t)=>Math.min(e.x1,t.x1)-Math.max(e.x0,t.x0)>1e-6&&Math.min(e.y1,t.y1)-Math.max(e.y0,t.y0)>1e-6;function Vl(e){let t=oo(e),n=Math.min(e.qr.radius??0,(t.x1-t.x0)/2,(t.y1-t.y0)/2),o=[[t.x0+n,t.y0+n,Math.PI],[t.x1-n,t.y0+n,-Math.PI/2],[t.x1-n,t.y1-n,0],[t.x0+n,t.y1-n,Math.PI/2]],r=[];for(let[a,i,s]of o)for(let l=0;l<=8;l++){let c=s+Math.PI/2*(l/8);r.push([a+n*Math.cos(c),i+n*Math.sin(c)]);}return r}function hf([e,t],n,o){if(e<n.x-.01||t<n.y-.01||e>n.x+n.width+.01||t>n.y+n.height+.01)return false;let a=Math.min(o,n.width/2,n.height/2),i=Math.min(Math.max(e,n.x+a),n.x+n.width-a),s=Math.min(Math.max(t,n.y+a),n.y+n.height-a);return Math.hypot(e-i,t-s)<=a+.01}function pf(e){let t=0;return e.forEach(([n,o],r)=>{let[a,i]=e[(r+1)%e.length];t+=n*i-a*o;}),Math.abs(t)/2}function gf(e,t,n){let o=oo(t);if(!ii(n,o))return false;if("stroke"in e&&e.stroke)return true;if(e.fill==="background")return false;if(e.type==="rect"&&e.hole){let{hole:r}=e;return !Vl(t).every(a=>hf(a,r,r.radius??0))}if(e.type==="circle"&&e.hole){let r=e.hole;return !Vl(t).every(([a,i])=>Math.hypot(a-e.cx,i-e.cy)<=r+.01)}if(e.type==="polygon"){let r=Rn(e.points,o);return r.length>2&&pf(r)>1e-6}return true}function ui(e){let t=bf(e),n="stroke"in e?e.stroke:void 0;if(!(n&&t.bounds))return t;let o=e.type==="circle"||e.type==="ellipse"?n.width/2:e.type==="rect"?n.width*Math.SQRT2/2:n.width*2,{x0:r,y0:a,x1:i,y1:s}=t.bounds;return {bounds:{x0:r-o,y0:a-o,x1:i+o,y1:s+o},segments:t.segments*2}}function bf(e){switch(e.type){case "rect":return {bounds:{x0:e.x,y0:e.y,x1:e.x+e.width,y1:e.y+e.height},segments:e.hole?18:9};case "circle":return {bounds:{x0:e.cx-e.r,y0:e.cy-e.r,x1:e.cx+e.r,y1:e.cy+e.r},segments:e.hole?10:5};case "ellipse":return {bounds:{x0:e.cx-e.rx,y0:e.cy-e.ry,x1:e.cx+e.rx,y1:e.cy+e.ry},segments:5};case "polygon":{let t=e.points.map(([o])=>o),n=e.points.map(([,o])=>o);return {bounds:{x0:Math.min(...t),y0:Math.min(...n),x1:Math.max(...t),y1:Math.max(...n)},segments:e.points.length}}case "path":{let t=ir(e.d,se.maxDecimals);return t?{bounds:Ht(st(e.d)),segments:Ql(t)}:{bounds:null,segments:0}}case "line":{let t=e.width/2,n=Math.hypot(e.x2-e.x1,e.y2-e.y1),o=e.dash?Math.ceil(n/(e.dash[0]+e.dash[1])):1;return {bounds:{x0:Math.min(e.x1,e.x2)-t,y0:Math.min(e.y1,e.y2)-t,x1:Math.max(e.x1,e.x2)+t,y1:Math.max(e.y1,e.y2)+t},segments:o*(e.cap==="round"?4:5)}}default:return {bounds:{x0:e.x,y0:e.y,x1:e.x+e.size,y1:e.y+e.size},segments:jl}}}function Xl(e,t){let n=se,o=new TextEncoder().encode(JSON.stringify(e)).length;if(o>n.maxBytes){t(`The spec is ${o} bytes; the limit is ${n.maxBytes}`);return}let{width:r,height:a}=e.artboard,i=Math.max(r,a)*.005,s={x0:-i,y0:-i,x1:r+i,y1:a+i},l=b=>b.x0>=s.x0&&b.y0>=s.y0&&b.x1<=s.x1&&b.y1<=s.y1,{qr:c}=e,u=vn(e);c.plate!=="none"&&u<c.size*n.minPadding-1e-9&&t(`qr.padding must be at least ${n.minPadding*100}% of qr.size`,["qr","padding"]),c.size<Math.min(r,a)*n.minQrShare-1e-9&&t(`qr.size must be at least ${n.minQrShare*100}% of the artboard's shorter side`,["qr","size"]);let m=oo(e);(m.x0<-1e-9||m.y0<-1e-9||m.x1>r+1e-9||m.y1>a+1e-9)&&t("The code and its padding must sit inside the artboard",["qr"]),(c.radius??0)>(c.size+2*u)/2&&t("qr.radius is larger than half the plate",["qr","radius"]);let f=0,d=0;e.shapes.forEach((b,_)=>{let y=["shapes",_],{bounds:w,segments:C}=ui(b);if(!w){t("Path data must use only M L H V C S Q T A Z, plain numbers (up to 3 decimals) and start with M",[...y,"d"]);return}if(l(w)||t("The shape extends outside the artboard",y),b.type==="rect"&&b.hole){let{hole:S}=b;(S.x<b.x||S.y<b.y||S.x+S.width>b.x+b.width+1e-9||S.y+S.height>b.y+b.height+1e-9)&&t("The hole must sit inside its rect",[...y,"hole"]);}b.type==="circle"&&b.hole&&b.hole>=b.r&&t("The hole must be smaller than the circle",[...y,"hole"]),"stroke"in b&&b.stroke&&b.stroke.width>Math.min(r,a)*.1+1e-9&&t("A stroke may be at most 10% of the artboard's shorter side",[...y,"stroke","width"]),c.plate==="background"&&gf(b,e,w)&&t('With qr.plate "background", only background fills (or a ring whose hole holds the plate) may lie under the plate',y),f+=C,typeof b.fill=="object"&&"gradient"in b.fill&&(d+=(b.fill.gradient.steps??32)*C);}),f>n.maxSegments&&t(`The shapes have ${f} segments; the limit is ${n.maxSegments}`,["shapes"]),d>n.maxGradientWork&&t("Gradient fills are too detailed (fewer steps or simpler shapes)",["shapes"]);let g=[],h=new Set,p=new Set;e.labels.forEach((b,_)=>{let y=["labels",_];h.has(b.id)&&t(`Label id "${b.id}" is used twice`,[...y,"id"]),h.add(b.id),b.slot!=="fixed"&&(p.has(b.slot)&&t(`Only one label may use the ${b.slot} slot`,[...y,"slot"]),p.add(b.slot));let w=b.maxLength??n.maxTextLength;b.text!==Pn(b.text,w)&&t(`Label text must be at most ${w} characters, trimmed, with no control or invisible characters (see sanitizeFrameText)`,[...y,"text"]);let C;if(b.type==="text"){C={x0:b.box.x,y0:b.box.y,x1:b.box.x+b.box.width,y1:b.box.y+b.box.height},b.fontSize!==void 0&&b.fontSize>b.box.height*ur+1e-9&&t("fontSize may be at most 95% of the label's row height",[...y,"fontSize"]);let S=b.box.y+b.box.height/2,$=ff(b)*df,R={x0:C.x0,x1:C.x1,y0:S-$,y1:S+$};(ii(C,mf(e))||ii(R,m))&&t("The label overlaps the code or its padding",[...y,"box"]);}else {let{cx:S,cy:$,radius:R}=b.curve,M=b.fontSize*Cn*.6;C={x0:S-R-M,y0:$-R-M,x1:S+R+M,y1:$+R+M};let E=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||E>=R+M||t("The curved label crosses the code or its padding",[...y,"curve"]);}if(l(C)||t("The label extends outside the artboard",y),b.collapse){let S=b.collapse,$=S.y+S.height;(S.y<-1e-9||$>a+1e-9)&&t("The collapse band must sit inside the artboard",[...y,"collapse"]),$>m.y0+1e-6&&S.y<m.y1-1e-6&&t("The collapse band crosses the code or its padding",[...y,"collapse"]);for(let R of g)$>R.y+1e-6&&S.y<R.y+R.height-1e-6&&t("Collapse bands may not overlap",[...y,"collapse"]);g.push(S);}});}var mi=(e,t=0)=>{for(let n=t;n<e.length;n++)if(e[n]?.continue!==true)return true;return false};function xt(e,t=[],n={}){return {...n,run(o){let r=e({value:o,issues:[]}),a=mi(r.issues);for(let i of t){if(i.hasLength){let l=r.value;if(r.issues.some(c=>c.continue===false)||l===null||l===void 0||l.length===void 0)continue}else if(a)continue;let s=r.issues.length;i.run(r),!a&&r.issues.length>s&&(a=mi(r.issues,s));}return r}}}function _f(e){if(typeof e=="number")return Number.isNaN(e)?"NaN":Number.isFinite(e)?"number":String(e);if(e===null)return "null";if(Array.isArray(e))return "array";if(typeof e=="object"){let t=e.constructor;if(Object.getPrototypeOf(e)!==Object.prototype&&"constructor"in e&&t)return t.name}return typeof e}var Wt=(e,t)=>({path:[],message:`Invalid input: expected ${e}, received ${_f(t)}`}),yf={string:"characters",array:"items"};function lt(e,t,n,o){let r=yf[t],a=e?"Too big":"Too small",i=`${e?"<=":">="}${n}`;return {path:[],message:r?`${a}: expected ${t} to have ${i} ${r}`:`${a}: expected ${t} to be ${i}`,continue:o}}var di=e=>typeof e=="string"?`"${e}"`:`${e}`,Jl=e=>typeof e=="object"&&e!==null&&!Array.isArray(e);function gi(e,t,n){for(let o of n)o.path.unshift(t),e.push(o);}var xf=e=>e>=55296&&e<=56319,$f=e=>e>=56320&&e<=57343;function Sf(e){let t=e.length;for(let n=0;n<e.length-1;n++)xf(e.charCodeAt(n))&&$f(e.charCodeAt(n+1))&&(t--,n++);return t}var ec=e=>Array.isArray(e)?"array":typeof e=="string"?"string":"unknown",fr=e=>({run(t){t.value<e&&t.issues.push(lt(false,"number",e,true));}}),hr=e=>({run(t){t.value>e&&t.issues.push(lt(true,"number",e,true));}}),Tn=(e,t="Invalid input")=>({run(n){e(n.value)||n.issues.push({path:[],message:t,continue:true});}}),tc=e=>typeof e=="string"?Sf(e):e.length,nc=e=>({hasLength:true,run(t){let n=t.value;tc(n)<e&&t.issues.push(lt(false,ec(n),e,true));}}),bi=e=>({hasLength:true,run(t){let n=t.value;tc(n)>e&&t.issues.push(lt(true,ec(n),e,true));}}),rc=(e,t)=>({run(n){e.lastIndex=0,e.test(n.value)||n.issues.push({path:[],message:t??`Invalid string: must match pattern ${e}`,continue:true});}}),wf={run(e){let t=e.value;Number.isInteger(t)?Number.isSafeInteger(t)||e.issues.push(t>0?lt(true,"int",Number.MAX_SAFE_INTEGER,true):lt(false,"int",Number.MIN_SAFE_INTEGER,true)):e.issues.push({...Wt("int",t),continue:false});}},qt=(...e)=>xt(t=>{let n=t.value;return typeof n=="number"&&Number.isFinite(n)||t.issues.push(Wt("number",n)),t},e),oc=(...e)=>qt(wf,...e),ao=(...e)=>xt(t=>(typeof t.value!="string"&&t.issues.push(Wt("string",t.value)),t),e);function ze(e){let t=e.length===1?`Invalid input: expected ${di(e[0])}`:`Invalid option: expected one of ${e.map(di).join("|")}`;return xt(n=>(e.includes(n.value)||n.issues.push({path:[],message:t}),n),[],{values:e})}var He=e=>ze([e]),ue=e=>({optional:true,run:t=>t===void 0?{value:t,issues:[]}:e.run(t)});function _e(e,t=[]){let n=Object.keys(e),o=new Set(n);return xt(r=>{let a=r.value;if(!Jl(a))return r.issues.push(Wt("object",a)),r;let i={};for(let l of n){let c=e[l],u=c.run(a[l]),m=l in a;gi(r.issues,l,u.issues),m||c.optional||u.issues.length>0||r.issues.push({path:[l],message:"Invalid input: expected nonoptional, received undefined"}),m&&(i[l]=u.value);}r.value=i;let s=[];for(let l in a)o.has(l)||s.push(l);return s.length>0&&r.issues.push({path:[],message:`Unrecognized key${s.length>1?"s":""}: ${s.map(di).join(", ")}`,continue:true}),r},t,{shape:e})}function fi(e,t,n){let o=[];return t!==void 0&&o.push(nc(t)),n!==void 0&&o.push(bi(n)),xt(r=>{let a=r.value;if(Array.isArray(a)&&n!==void 0&&a.length>n)return r.issues.push(lt(true,"array",n,false)),r;if(!Array.isArray(a))return r.issues.push(Wt("array",a)),r;let i=new Array(a.length);for(let s=0;s<a.length;s++){let l=e.run(a[s]);gi(r.issues,s,l.issues),i[s]=l.value;}return r.value=i,r},o)}function hi(e){return xt(t=>{let n=t.value;if(!Array.isArray(n))return t.issues.push(Wt("tuple",n)),t;if(n.length<e.length)return t.issues.push(lt(false,"array",e.length,void 0)),t;n.length>e.length&&t.issues.push(lt(true,"array",e.length,void 0));let o=[];return e.forEach((r,a)=>{let i=r.run(n[a]);gi(t.issues,a,i.issues),o[a]=i.value;}),t.value=o,t})}function Ln(e){return xt(t=>{let n=[];for(let r of e){let a=r.run(t.value);if(a.issues.length===0)return a;n.push(a);}let o=n.filter(r=>!mi(r.issues));return o.length===1?o[0]:(t.issues.push({path:[],message:"Invalid input"}),t)})}function ac(e,t){let n=new Map;for(let r of t)for(let a of r.shape?.[e]?.values??[])n.set(a,r);let o=`Invalid discriminator value. Expected ${[...n.keys()].map(r=>`'${r}'`).join(" | ")}`;return xt(r=>{let a=r.value;if(!Jl(a))return r.issues.push(Wt("object",a)),r;let i=n.get(a[e]);return i?i.run(a):(r.issues.push({path:[e],message:o}),r)})}var Cf=Tn(ro,`Numbers may have at most ${se.maxDecimals} decimals`),so=[fr(-se.maxCoordinate),hr(se.maxCoordinate),Cf],Se=qt(...so),Pe=qt(...so,Tn(e=>e>0,"Must be greater than 0")),io=qt(...so,Tn(e=>e>=0,"Must not be negative")),dr=ao(rc(/^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/,"Use a #rgb or #rrggbb color")),Yl=Ln([ze(li),dr]),ic=e=>_e({mix:hi([e,e]),amount:qt(fr(0),hr(1),Tn(ro))}),In=Ln([Yl,ic(Yl)]),Rf=Ln([dr,ic(Ln([ze(["frame","accent","background"]),dr]))]),zt=Ln([In,_e({gradient:_e({from:In,to:In,direction:ue(ze(["horizontal","vertical"])),steps:ue(oc(fr(2),hr(se.maxGradientSteps)))})})]),pi=()=>({x:Se,y:Se,width:Pe,height:Pe}),mr=_e({color:In,width:Pe}),Mf=ac("type",[_e({type:He("rect"),...pi(),radius:ue(io),fill:zt,hole:ue(_e({...pi(),radius:ue(io)})),stroke:ue(mr)}),_e({type:He("circle"),cx:Se,cy:Se,r:Pe,hole:ue(Pe),fill:zt,stroke:ue(mr)}),_e({type:He("ellipse"),cx:Se,cy:Se,rx:Pe,ry:Pe,fill:zt,stroke:ue(mr)}),_e({type:He("polygon"),points:fi(hi([Se,Se]),3,se.maxPolygonPoints),fill:zt,stroke:ue(mr)}),_e({type:He("path"),d:ao(nc(2),bi(se.maxPathLength)),fill:zt,fillRule:ue(ze(["nonzero","evenodd"])),stroke:ue(mr)}),_e({type:He("line"),x1:Se,y1:Se,x2:Se,y2:Se,width:Pe,cap:ue(ze(["butt","round"])),dash:ue(hi([Pe,Pe])),fill:zt}),_e({type:He("icon"),icon:ze(si),x:Se,y:Se,size:Pe,fill:zt})]),Zl=()=>({id:ao(rc(/^[a-z][a-z0-9-]{0,31}$/)),slot:ze(["primary","secondary","fixed"]),text:ao(bi(200)),maxLength:ue(oc(fr(1),hr(it))),color:In,weight:ue(ze(["bold","regular"])),collapse:ue(_e({y:Se,height:Pe}))}),Ef=ac("type",[_e({type:He("text"),...Zl(),box:_e(pi()),align:ue(ze(["start","middle","end"])),fontSize:ue(Pe)}),_e({type:He("curved"),...Zl(),curve:_e({cx:Se,cy:Se,radius:Pe,side:ze(["top","bottom"]),spread:ue(qt(fr(20),hr(300),Tn(ro)))}),fontSize:Pe})]),Kl=qt(...so,Tn(e=>e>=se.minArtboard&&e<=se.maxArtboard,`Artboard sides must be ${se.minArtboard} to ${se.maxArtboard} units`)),Af=_e({kind:He(sr),version:He(lr),artboard:_e({width:Kl,height:Kl}),qr:_e({x:Se,y:Se,size:Pe,padding:ue(io),radius:ue(io),plate:ue(ze(["opaque","background","none"]))}),colors:_e({frame:dr,text:ue(Rf),accent:ue(dr)}),shapes:fi(Mf,void 0,se.maxShapes),labels:fi(Ef,void 0,se.maxLabels),bleed:ue(Ln([He("none"),In]))},[{run(e){Xl(e.value,(t,n=[])=>{e.issues.push({path:[...n],message:t,continue:true});});}}]);function lo(e){let t=Af.run(e);return t.issues.length===0?{success:true,data:t.value}:{success:false,issues:t.issues.map(({path:n,message:o})=>({path:n,message:o}))}}var sc=({path:e,message:t})=>e.length>0?`${e.join(".")}: ${t}`:t;function Z(e){if(e.length===0)return "";let[t,...n]=e;return `M${x(t[0])} ${x(t[1])}${n.map(([o,r])=>`L${x(o)} ${x(r)}`).join("")}Z`}function J(e,t,n){return `M${x(e-n)} ${x(t)}A${x(n)} ${x(n)} 0 1 1 ${x(e+n)} ${x(t)}A${x(n)} ${x(n)} 0 1 1 ${x(e-n)} ${x(t)}Z`}function D(e,t,n,o,r=0){let a=Math.min(n,o)/2,[i,s,l,c]=(typeof r=="number"?[r,r,r,r]:r).map(m=>Math.max(0,Math.min(m,a))),u=(m,f,d)=>m>0?`A${x(m)} ${x(m)} 0 0 1 ${x(f)} ${x(d)}`:"";return `M${x(e+i)} ${x(t)}H${x(e+n-s)}${u(s,e+n,t+s)}V${x(t+o-l)}${u(l,e+n-l,t+o)}H${x(e+c)}${u(c,e,t+o-c)}V${x(t+i)}${u(i,e+i,t)}Z`}function _i(e,t,n,o){return [[e+o,t],[e+n-o,t],[e+n,t+o],[e+n,t+n-o],[e+n-o,t+n],[e+o,t+n],[e,t+n-o],[e,t+o]]}function kn(e,t,n,o,r=-90){return Array.from({length:o},(a,i)=>{let s=(r+360/o*i)*Math.PI/180;return [e+n*Math.cos(s),t+n*Math.sin(s)]})}function Fn(e,t,n,o,r=5){return Array.from({length:r*2},(a,i)=>{let s=i%2===0?n:o,l=-Math.PI/2+Math.PI/r*i;return [e+s*Math.cos(l),t+s*Math.sin(l)]})}function Nn(e,t,n,o,r=4,a=64){return Array.from({length:a},(i,s)=>{let l=2*Math.PI*s/a,c=Math.cos(l),u=Math.sin(l);return [e+n*Math.sign(c)*Math.abs(c)**(2/r),t+o*Math.sign(u)*Math.abs(u)**(2/r)]})}function On(e,t,n){let o=n/2,r=(a,i)=>`${x(e+a*o)} ${x(t+i*o)}`;return `M${r(0,-0.52)}C${r(.18,-0.92)} ${r(.98,-0.94)} ${r(1,-0.34)}C${r(1,.12)} ${r(.5,.48)} ${r(0,.92)}C${r(-0.5,.48)} ${r(-1,.12)} ${r(-1,-0.34)}C${r(-0.98,-0.94)} ${r(-0.18,-0.92)} ${r(0,-0.52)}Z`}function lc(e,t,n,o){if(o===0)return e;let r=o*Math.PI/180,a=Math.cos(r),i=Math.sin(r);return e.map(([s,l])=>[t+(s-t)*a-(l-n)*i,n+(s-t)*i+(l-n)*a])}function co(e,t,n=0){let o=Math.imul(e+2654435769,2246822507)^Math.imul(t+n,3266489909);return o=Math.imul(o^o>>>15,739982445),o=Math.imul(o^o>>>12,695872825),o^=o>>>15,(o>>>0)/4294967296}function Vt(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return (t>>>0).toString(36)}function yi(e,t,n,o,r){let a=Math.max(0,Math.min(r,Math.min(n,o)/2)),i=(s,l)=>`A${x(a)} ${x(a)} 0 0 0 ${x(s)} ${x(l)}`;return `M${x(e+a)} ${x(t)}H${x(e+n-a)}${i(e+n,t+a)}V${x(t+o-a)}${i(e+n-a,t+o)}H${x(e+a)}${i(e,t+o-a)}V${x(t+a)}${i(e+a,t)}Z`}function uo(e,t,n,o,r){let a=Math.max(0,Math.min(r,Math.min(n,o)/2));return Z([[e+a,t],[e+n-a,t],[e+n-a,t+a],[e+n,t+a],[e+n,t+o-a],[e+n-a,t+o-a],[e+n-a,t+o],[e+a,t+o],[e+a,t+o-a],[e,t+o-a],[e,t+a],[e+a,t+a]])}function pr(e,t,n,o,r){let a=o,i=n/2,s=(i-a)*.55,l=(c,u)=>`${x(e+c)} ${x(t+u)}`;return `M${l(a,0)}C${l(a+s,0)} ${l(i-s,r)} ${l(i,r)}C${l(i+s,r)} ${l(n-a-s,0)} ${l(n-a,0)}A${x(a)} ${x(a)} 0 0 1 ${l(n,a)}C${l(n,a+s)} ${l(n-r,i-s)} ${l(n-r,i)}C${l(n-r,i+s)} ${l(n,n-a-s)} ${l(n,n-a)}A${x(a)} ${x(a)} 0 0 1 ${l(n-a,n)}C${l(n-a-s,n)} ${l(i+s,n-r)} ${l(i,n-r)}C${l(i-s,n-r)} ${l(a+s,n)} ${l(a,n)}A${x(a)} ${x(a)} 0 0 1 ${l(0,n-a)}C${l(0,n-a-s)} ${l(r,i+s)} ${l(r,i)}C${l(r,i-s)} ${l(0,a+s)} ${l(0,a)}A${x(a)} ${x(a)} 0 0 1 ${l(a,0)}Z`}function xi(e,t,n,o,r,a){let i=n/2,s=(l,c)=>`${x(e+l)} ${x(t+c)}`;return `M${s(o,0)}H${x(e+n-o)}A${x(o)} ${x(o)} 0 0 1 ${s(n,o)}V${x(t+r)}C${s(n,r+1.55*a)} ${s(i+1.6*a,n)} ${s(i,n)}C${s(i-1.6*a,n)} ${s(0,r+1.55*a)} ${s(0,r)}V${x(t+o)}A${x(o)} ${x(o)} 0 0 1 ${s(o,0)}Z`}var $i=24,$t=(e,t,n,o)=>{let r=o*Math.PI/180;return [e+n*Math.cos(r),t+n*Math.sin(r)]},mo=([e,t])=>`${x(e)} ${x(t)}`;function Dn(e,t,n,o,r,a){let i=a-r>180?1:0;return `M${mo($t(e,t,o,r))}A${x(o)} ${x(o)} 0 ${i} 1 ${mo($t(e,t,o,a))}L${mo($t(e,t,n,a))}A${x(n)} ${x(n)} 0 ${i} 0 ${mo($t(e,t,n,r))}Z`}function gr(e,t,n,o){return `M${x(e-n)} ${x(t)}A${x(n)} ${x(o)} 0 1 1 ${x(e+n)} ${x(t)}A${x(n)} ${x(o)} 0 1 1 ${x(e-n)} ${x(t)}Z`}function Pf(e){let t=0;return e.forEach(([n,o],r)=>{let[a,i]=e[(r+1)%e.length];t+=n*i-a*o;}),t/2}function cc(e){return Z(Pf(e)<0?[...e].reverse():e)}function fo(e,t,n,o,r){let a=Math.hypot(n-e,o-t)||1,i=-(o-t)/a*(r/2),s=(n-e)/a*(r/2);return cc([[e+i,t+s],[n+i,o+s],[n-i,o-s],[e-i,t-s]])}var Ie=(...e)=>({d:e.join(""),fillRule:"nonzero"}),ct=(...e)=>({d:e.join(""),fillRule:"evenodd"});function vf(){let e=[];for(let t of [0,60,120]){let[n,o]=$t(12,12,10.5,t+180),[r,a]=$t(12,12,10.5,t);e.push(fo(n,o,r,a,2));}for(let t=0;t<6;t++){let n=t*60,[o,r]=$t(12,12,6.2,n);for(let a of [-45,45]){let[i,s]=$t(o,r,3.6,n+a);e.push(fo(o,r,i,s,1.7));}}return Ie(...e)}var If={wifi:()=>Ie(Dn(12,20,4.6,7.2,-135,-45),Dn(12,20,9.2,11.8,-135,-45),Dn(12,20,13.8,16.4,-135,-45),J(12,20,2.2)),star:()=>Ie(Z(Fn(12,12.8,11.6,4.8))),heart:()=>Ie(On(12,12.4,22)),phone:()=>ct(D(6,1.5,12,21,2.6),D(7.8,4.2,8.4,13.4,.6),J(12,19.8,1.1)),headphones:()=>Ie(Dn(12,13,7.6,9.8,-180,0),D(2,12,5,9.5,2),D(17,12,5,9.5,2)),calendar:()=>ct(D(2.5,4,19,17.5,2.5),D(4.6,9,14.8,10.6,.8),D(7,11.4,2.6,2.6,.4),D(10.7,11.4,2.6,2.6,.4),D(14.4,11.4,2.6,2.6,.4),D(7,15.1,2.6,2.6,.4),D(10.7,15.1,2.6,2.6,.4),D(6.5,1.4,2.4,2.6,[1.2,1.2,0,0]),D(15.1,1.4,2.4,2.6,[1.2,1.2,0,0])),user:()=>Ie(J(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:()=>ct(D(2,3,20,14,4),Z([[6.5,17],[11.5,17],[5.8,21.8]]),J(7.5,10,1.5),J(12,10,1.5),J(16.5,10,1.5)),bag:()=>Ie(D(3.5,7.5,17,14.5,2),Dn(12,7.5,3.1,4.8,-180,0)),bell:()=>Ie("M3.5 17.2A8.5 8.5 0 0 1 20.5 17.2Z",D(1.5,18.2,21,2.6,1.3),D(11.2,6.6,1.6,2.6,0),D(9.8,4.6,4.4,2.4,1.2)),cup:()=>Ie("M4 6.5H17V13.5A6.5 6.5 0 0 1 4 13.5Z",Dn(17,10.2,1.7,3.6,-90,90),D(2,20.6,17,2,1),D(7,1.6,1.6,3.4,.8),D(11.6,1.6,1.6,3.4,.8)),card:()=>ct(D(1.5,4.5,21,15,2.5),D(1.5,8,21,3,0),D(4.5,13.6,4.6,3.2,.6)),check:()=>ct(J(12,12,10.5),Z([[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:()=>ct(J(12,12,10.5),J(12,7.2,1.6),D(10.6,10,2.8,8,.8)),home:()=>ct(Z([[12,2.5],[22.5,11.5],[19.5,11.5],[19.5,21.5],[4.5,21.5],[4.5,11.5],[1.5,11.5]]),D(10,14.5,4,7,[.6,.6,0,0])),pin:()=>ct("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",J(12,9.5,3)),share:()=>Ie(fo(6,12,18,5,1.8),fo(6,12,18,19,1.8),J(18,5,3.2),J(6,12,3.2),J(18,19,3.2)),download:()=>Ie(D(10.6,2,2.8,9.5,0),Z([[6,10],[18,10],[12,16.5]]),Z([[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:()=>ct(J(12,12,10.5),J(12,12,8.4),Z([[11,5.4],[13,5.4],[13,11.3],[16.9,13.5],[15.9,15.2],[11,12.5]])),snowflake:vf,pumpkin:()=>Ie(gr(7.8,14.6,5.8,6.9),gr(16.2,14.6,5.8,6.9),gr(12,14.6,4.8,7.4),D(10.9,3.4,2.2,4.6,.8),cc([[13,4.2],[17.2,3],[16.2,5.4],[13,6]])),tree:()=>Ie(Z([[12,1.5],[16.8,8.2],[7.2,8.2]]),Z([[12,5.2],[19,13.6],[5,13.6]]),Z([[12,9.4],[21.2,19.2],[2.8,19.2]]),D(10.4,18.6,3.2,3.9,.4)),sparkle:()=>Ie(Z(Fn(9.5,13.5,9,2.4,4)),Z(Fn(19,5,4,1.1,4))),gift:()=>Ie(D(3,11.2,7.8,10.6,1),D(13.2,11.2,7.8,10.6,1),D(2,7.4,8.8,3.2,1),D(13.2,7.4,8.8,3.2,1),gr(8.8,4.8,2.9,1.9),gr(15.2,4.8,2.9,1.9))};function Si(e){return If[e]()}var Lf={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"},Tf=Object.fromEntries(Object.entries(Lf).map(([e,t])=>[e,[Number.parseInt(t.slice(0,2),16),Number.parseInt(t.slice(2,4),16),Number.parseInt(t.slice(4,6),16)]]));function uc(e,t){let n=e.trim(),o=Number.parseFloat(n);return Number.isNaN(o)?Number.NaN:n.endsWith("%")?o/100*t:o}function le(e){if(!e)return null;let t=e.trim().toLowerCase();if(t==="transparent")return {r:0,g:0,b:0,a:0};let n=Tf[t];if(n)return {r:n[0],g:n[1],b:n[2],a:1};if(t.startsWith("#")){let r=t.slice(1);return (r.length===3||r.length===4)&&(r=r.split("").map(a=>a+a).join("")),/^[0-9a-f]{6}([0-9a-f]{2})?$/.test(r)?{r:Number.parseInt(r.slice(0,2),16),g:Number.parseInt(r.slice(2,4),16),b:Number.parseInt(r.slice(4,6),16),a:r.length===8?Number.parseInt(r.slice(6,8),16)/255:1}:null}let o=/^rgba?\(([^)]*)\)$/.exec(t);if(o){let[r,a]=o[1].split("/"),i=r.split(/[\s,]+/).filter(Boolean);if(i.length!==(a===void 0&&i.length===4?4:3))return null;let s=a??i[3],[l,c,u]=i.slice(0,3).map(d=>uc(d,255)),m=s===void 0?1:uc(s,1);if([l,c,u,m].some(d=>Number.isNaN(d)))return null;let f=(d,g)=>Math.min(Math.max(d,0),g);return {r:f(l,255),g:f(c,255),b:f(u,255),a:f(m,1)}}return null}function St(e,t,n){let o=e/255,r=t/255,a=n/255,i=1-Math.max(o,r,a);return i>=1?[0,0,0,1]:[K((1-o-i)/(1-i)),K((1-r-i)/(1-i)),K((1-a-i)/(1-i)),K(i)]}function mc(e){return e===" "?.3:/[MWmw@%]/.test(e)?.92:/[A-Z0-9#&]/.test(e)?.72:/[il.,:;!'|1]/.test(e)?.32:.6}function Ci(e){let t=0;for(let n of e)t+=mc(n);return Math.max(t,1)}var wi=e=>Math.round(Math.min(255,Math.max(0,e))).toString(16).padStart(2,"0");function br(e,t,n){let o=le(e)??{r:0,g:0,b:0},r=le(t)??{r:255,g:255,b:255},a=Math.min(1,Math.max(0,n));return `#${wi(o.r+(r.r-o.r)*a)}${wi(o.g+(r.g-o.g)*a)}${wi(o.b+(r.b-o.b)*a)}`}function dc(e,t,n,o,r,a,i,s){let l=[...e],c=r*.08,u=l.map(h=>mc(h)*r),m=u.reduce((h,p)=>h+p,0)+c*Math.max(0,l.length-1),f=a==="top"?o-r*.35:o+r*.35,d=[],g=0;return l.forEach((h,p)=>{let b=u[p],_=(g+b/2)/f;if(g+=b+c,h.trim()==="")return;let y=a==="top"?-Math.PI/2-m/2/f+_:Math.PI/2+m/2/f-_;d.push({text:h,x:t+f*Math.cos(y),y:n+f*Math.sin(y),fontSize:r,maxWidth:r*2,color:i,rotate:y*180/Math.PI+(a==="top"?90:-90),field:s});}),d}function ye(e,t="#000000"){return e?typeof e=="string"?e:e.type==="solid"?e.color:e.type==="image"?e.underlay||t:(e.type==="linear"||e.type==="radial"||e.type==="angular")&&e.stops[0]?.color||t:t}var _r=class extends Error{issues;constructor(t){super(`Invalid frame spec: ${t.slice(0,5).join("; ")}`),this.name="FrameSpecError",this.issues=t;}},fc=new WeakMap;function jt(e){if(e&&typeof e=="object"){let n=fc.get(e);if(n)return n}if(e==null)throw new _r(['A "custom" frame needs a spec']);let t=lo(e);if(!t.success)throw new _r(t.issues.map(sc));return typeof e=="object"&&fc.set(e,t.data),t.data}function Ri(e){let t=jt(e);return vn(t)/t.qr.size}var kf=e=>{let t=le(e);return !!(t&&t.a>=1)};function Ff(e,t){let n=ye(t,fe);return e.qr.plate==="none"?{color:n,plate:false}:kf(n)?{color:n,plate:true}:e.qr.plate==="background"?{color:n,plate:false}:{color:fe,plate:true}}function ho(e,t,n=fe){let o=t.color||e.colors.frame,r=t.secondaryColor||e.colors.accent||o,a=l=>l==="frame"?o:l==="accent"?r:l==="background"?n:l,i=e.colors.text,s=t.textColor||(i===void 0?o:typeof i=="string"?i:br(a(i.mix[0]),a(i.mix[1]),i.amount));return {frame:o,text:s,accent:r}}function Nf(e,t,n){let o=ho(t,e,n),r=a=>{switch(a){case "frame":return o.frame;case "text":return o.text;case "accent":return o.accent;case "background":return n;default:return a}};return a=>typeof a=="string"?r(a):br(r(a.mix[0]),r(a.mix[1]),a.amount)}function hc(e,t,n=0,o=0){let r=ir(e);return r?ti(r,t,n,o):""}function Of(e,t,n,o){return `M${x(e-n)} ${x(t)}A${x(n)} ${x(o)} 0 1 1 ${x(e+n)} ${x(t)}A${x(n)} ${x(o)} 0 1 1 ${x(e-n)} ${x(t)}Z`}function Df(e,t){let[n,o,r,a]=[e.x1*t,e.y1*t,e.x2*t,e.y2*t],i=Math.hypot(r-n,a-o),s=e.width*t/2,l=i>0?(r-n)/i:1,c=i>0?(a-o)/i:0,u=-c*s,m=l*s,f=(p,b)=>{let _=[n+l*p,o+c*p],y=[n+l*b,o+c*b];if(e.cap==="round"&&b-p>2*s){let w=[_[0]+l*s,_[1]+c*s],C=[y[0]-l*s,y[1]-c*s];return `M${x(w[0]-u)} ${x(w[1]-m)}L${x(C[0]-u)} ${x(C[1]-m)}A${x(s)} ${x(s)} 0 0 1 ${x(C[0]+u)} ${x(C[1]+m)}L${x(w[0]+u)} ${x(w[1]+m)}A${x(s)} ${x(s)} 0 0 1 ${x(w[0]-u)} ${x(w[1]-m)}Z`}return `M${x(_[0]-u)} ${x(_[1]-m)}L${x(y[0]-u)} ${x(y[1]-m)}L${x(y[0]+u)} ${x(y[1]+m)}L${x(_[0]+u)} ${x(_[1]+m)}Z`};if(!e.dash)return {type:"path",d:f(0,i),fillRule:"nonzero"};let d=e.dash[0]*t,g=d+e.dash[1]*t,h=[];for(let p=0;p+d<=i+1e-6;p+=g)h.push(f(p,p+d));return {type:"path",d:h.join(""),fillRule:"nonzero"}}function Bf(e,t){switch(e.type){case "rect":return {type:"rect",x:e.x*t,y:e.y*t,width:e.width*t,height:e.height*t,radius:(e.radius??0)*t,...e.hole&&{hole:{x:e.hole.x*t,y:e.hole.y*t,width:e.hole.width*t,height:e.hole.height*t,radius:(e.hole.radius??0)*t}}};case "circle":return {type:"path",d:J(e.cx*t,e.cy*t,e.r*t)+(e.hole?J(e.cx*t,e.cy*t,e.hole*t):""),fillRule:e.hole?"evenodd":"nonzero"};case "ellipse":return {type:"path",d:Of(e.cx*t,e.cy*t,e.rx*t,e.ry*t),fillRule:"nonzero"};case "polygon":return {type:"polygon",points:e.points.map(([n,o])=>[n*t,o*t])};case "path":return {type:"path",d:hc(e.d,t),fillRule:e.fillRule??"nonzero"};case "line":return Df(e,t);default:{let n=Si(e.icon);return {type:"path",d:hc(n.d,e.size*t/$i,e.x*t,e.y*t),fillRule:n.fillRule}}}}function Gf(e){if(e.type==="rect"){let{x:t,y:n,width:o,height:r,radius:a,hole:i}=e;return [...tt(t,n,o,r,a,a),...i?tt(i.x,i.y,i.width,i.height,i.radius,i.radius):[]]}return e.type==="polygon"?[...e.points.map(([t,n],o)=>o===0?{op:"M",x:t,y:n}:{op:"L",x:t,y:n}),{op:"Z"}]:st(e.d)}function Qf(e,t,n){let o=Gf(e),r=to(o,.2),a=e.type==="rect"?e.hole?"evenodd":"nonzero":e.type==="path"?e.fillRule??"nonzero":"nonzero",i=t.direction==="vertical",s=p=>i?p[1]:p[0],l=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY;for(let p of r)for(let b of p)l=Math.min(l,s(b)),c=Math.max(c,s(b));if(!(c>l))return [];let u=t.steps??32,m=n(t.from),f=n(t.to),d=c-l,g=d*.002,h=[];for(let p=0;p<u;p++){let b=l+d*p/u,_=Math.min(c,l+d*(p+1)/u+(p+1<u?g:0)),y=i?{x0:Number.NEGATIVE_INFINITY,x1:Number.POSITIVE_INFINITY,y0:b,y1:_}:{x0:b,x1:_,y0:Number.NEGATIVE_INFINITY,y1:Number.POSITIVE_INFINITY},w=r.map(C=>Rn(C,y)).filter(C=>C.length>2);w.length!==0&&h.push({type:"path",d:Hl(w),fill:br(m,f,(p+.5)/u),fillRule:a});}return h}function Uf(e,t,n){let o=Bf(e,t),r="stroke"in e&&e.stroke?{stroke:n(e.stroke.color),strokeWidth:e.stroke.width*t}:void 0;if(typeof e.fill=="object"&&"gradient"in e.fill){let a=Qf(o,e.fill.gradient,n);return r?[...a,{...o,fill:"none",...r}]:a}return [{...o,fill:n(e.fill),...r}]}function Hf(e,t){let n=Math.min(e.maxLength??se.maxTextLength,se.maxTextLength),o=e.slot==="primary"?t.text??e.text:e.slot==="secondary"?t.secondaryText??e.text:e.text;return Pn(o,n)}function zf(e){return e===void 0||!Number.isFinite(e)?1:Math.min(Cn,Math.max(ar,e))}function Wf(e,t,n,o,r,a){let i=r(e.color),s=e.weight==="regular"?{fontWeight:400}:{};if(e.type==="curved"){let{cx:h,cy:p,radius:b,side:_,spread:y=140}=e.curve,w=b*o*(y*Math.PI/180),C=Math.min(e.fontSize*o*n,w/(Ci(t)+.08*t.length));return dc(t,h*o,p*o,b*o,C,_,i,a).map(S=>({...S,...s}))}let l=e.box.x*o,c=e.box.y*o,u=e.box.width*o,m=e.box.height*o;if(!(m>0))return [];let f=(e.fontSize??e.box.height*ci)*o,d=Math.min(f*n,m*ur,u/Ci(t)),g=e.align??"middle";return [{text:t,x:g==="start"?l:g==="end"?l+u:l+u/2,y:c+m/2+d*.35,fontSize:d,maxWidth:u,color:i,...g!=="middle"&&{align:g},...s,field:a}]}function qf(e){let t=0,n=0,o=0,r=0;return e.map(({command:a,values:i})=>{let s=a.toUpperCase(),l=a!==s;switch(s){case "Z":return t=o,n=r,{command:"Z",values:[]};case "H":return t=(l?t:0)+i[0],{command:"H",values:[t]};case "V":return n=(l?n:0)+i[0],{command:"V",values:[n]};case "A":return t=(l?t:0)+i[5],n=(l?n:0)+i[6],{command:"A",values:[...i.slice(0,5),t,n]};default:{let c=i.map((u,m)=>l?u+(m%2===0?t:n):u);return t=c.at(-2),n=c.at(-1),s==="M"&&(o=t,r=n),{command:s,values:c}}}})}function Vf(e,t){let n=ir(e);return n?ti(qf(n).map(({command:o,values:r})=>o==="V"?{command:o,values:[t(r[0])]}:o==="H"||o==="Z"?{command:o,values:r}:o==="A"?{command:o,values:[...r.slice(0,6),t(r[6])]}:{command:o,values:r.map((a,i)=>i%2===1?t(a):a)})):e}function jf(e,t){let n=(o,r)=>{let a=t(o);return {y:a,height:t(o+r)-a}};switch(e.type){case "rect":return {...e,...n(e.y,e.height),...e.hole&&{hole:{...e.hole,...n(e.hole.y,e.hole.height)}}};case "circle":case "ellipse":return {...e,cy:t(e.cy)};case "polygon":return {...e,points:e.points.map(([o,r])=>[o,t(r)])};case "path":return {...e,d:Vf(e.d,t)};case "line":return {...e,y1:t(e.y1),y2:t(e.y2)};default:return {...e,y:t(e.y)}}}function Xf(e,t){if(t.length===0)return e;let n=r=>{let a=r;for(let i of t)a-=Math.min(Math.max(r-i.y,0),i.height);return a},o=(r,a)=>t.some(i=>r>=i.y-1e-6&&a<=i.y+i.height+1e-6);return {...e,artboard:{...e.artboard,height:n(e.artboard.height)},qr:{...e.qr,y:n(e.qr.y)},shapes:e.shapes.filter(r=>{let{bounds:a}=ui(r);return !(a&&o(a.y0,a.y1))}).map(r=>jf(r,n)),labels:e.labels.map(r=>{if(r.type==="curved")return {...r,curve:{...r.curve,cy:n(r.curve.cy)}};let a=n(r.box.y);return {...r,box:{...r.box,y:a,height:n(r.box.y+r.box.height)-a}}})}}function yr(e,t,n,o,r={}){let a=new Map(t.labels.map(p=>[p.id,Hf(p,n)])),i=Xf(t,t.labels.flatMap(p=>p.collapse&&!a.get(p.id)?[p.collapse]:[])),s=e/i.qr.size,l=Ff(i,o),c=Nf(n,i,l.color),u=i.shapes.flatMap(p=>Uf(p,s,c));if(l.plate){let p=vn(i)*s;u.push({type:"rect",x:i.qr.x*s-p,y:i.qr.y*s-p,width:e+2*p,height:e+2*p,radius:(i.qr.radius??0)*s,fill:l.color});}let m=zf(n.fontScale),f=i.labels.flatMap(p=>{let b=a.get(p.id);if(!b)return [];let _=(p.slot==="fixed"?void 0:r[p.slot])??p.id;return Wf(p,b,m,s,c,_)}),d=f[0],g=d&&d.rotate===void 0?d:null,h=i.bleed??"none";return {width:i.artboard.width*s,height:i.artboard.height*s,qrX:i.qr.x*s,qrY:i.qr.y*s,qrSize:e,shapes:u,label:g,extraLabels:g?f.slice(1):f,squareEdges:h!=="none",color:c(h==="none"?"frame":h)}}function Mi(e,t,n){return yr(e,jt(t.spec),t,n)}var pc={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 gc={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 bc={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 _c={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 yc={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 xc={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 $c={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 Sc={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 po={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 wc={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 Cc={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 Rc={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 Mc={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 Ec={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 Ac={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 Pc={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 vc={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 Ic={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 we=(e,t,n,o,r)=>({style:e,name:t,tags:r,labelOn:o,spec:n}),Ai=[we("banner-bottom","Banner",Ei,"frame",["bottom","band"]),we("banner-top","Top banner",gc,"frame",["top","band"]),we("banner-top-bottom","Two banners",bc,"frame",["top","bottom","band"]),we("border","Border",_c,"background",["square","outline"]),we("rounded-border","Rounded",Mc,"background",["border","outline"]),we("gradient-border","Gradient",po,"background",["border","colorful"]),we("focus","Focus",Sc,"background",["corners","brackets"]),we("speech-bubble","Bubble",Ec,"frame",["speech"]),we("speech-bubble-top","Bubble top",Ac,"frame",["speech"]),we("chat-bubble","Chat",yc,"frame",["message","bubble"]),we("circle","Circle",xc,"frame",["round","ring","curved"]),we("badge","Ribbon",pc,"frame",["badge","banner"]),we("sticker","Sticker",Pc,"frame",["label"]),we("polaroid","Polaroid",Rc,"frame",["photo","picture"]),we("phone","Phone",Cc,"background",["mobile","screen"]),we("ticket","Ticket",Ic,"frame",["event","pass"]),we("tag","Tag",vc,"frame",["price","label"]),we("envelope","Envelope",$c,"frame",["mail","letter"]),we("menu-card","Menu card",wc,"background",["menu","restaurant"])],p1=new Map(Ai.map(e=>[e.style,e]));function Pi(e){return p1.get(e)}var g1=Object.fromEntries(Ai.map(e=>[e.style,e.spec])),b1={from:po.colors.frame,to:po.colors.accent};function go(e){return !e||e.style==="none"?null:e.style===cr?e.spec??null:Pi(e.style)?.spec??null}function _1(e){let t=go(e);return e&&typeof t?.colors?.frame=="string"?ho(t,e):null}var y1={primary:"text",secondary:"secondaryText"};function Lc(e,t,n){let o=Pi(t.style)?.spec??Ei;return yr(e,jt(o),t,n,y1)}var _o="system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif",kc=.08,Fc="data-qrdx-frame-label";function Fe(e){return !!(e?.style&&e.style!=="none")}function vi(e){let t=go(e);return t?Ri(t):kc}function x1(e){return (e.text??Da).trim().slice(0,it)}function $1(e){return (e.secondaryText??"").trim().slice(0,it)}function Xt(e,t,n){return t.style===cr?Mi(e,t,n):Lc(e,t,n)}function ut(e,t){if(!Fe(t))return {width:e,height:e};let{width:n,height:o}=Xt(e,t);return {width:n,height:o}}var ne=e=>K(e,2);function Tc({x:e,y:t,width:n,height:o,radius:r}){let a=ne(Math.min(r,n/2,o/2)),[i,s,l,c]=[ne(e),ne(t),ne(n),ne(o)];return a<=0?v`M${i} ${s}h${l}v${c}h${-l}z`:v`M${i+a} ${s}h${ne(l-2*a)}a${a} ${a} 0 0 1 ${a} ${a}`+v`v${ne(c-2*a)}a${a} ${a} 0 0 1 ${-a} ${a}`+v`h${ne(-(l-2*a))}a${a} ${a} 0 0 1 ${-a} ${-a}`+v`v${ne(-(c-2*a))}a${a} ${a} 0 0 1 ${a} ${-a}z`}function bo(e){return e.stroke&&e.strokeWidth?{stroke:e.stroke,strokeWidth:ne(e.strokeWidth)}:{}}function Nc(e,t){return e.type==="rect"&&e.hole?A("path",{d:Tc(e)+Tc(e.hole),fill:e.fill,fillRule:"evenodd",...bo(e)},t):e.type==="polygon"?A("polygon",{fill:e.fill,points:e.points.map(([n,o])=>`${ne(n)},${ne(o)}`).join(" "),...bo(e)},t):e.type==="path"?A("path",{d:e.d,fill:e.fill,...e.fillRule==="evenodd"&&{fillRule:"evenodd"},...bo(e)},t):Vr("rect",{...bo(e),fill:e.fill,height:ne(e.height),key:t,width:ne(e.width),x:ne(e.x),y:ne(e.y),...e.radius>0&&{rx:ne(e.radius),ry:ne(e.radius)}})}function Oc(e){return e.shapes.map((t,n)=>Nc(t,n))}function xr(e,t){let{size:n,frame:o,bgColor:r,svgProps:a,markLabels:i}=t,s=Xt(n,o,r),l=Dc(s),c=ne(s.width),u=ne(s.height);return $e("svg",{height:u,viewBox:`0 0 ${c} ${u}`,width:c,xmlns:"http://www.w3.org/2000/svg",...a,children:[A("g",{"data-qrdx-frame":o.style,children:s.shapes.map((m,f)=>Nc(m,f))}),Nt(e,{x:ne(s.qrX),y:ne(s.qrY),width:n,height:n}),l.map((m,f)=>A("text",{"data-max-width":ne(m.maxWidth),fill:m.color,fontFamily:_o,fontSize:ne(m.fontSize),fontWeight:m.fontWeight??700,textAnchor:m.align??"middle",x:ne(m.x),y:ne(m.y),...m.rotate&&{transform:`rotate(${ne(m.rotate)} ${ne(m.x)} ${ne(m.y)})`},...i&&m.field&&{[Fc]:m.field},children:m.text},f))]})}function Ii(e){let{frame:t,size:n=ce,bgColor:o,slot:r,svgProps:a}=e,i=r??A("svg",{height:n,viewBox:`0 0 ${n} ${n}`,width:n,xmlns:"http://www.w3.org/2000/svg"});return Fe(t)?xr(i,{size:n,frame:t,bgColor:o,svgProps:a}):A("svg",{height:n,viewBox:`0 0 ${n} ${n}`,width:n,xmlns:"http://www.w3.org/2000/svg",...a,children:Nt(i,{x:0,y:0,width:n,height:n})})}function Dc(e){return [...e.label?[e.label]:[],...e.extraLabels??[]]}var yo=.22,xo=.14;function Bc(e,t,n={}){if(e==="circle")return A("circle",{cx:x(t.x+t.w/2),cy:x(t.y+t.h/2),r:x(Math.min(t.w,t.h)/2),...n});let o=e==="rounded"?Math.min(t.w,t.h)*yo:0;return A("rect",{height:x(t.h),width:x(t.w),x:x(t.x),y:x(t.y),...o>0&&{rx:x(o),ry:x(o)},...n})}function S1(e,t){let n=e.w*t,o=e.h*t;return {x:e.x+n,y:e.y+o,w:e.w-2*n,h:e.h-2*o}}function $o(e,t){let n=e.shape??"square",o=e.plate,r=o?S1(t,xo):t,a=s=>A("image",{height:x(r.h),href:e.src,preserveAspectRatio:"none",width:x(r.w),x:x(r.x),y:x(r.y),...s&&{clipPath:`url(#${s})`}});if(n==="square"&&!o)return a();let i=n==="square"?void 0:`qrdx-logo-${Vt(`${n}|${x(r.x)}|${x(r.y)}|${x(r.w)}|${x(r.h)}`)}`;return $e("g",{children:[o&&Bc(n,t,{fill:o}),i&&A("clipPath",{id:i,children:Bc(n,r)}),a(i)]})}var{QrCode:Li}=Ge,w1={"1L":3,"1M":2,"1Q":1,"1H":1,"2L":2,"3L":1};function C1(e){let t=e*4+17,n=new Uint8Array(t*t),o=(i,s)=>{i>=0&&s>=0&&i<t&&s<t&&(n[s*t+i]=1);};for(let i=0;i<t;i++)o(6,i),o(i,6);for(let[i,s]of [[3,3],[t-4,3],[3,t-4]])for(let l=-4;l<=4;l++)for(let c=-4;c<=4;c++)o(i+c,s+l);let r=[];if(e>1){let i=Math.floor(e/7)+2,s=e===32?26:Math.ceil((e*4+4)/(i*2-2))*2;r.push(6);for(let l=t-7;r.length<i;l-=s)r.splice(1,0,l);}let a=r.length-1;for(let[i,s]of r.entries())for(let[l,c]of r.entries())if(!(i===0&&l===0||i===0&&l===a||i===a&&l===0))for(let u=-2;u<=2;u++)for(let m=-2;m<=2;m++)o(s+m,c+u);for(let i=0;i<=8;i++)o(8,i),o(i,8);for(let i=0;i<8;i++)o(t-1-i,8),o(8,t-1-i);if(e>=7)for(let i=0;i<18;i++){let s=t-11+i%3,l=Math.floor(i/3);o(s,l),o(l,s);}return n}function R1(e,t){let n=e*4+17,o=jr[t].ordinal,r=Li.NUM_ERROR_CORRECTION_BLOCKS[o]?.[e]??0,a=Li.ECC_CODEWORDS_PER_BLOCK[o]?.[e]??0,i=Math.floor(Li.getNumRawDataModules(e)/8),s=r-i%r,l=Math.floor(i/r),c=Array.from({length:r},(w,C)=>l+(C<s?0:1)),u=[],m=[],f=l-a;for(let w=0;w<=l;w++)for(let C=0;C<r;C++)if(C<s){if(w===f)continue;u.push(C),m.push(w<f?w:w-1);}else u.push(C),m.push(w);if(u.length!==i)throw new Error(`Codeword map: interleave mismatch at version ${e}`);let d=C1(e),g=new Int16Array(n*n).fill(-1),h=new Int16Array(n*n).fill(-1),p=new Int8Array(n*n).fill(-1),b=i*8,_=0;for(let w=n-1;w>=1;w-=2){w===6&&(w=5);let C=(w+1&2)===0;for(let S=0;S<n;S++)for(let $=0;$<2;$++){let R=w-$,E=(C?n-1-S:S)*n+R;if(!d[E]&&_<b){let P=_>>>3;g[E]=u[P],h[E]=m[P],p[E]=7-(_&7),_++;}}}if(_!==b)throw new Error(`Codeword map: placement mismatch at version ${e}`);let y=w1[`${e}${t}`]??0;return {version:e,level:t,size:n,blocks:r,eccPerBlock:a,blockLengths:c,correctable:Math.floor((a-y)/2),block:g,codeword:h,bit:p}}var M1=8,Yt=new Map;function $r(e,t){if(!(Number.isInteger(e)&&e>=1&&e<=40))throw new RangeError(`QR version must be 1\u201340, got ${e}`);let n=`${e}${t}`,o=Yt.get(n);if(o)return Yt.delete(n),Yt.set(n,o),o;let r=R1(e,t);if(Yt.size>=M1){let a=Yt.keys().next().value;a!==void 0&&Yt.delete(a);}return Yt.set(n,r),r}function Sr(e,t){let n=new Array(e.blocks).fill(0),o=new Set;for(let r of t){let a=e.block[r]??-1;if(a<0)continue;let i=a*4096+e.codeword[r];o.has(i)||(o.add(i),n[a]=n[a]+1);}return n}var E1={2:6,3:12};function Gc(e){let t=[e.start],n=e.start;for(let o of e.segments){let r=o.at(-1);if(o.length===1)t.push(r);else {let a=E1[o.length];for(let i=1;i<=a;i++){let s=i/a,l=1-s;if(o.length===2){let[c]=o;t.push([l*l*n[0]+2*l*s*c[0]+s*s*r[0],l*l*n[1]+2*l*s*c[1]+s*s*r[1]]);}else {let[c,u]=o;t.push([l*l*l*n[0]+3*l*l*s*c[0]+3*l*s*s*u[0]+s*s*s*r[0],l*l*l*n[1]+3*l*l*s*c[1]+3*l*s*s*u[1]+s*s*s*r[1]]);}}}n=r;}return t}function Uc(e,t){let n=[];for(let o of e)for(let r=0;r<o.length;r++){let[a,i]=o[r],[s,l]=o[(r+1)%o.length];i<=t!=l<=t&&n.push(a+(t-i)/(l-i)*(s-a));}return n.sort((o,r)=>o-r)}function Hc(e,t){let n=0;for(let o of e)if(o<t)n++;else break;return n%2===1}function A1(e,t,n){return Hc(Uc(e,n),t)}function zc(e){let t=new Map;return (n,o)=>{let r=t.get(o);return r||(r=Uc(e,o),t.set(o,r)),Hc(r,n)}}function P1(e,t,n,o){let r=n[0]-e,a=n[1]-t,i=o[0]-n[0],s=o[1]-n[1],l=u=>Math.max(Math.abs(r+u*i),Math.abs(a+u*s)),c=Math.min(l(0),l(1));for(let[u,m]of [[a-r,i-s],[-(r+a),i+s]])if(m!==0){let f=u/m;f>0&&f<1&&(c=Math.min(c,l(f)));}return c}function v1(e,t,n){if(!A1(e,t,n))return 0;let o=Number.POSITIVE_INFINITY;for(let r of e)for(let a=0;a<r.length;a++)o=Math.min(o,P1(t,n,r[a],r[(a+1)%r.length]));return Number.isFinite(o)?o:0}function I1(e){let t=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,r=Number.NEGATIVE_INFINITY;for(let a of e)for(let[i,s]of a)t=Math.min(t,i),n=Math.min(n,s),o=Math.max(o,i),r=Math.max(r,s);return {x0:t,y0:n,x1:o,y1:r}}function Wc(e){let t=e.map(Gc),n=I1(t),o=n.x1-n.x0,r=n.y1-n.y0;if(!(o>0&&r>0))return null;let a=(g,h)=>{let p=Math.max(g-n.x0,n.x1-g,h-n.y0,n.y1-h);return p>0?v1(t,g,h)/(2*p):0},i={cx:n.x0+o/2,cy:n.y0+r/2,value:0};i.value=a(i.cx,i.cy);let s=32;for(let g=1;g<s;g++)for(let h=1;h<s;h++){let p=n.x0+o*h/s,b=n.y0+r*g/s,_=a(p,b);_>i.value&&(i={cx:p,cy:b,value:_});}let l=o/s,c=r/s;for(let g=0;g<6;g++){let h=i;for(let p=-2;p<=2;p++)for(let b=-2;b<=2;b++){let _=h.cx+l*b/2,y=h.cy+c*p/2,w=a(_,y);w>i.value&&(i={cx:_,cy:y,value:w});}l/=2,c/=2;}if(i.value<=0)return null;let m=.5/Math.max(i.cx-n.x0,n.x1-i.cx,i.cy-n.y0,n.y1-i.cy),f=([g,h])=>[.5+(g-i.cx)*m,.5+(h-i.cy)*m],d=e.map(g=>({start:f(g.start),segments:g.segments.map(h=>h.map(f))}));return {rings:d,polygons:d.map(Gc),half:i.value}}function qc(e,t){let n=([r,a])=>`${x(r*t)} ${x(a*t)}`,o="";for(let r of e.rings){o+=`M${n(r.start)}`;for(let a of r.segments){let i=a.length===1?"L":a.length===2?"Q":"C";o+=i+a.map(n).join(" ");}o+="Z";}return o}var L1={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]]]},Qc;function Vc(){return Qc??=Wc([L1]),Qc}function T1(e){let{width:t,height:n,cells:o}=e;return Number.isInteger(t)&&Number.isInteger(n)&&t>=_t&&n>=_t&&t<=Gt&&n<=Gt&&typeof o=="string"&&o.length===t*n&&/^[01]*$/.test(o)?(r,a)=>r>=0&&a>=0&&r<t&&a<n&&o[a*t+r]==="1":null}var mt=([e,t])=>`${e},${t}`;function k1(e,t,n){let o=(l,c)=>e(l-1,c-1),r=new Map,a=(l,c)=>{for(let[u,m]of [[l,c],[c,l]]){let f=r.get(mt(u))??[];f.push(m),r.set(mt(u),f);}};for(let l=0;l<=n;l++)for(let c=0;c<=t;c++){let u=o(c,l),m=o(c+1,l),f=o(c+1,l+1),d=o(c,l+1),g=[c,l-.5],h=[c+.5,l],p=[c,l+.5],b=[c-.5,l];switch((u?8:0)+(m?4:0)+(f?2:0)+(d?1:0)){case 1:case 14:a(b,p);break;case 2:case 13:a(p,h);break;case 3:case 12:a(b,h);break;case 4:case 11:a(g,h);break;case 6:case 9:a(g,p);break;case 7:case 8:a(b,g);break;case 5:a(g,h),a(b,p);break;case 10:a(b,g),a(p,h);break;}}let i=[],s=new Set;for(let[l,c]of r){if(s.has(l)||c.length===0)continue;let[u,m]=l.split(",").map(Number),f=[[u,m]];s.add(l);let d=[u,m],g=c[0];for(;!s.has(mt(g));){s.add(mt(g)),f.push(g);let h=F1(r.get(mt(g))??[],d,s);if(!h)break;d=g,g=h;}f.length>=3&&i.push(N1(f));}return i}function F1(e,t,n){let o=mt(t);return e.find(r=>mt(r)!==o&&!n.has(mt(r)))??e.find(r=>mt(r)!==o)}function N1(e){let t=[];for(let n=0;n<e.length;n++){let o=e[(n-1+e.length)%e.length],r=e[n],a=e[(n+1)%e.length],i=(r[0]-o[0])*(a[1]-r[1])-(r[1]-o[1])*(a[0]-r[0]);Math.abs(i)>1e-9&&t.push(r);}return t.length>=3?t:e}function O1(e){let t=(a,i)=>[(a[0]+i[0])/2,(a[1]+i[1])/2],n=e.length,o=t(e[n-1],e[0]),r=e.map((a,i)=>[a,t(a,e[(i+1)%n])]);return {start:o,segments:r}}var wr=new Map;function Ti(e){let t=`${e.width}x${e.height}:${e.cells}`,n=wr.get(t);if(n)return n;let o=T1(e),r;if(!o)r={outline:null,problem:"invalid"};else if(e.cells.includes("1")){let a=k1(o,e.width,e.height),i=a.length>0?Wc(a.map(O1)):null;r=i&&2*i.half>=za?{outline:i,problem:null}:{outline:null,problem:i?"thin":"empty"};}else r={outline:null,problem:"empty"};return wr.size>16&&wr.delete(wr.keys().next().value),wr.set(t,r),r}var D1=1,jc=.5,Xc=.5,B1=.5;function Zt(e){return Math.max(e,Ha)}function So(e){return e==="heart"?Vc():typeof e=="object"&&e?.type==="silhouette"?Ti(e).outline:null}function Cr(e){return e==="circle"||So(e)!==null}var G1={invalid:"This silhouette isn't a valid shape grid.",empty:"No shape found: use a picture with a dark or opaque shape on a light or clear background.",thin:"This shape is too thin to hold the code with its quiet zone. Try a rounder, fuller shape."};function Q1(e){let{outline:t,problem:n}=Ti(e);if(t&&!n)return {ok:true,share:2*t.half};let o=n??"invalid";return {ok:false,reason:o,message:G1[o]}}function Me(e,t,n){if(n==="circle"){let i=Zt(t),s=(e/2+i)*Math.SQRT2+D1;return Math.ceil(s-e/2)}let o=So(n);if(!o)return t;let r=Zt(t),a=(e+2*(r+B1))/(2*o.half);return Math.ceil((a-e)/2-1e-9)}function Yc(e){let t=e>>>0;return ()=>{t=t+1831565813>>>0;let n=t;return n=Math.imul(n^n>>>15,n|1),n^=n+Math.imul(n^n>>>7,n|61),((n^n>>>14)>>>0)/4294967296}}function U1(e,t,n){let o=Me(t,n,"circle"),r=Zt(n),a=t+2*o,i=a/2,s=i-jc-.5,l=Yc(Number.parseInt(Vt(e),36)||1),c=o-r,u=o+t+r;return Array.from({length:a},(m,f)=>Array.from({length:a},(d,g)=>{let h=l()<Xc;return g>=c&&g<u&&f>=c&&f<u?false:h&&Math.hypot(g+.5-i,f+.5-i)<=s}))}var H1=Array.from({length:8},(e,t)=>{let n=t*Math.PI/4;return [Math.cos(n),Math.sin(n)]});function Zc(e,t,n,o){if(o==="circle")return U1(e,t,n);let r=So(o);if(!r)return null;let a=Me(t,n,o),i=Zt(n),s=t+2*a,l=zc(r.polygons),c=.5+jc,u=(g,h)=>{let p=g+.5,b=h+.5;return l(p/s,b/s)?H1.every(([_,y])=>l((p+_*c)/s,(b+y*c)/s)):false},m=Yc(Number.parseInt(Vt(e),36)||1),f=a-i,d=a+t+i;return Array.from({length:s},(g,h)=>Array.from({length:s},(p,b)=>{let _=m()<Xc;return b>=f&&b<d&&h>=f&&h<d?false:_&&u(b,h)}))}function ki(e,t){if(e==="circle")return {circle:t/2};let n=So(e);return n?{path:qc(n,t)}:null}function z1(e,t){let n=ki(e,t);return n?"circle"in n?J(t/2,t/2,n.circle):n.path:null}function Ee(e,t,n){return Ge.QrCode.encodeSegments(Ge.QrSegment.makeSegments(e),jr[t],Ge.QrCode.MIN_VERSION,Ge.QrCode.MAX_VERSION,-1,!n)}function Le(e,t="#000000"){return e?typeof e=="string"?{type:"solid",color:e}:e:{type:"solid",color:t}}function Kt(e){return !e||typeof e=="string"?false:e.type==="linear"||e.type==="radial"||e.type==="angular"}function Fi(e){return typeof e=="object"&&e!==null&&e.type==="image"}function W1(e,t="#000000"){let n=Le(e,t);return n.type==="solid"?n.color:n.type==="image"?n.underlay||t:n.stops[0]?.color||t}function Kc(e="center"){let[t,n]=e.split("-");return e==="center"?"center":n?`${n} ${t}`:t==="top"||t==="bottom"?`center ${t}`:`${t} center`}function q1(e){if(!e)return "#000000";if(typeof e=="string")return e;let t=Le(e);if(t.type==="solid")return t.color;if(t.type==="image"){let r=t.fit==="tile"?`${25*(t.scale??1)}% auto`:(t.scale??1)===1?t.fit==="contain"?"contain":"cover":`${100*(t.scale??1)}% auto`,a=t.fit==="tile"?"repeat":"no-repeat";return `${`url("${t.src.replace(/"/g,"%22")}")`} ${Kc(t.position)} / ${r} ${a}, ${t.underlay??"transparent"}`}let o=[...t.stops].sort((r,a)=>r.offset-a.offset).map(r=>`${r.color} ${r.offset}%`).join(", ");return t.type==="linear"?`linear-gradient(${(t.angle??0)+90}deg, ${o})`:t.type==="angular"?`conic-gradient(from ${t.angle??0}deg, ${o})`:`radial-gradient(circle, ${o})`}var Te=e=>e/255,Rr=(e,t)=>(e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]-t[2])**2,ee=e=>.2126*e[0]+.7152*e[1]+.0722*e[2];function Ni(e){let{width:t,height:n,data:o}=e,r=[0,t-1,(n-1)*t,n*t-1].map(i=>{let s=i*4;return {color:[Te(o[s]),Te(o[s+1]),Te(o[s+2])],alpha:o[s+3]/255}});if(r.some(i=>i.alpha<.9))return null;let a=r[0].color;return r.every(({color:i})=>Rr(i,a)<.006)?a:null}function V1(e){let{width:t,height:n,data:o}=e,r=Ni(e),a=new Float32Array(t*n);for(let i=0;i<a.length;i++){let s=i*4,l=o[s+3]/255;if(r&&l>0){let c=Math.sqrt(Rr([Te(o[s]),Te(o[s+1]),Te(o[s+2])],r));l*=Math.min(1,Math.max(0,(c-.06)/.1));}a[i]=l;}return a}var j1=8,X1=.14,Jc=.006;function Y1(e,t){let{width:n,height:o,data:r}=e,a=new Float64Array(4096),i=new Float64Array(4096*3),s=0;for(let d=0;d<t.length;d++){if(t[d]<.9)continue;let g=d*4,h=Math.floor(r[g]/16)*256+Math.floor(r[g+1]/16)*16+Math.floor(r[g+2]/16);a[h]+=1,i[h*3]+=Te(r[g]),i[h*3+1]+=Te(r[g+1]),i[h*3+2]+=Te(r[g+2]),s++;}if(s===0)return {palette:[],error:0};let l=[...a.keys()].filter(d=>a[d]>0).sort((d,g)=>a[g]-a[d]),c=[];for(let d of l){if(a[d]/s<Jc/2||c.length>=j1)break;let g=[i[d*3]/a[d],i[d*3+1]/a[d],i[d*3+2]/a[d]];c.every(h=>Rr(h,g)>=X1**2)&&c.push(g);}let u=[],m=0;for(let d=0;d<3;d++){u=c.map(()=>({n:0,r:0,g:0,b:0,x:0,y:0})),m=0;for(let g=0;g<t.length;g++){if(t[g]<.9)continue;let h=g*4,p=[Te(r[h]),Te(r[h+1]),Te(r[h+2])],b=0,_=Number.POSITIVE_INFINITY;for(let[w,C]of c.entries()){let S=Rr(p,C);S<_&&(_=S,b=w);}let y=u[b];y.n++,y.r+=p[0],y.g+=p[1],y.b+=p[2],y.x+=g%n,y.y+=Math.floor(g/n),m+=Math.sqrt(_);}for(let[g,h]of u.entries())h.n>0&&(c[g]=[h.r/h.n,h.g/h.n,h.b/h.n]);}return {palette:c.map((d,g)=>({color:d,area:u[g].n/s,cx:u[g].n?u[g].x/u[g].n+.5:n/2,cy:u[g].n?u[g].y/u[g].n+.5:o/2})).filter(d=>d.area>=Jc).sort((d,g)=>g.area-d.area),error:m/s}}function Z1(e,t,n){let o=t+2,r=n+2,a=(m,f)=>m<=0||f<=0||m>t||f>n?0:e[(f-1)*t+(m-1)],i=new Map,s=new Map,l=m=>{let f=s.get(m);if(f)return f;let d=Math.floor(m/2),g=d%o,h=Math.floor(d/o),p=a(g,h),b=m%2===1,_=b?a(g,h+1):a(g+1,h),y=p===_?.5:Math.min(1,Math.max(0,(.5-p)/(_-p))),w=b?[g-.5,h-.5+y]:[g-.5+y,h-.5];return s.set(m,w),w},c=(m,f)=>{i.set(m,f);};for(let m=0;m<r-1;m++)for(let f=0;f<o-1;f++){let d=a(f,m)>=.5,g=a(f+1,m)>=.5,h=a(f+1,m+1)>=.5,p=a(f,m+1)>=.5,b=2*(m*o+f),_=2*((m+1)*o+f),y=2*(m*o+f)+1,w=2*(m*o+f+1)+1;switch((d?8:0)+(g?4:0)+(h?2:0)+(p?1:0)){case 1:c(_,y);break;case 2:c(w,_);break;case 3:c(w,y);break;case 4:c(b,w);break;case 5:{(a(f,m)+a(f+1,m)+a(f+1,m+1)+a(f,m+1))/4>=.5?(c(b,y),c(_,w)):(c(b,w),c(_,y));break}case 6:c(b,_);break;case 7:c(b,y);break;case 8:c(y,b);break;case 9:c(_,b);break;case 10:{(a(f,m)+a(f+1,m)+a(f+1,m+1)+a(f,m+1))/4>=.5?(c(y,_),c(w,b)):(c(y,b),c(w,_));break}case 11:c(w,b);break;case 12:c(y,w);break;case 13:c(_,w);break;case 14:c(y,_);break;}}let u=[];for(let m of i.keys()){if(!i.has(m))continue;let f=[],d=m;for(;d!==void 0&&i.has(d);){f.push(l(d));let g=i.get(d);i.delete(d),d=g;}f.length>=3&&u.push(f);}return u}function K1(e){let t=0;for(let n=0;n<e.length;n++){let o=e[n],r=e[(n+1)%e.length];t+=o[0]*r[1]-r[0]*o[1];}return t/2}function eu(e,t){if(e.length<=2)return e;let n=new Uint8Array(e.length);n[0]=1,n[e.length-1]=1;let o=[[0,e.length-1]];for(;o.length>0;){let[r,a]=o.pop(),i=e[r],s=e[a],l=s[0]-i[0],c=s[1]-i[1],u=Math.hypot(l,c)||1,m=-1,f=t;for(let d=r+1;d<a;d++){let g=e[d],h=Math.abs(c*(g[0]-i[0])-l*(g[1]-i[1]))/u;h>f&&(f=h,m=d);}m>=0&&(n[m]=1,o.push([r,m],[m,a]));}return e.filter((r,a)=>n[a]===1)}function J1(e,t){let n=0,o=-1;for(let[i,s]of e.entries()){let l=(s[0]-e[0][0])**2+(s[1]-e[0][1])**2;l>o&&(o=l,n=i);}let r=eu(e.slice(0,n+1),t),a=eu([...e.slice(n),e[0]],t);return [...r.slice(0,-1),...a.slice(0,-1)]}var wt=e=>K(e,2);function eh(e,t){let n=e.length,o=(a,i)=>{let s=Math.hypot(i[0]-a[0],i[1]-a[1])||1,l=Math.min(.5,t/s);return [a[0]+(i[0]-a[0])*l,a[1]+(i[1]-a[1])*l]},r="";for(let a=0;a<n;a++){let i=e[a],s=o(i,e[(a-1+n)%n]),l=o(i,e[(a+1)%n]);r+=a===0?`M${wt(s[0])} ${wt(s[1])}`:`L${wt(s[0])} ${wt(s[1])}`,r+=`Q${wt(i[0])} ${wt(i[1])} ${wt(l[0])} ${wt(l[1])}`;}return `${r}Z`}function th(e,t,n){let o="";for(let r of Z1(e,t,n)){if(Math.abs(K1(r))<.8)continue;let a=J1(r,.18);a.length>=3&&(o+=eh(a,.9));}return o}var nh=.075;function tu(e){let{width:t,height:n,data:o}=e,r=V1(e),a=0;for(let h of r)a+=h;let{palette:i,error:s}=Y1(e,r),l={width:t,height:n,palette:i,alpha:r,coverage:a/(t*n)};if(i.length===0||s>nh)return {...l,layers:[],photographic:i.length>0};let c=i.length,u=Array.from({length:c},()=>new Float32Array(t*n)),m=i.map(h=>h.color);for(let h=0;h<r.length;h++){let p=r[h];if(p<=0)continue;let b=h*4,_=[Te(o[b]),Te(o[b+1]),Te(o[b+2])],y=0,w=-1,C=Number.POSITIVE_INFINITY,S=Number.POSITIVE_INFINITY;for(let P=0;P<c;P++){let I=Rr(_,m[P]);I<C?(w=y,S=C,y=P,C=I):I<S&&(w=P,S=I);}if(w<0||C<1e-6){u[y][h]=p;continue}let $=m[y],R=m[w],M=[R[0]-$[0],R[1]-$[1],R[2]-$[2]],E=Math.min(1,Math.max(0,((_[0]-$[0])*M[0]+(_[1]-$[1])*M[1]+(_[2]-$[2])*M[2])/(M[0]**2+M[1]**2+M[2]**2)));u[y][h]=p*(1-E),u[w][h]=p*E;}let f=[],d=new Float32Array(t*n),g=new Array(c);for(let h=c-1;h>=0;h--){let p=u[h];for(let b=0;b<d.length;b++)d[b]+=p[b];g[h]=d.slice();}for(let h=0;h<c;h++){let p=th(g[h],t,n);p&&f.push({color:m[h],d:p});}return {...l,layers:f,photographic:false}}var su=.6,Bi={logo:160,halftone:160};function rh(e){let t="";for(let o=0;o<e.length;o+=32768)t+=String.fromCharCode(...e.subarray(o,o+32768));return btoa(t)}var Bn=class{entries=new Map;limit;constructor(t){this.limit=t;}get(t,n){let o=this.entries.get(t);if(o!==void 0)return this.entries.delete(t),this.entries.set(t,o),o;let r=n();if(this.entries.size>=this.limit){let a=this.entries.keys().next().value;a!==void 0&&this.entries.delete(a);}return this.entries.set(t,r),r}},oh=new Bn(8);function ah(e){return oh.get(e,()=>{let t=atob(e),n=new Uint8Array(t.length);for(let o=0;o<t.length;o++)n[o]=t.charCodeAt(o);return n})}function Gi(e){let{width:t,height:n,data:o}=e;if(!(Number.isInteger(t)&&Number.isInteger(n))||t<1||n<1||t>rr||n>rr||typeof o!="string")return null;try{let r=ah(o);return r.length===t*n*4?{width:t,height:n,data:r}:null}catch{return null}}function lu(e,t={}){let{width:n,height:o,data:r}=e;if(!(n>0&&o>0)||r.length<n*o*4)throw new Error("Art image pixels must be width \xD7 height \xD7 4 RGBA bytes");let a=Math.min(n,o),i=t.square?Math.floor((n-a)/2):0,s=t.square?Math.floor((o-a)/2):0,l=t.square?a:n,c=t.square?a:o,u=Math.min(Math.max(Math.round(t.maxSize??Bi.halftone),1),rr),m=Math.min(1,u/Math.max(l,c)),f=Math.max(1,Math.round(l*m)),d=Math.max(1,Math.round(c*m)),g=new Uint8Array(f*d*4);for(let h=0;h<d;h++){let p=Math.floor(h*c/d),b=Math.max(p+1,Math.floor((h+1)*c/d));for(let _=0;_<f;_++){let y=Math.floor(_*l/f),w=Math.max(y+1,Math.floor((_+1)*l/f)),C=0,S=0,$=0,R=0,M=0;for(let P=p;P<b;P++)for(let I=y;I<w;I++){let L=((P+s)*n+I+i)*4,k=r[L+3]/255;C+=r[L]*k,S+=r[L+1]*k,$+=r[L+2]*k,R+=k,M++;}let E=(h*f+_)*4;g[E]=R>0?Math.round(C/R):0,g[E+1]=R>0?Math.round(S/R):0,g[E+2]=R>0?Math.round($/R):0,g[E+3]=Math.round(R/M*255);}}return {width:f,height:d,data:rh(g)}}async function ih(e){if(typeof e!="string"&&!(e instanceof Blob))return e.complete||await new Promise(n=>{e.addEventListener("load",n,{once:true}),e.addEventListener("error",n,{once:true});}),e;let t=typeof e=="string"?e:URL.createObjectURL(e);try{return await new Promise((n,o)=>{let r=new Image;r.crossOrigin="anonymous",r.onload=()=>n(r),r.onerror=()=>o(new Error("Could not load the art image")),r.src=t;})}finally{typeof e!="string"&&setTimeout(()=>URL.revokeObjectURL(t),1e3);}}async function sh(e,t={}){if(typeof document>"u")throw new Error("loadQRArtImage needs a browser; pass decoded pixels to createQRArtImage instead");let n=t.mode??"halftone",o=t.maxSize??Bi[n],r=await ih(e),a=r.naturalWidth||r.width||o,i=r.naturalHeight||r.height||o,s=n==="halftone",l=Math.min(1,o*4/(s?Math.min(a,i):Math.max(a,i))),c=Math.max(1,Math.round(a*l)),u=Math.max(1,Math.round(i*l)),m=document.createElement("canvas");m.width=c,m.height=u;let f=m.getContext("2d",{willReadFrequently:true});if(!f)throw new Error("Could not get a canvas context");f.imageSmoothingQuality="high",f.drawImage(r,0,0,c,u);let d;try{d=f.getImageData(0,0,c,u);}catch{throw new Error("Could not read the art image (cross-origin images need CORS); upload it instead")}finally{m.remove();}return lu(d,{maxSize:o,square:s})}function Qi(e){return !!(e&&Yr.includes(e.mode)&&e.image&&Gi(e.image))}function Ro(e){let t=Oa[e.mode];return e.variant&&t.includes(e.variant)?e.variant:t[0]}function lh(e,t){if(e===1)return [];let n=Math.floor(e/7)+2,o=e===32?26:Math.ceil((e*4+4)/(n*2-2))*2,r=[6];for(let a=t-7;r.length<n;a-=o)r.splice(1,0,a);return r}function Mr(e,t){let n=lh(e,t),o=n.length-1,r=[];for(let[a,i]of n.entries())for(let[s,l]of n.entries())a===0&&s===0||a===0&&s===o||a===o&&s===0||r.push([i,l]);return r}var ch=0,We=1,Ve=2,Ct=3,nu=4,ru=new Map;function cu(e){let t=ru.get(e);if(t)return t;let n=e*4+17,o=new Uint8Array(n*n),r=(a,i,s,l,c)=>{for(let u=Math.max(0,i);u<Math.min(n,i+l);u++)for(let m=Math.max(0,a);m<Math.min(n,a+s);m++)o[u*n+m]=c;};r(6,0,1,n,nu),r(0,6,n,1,nu),r(0,8,9,1,Ct),r(8,0,1,9,Ct),r(n-8,8,8,1,Ct),r(8,n-8,1,8,Ct),e>=7&&(r(n-11,0,3,6,Ct),r(0,n-11,6,3,Ct));for(let[a,i]of Mr(e,n))r(a-2,i-2,5,5,Ve);return r(0,0,8,8,We),r(n-8,0,8,8,We),r(0,n-8,8,8,We),ru.set(e,o),o}function uh(e){let t=e*4+17,n=cu(e);return Array.from({length:t},(o,r)=>Array.from({length:t},(a,i)=>n[r*t+i]!==ch))}function mh(e){let t=e[8],n=t?.[0]?1:0,o=t?.[1]?1:0,r=(1-n)*2+o;return ["M","L","H","Q"][r]??"M"}function Gn(e,t){let n=le(e);return !n||n.a===0?t:[n.r/255,n.g/255,n.b/255]}var en=(e,t,n)=>[e[0]+(t[0]-e[0])*n,e[1]+(t[1]-e[1])*n,e[2]+(t[2]-e[2])*n];function Rt(e,t,n,o){let r=ee(e);if(o?r<=n:r>=n)return e;let a=ee(t);return Math.abs(r-a)<1e-6?t:en(e,t,Math.min(1,Math.max(0,(r-n)/(r-a))))}var uu=e=>Math.max(...e)-Math.min(...e),dh=(e,t)=>(e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]-t[2])**2,Oi=e=>e.toString(16).padStart(2,"0");function ke(e,t=1){let n=o=>Math.min(255,Math.round(Math.round(Math.min(Math.max(o,0),1)*255)/t)*t);return `#${Oi(n(e[0]))}${Oi(n(e[1]))}${Oi(n(e[2]))}`}function fh(e){let t=e<0?-1:1,n=Math.abs(e),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 t*r}var Ui=.3,ou=e=>1-Math.exp(-((e/2)**2)/(2*Ui**2)),hh=e=>fh(e/(2*Ui*Math.SQRT2))**2,ph=(e,t,n)=>{let o=Math.min(1,Math.max(0,(n-e)/(t-e)));return o*o*(3-2*o)};function Hi(e,t,n,o){let r=o==="cover"?Math.max(n/e,n/t):Math.min(n/e,n/t);return {scale:r,offsetX:(n-e*r)/2,offsetY:(n-t*r)/2}}function mu(e,t){let{width:n,height:o,data:r}=e,a=new Float32Array(n*o*3),i=t??new Float32Array(n*o);for(let s=0;s<n*o;s++)a[s*3]=r[s*4]/255,a[s*3+1]=r[s*4+1]/255,a[s*3+2]=r[s*4+2]/255,t||(i[s]=r[s*4+3]/255);return {width:n,height:o,rgb:a,alpha:i}}function gh(e){let t=mu(e),{rgb:n,alpha:o}=t,r=new Float64Array(256),a=0;for(let m=0;m<o.length;m++){if(o[m]<.5)continue;let f=ee([n[m*3],n[m*3+1],n[m*3+2]]);r[Math.min(255,Math.floor(f*256))]+=1,a++;}let i=m=>{let f=0;for(let d=0;d<256;d++)if(f+=r[d],f>=m*a)return d/255;return 1},s=a?i(.01):0,l=a?i(.99):1;l-s<.15&&(s=0,l=1);let c=Math.min(1.6,1/(l-s)),u=(s+l)/2;for(let m=0;m<o.length;m++){let f=[n[m*3],n[m*3+1],n[m*3+2]],d=ee(f),g=.5+(d-u)*c;for(let h=0;h<3;h++)n[m*3+h]=Math.min(1,Math.max(0,g+(f[h]-d)*1.12));}return t}function du(e,t,n,o,r=1){let{width:a,height:i,rgb:s,alpha:l}=e,c=Math.min(Math.max(t-.5,0),a-1),u=Math.min(Math.max(n-.5,0),i-1),m=Math.floor(c),f=Math.floor(u),d=Math.min(m+1,a-1),g=Math.min(f+1,i-1),h=c-m,p=u-f,b=0,_=0,y=0,w=0,C=($,R,M)=>{let E=R*a+$,P=l[E]*M;b+=s[E*3]*P,_+=s[E*3+1]*P,y+=s[E*3+2]*P,w+=P;};if(C(m,f,(1-h)*(1-p)),C(d,f,h*(1-p)),C(m,g,(1-h)*p),C(d,g,h*p),w<=0)return o;let S=w*r;return [o[0]+(b/w-o[0])*S,o[1]+(_/w-o[1])*S,o[2]+(y/w-o[2])*S]}var bh=new Bn(4),_h=new Bn(6),yh=new Bn(6);function zi(e,t){return _h.get(e.image.data,()=>tu(t))}function fu(e,t,n){return yh.get(e.image.data,()=>mu(t,n.alpha))}var Ce=e=>K(e,2),hu=e=>K(e,4),tn=class{groups=new Map;add(t,n){let o=this.groups.get(t);o?o.push(n):this.groups.set(t,[n]);}cellRun(t,n,o,r){this.add(t,`M${n} ${o}h${r}.04v1.04h-${r}.04z`);}circle(t,n,o,r){this.add(t,xh(n,o,r));}toElements(t){return [...this.groups].map(([n,o],r)=>A("path",{d:o.join(""),fill:n},`${t}-${r}`))}};function xh(e,t,n){let o=Ce(n*2),r=Ce(n);return `M${Ce(e-n)} ${Ce(t)}a${r} ${r} 0 1 0 ${o} 0a${r} ${r} 0 1 0 ${-o} 0z`}function Jt(e,t,n,o,r){let a=Math.min(r,n/2,o/2);if(a<=0)return `M${Ce(e)} ${Ce(t)}h${Ce(n)}v${Ce(o)}h${Ce(-n)}z`;let i=Ce(a);return `M${Ce(e+a)} ${Ce(t)}h${Ce(n-2*a)}a${i} ${i} 0 0 1 ${i} ${i}v${Ce(o-2*a)}a${i} ${i} 0 0 1 ${-i} ${i}h${Ce(-(n-2*a))}a${i} ${i} 0 0 1 ${-i} ${-i}v${Ce(-(o-2*a))}a${i} ${i} 0 0 1 ${i} ${-i}z`}function pu(e,t,n){let o="";for(let[r,a]of e){let i=(r-2+t)*n,s=(a-2+t)*n;o+=Jt(i,s,5*n,5*n,n*.35),o+=Jt(i+n,s+n,3*n,3*n,n*.15),o+=Jt(i+2*n,s+2*n,n,n,n*.12);}return o}var $h={blend:1,badge:1,color:.9,mono:.7},Co=.35;function Sh(e,t){let n=Gn(e,[0,0,0]),o=Gn(t,[1,1,1]),r=ee(o)-ee(n);return r>=Co?null:r<=-Co?"inverted":"low-contrast"}function gu(e,t,n){let o=Math.min(Math.max(e.intensity??su,0),$h[Ro(e)]);return ee(n)-ee(t)>=Co?o:0}function wh(e){let{art:t,modules:n,version:o}=e,r=t.image&&Gi(t.image);if(!(r&&Yr.includes(t.mode)))return null;let a=n.length;if(a!==o*4+17)return null;let i=Gn(e.fgColor,[0,0,0]),s=Gn(e.bgColor,[1,1,1]),l=gu(t,i,s);return l<=0?null:{art:t,image:r,modules:n,size:a,version:o,kinds:cu(o),margin:e.margin,pixelSize:e.pixelSize,t:l,fg:i,bg:s,variant:Ro(t),body:e.body}}function Wi(e){let t=wh(e);if(!t)return null;let n;return t.art.mode==="halftone"?n=t.variant==="mono"?Ph(t):Ah(t):n=t.variant==="badge"?Dh(t):vh(t),A("g",{"data-qrdx-art":t.art.mode,"data-qrdx-art-variant":t.variant,children:n})}function Ch(e,t){return {margin:.42-.17*e+(t===3?.04:0),darkCap:.4+.3*e}}var bu=8.5,au=new Map;function qi(e){let t=e*4+17,n=au.get(e);if(!n){let a=t*2,i=new Uint8Array(a*a),s=bu*2;for(let l=0;l<a;l++)for(let c=0;c<a;c++){let u=c<s||c>=a-s,m=l<s||l>=a-s;u&&m&&!(c>=a-s&&l>=a-s)&&(i[l*a+c]=1);}for(let[l,c]of Mr(e,t))for(let u=(c-2)*2-1;u<(c+3)*2+1;u++)for(let m=(l-2)*2-1;m<(l+3)*2+1;m++)m>=0&&u>=0&&m<a&&u<a&&(i[u*a+m]=1);au.set(e,i),n=i;}let o=n,r=t*2;return (a,i)=>{let s=Math.floor(a*2),l=Math.floor(i*2);return s>=0&&l>=0&&s<r&&l<r&&o[l*r+s]===1}}function _u(e,t,n=false){let{image:o,size:r,kinds:a,fg:i,bg:s}=e,l=bh.get(e.art.image.data,()=>gh(o)),c=Hi(o.width,o.height,r,"cover"),u=r*t,m=new Float32Array(u*u*3).fill(Number.NaN),d=1/(t*c.scale)>1.3?2:1,g=ee(s)-.1*(ee(s)-ee(i)),h=qi(e.version);for(let p=0;p<r;p++)for(let b=0;b<r;b++){let _=a[p*r+b],y=_===We||_===Ve;if(!(y&&!n))for(let w=0;w<t;w++)for(let C=0;C<t;C++){let S=0,$=0,R=0;for(let F=0;F<d;F++)for(let T=0;T<d;T++){let H=b+(C+(T+.5)/d)/t,G=p+(w+(F+.5)/d)/t,z=du(l,(H-c.offsetX)/c.scale,(G-c.offsetY)/c.scale,s);S+=z[0],$+=z[1],R+=z[2];}let M=d*d,E=[S/M,$/M,R/M],P=b+(C+.5)/t,I=p+(w+.5)/t,L=Math.min(P,I,r-P,r-I);L<1.5&&(E=en(E,s,.35*(1-L/1.5))),n&&(y||h(P,I))&&(E=Rt(E,s,g,false));let k=((p*t+w)*u+b*t+C)*3;m[k]=E[0],m[k+1]=E[1],m[k+2]=E[2];}}return {n:t,count:u,rgb:m}}function Rh(e,t,n){let{size:o,kinds:r,modules:a,fg:i,bg:s,t:l}=e,{n:c,count:u,rgb:m}=t,f=ee(i),d=ee(s),g=d-f,h=Ch(l,c),p=R=>.2126*m[R]+.7152*m[R+1]+.0722*m[R+2],b=new Float32Array(o*o),_=new Float32Array(o*o);for(let R=0;R<o;R++)for(let M=0;M<o;M++){let E=r[R*o+M];if(E===We){b[R*o+M]=d;continue}if(E===Ve){b[R*o+M]=a[R]?.[M]?f:d;continue}let P=0,I=0,L=0;for(let k=0;k<c;k++)for(let F=0;F<c;F++){let T=p(((R*c+k)*u+M*c+F)*3);P+=T,n.under[k*c+F]||(I+=T,L++);}b[R*o+M]=P/(c*c),_[R*o+M]=L?I/L:P/(c*c);}let y=o+1,w=new Float64Array(y*y);for(let R=0;R<o;R++)for(let M=0;M<o;M++)w[(R+1)*y+M+1]=b[R*o+M]+w[R*y+M+1]+w[(R+1)*y+M]-w[R*y+M];let C=2,S=(R,M)=>{let E=Math.max(0,R-C),P=Math.max(0,M-C),I=Math.min(o,R+C+1),L=Math.min(o,M+C+1);return (w[L*y+I]-w[P*y+I]-w[L*y+E]+w[P*y+E])/((I-E)*(L-P))},$=n.weight;for(let R=0;R<o;R++)for(let M=0;M<o;M++){let E=r[R*o+M];if(E===We||E===Ve)continue;let P=E===Ct,I=(h.margin+(P?.08:0))*g,L=(h.darkCap-(P?.12:0))*g,k=($*((n.light-n.dark)/2)-I)/(1-$),F=S(M,R),T=_[R*o+M],H=!!a[R]?.[M],G=0,z=s;if(H){let O=Math.min(F+k,f+L);T>O&&(G=(T-O)/Math.max(T-f,1e-6),z=i);}else {let O=Math.max(F-k,d-L);T<O&&(G=(O-T)/Math.max(d-T,1e-6));}if(!(G<=0)){G=Math.min(1,G);for(let O=0;O<c;O++)for(let Y=0;Y<c;Y++){let be=((R*c+O)*u+M*c+Y)*3;for(let de=0;de<3;de++)m[be+de]+=(z[de]-m[be+de])*G;}}}}function yu(e,t,n,o){let{count:r}=t,a=new tn;for(let l=0;l<r;l++){let c=0,u=n(l*r);for(let m=1;m<=r;m++){let f=m<r?n(l*r+m):null;(m===r||f!==u)&&(u&&a.cellRun(u,c,l,m-c),c=m,u=f);}}let i=e.pixelSize/t.n,s=Ce(e.margin*e.pixelSize);return A("g",{transform:`translate(${s} ${s}) scale(${hu(i)})`,children:a.toElements(o)},o)}function Vi(e,t){let n=Mr(e.version,e.size);return n.length===0?[]:[A("path",{d:pu(n,e.margin,e.pixelSize),fill:t,fillRule:"evenodd"},"art-alignment")]}function xu(e){let{image:t,size:n}=e;return Math.floor(Math.min(t.width,t.height)/n)>=4&&n<=45?4:3}var Mh=e=>2*Ui*Math.sqrt(-2*Math.log(1-Math.min(e,.95)));function Eh(e,t,n){let o=t+1,r=new Float64Array(o*o);for(let i=0;i<t;i++)for(let s=0;s<t;s++)r[(i+1)*o+s+1]=e[i*t+s]+r[i*o+s+1]+r[(i+1)*o+s]-r[i*o+s];let a=new Float32Array(t*t);for(let i=0;i<t;i++)for(let s=0;s<t;s++){let l=Math.max(0,s-n),c=Math.max(0,i-n),u=Math.min(t,s+n+1),m=Math.min(t,i+n+1);a[i*t+s]=(r[m*o+u]-r[c*o+u]-r[m*o+l]+r[c*o+l])/((u-l)*(m-c));}return a}function $u(e,t,n,o){let{size:r,kinds:a,modules:i,fg:s,bg:l}=e,c=ee(s),u=ee(l),m=u-c,f=Eh(t,r,2),d=new Float32Array(r*r),g=new Float32Array(r*r).fill(Number.NaN);for(let h=0;h<r;h++)for(let p=0;p<r;p++){let b=h*r+p,_=a[b];if(_===We||_===Ve)continue;let y=_===Ct,w=o.base+(y?.08:0),C=(o.margin+(y?.03:0))*m,S=(o.cap-(y?.04:0))*m,$=ou(w),R=ou(y?Math.max(o.max,.94):o.max),M=$*((o.dark+o.light)/2)+(1-$)*f[b],E=n[b],P=!!i[h]?.[p],I=P?o.dark:o.light,L=P?Math.min(M-C,c+S):Math.max(M+C,u-S),F=(P?E<=L:E>=L)?0:(E-L)/(E-I);F>R&&(F=R,g[b]=Math.min(u,Math.max(c,(L-R*I)/(1-R))));let T=P?E<=L-.06:E>=L+.06;o.skip&&T&&!y||(F=Math.max(F,$)),d[b]=F>0?Mh(F):0;}return {diameter:d,surround:g}}function Ah(e){let{size:t,kinds:n,modules:o,fg:r,bg:a,t:i,margin:s,pixelSize:l}=e,c=xu(e),u=_u(e,c,true),m=ee(r),f=ee(a),d=m+.1*(f-m),g=f-.05*(f-m),{count:h,rgb:p}=u,b=(S,$,R,M)=>(($*c+M)*h+S*c+R)*3,_=new Float32Array(t*t);for(let S=0;S<t;S++)for(let $=0;$<t;$++){let R=n[S*t+$];if(R===We||R===Ve){_[S*t+$]=R===Ve&&o[S]?.[$]?m:f;continue}let M=0;for(let E=0;E<c;E++)for(let P=0;P<c;P++){let I=b($,S,P,E);M+=.2126*p[I]+.7152*p[I+1]+.0722*p[I+2];}_[S*t+$]=M/(c*c);}let y=$u(e,_,_,{base:.6-.28*i,max:.86,dark:d,light:g,margin:.2-.1*i,cap:.4+.14*i,skip:false});for(let S=0;S<t;S++)for(let $=0;$<t;$++){let R=y.surround[S*t+$];if(Number.isNaN(R))continue;let M=_[S*t+$],P=R<M?r:a,I=Math.min(1,Math.abs(M-R)/Math.max(Math.abs(M-ee(P)),1e-6));for(let L=0;L<c;L++)for(let k=0;k<c;k++){let F=b($,S,k,L);for(let T=0;T<3;T++)p[F+T]+=(P[T]-p[F+T])*I;}}let w=[yu(e,u,S=>{let $=S*3;return Number.isNaN(p[$])?null:ke([p[$],p[$+1],p[$+2]],8)},"art-photo")],C=new tn;for(let S=0;S<t;S++)for(let $=0;$<t;$++){let R=y.diameter[S*t+$];if(!(R>0))continue;let M=0,E=0,P=0;for(let k=0;k<c;k++)for(let F=0;F<c;F++){let T=b($,S,F,k);M+=p[T],E+=p[T+1],P+=p[T+2];}let I=[M/(c*c),E/(c*c),P/(c*c)],L=o[S]?.[$]?Rt(I,r,d,true):Rt(I,a,g,false);C.circle(ke(L,10),($+s+.5)*l,(S+s+.5)*l,R/2*l);}return w.push(...C.toElements("art-dot"),...Vi(e,ke(r))),w}function Ph(e){let{size:t,kinds:n,modules:o,fg:r,bg:a}=e,i=xu(e),s=_u(e,i),l=ee(r),c=ee(a),u=i%2===1?1:2,m=(i-u)/2,f=M=>M>=m&&M<m+u,d=[];for(let M=0;M<i;M++)for(let E=0;E<i;E++)d.push(f(E)&&f(M));Rh(e,s,{weight:hh(u/i),dark:l,light:c,under:d});let{count:g,rgb:h}=s,p=new Float32Array(g*g),b=new Int8Array(g*g).fill(-1);for(let M=0;M<g*g;M++){let E=M*3;if(Number.isNaN(h[E])){p[M]=Number.NaN;continue}let P=(.2126*h[E]+.7152*h[E+1]+.0722*h[E+2]-l)/(c-l);p[M]=.5+(ph(0,1,P)-.5)*1.15;}for(let M=0;M<t;M++)for(let E=0;E<t;E++){let P=n[M*t+E];if(!(P===We||P===Ve))for(let I=m;I<m+u;I++)for(let L=m;L<m+u;L++)b[(M*i+I)*g+E*i+L]=o[M]?.[E]?0:1;}let _=qi(e.version);for(let M=0;M<g;M++)for(let E=0;E<g;E++){let P=M*g+E;b[P]<0&&_((E+.5)/i,(M+.5)/i)&&(b[P]=1);}let y=new Uint8Array(g*g),w=.3,C=0,S=0,$=(M,E,P)=>{if(M<0||M>=g||E>=g)return;let I=E*g+M;if(!Number.isNaN(p[I])){let L=Math.floor(M/i)===Math.floor(C/i)&&Math.floor(E/i)===Math.floor(S/i);p[I]+=L?P:P*w;}};for(let M=0;M<g;M++){let E=M%2===0?1:-1;for(let P=0;P<g;P++){let I=E===1?P:g-1-P,L=M*g+I,k=p[L];if(Number.isNaN(k))continue;let F=b[L]>=0?b[L]:k>=.5?1:0;y[L]=F===0?1:0;let T=Math.min(.75,Math.max(-0.75,k-F));C=I,S=M,$(I+E,M,T*7/16),$(I-E,M+1,T*3/16),$(I,M+1,T*5/16),$(I+E,M+1,T/16);}}let R=ke(r);return [yu(e,s,M=>y[M]?R:null,"art-halftone"),...Vi(e,R)]}function iu(e,t){let n=null,o=0;for(let r of e.palette){if(t&&dh(r.color,t)<.02)continue;let a=r.area*(.35+uu(r.color))*(ee(r.color)>.86?.05:1);a>o&&(o=a,n=r.color);}return n}function Su(e,t,n,o,r){let a;if(e.photographic){let i=new tn,{width:s,height:l,rgb:c,alpha:u}=t;for(let m=0;m<l;m++){let f=0,d=null;for(let g=0;g<=s;g++){let h=m*s+g,p=g<s&&u[h]>=.5?ke(o([c[h*3],c[h*3+1],c[h*3+2]]),6):null;(g===s||p!==d)&&(d&&i.cellRun(d,f,m,g-f),f=g,d=p);}}a=i.toElements(`${r}-px`);}else a=e.layers.map((i,s)=>A("path",{d:i.d,fill:ke(o(i.color)),fillRule:"evenodd"},`${r}-${s}`));return A("g",{transform:`translate(${Ce(n.x)} ${Ce(n.y)}) scale(${hu(n.scale)})`,children:a},r)}function vh(e){let{art:t,image:n,size:o,kinds:r,modules:a,fg:i,bg:s,t:l,margin:c,pixelSize:u}=e,m=zi(t,n),f=fu(t,n,m),d=Hi(m.width,m.height,o,"contain"),g=Math.min(1,.3+1.4*l),h=T=>en(s,T,g),p=ke(s),b=ke(i),_=[Su(m,f,{x:(c+d.offsetX)*u,y:(c+d.offsetY)*u,scale:d.scale*u},h,"art-logo")],y=bu,w=(T,H)=>Jt((T+c)*u,(H+c)*u,(y+.4)*u,(y+.4)*u,1.2*u),C=Mr(e.version,o).map(([T,H])=>Jt((T-2.5+c)*u,(H-2.5+c)*u,6*u,6*u,u*.8)).join("");_.push(A("path",{d:w(-0.4,-0.4)+w(o-y,-0.4)+w(-0.4,o-y)+C,fill:p},"art-plates"));let S=qi(e.version),$=ee(s),R=ee(i),M=new Float32Array(o*o),E=new Float32Array(o*o),P=new Array(o*o);for(let T=0;T<o;T++)for(let H=0;H<o;H++){let G=T*o+H,z=r[G];if(z===We||z===Ve){M[G]=z===Ve&&a[T]?.[H]?R:$;continue}let O=1,Y=0,be=0,de=0,N=0;for(let Q=0;Q<4;Q++)for(let re=0;re<4;re++){let ie=H+(re+.5)/4,Tt=T+(Q+.5)/4,oe=S(ie,Tt)?s:du(f,(ie-d.offsetX)/d.scale,(Tt-d.offsetY)/d.scale,s,g),ot=ee(oe);O=Math.min(O,ot),Y+=ot,be+=oe[0],de+=oe[1],N+=oe[2];}M[G]=Y/16,E[G]=O,P[G]=[be/16,de/16,N/16];}let I=R+.08*($-R),L=$-.04*($-R),k=$u(e,M,M,{base:.74-.26*l,max:.9,dark:I,light:L,margin:.23-.1*l,cap:.4+.1*l,skip:l>=.7}),F=new tn;for(let T=0;T<o;T++)for(let H=0;H<o;H++){let G=T*o+H,z=k.diameter[G],O=!!a[T]?.[H];if(!(z>0)||!O&&E[G]>=$-.02)continue;let Y=O?Rt(P[G],i,I,true):Rt(P[G],s,L,false);F.circle(ke(Y,8),(H+c+.5)*u,(T+c+.5)*u,z/2*u);}return _.push(...F.toElements("art-dot")),_.push(...Vi(e,b)),_}var Ih={L:.5,M:.72,Q:.88,H:1},wu=.32,Cu=.55,Lh=.6,Th=2;function Ru(e,t,n){let o=t>=1?e:e*t,r=t>=1?e/t:e,a=Math.max(.7,e*.09),i=o+2*a,s=r+2*a;return {logoW:o,logoH:r,plateW:i,plateH:s,radius:Math.min(i,s)*.26,cx:n/2,cy:n/2}}var Mu=e=>({cx:e.cx,cy:e.cy,w:e.plateW,h:e.plateH,r:e.radius});function Eu(e,t,n){return Pu(t+.5,n+.5,e)<Cu}function kh(e,t){let n=Mu(e),o=Cu+1,r=Math.max(0,Math.floor(e.cx-e.plateW/2-o)),a=Math.min(t-1,Math.ceil(e.cx+e.plateW/2+o)),i=Math.max(0,Math.floor(e.cy-e.plateH/2-o)),s=Math.min(t-1,Math.ceil(e.cy+e.plateH/2+o)),l=[];for(let c=i;c<=s;c++)for(let u=r;u<=a;u++)Eu(n,u,c)&&l.push(c*t+u);return l}var Fh=e=>Math.floor(e.correctable*Lh);function Di(e,t,n){let o=Ru(e,t,n.size),r=Fh(n);return Sr(n,kh(o,n.size)).every(a=>a<=r)}function Au(e,t,n){if(Di(n,t,e))return n;let o=0,r=n;if(!Di(o,t,e))return -1;for(;r-o>1/64;){let a=(o+r)/2;Di(a,t,e)?o=a:r=a;}return o}var wo=new Map;function Nh(e,t){let n=`${e.version}${e.level}:${t.toFixed(3)}`,o=wo.get(n);return o===void 0&&(o=Au(e,t,wu*e.size),wo.size>=64&&wo.clear(),wo.set(n,o)),o}function Oh(e,t){let{size:n,t:o,modules:r,version:a}=e,i=mh(r),s=(.18+.15*o)*Ih[i],l=t.width/t.height,c=Math.min(wu,s)*n,u=$r(a,i),m=Math.max(0,Nh(u,l));if(m<Th)return {wantedBox:c,maxBox:m,box:0,plate:null};let f=Au(u,l,Math.min(c,m));return f<0?{wantedBox:c,maxBox:m,box:0,plate:null}:{wantedBox:c,maxBox:m,box:f,plate:Ru(f,l,n)}}function Pu(e,t,n){let o=Math.abs(e-n.cx)-(n.w/2-n.r),r=Math.abs(t-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 vu(e,t){let{fg:n,bg:o,t:r}=e,a=ee(n),i=ee(o),s=iu(t),l=Math.min(1,r/.6),c=s?Rt(s,n,a+.3*(i-a),true):n,u=en(n,c,l),m=s?iu(t,s):null,f=a+.42*(i-a),d=m&&ee(m)<=f+.22?en(n,Rt(m,n,f,true),l):u;return {body:u,inner:d}}function Dh(e){let{art:t,image:n,size:o,kinds:r,modules:a,bg:i,margin:s,pixelSize:l,version:c}=e,u=zi(t,n),m=Oh(e,u).plate,{body:f}=vu(e,u),d=ke(f),g=m&&Mu(m),h=a.map(P=>[...P]);for(let P=0;P<o;P++)for(let I=0;I<o;I++){let L=r[P*o+I];(L===Ve||g&&L!==We&&Eu(g,I,P))&&(h[P][I]=false);}let p=[],b=e.body?.(h);if(b)p.push(A("g",{fill:d,children:b},"art-body"));else {let P=new tn;for(let I=0;I<o;I++)for(let L=0;L<o;L++)h[I]?.[L]&&r[I*o+L]!==We&&P.circle(d,(L+s+.5)*l,(I+s+.5)*l,.45*l);p.push(...P.toElements("art-body"));}let _=Mr(c,o).filter(([P,I])=>!g||Pu(P+.5,I+.5,g)>3.2);if(_.length>0&&p.push(A("path",{d:pu(_,s,l),fill:d,fillRule:"evenodd"},"art-alignment")),!m)return p;let y=fu(t,n,u),w=(m.cx-m.plateW/2+s)*l,C=(m.cy-m.plateH/2+s)*l,S=m.plateW*l,$=m.plateH*l,R=m.radius*l,M=.1*l,E=Jt(w,C,S,$,R);return p.push(A("path",{d:E,fill:ke(i)},"art-plate"),A("path",{d:E+Jt(w+M,C+M,S-2*M,$-2*M,R-M),fill:ke(en(i,f,.16)),fillRule:"evenodd"},"art-plate-ring"),Su(u,y,{x:(m.cx-m.logoW/2+s)*l,y:(m.cy-m.logoH/2+s)*l,scale:m.logoW/u.width*l},P=>P,"art-logo")),p}function ji(e){let{art:t}=e;if(t.mode!=="logo"||t.matchEyes===false)return null;let n=t.image&&Gi(t.image);if(!n)return null;let o=Gn(e.fgColor,[0,0,0]),r=Gn(e.bgColor,[1,1,1]),a=gu(t,o,r);if(a<=0)return null;let i=zi(t,n);if(i.palette.length===0)return null;if(Ro(t)==="badge"){let{body:g,inner:h}=vu({fg:o,bg:r,t:a},i),p={outer:ke(g),inner:ke(h)};return {topLeft:p,topRight:p,bottomLeft:p}}let s=ee(o),l=ee(r),c=Math.min(1,a/.6),u=e.version*4+17,m=Hi(i.width,i.height,u,"contain"),f=.45*Math.max(i.width,i.height),d=(g,h)=>{let p=(g-m.offsetX)/m.scale,b=(h-m.offsetY)/m.scale,_=null,y=0;for(let C of i.palette){if(ee(C.color)>.86)continue;let S=(C.cx-p)**2+(C.cy-b)**2,$=C.area*(.35+uu(C.color))*Math.exp(-S/(2*f**2));$>y&&(y=$,_=C.color);}if(!_)return {};let w=Rt(_,o,s+.42*(l-s),true);return {inner:ke(en(o,w,c))}};return {topLeft:d(3.5,3.5),topRight:d(u-3.5,3.5),bottomLeft:d(3.5,u-3.5)}}var Bh=["horizontal-line","liquid","liquid-horizontal","liquid-vertical","classy","classy-rounded","leaf","plus","hexagon","star","heart","random-dots","mosaic","octagon"];function Iu(e){return Bh.includes(e)}var Lu={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 Mo(e,t){if(e===void 0||!Number.isFinite(e))return 1;let n=t?Lu[t]??1:Zr;return Math.min(Qa,Math.max(Zr,n,e))}function Gh(e,t,n){return e<7&&t<7||e>=n-7&&t<7||e<7&&t>=n-7}function Qh(e,t){if(e===1)return [];let n=Math.floor(e/7)+2,o=e===32?26:Math.ceil((e*4+4)/(n*2-2))*2,r=[6];for(let a=t-7;r.length<n;a-=o)r.splice(1,0,a);return r}function Xi(e){let t=(e-17)/4,n=Number.isInteger(t)?Qh(t,e):[],o=n.length-1,r=[];for(let[a,i]of n.entries())for(let[s,l]of n.entries())a===0&&s===0||a===0&&s===o||a===o&&s===0||r.push([i,l]);return (a,i)=>r.some(([s,l])=>Math.abs(a-s)<=2&&Math.abs(i-l)<=2)}var Uh={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:e=>e===0||e===2?1:0,fillets:false},"classy-rounded":{horizontal:true,vertical:true,thickness:1,radius:e=>e===0||e===2?1:.4,fillets:false}};function Hh(e,t,n,o,r,a){switch(e){case "horizontal-line":{let i=o*.43;return D(t-o/2,n-i,o,2*i)}case "leaf":{let i=o*.5;return D(t-i,n-i,2*i,2*i,[o*.4,o*.05,o*.4,o*.05])}case "plus":{let i=o*.22,s=o*.5;return Z([[t-i,n-s],[t+i,n-s],[t+i,n-i],[t+s,n-i],[t+s,n+i],[t+i,n+i],[t+i,n+s],[t-i,n+s],[t-i,n+i],[t-s,n+i],[t-s,n-i],[t-i,n-i]])}case "hexagon":return Z(kn(t,n,o*.54,6));case "star":return Z(Fn(t,n+o*.04,o*.62,o*.34));case "heart":return On(t,n+o*.02,o*1.08);case "random-dots":return J(t,n,o*(.38+.15*co(r,a)));case "mosaic":{let i=o*(.8+.14*co(r,a,1))/2,s=[[t-i,n-i],[t+i,n-i],[t+i,n+i],[t-i,n+i]];return Z(lc(s,t,n,(co(r,a,2)-.5)*16))}case "octagon":return Z(kn(t,n,o*.48/Math.cos(Math.PI/8),8,22.5));default:return J(t,n,o*.45)}}function Tu(e,t){let{margin:n,pixelSize:o,pattern:r}=t,a=Mo(t.scale,r),i=e.length,s=t.plain?()=>false:Xi(i),l=(h,p)=>!t.plain&&Gh(h,p,i),c=(h,p)=>h>=0&&p>=0&&h<i&&p<i&&!!e[p]?.[h]&&!l(h,p),u=h=>(h+.5+n)*o,m=[],f=[],d=Uh[r];for(let h=0;h<i;h++)for(let p=0;p<i;p++){if(!c(p,h))continue;let b=u(p),_=u(h);if(s(p,h)){m.push(v`M${b-o/2} ${_-o/2}h${o}v${o}h${-o}z`);continue}if(!d){f.push(Hh(r,b,_,o*a,p,h));continue}let y=o*d.thickness*a/2,w=d.horizontal&&c(p+1,h),C=d.horizontal&&c(p-1,h),S=d.vertical&&c(p,h-1),$=d.vertical&&c(p,h+1),M=[!(S||C),!(S||w),!($||w),!($||C)].map((E,P)=>E?y*d.radius(P):0);f.push(D(b-y,_-y,2*y,2*y,M)),2*y<o&&(w&&f.push(D(b,_-y,o,2*y)),$&&f.push(D(b-y,_,2*y,o)));}if(d?.fillets&&a===1){let h=o*.3;for(let p=0;p<i;p++)for(let b=0;b<i;b++){if(c(b,p)||l(b,p))continue;let _=u(b)-o/2,y=u(p)-o/2,w=_+o,C=y+o;c(b-1,p)&&c(b,p-1)&&c(b-1,p-1)&&f.push(v`M${_} ${y}h${h}A${h} ${h} 0 0 0 ${_} ${y+h}Z`),c(b+1,p)&&c(b,p-1)&&c(b+1,p-1)&&f.push(v`M${w} ${y}v${h}A${h} ${h} 0 0 0 ${w-h} ${y}Z`),c(b+1,p)&&c(b,p+1)&&c(b+1,p+1)&&f.push(v`M${w} ${C}h${-h}A${h} ${h} 0 0 0 ${w} ${C-h}Z`),c(b-1,p)&&c(b,p+1)&&c(b-1,p+1)&&f.push(v`M${_} ${C}v${-h}A${h} ${h} 0 0 0 ${_+h} ${C}Z`);}}let g=[];return f.length>0&&g.push(A("path",{d:f.join("")},"modules")),m.length>0&&g.push(A("path",{d:m.join("")},"alignment")),g}function zh(e){return e==="top-left"?0:e==="top-right"?1:3}function Eo(e,t,n,o="circle",r="top-left"){let a=n*2,i=n,s=a/3;switch(o){case "leaf":case "leaf-reverse":case "drop":case "drop-reverse":{let l=zh(r),c=(l+2)%4,u=1.3*s,m=.7*s,f=g=>{switch(o){case "leaf":return g===l||g===c;case "leaf-reverse":return !(g===l||g===c);case "drop":return g===l;default:return g===c}},d=[0,1,2,3].map(g=>f(g)?m:u);return A("path",{d:D(e-n,t-n,a,a,d)})}case "extra-rounded":return A("path",{d:D(e-n,t-n,a,a,1.15*s)});case "plus":{let l=1.15*s,c=n;return A("path",{d:Z([[e-l,t-c],[e+l,t-c],[e+l,t-l],[e+c,t-l],[e+c,t+l],[e+l,t+l],[e+l,t+c],[e-l,t+c],[e-l,t+l],[e-c,t+l],[e-c,t-l],[e-l,t-l]])})}case "cross-rounded":{let l=1.15*s,c=.5*s;return A("path",{d:D(e-n,t-l,a,2*l,c)+D(e-l,t-n,2*l,a,c)})}case "hexagon":return A("path",{d:Z(kn(e,t,1.72*s,6))});case "octagon":return A("path",{d:Z(kn(e,t,n/Math.cos(Math.PI/8),8,22.5))});case "flower":{let l=.6*s,c=.9*s;return A("path",{d:J(e-l,t-l,c)+J(e+l,t-l,c)+J(e+l,t+l,c)+J(e-l,t+l,c)+J(e,t,1.2*s)})}case "heart":return A("path",{d:On(e,t+.12*s,3.5*s)});case "squircle":return A("path",{d:Z(Nn(e,t,n,n,4,64))});case "dots":{let l=[];for(let c of [-1,0,1])for(let u of [-1,0,1])l.push(J(e+u*s*.82,t+c*s*.82,.58*s));return A("path",{d:l.join("")})}case "cushion":return A("path",{d:pr(e-n,t-n,a,.6*s,.15*s)});case "square":return A("rect",{height:x(a),transform:v`rotate(0,${e},${t})`,width:x(a),x:x(e-i),y:x(t-i)});case "rounded":return A("rect",{height:x(a),rx:x(n*.5),ry:x(n*.5),transform:v`rotate(0,${e},${t})`,width:x(a),x:x(e-i),y:x(t-i)});case "diamond":return A("path",{d:v`M ${e-i*.714286} ${t-i*.714286}v ${a*.714286}h ${a*.714286}v -${a*.714286}z`,transform:v`rotate(45,${e},${t})`});case "message":{let l=a/30,c=f=>(f-40)*l+e,u=f=>(f-40)*l+t,m=v`M ${c(25)} ${u(35.714285714285715)}v ${8.571428571428571*l}a ${10.714285714285714*l} ${10.714285714285714*l}, 0, 0, 0, ${10.714285714285714*l} ${10.714285714285714*l}h ${19.285714285714285*l}v -${19.285714285714285*l}a ${10.714285714285714*l} ${10.714285714285714*l}, 0, 0, 0, -${10.714285714285714*l} -${10.714285714285714*l}h -${8.571428571428571*l}a ${10.714285714285714*l} ${10.714285714285714*l}, 0, 0, 0, -${10.714285714285714*l} ${10.714285714285714*l}`;return A("path",{clipRule:"evenodd",d:m,transform:v`rotate(0,${e},${t})`})}case "message-reverse":{let l=a/30,c=f=>(f-40)*l+e,u=f=>(f-40)*l+t,m=v`M ${c(25)} ${u(35.714285714285715)}v ${8.571428571428571*l}a ${10.714285714285714*l} ${10.714285714285714*l}, 0, 0, 0, ${10.714285714285714*l} ${10.714285714285714*l}h ${19.285714285714285*l}v -${19.285714285714285*l}a ${10.714285714285714*l} ${10.714285714285714*l}, 0, 0, 0, -${10.714285714285714*l} -${10.714285714285714*l}h -${8.571428571428571*l}a ${10.714285714285714*l} ${10.714285714285714*l}, 0, 0, 0, -${10.714285714285714*l} ${10.714285714285714*l}`;return A("path",{clipRule:"evenodd",d:m,transform:v`rotate(-180,${e},${t})`})}case "diya":{let l=a/30,c=f=>(f-40)*l+e,u=f=>(f-40)*l+t,m=v`M ${c(25)} ${u(35.714285714285715)}v ${8.571428571428571*l}a ${10.714285714285714*l} ${10.714285714285714*l}, 0, 0, 0, ${10.714285714285714*l} ${10.714285714285714*l}h ${19.285714285714285*l}v -${19.285714285714285*l}a ${10.714285714285714*l} ${10.714285714285714*l}, 0, 0, 0, -${10.714285714285714*l} -${10.714285714285714*l}h -${8.571428571428571*l}H ${c(25)}z`;return A("path",{clipRule:"evenodd",d:m,transform:v`rotate(0,${e},${t})`})}case "diya-reverse":{let l=a/30,c=f=>(f-40)*l+e,u=f=>(f-40)*l+t,m=v`M ${c(25)} ${u(35.714285714285715)}v ${19.285714285714285*l}h ${19.285714285714285*l}a ${10.714285714285714*l} ${10.714285714285714*l}, 0, 0, 0, ${10.714285714285714*l} -${10.714285714285714*l}v -${19.285714285714285*l}h -${19.285714285714285*l}a ${10.714285714285714*l} ${10.714285714285714*l}, 0, 0, 0, -${10.714285714285714*l} ${10.714285714285714*l}z`;return A("path",{clipRule:"evenodd",d:m,transform:v`rotate(0,${e},${t})`})}case "rounded-triangle":{let l=a/21,c=f=>(f-40)*l+e,u=f=>(f-40)*l+t,m=v`M ${c(33.57142857142857)} ${u(29.285714285714285)}h ${12.857142857142856*l}c ${4.285714285714286*l} 0 ${4.285714285714286*l} ${4.285714285714286*l} ${4.285714285714286*l} ${4.285714285714286*l}v ${12.857142857142856*l}c 0 ${4.285714285714286*l} -${4.285714285714286*l} ${4.285714285714286*l} -${4.285714285714286*l} ${4.285714285714286*l}h -${12.857142857142856*l}c -${4.285714285714286*l} 0 -${4.285714285714286*l} -${4.285714285714286*l} -${4.285714285714286*l} -${4.285714285714286*l}v -${12.857142857142856*l}c 0 -${4.285714285714286*l} ${4.285714285714286*l} -${4.285714285714286*l} ${4.285714285714286*l} -${4.285714285714286*l}z`;return A("path",{d:m,transform:v`rotate(45,${e},${t})`})}case "star":{let l=a/27,c=f=>(f-40)*l+e,u=f=>(f-40)*l+t,m=v`M ${c(38.84615384615385)},${u(26.546153846153846)}c${.6692307692307691*l},-${1.0153846153846153*l},${2.215384615384615*l},-${1.0153846153846153*l},${2.884615384615384*l},0l${4.038461538461538*l},${6.069230769230768*l}c${.23076923076923075*l},${.3461538461538461*l},${.6*l},${.6*l},${1.0153846153846153*l},${.7153846153846153*l}l${7.223076923076922*l},${1.823076923076923*l}c${1.2*l},${.3*l},${1.6846153846153844*l},${1.7076923076923076*l},${.8999999999999999*l},${2.6538461538461533*l}l-${4.73076923076923*l},${5.584615384615384*l}c-${.2769230769230769*l},${.3230769230769231*l},-${.41538461538461535*l},${.7384615384615384*l},-${.3923076923076923*l},${1.1307692307692307*l}l${.4384615384615384*l},${7.199999999999999*l}c${.06923076923076922*l},${1.2*l},-${1.1769230769230767*l},${2.0769230769230766*l},-${2.3307692307692305*l},${1.6384615384615382*l}l-${6.9692307692307685*l},-${2.6076923076923073*l}c-${.3923076923076923*l},-${.16153846153846155*l},-${.8538461538461538*l},-${.16153846153846155*l},-${1.2461538461538462*l},0l-${6.9692307692307685*l},${2.6076923076923073*l}c-${1.1538461538461537*l},${.4384615384615384*l},-${2.4*l},-${.4384615384615384*l},-${2.3307692307692305*l},-${1.6384615384615382*l}l${.4384615384615384*l},-${7.199999999999999*l}c${.023076923076923075*l},-${.41538461538461535*l},-${.11538461538461538*l},-${.8307692307692307*l},-${.3923076923076923*l},-${1.1307692307692307*l}l-${4.73076923076923*l},-${5.584615384615384*l}c-${.7846153846153846*l},-${.923076923076923*l},-${.3230769230769231*l},-${2.3307692307692305*l},${.8999999999999999*l},-${2.6538461538461533*l}l${7.223076923076922*l},-${1.823076923076923*l}c${.41538461538461535*l},-${.11538461538461538*l},${.7846153846153846*l},-${.3461538461538461*l},${1.0153846153846153*l},-${.7153846153846153*l}l${4.038461538461538*l},-${6.069230769230768*l}z`;return A("path",{clipRule:"evenodd",d:m,transform:v`rotate(0,${e},${t})`})}case "banner":{let l=a/28;return A("g",{transform:v`translate(${e-40*l},${t-40*l}) scale(${x(l,6)})`,children:A("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 A("circle",{cx:x(e),cy:x(t),r:x(n),transform:v`rotate(0,${e},${t})`})}}function Qn(e,t,n,o){let r=e==="top-left"?0:e==="top-right"?1:3,a=(r+2)%4;return [0,1,2,3].map(i=>i===r||o&&i===a?n:t)}function ku(e,t,n,o){let r=n/7,a=Math.max(0,(o+Math.SQRT2-2)*r);return Z(_i(e,t,n,o*r))+Z(_i(e+r,t+r,5*r,a))}function Fu(e,t,n,o,r=false){let a=n/7,i=s=>r?Qn(o,0,s,true):Qn(o,s,0,true);return D(e,t,n,n,i(2.5*a))+D(e+a,t+a,5*a,5*a,i(1.5*a))}function Wh(e,t,n,o){let r=n/7;return D(e,t,n,n,Qn(o,2.6*r,0,false))+D(e+r,t+r,5*r,5*r,Qn(o,1.6*r,0,false))}function qh(e,t,n){let o=n/7,r=e+n/2,a=t+n/2;return Z(Nn(r,a,3.5*o,3.5*o,4,96))+Z(Nn(r,a,2.5*o,2.5*o,4,96))}function Vh(e,t,n){let o=n/7,r=.12*o;return pr(e,t,n,1.4*o,r)+pr(e+o,t+o,5*o,.7*o,r)}function jh(e,t,n){let o=n/7;return xi(e,t,n,.7*o,3.9*o,o)+xi(e+o,t+o,5*o,.35*o,2.7*o,.8*o)}function Xh(e,t,n,o){let r=n/7;return D(e,t,n,n,Qn(o,.5*r,2.5*r,false))+D(e+r,t+r,5*r,5*r,Qn(o,.25*r,1.5*r,false))}function Yh(e,t,n){return D(e+n,t+n,5*n,5*n,1.5*n)}function Zh(e,t,n){return Z(Nn(e,t,3.5*n,3.5*n,2.75,96))}function Kh(e,t,n){let o=n/7;return Zh(e+n/2,t+n/2,o)+uo(e+o,t+o,5*o,5*o,.52*o)}function Jh(e,t,n){let o=n/7;return yi(e,t,n,n,1.15*o)+yi(e+o,t+o,5*o,5*o,.74*o)}function ep(e,t,n){let o=n/7;return uo(e,t,n,n,.8*o)+uo(e+o,t+o,5*o,5*o,.52*o)}function Yi(e,t,n,o){let[r,a,i,s]=o,l=(u,m)=>v`${e+u} ${t+m}`,c=(u,m,f)=>u[0]==="round"?v`A${u[1]} ${u[1]} 0 0 1 ${l(m,f)}`:v`L${l(m,f)}`;return v`M${l(r[1],0)}L${l(n-a[1],0)}`+c(a,n,a[1])+v`L${l(n,n-i[1])}`+c(i,n-i[1],n)+v`L${l(s[1],n)}`+c(s,0,n-s[1])+v`L${l(0,r[1])}`+c(r,r[1],0)+"Z"}function tp(e,t){let n=[0,1,2,3].map(r=>t(r)?["round",2.8*e]:["cut",1.6*e]),o=[0,1,2,3].map(r=>t(r)?["round",1.5*e]:["cut",1.01*e]);return [n,o]}function np(e,t,n,o){let r=n/7,a=o==="top-left"?0:o==="top-right"?1:3,i=(a+2)%4,[s,l]=tp(r,c=>c===a||c===i);return Yi(e,t,n,s)+Yi(e+r,t+r,5*r,l)}function rp(e,t,n){let o=n/7;return Yi(e,t,n,[["cut",1.6*o],["cut",1.6*o],["round",3*o],["round",3*o]])+Yh(e,t,o)}function op(e,t,n){let o=n/7;return v`M ${e} ${t}v ${n}h ${n}v -${n}z`+v`M ${e+o} ${t+o}h ${5*o}v ${5*o}h -${5*o}z`}function ap(e,t,n){let o=n/7,r=o*.875,a=o*.4375,i=v`M ${e+r} ${t}`+v`h ${n-2*r}`+v`a ${r} ${r} 0 0 1 ${r} ${r}`+v`v ${n-2*r}`+v`a ${r} ${r} 0 0 1 ${-r} ${r}`+v`h ${-(n-2*r)}`+v`a ${r} ${r} 0 0 1 ${-r} ${-r}`+v`v ${-(n-2*r)}`+v`a ${r} ${r} 0 0 1 ${r} ${-r}z`,s=v`M ${e+o+a} ${t+o}`+v`h ${5*o-2*a}`+v`a ${a} ${a} 0 0 1 ${a} ${a}`+v`v ${5*o-2*a}`+v`a ${a} ${a} 0 0 1 ${-a} ${a}`+v`h ${-(5*o-2*a)}`+v`a ${a} ${a} 0 0 1 ${-a} ${-a}`+v`v ${-(5*o-2*a)}`+v`a ${a} ${a} 0 0 1 ${a} ${-a}z`;return i+s}function ip(e,t,n){let o=e+n/2,r=t+n/2,a=K(n/2),i=K(n*(2.5/7));return v`M ${o-a} ${r}`+v`a ${a} ${a} 0 1 0 ${a*2} 0`+v`a ${a} ${a} 0 1 0 ${-a*2} 0z`+v`M ${o-i} ${r}`+v`a ${i} ${i} 0 1 1 ${i*2} 0`+v`a ${i} ${i} 0 1 1 ${-i*2} 0z`}function sp(e,t,n){let o=n/74.7002,r=s=>s*o+e,a=s=>s*o+t;return v`M${r(37.3496)} ${a(0)}C${r(39.2939)} ${a(0)} ${r(40.9948)} ${a(1.03842)} ${r(41.9287)} ${a(2.59082)}C${r(43.2293)} ${a(1.34013)} ${r(45.1347)} ${a(.780267)} ${r(47.0098)} ${a(1.28027)}C${r(48.8871)} ${a(1.78928)} ${r(50.261)} ${a(3.23767)} ${r(50.7578)} ${a(4.98438)}C${r(52.3454)} ${a(4.0996)} ${r(54.3432)} ${a(4.047)} ${r(56.0303)} ${a(5.01953)}C${r(57.7094)} ${a(5.98752)} ${r(58.6586)} ${a(7.73647)} ${r(58.6924)} ${a(9.5459)}C${r(60.4517)} ${a(9.10661)} ${r(62.3883)} ${a(9.57215)} ${r(63.7598)} ${a(10.9502)}C${r(65.1282)} ${a(12.3253)} ${r(65.5963)} ${a(14.2585)} ${r(65.1641)} ${a(16.0127)}C${r(66.974)} ${a(16.044)} ${r(68.7242)} ${a(16.9982)} ${r(69.7002)} ${a(18.6797)}C${r(70.6781)} ${a(20.3647)} ${r(70.6241)} ${a(22.3635)} ${r(69.7402)} ${a(23.9502)}C${r(71.4776)} ${a(24.4496)} ${r(72.9194)} ${a(25.8232)} ${r(73.4199)} ${a(27.7002)}C${r(73.927)} ${a(29.5707)} ${r(73.3661)} ${a(31.4794)} ${r(72.1104)} ${a(32.7822)}C${r(73.6621)} ${a(33.7163)} ${r(74.7002)} ${a(35.4166)} ${r(74.7002)} ${a(37.3604)}C${r(74.7001)} ${a(39.307)} ${r(73.6582)} ${a(41.0084)} ${r(72.1025)} ${a(41.9414)}C${r(73.357)} ${a(43.245)} ${r(73.9207)} ${a(45.1525)} ${r(73.4199)} ${a(47.0303)}C${r(72.9187)} ${a(48.9027)} ${r(71.4782)} ${a(50.2735)} ${r(69.7383)} ${a(50.7734)}C${r(70.6201)} ${a(52.3601)} ${r(70.6716)} ${a(54.3549)} ${r(69.7002)} ${a(56.04)}C${r(68.7237)} ${a(57.7225)} ${r(66.9721)} ${a(58.6729)} ${r(65.1611)} ${a(58.7031)}C${r(65.598)} ${a(60.4623)} ${r(65.131)} ${a(62.3982)} ${r(63.7598)} ${a(63.7695)}C${r(62.3847)} ${a(65.138)} ${r(60.4515)} ${a(65.6061)} ${r(58.6973)} ${a(65.1738)}C${r(58.6635)} ${a(66.9833)} ${r(57.7094)} ${a(68.7322)} ${r(56.0303)} ${a(69.7002)}C${r(54.3461)} ${a(70.6777)} ${r(52.348)} ${a(70.6248)} ${r(50.7617)} ${a(69.7422)}C${r(50.2643)} ${a(71.4831)} ${r(48.8896)} ${a(72.9284)} ${r(47.0098)} ${a(73.4297)}C${r(45.1389)} ${a(73.9368)} ${r(43.2296)} ${a(73.3763)} ${r(41.9268)} ${a(72.1201)}C${r(40.9927)} ${a(73.6717)} ${r(39.2932)} ${a(74.71)} ${r(37.3496)} ${a(74.71)}C${r(35.4051)} ${a(74.7098)} ${r(33.7042)} ${a(73.6711)} ${r(32.7705)} ${a(72.1182)}C${r(31.4697)} ${a(73.3758)} ${r(29.5597)} ${a(73.9418)} ${r(27.6797)} ${a(73.4404)}V${a(73.4502)}C${r(25.8065)} ${a(72.9422)} ${r(24.434)} ${a(71.4985)} ${r(23.9346)} ${a(69.7568)}C${r(22.3504)} ${a(70.6301)} ${r(20.3591)} ${a(70.6781)} ${r(18.6797)} ${a(69.71)}C${r(16.9957)} ${a(68.7391)} ${r(16.045)} ${a(66.9831)} ${r(16.0166)} ${a(65.168)}C${r(14.2547)} ${a(65.6091)} ${r(12.3134)} ${a(65.1435)} ${r(10.9395)} ${a(63.7695)}C${r(9.5687)} ${a(62.3919)} ${r(9.10168)} ${a(60.454)} ${r(9.53809)} ${a(58.6973)}C${r(7.72791)} ${a(58.6641)} ${r(5.97815)} ${a(57.71)} ${r(5.00977)} ${a(56.0303)}C${r(4.03552)} ${a(54.3517)} ${r(4.08377)} ${a(52.3649)} ${r(4.95801)} ${a(50.7812)}C${r(3.21705)} ${a(50.2839)} ${r(1.77087)} ${a(48.9101)} ${r(1.26953)} ${a(47.0303)}V${a(47.0205)}C${r(.762081)} ${a(45.1489)} ${r(1.32758)} ${a(43.2375)} ${r(2.58496)} ${a(41.9346)}C${r(1.03604)} ${a(41)} ${r(108484e-9)} ${a(39.3019)} ${r(0)} ${a(37.3604)}C${r(0)} ${a(35.4159)} ${r(1.03815)} ${a(33.7141)} ${r(2.59082)} ${a(32.7803)}C${r(1.34044)} ${a(31.4797)} ${r(.780389)} ${a(29.575)} ${r(1.28027)} ${a(27.7002)}C${r(1.78258)} ${a(25.8232)} ${r(3.22806)} ${a(24.4482)} ${r(4.97363)} ${a(23.9512)}C${r(4.08938)} ${a(22.3638)} ${r(4.03743)} ${a(20.3664)} ${r(5.00977)} ${a(18.6797)}C${r(5.97815)} ${a(16.9999)} ${r(7.72788)} ${a(16.0496)} ${r(9.53809)} ${a(16.0166)}C${r(9.10139)} ${a(14.2576)} ${r(9.56846)} ${a(12.3214)} ${r(10.9395)} ${a(10.9502)}C${r(12.3171)} ${a(9.57911)} ${r(14.2558)} ${a(9.11137)} ${r(16.0127)} ${a(9.54785)}C${r(16.0426)} ${a(7.73421)} ${r(16.9969)} ${a(5.97989)} ${r(18.6797)} ${a(5.00977)}C${r(20.3596)} ${a(4.03474)} ${r(22.3521)} ${a(4.08468)} ${r(23.9365)} ${a(4.96094)}C${r(24.4378)} ${a(3.22749)} ${r(25.8059)} ${a(1.7898)} ${r(27.6797)} ${a(1.29004)}C${r(29.5511)} ${a(.78264)} ${r(31.4617)} ${a(1.34357)} ${r(32.7646)} ${a(2.60059)}C${r(33.6971)} ${a(1.04268)} ${r(35.4013)} ${a(152405e-9)} ${r(37.3496)} ${a(0)}ZM${r(41.0615)} ${a(9.17578)}C${r(40.1006)} ${a(10.1057)} ${r(38.793)} ${a(10.6797)} ${r(37.3496)} ${a(10.6797)}C${r(35.9064)} ${a(10.6796)} ${r(34.5985)} ${a(10.1066)} ${r(33.6377)} ${a(9.17676)}C${r(32.9511)} ${a(10.3241)} ${r(31.8358)} ${a(11.2176)} ${r(30.4404)} ${a(11.5898)}C${r(29.0527)} ${a(11.9661)} ${r(27.6436)} ${a(11.7542)} ${r(26.4766)} ${a(11.1074)}C${r(26.1072)} ${a(12.3879)} ${r(25.2629)} ${a(13.5333)} ${r(24.0195)} ${a(14.25)}C${r(22.7695)} ${a(14.9754)} ${r(21.347)} ${a(15.1322)} ${r(20.0479)} ${a(14.8047)}C${r(20.0289)} ${a(16.1454)} ${r(19.5108)} ${a(17.4793)} ${r(18.4902)} ${a(18.5)}C${r(17.4696)} ${a(19.5158)} ${r(16.1409)} ${a(20.033)} ${r(14.8066)} ${a(20.0566)}C${r(15.1312)} ${a(21.3534)} ${r(14.9738)} ${a(22.7723)} ${r(14.25)} ${a(24.0195)}C${r(13.5243)} ${a(25.2699)} ${r(12.3701)} ${a(26.1148)} ${r(11.082)} ${a(26.4795)}C${r(11.7347)} ${a(27.6479)} ${r(11.9529)} ${a(29.062)} ${r(11.5801)} ${a(30.46)}C${r(11.2085)} ${a(31.8485)} ${r(10.3194)} ${a(32.9607)} ${r(9.17578)} ${a(33.6475)}C${r(10.106)} ${a(34.6084)} ${r(10.6797)} ${a(35.9167)} ${r(10.6797)} ${a(37.3604)}C${r(10.6796)} ${a(38.805)} ${r(10.1053)} ${a(40.1141)} ${r(9.17383)} ${a(41.0752)}C${r(10.3132)} ${a(41.7614)} ${r(11.1999)} ${a(42.871)} ${r(11.5703)} ${a(44.2598)}C${r(11.946)} ${a(45.6504)} ${r(11.7335)} ${a(47.0592)} ${r(11.0889)} ${a(48.2266)}C${r(12.377)} ${a(48.593)} ${r(13.5297)} ${a(49.441)} ${r(14.25)} ${a(50.6904)}C${r(14.9754)} ${a(51.9405)} ${r(15.1322)} ${a(53.3629)} ${r(14.8047)} ${a(54.6621)}C${r(16.142)} ${a(54.6835)} ${r(17.4721)} ${a(55.2016)} ${r(18.4902)} ${a(56.2197)}C${r(19.5097)} ${a(57.2441)} ${r(20.0278)} ${a(58.5787)} ${r(20.0479)} ${a(59.918)}C${r(21.3469)} ${a(59.5917)} ${r(22.7696)} ${a(59.7493)} ${r(24.0195)} ${a(60.4697)}C${r(25.2676)} ${a(61.1892)} ${r(26.1117)} ${a(62.3406)} ${r(26.4775)} ${a(63.627)}C${r(27.6424)} ${a(62.9822)} ${r(29.0498)} ${a(62.7688)} ${r(30.4404)} ${a(63.1396)}C${r(31.8284)} ${a(63.5112)} ${r(32.9402)} ${a(64.3999)} ${r(33.627)} ${a(65.543)}C${r(34.5887)} ${a(64.6072)} ${r(35.9012)} ${a(64.0304)} ${r(37.3496)} ${a(64.0303)}C${r(38.7912)} ${a(64.0303)} ${r(40.098)} ${a(64.6023)} ${r(41.0586)} ${a(65.5303)}C${r(41.7458)} ${a(64.3887)} ${r(42.8594)} ${a(63.5007)} ${r(44.25)} ${a(63.1299)}C${r(45.643)} ${a(62.7522)} ${r(47.057)} ${a(62.9676)} ${r(48.2266)} ${a(63.6201)}C${r(48.5931)} ${a(62.3323)} ${r(49.4413)} ${a(61.1801)} ${r(50.6904)} ${a(60.46)}C${r(51.9373)} ${a(59.7364)} ${r(53.3558)} ${a(59.5781)} ${r(54.6523)} ${a(59.9023)}C${r(54.6744)} ${a(58.5659)} ${r(55.1925)} ${a(57.2372)} ${r(56.21)} ${a(56.2197)}C${r(57.2339)} ${a(55.2007)} ${r(58.5676)} ${a(54.6816)} ${r(59.9062)} ${a(54.6611)}C${r(59.5835)} ${a(53.3649)} ${r(59.7414)} ${a(51.9468)} ${r(60.46)} ${a(50.7002)}C${r(61.1797)} ${a(49.4517)} ${r(62.3312)} ${a(48.6068)} ${r(63.6182)} ${a(48.2412)}C${r(62.9651)} ${a(47.0726)} ${r(62.7473)} ${a(45.658)} ${r(63.1201)} ${a(44.2598)}C${r(63.4916)} ${a(42.8718)} ${r(64.3794)} ${a(41.7591)} ${r(65.5225)} ${a(41.0723)}C${r(64.5929)} ${a(40.1115)} ${r(64.0206)} ${a(38.8033)} ${r(64.0205)} ${a(37.3604)}C${r(64.0205)} ${a(35.9186)} ${r(64.5915)} ${a(34.611)} ${r(65.5195)} ${a(33.6504)}C${r(64.3785)} ${a(32.9631)} ${r(63.4908)} ${a(31.8501)} ${r(63.1201)} ${a(30.46)}C${r(62.7421)} ${a(29.0656)} ${r(62.9572)} ${a(27.6498)} ${r(63.6113)} ${a(26.4795)}C${r(62.3272)} ${a(26.1115)} ${r(61.1784)} ${a(25.2657)} ${r(60.46)} ${a(24.0195)}C${r(59.7364)} ${a(22.7727)} ${r(59.5781)} ${a(21.3541)} ${r(59.9023)} ${a(20.0576)}C${r(58.5626)} ${a(20.038)} ${r(57.23)} ${a(19.52)} ${r(56.21)} ${a(18.5)}C${r(55.1931)} ${a(17.4783)} ${r(54.675)} ${a(16.1482)} ${r(54.6523)} ${a(14.8125)}C${r(53.3557)} ${a(15.1357)} ${r(51.9374)} ${a(14.9785)} ${r(50.6904)} ${a(14.2598)}C${r(49.4399)} ${a(13.5339)} ${r(48.5931)} ${a(12.3801)} ${r(48.2285)} ${a(11.0918)}C${r(47.0603)} ${a(11.7439)} ${r(45.6474)} ${a(11.9624)} ${r(44.25)} ${a(11.5898)}V${a(11.5801)}C${r(42.8613)} ${a(11.2085)} ${r(41.7483)} ${a(10.3196)} ${r(41.0615)} ${a(9.17578)}Z`}function Zi(e){let t=e/70;return {scale:t,transform:(o,r)=>(o-5)*t+r}}function lp(e,t,n){let{scale:o,transform:r}=Zi(n);return v`M ${r(5,e)} ${r(30,t)}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,e)}zM ${r(30,e)} ${r(15,t)}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 cp(e,t,n){let o=n/7,r=o*1.5,a=o*.75,i=v`M ${e+r} ${t}`+v`h ${n-2*r}`+v`a ${r} ${r} 0 0 1 ${r} ${r}`+v`v ${n-2*r}`+v`a ${r} ${r} 0 0 1 ${-r} ${r}`+v`h ${-(n-2*r)}`+v`a ${r} ${r} 0 0 1 ${-r} ${-r}`+v`v ${-(n-2*r)}`+v`a ${r} ${r} 0 0 1 ${r} ${-r}z`,s=v`M ${e+o+a} ${t+o}`+v`h ${5*o-2*a}`+v`a ${a} ${a} 0 0 1 ${a} ${a}`+v`v ${5*o-2*a}`+v`a ${a} ${a} 0 0 1 ${-a} ${a}`+v`h ${-(5*o-2*a)}`+v`a ${a} ${a} 0 0 1 ${-a} ${-a}`+v`v ${-(5*o-2*a)}`+v`a ${a} ${a} 0 0 1 ${a} ${-a}z`;return i+s}function up(e,t,n){let{scale:o,transform:r}=Zi(n);return v`M ${r(5,e)} ${r(40,t)}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,e)} ${r(15,t)}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 mp(e,t,n){let{scale:o,transform:r}=Zi(n);return v`M ${r(5,e)} ${r(30,t)}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,e)} ${r(15,t)}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 dp(e,t,n){let o=n/70,r=e+n/2-40*o,a=t+n/2-40*o,i=(l,c)=>l*o+c;return v`M${i(35.19239999999999,r)} ${i(5.837547376725838,a)}C${i(37.69667692307692,r)} ${i(3.8737070690335305,a)}, ${i(41.218430769230764,r)} ${i(3.8737092228796843,a)}, ${i(43.722707692307694,r)} ${i(5.837547376725838,a)}L${i(46.62781538461539,r)} ${i(8.115648915187375,a)}L${i(50.23356923076923,r)} ${i(7.32361506903353,a)}C${i(53.342,r)} ${i(6.640824299802762,a)}, ${i(56.51483076923077,r)} ${i(8.168784299802759,a)}, ${i(57.91892307692308,r)} ${i(11.024719684418145,a)}L${i(59.54787692307692,r)} ${i(14.337679684418145,a)}L${i(63.14027692307692,r)} ${i(15.188578145956608,a)}C${i(66.23707692307693,r)} ${i(15.922091992110452,a)}, ${i(68.43270769230769,r)} ${i(18.675396607495067,a)}, ${i(68.45876923076924,r)} ${i(21.857768915187375,a)}L${i(68.48892307692307,r)} ${i(25.54931045364891,a)}L${i(71.35633846153846,r)} ${i(27.874602761341222,a)}C${i(73.82830769230769,r)} ${i(29.879187376725838,a)}, ${i(74.61187692307692,r)} ${i(33.312418145956606,a)}, ${i(73.25452307692306,r)} ${i(36.19103353057199,a)}L${i(71.68006153846153,r)} ${i(39.530141222879685,a)}L${i(73.25452307692306,r)} ${i(42.86924891518738,a)}C${i(74.61187692307692,r)} ${i(45.747864299802764,a)}, ${i(73.82830769230769,r)} ${i(49.18109506903353,a)}, ${i(71.35633846153846,r)} ${i(51.18567968441815,a)}L${i(68.48892307692307,r)} ${i(53.510971992110456,a)}L${i(68.45876923076924,r)} ${i(57.202664299802755,a)}C${i(68.43270769230769,r)} ${i(60.38497199211046,a)}, ${i(66.23707692307693,r)} ${i(63.13823353057199,a)}, ${i(63.14027692307692,r)} ${i(63.871833530572,a)}L${i(59.54787692307692,r)} ${i(64.72260276134121,a)}L${i(57.91892307692308,r)} ${i(68.03564891518737,a)}C${i(56.51483076923077,r)} ${i(70.89164891518737,a)}, ${i(53.342,r)} ${i(72.41958737672583,a)}, ${i(50.23356923076923,r)} ${i(71.7368181459566,a)}L${i(46.62781538461539,r)} ${i(70.94463353057199,a)}L${i(43.722707692307694,r)} ${i(73.22275660749506,a)}C${i(41.218430769230764,r)} ${i(75.18663353057198,a)}, ${i(37.69667692307692,r)} ${i(75.18663353057198,a)}, ${i(35.19239999999999,r)} ${i(73.22275660749506,a)}L${i(32.28729230769231,r)} ${i(70.94463353057199,a)}L${i(28.68153846153846,r)} ${i(71.7368181459566,a)}C${i(25.573215384615384,r)} ${i(72.41958737672583,a)}, ${i(22.400384615384613,r)} ${i(70.89164891518737,a)}, ${i(20.996141538461536,r)} ${i(68.03564891518737,a)}L${i(19.36720923076923,r)} ${i(64.72260276134121,a)}L${i(15.774852307692306,r)} ${i(63.871833530572,a)}C${i(12.67803076923077,r)} ${i(63.13823353057199,a)}, ${i(10.48237846153846,r)} ${i(60.38497199211046,a)}, ${i(10.45636,r)} ${i(57.202664299802755,a)}L${i(10.426163076923077,r)} ${i(53.510971992110456,a)}L${i(7.558747692307692,r)} ${i(51.18567968441815,a)}C${i(5.086880338461539,r)} ${i(49.18109506903353,a)}, ${i(4.303258769230769,r)} ${i(45.747864299802764,a)}, ${i(5.660599692307692,r)} ${i(42.86924891518738,a)}L${i(7.235153846153846,r)} ${i(39.530141222879685,a)}L${i(5.660599692307692,r)} ${i(36.19103353057199,a)}C${i(4.3032566153846155,r)} ${i(33.312418145956606,a)}, ${i(5.086885938461538,r)} ${i(29.879187376725838,a)}, ${i(7.558747692307692,r)} ${i(27.874602761341222,a)}L${i(10.426163076923077,r)} ${i(25.54931045364891,a)}L${i(10.45636,r)} ${i(21.857768915187375,a)}C${i(10.48237846153846,r)} ${i(18.67537506903353,a)}, ${i(12.678052307692308,r)} ${i(15.922091992110452,a)}, ${i(15.774852307692306,r)} ${i(15.188578145956608,a)}L${i(19.36720923076923,r)} ${i(14.337679684418145,a)}L${i(20.996141538461536,r)} ${i(11.024719684418145,a)}C${i(22.400384615384613,r)} ${i(8.168784299802759,a)}, ${i(25.573215384615384,r)} ${i(6.640824299802762,a)}, ${i(28.68153846153846,r)} ${i(7.32361506903353,a)}L${i(32.28729230769231,r)} ${i(8.115648915187375,a)}L${i(35.19239999999999,r)} ${i(5.837547376725838,a)}M${i(39.45766153846154,r)} ${i(13.665055069033532,a)}L${i(37.01498461538461,r)} ${i(15.58053506903353,a)}C${i(35.39098461538461,r)} ${i(16.854061222879682,a)}, ${i(33.282799999999995,r)} ${i(17.335251992110454,a)}, ${i(31.26701538461538,r)} ${i(16.892464299802757,a)}L${i(28.235046153846152,r)} ${i(16.22649506903353,a)}L${i(26.865415384615382,r)} ${i(19.012107376725837,a)}C${i(25.954812307692308,r)} ${i(20.864178145956608,a)}, ${i(24.264193846153844,r)} ${i(22.212399684418145,a)}, ${i(22.255926153846154,r)} ${i(22.688076607495066,a)}L${i(19.235393846153844,r)} ${i(23.40354122287968,a)}L${i(19.21,r)} ${i(26.507556607495065,a)}C${i(19.19313538461538,r)} ${i(28.57137199211045,a)}, ${i(18.25492,r)} ${i(30.519525838264297,a)}, ${i(16.651919999999997,r)} ${i(31.81937199211045,a)}L${i(14.240926153846154,r)} ${i(33.774633530572,a)}L${i(15.564830769230769,r)} ${i(36.58238737672584,a)}C${i(16.445064615384617,r)} ${i(38.44891045364892,a)}, ${i(16.445064615384617,r)} ${i(40.611371992110456,a)}, ${i(15.564830769230769,r)} ${i(42.47811045364892,a)}L${i(14.240926153846154,r)} ${i(45.28564891518738,a)}L${i(16.651919999999997,r)} ${i(47.240910453648915,a)}L${i(13.883236923076923,r)} ${i(50.654971992110454,a)}L${i(16.651919999999997,r)} ${i(47.240910453648915,a)}C${i(18.25492,r)} ${i(48.54075660749507,a)}, ${i(19.19313538461538,r)} ${i(50.4891258382643,a)}, ${i(19.21,r)} ${i(52.5527258382643,a)}L${i(19.235393846153844,r)} ${i(55.65684891518738,a)}L${i(22.255926153846154,r)} ${i(56.37235660749507,a)}C${i(24.264193846153844,r)} ${i(56.847925838264295,a)}, ${i(25.954812307692308,r)} ${i(58.196233530571995,a)}, ${i(26.865415384615382,r)} ${i(60.0483258382643,a)}L${i(28.235046153846152,r)} ${i(62.833895069033524,a)}L${i(31.26701538461538,r)} ${i(62.1679258382643,a)}C${i(33.282799999999995,r)} ${i(61.72509506903353,a)}, ${i(35.39098461538461,r)} ${i(62.20626429980276,a)}, ${i(37.01498461538461,r)} ${i(63.47983353057199,a)}L${i(39.45766153846154,r)} ${i(65.39524891518737,a)}L${i(41.90012307692308,r)} ${i(63.47983353057199,a)}C${i(43.524123076923075,r)} ${i(62.20626429980276,a)}, ${i(45.632307692307684,r)} ${i(61.72509506903353,a)}, ${i(47.6480923076923,r)} ${i(62.1679258382643,a)}L${i(50.68006153846154,r)} ${i(62.833895069033524,a)}L${i(52.049692307692304,r)} ${i(60.0483258382643,a)}C${i(52.960338461538456,r)} ${i(58.196233530571995,a)}, ${i(54.6508923076923,r)} ${i(56.847925838264295,a)}, ${i(56.65913846153846,r)} ${i(56.37235660749507,a)}L${i(59.67969230769231,r)} ${i(55.65684891518738,a)}L${i(59.70510769230769,r)} ${i(52.5527258382643,a)}C${i(59.72190769230769,r)} ${i(50.4891258382643,a)}, ${i(60.66012307692307,r)} ${i(48.54075660749507,a)}, ${i(62.263230769230766,r)} ${i(47.240910453648915,a)}L${i(64.67424615384616,r)} ${i(45.28564891518738,a)}L${i(63.35027692307692,r)} ${i(42.47811045364892,a)}C${i(62.47,r)} ${i(40.611371992110456,a)}, ${i(62.47,r)} ${i(38.44891045364892,a)}, ${i(63.35027692307692,r)} ${i(36.58238737672584,a)}L${i(64.67424615384616,r)} ${i(33.774633530572,a)}L${i(62.263230769230766,r)} ${i(31.81958737672584,a)}C${i(60.66012307692307,r)} ${i(30.519525838264297,a)}, ${i(59.72190769230769,r)} ${i(28.57137199211045,a)}, ${i(59.70510769230769,r)} ${i(26.507556607495065,a)}L${i(59.67969230769231,r)} ${i(23.40354122287968,a)}L${i(56.65913846153846,r)} ${i(22.688076607495066,a)}C${i(54.6508923076923,r)} ${i(22.212399684418145,a)}, ${i(52.960338461538456,r)} ${i(20.864178145956608,a)}, ${i(52.049692307692304,r)} ${i(19.012128915187375,a)}L${i(50.68006153846154,r)} ${i(16.22649506903353,a)}L${i(47.6480923076923,r)} ${i(16.892464299802757,a)}C${i(45.632307692307684,r)} ${i(17.335251992110454,a)}, ${i(43.524338461538456,r)} ${i(16.85408276134122,a)}, ${i(41.90012307692308,r)} ${i(15.58053506903353,a)}L${i(39.45766153846154,r)} ${i(13.665055069033532,a)}Z`}function Ao(e,t,n,o,r="top-left"){switch(o){case "leaf":return Fu(e,t,n,r);case "leaf-reverse":return Fu(e,t,n,r,true);case "drop":return Wh(e,t,n,r);case "octagon":return ku(e,t,n,1.6);case "bevel":return ku(e,t,n,1.1);case "squircle":return qh(e,t,n);case "cushion":return Vh(e,t,n);case "shield":return jh(e,t,n);case "petal":return Xh(e,t,n,r);case "porthole":return Kh(e,t,n);case "notch":return Jh(e,t,n);case "plus":return ep(e,t,n);case "bud":return np(e,t,n,r);case "bowl":return rp(e,t,n);case "gear":return sp(e,t,n);case "rounded":return ap(e,t,n);case "circle":return ip(e,t,n);case "diya":return lp(e,t,n);case "extra-rounded":return cp(e,t,n);case "message":return up(e,t,n);case "pointy":return mp(e,t,n);case "curly":return dp(e,t,n);default:return op(e,t,n)}}var Nu={diamond:["square","rounded","diya","extra-rounded","message","pointy","leaf","leaf-reverse","drop","bevel","squircle","cushion","shield","petal"],banner:["square","rounded","diya","leaf"],square:["curly"],diya:["curly"],message:["curly"]},Ou={diamond:["square"],pacman:["rounded"],"small-square":["square","rounded"]},Du=["circle","curly"],Bu=["diamond","banner","star"],Gu={circle:["square","rounded","diya","extra-rounded","message","pointy","leaf","leaf-reverse","drop","bevel","squircle","cushion","shield","petal"]},je=["square","liquid","classy","classy-rounded"],Qu={"circle/rounded":je,"circle/extra-rounded":je,"circle/message":[...je,"leaf"],"circle/pointy":je,"circle/leaf-reverse":je,"circle/drop":je,"circle/bevel":[...je,"leaf"],"circle/squircle":[...je,"circle","diamond","circle-mixed","rounded","horizontal-line","leaf","heart","mosaic","octagon"],"circle/cushion":je,"circle/shield":[...je,"rounded","horizontal-line","leaf"],"circle/petal":je};function Uu(e,t,n){return (Gu[e]?.includes(t)??false)&&!Qu[`${e}/${t}`]?.includes(n)}function Ki(e){let t=Qe(or,e.bodyPattern??"circle"),n=Qe(Dt,e.cornerEyePattern??"gear"),o=Qe(Bt,e.cornerEyeDotPattern??"circle");return Nu[o]?.includes(n)?{kind:"dot-eye",message:`${o} centres in ${n} eyes are missed by strict decoders`,fix:"Pick a square, rounded or circle centre, or another eye shape"}:Ou[t]?.includes(n)?{kind:"body-eye",message:`${t} dots next to ${n} eyes are missed up close`,fix:"Pick a fuller dot shape or another eye shape"}:Bu.includes(o)?{kind:"dot",message:`${o} centres are missed in sharp renders and up close`,fix:"Pick a square, rounded or circle centre"}:Du.includes(n)?{kind:"eye",message:`${n} eyes only read in lenient decoders`,fix:"Pick square, rounded or gear eyes"}:Uu(o,n,t)?{kind:"sharp-dot-eye",message:`${o} centres in ${n} eyes are missed by some decoders on screens and in sharp prints`,fix:"Pick a rounded centre, or gear or octagon eyes"}:null}var Ji=e=>{let t=e/255;return t<=.04045?t/12.92:((t+.055)/1.055)**2.4},fp=e=>255*(e<=.0031308?12.92*e:1.055*e**.4166666666666667-.055);function Wu({r:e,g:t,b:n}){let o=Ji(e),r=Ji(t),a=Ji(n),i=Math.cbrt(.4122214708*o+.5363325363*r+.0514459929*a),s=Math.cbrt(.2119034982*o+.6806995451*r+.1073969566*a),l=Math.cbrt(.0883024619*o+.2817188376*r+.6299787005*a),c=1.9779984951*i-2.428592205*s+.4505937099*l,u=.0259040371*i+.7827717662*s-.808675766*l;return {l:.2104542553*i+.793617785*s-.0040720468*l,c:Math.hypot(c,u),h:Math.atan2(u,c)}}function es({l:e,c:t,h:n}){let o=t*Math.cos(n),r=t*Math.sin(n),a=(e+.3963377774*o+.2158037573*r)**3,i=(e-.1055613458*o-.0638541728*r)**3,s=(e-.0894841775*o-1.291485548*r)**3;return [4.0767416621*a-3.3077115913*i+.2309699292*s,-1.2684380046*a+2.6097574011*i-.3413193965*s,-0.0041960863*a-.7034186147*i+1.707614701*s]}var Hu=1e-7,zu=e=>e.every(t=>t>=-Hu&&t<=1+Hu),hp=20;function Po(e){let t=es(e);if(!zu(t)){let a=0,i=e.c;for(let s=0;s<hp;s++){let l=(a+i)/2;zu(es({...e,c:l}))?a=l:i=l;}t=es({...e,c:a});}let[n=0,o=0,r=0]=t.map(a=>Math.round(fp(Math.min(1,Math.max(0,a)))));return {r:n,g:o,b:r,a:1}}var Vu="gear",pp="circle";function nt(e,t){let n=e.eyeShapes?.[t];return {outer:Qe(Dt,n?.outer??e.cornerEyePattern??Vu),inner:Qe(Bt,n?.inner??e.cornerEyeDotPattern??pp)}}var gp=["curly","circle"];function os(e){let t=Qt.map(n=>nt(e,n));for(let n of gp)if(t.some(o=>o.outer===n))return n;return t[0]?.outer??Vu}var qu=["dot-eye","body-eye","dot","sharp-dot-eye","eye"];function as(e){let t=null,n=new Set;for(let o of Qt){let{outer:r,inner:a}=nt(e,o),i=`${r}/${a}`;if(n.has(i))continue;n.add(i);let s=Ki({bodyPattern:e.bodyPattern,cornerEyePattern:r,cornerEyeDotPattern:a});s&&(!t||qu.indexOf(s.kind)<qu.indexOf(t.kind))&&(t=s);}return t}function Hn(e,t,n,o){if(!(e&&Number.isFinite(e))||e<=0||Cr(o)||n<=0)return 0;let r=Math.min(Kr,Wa*n/(t+2*n));return Math.min(e,r)}function bp(e){let{value:t,level:n,shape:o,autoLevel:r,exactLevel:a,isOGContext:i}=e,s=e.size??ce,l=e.margin??pe,c=zn({value:`${t}`,size:s,margin:l,level:n,shape:o,autoLevel:r,exactLevel:a,isOGContext:i},e.imageSettings),u=Ae({value:`${t}`,size:s,level:n,margin:l,imageSettings:c,isOGContext:i,autoLevel:r,exactLevel:a,shape:o}),m=Ee(`${t}`,u,a).size;return Hn(Kr,m,l,o)}var rs=(e,t,n,o)=>Math.min(o,Math.max(n,typeof e=="number"&&Number.isFinite(e)?e:t)),_p=/^hsla?\(([^)]*)\)$/,yp=/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:deg)?$/,xp=/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)%?$/;function ts(e,t){let n=e?.trim()??"";if(!xp.test(n))return Number.NaN;let o=Number.parseFloat(n),r=n.endsWith("%")||t?o/100:o;return Math.min(1,Math.max(0,r))}function $p(e){let t=_p.exec(e);if(!t)return null;let[n="",o]=(t[1]??"").split("/"),r=n.split(/[\s,]+/).filter(Boolean);if(r.length!==(o===void 0&&r.length===4?4:3))return null;let[a="",i,s,l]=r,c=ts(i,true),u=ts(s,true),m=ts(o??l??"1",false),f=Number.parseFloat(a);if(!(yp.test(a)&&[c,u,m].every(Number.isFinite)))return null;let d=c*Math.min(u,1-u),g=h=>{let p=(h+f/30)%12,b=p<0?p+12:p;return 255*(u-d*Math.max(-1,Math.min(b-3,9-b,1)))};return {r:g(0),g:g(8),b:g(4),a:m}}function To(e){let t=e?.trim().toLowerCase()??"";return t==="none"?{r:0,g:0,b:0,a:0}:le(t)??$p(t)}function vo(e){return To(e)?.a??1}function ju(e){let t=Le(e,fe);return t.type==="solid"?vo(t.color)<1:t.type==="image"?vo(t.underlay??"transparent")<1:t.stops.some(n=>vo(n.color)<1)}var Un=({r:e,g:t,b:n})=>[.2126*e+.7152*t+.0722*n,.299*e+.587*t+.114*n],Lo=Un(le(Ut)),rn=1e-9,Io=(e,t,n)=>e.every((o,r)=>o>=t[r]-rn&&o<=n[r]+rn),is=({r:e,g:t,b:n})=>`#${[e,t,n].map(o=>Math.round(o).toString(16).padStart(2,"0")).join("")}`;function Xu(e){let t=To(e.color||Jr);return t&&t.a>0?is(t):Jr}var Sp=24,wp=12;function Yu(e,t,n){if(Io(Un(e),t,n))return e;if(e.r===e.g&&e.g===e.b){let c=Math.min(Math.floor(Math.min(...n)+rn),Math.max(e.r,Math.ceil(Math.max(...t)-rn)));return c>=Math.max(...t)-rn?{r:c,g:c,b:c,a:1}:null}let o=Wu(e),r=c=>{let u=Po({l:o.l,c,h:o.h}),m=Un(u);if(Io(m,t,n))return u;let f=m.some((b,_)=>b<t[_]),d=b=>Un(b).every((_,y)=>f?_>=t[y]-rn:_<=n[y]+rn),g=o.l,h=f?1:0;for(let b=0;b<Sp;b++){let _=(g+h)/2;d(Po({l:_,c,h:o.h}))?h=_:g=_;}let p=Po({l:h,c,h:o.h});return Io(Un(p),t,n)?p:null},a=r(o.c);if(a)return a;let i=r(0);if(!i)return null;let s=0,l=o.c;for(let c=0;c<wp;c++){let u=(s+l)/2,m=r(u);m?(s=u,i=m):l=u;}return i}var ns="or turn the halo off";function Zu(e){let t=Le(e,fe);if(t.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, ${ns}`};if(ju(e))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, ${ns}`};let n=(t.type==="solid"?[t.color]:t.stops.map(r=>r.color)).map(To),o=[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY];for(let r of n){let a=r?Un(r):[0,0];o[0]=Math.min(o[0],a[0]),o[1]=Math.min(o[1],a[1]);}return Io(Lo,Lo,o)?o:{reason:"dark-background",message:`A halo needs a light background, at least as light as ${Ut}: on a darker one the rim makes the code unreadable`,fix:`Lighten the background to ${Ut} or lighter, ${ns}`}}function ss(e,t){let n=Zu(t);if(!Array.isArray(n))return n;let o=Xu(e),r=Yu(le(o),Lo,n);return {drawn:r?is(r):Ut,picked:o}}function Cp(e,t){let n=ss({color:e},t);return "drawn"in n?n.drawn:null}function Rp(e,t,n=4){let o=Zu(t),r=To(e);if(!(Array.isArray(o)&&r))return [];let a=new Set;for(let i=0;i<n;i++){let s=i/n,l=Lo.map((u,m)=>u+s*((o[m]??u)-u)),c=Yu({...r,a:1},l,o);c&&a.add(is(c));}return [...a]}function ls(e){if(!e.halo)return null;let t=ss(e.halo,e.bgColor);return "drawn"in t?t.drawn===t.picked?null:{reason:"adjusted",color:t.drawn,message:`Halo drawn as ${t.drawn} instead of ${t.picked} so the code still scans: a rim must read no lighter than the background and at least as light as ${Ut}`,fix:`To have it drawn as picked, choose a color in that range, such as ${t.drawn}`}:t}function Er(e,t){if(!e)return null;let n=t?ss(e,t.bgColor):null;if(n&&!("drawn"in n))return null;let o=rs(e.width,ja,qa,Va);return {color:n?n.drawn:Xu(e),width:o}}function cs(e){if(!e)return null;let t=r=>rs(r,Xa,-eo,eo),n=t(e.dx),o=t(e.dy);return n===0&&o===0?null:{color:e.color||Ja,opacity:rs(e.opacity,Ka,Ya,Za),dx:n,dy:o}}var us="data-qrdx-part",Ku="data-qrdx-eye",Mp=["eye-outer","eye-centre","body","logo","background"];function ms(e,t,n){if(e)return n?{[us]:t,[Ku]:n}:{[us]:t}}var Ar=300;function rt(e){return {id:e.id,name:e.name,description:e.description,spec:e.spec,wrapper:(t,n)=>{let o=jt(e.spec),r=n?.fgColor,a=(typeof r=="string"?r:ye(r,""))||"black",i=yr(o.qr.size,o,{color:a}),{x:s,y:l,scale:c}=e.at;return A("svg",{height:Ar,id:"svgQrWrapper",style:{width:"100%",height:"100%"},viewBox:`0 0 ${Ar} ${Ar}`,width:Ar,xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",children:$e("g",{"data-qrdx-template":e.id,transform:`translate(${x(s)} ${x(l)})${c===1?"":` scale(${c})`}`,children:[Oc(i),A("g",{fill:"none",transform:`translate(${x(i.qrX)} ${x(i.qrY)}) scale(${i.qrSize/Ar})`,children:t})]})})}}}var Ju={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 em=rt({id:"Arrow",name:"Arrow",description:"QR code with arrow",spec:Ju,at:{x:47,y:95,scale:1}});var tm={id:"default",name:"Default",description:"Simple QR code without decorative elements",wrapper:e=>A("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:A("g",{fill:"none",transform:"translate(9, 9) scale(0.95)",children:e})})};var vr=593,Mt=296.5,Pr=146.5,sm=294.5,lm=231.228,cm="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",Ap="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",Pp="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",nm="3cf27f17c00j3ch21n1ek00l1el3cj1vv1kd00n3cl3cn1q31q500p3cp1vx00r1kb3cs3aw1ej21p00t3ax3ay17b27h00w3b02g20yq01w2d611m01x3b52aa14i01y24i1bq0203bd3be1q21q60253bf39e39f39h14e2ae02d39j11i2da02e39l0ym02f39n2lt0sz03a39p2ix0vv03b39r2d511n39t03d27d17f03f39x39y21l1en03h3a03a11vt1kf03j37w37x1q11q703l37z1k903n1vz3821eh03p21r38714d03t11h03u2db38a0vp2j303w2lz38g03x0st2rk0n804o38l2oo0q404p38n2iw0vw04r36f36h2a814k04u36k36l1vs1kg04z36o36p1n41t405236q36x36y0ss2m005d3720n02rs05f3742uf0kd0633763772on0q506537834y2fz0yt06834z2d311p06935235424f1bt06c35621j1ep06d3581yn1hl06e35a1sv1nd06g35b1pz1q906h35d35e35g1ef21t06l35h1bj24p06m35k35l11f2dd06q35n0vn2j506s35p35q0pv2ox06u35s0mz2rt06v35t33h0k32up06w2x90hi08y2ud0ke08z33r2lp0t20922fx0yu0942a514m09624d1bu0983441yl1hm09a1vp1ki09b1px1qa09d34e1n11t609e1h91yy09g1ed21u09h1a227m0831492ai09l0yh2ga09n0sp2m209p0pt2oy09q0k12uq09s2xo0h52z209t31k0en0bt2780c319z0az0e831z0cq",rm=52,vp=240;function om(e){let t=0;return e.split(" ").map(n=>(t+=Number.parseInt(n,36),t/1e4))}var ds;function Ip(){if(!ds){let e=om(Ap),t=om(Pp),n=[];for(let o=0;o<nm.length;o+=3){let r=Number.parseInt(nm.slice(o,o+3),36);n.push({cx:e[Math.floor(r/rm)],cy:t[r%rm]});}ds=n;}return ds}function Lp(e){let t=0;for(let n=0;n<e.length;n++)t=t*32-t+e.charCodeAt(n),t%=2147483647;return Math.abs(t)}function um(e){let t=Ip(),n=Lp(e),o=()=>(n=(n*9301+49297)%233280,n/233280),r=t.map((a,i)=>i);for(let a=r.length-1;a>0;a--){let i=Math.floor(o()*(a+1));[r[a],r[i]]=[r[i],r[a]];}return r.slice(0,vp).sort((a,i)=>a-i).map(a=>t[a])}var am=300,Tp=49,kp=6;function mm(e,t){if(am/t<=Tp+.5)return e;let n=Pr,o=Pr+am,r=kp*t+t/2;return e.filter(({cx:a,cy:i})=>Math.max(n-a,a-o,n-i,i-o)>=r)}var dm="Scan the QR code * Scan the QR code * Scan the QR code * Scan the QR code *",Ir=32,fm=3.5,Fp=Ir*ar,hm=246.5,dt=2*Math.PI*hm,ps=.36,im=hm+ps*Ir,fs=400;function Wn(e,t){return e===" "||/[il1|!']/.test(e)?t*.3:/[mwMW@%&]/.test(e)?t*.8:t*.6}function Np(e){let t=e.slice(0,fs).split(" ").map(n=>Pn(n,fs)).join(" ");return Array.from(t).slice(0,fs)}var Op="\u2026",pm=1;function gm(e,t,n,o=false){return o&&t===e.length-1?pm*n:Wn(e[t],n)}function gs(e,t,n=false){let o=0;for(let r=0;r<e.length;r++)o+=gm(e,r,t,n);return o}function hs(e,t,n,o=false){return gs(e,t,o)+n*Math.max(0,e.length-1)+Wn(" ",t)+2*n<=dt}var bm=e=>e.join("").split(" ").filter(Boolean),Dp=(e,t)=>Array.from(Array.from({length:t},()=>e.join(" ")).join(" "));function _m(e,t,n){if(hs(e,t,n))return {chars:e,fontSize:t,letterSpacing:n};let o=Math.min(n,0),r=Math.min(t,Fp),a=(h,p=false)=>{let b=gs(h,t,p)+Wn(" ",t),_=h.length+1,y=(dt-b)/_;if(y>=o)return {chars:h,fontSize:t,letterSpacing:y,cut:p};let w=(dt-o*_)/b*t;return w>=r?{chars:h,fontSize:w,letterSpacing:o,cut:p}:null},i=a(e);if(i)return i;let s=bm(e),l=ym(s);for(let h=s.length/l.length-1;h>=1;h--){let p=Dp(l,h);if(hs(p,r,o))return a(p)??{chars:p,fontSize:r,letterSpacing:o}}let c=dt-Wn(" ",r)-pm*r-2*o,u=0,m=0,f=0;for(let[h,p]of e.entries()){if(u+=Wn(p,r)+o,u>c)break;f=h+1,(f===e.length||e[f]===" ")&&(m=f);}let d=[...Bp(e.slice(0,m>0?m:f)),Op];return (hs(d,t,n,true)?{chars:d,fontSize:t,letterSpacing:n,cut:true}:null)??a(d,true)??{chars:d,fontSize:r,letterSpacing:o,cut:true}}function Bp(e){let t=e.length;for(;t>0&&/[\s.,;:!?*·•\-–—]/u.test(e[t-1]);)t--;return e.slice(0,t)}function ym(e){for(let t=1;t<e.length;t++)if(e.length%t===0&&e.every((n,o)=>n===e[o%t]))return e.slice(0,t);return e}function Gp(e,t,n){let o=bm(e);if(o.length===0)return {chars:[],fontSize:t,letterSpacing:n};let r=Array.from(ym(o).join(" ")),a=gs(r,t)+Wn(" ",t),i=a+(r.length+1)*n,s=Math.min(n,0),l=null;for(let c of new Set([Math.floor(dt/i),Math.ceil(dt/i)])){if(c<1)continue;let u=(dt-c*a)/(c*(r.length+1));if(u>=s&&(!l||Math.abs(u-n)<Math.abs(l.letterSpacing-n))){let m=Array.from({length:c},()=>r.join(""));l={chars:Array.from(m.join(" ")),fontSize:t,letterSpacing:u};}}return l??_m(r,t,n)}function xm(e,t){let{position:n,rotation:o}=t,r=Np(e),a=t.fill==="repeat"?Gp(r,t.fontSize,t.letterSpacing):_m(r,t.fontSize,t.letterSpacing),{fontSize:i,letterSpacing:s}=a,l=[],c=0;for(let[h,p]of a.chars.entries()){let b=gm(a.chars,h,i,a.cut);l.push({char:p,along:c+b/2}),c+=b+s;}let u=c-(l.length>0?s:0),m=n!=="bottom",f=m?im-ps*i:im+ps*i,d=u/dt*180,g=[];for(let{char:h,along:p}of l){if(h.trim()==="")continue;let b=p/dt*360,_=m?o-d+b:o+180+d-b,y=_*Math.PI/180;g.push({char:h,x:K(Mt+f*Math.sin(y)),y:K(Mt-f*Math.cos(y)),rotate:K(m?_:_-180)});}return {text:a.chars.join(""),letters:g,fontSize:i===t.fontSize?i:K(i),letterSpacing:s}}var qn=(e,t)=>typeof e=="number"&&Number.isFinite(e)?e:t,$m={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:(e,t,n)=>{let o=ye(t?.fgColor,"#000000"),r=ye(t?.bgColor,"#ffffff"),a=n?.pixelSize??9,i=K(a/2),s=mm(um(n?.url??""),a),l=qn(t?.fontSize,Ir),c=l>0?l:Ir,u=typeof t?.customText=="string"?t.customText:dm,m=xm(u,{fontSize:c,letterSpacing:qn(t?.fontLetterSpacing,fm),position:t?.textPosition==="bottom"?"bottom":"top",rotation:qn(t?.textRotation,0),fill:t?.textFill==="repeat"?"repeat":"none"}),f=t?.textColor||"#ffffff",d=t?.fontFamily||_o,g=t?.fontWeight??900,h=qn(t?.strokeWidth,0),p=t?.strokeColor||"#000000",b=[{radius:Mt,width:qn(t?.outerStrokeWidth,h),color:t?.outerStrokeColor||p},{radius:lm,width:qn(t?.innerStrokeWidth,h),color:t?.innerStrokeColor||p}].filter(_=>_.width>0);return $e("svg",{height:vr,id:"svgQrWrapper",style:{width:"100%",height:"100%"},viewBox:`0 0 ${vr} ${vr}`,width:vr,xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",children:[A("circle",{cx:Mt,cy:Mt,fill:r,r:sm}),A("g",{fill:o,children:s.map((_,y)=>A("circle",{cx:_.cx,cy:_.cy,r:i},y))}),A("path",{d:cm,fill:t?.outerCircleColor||o}),b.map((_,y)=>A("circle",{cx:Mt,cy:Mt,fill:"none",r:_.radius,stroke:_.color,strokeWidth:_.width},y)),A("g",{"aria-hidden":"true",children:m.letters.map((_,y)=>A("text",{fill:f,fontFamily:d,fontSize:m.fontSize,fontWeight:g,textAnchor:"middle",transform:`rotate(${_.rotate} ${_.x} ${_.y})`,x:_.x,y:_.y,children:_.char},y))}),A("g",{transform:`translate(${Pr} ${Pr})`,children:e})]})}};var Sm={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 wm=rt({id:"Halloween",name:"Halloween",description:"QR code with Halloween theme",spec:Sm,at:{x:38,y:10,scale:1}});var Cm={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 Rm=rt({id:"SquareBorder",name:"Square Border",description:"QR code with square decorative border",spec:Cm,at:{x:0,y:0,scale:300/316}});var Mm={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 Em=rt({id:"StandardBox",name:"Standard Box",description:"QR code with standard box",spec:Mm,at:{x:46,y:1,scale:1}});var Am={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 Pm=rt({id:"StrikedBox",name:"Striked Box",description:"QR code with striked box",spec:Am,at:{x:24,y:0,scale:1}});var Lr={default:tm,Arrow:em,StandardBox:Em,SquareBorder:Rm,StrikedBox:Pm,Halloween:wm,DotRing:$m},vm={FlamQR:"DotRing"},ko=e=>{if(Object.hasOwn(Lr,e))return Lr[e];let t=Object.hasOwn(vm,e)?vm[e]:void 0;return t?Lr[t]:void 0},h3=()=>Object.values(Lr),p3=()=>Object.keys(Lr);var bs=e=>Math.round(Math.min(Math.max(e,0),255)).toString(16).padStart(2,"0");function km(e){return `#${bs(e.r)}${bs(e.g)}${bs(e.b)}`}function Vn(e){let t=le(e);return !t||t.a>=1||t.a<=0?{color:e}:{color:km(t),opacity:K(t.a,3)}}function Fo(e,t){let n=Math.min(Math.max(e.a,0),1);return {r:e.r*n+t.r*(1-n),g:e.g*n+t.g*(1-n),b:e.b*n+t.b*(1-n),a:1}}var Fm={r:0,g:0,b:0,a:1};function Wp(e){return [...e].map(t=>({offset:Math.min(Math.max(t.offset/100,0),1),color:le(t.color)??Fm})).sort((t,n)=>t.offset-n.offset)}function _s(e,t){let n=e[0],o=e.at(-1);if(!(n&&o))return Fm;if(t<=n.offset)return n.color;if(t>=o.offset)return o.color;for(let r=0;r+1<e.length;r++){let a=e[r],i=e[r+1];if(t>=a.offset&&t<=i.offset){let s=i.offset-a.offset,l=s>0?(t-a.offset)/s:1,c=a.color.a+(i.color.a-a.color.a)*l,u=(m,f)=>{let d=m*a.color.a+(f*i.color.a-m*a.color.a)*l;return c>0?d/c:m+(f-m)*l};return {r:u(a.color.r,i.color.r),g:u(a.color.g,i.color.g),b:u(a.color.b,i.color.b),a:c}}}return o.color}var Im=4,Lm=720,qp=2;function Nm(e,t,n,o,r){let a=Wp(e);if(a.length===0)return {wedges:[]};let i=a[0].color.a,s=a.every(_=>Math.abs(_.color.a-i)<.002),l=[...new Set([0,...a.map(_=>_.offset),1])].sort((_,y)=>_-y),c=[];for(let _=0;_+1<l.length;_++){let y=l[_],w=l[_+1];if(w<=y)continue;let C=_s(a,y+1e-9),S=_s(a,w-1e-9),$=Math.max(Math.abs(C.r*C.a-S.r*S.a),Math.abs(C.g*C.a-S.g*S.a),Math.abs(C.b*C.a-S.b*S.a),Math.abs(C.a-S.a)*255),R=Math.ceil($/qp),M=Math.ceil((w-y)*360/Im),E=Math.max(1,R,M);for(let P=0;P<E;P++)c.push([y+(w-y)*P/E,y+(w-y)*(P+1)/E]);}let u=c;if(c.length>Lm){let _=Math.ceil(c.length/Lm);u=[];for(let y=0;y<c.length;y+=_){let w=c.slice(y,y+_);u.push([w[0][0],w.at(-1)[1]]);}}let m=t-90,f=r/Math.cos(2*Im/2*(Math.PI/180)),d=_=>{let y=_*Math.PI/180;return [x(n+f*Math.cos(y)),x(o+f*Math.sin(y))]},g=`${x(n)} ${x(o)}`,h=_=>K((_%360+360)%360,4),p=u.length-1,b=u.map(([_,y],w)=>{let C=_s(a,(_+y)/2),S=(y-_)*360,$=s&&w===0&&p>0?S:0,R=s&&w<p?S:0,M=m+_*360-$,E=m+y*360+R,[P,I]=d(M),[L,k]=d(E);return {d:`M${g}L${P} ${I}L${L} ${k}Z`,color:km(C),...s||C.a>=1?{}:{opacity:K(C.a,3)},from:h(M),sweep:K(E-M,4)}});return s&&i<1?{wedges:b,opacity:K(i,3)}:{wedges:b}}function Tm(e,t,n,o){return (Math.atan2(o-t,n-e)*180/Math.PI%360+360)%360}function Om(e,t,n){if(e>=n.x-1e-6&&e<=n.x+n.width+1e-6&&t>=n.y-1e-6&&t<=n.y+n.height+1e-6)return null;let r=[[n.x,n.y],[n.x+n.width,n.y],[n.x,n.y+n.height],[n.x+n.width,n.y+n.height]],a=Tm(e,t,n.x+n.width/2,n.y+n.height/2),i=0,s=0;for(let[l,c]of r){let u=Tm(e,t,l,c)-a;u>180?u-=360:u<=-180&&(u+=360),i=Math.min(i,u),s=Math.max(s,u);}return [a+i,a+s]}function Dm(e,t){let n=e[1]-e[0],o=t[1]-t[0];if(n>=360||o>=360)return true;let r=((t[0]-e[0])%360+360)%360;return r<=n||r+o>=360}function xs(e,t){return e.slice().map((n,o)=>o<t.y||o>=t.y+t.h?n:n.map((r,a)=>a<t.x||a>=t.x+t.w?r:false))}function Qm(e,t=0){let n=[];return e.forEach((o,r)=>{let a=null;o.forEach((i,s)=>{if(!i&&a!==null){n.push(v`M${a+t} ${r+t}h${s-a}v1H${a+t}z`),a=null;return}if(s===o.length-1){if(!i)return;a===null?n.push(v`M${s+t},${r+t} h1v1H${s+t}z`):n.push(v`M${a+t},${r+t} h${s+1-a}v1H${a+t}z`);return}i&&a===null&&(a=s);});}),n.join("")}function Vp(e,t,n){return e<7&&t<7||e>=n-7&&t<7||e<7&&t>=n-7}var jp=.9;function ys(e,t){let{margin:n,pixelSize:o,pattern:r="circle",plain:a=false}=t;if(Iu(r))return Tu(e,{margin:n,pixelSize:o,pattern:r,scale:t.scale,plain:a});let i=Mo(t.scale,r),s=[],l=e.length,c=o*.45,u=a?()=>false:Xi(l);return e.forEach((m,f)=>{m.forEach((d,g)=>{if(d&&(a||!Vp(g,f,l))){let h=(g+.5+n)*o,p=(f+.5+n)*o,b=`${g}-${f}`,_=s.length;if(u(g,f)){s.push(A("rect",{height:x(o),width:x(o),x:x(h-o/2),y:x(p-o/2)},b));return}switch(r){case "circle":s.push(A("circle",{cx:x(h),cy:x(p),r:x(c),transform:v`rotate(0,${h},${p})`},b));break;case "circle-large":{let y=o*.5;s.push(A("circle",{cx:x(h),cy:x(p),r:x(y),transform:v`rotate(0,${h},${p})`},b));}break;case "small-square":{let y=o*.357143;s.push(A("path",{d:v`M ${h-y} ${p-y}v ${o*.714286}h ${o*.714286}v -${o*.714286}z`,transform:v`rotate(0,${h},${p})`},b));}break;case "diamond":{let y=o*.357143;s.push(A("path",{d:v`M ${h-y} ${p-y}v ${o*.714286}h ${o*.714286}v -${o*.714286}z`,transform:v`rotate(45,${h},${p})`},b));}break;case "circle-mixed":{let y=(g+f)%3===0?jp:(g+f)%2===0?1:1.25,w=c*y;s.push(A("circle",{cx:x(h),cy:x(p),r:x(w),transform:v`rotate(0,${h},${p})`},b));}break;case "pacman":{let y=o*.5,w=o*.357143;s.push(A("path",{d:v`M ${h-y} ${p-w}v ${o*.714286}h ${y}a ${y*.5} ${y*.5}, 0, 0, 0, 0 -${o*.714286}h -${y}v -${o*.714286}z`,transform:v`rotate(${(g+f)%2===0?0:90},${h},${p})`},b));}break;case "rounded":{let y=o*.5,w=o*.2;s.push(A("rect",{height:x(o),rx:x(w),ry:x(w),transform:v`rotate(0,${h},${p})`,width:x(o),x:x(h-y),y:x(p-y)},b));}break;case "square":{let y=o*.5;s.push(A("rect",{height:x(o),transform:v`rotate(0,${h},${p})`,width:x(o),x:x(h-y),y:x(p-y)},b));}break;case "vertical-line":{let y=o*.714286,w=o;s.push(A("path",{d:v`M ${h-o*.5} ${p-y*.5}v ${y}h ${w}v -${y}z`,transform:v`rotate(90,${h},${p})`},b));}break;default:s.push(A("circle",{cx:x(h),cy:x(p),r:x(c),transform:v`rotate(0,${h},${p})`},b));}if(i!==1&&s.length>_){let y=s.pop();s.push(A("g",{transform:v`translate(${h},${p}) scale(${x(i,6)}) translate(${-h},${-p})`,children:y},b));}}});}),s}function Xp(e,t){let n=e*Math.PI/180,o=t/2,r=t/2,a=Math.sqrt(t*t+t*t)/2,i=o-a*Math.cos(n),s=r-a*Math.sin(n),l=o+a*Math.cos(n),c=r+a*Math.sin(n);return {x1:i,y1:s,x2:l,y2:c}}function $s(e,t){return `${e}-${Vt(JSON.stringify(t))}`}function Yp(e,t,n,o,r){let a=e;if(e===0)switch(r){case "top-left":a=0;break;case "top-right":a=90;break;case "bottom-left":a=270;break;default:a=0;}let i=a*Math.PI/180,s=t+o/2,l=n+o/2,c=Math.sqrt(o*o+o*o)/2,u=s-c*Math.cos(i),m=l-c*Math.sin(i),f=s+c*Math.cos(i),d=l+c*Math.sin(i);return {x1:u,y1:m,x2:f,y2:d}}function Do(e,t){return t.map((n,o)=>{let{color:r,opacity:a}=Vn(n.color);return A("stop",{offset:`${n.offset}%`,stopColor:r,stopOpacity:a},`${e}-stop-${o}`)})}function Um(e,t,n,o,r,a){let i=Nm(t.stops,t.angle??0,n,o,r),s=i.wedges.map((l,c)=>A("path",{d:l.d,"data-arc":`${l.from} ${l.sweep}`,fill:l.color,fillOpacity:l.opacity,shapeRendering:l.opacity===void 0?void 0:"crispEdges"},`${e}-w-${c}`));return A("pattern",{"data-qrdx-conic":`${x(n)} ${x(o)}`,height:x(a),id:e,patternUnits:"userSpaceOnUse",width:x(a),x:0,y:0,children:i.opacity===void 0?s:A("g",{opacity:i.opacity,children:s})},e)}function Zp(e="center"){let[t,n]=e.split("-"),o=e==="center"?"center":t,r=n??(t==="left"||t==="right"?t:"center");return {x:r==="left"?0:r==="right"?1:.5,y:o==="top"?0:o==="bottom"?1:.5}}var Kp=["xMin","xMid","xMax"],Jp=["YMin","YMid","YMax"];function Hm(e,t,n){let o=t.scale??1,r=t.fit==="tile",a=r?n/4*o:n,i=t.underlay?Vn(t.underlay):null,s=r?a:n*o,l=Zp(t.position),c=r?0:l.x*(n-s),u=r?0:l.y*(n-s),m=r?"xMidYMid slice":`${Kp[l.x*2]??"xMid"}${Jp[l.y*2]??"YMid"} ${t.fit==="contain"?"meet":"slice"}`;return $e("pattern",{height:x(a),id:e,patternUnits:"userSpaceOnUse",width:x(a),x:0,y:0,children:[i&&A("rect",{fill:i.color,fillOpacity:i.opacity,height:x(a),width:x(a),x:0,y:0}),A("image",{height:x(s),href:t.src,opacity:(t.opacity??1)<1?t.opacity:void 0,preserveAspectRatio:m,width:x(s),x:x(c),y:x(u)})]},e)}var zm=(e,t)=>$s("img",[e,t]);function eg(e,t,n,o,r,a,i){let s=Le(e);if(s.type==="solid")return null;if(s.type==="image"){let c=zm(s,i);return {id:c,element:Hm(c,s,i)}}let l=$s(a,[s,t,n,o,r,...s.type==="angular"?[i]:[]]);if(s.type==="linear"){let c=s,u=c.angle??0,{x1:m,y1:f,x2:d,y2:g}=Yp(u,t,n,o,r);return {id:l,element:A("linearGradient",{gradientUnits:"userSpaceOnUse",id:l,x1:x(m),x2:x(d),y1:x(f),y2:x(g),children:Do(l,c.stops)},l)}}if(s.type==="radial"){let c=s,u=t+o/2,m=n+o/2,f=o/2*.97;return {id:l,element:A("radialGradient",{cx:x(u),cy:x(m),fx:x(u),fy:x(m),gradientUnits:"userSpaceOnUse",id:l,r:x(f),children:Do(l,c.stops)},l)}}return s.type==="angular"?{id:l,element:Um(l,s,t+o/2,n+o/2,o*.75,i)}:null}function No(e,t,n){let o=Le(e);if(o.type==="solid")return null;if(o.type==="image"){let a=zm(o,t);return {id:a,element:Hm(a,o,t)}}let r=$s(n,[o,t]);if(o.type==="linear"){let a=o,i=a.angle??0,{x1:s,y1:l,x2:c,y2:u}=Xp(i,t);return {id:r,element:A("linearGradient",{gradientUnits:"userSpaceOnUse",id:r,x1:x(s),x2:x(c),y1:x(l),y2:x(u),children:Do(r,a.stops)},r)}}if(o.type==="radial"){let a=o,i=t/2,s=t/2,l=t/2*.97;return {id:r,element:A("radialGradient",{cx:x(i),cy:x(s),fx:x(i),fy:x(s),gradientUnits:"userSpaceOnUse",id:r,r:x(l),children:Do(r,a.stops)},r)}}return o.type==="angular"?{id:r,element:Um(r,o,t/2,t/2,t*.75,t)}:null}var Oo=e=>Kt(e)||Fi(e);function Bm(e){let t=new Set,n=[];for(let o of e)o&&!t.has(o.id)&&(t.add(o.id),n.push(o.element));return n}function ft(e,t,n){if(t)return {fill:`url(#${t})`};let o=Le(e,n),r=o.type==="solid"?o.color:o.type==="image"?o.underlay??n:n,{color:a,opacity:i}=Vn(r);return i===void 0?{fill:a}:{fill:a,fillOpacity:i}}function Et(e,t,n,o){if(o==null)return null;let r=e.length,a=Math.floor(t*Xr),i=(r+2*n)/t,s=(o.width||a)*i,l=(o.height||a)*i,c=o.x==null?r/2-s/2:o.x*i,u=o.y==null?r/2-l/2:o.y*i,m=null;if(o.excavate){let f=Math.max(0,o.padding??0)*i,d=Math.floor(c-f),g=Math.floor(u-f),h=Math.ceil(s+c+f-d),p=Math.ceil(l+u+f-g);m={x:d,y:g,w:h,h:p};}return {x:c,y:u,h:l,w:s,excavation:m}}function Ae(e){let t=e.level??Ke,{imageSettings:n}=e,o=e.isOGContext&&n?.excavate&&(t==="L"||t==="M")?"Q":t;if(e.autoLevel&&n&&o!=="H"){let r=Ee(e.value,o,e.exactLevel).getModules(),a=Et(r,e.size??ce,Me(r.length,e.margin??pe,e.shape),n);a&&(a.excavation?a.excavation.w*a.excavation.h:a.w*a.h)/(r.length*r.length)>Ua&&(o="H");}return o}function tg(e,t,n,o){let r=t/n,a=e.w*r,i=e.h*r,s=(e.x+o)*r,l=(e.y+o)*r;return {imgWidth:a,imgHeight:i,imgLeft:s,imgTop:l}}function Tr(e){let{value:t,size:n=ce,level:o=Ke,bgColor:r=fe,fgColor:a=Re,eyeColor:i,dotColor:s,bodyPattern:l="circle",cornerEyePattern:c="gear",cornerEyeDotPattern:u="circle",margin:m=pe,isOGContext:f=false,imageSettings:d,templateId:g,customTemplate:h,customProps:p,frame:b,art:_,eyeColors:y,moduleScale:w,autoLevel:C,exactLevel:S,shape:$,eyeShapes:R,eyeGradient:M,bgRadius:E,backdrop:P,halo:I,shadow:L,frameLabelMarkers:k,partMarkers:F,...T}=e,H=Qe(or,l),G=Qe(Dt,c),z=Qe(Bt,u),O=zn({value:t,size:n,margin:m,level:o,shape:$,autoLevel:C,exactLevel:S,isOGContext:f},d),Y=Fe(b),be=Y?{}:T,de=U=>Y?xr(U,{size:n,frame:b,bgColor:r,svgProps:T,markLabels:k}):U,N=Ae({value:t,size:n,level:o,margin:m,imageSettings:O,isOGContext:f,autoLevel:C,exactLevel:S,shape:$}),Q=Ee(t,N,S),re=Q.getModules(),ie=Me(re.length,m,$),Tt=Zc(t,re.length,m,$),oe=(U,ve)=>ms(F,U,ve),ot=Hn(E,re.length,ie,$),kt=(U,ve)=>{let Ze=ki($,U);if(!Ze){if(ot>0){let at=x(ot*U),qe=P?Vn(P):null;return $e(Be,{children:[qe&&A("rect",{"data-qrdx-look":"backdrop",fill:qe.color,fillOpacity:qe.opacity,height:U,width:U,x:0,y:0}),A("rect",{...ve,height:U,rx:at,ry:at,width:U,x:0,y:0,...oe("background")})]})}return A("rect",{...ve,height:U,width:U,x:0,y:0,...oe("background")})}return "circle"in Ze?A("circle",{cx:x(U/2),cy:x(U/2),...ve,r:x(U/2),...oe("background")}):A("path",{d:Ze.path,...ve,...oe("background")})},B=re.length+ie*2,te=Et(re,n,ie,O),V=null;if(O!=null&&te!=null){te.excavation!=null&&(re=xs(re,te.excavation));let{imgWidth:U,imgHeight:ve,imgLeft:Ze,imgTop:at}=tg(te,n,B,ie);if(f){let qe=O.shape??"square";V=A("img",{alt:"Logo",src:O.src,style:{position:"absolute",left:`${x(Ze)}px`,top:`${x(at)}px`,width:`${x(U)}px`,height:`${x(ve)}px`,...qe!=="square"&&{borderRadius:qe==="circle"?"50%":`${x(Math.min(U,ve)*yo)}px`},...O.plate&&{backgroundColor:O.plate,padding:`${x(U*xo)}px`,boxSizing:"border-box"}}});}else V=$o(O,{x:Ze,y:at,w:U,h:ve}),F&&(V=Nt(V,oe("logo")));}let q=n/B,tr=re.length,ge=7*q,ga=1.5*q,Cl={fgColor:ye(a,Re),bgColor:ye(r,fe)},cn=Qi(_)?Wi({art:_,modules:re,version:Q.version,margin:ie,pixelSize:q,...Cl,body:U=>ys(U,{margin:ie,pixelSize:q,pattern:H,scale:w})}):null,Rl=cn&&F?Nt(cn,oe("body")):cn,Ml=cn&&_?ji({art:_,version:Q.version,...Cl}):null,El=cn?null:ys(re,{margin:ie,pixelSize:q,pattern:H,scale:w}),Wr=Tt?ys(Tt,{margin:0,pixelSize:q,pattern:H,scale:w,plain:true}):null,qr=Le(r,fe),ba=Le(a,Re),Al=Oo(qr)?No(qr,n,"bg-color"):null,_a=Oo(ba)?No(ba,n,"fg-color"):null,Id=ft(r,Al?.id??null,fe),Pl=ft(a,_a?.id??null,Re),vl=Rl?$e(Be,{children:[Rl,Wr&&A("g",{...Pl,...oe("body"),children:Wr})]}):$e("g",{...Pl,...oe("body"),children:[El,Wr]}),un=ie*q,mn=ie*q,dn=(tr-7+ie)*q,fn=ie*q,hn=ie*q,pn=(tr-7+ie)*q,Ft=ye(a,Re),gn=U=>y?.[U]?.outer??Ml?.[U]?.outer??i,bn=U=>y?.[U]?.inner??Ml?.[U]?.inner??s,_n=(U,ve,Ze,at,qe)=>{let xn=Le(U,Ft);if(!Oo(xn))return null;if(M==="code"&&Kt(xn)){let ka=JSON.stringify(xn)===JSON.stringify(ba);return No(xn,n,ka?"fg-color":qe)}return eg(xn,ve,Ze,ge,at,qe,n)},ya=_n(gn("topLeft"),un,mn,"top-left","corners-square-color-0-0"),xa=_n(gn("topRight"),dn,fn,"top-right","corners-square-color-1-0"),$a=_n(gn("bottomLeft"),hn,pn,"bottom-left","corners-square-color-0-1"),Sa=_n(bn("topLeft"),un,mn,"top-left","corners-dot-color-0-0"),wa=_n(bn("topRight"),dn,fn,"top-right","corners-dot-color-1-0"),Ca=_n(bn("bottomLeft"),hn,pn,"bottom-left","corners-dot-color-0-1"),Il=ft(gn("topLeft"),ya?.id??null,Ft),Ll=ft(gn("topRight"),xa?.id??null,Ft),Tl=ft(gn("bottomLeft"),$a?.id??null,Ft),kl=ft(bn("topLeft"),Sa?.id??null,Ft),Fl=ft(bn("topRight"),wa?.id??null,Ft),Nl=ft(bn("bottomLeft"),Ca?.id??null,Ft),yn={cornerEyePattern:G,cornerEyeDotPattern:z,eyeShapes:R},Ra=Ao(un,mn,ge,nt(yn,"topLeft").outer,"top-left"),Ma=Eo(un+ge/2,mn+ge/2,ga,nt(yn,"topLeft").inner,"top-left"),Ea=Ao(dn,fn,ge,nt(yn,"topRight").outer,"top-right"),Aa=Eo(dn+ge/2,fn+ge/2,ga,nt(yn,"topRight").inner,"top-right"),Pa=Ao(hn,pn,ge,nt(yn,"bottomLeft").outer,"bottom-left"),va=Eo(hn+ge/2,pn+ge/2,ga,nt(yn,"bottomLeft").inner,"bottom-left"),Ia=Er(I,{bgColor:r}),nr=cs(L),Ol=U=>$e(Be,{children:[cn?null:El,Wr,A("path",{d:Ra,fillRule:U}),Ma,A("path",{d:Ea,fillRule:U}),Aa,A("path",{d:Pa,fillRule:U}),va]}),La=null;if(Ia){let{color:U}=Ia;La=A("g",{"data-qrdx-look":"halo",fill:U,stroke:U,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:x(2*Ia.width*q),children:Ol("nonzero")});}let Ta=null;if(nr){let{color:U}=Vn(nr.color);Ta=A("g",{"data-qrdx-look":"shadow",fill:U,opacity:x(nr.opacity),transform:v`translate(${nr.dx*q},${nr.dy*q})`,children:Ol("evenodd")});}let Ld=$e(Be,{children:[A("defs",{children:Bm([Al,_a,ya,xa,$a,Sa,wa,Ca])}),kt(n,Id),La,Ta,vl,A("g",{...Il,...oe("eye-outer","top-left"),children:A("path",{d:Ra,fillRule:"evenodd",transform:v`rotate(0,${un+ge/2},${mn+ge/2})`})}),A("g",{...kl,...oe("eye-centre","top-left"),children:Ma}),A("g",{...Ll,...oe("eye-outer","top-right"),children:A("path",{d:Ea,fillRule:"evenodd",transform:v`rotate(0,${dn+ge/2},${fn+ge/2})`})}),A("g",{...Fl,...oe("eye-centre","top-right"),children:Aa}),A("g",{...Tl,...oe("eye-outer","bottom-left"),children:A("path",{d:Pa,fillRule:"evenodd",transform:v`rotate(0,${hn+ge/2},${pn+ge/2})`})}),A("g",{...Nl,...oe("eye-centre","bottom-left"),children:va}),V]}),Dl=h||(g?ko(g):void 0);if(Dl){let ve=Oo(qr)?No(qr,300,"bg-color-template"):null,Ze=ft(r,ve?.id??null,fe),at=$e("svg",{height:300,viewBox:"0 0 300 300",width:300,xmlns:"http://www.w3.org/2000/svg",children:[A("defs",{children:Bm([ve,_a,ya,xa,$a,Sa,wa,Ca])}),kt(300,Ze),$e("g",{transform:`scale(${x(300/n,6)})`,children:[La,Ta,vl,A("g",{...Il,...oe("eye-outer","top-left"),children:A("path",{d:Ra,fillRule:"evenodd",transform:v`rotate(0,${un+ge/2},${mn+ge/2})`})}),A("g",{...kl,...oe("eye-centre","top-left"),children:Ma}),A("g",{...Ll,...oe("eye-outer","top-right"),children:A("path",{d:Ea,fillRule:"evenodd",transform:v`rotate(0,${dn+ge/2},${fn+ge/2})`})}),A("g",{...Fl,...oe("eye-centre","top-right"),children:Aa}),A("g",{...Tl,...oe("eye-outer","bottom-left"),children:A("path",{d:Pa,fillRule:"evenodd",transform:v`rotate(0,${hn+ge/2},${pn+ge/2})`})}),A("g",{...Nl,...oe("eye-centre","bottom-left"),children:va}),V]})]}),qe=300/n,ka={pixelSize:q*qe,url:t},Bl=Dl.wrapper(at,{fgColor:a,bgColor:r,...p||{},...T},ka),Td={...Bl?.props?.style||{},width:void 0,height:void 0,...be.style};return de(Nt(Bl,{...be,width:n,height:n,style:Td}))}return de(A("svg",{height:n,viewBox:`0 0 ${n} ${n}`,width:n,xmlns:"http://www.w3.org/2000/svg",...be,children:Ld}))}var U3=(()=>{try{new Path2D().addPath(new Path2D);}catch{return false}return true})(),H3=e=>{let t=e.trim().replace(/^#/,"");t.length===3||t.length===4?t=t.slice(0,3).split("").map(o=>o+o).join(""):t.length===8&&(t=t.slice(0,6));let n=/^([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return n?{r:Number.parseInt(n[1],16),g:Number.parseInt(n[2],16),b:Number.parseInt(n[3],16)}:null},jn=(e,t,n)=>{let[o,r,a]=[e,t,n].map(i=>(i/=255,i<=.03928?i/12.92:((i+.055)/1.055)**2.4));return .2126*o+.7152*r+.0722*a},Gm=e=>{let t=le(e);if(!t)return null;let n=o=>o*t.a+255*(1-t.a);return {r:n(t.r),g:n(t.g),b:n(t.b)}},z3=(e,t)=>{let n=Gm(e),o=Gm(t);if(!(n&&o))return 1;let r=jn(n.r,n.g,n.b),a=jn(o.r,o.g,o.b),i=Math.max(r,a),s=Math.min(r,a);return (i+.05)/(s+.05)},W3=e=>e>=7?{level:"AAA",warning:false,message:"Excellent contrast"}:e>=4.5?{level:"AA",warning:false,message:"Good contrast"}:e>=3?{level:"AA Large",warning:true,message:"Low contrast - may be difficult to scan"}:{level:"Fail",warning:true,message:"Poor contrast - QR code may not scan properly"};var Wm=.6,ng=["L","M","Q","H"];function qm(e){let t=Ee(e.value,e.level,e.exactLevel),n=ng[t.errorCorrectionLevel.ordinal]??e.level;return {code:e,cells:t.getModules(),layoutMargin:Me(t.size,e.margin,e.shape),map:$r(t.version,n),level:n,version:t.version}}function Vm(e,t){let{cells:n,map:o}=e,r=n.length,a=Et(n,e.code.size,e.layoutMargin,t);if(!a)return null;let i=a.excavation??{x:Math.floor(a.x),y:Math.floor(a.y),w:Math.ceil(a.x+a.w)-Math.floor(a.x),h:Math.ceil(a.y+a.h)-Math.floor(a.y)},s=[];for(let c=Math.max(0,i.y);c<Math.min(r,i.y+i.h);c++)for(let u=Math.max(0,i.x);u<Math.min(r,i.x+i.w);u++)s.push(c*r+u);let l=Sr(o,s);return {worst:Math.max(0,...l),correctable:o.correctable,budget:Math.floor(o.correctable*Wm),level:e.level,version:e.version}}function Bo(e,t){return Vm(qm(e),t)}var jm=e=>!e||e.worst<=e.budget;function rg(e,t){return jm(Bo(e,t))}function Ss(e,t,n,o){let r=t.map(s=>qm({...e,level:s})),a=s=>{let l=o(s);return r.every(c=>jm(Vm(c,l)))};if(a(n))return n;let i=e.size*.005;for(let s=n-i;s>0;s-=i)if(a(s))return s;return 0}function zn(e,t){if(!t)return;let n=Math.floor(e.size*Xr),o=t.width||n,r=t.height||n,a=f=>{if(f===o)return t;let d=r*f/o;return {...t,width:f,height:d,...t.x!=null&&{x:t.x+(o-f)/2},...t.y!=null&&{y:t.y+(r-d)/2}}},i=e.level??Ke,s={value:e.value,size:e.size,margin:e.margin,shape:e.shape,exactLevel:e.exactLevel},l=f=>Ae({...e,level:i,imageSettings:f}),c=f=>{let d=Ss(s,[f],o,a);return d>0?a(d):void 0},u=l(t);if(u===i)return c(i);let m=c(u);return m&&l(m)===u?m:c(i)}async function ws(e){let{value:t,size:n=ce,level:o=Ke,bgColor:r=fe,fgColor:a=Re,margin:i=pe,imageSettings:s,eyeColor:l,dotColor:c,bodyPattern:u,cornerEyePattern:m,cornerEyeDotPattern:f,isOGContext:d,templateId:g,customTemplate:h,customProps:p,frame:b,art:_,eyeColors:y,moduleScale:w,eyeShapes:C,eyeGradient:S,bgRadius:$,backdrop:R,halo:M,shadow:E,frameLabelMarkers:P,partMarkers:I,autoLevel:L,exactLevel:k,...F}=e,T=zn({value:t,size:n,margin:i,level:o,autoLevel:L,exactLevel:k},s),H=Ae({value:t,size:n,level:o,margin:i,imageSettings:T,autoLevel:L,exactLevel:k}),G=Ee(t,H,k).getModules(),z=G.length+i*2,O=Et(G,n,i,T),Y=null;if(T!=null&&O!=null){O.excavation!=null&&(G=xs(G,O.excavation));let de=T.src.startsWith("data:")?T.src:await fetch(`https://wsrv.nl/?url=${encodeURIComponent(T.src)}&w=100&h=100&encoding=base64`).then(N=>{if(!N.ok)throw new Error(`Failed to load QR logo (${N.status}): ${T.src}`);return N.text()});Y={settings:{...T,src:de},box:{x:O.x+i,y:O.y+i,w:O.w,h:O.h}};}let be=Qm(G,i);return {size:n,numCells:z,fgPath:be,bgColor:r,fgColor:a,frame:b,svgProps:F,logo:Y}}function Cs(e){let{size:t,numCells:n,fgPath:o,bgColor:r,fgColor:a,frame:i,svgProps:s,logo:l}=e,c=Fe(i),u=l?$o(l.settings,l.box):A(Be,{}),m=$e("svg",{height:t,viewBox:`0 0 ${n} ${n}`,width:t,xmlns:"http://www.w3.org/2000/svg",...c?{}:s,children:[A("path",{d:`M0,0 h${n}v${n}H0z`,fill:ye(r,fe),shapeRendering:"crispEdges"}),A("path",{d:o,fill:ye(a,Re),shapeRendering:"crispEdges"}),u]});return c&&i?xr(m,{size:t,frame:i,bgColor:r,svgProps:s}):m}async function og(e){return Cs(await ws(e))}var Go=react.createElement;function Rs(e,t){let{children:n,...o}=e??{};return t===void 0?o:{...o,key:t}}var Xm=(e,t,n)=>t&&"children"in t?Go(e,Rs(t,n),t.children):Go(e,Rs(t,n)),lg=(e,t,n)=>{let o=t?.children;return Array.isArray(o)?Go(e,Rs(t,n),...o):Xm(e,t,n)},Xn={jsx:Xm,jsxs:lg,createElement:Go,cloneElement:react.cloneElement,Fragment:react.Fragment};async function hx(e){let t=await ws(e);return $n(Xn,()=>Cs(t))}var cg=16384;var Ym=e=>e*3+3&-4,Ms=(e,t)=>Math.floor((e*t+255*(255-t)+127)/255);function Es(e,t,n){if(!(Number.isInteger(t)&&Number.isInteger(n))||t<1||n<1||t>16384||n>16384)throw new RangeError(`BMP width and height must be whole numbers from 1 to 16384, got ${t} x ${n}`);if(e.length!==t*n*4)throw new RangeError(`Expected ${t*n*4} RGBA bytes for ${t} x ${n}, got ${e.length}`);let o=Ym(t),r=o*n,a=new Uint8Array(54+r),i=new DataView(a.buffer);a[0]=66,a[1]=77,i.setUint32(2,a.length,true),i.setUint32(10,54,true),i.setUint32(14,40,true),i.setInt32(18,t,true),i.setInt32(22,n,true),i.setUint16(26,1,true),i.setUint16(28,24,true),i.setUint32(30,0,true),i.setUint32(34,r,true),i.setInt32(38,2835,true),i.setInt32(42,2835,true);for(let s=0;s<n;s++){let l=s*t*4,c=54+(n-1-s)*o;for(let u=0;u<t;u++){let m=e[l+3],f=e[l],d=e[l+1],g=e[l+2];m===255?(a[c]=g,a[c+1]=d,a[c+2]=f):(a[c]=Ms(g,m),a[c+1]=Ms(d,m),a[c+2]=Ms(f,m)),l+=4,c+=3;}}return a}function As(e){if(e.length<54||e[0]!==66||e[1]!==77)return false;let t=new DataView(e.buffer,e.byteOffset,e.byteLength),n=t.getInt32(18,true),o=t.getInt32(22,true);return t.getUint32(2,true)===e.length&&t.getUint32(10,true)===54&&t.getUint32(14,true)===40&&n>0&&o>0&&t.getUint16(26,true)===1&&t.getUint16(28,true)===24&&t.getUint32(30,true)===0&&e.length===54+Ym(n)*o}function Qo(e){let t=e.getContext("2d");if(!t)throw new Error("Could not get canvas context");let{data:n}=t.getImageData(0,0,e.width,e.height),o=Es(n,e.width,e.height);if(!As(o))throw new Error("Could not write a BMP file");return new Blob([o],{type:"image/bmp"})}var Mx=(e,t,n,o)=>{let r=document.createElement("canvas");r.width=t,r.height=n;let a=r.getContext("2d");if(!a)return;a.putImageData(e,0,0);let i=r.toDataURL("image/png"),s=document.createElement("a");s.href=i,s.download=o,document.body.appendChild(s),s.click(),document.body.removeChild(s);},ug=async(e,t,n,o)=>{let{default:r}=await import('jsqr');return new Promise(a=>{e.complete?i():(e.onload=()=>i(),e.onerror=()=>a(null));function i(){let s=document.createElement("canvas");requestAnimationFrame(()=>{if(!(e.naturalWidth&&e.naturalHeight)){a(null);return}let l=e.naturalWidth/e.naturalHeight<=.33||e.naturalWidth/e.naturalHeight>=3?Math.sqrt(e.naturalWidth*e.naturalHeight/12e5):e.naturalWidth/e.naturalHeight<=.5||e.naturalWidth/e.naturalHeight>=2?Math.sqrt(e.naturalWidth*e.naturalHeight/9e5):Math.sqrt(e.naturalWidth*e.naturalHeight/64e4),c=s.getContext("2d",{willReadFrequently:true});if(!c){a(null);return}let u=[1,.8,.6,.4,.2,.1];for(let m of u){let f=Math.floor(e.naturalWidth*t*m/l),d=Math.floor(e.naturalHeight*t*m/l);s.width=f,s.height=d,c.clearRect(0,0,f,d),c.imageSmoothingEnabled=true,c.imageSmoothingQuality="high";try{c.drawImage(e,Math.floor(n),Math.floor(o),Math.floor(e.naturalWidth*t),Math.floor(e.naturalHeight*t),0,0,f,d);let g=c.getImageData(0,0,f,d);try{let h=r(g.data,f,d);if(h?.data){a(h);return}}catch(h){console.error("QR Detection error:",h);}}catch(g){console.error("Canvas drawing error:",g);}}a(null);});}})},Zm=async(e,t,n=false)=>{if(!e)return "NO_QR";await new Promise(r=>setTimeout(r,100));let o=[{dx:0,dy:0,ratio:1},{dx:0,dy:e.naturalHeight*.35,ratio:.65},{dx:e.naturalWidth*.35,dy:e.naturalHeight*.35,ratio:.65},{dx:e.naturalWidth*.35,dy:0,ratio:.65},{dx:e.naturalWidth*.35/2,dy:e.naturalHeight*.35/2,ratio:.65}];for(let r of o)try{let a=await ug(e,r.ratio,r.dx,r.dy);if(a?.data)return n?a:a.data}catch(a){console.warn("QR decode error:",a);}return "NO_QR"};function Ex(e,t,n){if(!(e&&t)||t.length!==4)return;let o=document.createElement("canvas");o.width=e.naturalWidth,o.height=e.naturalHeight;let r=o.getContext("2d");if(!r)return;r.drawImage(e,0,0),r.save(),r.strokeStyle="#ff0000",r.lineWidth=Math.max(5,Math.min(e.naturalWidth,e.naturalHeight)/200),r.shadowColor="transparent",r.shadowBlur=0,r.beginPath(),r.moveTo(t[0].x,t[0].y),r.lineTo(t[1].x,t[1].y),r.lineTo(t[3].x,t[3].y),r.lineTo(t[2].x,t[2].y),r.closePath(),r.stroke(),r.fillStyle="#ff0000",t.forEach((s,l)=>{r.fillRect(s.x-3,s.y-3,6,6),r.fillStyle="#ffffff",r.font="16px Arial",r.fillText(`${l}`,s.x+5,s.y-5),r.fillStyle="#ff0000";}),r.restore();let a=o.toDataURL("image/png"),i=document.createElement("a");i.href=a,i.download=n,document.body.appendChild(i),i.click(),document.body.removeChild(i);}var mg=256,dg=16384,fg=128;var Jm=(e,t)=>{if(!(Number.isInteger(e)&&Number.isInteger(t))||e<1||t<1||e>16384||t>16384)throw new RangeError(`GIF width and height must be whole numbers from 1 to 16384, got ${e} x ${t}`)},Ps=(e,t)=>e>>6*(2-t)&63;function e0(e,t,n){Jm(t,n);let o=t*n;if(e.length!==o*4)throw new RangeError(`Expected ${o*4} RGBA bytes for ${t} x ${n}, got ${e.length}`);let r=new Map,a=false,i=false,s=false;for(let b=0;b<o;b++){let _=b*4,y=e[_+3];if(y<128){a=true,i||=y>0;continue}if(i||=y<255,!s){let w=e[_]<<16|e[_+1]<<8|e[_+2];r.has(w)||(r.set(w,r.size),s=r.size>256);}}let l=a?255:256,c=!s&&r.size<=l,u=new Uint8Array(o),m,f,d;if(c){f=[];for(let b of r.keys())f.push(b>>16&255,b>>8&255,b&255);m=r.size,d=(b,_,y)=>r.get(b<<16|_<<8|y);}else {let b=hg(e,o,l);f=b.palette,m=b.palette.length/3,d=(_,y,w)=>b.bucketIndex[t0(_,y,w)];}let g=a?m:null;for(let b=0;b<o;b++){let _=b*4;e[_+3]<128?u[b]=g:u[b]=d(e[_],e[_+1],e[_+2]);}let h=m+(a?1:0),p=new Uint8Array(h*3);return p.set(f),a&&p.fill(255,m*3),{width:t,height:n,palette:p,indices:u,transparentIndex:g,colors:h,lossless:c&&!i}}var t0=(e,t,n)=>e>>2<<12|t>>2<<6|n>>2;function hg(e,t,n){let o=new Uint32Array(262144),r=new Float64Array(262144),a=new Float64Array(262144),i=new Float64Array(262144);for(let f=0;f<t;f++){let d=f*4;if(e[d+3]<128)continue;let g=e[d],h=e[d+1],p=e[d+2],b=t0(g,h,p);o[b]=o[b]+1,r[b]=r[b]+g,a[b]=a[b]+h,i[b]=i[b]+p;}let s=[];for(let f=0;f<262144;f++)o[f]>0&&s.push(f);let l=[{keys:s,pixels:s.reduce((f,d)=>f+o[d],0)}];for(;l.length<n;){let f=-1;for(let $=0;$<l.length;$++){let R=l[$];R.keys.length>1&&(f===-1||R.pixels>l[f].pixels)&&(f=$);}if(f===-1)break;let d=l[f],g=0,h=-1;for(let $ of [0,1,2]){let R=255,M=0;for(let E of d.keys){let P=Ps(E,$);R=Math.min(R,P),M=Math.max(M,P);}M-R>h&&(h=M-R,g=$);}let p=[...d.keys].sort(($,R)=>Ps($,g)-Ps(R,g)||$-R),b=d.pixels/2,_=0,y=1;for(let $=0;$<p.length-1&&(_+=o[p[$]],y=$+1,!(_>=b));$++);let w=p.slice(0,y),C=p.slice(y),S=$=>$.reduce((R,M)=>R+o[M],0);l.splice(f,1,{keys:w,pixels:S(w)},{keys:C,pixels:S(C)});}let c=[];for(let f of l){let d=0,g=0,h=0;for(let p of f.keys)d+=r[p],g+=a[p],h+=i[p];c.push(Math.round(d/f.pixels),Math.round(g/f.pixels),Math.round(h/f.pixels));}let u=new Uint8Array(262144),m=c.length/3;for(let f of s){let d=o[f],g=r[f]/d,h=a[f]/d,p=i[f]/d,b=0,_=Number.POSITIVE_INFINITY;for(let y=0;y<m;y++){let w=g-c[y*3],C=h-c[y*3+1],S=p-c[y*3+2],$=w*w+C*C+S*S;$<_&&(_=$,b=y);}u[f]=b;}return {palette:c,bucketIndex:u}}var pg=e=>Math.max(1,Math.ceil(Math.log2(e))),Uo=class{buffer=new Uint8Array(1024);length=0;push(...t){this.ensure(t.length);for(let n of t)this.buffer[this.length++]=n;}u16(t){this.push(t&255,t>>8&255);}ascii(t){for(let n=0;n<t.length;n++)this.push(t.charCodeAt(n));}bytes(t){this.ensure(t.length),this.buffer.set(t,this.length),this.length+=t.length;}ensure(t){if(this.length+t<=this.buffer.length)return;let n=this.buffer.length;for(;n<this.length+t;)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 gg(e,t){let n=new Uo,o=1<<t,r=o+1,a=[],i=0,s=0,l=()=>{a.length>0&&(n.push(a.length,...a),a=[]);},c=h=>{a.push(h),a.length===255&&l();},u=(h,p)=>{for(i|=h<<s,s+=p;s>=8;)c(i&255),i>>>=8,s-=8;},m=new Int32Array(1048576),f=t+1,d=r+1;u(o,f);let g=e[0];for(let h=1;h<e.length;h++){let p=e[h],b=g<<8|p,_=m[b];if(_!==0){g=_-1;continue}u(g,f),d===4096?(u(o,f),m=new Int32Array(1048576),d=r+1,f=t+1):(d>=1<<f&&f++,m[b]=d+1,d++),g=p;}return u(g,f),u(r,f),s>0&&c(i&255),l(),n.result()}function n0(e){let{width:t,height:n,palette:o,indices:r,transparentIndex:a}=e;Jm(t,n);let i=o.length/3;if(!Number.isInteger(i)||i<1||i>256)throw new RangeError(`A GIF palette holds 1 to 256 colors, got ${o.length} bytes`);if(r.length!==t*n)throw new RangeError(`Expected ${t*n} palette indices for ${t} x ${n}, got ${r.length}`);if(a!==null&&!(Number.isInteger(a)&&a>=0&&a<i))throw new RangeError(`The transparent index ${a} isn't in a palette of ${i} colors`);for(let m=0;m<r.length;m++)if(r[m]>=i)throw new RangeError(`Pixel ${m} points at color ${r[m]}, past the palette of ${i}`);let s=pg(i),l=1<<s,c=Math.max(2,s),u=new Uo;return u.ascii("GIF89a"),u.u16(t),u.u16(n),u.push(240|s-1,0,0),u.bytes(o),u.bytes(new Uint8Array((l-i)*3)),a!==null&&u.push(33,249,4,1,0,0,a,0),u.push(44),u.u16(0),u.u16(0),u.u16(t),u.u16(n),u.push(0),u.push(c),u.bytes(gg(r,c)),u.push(0),u.push(59),u.result()}function vs(e,t,n){let o=e0(e,t,n);return {file:n0(o),image:o}}function Is(e){let{palette:t,indices:n,transparentIndex:o}=e,r=new Uint8ClampedArray(n.length*4);for(let a=0;a<n.length;a++){let i=n[a],s=a*4;r[s]=t[i*3],r[s+1]=t[i*3+1],r[s+2]=t[i*3+2],r[s+3]=i===o?0:255;}return r}var Km="GIF89a";function Ls(e){if(e.length<32)return false;for(let l=0;l<Km.length;l++)if(e[l]!==Km.charCodeAt(l))return false;let t=new DataView(e.buffer,e.byteOffset,e.byteLength),n=t.getUint16(6,true),o=t.getUint16(8,true),r=e[10];if(n<1||o<1||!(r&128))return false;let a=13+3*(1<<(r&7)+1);if(e.length<a)return false;let i=l=>{let c=l;for(;c<e.length;){let u=e[c];if(c+=1,u===0)return c;c+=u;}return -1},s=0;for(;a<e.length;){let l=e[a];if(l===59)return s===1&&a===e.length-1;if(l===33)a=i(a+2);else if(l===44){if(a+10>e.length||t.getUint16(a+5,true)!==n||t.getUint16(a+7,true)!==o||e[a+9]&128)return false;let c=e[a+10];if(c<2||c>8)return false;s+=1,a=i(a+11);}else return false;if(a===-1)return false}return false}var kr="image/gif",zo=class extends Error{constructor(t){super(t),this.name="GIFScanError";}},Ho=255;function r0(e){let t=new Uint8ClampedArray(e.length);for(let n=0;n<e.length;n+=4){let o=e[n+3];for(let r=0;r<3;r++)t[n+r]=Math.round((e[n+r]*o+Ho*(Ho-o))/Ho);t[n+3]=Ho;}return t}function o0(e,t,n){let o=Uint8ClampedArray.from(t.data),r=e(o,t.width,t.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 bg(e,t,n){let{width:o,height:r}=e,a=r0(e.data),i=r0(t.data);if(t.width===o&&t.height===r&&a.every((c,u)=>c===i[u]))return;let s;try{s=(await import('jsqr')).default;}catch{throw new zo("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(!o0(s,{data:a,width:o,height:r},n))return;if(!o0(s,{data:i,width:t.width,height:t.height},n))throw new zo("This design uses more colors than a GIF holds (256), and the reduced image would not scan. Download a PNG instead.")}async function _g(e,t){let{file:n,image:o}=vs(e.data,e.width,e.height);if(!Ls(n))throw new Error("Could not write a GIF file");return t!==void 0&&!o.lossless&&await bg(e,{data:Is(o),width:e.width,height:e.height},t),{file:n,colors:o.colors,lossless:o.lossless}}async function Wo(e,t){let n=e.getContext("2d");if(!n)throw new Error("Could not get canvas context");let{data:o}=n.getImageData(0,0,e.width,e.height),{file:r}=await _g({data:o,width:e.width,height:e.height},t);return new Blob([r],{type:kr})}var qo=[16,32,48,256],an="image/vnd.microsoft.icon",on=256,Ts=64,Fr=6,Nr=16,yg=[137,80,78,71,13,10,26,10],xg=16,a0=20,$g=32,i0=e=>e.length>=a0+4&&yg.every((t,n)=>e[n]===t),s0=e=>{let t=new DataView(e.buffer,e.byteOffset,e.byteLength);return {width:t.getUint32(xg),height:t.getUint32(a0)}};function ks(e){if(e.length<1||e.length>Ts)throw new RangeError(`An ICO holds 1 to ${Ts} images, got ${e.length}`);for(let{width:i,height:s,png:l}of e){let c=m=>Number.isInteger(m)&&m>=1&&m<=on;if(!(c(i)&&c(s)))throw new RangeError(`ICO images must be whole numbers from 1 to ${on} px, got ${i} x ${s}`);if(!i0(l))throw new RangeError("Every ICO image must be a PNG file");let u=s0(l);if(u.width!==i||u.height!==s)throw new RangeError(`An ICO image says ${i} x ${s} but its PNG is ${u.width} x ${u.height}`)}let t=Fr+Nr*e.length,n=e.reduce((i,s)=>i+s.png.length,0),o=new Uint8Array(t+n),r=new DataView(o.buffer);r.setUint16(0,0,true),r.setUint16(2,1,true),r.setUint16(4,e.length,true);let a=t;return e.forEach(({width:i,height:s,png:l},c)=>{let u=Fr+Nr*c;o[u]=i===on?0:i,o[u+1]=s===on?0:s,o[u+2]=0,o[u+3]=0,r.setUint16(u+4,1,true),r.setUint16(u+6,$g,true),r.setUint32(u+8,l.length,true),r.setUint32(u+12,a,true),o.set(l,a),a+=l.length;}),o}function Fs(e){if(e.length<Fr+Nr)return false;let t=new DataView(e.buffer,e.byteOffset,e.byteLength),n=t.getUint16(4,true);if(t.getUint16(0,true)!==0||t.getUint16(2,true)!==1||n<1||n>Ts||e.length<Fr+Nr*n)return false;for(let o=0;o<n;o++){let r=Fr+Nr*o,a=e[r]||on,i=e[r+1]||on,s=t.getUint32(r+8,true),l=t.getUint32(r+12,true);if(l+s>e.length)return false;let c=e.subarray(l,l+s);if(!i0(c))return false;let u=s0(c);if(u.width!==a||u.height!==i)return false}return true}var l0="data:image/png;base64,";function Sg(e){let t=e.toDataURL("image/png");if(!t.startsWith(l0))throw new Error("This browser can't write a PNG from a canvas");let n=atob(t.slice(l0.length)),o=new Uint8Array(n.length);for(let r=0;r<n.length;r++)o[r]=n.charCodeAt(r);return o}function Ns(e){let t=ks(e.map(n=>({width:n.width,height:n.height,png:Sg(n)})));if(!Fs(t))throw new Error("Could not write an ICO file");return new Blob([t],{type:an})}function c0(e){return Ns([e])}var wg=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"]]),Cg=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"]]),Rg=new Set(["children","dangerouslySetInnerHTML","key","defaultValue","defaultChecked","innerHTML","suppressContentEditableWarning","suppressHydrationWarning","ref"]),Mg=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"]),Eg=new Set(["autoFocus","multiple","muted"]),Ag=new Set(["contentEditable","spellCheck","draggable","value","autoReverse","externalResourcesRequired","focusable","preserveAlpha"]),Pg=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(" ")),u0=":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",vg=new RegExp(`^[${u0}][${u0}\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`),Vo=/^[a-zA-Z][a-zA-Z:_.\-\d]*$/,Ig=/^[\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,Lg="javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')",Tg=e=>Ig.test(e)?Lg:e,d0=new Set(["area","base","br","col","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"]),kg=/["'&<>]/;function Os(e){if(!kg.test(e))return e;let t="",n=0;for(let o=0;o<e.length;o++){let r;switch(e.charCodeAt(o)){case 34:r=""";break;case 38:r="&";break;case 39:r="'";break;case 60:r="<";break;case 62:r=">";break;default:continue}t+=e.slice(n,o)+r,n=o+1;}return t+e.slice(n)}var ht=e=>typeof e=="function"||typeof e=="symbol",m0=new Map,Fg=e=>{let t=m0.get(e);return t===void 0&&(t=e.replace(/([A-Z])/g,"-$1").toLowerCase().replace(/^ms-/,"-ms-"),m0.set(e,t)),t};function Ng(e){if(typeof e=="string")return e;if(typeof e!="object"||e===null)return "";let t="";for(let n of Object.keys(e)){let o=e[n];if(o==null||typeof o=="boolean"||o==="")continue;let r;if(n.startsWith("--"))r=`${n}:${`${o}`.trim()}`;else {let a=typeof o=="number"?o===0||Pg.has(n)?`${o}`:`${o}px`:`${o}`.trim();r=`${Fg(n)}:${a}`;}t=t?`${t};${r}`:r;}return t}function Yn(e,t){if(t==null||Rg.has(e))return null;let n=Cg.get(e);if(n!==void 0)return ht(t)||typeof t=="boolean"?null:{name:n,value:`${t}`};switch(e){case "style":{let r=Ng(t);return r?{name:"style",value:r}:null}case "src":case "href":case "action":case "formAction":case "xlinkHref":return (e==="src"||e==="href")&&t===""||ht(t)||typeof t=="boolean"?null:{name:e==="xlinkHref"?"xlink:href":e,value:Tg(`${t}`)};case "capture":case "download":return t===true?{name:e,value:""}:t===false||ht(t)?null:{name:e,value:`${t}`};case "cols":case "rows":case "size":case "span":return ht(t)||Number.isNaN(Number(t))||!(t>=1)?null:{name:e,value:`${t}`};case "rowSpan":case "start":return ht(t)||Number.isNaN(Number(t))?null:{name:e,value:`${t}`};}if(Eg.has(e))return t&&!ht(t)?{name:e.toLowerCase(),value:""}:null;if(Ag.has(e))return ht(t)?null:{name:e,value:`${t}`};if(Mg.has(e))return t&&!ht(t)?{name:e,value:""}:null;if(e.length>2&&(e[0]==="o"||e[0]==="O")&&(e[1]==="n"||e[1]==="N"))return null;let o=wg.get(e)??e;if(!vg.test(o)||ht(t))return null;if(typeof t=="boolean"){let r=o.toLowerCase().slice(0,5);if(r!=="data-"&&r!=="aria-")return null}return {name:o,value:`${t}`}}var f0="http://www.w3.org/2000/svg",h0="http://www.w3.org/1999/xhtml",Og="http://www.w3.org/1999/xlink",Dg="http://www.w3.org/XML/1998/namespace",Bg="http://www.w3.org/2000/xmlns/";function Gg(e,t,n){t==="xmlns"||t.startsWith("xmlns:")?e.setAttributeNS(Bg,t,n):t.startsWith("xlink:")?e.setAttributeNS(Og,t,n):t.startsWith("xml:")?e.setAttributeNS(Dg,t,n):e.setAttribute(t,n);}function Or(e,t,n,o){if(t==null||typeof t=="boolean")return;if(typeof t=="string"||typeof t=="number"||typeof t=="bigint"){e.appendChild(o.createTextNode(`${t}`));return}if(Array.isArray(t)){for(let l of t)Or(e,l,n,o);return}if(!Ot(t))throw new TypeError("qrdx: can't render this value as DOM nodes");let{type:r,props:a}=t;if(Sn(r)){Or(e,a.children,n,o);return}if(typeof r=="function"){Or(e,r(a),n,o);return}if(!Vo.test(r))throw new TypeError(`qrdx: invalid element name: ${r}`);let i=r==="svg"?f0:n,s=o.createElementNS(i,r);for(let l of Object.keys(a)){let c=Yn(l,a[l]);c&&Gg(s,c.name,c.value);}Or(s,a.children,i===f0&&r==="foreignObject"?h0:i,o),e.appendChild(s);}function Ds(e,t=document){let n=t.createDocumentFragment();return Or(n,e,h0,t),n}function sn(e){if(e==null||typeof e=="boolean")return "";if(typeof e=="string")return Os(e);if(typeof e=="number"||typeof e=="bigint")return `${e}`;if(Array.isArray(e)){let t="";for(let n of e)t+=sn(n);return t}if(!Ot(e))throw new TypeError("qrdx: can't render this value as SVG markup");return Qg(e)}function Qg(e){let{type:t,props:n}=e;if(Sn(t))return sn(n.children);if(typeof t=="function")return sn(t(n));if(!Vo.test(t))throw new TypeError(`qrdx: invalid element name: ${t}`);let o=`<${t}`;for(let i of Object.keys(n)){let s=Yn(i,n[i]);s&&(o+=` ${s.name}="${Os(s.value)}"`);}if(d0.has(t))return `${o}/>`;let r=n.dangerouslySetInnerHTML?.__html,a=r==null?sn(n.children):`${r}`;return `${o}>${a}</${t}>`}function Bs(e){return sn(Tr(e))}function Ug(e,t=document){return Ds(Tr(e),t).firstChild}var Hg=16384;var Gs=[17,18,0,1,2,3,4,5,16,6,7,8,9,10,11,12,13,14,15],zg=8,Qs=class{buffer;position=0;bits=0;used=0;constructor(t){this.buffer=new Uint8Array(Math.max(t,64));}write(t,n){if(n!==0)for(this.bits|=t<<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 x0(e,t){let n=new Uint8Array(e.length),o=[];for(let c=0;c<e.length;c++)(e[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,a=2*r-1,i=new Float64Array(a),s=new Int32Array(a),l=new Uint8Array(a);for(let c=1;;c*=2){for(let h=0;h<r;h++)i[h]=Math.max(e[o[h]]??0,c);let u=Array.from({length:r},(h,p)=>p).sort((h,p)=>i[h]-i[p]||h-p),m=0,f=r,d=h=>m<r&&(f>=h||i[u[m]]<=i[f])?u[m++]:f++;for(let h=r;h<a;h++){let p=d(h),b=d(h);i[h]=i[p]+i[b],s[p]=h,s[b]=h;}l[a-1]=0;let g=0;for(let h=a-2;h>=0;h--){let p=l[s[h]]+1;l[h]=p,h<r&&p>g&&(g=p);}if(g<=t){for(let h=0;h<r;h++)n[o[h]]=l[h];return n}}}function Wg(e,t){let n=0;for(let o=0;o<t;o++)n=n<<1|e>>o&1;return n}function $0(e){let t=new Uint16Array(16),n=0;for(let s of e)s>0&&(t[s]=t[s]+1,n++);let o=new Uint16Array(16),r=0;for(let s=1;s<=15;s++)r=r+t[s-1]<<1,o[s]=r;let a=new Uint16Array(e.length),i=new Uint8Array(e.length);return e.forEach((s,l)=>{if(s===0)return;let c=o[s];o[s]=c+1,a[l]=Wg(c,s),i[l]=n===1?0:s;}),{lengths:e,codes:a,emitted:i}}function ln(e,t,n){e.write(t.codes[n],t.emitted[n]);}function qg(e){let t=[],n=a=>t.push({code:a,extra:0,extraBits:0}),o=zg,r=0;for(;r<e.length;){let a=e[r],i=1;for(;r+i<e.length&&e[r+i]===a;)i++;r+=i;let s=i;if(a===0){for(;s>0;)if(s<3)for(;s>0;s--)n(0);else if(s<=10)t.push({code:17,extra:s-3,extraBits:3}),s=0;else {let l=Math.min(s,138);t.push({code:18,extra:l-11,extraBits:7}),s-=l;}continue}for(a!==o&&(n(a),o=a,s--);s>0;)if(s<3)for(;s>0;s--)n(a);else {let l=Math.min(s,6);t.push({code:16,extra:l-3,extraBits:2}),s-=l;}}return t}function Vg(e,t){let n=[];if(t.forEach((s,l)=>{s>0&&n.push(l);}),n.length<=2&&n.every(s=>s<256)){let[s=0,l]=n;e.write(1,1),e.write(n.length===2?1:0,1),s<2?(e.write(0,1),e.write(s,1)):(e.write(1,1),e.write(s,8)),l!==void 0&&e.write(l,8);return}let o=qg(t),r=new Uint32Array(19);for(let s of o)r[s.code]=r[s.code]+1;let a=$0(x0(r,7)),i=Gs.length;for(;i>4&&a.lengths[Gs[i-1]]===0;)i--;e.write(0,1),e.write(i-4,4);for(let s=0;s<i;s++)e.write(a.lengths[Gs[s]],3);e.write(0,1);for(let s of o)ln(e,a,s.code),e.write(s.extra,s.extraBits);}function jo(e){let t=e-1;if(t<4)return {symbol:t,extra:0,extraBits:0};let n=31-Math.clz32(t),o=t>>n-1&1,r=n-1;return {symbol:2*n+o,extra:t&(1<<r)-1,extraBits:r}}function p0(e,t,n,o){let r=0;for(;r<o&&e[t+r]===e[t+r-n];)r++;return r}function g0(e,t,n){let o=e.length,r=0;for(;r<o;){let a=Math.min(4096,o-r),i=r>=1?p0(e,r,1,a):0,s=r>=t?p0(e,r,t,a):0;if(Math.max(i,s)>=3){s>=i?(n.copy(s,t===1?2:1),r+=s):(n.copy(i,2),r+=i);continue}n.literal(e[r]),r++;}}var b0=20;function _0(e,t,n){for(let o=0;o<n.length;o++)e[t+o]=n.charCodeAt(o);}function y0(e,t,n){e[t]=n&255,e[t+1]=n>>>8&255,e[t+2]=n>>>16&255,e[t+3]=n>>>24&255;}function Hs(e,t,n){if(!(Number.isInteger(t)&&Number.isInteger(n))||t<1||n<1||t>16384||n>16384)throw new RangeError(`WebP images are 1 to 16384 pixels wide and high (got ${t} \xD7 ${n})`);let o=t*n;if(e.length<o*4)throw new RangeError(`Expected ${o*4} bytes of RGBA for ${t} \xD7 ${n}, got ${e.length}`);let r=new Uint32Array(o),a=false;for(let C=0;C<o;C++){let S=C*4,$=e[S],R=e[S+1],M=e[S+2],E=e[S+3];E!==255&&(a=true),r[C]=(E<<24|($-R&255)<<16|R<<8|M-R&255)>>>0;}let i=new Uint32Array(280),s=new Uint32Array(256),l=new Uint32Array(256),c=new Uint32Array(256),u=new Uint32Array(40);g0(r,t,{literal(C){i[C>>>8&255]++,s[C>>>16&255]++,l[C&255]++,c[C>>>24]++;},copy(C,S){i[256+jo(C).symbol]++,u[jo(S).symbol]++;}});let m=[i,s,l,c,u].map(C=>x0(C,15)),[f,d,g,h,p]=m.map($0),b=new Qs(Math.ceil(o/4)+1024);b.write(47,8),b.write(t-1,14),b.write(n-1,14),b.write(a?1:0,1),b.write(0,3),b.write(1,1),b.write(2,2),b.write(0,1),b.write(0,1),b.write(0,1);for(let C of m)Vg(b,C);g0(r,t,{literal(C){ln(b,f,C>>>8&255),ln(b,d,C>>>16&255),ln(b,g,C&255),ln(b,h,C>>>24);},copy(C,S){let $=jo(C);ln(b,f,256+$.symbol),b.write($.extra,$.extraBits);let R=jo(S);ln(b,p,R.symbol),b.write(R.extra,R.extraBits);}});let _=b.finish(),y=_.length+(_.length&1),w=new Uint8Array(b0+y);return _0(w,0,"RIFF"),y0(w,4,w.length-8),_0(w,8,"WEBPVP8L"),y0(w,16,_.length),w.set(_,b0),w}function Us(e,t,n){return String.fromCharCode(...e.subarray(t,t+n))}function S0(e){return e.length>=12&&Us(e,0,4)==="RIFF"&&Us(e,8,4)==="WEBP"}function zs(e){if(!S0(e))return null;let t=12;for(;t+8<=e.length;){let n=Us(e,t,4);if(n==="VP8L")return "lossless";if(n==="VP8 ")return "lossy";let o=(e[t+4]|e[t+5]<<8|e[t+6]<<16|e[t+7]<<24)>>>0;t+=8+o+(o&1);}return null}function jg(e,t,n){return typeof e.toBlob!="function"?Promise.resolve(null):new Promise(o=>{try{e.toBlob(o,t,n);}catch{o(null);}})}async function Xo(e,t={}){let n=t.quality!==void 0,o=n?Math.min(1,Math.max(0,Number(t.quality))):1,r=await jg(e,"image/webp",o);if(r){let l=new Uint8Array(await r.arrayBuffer()),c=zs(l);if(c==="lossless"||n&&c==="lossy")return new Blob([l],{type:"image/webp"})}let a=e.getContext("2d");if(!a)throw new Error("Could not get canvas context");let{data:i}=a.getImageData(0,0,e.width,e.height),s=Hs(i,e.width,e.height);return new Blob([s],{type:"image/webp"})}var w0=32768;async function Ne(e){let t=new Uint8Array(await e.arrayBuffer()),n="";for(let o=0;o<t.length;o+=w0)n+=String.fromCharCode(...t.subarray(o,o+w0));return `data:${e.type||"application/octet-stream"};base64,${btoa(n)}`}async function Xe(e){let t={...e};if(e.imageSettings?.src)try{let u=await Xg(e.imageSettings.src);t={...e,imageSettings:{...e.imageSettings,src:u}};}catch{let{imageSettings:u,...m}=e;t=m;}let{hideLogo:n,url:o,logo:r,scale:a,frameLabelMarkers:i,partMarkers:s,...l}=t,c=Bs({...l,templateId:t.templateId,customTemplate:t.customTemplate});return `data:image/svg+xml,${encodeURIComponent(c)}`}var Xg=e=>new Promise((t,n)=>{if(e.startsWith("data:")){t(e);return}let o=new Image;o.crossOrigin="anonymous",o.onload=()=>{try{let r=document.createElement("canvas");r.width=o.naturalWidth||o.width,r.height=o.naturalHeight||o.height;let a=r.getContext("2d");if(!a){n(new Error("Could not get canvas context"));return}a.drawImage(o,0,0);let i=r.toDataURL("image/png");r.remove(),t(i);}catch(r){n(new Error(`Failed to convert image to base64: ${r}`));}},o.onerror=()=>{n(new Error(`Could not load image from ${e.slice(0,100)}... Check CORS settings or use a data URL.`));},o.src=e;});async function pt(e,t,n){let o=await Xe(e),r=decodeURIComponent(o.replace("data:image/svg+xml,","")),a;try{let i=new TextEncoder().encode(r),s=Array.from(i,c=>String.fromCharCode(c)).join("");a=`data:image/svg+xml;base64,${btoa(s)}`;}catch(i){throw new Error(`Failed to encode SVG for canvas conversion: ${i}`)}return new Promise((i,s)=>{let l=document.createElement("canvas"),c=l.getContext("2d");if(!c){s(new Error("Could not get canvas context"));return}let u=new Image,{width:m,height:f}=ut(e.size||ce,e.frame);l.width=Math.round(m),l.height=Math.round(f);let d=setTimeout(()=>{l.remove(),s(new Error("SVG load timeout - image may be too large or contain invalid data"));},3e4);u.onload=()=>{clearTimeout(d);try{if(t==="image/jpeg"&&(c.fillStyle="white",c.fillRect(0,0,l.width,l.height)),c.drawImage(u,0,0,l.width,l.height),n)i(l);else if(t==="image/webp")Xo(l).then(Ne).then(i,s).finally(()=>l.remove());else if(t==="image/bmp")Ne(Qo(l)).then(i,s).finally(()=>l.remove());else if(t===kr)Wo(l,e.value).then(Ne).then(i,s).finally(()=>l.remove());else if(t===an||t==="image/x-icon")Ne(c0(l)).then(i,s).finally(()=>l.remove());else {let g=l.toDataURL(t,1);l.remove(),i(g);}}catch(g){clearTimeout(d),l.remove(),s(new Error(`Failed to draw SVG to canvas: ${g}`));}},u.onerror=()=>{clearTimeout(d),l.remove(),s(new Error("Could not load SVG"));},u.src=a;})}var C0=["gradientUnits","gradientTransform","spreadMethod"],Yg={linear:["x1","y1","x2","y2"],radial:["cx","cy","r","fx","fy","fr"]},Zg={r:0,g:0,b:0,a:1};function R0(e,t){for(let n of (e.attrs.style??"").split(";")){let[o,...r]=n.split(":");if(o?.trim()===t)return r.join(":").trim()}return e.attrs[t]}function Ws(e){return e.name==="linearGradient"?"linear":e.name==="radialGradient"?"radial":null}function Kg(e){let t=[],n=0;for(let o of e.children){if(o.name!=="stop")continue;let r=(o.attrs.offset??"0").trim(),a=Number.parseFloat(r),i=Number.isFinite(a)?r.endsWith("%")?a/100:a:0;n=Math.max(n,Math.min(Math.max(i,0),1));let s=R0(o,"stop-color")??"#000000",l=le(s==="currentColor"?"#000000":s)??Zg,c=Number.parseFloat(R0(o,"stop-opacity")??"1");t.push({offset:n,color:Number.isFinite(c)?{...l,a:l.a*Math.min(Math.max(c,0),1)}:l});}return t}function Yo(e){let t=new Map,n=r=>{let a=r.attrs.id;Ws(r)&&a&&!t.has(a)&&t.set(a,r);for(let i of r.children)n(i);};n(e);let o=new Map;for(let[r,a]of t){let i=Ws(a),s={},l=[],c=new Set,u=a;for(;u&&!c.has(u);){c.add(u);let m=Ws(u)===i?[...C0,...Yg[i]]:C0;for(let d of m){let g=u.attrs[d];s[d]===void 0&&g!==void 0&&(s[d]=g);}l.length===0&&(l=Kg(u));let f=u.attrs.href??u.attrs["xlink:href"];u=f?.startsWith("#")?t.get(f.slice(1)):void 0;}o.set(r,{kind:i,attrs:s,stops:l});}return o}function qs(e){let t=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,r=Number.NEGATIVE_INFINITY,a=(m,f)=>{t=Math.min(t,m),o=Math.max(o,m),n=Math.min(n,f),r=Math.max(r,f);},i=(m,f,d,g)=>{let h=-m+3*f-3*d+g,p=2*(m-2*f+d),b=f-m;if(Math.abs(h)<1e-12)return Math.abs(p)<1e-12?[]:[-b/p];let _=p*p-4*h*b;if(_<0)return [];let y=Math.sqrt(_);return [(-p+y)/(2*h),(-p-y)/(2*h)]},s=(m,f,d,g,h)=>{let p=1-m;return p*p*p*f+3*p*p*m*d+3*p*m*m*g+m**3*h},l=0,c=0,u=[0,0];for(let m of e)if(m.op==="M"&&(u=[m.x,m.y]),m.op==="M"||m.op==="L")a(m.x,m.y),l=m.x,c=m.y;else if(m.op==="C"){a(m.x,m.y);for(let f of [...i(l,m.x1,m.x2,m.x),...i(c,m.y1,m.y2,m.y)])f>0&&f<1&&a(s(f,l,m.x1,m.x2,m.x),s(f,c,m.y1,m.y2,m.y));l=m.x,c=m.y;}else [l,c]=u;return Number.isFinite(t)?{x:t,y:n,width:o-t,height:r-n}:null}var Jg=e=>e[0]*e[3]-e[1]*e[2];function At(e){let t=Jg(e);if(!Number.isFinite(t)||Math.abs(t)<1e-12)return null;let[n,o,r,a,i,s]=e;return [a/t,-o/t,-r/t,n/t,(r*s-a*i)/t,(o*i-n*s)/t]}function E0(e,t,n){let{kind:o,attrs:r,stops:a}=e,i=a[0],s=a.at(-1);if(!(i&&s)||a.every(S=>S.color.a===0))return null;if(a.length===1)return i.color;let l=r.gradientUnits==="userSpaceOnUse",c=En;if(!l){let S=qs(t);if(!S||S.width<=0||S.height<=0)return null;c=[S.width,0,0,S.height,S.x,S.y];}let u=me(c,Ue(r.gradientTransform));if(!At(u))return s.color;let[m,f]=n,d=Math.sqrt((m*m+f*f)/2),g=(S,$)=>{let R=Number.parseFloat(S);return Number.isFinite(R)?S.trim().endsWith("%")?R/100*(l?$:1):R:null},h=(S,$,R)=>g(r[S]??$,R)??g($,R)??0;if(o==="linear"){let S=[h("x1","0%",m),h("y1","0%",f),h("x2","100%",m),h("y2","0%",f)],[$,R,M,E]=S;return $===M&&R===E?s.color:{kind:o,coords:S,matrix:u,stops:a}}let p=h("cx","50%",m),b=h("cy","50%",f),_=h("r","50%",d),y=r.fx===void 0?p:h("fx","50%",m),w=r.fy===void 0?b:h("fy","50%",f),C=Math.max(0,h("fr","0%",d));return _<0?null:_===0?s.color:{kind:o,coords:[y,w,C,p,b,_],matrix:u,stops:a}}function Zo(e){return e.map(t=>x(t,6)).join(" ")}function e2(e,t){return (t==="cmyk"?St(e.r,e.g,e.b):[e.r/255,e.g/255,e.b/255]).map(o=>x(o,4)).join(" ")}var M0=(e,t)=>`<< /FunctionType 2 /Domain [0 1] /C0 [${e}] /C1 [${t}] /N 1 >>`;function t2(e,t){let n=[],o=e.map(s=>K(s.offset,4)),r=e.map(s=>e2(s.color,t)),a=o[0],i=o.at(-1);if(a>0){let s=r[0];n.push({from:0,to:a,c0:s,c1:s});}for(let s=0;s+1<e.length;s++){let l=o[s],c=o[s+1];c>l&&n.push({from:l,to:c,c0:r[s],c1:r[s+1]});}if(i<1){let s=r.at(-1);n.push({from:i,to:1,c0:s,c1:s});}if(n.length===1){let[s]=n;return M0(s.c0,s.c1)}return ["<< /FunctionType 3 /Domain [0 1]",`/Functions [${n.map(s=>M0(s.c0,s.c1)).join(" ")}]`,`/Bounds [${n.slice(1).map(s=>x(s.from,4)).join(" ")}]`,`/Encode [${n.map(()=>"0 1").join(" ")}] >>`].join(" ")}function Ko(e,t){return [`<< /ShadingType ${e.kind==="linear"?2:3}`,`/ColorSpace /Device${t==="cmyk"?"CMYK":"RGB"}`,`/Coords [${e.coords.map(n=>x(n,6)).join(" ")}]`,`/Function ${t2(e.stops,t)}`,"/Extend [true true] >>"].join(" ")}function n2(e,t){if(e.op==="Z")return e;if(e.op==="C"){let[r,a]=W(t,e.x1,e.y1),[i,s]=W(t,e.x2,e.y2),[l,c]=W(t,e.x,e.y);return {op:"C",x1:r,y1:a,x2:i,y2:s,x:l,y:c}}let[n,o]=W(t,e.x,e.y);return {op:e.op,x:n,y:o}}function ea(e){let t={round:1,bevel:2}[e.strokeLinejoin?.trim()??""],n={round:1,square:2}[e.strokeLinecap?.trim()??""];return {join:t??0,cap:n??0}}var A0={r:255,g:255,b:255,a:1},r2=/^url\(\s*#bg-color-/,Jo=/^url\(\s*#([^)\s]+)\s*\)/,o2=new Set(["defs","clipPath","mask","pattern","linearGradient","radialGradient","symbol","title","desc","metadata","style","script","use","foreignObject"]);function X(e,t){let n=e.attrs.style;if(n)for(let o of n.split(";")){let[r,...a]=o.split(":");if(r?.trim()===t)return a.join(":").trim()}return e.attrs[t]}function j(e,t,n=0){if(e===void 0||e==="")return n;let o=Number.parseFloat(e);return Number.isNaN(o)?n:e.trim().endsWith("%")?o/100*t:o}function Dr(e,t){if((e.name==="linearGradient"||e.name==="radialGradient")&&e.attrs.id){let n=e.children.find(r=>r.name==="stop"),o=n&&(X(n,"stop-color")??"#000000");o&&t.set(e.attrs.id,o);}for(let n of e.children)Dr(n,t);return t}function Br(e,t){if(e.name==="image"){let n=e.attrs.href??e.attrs["xlink:href"];n&&t.add(n);}for(let n of e.children)Br(n,t);return t}function ta(e){return /^data:image\/png[;,]/i.test(e)?"PNG":/^data:image\/jpe?g[;,]/i.test(e)?"JPEG":null}async function na(e){return typeof document>"u"||typeof Image>"u"?null:await new Promise(t=>{let n=new Image;n.crossOrigin="anonymous",n.onload=()=>{let o=document.createElement("canvas"),r=Math.max(n.naturalWidth||512,n.naturalHeight||512),a=Math.min(1024/r,4);o.width=Math.round((n.naturalWidth||512)*a),o.height=Math.round((n.naturalHeight||512)*a);let i=o.getContext("2d");if(!i){t(null);return}i.drawImage(n,0,0,o.width,o.height);try{t(o.toDataURL("image/png"));}catch{t(null);}},n.onerror=()=>t(null),n.src=e;})}function P0(e,t,n){let o={x:j(e.attrs.x,t[0]),y:j(e.attrs.y,t[1]),width:j(e.attrs.width,t[0]),height:j(e.attrs.height,t[1])};if(o.width<=0||o.height<=0)return null;let r=(e.attrs.preserveAspectRatio??"").trim();if(!r||r.startsWith("none")||!n||!(n.width>0&&n.height>0))return {draw:o,clip:null};let[a="xMidYMid",i="meet"]=r.split(/\s+/),s=i==="slice",l=(s?Math.max:Math.min)(o.width/n.width,o.height/n.height),c=n.width*l,u=n.height*l,m=f=>{let d=f==="x"?a.slice(0,4):a.slice(4);return d.endsWith("Min")?0:d.endsWith("Max")?1:.5};return {draw:{x:o.x+(o.width-c)*m("x"),y:o.y+(o.height-u)*m("y"),width:c,height:u},clip:s?o:null}}function v0(e,t){e.name==="clipPath"&&e.attrs.id&&t.set(e.attrs.id,e);for(let n of e.children)v0(n,t);return t}function I0(e,t){e.name==="pattern"&&e.attrs.id&&t.set(e.attrs.id,e);for(let n of e.children)I0(n,t);return t}function a2(e,t){let[n,o]=t,r=(a,i)=>j(e.attrs[a],i);switch(e.name){case "path":return st(e.attrs.d??"");case "rect":{let a=e.attrs.rx??e.attrs.ry,i=e.attrs.ry??e.attrs.rx;return tt(r("x",n),r("y",o),r("width",n),r("height",o),j(a,n),j(i,o))}case "circle":{let a=r("r",Math.hypot(n,o)/Math.SQRT2);return et(r("cx",n),r("cy",o),a,a)}case "ellipse":return et(r("cx",n),r("cy",o),r("rx",n),r("ry",o));default:return []}}var Zn=class{gradients;shadings;clipPaths=new Map;patterns=new Map;backdrop=A0;paper=A0;background=null;onPaper=false;inConic=false;constructor(t,n=null){this.gradients=t,this.shadings=n;}resolveColor(t){if(!t||t==="none")return null;let n=Jo.exec(t);if(n)return this.resolveColor(this.gradients.get(n[1]));let o=le(t==="currentColor"?"#000000":t);return o&&o.a>0?o:null}shadedGradient(t){let n=t?Jo.exec(t)?.[1]:void 0;return n?this.shadings?.get(n):void 0}resolveFill(t,n,o,r=1){if(r<=0)return null;let a=this.patternOf(t);if(a)return {pattern:a,alpha:r};let i=this.shadedGradient(t);if(i){let c=E0(i,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 s=this.resolveColor(t);if(!s)return null;let l={...s,a:s.a*r};return l.a>0?{color:l}:null}patternOf(t){let n=t?Jo.exec(t)?.[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(t){if(t.a>=1)return t;let n=this.background,o=n!==null&&Math.abs(n.r-t.r)<.5&&Math.abs(n.g-t.g)<.5&&Math.abs(n.b-t.b)<.5&&Math.abs(n.a-t.a)<.002;return Fo(t,this.onPaper||o?this.paper:this.backdrop)}paintPattern(t,n,o,r){let a=qs(t);if(!a||a.width<=0||a.height<=0)return true;let[i,s]=n.viewport,l=j(o.attrs.x,i),c=j(o.attrs.y,s),u=j(o.attrs.width,i),m=j(o.attrs.height,s);if(!(u>0&&m>0))return true;let f=Ue(o.attrs.patternTransform),d=At(f);if(!d)return true;if(!this.beginClip(t,n.matrix,n.fillRule==="evenodd"))return false;let g=this.inConic;this.inConic=o.attrs["data-qrdx-conic"]!==void 0;try{let h=[W(d,a.x,a.y),W(d,a.x+a.width,a.y),W(d,a.x,a.y+a.height),W(d,a.x+a.width,a.y+a.height)],p=h.map(([L])=>L),b=h.map(([,L])=>L),_=Math.min(...p),y=Math.max(...p),w=Math.min(...b),C=Math.max(...b),S=Math.floor((_-l)/u),$=Math.ceil((y-l)/u)-1,R=Math.floor((w-c)/m),M=Math.ceil((C-c)/m)-1,E=($-S+1)*(M-R+1);if(E>4096)return !0;let P=(o.attrs["data-qrdx-conic"]??"").trim().split(/\s+/).map(Number),I=me(n.matrix,f);for(let L=R;L<=M;L++)for(let k=S;k<=$;k++){let F=l+k*u,T=c+L*m,H=me(I,[1,0,0,1,F,T]),G={x:_-F,y:w-T,width:y-_,height:C-w},z=P.length===2&&P.every(Number.isFinite)?Om(P[0],P[1],G):null,O=E>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"}],H,!1);try{let Y={matrix:H,viewport:n.viewport,fill:"#000000",fillRule:"nonzero",stroke:"none",strokeWidth:1,fontSize:16,fontWeight:"normal",textAnchor:"start",fillOpacity:1,opacity:r},be=(de,N)=>{for(let Q of de){if(Q.name==="g"&&!Q.attrs.transform){let re=Number.parseFloat(Q.attrs.opacity??"1");be(Q.children,{...N,opacity:(N.opacity??1)*(Number.isFinite(re)?re:1)});continue}if(z&&Q.attrs["data-arc"]){let[re,ie]=Q.attrs["data-arc"].split(/\s+/).map(Number);if(!Dm([re,re+ie],z))continue}this.walk(Q,N);}};be(o.children,Y);}finally{O&&this.endClip();}}}finally{this.inConic=g,this.endClip();}return true}paintBleed(t,n,o,r){if(!this.shadedGradient(o))return false;let[a,i]=this.viewportMatrix({...t,attrs:{...t.attrs,x:"0",y:"0"}},{...n,matrix:me(n.matrix,Ue(t.attrs.transform))}),s=At(a);if(!s)return false;let[l,c,u,m]=r,d=[[l,c],[u,c],[u,m],[l,m]].map(([g,h])=>W(s,g,h)).map(([g,h],p)=>({op:p===0?"M":"L",x:g,y:h}));return d.push({op:"Z"}),this.paint(d,{name:"rect",attrs:{},children:[],text:""},{...n,matrix:a,viewport:i,fill:o,fillRule:"nonzero",stroke:"none"}),true}beginClip(t,n,o){return false}endClip(){}clipOf(t,n){let o=X(t,"clip-path"),r=o?Jo.exec(o)?.[1]:void 0,a=r?this.clipPaths.get(r):void 0;if(!a)return null;let i=[],s=false;for(let l of a.children){let c=a2(l,n.viewport);if(c.length===0)continue;let u=Ue(l.attrs.transform),m=u[0]===1&&u[1]===0&&u[2]===0&&u[3]===1&&u[4]===0&&u[5]===0;i.push(...m?c:c.map(f=>n2(f,u))),s||=X(l,"clip-rule")==="evenodd";}return i.length>0?{segments:i,matrix:n.matrix,evenOdd:s}:null}viewportMatrix(t,n){let o=j(t.attrs.x,n.viewport[0]),r=j(t.attrs.y,n.viewport[1]),a=j(t.attrs.width,n.viewport[0],n.viewport[0]),i=j(t.attrs.height,n.viewport[1],n.viewport[1]),s=Je(t.attrs.viewBox);if(s.length!==4||!(s[2]&&s[3]))return [me(n.matrix,[1,0,0,1,o,r]),[a,i]];let[l,c,u,m]=s,f=a/u,d=i/m,g=o,h=r;if((t.attrs.preserveAspectRatio??"").trim()!=="none"){let p=t.attrs.preserveAspectRatio?.includes("slice")?Math.max(f,d):Math.min(f,d);g+=(a-u*p)/2,h+=(i-m*p)/2,f=p,d=p;}return [me(n.matrix,[f,0,0,d,g-l*f,h-c*d]),[u,m]]}walk(t,n,o=false){if(o&&(this.clipPaths=v0(t,new Map),this.patterns=I0(t,new Map)),o2.has(t.name)||X(t,"display")==="none"||X(t,"visibility")==="hidden")return;let r=me(n.matrix,Ue(t.attrs.transform)),a=n.viewport;if(t.name==="svg"){let[f,d]=this.viewportMatrix(o?{...t,attrs:{...t.attrs,x:"0",y:"0"}}:t,{...n,matrix:r});r=f,a=d;}let i=X(t,"font-size"),s=Number.parseFloat(X(t,"opacity")??"1"),l=X(t,"fill-opacity"),c=l===void 0?n.fillOpacity??1:Number.parseFloat(l),u={fillOpacity:Number.isFinite(c)?Math.min(Math.max(c,0),1):1,opacity:(n.opacity??1)*(Number.isFinite(s)?Math.min(Math.max(s,0),1):1),matrix:r,viewport:a,fill:X(t,"fill")??n.fill,fillRule:X(t,"fill-rule")??n.fillRule,stroke:X(t,"stroke")??n.stroke,strokeWidth:X(t,"stroke-width")===void 0?n.strokeWidth:j(X(t,"stroke-width"),a[0],1),strokeLinejoin:X(t,"stroke-linejoin")??n.strokeLinejoin,strokeLinecap:X(t,"stroke-linecap")??n.strokeLinecap,fontSize:i===void 0?n.fontSize:j(i,16,16),fontWeight:X(t,"font-weight")??n.fontWeight,textAnchor:X(t,"text-anchor")??n.textAnchor},m=this.onPaper;(t.name==="rect"||t.name==="circle"||t.name==="path")&&r2.test(X(t,"fill")??"")&&(this.onPaper=true);try{let f=t.attrs["clip-path"]?this.clipOf(t,u):null;if(f&&this.beginClip(f.segments,f.matrix,f.evenOdd)){try{this.paintNode(t,u);}finally{this.endClip();}return}this.paintNode(t,u);}finally{this.onPaper=m;}}paintNode(t,n){let[o,r]=n.viewport,a=(i,s)=>j(t.attrs[i],s);switch(t.name){case "path":this.paint(st(t.attrs.d??""),t,n);return;case "rect":{let i=t.attrs.rx??t.attrs.ry,s=t.attrs.ry??t.attrs.rx;this.paint(tt(a("x",o),a("y",r),a("width",o),a("height",r),j(i,o),j(s,r)),t,n);return}case "circle":{let i=a("r",Math.hypot(o,r)/Math.SQRT2);this.paint(et(a("cx",o),a("cy",r),i,i),t,n);return}case "ellipse":this.paint(et(a("cx",o),a("cy",r),a("rx",o),a("ry",r)),t,n);return;case "line":this.paint([{op:"M",x:a("x1",o),y:a("y1",r)},{op:"L",x:a("x2",o),y:a("y2",r)}],t,{...n,fill:"none"});return;case "polygon":case "polyline":{let i=Je(t.attrs.points),s=[];for(let l=0;l+1<i.length;l+=2)s.push({op:l===0?"M":"L",x:i[l],y:i[l+1]});t.name==="polygon"&&s.length>0&&s.push({op:"Z"}),this.paint(s,t,n);return}case "text":this.text(t,n);return;case "image":this.image(t,n);return;default:for(let i of t.children)this.walk(i,n);}}};var ra=1e3;async function Gr(e){let t=await Xe(Pt({...e,size:e.size??ce},ra));return decodeURIComponent(t.replace("data:image/svg+xml,",""))}function Vs(e){if(Fe(e.frame)){let t=Xt(ra,e.frame);return t.squareEdges?t.color:null}if(e.backdrop&&e.bgRadius){let t=Ee(e.value,Ae(e),e.exactLevel).size,n=Me(t,e.margin??pe,e.shape);if(Hn(e.bgRadius,t,n,e.shape)>0)return ye(e.backdrop,fe)}return ye(e.bgColor,fe)}function oa(e,t){let n=Vs(e);if(!(n&&Kt(e.bgColor))||Fe(e.frame)||e.templateId||e.customTemplate)return n;let o=yt(t)?.children.find(a=>a.name==="rect"),r=o&&X(o,"fill");return r?.startsWith("url(")?r:n}function aa(e,t){let n={r:255,g:255,b:255,a:1},o=le(ye(t.bgColor,fe));e.paper=n,e.background=o&&!Kt(t.bgColor)?o:null,e.backdrop=o?Fo(o,n):n;}var ia=25.4,L0=5,T0=2e3,gt=ra,js=5,k0=2,s2=.25*(ia/72);function l2(e,t="mm"){return t==="in"?e*ia:e}function c2(e){let t=Ae(e),n=Ee(e.value,t,e.exactLevel).size;return n+Me(n,e.margin??pe,e.shape)*2}function sa(e,t){let n=l2(t.size,t.unit);if(!Number.isFinite(n)||n<L0||n>T0)throw new Error(`Print size must be between ${L0} mm and ${T0/1e3} m`);let o=Math.min(Math.max(t.bleed??0,0),20),r=n/gt,a=Fe(e.frame)?Xt(gt,e.frame):null,i=(a?.width??gt)*r,s=(a?.height??gt)*r,l=t.cropMarks?o+k0+js+1:o,c=c2(e);return {codeWidth:n,trimWidth:i,trimHeight:s,bleed:o,pageWidth:i+2*l,pageHeight:s+2*l,trimX:l,trimY:l,moduleSize:n/c,moduleCount:c,maxScanDistance:n*10}}var Xs=class e{pdf;internals;names=new Map;constructor(t,n){this.pdf=t,this.internals=n;}static attach(t){let n=t.internal;return typeof t.advancedAPI!="function"||typeof t.addShadingPattern!="function"||typeof n.write!="function"||typeof n.events?.subscribe!="function"?null:new e(t,n)}name(t){let n=this.names.get(t);return n||(this.names.size===0&&this.install(),n=`Sh${this.names.size}`,this.names.set(t,n)),n}install(){this.pdf.advancedAPI(t=>{t.addShadingPattern("qrdx-shadings",{});}),this.internals.events.subscribe("putShadingPatternDict",()=>{for(let[t,n]of this.names)this.internals.write(`/${n} ${t}`);});}},Ys=class extends Zn{pdf;cmyk;images;shadingResources;constructor(t,n,o,r,a){super(o,r?.gradients??null),this.pdf=t,this.cmyk=n,this.images=a,this.shadingResources=r?.resources??null;}setColor(t,n){let o=t==="fill"?this.pdf.setFillColor.bind(this.pdf):t==="draw"?this.pdf.setDrawColor.bind(this.pdf):this.pdf.setTextColor.bind(this.pdf);if(this.cmyk){let[r,a,i,s]=St(n.r,n.g,n.b);o(r,a,i,s);}else o(Math.round(n.r),Math.round(n.g),Math.round(n.b));}setRegistrationColor(){this.cmyk?this.pdf.setDrawColor(1,1,1,1):this.pdf.setDrawColor(0,0,0);}tracePath(t,n){let o=false;for(let r of t)if(r.op==="M"){let[a,i]=W(n,r.x,r.y);this.pdf.moveTo(a,i),o=true;}else if(r.op==="L"){let[a,i]=W(n,r.x,r.y);o?this.pdf.lineTo(a,i):(this.pdf.moveTo(a,i),o=true);}else if(r.op==="C"){let[a,i]=W(n,r.x1,r.y1),[s,l]=W(n,r.x2,r.y2),[c,u]=W(n,r.x,r.y);this.pdf.curveTo(a,i,s,l,c,u);}else o&&this.pdf.close();}shade(t,n,o){let r=this.pdf.internal,a=r.scaleFactor,i=[a,0,0,-a,0,r.pageSize.getHeight()*a],s=me(i,me(n.matrix,o.matrix));if(!(this.shadingResources&&At(s)))return;let l=this.shadingResources.name(Ko(o,this.cmyk?"cmyk":"rgb"));this.pdf.saveGraphicsState(),this.tracePath(t,n.matrix),this.pdf.clip(n.fillRule==="evenodd"?"evenodd":void 0),this.pdf.discardPath(),r.write(`${Zo(s)} cm /${l} sh`),this.pdf.restoreGraphicsState();}beginClip(t,n,o){return this.pdf.saveGraphicsState(),this.tracePath(t,n),this.pdf.clip(o?"evenodd":void 0),this.pdf.discardPath(),true}endClip(){this.pdf.restoreGraphicsState();}withAlpha(t,n,o){if(t>=1&&n>=1){o();return}this.pdf.saveGraphicsState();let r=this.pdf.GState;this.pdf.setGState(new r({opacity:t,"stroke-opacity":n}));try{o();}finally{this.pdf.restoreGraphicsState();}}opaqueGradient(t,n){let o=t.stops[0]?.color.a??1;return t.stops.every(a=>Math.abs(a.color.a-o)<.002)?{gradient:{...t,stops:t.stops.map(a=>({...a,color:{...a.color,a:1}}))},alpha:o*n}:{gradient:{...t,stops:t.stops.map(a=>({...a,color:this.flatten({...a.color,a:a.color.a*n})}))},alpha:1}}paint(t,n,o){if(t.length===0)return;let r=o.opacity??1;if(r<=0)return;let a=this.resolveFill(o.fill,t,o.viewport,(o.fillOpacity??1)*r);if(a&&"pattern"in a)this.paintPattern(t,o,a.pattern,a.alpha);else if(a&&"gradient"in a){let{gradient:m,alpha:f}=this.opaqueGradient(a.gradient,a.alpha);this.withAlpha(f,1,()=>this.shade(t,o,m));}let i=a&&"color"in a?a.color:null,s=i&&this.inConic?this.flatten(i):i,l=o.strokeWidth>0?this.resolveColor(o.stroke):null,c=l&&{...l,a:l.a*r};if(!(s||c))return;let u=o.fillRule==="evenodd";this.withAlpha(s?.a??1,c?.a??1,()=>{s&&this.setColor("fill",s);let m=c?ea(o):{join:0,cap:0};c&&(this.setColor("draw",c),this.pdf.setLineWidth(o.strokeWidth*An(o.matrix)),(m.join||m.cap)&&(this.pdf.setLineJoin(m.join),this.pdf.setLineCap(m.cap))),this.tracePath(t,o.matrix),s&&c?u?this.pdf.fillStrokeEvenOdd():this.pdf.fillStroke():s?u?this.pdf.fillEvenOdd():this.pdf.fill():this.pdf.stroke(),(m.join||m.cap)&&(this.pdf.setLineJoin(0),this.pdf.setLineCap(0));});}text(t,n){let o=t.text.replace(/\s+/g," ").trim(),r=this.resolveColor(n.fill);if(!(o&&r))return;let a=An(n.matrix),[i,s]=W(n.matrix,j(t.attrs.x,n.viewport[0]),j(t.attrs.y,n.viewport[1])),l=n.fontWeight==="bold"||Number.parseInt(n.fontWeight,10)>=600;this.pdf.setFont("helvetica",l?"bold":"normal");let c=n.fontSize*a*(72/ia);this.pdf.setFontSize(c);let u=Number.parseFloat(t.attrs["data-max-width"]??"");if(u>0){let d=u*a,g=this.pdf.getTextWidth(o);g>d&&(c*=d/g,this.pdf.setFontSize(c));}this.setColor("text",r);let m=Math.atan2(n.matrix[1],n.matrix[0]);if(Math.abs(m)>2e-4){let d=n.textAnchor==="middle"?this.pdf.getTextWidth(o)/2:n.textAnchor==="end"?this.pdf.getTextWidth(o):0;this.pdf.text(o,i-d*Math.cos(m),s-d*Math.sin(m),{angle:-m*180/Math.PI,baseline:"alphabetic"});return}let f=n.textAnchor==="middle"?"center":n.textAnchor==="end"?"right":"left";this.pdf.text(o,i,s,{align:f,baseline:"alphabetic"});}aliases=new Map;image(t,n){let o=t.attrs.href??t.attrs["xlink:href"],r=o&&(ta(o)?o:this.images.get(o)),a=r&&ta(r);if(!(r&&a))return;let i=this.aliases.get(r);i||(i=`qrdx-image-${this.aliases.size}`,this.aliases.set(r,i));let s=null;if(t.attrs.preserveAspectRatio)try{let p=this.pdf.getImageProperties(r);s={width:p.width,height:p.height};}catch{s=null;}let l=P0(t,n.viewport,s);if(!l)return;let{draw:c,clip:u}=l,[m,f]=W(n.matrix,c.x,c.y),[d,g]=W(n.matrix,c.x+c.width,c.y+c.height),h=u!==null&&this.beginClip([{op:"M",x:u.x,y:u.y},{op:"L",x:u.x+u.width,y:u.y},{op:"L",x:u.x+u.width,y:u.y+u.height},{op:"L",x:u.x,y:u.y+u.height},{op:"Z"}],n.matrix,false);try{this.withAlpha(n.opacity??1,1,()=>{this.pdf.addImage(r,a,Math.min(m,d),Math.min(f,g),Math.abs(d-m),Math.abs(g-f),i);});}finally{h&&this.endClip();}}};function u2(e,t,n){let{trimX:o,trimY:r,trimWidth:a,trimHeight:i,bleed:s}=n,l=s+k0,c=o,u=o+a,m=r,f=r+i;t.setRegistrationColor(),e.setLineWidth(s2);for(let d of [c,u]){let g=d===c?-1:1;for(let h of [m,f]){let p=h===m?-1:1;e.line(d+g*l,h,d+g*(l+js),h),e.line(d,h+p*l,d,h+p*(l+js));}}}async function m2(e,t){return (await F0(e,t)).output("dataurlstring")}async function U4(e,t){return (await F0(e,t)).output("arraybuffer")}async function F0(e,t){let n=sa(e,t),o;try{({jsPDF:o}=await import('jspdf'));}catch(b){throw new Error(`PDF export needs the optional "jspdf" package. Install it with \`npm install jspdf\`. (${b})`)}let r=await Gr(e),a=yt(r);if(!a)throw new Error("Failed to render the QR code for printing");let i=new Map;for(let b of Br(a,new Set))if(!ta(b)){let _=await na(b);_&&i.set(b,_);}let s=new o({orientation:n.pageWidth>n.pageHeight?"landscape":"portrait",unit:"mm",format:[n.pageWidth,n.pageHeight],compress:true,floatPrecision:3});s.setProperties({title:"QR code",creator:"qrdx"});let l=Yo(a),c=l.size>0?Xs.attach(s):null,u=new Ys(s,t.colorMode==="cmyk",Dr(a,new Map),c?{gradients:l,resources:c}:null,i);aa(u,e);let m=n.codeWidth/gt,f=j(a.attrs.width,gt,gt),d=j(a.attrs.height,gt,gt),g={matrix:me([1,0,0,1,n.trimX,n.trimY],[m,0,0,m,0,0]),viewport:[f,d],fill:"#000000",fillRule:"nonzero",stroke:"none",strokeWidth:1,fontSize:16,fontWeight:"normal",textAnchor:"start"},h=n.bleed>0?oa(e,r):null,p=[n.trimX-n.bleed,n.trimY-n.bleed,n.trimX+n.trimWidth+n.bleed,n.trimY+n.trimHeight+n.bleed];if(!(h&&u.paintBleed(a,g,h,p))){let b=h?u.resolveColor(h):null;b&&(u.setColor("fill",b),s.rect(n.trimX-n.bleed,n.trimY-n.bleed,n.trimWidth+2*n.bleed,n.trimHeight+2*n.bleed,"F"));}return u.walk(a,g,true),t.cropMarks&&u2(s,u,n),s}async function d2(e,t){let n=sa(e,{size:t.size,unit:t.unit}),o=await Gr(e),r=t.unit??"mm",a=l=>`${x(r==="in"?l/ia:l)}${r}`,i=/^<svg\b[^>]*>/.exec(o)?.[0];if(!i)throw new Error("Failed to render the QR code for printing");return `<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
${i.replace(/\swidth="[^"]*"/,` width="${a(n.trimWidth)}"`).replace(/\sheight="[^"]*"/,` height="${a(n.trimHeight)}"`)}${o.slice(i.length)}`}async function H4(e,t){let n=await m2(e,t);De(n,t.filename??"qr-code-print.pdf");}async function z4(e,t){let n=await d2(e,t);De(`data:image/svg+xml;charset=utf-8,${encodeURIComponent(n)}`,t.filename??"qr-code-print.svg");}var f2=[137,80,78,71,13,10,26,10];async function O0(e,t){let n=new Blob([e]).stream().pipeThrough(t);return new Uint8Array(await new Response(n).arrayBuffer())}async function D0(e){return typeof CompressionStream>"u"?null:await O0(e,new CompressionStream("deflate"))}async function h2(e){if(typeof DecompressionStream>"u")return null;try{return await O0(e,new DecompressionStream("deflate"))}catch{return null}}var Zs=(e,t)=>e[t]*2**24+(e[t+1]<<16)+(e[t+2]<<8)+e[t+3]>>>0,N0={0:1,2:3,3:1,4:2,6:4};function p2(e,t,n){let o=e+t-n,r=Math.abs(o-e),a=Math.abs(o-t),i=Math.abs(o-n);return r<=a&&r<=i?e:a<=i?t:n}async function Ks(e){if(f2.some((h,p)=>e[p]!==h))return null;let t=8,n=0,o=0,r=-1,a=null,i=null,s=[];for(;t+8<=e.length;){let h=Zs(e,t),p=String.fromCharCode(...e.subarray(t+4,t+8)),b=e.subarray(t+8,t+8+h);if(t+=12+h,p==="IHDR"){n=Zs(b,0),o=Zs(b,4);let _=b[8];r=b[9];let y=b[12];if(_!==8||y!==0||!(r in N0))return null}else if(p==="PLTE")a=b;else if(p==="tRNS")i=b;else if(p==="IDAT")s.push(b);else if(p==="IEND")break}if(!(n&&o)||n*o>4096*4096)return null;let l=new Uint8Array(s.reduce((h,p)=>h+p.length,0)),c=0;for(let h of s)l.set(h,c),c+=h.length;let u=await h2(l),m=N0[r],f=n*m;if(!u||u.length<o*(f+1))return null;let d=new Uint8Array(o*f);for(let h=0;h<o;h++){let p=u[h*(f+1)],b=u.subarray(h*(f+1)+1,(h+1)*(f+1)),_=h*f;for(let y=0;y<f;y++){let w=y>=m?d[_+y-m]:0,C=h>0?d[_-f+y]:0,S=h>0&&y>=m?d[_-f+y-m]:0,$=b[y],R=0;p===1?R=w:p===2?R=C:p===3?R=w+C>>1:p===4&&(R=p2(w,C,S)),d[_+y]=$+R&255;}}let g=new Uint8Array(n*o*4);for(let h=0;h<n*o;h++){let p=h*4,b=h*m;if(r===3){let _=d[b];g[p]=a?.[_*3]??0,g[p+1]=a?.[_*3+1]??0,g[p+2]=a?.[_*3+2]??0,g[p+3]=i?.[_]??255;}else if(r===0||r===4){let _=d[b];g[p]=_,g[p+1]=_,g[p+2]=_,g[p+3]=r===4?d[b+1]:255;}else g[p]=d[b],g[p+1]=d[b+1],g[p+2]=d[b+2],g[p+3]=r===6?d[b+3]:255;}return {width:n,height:o,data:g}}var g2=25.4,B0=72/g2,b2=50;function _2(e){let t=/^data:[^,]*?(;base64)?,(.*)$/s.exec(e);if(!t)return null;try{let n=t[1]?atob(t[2]):decodeURIComponent(t[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 y2(e){if(e[0]!==255||e[1]!==216)return null;let t=2;for(;t+9<e.length;){if(e[t]!==255)return null;let n=e[t+1];if(n===216||n>=208&&n<=215){t+=2;continue}let o=e[t+2]<<8|e[t+3];if(n===192||n===193||n===194){let r=e[t+5]<<8|e[t+6],a=e[t+7]<<8|e[t+8],i=e[t+9];return {width:a,height:r,components:i,progressive:n===194}}t+=2+o;}return null}async function x2(e,t){let{width:n,height:o,data:r}=e,a=t?4:3,i=new Uint8Array(n*o*a);for(let l=0;l<n*o;l++){let c=r[l*4+3]/255,u=r[l*4]*c+255*(1-c),m=r[l*4+1]*c+255*(1-c),f=r[l*4+2]*c+255*(1-c);if(t){let[d,g,h,p]=St(u,m,f);i.set([d*255,g*255,h*255,p*255].map(Math.round),l*a);}else i.set([Math.round(u),Math.round(m),Math.round(f)],l*a);}let s=await D0(i);return {kind:"raw",width:n,height:o,components:a,bytes:s??i,compressed:!!s}}async function $2(e,t){let n=e;if(!/^data:image\/(png|jpe?g)[;,]/i.test(n)){let i=await na(n);if(!i)return null;n=i;}let o=_2(n);if(!o)return null;let r=y2(o);if(r)return r.components===1||r.components===3?{kind:"jpeg",width:r.width,height:r.height,components:r.components,bytes:o,progressive:r.progressive}:null;let a=await Ks(o);return a?await x2(a,t):null}function S2(e){let t="",n=0,o=r=>{t+=r,n+=r.length,n>=76&&(t+=`
|
|
3
|
+
`,n=0);};for(let r=0;r<e.length;r+=4){let a=Math.min(4,e.length-r),i=0;for(let l=0;l<4;l++)i=i*256+(l<a?e[r+l]:0);if(i===0&&a===4){o("z");continue}let s=[];for(let l=0;l<5;l++)s.unshift(String.fromCharCode(i%85+33)),i=Math.floor(i/85);o(s.slice(0,a+1).join(""));}return `${t}~>`}var w2=`/qrdxdict 40 dict def
|
|
4
4
|
qrdxdict begin
|
|
5
5
|
/m {moveto} bind def
|
|
6
6
|
/l {lineto} bind def
|
|
@@ -21,11 +21,11 @@ qrdxdict begin
|
|
|
21
21
|
} bind def
|
|
22
22
|
/QRDX-Regular /Helvetica latin1
|
|
23
23
|
/QRDX-Bold /Helvetica-Bold latin1
|
|
24
|
-
end`;function
|
|
25
|
-
`));}};async function
|
|
26
|
-
`)}var Fm="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 Nm(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 aa(t,e={}){if(Nm(t))throw new Error(Fm);let n=oa(t,{size:e.sizeMm??c2,unit:"mm",bleed:e.bleedMm}),o=await Br(t);return await km(o,{width:n.trimWidth*Tm,bleed:n.bleed*Tm,bleedColor:n.bleed>0?ea(t,o):Us(t),colorMode:e.colorMode,background:_t(t.bgColor,ft)})}function ia(t){return `data:application/postscript;base64,${btoa(t)}`}async function g2(t,e={}){let n=await aa(t,e);Bt(ia(n),e.filename??"qr-code-print.eps");}var Ys={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:Tr,extension:"gif",vector:false},ico:{mimeType:an,extension:"ico",vector:false,sizes:Ho},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}},r6={small:{width:200,height:200},medium:{width:400,height:400},large:{width:800,height:800},xlarge:{width:1200,height:1200},"2xl":{width:1600,height:1600},"3xl":{width:2e3,height:2e3}};function Zs(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 Ie(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 Bt(t,e){let n=document.createElement("a");n.href=t,n.download=e,document.body.appendChild(n),n.click(),document.body.removeChild(n);}var Om=t=>(Ys[t]??Ys.png).mimeType;function b2(t,e,n){let{extension:o,vector:r,sizes:a}=Ys[t];if(r||a)return `qr-code.${o}`;let{width:i,height:s}=me(e.width,n);return `qr-code-${Math.round(i)}x${Math.round(s)}.${o}`}async function Dm(t,e={}){let n=await ge(t,"image/webp",true);try{return await qo(n,e)}finally{n.remove();}}async function Bm(t){let e=await ge(t,"image/png",true);try{return Do(e)}finally{e.remove();}}async function Gm(t){let e=await ge(t,"image/png",true);try{return await Uo(e,t.value)}finally{e.remove();}}async function Qm(t,e=Ho){let n=[];try{for(let o of e)n.push(await ge(Ie({...t,frame:void 0},o),"image/png",!0));return vs(n)}finally{for(let o of n)o.remove();}}var _2=25.4/72;async function Um(t){let e=await aa(t,{sizeMm:(t.size??it)*_2});return ia(e)}async function Hm(t){let e;try{({jsPDF:e}=await import('jspdf'));}catch(f){throw new Error(`PDF export needs the optional "jspdf" package. Install it with \`npm install jspdf\`. (${f})`)}let n=await Xt(t),o=decodeURIComponent(n.replace("data:image/svg+xml,","")),r;try{let f=new TextEncoder().encode(o),d=Array.from(f,h=>String.fromCharCode(h)).join("");r=`data:image/svg+xml;base64,${btoa(d)}`;}catch(f){throw new Error(`Failed to encode SVG for PDF conversion: ${f}`)}let{width:a,height:i}=me(t.size||it,t.frame),s=await new Promise((f,d)=>{let g=new Image,h=document.createElement("canvas");h.width=Math.round(a),h.height=Math.round(i);let p=h.getContext("2d");if(!p){d(new Error("Could not get canvas context"));return}let b=setTimeout(()=>{h.remove(),d(new Error("SVG load timeout - image may be too large or contain invalid data"));},3e4);g.onload=()=>{clearTimeout(b);try{p.drawImage(g,0,0,h.width,h.height),f(h);}catch(_){clearTimeout(b),h.remove(),d(new Error(`Failed to draw image to canvas: ${_}`));}},g.onerror=()=>{clearTimeout(b),h.remove(),d(new Error("Could not load SVG for PDF conversion"));},g.src=r;}),l=s.toDataURL("image/png",1),c=a*.264583,u=i*.264583,m=new e({orientation:c>u?"landscape":"portrait",unit:"mm",format:[c,u]});return m.addImage(l,"PNG",0,0,c,u),s.remove(),m.output("dataurlstring")}async function o6(t,e){let{format:n,size:o,filename:r,quality:a}=e,i=Zs(o.width,o.height);if(!i.isValid)throw new Error(i.error);let s=Ie(t,o.width),l=r||b2(n,o,t.frame);try{if(n==="svg"){let c=await Xt(s);Bt(c,l);}else if(n==="pdf"){let c=await Hm(s);Bt(c,l);}else if(n==="eps")Bt(await Um(s),l);else if(n==="webp"){let c=await Dm(s,{quality:a});Bt(await Ot(c),l);}else if(n==="bmp"){let c=await Bm(s);Bt(await Ot(c),l);}else if(n==="gif"){let c=await Gm(s);Bt(await Ot(c),l);}else if(n==="ico"){let c=await Qm(s);Bt(await Ot(c),l);}else {let c=Om(n),u=await ge(s,c);if(typeof u=="string")Bt(u,l);else throw new Error("Failed to generate image data URL")}}catch(c){throw console.error(`Error downloading ${n.toUpperCase()}:`,c),c}}async function a6(t,e,n,o={}){let r=Zs(n.width,n.height);if(!r.isValid)throw new Error(r.error);let a=Ie(t,n.width);if(e==="svg")return await Xt(a);if(e==="pdf")return await Hm(a);if(e==="eps")return await Um(a);if(e==="webp")return await Ot(await Dm(a,o));if(e==="bmp")return await Ot(await Bm(a));if(e==="gif")return await Ot(await Gm(a));if(e==="ico")return await Ot(await Qm(a));let i=Om(e),s=await ge(a,i);if(typeof s=="string")return s;throw new Error("Failed to generate QR code data URL")}async function i6(t,e={width:it,height:it}){try{let n=Zs(e.width,e.height);if(!n.isValid)throw new Error(n.error);let o=Ie(t,e.width),r=ge(o,"image/png",!0).then(a=>new Promise((i,s)=>{let l=a;l.toBlob(c=>{l.remove(),c?i(c):s(new Error("Failed to create blob from canvas"));},"image/png");}));await navigator.clipboard.write([new ClipboardItem({"image/png":r})]);}catch(n){throw console.error("Error copying to clipboard:",n),n}}async function s6(t){let e=await Xt(t);return decodeURIComponent(e.replace("data:image/svg+xml,",""))}var Dt={maxBytes:2e5,maxElements:500,maxDepth:16,maxInputSegments:4e3,maxColors:8,artboardSide:1e3,decimals:1,padding:.06},rt=class extends Error{},y2={script:t=>`Removed ${yt(t,"script")}`,style:t=>`Removed ${yt(t,"style sheet")}: colors set with CSS classes are lost. Export with presentation attributes (Illustrator: Styling \u2192 Presentation Attributes)`,"foreign-object":t=>`Removed ${yt(t,"foreignObject element")}`,image:t=>`Removed ${yt(t,"image")}: frames are vector shapes only`,use:t=>`Removed ${yt(t,"<use> reference")}: ungroup or detach symbols before exporting`,text:t=>`Removed ${yt(t,"text element")}: add text as labels in the frame editor`,effects:t=>`Removed ${yt(t,"filter, mask, clip path or pattern")}`,animation:t=>`Removed ${yt(t,"animation")}`,unknown:t=>`Removed ${yt(t,"unsupported element")}`,"nested-svg":t=>`Removed ${yt(t,"nested <svg>")}: flatten it first`,handlers:t=>`Removed ${yt(t,"event handler attribute")}`,links:t=>`Removed ${yt(t,"link")} (href)`,"external-paint":t=>`Removed ${yt(t,"fill or stroke")} that referenced something outside the file`,gradient:t=>`Flattened ${yt(t,"gradient")} to its first color: add gradients in the frame editor`,opacity:t=>`Made ${yt(t,"semi-transparent shape")} opaque (print files have no transparency)`,"invalid-paint":t=>`${yt(t,"color")} couldn't be read and fell back to the parent color`,stroke:t=>`Removed ${yt(t,"stroke")} on paths, polygons or polylines: outline strokes before exporting (Figma: Outline stroke)`,dash:t=>`Drew ${yt(t,"dashed stroke")} as solid`,clipped:t=>`Cut ${yt(t,"shape")} at the edge of the artboard`,outside:t=>`Removed ${yt(t,"shape")} outside the artboard`,colors:t=>`Merged ${yt(t,"color")} with similar ones (${Dt.maxColors} at most)`,"qr-placed":()=>'No QR placeholder found (a rect with id "qr"): the code was centered; place it in the frame editor'};function yt(t,e){return `${t} ${e}${t===1?"":"s"}`}var el=class{counts=new Map;add(e,n=1){this.counts.set(e,(this.counts.get(e)??0)+n);}list(){return [...this.counts].map(([e,n])=>({code:e,count:n,message:y2[e](n)}))}},x2=/^\s*<\?xml\s[^?>]*\?>/,Ks=/[A-Za-z_][\w:.-]*/y,Js=/<\/([A-Za-z_][\w:.-]*)\s*>/y,sa=/\s*/y,$2=/[A-Za-z_:][\w:.-]*/y,S2=/[^"<]*/y,w2=/[^'<]*/y;function Kn(t,e,n){return t.lastIndex=n,t.test(e)?t.lastIndex:n}function zm(t,e){let n=Kn(sa,t,e),o=Kn($2,t,n);if(n===e||o===n)return -1;let r=Kn(sa,t,o);if(t[r]!=="=")return -1;let a=Kn(sa,t,r+1),i=t[a];if(i!=='"'&&i!=="'")return -1;let l=Kn(i==='"'?S2:w2,t,a+1);return t[l]===i?l+1:-1}function C2(t,e){let n=Kn(sa,t,e);return t[n]===">"?{end:n+1,selfClosing:false}:t.startsWith("/>",n)?{end:n+2,selfClosing:true}:null}function R2(t){let e=[],n=0,o="",r=0;for(;r<t.length;){let a=t.indexOf("<",r);if(a<0)break;if(r=a,t.startsWith("<!--",r)){let c=t.indexOf("-->",r+4);if(c<0)throw new rt("The SVG has an unclosed comment");r=c+3;continue}if(t.startsWith("<![CDATA[",r)){let c=t.indexOf("]]>",r+9);if(c<0)throw new rt("The SVG has an unclosed CDATA section");r=c+3;continue}if(t.startsWith("<?",r)){let c=t.indexOf("?>",r+2);if(c<0)throw new rt("The SVG has an unclosed declaration");r=c+2;continue}if(t.startsWith("<!",r))throw new rt("DOCTYPE and other declarations are not allowed");if(t[r+1]==="/"){Js.lastIndex=r;let c=Js.exec(t);if(!c)throw new rt("The SVG has a malformed closing tag");if(e.pop()!==c[1])throw new rt(`The SVG closes <${c[1]}> out of order`);r=Js.lastIndex;continue}Ks.lastIndex=r+1;let i=Ks.exec(t);if(!i)throw new rt("The SVG has a malformed tag");let s=Ks.lastIndex;for(let c=zm(t,s);c>=0;c=zm(t,s))s=c;let l=C2(t,s);if(!l)throw new rt(`The SVG has a malformed <${i[0]}> tag (attributes must be quoted and may not contain "<")`);if(n++,n>Dt.maxElements)throw new rt(`The SVG has more than ${Dt.maxElements} elements`);if(o||(o=i[0]),!l.selfClosing&&(e.push(i[0]),e.length>Dt.maxDepth))throw new rt(`The SVG nests elements more than ${Dt.maxDepth} deep`);r=l.end;}if(e.length>0)throw new rt(`The SVG doesn't close <${e.at(-1)}>`);return o}function M2(t){if(typeof t!="string")throw new rt("Expected SVG markup as a string");let e=new TextEncoder().encode(t).length;if(e>Dt.maxBytes)throw new rt(`The SVG is ${Math.ceil(e/1e3)} KB; the limit is ${Dt.maxBytes/1e3} KB`);if(/<!(?:DOCTYPE|ENTITY|ATTLIST|ELEMENT|NOTATION)/i.test(t))throw new rt("DOCTYPE and entity declarations are not allowed");let n=t.replace(x2,"");if(n.includes("<?"))throw new rt("Processing instructions (such as xml-stylesheet) are not allowed");if(R2(n)!=="svg")throw new rt("The file must start with an <svg> element");return n}var tl=t=>Math.round(Math.min(255,Math.max(0,t))).toString(16).padStart(2,"0");function Yt(t){let e=t?.replace(/!important/i,"").trim();return e===""||e==="inherit"?void 0:e}function nl(t,e,n,o){let r=t.trim();if(r==="none"||r==="transparent")return null;if(/^url\(/i.test(r)){let i=/^url\(\s*['"]?#([^)'"\s]+)['"]?\s*\)/i.exec(r)?.[1],s=i?n.get(i):void 0;return s?(o.add("gradient"),nl(s,e,n,o)):(o.add("external-paint"),null)}let a=at(r==="currentColor"?e.color:r);return a?a.a<=0?null:`#${tl(a.r)}${tl(a.g)}${tl(a.b)}`:(o.add("invalid-paint"),null)}function E2(t){let e=new Map,n=r=>{(r.name==="linearGradient"||r.name==="radialGradient")&&r.attrs.id&&e.set(r.attrs.id,r);for(let a of r.children)n(a);};n(t);let o=new Map;for(let[r,a]of e){let i=a.children.find(l=>l.name==="stop");if(!i){let l=(a.attrs.href??a.attrs["xlink:href"])?.match(/^#(.+)$/)?.[1];i=l?e.get(l)?.children.find(c=>c.name==="stop"):void 0;}let s=i&&Yt(j(i,"stop-color"));s&&o.set(r,s);}return o}function Wm(t,e){return t.map(n=>{if(n.op==="Z")return n;if(n.op==="C"){let[a,i]=q(e,n.x1,n.y1),[s,l]=q(e,n.x2,n.y2),[c,u]=q(e,n.x,n.y);return {op:"C",x1:a,y1:i,x2:s,y2:l,x:c,y:u}}let[o,r]=q(e,n.x,n.y);return {op:n.op,x:o,y:r}})}function A2(t){let e=0;return t.forEach(([n,o],r)=>{let[a,i]=t[(r+1)%t.length];e+=n*i-a*o;}),e/2}function ol(t){return t.length<3?[]:[...t.map(([e,n],o)=>({op:o===0?"M":"L",x:e,y:n})),{op:"Z"}]}var ve=t=>Number.isFinite(t);function ht(t,e,n=0){let o=Number.parseFloat(t.attrs[e]??"");return ve(o)?o:n}function qm(t){switch(t.name){case "path":return le(t.attrs.d??"");case "rect":{let e=t.attrs.rx??t.attrs.ry,n=t.attrs.ry??t.attrs.rx;return ne(ht(t,"x"),ht(t,"y"),ht(t,"width"),ht(t,"height"),Number.parseFloat(e??"0")||0,Number.parseFloat(n??"0")||0)}case "circle":{let e=ht(t,"r");return ee(ht(t,"cx"),ht(t,"cy"),e,e)}case "ellipse":return ee(ht(t,"cx"),ht(t,"cy"),ht(t,"rx"),ht(t,"ry"));case "polygon":case "polyline":{let e=te(t.attrs.points),n=[];for(let o=0;o+1<e.length;o+=2)n.push([e[o],e[o+1]]);return ol(n)}default:return []}}function P2(t,e){let n=e/2;switch(t.name){case "rect":{let o=ht(t,"x"),r=ht(t,"y"),a=ht(t,"width"),i=ht(t,"height"),s=Number.parseFloat(t.attrs.rx??t.attrs.ry??"0")||0,l=ne(o-n,r-n,a+e,i+e,s>0?s+n:0,s>0?s+n:0);if(a<=e||i<=e)return l;let c=Math.max(s-n,0);return [...l,...ne(o+n,r+n,a-e,i-e,c,c)]}case "circle":case "ellipse":{let o=ht(t,"cx"),r=ht(t,"cy"),a=t.name==="circle"?ht(t,"r"):ht(t,"rx"),i=t.name==="circle"?ht(t,"r"):ht(t,"ry"),s=ee(o,r,a+n,i+n);return a<=n||i<=n?s:[...s,...ee(o,r,a-n,i-n)]}case "line":{let[o,r,a,i]=["x1","y1","x2","y2"].map(m=>ht(t,m)),s=Math.hypot(a-o,i-r);if(s===0)return [];let l=-(i-r)/s*n,c=(a-o)/s*n,u=[[o+l,r+c],[a+l,i+c],[a-l,i-c],[o-l,r-c]];return ol(A2(u)<0?u.reverse():u)}default:return null}}var I2=new Set(["path","rect","circle","ellipse","polygon","polyline","line"]),v2=new Set(["defs","linearGradient","radialGradient","stop","title","desc","metadata"]),L2={script:"script",style:"style",foreignObject:"foreign-object",image:"image",feImage:"image",use:"use",text:"text",tspan:"text",textPath:"text",filter:"effects",mask:"effects",clipPath:"effects",pattern:"effects",marker:"effects",symbol:"effects",animate:"animation",animateMotion:"animation",animateTransform:"animation",set:"animation"},T2=/^(?:qrdx[-_ ]?)?qr(?:[-_ ]?code)?$/i;function jm(t,e){for(let n of Object.keys(t.attrs)){let o=n.toLowerCase();o.startsWith("on")?e.add("handlers"):o==="href"||o==="xlink:href"?t.name!=="linearGradient"&&t.name!=="radialGradient"&&e.add("links"):(o==="filter"||o==="mask"||o==="clip-path")&&e.add("effects");}}function Xm(t,e,n,o,r){if(jm(t,o),Yt(j(t,"display"))==="none"||Yt(j(t,"visibility"))==="hidden")return;let a=Number.parseFloat(j(t,"opacity")??"1"),i=Yt(j(t,"fill-rule")),s=Number.parseFloat(Yt(j(t,"stroke-width"))??""),l={matrix:mt(e.matrix,Ut(t.attrs.transform)),fill:Yt(j(t,"fill"))??e.fill,fillRule:i==="evenodd"||i==="nonzero"?i:e.fillRule,stroke:Yt(j(t,"stroke"))??e.stroke,strokeWidth:ve(s)&&s>=0?s:e.strokeWidth,color:Yt(j(t,"color"))??e.color,opacity:e.opacity*(ve(a)?a:1)};for(let c of t.children){if(v2.has(c.name))continue;let u=L2[c.name];if(u){o.add(u);continue}if(c.name==="svg"){o.add("nested-svg");continue}if(c.name==="g"||c.name==="a"){Xm(c,l,n,o,r);continue}if(!I2.has(c.name)){o.add("unknown");continue}k2(c,l,n,o,r);}}function k2(t,e,n,o,r){if(jm(t,o),Yt(j(t,"display"))==="none"||Yt(j(t,"visibility"))==="hidden")return;let a=mt(e.matrix,Ut(t.attrs.transform));if(t.name==="rect"&&T2.test(t.attrs.id??"")&&!r.qrBox){r.qrBox=He(Wm(qm(t),a));return}let i=p=>Yt(j(t,p)),s=e.opacity*Number.parseFloat(i("opacity")??"1"),l=Number.parseFloat(i("fill-opacity")??"1"),c=Number.parseFloat(i("stroke-opacity")??"1"),u=i("fill-rule"),m={...e,fill:i("fill")??e.fill,fillRule:u==="evenodd"||u==="nonzero"?u:e.fillRule,stroke:i("stroke")??e.stroke,color:i("color")??e.color},f=Number.parseFloat(i("stroke-width")??""),d=ve(f)&&f>=0?f:e.strokeWidth,g=(p,b,_)=>{if(p.length!==0){if(r.segments+=p.length,r.segments>Dt.maxInputSegments)throw new rt(`The SVG has more than ${Dt.maxInputSegments} path segments; simplify it`);r.shapes.push({segments:Wm(p,a),fill:b,fillRule:_});}},h=p=>{let b=(ve(s)?s:1)*(ve(p)?p:1);return b<=0?false:(b<1&&o.add("opacity"),true)};if(t.name!=="line"){let p=nl(m.fill,m,n,o);p&&h(l)&&g(qm(t),p,m.fillRule);}if(d>0&&m.stroke!=="none"){let p=nl(m.stroke,m,n,o);if(p&&h(c)){let b=P2(t,d);b?((i("stroke-dasharray")??"none")!=="none"&&o.add("dash"),g(b,p,t.name==="line"?"nonzero":"evenodd")):o.add("stroke");}}}function F2(t,e){let n=c=>{let u=10**e;return Math.round(c*u)/u+0},o=c=>x(c,e),r="",a=0,i=0,s=0,l=0;for(let c of t){if(c.op==="Z"){r+="z",a=s,i=l;continue}let u=n(c.x),m=n(c.y);if(c.op==="M")r+=`m${o(u-a)} ${o(m-i)}`,s=u,l=m;else if(c.op==="L"){if(u===a&&m===i)continue;r+=m===i?`h${o(u-a)}`:u===a?`v${o(m-i)}`:`l${o(u-a)} ${o(m-i)}`;}else r+=`c${o(n(c.x1)-a)} ${o(n(c.y1)-i)} ${o(n(c.x2)-a)} ${o(n(c.y2)-i)} ${o(u-a)} ${o(m-i)}`;a=u,i=m;}return r}var N2=(t,e)=>t.x0<e.x1&&e.x0<t.x1&&t.y0<e.y1&&e.y0<t.y1;function O2(t){let e=[];for(let n of t){let o=He(n.segments);if(!o)continue;let r=e.at(-1);r&&r.shape.fill===n.fill&&r.shape.fillRule===n.fillRule&&!r.boxes.some(a=>N2(a,o))?(r.shape={...r.shape,segments:[...r.shape.segments,...n.segments]},r.boxes.push(o)):e.push({shape:n,boxes:[o]});}return e.map(n=>n.shape)}var rl=t=>[Number.parseInt(t.slice(1,3),16),Number.parseInt(t.slice(3,5),16),Number.parseInt(t.slice(5,7),16)];function D2(t,e,n){let o=new Map;for(let i of t)o.set(i.fill,(o.get(i.fill)??0)+1);let r=new Map([...o.keys()].map(i=>[i,i])),a=0;for(;o.size>e;){let i=[...o.keys()],s=[i[0],i[1]],l=Number.POSITIVE_INFINITY;for(let d=0;d<i.length;d++)for(let g=d+1;g<i.length;g++){let h=rl(i[d]),p=rl(i[g]),b=Math.hypot(h[0]-p[0],h[1]-p[1],h[2]-p[2]);b<l&&(l=b,s=[i[d],i[g]]);}let[c,u]=s,[m,f]=(o.get(c)??0)>=(o.get(u)??0)?[c,u]:[u,c];o.set(m,(o.get(m)??0)+(o.get(f)??0)),o.delete(f);for(let[d,g]of r)g===f&&r.set(d,m);a++;}return a>0&&n.add("colors",a),r}var Vm=t=>{let[e,n,o]=rl(t);return .2126*e+.7152*n+.0722*o>235};function B2(t,e={}){let n=new el;try{let o=M2(t),r=xe(o);if(!r)throw new rt("No <svg> element found");let a=te(r.attrs.viewBox),[i,s,l,c]=[0,0,0,0];if(a.length===4&&a[2]>0&&a[3]>0?[i,s,l,c]=a:(l=ht(r,"width"),c=ht(r,"height")),!(ve(l)&&ve(c)&&l>0&&c>0))throw new rt("The SVG needs a viewBox (or a width and height)");let m=Dt.artboardSide/Math.max(l,c),f=Math.round(l*m*10)/10,d=Math.round(c*m*10)/10;if(Math.min(f,d)<ot.minArtboard)throw new rt("The artboard is too narrow: its sides may differ by 20 times at most");let g=[m,0,0,m,-i*m,-s*m],h={shapes:[],qrBox:null,segments:0};Xm(r,{matrix:g,fill:"#000000",fillRule:"nonzero",stroke:"none",strokeWidth:1,color:"#000000",opacity:1},E2(r),n,h);let p={x0:0,y0:0,x1:f,y1:d},b=Math.max(f,d)*.004,_=[],y=0,w=0;for(let N of h.shapes){let B=He(N.segments);if(!B||B.x1<=0||B.y1<=0||B.x0>=f||B.y0>=d){y++;continue}if(B.x0<-b||B.y0<-b||B.x1>f+b||B.y1>d+b){let Z=Jr(N.segments,.25).map(Pt=>Rn(Pt,p)).filter(Pt=>Pt.length>2);if(Z.length===0){y++;continue}w++,_.push({...N,segments:Z.flatMap(Pt=>ol(Pt))});}else _.push(N);}if(y>0&&n.add("outside",y),w>0&&n.add("clipped",w),_.length===0)throw new rt("The SVG has no filled shapes to use");let C=D2(_,Dt.maxColors,n);for(let N of _)N.fill=C.get(N.fill)??N.fill;let S=new Map,$=new Map;for(let N of _){let B=He(N.segments);S.set(N.fill,(S.get(N.fill)??0)+(B.x1-B.x0)*(B.y1-B.y0)),$.set(N.fill,($.get(N.fill)??0)+1);}let R=[...S.keys()].sort((N,B)=>Number(Vm(N))-Number(Vm(B))||S.get(B)-S.get(N)),M=R[0],E=R[1],P=N=>N===M?"frame":N===E?"accent":N,v=h.qrBox;if(!v&&e.qr){let[N,B]=q(g,e.qr.x,e.qr.y);v={x0:N,y0:B,x1:N+e.qr.size*m,y1:B+e.qr.size*m};}let L,F,k;v?(L=Math.min(v.x1-v.x0,v.y1-v.y0),F=(v.x0+v.x1-L)/2,k=(v.y0+v.y1-L)/2):(n.add("qr-placed"),L=Math.min(f,d)*.6,F=(f-L)/2,k=(d-L)/2);let T=N=>Math.round(N*10)/10+0;if(L=Math.floor(L*10)/10,F=T(F),k=T(k),L<Math.min(f,d)*ot.minQrShare)throw new rt("The QR area must be at least half the frame's shorter side");let z=Math.min(F,k,f-F-L,d-k-L);if(z<L*ot.minPadding-1e-9)throw new rt("Leave room around the QR area: at least 4% of its size on every side, inside the artboard");let W=Math.min(Math.max(e.padding??Dt.padding,ot.minPadding),.2),D=Math.floor(Math.min(L*W,z)*10)/10,U=O2(_);if(U.length>ot.maxShapes)throw new rt(`The artwork has ${U.length} separate shapes; the limit is ${ot.maxShapes}. Combine shapes of the same color first`);let X={kind:ir,version:sr,artboard:{width:f,height:d},qr:{x:F,y:k,size:L,padding:D},colors:{frame:M,...E&&{accent:E}},shapes:U.map(N=>({type:"path",d:F2(N.segments,Dt.decimals),fill:P(N.fill),...N.fillRule==="evenodd"&&{fillRule:"evenodd"}})),labels:[]},xt=io(X);if(!xt.success){let N=xt.issues[0];throw new rt(`The converted frame doesn't fit the frame format: ${N?.message??"invalid"}`)}let lt=R.map(N=>({color:N,ref:N===M?"frame":N===E?"accent":"fixed",shapes:$.get(N)??0}));return {ok:!0,spec:xt.data,warnings:n.list(),palette:lt}}catch(o){return {ok:false,error:o instanceof rt?o.message:`Could not read the SVG (${o instanceof Error?o.name:"error"})`,warnings:n.list()}}}var G2=1114,Q2={"call-to-action":134,holidays:283,seasons:60,"food-drink":71,shopping:64,"beauty-wellness":26,events:77,places:71,"real-estate":35,automotive:27,"health-learning":48,"sports-fitness":36,business:82,nonprofit:28,objects:28,playful:44};var U2=[{id:"call-to-action",label:"Call to action"},{id:"holidays",label:"Holidays"},{id:"seasons",label:"Seasons"},{id:"food-drink",label:"Food & drink"},{id:"shopping",label:"Shops & packaging"},{id:"beauty-wellness",label:"Beauty & wellness"},{id:"events",label:"Events & weddings"},{id:"places",label:"Places & Wi-Fi"},{id:"real-estate",label:"Real estate"},{id:"automotive",label:"Cars & parking"},{id:"health-learning",label:"Health & learning"},{id:"sports-fitness",label:"Sports & fitness"},{id:"business",label:"Business & social"},{id:"nonprofit",label:"Nonprofits & community"},{id:"objects",label:"Everyday objects"},{id:"playful",label:"Playful & surprising"}];function al(t){return Array.isArray(t)?`[${t.map(al).join(",")}]`:t&&typeof t=="object"?`{${Object.keys(t).filter(n=>t[n]!==void 0).sort().map(n=>`${JSON.stringify(n)}:${al(t[n])}`).join(",")}}`:JSON.stringify(t)}function H2(t){let e=al(t),n=2166136261;for(let o=0;o<e.length;o++)n^=e.charCodeAt(o),n=Math.imul(n,16777619)>>>0;return n.toString(16).padStart(8,"0")}function z2(t,e){return dt.QrCode.encodeText(t,St[e??Jt]).size}function Ym(t,e,n,o=n.size*(e?.size??Na)){let r={src:t,width:o,height:o,excavate:true,...e?.shape&&e.shape!=="square"&&{shape:e.shape},...e?.plate&&{plate:e.plate}},a=e?.x!==void 0||e?.y!==void 0;if(!(e?.padding||a))return r;let i=z2(n.value,n.level),s=Et(i,n.margin,n.shape),l=n.size/(i+2*s);if(e.padding&&(r.padding=e.padding*l),a){let c=i*l,u=m=>Math.min(Math.max((m??.5)*c-o/2,0),c-o);r.x=u(e.x),r.y=u(e.y);}return r}function Zm(t,e,n,o){let r=n.level??Jt,a=r;o&&(a=At({...n,imageSettings:Ym(t,e,n),autoLevel:o}));let i=l=>{let c=m=>Ym(t,e,{...n,level:l},m),u=_s(n,[l],c().width,c);return u>0?c(u):void 0};if(a===r)return i(r);let s=i(a);return s&&At({...n,imageSettings:s,autoLevel:o})===a?s:i(r)}function W2({value:t,level:e,margin:n,shape:o,autoLevel:r,logoOptions:a}){let s=Zm("data:,",{...a,size:Fa},{value:`${t}`,size:1024,margin:n??pt,level:e,shape:o},r);return s?s.width/1024:0}function il({value:t,size:e=1024,fgColor:n,bgColor:o,eyeColor:r,dotColor:a,bodyPattern:i,hideLogo:s,logo:l,logoOptions:c,margin:u,cornerEyePattern:m,cornerEyeDotPattern:f,level:d,templateId:g,frame:h,eyeColors:p,moduleScale:b,autoLevel:_,shape:y,eyeShapes:w,eyeGradient:C,bgRadius:S,backdrop:$,halo:R,shadow:M}){let E={value:`${t}`,size:e,margin:u??pt,level:d,shape:y},P=!s&&l?Zm(l,c,E,_):void 0;return {value:E.value,bgColor:o,fgColor:n,eyeColor:r,dotColor:a,bodyPattern:i,cornerEyePattern:m,cornerEyeDotPattern:f,level:d,templateId:g,size:e,margin:u,...h&&{frame:h},...p&&{eyeColors:p},...b!==void 0&&{moduleScale:b},..._&&{autoLevel:_},...y&&y!=="square"&&{shape:y},...w&&{eyeShapes:w},...C&&C!=="corner"&&{eyeGradient:C},...S&&{bgRadius:S},...$&&{backdrop:$},...R&&{halo:R},...M&&{shadow:M},...P&&{imageSettings:P}}}var Km=.06,Jm=.16,td=512;function ed(t){let{width:e,height:n}=t;if(!(e>0&&n>0)||t.data.length<e*n*4)return null;let o=Uint8Array.from(t.data),r=Li({width:e,height:n,data:o});if(!r)return null;let a=d=>{let g=d*4;return Math.hypot(o[g]/255-r[0],o[g+1]/255-r[1],o[g+2]/255-r[2])},i=new Uint8Array(e*n),s=new Int32Array(e*n),l=0,c=0,u=d=>{i[d]||o[d*4+3]===0||a(d)>=Jm||(i[d]=1,s[c++]=d);};for(let d=0;d<e;d++)u(d),u((n-1)*e+d);for(let d=0;d<n;d++)u(d*e),u(d*e+e-1);for(;l<c;){let d=s[l++],g=d%e;g>0&&u(d-1),g<e-1&&u(d+1),d>=e&&u(d-e),d<(n-1)*e&&u(d+e);}let m=new Uint8ClampedArray(o),f=r;for(let d=0;d<e*n;d++){if(!i[d])continue;let g=Math.min(1,Math.max(0,(a(d)-Km)/(Jm-Km))),h=d*4;if(m[h+3]=Math.round(o[h+3]*g),g>0&&g<1)for(let p=0;p<3;p++){let _=(o[h+p]/255-(1-g)*f[p])/g;m[h+p]=Math.round(Math.min(1,Math.max(0,_))*255);}}return {width:e,height:n,data:m}}async function q2(t){if(typeof document>"u"||typeof Image>"u")throw new Error("removeLogoBackground needs a browser (canvas)");let e=await new Promise(s=>{let l=new Image;l.crossOrigin="anonymous",l.onload=()=>s(l),l.onerror=()=>s(null),l.src=t;});if(!e)return null;let n=e.naturalWidth||512,o=e.naturalHeight||512,r=Math.min(1,td/Math.max(n,o)),a=document.createElement("canvas");a.width=Math.max(1,Math.round(n*r)),a.height=Math.max(1,Math.round(o*r));let i=a.getContext("2d",{willReadFrequently:true});if(!i)return null;try{i.drawImage(e,0,0,a.width,a.height);let s=i.getImageData(0,0,a.width,a.height),l=ed(s);return l?(s.data.set(l.data),i.putImageData(s,0,0),a.toDataURL("image/png")):null}catch{return null}finally{a.remove();}}var V2={value:true,size:true,level:true,bgColor:true,fgColor:true,eyeColor:true,dotColor:true,bodyPattern:true,cornerEyePattern:true,cornerEyeDotPattern:true,margin:true,style:true,imageSettings:true,isOGContext:true,templateId:true,customTemplate:true,customProps:true,frame:true,art:true,eyeColors:true,moduleScale:true,autoLevel:true,shape:true,eyeShapes:true,eyeGradient:true,bgRadius:true,backdrop:true,halo:true,shadow:true,frameLabelMarkers:true,partMarkers:true,hideLogo:true,logo:true,logoOptions:true,scale:true};function j2(t){let e={};for(let n of Object.keys(t))Object.hasOwn(V2,n)||(e[n]=t[n]);return e}var sl=["value","fgColor","hideLogo","bgColor","eyeColor","dotColor","bodyPattern","cornerEyePattern","cornerEyeDotPattern","level","templateId","logo","logoOptions","margin","autoLevel","shape","eyeShapes","eyeGradient","bgRadius","backdrop","halo","shadow"];function la(t){let e=Object.fromEntries(sl.map(n=>[n,t[n]]));return il({...e,margin:t.margin??pt})}function ca(t,e){let{size:n=it,scale:o=1,level:r,style:a,customTemplate:i,customProps:s,frame:l,art:c,eyeColors:u,moduleScale:m,autoLevel:f,shape:d,frameLabelMarkers:g,partMarkers:h}=t,p={...e.eyeShapes&&{eyeShapes:e.eyeShapes},...e.eyeGradient&&{eyeGradient:e.eyeGradient},...e.bgRadius&&{bgRadius:e.bgRadius},...e.backdrop&&{backdrop:e.backdrop},...e.halo&&{halo:e.halo},...e.shadow&&{shadow:e.shadow}},b=n*o,_=b/e.size,y=e.imageSettings&&{...e.imageSettings,height:e.imageSettings.height*_,width:e.imageSettings.width*_,...e.imageSettings.x!=null&&{x:e.imageSettings.x*_},...e.imageSettings.y!=null&&{y:e.imageSettings.y*_},...e.imageSettings.padding!=null&&{padding:e.imageSettings.padding*_}};return {art:c,bgColor:e.bgColor,bodyPattern:e.bodyPattern,cornerEyeDotPattern:e.cornerEyeDotPattern,cornerEyePattern:e.cornerEyePattern,customProps:s,customTemplate:i,dotColor:e.dotColor,eyeColor:e.eyeColor,fgColor:e.fgColor,frame:l,level:r||e.level,margin:e.margin,...u&&{eyeColors:u},...m!==void 0&&{moduleScale:m},...f&&{autoLevel:f},...d&&d!=="square"&&{shape:d},...p,...g&&{frameLabelMarkers:g},...h&&{partMarkers:h},size:b,style:a,templateId:e.templateId,value:e.value,...y&&{imageSettings:y},...j2(t)}}function X2(t){return ca(t,la(t))}function nd(t,e){let n=[],o=r=>{if(r==null||typeof r=="boolean")return;if(typeof r=="string"||typeof r=="number"||typeof r=="bigint"){n.push(`${r}`);return}if(Array.isArray(r)){for(let c of r)o(c);return}if(!Oe(r))throw new TypeError("qrdx: can't render this value");let{type:a,props:i,key:s}=r;if(Sn(a)){o(i.children);return}if(typeof a=="function"){o(a(i));return}let l={};for(let c of Object.keys(i)){let u=Yn(c,i[c]);u&&(l[u.name]=u.value);}n.push(e(a,l,nd(i.children,e),s));};return o(t),n}var Jn=300,Gr=t=>{let e=typeof t=="number"?t:Number.parseFloat(String(t));return Number.isFinite(e)?e:void 0};function Y2(t){let e=Gr(t.x)??0,n=Gr(t.y)??0,o=te(typeof t.viewBox=="string"?t.viewBox:void 0),r=Gr(t.width),a=Gr(t.height);if(o.length!==4||!(o[2]&&o[3]&&r&&a))return [1,0,0,1,e,n];let[i,s,l,c]=o,u=Math.min(r/l,a/c);return [u,0,0,u,e+(r-l*u)/2-i*u,n+(a-c*u)/2-s*u]}function ll(t,e,n,o){if(t===e)return n;if(Array.isArray(t)){for(let s of t){let l=ll(s,e,n,false);if(l)return l}return null}let r=t;if(!r||typeof r!="object"||!r.props)return null;let{props:a}=r,i=mt(n,Ut(typeof a.transform=="string"?a.transform:void 0));return r.type==="svg"&&!o&&(i=mt(i,Y2(a))),ll(a.children,e,i,false)}function cl(t){let e=t.customTemplate||(t.templateId?Lo(t.templateId):void 0);if(!e)return 1;let n={type:"svg",props:{height:Jn,viewBox:`0 0 ${Jn} ${Jn}`,width:Jn},key:null},o;try{o=e.wrapper(n,{fgColor:typeof t.fgColor=="string"?t.fgColor:void 0,bgColor:typeof t.bgColor=="string"?t.bgColor:void 0,...t.customProps??{}},{pixelSize:10,url:t.value});}catch{return 1}let r=o?.props;if(!r)return 1;let a=te(typeof r.viewBox=="string"?r.viewBox:void 0),i=a.length===4?a[2]:Gr(r.width),s=ll(o,n,En,true);if(!(s&&i))return 1;let[l,c]=q(s,0,0),[u,m]=q(s,Jn,Jn),d=Math.min(Math.abs(u-l),Math.abs(m-c))/i;return d>0&&d<=1?d:1}var cd=[96,160,320],ml=640;function fl(){if(typeof document>"u")throw new Error("Scan scoring needs a browser (canvas + image decoding)")}function Te(t){if(t?.aborted)throw new DOMException("Scan scoring was aborted","AbortError")}var ud=()=>new Promise(t=>setTimeout(t,0));async function hl(){let{default:t}=await import('jsqr');return t}function dl(t,e){if(!t)return false;if(t.data===e)return true;try{return new TextDecoder().decode(Uint8Array.from(t.binaryData))===e}catch{return false}}function Z2(t,e,n=.7){let{data:o,width:r,height:a}=t;for(let u=0;u<o.length;u+=4)for(let m=0;m<3;m++)o[u+m]=128+(o[u+m]-128)*n;let i=Math.max(1,Math.round(e*.25)),s=2*i+1,l=new Float32Array(r*a*3),c=u=>{let m=u?a:r,f=u?r:a,d=u?r:1,g=u?1:r;for(let h=0;h<m;h++){let p=h*d,b=0,_=0,y=0;for(let w=-i;w<=i;w++){let C=(p+Math.min(Math.max(w,0),f-1)*g)*4;b+=o[C],_+=o[C+1],y+=o[C+2];}for(let w=0;w<f;w++){let C=(p+w*g)*3;l[C]=b/s,l[C+1]=_/s,l[C+2]=y/s;let S=(p+Math.max(w-i,0)*g)*4,$=(p+Math.min(w+i+1,f-1)*g)*4;b=b-o[S]+o[$],_=_-o[S+1]+o[$+1],y=y-o[S+2]+o[$+2];}}for(let h=0,p=0;h<r*a*3;h+=3,p+=4)o[p]=l[h],o[p+1]=l[h+1],o[p+2]=l[h+2];};for(let u=0;u<2;u++)c(true),c(false);}function tr(t,e){let n=document.createElement("canvas");n.width=Math.max(1,Math.round(t)),n.height=Math.max(1,Math.round(e));let o=n.getContext("2d",{willReadFrequently:true});if(!o)throw new Error("Could not get canvas context");return o.imageSmoothingEnabled=true,o.imageSmoothingQuality="high",{canvas:n,ctx:o}}var K2=[.9,1,1.1];function pl(t,e,n,o,r){let a=0;for(let i of K2){let s=n*i,l=e(s);Z2(l,s/o),r(t(l.data,l.width,l.height))&&a++;}return a>=2?"pass":a===1?"fragile":"fail"}var ul={small:"small print or far away",medium:"typical phone distance",large:"close up"};function J2(t,e){return t===e[0]&&e.length>1?ul.small:t===e.at(-1)?ul.large:ul.medium}function md(t,e,n){if(n==="pass")return 0;let o=e===1?[45]:e===2?[20,45]:[15,20,45],r=o[Math.round(t*(o.length-1)/Math.max(e-1,1))]??20;return n==="fragile"?Math.round(r/2):r}function dd(t,e,n){let o=`${t} px (${J2(t,e)})`;return n==="pass"?{id:`decode-${t}`,passed:true,message:`Reads at ${o}, with camera blur`}:{id:`decode-${t}`,passed:false,message:n==="fragile"?`Reads at ${o} only some of the time`:`Doesn't read at ${o}`,fix:t===e[0]?"Print it bigger, shorten the content (fewer modules) or use solid square dots":"Raise the contrast, use bigger dots or a simpler eye shape"}}function fd(t,e){return e?"fails":t>=85?"great":t>=65?"ok":"risky"}function tb(t,e,n){let o=Tt(t,e);if(o.type==="solid")return [o.color];if(o.type!=="image")return o.stops.map(s=>s.color);let r=o.underlay?ma(o.underlay):null,a=n?.[o.src];if(!a)return o.underlay?[o.underlay]:[];let i=o.opacity??1;return [a.light,a.dark].flatMap(s=>{let l=ma(s);if(!l)return [];let c={...l,a:l.a*i};if(!r)return [rd(c)];let u=c.a+r.a*(1-c.a),m=(f,d)=>u>0?(f*c.a+d*r.a*(1-c.a))/u:0;return [rd({r:m(c.r,r.r),g:m(c.g,r.g),b:m(c.b,r.b),a:u})]})}var rd=({r:t,g:e,b:n,a:o})=>`rgba(${Math.round(t)}, ${Math.round(e)}, ${Math.round(n)}, ${Math.round(o*1e3)/1e3})`;function eb(t){let e=[],n=t.width*t.height;for(let a=0;a<n;a++){let i=t.data[a*4],s=t.data[a*4+1],l=t.data[a*4+2];t.data[a*4+3]<128||e.push({lum:jn(i,s,l),r:i,g:s,b:l});}if(e.length===0)return null;e.sort((a,i)=>a.lum-i.lum);let o=Math.max(1,Math.round(e.length/10)),r=a=>{let i=a.reduce((l,c)=>({r:l.r+c.r,g:l.g+c.g,b:l.b+c.b}),{r:0,g:0,b:0}),s=l=>Math.round(l/a.length).toString(16).padStart(2,"0");return `#${s(i.r)}${s(i.g)}${s(i.b)}`};return {dark:r(e.slice(0,o)),light:r(e.slice(-o))}}async function nb(t){fl();let e=await Hr(t),{canvas:n,ctx:o}=tr(64,64);o.drawImage(e,0,0,64,64);let r=eb(o.getImageData(0,0,64,64));return n.remove(),r}function hd(t){let e=[t.bgColor,t.fgColor,t.eyeColor,t.dotColor,...Qe.flatMap(o=>[t.eyeColors?.[o]?.outer,t.eyeColors?.[o]?.inner])],n=new Set;for(let o of e)typeof o=="object"&&o?.type==="image"&&n.add(o.src);return [...n]}var Qr=null;function ma(t){let e=at(t);if(e||typeof document>"u")return e;if(Qr??=document.createElement("canvas").getContext("2d"),!Qr)return null;Qr.fillStyle="#010203",Qr.fillStyle=t;let n=String(Qr.fillStyle);return n==="#010203"?null:at(n)}var od=t=>jn(t.r,t.g,t.b),pd=(t,e)=>(Math.max(t,e)+.05)/(Math.min(t,e)+.05),Ur=4.5,rb=3,ad=1.5,id={code:7,background:12},sd={r:255,g:255,b:255,a:1},ld=(t,e)=>({r:t.r*t.a+e.r*(1-t.a),g:t.g*t.a+e.g*(1-t.a),b:t.b*t.a+e.b*(1-t.a),a:1});function ob(t,e={}){let n=e.imageTones,o=(g,h)=>{let p=typeof g=="object"&&g?.type==="image";return tb(g,h,n).map(b=>({color:b,picture:p}))},r=t.fgColor??Mt,a=Qe.flatMap(g=>{let h=t.eyeColors?.[g];return [...h?.outer?o(h.outer,Mt):[],...h?.inner?o(h.inner,Mt):[]]}),i=[...o(r,Mt),...o(t.eyeColor??r,Mt),...o(t.dotColor??r,Mt),...a],s=o(t.bgColor,ft),l=Mr(t.halo,t)?.color;l&&s.push({color:l,picture:false});let c=(s.length>0?s:[{color:"#ffffff",picture:false}]).map(g=>{let h=ma(g.color);return {color:h?ld(h,sd):sd,picture:g.picture}}),u=i.flatMap(g=>{let h=ma(g.color);return h?[{color:h,picture:g.picture}]:[]}),m=Number.POSITIVE_INFINITY,f=Ur,d=false;for(let g of u)for(let h of c){let p=od(ld(g.color,h.color)),b=od(h.color),_=pd(p,b),y=h.picture?id.background:g.picture?id.code:Ur;_/y<m/f&&(m=_,f=y),p>b&&(d=true);}return {ratio:Number.isFinite(m)?m:Number.POSITIVE_INFINITY,required:f,inverted:d}}function ab(t,e){let{ratio:n,inverted:o,required:r}=ob(t,{imageTones:e});if(!Number.isFinite(n))return {checks:[],penalty:0,fails:false};let a=r/Ur,i=r!==Ur,s=Math.round(n*10)/10,l=[],c=0;return n>=r?l.push({id:"contrast",passed:true,message:`Contrast ${s}:1 between code and background`}):(c=n<ad*a?60:n<rb*a?30:10,l.push({id:"contrast",passed:false,message:i?`Low contrast for a picture (${s}:1); ${r}:1 or more scans reliably`:`Low contrast (${s}:1); 4.5:1 or more scans reliably`,fix:i?"Lower the picture's opacity over a darker underlay (dots) or a lighter one (background)":"Use a darker code color or a lighter background"})),o?(c+=10,l.push({id:"polarity",passed:false,message:"Light code on a dark background; some scanner apps can't read it",fix:"Use dark modules on a light background"})):l.push({id:"polarity",passed:true,message:"Dark code on a light background"}),{checks:l,penalty:c,fails:n<ad*(r/Ur)}}function gl(t){return dt.QrCode.encodeText(t.value,St[At(t)]).getModules()}function ib(t){let{imageSettings:e}=t;if(!e)return {check:null,penalty:0};let n=gl(t),o=Ae(n,t.size??it,Et(n.length,t.margin??pt,t.shape),e);if(!o)return {check:null,penalty:0};let r=o.excavation??o,a=n.length,s=[[0,0],[a-8,0],[0,a-8]].some(([g,h])=>r.x<g+9&&r.x+r.w>g&&r.y<h+9&&r.y+r.h>h),l=a>21?a-9:null,c=l!==null&&r.x<l+5&&r.x+r.w>l&&r.y<l+5&&r.y+r.h>l;if(s||c)return {check:{id:"logo",passed:false,message:s?"The logo covers a corner eye":"The logo covers the small square near the bottom-right corner",fix:"Move the logo toward the center or make it smaller"},penalty:40};let u=r.w*r.h/(a*a),m=At(t),f=Math.round(u*100),d=Oo({value:t.value,size:t.size??it,margin:t.margin??pt,level:m,shape:t.shape},e);return !d||d.worst<=d.budget?{check:{id:"logo",passed:true,message:`Logo covers ${f}% of the code; error correction repairs it with room to spare`},penalty:0}:{check:{id:"logo",passed:false,message:`Logo covers ${f}% of the code and spoils ${d.worst} codewords in one block, which repairs ${d.correctable}`,fix:d.level==="H"?"Use a smaller logo":"Switch error correction to H or use a smaller logo"},penalty:d.worst>d.correctable?25:10}}function sb(t){let e=wr(t.shape)?Ze(t.margin??pt):t.margin??pt,n=gl(t).length+2*e,o=e+(Nt(t.frame)?Mi(t.frame)*n:0),r=Math.round(o*10)/10;return o>=4?{check:{id:"quiet-zone",passed:true,message:`Quiet zone of ${r} modules`},penalty:0}:o>=1.5?{check:{id:"quiet-zone",passed:true,message:`Quiet zone of ${r} modules (4 is ideal)`},penalty:0}:{check:{id:"quiet-zone",passed:false,message:"No quiet zone around the code",fix:"Leave clear space (about 10% of the code width) around it wherever you place it, or add a frame"},penalty:5}}function lb(t){let e=os(t);return e?e.reason==="adjusted"?{check:{id:"halo",passed:true,message:e.message},penalty:0}:{check:{id:"halo",passed:false,message:e.message,fix:e.fix},penalty:15}:{check:null,penalty:0}}function cb(t){let e=ts(t);return e==="curly"?{check:{id:"eye-shape",passed:false,message:"Curly eyes fail strict decoders such as ZXing-based apps",fix:"Pick square, rounded or gear eyes"},penalty:40}:e==="circle"?{check:{id:"eye-shape",passed:false,message:"Circle eyes only read in lenient decoders; many apps miss them",fix:"Pick square, rounded or gear eyes"},penalty:20}:{check:{id:"eye-shape",passed:true,message:`No known decoder issues with ${e} eyes`},penalty:0}}function Hr(t){return new Promise((e,n)=>{let o=new Image;o.crossOrigin="anonymous",o.onload=()=>e(o),o.onerror=()=>n(new Error("Could not load image")),o.src=t;})}var ub=`data:image/svg+xml,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 10"><rect width="10" height="10" rx="2" fill="#808080"/></svg>')}`;async function mb(t){let{imageSettings:e}=t;if(!e||e.src.startsWith("data:"))return t;let n=ub;try{let o=await Hr(e.src),{canvas:r,ctx:a}=tr(o.naturalWidth||256,o.naturalHeight||256);a.drawImage(o,0,0,r.width,r.height),n=r.toDataURL("image/png");}catch{}return {...t,imageSettings:{...e,src:n}}}async function db(t){let e=new Map;for(let r of hd(t))if(!r.startsWith("data:"))try{let a=await Hr(r),{canvas:i,ctx:s}=tr(a.naturalWidth||256,a.naturalHeight||256);s.drawImage(a,0,0,i.width,i.height),e.set(r,i.toDataURL("image/png")),i.remove();}catch{e.set(r,null);}if(e.size===0)return t;let n=r=>{if(typeof r!="object"||r?.type!=="image")return r;let a=e.get(r.src);return a===void 0?r:a?{...r,src:a}:r.underlay??Mt},o=t.eyeColors?Object.fromEntries(Object.entries(t.eyeColors).map(([r,a])=>[r,a&&{outer:n(a.outer),inner:n(a.inner)}])):void 0;return {...t,bgColor:n(t.bgColor),fgColor:n(t.fgColor),eyeColor:n(t.eyeColor),dotColor:n(t.dotColor),...o&&{eyeColors:o}}}async function gd(t,e,n,o,r){let a=[],i=0,s=ab(t,r);i+=s.penalty;let l=ib(t);i+=l.penalty;let c=sb(t);i+=c.penalty;let u=cb(t);i+=u.penalty;let m=lb(t);i+=m.penalty;let f=es(t),d=f?.kind==="eye"?null:f;d&&d.kind!=="sharp-dot-eye"&&(i+=10);let g=await hl();Te(o);let h=gl(t).length,p=h+2*Et(h,t.margin??pt,t.shape),b=[],_=false;for(let[C,S]of n.entries()){await ud(),Te(o);let $=pl(g,e,S,p,R=>dl(R,t.value));i+=md(C,n.length,$),b.push(dd(S,n,$)),C===n.length-1&&$==="fail"&&(_=true);}a.push(...b,...s.checks),l.check&&a.push(l.check),a.push(u.check,c.check),m.check&&a.push(m.check),d&&a.push({id:"style-pair",passed:false,message:d.message,fix:d.fix});let y=_||s.fails,w=Math.max(0,Math.min(100,100-i));return y&&(w=Math.min(w,30)),{score:w,grade:fd(w,y),checks:a}}function bd(t){return [...t.sizes??cd].filter(e=>e>0).sort((e,n)=>e-n)}async function K6(t,e={}){fl();let{signal:n}=e,o=bd(e),r=ml/cl(t),a=await db(await mb(Ie({...t,size:t.size??it},r)));Te(n);let i={};for(let m of hd(t))try{let f=await nb(m);f&&(i[m]=f);}catch{}Te(n);let s=await Xt(a),l=await Hr(s);Te(n);let c=me(r,t.frame);return await gd(t,m=>{let f=m/ml,d=c.width*f,g=c.height*f,h=Math.max(8,Math.round(m*.12)),{canvas:p,ctx:b}=tr(d+2*h,g+2*h);b.fillStyle="#ffffff",b.fillRect(0,0,p.width,p.height),b.drawImage(l,h,h,d,g);let _=b.getImageData(0,0,p.width,p.height);return p.remove(),_},o,n,i)}var J6=ml;async function t8(t,e,n={}){let{width:o,height:r}=e;if(!(o>0&&r>0)||e.data.length<o*r*4)throw new Error("Pixels must be width \xD7 height \xD7 4 RGBA bytes");let a=bd(n),i=t.size??it,s=me(i,t.frame),l=o*i*cl(t)/s.width,c={data:fb(e),width:o,height:r};return await gd(t,m=>{let f=_d(c,m/l),d=Math.max(8,Math.round(m*.12));return hb(f,d)},a,n.signal)}function fb(t){let{data:e,width:n,height:o}=t,r=new Uint8ClampedArray(n*o*4);for(let a=0;a<n*o*4;a+=4){let i=e[a+3]/255;for(let s=0;s<3;s++)r[a+s]=e[a+s]*i+255*(1-i);r[a+3]=255;}return r}function hb(t,e){let n=t.width+2*e,o=t.height+2*e,r=new Uint8ClampedArray(n*o*4).fill(255);for(let a=0;a<t.height;a++)r.set(t.data.subarray(a*t.width*4,(a+1)*t.width*4),((a+e)*n+e)*4);return {data:r,width:n,height:o,colorSpace:"srgb"}}var Le=(t,e)=>Math.hypot(t.x-e.x,t.y-e.y);function ua(t,e){return .299*t[e]+.587*t[e+1]+.114*t[e+2]}function pb(t,e){let n=0;for(let s=0;s<256;s++)n+=s*t[s];let o=0,r=0,a=0,i=128;for(let s=0;s<256;s++){if(r+=t[s],r===0)continue;let l=e-r;if(l===0)break;o+=s*t[s];let c=o/r,u=(n-o)/l,m=r*l*(c-u)**2;m>a&&(a=m,i=s);}return i}async function gb(t){if(!(t instanceof Blob))return t.complete||await new Promise(n=>{t.addEventListener("load",n,{once:true}),t.addEventListener("error",n,{once:true});}),t;let e=URL.createObjectURL(t);try{let n=await Hr(e);return await n.decode?.().catch(()=>{}),n}finally{setTimeout(()=>URL.revokeObjectURL(e),1e3);}}async function e8(t,e={}){fl();let{signal:n}=e,o=[...e.sizes??cd].filter(G=>G>0).sort((G,K)=>G-K),r=await hl(),a=await gb(t);Te(n);let i=a.naturalWidth||a.width,s=a.naturalHeight||a.height;if(!(i&&s))throw new Error("Could not read this image");let l=Math.min(1,1600/Math.max(i,s)),{canvas:c,ctx:u}=tr(i*l,s*l);u.fillStyle="#ffffff",u.fillRect(0,0,c.width,c.height),u.drawImage(a,0,0,c.width,c.height);let m=u.getImageData(0,0,c.width,c.height),f=r(m.data,m.width,m.height);if(Te(n),!f){let G=await W0(a,0,false);return c.remove(),typeof G!="string"||G==="NO_QR"?{data:null,version:null,score:0,grade:"fails",checks:[{id:"decode",passed:false,message:"No QR code found in this image",fix:"Try a sharper, well-lit, straight-on photo or a screenshot"}]}:{data:G,version:null,score:55,grade:"risky",checks:[{id:"decode",passed:false,message:"Decoded only after cropping; the code is small or hard to find in this image",fix:"Make the code bigger relative to its surroundings"}]}}let{location:d,version:g}=f,h=17+4*g,p=(Le(d.topLeftCorner,d.topRightCorner)+Le(d.bottomLeftCorner,d.bottomRightCorner)+Le(d.topLeftCorner,d.bottomLeftCorner)+Le(d.topRightCorner,d.bottomRightCorner))/4,b=p/h,_=[d.topLeftCorner,d.topRightCorner,d.bottomRightCorner,d.bottomLeftCorner],y=Math.max(0,Math.floor(Math.min(..._.map(G=>G.x)))),w=Math.min(m.width,Math.ceil(Math.max(..._.map(G=>G.x)))),C=Math.max(0,Math.floor(Math.min(..._.map(G=>G.y)))),S=Math.min(m.height,Math.ceil(Math.max(..._.map(G=>G.y)))),$=[],R=0,M=new Array(256).fill(0),E=0;for(let G=C;G<S;G++)for(let K=y;K<w;K++){let Q=Math.round(ua(m.data,(G*m.width+K)*4));M[Q]=M[Q]+1,E++;}let P=pb(M,E),v={dark:[0,0,0,0],light:[0,0,0,0]};for(let G=C;G<S;G++)for(let K=y;K<w;K++){let Q=(G*m.width+K)*4,gt=ua(m.data,Q)<=P?v.dark:v.light;gt[0]=gt[0]+m.data[Q],gt[1]=gt[1]+m.data[Q+1],gt[2]=gt[2]+m.data[Q+2],gt[3]=gt[3]+1;}let L=G=>{let K=Math.max(G[3],1);return jn(G[0]/K,G[1]/K,G[2]/K)},F=L(v.dark),k=L(v.light),T=pd(F,k),z=Math.round(T*10)/10;T>=4.5?$.push({id:"contrast",passed:true,message:`Contrast ${z}:1 in the image`}):(R+=T<2?30:10,$.push({id:"contrast",passed:false,message:`Low contrast in the image (${z}:1)`,fix:"Use a darker code on a lighter background, or better lighting for photos"}));let D=[d.topLeftFinderPattern,d.topRightFinderPattern,d.bottomLeftFinderPattern].map(G=>{let K=Math.min(m.width-1,Math.max(0,Math.round(G.x))),Q=Math.min(m.height-1,Math.max(0,Math.round(G.y)));return ua(m.data,(Q*m.width+K)*4)}).filter(G=>G>P).length>=2;D?(R+=10,$.push({id:"polarity",passed:false,message:"Light code on a dark background; some scanner apps can't read it",fix:"Use dark modules on a light background"})):$.push({id:"polarity",passed:true,message:"Dark code on a light background"});let U=Math.max(2,Math.round(b*2)),X={minX:y-U,maxX:w+U,minY:C-U,maxY:S+U};if(X.minX<0||X.minY<0||X.maxX>m.width||X.maxY>m.height)$.push({id:"quiet-zone",passed:true,skipped:true,message:"The image is cropped too tight to check the quiet zone"});else {let G=0,K=0;for(let Q=X.minY;Q<X.maxY;Q++)for(let gt=X.minX;gt<X.maxX;gt++){if(gt>=y&><w&&Q>=C&&Q<S)continue;let ut=ua(m.data,(Q*m.width+gt)*4);(D?ut>P:ut<=P)&&G++,K++;}G/Math.max(K,1)>.12?(R+=10,$.push({id:"quiet-zone",passed:false,message:"Something dark touches the code; the quiet zone isn't clear",fix:"Leave clear space (about 4 modules) around the code"})):$.push({id:"quiet-zone",passed:true,message:"Clear space around the code"});}b<2?$.push({id:"resolution",passed:false,message:`Low resolution: about ${Math.round(b*10)/10} px per module`,fix:"Use a larger image, or export the code at a bigger size"}):$.push({id:"resolution",passed:true,message:`About ${Math.round(b)} px per module`});let lt=Math.round(b*4),N=Math.max(0,y-lt),B=Math.max(0,C-lt),Z=Math.min(m.width,w+lt)-N,Pt=Math.min(m.height,S+lt)-B,ct=G=>{let K=G/p,Q=tr(Z*K,Pt*K);Q.ctx.drawImage(c,N,B,Z,Pt,0,0,Q.canvas.width,Q.canvas.height);let gt=Q.ctx.getImageData(0,0,Q.canvas.width,Q.canvas.height);return Q.canvas.remove(),gt},Zt=[],ae=false;for(let[G,K]of o.entries()){await ud(),Te(n);let Q=pl(r,ct,K,h,gt=>gt?.data===f.data);R+=md(G,o.length,Q),Zt.push(dd(K,o,Q)),G===o.length-1&&Q==="fail"&&(ae=true);}c.remove();let ke=Math.max(0,Math.min(100,100-R));return ae&&(ke=Math.min(ke,30)),{data:f.data,version:g,score:ke,grade:fd(ke,ae),checks:[...Zt,...$]}}var bb=[320];function _d(t,e){let n=Math.min(1,e),o=Math.max(1,Math.round(t.width*n)),r=Math.max(1,Math.round(t.height*n)),a=new Uint8ClampedArray(o*r*4),i=t.width/o,s=t.height/r;for(let l=0;l<r;l++){let c=Math.floor(l*s),u=Math.max(c+1,Math.min(t.height,Math.floor((l+1)*s)));for(let m=0;m<o;m++){let f=Math.floor(m*i),d=Math.max(f+1,Math.min(t.width,Math.floor((m+1)*i))),g=0,h=0,p=0,b=0;for(let w=c;w<u;w++)for(let C=f;C<d;C++){let S=(w*t.width+C)*4;g+=t.data[S],h+=t.data[S+1],p+=t.data[S+2],b+=t.data[S+3];}let _=(u-c)*(d-f),y=(l*o+m)*4;a[y]=g/_,a[y+1]=h/_,a[y+2]=p/_,a[y+3]=b/_;}}return {data:a,width:o,height:r,colorSpace:"srgb"}}function _b(t){try{return new TextDecoder("utf-8",{fatal:!0}).decode(Uint8Array.from(t.binaryData))}catch{return t.data}}async function n8(t,e,n={}){let{width:o,height:r}=t;if(!(o>0&&r>0)||t.data.length<o*r*4)throw new Error("Pixels must be width \xD7 height \xD7 4 RGBA bytes");let a=await hl(),i={data:t.data instanceof Uint8ClampedArray?t.data:Uint8ClampedArray.from(t.data),width:o,height:r},s=a(i.data,o,r,{inversionAttempts:"dontInvert"});if(!s)return {data:null,version:null,passed:false};let l=_b(s),{version:c,location:u}=s;if(!dl(s,e))return {data:l,version:c,passed:false};let m=17+4*c,f=(Le(u.topLeftCorner,u.topRightCorner)+Le(u.bottomLeftCorner,u.bottomRightCorner)+Le(u.topLeftCorner,u.bottomLeftCorner)+Le(u.topRightCorner,u.bottomRightCorner))/4;for(let d of n.sizes??bb)if(pl(a,h=>_d(i,h/f),d,m,h=>dl(h,e))!=="pass")return {data:l,version:c,passed:false};return {data:l,version:c,passed:true}}var yb=16,yd=.01;function xb(t){let e=new Float64Array(256);for(let l of t)e[Math.min(255,Math.max(0,Math.round(l*255)))]++;let n=t.length,o=0;for(let l=0;l<256;l++)o+=l*e[l];let r=0,a=0,i=0,s=128;for(let l=0;l<256;l++){if(a+=e[l],a===0)continue;let c=n-a;if(c===0)break;r+=l*e[l];let u=r/a,m=(o-r)/c,f=a*c*(u-m)**2;f>i&&(i=f,s=l);}return (s+.5)/255}function $b(t,e){let{width:n,height:o,data:r}=t,a=n*o,i=new Uint8Array(a),s=0;for(let d=0;d<a;d++)r[d*4+3]<128&&s++;if(e==="alpha"||e==="auto"&&s>a*.02&&s<a*.98){for(let d=0;d<a;d++)i[d]=r[d*4+3]>=128?1:0;return i}let c=new Float32Array(a);for(let d=0;d<a;d++){let g=r[d*4+3]/255,h=.2126*r[d*4]+.7152*r[d*4+1]+.0722*r[d*4+2];c[d]=1-(h*g+255*(1-g))/255;}let u=xb(c);for(let d=0;d<a;d++)i[d]=c[d]>u?1:0;let m=0,f=0;for(let d=0;d<n;d++)for(let g of [0,o-1])m++,f+=i[g*n+d];for(let d=1;d<o-1;d++)for(let g of [0,n-1])m++,f+=i[d*n+g];if(f>m/2)for(let d=0;d<a;d++)i[d]=i[d]?0:1;return i}function xd(t,e,n,o){for(let r of [1,0]){let a=new Uint8Array(t.length);for(let i=0;i<t.length;i++){if(a[i]||t[i]!==r)continue;let s=[i];a[i]=1;let l=false;for(let u of s){let m=u%e,f=(u-m)/e;(m===0||f===0||m===e-1||f===n-1)&&(l=true);for(let[d,g]of [[m-1,f],[m+1,f],[m,f-1],[m,f+1]]){if(d<0||g<0||d>=e||g>=n)continue;let h=g*e+d;!a[h]&&t[h]===r&&(a[h]=1,s.push(h));}}if((r===1||!l)&&s.length<o)for(let u of s)t[u]=r?0:1;}}}function $d(t,e={}){let{width:n,height:o,data:r}=t;if(!(n>0&&o>0)||r.length<n*o*4)throw new Error("Silhouette pixels must be width \xD7 height \xD7 4 RGBA bytes");let a=$b(t,e.mode??"auto"),i=a.reduce(($,R)=>$+R,0);xd(a,n,o,Math.max(16,i*yd));let s=n,l=o,c=-1,u=-1;for(let $=0;$<o;$++)for(let R=0;R<n;R++)a[$*n+R]&&(s=Math.min(s,R),l=Math.min(l,$),c=Math.max(c,R),u=Math.max(u,$));if(c<0)throw new Error("No shape found: use a picture with a dark or opaque shape on a light or clear background");let m=c-s+1,f=u-l+1;if(Math.max(m,f)<yb)throw new Error("The shape is too small to trace; use a bigger picture");let g=Math.min(Math.max(Math.round(e.cells??Ge),ye),Ge)/Math.max(m,f),h=Math.max(ye,Math.round(m*g)),p=Math.max(ye,Math.round(f*g)),b=Math.max(1,Math.round(m*g)),_=Math.max(1,Math.round(f*g)),y=Math.floor((h-b)/2),w=Math.floor((p-_)/2),C=new Uint8Array(h*p);for(let $=0;$<_;$++){let R=l+Math.floor($*f/_),M=Math.max(R+1,l+Math.floor(($+1)*f/_));for(let E=0;E<b;E++){let P=s+Math.floor(E*m/b),v=Math.max(P+1,s+Math.floor((E+1)*m/b)),L=0;for(let F=R;F<M;F++)for(let k=P;k<v;k++)L+=a[F*n+k];C[($+w)*h+E+y]=L*2>=(M-R)*(v-P)?1:0;}}let S=C.reduce(($,R)=>$+R,0);if(xd(C,h,p,Math.max(4,S*yd)),!C.includes(1))throw new Error("The shape is too small to trace; use a bigger picture");return {type:"silhouette",width:h,height:p,cells:Array.from(C,$=>$?"1":"0").join("")}}var bl=512;async function Sb(t){if(typeof t!="string"&&!(t instanceof Blob))return t.complete||await new Promise(n=>{t.addEventListener("load",n,{once:true}),t.addEventListener("error",n,{once:true});}),t;let e=typeof t=="string"?t:URL.createObjectURL(t);try{return await new Promise((n,o)=>{let r=new Image;r.crossOrigin="anonymous",r.onload=()=>n(r),r.onerror=()=>o(new Error("Could not load the picture")),r.src=e;})}finally{typeof t!="string"&&setTimeout(()=>URL.revokeObjectURL(e),1e3);}}async function wb(t,e={}){if(typeof document>"u")throw new Error("loadQRSilhouette needs a browser; pass decoded pixels to createQRSilhouette instead");let n=await Sb(t),o=n.naturalWidth||n.width||bl,r=n.naturalHeight||n.height||bl,a=bl/Math.max(o,r),i=Math.max(1,Math.round(o*a)),s=Math.max(1,Math.round(r*a)),l=document.createElement("canvas");l.width=i,l.height=s;let c=l.getContext("2d",{willReadFrequently:true});if(!c)throw new Error("Could not get a canvas context");c.drawImage(n,0,0,i,s);let u;try{u=c.getImageData(0,0,i,s);}catch{throw new Error("Could not read the picture (cross-origin images need CORS); upload it instead")}finally{l.remove();}return $d(u,e)}function _l(t){return $n(Xn,()=>Lr(t))}var Mb=react.memo(t=>{let e=react.useMemo(()=>la(t),sl.map(n=>t[n]));return jsxRuntime.jsx(_l,{...ca(t,e)})});Mb.displayName="QRCode";function Ab({frame:t,size:e,bgColor:n,slot:o,...r}){let a=o;return $n(Xn,()=>Ei({frame:t,size:e,bgColor:n,slot:a,svgProps:r}))}/**
|
|
24
|
+
end`;function Js(e){let t="(";for(let n of e){let o=n.codePointAt(0)??63;n==="("||n===")"||n==="\\"?t+=`\\${n}`:n==="\u2026"?t+="...":o>=32&&o<127?t+=n:o>=160&&o<=255?t+=`\\${o.toString(8).padStart(3,"0")}`:t+="?";}return `${t})`}var el=class extends Zn{out=[];shadingNames=new Map;cmyk;images;usesLevel3=false;constructor(t,n,o,r){super(n,o),this.cmyk=t,this.images=r;}color(t){if(this.cmyk){let[n,o,r,a]=St(t.r,t.g,t.b);return `${x(n)} ${x(o)} ${x(r)} ${x(a)} cmyk`}return `${x(t.r/255)} ${x(t.g/255)} ${x(t.b/255)} rg`}tracePath(t,n){let o=["n"],r=false;for(let a of t)if(a.op==="M"||a.op==="L"&&!r){let[i,s]=W(n,a.x,a.y);o.push(`${x(i)} ${x(s)} m`),r=true;}else if(a.op==="L"){let[i,s]=W(n,a.x,a.y);o.push(`${x(i)} ${x(s)} l`);}else if(a.op==="C"){if(!r)continue;let[i,s]=W(n,a.x1,a.y1),[l,c]=W(n,a.x2,a.y2),[u,m]=W(n,a.x,a.y);o.push(`${x(i)} ${x(s)} ${x(l)} ${x(c)} ${x(u)} ${x(m)} c`);}else r&&o.push("h");return o.join(" ")}beginClip(t,n,o){return this.out.push(`gsave ${this.tracePath(t,n)} ${o?"eoclip":"clip"} n`),true}endClip(){this.out.push("grestore");}rect(t,n,o,r,a){this.out.push(`${this.color(t)} n ${x(n)} ${x(o)} m ${x(n+r)} ${x(o)} l ${x(n+r)} ${x(o+a)} l ${x(n)} ${x(o+a)} l h f`);}shade(t,n,o){let r=me(n.matrix,o.matrix);if(!At(r))return;let a=Ko(o,this.cmyk?"cmyk":"rgb"),i=this.shadingNames.get(a);i||(i=`Sh${this.shadingNames.size}`,this.shadingNames.set(a,i)),this.usesLevel3=true;let s=n.fillRule==="evenodd"?"eoclip":"clip";this.out.push(`gsave ${this.tracePath(t,n.matrix)} ${s} n [${Zo(r)}] concat ${i} shfill grestore`);}paint(t,n,o){if(t.length===0)return;let r=o.opacity??1;if(r<=0)return;let a=this.resolveFill(o.fill,t,o.viewport,(o.fillOpacity??1)*r);a&&"pattern"in a?this.paintPattern(t,o,a.pattern,a.alpha):a&&"gradient"in a&&this.shade(t,o,{...a.gradient,stops:a.gradient.stops.map(m=>({...m,color:this.flatten({...m.color,a:m.color.a*a.alpha})}))});let i=a&&"color"in a?this.flatten(a.color):null,s=o.strokeWidth>0?this.resolveColor(o.stroke):null,l=s&&this.flatten({...s,a:s.a*r});if(!(i||l))return;let c=this.tracePath(t,o.matrix),u=o.fillRule==="evenodd"?"ef":"f";if(i&&l?this.out.push(`gsave ${this.color(i)} ${c} ${u} grestore`):i&&this.out.push(`${this.color(i)} ${c} ${u}`),l){let m=`${this.color(l)} ${x(o.strokeWidth*An(o.matrix))} w ${c} s`,{join:f,cap:d}=ea(o);this.out.push(f||d?`gsave ${f} setlinejoin ${d} setlinecap ${m} grestore`:m);}}text(t,n){let o=t.text.replace(/\s+/g," ").trim(),r=this.resolveColor(n.fill);if(!(o&&r))return;let a=An(n.matrix),[i,s]=W(n.matrix,j(t.attrs.x,n.viewport[0]),j(t.attrs.y,n.viewport[1])),c=n.fontWeight==="bold"||Number.parseInt(n.fontWeight,10)>=600?"/QRDX-Bold":"/QRDX-Regular",u=x(n.fontSize*a),m=Number.parseFloat(t.attrs["data-max-width"]??""),f=m>0?` dup stringwidth pop dup ${x(m*a)} gt {${x(m*a)} exch div ${u} mul ${c} findfont exch scalefont setfont} {pop} ifelse`:"",d=n.textAnchor==="middle"?" dup stringwidth pop 2 div neg 0 rmoveto":n.textAnchor==="end"?" dup stringwidth pop neg 0 rmoveto":"",g=Math.atan2(n.matrix[1],n.matrix[0])*180/Math.PI;if(Math.abs(g)>.01){this.out.push(`gsave ${this.color(r)} ${c} findfont ${u} scalefont setfont ${x(i)} ${x(s)} translate ${x(g)} rotate ${Js(o)}${f} 0 0 moveto${d} show grestore`);return}this.out.push(`gsave ${this.color(r)} ${c} findfont ${u} scalefont setfont ${Js(o)}${f} ${x(i)} ${x(s)} moveto${d} show grestore`);}image(t,n){let o=t.attrs.href??t.attrs["xlink:href"],r=o?this.images.get(o):void 0;if(!r)return;let a=j(t.attrs.x,n.viewport[0]),i=j(t.attrs.y,n.viewport[1]),s=j(t.attrs.width,n.viewport[0]),l=j(t.attrs.height,n.viewport[1]);if(s<=0||l<=0)return;let[c,u]=W(n.matrix,a,i),[m,f]=W(n.matrix,a+s,i+l),{components:d}=r,g=d===1?"/DeviceGray":d===4?"/DeviceCMYK":"/DeviceRGB",h=Array.from({length:d},()=>"0 1").join(" "),p="/ASCII85Decode filter";r.kind==="jpeg"?(p+=" /DCTDecode filter",r.progressive&&(this.usesLevel3=true)):r.compressed&&(p+=" /FlateDecode filter",this.usesLevel3=true),this.out.push(["gsave",`${x(Math.min(c,m))} ${x(Math.min(u,f))} translate ${x(Math.abs(m-c))} ${x(Math.abs(f-u))} scale`,`${g} setcolorspace`,`<< /ImageType 1 /Width ${r.width} /Height ${r.height} /BitsPerComponent 8 /Decode [${h}] /ImageMatrix [${r.width} 0 0 -${r.height} 0 ${r.height}] /DataSource currentfile ${p} >> image`,S2(r.bytes),"grestore"].join(`
|
|
25
|
+
`));}};async function G0(e,t={}){let n=yt(e);if(!n)throw new Error("Could not read the SVG to convert to EPS");let o=j(n.attrs.width,0,0)||512,r=j(n.attrs.height,0,0)||o,a=t.width??o;if(!(Number.isFinite(a)&&a>0))throw new Error("EPS width must be a positive number of points");let i=a/o,s=r*i,l=Math.max(0,t.bleed??0),c=a+2*l,u=s+2*l,m=t.colorMode==="cmyk",f=new Map;for(let _ of Br(n,new Set)){let y=await $2(_,m);y&&f.set(_,y);}let d=new el(m,Dr(n,new Map),Yo(n),f);aa(d,{bgColor:t.background??"#ffffff"});let h={matrix:me([1,0,0,-1,l,u-l],[i,0,0,i,0,0]),viewport:[o,r],fill:"#000000",fillRule:"nonzero",stroke:"none",strokeWidth:1,fontSize:16,fontWeight:"normal",textAnchor:"start"},p=l>0?t.bleedColor??void 0:void 0;if(!(p&&d.paintBleed(n,h,p,[0,0,c,u]))){let _=p?d.resolveColor(p):null;_&&d.rect(_,0,0,c,u);}d.walk(n,h,true);let b=(t.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 ${x(c)} ${x(u)}`,`%%Title: ${Js(b)}`,"%%Creator: qrdx",`%%LanguageLevel: ${d.usesLevel3?3:2}`,"%%DocumentData: Clean7Bit","%%EndComments","%%BeginProlog",w2,"%%EndProlog","qrdxdict begin",...Array.from(d.shadingNames,([_,y])=>`/${y} ${_} def`),"gsave",...d.out,"grestore","end","showpage","%%Trailer","%%EOF",""].join(`
|
|
26
|
+
`)}var Q0="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 U0(e){return [e.bgColor,e.fgColor,e.eyeColor,e.dotColor,...Object.values(e.eyeColors??{}).flatMap(n=>[n?.outer,n?.inner])].some(n=>typeof n=="object"&&n?.type==="image")}async function la(e,t={}){if(U0(e))throw new Error(Q0);let n=sa(e,{size:t.sizeMm??b2,unit:"mm",bleed:t.bleedMm}),o=await Gr(e);return await G0(o,{width:n.trimWidth*B0,bleed:n.bleed*B0,bleedColor:n.bleed>0?oa(e,o):Vs(e),colorMode:t.colorMode,background:ye(e.bgColor,fe)})}function ca(e){return `data:application/postscript;base64,${btoa(e)}`}async function C2(e,t={}){let n=await la(e,t);De(ca(n),t.filename??"qr-code-print.eps");}var tl={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:kr,extension:"gif",vector:false},ico:{mimeType:an,extension:"ico",vector:false,sizes:qo},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}},h6={small:{width:200,height:200},medium:{width:400,height:400},large:{width:800,height:800},xlarge:{width:1200,height:1200},"2xl":{width:1600,height:1600},"3xl":{width:2e3,height:2e3}};function nl(e,t){return e<50||t<50?{isValid:false,error:"Size must be at least 50x50 pixels"}:e>5e3||t>5e3?{isValid:false,error:"Size must not exceed 5000x5000 pixels"}:e!==t?{isValid:false,error:"Width and height must be equal for QR codes"}:{isValid:true}}function Pt(e,t){let{imageSettings:n,size:o}=e;if(!(n&&o)||o===t)return {...e,size:t};let r=t/o;return {...e,size:t,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 De(e,t){let n=document.createElement("a");n.href=e,n.download=t,document.body.appendChild(n),n.click(),document.body.removeChild(n);}var H0=e=>(tl[e]??tl.png).mimeType;function R2(e,t,n){let{extension:o,vector:r,sizes:a}=tl[e];if(r||a)return `qr-code.${o}`;let{width:i,height:s}=ut(t.width,n);return `qr-code-${Math.round(i)}x${Math.round(s)}.${o}`}async function z0(e,t={}){let n=await pt(e,"image/webp",true);try{return await Xo(n,t)}finally{n.remove();}}async function W0(e){let t=await pt(e,"image/png",true);try{return Qo(t)}finally{t.remove();}}async function q0(e){let t=await pt(e,"image/png",true);try{return await Wo(t,e.value)}finally{t.remove();}}async function V0(e,t=qo){let n=[];try{for(let o of t)n.push(await pt(Pt({...e,frame:void 0},o),"image/png",!0));return Ns(n)}finally{for(let o of n)o.remove();}}var M2=25.4/72;async function j0(e){let t=await la(e,{sizeMm:(e.size??ce)*M2});return ca(t)}async function X0(e){let t;try{({jsPDF:t}=await import('jspdf'));}catch(f){throw new Error(`PDF export needs the optional "jspdf" package. Install it with \`npm install jspdf\`. (${f})`)}let n=await Xe(e),o=decodeURIComponent(n.replace("data:image/svg+xml,","")),r;try{let f=new TextEncoder().encode(o),d=Array.from(f,h=>String.fromCharCode(h)).join("");r=`data:image/svg+xml;base64,${btoa(d)}`;}catch(f){throw new Error(`Failed to encode SVG for PDF conversion: ${f}`)}let{width:a,height:i}=ut(e.size||ce,e.frame),s=await new Promise((f,d)=>{let g=new Image,h=document.createElement("canvas");h.width=Math.round(a),h.height=Math.round(i);let p=h.getContext("2d");if(!p){d(new Error("Could not get canvas context"));return}let b=setTimeout(()=>{h.remove(),d(new Error("SVG load timeout - image may be too large or contain invalid data"));},3e4);g.onload=()=>{clearTimeout(b);try{p.drawImage(g,0,0,h.width,h.height),f(h);}catch(_){clearTimeout(b),h.remove(),d(new Error(`Failed to draw image to canvas: ${_}`));}},g.onerror=()=>{clearTimeout(b),h.remove(),d(new Error("Could not load SVG for PDF conversion"));},g.src=r;}),l=s.toDataURL("image/png",1),c=a*.264583,u=i*.264583,m=new t({orientation:c>u?"landscape":"portrait",unit:"mm",format:[c,u]});return m.addImage(l,"PNG",0,0,c,u),s.remove(),m.output("dataurlstring")}async function p6(e,t){let{format:n,size:o,filename:r,quality:a}=t,i=nl(o.width,o.height);if(!i.isValid)throw new Error(i.error);let s=Pt(e,o.width),l=r||R2(n,o,e.frame);try{if(n==="svg"){let c=await Xe(s);De(c,l);}else if(n==="pdf"){let c=await X0(s);De(c,l);}else if(n==="eps")De(await j0(s),l);else if(n==="webp"){let c=await z0(s,{quality:a});De(await Ne(c),l);}else if(n==="bmp"){let c=await W0(s);De(await Ne(c),l);}else if(n==="gif"){let c=await q0(s);De(await Ne(c),l);}else if(n==="ico"){let c=await V0(s);De(await Ne(c),l);}else {let c=H0(n),u=await pt(s,c);if(typeof u=="string")De(u,l);else throw new Error("Failed to generate image data URL")}}catch(c){throw console.error(`Error downloading ${n.toUpperCase()}:`,c),c}}async function g6(e,t,n,o={}){let r=nl(n.width,n.height);if(!r.isValid)throw new Error(r.error);let a=Pt(e,n.width);if(t==="svg")return await Xe(a);if(t==="pdf")return await X0(a);if(t==="eps")return await j0(a);if(t==="webp")return await Ne(await z0(a,o));if(t==="bmp")return await Ne(await W0(a));if(t==="gif")return await Ne(await q0(a));if(t==="ico")return await Ne(await V0(a));let i=H0(t),s=await pt(a,i);if(typeof s=="string")return s;throw new Error("Failed to generate QR code data URL")}async function b6(e,t={width:ce,height:ce}){try{let n=nl(t.width,t.height);if(!n.isValid)throw new Error(n.error);let o=Pt(e,t.width),r=pt(o,"image/png",!0).then(a=>new Promise((i,s)=>{let l=a;l.toBlob(c=>{l.remove(),c?i(c):s(new Error("Failed to create blob from canvas"));},"image/png");}));await navigator.clipboard.write([new ClipboardItem({"image/png":r})]);}catch(n){throw console.error("Error copying to clipboard:",n),n}}async function _6(e){let t=await Xe(e);return decodeURIComponent(t.replace("data:image/svg+xml,",""))}var Oe={maxBytes:2e5,maxElements:500,maxDepth:16,maxInputSegments:4e3,maxColors:8,artboardSide:1e3,decimals:1,padding:.06},ae=class extends Error{},E2={script:e=>`Removed ${xe(e,"script")}`,style:e=>`Removed ${xe(e,"style sheet")}: colors set with CSS classes are lost. Export with presentation attributes (Illustrator: Styling \u2192 Presentation Attributes)`,"foreign-object":e=>`Removed ${xe(e,"foreignObject element")}`,image:e=>`Removed ${xe(e,"image")}: frames are vector shapes only`,use:e=>`Removed ${xe(e,"<use> reference")}: ungroup or detach symbols before exporting`,text:e=>`Removed ${xe(e,"text element")}: add text as labels in the frame editor`,effects:e=>`Removed ${xe(e,"filter, mask, clip path or pattern")}`,animation:e=>`Removed ${xe(e,"animation")}`,unknown:e=>`Removed ${xe(e,"unsupported element")}`,"nested-svg":e=>`Removed ${xe(e,"nested <svg>")}: flatten it first`,handlers:e=>`Removed ${xe(e,"event handler attribute")}`,links:e=>`Removed ${xe(e,"link")} (href)`,"external-paint":e=>`Removed ${xe(e,"fill or stroke")} that referenced something outside the file`,gradient:e=>`Flattened ${xe(e,"gradient")} to its first color: add gradients in the frame editor`,opacity:e=>`Made ${xe(e,"semi-transparent shape")} opaque (print files have no transparency)`,"invalid-paint":e=>`${xe(e,"color")} couldn't be read and fell back to the parent color`,stroke:e=>`Removed ${xe(e,"stroke")} on paths, polygons or polylines: outline strokes before exporting (Figma: Outline stroke)`,dash:e=>`Drew ${xe(e,"dashed stroke")} as solid`,clipped:e=>`Cut ${xe(e,"shape")} at the edge of the artboard`,outside:e=>`Removed ${xe(e,"shape")} outside the artboard`,colors:e=>`Merged ${xe(e,"color")} with similar ones (${Oe.maxColors} at most)`,"qr-placed":()=>'No QR placeholder found (a rect with id "qr"): the code was centered; place it in the frame editor'};function xe(e,t){return `${e} ${t}${e===1?"":"s"}`}var il=class{counts=new Map;add(t,n=1){this.counts.set(t,(this.counts.get(t)??0)+n);}list(){return [...this.counts].map(([t,n])=>({code:t,count:n,message:E2[t](n)}))}},A2=/^\s*<\?xml\s[^?>]*\?>/,rl=/[A-Za-z_][\w:.-]*/y,ol=/<\/([A-Za-z_][\w:.-]*)\s*>/y,ua=/\s*/y,P2=/[A-Za-z_:][\w:.-]*/y,v2=/[^"<]*/y,I2=/[^'<]*/y;function Kn(e,t,n){return e.lastIndex=n,e.test(t)?e.lastIndex:n}function Y0(e,t){let n=Kn(ua,e,t),o=Kn(P2,e,n);if(n===t||o===n)return -1;let r=Kn(ua,e,o);if(e[r]!=="=")return -1;let a=Kn(ua,e,r+1),i=e[a];if(i!=='"'&&i!=="'")return -1;let l=Kn(i==='"'?v2:I2,e,a+1);return e[l]===i?l+1:-1}function L2(e,t){let n=Kn(ua,e,t);return e[n]===">"?{end:n+1,selfClosing:false}:e.startsWith("/>",n)?{end:n+2,selfClosing:true}:null}function T2(e){let t=[],n=0,o="",r=0;for(;r<e.length;){let a=e.indexOf("<",r);if(a<0)break;if(r=a,e.startsWith("<!--",r)){let c=e.indexOf("-->",r+4);if(c<0)throw new ae("The SVG has an unclosed comment");r=c+3;continue}if(e.startsWith("<![CDATA[",r)){let c=e.indexOf("]]>",r+9);if(c<0)throw new ae("The SVG has an unclosed CDATA section");r=c+3;continue}if(e.startsWith("<?",r)){let c=e.indexOf("?>",r+2);if(c<0)throw new ae("The SVG has an unclosed declaration");r=c+2;continue}if(e.startsWith("<!",r))throw new ae("DOCTYPE and other declarations are not allowed");if(e[r+1]==="/"){ol.lastIndex=r;let c=ol.exec(e);if(!c)throw new ae("The SVG has a malformed closing tag");if(t.pop()!==c[1])throw new ae(`The SVG closes <${c[1]}> out of order`);r=ol.lastIndex;continue}rl.lastIndex=r+1;let i=rl.exec(e);if(!i)throw new ae("The SVG has a malformed tag");let s=rl.lastIndex;for(let c=Y0(e,s);c>=0;c=Y0(e,s))s=c;let l=L2(e,s);if(!l)throw new ae(`The SVG has a malformed <${i[0]}> tag (attributes must be quoted and may not contain "<")`);if(n++,n>Oe.maxElements)throw new ae(`The SVG has more than ${Oe.maxElements} elements`);if(o||(o=i[0]),!l.selfClosing&&(t.push(i[0]),t.length>Oe.maxDepth))throw new ae(`The SVG nests elements more than ${Oe.maxDepth} deep`);r=l.end;}if(t.length>0)throw new ae(`The SVG doesn't close <${t.at(-1)}>`);return o}function k2(e){if(typeof e!="string")throw new ae("Expected SVG markup as a string");let t=new TextEncoder().encode(e).length;if(t>Oe.maxBytes)throw new ae(`The SVG is ${Math.ceil(t/1e3)} KB; the limit is ${Oe.maxBytes/1e3} KB`);if(/<!(?:DOCTYPE|ENTITY|ATTLIST|ELEMENT|NOTATION)/i.test(e))throw new ae("DOCTYPE and entity declarations are not allowed");let n=e.replace(A2,"");if(n.includes("<?"))throw new ae("Processing instructions (such as xml-stylesheet) are not allowed");if(T2(n)!=="svg")throw new ae("The file must start with an <svg> element");return n}var al=e=>Math.round(Math.min(255,Math.max(0,e))).toString(16).padStart(2,"0");function Ye(e){let t=e?.replace(/!important/i,"").trim();return t===""||t==="inherit"?void 0:t}function sl(e,t,n,o){let r=e.trim();if(r==="none"||r==="transparent")return null;if(/^url\(/i.test(r)){let i=/^url\(\s*['"]?#([^)'"\s]+)['"]?\s*\)/i.exec(r)?.[1],s=i?n.get(i):void 0;return s?(o.add("gradient"),sl(s,t,n,o)):(o.add("external-paint"),null)}let a=le(r==="currentColor"?t.color:r);return a?a.a<=0?null:`#${al(a.r)}${al(a.g)}${al(a.b)}`:(o.add("invalid-paint"),null)}function F2(e){let t=new Map,n=r=>{(r.name==="linearGradient"||r.name==="radialGradient")&&r.attrs.id&&t.set(r.attrs.id,r);for(let a of r.children)n(a);};n(e);let o=new Map;for(let[r,a]of t){let i=a.children.find(l=>l.name==="stop");if(!i){let l=(a.attrs.href??a.attrs["xlink:href"])?.match(/^#(.+)$/)?.[1];i=l?t.get(l)?.children.find(c=>c.name==="stop"):void 0;}let s=i&&Ye(X(i,"stop-color"));s&&o.set(r,s);}return o}function Z0(e,t){return e.map(n=>{if(n.op==="Z")return n;if(n.op==="C"){let[a,i]=W(t,n.x1,n.y1),[s,l]=W(t,n.x2,n.y2),[c,u]=W(t,n.x,n.y);return {op:"C",x1:a,y1:i,x2:s,y2:l,x:c,y:u}}let[o,r]=W(t,n.x,n.y);return {op:n.op,x:o,y:r}})}function N2(e){let t=0;return e.forEach(([n,o],r)=>{let[a,i]=e[(r+1)%e.length];t+=n*i-a*o;}),t/2}function cl(e){return e.length<3?[]:[...e.map(([t,n],o)=>({op:o===0?"M":"L",x:t,y:n})),{op:"Z"}]}var vt=e=>Number.isFinite(e);function he(e,t,n=0){let o=Number.parseFloat(e.attrs[t]??"");return vt(o)?o:n}function K0(e){switch(e.name){case "path":return st(e.attrs.d??"");case "rect":{let t=e.attrs.rx??e.attrs.ry,n=e.attrs.ry??e.attrs.rx;return tt(he(e,"x"),he(e,"y"),he(e,"width"),he(e,"height"),Number.parseFloat(t??"0")||0,Number.parseFloat(n??"0")||0)}case "circle":{let t=he(e,"r");return et(he(e,"cx"),he(e,"cy"),t,t)}case "ellipse":return et(he(e,"cx"),he(e,"cy"),he(e,"rx"),he(e,"ry"));case "polygon":case "polyline":{let t=Je(e.attrs.points),n=[];for(let o=0;o+1<t.length;o+=2)n.push([t[o],t[o+1]]);return cl(n)}default:return []}}function O2(e,t){let n=t/2;switch(e.name){case "rect":{let o=he(e,"x"),r=he(e,"y"),a=he(e,"width"),i=he(e,"height"),s=Number.parseFloat(e.attrs.rx??e.attrs.ry??"0")||0,l=tt(o-n,r-n,a+t,i+t,s>0?s+n:0,s>0?s+n:0);if(a<=t||i<=t)return l;let c=Math.max(s-n,0);return [...l,...tt(o+n,r+n,a-t,i-t,c,c)]}case "circle":case "ellipse":{let o=he(e,"cx"),r=he(e,"cy"),a=e.name==="circle"?he(e,"r"):he(e,"rx"),i=e.name==="circle"?he(e,"r"):he(e,"ry"),s=et(o,r,a+n,i+n);return a<=n||i<=n?s:[...s,...et(o,r,a-n,i-n)]}case "line":{let[o,r,a,i]=["x1","y1","x2","y2"].map(m=>he(e,m)),s=Math.hypot(a-o,i-r);if(s===0)return [];let l=-(i-r)/s*n,c=(a-o)/s*n,u=[[o+l,r+c],[a+l,i+c],[a-l,i-c],[o-l,r-c]];return cl(N2(u)<0?u.reverse():u)}default:return null}}var D2=new Set(["path","rect","circle","ellipse","polygon","polyline","line"]),B2=new Set(["defs","linearGradient","radialGradient","stop","title","desc","metadata"]),G2={script:"script",style:"style",foreignObject:"foreign-object",image:"image",feImage:"image",use:"use",text:"text",tspan:"text",textPath:"text",filter:"effects",mask:"effects",clipPath:"effects",pattern:"effects",marker:"effects",symbol:"effects",animate:"animation",animateMotion:"animation",animateTransform:"animation",set:"animation"},Q2=/^(?:qrdx[-_ ]?)?qr(?:[-_ ]?code)?$/i;function ed(e,t){for(let n of Object.keys(e.attrs)){let o=n.toLowerCase();o.startsWith("on")?t.add("handlers"):o==="href"||o==="xlink:href"?e.name!=="linearGradient"&&e.name!=="radialGradient"&&t.add("links"):(o==="filter"||o==="mask"||o==="clip-path")&&t.add("effects");}}function td(e,t,n,o,r){if(ed(e,o),Ye(X(e,"display"))==="none"||Ye(X(e,"visibility"))==="hidden")return;let a=Number.parseFloat(X(e,"opacity")??"1"),i=Ye(X(e,"fill-rule")),s=Number.parseFloat(Ye(X(e,"stroke-width"))??""),l={matrix:me(t.matrix,Ue(e.attrs.transform)),fill:Ye(X(e,"fill"))??t.fill,fillRule:i==="evenodd"||i==="nonzero"?i:t.fillRule,stroke:Ye(X(e,"stroke"))??t.stroke,strokeWidth:vt(s)&&s>=0?s:t.strokeWidth,color:Ye(X(e,"color"))??t.color,opacity:t.opacity*(vt(a)?a:1)};for(let c of e.children){if(B2.has(c.name))continue;let u=G2[c.name];if(u){o.add(u);continue}if(c.name==="svg"){o.add("nested-svg");continue}if(c.name==="g"||c.name==="a"){td(c,l,n,o,r);continue}if(!D2.has(c.name)){o.add("unknown");continue}U2(c,l,n,o,r);}}function U2(e,t,n,o,r){if(ed(e,o),Ye(X(e,"display"))==="none"||Ye(X(e,"visibility"))==="hidden")return;let a=me(t.matrix,Ue(e.attrs.transform));if(e.name==="rect"&&Q2.test(e.attrs.id??"")&&!r.qrBox){r.qrBox=Ht(Z0(K0(e),a));return}let i=p=>Ye(X(e,p)),s=t.opacity*Number.parseFloat(i("opacity")??"1"),l=Number.parseFloat(i("fill-opacity")??"1"),c=Number.parseFloat(i("stroke-opacity")??"1"),u=i("fill-rule"),m={...t,fill:i("fill")??t.fill,fillRule:u==="evenodd"||u==="nonzero"?u:t.fillRule,stroke:i("stroke")??t.stroke,color:i("color")??t.color},f=Number.parseFloat(i("stroke-width")??""),d=vt(f)&&f>=0?f:t.strokeWidth,g=(p,b,_)=>{if(p.length!==0){if(r.segments+=p.length,r.segments>Oe.maxInputSegments)throw new ae(`The SVG has more than ${Oe.maxInputSegments} path segments; simplify it`);r.shapes.push({segments:Z0(p,a),fill:b,fillRule:_});}},h=p=>{let b=(vt(s)?s:1)*(vt(p)?p:1);return b<=0?false:(b<1&&o.add("opacity"),true)};if(e.name!=="line"){let p=sl(m.fill,m,n,o);p&&h(l)&&g(K0(e),p,m.fillRule);}if(d>0&&m.stroke!=="none"){let p=sl(m.stroke,m,n,o);if(p&&h(c)){let b=O2(e,d);b?((i("stroke-dasharray")??"none")!=="none"&&o.add("dash"),g(b,p,e.name==="line"?"nonzero":"evenodd")):o.add("stroke");}}}function H2(e,t){let n=c=>{let u=10**t;return Math.round(c*u)/u+0},o=c=>x(c,t),r="",a=0,i=0,s=0,l=0;for(let c of e){if(c.op==="Z"){r+="z",a=s,i=l;continue}let u=n(c.x),m=n(c.y);if(c.op==="M")r+=`m${o(u-a)} ${o(m-i)}`,s=u,l=m;else if(c.op==="L"){if(u===a&&m===i)continue;r+=m===i?`h${o(u-a)}`:u===a?`v${o(m-i)}`:`l${o(u-a)} ${o(m-i)}`;}else r+=`c${o(n(c.x1)-a)} ${o(n(c.y1)-i)} ${o(n(c.x2)-a)} ${o(n(c.y2)-i)} ${o(u-a)} ${o(m-i)}`;a=u,i=m;}return r}var z2=(e,t)=>e.x0<t.x1&&t.x0<e.x1&&e.y0<t.y1&&t.y0<e.y1;function W2(e){let t=[];for(let n of e){let o=Ht(n.segments);if(!o)continue;let r=t.at(-1);r&&r.shape.fill===n.fill&&r.shape.fillRule===n.fillRule&&!r.boxes.some(a=>z2(a,o))?(r.shape={...r.shape,segments:[...r.shape.segments,...n.segments]},r.boxes.push(o)):t.push({shape:n,boxes:[o]});}return t.map(n=>n.shape)}var ll=e=>[Number.parseInt(e.slice(1,3),16),Number.parseInt(e.slice(3,5),16),Number.parseInt(e.slice(5,7),16)];function q2(e,t,n){let o=new Map;for(let i of e)o.set(i.fill,(o.get(i.fill)??0)+1);let r=new Map([...o.keys()].map(i=>[i,i])),a=0;for(;o.size>t;){let i=[...o.keys()],s=[i[0],i[1]],l=Number.POSITIVE_INFINITY;for(let d=0;d<i.length;d++)for(let g=d+1;g<i.length;g++){let h=ll(i[d]),p=ll(i[g]),b=Math.hypot(h[0]-p[0],h[1]-p[1],h[2]-p[2]);b<l&&(l=b,s=[i[d],i[g]]);}let[c,u]=s,[m,f]=(o.get(c)??0)>=(o.get(u)??0)?[c,u]:[u,c];o.set(m,(o.get(m)??0)+(o.get(f)??0)),o.delete(f);for(let[d,g]of r)g===f&&r.set(d,m);a++;}return a>0&&n.add("colors",a),r}var J0=e=>{let[t,n,o]=ll(e);return .2126*t+.7152*n+.0722*o>235};function V2(e,t={}){let n=new il;try{let o=k2(e),r=yt(o);if(!r)throw new ae("No <svg> element found");let a=Je(r.attrs.viewBox),[i,s,l,c]=[0,0,0,0];if(a.length===4&&a[2]>0&&a[3]>0?[i,s,l,c]=a:(l=he(r,"width"),c=he(r,"height")),!(vt(l)&&vt(c)&&l>0&&c>0))throw new ae("The SVG needs a viewBox (or a width and height)");let m=Oe.artboardSide/Math.max(l,c),f=Math.round(l*m*10)/10,d=Math.round(c*m*10)/10;if(Math.min(f,d)<se.minArtboard)throw new ae("The artboard is too narrow: its sides may differ by 20 times at most");let g=[m,0,0,m,-i*m,-s*m],h={shapes:[],qrBox:null,segments:0};td(r,{matrix:g,fill:"#000000",fillRule:"nonzero",stroke:"none",strokeWidth:1,color:"#000000",opacity:1},F2(r),n,h);let p={x0:0,y0:0,x1:f,y1:d},b=Math.max(f,d)*.004,_=[],y=0,w=0;for(let N of h.shapes){let Q=Ht(N.segments);if(!Q||Q.x1<=0||Q.y1<=0||Q.x0>=f||Q.y0>=d){y++;continue}if(Q.x0<-b||Q.y0<-b||Q.x1>f+b||Q.y1>d+b){let re=to(N.segments,.25).map(ie=>Rn(ie,p)).filter(ie=>ie.length>2);if(re.length===0){y++;continue}w++,_.push({...N,segments:re.flatMap(ie=>cl(ie))});}else _.push(N);}if(y>0&&n.add("outside",y),w>0&&n.add("clipped",w),_.length===0)throw new ae("The SVG has no filled shapes to use");let C=q2(_,Oe.maxColors,n);for(let N of _)N.fill=C.get(N.fill)??N.fill;let S=new Map,$=new Map;for(let N of _){let Q=Ht(N.segments);S.set(N.fill,(S.get(N.fill)??0)+(Q.x1-Q.x0)*(Q.y1-Q.y0)),$.set(N.fill,($.get(N.fill)??0)+1);}let R=[...S.keys()].sort((N,Q)=>Number(J0(N))-Number(J0(Q))||S.get(Q)-S.get(N)),M=R[0],E=R[1],P=N=>N===M?"frame":N===E?"accent":N,I=h.qrBox;if(!I&&t.qr){let[N,Q]=W(g,t.qr.x,t.qr.y);I={x0:N,y0:Q,x1:N+t.qr.size*m,y1:Q+t.qr.size*m};}let L,k,F;I?(L=Math.min(I.x1-I.x0,I.y1-I.y0),k=(I.x0+I.x1-L)/2,F=(I.y0+I.y1-L)/2):(n.add("qr-placed"),L=Math.min(f,d)*.6,k=(f-L)/2,F=(d-L)/2);let T=N=>Math.round(N*10)/10+0;if(L=Math.floor(L*10)/10,k=T(k),F=T(F),L<Math.min(f,d)*se.minQrShare)throw new ae("The QR area must be at least half the frame's shorter side");let H=Math.min(k,F,f-k-L,d-F-L);if(H<L*se.minPadding-1e-9)throw new ae("Leave room around the QR area: at least 4% of its size on every side, inside the artboard");let G=Math.min(Math.max(t.padding??Oe.padding,se.minPadding),.2),z=Math.floor(Math.min(L*G,H)*10)/10,O=W2(_);if(O.length>se.maxShapes)throw new ae(`The artwork has ${O.length} separate shapes; the limit is ${se.maxShapes}. Combine shapes of the same color first`);let Y={kind:sr,version:lr,artboard:{width:f,height:d},qr:{x:k,y:F,size:L,padding:z},colors:{frame:M,...E&&{accent:E}},shapes:O.map(N=>({type:"path",d:H2(N.segments,Oe.decimals),fill:P(N.fill),...N.fillRule==="evenodd"&&{fillRule:"evenodd"}})),labels:[]},be=lo(Y);if(!be.success){let N=be.issues[0];throw new ae(`The converted frame doesn't fit the frame format: ${N?.message??"invalid"}`)}let de=R.map(N=>({color:N,ref:N===M?"frame":N===E?"accent":"fixed",shapes:$.get(N)??0}));return {ok:!0,spec:be.data,warnings:n.list(),palette:de}}catch(o){return {ok:false,error:o instanceof ae?o.message:`Could not read the SVG (${o instanceof Error?o.name:"error"})`,warnings:n.list()}}}var j2=1114,X2={"call-to-action":134,holidays:283,seasons:60,"food-drink":71,shopping:64,"beauty-wellness":26,events:77,places:71,"real-estate":35,automotive:27,"health-learning":48,"sports-fitness":36,business:82,nonprofit:28,objects:28,playful:44};var Y2=[{id:"call-to-action",label:"Call to action"},{id:"holidays",label:"Holidays"},{id:"seasons",label:"Seasons"},{id:"food-drink",label:"Food & drink"},{id:"shopping",label:"Shops & packaging"},{id:"beauty-wellness",label:"Beauty & wellness"},{id:"events",label:"Events & weddings"},{id:"places",label:"Places & Wi-Fi"},{id:"real-estate",label:"Real estate"},{id:"automotive",label:"Cars & parking"},{id:"health-learning",label:"Health & learning"},{id:"sports-fitness",label:"Sports & fitness"},{id:"business",label:"Business & social"},{id:"nonprofit",label:"Nonprofits & community"},{id:"objects",label:"Everyday objects"},{id:"playful",label:"Playful & surprising"}];function ul(e){return Array.isArray(e)?`[${e.map(ul).join(",")}]`:e&&typeof e=="object"?`{${Object.keys(e).filter(n=>e[n]!==void 0).sort().map(n=>`${JSON.stringify(n)}:${ul(e[n])}`).join(",")}}`:JSON.stringify(e)}function Z2(e){let t=ul(e),n=2166136261;for(let o=0;o<t.length;o++)n^=t.charCodeAt(o),n=Math.imul(n,16777619)>>>0;return n.toString(16).padStart(8,"0")}function K2(e,t,n){return Ee(e,t??Ke,n).size}function nd(e,t,n,o=n.size*(t?.size??Ga)){let r={src:e,width:o,height:o,excavate:true,...t?.shape&&t.shape!=="square"&&{shape:t.shape},...t?.plate&&{plate:t.plate}},a=t?.x!==void 0||t?.y!==void 0;if(!(t?.padding||a))return r;let i=K2(n.value,n.level,n.exactLevel),s=Me(i,n.margin,n.shape),l=n.size/(i+2*s);if(t.padding&&(r.padding=t.padding*l),a){let c=i*l,u=m=>Math.min(Math.max((m??.5)*c-o/2,0),c-o);r.x=u(t.x),r.y=u(t.y);}return r}function rd(e,t,n,o){let r=n.level??Ke,a=r;o&&(a=Ae({...n,imageSettings:nd(e,t,n),autoLevel:o}));let i=l=>{let c=m=>nd(e,t,{...n,level:l},m),u=Ss(n,[l],c().width,c);return u>0?c(u):void 0};if(a===r)return i(r);let s=i(a);return s&&Ae({...n,imageSettings:s,autoLevel:o})===a?s:i(r)}function J2({value:e,level:t,margin:n,shape:o,autoLevel:r,exactLevel:a,logoOptions:i}){let l=rd("data:,",{...i,size:Ba},{value:`${e}`,size:1024,margin:n??pe,level:t,shape:o,exactLevel:a},r);return l?l.width/1024:0}function ml({value:e,size:t=1024,fgColor:n,bgColor:o,eyeColor:r,dotColor:a,bodyPattern:i,hideLogo:s,logo:l,logoOptions:c,margin:u,cornerEyePattern:m,cornerEyeDotPattern:f,level:d,templateId:g,frame:h,eyeColors:p,moduleScale:b,autoLevel:_,exactLevel:y,shape:w,eyeShapes:C,eyeGradient:S,bgRadius:$,backdrop:R,halo:M,shadow:E}){let P={value:`${e}`,size:t,margin:u??pe,level:d,shape:w,exactLevel:y},I=!s&&l?rd(l,c,P,_):void 0;return {value:P.value,bgColor:o,fgColor:n,eyeColor:r,dotColor:a,bodyPattern:i,cornerEyePattern:m,cornerEyeDotPattern:f,level:d,templateId:g,size:t,margin:u,...h&&{frame:h},...p&&{eyeColors:p},...b!==void 0&&{moduleScale:b},..._&&{autoLevel:_},...y&&{exactLevel:y},...w&&w!=="square"&&{shape:w},...C&&{eyeShapes:C},...S&&S!=="corner"&&{eyeGradient:S},...$&&{bgRadius:$},...R&&{backdrop:R},...M&&{halo:M},...E&&{shadow:E},...I&&{imageSettings:I}}}var od=.06,ad=.16,id=512;function sd(e){let{width:t,height:n}=e;if(!(t>0&&n>0)||e.data.length<t*n*4)return null;let o=Uint8Array.from(e.data),r=Ni({width:t,height:n,data:o});if(!r)return null;let a=d=>{let g=d*4;return Math.hypot(o[g]/255-r[0],o[g+1]/255-r[1],o[g+2]/255-r[2])},i=new Uint8Array(t*n),s=new Int32Array(t*n),l=0,c=0,u=d=>{i[d]||o[d*4+3]===0||a(d)>=ad||(i[d]=1,s[c++]=d);};for(let d=0;d<t;d++)u(d),u((n-1)*t+d);for(let d=0;d<n;d++)u(d*t),u(d*t+t-1);for(;l<c;){let d=s[l++],g=d%t;g>0&&u(d-1),g<t-1&&u(d+1),d>=t&&u(d-t),d<(n-1)*t&&u(d+t);}let m=new Uint8ClampedArray(o),f=r;for(let d=0;d<t*n;d++){if(!i[d])continue;let g=Math.min(1,Math.max(0,(a(d)-od)/(ad-od))),h=d*4;if(m[h+3]=Math.round(o[h+3]*g),g>0&&g<1)for(let p=0;p<3;p++){let _=(o[h+p]/255-(1-g)*f[p])/g;m[h+p]=Math.round(Math.min(1,Math.max(0,_))*255);}}return {width:t,height:n,data:m}}async function eb(e){if(typeof document>"u"||typeof Image>"u")throw new Error("removeLogoBackground needs a browser (canvas)");let t=await new Promise(s=>{let l=new Image;l.crossOrigin="anonymous",l.onload=()=>s(l),l.onerror=()=>s(null),l.src=e;});if(!t)return null;let n=t.naturalWidth||512,o=t.naturalHeight||512,r=Math.min(1,id/Math.max(n,o)),a=document.createElement("canvas");a.width=Math.max(1,Math.round(n*r)),a.height=Math.max(1,Math.round(o*r));let i=a.getContext("2d",{willReadFrequently:true});if(!i)return null;try{i.drawImage(t,0,0,a.width,a.height);let s=i.getImageData(0,0,a.width,a.height),l=sd(s);return l?(s.data.set(l.data),i.putImageData(s,0,0),a.toDataURL("image/png")):null}catch{return null}finally{a.remove();}}var tb={value:true,size:true,level:true,bgColor:true,fgColor:true,eyeColor:true,dotColor:true,bodyPattern:true,cornerEyePattern:true,cornerEyeDotPattern:true,margin:true,style:true,imageSettings:true,isOGContext:true,templateId:true,customTemplate:true,customProps:true,frame:true,art:true,eyeColors:true,moduleScale:true,autoLevel:true,exactLevel:true,shape:true,eyeShapes:true,eyeGradient:true,bgRadius:true,backdrop:true,halo:true,shadow:true,frameLabelMarkers:true,partMarkers:true,hideLogo:true,logo:true,logoOptions:true,scale:true};function nb(e){let t={};for(let n of Object.keys(e))Object.hasOwn(tb,n)||(t[n]=e[n]);return t}var dl=["value","fgColor","hideLogo","bgColor","eyeColor","dotColor","bodyPattern","cornerEyePattern","cornerEyeDotPattern","level","templateId","logo","logoOptions","margin","autoLevel","exactLevel","shape","eyeShapes","eyeGradient","bgRadius","backdrop","halo","shadow"];function ma(e){let t=Object.fromEntries(dl.map(n=>[n,e[n]]));return ml({...t,margin:e.margin??pe})}function da(e,t){let{size:n=ce,scale:o=1,level:r,style:a,customTemplate:i,customProps:s,frame:l,art:c,eyeColors:u,moduleScale:m,autoLevel:f,exactLevel:d,shape:g,frameLabelMarkers:h,partMarkers:p}=e,b={...t.eyeShapes&&{eyeShapes:t.eyeShapes},...t.eyeGradient&&{eyeGradient:t.eyeGradient},...t.bgRadius&&{bgRadius:t.bgRadius},...t.backdrop&&{backdrop:t.backdrop},...t.halo&&{halo:t.halo},...t.shadow&&{shadow:t.shadow}},_=n*o,y=_/t.size,w=t.imageSettings&&{...t.imageSettings,height:t.imageSettings.height*y,width:t.imageSettings.width*y,...t.imageSettings.x!=null&&{x:t.imageSettings.x*y},...t.imageSettings.y!=null&&{y:t.imageSettings.y*y},...t.imageSettings.padding!=null&&{padding:t.imageSettings.padding*y}};return {art:c,bgColor:t.bgColor,bodyPattern:t.bodyPattern,cornerEyeDotPattern:t.cornerEyeDotPattern,cornerEyePattern:t.cornerEyePattern,customProps:s,customTemplate:i,dotColor:t.dotColor,eyeColor:t.eyeColor,fgColor:t.fgColor,frame:l,level:r||t.level,margin:t.margin,...u&&{eyeColors:u},...m!==void 0&&{moduleScale:m},...f&&{autoLevel:f},...d&&{exactLevel:d},...g&&g!=="square"&&{shape:g},...b,...h&&{frameLabelMarkers:h},...p&&{partMarkers:p},size:_,style:a,templateId:t.templateId,value:t.value,...w&&{imageSettings:w},...nb(e)}}function rb(e){return da(e,ma(e))}function ld(e,t){let n=[],o=r=>{if(r==null||typeof r=="boolean")return;if(typeof r=="string"||typeof r=="number"||typeof r=="bigint"){n.push(`${r}`);return}if(Array.isArray(r)){for(let c of r)o(c);return}if(!Ot(r))throw new TypeError("qrdx: can't render this value");let{type:a,props:i,key:s}=r;if(Sn(a)){o(i.children);return}if(typeof a=="function"){o(a(i));return}let l={};for(let c of Object.keys(i)){let u=Yn(c,i[c]);u&&(l[u.name]=u.value);}n.push(t(a,l,ld(i.children,t),s));};return o(e),n}var Jn=300,Qr=e=>{let t=typeof e=="number"?e:Number.parseFloat(String(e));return Number.isFinite(t)?t:void 0};function ob(e){let t=Qr(e.x)??0,n=Qr(e.y)??0,o=Je(typeof e.viewBox=="string"?e.viewBox:void 0),r=Qr(e.width),a=Qr(e.height);if(o.length!==4||!(o[2]&&o[3]&&r&&a))return [1,0,0,1,t,n];let[i,s,l,c]=o,u=Math.min(r/l,a/c);return [u,0,0,u,t+(r-l*u)/2-i*u,n+(a-c*u)/2-s*u]}function fl(e,t,n,o){if(e===t)return n;if(Array.isArray(e)){for(let s of e){let l=fl(s,t,n,false);if(l)return l}return null}let r=e;if(!r||typeof r!="object"||!r.props)return null;let{props:a}=r,i=me(n,Ue(typeof a.transform=="string"?a.transform:void 0));return r.type==="svg"&&!o&&(i=me(i,ob(a))),fl(a.children,t,i,false)}function hl(e){let t=e.customTemplate||(e.templateId?ko(e.templateId):void 0);if(!t)return 1;let n={type:"svg",props:{height:Jn,viewBox:`0 0 ${Jn} ${Jn}`,width:Jn},key:null},o;try{o=t.wrapper(n,{fgColor:typeof e.fgColor=="string"?e.fgColor:void 0,bgColor:typeof e.bgColor=="string"?e.bgColor:void 0,...e.customProps??{}},{pixelSize:10,url:e.value});}catch{return 1}let r=o?.props;if(!r)return 1;let a=Je(typeof r.viewBox=="string"?r.viewBox:void 0),i=a.length===4?a[2]:Qr(r.width),s=fl(o,n,En,true);if(!(s&&i))return 1;let[l,c]=W(s,0,0),[u,m]=W(s,Jn,Jn),d=Math.min(Math.abs(u-l),Math.abs(m-c))/i;return d>0&&d<=1?d:1}var gd=[96,160,320],gl=640;function pa(){if(typeof document>"u")throw new Error("Scan scoring needs a browser (canvas + image decoding)")}function Lt(e){if(e?.aborted)throw new DOMException("Scan scoring was aborted","AbortError")}var bd=()=>new Promise(e=>setTimeout(e,0));async function _l(){let{default:e}=await import('jsqr');return e}function bl(e,t){if(!e)return false;if(e.data===t)return true;try{return new TextDecoder().decode(Uint8Array.from(e.binaryData))===t}catch{return false}}function ab(e,t,n=.7){let{data:o,width:r,height:a}=e,i=r*a,s=Math.max(1,Math.round(t*.25)),l=ib(o,i);if(l){for(let u=0;u<i;u++)l[u]=128+(l[u]-128)*n;cd(l,r,a,s);for(let u=0,m=0;u<i;u++,m+=4){let f=l[u];o[m]=f,o[m+1]=f,o[m+2]=f;}return}let c=new Uint8ClampedArray(i);for(let u=0;u<3;u++){for(let m=0,f=u;m<i;m++,f+=4)c[m]=128+(o[f]-128)*n;cd(c,r,a,s);for(let m=0,f=u;m<i;m++,f+=4)o[f]=c[m];}}function ib(e,t){let n=new Uint8ClampedArray(t);for(let o=0,r=0;o<t;o++,r+=4){let a=e[r];if(a!==e[r+1]||a!==e[r+2])return null;n[o]=a;}return n}function cd(e,t,n,o){let r=2*o+1,a=new Float32Array(t*n),i=s=>{let l=s?n:t,c=s?t:n,u=s?t:1,m=s?1:t;for(let f=0;f<l;f++){let d=f*u,g=0;for(let h=-o;h<=o;h++)g+=e[d+Math.min(Math.max(h,0),c-1)*m];for(let h=0;h<c;h++)a[d+h*m]=g/r,g=g-e[d+Math.max(h-o,0)*m]+e[d+Math.min(h+o+1,c-1)*m];}e.set(a);};for(let s=0;s<2;s++)i(true),i(false);}function er(e,t){let n=document.createElement("canvas");n.width=Math.max(1,Math.round(e)),n.height=Math.max(1,Math.round(t));let o=n.getContext("2d",{willReadFrequently:true});if(!o)throw new Error("Could not get canvas context");return o.imageSmoothingEnabled=true,o.imageSmoothingQuality="high",{canvas:n,ctx:o}}var sb=[.9,1,1.1];function _d(e){return sb.map(t=>e*t)}function yl(e,t,n,o,r){let a=0;for(let i of _d(n)){let s=t(i);if(ab(s,i/o),r(e(s.data,s.width,s.height))&&(a++,a>=2))break}return a>=2?"pass":a===1?"fragile":"fail"}var pl={small:"small print or far away",medium:"typical phone distance",large:"close up"};function lb(e,t){return e===t[0]&&t.length>1?pl.small:e===t.at(-1)?pl.large:pl.medium}function yd(e,t,n){if(n==="pass")return 0;let o=t===1?[45]:t===2?[20,45]:[15,20,45],r=o[Math.round(e*(o.length-1)/Math.max(t-1,1))]??20;return n==="fragile"?Math.round(r/2):r}function xd(e,t,n){let o=`${e} px (${lb(e,t)})`;return n==="pass"?{id:`decode-${e}`,passed:true,message:`Reads at ${o}, with camera blur`}:{id:`decode-${e}`,passed:false,message:n==="fragile"?`Reads at ${o} only some of the time`:`Doesn't read at ${o}`,fix:e===t[0]?"Print it bigger, shorten the content (fewer modules) or use solid square dots":"Raise the contrast, use bigger dots or a simpler eye shape"}}function $d(e,t){return t?"fails":e>=85?"great":e>=65?"ok":"risky"}function cb(e,t,n){let o=Le(e,t);if(o.type==="solid")return [o.color];if(o.type!=="image")return o.stops.map(s=>s.color);let r=o.underlay?ha(o.underlay):null,a=n?.[o.src];if(!a)return o.underlay?[o.underlay]:[];let i=o.opacity??1;return [a.light,a.dark].flatMap(s=>{let l=ha(s);if(!l)return [];let c={...l,a:l.a*i};if(!r)return [ud(c)];let u=c.a+r.a*(1-c.a),m=(f,d)=>u>0?(f*c.a+d*r.a*(1-c.a))/u:0;return [ud({r:m(c.r,r.r),g:m(c.g,r.g),b:m(c.b,r.b),a:u})]})}var ud=({r:e,g:t,b:n,a:o})=>`rgba(${Math.round(e)}, ${Math.round(t)}, ${Math.round(n)}, ${Math.round(o*1e3)/1e3})`;function ub(e){let t=[],n=e.width*e.height;for(let a=0;a<n;a++){let i=e.data[a*4],s=e.data[a*4+1],l=e.data[a*4+2];e.data[a*4+3]<128||t.push({lum:jn(i,s,l),r:i,g:s,b:l});}if(t.length===0)return null;t.sort((a,i)=>a.lum-i.lum);let o=Math.max(1,Math.round(t.length/10)),r=a=>{let i=a.reduce((l,c)=>({r:l.r+c.r,g:l.g+c.g,b:l.b+c.b}),{r:0,g:0,b:0}),s=l=>Math.round(l/a.length).toString(16).padStart(2,"0");return `#${s(i.r)}${s(i.g)}${s(i.b)}`};return {dark:r(t.slice(0,o)),light:r(t.slice(-o))}}async function mb(e){pa();let t=await zr(e),{canvas:n,ctx:o}=er(64,64);o.drawImage(t,0,0,64,64);let r=ub(o.getImageData(0,0,64,64));return n.remove(),r}function Sd(e){let t=[e.bgColor,e.fgColor,e.eyeColor,e.dotColor,...Qt.flatMap(o=>[e.eyeColors?.[o]?.outer,e.eyeColors?.[o]?.inner])],n=new Set;for(let o of t)typeof o=="object"&&o?.type==="image"&&n.add(o.src);return [...n]}var Ur=null;function ha(e){let t=le(e);if(t||typeof document>"u")return t;if(Ur??=document.createElement("canvas").getContext("2d"),!Ur)return null;Ur.fillStyle="#010203",Ur.fillStyle=e;let n=String(Ur.fillStyle);return n==="#010203"?null:le(n)}var md=e=>jn(e.r,e.g,e.b),wd=(e,t)=>(Math.max(e,t)+.05)/(Math.min(e,t)+.05),Hr=4.5,db=3,dd=1.5,fd={code:7,background:12},hd={r:255,g:255,b:255,a:1},pd=(e,t)=>({r:e.r*e.a+t.r*(1-e.a),g:e.g*e.a+t.g*(1-e.a),b:e.b*e.a+t.b*(1-e.a),a:1});function fb(e,t={}){let n=t.imageTones,o=(g,h)=>{let p=typeof g=="object"&&g?.type==="image";return cb(g,h,n).map(b=>({color:b,picture:p}))},r=e.fgColor??Re,a=Qt.flatMap(g=>{let h=e.eyeColors?.[g];return [...h?.outer?o(h.outer,Re):[],...h?.inner?o(h.inner,Re):[]]}),i=[...o(r,Re),...o(e.eyeColor??r,Re),...o(e.dotColor??r,Re),...a],s=o(e.bgColor,fe),l=Er(e.halo,e)?.color;l&&s.push({color:l,picture:false});let c=(s.length>0?s:[{color:"#ffffff",picture:false}]).map(g=>{let h=ha(g.color);return {color:h?pd(h,hd):hd,picture:g.picture}}),u=i.flatMap(g=>{let h=ha(g.color);return h?[{color:h,picture:g.picture}]:[]}),m=Number.POSITIVE_INFINITY,f=Hr,d=false;for(let g of u)for(let h of c){let p=md(pd(g.color,h.color)),b=md(h.color),_=wd(p,b),y=h.picture?fd.background:g.picture?fd.code:Hr;_/y<m/f&&(m=_,f=y),p>b&&(d=true);}return {ratio:Number.isFinite(m)?m:Number.POSITIVE_INFINITY,required:f,inverted:d}}function hb(e,t){let{ratio:n,inverted:o,required:r}=fb(e,{imageTones:t});if(!Number.isFinite(n))return {checks:[],penalty:0,fails:false};let a=r/Hr,i=r!==Hr,s=Math.round(n*10)/10,l=[],c=0;return n>=r?l.push({id:"contrast",passed:true,message:`Contrast ${s}:1 between code and background`}):(c=n<dd*a?60:n<db*a?30:10,l.push({id:"contrast",passed:false,message:i?`Low contrast for a picture (${s}:1); ${r}:1 or more scans reliably`:`Low contrast (${s}:1); 4.5:1 or more scans reliably`,fix:i?"Lower the picture's opacity over a darker underlay (dots) or a lighter one (background)":"Use a darker code color or a lighter background"})),o?(c+=10,l.push({id:"polarity",passed:false,message:"Light code on a dark background; some scanner apps can't read it",fix:"Use dark modules on a light background"})):l.push({id:"polarity",passed:true,message:"Dark code on a light background"}),{checks:l,penalty:c,fails:n<dd*(r/Hr)}}function xl(e){return Ee(e.value,Ae(e),e.exactLevel).getModules()}function pb(e){let{imageSettings:t}=e;if(!t)return {check:null,penalty:0};let n=xl(e),o=Et(n,e.size??ce,Me(n.length,e.margin??pe,e.shape),t);if(!o)return {check:null,penalty:0};let r=o.excavation??o,a=n.length,s=[[0,0],[a-8,0],[0,a-8]].some(([g,h])=>r.x<g+9&&r.x+r.w>g&&r.y<h+9&&r.y+r.h>h),l=a>21?a-9:null,c=l!==null&&r.x<l+5&&r.x+r.w>l&&r.y<l+5&&r.y+r.h>l;if(s||c)return {check:{id:"logo",passed:false,message:s?"The logo covers a corner eye":"The logo covers the small square near the bottom-right corner",fix:"Move the logo toward the center or make it smaller"},penalty:40};let u=r.w*r.h/(a*a),m=Ae(e),f=Math.round(u*100),d=Bo({value:e.value,size:e.size??ce,margin:e.margin??pe,level:m,shape:e.shape,exactLevel:e.exactLevel},t);return !d||d.worst<=d.budget?{check:{id:"logo",passed:true,message:`Logo covers ${f}% of the code; error correction repairs it with room to spare`},penalty:0}:{check:{id:"logo",passed:false,message:`Logo covers ${f}% of the code and spoils ${d.worst} codewords in one block, which repairs ${d.correctable}`,fix:d.level==="H"?"Use a smaller logo":"Switch error correction to H or use a smaller logo"},penalty:d.worst>d.correctable?25:10}}function gb(e){let t=Cr(e.shape)?Zt(e.margin??pe):e.margin??pe,n=xl(e).length+2*t,o=t+(Fe(e.frame)?vi(e.frame)*n:0),r=Math.round(o*10)/10;return o>=4?{check:{id:"quiet-zone",passed:true,message:`Quiet zone of ${r} modules`},penalty:0}:o>=1.5?{check:{id:"quiet-zone",passed:true,message:`Quiet zone of ${r} modules (4 is ideal)`},penalty:0}:{check:{id:"quiet-zone",passed:false,message:"No quiet zone around the code",fix:"Leave clear space (about 10% of the code width) around it wherever you place it, or add a frame"},penalty:5}}function bb(e){let t=ls(e);return t?t.reason==="adjusted"?{check:{id:"halo",passed:true,message:t.message},penalty:0}:{check:{id:"halo",passed:false,message:t.message,fix:t.fix},penalty:15}:{check:null,penalty:0}}function _b(e){let t=os(e);return t==="curly"?{check:{id:"eye-shape",passed:false,message:"Curly eyes fail strict decoders such as ZXing-based apps",fix:"Pick square, rounded or gear eyes"},penalty:40}:t==="circle"?{check:{id:"eye-shape",passed:false,message:"Circle eyes only read in lenient decoders; many apps miss them",fix:"Pick square, rounded or gear eyes"},penalty:20}:{check:{id:"eye-shape",passed:true,message:`No known decoder issues with ${t} eyes`},penalty:0}}function zr(e){return new Promise((t,n)=>{let o=new Image;o.crossOrigin="anonymous",o.onload=()=>t(o),o.onerror=()=>n(new Error("Could not load image")),o.src=e;})}var yb=`data:image/svg+xml,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 10"><rect width="10" height="10" rx="2" fill="#808080"/></svg>')}`;async function xb(e){let{imageSettings:t}=e;if(!t||t.src.startsWith("data:"))return e;let n=yb;try{let o=await zr(t.src),{canvas:r,ctx:a}=er(o.naturalWidth||256,o.naturalHeight||256);a.drawImage(o,0,0,r.width,r.height),n=r.toDataURL("image/png");}catch{}return {...e,imageSettings:{...t,src:n}}}async function $b(e){let t=new Map;for(let r of Sd(e))if(!r.startsWith("data:"))try{let a=await zr(r),{canvas:i,ctx:s}=er(a.naturalWidth||256,a.naturalHeight||256);s.drawImage(a,0,0,i.width,i.height),t.set(r,i.toDataURL("image/png")),i.remove();}catch{t.set(r,null);}if(t.size===0)return e;let n=r=>{if(typeof r!="object"||r?.type!=="image")return r;let a=t.get(r.src);return a===void 0?r:a?{...r,src:a}:r.underlay??Re},o=e.eyeColors?Object.fromEntries(Object.entries(e.eyeColors).map(([r,a])=>[r,a&&{outer:n(a.outer),inner:n(a.inner)}])):void 0;return {...e,bgColor:n(e.bgColor),fgColor:n(e.fgColor),eyeColor:n(e.eyeColor),dotColor:n(e.dotColor),...o&&{eyeColors:o}}}async function $l(e,t,n,o,r){let a=[],i=0,s=hb(e,r);i+=s.penalty;let l=pb(e);i+=l.penalty;let c=gb(e);i+=c.penalty;let u=_b(e);i+=u.penalty;let m=bb(e);i+=m.penalty;let f=as(e),d=f?.kind==="eye"?null:f;d&&d.kind!=="sharp-dot-eye"&&(i+=10);let g=await _l();Lt(o);let h=xl(e).length,p=h+2*Me(h,e.margin??pe,e.shape),b=[],_=false;for(let[C,S]of n.entries()){await bd(),Lt(o);let $=yl(g,t,S,p,R=>bl(R,e.value));i+=yd(C,n.length,$),b.push(xd(S,n,$)),C===n.length-1&&$==="fail"&&(_=true);}a.push(...b,...s.checks),l.check&&a.push(l.check),a.push(u.check,c.check),m.check&&a.push(m.check),d&&a.push({id:"style-pair",passed:false,message:d.message,fix:d.fix});let y=_||s.fails,w=Math.max(0,Math.min(100,100-i));return y&&(w=Math.min(w,30)),{score:w,grade:$d(w,y),checks:a}}function Cd(e){return [...e.sizes??gd].filter(t=>t>0).sort((t,n)=>t-n)}async function c8(e,t={}){pa();let{draw:n,sizes:o,imageTones:r}=await Rd(e,t);return await $l(e,n,o,t.signal,r)}async function u8(e,t={}){pa();let{draw:n,sizes:o,imageTones:r}=await Rd(e,t),a=o.flatMap(i=>_d(i).map(s=>{let{data:l,width:c,height:u}=n(s);return {codeWidth:s,width:c,height:u,data:l}}));return {sizes:o,frames:a,imageTones:r}}async function m8(e,t,n={}){let o=new Map(t.frames.map(a=>[a.codeWidth,a]));return await $l(e,a=>{let i=o.get(a);if(!i||i.data.length<i.width*i.height*4)throw new Error(`No scan frame with the code ${a} px wide: draw the frames with drawScanFrames for these props and sizes`);return {data:new Uint8ClampedArray(i.data),width:i.width,height:i.height,colorSpace:"srgb"}},t.sizes,n.signal,t.imageTones)}async function Rd(e,t){let{signal:n}=t,o=Cd(t),r=gl/hl(e),a=await $b(await xb(Pt({...e,size:e.size??ce},r)));Lt(n);let i={};for(let m of Sd(e))try{let f=await mb(m);f&&(i[m]=f);}catch{}Lt(n);let s=await Xe(a),l=await zr(s);Lt(n);let c=ut(r,e.frame);return {draw:m=>{let f=m/gl,d=c.width*f,g=c.height*f,h=Math.max(8,Math.round(m*.12)),{canvas:p,ctx:b}=er(d+2*h,g+2*h);b.fillStyle="#ffffff",b.fillRect(0,0,p.width,p.height),b.drawImage(l,h,h,d,g);let _=b.getImageData(0,0,p.width,p.height);return p.remove(),_},sizes:o,imageTones:i}}var d8=gl;async function f8(e,t,n={}){let{width:o,height:r}=t;if(!(o>0&&r>0)||t.data.length<o*r*4)throw new Error("Pixels must be width \xD7 height \xD7 4 RGBA bytes");let a=Cd(n),i=e.size??ce,s=ut(i,e.frame),l=o*i*hl(e)/s.width,c={data:Sb(t),width:o,height:r},u=Md(c.data);return await $l(e,f=>{let d=Ed(c,f/l,u),g=Math.max(8,Math.round(f*.12));return wb(d,g)},a,n.signal)}function Sb(e){let{data:t,width:n,height:o}=e,r=new Uint8ClampedArray(n*o*4);for(let a=0;a<n*o*4;a+=4){let i=t[a+3]/255;for(let s=0;s<3;s++)r[a+s]=t[a+s]*i+255*(1-i);r[a+3]=255;}return r}function wb(e,t){let n=e.width+2*t,o=e.height+2*t,r=new Uint8ClampedArray(n*o*4).fill(255);for(let a=0;a<e.height;a++)r.set(e.data.subarray(a*e.width*4,(a+1)*e.width*4),((a+t)*n+t)*4);return {data:r,width:n,height:o,colorSpace:"srgb"}}var It=(e,t)=>Math.hypot(e.x-t.x,e.y-t.y);function fa(e,t){return .299*e[t]+.587*e[t+1]+.114*e[t+2]}function Cb(e,t){let n=0;for(let s=0;s<256;s++)n+=s*e[s];let o=0,r=0,a=0,i=128;for(let s=0;s<256;s++){if(r+=e[s],r===0)continue;let l=t-r;if(l===0)break;o+=s*e[s];let c=o/r,u=(n-o)/l,m=r*l*(c-u)**2;m>a&&(a=m,i=s);}return i}async function Rb(e){if(!(e instanceof Blob))return e.complete||await new Promise(n=>{e.addEventListener("load",n,{once:true}),e.addEventListener("error",n,{once:true});}),e;let t=URL.createObjectURL(e);try{let n=await zr(t);return await n.decode?.().catch(()=>{}),n}finally{setTimeout(()=>URL.revokeObjectURL(t),1e3);}}async function h8(e,t={}){pa();let{signal:n}=t,o=[...t.sizes??gd].filter(B=>B>0).sort((B,te)=>B-te),r=await _l(),a=await Rb(e);Lt(n);let i=a.naturalWidth||a.width,s=a.naturalHeight||a.height;if(!(i&&s))throw new Error("Could not read this image");let l=Math.min(1,1600/Math.max(i,s)),{canvas:c,ctx:u}=er(i*l,s*l);u.fillStyle="#ffffff",u.fillRect(0,0,c.width,c.height),u.drawImage(a,0,0,c.width,c.height);let m=u.getImageData(0,0,c.width,c.height),f=r(m.data,m.width,m.height);if(Lt(n),!f){let B=await Zm(a,0,false);return c.remove(),typeof B!="string"||B==="NO_QR"?{data:null,version:null,score:0,grade:"fails",checks:[{id:"decode",passed:false,message:"No QR code found in this image",fix:"Try a sharper, well-lit, straight-on photo or a screenshot"}]}:{data:B,version:null,score:55,grade:"risky",checks:[{id:"decode",passed:false,message:"Decoded only after cropping; the code is small or hard to find in this image",fix:"Make the code bigger relative to its surroundings"}]}}let{location:d,version:g}=f,h=17+4*g,p=(It(d.topLeftCorner,d.topRightCorner)+It(d.bottomLeftCorner,d.bottomRightCorner)+It(d.topLeftCorner,d.bottomLeftCorner)+It(d.topRightCorner,d.bottomRightCorner))/4,b=p/h,_=[d.topLeftCorner,d.topRightCorner,d.bottomRightCorner,d.bottomLeftCorner],y=Math.max(0,Math.floor(Math.min(..._.map(B=>B.x)))),w=Math.min(m.width,Math.ceil(Math.max(..._.map(B=>B.x)))),C=Math.max(0,Math.floor(Math.min(..._.map(B=>B.y)))),S=Math.min(m.height,Math.ceil(Math.max(..._.map(B=>B.y)))),$=[],R=0,M=new Array(256).fill(0),E=0;for(let B=C;B<S;B++)for(let te=y;te<w;te++){let V=Math.round(fa(m.data,(B*m.width+te)*4));M[V]=M[V]+1,E++;}let P=Cb(M,E),I={dark:[0,0,0,0],light:[0,0,0,0]};for(let B=C;B<S;B++)for(let te=y;te<w;te++){let V=(B*m.width+te)*4,q=fa(m.data,V)<=P?I.dark:I.light;q[0]=q[0]+m.data[V],q[1]=q[1]+m.data[V+1],q[2]=q[2]+m.data[V+2],q[3]=q[3]+1;}let L=B=>{let te=Math.max(B[3],1);return jn(B[0]/te,B[1]/te,B[2]/te)},k=L(I.dark),F=L(I.light),T=wd(k,F),H=Math.round(T*10)/10;T>=4.5?$.push({id:"contrast",passed:true,message:`Contrast ${H}:1 in the image`}):(R+=T<2?30:10,$.push({id:"contrast",passed:false,message:`Low contrast in the image (${H}:1)`,fix:"Use a darker code on a lighter background, or better lighting for photos"}));let z=[d.topLeftFinderPattern,d.topRightFinderPattern,d.bottomLeftFinderPattern].map(B=>{let te=Math.min(m.width-1,Math.max(0,Math.round(B.x))),V=Math.min(m.height-1,Math.max(0,Math.round(B.y)));return fa(m.data,(V*m.width+te)*4)}).filter(B=>B>P).length>=2;z?(R+=10,$.push({id:"polarity",passed:false,message:"Light code on a dark background; some scanner apps can't read it",fix:"Use dark modules on a light background"})):$.push({id:"polarity",passed:true,message:"Dark code on a light background"});let O=Math.max(2,Math.round(b*2)),Y={minX:y-O,maxX:w+O,minY:C-O,maxY:S+O};if(Y.minX<0||Y.minY<0||Y.maxX>m.width||Y.maxY>m.height)$.push({id:"quiet-zone",passed:true,skipped:true,message:"The image is cropped too tight to check the quiet zone"});else {let B=0,te=0;for(let V=Y.minY;V<Y.maxY;V++)for(let q=Y.minX;q<Y.maxX;q++){if(q>=y&&q<w&&V>=C&&V<S)continue;let tr=fa(m.data,(V*m.width+q)*4);(z?tr>P:tr<=P)&&B++,te++;}B/Math.max(te,1)>.12?(R+=10,$.push({id:"quiet-zone",passed:false,message:"Something dark touches the code; the quiet zone isn't clear",fix:"Leave clear space (about 4 modules) around the code"})):$.push({id:"quiet-zone",passed:true,message:"Clear space around the code"});}b<2?$.push({id:"resolution",passed:false,message:`Low resolution: about ${Math.round(b*10)/10} px per module`,fix:"Use a larger image, or export the code at a bigger size"}):$.push({id:"resolution",passed:true,message:`About ${Math.round(b)} px per module`});let de=Math.round(b*4),N=Math.max(0,y-de),Q=Math.max(0,C-de),re=Math.min(m.width,w+de)-N,ie=Math.min(m.height,S+de)-Q,Tt=B=>{let te=B/p,V=er(re*te,ie*te);V.ctx.drawImage(c,N,Q,re,ie,0,0,V.canvas.width,V.canvas.height);let q=V.ctx.getImageData(0,0,V.canvas.width,V.canvas.height);return V.canvas.remove(),q},oe=[],ot=false;for(let[B,te]of o.entries()){await bd(),Lt(n);let V=yl(r,Tt,te,h,q=>q?.data===f.data);R+=yd(B,o.length,V),oe.push(xd(te,o,V)),B===o.length-1&&V==="fail"&&(ot=true);}c.remove();let kt=Math.max(0,Math.min(100,100-R));return ot&&(kt=Math.min(kt,30)),{data:f.data,version:g,score:kt,grade:$d(kt,ot),checks:[...oe,...$]}}var Mb=[320];function Md(e){for(let t=0;t<e.length;t+=4)if(e[t]!==e[t+1]||e[t]!==e[t+2])return false;return true}function Ed(e,t,n=false){let o=Math.min(1,t),r=Math.max(1,Math.round(e.width*o)),a=Math.max(1,Math.round(e.height*o)),i=new Uint8ClampedArray(r*a*4),s=e.width/r,l=e.height/a,{data:c}=e;for(let u=0;u<a;u++){let m=Math.floor(u*l),f=Math.max(m+1,Math.min(e.height,Math.floor((u+1)*l)));for(let d=0;d<r;d++){let g=Math.floor(d*s),h=Math.max(g+1,Math.min(e.width,Math.floor((d+1)*s))),p=(f-m)*(h-g),b=(u*r+d)*4,_=0;if(n){for(let C=m;C<f;C++)for(let S=g;S<h;S++)_+=c[(C*e.width+S)*4];i[b]=_/p,i[b+1]=i[b],i[b+2]=i[b],i[b+3]=255;continue}let y=0,w=0;for(let C=m;C<f;C++)for(let S=g;S<h;S++){let $=(C*e.width+S)*4;_+=c[$],y+=c[$+1],w+=c[$+2];}i[b]=_/p,i[b+1]=y/p,i[b+2]=w/p,i[b+3]=255;}}return {data:i,width:r,height:a,colorSpace:"srgb"}}function Eb(e){try{return new TextDecoder("utf-8",{fatal:!0}).decode(Uint8Array.from(e.binaryData))}catch{return e.data}}async function p8(e,t,n={}){let{width:o,height:r}=e;if(!(o>0&&r>0)||e.data.length<o*r*4)throw new Error("Pixels must be width \xD7 height \xD7 4 RGBA bytes");let a=await _l(),i={data:e.data instanceof Uint8ClampedArray?e.data:Uint8ClampedArray.from(e.data),width:o,height:r},s=a(i.data,o,r,{inversionAttempts:"dontInvert"});if(!s)return {data:null,version:null,passed:false};let l=Eb(s),{version:c,location:u}=s;if(!bl(s,t))return {data:l,version:c,passed:false};let m=17+4*c,f=(It(u.topLeftCorner,u.topRightCorner)+It(u.bottomLeftCorner,u.bottomRightCorner)+It(u.topLeftCorner,u.bottomLeftCorner)+It(u.topRightCorner,u.bottomRightCorner))/4,d=Md(i.data);for(let g of n.sizes??Mb)if(yl(a,p=>Ed(i,p/f,d),g,m,p=>bl(p,t))!=="pass")return {data:l,version:c,passed:false};return {data:l,version:c,passed:true}}var Ab=16,Ad=.01;function Pb(e){let t=new Float64Array(256);for(let l of e)t[Math.min(255,Math.max(0,Math.round(l*255)))]++;let n=e.length,o=0;for(let l=0;l<256;l++)o+=l*t[l];let r=0,a=0,i=0,s=128;for(let l=0;l<256;l++){if(a+=t[l],a===0)continue;let c=n-a;if(c===0)break;r+=l*t[l];let u=r/a,m=(o-r)/c,f=a*c*(u-m)**2;f>i&&(i=f,s=l);}return (s+.5)/255}function vb(e,t){let{width:n,height:o,data:r}=e,a=n*o,i=new Uint8Array(a),s=0;for(let d=0;d<a;d++)r[d*4+3]<128&&s++;if(t==="alpha"||t==="auto"&&s>a*.02&&s<a*.98){for(let d=0;d<a;d++)i[d]=r[d*4+3]>=128?1:0;return i}let c=new Float32Array(a);for(let d=0;d<a;d++){let g=r[d*4+3]/255,h=.2126*r[d*4]+.7152*r[d*4+1]+.0722*r[d*4+2];c[d]=1-(h*g+255*(1-g))/255;}let u=Pb(c);for(let d=0;d<a;d++)i[d]=c[d]>u?1:0;let m=0,f=0;for(let d=0;d<n;d++)for(let g of [0,o-1])m++,f+=i[g*n+d];for(let d=1;d<o-1;d++)for(let g of [0,n-1])m++,f+=i[d*n+g];if(f>m/2)for(let d=0;d<a;d++)i[d]=i[d]?0:1;return i}function Pd(e,t,n,o){for(let r of [1,0]){let a=new Uint8Array(e.length);for(let i=0;i<e.length;i++){if(a[i]||e[i]!==r)continue;let s=[i];a[i]=1;let l=false;for(let u of s){let m=u%t,f=(u-m)/t;(m===0||f===0||m===t-1||f===n-1)&&(l=true);for(let[d,g]of [[m-1,f],[m+1,f],[m,f-1],[m,f+1]]){if(d<0||g<0||d>=t||g>=n)continue;let h=g*t+d;!a[h]&&e[h]===r&&(a[h]=1,s.push(h));}}if((r===1||!l)&&s.length<o)for(let u of s)e[u]=r?0:1;}}}function vd(e,t={}){let{width:n,height:o,data:r}=e;if(!(n>0&&o>0)||r.length<n*o*4)throw new Error("Silhouette pixels must be width \xD7 height \xD7 4 RGBA bytes");let a=vb(e,t.mode??"auto"),i=a.reduce(($,R)=>$+R,0);Pd(a,n,o,Math.max(16,i*Ad));let s=n,l=o,c=-1,u=-1;for(let $=0;$<o;$++)for(let R=0;R<n;R++)a[$*n+R]&&(s=Math.min(s,R),l=Math.min(l,$),c=Math.max(c,R),u=Math.max(u,$));if(c<0)throw new Error("No shape found: use a picture with a dark or opaque shape on a light or clear background");let m=c-s+1,f=u-l+1;if(Math.max(m,f)<Ab)throw new Error("The shape is too small to trace; use a bigger picture");let g=Math.min(Math.max(Math.round(t.cells??Gt),_t),Gt)/Math.max(m,f),h=Math.max(_t,Math.round(m*g)),p=Math.max(_t,Math.round(f*g)),b=Math.max(1,Math.round(m*g)),_=Math.max(1,Math.round(f*g)),y=Math.floor((h-b)/2),w=Math.floor((p-_)/2),C=new Uint8Array(h*p);for(let $=0;$<_;$++){let R=l+Math.floor($*f/_),M=Math.max(R+1,l+Math.floor(($+1)*f/_));for(let E=0;E<b;E++){let P=s+Math.floor(E*m/b),I=Math.max(P+1,s+Math.floor((E+1)*m/b)),L=0;for(let k=R;k<M;k++)for(let F=P;F<I;F++)L+=a[k*n+F];C[($+w)*h+E+y]=L*2>=(M-R)*(I-P)?1:0;}}let S=C.reduce(($,R)=>$+R,0);if(Pd(C,h,p,Math.max(4,S*Ad)),!C.includes(1))throw new Error("The shape is too small to trace; use a bigger picture");return {type:"silhouette",width:h,height:p,cells:Array.from(C,$=>$?"1":"0").join("")}}var Sl=512;async function Ib(e){if(typeof e!="string"&&!(e instanceof Blob))return e.complete||await new Promise(n=>{e.addEventListener("load",n,{once:true}),e.addEventListener("error",n,{once:true});}),e;let t=typeof e=="string"?e:URL.createObjectURL(e);try{return await new Promise((n,o)=>{let r=new Image;r.crossOrigin="anonymous",r.onload=()=>n(r),r.onerror=()=>o(new Error("Could not load the picture")),r.src=t;})}finally{typeof e!="string"&&setTimeout(()=>URL.revokeObjectURL(t),1e3);}}async function Lb(e,t={}){if(typeof document>"u")throw new Error("loadQRSilhouette needs a browser; pass decoded pixels to createQRSilhouette instead");let n=await Ib(e),o=n.naturalWidth||n.width||Sl,r=n.naturalHeight||n.height||Sl,a=Sl/Math.max(o,r),i=Math.max(1,Math.round(o*a)),s=Math.max(1,Math.round(r*a)),l=document.createElement("canvas");l.width=i,l.height=s;let c=l.getContext("2d",{willReadFrequently:true});if(!c)throw new Error("Could not get a canvas context");c.drawImage(n,0,0,i,s);let u;try{u=c.getImageData(0,0,i,s);}catch{throw new Error("Could not read the picture (cross-origin images need CORS); upload it instead")}finally{l.remove();}return vd(u,t)}function wl(e){return $n(Xn,()=>Tr(e))}var Nb=react.memo(e=>{let t=react.useMemo(()=>ma(e),dl.map(n=>e[n]));return react.createElement(wl,da(e,t))});Nb.displayName="QRCode";function Ob({frame:e,size:t,bgColor:n,slot:o,...r}){let a=o;return $n(Xn,()=>Ii({frame:e,size:t,bgColor:n,slot:a,svgProps:r}))}/**
|
|
27
27
|
* @license QR Code generator library (TypeScript)
|
|
28
28
|
* Copyright (c) Project Nayuki.
|
|
29
29
|
* SPDX-License-Identifier: MIT
|
|
30
|
-
*/Object.defineProperty(exports,"angularGradientSchema",{enumerable:true,get:function(){return schemas_js.angularGradientSchema}});Object.defineProperty(exports,"anyFrameSchema",{enumerable:true,get:function(){return schemas_js.anyFrameSchema}});Object.defineProperty(exports,"baseTemplatePropsSchema",{enumerable:true,get:function(){return schemas_js.baseTemplatePropsSchema}});Object.defineProperty(exports,"bodyPatternSchema",{enumerable:true,get:function(){return schemas_js.bodyPatternSchema}});Object.defineProperty(exports,"colorConfigSchema",{enumerable:true,get:function(){return schemas_js.colorConfigSchema}});Object.defineProperty(exports,"colorTypeSchema",{enumerable:true,get:function(){return schemas_js.colorTypeSchema}});Object.defineProperty(exports,"cornerEyeDotPatternSchema",{enumerable:true,get:function(){return schemas_js.cornerEyeDotPatternSchema}});Object.defineProperty(exports,"cornerEyePatternSchema",{enumerable:true,get:function(){return schemas_js.cornerEyePatternSchema}});Object.defineProperty(exports,"customFrameSchema",{enumerable:true,get:function(){return schemas_js.customFrameSchema}});Object.defineProperty(exports,"errorLevelSchema",{enumerable:true,get:function(){return schemas_js.errorLevelSchema}});Object.defineProperty(exports,"excavationSchema",{enumerable:true,get:function(){return schemas_js.excavationSchema}});Object.defineProperty(exports,"eyeColorOverrideSchema",{enumerable:true,get:function(){return schemas_js.eyeColorOverrideSchema}});Object.defineProperty(exports,"eyeColorsSchema",{enumerable:true,get:function(){return schemas_js.eyeColorsSchema}});Object.defineProperty(exports,"eyeGradientSpanSchema",{enumerable:true,get:function(){return schemas_js.eyeGradientSpanSchema}});Object.defineProperty(exports,"eyeShapeOverrideSchema",{enumerable:true,get:function(){return schemas_js.eyeShapeOverrideSchema}});Object.defineProperty(exports,"eyeShapesSchema",{enumerable:true,get:function(){return schemas_js.eyeShapesSchema}});Object.defineProperty(exports,"frameSchema",{enumerable:true,get:function(){return schemas_js.frameSchema}});Object.defineProperty(exports,"frameSpecColorSchema",{enumerable:true,get:function(){return schemas_js.frameSpecColorSchema}});Object.defineProperty(exports,"frameSpecLabelSchema",{enumerable:true,get:function(){return schemas_js.frameSpecLabelSchema}});Object.defineProperty(exports,"frameSpecPaintSchema",{enumerable:true,get:function(){return schemas_js.frameSpecPaintSchema}});Object.defineProperty(exports,"frameSpecSchema",{enumerable:true,get:function(){return schemas_js.frameSpecSchema}});Object.defineProperty(exports,"frameSpecShapeSchema",{enumerable:true,get:function(){return schemas_js.frameSpecShapeSchema}});Object.defineProperty(exports,"frameStyleSchema",{enumerable:true,get:function(){return schemas_js.frameStyleSchema}});Object.defineProperty(exports,"getFrameSpecIssues",{enumerable:true,get:function(){return schemas_js.getFrameSpecIssues}});Object.defineProperty(exports,"gradientStopSchema",{enumerable:true,get:function(){return schemas_js.gradientStopSchema}});Object.defineProperty(exports,"haloSchema",{enumerable:true,get:function(){return schemas_js.haloSchema}});Object.defineProperty(exports,"imageFitSchema",{enumerable:true,get:function(){return schemas_js.imageFitSchema}});Object.defineProperty(exports,"imagePaintSchema",{enumerable:true,get:function(){return schemas_js.imagePaintSchema}});Object.defineProperty(exports,"imagePositionSchema",{enumerable:true,get:function(){return schemas_js.imagePositionSchema}});Object.defineProperty(exports,"imageSettingsSchema",{enumerable:true,get:function(){return schemas_js.imageSettingsSchema}});Object.defineProperty(exports,"linearGradientSchema",{enumerable:true,get:function(){return schemas_js.linearGradientSchema}});Object.defineProperty(exports,"logoOptionsSchema",{enumerable:true,get:function(){return schemas_js.logoOptionsSchema}});Object.defineProperty(exports,"logoShapeSchema",{enumerable:true,get:function(){return schemas_js.logoShapeSchema}});Object.defineProperty(exports,"pickableCornerEyeDotPatternSchema",{enumerable:true,get:function(){return schemas_js.pickableCornerEyeDotPatternSchema}});Object.defineProperty(exports,"pickableCornerEyePatternSchema",{enumerable:true,get:function(){return schemas_js.pickableCornerEyePatternSchema}});Object.defineProperty(exports,"qrArtImageSchema",{enumerable:true,get:function(){return schemas_js.qrArtImageSchema}});Object.defineProperty(exports,"qrArtModeSchema",{enumerable:true,get:function(){return schemas_js.qrArtModeSchema}});Object.defineProperty(exports,"qrArtSchema",{enumerable:true,get:function(){return schemas_js.qrArtSchema}});Object.defineProperty(exports,"qrArtVariantSchema",{enumerable:true,get:function(){return schemas_js.qrArtVariantSchema}});Object.defineProperty(exports,"qrCodeShapeSchema",{enumerable:true,get:function(){return schemas_js.qrCodeShapeSchema}});Object.defineProperty(exports,"qrPropsSchema",{enumerable:true,get:function(){return schemas_js.qrPropsSchema}});Object.defineProperty(exports,"qrShapeSchema",{enumerable:true,get:function(){return schemas_js.qrShapeSchema}});Object.defineProperty(exports,"qrSilhouetteSchema",{enumerable:true,get:function(){return schemas_js.qrSilhouetteSchema}});Object.defineProperty(exports,"radialGradientSchema",{enumerable:true,get:function(){return schemas_js.radialGradientSchema}});Object.defineProperty(exports,"shadowSchema",{enumerable:true,get:function(){return schemas_js.shadowSchema}});Object.defineProperty(exports,"solidColorSchema",{enumerable:true,get:function(){return schemas_js.solidColorSchema}});Object.defineProperty(exports,"templateConfigSchema",{enumerable:true,get:function(){return schemas_js.templateConfigSchema}});Object.defineProperty(exports,"templateDefinitionBaseSchema",{enumerable:true,get:function(){return schemas_js.templateDefinitionBaseSchema}});Object.defineProperty(exports,"OFFICIAL_FRAME_INDEX",{enumerable:true,get:function(){return framesIndex_js.OFFICIAL_FRAME_INDEX}});Object.defineProperty(exports,"OFFICIAL_FRAMES",{enumerable:true,get:function(){return framesOfficial_js.OFFICIAL_FRAMES}});Object.defineProperty(exports,"getOfficialFrame",{enumerable:true,get:function(){return framesOfficial_js.getOfficialFrame}});Object.defineProperty(exports,"QRCodeCanvas",{enumerable:true,get:function(){return qrCodeCanvas_js.QRCodeCanvas}});exports.AUTO_LEVEL_LOGO_COVERAGE=Da;exports.Arrow=Xu;exports.BG_RADIUS_MAX=Yr;exports.BG_RADIUS_QUIET_RATIO=Qa;exports.BMP_MAX_DIMENSION=eg;exports.BODY_PATTERN=kd;exports.BUILT_IN_FRAMES=Ci;exports.BUILT_IN_FRAME_SPECS=s1;exports.CORNER_EYE_DOT_PATTERNS=Id;exports.CORNER_EYE_PATTERNS=Ld;exports.CUSTOM_FRAME_STYLE=lr;exports.DEFAULT_ART_INTENSITY=nu;exports.DEFAULT_FRAME_TEXT=ka;exports.DEFAULT_MARGIN=pt;exports.DEFAULT_SIZE=it;exports.DOWNLOAD_FORMATS=Ys;exports.DotRing=g0;exports.EPS_IMAGE_FILL_REASON=Fm;exports.EYE_GRADIENT_SPANS=Gd;exports.EYE_POSITIONS=Qe;exports.FRAME_COLOR_TOKENS=oi;exports.FRAME_FONT_FAMILY=go;exports.FRAME_FONT_SCALE_MAX=Cn;exports.FRAME_FONT_SCALE_MIN=or;exports.FRAME_GAP_RATIO=Pc;exports.FRAME_ICONS=ri;exports.FRAME_ICON_BOX=bi;exports.FRAME_ICON_MAX_SEGMENTS=Hl;exports.FRAME_IMPORT_LIMITS=Dt;exports.FRAME_LABEL_ATTRIBUTE=Ic;exports.FRAME_SPEC_KIND=ir;exports.FRAME_SPEC_LABEL_MAX_FONT=cr;exports.FRAME_SPEC_LIMITS=ot;exports.FRAME_SPEC_VERSION=sr;exports.FRAME_STYLES=Fd;exports.FRAME_TEXT_MAX_LENGTH=se;exports.Fragment=Gt;exports.FrameSpecError=br;exports.GIFScanError=Qo;exports.GIF_ALPHA_THRESHOLD=ag;exports.GIF_MAX_COLORS=rg;exports.GIF_MAX_DIMENSION=og;exports.GIF_MIME=Tr;exports.GRADIENT_FRAME_DEFAULTS=l1;exports.HALO_COLOR_DEFAULT=Zr;exports.HALO_LIGHT_MIN=Ue;exports.HALO_WIDTH_DEFAULT=za;exports.HALO_WIDTH_MAX=Ha;exports.HALO_WIDTH_MIN=Ua;exports.Halloween=_0;exports.ICO_MAX_DIMENSION=on;exports.ICO_MIME=an;exports.ICO_SIZES=Ho;exports.LOGO_CLEANUP_MAX_SIDE=td;exports.LOGO_EC_SAFETY=G0;exports.LOGO_PADDING_MAX=Dd;exports.LOGO_PLATE_INSET=_o;exports.LOGO_ROUNDED_RADIUS=bo;exports.LOGO_SHAPES=Nd;exports.LOGO_SIZE_DEFAULT=Na;exports.LOGO_SIZE_MAX=Fa;exports.LOGO_SIZE_MIN=Od;exports.MODULE_SCALE_FLOOR=Eu;exports.MODULE_SCALE_MAX=Oa;exports.MODULE_SCALE_MIN=Xr;exports.OFFICIAL_FRAME_COLLECTIONS=U2;exports.OFFICIAL_FRAME_COUNT=G2;exports.OFFICIAL_FRAME_COUNTS=Q2;exports.PIXEL_SCAN_SIZES=bb;exports.PIXEL_SCORE_MIN_CODE_WIDTH=J6;exports.PRESET_SIZES=r6;exports.QRCode=Mb;exports.QRCodeSVG=_l;exports.QRFrameSVG=Ab;exports.QR_ART_MAX_SAMPLE_SIZE=nr;exports.QR_ART_MIN_LUMA_GAP=So;exports.QR_ART_MODES=jr;exports.QR_ART_SAMPLE_SIZES=Fi;exports.QR_ART_VARIANTS=Ta;exports.QR_CIRCLE_QUIET_MIN=Ba;exports.QR_EYE_ATTRIBUTE=Vu;exports.QR_PARTS=bp;exports.QR_PART_ATTRIBUTE=is;exports.QR_SHAPES=Bd;exports.QR_SILHOUETTE_MAX_CELLS=Ge;exports.QR_SILHOUETTE_MIN_CELLS=ye;exports.QR_SILHOUETTE_MIN_SHARE=Ga;exports.RETIRED_CORNER_EYE_DOT_PATTERNS=vd;exports.RETIRED_CORNER_EYE_PATTERNS=Td;exports.SCAN_CONTRAST_FAIL=ad;exports.SCAN_CONTRAST_LOW=rb;exports.SCAN_CONTRAST_MIN=Ur;exports.SCAN_IMAGE_CONTRAST_MIN=id;exports.SCAN_TEST_SIZES=cd;exports.SHADOW_COLOR_DEFAULT=Xa;exports.SHADOW_OFFSET_DEFAULT=Wa;exports.SHADOW_OFFSET_MAX=Kr;exports.SHADOW_OPACITY_DEFAULT=ja;exports.SHADOW_OPACITY_MAX=Va;exports.SHADOW_OPACITY_MIN=qa;exports.SHARP_DOT_EYE_SAFE_BODIES=Nu;exports.SUPPORTS_PATH2D=I3;exports.SquareBorder=x0;exports.StandardBox=S0;exports.StrikedBox=C0;exports.TEMPLATES=vr;exports.WEAK_BODY_EYES=Lu;exports.WEAK_DOTS=ku;exports.WEAK_DOT_EYES=vu;exports.WEAK_EYES=Tu;exports.WEAK_SHARP_DOT_EYES=Fu;exports.WEBP_MAX_DIMENSION=Fg;exports.WITHDRAWN_BODY_PATTERNS=rr;exports.WITHDRAWN_CORNER_EYE_DOT_PATTERNS=Be;exports.WITHDRAWN_CORNER_EYE_PATTERNS=De;exports.assertGIFStillScans=cg;exports.blobToDataUrl=Ot;exports.canvasToBMP=Do;exports.canvasToGIF=Uo;exports.canvasToICO=rm;exports.canvasToPNGBytes=hg;exports.canvasToWebP=qo;exports.canvasesToICO=vs;exports.circleQuietZone=Ze;exports.clampBgRadius=Hn;exports.clampModuleScale=Co;exports.colorAlpha=Ao;exports.convertImageSettingsToPixels=qp;exports.copyQRCodeToClipboard=i6;exports.createFrameTree=Ei;exports.createQRArtImage=ru;exports.createQRCodeTree=Lr;exports.createQRSilhouette=$d;exports.damagedCodewords=$r;exports.decodePNGPixels=Vs;exports.defaultTemplate=Yu;exports.downloadFile=Bt;exports.downloadImageData=p4;exports.downloadImageWithBoundingBox=g4;exports.downloadPrintEPS=g2;exports.downloadPrintPDF=Lx;exports.downloadPrintSVG=Tx;exports.downloadQRCode=o6;exports.encodeBMP=Ss;exports.encodeGIF=Y0;exports.encodeGIFFromRGBA=Rs;exports.encodeICO=Ps;exports.encodeWebPLossless=Ds;exports.epsToDataUrl=ia;exports.excavateModules=gs;exports.eyeShapeOf=re;exports.fitHaloColor=pp;exports.frameLabels=Tc;exports.frameSpecHash=H2;exports.frameSpecOf=ho;exports.frameSpecPadding=In;exports.frameSpecQrZone=no;exports.generatePath=N0;exports.getAllTemplates=n3;exports.getBgRadiusLimit=lp;exports.getBuiltInFrame=Ri;exports.getCodewordMap=xr;exports.getColorString=N1;exports.getContrastLevel=T3;exports.getContrastRatio=L3;exports.getCustomFrameLayout=Si;exports.getDownloadFilename=b2;exports.getEyeStyleRisk=es;exports.getFrameColors=c1;exports.getFrameDimensions=me;exports.getFrameGapRatio=Mi;exports.getFrameIconPath=_i;exports.getFrameLayout=Xe;exports.getFrameSecondaryText=d1;exports.getFrameSpecColors=mo;exports.getFrameSpecGapRatio=$i;exports.getFrameText=m1;exports.getHaloRisk=os;exports.getImageScanScore=e8;exports.getImageSettings=Ae;exports.getImageTones=nb;exports.getImageTonesFromPixels=eb;exports.getLayoutMargin=Et;exports.getLogoBlockDamage=Oo;exports.getLogoSizeLimit=W2;exports.getLuminance=jn;exports.getNormalizedColor=O1;exports.getPrintLayout=oa;exports.getQRArtColorIssue=fh;exports.getQRArtEyeColors=zi;exports.getQRArtVariant=wo;exports.getQRAsBMP=Bm;exports.getQRAsCanvas=ge;exports.getQRAsEPS=aa;exports.getQRAsGIF=Gm;exports.getQRAsICO=Qm;exports.getQRAsPrintPDF=r2;exports.getQRAsPrintPDFBuffer=vx;exports.getQRAsPrintSVG=o2;exports.getQRAsSVG=r4;exports.getQRAsSVGDataUri=Xt;exports.getQRAsSVGNode=Xp;exports.getQRAsWebP=Dm;exports.getQRCodeData=la;exports.getQRCodeDataUrl=a6;exports.getQRCodeSVGProps=ca;exports.getQRData=il;exports.getQRFunctionModules=eh;exports.getQRModuleCount=e2;exports.getQRShapePath=F1;exports.getQRSilhouetteFit=L1;exports.getSVGString=s6;exports.getScanContrast=ob;exports.getScanScore=K6;exports.getScanScoreFromPixels=t8;exports.getSolidColor=_t;exports.getStylePairRisk=ji;exports.getTemplate=Lo;exports.getTemplateIds=r3;exports.getWebPCompression=Bs;exports.h=qr;exports.haloTints=gp;exports.handleImageLoad=W0;exports.hasImageFill=Nm;exports.hexToRgb=v3;exports.imagePositionCss=Vc;exports.importFrameSvg=B2;exports.indexedToRGBA=Ms;exports.isBMPFile=ws;exports.isFrameActive=Nt;exports.isGIFFile=Es;exports.isGradient=Ke;exports.isICOFile=Is;exports.isImagePaint=vi;exports.isLatin1Text=tf;exports.isQRArtActive=Oi;exports.isQRNode=Oe;exports.isSeeThroughBackground=Hu;exports.isShapedCode=wr;exports.isWeakSharpPair=Ou;exports.isWebPFile=gm;exports.loadQRArtImage=K1;exports.loadQRSilhouette=wb;exports.logoFitsBudget=jp;exports.mixFrameColors=gr;exports.normalizeColorConfig=Tt;exports.partMarker=ss;exports.pixelsToGIF=ug;exports.quantizeRGBA=j0;exports.removeLogoBackdrop=ed;exports.removeLogoBackground=q2;exports.renderQRArt=Qi;exports.renderToDOM=Ts;exports.renderToString=sn;exports.resolveErrorLevel=At;exports.resolveFrameSpec=je;exports.resolveHalo=Mr;exports.resolveQRCodeProps=X2;exports.resolveShadow=as;exports.rgbToCmyk=we;exports.sanitizeFrameText=Pn;exports.scanQRPixels=n8;exports.svgToEPS=km;exports.toHyperscript=nd;exports.toSVGElement=kg;exports.toSVGString=ks;exports.validateSize=Zs;exports.weakestEyePattern=ts;exports.withQRSize=Ie;exports.withdrawnFallback=Qt;//# sourceMappingURL=index.js.map
|
|
30
|
+
*/Object.defineProperty(exports,"angularGradientSchema",{enumerable:true,get:function(){return schemas_js.angularGradientSchema}});Object.defineProperty(exports,"anyFrameSchema",{enumerable:true,get:function(){return schemas_js.anyFrameSchema}});Object.defineProperty(exports,"baseTemplatePropsSchema",{enumerable:true,get:function(){return schemas_js.baseTemplatePropsSchema}});Object.defineProperty(exports,"bodyPatternSchema",{enumerable:true,get:function(){return schemas_js.bodyPatternSchema}});Object.defineProperty(exports,"colorConfigSchema",{enumerable:true,get:function(){return schemas_js.colorConfigSchema}});Object.defineProperty(exports,"colorTypeSchema",{enumerable:true,get:function(){return schemas_js.colorTypeSchema}});Object.defineProperty(exports,"cornerEyeDotPatternSchema",{enumerable:true,get:function(){return schemas_js.cornerEyeDotPatternSchema}});Object.defineProperty(exports,"cornerEyePatternSchema",{enumerable:true,get:function(){return schemas_js.cornerEyePatternSchema}});Object.defineProperty(exports,"customFrameSchema",{enumerable:true,get:function(){return schemas_js.customFrameSchema}});Object.defineProperty(exports,"errorLevelSchema",{enumerable:true,get:function(){return schemas_js.errorLevelSchema}});Object.defineProperty(exports,"excavationSchema",{enumerable:true,get:function(){return schemas_js.excavationSchema}});Object.defineProperty(exports,"eyeColorOverrideSchema",{enumerable:true,get:function(){return schemas_js.eyeColorOverrideSchema}});Object.defineProperty(exports,"eyeColorsSchema",{enumerable:true,get:function(){return schemas_js.eyeColorsSchema}});Object.defineProperty(exports,"eyeGradientSpanSchema",{enumerable:true,get:function(){return schemas_js.eyeGradientSpanSchema}});Object.defineProperty(exports,"eyeShapeOverrideSchema",{enumerable:true,get:function(){return schemas_js.eyeShapeOverrideSchema}});Object.defineProperty(exports,"eyeShapesSchema",{enumerable:true,get:function(){return schemas_js.eyeShapesSchema}});Object.defineProperty(exports,"frameSchema",{enumerable:true,get:function(){return schemas_js.frameSchema}});Object.defineProperty(exports,"frameSpecColorSchema",{enumerable:true,get:function(){return schemas_js.frameSpecColorSchema}});Object.defineProperty(exports,"frameSpecLabelSchema",{enumerable:true,get:function(){return schemas_js.frameSpecLabelSchema}});Object.defineProperty(exports,"frameSpecPaintSchema",{enumerable:true,get:function(){return schemas_js.frameSpecPaintSchema}});Object.defineProperty(exports,"frameSpecSchema",{enumerable:true,get:function(){return schemas_js.frameSpecSchema}});Object.defineProperty(exports,"frameSpecShapeSchema",{enumerable:true,get:function(){return schemas_js.frameSpecShapeSchema}});Object.defineProperty(exports,"frameStyleSchema",{enumerable:true,get:function(){return schemas_js.frameStyleSchema}});Object.defineProperty(exports,"getFrameSpecIssues",{enumerable:true,get:function(){return schemas_js.getFrameSpecIssues}});Object.defineProperty(exports,"gradientStopSchema",{enumerable:true,get:function(){return schemas_js.gradientStopSchema}});Object.defineProperty(exports,"haloSchema",{enumerable:true,get:function(){return schemas_js.haloSchema}});Object.defineProperty(exports,"imageFitSchema",{enumerable:true,get:function(){return schemas_js.imageFitSchema}});Object.defineProperty(exports,"imagePaintSchema",{enumerable:true,get:function(){return schemas_js.imagePaintSchema}});Object.defineProperty(exports,"imagePositionSchema",{enumerable:true,get:function(){return schemas_js.imagePositionSchema}});Object.defineProperty(exports,"imageSettingsSchema",{enumerable:true,get:function(){return schemas_js.imageSettingsSchema}});Object.defineProperty(exports,"linearGradientSchema",{enumerable:true,get:function(){return schemas_js.linearGradientSchema}});Object.defineProperty(exports,"logoOptionsSchema",{enumerable:true,get:function(){return schemas_js.logoOptionsSchema}});Object.defineProperty(exports,"logoShapeSchema",{enumerable:true,get:function(){return schemas_js.logoShapeSchema}});Object.defineProperty(exports,"pickableCornerEyeDotPatternSchema",{enumerable:true,get:function(){return schemas_js.pickableCornerEyeDotPatternSchema}});Object.defineProperty(exports,"pickableCornerEyePatternSchema",{enumerable:true,get:function(){return schemas_js.pickableCornerEyePatternSchema}});Object.defineProperty(exports,"qrArtImageSchema",{enumerable:true,get:function(){return schemas_js.qrArtImageSchema}});Object.defineProperty(exports,"qrArtModeSchema",{enumerable:true,get:function(){return schemas_js.qrArtModeSchema}});Object.defineProperty(exports,"qrArtSchema",{enumerable:true,get:function(){return schemas_js.qrArtSchema}});Object.defineProperty(exports,"qrArtVariantSchema",{enumerable:true,get:function(){return schemas_js.qrArtVariantSchema}});Object.defineProperty(exports,"qrCodeShapeSchema",{enumerable:true,get:function(){return schemas_js.qrCodeShapeSchema}});Object.defineProperty(exports,"qrPropsSchema",{enumerable:true,get:function(){return schemas_js.qrPropsSchema}});Object.defineProperty(exports,"qrShapeSchema",{enumerable:true,get:function(){return schemas_js.qrShapeSchema}});Object.defineProperty(exports,"qrSilhouetteSchema",{enumerable:true,get:function(){return schemas_js.qrSilhouetteSchema}});Object.defineProperty(exports,"radialGradientSchema",{enumerable:true,get:function(){return schemas_js.radialGradientSchema}});Object.defineProperty(exports,"shadowSchema",{enumerable:true,get:function(){return schemas_js.shadowSchema}});Object.defineProperty(exports,"solidColorSchema",{enumerable:true,get:function(){return schemas_js.solidColorSchema}});Object.defineProperty(exports,"templateConfigSchema",{enumerable:true,get:function(){return schemas_js.templateConfigSchema}});Object.defineProperty(exports,"templateDefinitionBaseSchema",{enumerable:true,get:function(){return schemas_js.templateDefinitionBaseSchema}});Object.defineProperty(exports,"OFFICIAL_FRAME_INDEX",{enumerable:true,get:function(){return framesIndex_js.OFFICIAL_FRAME_INDEX}});Object.defineProperty(exports,"OFFICIAL_FRAMES",{enumerable:true,get:function(){return framesOfficial_js.OFFICIAL_FRAMES}});Object.defineProperty(exports,"getOfficialFrame",{enumerable:true,get:function(){return framesOfficial_js.getOfficialFrame}});Object.defineProperty(exports,"QRCodeCanvas",{enumerable:true,get:function(){return qrCodeCanvas_js.QRCodeCanvas}});exports.AUTO_LEVEL_LOGO_COVERAGE=Ua;exports.Arrow=em;exports.BG_RADIUS_MAX=Kr;exports.BG_RADIUS_QUIET_RATIO=Wa;exports.BMP_MAX_DIMENSION=cg;exports.BODY_PATTERN=Hd;exports.BUILT_IN_FRAMES=Ai;exports.BUILT_IN_FRAME_SPECS=g1;exports.CORNER_EYE_DOT_PATTERNS=Bd;exports.CORNER_EYE_PATTERNS=Qd;exports.CUSTOM_FRAME_STYLE=cr;exports.DEFAULT_ART_INTENSITY=su;exports.DEFAULT_FRAME_TEXT=Da;exports.DEFAULT_MARGIN=pe;exports.DEFAULT_SIZE=ce;exports.DOWNLOAD_FORMATS=tl;exports.DotRing=$m;exports.EPS_IMAGE_FILL_REASON=Q0;exports.EYE_GRADIENT_SPANS=Xd;exports.EYE_POSITIONS=Qt;exports.FRAME_COLOR_TOKENS=li;exports.FRAME_FONT_FAMILY=_o;exports.FRAME_FONT_SCALE_MAX=Cn;exports.FRAME_FONT_SCALE_MIN=ar;exports.FRAME_GAP_RATIO=kc;exports.FRAME_ICONS=si;exports.FRAME_ICON_BOX=$i;exports.FRAME_ICON_MAX_SEGMENTS=jl;exports.FRAME_IMPORT_LIMITS=Oe;exports.FRAME_LABEL_ATTRIBUTE=Fc;exports.FRAME_SPEC_KIND=sr;exports.FRAME_SPEC_LABEL_MAX_FONT=ur;exports.FRAME_SPEC_LIMITS=se;exports.FRAME_SPEC_VERSION=lr;exports.FRAME_STYLES=zd;exports.FRAME_TEXT_MAX_LENGTH=it;exports.Fragment=Be;exports.FrameSpecError=_r;exports.GIFScanError=zo;exports.GIF_ALPHA_THRESHOLD=fg;exports.GIF_MAX_COLORS=mg;exports.GIF_MAX_DIMENSION=dg;exports.GIF_MIME=kr;exports.GRADIENT_FRAME_DEFAULTS=b1;exports.HALO_COLOR_DEFAULT=Jr;exports.HALO_LIGHT_MIN=Ut;exports.HALO_WIDTH_DEFAULT=ja;exports.HALO_WIDTH_MAX=Va;exports.HALO_WIDTH_MIN=qa;exports.Halloween=wm;exports.ICO_MAX_DIMENSION=on;exports.ICO_MIME=an;exports.ICO_SIZES=qo;exports.LOGO_CLEANUP_MAX_SIDE=id;exports.LOGO_EC_SAFETY=Wm;exports.LOGO_PADDING_MAX=Vd;exports.LOGO_PLATE_INSET=xo;exports.LOGO_ROUNDED_RADIUS=yo;exports.LOGO_SHAPES=Wd;exports.LOGO_SIZE_DEFAULT=Ga;exports.LOGO_SIZE_MAX=Ba;exports.LOGO_SIZE_MIN=qd;exports.MODULE_SCALE_FLOOR=Lu;exports.MODULE_SCALE_MAX=Qa;exports.MODULE_SCALE_MIN=Zr;exports.OFFICIAL_FRAME_COLLECTIONS=Y2;exports.OFFICIAL_FRAME_COUNT=j2;exports.OFFICIAL_FRAME_COUNTS=X2;exports.PIXEL_SCAN_SIZES=Mb;exports.PIXEL_SCORE_MIN_CODE_WIDTH=d8;exports.PRESET_SIZES=h6;exports.QRCode=Nb;exports.QRCodeSVG=wl;exports.QRFrameSVG=Ob;exports.QR_ART_MAX_SAMPLE_SIZE=rr;exports.QR_ART_MIN_LUMA_GAP=Co;exports.QR_ART_MODES=Yr;exports.QR_ART_SAMPLE_SIZES=Bi;exports.QR_ART_VARIANTS=Oa;exports.QR_CIRCLE_QUIET_MIN=Ha;exports.QR_EYE_ATTRIBUTE=Ku;exports.QR_PARTS=Mp;exports.QR_PART_ATTRIBUTE=us;exports.QR_SHAPES=jd;exports.QR_SILHOUETTE_MAX_CELLS=Gt;exports.QR_SILHOUETTE_MIN_CELLS=_t;exports.QR_SILHOUETTE_MIN_SHARE=za;exports.RETIRED_CORNER_EYE_DOT_PATTERNS=Gd;exports.RETIRED_CORNER_EYE_PATTERNS=Ud;exports.SCAN_CONTRAST_FAIL=dd;exports.SCAN_CONTRAST_LOW=db;exports.SCAN_CONTRAST_MIN=Hr;exports.SCAN_IMAGE_CONTRAST_MIN=fd;exports.SCAN_TEST_SIZES=gd;exports.SHADOW_COLOR_DEFAULT=Ja;exports.SHADOW_OFFSET_DEFAULT=Xa;exports.SHADOW_OFFSET_MAX=eo;exports.SHADOW_OPACITY_DEFAULT=Ka;exports.SHADOW_OPACITY_MAX=Za;exports.SHADOW_OPACITY_MIN=Ya;exports.SHARP_DOT_EYE_SAFE_BODIES=Qu;exports.SUPPORTS_PATH2D=U3;exports.SquareBorder=Rm;exports.StandardBox=Em;exports.StrikedBox=Pm;exports.TEMPLATES=Lr;exports.WEAK_BODY_EYES=Ou;exports.WEAK_DOTS=Bu;exports.WEAK_DOT_EYES=Nu;exports.WEAK_EYES=Du;exports.WEAK_SHARP_DOT_EYES=Gu;exports.WEBP_MAX_DIMENSION=Hg;exports.WITHDRAWN_BODY_PATTERNS=or;exports.WITHDRAWN_CORNER_EYE_DOT_PATTERNS=Bt;exports.WITHDRAWN_CORNER_EYE_PATTERNS=Dt;exports.assertGIFStillScans=bg;exports.blobToDataUrl=Ne;exports.canvasToBMP=Qo;exports.canvasToGIF=Wo;exports.canvasToICO=c0;exports.canvasToPNGBytes=Sg;exports.canvasToWebP=Xo;exports.canvasesToICO=Ns;exports.circleQuietZone=Zt;exports.clampBgRadius=Hn;exports.clampModuleScale=Mo;exports.colorAlpha=vo;exports.convertImageSettingsToPixels=tg;exports.copyQRCodeToClipboard=b6;exports.createFrameTree=Ii;exports.createQRArtImage=lu;exports.createQRCodeTree=Tr;exports.createQRSilhouette=vd;exports.damagedCodewords=Sr;exports.decodePNGPixels=Ks;exports.defaultTemplate=tm;exports.downloadFile=De;exports.downloadImageData=Mx;exports.downloadImageWithBoundingBox=Ex;exports.downloadPrintEPS=C2;exports.downloadPrintPDF=H4;exports.downloadPrintSVG=z4;exports.downloadQRCode=p6;exports.drawScanFrames=u8;exports.encodeBMP=Es;exports.encodeGIF=n0;exports.encodeGIFFromRGBA=vs;exports.encodeICO=ks;exports.encodeWebPLossless=Hs;exports.epsToDataUrl=ca;exports.excavateModules=xs;exports.eyeShapeOf=nt;exports.fitHaloColor=Cp;exports.frameLabels=Dc;exports.frameSpecHash=Z2;exports.frameSpecOf=go;exports.frameSpecPadding=vn;exports.frameSpecQrZone=oo;exports.generatePath=Qm;exports.getAllTemplates=h3;exports.getBgRadiusLimit=bp;exports.getBuiltInFrame=Pi;exports.getCodewordMap=$r;exports.getColorString=W1;exports.getContrastLevel=W3;exports.getContrastRatio=z3;exports.getCustomFrameLayout=Mi;exports.getDownloadFilename=R2;exports.getEyeStyleRisk=as;exports.getFrameColors=_1;exports.getFrameDimensions=ut;exports.getFrameGapRatio=vi;exports.getFrameIconPath=Si;exports.getFrameLayout=Xt;exports.getFrameSecondaryText=$1;exports.getFrameSpecColors=ho;exports.getFrameSpecGapRatio=Ri;exports.getFrameText=x1;exports.getHaloRisk=ls;exports.getImageScanScore=h8;exports.getImageSettings=Et;exports.getImageTones=mb;exports.getImageTonesFromPixels=ub;exports.getLayoutMargin=Me;exports.getLogoBlockDamage=Bo;exports.getLogoSizeLimit=J2;exports.getLuminance=jn;exports.getNormalizedColor=q1;exports.getPrintLayout=sa;exports.getQRArtColorIssue=Sh;exports.getQRArtEyeColors=ji;exports.getQRArtVariant=Ro;exports.getQRAsBMP=W0;exports.getQRAsCanvas=pt;exports.getQRAsEPS=la;exports.getQRAsGIF=q0;exports.getQRAsICO=V0;exports.getQRAsPrintPDF=m2;exports.getQRAsPrintPDFBuffer=U4;exports.getQRAsPrintSVG=d2;exports.getQRAsSVG=hx;exports.getQRAsSVGDataUri=Xe;exports.getQRAsSVGNode=og;exports.getQRAsWebP=z0;exports.getQRCodeData=ma;exports.getQRCodeDataUrl=g6;exports.getQRCodeSVGProps=da;exports.getQRData=ml;exports.getQRFunctionModules=uh;exports.getQRModuleCount=c2;exports.getQRShapePath=z1;exports.getQRSilhouetteFit=Q1;exports.getSVGString=_6;exports.getScanContrast=fb;exports.getScanScore=c8;exports.getScanScoreFromFrames=m8;exports.getScanScoreFromPixels=f8;exports.getSolidColor=ye;exports.getStylePairRisk=Ki;exports.getTemplate=ko;exports.getTemplateIds=p3;exports.getWebPCompression=zs;exports.h=Vr;exports.haloTints=Rp;exports.handleImageLoad=Zm;exports.hasImageFill=U0;exports.hexToRgb=H3;exports.imagePositionCss=Kc;exports.importFrameSvg=V2;exports.indexedToRGBA=Is;exports.isBMPFile=As;exports.isFrameActive=Fe;exports.isGIFFile=Ls;exports.isGradient=Kt;exports.isICOFile=Fs;exports.isImagePaint=Fi;exports.isLatin1Text=uf;exports.isQRArtActive=Qi;exports.isQRNode=Ot;exports.isSeeThroughBackground=ju;exports.isShapedCode=Cr;exports.isWeakSharpPair=Uu;exports.isWebPFile=S0;exports.loadQRArtImage=sh;exports.loadQRSilhouette=Lb;exports.logoFitsBudget=rg;exports.mixFrameColors=br;exports.normalizeColorConfig=Le;exports.partMarker=ms;exports.pixelsToGIF=_g;exports.quantizeRGBA=e0;exports.removeLogoBackdrop=sd;exports.removeLogoBackground=eb;exports.renderQRArt=Wi;exports.renderToDOM=Ds;exports.renderToString=sn;exports.resolveErrorLevel=Ae;exports.resolveFrameSpec=jt;exports.resolveHalo=Er;exports.resolveQRCodeProps=rb;exports.resolveShadow=cs;exports.rgbToCmyk=St;exports.sanitizeFrameText=Pn;exports.scanQRPixels=p8;exports.svgToEPS=G0;exports.toHyperscript=ld;exports.toSVGElement=Ug;exports.toSVGString=Bs;exports.validateSize=nl;exports.weakestEyePattern=os;exports.withQRSize=Pt;exports.withdrawnFallback=Qe;//# sourceMappingURL=index.js.map
|
|
31
31
|
//# sourceMappingURL=index.js.map
|