qrdx 0.0.59 → 0.0.61

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.
Files changed (96) hide show
  1. package/README.md +4 -4
  2. package/dist/core.js +7 -7
  3. package/dist/core.js.map +1 -1
  4. package/dist/core.mjs +7 -7
  5. package/dist/core.mjs.map +1 -1
  6. package/dist/element.browser.mjs +6 -6
  7. package/dist/element.browser.mjs.map +1 -1
  8. package/dist/index.js +7 -7
  9. package/dist/index.js.map +1 -1
  10. package/dist/index.mjs +7 -7
  11. package/dist/index.mjs.map +1 -1
  12. package/dist/node.js +2 -2
  13. package/dist/node.js.map +1 -1
  14. package/dist/node.mjs +2 -2
  15. package/dist/node.mjs.map +1 -1
  16. package/dist/qr-code-canvas.js +1 -1
  17. package/dist/qr-code-canvas.js.map +1 -1
  18. package/dist/qr-code-canvas.mjs +1 -1
  19. package/dist/qr-code-canvas.mjs.map +1 -1
  20. package/dist/schemas.js +1 -1
  21. package/dist/schemas.js.map +1 -1
  22. package/dist/schemas.mjs +1 -1
  23. package/dist/schemas.mjs.map +1 -1
  24. package/dist/src/api.d.ts +2 -3
  25. package/dist/src/api.d.ts.map +1 -1
  26. package/dist/src/corner-dot.d.ts.map +1 -1
  27. package/dist/src/corner-eye.d.ts.map +1 -1
  28. package/dist/src/engine.d.ts +1 -1
  29. package/dist/src/engine.d.ts.map +1 -1
  30. package/dist/src/looks.d.ts +45 -17
  31. package/dist/src/looks.d.ts.map +1 -1
  32. package/dist/src/qr-code-canvas.d.ts +2 -8
  33. package/dist/src/qr-code-canvas.d.ts.map +1 -1
  34. package/dist/src/qr-code-svg.d.ts +2 -3
  35. package/dist/src/qr-code-svg.d.ts.map +1 -1
  36. package/dist/src/qr-code.d.ts +2 -2
  37. package/dist/src/qr-code.d.ts.map +1 -1
  38. package/dist/src/qr-frame-svg.d.ts +2 -3
  39. package/dist/src/qr-frame-svg.d.ts.map +1 -1
  40. package/dist/src/rasterize.d.ts +8 -0
  41. package/dist/src/rasterize.d.ts.map +1 -1
  42. package/dist/src/react-elements.d.ts.map +1 -1
  43. package/dist/src/scan-risk.d.ts.map +1 -1
  44. package/dist/src/scan-score.d.ts +34 -0
  45. package/dist/src/scan-score.d.ts.map +1 -1
  46. package/dist/src/shapes.d.ts +19 -0
  47. package/dist/src/shapes.d.ts.map +1 -1
  48. package/dist/src/utils/oklab.d.ts +16 -0
  49. package/dist/src/utils/oklab.d.ts.map +1 -0
  50. package/dist/src/utils.d.ts.map +1 -1
  51. package/dist/types/constants.d.ts +40 -5
  52. package/dist/types/constants.d.ts.map +1 -1
  53. package/dist/types/corner-dot.d.ts +11 -6
  54. package/dist/types/corner-dot.d.ts.map +1 -1
  55. package/dist/types/corner-eye.d.ts +21 -8
  56. package/dist/types/corner-eye.d.ts.map +1 -1
  57. package/dist/types/frame-spec.d.ts +1 -1
  58. package/dist/types/frame.d.ts +2 -2
  59. package/dist/types/image-pattern.d.ts +3 -3
  60. package/dist/types/image-pattern.d.ts.map +1 -1
  61. package/dist/types/index.js +2 -2
  62. package/dist/types/index.js.map +1 -1
  63. package/dist/types/index.mjs +2 -2
  64. package/dist/types/index.mjs.map +1 -1
  65. package/dist/types/plain.d.ts +1 -1
  66. package/dist/types/plain.d.ts.map +1 -1
  67. package/dist/types/qr.d.ts +96 -46
  68. package/dist/types/qr.d.ts.map +1 -1
  69. package/dist/types/react.d.ts +21 -3
  70. package/dist/types/react.d.ts.map +1 -1
  71. package/dist/vanilla.browser.mjs +29 -29
  72. package/dist/vanilla.browser.mjs.map +1 -1
  73. package/package.json +4 -6
  74. package/src/api.tsx +3 -4
  75. package/src/corner-dot.tsx +15 -0
  76. package/src/corner-eye.ts +163 -72
  77. package/src/engine.ts +4 -0
  78. package/src/looks.ts +272 -69
  79. package/src/qr-code-canvas.tsx +34 -27
  80. package/src/qr-code-svg.tsx +3 -4
  81. package/src/qr-code.tsx +7 -5
  82. package/src/qr-frame-svg.tsx +3 -4
  83. package/src/rasterize.ts +14 -1
  84. package/src/react-elements.ts +40 -2
  85. package/src/scan-risk.ts +19 -3
  86. package/src/scan-score.ts +231 -48
  87. package/src/shapes.ts +123 -0
  88. package/src/utils/oklab.ts +93 -0
  89. package/src/utils.tsx +20 -4
  90. package/types/constants.ts +59 -3
  91. package/types/corner-dot.ts +17 -7
  92. package/types/corner-eye.ts +26 -8
  93. package/types/image-pattern.ts +11 -4
  94. package/types/plain.ts +4 -0
  95. package/types/qr.ts +5 -3
  96. package/types/react.ts +22 -3
@@ -1,6 +1,6 @@
1
- import {z}from'zod';var X;(h=>{class e{constructor(o,r,t,a){this.version=o;this.errorCorrectionLevel=r;if(o<e.MIN_VERSION||o>e.MAX_VERSION)throw new RangeError("Version value out of range");if(a<-1||a>7)throw new RangeError("Mask value out of range");this.size=o*4+17;let s=[];for(let u=0;u<this.size;u++)s.push(false);for(let u=0;u<this.size;u++)this.modules.push(s.slice()),this.isFunction.push(s.slice());this.drawFunctionPatterns();let d=this.addEccAndInterleave(t);if(this.drawCodewords(d),a==-1){let u=1e9;for(let S=0;S<8;S++){this.applyMask(S),this.drawFormatBits(S);let E=this.getPenaltyScore();E<u&&(a=S,u=E),this.applyMask(S);}}l(0<=a&&a<=7),this.mask=a,this.applyMask(a),this.drawFormatBits(a),this.isFunction=[];}version;errorCorrectionLevel;static encodeText(o,r){let t=h.QrSegment.makeSegments(o);return e.encodeSegments(t,r)}static encodeBinary(o,r){let t=h.QrSegment.makeBytes(o);return e.encodeSegments([t],r)}static encodeSegments(o,r,t=1,a=40,s=-1,d=true){if(!(e.MIN_VERSION<=t&&t<=a&&a<=e.MAX_VERSION)||s<-1||s>7)throw new RangeError("Invalid value");let u,S;for(u=t;;u++){let b=e.getNumDataCodewords(u,r)*8,A=c.getTotalBits(o,u);if(A<=b){S=A;break}if(u>=a)throw new RangeError("Data too long")}for(let b of [e.Ecc.MEDIUM,e.Ecc.QUARTILE,e.Ecc.HIGH])d&&S<=e.getNumDataCodewords(u,b)*8&&(r=b);let E=[];for(let b of o){n(b.mode.modeBits,4,E),n(b.numChars,b.mode.numCharCountBits(u),E);for(let A of b.getData())E.push(A);}l(E.length==S);let _=e.getNumDataCodewords(u,r)*8;l(E.length<=_),n(0,Math.min(4,_-E.length),E),n(0,(8-E.length%8)%8,E),l(E.length%8==0);for(let b=236;E.length<_;b^=253)n(b,8,E);let m=[];for(;m.length*8<E.length;)m.push(0);return E.forEach((b,A)=>m[A>>>3]|=b<<7-(A&7)),new e(u,r,m,s)}size;mask;modules=[];isFunction=[];getModule(o,r){return 0<=o&&o<this.size&&0<=r&&r<this.size&&this.modules[r][o]}getModules(){return this.modules}drawFunctionPatterns(){for(let t=0;t<this.size;t++)this.setFunctionModule(6,t,t%2==0),this.setFunctionModule(t,6,t%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);let o=this.getAlignmentPatternPositions(),r=o.length;for(let t=0;t<r;t++)for(let a=0;a<r;a++)t==0&&a==0||t==0&&a==r-1||t==r-1&&a==0||this.drawAlignmentPattern(o[t],o[a]);this.drawFormatBits(0),this.drawVersion();}drawFormatBits(o){let r=this.errorCorrectionLevel.formatBits<<3|o,t=r;for(let s=0;s<10;s++)t=t<<1^(t>>>9)*1335;let a=(r<<10|t)^21522;l(a>>>15==0);for(let s=0;s<=5;s++)this.setFunctionModule(8,s,i(a,s));this.setFunctionModule(8,7,i(a,6)),this.setFunctionModule(8,8,i(a,7)),this.setFunctionModule(7,8,i(a,8));for(let s=9;s<15;s++)this.setFunctionModule(14-s,8,i(a,s));for(let s=0;s<8;s++)this.setFunctionModule(this.size-1-s,8,i(a,s));for(let s=8;s<15;s++)this.setFunctionModule(8,this.size-15+s,i(a,s));this.setFunctionModule(8,this.size-8,true);}drawVersion(){if(this.version<7)return;let o=this.version;for(let t=0;t<12;t++)o=o<<1^(o>>>11)*7973;let r=this.version<<12|o;l(r>>>18==0);for(let t=0;t<18;t++){let a=i(r,t),s=this.size-11+t%3,d=Math.floor(t/3);this.setFunctionModule(s,d,a),this.setFunctionModule(d,s,a);}}drawFinderPattern(o,r){for(let t=-4;t<=4;t++)for(let a=-4;a<=4;a++){let s=Math.max(Math.abs(a),Math.abs(t)),d=o+a,u=r+t;0<=d&&d<this.size&&0<=u&&u<this.size&&this.setFunctionModule(d,u,s!=2&&s!=4);}}drawAlignmentPattern(o,r){for(let t=-2;t<=2;t++)for(let a=-2;a<=2;a++)this.setFunctionModule(o+a,r+t,Math.max(Math.abs(a),Math.abs(t))!=1);}setFunctionModule(o,r,t){this.modules[r][o]=t,this.isFunction[r][o]=true;}addEccAndInterleave(o){let r=this.version,t=this.errorCorrectionLevel;if(o.length!=e.getNumDataCodewords(r,t))throw new RangeError("Invalid argument");let a=e.NUM_ERROR_CORRECTION_BLOCKS[t.ordinal][r],s=e.ECC_CODEWORDS_PER_BLOCK[t.ordinal][r],d=Math.floor(e.getNumRawDataModules(r)/8),u=a-d%a,S=Math.floor(d/a),E=[],_=e.reedSolomonComputeDivisor(s);for(let b=0,A=0;b<a;b++){let O=o.slice(A,A+S-s+(b<u?0:1));A+=O.length;let M=e.reedSolomonComputeRemainder(O,_);b<u&&O.push(0),E.push(O.concat(M));}let m=[];for(let b=0;b<E[0].length;b++)E.forEach((A,O)=>{(b!=S-s||O>=u)&&m.push(A[b]);});return l(m.length==d),m}drawCodewords(o){if(o.length!=Math.floor(e.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let r=0;for(let t=this.size-1;t>=1;t-=2){t==6&&(t=5);for(let a=0;a<this.size;a++)for(let s=0;s<2;s++){let d=t-s,S=(t+1&2)==0?this.size-1-a:a;!this.isFunction[S][d]&&r<o.length*8&&(this.modules[S][d]=i(o[r>>>3],7-(r&7)),r++);}}l(r==o.length*8);}applyMask(o){if(o<0||o>7)throw new RangeError("Mask value out of range");for(let r=0;r<this.size;r++)for(let t=0;t<this.size;t++){let a;switch(o){case 0:a=(t+r)%2==0;break;case 1:a=r%2==0;break;case 2:a=t%3==0;break;case 3:a=(t+r)%3==0;break;case 4:a=(Math.floor(t/3)+Math.floor(r/2))%2==0;break;case 5:a=t*r%2+t*r%3==0;break;case 6:a=(t*r%2+t*r%3)%2==0;break;case 7:a=((t+r)%2+t*r%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[r][t]&&a&&(this.modules[r][t]=!this.modules[r][t]);}}getPenaltyScore(){let o=0;for(let s=0;s<this.size;s++){let d=false,u=0,S=[0,0,0,0,0,0,0];for(let E=0;E<this.size;E++)this.modules[s][E]==d?(u++,u==5?o+=e.PENALTY_N1:u>5&&o++):(this.finderPenaltyAddHistory(u,S),d||(o+=this.finderPenaltyCountPatterns(S)*e.PENALTY_N3),d=this.modules[s][E],u=1);o+=this.finderPenaltyTerminateAndCount(d,u,S)*e.PENALTY_N3;}for(let s=0;s<this.size;s++){let d=false,u=0,S=[0,0,0,0,0,0,0];for(let E=0;E<this.size;E++)this.modules[E][s]==d?(u++,u==5?o+=e.PENALTY_N1:u>5&&o++):(this.finderPenaltyAddHistory(u,S),d||(o+=this.finderPenaltyCountPatterns(S)*e.PENALTY_N3),d=this.modules[E][s],u=1);o+=this.finderPenaltyTerminateAndCount(d,u,S)*e.PENALTY_N3;}for(let s=0;s<this.size-1;s++)for(let d=0;d<this.size-1;d++){let u=this.modules[s][d];u==this.modules[s][d+1]&&u==this.modules[s+1][d]&&u==this.modules[s+1][d+1]&&(o+=e.PENALTY_N2);}let r=0;for(let s of this.modules)r=s.reduce((d,u)=>d+(u?1:0),r);let t=this.size*this.size,a=Math.ceil(Math.abs(r*20-t*10)/t)-1;return l(0<=a&&a<=9),o+=a*e.PENALTY_N4,l(0<=o&&o<=2568888),o}getAlignmentPatternPositions(){if(this.version==1)return [];{let o=Math.floor(this.version/7)+2,r=this.version==32?26:Math.ceil((this.version*4+4)/(o*2-2))*2,t=[6];for(let a=this.size-7;t.length<o;a-=r)t.splice(1,0,a);return t}}static getNumRawDataModules(o){if(o<e.MIN_VERSION||o>e.MAX_VERSION)throw new RangeError("Version number out of range");let r=(16*o+128)*o+64;if(o>=2){let t=Math.floor(o/7)+2;r-=(25*t-10)*t-55,o>=7&&(r-=36);}return l(208<=r&&r<=29648),r}static getNumDataCodewords(o,r){return Math.floor(e.getNumRawDataModules(o)/8)-e.ECC_CODEWORDS_PER_BLOCK[r.ordinal][o]*e.NUM_ERROR_CORRECTION_BLOCKS[r.ordinal][o]}static reedSolomonComputeDivisor(o){if(o<1||o>255)throw new RangeError("Degree out of range");let r=[];for(let a=0;a<o-1;a++)r.push(0);r.push(1);let t=1;for(let a=0;a<o;a++){for(let s=0;s<r.length;s++)r[s]=e.reedSolomonMultiply(r[s],t),s+1<r.length&&(r[s]^=r[s+1]);t=e.reedSolomonMultiply(t,2);}return r}static reedSolomonComputeRemainder(o,r){let t=r.map(a=>0);for(let a of o){let s=a^t.shift();t.push(0),r.forEach((d,u)=>t[u]^=e.reedSolomonMultiply(d,s));}return t}static reedSolomonMultiply(o,r){if(o>>>8||r>>>8)throw new RangeError("Byte out of range");let t=0;for(let a=7;a>=0;a--)t=t<<1^(t>>>7)*285,t^=(r>>>a&1)*o;return l(t>>>8==0),t}finderPenaltyCountPatterns(o){let r=o[1];l(r<=this.size*3);let t=r>0&&o[2]==r&&o[3]==r*3&&o[4]==r&&o[5]==r;return (t&&o[0]>=r*4&&o[6]>=r?1:0)+(t&&o[6]>=r*4&&o[0]>=r?1:0)}finderPenaltyTerminateAndCount(o,r,t){return o&&(this.finderPenaltyAddHistory(r,t),r=0),r+=this.size,this.finderPenaltyAddHistory(r,t),this.finderPenaltyCountPatterns(t)}finderPenaltyAddHistory(o,r){r[0]==0&&(o+=this.size),r.pop(),r.unshift(o);}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]]}h.QrCode=e;function n(f,o,r){if(o<0||o>31||f>>>o)throw new RangeError("Value out of range");for(let t=o-1;t>=0;t--)r.push(f>>>t&1);}function i(f,o){return (f>>>o&1)!=0}function l(f){if(!f)throw new Error("Assertion error")}class c{constructor(o,r,t){this.mode=o;this.numChars=r;this.bitData=t;if(r<0)throw new RangeError("Invalid argument");this.bitData=t.slice();}mode;numChars;bitData;static makeBytes(o){let r=[];for(let t of o)n(t,8,r);return new c(c.Mode.BYTE,o.length,r)}static makeNumeric(o){if(!c.isNumeric(o))throw new RangeError("String contains non-numeric characters");let r=[];for(let t=0;t<o.length;){let a=Math.min(o.length-t,3);n(parseInt(o.substr(t,a),10),a*3+1,r),t+=a;}return new c(c.Mode.NUMERIC,o.length,r)}static makeAlphanumeric(o){if(!c.isAlphanumeric(o))throw new RangeError("String contains unencodable characters in alphanumeric mode");let r=[],t;for(t=0;t+2<=o.length;t+=2){let a=c.ALPHANUMERIC_CHARSET.indexOf(o.charAt(t))*45;a+=c.ALPHANUMERIC_CHARSET.indexOf(o.charAt(t+1)),n(a,11,r);}return t<o.length&&n(c.ALPHANUMERIC_CHARSET.indexOf(o.charAt(t)),6,r),new c(c.Mode.ALPHANUMERIC,o.length,r)}static makeSegments(o){return o==""?[]:c.isNumeric(o)?[c.makeNumeric(o)]:c.isAlphanumeric(o)?[c.makeAlphanumeric(o)]:[c.makeBytes(c.toUtf8ByteArray(o))]}static makeEci(o){let r=[];if(o<0)throw new RangeError("ECI assignment value out of range");if(o<128)n(o,8,r);else if(o<16384)n(2,2,r),n(o,14,r);else if(o<1e6)n(6,3,r),n(o,21,r);else throw new RangeError("ECI assignment value out of range");return new c(c.Mode.ECI,0,r)}static isNumeric(o){return c.NUMERIC_REGEX.test(o)}static isAlphanumeric(o){return c.ALPHANUMERIC_REGEX.test(o)}getData(){return this.bitData.slice()}static getTotalBits(o,r){let t=0;for(let a of o){let s=a.mode.numCharCountBits(r);if(a.numChars>=1<<s)return 1/0;t+=4+s+a.bitData.length;}return t}static toUtf8ByteArray(o){o=encodeURI(o);let r=[];for(let t=0;t<o.length;t++)o.charAt(t)!="%"?r.push(o.charCodeAt(t)):(r.push(parseInt(o.substr(t+1,2),16)),t+=2);return r}static NUMERIC_REGEX=/^[0-9]*$/;static ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/;static ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:"}h.QrSegment=c;})(X||={});(n=>{(l=>{class i{constructor(h,f){this.ordinal=h;this.formatBits=f;}ordinal;formatBits;static LOW=new i(0,1);static MEDIUM=new i(1,0);static QUARTILE=new i(2,3);static HIGH=new i(3,2)}l.Ecc=i;})(n.QrCode||={});})(X||={});(n=>{(l=>{class i{constructor(h,f){this.modeBits=h;this.numBitsCharCount=f;}modeBits;numBitsCharCount;static NUMERIC=new i(1,[10,12,14]);static ALPHANUMERIC=new i(2,[9,11,13]);static BYTE=new i(4,[8,16,16]);static KANJI=new i(8,[8,10,12]);static ECI=new i(7,[0,0,0]);numCharCountBits(h){return this.numBitsCharCount[Math.floor((h+7)/17)]}}l.Mode=i;})(n.QrSegment||={});})(X||={});var Z=X;({L:Z.QrCode.Ecc.LOW,M:Z.QrCode.Ecc.MEDIUM,Q:Z.QrCode.Ecc.QUARTILE,H:Z.QrCode.Ecc.HIGH});var Vt=0;function Wt(e,n="#000000"){return e?typeof e=="string"?e:e.type==="solid"?e.color:e.type==="image"?e.underlay||n:(e.type==="linear"||e.type==="radial"||e.type==="angular")&&e.stops[0]?.color||n:n}function Ee(e,n="#000000"){return e?typeof e=="string"?{type:"solid",color:e}:e:{type:"solid",color:n}}function $t(e){return !e||typeof e=="string"?false:e.type==="linear"||e.type==="radial"||e.type==="angular"}function Zt(e){return typeof e=="object"&&e!==null&&e.type==="image"}function Kt(e,n="#000000"){let i=Ee(e,n);return i.type==="solid"?i.color:i.type==="image"?i.underlay||n:i.stops[0]?.color||n}function tt(e="center"){let[n,i]=e.split("-");return e==="center"?"center":i?`${i} ${n}`:n==="top"||n==="bottom"?`center ${n}`:`${n} center`}function Jt(e){if(!e)return "#000000";if(typeof e=="string")return e;let n=Ee(e);if(n.type==="solid")return n.color;if(n.type==="image"){let c=n.fit==="tile"?`${25*(n.scale??1)}% auto`:(n.scale??1)===1?n.fit==="contain"?"contain":"cover":`${100*(n.scale??1)}% auto`,h=n.fit==="tile"?"repeat":"no-repeat";return `${`url("${n.src.replace(/"/g,"%22")}")`} ${tt(n.position)} / ${c} ${h}, ${n.underlay??"transparent"}`}let l=[...n.stops].sort((c,h)=>c.offset-h.offset).map(c=>`${c.color} ${c.offset}%`).join(", ");return n.type==="linear"?`linear-gradient(${(n.angle??0)+90}deg, ${l})`:n.type==="angular"?`conic-gradient(from ${n.angle??0}deg, ${l})`:`radial-gradient(circle, ${l})`}var xe=["logo","halftone"],ne={logo:["blend","badge"],halftone:["color","mono"]},j=192,ae=["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"],be=["diamond","star","banner"],ie=["square","rounded","gear","circle","diya","extra-rounded","message","pointy","leaf","drop","octagon","bevel","squircle","cushion","shield","petal","leaf-reverse"],ge=["curly"],Ae=["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"],_e=["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"],w=24,eo="Scan me",Me=.5,V=1.5,Re=["square","rounded","circle"],Te=.1,Ce=.3,to=.25,Oe=2,Pe=.5,Le=1,oo=.07,Ie=["square","circle","heart"],ro=3,W=64,se=8,no=.42,ao=["topLeft","topRight","bottomLeft"],Ne=.5,io=2,Fe=.1,De=.5,so=.25,co="#e5e7eb",lo="#d1d5db",$=.3,mo=.2,ve=.1,we=.4,po=.3,uo="#000000",ze=["corner","code"];var fo={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0},ho=/^[MmLlHhVvCcSsQqTtAaZz0-9.,+\-\s]*$/,Ue=/[+-]?(?:\d+\.?\d*|\.\d+)/y;function ot(e,n=Number.POSITIVE_INFINITY){if(!ho.test(e))return null;let i=[],l=0,c=()=>{for(;l<e.length&&/[\s,]/.test(e[l]);)l++;},h=()=>{c(),Ue.lastIndex=l;let r=Ue.exec(e);if(!r)return null;let t=r[0],a=t.indexOf(".");if(a>=0&&t.length-a-1>n)return null;l=Ue.lastIndex;let s=Number(t);return Number.isFinite(s)?s:null},f=()=>{c();let r=e[l];return r==="0"||r==="1"?(l++,r==="1"?1:0):null},o=()=>(c(),l<e.length&&/[0-9.+-]/.test(e[l]));for(c();l<e.length;){let r=e[l],t=r.toUpperCase(),a=fo[t];if(a===void 0||i.length===0&&t!=="M")return null;if(l++,a===0){i.push({command:r,values:[]}),c();continue}let s=r,d=true;for(;d||o();){let u=[];for(let S=0;S<a;S++){let E=t==="A"&&(S===3||S===4)?f():h();if(E===null)return null;u.push(E);}i.push({command:s,values:u}),t==="M"&&(s=r==="M"?"L":"l"),d=false;}c();}return i}function rt(e){let n=0;for(let{command:i}of e)n+=i.toUpperCase()==="A"?4:1;return n}function at(e,n){let i=[c=>c[0]-n.x0,c=>n.x1-c[0],c=>c[1]-n.y0,c=>n.y1-c[1]],l=e;for(let c of i){if(l.length===0)break;let h=l;l=[];for(let f=0;f<h.length;f++){let o=h[f],r=h[(f+h.length-1)%h.length],t=c(o),a=c(r);t>=0?(a<0&&l.push(nt(r,o,a,t)),l.push(o)):a>=0&&l.push(nt(r,o,a,t));}}return l.length>2?l:[]}function nt(e,n,i,l){let c=i/(i-l);return [e[0]+(n[0]-e[0])*c,e[1]+(n[1]-e[1])*c]}function it(e){let n=Number.POSITIVE_INFINITY,i=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY,c=Number.NEGATIVE_INFINITY,h=(f,o)=>{n=Math.min(n,f),i=Math.min(i,o),l=Math.max(l,f),c=Math.max(c,o);};for(let f of e)f.op==="C"?(h(f.x1,f.y1),h(f.x2,f.y2),h(f.x,f.y)):f.op!=="Z"&&h(f.x,f.y);return Number.isFinite(n)?{x0:n,y0:i,x1:l,y1:c}:null}var Ge=/[+-]?(?:\d+\.?\d*|\.\d+)(?:[eE][+-]?\d+)?/y;function yo(e,n,i,l,c,h,f,o,r){if(e===o&&n===r)return [];let t=Math.abs(i),a=Math.abs(l);if(t===0||a===0)return [{op:"L",x:o,y:r}];let s=c*Math.PI/180,d=Math.cos(s),u=Math.sin(s),S=(e-o)/2,E=(n-r)/2,_=d*S+u*E,m=-u*S+d*E,b=_*_/(t*t)+m*m/(a*a);b>1&&(t*=Math.sqrt(b),a*=Math.sqrt(b));let A=t*t*a*a-t*t*m*m-a*a*_*_,O=t*t*m*m+a*a*_*_,M=(h===f?-1:1)*Math.sqrt(Math.max(0,A/O)),x=M*t*m/a,g=-M*a*_/t,C=d*x-u*g+(e+o)/2,L=u*x+d*g+(n+r)/2,Q=(F,N,v,re)=>Math.atan2(F*re-N*v,F*v+N*re),te=Q(1,0,(_-x)/t,(m-g)/a),U=Q((_-x)/t,(m-g)/a,(-_-x)/t,(-m-g)/a);!f&&U>0?U-=2*Math.PI:f&&U<0&&(U+=2*Math.PI);let Y=Math.max(1,Math.ceil(Math.abs(U)/(Math.PI/2)-1e-9)),q=U/Y,oe=4/3*Math.tan(q/4),Se=(F,N)=>[C+t*d*F-a*u*N,L+t*u*F+a*d*N],et=[];for(let F=0;F<Y;F++){let N=te+F*q,v=N+q,[re,Qt]=Se(Math.cos(N)-oe*Math.sin(N),Math.sin(N)+oe*Math.cos(N)),[Yt,qt]=Se(Math.cos(v)+oe*Math.sin(v),Math.sin(v)-oe*Math.cos(v)),[Xt,jt]=F===Y-1?[o,r]:Se(Math.cos(v),Math.sin(v));et.push({op:"C",x1:re,y1:Qt,x2:Yt,y2:qt,x:Xt,y:jt});}return et}function st(e){let n=[],i=0,l=0,c=0,h=0,f=0,o="",r=null,t=null,a=()=>{for(;i<e.length&&/[\s,]/.test(e[i]);)i++;},s=()=>{a(),Ge.lastIndex=i;let S=Ge.exec(e);return S?(i=Ge.lastIndex,Number(S[0])):null},d=()=>{a();let S=e[i];return S==="0"||S==="1"?(i++,S==="1"):null},u=S=>{let E=[];for(let _=0;_<S;_++){let m=s();if(m===null)return null;E.push(m);}return E};for(;a(),!(i>=e.length);){let S=e[i];if(/[MmLlHhVvCcSsQqTtAaZz]/.test(S))o=S,i++;else if(!o||o==="Z"||o==="z")break;let E=o===o.toLowerCase(),_=E?l:0,m=E?c:0,b=o.toUpperCase();if(b==="Z"){n.push({op:"Z"}),l=h,c=f,r=null,t=null;continue}if(b==="A"){let x=u(3),g=d(),C=d(),L=u(2);if(!(x&&L)||g===null||C===null)break;let[Q,te,U]=x,Y=L[0]+_,q=L[1]+m;n.push(...yo(l,c,Q,te,U,g,C,Y,q)),l=Y,c=q,r=null,t=null;continue}let A={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2}[b]??0,O=u(A);if(!O)break;let M=O;switch(b){case "M":l=M[0]+_,c=M[1]+m,h=l,f=c,n.push({op:"M",x:l,y:c}),o=E?"l":"L",r=null,t=null;break;case "L":case "H":case "V":b!=="V"&&(l=M[0]+_),b==="V"?c=M[0]+m:b==="L"&&(c=M[1]+m),n.push({op:"L",x:l,y:c}),r=null,t=null;break;case "C":case "S":{let x,g;b==="C"?(x=[M[0]+_,M[1]+m],g=M.slice(2)):(x=r?[2*l-r[0],2*c-r[1]]:[l,c],g=M);let C=[g[0]+_,g[1]+m],L=[g[2]+_,g[3]+m];n.push({op:"C",x1:x[0],y1:x[1],x2:C[0],y2:C[1],x:L[0],y:L[1]}),[l,c]=L,r=C,t=null;break}case "Q":case "T":{let x,g;b==="Q"?(x=[M[0]+_,M[1]+m],g=[M[2]+_,M[3]+m]):(x=t?[2*l-t[0],2*c-t[1]]:[l,c],g=[M[0]+_,M[1]+m]),n.push({op:"C",x1:l+2/3*(x[0]-l),y1:c+2/3*(x[1]-c),x2:g[0]+2/3*(x[0]-g[0]),y2:g[1]+2/3*(x[1]-g[1]),x:g[0],y:g[1]}),[l,c]=g,t=x,r=null;break}}}return n}var Be="qrdx.frame",ke=1,Qe="custom",P={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:w},Ye=["wifi","star","heart","phone","headphones","calendar","user","chat","bag","bell","cup","card","check","info","home","pin","share","download","clock","snowflake","pumpkin","tree","sparkle","gift"],qe=.95,lt=200,Xe=["frame","text","accent","background"],So=/[\t\n\v\f\r\u0085\u2028\u2029]/g,Eo=/[\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 mt(e,n=w){let i=e.slice(0,1e3).normalize("NFC").replace(So," ").replace(Eo,"").replace(/\s+/g," ").trim();return Array.from(i).slice(0,Math.max(0,n)).join("").trim()}function xo(e){for(let n of e)if((n.codePointAt(0)??0)>255)return false;return true}var ce=e=>Math.abs(e*1e3-Math.round(e*1e3))<1e-6;function le(e){let n=je(e);return {x0:e.qr.x-n,y0:e.qr.y-n,x1:e.qr.x+e.qr.size+n,y1:e.qr.y+e.qr.size+n}}function bo(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 je(e){return e.qr.padding??e.qr.size*P.defaultPadding}var go=.52,Ao=.35;function _o(e){let n=e.fontSize??e.box.height*go;return Math.min(n*V,e.box.height*qe)}var He=(e,n)=>Math.min(e.x1,n.x1)-Math.max(e.x0,n.x0)>1e-6&&Math.min(e.y1,n.y1)-Math.max(e.y0,n.y0)>1e-6;function ct(e){let n=le(e),i=Math.min(e.qr.radius??0,(n.x1-n.x0)/2,(n.y1-n.y0)/2),l=[[n.x0+i,n.y0+i,Math.PI],[n.x1-i,n.y0+i,-Math.PI/2],[n.x1-i,n.y1-i,0],[n.x0+i,n.y1-i,Math.PI/2]],c=[];for(let[h,f,o]of l)for(let r=0;r<=8;r++){let t=o+Math.PI/2*(r/8);c.push([h+i*Math.cos(t),f+i*Math.sin(t)]);}return c}function Mo([e,n],i,l){if(e<i.x-.01||n<i.y-.01||e>i.x+i.width+.01||n>i.y+i.height+.01)return false;let h=Math.min(l,i.width/2,i.height/2),f=Math.min(Math.max(e,i.x+h),i.x+i.width-h),o=Math.min(Math.max(n,i.y+h),i.y+i.height-h);return Math.hypot(e-f,n-o)<=h+.01}function Ro(e){let n=0;return e.forEach(([i,l],c)=>{let[h,f]=e[(c+1)%e.length];n+=i*f-h*l;}),Math.abs(n)/2}function To(e,n,i){let l=le(n);if(!He(i,l))return false;if("stroke"in e&&e.stroke)return true;if(e.fill==="background")return false;if(e.type==="rect"&&e.hole){let{hole:c}=e;return !ct(n).every(h=>Mo(h,c,c.radius??0))}if(e.type==="circle"&&e.hole){let c=e.hole;return !ct(n).every(([h,f])=>Math.hypot(h-e.cx,f-e.cy)<=c+.01)}if(e.type==="polygon"){let c=at(e.points,l);return c.length>2&&Ro(c)>1e-6}return true}function Co(e){let n=Oo(e),i="stroke"in e?e.stroke:void 0;if(!(i&&n.bounds))return n;let l=e.type==="circle"||e.type==="ellipse"?i.width/2:e.type==="rect"?i.width*Math.SQRT2/2:i.width*2,{x0:c,y0:h,x1:f,y1:o}=n.bounds;return {bounds:{x0:c-l,y0:h-l,x1:f+l,y1:o+l},segments:n.segments*2}}function Oo(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 n=e.points.map(([l])=>l),i=e.points.map(([,l])=>l);return {bounds:{x0:Math.min(...n),y0:Math.min(...i),x1:Math.max(...n),y1:Math.max(...i)},segments:e.points.length}}case "path":{let n=ot(e.d,P.maxDecimals);return n?{bounds:it(st(e.d)),segments:rt(n)}:{bounds:null,segments:0}}case "line":{let n=e.width/2,i=Math.hypot(e.x2-e.x1,e.y2-e.y1),l=e.dash?Math.ceil(i/(e.dash[0]+e.dash[1])):1;return {bounds:{x0:Math.min(e.x1,e.x2)-n,y0:Math.min(e.y1,e.y2)-n,x1:Math.max(e.x1,e.x2)+n,y1:Math.max(e.y1,e.y2)+n},segments:l*(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:lt}}}function pt(e,n){let i=P,l=new TextEncoder().encode(JSON.stringify(e)).length;if(l>i.maxBytes){n(`The spec is ${l} bytes; the limit is ${i.maxBytes}`);return}let{width:c,height:h}=e.artboard,f=Math.max(c,h)*.005,o={x0:-f,y0:-f,x1:c+f,y1:h+f},r=m=>m.x0>=o.x0&&m.y0>=o.y0&&m.x1<=o.x1&&m.y1<=o.y1,{qr:t}=e,a=je(e);t.plate!=="none"&&a<t.size*i.minPadding-1e-9&&n(`qr.padding must be at least ${i.minPadding*100}% of qr.size`,["qr","padding"]),t.size<Math.min(c,h)*i.minQrShare-1e-9&&n(`qr.size must be at least ${i.minQrShare*100}% of the artboard's shorter side`,["qr","size"]);let s=le(e);(s.x0<-1e-9||s.y0<-1e-9||s.x1>c+1e-9||s.y1>h+1e-9)&&n("The code and its padding must sit inside the artboard",["qr"]),(t.radius??0)>(t.size+2*a)/2&&n("qr.radius is larger than half the plate",["qr","radius"]);let d=0,u=0;e.shapes.forEach((m,b)=>{let A=["shapes",b],{bounds:O,segments:M}=Co(m);if(!O){n("Path data must use only M L H V C S Q T A Z, plain numbers (up to 3 decimals) and start with M",[...A,"d"]);return}if(r(O)||n("The shape extends outside the artboard",A),m.type==="rect"&&m.hole){let{hole:x}=m;(x.x<m.x||x.y<m.y||x.x+x.width>m.x+m.width+1e-9||x.y+x.height>m.y+m.height+1e-9)&&n("The hole must sit inside its rect",[...A,"hole"]);}m.type==="circle"&&m.hole&&m.hole>=m.r&&n("The hole must be smaller than the circle",[...A,"hole"]),"stroke"in m&&m.stroke&&m.stroke.width>Math.min(c,h)*.1+1e-9&&n("A stroke may be at most 10% of the artboard's shorter side",[...A,"stroke","width"]),t.plate==="background"&&To(m,e,O)&&n('With qr.plate "background", only background fills (or a ring whose hole holds the plate) may lie under the plate',A),d+=M,typeof m.fill=="object"&&"gradient"in m.fill&&(u+=(m.fill.gradient.steps??32)*M);}),d>i.maxSegments&&n(`The shapes have ${d} segments; the limit is ${i.maxSegments}`,["shapes"]),u>i.maxGradientWork&&n("Gradient fills are too detailed (fewer steps or simpler shapes)",["shapes"]);let S=[],E=new Set,_=new Set;e.labels.forEach((m,b)=>{let A=["labels",b];E.has(m.id)&&n(`Label id "${m.id}" is used twice`,[...A,"id"]),E.add(m.id),m.slot!=="fixed"&&(_.has(m.slot)&&n(`Only one label may use the ${m.slot} slot`,[...A,"slot"]),_.add(m.slot));let O=m.maxLength??i.maxTextLength;m.text!==mt(m.text,O)&&n(`Label text must be at most ${O} characters, trimmed, with no control or invisible characters (see sanitizeFrameText)`,[...A,"text"]);let M;if(m.type==="text"){M={x0:m.box.x,y0:m.box.y,x1:m.box.x+m.box.width,y1:m.box.y+m.box.height},m.fontSize!==void 0&&m.fontSize>m.box.height*qe+1e-9&&n("fontSize may be at most 95% of the label's row height",[...A,"fontSize"]);let x=m.box.y+m.box.height/2,g=_o(m)*Ao,C={x0:M.x0,x1:M.x1,y0:x-g,y1:x+g};(He(M,bo(e))||He(C,s))&&n("The label overlaps the code or its padding",[...A,"box"]);}else {let{cx:x,cy:g,radius:C}=m.curve,L=m.fontSize*V*.6;M={x0:x-C-L,y0:g-C-L,x1:x+C+L,y1:g+C+L};let Q=Math.hypot(Math.max(s.x0-x,0,x-s.x1),Math.max(s.y0-g,0,g-s.y1));Math.hypot(Math.max(Math.abs(s.x0-x),Math.abs(s.x1-x)),Math.max(Math.abs(s.y0-g),Math.abs(s.y1-g)))<=C-L||Q>=C+L||n("The curved label crosses the code or its padding",[...A,"curve"]);}if(r(M)||n("The label extends outside the artboard",A),m.collapse){let x=m.collapse,g=x.y+x.height;(x.y<-1e-9||g>h+1e-9)&&n("The collapse band must sit inside the artboard",[...A,"collapse"]),g>s.y0+1e-6&&x.y<s.y1-1e-6&&n("The collapse band crosses the code or its padding",[...A,"collapse"]);for(let C of S)g>C.y+1e-6&&x.y<C.y+C.height-1e-6&&n("Collapse bands may not overlap",[...A,"collapse"]);S.push(x);}});}var dt=z.enum(xe),ft=z.enum([...ne.logo,...ne.halftone]),ut=e=>Math.ceil(e/3)*4,ht=z.object({width:z.number().int().min(1).max(j),height:z.number().int().min(1).max(j),data:z.string().max(ut(j*j*4))}).refine(e=>e.data.length===ut(e.width*e.height*4),{message:"Art image data does not match its width and height"}),Ve=z.object({mode:dt,image:ht,intensity:z.number().min(0).max(1).optional(),variant:ft.optional(),matchEyes:z.boolean().optional()});var Po=z.enum(["solid","linear","radial","angular","image"]),yt=z.object({type:z.literal("solid"),color:z.string()}),me=z.object({color:z.string(),offset:z.number().min(0).max(100)}),St=z.object({type:z.literal("linear"),stops:z.array(me).min(2),angle:z.number().optional().default(0)}),Et=z.object({type:z.literal("radial"),stops:z.array(me).min(2)}),xt=z.object({type:z.literal("angular"),stops:z.array(me).min(2),angle:z.number().optional().default(0)}),bt=z.enum(["cover","contain","tile"]),gt=z.enum(["top-left","top","top-right","left","center","right","bottom-left","bottom","bottom-right"]),At=z.object({type:z.literal("image"),src:z.string().min(1),fit:bt.optional().default("cover"),scale:z.number().min(.1).max(4).optional().default(1),position:gt.optional().default("center"),opacity:z.number().min(0).max(1).optional().default(1),underlay:z.string().optional()}),G=z.union([z.string(),yt,St,Et,xt,At]);var Lo=z.object({x:z.number(),y:z.number(),w:z.number(),h:z.number()});var pe=z.enum([...ae,...be]),Io=z.enum(ae);var ue=z.enum([...ie,...ge]),No=z.enum(ie);var Rt=z.enum(_e),de=z.object({style:Rt,text:z.string().max(w).optional(),color:z.string().optional(),textColor:z.string().optional(),secondaryText:z.string().max(w).optional(),secondaryColor:z.string().optional(),fontScale:z.number().min(Me).max(V).optional()});var T=z.number().min(-P.maxCoordinate).max(P.maxCoordinate).refine(ce,{message:`Numbers may have at most ${P.maxDecimals} decimals`}),I=T.refine(e=>e>0,{message:"Must be greater than 0"}),fe=T.refine(e=>e>=0,{message:"Must not be negative"}),J=z.string().regex(/^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/,"Use a #rgb or #rrggbb color"),Tt=z.union([z.enum(Xe),J]),Ot=e=>z.object({mix:z.tuple([e,e]),amount:z.number().min(0).max(1).refine(ce)}).strict(),k=z.union([Tt,Ot(Tt)]),Fo=z.union([J,Ot(z.union([z.enum(["frame","accent","background"]),J]))]),B=z.union([k,z.object({gradient:z.object({from:k,to:k,direction:z.enum(["horizontal","vertical"]).optional(),steps:z.int().min(2).max(P.maxGradientSteps).optional()}).strict()}).strict()]),We={x:T,y:T,width:I,height:I},ee=z.object({color:k,width:I}).strict(),Do=z.object({type:z.literal("rect"),...We,radius:fe.optional(),fill:B,hole:z.object({...We,radius:fe.optional()}).strict().optional(),stroke:ee.optional()}).strict(),vo=z.object({type:z.literal("circle"),cx:T,cy:T,r:I,hole:I.optional(),fill:B,stroke:ee.optional()}).strict(),wo=z.object({type:z.literal("ellipse"),cx:T,cy:T,rx:I,ry:I,fill:B,stroke:ee.optional()}).strict(),zo=z.object({type:z.literal("polygon"),points:z.array(z.tuple([T,T])).min(3).max(P.maxPolygonPoints),fill:B,stroke:ee.optional()}).strict(),Uo=z.object({type:z.literal("path"),d:z.string().min(2).max(P.maxPathLength),fill:B,fillRule:z.enum(["nonzero","evenodd"]).optional(),stroke:ee.optional()}).strict(),Go=z.object({type:z.literal("line"),x1:T,y1:T,x2:T,y2:T,width:I,cap:z.enum(["butt","round"]).optional(),dash:z.tuple([I,I]).optional(),fill:B}).strict(),Ho=z.object({type:z.literal("icon"),icon:z.enum(Ye),x:T,y:T,size:I,fill:B}).strict(),Pt=z.discriminatedUnion("type",[Do,vo,wo,zo,Uo,Go,Ho]),Lt={id:z.string().regex(/^[a-z][a-z0-9-]{0,31}$/),slot:z.enum(["primary","secondary","fixed"]),text:z.string().max(200),maxLength:z.int().min(1).max(w).optional(),color:k,weight:z.enum(["bold","regular"]).optional(),collapse:z.object({y:T,height:I}).strict().optional()},Bo=z.object({type:z.literal("text"),...Lt,box:z.object(We).strict(),align:z.enum(["start","middle","end"]).optional(),fontSize:I.optional()}).strict(),ko=z.object({type:z.literal("curved"),...Lt,curve:z.object({cx:T,cy:T,radius:I,side:z.enum(["top","bottom"]),spread:z.number().min(20).max(300).refine(ce).optional()}).strict(),fontSize:I}).strict(),It=z.discriminatedUnion("type",[Bo,ko]),Ct=T.refine(e=>e>=P.minArtboard&&e<=P.maxArtboard,{message:`Artboard sides must be ${P.minArtboard} to ${P.maxArtboard} units`}),Qo=z.object({kind:z.literal(Be),version:z.literal(ke),artboard:z.object({width:Ct,height:Ct}).strict(),qr:z.object({x:T,y:T,size:I,padding:fe.optional(),radius:fe.optional(),plate:z.enum(["opaque","background","none"]).optional()}).strict(),colors:z.object({frame:J,text:Fo.optional(),accent:J.optional()}).strict(),shapes:z.array(Pt).max(P.maxShapes),labels:z.array(It).max(P.maxLabels),bleed:z.union([z.literal("none"),k]).optional()}).strict(),$e=Qo.superRefine((e,n)=>pt(e,(i,l=[])=>n.addIssue({code:"custom",message:i,path:l})));function Yo(e){let n=$e.safeParse(e);return n.success?[]:n.error.issues.map(i=>i.path.length>0?`${i.path.join(".")}: ${i.message}`:i.message)}var Nt=de.extend({style:z.literal(Qe),spec:$e}),Ze=z.discriminatedUnion("style",[de,Nt]);var Ke=z.enum(Ae);var Je=z.enum(Re),Ft=z.object({src:z.string(),height:z.number(),width:z.number(),excavate:z.boolean(),x:z.number().optional(),y:z.number().optional(),padding:z.number().min(0).optional(),shape:Je.optional(),plate:z.string().optional()}),Xo=z.object({size:z.number().min(Te).max(Ce).optional(),padding:z.number().min(0).max(Oe).optional(),x:z.number().min(0).max(1).optional(),y:z.number().min(0).max(1).optional(),shape:Je.optional(),plate:z.string().optional()}),Dt=z.enum(["L","M","Q","H"]),vt=z.enum(Ie),wt=z.object({type:z.literal("silhouette"),width:z.number().int().min(se).max(W),height:z.number().int().min(se).max(W),cells:z.string().max(W*W).regex(/^[01]*$/).describe('Row by row, "1" inside the shape and "0" outside: width \xD7 height characters')}).refine(e=>e.cells.length===e.width*e.height,{message:"Silhouette cells do not match its width and height"}),zt=z.union([vt,wt]),he=z.object({outer:G.optional(),inner:G.optional()}),Ut=z.object({topLeft:he.optional(),topRight:he.optional(),bottomLeft:he.optional()}),ye=z.object({outer:ue.optional(),inner:pe.optional()}),Gt=z.object({topLeft:ye.optional(),topRight:ye.optional(),bottomLeft:ye.optional()}),Ht=z.enum(ze),Bt=z.object({color:z.string().optional(),width:z.number().min(Fe).max(De).optional()}),kt=z.object({color:z.string().optional(),opacity:z.number().min(ve).max(we).optional(),dx:z.number().min(-$).max($).optional(),dy:z.number().min(-$).max($).optional()}),jo=z.object({value:z.string(),size:z.number().optional(),level:Dt.optional(),bgColor:G.optional(),fgColor:G.optional(),eyeColor:G.optional(),dotColor:G.optional(),bodyPattern:Ke.optional(),cornerEyePattern:ue.optional(),cornerEyeDotPattern:pe.optional(),margin:z.number().optional(),imageSettings:Ft.optional(),isOGContext:z.boolean().optional(),templateId:z.string().optional(),customProps:z.record(z.string(),z.any()).optional(),frame:Ze.optional(),art:Ve.optional(),eyeColors:Ut.optional(),moduleScale:z.number().min(Pe).max(Le).optional(),autoLevel:z.boolean().optional(),shape:zt.optional(),eyeShapes:Gt.optional(),eyeGradient:Ht.optional(),bgRadius:z.number().min(0).max(Ne).optional(),backdrop:z.string().optional(),halo:Bt.optional(),shadow:kt.optional()});var Vo=z.object({fgColor:z.string().optional(),bgColor:z.string().optional()}),Wo=z.object({pixelSize:z.number(),url:z.string()}),$o=z.object({id:z.string(),name:z.string(),description:z.string().optional()});/**
1
+ import {z}from'zod';var W;(h=>{class e{constructor(o,r,t,a){this.version=o;this.errorCorrectionLevel=r;if(o<e.MIN_VERSION||o>e.MAX_VERSION)throw new RangeError("Version value out of range");if(a<-1||a>7)throw new RangeError("Mask value out of range");this.size=o*4+17;let s=[];for(let u=0;u<this.size;u++)s.push(false);for(let u=0;u<this.size;u++)this.modules.push(s.slice()),this.isFunction.push(s.slice());this.drawFunctionPatterns();let d=this.addEccAndInterleave(t);if(this.drawCodewords(d),a==-1){let u=1e9;for(let S=0;S<8;S++){this.applyMask(S),this.drawFormatBits(S);let E=this.getPenaltyScore();E<u&&(a=S,u=E),this.applyMask(S);}}l(0<=a&&a<=7),this.mask=a,this.applyMask(a),this.drawFormatBits(a),this.isFunction=[];}version;errorCorrectionLevel;static encodeText(o,r){let t=h.QrSegment.makeSegments(o);return e.encodeSegments(t,r)}static encodeBinary(o,r){let t=h.QrSegment.makeBytes(o);return e.encodeSegments([t],r)}static encodeSegments(o,r,t=1,a=40,s=-1,d=true){if(!(e.MIN_VERSION<=t&&t<=a&&a<=e.MAX_VERSION)||s<-1||s>7)throw new RangeError("Invalid value");let u,S;for(u=t;;u++){let x=e.getNumDataCodewords(u,r)*8,A=c.getTotalBits(o,u);if(A<=x){S=A;break}if(u>=a)throw new RangeError("Data too long")}for(let x of [e.Ecc.MEDIUM,e.Ecc.QUARTILE,e.Ecc.HIGH])d&&S<=e.getNumDataCodewords(u,x)*8&&(r=x);let E=[];for(let x of o){n(x.mode.modeBits,4,E),n(x.numChars,x.mode.numCharCountBits(u),E);for(let A of x.getData())E.push(A);}l(E.length==S);let _=e.getNumDataCodewords(u,r)*8;l(E.length<=_),n(0,Math.min(4,_-E.length),E),n(0,(8-E.length%8)%8,E),l(E.length%8==0);for(let x=236;E.length<_;x^=253)n(x,8,E);let m=[];for(;m.length*8<E.length;)m.push(0);return E.forEach((x,A)=>m[A>>>3]|=x<<7-(A&7)),new e(u,r,m,s)}size;mask;modules=[];isFunction=[];getModule(o,r){return 0<=o&&o<this.size&&0<=r&&r<this.size&&this.modules[r][o]}getModules(){return this.modules}drawFunctionPatterns(){for(let t=0;t<this.size;t++)this.setFunctionModule(6,t,t%2==0),this.setFunctionModule(t,6,t%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);let o=this.getAlignmentPatternPositions(),r=o.length;for(let t=0;t<r;t++)for(let a=0;a<r;a++)t==0&&a==0||t==0&&a==r-1||t==r-1&&a==0||this.drawAlignmentPattern(o[t],o[a]);this.drawFormatBits(0),this.drawVersion();}drawFormatBits(o){let r=this.errorCorrectionLevel.formatBits<<3|o,t=r;for(let s=0;s<10;s++)t=t<<1^(t>>>9)*1335;let a=(r<<10|t)^21522;l(a>>>15==0);for(let s=0;s<=5;s++)this.setFunctionModule(8,s,i(a,s));this.setFunctionModule(8,7,i(a,6)),this.setFunctionModule(8,8,i(a,7)),this.setFunctionModule(7,8,i(a,8));for(let s=9;s<15;s++)this.setFunctionModule(14-s,8,i(a,s));for(let s=0;s<8;s++)this.setFunctionModule(this.size-1-s,8,i(a,s));for(let s=8;s<15;s++)this.setFunctionModule(8,this.size-15+s,i(a,s));this.setFunctionModule(8,this.size-8,true);}drawVersion(){if(this.version<7)return;let o=this.version;for(let t=0;t<12;t++)o=o<<1^(o>>>11)*7973;let r=this.version<<12|o;l(r>>>18==0);for(let t=0;t<18;t++){let a=i(r,t),s=this.size-11+t%3,d=Math.floor(t/3);this.setFunctionModule(s,d,a),this.setFunctionModule(d,s,a);}}drawFinderPattern(o,r){for(let t=-4;t<=4;t++)for(let a=-4;a<=4;a++){let s=Math.max(Math.abs(a),Math.abs(t)),d=o+a,u=r+t;0<=d&&d<this.size&&0<=u&&u<this.size&&this.setFunctionModule(d,u,s!=2&&s!=4);}}drawAlignmentPattern(o,r){for(let t=-2;t<=2;t++)for(let a=-2;a<=2;a++)this.setFunctionModule(o+a,r+t,Math.max(Math.abs(a),Math.abs(t))!=1);}setFunctionModule(o,r,t){this.modules[r][o]=t,this.isFunction[r][o]=true;}addEccAndInterleave(o){let r=this.version,t=this.errorCorrectionLevel;if(o.length!=e.getNumDataCodewords(r,t))throw new RangeError("Invalid argument");let a=e.NUM_ERROR_CORRECTION_BLOCKS[t.ordinal][r],s=e.ECC_CODEWORDS_PER_BLOCK[t.ordinal][r],d=Math.floor(e.getNumRawDataModules(r)/8),u=a-d%a,S=Math.floor(d/a),E=[],_=e.reedSolomonComputeDivisor(s);for(let x=0,A=0;x<a;x++){let O=o.slice(A,A+S-s+(x<u?0:1));A+=O.length;let R=e.reedSolomonComputeRemainder(O,_);x<u&&O.push(0),E.push(O.concat(R));}let m=[];for(let x=0;x<E[0].length;x++)E.forEach((A,O)=>{(x!=S-s||O>=u)&&m.push(A[x]);});return l(m.length==d),m}drawCodewords(o){if(o.length!=Math.floor(e.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let r=0;for(let t=this.size-1;t>=1;t-=2){t==6&&(t=5);for(let a=0;a<this.size;a++)for(let s=0;s<2;s++){let d=t-s,S=(t+1&2)==0?this.size-1-a:a;!this.isFunction[S][d]&&r<o.length*8&&(this.modules[S][d]=i(o[r>>>3],7-(r&7)),r++);}}l(r==o.length*8);}applyMask(o){if(o<0||o>7)throw new RangeError("Mask value out of range");for(let r=0;r<this.size;r++)for(let t=0;t<this.size;t++){let a;switch(o){case 0:a=(t+r)%2==0;break;case 1:a=r%2==0;break;case 2:a=t%3==0;break;case 3:a=(t+r)%3==0;break;case 4:a=(Math.floor(t/3)+Math.floor(r/2))%2==0;break;case 5:a=t*r%2+t*r%3==0;break;case 6:a=(t*r%2+t*r%3)%2==0;break;case 7:a=((t+r)%2+t*r%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[r][t]&&a&&(this.modules[r][t]=!this.modules[r][t]);}}getPenaltyScore(){let o=0;for(let s=0;s<this.size;s++){let d=false,u=0,S=[0,0,0,0,0,0,0];for(let E=0;E<this.size;E++)this.modules[s][E]==d?(u++,u==5?o+=e.PENALTY_N1:u>5&&o++):(this.finderPenaltyAddHistory(u,S),d||(o+=this.finderPenaltyCountPatterns(S)*e.PENALTY_N3),d=this.modules[s][E],u=1);o+=this.finderPenaltyTerminateAndCount(d,u,S)*e.PENALTY_N3;}for(let s=0;s<this.size;s++){let d=false,u=0,S=[0,0,0,0,0,0,0];for(let E=0;E<this.size;E++)this.modules[E][s]==d?(u++,u==5?o+=e.PENALTY_N1:u>5&&o++):(this.finderPenaltyAddHistory(u,S),d||(o+=this.finderPenaltyCountPatterns(S)*e.PENALTY_N3),d=this.modules[E][s],u=1);o+=this.finderPenaltyTerminateAndCount(d,u,S)*e.PENALTY_N3;}for(let s=0;s<this.size-1;s++)for(let d=0;d<this.size-1;d++){let u=this.modules[s][d];u==this.modules[s][d+1]&&u==this.modules[s+1][d]&&u==this.modules[s+1][d+1]&&(o+=e.PENALTY_N2);}let r=0;for(let s of this.modules)r=s.reduce((d,u)=>d+(u?1:0),r);let t=this.size*this.size,a=Math.ceil(Math.abs(r*20-t*10)/t)-1;return l(0<=a&&a<=9),o+=a*e.PENALTY_N4,l(0<=o&&o<=2568888),o}getAlignmentPatternPositions(){if(this.version==1)return [];{let o=Math.floor(this.version/7)+2,r=this.version==32?26:Math.ceil((this.version*4+4)/(o*2-2))*2,t=[6];for(let a=this.size-7;t.length<o;a-=r)t.splice(1,0,a);return t}}static getNumRawDataModules(o){if(o<e.MIN_VERSION||o>e.MAX_VERSION)throw new RangeError("Version number out of range");let r=(16*o+128)*o+64;if(o>=2){let t=Math.floor(o/7)+2;r-=(25*t-10)*t-55,o>=7&&(r-=36);}return l(208<=r&&r<=29648),r}static getNumDataCodewords(o,r){return Math.floor(e.getNumRawDataModules(o)/8)-e.ECC_CODEWORDS_PER_BLOCK[r.ordinal][o]*e.NUM_ERROR_CORRECTION_BLOCKS[r.ordinal][o]}static reedSolomonComputeDivisor(o){if(o<1||o>255)throw new RangeError("Degree out of range");let r=[];for(let a=0;a<o-1;a++)r.push(0);r.push(1);let t=1;for(let a=0;a<o;a++){for(let s=0;s<r.length;s++)r[s]=e.reedSolomonMultiply(r[s],t),s+1<r.length&&(r[s]^=r[s+1]);t=e.reedSolomonMultiply(t,2);}return r}static reedSolomonComputeRemainder(o,r){let t=r.map(a=>0);for(let a of o){let s=a^t.shift();t.push(0),r.forEach((d,u)=>t[u]^=e.reedSolomonMultiply(d,s));}return t}static reedSolomonMultiply(o,r){if(o>>>8||r>>>8)throw new RangeError("Byte out of range");let t=0;for(let a=7;a>=0;a--)t=t<<1^(t>>>7)*285,t^=(r>>>a&1)*o;return l(t>>>8==0),t}finderPenaltyCountPatterns(o){let r=o[1];l(r<=this.size*3);let t=r>0&&o[2]==r&&o[3]==r*3&&o[4]==r&&o[5]==r;return (t&&o[0]>=r*4&&o[6]>=r?1:0)+(t&&o[6]>=r*4&&o[0]>=r?1:0)}finderPenaltyTerminateAndCount(o,r,t){return o&&(this.finderPenaltyAddHistory(r,t),r=0),r+=this.size,this.finderPenaltyAddHistory(r,t),this.finderPenaltyCountPatterns(t)}finderPenaltyAddHistory(o,r){r[0]==0&&(o+=this.size),r.pop(),r.unshift(o);}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]]}h.QrCode=e;function n(f,o,r){if(o<0||o>31||f>>>o)throw new RangeError("Value out of range");for(let t=o-1;t>=0;t--)r.push(f>>>t&1);}function i(f,o){return (f>>>o&1)!=0}function l(f){if(!f)throw new Error("Assertion error")}class c{constructor(o,r,t){this.mode=o;this.numChars=r;this.bitData=t;if(r<0)throw new RangeError("Invalid argument");this.bitData=t.slice();}mode;numChars;bitData;static makeBytes(o){let r=[];for(let t of o)n(t,8,r);return new c(c.Mode.BYTE,o.length,r)}static makeNumeric(o){if(!c.isNumeric(o))throw new RangeError("String contains non-numeric characters");let r=[];for(let t=0;t<o.length;){let a=Math.min(o.length-t,3);n(parseInt(o.substr(t,a),10),a*3+1,r),t+=a;}return new c(c.Mode.NUMERIC,o.length,r)}static makeAlphanumeric(o){if(!c.isAlphanumeric(o))throw new RangeError("String contains unencodable characters in alphanumeric mode");let r=[],t;for(t=0;t+2<=o.length;t+=2){let a=c.ALPHANUMERIC_CHARSET.indexOf(o.charAt(t))*45;a+=c.ALPHANUMERIC_CHARSET.indexOf(o.charAt(t+1)),n(a,11,r);}return t<o.length&&n(c.ALPHANUMERIC_CHARSET.indexOf(o.charAt(t)),6,r),new c(c.Mode.ALPHANUMERIC,o.length,r)}static makeSegments(o){return o==""?[]:c.isNumeric(o)?[c.makeNumeric(o)]:c.isAlphanumeric(o)?[c.makeAlphanumeric(o)]:[c.makeBytes(c.toUtf8ByteArray(o))]}static makeEci(o){let r=[];if(o<0)throw new RangeError("ECI assignment value out of range");if(o<128)n(o,8,r);else if(o<16384)n(2,2,r),n(o,14,r);else if(o<1e6)n(6,3,r),n(o,21,r);else throw new RangeError("ECI assignment value out of range");return new c(c.Mode.ECI,0,r)}static isNumeric(o){return c.NUMERIC_REGEX.test(o)}static isAlphanumeric(o){return c.ALPHANUMERIC_REGEX.test(o)}getData(){return this.bitData.slice()}static getTotalBits(o,r){let t=0;for(let a of o){let s=a.mode.numCharCountBits(r);if(a.numChars>=1<<s)return 1/0;t+=4+s+a.bitData.length;}return t}static toUtf8ByteArray(o){o=encodeURI(o);let r=[];for(let t=0;t<o.length;t++)o.charAt(t)!="%"?r.push(o.charCodeAt(t)):(r.push(parseInt(o.substr(t+1,2),16)),t+=2);return r}static NUMERIC_REGEX=/^[0-9]*$/;static ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/;static ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:"}h.QrSegment=c;})(W||={});(n=>{(l=>{class i{constructor(h,f){this.ordinal=h;this.formatBits=f;}ordinal;formatBits;static LOW=new i(0,1);static MEDIUM=new i(1,0);static QUARTILE=new i(2,3);static HIGH=new i(3,2)}l.Ecc=i;})(n.QrCode||={});})(W||={});(n=>{(l=>{class i{constructor(h,f){this.modeBits=h;this.numBitsCharCount=f;}modeBits;numBitsCharCount;static NUMERIC=new i(1,[10,12,14]);static ALPHANUMERIC=new i(2,[9,11,13]);static BYTE=new i(4,[8,16,16]);static KANJI=new i(8,[8,10,12]);static ECI=new i(7,[0,0,0]);numCharCountBits(h){return this.numBitsCharCount[Math.floor((h+7)/17)]}}l.Mode=i;})(n.QrSegment||={});})(W||={});var K=W;({L:K.QrCode.Ecc.LOW,M:K.QrCode.Ecc.MEDIUM,Q:K.QrCode.Ecc.QUARTILE,H:K.QrCode.Ecc.HIGH});var to=0;function oo(e,n="#000000"){return e?typeof e=="string"?e:e.type==="solid"?e.color:e.type==="image"?e.underlay||n:(e.type==="linear"||e.type==="radial"||e.type==="angular")&&e.stops[0]?.color||n:n}function ge(e,n="#000000"){return e?typeof e=="string"?{type:"solid",color:e}:e:{type:"solid",color:n}}function ro(e){return !e||typeof e=="string"?false:e.type==="linear"||e.type==="radial"||e.type==="angular"}function no(e){return typeof e=="object"&&e!==null&&e.type==="image"}function ao(e,n="#000000"){let i=ge(e,n);return i.type==="solid"?i.color:i.type==="image"?i.underlay||n:i.stops[0]?.color||n}function st(e="center"){let[n,i]=e.split("-");return e==="center"?"center":i?`${i} ${n}`:n==="top"||n==="bottom"?`center ${n}`:`${n} center`}function io(e){if(!e)return "#000000";if(typeof e=="string")return e;let n=ge(e);if(n.type==="solid")return n.color;if(n.type==="image"){let c=n.fit==="tile"?`${25*(n.scale??1)}% auto`:(n.scale??1)===1?n.fit==="contain"?"contain":"cover":`${100*(n.scale??1)}% auto`,h=n.fit==="tile"?"repeat":"no-repeat";return `${`url("${n.src.replace(/"/g,"%22")}")`} ${st(n.position)} / ${c} ${h}, ${n.underlay??"transparent"}`}let l=[...n.stops].sort((c,h)=>c.offset-h.offset).map(c=>`${c.color} ${c.offset}%`).join(", ");return n.type==="linear"?`linear-gradient(${(n.angle??0)+90}deg, ${l})`:n.type==="angular"?`conic-gradient(from ${n.angle??0}deg, ${l})`:`radial-gradient(circle, ${l})`}var Ae=["logo","halftone"],ae={logo:["blend","badge"],halftone:["color","mono"]},j=192,ie=["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"],_e=["diamond","star","banner"],se=["square","rounded","gear","circle","diya","extra-rounded","message","pointy","leaf","drop","octagon","bevel","squircle","cushion","shield","petal","leaf-reverse","porthole","notch","plus","bud","bowl"],Re=["curly"],Te=["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"],Me={x:"plus",pebble:"rounded",flower:"circle",beads:"circle",bubble:"circle",chain:"circle",petal:"leaf",drop:"rounded",squircle:"rounded"},Ce={pebble:"squircle",tag:"rounded",crest:"shield",doodle:"squircle",stamp:"notch"},Oe={bevel:"square",notch:"square"};function k(e,n){return typeof n=="string"&&Object.hasOwn(e,n)?e[n]:n}var Pe=["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"],v=24,so="Scan me",Ne=.5,V=1.5,Ie=["square","rounded","circle"],Le=.1,Fe=.3,co=.25,De=2,we=.5,ve=1,lo=.07,ze=["square","circle","heart"],mo=3,$=64,ce=8,po=.42,uo=["topLeft","topRight","bottomLeft"],He=.5,fo=2,Ue=.1,Ge=.5,ho=.25,yo="#e5e7eb",So="#d1d5db",Z=.3,Eo=.2,Be=.1,ke=.4,bo=.3,xo="#000000",Ye=["corner","code"];var go={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0},Ao=/^[MmLlHhVvCcSsQqTtAaZz0-9.,+\-\s]*$/,Qe=/[+-]?(?:\d+\.?\d*|\.\d+)/y;function ct(e,n=Number.POSITIVE_INFINITY){if(!Ao.test(e))return null;let i=[],l=0,c=()=>{for(;l<e.length&&/[\s,]/.test(e[l]);)l++;},h=()=>{c(),Qe.lastIndex=l;let r=Qe.exec(e);if(!r)return null;let t=r[0],a=t.indexOf(".");if(a>=0&&t.length-a-1>n)return null;l=Qe.lastIndex;let s=Number(t);return Number.isFinite(s)?s:null},f=()=>{c();let r=e[l];return r==="0"||r==="1"?(l++,r==="1"?1:0):null},o=()=>(c(),l<e.length&&/[0-9.+-]/.test(e[l]));for(c();l<e.length;){let r=e[l],t=r.toUpperCase(),a=go[t];if(a===void 0||i.length===0&&t!=="M")return null;if(l++,a===0){i.push({command:r,values:[]}),c();continue}let s=r,d=true;for(;d||o();){let u=[];for(let S=0;S<a;S++){let E=t==="A"&&(S===3||S===4)?f():h();if(E===null)return null;u.push(E);}i.push({command:s,values:u}),t==="M"&&(s=r==="M"?"L":"l"),d=false;}c();}return i}function lt(e){let n=0;for(let{command:i}of e)n+=i.toUpperCase()==="A"?4:1;return n}function pt(e,n){let i=[c=>c[0]-n.x0,c=>n.x1-c[0],c=>c[1]-n.y0,c=>n.y1-c[1]],l=e;for(let c of i){if(l.length===0)break;let h=l;l=[];for(let f=0;f<h.length;f++){let o=h[f],r=h[(f+h.length-1)%h.length],t=c(o),a=c(r);t>=0?(a<0&&l.push(mt(r,o,a,t)),l.push(o)):a>=0&&l.push(mt(r,o,a,t));}}return l.length>2?l:[]}function mt(e,n,i,l){let c=i/(i-l);return [e[0]+(n[0]-e[0])*c,e[1]+(n[1]-e[1])*c]}function ut(e){let n=Number.POSITIVE_INFINITY,i=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY,c=Number.NEGATIVE_INFINITY,h=(f,o)=>{n=Math.min(n,f),i=Math.min(i,o),l=Math.max(l,f),c=Math.max(c,o);};for(let f of e)f.op==="C"?(h(f.x1,f.y1),h(f.x2,f.y2),h(f.x,f.y)):f.op!=="Z"&&h(f.x,f.y);return Number.isFinite(n)?{x0:n,y0:i,x1:l,y1:c}:null}var qe=/[+-]?(?:\d+\.?\d*|\.\d+)(?:[eE][+-]?\d+)?/y;function _o(e,n,i,l,c,h,f,o,r){if(e===o&&n===r)return [];let t=Math.abs(i),a=Math.abs(l);if(t===0||a===0)return [{op:"L",x:o,y:r}];let s=c*Math.PI/180,d=Math.cos(s),u=Math.sin(s),S=(e-o)/2,E=(n-r)/2,_=d*S+u*E,m=-u*S+d*E,x=_*_/(t*t)+m*m/(a*a);x>1&&(t*=Math.sqrt(x),a*=Math.sqrt(x));let A=t*t*a*a-t*t*m*m-a*a*_*_,O=t*t*m*m+a*a*_*_,R=(h===f?-1:1)*Math.sqrt(Math.max(0,A/O)),b=R*t*m/a,g=-R*a*_/t,C=d*b-u*g+(e+o)/2,N=u*b+d*g+(n+r)/2,Q=(F,L,w,ne)=>Math.atan2(F*ne-L*w,F*w+L*ne),oe=Q(1,0,(_-b)/t,(m-g)/a),H=Q((_-b)/t,(m-g)/a,(-_-b)/t,(-m-g)/a);!f&&H>0?H-=2*Math.PI:f&&H<0&&(H+=2*Math.PI);let q=Math.max(1,Math.ceil(Math.abs(H)/(Math.PI/2)-1e-9)),X=H/q,re=4/3*Math.tan(X/4),xe=(F,L)=>[C+t*d*F-a*u*L,N+t*u*F+a*d*L],it=[];for(let F=0;F<q;F++){let L=oe+F*X,w=L+X,[ne,$t]=xe(Math.cos(L)-re*Math.sin(L),Math.sin(L)+re*Math.cos(L)),[Zt,Kt]=xe(Math.cos(w)+re*Math.sin(w),Math.sin(w)-re*Math.cos(w)),[Jt,eo]=F===q-1?[o,r]:xe(Math.cos(w),Math.sin(w));it.push({op:"C",x1:ne,y1:$t,x2:Zt,y2:Kt,x:Jt,y:eo});}return it}function dt(e){let n=[],i=0,l=0,c=0,h=0,f=0,o="",r=null,t=null,a=()=>{for(;i<e.length&&/[\s,]/.test(e[i]);)i++;},s=()=>{a(),qe.lastIndex=i;let S=qe.exec(e);return S?(i=qe.lastIndex,Number(S[0])):null},d=()=>{a();let S=e[i];return S==="0"||S==="1"?(i++,S==="1"):null},u=S=>{let E=[];for(let _=0;_<S;_++){let m=s();if(m===null)return null;E.push(m);}return E};for(;a(),!(i>=e.length);){let S=e[i];if(/[MmLlHhVvCcSsQqTtAaZz]/.test(S))o=S,i++;else if(!o||o==="Z"||o==="z")break;let E=o===o.toLowerCase(),_=E?l:0,m=E?c:0,x=o.toUpperCase();if(x==="Z"){n.push({op:"Z"}),l=h,c=f,r=null,t=null;continue}if(x==="A"){let b=u(3),g=d(),C=d(),N=u(2);if(!(b&&N)||g===null||C===null)break;let[Q,oe,H]=b,q=N[0]+_,X=N[1]+m;n.push(..._o(l,c,Q,oe,H,g,C,q,X)),l=q,c=X,r=null,t=null;continue}let A={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2}[x]??0,O=u(A);if(!O)break;let R=O;switch(x){case "M":l=R[0]+_,c=R[1]+m,h=l,f=c,n.push({op:"M",x:l,y:c}),o=E?"l":"L",r=null,t=null;break;case "L":case "H":case "V":x!=="V"&&(l=R[0]+_),x==="V"?c=R[0]+m:x==="L"&&(c=R[1]+m),n.push({op:"L",x:l,y:c}),r=null,t=null;break;case "C":case "S":{let b,g;x==="C"?(b=[R[0]+_,R[1]+m],g=R.slice(2)):(b=r?[2*l-r[0],2*c-r[1]]:[l,c],g=R);let C=[g[0]+_,g[1]+m],N=[g[2]+_,g[3]+m];n.push({op:"C",x1:b[0],y1:b[1],x2:C[0],y2:C[1],x:N[0],y:N[1]}),[l,c]=N,r=C,t=null;break}case "Q":case "T":{let b,g;x==="Q"?(b=[R[0]+_,R[1]+m],g=[R[2]+_,R[3]+m]):(b=t?[2*l-t[0],2*c-t[1]]:[l,c],g=[R[0]+_,R[1]+m]),n.push({op:"C",x1:l+2/3*(b[0]-l),y1:c+2/3*(b[1]-c),x2:g[0]+2/3*(b[0]-g[0]),y2:g[1]+2/3*(b[1]-g[1]),x:g[0],y:g[1]}),[l,c]=g,t=b,r=null;break}}}return n}var We="qrdx.frame",je=1,Ve="custom",P={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:v},$e=["wifi","star","heart","phone","headphones","calendar","user","chat","bag","bell","cup","card","check","info","home","pin","share","download","clock","snowflake","pumpkin","tree","sparkle","gift"],Ze=.95,ht=200,Ke=["frame","text","accent","background"],Ro=/[\t\n\v\f\r\u0085\u2028\u2029]/g,To=/[\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 yt(e,n=v){let i=e.slice(0,1e3).normalize("NFC").replace(Ro," ").replace(To,"").replace(/\s+/g," ").trim();return Array.from(i).slice(0,Math.max(0,n)).join("").trim()}function Mo(e){for(let n of e)if((n.codePointAt(0)??0)>255)return false;return true}var le=e=>Math.abs(e*1e3-Math.round(e*1e3))<1e-6;function me(e){let n=Je(e);return {x0:e.qr.x-n,y0:e.qr.y-n,x1:e.qr.x+e.qr.size+n,y1:e.qr.y+e.qr.size+n}}function Co(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 Je(e){return e.qr.padding??e.qr.size*P.defaultPadding}var Oo=.52,Po=.35;function No(e){let n=e.fontSize??e.box.height*Oo;return Math.min(n*V,e.box.height*Ze)}var Xe=(e,n)=>Math.min(e.x1,n.x1)-Math.max(e.x0,n.x0)>1e-6&&Math.min(e.y1,n.y1)-Math.max(e.y0,n.y0)>1e-6;function ft(e){let n=me(e),i=Math.min(e.qr.radius??0,(n.x1-n.x0)/2,(n.y1-n.y0)/2),l=[[n.x0+i,n.y0+i,Math.PI],[n.x1-i,n.y0+i,-Math.PI/2],[n.x1-i,n.y1-i,0],[n.x0+i,n.y1-i,Math.PI/2]],c=[];for(let[h,f,o]of l)for(let r=0;r<=8;r++){let t=o+Math.PI/2*(r/8);c.push([h+i*Math.cos(t),f+i*Math.sin(t)]);}return c}function Io([e,n],i,l){if(e<i.x-.01||n<i.y-.01||e>i.x+i.width+.01||n>i.y+i.height+.01)return false;let h=Math.min(l,i.width/2,i.height/2),f=Math.min(Math.max(e,i.x+h),i.x+i.width-h),o=Math.min(Math.max(n,i.y+h),i.y+i.height-h);return Math.hypot(e-f,n-o)<=h+.01}function Lo(e){let n=0;return e.forEach(([i,l],c)=>{let[h,f]=e[(c+1)%e.length];n+=i*f-h*l;}),Math.abs(n)/2}function Fo(e,n,i){let l=me(n);if(!Xe(i,l))return false;if("stroke"in e&&e.stroke)return true;if(e.fill==="background")return false;if(e.type==="rect"&&e.hole){let{hole:c}=e;return !ft(n).every(h=>Io(h,c,c.radius??0))}if(e.type==="circle"&&e.hole){let c=e.hole;return !ft(n).every(([h,f])=>Math.hypot(h-e.cx,f-e.cy)<=c+.01)}if(e.type==="polygon"){let c=pt(e.points,l);return c.length>2&&Lo(c)>1e-6}return true}function Do(e){let n=wo(e),i="stroke"in e?e.stroke:void 0;if(!(i&&n.bounds))return n;let l=e.type==="circle"||e.type==="ellipse"?i.width/2:e.type==="rect"?i.width*Math.SQRT2/2:i.width*2,{x0:c,y0:h,x1:f,y1:o}=n.bounds;return {bounds:{x0:c-l,y0:h-l,x1:f+l,y1:o+l},segments:n.segments*2}}function wo(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 n=e.points.map(([l])=>l),i=e.points.map(([,l])=>l);return {bounds:{x0:Math.min(...n),y0:Math.min(...i),x1:Math.max(...n),y1:Math.max(...i)},segments:e.points.length}}case "path":{let n=ct(e.d,P.maxDecimals);return n?{bounds:ut(dt(e.d)),segments:lt(n)}:{bounds:null,segments:0}}case "line":{let n=e.width/2,i=Math.hypot(e.x2-e.x1,e.y2-e.y1),l=e.dash?Math.ceil(i/(e.dash[0]+e.dash[1])):1;return {bounds:{x0:Math.min(e.x1,e.x2)-n,y0:Math.min(e.y1,e.y2)-n,x1:Math.max(e.x1,e.x2)+n,y1:Math.max(e.y1,e.y2)+n},segments:l*(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:ht}}}function St(e,n){let i=P,l=new TextEncoder().encode(JSON.stringify(e)).length;if(l>i.maxBytes){n(`The spec is ${l} bytes; the limit is ${i.maxBytes}`);return}let{width:c,height:h}=e.artboard,f=Math.max(c,h)*.005,o={x0:-f,y0:-f,x1:c+f,y1:h+f},r=m=>m.x0>=o.x0&&m.y0>=o.y0&&m.x1<=o.x1&&m.y1<=o.y1,{qr:t}=e,a=Je(e);t.plate!=="none"&&a<t.size*i.minPadding-1e-9&&n(`qr.padding must be at least ${i.minPadding*100}% of qr.size`,["qr","padding"]),t.size<Math.min(c,h)*i.minQrShare-1e-9&&n(`qr.size must be at least ${i.minQrShare*100}% of the artboard's shorter side`,["qr","size"]);let s=me(e);(s.x0<-1e-9||s.y0<-1e-9||s.x1>c+1e-9||s.y1>h+1e-9)&&n("The code and its padding must sit inside the artboard",["qr"]),(t.radius??0)>(t.size+2*a)/2&&n("qr.radius is larger than half the plate",["qr","radius"]);let d=0,u=0;e.shapes.forEach((m,x)=>{let A=["shapes",x],{bounds:O,segments:R}=Do(m);if(!O){n("Path data must use only M L H V C S Q T A Z, plain numbers (up to 3 decimals) and start with M",[...A,"d"]);return}if(r(O)||n("The shape extends outside the artboard",A),m.type==="rect"&&m.hole){let{hole:b}=m;(b.x<m.x||b.y<m.y||b.x+b.width>m.x+m.width+1e-9||b.y+b.height>m.y+m.height+1e-9)&&n("The hole must sit inside its rect",[...A,"hole"]);}m.type==="circle"&&m.hole&&m.hole>=m.r&&n("The hole must be smaller than the circle",[...A,"hole"]),"stroke"in m&&m.stroke&&m.stroke.width>Math.min(c,h)*.1+1e-9&&n("A stroke may be at most 10% of the artboard's shorter side",[...A,"stroke","width"]),t.plate==="background"&&Fo(m,e,O)&&n('With qr.plate "background", only background fills (or a ring whose hole holds the plate) may lie under the plate',A),d+=R,typeof m.fill=="object"&&"gradient"in m.fill&&(u+=(m.fill.gradient.steps??32)*R);}),d>i.maxSegments&&n(`The shapes have ${d} segments; the limit is ${i.maxSegments}`,["shapes"]),u>i.maxGradientWork&&n("Gradient fills are too detailed (fewer steps or simpler shapes)",["shapes"]);let S=[],E=new Set,_=new Set;e.labels.forEach((m,x)=>{let A=["labels",x];E.has(m.id)&&n(`Label id "${m.id}" is used twice`,[...A,"id"]),E.add(m.id),m.slot!=="fixed"&&(_.has(m.slot)&&n(`Only one label may use the ${m.slot} slot`,[...A,"slot"]),_.add(m.slot));let O=m.maxLength??i.maxTextLength;m.text!==yt(m.text,O)&&n(`Label text must be at most ${O} characters, trimmed, with no control or invisible characters (see sanitizeFrameText)`,[...A,"text"]);let R;if(m.type==="text"){R={x0:m.box.x,y0:m.box.y,x1:m.box.x+m.box.width,y1:m.box.y+m.box.height},m.fontSize!==void 0&&m.fontSize>m.box.height*Ze+1e-9&&n("fontSize may be at most 95% of the label's row height",[...A,"fontSize"]);let b=m.box.y+m.box.height/2,g=No(m)*Po,C={x0:R.x0,x1:R.x1,y0:b-g,y1:b+g};(Xe(R,Co(e))||Xe(C,s))&&n("The label overlaps the code or its padding",[...A,"box"]);}else {let{cx:b,cy:g,radius:C}=m.curve,N=m.fontSize*V*.6;R={x0:b-C-N,y0:g-C-N,x1:b+C+N,y1:g+C+N};let Q=Math.hypot(Math.max(s.x0-b,0,b-s.x1),Math.max(s.y0-g,0,g-s.y1));Math.hypot(Math.max(Math.abs(s.x0-b),Math.abs(s.x1-b)),Math.max(Math.abs(s.y0-g),Math.abs(s.y1-g)))<=C-N||Q>=C+N||n("The curved label crosses the code or its padding",[...A,"curve"]);}if(r(R)||n("The label extends outside the artboard",A),m.collapse){let b=m.collapse,g=b.y+b.height;(b.y<-1e-9||g>h+1e-9)&&n("The collapse band must sit inside the artboard",[...A,"collapse"]),g>s.y0+1e-6&&b.y<s.y1-1e-6&&n("The collapse band crosses the code or its padding",[...A,"collapse"]);for(let C of S)g>C.y+1e-6&&b.y<C.y+C.height-1e-6&&n("Collapse bands may not overlap",[...A,"collapse"]);S.push(b);}});}var bt=z.enum(Ae),xt=z.enum([...ae.logo,...ae.halftone]),Et=e=>Math.ceil(e/3)*4,gt=z.object({width:z.number().int().min(1).max(j),height:z.number().int().min(1).max(j),data:z.string().max(Et(j*j*4))}).refine(e=>e.data.length===Et(e.width*e.height*4),{message:"Art image data does not match its width and height"}),et=z.object({mode:bt,image:gt,intensity:z.number().min(0).max(1).optional(),variant:xt.optional(),matchEyes:z.boolean().optional()});var vo=z.enum(["solid","linear","radial","angular","image"]),At=z.object({type:z.literal("solid"),color:z.string()}),pe=z.object({color:z.string(),offset:z.number().min(0).max(100)}),_t=z.object({type:z.literal("linear"),stops:z.array(pe).min(2),angle:z.number().optional().default(0)}),Rt=z.object({type:z.literal("radial"),stops:z.array(pe).min(2)}),Tt=z.object({type:z.literal("angular"),stops:z.array(pe).min(2),angle:z.number().optional().default(0)}),Mt=z.enum(["cover","contain","tile"]),Ct=z.enum(["top-left","top","top-right","left","center","right","bottom-left","bottom","bottom-right"]),Ot=z.object({type:z.literal("image"),src:z.string().min(1),fit:Mt.optional().default("cover"),scale:z.number().min(.1).max(4).optional().default(1),position:Ct.optional().default("center"),opacity:z.number().min(0).max(1).optional().default(1),underlay:z.string().optional()}),U=z.union([z.string(),At,_t,Rt,Tt,Ot]);var zo=z.object({x:z.number(),y:z.number(),w:z.number(),h:z.number()});var Pt=e=>k(Oe,e),de=z.preprocess(Pt,z.enum([...ie,..._e])),Ho=z.preprocess(Pt,z.enum(ie));var Nt=e=>k(Ce,e),he=z.preprocess(Nt,z.enum([...se,...Re])),Uo=z.preprocess(Nt,z.enum(se));var It=z.enum(Pe),ye=z.object({style:It,text:z.string().max(v).optional(),color:z.string().optional(),textColor:z.string().optional(),secondaryText:z.string().max(v).optional(),secondaryColor:z.string().optional(),fontScale:z.number().min(Ne).max(V).optional()});var M=z.number().min(-P.maxCoordinate).max(P.maxCoordinate).refine(le,{message:`Numbers may have at most ${P.maxDecimals} decimals`}),I=M.refine(e=>e>0,{message:"Must be greater than 0"}),Se=M.refine(e=>e>=0,{message:"Must not be negative"}),ee=z.string().regex(/^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/,"Use a #rgb or #rrggbb color"),Lt=z.union([z.enum(Ke),ee]),Dt=e=>z.object({mix:z.tuple([e,e]),amount:z.number().min(0).max(1).refine(le)}).strict(),Y=z.union([Lt,Dt(Lt)]),Go=z.union([ee,Dt(z.union([z.enum(["frame","accent","background"]),ee]))]),B=z.union([Y,z.object({gradient:z.object({from:Y,to:Y,direction:z.enum(["horizontal","vertical"]).optional(),steps:z.int().min(2).max(P.maxGradientSteps).optional()}).strict()}).strict()]),tt={x:M,y:M,width:I,height:I},te=z.object({color:Y,width:I}).strict(),Bo=z.object({type:z.literal("rect"),...tt,radius:Se.optional(),fill:B,hole:z.object({...tt,radius:Se.optional()}).strict().optional(),stroke:te.optional()}).strict(),ko=z.object({type:z.literal("circle"),cx:M,cy:M,r:I,hole:I.optional(),fill:B,stroke:te.optional()}).strict(),Yo=z.object({type:z.literal("ellipse"),cx:M,cy:M,rx:I,ry:I,fill:B,stroke:te.optional()}).strict(),Qo=z.object({type:z.literal("polygon"),points:z.array(z.tuple([M,M])).min(3).max(P.maxPolygonPoints),fill:B,stroke:te.optional()}).strict(),qo=z.object({type:z.literal("path"),d:z.string().min(2).max(P.maxPathLength),fill:B,fillRule:z.enum(["nonzero","evenodd"]).optional(),stroke:te.optional()}).strict(),Xo=z.object({type:z.literal("line"),x1:M,y1:M,x2:M,y2:M,width:I,cap:z.enum(["butt","round"]).optional(),dash:z.tuple([I,I]).optional(),fill:B}).strict(),Wo=z.object({type:z.literal("icon"),icon:z.enum($e),x:M,y:M,size:I,fill:B}).strict(),wt=z.discriminatedUnion("type",[Bo,ko,Yo,Qo,qo,Xo,Wo]),vt={id:z.string().regex(/^[a-z][a-z0-9-]{0,31}$/),slot:z.enum(["primary","secondary","fixed"]),text:z.string().max(200),maxLength:z.int().min(1).max(v).optional(),color:Y,weight:z.enum(["bold","regular"]).optional(),collapse:z.object({y:M,height:I}).strict().optional()},jo=z.object({type:z.literal("text"),...vt,box:z.object(tt).strict(),align:z.enum(["start","middle","end"]).optional(),fontSize:I.optional()}).strict(),Vo=z.object({type:z.literal("curved"),...vt,curve:z.object({cx:M,cy:M,radius:I,side:z.enum(["top","bottom"]),spread:z.number().min(20).max(300).refine(le).optional()}).strict(),fontSize:I}).strict(),zt=z.discriminatedUnion("type",[jo,Vo]),Ft=M.refine(e=>e>=P.minArtboard&&e<=P.maxArtboard,{message:`Artboard sides must be ${P.minArtboard} to ${P.maxArtboard} units`}),$o=z.object({kind:z.literal(We),version:z.literal(je),artboard:z.object({width:Ft,height:Ft}).strict(),qr:z.object({x:M,y:M,size:I,padding:Se.optional(),radius:Se.optional(),plate:z.enum(["opaque","background","none"]).optional()}).strict(),colors:z.object({frame:ee,text:Go.optional(),accent:ee.optional()}).strict(),shapes:z.array(wt).max(P.maxShapes),labels:z.array(zt).max(P.maxLabels),bleed:z.union([z.literal("none"),Y]).optional()}).strict(),ot=$o.superRefine((e,n)=>St(e,(i,l=[])=>n.addIssue({code:"custom",message:i,path:l})));function Zo(e){let n=ot.safeParse(e);return n.success?[]:n.error.issues.map(i=>i.path.length>0?`${i.path.join(".")}: ${i.message}`:i.message)}var Ht=ye.extend({style:z.literal(Ve),spec:ot}),rt=z.discriminatedUnion("style",[ye,Ht]);var nt=z.preprocess(e=>k(Me,e),z.enum(Te));var at=z.enum(Ie),Gt=z.object({src:z.string(),height:z.number(),width:z.number(),excavate:z.boolean(),x:z.number().optional(),y:z.number().optional(),padding:z.number().min(0).optional(),shape:at.optional(),plate:z.string().optional()}),Ko=z.object({size:z.number().min(Le).max(Fe).optional(),padding:z.number().min(0).max(De).optional(),x:z.number().min(0).max(1).optional(),y:z.number().min(0).max(1).optional(),shape:at.optional(),plate:z.string().optional()}),Bt=z.enum(["L","M","Q","H"]),kt=z.enum(ze),Yt=z.object({type:z.literal("silhouette"),width:z.number().int().min(ce).max($),height:z.number().int().min(ce).max($),cells:z.string().max($*$).regex(/^[01]*$/).describe('Row by row, "1" inside the shape and "0" outside: width \xD7 height characters')}).refine(e=>e.cells.length===e.width*e.height,{message:"Silhouette cells do not match its width and height"}),Qt=z.union([kt,Yt]),Ee=z.object({outer:U.optional(),inner:U.optional()}),qt=z.object({topLeft:Ee.optional(),topRight:Ee.optional(),bottomLeft:Ee.optional()}),be=z.object({outer:he.optional(),inner:de.optional()}),Xt=z.object({topLeft:be.optional(),topRight:be.optional(),bottomLeft:be.optional()}),Wt=z.enum(Ye),jt=z.object({color:z.string().optional(),width:z.number().min(Ue).max(Ge).optional()}),Vt=z.object({color:z.string().optional(),opacity:z.number().min(Be).max(ke).optional(),dx:z.number().min(-Z).max(Z).optional(),dy:z.number().min(-Z).max(Z).optional()}),Jo=z.object({value:z.string(),size:z.number().optional(),level:Bt.optional(),bgColor:U.optional(),fgColor:U.optional(),eyeColor:U.optional(),dotColor:U.optional(),bodyPattern:nt.optional(),cornerEyePattern:he.optional(),cornerEyeDotPattern:de.optional(),margin:z.number().optional(),imageSettings:Gt.optional(),isOGContext:z.boolean().optional(),templateId:z.string().optional(),customProps:z.record(z.string(),z.any()).optional(),frame:rt.optional(),art:et.optional(),eyeColors:qt.optional(),moduleScale:z.number().min(we).max(ve).optional(),autoLevel:z.boolean().optional(),shape:Qt.optional(),eyeShapes:Xt.optional(),eyeGradient:Wt.optional(),bgRadius:z.number().min(0).max(He).optional(),backdrop:z.string().optional(),halo:jt.optional(),shadow:Vt.optional()});var er=z.object({fgColor:z.string().optional(),bgColor:z.string().optional()}),tr=z.object({pixelSize:z.number(),url:z.string()}),or=z.object({id:z.string(),name:z.string(),description:z.string().optional()});/**
2
2
  * @license QR Code generator library (TypeScript)
3
3
  * Copyright (c) Project Nayuki.
4
4
  * SPDX-License-Identifier: MIT
5
- */export{oo as AUTO_LEVEL_LOGO_COVERAGE,Ne as BG_RADIUS_MAX,io as BG_RADIUS_QUIET_RATIO,Ae as BODY_PATTERN,ae as CORNER_EYE_DOT_PATTERNS,ie as CORNER_EYE_PATTERNS,Qe as CUSTOM_FRAME_STYLE,eo as DEFAULT_FRAME_TEXT,Vt as DEFAULT_MARGIN,ze as EYE_GRADIENT_SPANS,ao as EYE_POSITIONS,Xe as FRAME_COLOR_TOKENS,V as FRAME_FONT_SCALE_MAX,Me as FRAME_FONT_SCALE_MIN,Ye as FRAME_ICONS,lt as FRAME_ICON_MAX_SEGMENTS,Be as FRAME_SPEC_KIND,qe as FRAME_SPEC_LABEL_MAX_FONT,P as FRAME_SPEC_LIMITS,ke as FRAME_SPEC_VERSION,_e as FRAME_STYLES,w as FRAME_TEXT_MAX_LENGTH,co as HALO_COLOR_DEFAULT,lo as HALO_LIGHT_MIN,so as HALO_WIDTH_DEFAULT,De as HALO_WIDTH_MAX,Fe as HALO_WIDTH_MIN,Oe as LOGO_PADDING_MAX,Re as LOGO_SHAPES,to as LOGO_SIZE_DEFAULT,Ce as LOGO_SIZE_MAX,Te as LOGO_SIZE_MIN,Le as MODULE_SCALE_MAX,Pe as MODULE_SCALE_MIN,j as QR_ART_MAX_SAMPLE_SIZE,xe as QR_ART_MODES,ne as QR_ART_VARIANTS,ro as QR_CIRCLE_QUIET_MIN,Ie as QR_SHAPES,W as QR_SILHOUETTE_MAX_CELLS,se as QR_SILHOUETTE_MIN_CELLS,no as QR_SILHOUETTE_MIN_SHARE,be as RETIRED_CORNER_EYE_DOT_PATTERNS,ge as RETIRED_CORNER_EYE_PATTERNS,uo as SHADOW_COLOR_DEFAULT,mo as SHADOW_OFFSET_DEFAULT,$ as SHADOW_OFFSET_MAX,po as SHADOW_OPACITY_DEFAULT,we as SHADOW_OPACITY_MAX,ve as SHADOW_OPACITY_MIN,xt as angularGradientSchema,Ze as anyFrameSchema,Vo as baseTemplatePropsSchema,Ke as bodyPatternSchema,G as colorConfigSchema,Po as colorTypeSchema,pe as cornerEyeDotPatternSchema,ue as cornerEyePatternSchema,Nt as customFrameSchema,Dt as errorLevelSchema,Lo as excavationSchema,he as eyeColorOverrideSchema,Ut as eyeColorsSchema,Ht as eyeGradientSpanSchema,ye as eyeShapeOverrideSchema,Gt as eyeShapesSchema,de as frameSchema,k as frameSpecColorSchema,It as frameSpecLabelSchema,je as frameSpecPadding,B as frameSpecPaintSchema,le as frameSpecQrZone,$e as frameSpecSchema,Pt as frameSpecShapeSchema,Rt as frameStyleSchema,Kt as getColorString,Yo as getFrameSpecIssues,Jt as getNormalizedColor,Wt as getSolidColor,me as gradientStopSchema,Bt as haloSchema,bt as imageFitSchema,At as imagePaintSchema,tt as imagePositionCss,gt as imagePositionSchema,Ft as imageSettingsSchema,$t as isGradient,Zt as isImagePaint,xo as isLatin1Text,St as linearGradientSchema,Xo as logoOptionsSchema,Je as logoShapeSchema,Ee as normalizeColorConfig,Io as pickableCornerEyeDotPatternSchema,No as pickableCornerEyePatternSchema,ht as qrArtImageSchema,dt as qrArtModeSchema,Ve as qrArtSchema,ft as qrArtVariantSchema,zt as qrCodeShapeSchema,jo as qrPropsSchema,vt as qrShapeSchema,wt as qrSilhouetteSchema,Et as radialGradientSchema,mt as sanitizeFrameText,kt as shadowSchema,yt as solidColorSchema,Wo as templateConfigSchema,$o as templateDefinitionBaseSchema};//# sourceMappingURL=index.mjs.map
5
+ */export{lo as AUTO_LEVEL_LOGO_COVERAGE,He as BG_RADIUS_MAX,fo as BG_RADIUS_QUIET_RATIO,Te as BODY_PATTERN,ie as CORNER_EYE_DOT_PATTERNS,se as CORNER_EYE_PATTERNS,Ve as CUSTOM_FRAME_STYLE,so as DEFAULT_FRAME_TEXT,to as DEFAULT_MARGIN,Ye as EYE_GRADIENT_SPANS,uo as EYE_POSITIONS,Ke as FRAME_COLOR_TOKENS,V as FRAME_FONT_SCALE_MAX,Ne as FRAME_FONT_SCALE_MIN,$e as FRAME_ICONS,ht as FRAME_ICON_MAX_SEGMENTS,We as FRAME_SPEC_KIND,Ze as FRAME_SPEC_LABEL_MAX_FONT,P as FRAME_SPEC_LIMITS,je as FRAME_SPEC_VERSION,Pe as FRAME_STYLES,v as FRAME_TEXT_MAX_LENGTH,yo as HALO_COLOR_DEFAULT,So as HALO_LIGHT_MIN,ho as HALO_WIDTH_DEFAULT,Ge as HALO_WIDTH_MAX,Ue as HALO_WIDTH_MIN,De as LOGO_PADDING_MAX,Ie as LOGO_SHAPES,co as LOGO_SIZE_DEFAULT,Fe as LOGO_SIZE_MAX,Le as LOGO_SIZE_MIN,ve as MODULE_SCALE_MAX,we as MODULE_SCALE_MIN,j as QR_ART_MAX_SAMPLE_SIZE,Ae as QR_ART_MODES,ae as QR_ART_VARIANTS,mo as QR_CIRCLE_QUIET_MIN,ze as QR_SHAPES,$ as QR_SILHOUETTE_MAX_CELLS,ce as QR_SILHOUETTE_MIN_CELLS,po as QR_SILHOUETTE_MIN_SHARE,_e as RETIRED_CORNER_EYE_DOT_PATTERNS,Re as RETIRED_CORNER_EYE_PATTERNS,xo as SHADOW_COLOR_DEFAULT,Eo as SHADOW_OFFSET_DEFAULT,Z as SHADOW_OFFSET_MAX,bo as SHADOW_OPACITY_DEFAULT,ke as SHADOW_OPACITY_MAX,Be as SHADOW_OPACITY_MIN,Me as WITHDRAWN_BODY_PATTERNS,Oe as WITHDRAWN_CORNER_EYE_DOT_PATTERNS,Ce as WITHDRAWN_CORNER_EYE_PATTERNS,Tt as angularGradientSchema,rt as anyFrameSchema,er as baseTemplatePropsSchema,nt as bodyPatternSchema,U as colorConfigSchema,vo as colorTypeSchema,de as cornerEyeDotPatternSchema,he as cornerEyePatternSchema,Ht as customFrameSchema,Bt as errorLevelSchema,zo as excavationSchema,Ee as eyeColorOverrideSchema,qt as eyeColorsSchema,Wt as eyeGradientSpanSchema,be as eyeShapeOverrideSchema,Xt as eyeShapesSchema,ye as frameSchema,Y as frameSpecColorSchema,zt as frameSpecLabelSchema,Je as frameSpecPadding,B as frameSpecPaintSchema,me as frameSpecQrZone,ot as frameSpecSchema,wt as frameSpecShapeSchema,It as frameStyleSchema,ao as getColorString,Zo as getFrameSpecIssues,io as getNormalizedColor,oo as getSolidColor,pe as gradientStopSchema,jt as haloSchema,Mt as imageFitSchema,Ot as imagePaintSchema,st as imagePositionCss,Ct as imagePositionSchema,Gt as imageSettingsSchema,ro as isGradient,no as isImagePaint,Mo as isLatin1Text,_t as linearGradientSchema,Ko as logoOptionsSchema,at as logoShapeSchema,ge as normalizeColorConfig,Ho as pickableCornerEyeDotPatternSchema,Uo as pickableCornerEyePatternSchema,gt as qrArtImageSchema,bt as qrArtModeSchema,et as qrArtSchema,xt as qrArtVariantSchema,Qt as qrCodeShapeSchema,Jo as qrPropsSchema,kt as qrShapeSchema,Yt as qrSilhouetteSchema,Rt as radialGradientSchema,yt as sanitizeFrameText,Vt as shadowSchema,At as solidColorSchema,tr as templateConfigSchema,or as templateDefinitionBaseSchema,k as withdrawnFallback};//# sourceMappingURL=index.mjs.map
6
6
  //# sourceMappingURL=index.mjs.map