qrdx 0.0.52 → 0.0.54

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 (63) hide show
  1. package/dist/core.js +7 -7
  2. package/dist/core.js.map +1 -1
  3. package/dist/core.mjs +7 -7
  4. package/dist/core.mjs.map +1 -1
  5. package/dist/element.browser.mjs +17 -17
  6. package/dist/element.browser.mjs.map +1 -1
  7. package/dist/index.js +7 -7
  8. package/dist/index.js.map +1 -1
  9. package/dist/index.mjs +7 -7
  10. package/dist/index.mjs.map +1 -1
  11. package/dist/qr-code-canvas.js +1 -1
  12. package/dist/qr-code-canvas.js.map +1 -1
  13. package/dist/qr-code-canvas.mjs +1 -1
  14. package/dist/qr-code-canvas.mjs.map +1 -1
  15. package/dist/src/frame-spec.d.ts.map +1 -1
  16. package/dist/src/frame.d.ts +13 -3
  17. package/dist/src/frame.d.ts.map +1 -1
  18. package/dist/src/template/arrow.d.ts +0 -1
  19. package/dist/src/template/arrow.d.ts.map +1 -1
  20. package/dist/src/template/frame-template.d.ts +19 -0
  21. package/dist/src/template/frame-template.d.ts.map +1 -0
  22. package/dist/src/template/halloween.d.ts +0 -1
  23. package/dist/src/template/halloween.d.ts.map +1 -1
  24. package/dist/src/template/square-border.d.ts +0 -1
  25. package/dist/src/template/square-border.d.ts.map +1 -1
  26. package/dist/src/template/standard-box.d.ts +0 -1
  27. package/dist/src/template/standard-box.d.ts.map +1 -1
  28. package/dist/src/template/striked-box.d.ts +0 -1
  29. package/dist/src/template/striked-box.d.ts.map +1 -1
  30. package/dist/types/frame-spec.d.ts +554 -0
  31. package/dist/types/frame-spec.d.ts.map +1 -1
  32. package/dist/types/index.js +2 -2
  33. package/dist/types/index.js.map +1 -1
  34. package/dist/types/index.mjs +2 -2
  35. package/dist/types/index.mjs.map +1 -1
  36. package/dist/types/qr.d.ts +111 -0
  37. package/dist/types/qr.d.ts.map +1 -1
  38. package/dist/types/template.d.ts +7 -0
  39. package/dist/types/template.d.ts.map +1 -1
  40. package/dist/vanilla.browser.mjs +15 -15
  41. package/dist/vanilla.browser.mjs.map +1 -1
  42. package/package.json +3 -3
  43. package/src/frame-spec.ts +17 -2
  44. package/src/frame.tsx +57 -7
  45. package/src/rasterize.ts +1 -1
  46. package/src/template/arrow.ts +14 -0
  47. package/src/template/frame-template.tsx +70 -0
  48. package/src/template/halloween.ts +14 -0
  49. package/src/template/specs/arrow.json +26 -0
  50. package/src/template/specs/halloween.json +144 -0
  51. package/src/template/specs/square-border.json +27 -0
  52. package/src/template/specs/standard-box.json +31 -0
  53. package/src/template/specs/striked-box.json +56 -0
  54. package/src/template/square-border.ts +14 -0
  55. package/src/template/standard-box.ts +14 -0
  56. package/src/template/striked-box.ts +14 -0
  57. package/types/frame-spec.ts +67 -4
  58. package/types/template.ts +7 -0
  59. package/src/template/arrow.tsx +0 -40
  60. package/src/template/halloween.tsx +0 -147
  61. package/src/template/square-border.tsx +0 -43
  62. package/src/template/standard-box.tsx +0 -43
  63. package/src/template/striked-box.tsx +0 -42
@@ -1,9 +1,9 @@
1
- var cb=Object.defineProperty;var kt=(e,t)=>{for(var r in t)cb(e,r,{get:t[r],enumerable:true});};var Dr;(i=>{class e{constructor(a,c,u,l){this.version=a;this.errorCorrectionLevel=c;if(a<e.MIN_VERSION||a>e.MAX_VERSION)throw new RangeError("Version value out of range");if(l<-1||l>7)throw new RangeError("Mask value out of range");this.size=a*4+17;let f=[];for(let m=0;m<this.size;m++)f.push(false);for(let m=0;m<this.size;m++)this.modules.push(f.slice()),this.isFunction.push(f.slice());this.drawFunctionPatterns();let p=this.addEccAndInterleave(u);if(this.drawCodewords(p),l==-1){let m=1e9;for(let h=0;h<8;h++){this.applyMask(h),this.drawFormatBits(h);let d=this.getPenaltyScore();d<m&&(l=h,m=d),this.applyMask(h);}}n(0<=l&&l<=7),this.mask=l,this.applyMask(l),this.drawFormatBits(l),this.isFunction=[];}version;errorCorrectionLevel;static encodeText(a,c){let u=i.QrSegment.makeSegments(a);return e.encodeSegments(u,c)}static encodeBinary(a,c){let u=i.QrSegment.makeBytes(a);return e.encodeSegments([u],c)}static encodeSegments(a,c,u=1,l=40,f=-1,p=true){if(!(e.MIN_VERSION<=u&&u<=l&&l<=e.MAX_VERSION)||f<-1||f>7)throw new RangeError("Invalid value");let m,h;for(m=u;;m++){let _=e.getNumDataCodewords(m,c)*8,b=o.getTotalBits(a,m);if(b<=_){h=b;break}if(m>=l)throw new RangeError("Data too long")}for(let _ of [e.Ecc.MEDIUM,e.Ecc.QUARTILE,e.Ecc.HIGH])p&&h<=e.getNumDataCodewords(m,_)*8&&(c=_);let d=[];for(let _ of a){t(_.mode.modeBits,4,d),t(_.numChars,_.mode.numCharCountBits(m),d);for(let b of _.getData())d.push(b);}n(d.length==h);let g=e.getNumDataCodewords(m,c)*8;n(d.length<=g),t(0,Math.min(4,g-d.length),d),t(0,(8-d.length%8)%8,d),n(d.length%8==0);for(let _=236;d.length<g;_^=253)t(_,8,d);let y=[];for(;y.length*8<d.length;)y.push(0);return d.forEach((_,b)=>y[b>>>3]|=_<<7-(b&7)),new e(m,c,y,f)}size;mask;modules=[];isFunction=[];getModule(a,c){return 0<=a&&a<this.size&&0<=c&&c<this.size&&this.modules[c][a]}getModules(){return this.modules}drawFunctionPatterns(){for(let u=0;u<this.size;u++)this.setFunctionModule(6,u,u%2==0),this.setFunctionModule(u,6,u%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);let a=this.getAlignmentPatternPositions(),c=a.length;for(let u=0;u<c;u++)for(let l=0;l<c;l++)u==0&&l==0||u==0&&l==c-1||u==c-1&&l==0||this.drawAlignmentPattern(a[u],a[l]);this.drawFormatBits(0),this.drawVersion();}drawFormatBits(a){let c=this.errorCorrectionLevel.formatBits<<3|a,u=c;for(let f=0;f<10;f++)u=u<<1^(u>>>9)*1335;let l=(c<<10|u)^21522;n(l>>>15==0);for(let f=0;f<=5;f++)this.setFunctionModule(8,f,r(l,f));this.setFunctionModule(8,7,r(l,6)),this.setFunctionModule(8,8,r(l,7)),this.setFunctionModule(7,8,r(l,8));for(let f=9;f<15;f++)this.setFunctionModule(14-f,8,r(l,f));for(let f=0;f<8;f++)this.setFunctionModule(this.size-1-f,8,r(l,f));for(let f=8;f<15;f++)this.setFunctionModule(8,this.size-15+f,r(l,f));this.setFunctionModule(8,this.size-8,true);}drawVersion(){if(this.version<7)return;let a=this.version;for(let u=0;u<12;u++)a=a<<1^(a>>>11)*7973;let c=this.version<<12|a;n(c>>>18==0);for(let u=0;u<18;u++){let l=r(c,u),f=this.size-11+u%3,p=Math.floor(u/3);this.setFunctionModule(f,p,l),this.setFunctionModule(p,f,l);}}drawFinderPattern(a,c){for(let u=-4;u<=4;u++)for(let l=-4;l<=4;l++){let f=Math.max(Math.abs(l),Math.abs(u)),p=a+l,m=c+u;0<=p&&p<this.size&&0<=m&&m<this.size&&this.setFunctionModule(p,m,f!=2&&f!=4);}}drawAlignmentPattern(a,c){for(let u=-2;u<=2;u++)for(let l=-2;l<=2;l++)this.setFunctionModule(a+l,c+u,Math.max(Math.abs(l),Math.abs(u))!=1);}setFunctionModule(a,c,u){this.modules[c][a]=u,this.isFunction[c][a]=true;}addEccAndInterleave(a){let c=this.version,u=this.errorCorrectionLevel;if(a.length!=e.getNumDataCodewords(c,u))throw new RangeError("Invalid argument");let l=e.NUM_ERROR_CORRECTION_BLOCKS[u.ordinal][c],f=e.ECC_CODEWORDS_PER_BLOCK[u.ordinal][c],p=Math.floor(e.getNumRawDataModules(c)/8),m=l-p%l,h=Math.floor(p/l),d=[],g=e.reedSolomonComputeDivisor(f);for(let _=0,b=0;_<l;_++){let v=a.slice(b,b+h-f+(_<m?0:1));b+=v.length;let C=e.reedSolomonComputeRemainder(v,g);_<m&&v.push(0),d.push(v.concat(C));}let y=[];for(let _=0;_<d[0].length;_++)d.forEach((b,v)=>{(_!=h-f||v>=m)&&y.push(b[_]);});return n(y.length==p),y}drawCodewords(a){if(a.length!=Math.floor(e.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let c=0;for(let u=this.size-1;u>=1;u-=2){u==6&&(u=5);for(let l=0;l<this.size;l++)for(let f=0;f<2;f++){let p=u-f,h=(u+1&2)==0?this.size-1-l:l;!this.isFunction[h][p]&&c<a.length*8&&(this.modules[h][p]=r(a[c>>>3],7-(c&7)),c++);}}n(c==a.length*8);}applyMask(a){if(a<0||a>7)throw new RangeError("Mask value out of range");for(let c=0;c<this.size;c++)for(let u=0;u<this.size;u++){let l;switch(a){case 0:l=(u+c)%2==0;break;case 1:l=c%2==0;break;case 2:l=u%3==0;break;case 3:l=(u+c)%3==0;break;case 4:l=(Math.floor(u/3)+Math.floor(c/2))%2==0;break;case 5:l=u*c%2+u*c%3==0;break;case 6:l=(u*c%2+u*c%3)%2==0;break;case 7:l=((u+c)%2+u*c%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[c][u]&&l&&(this.modules[c][u]=!this.modules[c][u]);}}getPenaltyScore(){let a=0;for(let f=0;f<this.size;f++){let p=false,m=0,h=[0,0,0,0,0,0,0];for(let d=0;d<this.size;d++)this.modules[f][d]==p?(m++,m==5?a+=e.PENALTY_N1:m>5&&a++):(this.finderPenaltyAddHistory(m,h),p||(a+=this.finderPenaltyCountPatterns(h)*e.PENALTY_N3),p=this.modules[f][d],m=1);a+=this.finderPenaltyTerminateAndCount(p,m,h)*e.PENALTY_N3;}for(let f=0;f<this.size;f++){let p=false,m=0,h=[0,0,0,0,0,0,0];for(let d=0;d<this.size;d++)this.modules[d][f]==p?(m++,m==5?a+=e.PENALTY_N1:m>5&&a++):(this.finderPenaltyAddHistory(m,h),p||(a+=this.finderPenaltyCountPatterns(h)*e.PENALTY_N3),p=this.modules[d][f],m=1);a+=this.finderPenaltyTerminateAndCount(p,m,h)*e.PENALTY_N3;}for(let f=0;f<this.size-1;f++)for(let p=0;p<this.size-1;p++){let m=this.modules[f][p];m==this.modules[f][p+1]&&m==this.modules[f+1][p]&&m==this.modules[f+1][p+1]&&(a+=e.PENALTY_N2);}let c=0;for(let f of this.modules)c=f.reduce((p,m)=>p+(m?1:0),c);let u=this.size*this.size,l=Math.ceil(Math.abs(c*20-u*10)/u)-1;return n(0<=l&&l<=9),a+=l*e.PENALTY_N4,n(0<=a&&a<=2568888),a}getAlignmentPatternPositions(){if(this.version==1)return [];{let a=Math.floor(this.version/7)+2,c=this.version==32?26:Math.ceil((this.version*4+4)/(a*2-2))*2,u=[6];for(let l=this.size-7;u.length<a;l-=c)u.splice(1,0,l);return u}}static getNumRawDataModules(a){if(a<e.MIN_VERSION||a>e.MAX_VERSION)throw new RangeError("Version number out of range");let c=(16*a+128)*a+64;if(a>=2){let u=Math.floor(a/7)+2;c-=(25*u-10)*u-55,a>=7&&(c-=36);}return n(208<=c&&c<=29648),c}static getNumDataCodewords(a,c){return Math.floor(e.getNumRawDataModules(a)/8)-e.ECC_CODEWORDS_PER_BLOCK[c.ordinal][a]*e.NUM_ERROR_CORRECTION_BLOCKS[c.ordinal][a]}static reedSolomonComputeDivisor(a){if(a<1||a>255)throw new RangeError("Degree out of range");let c=[];for(let l=0;l<a-1;l++)c.push(0);c.push(1);let u=1;for(let l=0;l<a;l++){for(let f=0;f<c.length;f++)c[f]=e.reedSolomonMultiply(c[f],u),f+1<c.length&&(c[f]^=c[f+1]);u=e.reedSolomonMultiply(u,2);}return c}static reedSolomonComputeRemainder(a,c){let u=c.map(l=>0);for(let l of a){let f=l^u.shift();u.push(0),c.forEach((p,m)=>u[m]^=e.reedSolomonMultiply(p,f));}return u}static reedSolomonMultiply(a,c){if(a>>>8||c>>>8)throw new RangeError("Byte out of range");let u=0;for(let l=7;l>=0;l--)u=u<<1^(u>>>7)*285,u^=(c>>>l&1)*a;return n(u>>>8==0),u}finderPenaltyCountPatterns(a){let c=a[1];n(c<=this.size*3);let u=c>0&&a[2]==c&&a[3]==c*3&&a[4]==c&&a[5]==c;return (u&&a[0]>=c*4&&a[6]>=c?1:0)+(u&&a[6]>=c*4&&a[0]>=c?1:0)}finderPenaltyTerminateAndCount(a,c,u){return a&&(this.finderPenaltyAddHistory(c,u),c=0),c+=this.size,this.finderPenaltyAddHistory(c,u),this.finderPenaltyCountPatterns(u)}finderPenaltyAddHistory(a,c){c[0]==0&&(a+=this.size),c.pop(),c.unshift(a);}static MIN_VERSION=1;static MAX_VERSION=40;static PENALTY_N1=3;static PENALTY_N2=3;static PENALTY_N3=40;static PENALTY_N4=10;static ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]];static NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]]}i.QrCode=e;function t(s,a,c){if(a<0||a>31||s>>>a)throw new RangeError("Value out of range");for(let u=a-1;u>=0;u--)c.push(s>>>u&1);}function r(s,a){return (s>>>a&1)!=0}function n(s){if(!s)throw new Error("Assertion error")}class o{constructor(a,c,u){this.mode=a;this.numChars=c;this.bitData=u;if(c<0)throw new RangeError("Invalid argument");this.bitData=u.slice();}mode;numChars;bitData;static makeBytes(a){let c=[];for(let u of a)t(u,8,c);return new o(o.Mode.BYTE,a.length,c)}static makeNumeric(a){if(!o.isNumeric(a))throw new RangeError("String contains non-numeric characters");let c=[];for(let u=0;u<a.length;){let l=Math.min(a.length-u,3);t(parseInt(a.substr(u,l),10),l*3+1,c),u+=l;}return new o(o.Mode.NUMERIC,a.length,c)}static makeAlphanumeric(a){if(!o.isAlphanumeric(a))throw new RangeError("String contains unencodable characters in alphanumeric mode");let c=[],u;for(u=0;u+2<=a.length;u+=2){let l=o.ALPHANUMERIC_CHARSET.indexOf(a.charAt(u))*45;l+=o.ALPHANUMERIC_CHARSET.indexOf(a.charAt(u+1)),t(l,11,c);}return u<a.length&&t(o.ALPHANUMERIC_CHARSET.indexOf(a.charAt(u)),6,c),new o(o.Mode.ALPHANUMERIC,a.length,c)}static makeSegments(a){return a==""?[]:o.isNumeric(a)?[o.makeNumeric(a)]:o.isAlphanumeric(a)?[o.makeAlphanumeric(a)]:[o.makeBytes(o.toUtf8ByteArray(a))]}static makeEci(a){let c=[];if(a<0)throw new RangeError("ECI assignment value out of range");if(a<128)t(a,8,c);else if(a<16384)t(2,2,c),t(a,14,c);else if(a<1e6)t(6,3,c),t(a,21,c);else throw new RangeError("ECI assignment value out of range");return new o(o.Mode.ECI,0,c)}static isNumeric(a){return o.NUMERIC_REGEX.test(a)}static isAlphanumeric(a){return o.ALPHANUMERIC_REGEX.test(a)}getData(){return this.bitData.slice()}static getTotalBits(a,c){let u=0;for(let l of a){let f=l.mode.numCharCountBits(c);if(l.numChars>=1<<f)return 1/0;u+=4+f+l.bitData.length;}return u}static toUtf8ByteArray(a){a=encodeURI(a);let c=[];for(let u=0;u<a.length;u++)a.charAt(u)!="%"?c.push(a.charCodeAt(u)):(c.push(parseInt(a.substr(u+1,2),16)),u+=2);return c}static NUMERIC_REGEX=/^[0-9]*$/;static ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/;static ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:"}i.QrSegment=o;})(Dr||={});(t=>{(n=>{class r{constructor(i,s){this.ordinal=i;this.formatBits=s;}ordinal;formatBits;static LOW=new r(0,1);static MEDIUM=new r(1,0);static QUARTILE=new r(2,3);static HIGH=new r(3,2)}n.Ecc=r;})(t.QrCode||={});})(Dr||={});(t=>{(n=>{class r{constructor(i,s){this.modeBits=i;this.numBitsCharCount=s;}modeBits;numBitsCharCount;static NUMERIC=new r(1,[10,12,14]);static ALPHANUMERIC=new r(2,[9,11,13]);static BYTE=new r(4,[8,16,16]);static KANJI=new r(8,[8,10,12]);static ECI=new r(7,[0,0,0]);numCharCountBits(i){return this.numBitsCharCount[Math.floor((i+7)/17)]}}n.Mode=r;})(t.QrSegment||={});})(Dr||={});var Qe=Dr;var ht={L:Qe.QrCode.Ecc.LOW,M:Qe.QrCode.Ecc.MEDIUM,Q:Qe.QrCode.Ecc.QUARTILE,H:Qe.QrCode.Ecc.HIGH},Je=128,Qn="Q",Ie="#FFFFFF",Zr="#000000";var Vn=0;var pi=.1;function Ve(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 k={};kt(k,{$brand:()=>Mc,$input:()=>nf,$output:()=>rf,INVALID:()=>Le,NEVER:()=>Rc,TimePrecision:()=>gf,ZodAny:()=>nm,ZodArray:()=>am,ZodBase64:()=>ca,ZodBase64URL:()=>ua,ZodBigInt:()=>Sn,ZodBigIntFormat:()=>pa,ZodBoolean:()=>vn,ZodCIDRv4:()=>sa,ZodCIDRv6:()=>aa,ZodCUID:()=>Ys,ZodCUID2:()=>ea,ZodCatch:()=>Am,ZodCodec:()=>Do,ZodCompileAsyncError:()=>it,ZodCompileUnsupportedError:()=>H,ZodCreditCard:()=>Hp,ZodCustom:()=>Zo,ZodCustomStringFormat:()=>lr,ZodDate:()=>zo,ZodDefault:()=>wm,ZodDiscriminatedUnion:()=>um,ZodE164:()=>la,ZodEmail:()=>Hs,ZodEmoji:()=>Js,ZodEnum:()=>$n,ZodError:()=>x3,ZodExactOptional:()=>ga,ZodFile:()=>ym,ZodFirstPartyTypeKind:()=>Um,ZodFunction:()=>Fm,ZodGUID:()=>Ks,ZodIBAN:()=>Kp,ZodIPv4:()=>oa,ZodIPv6:()=>ia,ZodISODate:()=>Ft,ZodISODateTime:()=>Tt,ZodISODuration:()=>Zt,ZodISOTime:()=>Dt,ZodInstanceOf:()=>Bm,ZodIntersection:()=>lm,ZodIssueCode:()=>S3,ZodJWT:()=>fa,ZodKSUID:()=>na,ZodLazy:()=>Lm,ZodLiteral:()=>_m,ZodMAC:()=>Wp,ZodMap:()=>hm,ZodNaN:()=>Rm,ZodNanoID:()=>Xs,ZodNever:()=>im,ZodNonOptional:()=>_a,ZodNull:()=>tm,ZodNullable:()=>xm,ZodNumber:()=>wn,ZodNumberFormat:()=>fr,ZodObject:()=>Lo,ZodOptional:()=>To,ZodPipe:()=>Fo,ZodPrefault:()=>Sm,ZodPreprocess:()=>Mm,ZodPromise:()=>Tm,ZodReadonly:()=>Im,ZodRealError:()=>Ke,ZodRecord:()=>bn,ZodSet:()=>gm,ZodString:()=>xn,ZodStringFormat:()=>ie,ZodSuccess:()=>km,ZodSymbol:()=>Yp,ZodTemplateLiteral:()=>Nm,ZodTransform:()=>bm,ZodTuple:()=>pm,ZodType:()=>j,ZodULID:()=>ta,ZodURL:()=>Io,ZodUUID:()=>dt,ZodUndefined:()=>em,ZodUnion:()=>Oo,ZodUnknown:()=>om,ZodVoid:()=>sm,ZodXID:()=>ra,ZodXor:()=>cm,_ZodString:()=>Ws,_default:()=>vm,_function:()=>H1,any:()=>P1,array:()=>No,base64:()=>s1,base64url:()=>a1,bigint:()=>x1,boolean:()=>Xp,catch:()=>Em,check:()=>K1,cidrv4:()=>o1,cidrv6:()=>i1,clone:()=>Y,codec:()=>V1,coerce:()=>Qm,compile:()=>cf,config:()=>de,core:()=>$t,creditCard:()=>u1,cuid:()=>K0,cuid2:()=>J0,currencyCode:()=>h1,custom:()=>J1,date:()=>A1,decode:()=>Bp,decodeAsync:()=>Gp,deepPartial:()=>lg,describe:()=>X1,discriminatedUnion:()=>N1,e164:()=>c1,email:()=>Z0,emoji:()=>W0,encode:()=>Zp,encodeAsync:()=>Up,endsWith:()=>cn,enum:()=>da,exactOptional:()=>$m,file:()=>B1,flattenError:()=>ro,float32:()=>_1,float64:()=>y1,formatError:()=>no,fromJSONSchema:()=>cg,function:()=>H1,getDiscriminatedOption:()=>Rl,getErrorMap:()=>P3,globalRegistry:()=>ke,gt:()=>pt,gte:()=>Ye,guid:()=>B0,hash:()=>g1,hex:()=>d1,hostname:()=>m1,httpUrl:()=>q0,iban:()=>l1,includes:()=>sn,input:()=>pg,instanceof:()=>eg,int:()=>js,int32:()=>b1,int64:()=>w1,intersection:()=>fm,invertCodec:()=>j1,ipv4:()=>t1,ipv6:()=>n1,iso:()=>Bo,json:()=>rg,jwt:()=>f1,keyof:()=>E1,ksuid:()=>e1,lazy:()=>Om,length:()=>ir,literal:()=>Z1,locales:()=>as,looseObject:()=>I1,looseRecord:()=>O1,lowercase:()=>nn,lt:()=>ft,lte:()=>Xe,mac:()=>r1,map:()=>T1,maxLength:()=>or,maxSize:()=>zt,memoizer:()=>wo,meta:()=>Y1,mime:()=>ln,minLength:()=>bt,minSize:()=>mt,multipleOf:()=>It,nan:()=>Q1,nanoid:()=>H0,nativeEnum:()=>D1,negative:()=>Ls,never:()=>ma,nonnegative:()=>Ts,nonoptional:()=>Pm,nonpositive:()=>Os,normalize:()=>fn,null:()=>rm,nullable:()=>Mo,nullish:()=>U1,number:()=>Jp,object:()=>R1,optional:()=>cr,output:()=>mg,overwrite:()=>st,parse:()=>Op,parseAsync:()=>Tp,partialRecord:()=>L1,pipe:()=>qs,positive:()=>Ns,prefault:()=>Cm,preprocess:()=>ng,prettifyError:()=>Oc,promise:()=>W1,properties:()=>un,property:()=>Fs,readonly:()=>zm,record:()=>dm,refine:()=>Dm,regex:()=>rn,regexes:()=>rt,registry:()=>us,safeDecode:()=>Vp,safeDecodeAsync:()=>qp,safeEncode:()=>Qp,safeEncodeAsync:()=>jp,safeParse:()=>Fp,safeParseAsync:()=>Dp,set:()=>F1,setErrorMap:()=>C3,size:()=>nr,slugify:()=>hn,startsWith:()=>an,strictObject:()=>M1,string:()=>Ro,stringFormat:()=>p1,stringbool:()=>tg,success:()=>G1,superRefine:()=>Zm,symbol:()=>S1,templateLiteral:()=>q1,toJSONSchema:()=>Us,toLowerCase:()=>mn,toUpperCase:()=>dn,toZod:()=>jn,transform:()=>ha,treeifyError:()=>Lc,trim:()=>pn,tuple:()=>mm,uint32:()=>$1,uint64:()=>v1,ulid:()=>X0,undefined:()=>C1,union:()=>Cn,unknown:()=>ar,uppercase:()=>on,url:()=>j0,util:()=>T,uuid:()=>U0,uuidv4:()=>G0,uuidv6:()=>Q0,uuidv7:()=>V0,validate:()=>oo,validateAsync:()=>io,void:()=>k1,withParser:()=>ls,xid:()=>Y0,xor:()=>z1});var $t={};kt($t,{$ZodAny:()=>xl,$ZodArray:()=>kl,$ZodAsyncError:()=>We,$ZodBase64:()=>ul,$ZodBase64URL:()=>ll,$ZodBigInt:()=>Ji,$ZodBigIntFormat:()=>_l,$ZodBoolean:()=>go,$ZodCIDRv4:()=>al,$ZodCIDRv6:()=>cl,$ZodCUID:()=>Hu,$ZodCUID2:()=>Ku,$ZodCatch:()=>jl,$ZodCheck:()=>ae,$ZodCheckBigIntFormat:()=>wu,$ZodCheckEndsWith:()=>Nu,$ZodCheckGreaterThan:()=>Li,$ZodCheckIncludes:()=>Iu,$ZodCheckLengthEquals:()=>Au,$ZodCheckLessThan:()=>Ni,$ZodCheckLowerCase:()=>Ru,$ZodCheckMaxLength:()=>Pu,$ZodCheckMaxSize:()=>vu,$ZodCheckMimeType:()=>Tu,$ZodCheckMinLength:()=>ku,$ZodCheckMinSize:()=>Su,$ZodCheckMultipleOf:()=>$u,$ZodCheckNumberFormat:()=>xu,$ZodCheckOverwrite:()=>Fu,$ZodCheckProperties:()=>Ou,$ZodCheckProperty:()=>Lu,$ZodCheckRegex:()=>Eu,$ZodCheckSizeEquals:()=>Cu,$ZodCheckStartsWith:()=>zu,$ZodCheckStringFormat:()=>Xr,$ZodCheckUpperCase:()=>Mu,$ZodCodec:()=>yo,$ZodCreditCard:()=>pl,$ZodCustom:()=>Yl,$ZodCustomStringFormat:()=>hl,$ZodCyclicError:()=>os,$ZodDate:()=>Cl,$ZodDefault:()=>Ul,$ZodDiscriminatedUnion:()=>Ml,$ZodE164:()=>fl,$ZodEmail:()=>Gu,$ZodEmoji:()=>qu,$ZodEncodeError:()=>Rt,$ZodEnum:()=>Ol,$ZodError:()=>Nc,$ZodExactOptional:()=>Zl,$ZodFile:()=>Fl,$ZodFunction:()=>Jl,$ZodGUID:()=>Bu,$ZodIBAN:()=>ml,$ZodIPv4:()=>ol,$ZodIPv6:()=>il,$ZodISODate:()=>tl,$ZodISODateTime:()=>el,$ZodISODuration:()=>nl,$ZodISOTime:()=>rl,$ZodIntersection:()=>Il,$ZodJWT:()=>dl,$ZodKSUID:()=>Yu,$ZodLazy:()=>bo,$ZodLiteral:()=>Tl,$ZodMAC:()=>sl,$ZodMap:()=>Nl,$ZodNaN:()=>ql,$ZodNanoID:()=>Wu,$ZodNever:()=>vl,$ZodNonOptional:()=>Ql,$ZodNull:()=>$l,$ZodNullable:()=>Bl,$ZodNumber:()=>Ki,$ZodNumberFormat:()=>gl,$ZodObject:()=>i0,$ZodObjectJIT:()=>Al,$ZodOptional:()=>Yi,$ZodPipe:()=>es,$ZodPrefault:()=>Gl,$ZodPreprocess:()=>Wl,$ZodPromise:()=>Xl,$ZodReadonly:()=>Hl,$ZodRealError:()=>He,$ZodRecord:()=>zl,$ZodRegistry:()=>cs,$ZodSet:()=>Ll,$ZodString:()=>Yt,$ZodStringFormat:()=>ee,$ZodSuccess:()=>Vl,$ZodSymbol:()=>yl,$ZodTemplateLiteral:()=>Kl,$ZodTransform:()=>Dl,$ZodTuple:()=>Xi,$ZodType:()=>G,$ZodULID:()=>Ju,$ZodURL:()=>ju,$ZodUUID:()=>Uu,$ZodUndefined:()=>bl,$ZodUnion:()=>_o,$ZodUnknown:()=>wl,$ZodVoid:()=>Sl,$ZodXID:()=>Xu,$ZodXor:()=>El,$brand:()=>Mc,$constructor:()=>S,$input:()=>nf,$output:()=>rf,Doc:()=>Xt,INVALID:()=>Le,JSONSchema:()=>O0,JSONSchemaGenerator:()=>Gs,NEVER:()=>Rc,TimePrecision:()=>gf,URL_BAD_FORMAT:()=>Qu,URL_UNPARSEABLE:()=>lo,ZodCompileAsyncError:()=>it,ZodCompileUnsupportedError:()=>H,_any:()=>zf,_array:()=>Zf,_base64:()=>Rs,_base64url:()=>Ms,_bigint:()=>Pf,_boolean:()=>Sf,_catch:()=>c3,_check:()=>$0,_cidrv4:()=>As,_cidrv6:()=>Es,_coercedBigint:()=>kf,_coercedBoolean:()=>Cf,_coercedDate:()=>Ff,_coercedNumber:()=>yf,_coercedString:()=>pf,_creditCard:()=>df,_cuid:()=>xs,_cuid2:()=>ws,_custom:()=>Uf,_date:()=>Tf,_decode:()=>vi,_decodeAsync:()=>Ci,_default:()=>i3,_discriminatedUnion:()=>qx,_e164:()=>Is,_email:()=>ms,_emoji:()=>bs,_encode:()=>wi,_encodeAsync:()=>Si,_endsWith:()=>cn,_enum:()=>Yx,_file:()=>Bf,_float32:()=>$f,_float64:()=>xf,_gt:()=>pt,_gte:()=>Ye,_guid:()=>ds,_iban:()=>hf,_includes:()=>sn,_int:()=>bf,_int32:()=>wf,_int64:()=>Af,_intersection:()=>Wx,_ipv4:()=>Ps,_ipv6:()=>ks,_isoDate:()=>Co,_isoDateTime:()=>So,_isoDuration:()=>ko,_isoTime:()=>Po,_jwt:()=>zs,_ksuid:()=>Cs,_lazy:()=>p3,_length:()=>ir,_literal:()=>t3,_lowercase:()=>nn,_lt:()=>ft,_lte:()=>Xe,_mac:()=>mf,_map:()=>Jx,_max:()=>Xe,_maxLength:()=>or,_maxSize:()=>zt,_mime:()=>ln,_min:()=>Ye,_minLength:()=>bt,_minSize:()=>mt,_multipleOf:()=>It,_nan:()=>Df,_nanoid:()=>$s,_nativeEnum:()=>e3,_negative:()=>Ls,_never:()=>Lf,_nonnegative:()=>Ts,_nonoptional:()=>s3,_nonpositive:()=>Os,_normalize:()=>fn,_null:()=>If,_nullable:()=>o3,_number:()=>_f,_optional:()=>n3,_overwrite:()=>st,_parse:()=>Wr,_parseAsync:()=>Hr,_pipe:()=>u3,_positive:()=>Ns,_promise:()=>m3,_properties:()=>un,_property:()=>Fs,_readonly:()=>l3,_record:()=>Kx,_refine:()=>Gf,_regex:()=>rn,_safeDecode:()=>ki,_safeDecodeAsync:()=>Ei,_safeEncode:()=>Pi,_safeEncodeAsync:()=>Ai,_safeParse:()=>Kr,_safeParseAsync:()=>Jr,_set:()=>Xx,_size:()=>nr,_slugify:()=>hn,_startsWith:()=>an,_string:()=>ff,_stringFormat:()=>sr,_stringbool:()=>qf,_success:()=>a3,_superRefine:()=>Qf,_symbol:()=>Rf,_templateLiteral:()=>f3,_toLowerCase:()=>mn,_toUpperCase:()=>dn,_transform:()=>r3,_trim:()=>pn,_tuple:()=>Hx,_uint32:()=>vf,_uint64:()=>Ef,_ulid:()=>vs,_undefined:()=>Mf,_union:()=>Vx,_unknown:()=>Nf,_uppercase:()=>on,_url:()=>vo,_uuid:()=>hs,_uuidv4:()=>gs,_uuidv6:()=>_s,_uuidv7:()=>ys,_void:()=>Of,_xid:()=>Ss,_xor:()=>jx,base64Charset:()=>Vi,base64urlCharset:()=>ho,canParseURL:()=>Vu,clone:()=>Y,compile:()=>cf,compileFn:()=>fs,config:()=>de,createStandardJSONSchemaMethod:()=>gn,createToJSONSchemaMethod:()=>Hf,decode:()=>Yb,decodeAsync:()=>t$,describe:()=>Vf,encode:()=>Xb,encodeAsync:()=>e$,extractDefs:()=>Lt,finalize:()=>Ot,flattenError:()=>ro,formatError:()=>no,getDiscriminatedOption:()=>Rl,globalConfig:()=>ve,globalRegistry:()=>ke,handleUnrepresentable:()=>_e,initializeContext:()=>Nt,isBackEdge:()=>ss,isRecursiveSchema:()=>is,isValidBase64:()=>mo,isValidBase64URL:()=>ji,isValidCIDRv6:()=>Qi,isValidCreditCard:()=>qi,isValidIBAN:()=>Wi,isValidIPv6:()=>po,isValidJWT:()=>Hi,locales:()=>as,memoizer:()=>wo,mergeValues:()=>Yr,meta:()=>jf,parse:()=>$i,parseAsync:()=>xi,parseURLObject:()=>r0,prettifyError:()=>Oc,process:()=>te,processSchema:()=>te,regexes:()=>rt,registry:()=>us,safeDecode:()=>n$,safeDecodeAsync:()=>i$,safeEncode:()=>r$,safeEncodeAsync:()=>o$,safeParse:()=>qb,safeParseAsync:()=>Wb,standardProps:()=>Zi,stripTabAndNewline:()=>fo,toDotPath:()=>Lh,toJSONSchema:()=>Us,toZod:()=>jn,treeifyError:()=>Lc,urlHostnameOk:()=>Ui,urlProtocolOk:()=>Gi,util:()=>T,validate:()=>oo,validateAsync:()=>io,validateURL:()=>Bi,version:()=>Du,withParser:()=>ls});var T={};kt(T,{BIGINT_FORMAT_RANGES:()=>Jn,CONSTANT_CATCH:()=>yi,Class:()=>bc,NUMBER_FORMAT_RANGES:()=>Kn,aborted:()=>Ne,allowsEval:()=>wc,assert:()=>mb,assertEqual:()=>ub,assertIs:()=>fb,assertNever:()=>pb,assertNotEqual:()=>lb,assignProp:()=>Pe,attachSchema:()=>Xn,base64ToUint8Array:()=>Eh,base64urlToUint8Array:()=>Ib,cached:()=>Qr,captureStackTrace:()=>hi,cleanEnum:()=>Mb,cleanRegex:()=>_t,clone:()=>Y,cloneDef:()=>gb,codePointLength:()=>Kt,constantCatch:()=>Ac,createTransparentProxy:()=>wb,defineLazy:()=>$c,defineLazyInternal:()=>q,derived:()=>Ob,esc:()=>ze,escapeRegex:()=>tt,explicitlyAborted:()=>Cc,extend:()=>Cb,finalizeIssue:()=>qe,floatSafeRemainder:()=>qn,getElementAtPath:()=>_b,getEnumValues:()=>Ur,getLengthableOrigin:()=>eo,getParsedType:()=>xb,getSizableOrigin:()=>Yn,hexToUint8Array:()=>Nb,hide:()=>to,installLazyProp:()=>Zb,isObject:()=>Ht,isPlainObject:()=>et,issue:()=>qr,joinValues:()=>mi,jsonStringifyReplacer:()=>Gr,members:()=>kc,merge:()=>kb,mergeDefs:()=>ot,normalizeParams:()=>z,nullish:()=>di,numKeys:()=>$b,objectClone:()=>db,omit:()=>Sb,optionalKeys:()=>Sc,own:()=>Et,parsedType:()=>Pc,partial:()=>Ab,pick:()=>vb,prefixIssues:()=>je,primitiveTypes:()=>vc,promiseAllObject:()=>yb,propertyKeyTypes:()=>Hn,randomString:()=>bb,rawShape:()=>Vr,required:()=>Eb,safeExtend:()=>Pb,shallowClone:()=>Wn,sizeCaps:()=>jr,slugify:()=>xc,stringifyPrimitive:()=>gi,toZod:()=>jn,uint8ArrayToBase64:()=>Rh,uint8ArrayToBase64url:()=>zb,uint8ArrayToHex:()=>Lb,unwrapMessage:()=>Br});function ub(e){return e}function lb(e){return e}function jn(){return e=>e}function fb(e){}function pb(e){throw new Error("Unexpected value in exhaustive check")}function mb(e){}function Ur(e){let t=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,o])=>t.indexOf(+n)===-1).map(([n,o])=>o)}function mi(e,t="|"){return e.map(r=>gi(r)).join(t)}function Gr(e,t){return typeof t=="bigint"?t.toString():t}var yc=class{constructor(t){this._getter=t,this._value=void 0;}get value(){let t=this._getter;return t!==void 0&&(this._value=t(),this._getter=void 0),this._value}};function Qr(e){return new yc(e)}function di(e){return e==null}function _t(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function qn(e,t){let r=e/t,n=Math.round(r),o=4*Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-n)<o?0:r-n}var Ch=Symbol("evaluating");function $c(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==Ch)return n===void 0&&(n=Ch,n=r()),n},set(o){Object.defineProperty(e,t,{value:o});},configurable:true});}function db(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function Pe(e,t,r){Object.defineProperty(e,t,{value:r,writable:true,enumerable:true,configurable:true});}function Vr(e){let t=Object.getOwnPropertyDescriptor(e,"shape");return t?.get?t.get.raw:t?.value}function gt(e){return Vr(e._zod.def)??e._zod.def.shape}function Ph(e,t,r){Object.defineProperty(e,t,{get(){let n=r();return Pe(this,t,n),n},enumerable:true,configurable:true});}function kh(e,t,r){t in e?Pe(e,t,r):e[t]=r;}function Wt(e,t,r,n){let o=gt(t);for(let i of r){let s=Object.getOwnPropertyDescriptor(o,i);s.enumerable&&(s.get?Ph(e,i,()=>{let a=t._zod.def.shape[i];return n?n(a,i):a}):kh(e,i,n?n(s.value,i):s.value));}}function hb(e,t){for(let r of Reflect.ownKeys(t)){let n=Object.getOwnPropertyDescriptor(t,r);n.enumerable&&(n.get?Ph(e,r,()=>t[r]):kh(e,r,n.value));}}function ot(...e){let t={};for(let r of e){let n=Object.getOwnPropertyDescriptors(r);Object.assign(t,n);}return Object.defineProperties({},t)}function gb(e){return ot(e._zod.def)}function _b(e,t){return t?t.reduce((r,n)=>r?.[n],e):e}function yb(e){let t=Object.keys(e),r=t.map(n=>e[n]);return Promise.all(r).then(n=>{let o={};for(let i=0;i<t.length;i++)o[t[i]]=n[i];return o})}function bb(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let n=0;n<e;n++)r+=t[Math.floor(Math.random()*t.length)];return r}function ze(e){return JSON.stringify(e)}function xc(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var hi="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Ht(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var wc=Qr(()=>{if(ve.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return false;try{let e=Function;return new e(""),!0}catch{return false}});function et(e){if(Ht(e)===false)return false;let t=e.constructor;if(t===void 0||typeof t!="function")return true;let r=t.prototype;return !(Ht(r)===false||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===false)}function Wn(e){return et(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function $b(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}var xb=e=>{let t=typeof e;switch(t){case "undefined":return "undefined";case "string":return "string";case "number":return Number.isNaN(e)?"nan":"number";case "boolean":return "boolean";case "function":return "function";case "bigint":return "bigint";case "symbol":return "symbol";case "object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},Hn=new Set(["string","number","symbol"]),vc=new Set(["string","number","bigint","boolean","symbol","undefined"]);function tt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Y(e,t,r){let n=new e._zod.constr(t??e._zod.def);return (!t||r?.parent)&&(n._zod.parent=e),n}function z(e){let t=e;if(!t)return {};if(typeof t=="string")return {error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message;}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function wb(e){let t;return new Proxy({},{get(r,n,o){return t??(t=e()),Reflect.get(t,n,o)},set(r,n,o,i){return t??(t=e()),Reflect.set(t,n,o,i)},has(r,n){return t??(t=e()),Reflect.has(t,n)},deleteProperty(r,n){return t??(t=e()),Reflect.deleteProperty(t,n)},ownKeys(r){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(r,n){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,n)},defineProperty(r,n,o){return t??(t=e()),Reflect.defineProperty(t,n,o)}})}function gi(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function Sc(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}var Kn={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Jn={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function vb(e,t){let r=e._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let i={};return Wt(i,e,_i(e,t)),Y(e,ot(r,{shape:i,checks:[]}))}function _i(e,t){let r=gt(e),n=[];for(let o of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(r,o)?.enumerable)throw new Error(`Unrecognized key: "${String(o)}"`);t[o]&&n.push(o);}return n}function Sb(e,t){let r=e._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let i=new Set(_i(e,t)),s={};return Wt(s,e,Reflect.ownKeys(gt(e)).filter(a=>!i.has(a))),Y(e,ot(r,{shape:s,checks:[]}))}function Cb(e,t){if(!et(t))throw new Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let o=gt(e);for(let i of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(o,i)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return Y(e,ot(e._zod.def,{shape:Ah(e,t)}))}function Ah(e,t){let r={};return Wt(r,e,Reflect.ownKeys(gt(e))),hb(r,t),r}function Pb(e,t){if(!et(t))throw new Error("Invalid input to safeExtend: expected a plain object");return Y(e,ot(e._zod.def,{shape:Ah(e,t)}))}function kb(e,t){if(!t?._zod?.def)throw new Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r={};Wt(r,e,Reflect.ownKeys(gt(e))),Wt(r,t,Reflect.ownKeys(gt(t)));let n=ot(e._zod.def,{shape:r,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return Y(e,n)}function Ab(e,t,r,n="partial"){let i=t._zod.def.checks;if(i&&i.length>0)throw new Error(`.${n}() cannot be used on object schemas containing refinements`);let a=r?new Set(_i(t,r)):void 0,c={};return Wt(c,t,Reflect.ownKeys(gt(t)),e&&((u,l)=>a&&!a.has(l)?u:new e({type:"optional",innerType:u}))),Y(t,ot(t._zod.def,{shape:c,checks:[]}))}function Eb(e,t,r){let n=r?new Set(_i(t,r)):void 0,o={};return Wt(o,t,Reflect.ownKeys(gt(t)),(i,s)=>n&&!n.has(s)?i:new e({type:"nonoptional",innerType:i})),Y(t,ot(t._zod.def,{shape:o}))}function Ne(e,t=0){if(e.aborted===true)return true;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==true)return true;return false}function Cc(e,t=0){if(e.aborted===true)return true;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue===false)return true;return false}function je(e,t){return t.map(r=>{var n;return (n=r).path??(n.path=[]),r.path.unshift(e),r})}function Br(e){return typeof e=="string"?e:e?.message}function jr(e){let t=[];for(let r of e??[]){let n=r._zod.def;if(!/_(length|size)$|_equals$/.test(n.check))break;let o=n.maximum??n.length??n.size;o>=0&&t.push([o,r]);}return t}function Xn(e,t,r){var n;for(let o=t;o<e.length;o++)(n=e[o]).schema??(n.schema=r);}function qe(e,t,r){var n;let o=e.inst?._zod?.traits;o?.has("$ZodType")&&(o.has("$ZodCheck")?(n=e).schema??(n.schema=e.inst):e.schema=e.inst);let i=e.schema!==e.inst?e.schema?._zod.def?.error:void 0,s=e.message?e.message:Br(e.inst?._zod.def?.error?.(e))??Br(i?.(e))??Br(t?.error?.(e))??Br(r.customError?.(e))??Br(r.localeError?.(e))??"Invalid input",a={};for(let c of Object.keys(e))c==="inst"||c==="schema"||c==="continue"||c==="input"||c==="__proto__"||(a[c]=e[c]);return a.path??(a.path=[]),a.message=s,t?.reportInput&&(a.input=e.input),a}function Yn(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}var Rb=/[\uD800-\uDBFF]/;function Kt(e){let t=e.length;if(!Rb.test(e))return t;let r=t;for(let n=0;n<t-1;n++)(e.charCodeAt(n)&64512)===55296&&(e.charCodeAt(n+1)&64512)===56320&&(r--,n++);return r}function eo(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Pc(e){let t=typeof e;switch(t){case "number":return Number.isNaN(e)?"nan":"number";case "object":{if(e===null)return "null";if(Array.isArray(e))return "array";let r=e;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return t}function qr(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}function Mb(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function Eh(e){let t=atob(e),r=new Uint8Array(t.length);for(let n=0;n<t.length;n++)r[n]=t.charCodeAt(n);return r}function Rh(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function Ib(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return Eh(t+r)}function zb(e){return Rh(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Nb(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let r=new Uint8Array(t.length/2);for(let n=0;n<t.length;n+=2)r[n/2]=Number.parseInt(t.slice(n,n+2),16);return r}function Lb(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var bc=class{constructor(...t){}};function kc(e,t){for(let r in t){let n=Object.getOwnPropertyDescriptor(t,r);n.get?Object.defineProperty(e,r,{...n,enumerable:false}):Tb(e,r,n.value);}}function Et(e,t,r,n=true){return Object.defineProperty(e,t,{configurable:true,writable:true,enumerable:n,value:r}),r}function to(e,t,r){return Et(e,t,r,false)}function Ob(e,t){for(let r in e){let n=e[r];Object.defineProperty(t,r,{configurable:true,enumerable:true,get(){return Et(this,r,n(this))},set(o){Et(this,r,o);}});}return t}function Tb(e,t,r){Object.defineProperty(e,t,{configurable:true,get(){return this==null?r:Et(this,t,r.bind(this))},set(n){Et(this,t,n);}});}function Fb(e,t){let r=Object.getPrototypeOf(e);return t in r?void 0:r}var _c,At=false,Db={configurable:true,get(){At=true;}};function q(e,t,r){let n=Object.getPrototypeOf(e._zod);if(t in n&&_c!==e._zod){_c=void 0;return}_c=e._zod,Object.defineProperty(n,t,{configurable:true,get(){Object.defineProperty(this,t,Db);let o=At;At=false;try{let i=r(this);return At?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:i}),At=At||o,i}catch(i){throw delete this[t],At=At||o,i}},set(o){Object.defineProperty(this,t,{configurable:true,writable:true,value:o});}});}function Zb(e,t,r,n){let o=Fb(e,t);o&&Object.defineProperty(o,t,{configurable:true,get(){let i={configurable:true,writable:true,enumerable:n,value:void 0};return Object.defineProperty(this,t,i),i.value=r(this),Object.defineProperty(this,t,i),i.value},set(i){Object.defineProperty(this,t,{configurable:true,writable:true,enumerable:n,value:i});}});}var yi="~constantCatch";function Ac(e){let t=()=>e;return t[yi]=true,t}var Mh,Rc=Object.freeze({status:"aborted"}),Ec={value:void 0,enumerable:false},Ih="captureStackTrace"in Error?Error:null;function Bb(e){let t=Ih;if(t){let r=t.stackTraceLimit;if(typeof r=="number"){try{t.stackTraceLimit=0;}catch{return Ih=null,new e}try{return new e}finally{t.stackTraceLimit=r;}}}return new e}function S(e,t,r,n){let o={};function i(p){this.def=p,this.constr=f,this.traits=new Set;}i.prototype=o;let s=r,a=s&&new WeakSet;function c(p,m){if(p._zod){if(p._zod.traits.has(e))return}else {Ec.value=new i(m);try{Object.defineProperty(p,"_zod",Ec);}finally{Ec.value=void 0;}}if(p._zod.traits.add(e),t(p,m),a){let d=Object.getPrototypeOf(p),g=p._zod.constr.prototype,y=d;for(;y&&y!==g;)y=Object.getPrototypeOf(y);let _=y??d;a.has(_)||(a.add(_),kc(_,s));}let h=f.prototype;for(let d in h)Object.prototype.hasOwnProperty.call(h,d)&&(d in p||(p[d]=h[d].bind(p)));}let u=n?.Parent??Object;class l extends u{}Object.defineProperty(l,"name",{value:e});function f(p){let m=n?.Parent?Bb(l):this;c(m,p);let h=m._zod.deferred;if(h){for(let g of h)g();m._zod.deferred=void 0;}let d=globalThis.__zod_globalConfig?.postProcessor;return d&&d(m),m}return Object.defineProperty(f,"init",{value:c}),Object.defineProperty(f,Symbol.hasInstance,{value:p=>n?.Parent&&p instanceof n.Parent?true:p?._zod?.traits?.has(e)}),Object.defineProperty(f,"name",{value:e}),f}var Mc=Symbol("zod_brand"),We=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.");}},Rt=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError";}};(Mh=globalThis).__zod_globalConfig??(Mh.__zod_globalConfig={});var ve=globalThis.__zod_globalConfig;function de(e){return e&&Object.assign(ve,e),ve}function Ub(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,Gr,2)),e.message}function Gb(e){this._zod.message=e;}var Qb={get:Ub,set:Gb,enumerable:true,configurable:true},zc={value:void 0,enumerable:false},zh=new WeakSet([Object.prototype,Error.prototype]),Nh=(e,t)=>{e.name="$ZodError",zc.value=t,Object.defineProperty(e,"issues",zc),zc.value=void 0,Object.defineProperty(e,"message",Qb);let r=Object.getPrototypeOf(e);zh.has(r)||(zh.add(r),Object.defineProperty(r,"toString",{configurable:true,enumerable:false,get(){let n=()=>this.message;return Object.defineProperty(this,"toString",{value:n,configurable:true,writable:true}),n},set(n){Object.defineProperty(this,"toString",{value:n,configurable:true,writable:true});}}));},Nc=S("$ZodError",Nh),He=S("$ZodError",Nh,void 0,{Parent:Error});function Vb(e,t,r){return Object.prototype.hasOwnProperty.call(e,t)||(t==="__proto__"?Object.defineProperty(e,t,{value:r(),writable:true,enumerable:true,configurable:true}):e[t]=r()),e[t]}function ro(e,t=r=>r.message){let r={},n=[];for(let o of e.issues)o.path.length>0?Vb(r,o.path[0],()=>[]).push(t(o)):n.push(t(o));return {formErrors:n,fieldErrors:r}}function no(e,t=r=>r.message){let r={_errors:[]},n=(o,i=[])=>{for(let s of o.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(a=>n({issues:a},[...i,...s.path]));else if(s.code==="invalid_key")n({issues:s.issues},[...i,...s.path]);else if(s.code==="invalid_element")n({issues:s.issues},[...i,...s.path]);else {let a=[...i,...s.path];if(a.length===0)r._errors.push(t(s));else {let c=r,u=0;for(;u<a.length;){let l=a[u],f=u===a.length-1;if(l==="_errors"){f&&c._errors.push(t(s)),u++;continue}Object.prototype.hasOwnProperty.call(c,l)||Object.defineProperty(c,l,{value:{_errors:[]},enumerable:true,writable:true,configurable:true});let p=c[l];f&&p._errors.push(t(s)),c=p,u++;}}}};return n(e),r}function Lc(e,t=r=>r.message){let r={errors:[]},n=(o,i=[])=>{var s;for(let a of o.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(c=>n({issues:c},[...i,...a.path]));else if(a.code==="invalid_key")n({issues:a.issues},[...i,...a.path]);else if(a.code==="invalid_element")n({issues:a.issues},[...i,...a.path]);else {let c=[...i,...a.path];if(c.length===0){r.errors.push(t(a));continue}let u=r,l=0;for(;l<c.length;){let f=c[l],p=l===c.length-1;typeof f=="string"?(u.properties??(u.properties={}),Object.prototype.hasOwnProperty.call(u.properties,f)||Object.defineProperty(u.properties,f,{value:{errors:[]},enumerable:true,writable:true,configurable:true}),u=u.properties[f]):(u.items??(u.items=[]),(s=u.items)[f]??(s[f]={errors:[]}),u=u.items[f]),p&&u.errors.push(t(a)),l++;}}};return n(e),r}function Lh(e){let t=[],r=e.map(n=>typeof n=="object"?n.key:n);for(let n of r)typeof n=="number"?t.push(`[${n}]`):typeof n=="symbol"?t.push(`[${JSON.stringify(String(n))}]`):/[^\w$]/.test(n)?t.push(`[${JSON.stringify(n)}]`):(t.length&&t.push("."),t.push(n));return t.join("")}function Oc(e){let t=[],r=[...e.issues].sort((n,o)=>(n.path??[]).length-(o.path??[]).length);for(let n of r)t.push(`\u2716 ${n.message}`),n.path?.length&&t.push(` \u2192 at ${Lh(n.path)}`);return t.join(`
2
- `)}function bi(e,t){return {callee:t?.callee??e,Err:t?.Err}}var Wr=e=>{let t=(r,n,o,i)=>{let s=o?{...o,async:false}:{async:false},a=r._zod.run({value:n,issues:[]},s);if(a instanceof Promise)throw new We;if(a.issues.length){let c=new(i?.Err??e)(a.issues.map(u=>qe(u,s,de())));throw hi(c,i?.callee??t),c}return a.value};return t},$i=Wr(He),Hr=e=>{let t=async(r,n,o,i)=>{let s=o?{...o,async:true}:{async:true},a=r._zod.run({value:n,issues:[]},s);if(a instanceof Promise&&(a=await a),a.issues.length){let c=new(i?.Err??e)(a.issues.map(u=>qe(u,s,de())));throw hi(c,i?.callee??t),c}return a.value};return t},xi=Hr(He),Kr=e=>(t,r,n)=>{let o=n?{...n,async:false}:{async:false},i=t._zod.run({value:r,issues:[]},o);if(i instanceof Promise)throw new We;return i.issues.length?Oh(e,i.issues,o):{success:true,data:i.value}},qb=Kr(He);function Oh(e,t,r){let n;return {success:false,get error(){return n||(n=new e(t.map(o=>qe(o,r,de()))),t=void 0,r=void 0),n},set error(o){n=o,t=void 0,r=void 0;}}}var Jr=e=>async(t,r,n)=>{let o=n?{...n,async:true}:{async:true},i=t._zod.run({value:r,issues:[]},o);return i instanceof Promise&&(i=await i),i.issues.length?Oh(e,i.issues,o):{success:true,data:i.value}},Wb=Jr(He),Hb=Symbol.for("zod.compile.invalid"),Kb=Symbol.for("zod.compile.fallback"),oo=((e,t,r)=>{let n=e._zod.bag.validator;if(n!==void 0){if(n(t)!==Hb)return true;if(n.definite===true&&r===void 0)return false}return Jb(e,t,r)});function Jb(e,t,r){let n=r?{...r,async:false,abortEarly:true}:{async:false,abortEarly:true},o=e._zod.bag.fallbackRun,i;if(o?(n[Kb]=true,i=o({value:t,issues:[]},n)):i=e._zod.run({value:t,issues:[]},n),i instanceof Promise)throw new We;return i.issues.length===0}var io=async(e,t,r)=>{let n=r?{...r,async:true,abortEarly:true}:{async:true,abortEarly:true},o=e._zod.run({value:t,issues:[]},n);return o instanceof Promise&&(o=await o),o.issues.length===0},wi=e=>{let t=Wr(e),r=(n,o,i,s)=>{let a=i?{...i,direction:"backward"}:{direction:"backward"};return t(n,o,a,bi(r,s))};return r},Xb=wi(He),vi=e=>{let t=Wr(e),r=(n,o,i,s)=>t(n,o,i,bi(r,s));return r},Yb=vi(He),Si=e=>{let t=Hr(e),r=async(n,o,i,s)=>{let a=i?{...i,direction:"backward"}:{direction:"backward"};return await t(n,o,a,bi(r,s))};return r},e$=Si(He),Ci=e=>{let t=Hr(e),r=async(n,o,i,s)=>await t(n,o,i,bi(r,s));return r},t$=Ci(He),Pi=e=>(t,r,n)=>{let o=n?{...n,direction:"backward"}:{direction:"backward"};return Kr(e)(t,r,o)},r$=Pi(He),ki=e=>(t,r,n)=>Kr(e)(t,r,n),n$=ki(He),Ai=e=>async(t,r,n)=>{let o=n?{...n,direction:"backward"}:{direction:"backward"};return Jr(e)(t,r,o)},o$=Ai(He),Ei=e=>async(t,r,n)=>Jr(e)(t,r,n),i$=Ei(He);var rt={};kt(rt,{anyString:()=>uu,base64:()=>eu,base64url:()=>tu,bigint:()=>fu,boolean:()=>pu,browserEmail:()=>m$,cidrv4:()=>Xc,cidrv6:()=>Yc,creditCard:()=>Ri,cuid:()=>Fc,cuid2:()=>Dc,currencyCode:()=>iu,date:()=>su,datetime:()=>cu,domain:()=>nu,duration:()=>Vc,e164:()=>ou,email:()=>qc,emoji:()=>Wc,extendedDuration:()=>s$,guid:()=>jc,hex:()=>_u,hostname:()=>ru,html5Email:()=>l$,httpProtocol:()=>so,iban:()=>Mi,idnEmail:()=>p$,integer:()=>ao,ipv4:()=>Hc,ipv6:()=>Kc,ksuid:()=>Uc,lowercase:()=>hu,mac:()=>Jc,md5_base64:()=>_$,md5_base64url:()=>y$,md5_hex:()=>g$,nanoid:()=>Gc,nanoidOfLength:()=>Qc,null:()=>mu,number:()=>yt,rfc5322Email:()=>f$,sha1_base64:()=>$$,sha1_base64url:()=>x$,sha1_hex:()=>b$,sha256_base64:()=>v$,sha256_base64url:()=>S$,sha256_hex:()=>w$,sha384_base64:()=>P$,sha384_base64url:()=>k$,sha384_hex:()=>C$,sha512_base64:()=>E$,sha512_base64url:()=>R$,sha512_hex:()=>A$,string:()=>lu,time:()=>au,ulid:()=>Zc,undefined:()=>du,unicodeEmail:()=>Th,uppercase:()=>gu,uuid:()=>Jt,uuid4:()=>a$,uuid6:()=>c$,uuid7:()=>u$,xid:()=>Bc});var Fc=/^[cC][0-9a-z]{6,}$/,Dc=/^[0-9a-z]+$/,Zc=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,Bc=/^[0-9a-vA-V]{20}$/,Uc=/^[A-Za-z0-9]{27}$/,Gc=/^[a-zA-Z0-9_-]{21}$/;function Qc(e){return new RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var Vc=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,s$=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,jc=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Jt=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,a$=Jt(4),c$=Jt(6),u$=Jt(7),qc=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,l$=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,f$=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,Th=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,p$=Th,m$=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,d$="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function Wc(){return new RegExp(d$,"u")}var Hc=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Kc=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Jc=e=>{let t=tt(e??":");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},Xc=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Yc=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,eu=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,tu=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,ru=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,nu=/^(?=.{1,253}$)([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,63}$/,so=/^https?$/,ou=/^\+[1-9]\d{6,14}$/,Ri=/^\d(?:[ -]?\d){11,18}$/,iu=/^(?:AED|AFN|ALL|AMD|AOA|ARS|AUD|AWG|AZN|BAM|BBD|BDT|BHD|BIF|BMD|BND|BOB|BOV|BRL|BSD|BTN|BWP|BYN|BZD|CAD|CDF|CHE|CHF|CHW|CLF|CLP|CNY|COP|COU|CRC|CUP|CVE|CZK|DJF|DKK|DOP|DZD|EGP|ERN|ETB|EUR|FJD|FKP|GBP|GEL|GHS|GIP|GMD|GNF|GTQ|GYD|HKD|HNL|HTG|HUF|IDR|ILS|INR|IQD|IRR|ISK|JMD|JOD|JPY|KES|KGS|KHR|KMF|KPW|KRW|KWD|KYD|KZT|LAK|LBP|LKR|LRD|LSL|LYD|MAD|MDL|MGA|MKD|MMK|MNT|MOP|MRU|MUR|MVR|MWK|MXN|MXV|MYR|MZN|NAD|NGN|NIO|NOK|NPR|NZD|OMR|PAB|PEN|PGK|PHP|PKR|PLN|PYG|QAR|RON|RSD|RUB|RWF|SAR|SBD|SCR|SDG|SEK|SGD|SHP|SLE|SOS|SRD|SSP|STN|SVC|SYP|SZL|THB|TJS|TMT|TND|TOP|TRY|TTD|TWD|TZS|UAH|UGX|USD|USN|UYI|UYU|UYW|UZS|VED|VES|VND|VUV|WST|XAD|XAF|XAG|XAU|XBA|XBB|XBC|XBD|XCD|XCG|XDR|XOF|XPD|XPF|XPT|XSU|XTS|XUA|XXX|YER|ZAR|ZMW|ZWG)$/,Mi=/^[A-Z]{2}(?!00|01|99)\d{2}[A-Z0-9]{11,30}$/,Fh="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))";function h$(e){return new RegExp(`^${e}$`)}var su=h$(Fh);function Tc(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function au(e){return new RegExp(`^${Tc(e)}$`)}function cu(e){let t=["Z"];e.offset&&t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let r=`${Tc({precision:e.precision,seconds:true})}(?:${t.join("|")})`,n=e.local?`${r}|${Tc({precision:e.precision})}`:r;return new RegExp(`^${Fh}T(?:${n})$`)}var uu=/^[\s\S]{0,}$/,lu=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},fu=/^-?\d+n?$/,ao=/^-?\d+$/,yt=/^-?\d+(?:\.\d+)?$/,pu=/^(?:true|false)$/i,mu=/^null$/i;var du=/^undefined$/i;var hu=/^[^A-Z]*$/,gu=/^[^a-z]*$/,_u=/^[0-9a-fA-F]*$/;function co(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function uo(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}var g$=/^[0-9a-fA-F]{32}$/,_$=co(22,"=="),y$=uo(22),b$=/^[0-9a-fA-F]{40}$/,$$=co(27,"="),x$=uo(27),w$=/^[0-9a-fA-F]{64}$/,v$=co(43,"="),S$=uo(43),C$=/^[0-9a-fA-F]{96}$/,P$=co(64,""),k$=uo(64),A$=/^[0-9a-fA-F]{128}$/,E$=co(86,"=="),R$=uo(86);var ae=S("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[]);}),yu=e=>{let t=e.value;return !di(t)&&t.size!==void 0},bu=e=>{let t=e.value;return !di(t)&&t.length!==void 0},Ii={number:"number",bigint:"bigint",object:"date"},Ni=S("$ZodCheckLessThan",(e,t)=>{ae.init(e,t);let r=Ii[typeof t.value];e._zod.check=n=>{(t.inclusive?n.value<=t.value:n.value<t.value)||n.issues.push({origin:Ii[typeof n.value]??r,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort});};}),Li=S("$ZodCheckGreaterThan",(e,t)=>{ae.init(e,t);let r=Ii[typeof t.value];e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:Ii[typeof n.value]??r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort});};}),$u=S("$ZodCheckMultipleOf",(e,t)=>{ae.init(e,t),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?t.value!==BigInt(0)&&r.value%t.value===BigInt(0):qn(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort});};}),xu=S("$ZodCheckNumberFormat",(e,t)=>{ae.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[o,i]=Kn[t.format];e._zod.check=s=>{let a=s.value;if(r){if(!Number.isInteger(a)){s.issues.push({expected:n,format:t.format,code:"invalid_type",continue:false,input:a,inst:e});return}if(!Number.isSafeInteger(a)){a>0?s.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:true,continue:!t.abort}):s.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:true,continue:!t.abort});return}}a<o&&s.issues.push({origin:"number",input:a,code:"too_small",minimum:o,inclusive:true,inst:e,continue:!t.abort}),a>i&&s.issues.push({origin:"number",input:a,code:"too_big",maximum:i,inclusive:true,inst:e,continue:!t.abort});};}),wu=S("$ZodCheckBigIntFormat",(e,t)=>{ae.init(e,t);let[r,n]=Jn[t.format];e._zod.check=o=>{let i=o.value;i<r&&o.issues.push({origin:"bigint",input:i,code:"too_small",minimum:r,inclusive:true,inst:e,continue:!t.abort}),i>n&&o.issues.push({origin:"bigint",input:i,code:"too_big",maximum:n,inclusive:true,inst:e,continue:!t.abort});};}),vu=S("$ZodCheckMaxSize",(e,t)=>{var r;ae.init(e,t),(r=e._zod.def).when??(r.when=yu),e._zod.check=n=>{let o=n.value;o.size<=t.maximum||n.issues.push({origin:Yn(o),code:"too_big",maximum:t.maximum,inclusive:true,input:o,inst:e,continue:!t.abort});};}),Su=S("$ZodCheckMinSize",(e,t)=>{var r;ae.init(e,t),(r=e._zod.def).when??(r.when=yu),e._zod.check=n=>{let o=n.value;o.size>=t.minimum||n.issues.push({origin:Yn(o),code:"too_small",minimum:t.minimum,inclusive:true,input:o,inst:e,continue:!t.abort});};}),Cu=S("$ZodCheckSizeEquals",(e,t)=>{var r;ae.init(e,t),(r=e._zod.def).when??(r.when=yu),e._zod.check=n=>{let o=n.value,i=o.size;if(i===t.size)return;let s=i>t.size;n.issues.push({origin:Yn(o),...s?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:true,exact:true,input:n.value,inst:e,continue:!t.abort});};}),Pu=S("$ZodCheckMaxLength",(e,t)=>{var r;ae.init(e,t),(r=e._zod.def).when??(r.when=bu),e._zod.check=n=>{let o=n.value,i=o.length;if((typeof o=="string"&&i>t.maximum?Kt(o):i)<=t.maximum)return;let a=eo(o);n.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:true,input:o,inst:e,continue:!t.abort});};}),ku=S("$ZodCheckMinLength",(e,t)=>{var r;ae.init(e,t),(r=e._zod.def).when??(r.when=bu),e._zod.check=n=>{let o=n.value,i=o.length;if((typeof o=="string"&&i>=t.minimum&&i<t.minimum*2?Kt(o):i)>=t.minimum)return;let a=eo(o);n.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:true,input:o,inst:e,continue:!t.abort});};}),Au=S("$ZodCheckLengthEquals",(e,t)=>{var r;ae.init(e,t),(r=e._zod.def).when??(r.when=bu),e._zod.check=n=>{let o=n.value,i=o.length,s=typeof o=="string"&&i>=t.length&&i<=t.length*2?Kt(o):i;if(s===t.length)return;let a=eo(o),c=s>t.length;n.issues.push({origin:a,...c?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:true,exact:true,input:n.value,inst:e,continue:!t.abort});};}),Xr=S("$ZodCheckStringFormat",(e,t)=>{var r,n;ae.init(e,t),t.pattern?(r=e._zod).check??(r.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort});}):(n=e._zod).check??(n.check=()=>{});}),Eu=S("$ZodCheckRegex",(e,t)=>{Xr.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort});};}),Ru=S("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=hu),Xr.init(e,t);}),Mu=S("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=gu),Xr.init(e,t);}),Iu=S("$ZodCheckIncludes",(e,t)=>{ae.init(e,t);let r=tt(t.includes),n=new RegExp(typeof t.position=="number"?`^.{${t.position},}${r}`:r);t.pattern=n,e._zod.check=o=>{o.value.includes(t.includes,t.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort});};}),zu=S("$ZodCheckStartsWith",(e,t)=>{ae.init(e,t);let r=new RegExp(`^${tt(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort});};}),Nu=S("$ZodCheckEndsWith",(e,t)=>{ae.init(e,t);let r=new RegExp(`.*${tt(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort});};});function zi(e,t,r){e.issues.length&&t.issues.push(...je(r,e.issues));}var Lu=S("$ZodCheckProperty",(e,t)=>{ae.init(e,t),e._zod.check=r=>{let n=t.schema._zod.run({value:r.value[t.property],issues:[]},{});if(n instanceof Promise)return n.then(o=>zi(o,r,t.property));zi(n,r,t.property);};}),Ou=S("$ZodCheckProperties",(e,t)=>{ae.init(e,t),to(e,Symbol.iterator,function*(){yield e;});let r;e._zod.check=n=>{if(n.value==null){n.issues.push({expected:"object",code:"invalid_type",input:n.value,inst:e});return}r??(r=Reflect.ownKeys(t.shape).map(s=>[s,t.shape[s]]));let o=n.value,i;for(let[s,a]of r){let c=a._zod.run({value:o[s],issues:[]},{});c instanceof Promise?(i??(i=[]),i.push(c.then(u=>zi(u,n,s)))):zi(c,n,s);}if(i)return Promise.all(i).then(()=>{})};}),Tu=S("$ZodCheckMimeType",(e,t)=>{ae.init(e,t);let r=new Set(t.mime);e._zod.check=n=>{r.has(n.value.type)||n.issues.push({code:"invalid_value",values:t.mime,input:n.value.type,inst:e,continue:!t.abort});};}),Fu=S("$ZodCheckOverwrite",(e,t)=>{ae.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value);};});var Xt=class{constructor(t=[],r={}){this.content=[],this.indent=0,this.args=t,this.closed=r;}indented(t){this.indent+=1;try{t(this);}finally{this.indent-=1;}}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let n=t.split(`
1
+ var $b=Object.defineProperty;var At=(e,t)=>{for(var r in t)$b(e,r,{get:t[r],enumerable:true});};var Zr;(i=>{class e{constructor(a,c,u,l){this.version=a;this.errorCorrectionLevel=c;if(a<e.MIN_VERSION||a>e.MAX_VERSION)throw new RangeError("Version value out of range");if(l<-1||l>7)throw new RangeError("Mask value out of range");this.size=a*4+17;let f=[];for(let m=0;m<this.size;m++)f.push(false);for(let m=0;m<this.size;m++)this.modules.push(f.slice()),this.isFunction.push(f.slice());this.drawFunctionPatterns();let p=this.addEccAndInterleave(u);if(this.drawCodewords(p),l==-1){let m=1e9;for(let h=0;h<8;h++){this.applyMask(h),this.drawFormatBits(h);let d=this.getPenaltyScore();d<m&&(l=h,m=d),this.applyMask(h);}}n(0<=l&&l<=7),this.mask=l,this.applyMask(l),this.drawFormatBits(l),this.isFunction=[];}version;errorCorrectionLevel;static encodeText(a,c){let u=i.QrSegment.makeSegments(a);return e.encodeSegments(u,c)}static encodeBinary(a,c){let u=i.QrSegment.makeBytes(a);return e.encodeSegments([u],c)}static encodeSegments(a,c,u=1,l=40,f=-1,p=true){if(!(e.MIN_VERSION<=u&&u<=l&&l<=e.MAX_VERSION)||f<-1||f>7)throw new RangeError("Invalid value");let m,h;for(m=u;;m++){let _=e.getNumDataCodewords(m,c)*8,b=o.getTotalBits(a,m);if(b<=_){h=b;break}if(m>=l)throw new RangeError("Data too long")}for(let _ of [e.Ecc.MEDIUM,e.Ecc.QUARTILE,e.Ecc.HIGH])p&&h<=e.getNumDataCodewords(m,_)*8&&(c=_);let d=[];for(let _ of a){t(_.mode.modeBits,4,d),t(_.numChars,_.mode.numCharCountBits(m),d);for(let b of _.getData())d.push(b);}n(d.length==h);let g=e.getNumDataCodewords(m,c)*8;n(d.length<=g),t(0,Math.min(4,g-d.length),d),t(0,(8-d.length%8)%8,d),n(d.length%8==0);for(let _=236;d.length<g;_^=253)t(_,8,d);let y=[];for(;y.length*8<d.length;)y.push(0);return d.forEach((_,b)=>y[b>>>3]|=_<<7-(b&7)),new e(m,c,y,f)}size;mask;modules=[];isFunction=[];getModule(a,c){return 0<=a&&a<this.size&&0<=c&&c<this.size&&this.modules[c][a]}getModules(){return this.modules}drawFunctionPatterns(){for(let u=0;u<this.size;u++)this.setFunctionModule(6,u,u%2==0),this.setFunctionModule(u,6,u%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);let a=this.getAlignmentPatternPositions(),c=a.length;for(let u=0;u<c;u++)for(let l=0;l<c;l++)u==0&&l==0||u==0&&l==c-1||u==c-1&&l==0||this.drawAlignmentPattern(a[u],a[l]);this.drawFormatBits(0),this.drawVersion();}drawFormatBits(a){let c=this.errorCorrectionLevel.formatBits<<3|a,u=c;for(let f=0;f<10;f++)u=u<<1^(u>>>9)*1335;let l=(c<<10|u)^21522;n(l>>>15==0);for(let f=0;f<=5;f++)this.setFunctionModule(8,f,r(l,f));this.setFunctionModule(8,7,r(l,6)),this.setFunctionModule(8,8,r(l,7)),this.setFunctionModule(7,8,r(l,8));for(let f=9;f<15;f++)this.setFunctionModule(14-f,8,r(l,f));for(let f=0;f<8;f++)this.setFunctionModule(this.size-1-f,8,r(l,f));for(let f=8;f<15;f++)this.setFunctionModule(8,this.size-15+f,r(l,f));this.setFunctionModule(8,this.size-8,true);}drawVersion(){if(this.version<7)return;let a=this.version;for(let u=0;u<12;u++)a=a<<1^(a>>>11)*7973;let c=this.version<<12|a;n(c>>>18==0);for(let u=0;u<18;u++){let l=r(c,u),f=this.size-11+u%3,p=Math.floor(u/3);this.setFunctionModule(f,p,l),this.setFunctionModule(p,f,l);}}drawFinderPattern(a,c){for(let u=-4;u<=4;u++)for(let l=-4;l<=4;l++){let f=Math.max(Math.abs(l),Math.abs(u)),p=a+l,m=c+u;0<=p&&p<this.size&&0<=m&&m<this.size&&this.setFunctionModule(p,m,f!=2&&f!=4);}}drawAlignmentPattern(a,c){for(let u=-2;u<=2;u++)for(let l=-2;l<=2;l++)this.setFunctionModule(a+l,c+u,Math.max(Math.abs(l),Math.abs(u))!=1);}setFunctionModule(a,c,u){this.modules[c][a]=u,this.isFunction[c][a]=true;}addEccAndInterleave(a){let c=this.version,u=this.errorCorrectionLevel;if(a.length!=e.getNumDataCodewords(c,u))throw new RangeError("Invalid argument");let l=e.NUM_ERROR_CORRECTION_BLOCKS[u.ordinal][c],f=e.ECC_CODEWORDS_PER_BLOCK[u.ordinal][c],p=Math.floor(e.getNumRawDataModules(c)/8),m=l-p%l,h=Math.floor(p/l),d=[],g=e.reedSolomonComputeDivisor(f);for(let _=0,b=0;_<l;_++){let S=a.slice(b,b+h-f+(_<m?0:1));b+=S.length;let C=e.reedSolomonComputeRemainder(S,g);_<m&&S.push(0),d.push(S.concat(C));}let y=[];for(let _=0;_<d[0].length;_++)d.forEach((b,S)=>{(_!=h-f||S>=m)&&y.push(b[_]);});return n(y.length==p),y}drawCodewords(a){if(a.length!=Math.floor(e.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let c=0;for(let u=this.size-1;u>=1;u-=2){u==6&&(u=5);for(let l=0;l<this.size;l++)for(let f=0;f<2;f++){let p=u-f,h=(u+1&2)==0?this.size-1-l:l;!this.isFunction[h][p]&&c<a.length*8&&(this.modules[h][p]=r(a[c>>>3],7-(c&7)),c++);}}n(c==a.length*8);}applyMask(a){if(a<0||a>7)throw new RangeError("Mask value out of range");for(let c=0;c<this.size;c++)for(let u=0;u<this.size;u++){let l;switch(a){case 0:l=(u+c)%2==0;break;case 1:l=c%2==0;break;case 2:l=u%3==0;break;case 3:l=(u+c)%3==0;break;case 4:l=(Math.floor(u/3)+Math.floor(c/2))%2==0;break;case 5:l=u*c%2+u*c%3==0;break;case 6:l=(u*c%2+u*c%3)%2==0;break;case 7:l=((u+c)%2+u*c%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[c][u]&&l&&(this.modules[c][u]=!this.modules[c][u]);}}getPenaltyScore(){let a=0;for(let f=0;f<this.size;f++){let p=false,m=0,h=[0,0,0,0,0,0,0];for(let d=0;d<this.size;d++)this.modules[f][d]==p?(m++,m==5?a+=e.PENALTY_N1:m>5&&a++):(this.finderPenaltyAddHistory(m,h),p||(a+=this.finderPenaltyCountPatterns(h)*e.PENALTY_N3),p=this.modules[f][d],m=1);a+=this.finderPenaltyTerminateAndCount(p,m,h)*e.PENALTY_N3;}for(let f=0;f<this.size;f++){let p=false,m=0,h=[0,0,0,0,0,0,0];for(let d=0;d<this.size;d++)this.modules[d][f]==p?(m++,m==5?a+=e.PENALTY_N1:m>5&&a++):(this.finderPenaltyAddHistory(m,h),p||(a+=this.finderPenaltyCountPatterns(h)*e.PENALTY_N3),p=this.modules[d][f],m=1);a+=this.finderPenaltyTerminateAndCount(p,m,h)*e.PENALTY_N3;}for(let f=0;f<this.size-1;f++)for(let p=0;p<this.size-1;p++){let m=this.modules[f][p];m==this.modules[f][p+1]&&m==this.modules[f+1][p]&&m==this.modules[f+1][p+1]&&(a+=e.PENALTY_N2);}let c=0;for(let f of this.modules)c=f.reduce((p,m)=>p+(m?1:0),c);let u=this.size*this.size,l=Math.ceil(Math.abs(c*20-u*10)/u)-1;return n(0<=l&&l<=9),a+=l*e.PENALTY_N4,n(0<=a&&a<=2568888),a}getAlignmentPatternPositions(){if(this.version==1)return [];{let a=Math.floor(this.version/7)+2,c=this.version==32?26:Math.ceil((this.version*4+4)/(a*2-2))*2,u=[6];for(let l=this.size-7;u.length<a;l-=c)u.splice(1,0,l);return u}}static getNumRawDataModules(a){if(a<e.MIN_VERSION||a>e.MAX_VERSION)throw new RangeError("Version number out of range");let c=(16*a+128)*a+64;if(a>=2){let u=Math.floor(a/7)+2;c-=(25*u-10)*u-55,a>=7&&(c-=36);}return n(208<=c&&c<=29648),c}static getNumDataCodewords(a,c){return Math.floor(e.getNumRawDataModules(a)/8)-e.ECC_CODEWORDS_PER_BLOCK[c.ordinal][a]*e.NUM_ERROR_CORRECTION_BLOCKS[c.ordinal][a]}static reedSolomonComputeDivisor(a){if(a<1||a>255)throw new RangeError("Degree out of range");let c=[];for(let l=0;l<a-1;l++)c.push(0);c.push(1);let u=1;for(let l=0;l<a;l++){for(let f=0;f<c.length;f++)c[f]=e.reedSolomonMultiply(c[f],u),f+1<c.length&&(c[f]^=c[f+1]);u=e.reedSolomonMultiply(u,2);}return c}static reedSolomonComputeRemainder(a,c){let u=c.map(l=>0);for(let l of a){let f=l^u.shift();u.push(0),c.forEach((p,m)=>u[m]^=e.reedSolomonMultiply(p,f));}return u}static reedSolomonMultiply(a,c){if(a>>>8||c>>>8)throw new RangeError("Byte out of range");let u=0;for(let l=7;l>=0;l--)u=u<<1^(u>>>7)*285,u^=(c>>>l&1)*a;return n(u>>>8==0),u}finderPenaltyCountPatterns(a){let c=a[1];n(c<=this.size*3);let u=c>0&&a[2]==c&&a[3]==c*3&&a[4]==c&&a[5]==c;return (u&&a[0]>=c*4&&a[6]>=c?1:0)+(u&&a[6]>=c*4&&a[0]>=c?1:0)}finderPenaltyTerminateAndCount(a,c,u){return a&&(this.finderPenaltyAddHistory(c,u),c=0),c+=this.size,this.finderPenaltyAddHistory(c,u),this.finderPenaltyCountPatterns(u)}finderPenaltyAddHistory(a,c){c[0]==0&&(a+=this.size),c.pop(),c.unshift(a);}static MIN_VERSION=1;static MAX_VERSION=40;static PENALTY_N1=3;static PENALTY_N2=3;static PENALTY_N3=40;static PENALTY_N4=10;static ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]];static NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]]}i.QrCode=e;function t(s,a,c){if(a<0||a>31||s>>>a)throw new RangeError("Value out of range");for(let u=a-1;u>=0;u--)c.push(s>>>u&1);}function r(s,a){return (s>>>a&1)!=0}function n(s){if(!s)throw new Error("Assertion error")}class o{constructor(a,c,u){this.mode=a;this.numChars=c;this.bitData=u;if(c<0)throw new RangeError("Invalid argument");this.bitData=u.slice();}mode;numChars;bitData;static makeBytes(a){let c=[];for(let u of a)t(u,8,c);return new o(o.Mode.BYTE,a.length,c)}static makeNumeric(a){if(!o.isNumeric(a))throw new RangeError("String contains non-numeric characters");let c=[];for(let u=0;u<a.length;){let l=Math.min(a.length-u,3);t(parseInt(a.substr(u,l),10),l*3+1,c),u+=l;}return new o(o.Mode.NUMERIC,a.length,c)}static makeAlphanumeric(a){if(!o.isAlphanumeric(a))throw new RangeError("String contains unencodable characters in alphanumeric mode");let c=[],u;for(u=0;u+2<=a.length;u+=2){let l=o.ALPHANUMERIC_CHARSET.indexOf(a.charAt(u))*45;l+=o.ALPHANUMERIC_CHARSET.indexOf(a.charAt(u+1)),t(l,11,c);}return u<a.length&&t(o.ALPHANUMERIC_CHARSET.indexOf(a.charAt(u)),6,c),new o(o.Mode.ALPHANUMERIC,a.length,c)}static makeSegments(a){return a==""?[]:o.isNumeric(a)?[o.makeNumeric(a)]:o.isAlphanumeric(a)?[o.makeAlphanumeric(a)]:[o.makeBytes(o.toUtf8ByteArray(a))]}static makeEci(a){let c=[];if(a<0)throw new RangeError("ECI assignment value out of range");if(a<128)t(a,8,c);else if(a<16384)t(2,2,c),t(a,14,c);else if(a<1e6)t(6,3,c),t(a,21,c);else throw new RangeError("ECI assignment value out of range");return new o(o.Mode.ECI,0,c)}static isNumeric(a){return o.NUMERIC_REGEX.test(a)}static isAlphanumeric(a){return o.ALPHANUMERIC_REGEX.test(a)}getData(){return this.bitData.slice()}static getTotalBits(a,c){let u=0;for(let l of a){let f=l.mode.numCharCountBits(c);if(l.numChars>=1<<f)return 1/0;u+=4+f+l.bitData.length;}return u}static toUtf8ByteArray(a){a=encodeURI(a);let c=[];for(let u=0;u<a.length;u++)a.charAt(u)!="%"?c.push(a.charCodeAt(u)):(c.push(parseInt(a.substr(u+1,2),16)),u+=2);return c}static NUMERIC_REGEX=/^[0-9]*$/;static ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/;static ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:"}i.QrSegment=o;})(Zr||={});(t=>{(n=>{class r{constructor(i,s){this.ordinal=i;this.formatBits=s;}ordinal;formatBits;static LOW=new r(0,1);static MEDIUM=new r(1,0);static QUARTILE=new r(2,3);static HIGH=new r(3,2)}n.Ecc=r;})(t.QrCode||={});})(Zr||={});(t=>{(n=>{class r{constructor(i,s){this.modeBits=i;this.numBitsCharCount=s;}modeBits;numBitsCharCount;static NUMERIC=new r(1,[10,12,14]);static ALPHANUMERIC=new r(2,[9,11,13]);static BYTE=new r(4,[8,16,16]);static KANJI=new r(8,[8,10,12]);static ECI=new r(7,[0,0,0]);numCharCountBits(i){return this.numBitsCharCount[Math.floor((i+7)/17)]}}n.Mode=r;})(t.QrSegment||={});})(Zr||={});var Ve=Zr;var gt={L:Ve.QrCode.Ecc.LOW,M:Ve.QrCode.Ecc.MEDIUM,Q:Ve.QrCode.Ecc.QUARTILE,H:Ve.QrCode.Ecc.HIGH},Je=128,jn="Q",Ne="#FFFFFF",Br="#000000";var qn=0;var yi=.1;function Ae(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 k={};At(k,{$brand:()=>Oc,$input:()=>lf,$output:()=>uf,INVALID:()=>Oe,NEVER:()=>Tc,TimePrecision:()=>wf,ZodAny:()=>um,ZodArray:()=>mm,ZodBase64:()=>da,ZodBase64URL:()=>ha,ZodBigInt:()=>Cn,ZodBigIntFormat:()=>ya,ZodBoolean:()=>vn,ZodCIDRv4:()=>pa,ZodCIDRv6:()=>ma,ZodCUID:()=>ia,ZodCUID2:()=>sa,ZodCatch:()=>Nm,ZodCodec:()=>Bo,ZodCompileAsyncError:()=>it,ZodCompileUnsupportedError:()=>H,ZodCreditCard:()=>tm,ZodCustom:()=>Uo,ZodCustomStringFormat:()=>fr,ZodDate:()=>Lo,ZodDefault:()=>Am,ZodDiscriminatedUnion:()=>hm,ZodE164:()=>ga,ZodEmail:()=>ta,ZodEmoji:()=>na,ZodEnum:()=>xn,ZodError:()=>z5,ZodExactOptional:()=>wa,ZodFile:()=>vm,ZodFirstPartyTypeKind:()=>Wm,ZodFunction:()=>Qm,ZodGUID:()=>ra,ZodIBAN:()=>rm,ZodIPv4:()=>la,ZodIPv6:()=>fa,ZodISODate:()=>Dt,ZodISODateTime:()=>Ft,ZodISODuration:()=>Bt,ZodISOTime:()=>Zt,ZodInstanceOf:()=>qm,ZodIntersection:()=>gm,ZodIssueCode:()=>T5,ZodJWT:()=>_a,ZodKSUID:()=>ua,ZodLazy:()=>Bm,ZodLiteral:()=>Sm,ZodMAC:()=>em,ZodMap:()=>xm,ZodNaN:()=>Tm,ZodNanoID:()=>oa,ZodNever:()=>fm,ZodNonOptional:()=>Sa,ZodNull:()=>am,ZodNullable:()=>km,ZodNumber:()=>Sn,ZodNumberFormat:()=>pr,ZodObject:()=>Oo,ZodOptional:()=>Do,ZodPipe:()=>Zo,ZodPrefault:()=>Rm,ZodPreprocess:()=>Om,ZodPromise:()=>Gm,ZodReadonly:()=>Fm,ZodRealError:()=>Ke,ZodRecord:()=>$n,ZodSet:()=>wm,ZodString:()=>wn,ZodStringFormat:()=>ie,ZodSuccess:()=>zm,ZodSymbol:()=>im,ZodTemplateLiteral:()=>Zm,ZodTransform:()=>Cm,ZodTuple:()=>ym,ZodType:()=>j,ZodULID:()=>aa,ZodURL:()=>No,ZodUUID:()=>dt,ZodUndefined:()=>sm,ZodUnion:()=>Fo,ZodUnknown:()=>lm,ZodVoid:()=>pm,ZodXID:()=>ca,ZodXor:()=>dm,_ZodString:()=>ea,_default:()=>Em,_function:()=>tg,any:()=>I1,array:()=>To,base64:()=>p1,base64url:()=>m1,bigint:()=>k1,boolean:()=>om,catch:()=>Lm,check:()=>rg,cidrv4:()=>l1,cidrv6:()=>f1,clone:()=>Y,codec:()=>J1,coerce:()=>Km,compile:()=>df,config:()=>me,core:()=>xt,creditCard:()=>h1,cuid:()=>r1,cuid2:()=>n1,currencyCode:()=>x1,custom:()=>ng,date:()=>N1,decode:()=>qp,decodeAsync:()=>Hp,deepPartial:()=>gg,describe:()=>og,discriminatedUnion:()=>Z1,e164:()=>d1,email:()=>j0,emoji:()=>e1,encode:()=>jp,encodeAsync:()=>Wp,endsWith:()=>un,enum:()=>$a,exactOptional:()=>Pm,file:()=>q1,flattenError:()=>oo,float32:()=>S1,float64:()=>v1,formatError:()=>io,fromJSONSchema:()=>dg,function:()=>tg,getDiscriminatedOption:()=>Tl,getErrorMap:()=>F5,globalRegistry:()=>Pe,gt:()=>pt,gte:()=>Ye,guid:()=>q0,hash:()=>w1,hex:()=>$1,hostname:()=>b1,httpUrl:()=>Y0,iban:()=>g1,includes:()=>an,input:()=>yg,instanceof:()=>sg,int:()=>Xs,int32:()=>C1,int64:()=>A1,intersection:()=>_m,invertCodec:()=>X1,ipv4:()=>a1,ipv6:()=>u1,iso:()=>Go,json:()=>cg,jwt:()=>_1,keyof:()=>L1,ksuid:()=>s1,lazy:()=>Um,length:()=>sr,literal:()=>j1,locales:()=>ms,looseObject:()=>F1,looseRecord:()=>U1,lowercase:()=>on,lt:()=>ft,lte:()=>Xe,mac:()=>c1,map:()=>G1,maxLength:()=>ir,maxSize:()=>Nt,memoizer:()=>vo,meta:()=>ig,mime:()=>fn,minLength:()=>$t,minSize:()=>mt,multipleOf:()=>zt,nan:()=>K1,nanoid:()=>t1,nativeEnum:()=>V1,negative:()=>Bs,never:()=>ba,nonnegative:()=>Gs,nonoptional:()=>Im,nonpositive:()=>Us,normalize:()=>pn,null:()=>cm,nullable:()=>zo,nullish:()=>W1,number:()=>nm,object:()=>T1,optional:()=>ur,output:()=>bg,overwrite:()=>st,parse:()=>Up,parseAsync:()=>Gp,partialRecord:()=>B1,pipe:()=>Ys,positive:()=>Zs,prefault:()=>Mm,preprocess:()=>ug,prettifyError:()=>Uc,promise:()=>eg,properties:()=>ln,property:()=>Qs,readonly:()=>Dm,record:()=>$m,refine:()=>Vm,regex:()=>nn,regexes:()=>rt,registry:()=>hs,safeDecode:()=>Jp,safeDecodeAsync:()=>Yp,safeEncode:()=>Kp,safeEncodeAsync:()=>Xp,safeParse:()=>Qp,safeParseAsync:()=>Vp,set:()=>Q1,setErrorMap:()=>O5,size:()=>or,slugify:()=>gn,startsWith:()=>cn,strictObject:()=>O1,string:()=>Io,stringFormat:()=>y1,stringbool:()=>ag,success:()=>H1,superRefine:()=>jm,symbol:()=>R1,templateLiteral:()=>Y1,toJSONSchema:()=>Ws,toLowerCase:()=>dn,toUpperCase:()=>hn,toZod:()=>Wn,transform:()=>xa,treeifyError:()=>Bc,trim:()=>mn,tuple:()=>bm,uint32:()=>P1,uint64:()=>E1,ulid:()=>o1,undefined:()=>M1,union:()=>Pn,unknown:()=>cr,uppercase:()=>sn,url:()=>X0,util:()=>O,uuid:()=>W0,uuidv4:()=>H0,uuidv6:()=>K0,uuidv7:()=>J0,validate:()=>so,validateAsync:()=>ao,void:()=>z1,withParser:()=>gs,xid:()=>i1,xor:()=>D1});var xt={};At(xt,{$ZodAny:()=>kl,$ZodArray:()=>zl,$ZodAsyncError:()=>We,$ZodBase64:()=>hl,$ZodBase64URL:()=>gl,$ZodBigInt:()=>ns,$ZodBigIntFormat:()=>Sl,$ZodBoolean:()=>yo,$ZodCIDRv4:()=>ml,$ZodCIDRv6:()=>dl,$ZodCUID:()=>tl,$ZodCUID2:()=>rl,$ZodCatch:()=>Xl,$ZodCheck:()=>ce,$ZodCheckBigIntFormat:()=>Au,$ZodCheckEndsWith:()=>Zu,$ZodCheckGreaterThan:()=>Bi,$ZodCheckIncludes:()=>Fu,$ZodCheckLengthEquals:()=>Nu,$ZodCheckLessThan:()=>Zi,$ZodCheckLowerCase:()=>Tu,$ZodCheckMaxLength:()=>Iu,$ZodCheckMaxSize:()=>Eu,$ZodCheckMimeType:()=>Gu,$ZodCheckMinLength:()=>zu,$ZodCheckMinSize:()=>Ru,$ZodCheckMultipleOf:()=>Pu,$ZodCheckNumberFormat:()=>ku,$ZodCheckOverwrite:()=>Qu,$ZodCheckProperties:()=>Uu,$ZodCheckProperty:()=>Bu,$ZodCheckRegex:()=>Lu,$ZodCheckSizeEquals:()=>Mu,$ZodCheckStartsWith:()=>Du,$ZodCheckStringFormat:()=>Yr,$ZodCheckUpperCase:()=>Ou,$ZodCodec:()=>$o,$ZodCreditCard:()=>yl,$ZodCustom:()=>sf,$ZodCustomStringFormat:()=>xl,$ZodCyclicError:()=>ls,$ZodDate:()=>Ml,$ZodDefault:()=>Wl,$ZodDiscriminatedUnion:()=>Ol,$ZodE164:()=>_l,$ZodEmail:()=>Hu,$ZodEmoji:()=>Yu,$ZodEncodeError:()=>Mt,$ZodEnum:()=>Ul,$ZodError:()=>Zc,$ZodExactOptional:()=>jl,$ZodFile:()=>Ql,$ZodFunction:()=>nf,$ZodGUID:()=>qu,$ZodIBAN:()=>bl,$ZodIPv4:()=>ll,$ZodIPv6:()=>fl,$ZodISODate:()=>al,$ZodISODateTime:()=>sl,$ZodISODuration:()=>ul,$ZodISOTime:()=>cl,$ZodIntersection:()=>Fl,$ZodJWT:()=>$l,$ZodKSUID:()=>il,$ZodLazy:()=>xo,$ZodLiteral:()=>Gl,$ZodMAC:()=>pl,$ZodMap:()=>Zl,$ZodNaN:()=>Yl,$ZodNanoID:()=>el,$ZodNever:()=>El,$ZodNonOptional:()=>Kl,$ZodNull:()=>Pl,$ZodNullable:()=>ql,$ZodNumber:()=>rs,$ZodNumberFormat:()=>wl,$ZodObject:()=>f0,$ZodObjectJIT:()=>Nl,$ZodOptional:()=>is,$ZodPipe:()=>ss,$ZodPrefault:()=>Hl,$ZodPreprocess:()=>ef,$ZodPromise:()=>of,$ZodReadonly:()=>tf,$ZodRealError:()=>He,$ZodRecord:()=>Dl,$ZodRegistry:()=>ds,$ZodSet:()=>Bl,$ZodString:()=>er,$ZodStringFormat:()=>ee,$ZodSuccess:()=>Jl,$ZodSymbol:()=>vl,$ZodTemplateLiteral:()=>rf,$ZodTransform:()=>Vl,$ZodTuple:()=>os,$ZodType:()=>G,$ZodULID:()=>nl,$ZodURL:()=>Xu,$ZodUUID:()=>Wu,$ZodUndefined:()=>Cl,$ZodUnion:()=>bo,$ZodUnknown:()=>Al,$ZodVoid:()=>Rl,$ZodXID:()=>ol,$ZodXor:()=>Ll,$brand:()=>Oc,$constructor:()=>v,$input:()=>lf,$output:()=>uf,Doc:()=>Yt,INVALID:()=>Oe,JSONSchema:()=>U0,JSONSchemaGenerator:()=>Hs,NEVER:()=>Tc,TimePrecision:()=>wf,URL_BAD_FORMAT:()=>Ku,URL_UNPARSEABLE:()=>po,ZodCompileAsyncError:()=>it,ZodCompileUnsupportedError:()=>H,_any:()=>Df,_array:()=>jf,_base64:()=>Ts,_base64url:()=>Os,_bigint:()=>If,_boolean:()=>Rf,_catch:()=>$5,_check:()=>P0,_cidrv4:()=>Ns,_cidrv6:()=>Ls,_coercedBigint:()=>zf,_coercedBoolean:()=>Mf,_coercedDate:()=>Qf,_coercedNumber:()=>vf,_coercedString:()=>yf,_creditCard:()=>$f,_cuid:()=>ks,_cuid2:()=>As,_custom:()=>Wf,_date:()=>Gf,_decode:()=>Ei,_decodeAsync:()=>Mi,_default:()=>_5,_discriminatedUnion:()=>i5,_e164:()=>Fs,_email:()=>bs,_emoji:()=>Cs,_encode:()=>Ai,_encodeAsync:()=>Ri,_endsWith:()=>un,_enum:()=>f5,_file:()=>qf,_float32:()=>Pf,_float64:()=>kf,_gt:()=>pt,_gte:()=>Ye,_guid:()=>$s,_iban:()=>xf,_includes:()=>an,_int:()=>Cf,_int32:()=>Af,_int64:()=>Nf,_intersection:()=>s5,_ipv4:()=>Is,_ipv6:()=>zs,_isoDate:()=>ko,_isoDateTime:()=>Po,_isoDuration:()=>Eo,_isoTime:()=>Ao,_jwt:()=>Ds,_ksuid:()=>Ms,_lazy:()=>v5,_length:()=>sr,_literal:()=>m5,_lowercase:()=>on,_lt:()=>ft,_lte:()=>Xe,_mac:()=>bf,_map:()=>u5,_max:()=>Xe,_maxLength:()=>ir,_maxSize:()=>Nt,_mime:()=>fn,_min:()=>Ye,_minLength:()=>$t,_minSize:()=>mt,_multipleOf:()=>zt,_nan:()=>Vf,_nanoid:()=>Ps,_nativeEnum:()=>p5,_negative:()=>Bs,_never:()=>Bf,_nonnegative:()=>Gs,_nonoptional:()=>y5,_nonpositive:()=>Us,_normalize:()=>pn,_null:()=>Ff,_nullable:()=>g5,_number:()=>Sf,_optional:()=>h5,_overwrite:()=>st,_parse:()=>Hr,_parseAsync:()=>Kr,_pipe:()=>x5,_positive:()=>Zs,_promise:()=>C5,_properties:()=>ln,_property:()=>Qs,_readonly:()=>w5,_record:()=>c5,_refine:()=>Hf,_regex:()=>nn,_safeDecode:()=>zi,_safeDecodeAsync:()=>Li,_safeEncode:()=>Ii,_safeEncodeAsync:()=>Ni,_safeParse:()=>Jr,_safeParseAsync:()=>Xr,_set:()=>l5,_size:()=>or,_slugify:()=>gn,_startsWith:()=>cn,_string:()=>_f,_stringFormat:()=>ar,_stringbool:()=>Yf,_success:()=>b5,_superRefine:()=>Kf,_symbol:()=>Tf,_templateLiteral:()=>S5,_toLowerCase:()=>dn,_toUpperCase:()=>hn,_transform:()=>d5,_trim:()=>mn,_tuple:()=>a5,_uint32:()=>Ef,_uint64:()=>Lf,_ulid:()=>Es,_undefined:()=>Of,_union:()=>n5,_unknown:()=>Zf,_uppercase:()=>sn,_url:()=>Co,_uuid:()=>xs,_uuidv4:()=>ws,_uuidv6:()=>Ss,_uuidv7:()=>vs,_void:()=>Uf,_xid:()=>Rs,_xor:()=>o5,base64Charset:()=>Ji,base64urlCharset:()=>_o,canParseURL:()=>Ju,clone:()=>Y,compile:()=>df,compileFn:()=>_s,config:()=>me,createStandardJSONSchemaMethod:()=>_n,createToJSONSchemaMethod:()=>tp,decode:()=>f$,decodeAsync:()=>m$,describe:()=>Jf,encode:()=>l$,encodeAsync:()=>p$,extractDefs:()=>Tt,finalize:()=>Ot,flattenError:()=>oo,formatError:()=>io,getDiscriminatedOption:()=>Tl,globalConfig:()=>we,globalRegistry:()=>Pe,handleUnrepresentable:()=>ge,initializeContext:()=>Lt,isBackEdge:()=>ps,isRecursiveSchema:()=>fs,isValidBase64:()=>go,isValidBase64URL:()=>Xi,isValidCIDRv6:()=>Ki,isValidCreditCard:()=>Yi,isValidIBAN:()=>es,isValidIPv6:()=>ho,isValidJWT:()=>ts,locales:()=>ms,memoizer:()=>vo,mergeValues:()=>en,meta:()=>Xf,parse:()=>Pi,parseAsync:()=>ki,parseURLObject:()=>c0,prettifyError:()=>Uc,process:()=>te,processSchema:()=>te,regexes:()=>rt,registry:()=>hs,safeDecode:()=>h$,safeDecodeAsync:()=>_$,safeEncode:()=>d$,safeEncodeAsync:()=>g$,safeParse:()=>i$,safeParseAsync:()=>s$,standardProps:()=>ji,stripTabAndNewline:()=>mo,toDotPath:()=>Bh,toJSONSchema:()=>Ws,toZod:()=>Wn,treeifyError:()=>Bc,urlHostnameOk:()=>Wi,urlProtocolOk:()=>Hi,util:()=>O,validate:()=>so,validateAsync:()=>ao,validateURL:()=>qi,version:()=>Vu,withParser:()=>gs});var O={};At(O,{BIGINT_FORMAT_RANGES:()=>Yn,CONSTANT_CATCH:()=>vi,Class:()=>Cc,NUMBER_FORMAT_RANGES:()=>Xn,aborted:()=>Te,allowsEval:()=>Ac,assert:()=>Cb,assertEqual:()=>xb,assertIs:()=>Sb,assertNever:()=>vb,assertNotEqual:()=>wb,assignProp:()=>Ce,attachSchema:()=>eo,base64ToUint8Array:()=>Lh,base64urlToUint8Array:()=>Qb,cached:()=>Vr,captureStackTrace:()=>xi,cleanEnum:()=>Gb,cleanRegex:()=>yt,clone:()=>Y,cloneDef:()=>Ab,codePointLength:()=>Jt,constantCatch:()=>Nc,createTransparentProxy:()=>Nb,defineLazy:()=>Pc,defineLazyInternal:()=>q,derived:()=>Wb,esc:()=>Le,escapeRegex:()=>tt,explicitlyAborted:()=>Mc,extend:()=>Ob,finalizeIssue:()=>qe,floatSafeRemainder:()=>Hn,getElementAtPath:()=>Eb,getEnumValues:()=>Gr,getLengthableOrigin:()=>ro,getParsedType:()=>zb,getSizableOrigin:()=>to,hexToUint8Array:()=>jb,hide:()=>no,installLazyProp:()=>Xb,isObject:()=>Kt,isPlainObject:()=>et,issue:()=>Wr,joinValues:()=>bi,jsonStringifyReplacer:()=>Qr,members:()=>zc,merge:()=>Db,mergeDefs:()=>ot,normalizeParams:()=>z,nullish:()=>$i,numKeys:()=>Ib,objectClone:()=>Pb,omit:()=>Tb,optionalKeys:()=>Rc,own:()=>Rt,parsedType:()=>Ic,partial:()=>Zb,pick:()=>Lb,prefixIssues:()=>je,primitiveTypes:()=>Ec,promiseAllObject:()=>Rb,propertyKeyTypes:()=>Jn,randomString:()=>Mb,rawShape:()=>jr,required:()=>Bb,safeExtend:()=>Fb,shallowClone:()=>Kn,sizeCaps:()=>qr,slugify:()=>kc,stringifyPrimitive:()=>wi,toZod:()=>Wn,uint8ArrayToBase64:()=>Th,uint8ArrayToBase64url:()=>Vb,uint8ArrayToHex:()=>qb,unwrapMessage:()=>Ur});function xb(e){return e}function wb(e){return e}function Wn(){return e=>e}function Sb(e){}function vb(e){throw new Error("Unexpected value in exhaustive check")}function Cb(e){}function Gr(e){let t=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,o])=>t.indexOf(+n)===-1).map(([n,o])=>o)}function bi(e,t="|"){return e.map(r=>wi(r)).join(t)}function Qr(e,t){return typeof t=="bigint"?t.toString():t}var vc=class{constructor(t){this._getter=t,this._value=void 0;}get value(){let t=this._getter;return t!==void 0&&(this._value=t(),this._getter=void 0),this._value}};function Vr(e){return new vc(e)}function $i(e){return e==null}function yt(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function Hn(e,t){let r=e/t,n=Math.round(r),o=4*Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-n)<o?0:r-n}var Mh=Symbol("evaluating");function Pc(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==Mh)return n===void 0&&(n=Mh,n=r()),n},set(o){Object.defineProperty(e,t,{value:o});},configurable:true});}function Pb(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function Ce(e,t,r){Object.defineProperty(e,t,{value:r,writable:true,enumerable:true,configurable:true});}function jr(e){let t=Object.getOwnPropertyDescriptor(e,"shape");return t?.get?t.get.raw:t?.value}function _t(e){return jr(e._zod.def)??e._zod.def.shape}function Ih(e,t,r){Object.defineProperty(e,t,{get(){let n=r();return Ce(this,t,n),n},enumerable:true,configurable:true});}function zh(e,t,r){t in e?Ce(e,t,r):e[t]=r;}function Ht(e,t,r,n){let o=_t(t);for(let i of r){let s=Object.getOwnPropertyDescriptor(o,i);s.enumerable&&(s.get?Ih(e,i,()=>{let a=t._zod.def.shape[i];return n?n(a,i):a}):zh(e,i,n?n(s.value,i):s.value));}}function kb(e,t){for(let r of Reflect.ownKeys(t)){let n=Object.getOwnPropertyDescriptor(t,r);n.enumerable&&(n.get?Ih(e,r,()=>t[r]):zh(e,r,n.value));}}function ot(...e){let t={};for(let r of e){let n=Object.getOwnPropertyDescriptors(r);Object.assign(t,n);}return Object.defineProperties({},t)}function Ab(e){return ot(e._zod.def)}function Eb(e,t){return t?t.reduce((r,n)=>r?.[n],e):e}function Rb(e){let t=Object.keys(e),r=t.map(n=>e[n]);return Promise.all(r).then(n=>{let o={};for(let i=0;i<t.length;i++)o[t[i]]=n[i];return o})}function Mb(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let n=0;n<e;n++)r+=t[Math.floor(Math.random()*t.length)];return r}function Le(e){return JSON.stringify(e)}function kc(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var xi="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Kt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var Ac=Vr(()=>{if(we.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return false;try{let e=Function;return new e(""),!0}catch{return false}});function et(e){if(Kt(e)===false)return false;let t=e.constructor;if(t===void 0||typeof t!="function")return true;let r=t.prototype;return !(Kt(r)===false||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===false)}function Kn(e){return et(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function Ib(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}var zb=e=>{let t=typeof e;switch(t){case "undefined":return "undefined";case "string":return "string";case "number":return Number.isNaN(e)?"nan":"number";case "boolean":return "boolean";case "function":return "function";case "bigint":return "bigint";case "symbol":return "symbol";case "object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},Jn=new Set(["string","number","symbol"]),Ec=new Set(["string","number","bigint","boolean","symbol","undefined"]);function tt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Y(e,t,r){let n=new e._zod.constr(t??e._zod.def);return (!t||r?.parent)&&(n._zod.parent=e),n}function z(e){let t=e;if(!t)return {};if(typeof t=="string")return {error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message;}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function Nb(e){let t;return new Proxy({},{get(r,n,o){return t??(t=e()),Reflect.get(t,n,o)},set(r,n,o,i){return t??(t=e()),Reflect.set(t,n,o,i)},has(r,n){return t??(t=e()),Reflect.has(t,n)},deleteProperty(r,n){return t??(t=e()),Reflect.deleteProperty(t,n)},ownKeys(r){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(r,n){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,n)},defineProperty(r,n,o){return t??(t=e()),Reflect.defineProperty(t,n,o)}})}function wi(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function Rc(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}var Xn={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Yn={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Lb(e,t){let r=e._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let i={};return Ht(i,e,Si(e,t)),Y(e,ot(r,{shape:i,checks:[]}))}function Si(e,t){let r=_t(e),n=[];for(let o of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(r,o)?.enumerable)throw new Error(`Unrecognized key: "${String(o)}"`);t[o]&&n.push(o);}return n}function Tb(e,t){let r=e._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let i=new Set(Si(e,t)),s={};return Ht(s,e,Reflect.ownKeys(_t(e)).filter(a=>!i.has(a))),Y(e,ot(r,{shape:s,checks:[]}))}function Ob(e,t){if(!et(t))throw new Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let o=_t(e);for(let i of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(o,i)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return Y(e,ot(e._zod.def,{shape:Nh(e,t)}))}function Nh(e,t){let r={};return Ht(r,e,Reflect.ownKeys(_t(e))),kb(r,t),r}function Fb(e,t){if(!et(t))throw new Error("Invalid input to safeExtend: expected a plain object");return Y(e,ot(e._zod.def,{shape:Nh(e,t)}))}function Db(e,t){if(!t?._zod?.def)throw new Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r={};Ht(r,e,Reflect.ownKeys(_t(e))),Ht(r,t,Reflect.ownKeys(_t(t)));let n=ot(e._zod.def,{shape:r,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return Y(e,n)}function Zb(e,t,r,n="partial"){let i=t._zod.def.checks;if(i&&i.length>0)throw new Error(`.${n}() cannot be used on object schemas containing refinements`);let a=r?new Set(Si(t,r)):void 0,c={};return Ht(c,t,Reflect.ownKeys(_t(t)),e&&((u,l)=>a&&!a.has(l)?u:new e({type:"optional",innerType:u}))),Y(t,ot(t._zod.def,{shape:c,checks:[]}))}function Bb(e,t,r){let n=r?new Set(Si(t,r)):void 0,o={};return Ht(o,t,Reflect.ownKeys(_t(t)),(i,s)=>n&&!n.has(s)?i:new e({type:"nonoptional",innerType:i})),Y(t,ot(t._zod.def,{shape:o}))}function Te(e,t=0){if(e.aborted===true)return true;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==true)return true;return false}function Mc(e,t=0){if(e.aborted===true)return true;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue===false)return true;return false}function je(e,t){return t.map(r=>{var n;return (n=r).path??(n.path=[]),r.path.unshift(e),r})}function Ur(e){return typeof e=="string"?e:e?.message}function qr(e){let t=[];for(let r of e??[]){let n=r._zod.def;if(!/_(length|size)$|_equals$/.test(n.check))break;let o=n.maximum??n.length??n.size;o>=0&&t.push([o,r]);}return t}function eo(e,t,r){var n;for(let o=t;o<e.length;o++)(n=e[o]).schema??(n.schema=r);}function qe(e,t,r){var n;let o=e.inst?._zod?.traits;o?.has("$ZodType")&&(o.has("$ZodCheck")?(n=e).schema??(n.schema=e.inst):e.schema=e.inst);let i=e.schema!==e.inst?e.schema?._zod.def?.error:void 0,s=e.message?e.message:Ur(e.inst?._zod.def?.error?.(e))??Ur(i?.(e))??Ur(t?.error?.(e))??Ur(r.customError?.(e))??Ur(r.localeError?.(e))??"Invalid input",a={};for(let c of Object.keys(e))c==="inst"||c==="schema"||c==="continue"||c==="input"||c==="__proto__"||(a[c]=e[c]);return a.path??(a.path=[]),a.message=s,t?.reportInput&&(a.input=e.input),a}function to(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}var Ub=/[\uD800-\uDBFF]/;function Jt(e){let t=e.length;if(!Ub.test(e))return t;let r=t;for(let n=0;n<t-1;n++)(e.charCodeAt(n)&64512)===55296&&(e.charCodeAt(n+1)&64512)===56320&&(r--,n++);return r}function ro(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Ic(e){let t=typeof e;switch(t){case "number":return Number.isNaN(e)?"nan":"number";case "object":{if(e===null)return "null";if(Array.isArray(e))return "array";let r=e;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return t}function Wr(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}function Gb(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function Lh(e){let t=atob(e),r=new Uint8Array(t.length);for(let n=0;n<t.length;n++)r[n]=t.charCodeAt(n);return r}function Th(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function Qb(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return Lh(t+r)}function Vb(e){return Th(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function jb(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let r=new Uint8Array(t.length/2);for(let n=0;n<t.length;n+=2)r[n/2]=Number.parseInt(t.slice(n,n+2),16);return r}function qb(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var Cc=class{constructor(...t){}};function zc(e,t){for(let r in t){let n=Object.getOwnPropertyDescriptor(t,r);n.get?Object.defineProperty(e,r,{...n,enumerable:false}):Hb(e,r,n.value);}}function Rt(e,t,r,n=true){return Object.defineProperty(e,t,{configurable:true,writable:true,enumerable:n,value:r}),r}function no(e,t,r){return Rt(e,t,r,false)}function Wb(e,t){for(let r in e){let n=e[r];Object.defineProperty(t,r,{configurable:true,enumerable:true,get(){return Rt(this,r,n(this))},set(o){Rt(this,r,o);}});}return t}function Hb(e,t,r){Object.defineProperty(e,t,{configurable:true,get(){return this==null?r:Rt(this,t,r.bind(this))},set(n){Rt(this,t,n);}});}function Kb(e,t){let r=Object.getPrototypeOf(e);return t in r?void 0:r}var Sc,Et=false,Jb={configurable:true,get(){Et=true;}};function q(e,t,r){let n=Object.getPrototypeOf(e._zod);if(t in n&&Sc!==e._zod){Sc=void 0;return}Sc=e._zod,Object.defineProperty(n,t,{configurable:true,get(){Object.defineProperty(this,t,Jb);let o=Et;Et=false;try{let i=r(this);return Et?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:i}),Et=Et||o,i}catch(i){throw delete this[t],Et=Et||o,i}},set(o){Object.defineProperty(this,t,{configurable:true,writable:true,value:o});}});}function Xb(e,t,r,n){let o=Kb(e,t);o&&Object.defineProperty(o,t,{configurable:true,get(){let i={configurable:true,writable:true,enumerable:n,value:void 0};return Object.defineProperty(this,t,i),i.value=r(this),Object.defineProperty(this,t,i),i.value},set(i){Object.defineProperty(this,t,{configurable:true,writable:true,enumerable:n,value:i});}});}var vi="~constantCatch";function Nc(e){let t=()=>e;return t[vi]=true,t}var Oh,Tc=Object.freeze({status:"aborted"}),Lc={value:void 0,enumerable:false},Fh="captureStackTrace"in Error?Error:null;function Yb(e){let t=Fh;if(t){let r=t.stackTraceLimit;if(typeof r=="number"){try{t.stackTraceLimit=0;}catch{return Fh=null,new e}try{return new e}finally{t.stackTraceLimit=r;}}}return new e}function v(e,t,r,n){let o={};function i(p){this.def=p,this.constr=f,this.traits=new Set;}i.prototype=o;let s=r,a=s&&new WeakSet;function c(p,m){if(p._zod){if(p._zod.traits.has(e))return}else {Lc.value=new i(m);try{Object.defineProperty(p,"_zod",Lc);}finally{Lc.value=void 0;}}if(p._zod.traits.add(e),t(p,m),a){let d=Object.getPrototypeOf(p),g=p._zod.constr.prototype,y=d;for(;y&&y!==g;)y=Object.getPrototypeOf(y);let _=y??d;a.has(_)||(a.add(_),zc(_,s));}let h=f.prototype;for(let d in h)Object.prototype.hasOwnProperty.call(h,d)&&(d in p||(p[d]=h[d].bind(p)));}let u=n?.Parent??Object;class l extends u{}Object.defineProperty(l,"name",{value:e});function f(p){let m=n?.Parent?Yb(l):this;c(m,p);let h=m._zod.deferred;if(h){for(let g of h)g();m._zod.deferred=void 0;}let d=globalThis.__zod_globalConfig?.postProcessor;return d&&d(m),m}return Object.defineProperty(f,"init",{value:c}),Object.defineProperty(f,Symbol.hasInstance,{value:p=>n?.Parent&&p instanceof n.Parent?true:p?._zod?.traits?.has(e)}),Object.defineProperty(f,"name",{value:e}),f}var Oc=Symbol("zod_brand"),We=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.");}},Mt=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError";}};(Oh=globalThis).__zod_globalConfig??(Oh.__zod_globalConfig={});var we=globalThis.__zod_globalConfig;function me(e){return e&&Object.assign(we,e),we}function e$(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,Qr,2)),e.message}function t$(e){this._zod.message=e;}var r$={get:e$,set:t$,enumerable:true,configurable:true},Dc={value:void 0,enumerable:false},Dh=new WeakSet([Object.prototype,Error.prototype]),Zh=(e,t)=>{e.name="$ZodError",Dc.value=t,Object.defineProperty(e,"issues",Dc),Dc.value=void 0,Object.defineProperty(e,"message",r$);let r=Object.getPrototypeOf(e);Dh.has(r)||(Dh.add(r),Object.defineProperty(r,"toString",{configurable:true,enumerable:false,get(){let n=()=>this.message;return Object.defineProperty(this,"toString",{value:n,configurable:true,writable:true}),n},set(n){Object.defineProperty(this,"toString",{value:n,configurable:true,writable:true});}}));},Zc=v("$ZodError",Zh),He=v("$ZodError",Zh,void 0,{Parent:Error});function n$(e,t,r){return Object.prototype.hasOwnProperty.call(e,t)||(t==="__proto__"?Object.defineProperty(e,t,{value:r(),writable:true,enumerable:true,configurable:true}):e[t]=r()),e[t]}function oo(e,t=r=>r.message){let r={},n=[];for(let o of e.issues)o.path.length>0?n$(r,o.path[0],()=>[]).push(t(o)):n.push(t(o));return {formErrors:n,fieldErrors:r}}function io(e,t=r=>r.message){let r={_errors:[]},n=(o,i=[])=>{for(let s of o.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(a=>n({issues:a},[...i,...s.path]));else if(s.code==="invalid_key")n({issues:s.issues},[...i,...s.path]);else if(s.code==="invalid_element")n({issues:s.issues},[...i,...s.path]);else {let a=[...i,...s.path];if(a.length===0)r._errors.push(t(s));else {let c=r,u=0;for(;u<a.length;){let l=a[u],f=u===a.length-1;if(l==="_errors"){f&&c._errors.push(t(s)),u++;continue}Object.prototype.hasOwnProperty.call(c,l)||Object.defineProperty(c,l,{value:{_errors:[]},enumerable:true,writable:true,configurable:true});let p=c[l];f&&p._errors.push(t(s)),c=p,u++;}}}};return n(e),r}function Bc(e,t=r=>r.message){let r={errors:[]},n=(o,i=[])=>{var s;for(let a of o.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(c=>n({issues:c},[...i,...a.path]));else if(a.code==="invalid_key")n({issues:a.issues},[...i,...a.path]);else if(a.code==="invalid_element")n({issues:a.issues},[...i,...a.path]);else {let c=[...i,...a.path];if(c.length===0){r.errors.push(t(a));continue}let u=r,l=0;for(;l<c.length;){let f=c[l],p=l===c.length-1;typeof f=="string"?(u.properties??(u.properties={}),Object.prototype.hasOwnProperty.call(u.properties,f)||Object.defineProperty(u.properties,f,{value:{errors:[]},enumerable:true,writable:true,configurable:true}),u=u.properties[f]):(u.items??(u.items=[]),(s=u.items)[f]??(s[f]={errors:[]}),u=u.items[f]),p&&u.errors.push(t(a)),l++;}}};return n(e),r}function Bh(e){let t=[],r=e.map(n=>typeof n=="object"?n.key:n);for(let n of r)typeof n=="number"?t.push(`[${n}]`):typeof n=="symbol"?t.push(`[${JSON.stringify(String(n))}]`):/[^\w$]/.test(n)?t.push(`[${JSON.stringify(n)}]`):(t.length&&t.push("."),t.push(n));return t.join("")}function Uc(e){let t=[],r=[...e.issues].sort((n,o)=>(n.path??[]).length-(o.path??[]).length);for(let n of r)t.push(`\u2716 ${n.message}`),n.path?.length&&t.push(` \u2192 at ${Bh(n.path)}`);return t.join(`
2
+ `)}function Ci(e,t){return {callee:t?.callee??e,Err:t?.Err}}var Hr=e=>{let t=(r,n,o,i)=>{let s=o?{...o,async:false}:{async:false},a=r._zod.run({value:n,issues:[]},s);if(a instanceof Promise)throw new We;if(a.issues.length){let c=new(i?.Err??e)(a.issues.map(u=>qe(u,s,me())));throw xi(c,i?.callee??t),c}return a.value};return t},Pi=Hr(He),Kr=e=>{let t=async(r,n,o,i)=>{let s=o?{...o,async:true}:{async:true},a=r._zod.run({value:n,issues:[]},s);if(a instanceof Promise&&(a=await a),a.issues.length){let c=new(i?.Err??e)(a.issues.map(u=>qe(u,s,me())));throw xi(c,i?.callee??t),c}return a.value};return t},ki=Kr(He),Jr=e=>(t,r,n)=>{let o=n?{...n,async:false}:{async:false},i=t._zod.run({value:r,issues:[]},o);if(i instanceof Promise)throw new We;return i.issues.length?Uh(e,i.issues,o):{success:true,data:i.value}},i$=Jr(He);function Uh(e,t,r){let n;return {success:false,get error(){return n||(n=new e(t.map(o=>qe(o,r,me()))),t=void 0,r=void 0),n},set error(o){n=o,t=void 0,r=void 0;}}}var Xr=e=>async(t,r,n)=>{let o=n?{...n,async:true}:{async:true},i=t._zod.run({value:r,issues:[]},o);return i instanceof Promise&&(i=await i),i.issues.length?Uh(e,i.issues,o):{success:true,data:i.value}},s$=Xr(He),a$=Symbol.for("zod.compile.invalid"),c$=Symbol.for("zod.compile.fallback"),so=((e,t,r)=>{let n=e._zod.bag.validator;if(n!==void 0){if(n(t)!==a$)return true;if(n.definite===true&&r===void 0)return false}return u$(e,t,r)});function u$(e,t,r){let n=r?{...r,async:false,abortEarly:true}:{async:false,abortEarly:true},o=e._zod.bag.fallbackRun,i;if(o?(n[c$]=true,i=o({value:t,issues:[]},n)):i=e._zod.run({value:t,issues:[]},n),i instanceof Promise)throw new We;return i.issues.length===0}var ao=async(e,t,r)=>{let n=r?{...r,async:true,abortEarly:true}:{async:true,abortEarly:true},o=e._zod.run({value:t,issues:[]},n);return o instanceof Promise&&(o=await o),o.issues.length===0},Ai=e=>{let t=Hr(e),r=(n,o,i,s)=>{let a=i?{...i,direction:"backward"}:{direction:"backward"};return t(n,o,a,Ci(r,s))};return r},l$=Ai(He),Ei=e=>{let t=Hr(e),r=(n,o,i,s)=>t(n,o,i,Ci(r,s));return r},f$=Ei(He),Ri=e=>{let t=Kr(e),r=async(n,o,i,s)=>{let a=i?{...i,direction:"backward"}:{direction:"backward"};return await t(n,o,a,Ci(r,s))};return r},p$=Ri(He),Mi=e=>{let t=Kr(e),r=async(n,o,i,s)=>await t(n,o,i,Ci(r,s));return r},m$=Mi(He),Ii=e=>(t,r,n)=>{let o=n?{...n,direction:"backward"}:{direction:"backward"};return Jr(e)(t,r,o)},d$=Ii(He),zi=e=>(t,r,n)=>Jr(e)(t,r,n),h$=zi(He),Ni=e=>async(t,r,n)=>{let o=n?{...n,direction:"backward"}:{direction:"backward"};return Xr(e)(t,r,o)},g$=Ni(He),Li=e=>async(t,r,n)=>Xr(e)(t,r,n),_$=Li(He);var rt={};At(rt,{anyString:()=>hu,base64:()=>su,base64url:()=>au,bigint:()=>_u,boolean:()=>yu,browserEmail:()=>C$,cidrv4:()=>ou,cidrv6:()=>iu,creditCard:()=>Ti,cuid:()=>Qc,cuid2:()=>Vc,currencyCode:()=>fu,date:()=>pu,datetime:()=>du,domain:()=>uu,duration:()=>Jc,e164:()=>lu,email:()=>Yc,emoji:()=>eu,extendedDuration:()=>y$,guid:()=>Xc,hex:()=>Su,hostname:()=>cu,html5Email:()=>w$,httpProtocol:()=>co,iban:()=>Oi,idnEmail:()=>v$,integer:()=>uo,ipv4:()=>tu,ipv6:()=>ru,ksuid:()=>Wc,lowercase:()=>xu,mac:()=>nu,md5_base64:()=>E$,md5_base64url:()=>R$,md5_hex:()=>A$,nanoid:()=>Hc,nanoidOfLength:()=>Kc,null:()=>bu,number:()=>bt,rfc5322Email:()=>S$,sha1_base64:()=>I$,sha1_base64url:()=>z$,sha1_hex:()=>M$,sha256_base64:()=>L$,sha256_base64url:()=>T$,sha256_hex:()=>N$,sha384_base64:()=>F$,sha384_base64url:()=>D$,sha384_hex:()=>O$,sha512_base64:()=>B$,sha512_base64url:()=>U$,sha512_hex:()=>Z$,string:()=>gu,time:()=>mu,ulid:()=>jc,undefined:()=>$u,unicodeEmail:()=>Gh,uppercase:()=>wu,uuid:()=>Xt,uuid4:()=>b$,uuid6:()=>$$,uuid7:()=>x$,xid:()=>qc});var Qc=/^[cC][0-9a-z]{6,}$/,Vc=/^[0-9a-z]+$/,jc=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,qc=/^[0-9a-vA-V]{20}$/,Wc=/^[A-Za-z0-9]{27}$/,Hc=/^[a-zA-Z0-9_-]{21}$/;function Kc(e){return new RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var Jc=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,y$=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Xc=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Xt=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,b$=Xt(4),$$=Xt(6),x$=Xt(7),Yc=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,w$=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,S$=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,Gh=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,v$=Gh,C$=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,P$="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function eu(){return new RegExp(P$,"u")}var tu=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ru=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,nu=e=>{let t=tt(e??":");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},ou=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,iu=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,su=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,au=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,cu=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,uu=/^(?=.{1,253}$)([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,63}$/,co=/^https?$/,lu=/^\+[1-9]\d{6,14}$/,Ti=/^\d(?:[ -]?\d){11,18}$/,fu=/^(?:AED|AFN|ALL|AMD|AOA|ARS|AUD|AWG|AZN|BAM|BBD|BDT|BHD|BIF|BMD|BND|BOB|BOV|BRL|BSD|BTN|BWP|BYN|BZD|CAD|CDF|CHE|CHF|CHW|CLF|CLP|CNY|COP|COU|CRC|CUP|CVE|CZK|DJF|DKK|DOP|DZD|EGP|ERN|ETB|EUR|FJD|FKP|GBP|GEL|GHS|GIP|GMD|GNF|GTQ|GYD|HKD|HNL|HTG|HUF|IDR|ILS|INR|IQD|IRR|ISK|JMD|JOD|JPY|KES|KGS|KHR|KMF|KPW|KRW|KWD|KYD|KZT|LAK|LBP|LKR|LRD|LSL|LYD|MAD|MDL|MGA|MKD|MMK|MNT|MOP|MRU|MUR|MVR|MWK|MXN|MXV|MYR|MZN|NAD|NGN|NIO|NOK|NPR|NZD|OMR|PAB|PEN|PGK|PHP|PKR|PLN|PYG|QAR|RON|RSD|RUB|RWF|SAR|SBD|SCR|SDG|SEK|SGD|SHP|SLE|SOS|SRD|SSP|STN|SVC|SYP|SZL|THB|TJS|TMT|TND|TOP|TRY|TTD|TWD|TZS|UAH|UGX|USD|USN|UYI|UYU|UYW|UZS|VED|VES|VND|VUV|WST|XAD|XAF|XAG|XAU|XBA|XBB|XBC|XBD|XCD|XCG|XDR|XOF|XPD|XPF|XPT|XSU|XTS|XUA|XXX|YER|ZAR|ZMW|ZWG)$/,Oi=/^[A-Z]{2}(?!00|01|99)\d{2}[A-Z0-9]{11,30}$/,Qh="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))";function k$(e){return new RegExp(`^${e}$`)}var pu=k$(Qh);function Gc(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function mu(e){return new RegExp(`^${Gc(e)}$`)}function du(e){let t=["Z"];e.offset&&t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let r=`${Gc({precision:e.precision,seconds:true})}(?:${t.join("|")})`,n=e.local?`${r}|${Gc({precision:e.precision})}`:r;return new RegExp(`^${Qh}T(?:${n})$`)}var hu=/^[\s\S]{0,}$/,gu=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},_u=/^-?\d+n?$/,uo=/^-?\d+$/,bt=/^-?\d+(?:\.\d+)?$/,yu=/^(?:true|false)$/i,bu=/^null$/i;var $u=/^undefined$/i;var xu=/^[^A-Z]*$/,wu=/^[^a-z]*$/,Su=/^[0-9a-fA-F]*$/;function lo(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function fo(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}var A$=/^[0-9a-fA-F]{32}$/,E$=lo(22,"=="),R$=fo(22),M$=/^[0-9a-fA-F]{40}$/,I$=lo(27,"="),z$=fo(27),N$=/^[0-9a-fA-F]{64}$/,L$=lo(43,"="),T$=fo(43),O$=/^[0-9a-fA-F]{96}$/,F$=lo(64,""),D$=fo(64),Z$=/^[0-9a-fA-F]{128}$/,B$=lo(86,"=="),U$=fo(86);var ce=v("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[]);}),vu=e=>{let t=e.value;return !$i(t)&&t.size!==void 0},Cu=e=>{let t=e.value;return !$i(t)&&t.length!==void 0},Fi={number:"number",bigint:"bigint",object:"date"},Zi=v("$ZodCheckLessThan",(e,t)=>{ce.init(e,t);let r=Fi[typeof t.value];e._zod.check=n=>{(t.inclusive?n.value<=t.value:n.value<t.value)||n.issues.push({origin:Fi[typeof n.value]??r,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort});};}),Bi=v("$ZodCheckGreaterThan",(e,t)=>{ce.init(e,t);let r=Fi[typeof t.value];e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:Fi[typeof n.value]??r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort});};}),Pu=v("$ZodCheckMultipleOf",(e,t)=>{ce.init(e,t),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?t.value!==BigInt(0)&&r.value%t.value===BigInt(0):Hn(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort});};}),ku=v("$ZodCheckNumberFormat",(e,t)=>{ce.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[o,i]=Xn[t.format];e._zod.check=s=>{let a=s.value;if(r){if(!Number.isInteger(a)){s.issues.push({expected:n,format:t.format,code:"invalid_type",continue:false,input:a,inst:e});return}if(!Number.isSafeInteger(a)){a>0?s.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:true,continue:!t.abort}):s.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:true,continue:!t.abort});return}}a<o&&s.issues.push({origin:"number",input:a,code:"too_small",minimum:o,inclusive:true,inst:e,continue:!t.abort}),a>i&&s.issues.push({origin:"number",input:a,code:"too_big",maximum:i,inclusive:true,inst:e,continue:!t.abort});};}),Au=v("$ZodCheckBigIntFormat",(e,t)=>{ce.init(e,t);let[r,n]=Yn[t.format];e._zod.check=o=>{let i=o.value;i<r&&o.issues.push({origin:"bigint",input:i,code:"too_small",minimum:r,inclusive:true,inst:e,continue:!t.abort}),i>n&&o.issues.push({origin:"bigint",input:i,code:"too_big",maximum:n,inclusive:true,inst:e,continue:!t.abort});};}),Eu=v("$ZodCheckMaxSize",(e,t)=>{var r;ce.init(e,t),(r=e._zod.def).when??(r.when=vu),e._zod.check=n=>{let o=n.value;o.size<=t.maximum||n.issues.push({origin:to(o),code:"too_big",maximum:t.maximum,inclusive:true,input:o,inst:e,continue:!t.abort});};}),Ru=v("$ZodCheckMinSize",(e,t)=>{var r;ce.init(e,t),(r=e._zod.def).when??(r.when=vu),e._zod.check=n=>{let o=n.value;o.size>=t.minimum||n.issues.push({origin:to(o),code:"too_small",minimum:t.minimum,inclusive:true,input:o,inst:e,continue:!t.abort});};}),Mu=v("$ZodCheckSizeEquals",(e,t)=>{var r;ce.init(e,t),(r=e._zod.def).when??(r.when=vu),e._zod.check=n=>{let o=n.value,i=o.size;if(i===t.size)return;let s=i>t.size;n.issues.push({origin:to(o),...s?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:true,exact:true,input:n.value,inst:e,continue:!t.abort});};}),Iu=v("$ZodCheckMaxLength",(e,t)=>{var r;ce.init(e,t),(r=e._zod.def).when??(r.when=Cu),e._zod.check=n=>{let o=n.value,i=o.length;if((typeof o=="string"&&i>t.maximum?Jt(o):i)<=t.maximum)return;let a=ro(o);n.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:true,input:o,inst:e,continue:!t.abort});};}),zu=v("$ZodCheckMinLength",(e,t)=>{var r;ce.init(e,t),(r=e._zod.def).when??(r.when=Cu),e._zod.check=n=>{let o=n.value,i=o.length;if((typeof o=="string"&&i>=t.minimum&&i<t.minimum*2?Jt(o):i)>=t.minimum)return;let a=ro(o);n.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:true,input:o,inst:e,continue:!t.abort});};}),Nu=v("$ZodCheckLengthEquals",(e,t)=>{var r;ce.init(e,t),(r=e._zod.def).when??(r.when=Cu),e._zod.check=n=>{let o=n.value,i=o.length,s=typeof o=="string"&&i>=t.length&&i<=t.length*2?Jt(o):i;if(s===t.length)return;let a=ro(o),c=s>t.length;n.issues.push({origin:a,...c?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:true,exact:true,input:n.value,inst:e,continue:!t.abort});};}),Yr=v("$ZodCheckStringFormat",(e,t)=>{var r,n;ce.init(e,t),t.pattern?(r=e._zod).check??(r.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort});}):(n=e._zod).check??(n.check=()=>{});}),Lu=v("$ZodCheckRegex",(e,t)=>{Yr.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort});};}),Tu=v("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=xu),Yr.init(e,t);}),Ou=v("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=wu),Yr.init(e,t);}),Fu=v("$ZodCheckIncludes",(e,t)=>{ce.init(e,t);let r=tt(t.includes),n=new RegExp(typeof t.position=="number"?`^.{${t.position},}${r}`:r);t.pattern=n,e._zod.check=o=>{o.value.includes(t.includes,t.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort});};}),Du=v("$ZodCheckStartsWith",(e,t)=>{ce.init(e,t);let r=new RegExp(`^${tt(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort});};}),Zu=v("$ZodCheckEndsWith",(e,t)=>{ce.init(e,t);let r=new RegExp(`.*${tt(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort});};});function Di(e,t,r){e.issues.length&&t.issues.push(...je(r,e.issues));}var Bu=v("$ZodCheckProperty",(e,t)=>{ce.init(e,t),e._zod.check=r=>{let n=t.schema._zod.run({value:r.value[t.property],issues:[]},{});if(n instanceof Promise)return n.then(o=>Di(o,r,t.property));Di(n,r,t.property);};}),Uu=v("$ZodCheckProperties",(e,t)=>{ce.init(e,t),no(e,Symbol.iterator,function*(){yield e;});let r;e._zod.check=n=>{if(n.value==null){n.issues.push({expected:"object",code:"invalid_type",input:n.value,inst:e});return}r??(r=Reflect.ownKeys(t.shape).map(s=>[s,t.shape[s]]));let o=n.value,i;for(let[s,a]of r){let c=a._zod.run({value:o[s],issues:[]},{});c instanceof Promise?(i??(i=[]),i.push(c.then(u=>Di(u,n,s)))):Di(c,n,s);}if(i)return Promise.all(i).then(()=>{})};}),Gu=v("$ZodCheckMimeType",(e,t)=>{ce.init(e,t);let r=new Set(t.mime);e._zod.check=n=>{r.has(n.value.type)||n.issues.push({code:"invalid_value",values:t.mime,input:n.value.type,inst:e,continue:!t.abort});};}),Qu=v("$ZodCheckOverwrite",(e,t)=>{ce.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value);};});var Yt=class{constructor(t=[],r={}){this.content=[],this.indent=0,this.args=t,this.closed=r;}indented(t){this.indent+=1;try{t(this);}finally{this.indent-=1;}}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let n=t.split(`
3
3
  `).filter(s=>s),o=Math.min(...n.map(s=>s.length-s.trimStart().length)),i=n.map(s=>s.slice(o)).map(s=>" ".repeat(this.indent*2)+s);for(let s of i)this.content.push(s);}compile(){let t=Function,r=this?.content??[""];return new t(...Object.keys(this.closed),`return function (${this.args.join(", ")}) {
4
4
  ${r.join(`
5
5
  `)}
6
- };`)(...Object.values(this.closed))}};var Du={major:4,minor:6,patch:7};var G=S("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Du;let n=e._zod.def.checks,o=e._zod.traits.has("$ZodCheck")?[e,...n??[]]:n?.length?[...n]:[];for(let i of o)for(let s of i._zod.onattach)s(e);if(o.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse;});else {let i=(a,c,u)=>{if(a.memo)return a;let l=Ne(a),f;for(let p of c){if(p._zod.def.when){if(Cc(a)||!p._zod.def.when(a))continue}else if(l)continue;let m=a.issues.length,h=p._zod.check(a);if(h instanceof Promise&&u?.async===false)throw new We;if(f||h instanceof Promise)f=(f??Promise.resolve()).then(async()=>{await h,a.issues.length!==m&&(Xn(a.issues,m,e),l||(l=Ne(a,m)));});else {if(a.issues.length===m)continue;Xn(a.issues,m,e),l||(l=Ne(a,m));}}return f?f.then(()=>a):a},s=(a,c,u)=>{if(Ne(a))return a.aborted=true,a;let l=i(c,o,u);if(l instanceof Promise){if(u.async===false)throw new We;return l.then(f=>e._zod.parse(f,u))}return e._zod.parse(l,u)};e._zod.run=(a,c)=>{if(c.skipChecks)return e._zod.parse(a,c);if(c.direction==="backward"){let l=e._zod.parse({value:a.value,issues:[]},{...c,skipChecks:true});return l instanceof Promise?l.then(f=>s(f,a,c)):s(l,a,c)}let u=e._zod.parse(a,c);if(u instanceof Promise){if(c.async===false)throw new We;return u.then(l=>i(l,o,c))}return i(u,o,c)};}},{get"~standard"(){return to(this,"~standard",Zi(this))},set"~standard"(e){Et(this,"~standard",e);}}),t0=(e,t)=>e.issues.length?{issues:e.issues.map(r=>qe(r,t,de()))}:{value:e.value};async function M$(e,t){let r={async:true};return t0(await e._zod.run({value:t,issues:[]},r),r)}function Zi(e){return {validate:t=>{let r={async:false};try{let n=e._zod.run({value:t,issues:[]},r);if(!(n instanceof Promise))return t0(n,r)}catch{}return M$(e,t)},vendor:"zod",version:1}}var Yt=S("$ZodString",(e,t)=>{G.init(e,t),e._zod.pattern=t.pattern??uu,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=String(r.value);}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r};}),ee=S("$ZodStringFormat",(e,t)=>{Xr.init(e,t),Yt.init(e,t);}),Bu=S("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=jc),ee.init(e,t);}),Uu=S("$ZodUUID",(e,t)=>{if(t.version){let n={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(n===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Jt(n));}else t.pattern??(t.pattern=Jt());ee.init(e,t);}),Gu=S("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=qc),ee.init(e,t);}),Qu=1,lo=2;function Vu(e){try{return typeof URL<"u"&&typeof URL.canParse=="function"?URL.canParse(e):(new URL(e),!0)}catch{return false}}function Bi(e,t){return !("normalize"in t)&&!("hostname"in t)&&!("protocol"in t)?Vu(e)||lo:r0(e,t)}function r0(e,t){if(!t.normalize&&t.protocol?.source===so.source&&!/^https?:\/\//i.test(e))return Qu;try{if(typeof URL<"u"){let r=URL;if(typeof r.parse=="function")return r.parse(e)??lo}return new URL(e)}catch{return lo}}var I$=/[\t\n\r]/g;function fo(e){return e.replace(I$,"")}function Ui(e,t){return t.lastIndex=0,t.test(e.hostname)}function Gi(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(":")?e.protocol.slice(0,-1):e.protocol)}var ju=S("$ZodURL",(e,t)=>{ee.init(e,t),e._zod.check=r=>{try{let n=r.value.trim(),o=Bi(n,t);if(o===Qu){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!t.abort});return}if(o===lo){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort});return}if(o===!0){r.value=fo(n);return}t.hostname&&!Ui(o,t.hostname)&&r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort}),t.protocol&&!Gi(o,t.protocol)&&r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort}),r.value=t.normalize?o.href:fo(n);return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort});}};}),qu=S("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Wc()),ee.init(e,t);}),Wu=S("$ZodNanoID",(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw new Error(`Invalid nanoid length: ${t.length}`);t.pattern??(t.pattern=t.length===void 0?Gc:Qc(t.length)),ee.init(e,t);}),Hu=S("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Fc),ee.init(e,t);}),Ku=S("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Dc),ee.init(e,t);}),Ju=S("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Zc),ee.init(e,t);}),Xu=S("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Bc),ee.init(e,t);}),Yu=S("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Uc),ee.init(e,t);}),el=S("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=cu(t)),ee.init(e,t);}),tl=S("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=su),ee.init(e,t);}),rl=S("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=au(t)),ee.init(e,t);}),nl=S("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Vc),ee.init(e,t);}),ol=S("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Hc),ee.init(e,t);}),z$=/^[0-9a-fA-F:.]+$/;function po(e){return z$.test(e)?Vu(`http://[${e}]`):false}var il=S("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Kc),ee.init(e,t),e._zod.check=r=>{po(r.value)||r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort});};}),sl=S("$ZodMAC",(e,t)=>{t.pattern??(t.pattern=Jc(t.delimiter)),ee.init(e,t);}),al=S("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Xc),ee.init(e,t);});function Qi(e){let t=e.split("/");if(t.length!==2)return false;let[r,n]=t;if(!n)return false;let o=Number(n);return `${o}`!==n||o<0||o>128?false:po(r)}var cl=S("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Yc),ee.init(e,t),e._zod.check=r=>{Qi(r.value)||r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort});};});function mo(e){if(e==="")return true;if(/\s/.test(e)||e.length%4!==0)return false;try{return atob(e),!0}catch{return false}}var Vi=/^[0-9a-zA-Z+/]*={0,2}$/,ul=S("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Vi),ee.init(e,t),e._zod.check=r=>{mo(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort});};}),ho=/^[A-Za-z0-9_-]*$/;function ji(e){if(!ho.test(e))return false;let t=e.replace(/[-_]/g,n=>n==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return mo(r)}var ll=S("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=ho),ee.init(e,t),e._zod.check=r=>{ji(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort});};}),fl=S("$ZodE164",(e,t)=>{t.pattern??(t.pattern=ou),ee.init(e,t);}),N$=/[- ]/g;function L$(e){let t=e.length,r=1,n=0;for(;t;){let o=e.charCodeAt(--t)-48;r^=1,n+=r?[0,2,4,6,8,1,3,5,7,9][o]:o;}return n%10===0}function qi(e){return Ri.test(e)?L$(e.replace(N$,"")):false}var pl=S("$ZodCreditCard",(e,t)=>{t.pattern??(t.pattern=Ri),ee.init(e,t),e._zod.check=r=>{qi(r.value)||r.issues.push({code:"invalid_format",format:"credit_card",input:r.value,inst:e,continue:!t.abort});};});function O$(e){let t=0,r=e.length;for(let n=4;n<r;n++){let o=e.charCodeAt(n);t=(o>=65?t*100+(o-55):t*10+(o-48))%97;}for(let n=0;n<4;n++){let o=e.charCodeAt(n);t=(o>=65?t*100+(o-55):t*10+(o-48))%97;}return t===1}function Wi(e){return Mi.test(e)?O$(e):false}var ml=S("$ZodIBAN",(e,t)=>{t.pattern??(t.pattern=Mi),ee.init(e,t),e._zod.check=r=>{Wi(r.value)||r.issues.push({code:"invalid_format",format:"iban",input:r.value,inst:e,continue:!t.abort});};});function Hi(e,t=null){try{let r=e.split(".");if(r.length!==3)return !1;let[n]=r;if(!n)return !1;let o=JSON.parse(atob(n));return !("typ"in o&&o?.typ!=="JWT"||!o.alg||t&&(!("alg"in o)||o.alg!==t))}catch{return false}}var dl=S("$ZodJWT",(e,t)=>{ee.init(e,t),e._zod.check=r=>{Hi(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort});};}),hl=S("$ZodCustomStringFormat",(e,t)=>{ee.init(e,t),e._zod.check=r=>{t.fn(r.value)||r.issues.push({code:"invalid_format",format:t.format,input:r.value,inst:e,continue:!t.abort});};}),Ki=S("$ZodNumber",(e,t)=>{G.init(e,t),e._zod.pattern=yt,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value);}catch{}let o=r.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return r;let i=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:String(o):void 0;return r.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...i?{received:i}:{}}),r};}),gl=S("$ZodNumberFormat",(e,t)=>{xu.init(e,t),Ki.init(e,t);}),go=S("$ZodBoolean",(e,t)=>{G.init(e,t),e._zod.pattern=pu,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=!!r.value;}catch{}let o=r.value;return typeof o=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),r};}),Ji=S("$ZodBigInt",(e,t)=>{G.init(e,t),e._zod.pattern=fu,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=BigInt(r.value);}catch{}return typeof r.value=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:e}),r};}),_l=S("$ZodBigIntFormat",(e,t)=>{wu.init(e,t),Ji.init(e,t);}),yl=S("$ZodSymbol",(e,t)=>{G.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;return typeof o=="symbol"||r.issues.push({expected:"symbol",code:"invalid_type",input:o,inst:e}),r};}),bl=S("$ZodUndefined",(e,t)=>{G.init(e,t),e._zod.pattern=du,e._zod.values=new Set([void 0]),e._zod.parse=(r,n)=>{let o=r.value;return typeof o>"u"||r.issues.push({expected:"undefined",code:"invalid_type",input:o,inst:e}),r};}),$l=S("$ZodNull",(e,t)=>{G.init(e,t),e._zod.pattern=mu,e._zod.values=new Set([null]),e._zod.parse=(r,n)=>{let o=r.value;return o===null||r.issues.push({expected:"null",code:"invalid_type",input:o,inst:e}),r};}),xl=S("$ZodAny",(e,t)=>{G.init(e,t),e._zod.parse=r=>r;}),wl=S("$ZodUnknown",(e,t)=>{G.init(e,t),e._zod.parse=r=>r;}),vl=S("$ZodNever",(e,t)=>{G.init(e,t),e._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r);}),Sl=S("$ZodVoid",(e,t)=>{G.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;return typeof o>"u"||r.issues.push({expected:"void",code:"invalid_type",input:o,inst:e}),r};}),Cl=S("$ZodDate",(e,t)=>{G.init(e,t),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=new Date(r.value);}catch{}let o=r.value,i=o instanceof Date;return i&&!Number.isNaN(o.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:o,...i?{received:"Invalid Date"}:{},inst:e}),r};});function Pl(e,t){let r=jr(e._zod.def.checks);if(!r.length)return;let n=Math.min(...r.map(i=>i[0])),o=e._zod.parse;e._zod.parse=(i,s)=>{let a=t(i.value);if(a>n&&!s?.skipChecks&&s?.direction!=="backward"){for(let[c,u]of jr(e._zod.def.checks))if(a>c&&u._zod.def.when(i)){let l=i.issues.length;return u._zod.check(i),i.issues[l].continue=false,Xn(i.issues,l,e),i}}return o(i,s)};}var T$=e=>Array.isArray(e)?e.length:-1,F$=e=>e instanceof Map?e.size:-1,D$=e=>e instanceof Set?e.size:-1;function Zh(e,t,r){e.issues.length&&t.issues.push(...je(r,e.issues)),t.value[r]=e.value;}var kl=S("$ZodArray",(e,t)=>{G.init(e,t);let r=ve.memoizer;r?.attach(e),e._zod.parse=(n,o)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),n;n.value=r?r.alloc(e,n,Array(i.length),o):Array(i.length);let s=[],a=o?.abortEarly;for(let c=0;c<i.length;c++){let u=i[c],l=t.element._zod.run({value:u,issues:[]},o);if(l instanceof Promise)s.push(l.then(f=>Zh(f,n,c)));else if(Zh(l,n,c),a&&l.issues.length!==0&&Ne(l))break}return s.length?Promise.all(s).then(()=>n):n},Pl(e,T$);});function Di(e,t,r,n,o,i){let s=r in n,a=i==="optional";if(!(!s&&a&&o==="optional")){if(e.issues.length){if(o!==void 0&&a&&!s)return;t.issues.push(...je(r,e.issues));}if(!s&&o===void 0){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}e.value===void 0?(s||o==="defaulted"&&!a)&&(t.value[r]=void 0):t.value[r]=e.value;}}var Z$=[];function n0(e){let t=Object.keys(e.shape),r=Object.getOwnPropertySymbols(e.shape),n=r.length?r:Z$,o=n.length?[...t,...n]:t;for(let s of o)if(!e.shape?.[s]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${String(s)}": expected a Zod schema`);let i=Sc(e.shape);return {...e,allKeys:o,symbolKeys:n,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(i)}}function o0(e,t,r,n,o,i,s){let a=[],c=o.keySet,u=o.catchall._zod,l=u.def.type,f=u.optin,p=u.optout,m=0;for(let h in t){if(s&&r.issues.length!==m){if(Ne(r,m))break;m=r.issues.length;}if(c.has(h))continue;if(h==="__proto__"){l==="never"&&a.push(h);continue}if(l==="never"){a.push(h);continue}let d=u.run({value:t[h],issues:[]},n);d instanceof Promise?e.push(d.then(g=>Di(g,r,h,t,f,p))):Di(d,r,h,t,f,p);}return a.length&&r.issues.push({code:"unrecognized_keys",keys:a,input:t,inst:i,continue:true}),e.length?Promise.all(e).then(()=>r):r}var i0=S("$ZodObject",(e,t)=>{G.init(e,t);let r=Object.getOwnPropertyDescriptor(t,"shape"),n=r?.get?r.get.raw:t.shape??{};if(n){let u=()=>{let l={...n};return Object.defineProperty(t,"shape",{value:l}),u.raw=l,l};u.raw=n,Object.defineProperty(t,"shape",{get:u});}let o=Qr(()=>n0(t));q(e,"propValues",u=>{let l=u.def.shape,f={};for(let p in l){let m=l[p]._zod;if(m.values){Object.prototype.hasOwnProperty.call(f,p)||Pe(f,p,new Set);for(let h of m.values)f[p].add(h);m.optin!==void 0&&f[p].add(void 0);}}return f});let i=Ht,s=t.catchall,a,c=ve.memoizer;c?.attach(e),e._zod.parse=(u,l)=>{a??(a=o.value);let f=u.value;if(!i(f))return u.issues.push({expected:"object",code:"invalid_type",input:f,inst:e}),u;u.value=c?c.alloc(e,u,{},l):{};let p=[],m=a.shape,h=l?.abortEarly,d=u.issues.length;for(let g of a.allKeys){if(h&&u.issues.length!==d){if(Ne(u,d))break;d=u.issues.length;}if(g==="__proto__")continue;let y=m[g],_=y._zod.optin,b=y._zod.optout,v=y._zod.run({value:f[g],issues:[]},l);v instanceof Promise?p.push(v.then(C=>Di(C,u,g,f,_,b))):Di(v,u,g,f,_,b);}return s?o0(p,f,u,l,o.value,e,h===true):p.length?Promise.all(p).then(()=>u):u};}),Al=S("$ZodObjectJIT",(e,t)=>{i0.init(e,t);let r=e._zod.parse,n=Qr(()=>n0(t)),o=ve.memoizer,i=m=>{let h=n.value,d=h.symbolKeys,g=new Xt(["payload","ctx"],{shape:m,inst:e,memo:o,syms:d}),y=C=>`shape[${C}]._zod.run({ value: input[${C}], issues: [] }, ctx)`,_=(C,w)=>`
6
+ };`)(...Object.values(this.closed))}};var Vu={major:4,minor:6,patch:7};var G=v("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Vu;let n=e._zod.def.checks,o=e._zod.traits.has("$ZodCheck")?[e,...n??[]]:n?.length?[...n]:[];for(let i of o)for(let s of i._zod.onattach)s(e);if(o.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse;});else {let i=(a,c,u)=>{if(a.memo)return a;let l=Te(a),f;for(let p of c){if(p._zod.def.when){if(Mc(a)||!p._zod.def.when(a))continue}else if(l)continue;let m=a.issues.length,h=p._zod.check(a);if(h instanceof Promise&&u?.async===false)throw new We;if(f||h instanceof Promise)f=(f??Promise.resolve()).then(async()=>{await h,a.issues.length!==m&&(eo(a.issues,m,e),l||(l=Te(a,m)));});else {if(a.issues.length===m)continue;eo(a.issues,m,e),l||(l=Te(a,m));}}return f?f.then(()=>a):a},s=(a,c,u)=>{if(Te(a))return a.aborted=true,a;let l=i(c,o,u);if(l instanceof Promise){if(u.async===false)throw new We;return l.then(f=>e._zod.parse(f,u))}return e._zod.parse(l,u)};e._zod.run=(a,c)=>{if(c.skipChecks)return e._zod.parse(a,c);if(c.direction==="backward"){let l=e._zod.parse({value:a.value,issues:[]},{...c,skipChecks:true});return l instanceof Promise?l.then(f=>s(f,a,c)):s(l,a,c)}let u=e._zod.parse(a,c);if(u instanceof Promise){if(c.async===false)throw new We;return u.then(l=>i(l,o,c))}return i(u,o,c)};}},{get"~standard"(){return no(this,"~standard",ji(this))},set"~standard"(e){Rt(this,"~standard",e);}}),a0=(e,t)=>e.issues.length?{issues:e.issues.map(r=>qe(r,t,me()))}:{value:e.value};async function G$(e,t){let r={async:true};return a0(await e._zod.run({value:t,issues:[]},r),r)}function ji(e){return {validate:t=>{let r={async:false};try{let n=e._zod.run({value:t,issues:[]},r);if(!(n instanceof Promise))return a0(n,r)}catch{}return G$(e,t)},vendor:"zod",version:1}}var er=v("$ZodString",(e,t)=>{G.init(e,t),e._zod.pattern=t.pattern??hu,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=String(r.value);}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r};}),ee=v("$ZodStringFormat",(e,t)=>{Yr.init(e,t),er.init(e,t);}),qu=v("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Xc),ee.init(e,t);}),Wu=v("$ZodUUID",(e,t)=>{if(t.version){let n={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(n===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Xt(n));}else t.pattern??(t.pattern=Xt());ee.init(e,t);}),Hu=v("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Yc),ee.init(e,t);}),Ku=1,po=2;function Ju(e){try{return typeof URL<"u"&&typeof URL.canParse=="function"?URL.canParse(e):(new URL(e),!0)}catch{return false}}function qi(e,t){return !("normalize"in t)&&!("hostname"in t)&&!("protocol"in t)?Ju(e)||po:c0(e,t)}function c0(e,t){if(!t.normalize&&t.protocol?.source===co.source&&!/^https?:\/\//i.test(e))return Ku;try{if(typeof URL<"u"){let r=URL;if(typeof r.parse=="function")return r.parse(e)??po}return new URL(e)}catch{return po}}var Q$=/[\t\n\r]/g;function mo(e){return e.replace(Q$,"")}function Wi(e,t){return t.lastIndex=0,t.test(e.hostname)}function Hi(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(":")?e.protocol.slice(0,-1):e.protocol)}var Xu=v("$ZodURL",(e,t)=>{ee.init(e,t),e._zod.check=r=>{try{let n=r.value.trim(),o=qi(n,t);if(o===Ku){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!t.abort});return}if(o===po){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort});return}if(o===!0){r.value=mo(n);return}t.hostname&&!Wi(o,t.hostname)&&r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort}),t.protocol&&!Hi(o,t.protocol)&&r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort}),r.value=t.normalize?o.href:mo(n);return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort});}};}),Yu=v("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=eu()),ee.init(e,t);}),el=v("$ZodNanoID",(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw new Error(`Invalid nanoid length: ${t.length}`);t.pattern??(t.pattern=t.length===void 0?Hc:Kc(t.length)),ee.init(e,t);}),tl=v("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Qc),ee.init(e,t);}),rl=v("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Vc),ee.init(e,t);}),nl=v("$ZodULID",(e,t)=>{t.pattern??(t.pattern=jc),ee.init(e,t);}),ol=v("$ZodXID",(e,t)=>{t.pattern??(t.pattern=qc),ee.init(e,t);}),il=v("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Wc),ee.init(e,t);}),sl=v("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=du(t)),ee.init(e,t);}),al=v("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=pu),ee.init(e,t);}),cl=v("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=mu(t)),ee.init(e,t);}),ul=v("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Jc),ee.init(e,t);}),ll=v("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=tu),ee.init(e,t);}),V$=/^[0-9a-fA-F:.]+$/;function ho(e){return V$.test(e)?Ju(`http://[${e}]`):false}var fl=v("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=ru),ee.init(e,t),e._zod.check=r=>{ho(r.value)||r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort});};}),pl=v("$ZodMAC",(e,t)=>{t.pattern??(t.pattern=nu(t.delimiter)),ee.init(e,t);}),ml=v("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=ou),ee.init(e,t);});function Ki(e){let t=e.split("/");if(t.length!==2)return false;let[r,n]=t;if(!n)return false;let o=Number(n);return `${o}`!==n||o<0||o>128?false:ho(r)}var dl=v("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=iu),ee.init(e,t),e._zod.check=r=>{Ki(r.value)||r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort});};});function go(e){if(e==="")return true;if(/\s/.test(e)||e.length%4!==0)return false;try{return atob(e),!0}catch{return false}}var Ji=/^[0-9a-zA-Z+/]*={0,2}$/,hl=v("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Ji),ee.init(e,t),e._zod.check=r=>{go(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort});};}),_o=/^[A-Za-z0-9_-]*$/;function Xi(e){if(!_o.test(e))return false;let t=e.replace(/[-_]/g,n=>n==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return go(r)}var gl=v("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=_o),ee.init(e,t),e._zod.check=r=>{Xi(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort});};}),_l=v("$ZodE164",(e,t)=>{t.pattern??(t.pattern=lu),ee.init(e,t);}),j$=/[- ]/g;function q$(e){let t=e.length,r=1,n=0;for(;t;){let o=e.charCodeAt(--t)-48;r^=1,n+=r?[0,2,4,6,8,1,3,5,7,9][o]:o;}return n%10===0}function Yi(e){return Ti.test(e)?q$(e.replace(j$,"")):false}var yl=v("$ZodCreditCard",(e,t)=>{t.pattern??(t.pattern=Ti),ee.init(e,t),e._zod.check=r=>{Yi(r.value)||r.issues.push({code:"invalid_format",format:"credit_card",input:r.value,inst:e,continue:!t.abort});};});function W$(e){let t=0,r=e.length;for(let n=4;n<r;n++){let o=e.charCodeAt(n);t=(o>=65?t*100+(o-55):t*10+(o-48))%97;}for(let n=0;n<4;n++){let o=e.charCodeAt(n);t=(o>=65?t*100+(o-55):t*10+(o-48))%97;}return t===1}function es(e){return Oi.test(e)?W$(e):false}var bl=v("$ZodIBAN",(e,t)=>{t.pattern??(t.pattern=Oi),ee.init(e,t),e._zod.check=r=>{es(r.value)||r.issues.push({code:"invalid_format",format:"iban",input:r.value,inst:e,continue:!t.abort});};});function ts(e,t=null){try{let r=e.split(".");if(r.length!==3)return !1;let[n]=r;if(!n)return !1;let o=JSON.parse(atob(n));return !("typ"in o&&o?.typ!=="JWT"||!o.alg||t&&(!("alg"in o)||o.alg!==t))}catch{return false}}var $l=v("$ZodJWT",(e,t)=>{ee.init(e,t),e._zod.check=r=>{ts(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort});};}),xl=v("$ZodCustomStringFormat",(e,t)=>{ee.init(e,t),e._zod.check=r=>{t.fn(r.value)||r.issues.push({code:"invalid_format",format:t.format,input:r.value,inst:e,continue:!t.abort});};}),rs=v("$ZodNumber",(e,t)=>{G.init(e,t),e._zod.pattern=bt,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value);}catch{}let o=r.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return r;let i=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:String(o):void 0;return r.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...i?{received:i}:{}}),r};}),wl=v("$ZodNumberFormat",(e,t)=>{ku.init(e,t),rs.init(e,t);}),yo=v("$ZodBoolean",(e,t)=>{G.init(e,t),e._zod.pattern=yu,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=!!r.value;}catch{}let o=r.value;return typeof o=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),r};}),ns=v("$ZodBigInt",(e,t)=>{G.init(e,t),e._zod.pattern=_u,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=BigInt(r.value);}catch{}return typeof r.value=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:e}),r};}),Sl=v("$ZodBigIntFormat",(e,t)=>{Au.init(e,t),ns.init(e,t);}),vl=v("$ZodSymbol",(e,t)=>{G.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;return typeof o=="symbol"||r.issues.push({expected:"symbol",code:"invalid_type",input:o,inst:e}),r};}),Cl=v("$ZodUndefined",(e,t)=>{G.init(e,t),e._zod.pattern=$u,e._zod.values=new Set([void 0]),e._zod.parse=(r,n)=>{let o=r.value;return typeof o>"u"||r.issues.push({expected:"undefined",code:"invalid_type",input:o,inst:e}),r};}),Pl=v("$ZodNull",(e,t)=>{G.init(e,t),e._zod.pattern=bu,e._zod.values=new Set([null]),e._zod.parse=(r,n)=>{let o=r.value;return o===null||r.issues.push({expected:"null",code:"invalid_type",input:o,inst:e}),r};}),kl=v("$ZodAny",(e,t)=>{G.init(e,t),e._zod.parse=r=>r;}),Al=v("$ZodUnknown",(e,t)=>{G.init(e,t),e._zod.parse=r=>r;}),El=v("$ZodNever",(e,t)=>{G.init(e,t),e._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r);}),Rl=v("$ZodVoid",(e,t)=>{G.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;return typeof o>"u"||r.issues.push({expected:"void",code:"invalid_type",input:o,inst:e}),r};}),Ml=v("$ZodDate",(e,t)=>{G.init(e,t),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=new Date(r.value);}catch{}let o=r.value,i=o instanceof Date;return i&&!Number.isNaN(o.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:o,...i?{received:"Invalid Date"}:{},inst:e}),r};});function Il(e,t){let r=qr(e._zod.def.checks);if(!r.length)return;let n=Math.min(...r.map(i=>i[0])),o=e._zod.parse;e._zod.parse=(i,s)=>{let a=t(i.value);if(a>n&&!s?.skipChecks&&s?.direction!=="backward"){for(let[c,u]of qr(e._zod.def.checks))if(a>c&&u._zod.def.when(i)){let l=i.issues.length;return u._zod.check(i),i.issues[l].continue=false,eo(i.issues,l,e),i}}return o(i,s)};}var H$=e=>Array.isArray(e)?e.length:-1,K$=e=>e instanceof Map?e.size:-1,J$=e=>e instanceof Set?e.size:-1;function jh(e,t,r){e.issues.length&&t.issues.push(...je(r,e.issues)),t.value[r]=e.value;}var zl=v("$ZodArray",(e,t)=>{G.init(e,t);let r=we.memoizer;r?.attach(e),e._zod.parse=(n,o)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),n;n.value=r?r.alloc(e,n,Array(i.length),o):Array(i.length);let s=[],a=o?.abortEarly;for(let c=0;c<i.length;c++){let u=i[c],l=t.element._zod.run({value:u,issues:[]},o);if(l instanceof Promise)s.push(l.then(f=>jh(f,n,c)));else if(jh(l,n,c),a&&l.issues.length!==0&&Te(l))break}return s.length?Promise.all(s).then(()=>n):n},Il(e,H$);});function Vi(e,t,r,n,o,i){let s=r in n,a=i==="optional";if(!(!s&&a&&o==="optional")){if(e.issues.length){if(o!==void 0&&a&&!s)return;t.issues.push(...je(r,e.issues));}if(!s&&o===void 0){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}e.value===void 0?(s||o==="defaulted"&&!a)&&(t.value[r]=void 0):t.value[r]=e.value;}}var X$=[];function u0(e){let t=Object.keys(e.shape),r=Object.getOwnPropertySymbols(e.shape),n=r.length?r:X$,o=n.length?[...t,...n]:t;for(let s of o)if(!e.shape?.[s]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${String(s)}": expected a Zod schema`);let i=Rc(e.shape);return {...e,allKeys:o,symbolKeys:n,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(i)}}function l0(e,t,r,n,o,i,s){let a=[],c=o.keySet,u=o.catchall._zod,l=u.def.type,f=u.optin,p=u.optout,m=0;for(let h in t){if(s&&r.issues.length!==m){if(Te(r,m))break;m=r.issues.length;}if(c.has(h))continue;if(h==="__proto__"){l==="never"&&a.push(h);continue}if(l==="never"){a.push(h);continue}let d=u.run({value:t[h],issues:[]},n);d instanceof Promise?e.push(d.then(g=>Vi(g,r,h,t,f,p))):Vi(d,r,h,t,f,p);}return a.length&&r.issues.push({code:"unrecognized_keys",keys:a,input:t,inst:i,continue:true}),e.length?Promise.all(e).then(()=>r):r}var f0=v("$ZodObject",(e,t)=>{G.init(e,t);let r=Object.getOwnPropertyDescriptor(t,"shape"),n=r?.get?r.get.raw:t.shape??{};if(n){let u=()=>{let l={...n};return Object.defineProperty(t,"shape",{value:l}),u.raw=l,l};u.raw=n,Object.defineProperty(t,"shape",{get:u});}let o=Vr(()=>u0(t));q(e,"propValues",u=>{let l=u.def.shape,f={};for(let p in l){let m=l[p]._zod;if(m.values){Object.prototype.hasOwnProperty.call(f,p)||Ce(f,p,new Set);for(let h of m.values)f[p].add(h);m.optin!==void 0&&f[p].add(void 0);}}return f});let i=Kt,s=t.catchall,a,c=we.memoizer;c?.attach(e),e._zod.parse=(u,l)=>{a??(a=o.value);let f=u.value;if(!i(f))return u.issues.push({expected:"object",code:"invalid_type",input:f,inst:e}),u;u.value=c?c.alloc(e,u,{},l):{};let p=[],m=a.shape,h=l?.abortEarly,d=u.issues.length;for(let g of a.allKeys){if(h&&u.issues.length!==d){if(Te(u,d))break;d=u.issues.length;}if(g==="__proto__")continue;let y=m[g],_=y._zod.optin,b=y._zod.optout,S=y._zod.run({value:f[g],issues:[]},l);S instanceof Promise?p.push(S.then(C=>Vi(C,u,g,f,_,b))):Vi(S,u,g,f,_,b);}return s?l0(p,f,u,l,o.value,e,h===true):p.length?Promise.all(p).then(()=>u):u};}),Nl=v("$ZodObjectJIT",(e,t)=>{f0.init(e,t);let r=e._zod.parse,n=Vr(()=>u0(t)),o=we.memoizer,i=m=>{let h=n.value,d=h.symbolKeys,g=new Yt(["payload","ctx"],{shape:m,inst:e,memo:o,syms:d}),y=C=>`shape[${C}]._zod.run({ value: input[${C}], issues: [] }, ctx)`,_=(C,w)=>`
7
7
  let ${C}_ab = false;
8
8
  for (let i = 0; i < ${C}.issues.length; i++) {
9
9
  const iss = ${C}.issues[i];
@@ -14,13 +14,13 @@ ${r.join(`
14
14
  if (${C}_ab && ctx && ctx.abortEarly) {
15
15
  payload.value = newResult;
16
16
  return payload;
17
- }`;g.write("const input = payload.value;");let b=Object.create(null),v=0;for(let C of h.allKeys)b[C]=`key_${v++}`;g.write(o?"const newResult = memo.alloc(inst, payload, {}, ctx);":"const newResult = {};");for(let C of h.allKeys){if(C==="__proto__")continue;let w=b[C],x=typeof C=="symbol"?`syms[${d.indexOf(C)}]`:ze(C),E=`${x} in input`,P=m[C],R=P?._zod?.optin,I=R!==void 0,N=P?._zod?.optout==="optional";if(g.write(`const ${w} = ${y(x)};`),I&&N){let O=R==="optional"?`${w}_present`:`${w}.value !== undefined || ${w}_present`;g.write(`
18
- const ${w}_present = ${E};
17
+ }`;g.write("const input = payload.value;");let b=Object.create(null),S=0;for(let C of h.allKeys)b[C]=`key_${S++}`;g.write(o?"const newResult = memo.alloc(inst, payload, {}, ctx);":"const newResult = {};");for(let C of h.allKeys){if(C==="__proto__")continue;let w=b[C],x=typeof C=="symbol"?`syms[${d.indexOf(C)}]`:Le(C),A=`${x} in input`,P=m[C],E=P?._zod?.optin,I=E!==void 0,N=P?._zod?.optout==="optional";if(g.write(`const ${w} = ${y(x)};`),I&&N){let T=E==="optional"?`${w}_present`:`${w}.value !== undefined || ${w}_present`;g.write(`
18
+ const ${w}_present = ${A};
19
19
  if (!${w}.issues.length || ${w}_present) {
20
20
  if (${w}.issues.length) {${_(w,x)}
21
21
  }
22
22
 
23
- if (${O}) {
23
+ if (${T}) {
24
24
  newResult[${x}] = ${w}.value;
25
25
  }
26
26
  }
@@ -28,12 +28,12 @@ ${r.join(`
28
28
  `);}else I?(g.write(`
29
29
  if (${w}.issues.length) {${_(w,x)}
30
30
  }
31
- `),R==="defaulted"?g.write(`newResult[${x}] = ${w}.value;`):g.write(`
32
- if (${w}.value !== undefined || ${E}) {
31
+ `),E==="defaulted"?g.write(`newResult[${x}] = ${w}.value;`):g.write(`
32
+ if (${w}.value !== undefined || ${A}) {
33
33
  newResult[${x}] = ${w}.value;
34
34
  }
35
35
  `)):g.write(`
36
- const ${w}_present = ${E};
36
+ const ${w}_present = ${A};
37
37
  if (${w}.issues.length) {${_(w,x)}
38
38
  }
39
39
  if (!${w}_present && !${w}.issues.length) {
@@ -53,14 +53,14 @@ ${r.join(`
53
53
  newResult[${x}] = ${w}.value;
54
54
  }
55
55
 
56
- `);}return g.write("payload.value = newResult;"),g.write("return payload;"),g.compile()},s,a=Ht,c=!ve.jitless,l=c&&wc.value,f=t.catchall,p;e._zod.parse=(m,h)=>{p??(p=n.value);let d=m.value;return a(d)?c&&l&&h?.async===false&&h.jitless!==true?(s||(s=i(t.shape)),m=s(m,h),f?o0([],d,m,h,p,e,h?.abortEarly===true):m):r(m,h):(m.issues.push({expected:"object",code:"invalid_type",input:d,inst:e}),m)};});function Bh(e,t,r,n){for(let i of e)if(i.issues.length===0)return t.value=i.value,t;let o=e.filter(i=>!Ne(i));return o.length===1?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(i=>i.issues.map(s=>qe(s,n,de())))}),t)}var _o=S("$ZodUnion",(e,t)=>{G.init(e,t),q(e,"optin",n=>n.def.options.some(o=>o._zod.optin==="defaulted")?"defaulted":n.def.options.some(o=>o._zod.optin!==void 0)?"optional":void 0),q(e,"optout",n=>n.def.options.some(o=>o._zod.optout==="optional")?"optional":void 0),q(e,"values",n=>{if(n.def.options.every(o=>o._zod.values))return new Set(n.def.options.flatMap(o=>Array.from(o._zod.values)))}),q(e,"pattern",n=>{if(n.def.options.every(o=>o._zod.pattern)){let o=n.def.options.map(i=>i._zod.pattern);return new RegExp(`^(${o.map(i=>_t(i.source)).join("|")})$`)}});let r=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(n,o)=>{if(r)return r(n,o);let i=false,s=[];for(let a of t.options){let c=a._zod.run({value:n.value,issues:[]},o);if(c instanceof Promise)s.push(c),i=true;else {if(c.issues.length===0)return c;s.push(c);}}return i?Promise.all(s).then(a=>Bh(a,n,e,o)):Bh(s,n,e,o)};});function Uh(e,t,r,n){let o=[];for(let i=0;i<e.length;i++)e[i].issues.length===0&&o.push(i);return o.length===1?(t.value=e[o[0]].value,t):(o.length===0?t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(i=>i.issues.map(s=>qe(s,n,de())))}):t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:[],inclusive:false,matches:o}),t)}var El=S("$ZodXor",(e,t)=>{_o.init(e,t),t.inclusive=false;let r=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(n,o)=>{if(r)return r(n,o);let i=false,s=[];for(let a of t.options){let c=a._zod.run({value:n.value,issues:[]},o);c instanceof Promise?(s.push(c),i=true):s.push(c);}return i?Promise.all(s).then(a=>Uh(a,n,e,o)):Uh(s,n,e,o)};});function Rl(e,t){let r=e._zod,n=r.bag.optionsMap;n||(n=s0(r.def),r.bag.optionsMap=n);let o=n.get(t);if(o===null)throw new Error(`Ambiguous discriminator value "${String(t)}"`);return o}function s0(e){let t=new Map;for(let r of e.options){let n=r._zod.propValues?.[e.discriminator];if(!n||n.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(r)}"`);for(let o of n)if(t.has(o)){if(o!==void 0)throw new Error(`Duplicate discriminator value "${String(o)}"`);t.set(o,null);}else t.set(o,r);}return t}var Ml=S("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=false,_o.init(e,t);let r=e._zod.parse;q(e,"propValues",o=>{let i={},s=0;for(let a of o.def.options){let c=a._zod.propValues;if(!c||Object.keys(c).length===0)throw new Error(`Invalid discriminated union option at index "${o.def.options.indexOf(a)}"`);c[o.def.discriminator]?.has(void 0)&&s++;for(let[u,l]of Object.entries(c)){Object.prototype.hasOwnProperty.call(i,u)||Pe(i,u,new Set);for(let f of l)i[u].add(f);}}return !o.def.unionFallback&&s>1&&i[o.def.discriminator]?.delete(void 0),i}),t.options.forEach((o,i)=>{let s=Vr(o._zod.def);if(s&&!Object.prototype.hasOwnProperty.call(s,t.discriminator))throw new Error(`Invalid discriminated union option at index "${i}"`)});let n=Qr(()=>s0(t));e._zod.parse=(o,i)=>{let s=o.value;if(!Ht(s))return o.issues.push({code:"invalid_type",expected:"object",input:s,inst:e}),o;let a=s?.[t.discriminator],c=n.value.get(a);return c&&(a!==void 0||i.direction!=="backward")?c._zod.run(o,i):t.unionFallback||i.direction==="backward"?r(o,i):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(n.value.keys()).filter(u=>n.value.get(u)!==null),input:s,path:[t.discriminator],inst:e}),o)};}),Il=S("$ZodIntersection",(e,t)=>{G.init(e,t),e._zod.parse=(r,n)=>{let o=r.value,i=t.left._zod.run({value:o,issues:[]},n),s=t.right._zod.run({value:o,issues:[]},n);return i instanceof Promise||s instanceof Promise?Promise.all([i,s]).then(([c,u])=>Gh(r,c,u)):Gh(r,i,s)};});function Yr(e,t){if(e===t)return {valid:true,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return {valid:true,data:e};if(et(e)&&et(t)){let r=Object.keys(t),n=Object.keys(e).filter(i=>r.indexOf(i)!==-1),o={...e,...t};Object.prototype.hasOwnProperty.call(o,"__proto__")&&delete o.__proto__;for(let i of n){if(i==="__proto__")continue;let s=Yr(e[i],t[i]);if(!s.valid)return {valid:false,mergeErrorPath:[i,...s.mergeErrorPath]};o[i]=s.data;}return {valid:true,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return {valid:false,mergeErrorPath:[]};let r=[];for(let n=0;n<e.length;n++){let o=e[n],i=t[n],s=Yr(o,i);if(!s.valid)return {valid:false,mergeErrorPath:[n,...s.mergeErrorPath]};r.push(s.data);}return {valid:true,data:r}}return {valid:false,mergeErrorPath:[]}}function Gh(e,t,r){let n=new Map,o,i=new Map,s=(u,l)=>{let f;if(u.code==="unrecognized_keys"&&!u.path?.length)o??(o=u),f=u.keys;else if(u.code==="invalid_key"&&u.origin==="record"&&u.path?.length===1){let p=String(u.path[0]);i.has(p)||i.set(p,u),f=[p];}else return false;for(let p of f)n.has(p)||n.set(p,{}),n.get(p)[l]=true;return true};for(let u of t.issues)s(u,"l")||e.issues.push(u);for(let u of r.issues)s(u,"r")||e.issues.push(u);let a=[...n].filter(([,u])=>u.l&&u.r).map(([u])=>u);if(a.length){let u=o?a.filter(l=>o.keys.includes(l)):[];u.length&&e.issues.push({...o,keys:u});for(let l of a)!u.includes(l)&&i.has(l)&&e.issues.push(i.get(l));}let c=Yr(t.value,r.value);if(!c.valid){if(Ne(e))return e;throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}var Xi=S("$ZodTuple",(e,t)=>{G.init(e,t);let r=t.items,n=ve.memoizer;n?.attach(e),e._zod.parse=(o,i)=>{let s=o.value;if(!Array.isArray(s))return o.issues.push({input:s,inst:e,expected:"tuple",code:"invalid_type"}),o;o.value=n?n.alloc(e,o,[],i):[];let a=[],c=Qh(r,"optin"),u=Qh(r,"optout");if(!t.rest){if(s.length<c)return o.issues.push({code:"too_small",minimum:c,inclusive:true,input:s,inst:e,origin:"array"}),o;s.length>r.length&&o.issues.push({code:"too_big",maximum:r.length,inclusive:true,input:s,inst:e,origin:"array"});}let l=new Array(r.length),f=t.rest?i?.abortEarly:void 0,p=false;for(let m=0;m<r.length;m++){let h=r[m]._zod.run({value:s[m],issues:[]},i);h instanceof Promise?a.push(h.then(d=>{l[m]=d;})):(l[m]=h,f&&!p&&h.issues.length&&(p=Ne(h)));}if(t.rest&&!p){let m=r.length-1,h=s.slice(r.length),d=o.issues.length;for(let g of h){if(f&&o.issues.length!==d){if(Ne(o,d))break;d=o.issues.length;}m++;let y=t.rest._zod.run({value:g,issues:[]},i);y instanceof Promise?a.push(y.then(_=>Vh(_,o,m))):Vh(y,o,m);}}return a.length?Promise.all(a).then(()=>jh(l,o,r,s,u)):jh(l,o,r,s,u)};});function Qh(e,t){for(let r=e.length-1;r>=0;r--)if(!(t==="optin"?e[r]._zod.optin!==void 0:e[r]._zod.optout==="optional"))return r+1;return 0}function Vh(e,t,r){e.issues.length&&t.issues.push(...je(r,e.issues)),t.value[r]=e.value;}function jh(e,t,r,n,o){for(let i=0;i<r.length;i++){let s=e[i],a=i<n.length;if(!a&&i>=o&&r[i]._zod.optin==="optional"){t.value.length=i;break}if(s.issues.length){if(!a&&i>=o){t.value.length=i;break}t.issues.push(...je(i,s.issues));}t.value[i]=s.value;}for(let i=t.value.length-1;i>=n.length&&(r[i]._zod.optout==="optional"&&t.value[i]===void 0);i--)t.value.length=i;return t}var zl=S("$ZodRecord",(e,t)=>{G.init(e,t);let r=ve.memoizer;r?.attach(e),e._zod.parse=(n,o)=>{let i=n.value;if(!et(i))return n.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),n;let s=[],a=t.keyType._zod.values;if(a&&!t.partial){n.value=r?r.alloc(e,n,{},o):{};let c=new Set;for(let l of a)if(typeof l=="string"||typeof l=="number"||typeof l=="symbol"){if(c.add(typeof l=="number"?l.toString():l),l==="__proto__")continue;let f=t.keyType._zod.run({value:l,issues:[]},o);if(f instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(f.issues.length){n.issues.push({code:"invalid_key",origin:"record",issues:f.issues.map(h=>qe(h,o,de())),input:l,path:[l],inst:e});continue}let p=f.value;if(p==="__proto__")continue;let m=t.valueType._zod.run({value:i[l],issues:[]},o);m instanceof Promise?s.push(m.then(h=>{h.issues.length&&n.issues.push(...je(l,h.issues)),n.value[p]=h.value;})):(m.issues.length&&n.issues.push(...je(l,m.issues)),n.value[p]=m.value);}let u;for(let l in i)if(!c.has(l))if(t.mode==="loose"){if(l==="__proto__")continue;n.value[l]=i[l];}else u=u??[],u.push(l);u&&u.length>0&&n.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:u,continue:true});}else {n.value=r?r.alloc(e,n,{},o):{};let c;for(let u of Reflect.ownKeys(i)){if(u==="__proto__"||!Object.prototype.propertyIsEnumerable.call(i,u))continue;let l=t.keyType._zod.run({value:u,issues:[]},o);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof u=="string"&&yt.test(u)&&l.issues.length){let h=t.keyType._zod.run({value:Number(u),issues:[]},o);if(h instanceof Promise)throw new Error("Async schemas not supported in object keys currently");h.issues.length===0&&(l=h);}if(l.issues.length){t.mode==="loose"?n.value[u]=i[u]:a?(c=c??[],c.push(u)):n.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(h=>qe(h,o,de())),input:u,path:[u],inst:e});continue}let p=l.value;if(p==="__proto__")continue;let m=t.valueType._zod.run({value:i[u],issues:[]},o);m instanceof Promise?s.push(m.then(h=>{h.issues.length&&n.issues.push(...je(u,h.issues)),n.value[p]=h.value;})):(m.issues.length&&n.issues.push(...je(u,m.issues)),n.value[p]=m.value);}c&&c.length>0&&n.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:c,continue:true});}return s.length?Promise.all(s).then(()=>n):n};}),Nl=S("$ZodMap",(e,t)=>{G.init(e,t);let r=ve.memoizer;r?.attach(e),e._zod.parse=(n,o)=>{let i=n.value;if(!(i instanceof Map))return n.issues.push({expected:"map",code:"invalid_type",input:i,inst:e}),n;let s=[];n.value=r?r.alloc(e,n,new Map,o):new Map;let a=o?.abortEarly,c=n.issues.length;for(let[u,l]of i){if(a&&n.issues.length!==c){if(Ne(n,c))break;c=n.issues.length;}let f=t.keyType._zod.run({value:u,issues:[]},o),p=t.valueType._zod.run({value:l,issues:[]},o);f instanceof Promise||p instanceof Promise?s.push(Promise.all([f,p]).then(([m,h])=>{qh(m,h,n,u,i,e,o);})):qh(f,p,n,u,i,e,o);}return s.length?Promise.all(s).then(()=>n):n},Pl(e,F$);});function qh(e,t,r,n,o,i,s){e.issues.length&&(Hn.has(typeof n)?r.issues.push(...je(n,e.issues)):r.issues.push({code:"invalid_key",origin:"map",input:o,inst:i,issues:e.issues.map(a=>qe(a,s,de()))})),t.issues.length&&(Hn.has(typeof n)?r.issues.push(...je(n,t.issues)):r.issues.push({origin:"map",code:"invalid_element",input:o,inst:i,key:n,issues:t.issues.map(a=>qe(a,s,de()))})),r.value.set(e.value,t.value);}var Ll=S("$ZodSet",(e,t)=>{G.init(e,t);let r=ve.memoizer;r?.attach(e),e._zod.parse=(n,o)=>{let i=n.value;if(!(i instanceof Set))return n.issues.push({input:i,inst:e,expected:"set",code:"invalid_type"}),n;let s=[];n.value=r?r.alloc(e,n,new Set,o):new Set;let a=o?.abortEarly,c=n.issues.length;for(let u of i){if(a&&n.issues.length!==c){if(Ne(n,c))break;c=n.issues.length;}let l=t.valueType._zod.run({value:u,issues:[]},o);l instanceof Promise?s.push(l.then(f=>Wh(f,n))):Wh(l,n);}return s.length?Promise.all(s).then(()=>n):n},Pl(e,D$);});function Wh(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value);}var Ol=S("$ZodEnum",(e,t)=>{G.init(e,t);let r=Ur(t.entries),n=new Set(r);e._zod.values=n,q(e,"pattern",o=>{let i=Ur(o.def.entries).filter(s=>Hn.has(typeof s));return new RegExp(i.length?`^(${i.map(s=>tt(s.toString())).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(o,i)=>{let s=o.value;return n.has(s)||o.issues.push({code:"invalid_value",values:r,input:s,inst:e}),o};}),Tl=S("$ZodLiteral",(e,t)=>{G.init(e,t);let r=new Set(t.values);e._zod.values=r,q(e,"pattern",n=>{let o=n.def.values;return new RegExp(o.length?`^(${o.map(i=>typeof i=="string"?tt(i):i?tt(i.toString()):String(i)).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(n,o)=>{let i=n.value;return r.has(i)||n.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),n};}),Fl=S("$ZodFile",(e,t)=>{G.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;return o instanceof File||r.issues.push({expected:"file",code:"invalid_type",input:o,inst:e}),r};}),Dl=S("$ZodTransform",(e,t)=>{G.init(e,t),e._zod.optin="optional",ve.memoizer?.guard(e),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Rt(e.constructor.name);let o=t.transform(r.value,r);if(n.async)return (o instanceof Promise?o:Promise.resolve(o)).then(s=>(r.value=s,r));if(o instanceof Promise)throw new We;return r.value=o,r};});function Hh(e,t){return e.value=t.issues.length?void 0:t.value,e}var Yi=S("$ZodOptional",(e,t)=>{G.init(e,t),q(e,"optin",r=>r.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),e._zod.optout="optional",q(e,"values",r=>{let n=r.def.innerType._zod.values;return n?new Set([...n,void 0]):void 0}),q(e,"pattern",r=>{let n=r.def.innerType._zod.pattern;return n?new RegExp(`^(${_t(n.source)})?$`):void 0}),e._zod.parse=(r,n)=>{if(r.value===void 0){if(t.innerType._zod.optin!=="defaulted")return r;let o=t.innerType._zod.run({value:r.value,issues:[]},n);return o instanceof Promise?o.then(i=>Hh(r,i)):Hh(r,o)}return t.innerType._zod.run(r,n)};}),Zl=S("$ZodExactOptional",(e,t)=>{Yi.init(e,t),q(e,"values",r=>r.def.innerType._zod.values),q(e,"pattern",r=>r.def.innerType._zod.pattern),e._zod.parse=(r,n)=>t.innerType._zod.run(r,n);}),Bl=S("$ZodNullable",(e,t)=>{G.init(e,t),q(e,"optin",r=>r.def.innerType._zod.optin),q(e,"optout",r=>r.def.innerType._zod.optout),q(e,"pattern",r=>{let n=r.def.innerType._zod.pattern;return n?new RegExp(`^(${_t(n.source)}|null)$`):void 0}),q(e,"values",r=>r.def.innerType._zod.values?new Set([...r.def.innerType._zod.values,null]):void 0),e._zod.parse=(r,n)=>r.value===null?r:t.innerType._zod.run(r,n);}),Ul=S("$ZodDefault",(e,t)=>{G.init(e,t),e._zod.optin="defaulted",q(e,"values",r=>r.def.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);if(r.value===void 0)return r.value=t.defaultValue,r;let o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(i=>Kh(i,t)):Kh(o,t)};});function Kh(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var Gl=S("$ZodPrefault",(e,t)=>{G.init(e,t),e._zod.optin="defaulted",q(e,"values",r=>r.def.innerType._zod.values),e._zod.parse=(r,n)=>(n.direction==="backward"||r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,n));}),Ql=S("$ZodNonOptional",(e,t)=>{G.init(e,t),q(e,"values",r=>{let n=r.def.innerType._zod.values;return n?new Set([...n].filter(o=>o!==void 0)):void 0}),e._zod.parse=(r,n)=>{let o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(i=>Jh(i,e)):Jh(o,e)};});function Jh(e,t){return !e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}var Vl=S("$ZodSuccess",(e,t)=>{G.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Rt("ZodSuccess");let o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(i=>(r.value=i.issues.length===0,r)):(r.value=o.issues.length===0,r)};});function Xh(e,t,r,n){return t.issues.length?(e.value=r.catchValue({...t,value:e.value,error:{issues:t.issues.map(o=>qe(o,n,de()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=true),e)}var jl=S("$ZodCatch",(e,t)=>{G.init(e,t),q(e,"optin",r=>r.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),q(e,"optout",r=>r.def.innerType._zod.optout),q(e,"values",r=>r.def.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);let o=t.innerType._zod.run({value:r.value,issues:[]},n);return o instanceof Promise?o.then(i=>Xh(r,i,t,n)):Xh(r,o,t,n)};}),ql=S("$ZodNaN",(e,t)=>{G.init(e,t),e._zod.parse=(r,n)=>((typeof r.value!="number"||!Number.isNaN(r.value))&&r.issues.push({input:r.value,inst:e,expected:"nan",code:"invalid_type"}),r);}),es=S("$ZodPipe",(e,t)=>{G.init(e,t),q(e,"values",r=>r.def.in._zod.values),q(e,"optin",r=>r.def.in._zod.optin),q(e,"optout",r=>r.def.out._zod.optout),q(e,"propValues",r=>r.def.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){let i=t.out._zod.run(r,n);return i instanceof Promise?i.then(s=>Oi(s,t.in,n)):Oi(i,t.in,n)}let o=t.in._zod.run(r,n);return o instanceof Promise?o.then(i=>Oi(i,t.out,n)):Oi(o,t.out,n)};});function Oi(e,t,r){return e.issues.some(n=>n.code!=="unrecognized_keys")?(e.aborted=true,e):t._zod.run({value:e.value,issues:e.issues},r)}var yo=S("$ZodCodec",(e,t)=>{G.init(e,t),q(e,"values",r=>r.def.in._zod.values),q(e,"optin",r=>r.def.in._zod.optin),q(e,"optout",r=>r.def.out._zod.optout),q(e,"propValues",r=>r.def.in._zod.propValues),e._zod.parse=(r,n)=>{if((n.direction||"forward")==="forward"){let i=t.in._zod.run(r,n);return i instanceof Promise?i.then(s=>Ti(s,t,n)):Ti(i,t,n)}else {let i=t.out._zod.run(r,n);return i instanceof Promise?i.then(s=>Ti(s,t,n)):Ti(i,t,n)}};});function Ti(e,t,r){if(e.issues.length)return e.aborted=true,e;if((r.direction||"forward")==="forward"){let o=t.transform(e.value,e);return o instanceof Promise?o.then(i=>Fi(e,i,t.out,r)):Fi(e,o,t.out,r)}else {let o=t.reverseTransform(e.value,e);return o instanceof Promise?o.then(i=>Fi(e,i,t.in,r)):Fi(e,o,t.in,r)}}function Fi(e,t,r,n){return e.issues.length?(e.aborted=true,e):r._zod.run({value:t,issues:e.issues},n)}var Wl=S("$ZodPreprocess",(e,t)=>{es.init(e,t);}),Hl=S("$ZodReadonly",(e,t)=>{G.init(e,t),q(e,"propValues",r=>r.def.innerType._zod.propValues),q(e,"values",r=>r.def.innerType._zod.values),q(e,"optin",r=>r.def.innerType?._zod?.optin),q(e,"optout",r=>r.def.innerType?._zod?.optout),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);let o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(Yh):Yh(o)};});function Yh(e){return e.memo||(e.value=Object.freeze(e.value)),e}function B$(e){let t=e._zod.def,r=t.pattern,n=!!t.format?.includes("int"),o,i;for(let a of t.checks??[]){let c=a._zod.def;c.pattern&&(r=c.pattern),n||(n=!!c.format?.includes("int"));let u=c.minimum??c.length,l=c.maximum??c.length;u!==void 0&&(o===void 0||u>o)&&(o=u),l!==void 0&&(i===void 0||l<i)&&(i=l);}if(r)return r.source;if(o!==void 0&&i!==void 0&&o>i)return "(?!)";if(o!==void 0||i!==void 0)return lu({minimum:o,maximum:i}).source;let s=e._zod.pattern;return (n&&s===yt?ao:s)?.source}function Zu(e){let t=e._zod.def,r=e._zod.pattern?.source,n=t.innerType??e._zod.innerType;if(n){let o=n._zod.pattern?.source,i=Zu(n);return r&&o&&i&&i!==o?r.replace(_t(o),()=>_t(i)):r}if(t.options){let o=t.options.map(Zu);if(o.every(Boolean))return `^(${o.map(i=>_t(i)).join("|")})$`}return B$(e)}var Kl=S("$ZodTemplateLiteral",(e,t)=>{G.init(e,t);let r=[];for(let n of t.parts)if(typeof n=="object"&&n!==null){let o=Zu(n);if(!o)throw new Error(`Invalid template literal part, no pattern found: ${[...n._zod.traits].shift()}`);r.push(_t(o));}else if(n===null||vc.has(typeof n))r.push(tt(`${n}`));else throw new Error(`Invalid template literal part: ${n}`);e._zod.pattern=new RegExp(`^${r.join("")}$`),e._zod.parse=(n,o)=>typeof n.value!="string"?(n.issues.push({input:n.value,inst:e,expected:"string",code:"invalid_type"}),n):(e._zod.pattern.lastIndex=0,e._zod.pattern.test(n.value)||n.issues.push({input:n.value,inst:e,code:"invalid_format",format:t.format??"template_literal",pattern:e._zod.pattern.source}),n);}),Jl=S("$ZodFunction",(e,t)=>(G.init(e,t),Object.defineProperty(e,"_def",{value:t}),e._zod.def=t,e.implement=r=>{if(typeof r!="function")throw new Error("implement() must be called with a function");return Object.defineProperty(function(...n){let o=e._def.input?$i(e._def.input,n):n,i=Reflect.apply(r,this,o);return e._def.output?$i(e._def.output,i):i},"_zod",{value:e._zod,enumerable:false})},e.implementAsync=r=>{if(typeof r!="function")throw new Error("implementAsync() must be called with a function");return Object.defineProperty(async function(...n){let o=e._def.input?await xi(e._def.input,n):n,i=await Reflect.apply(r,this,o);return e._def.output?await xi(e._def.output,i):i},"_zod",{value:e._zod,enumerable:false})},e._zod.parse=(r,n)=>typeof r.value!="function"?(r.issues.push({code:"invalid_type",expected:"function",input:r.value,inst:e}),r):(e._def.output&&e._def.output._zod.def.type==="promise"?r.value=e.implementAsync(r.value):r.value=e.implement(r.value),r),e.input=(...r)=>{let n=e.constructor;return Array.isArray(r[0])?new n({type:"function",input:new Xi({type:"tuple",items:r[0],rest:r[1]}),output:e._def.output}):new n({type:"function",input:r[0],output:e._def.output})},e.output=r=>{let n=e.constructor;return new n({type:"function",input:e._def.input,output:r})},e)),Xl=S("$ZodPromise",(e,t)=>{G.init(e,t),e._zod.parse=(r,n)=>Promise.resolve(r.value).then(o=>t.innerType._zod.run({value:o,issues:[]},n));}),bo=S("$ZodLazy",(e,t)=>{G.init(e,t),$c(e._zod,"innerType",()=>{let r=t;return r._cachedInner||(r._cachedInner=t.getter()),r._cachedInner}),q(e,"pattern",r=>r.innerType?._zod?.pattern),q(e,"propValues",r=>r.innerType?._zod?.propValues),q(e,"optin",r=>r.innerType?._zod?.optin??void 0),q(e,"optout",r=>r.innerType?._zod?.optout??void 0),e._zod.parse=(r,n)=>e._zod.innerType._zod.run(r,n);}),Yl=S("$ZodCustom",(e,t)=>{ae.init(e,t),G.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{let n=r.value,o=t.fn(n);if(o instanceof Promise)return o.then(i=>e0(i,r,n,e));e0(o,r,n,e);};});function e0(e,t,r,n){if(!e){let o={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(o.params=n._zod.def.params),t.issues.push(qr(o));}}var os=class extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform"),this.name="ZodCyclicError";}},tf="~memo",c0=[];function u0(e){return e!==null&&typeof e=="object"}function ef(e){return e.map(t=>t.path?{...t,path:t.path.slice()}:{...t})}var l0=new WeakMap,en=0,ns=1,$o=2;function xo(e,t,r){let n=l0.get(e);if(n!==void 0)return n?$o:en;if(t.has(e))return $o;t.add(e);let o=en,i=l=>{if(o!==$o&&l?._zod){let f=xo(l,t,r);f>o&&(o=f);}},s=(l,f)=>{let p=en;for(let m of Reflect.ownKeys(l)){let h=Object.getOwnPropertyDescriptor(l,m);if(!h.enumerable)continue;let d=h.get?ns:h.value?._zod?xo(h.value,t,r):en;d>p&&(p=d);}return p},a=l=>{l>o&&(o=l);},c=e._zod.def,u=c.type;switch(u){case "object":{let l=Vr(c);a(l?s(l):ns),i(c.catchall);break}case "array":i(c.element);break;case "tuple":for(let l of c.items)i(l);i(c.rest);break;case "record":case "map":i(c.keyType),i(c.valueType);break;case "set":i(c.valueType);break;case "union":for(let l of c.options)i(l);break;case "intersection":i(c.left),i(c.right);break;case "optional":case "nullable":case "default":case "prefault":case "catch":case "readonly":case "nonoptional":case "promise":case "success":i(c.innerType);break;case "pipe":i(c.in),i(c.out);break;case "function":i(c.input),i(c.output);break;case "lazy":{let l=c._cachedInner??(r?e._zod.innerType:void 0);a(l?xo(l,t,false):ns);break}case "template_literal":case "string":case "number":case "int":case "boolean":case "bigint":case "symbol":case "undefined":case "null":case "void":case "never":case "any":case "unknown":case "date":case "nan":case "enum":case "literal":case "file":case "transform":case "custom":break;default:for(let l in c){let f=Object.getOwnPropertyDescriptor(c,l);if(!f||f.get)continue;let p=f.value;if(!(!p||typeof p!="object")){if(p._zod)i(p);else if(Array.isArray(p))for(let m of p)i(m);}}}return t.delete(e),U$(e,o)}function U$(e,t){return t!==ns&&l0.set(e,t===$o),t}function is(e){return xo(e,new Set,true)!==en}function G$(e,t){let r=e.buckets.get(t);return r||(r=new WeakMap,e.buckets.set(t,r)),r}var ts,rs=[],Q$={alloc(e,t,r){let n=ts;if(!n)return r;ts=void 0;let o={value:r,issues:null};return n.set(t.value,o),rs.push(o),r},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let r=e._zod.parse,n=(o,i)=>{if(i.direction!=="backward"&&ss(i,o.value))throw new os;return r(o,i)};e._zod.parse=n,e._zod.run===r&&(e._zod.run=n);});},attach(e){var t;let r,n=false,o,i;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let s=e._zod.parse,a=(c,u)=>{if(r===void 0){let y=xo(e,new Set,false);if(y===en)return e._zod.parse=s,e._zod.run===a&&(e._zod.run=s),s(c,u);y===$o||n?r=true:n=true;}let l=c.value;if(!u0(l))return s(c,u);let f=u[tf];f||(f={buckets:new WeakMap,backEdges:void 0},u[tf]=f);let p;o===u?p=i:(p=G$(f,e),o=u,i=p);let m=p.get(l);if(m)return c.value=m.value,m.issues?m.issues.length&&c.issues.push(...ef(m.issues)):(c.memo=true,f.backEdges??(f.backEdges=new WeakSet),f.backEdges.add(m.value)),c;ts=p;let h=rs.length,d=s(c,u);ts=void 0;let g=rs.length>h?rs.pop():void 0;return d instanceof Promise?d.then(y=>(g&&(g.issues=y.issues.length?ef(y.issues):c0),y)):(g&&(g.issues=d.issues.length?ef(d.issues):c0),d)};e._zod.parse=a,e._zod.run===s&&(e._zod.run=a);});}};function wo(){return Q$}function ss(e,t){let r=e[tf]?.backEdges;return r!==void 0&&u0(t)&&r.has(t)}var as={};var f0,rf=Symbol("ZodOutput"),nf=Symbol("ZodInput"),cs=class{constructor(){this._map=new WeakMap,this._idmap=new Map;}add(t,...r){let n=r[0];return this._map.set(t,n),n&&typeof n=="object"&&"id"in n&&this._idmap.set(n.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){let r=t._zod.parent;if(r){let n={...this.get(r)??{}};delete n.id;let o={...n,...this._map.get(t)};return Object.keys(o).length?o:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};function us(){return new cs}(f0=globalThis).__zod_globalRegistry??(f0.__zod_globalRegistry=us());var ke=globalThis.__zod_globalRegistry;var Le=Symbol.for("zod.compile.invalid"),p0=Symbol.for("zod.compile.fallback"),it=class extends Error{constructor(t="z.compile does not support async refinements, transforms, or checks"){super(t),this.name="ZodCompileAsyncError";}},H=class extends Error{constructor(t,r=true){super(`z.compile does not support ${t}; this schema must use the runtime parser`),this.name="ZodCompileUnsupportedError",this.islandable=r;}};function j$(e,t){try{return fs(e,{assertOnly:!0})}catch{return t}}function cf(e,t){try{let r=fs(e),n=ls(e,r);return n._zod.bag.validator=j$(e,r),n}catch(r){if(t?.strict)throw r;return e}}function ls(e,t){if(is(e))throw new H("a schema whose subtree contains a reference cycle");let r=Y(e),n=e._zod.run,o=n.__originalRun??n,i=(s,a)=>{if(a?.async||a?.direction==="backward"||a?.skipChecks||a?.[p0]||a&&ss(a,s.value))return o(s,a);let c=t(s.value);return c!==Le?(s.value=c,s):(a&&(a[p0]=true),o(s,a))};return i.__originalRun=o,r._zod.bag.fallbackRun=o,r._zod.bag.validator=t,r._zod.run=i,n.__originalRun||q$(r,e,t),r}function q$(e,t,r){let n=e,o=t;if(typeof o.safeParse=="function"){let i=o.safeParse;n.safeParse=(s,a)=>{let c=r(s);return c!==Le?{success:true,data:c}:i(s,a)};}if(typeof o.parse=="function"){let i=o.parse;n.parse=(s,a)=>{let c=r(s);return c!==Le?c:i(s,a)};}}function fs(e,t){let r=true;try{r=is(e);}catch{}if(r)throw new H("a schema whose subtree contains a reference cycle");let n={constants:new Map,constantCounter:0,varCounter:0,definite:true},o=new Xt(["input"]),i=pe(o,n,e,"input",!t?.assertOnly);o.write(i===null?"return true;":`return ${i};`);let s=["INVALID",...n.constants.keys()],a=[Le,...n.constants.values()],c=o.content.join(`
56
+ `);}return g.write("payload.value = newResult;"),g.write("return payload;"),g.compile()},s,a=Kt,c=!we.jitless,l=c&&Ac.value,f=t.catchall,p;e._zod.parse=(m,h)=>{p??(p=n.value);let d=m.value;return a(d)?c&&l&&h?.async===false&&h.jitless!==true?(s||(s=i(t.shape)),m=s(m,h),f?l0([],d,m,h,p,e,h?.abortEarly===true):m):r(m,h):(m.issues.push({expected:"object",code:"invalid_type",input:d,inst:e}),m)};});function qh(e,t,r,n){for(let i of e)if(i.issues.length===0)return t.value=i.value,t;let o=e.filter(i=>!Te(i));return o.length===1?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(i=>i.issues.map(s=>qe(s,n,me())))}),t)}var bo=v("$ZodUnion",(e,t)=>{G.init(e,t),q(e,"optin",n=>n.def.options.some(o=>o._zod.optin==="defaulted")?"defaulted":n.def.options.some(o=>o._zod.optin!==void 0)?"optional":void 0),q(e,"optout",n=>n.def.options.some(o=>o._zod.optout==="optional")?"optional":void 0),q(e,"values",n=>{if(n.def.options.every(o=>o._zod.values))return new Set(n.def.options.flatMap(o=>Array.from(o._zod.values)))}),q(e,"pattern",n=>{if(n.def.options.every(o=>o._zod.pattern)){let o=n.def.options.map(i=>i._zod.pattern);return new RegExp(`^(${o.map(i=>yt(i.source)).join("|")})$`)}});let r=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(n,o)=>{if(r)return r(n,o);let i=false,s=[];for(let a of t.options){let c=a._zod.run({value:n.value,issues:[]},o);if(c instanceof Promise)s.push(c),i=true;else {if(c.issues.length===0)return c;s.push(c);}}return i?Promise.all(s).then(a=>qh(a,n,e,o)):qh(s,n,e,o)};});function Wh(e,t,r,n){let o=[];for(let i=0;i<e.length;i++)e[i].issues.length===0&&o.push(i);return o.length===1?(t.value=e[o[0]].value,t):(o.length===0?t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(i=>i.issues.map(s=>qe(s,n,me())))}):t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:[],inclusive:false,matches:o}),t)}var Ll=v("$ZodXor",(e,t)=>{bo.init(e,t),t.inclusive=false;let r=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(n,o)=>{if(r)return r(n,o);let i=false,s=[];for(let a of t.options){let c=a._zod.run({value:n.value,issues:[]},o);c instanceof Promise?(s.push(c),i=true):s.push(c);}return i?Promise.all(s).then(a=>Wh(a,n,e,o)):Wh(s,n,e,o)};});function Tl(e,t){let r=e._zod,n=r.bag.optionsMap;n||(n=p0(r.def),r.bag.optionsMap=n);let o=n.get(t);if(o===null)throw new Error(`Ambiguous discriminator value "${String(t)}"`);return o}function p0(e){let t=new Map;for(let r of e.options){let n=r._zod.propValues?.[e.discriminator];if(!n||n.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(r)}"`);for(let o of n)if(t.has(o)){if(o!==void 0)throw new Error(`Duplicate discriminator value "${String(o)}"`);t.set(o,null);}else t.set(o,r);}return t}var Ol=v("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=false,bo.init(e,t);let r=e._zod.parse;q(e,"propValues",o=>{let i={},s=0;for(let a of o.def.options){let c=a._zod.propValues;if(!c||Object.keys(c).length===0)throw new Error(`Invalid discriminated union option at index "${o.def.options.indexOf(a)}"`);c[o.def.discriminator]?.has(void 0)&&s++;for(let[u,l]of Object.entries(c)){Object.prototype.hasOwnProperty.call(i,u)||Ce(i,u,new Set);for(let f of l)i[u].add(f);}}return !o.def.unionFallback&&s>1&&i[o.def.discriminator]?.delete(void 0),i}),t.options.forEach((o,i)=>{let s=jr(o._zod.def);if(s&&!Object.prototype.hasOwnProperty.call(s,t.discriminator))throw new Error(`Invalid discriminated union option at index "${i}"`)});let n=Vr(()=>p0(t));e._zod.parse=(o,i)=>{let s=o.value;if(!Kt(s))return o.issues.push({code:"invalid_type",expected:"object",input:s,inst:e}),o;let a=s?.[t.discriminator],c=n.value.get(a);return c&&(a!==void 0||i.direction!=="backward")?c._zod.run(o,i):t.unionFallback||i.direction==="backward"?r(o,i):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(n.value.keys()).filter(u=>n.value.get(u)!==null),input:s,path:[t.discriminator],inst:e}),o)};}),Fl=v("$ZodIntersection",(e,t)=>{G.init(e,t),e._zod.parse=(r,n)=>{let o=r.value,i=t.left._zod.run({value:o,issues:[]},n),s=t.right._zod.run({value:o,issues:[]},n);return i instanceof Promise||s instanceof Promise?Promise.all([i,s]).then(([c,u])=>Hh(r,c,u)):Hh(r,i,s)};});function en(e,t){if(e===t)return {valid:true,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return {valid:true,data:e};if(et(e)&&et(t)){let r=Object.keys(t),n=Object.keys(e).filter(i=>r.indexOf(i)!==-1),o={...e,...t};Object.prototype.hasOwnProperty.call(o,"__proto__")&&delete o.__proto__;for(let i of n){if(i==="__proto__")continue;let s=en(e[i],t[i]);if(!s.valid)return {valid:false,mergeErrorPath:[i,...s.mergeErrorPath]};o[i]=s.data;}return {valid:true,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return {valid:false,mergeErrorPath:[]};let r=[];for(let n=0;n<e.length;n++){let o=e[n],i=t[n],s=en(o,i);if(!s.valid)return {valid:false,mergeErrorPath:[n,...s.mergeErrorPath]};r.push(s.data);}return {valid:true,data:r}}return {valid:false,mergeErrorPath:[]}}function Hh(e,t,r){let n=new Map,o,i=new Map,s=(u,l)=>{let f;if(u.code==="unrecognized_keys"&&!u.path?.length)o??(o=u),f=u.keys;else if(u.code==="invalid_key"&&u.origin==="record"&&u.path?.length===1){let p=String(u.path[0]);i.has(p)||i.set(p,u),f=[p];}else return false;for(let p of f)n.has(p)||n.set(p,{}),n.get(p)[l]=true;return true};for(let u of t.issues)s(u,"l")||e.issues.push(u);for(let u of r.issues)s(u,"r")||e.issues.push(u);let a=[...n].filter(([,u])=>u.l&&u.r).map(([u])=>u);if(a.length){let u=o?a.filter(l=>o.keys.includes(l)):[];u.length&&e.issues.push({...o,keys:u});for(let l of a)!u.includes(l)&&i.has(l)&&e.issues.push(i.get(l));}let c=en(t.value,r.value);if(!c.valid){if(Te(e))return e;throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}var os=v("$ZodTuple",(e,t)=>{G.init(e,t);let r=t.items,n=we.memoizer;n?.attach(e),e._zod.parse=(o,i)=>{let s=o.value;if(!Array.isArray(s))return o.issues.push({input:s,inst:e,expected:"tuple",code:"invalid_type"}),o;o.value=n?n.alloc(e,o,[],i):[];let a=[],c=Kh(r,"optin"),u=Kh(r,"optout");if(!t.rest){if(s.length<c)return o.issues.push({code:"too_small",minimum:c,inclusive:true,input:s,inst:e,origin:"array"}),o;s.length>r.length&&o.issues.push({code:"too_big",maximum:r.length,inclusive:true,input:s,inst:e,origin:"array"});}let l=new Array(r.length),f=t.rest?i?.abortEarly:void 0,p=false;for(let m=0;m<r.length;m++){let h=r[m]._zod.run({value:s[m],issues:[]},i);h instanceof Promise?a.push(h.then(d=>{l[m]=d;})):(l[m]=h,f&&!p&&h.issues.length&&(p=Te(h)));}if(t.rest&&!p){let m=r.length-1,h=s.slice(r.length),d=o.issues.length;for(let g of h){if(f&&o.issues.length!==d){if(Te(o,d))break;d=o.issues.length;}m++;let y=t.rest._zod.run({value:g,issues:[]},i);y instanceof Promise?a.push(y.then(_=>Jh(_,o,m))):Jh(y,o,m);}}return a.length?Promise.all(a).then(()=>Xh(l,o,r,s,u)):Xh(l,o,r,s,u)};});function Kh(e,t){for(let r=e.length-1;r>=0;r--)if(!(t==="optin"?e[r]._zod.optin!==void 0:e[r]._zod.optout==="optional"))return r+1;return 0}function Jh(e,t,r){e.issues.length&&t.issues.push(...je(r,e.issues)),t.value[r]=e.value;}function Xh(e,t,r,n,o){for(let i=0;i<r.length;i++){let s=e[i],a=i<n.length;if(!a&&i>=o&&r[i]._zod.optin==="optional"){t.value.length=i;break}if(s.issues.length){if(!a&&i>=o){t.value.length=i;break}t.issues.push(...je(i,s.issues));}t.value[i]=s.value;}for(let i=t.value.length-1;i>=n.length&&(r[i]._zod.optout==="optional"&&t.value[i]===void 0);i--)t.value.length=i;return t}var Dl=v("$ZodRecord",(e,t)=>{G.init(e,t);let r=we.memoizer;r?.attach(e),e._zod.parse=(n,o)=>{let i=n.value;if(!et(i))return n.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),n;let s=[],a=t.keyType._zod.values;if(a&&!t.partial){n.value=r?r.alloc(e,n,{},o):{};let c=new Set;for(let l of a)if(typeof l=="string"||typeof l=="number"||typeof l=="symbol"){if(c.add(typeof l=="number"?l.toString():l),l==="__proto__")continue;let f=t.keyType._zod.run({value:l,issues:[]},o);if(f instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(f.issues.length){n.issues.push({code:"invalid_key",origin:"record",issues:f.issues.map(h=>qe(h,o,me())),input:l,path:[l],inst:e});continue}let p=f.value;if(p==="__proto__")continue;let m=t.valueType._zod.run({value:i[l],issues:[]},o);m instanceof Promise?s.push(m.then(h=>{h.issues.length&&n.issues.push(...je(l,h.issues)),n.value[p]=h.value;})):(m.issues.length&&n.issues.push(...je(l,m.issues)),n.value[p]=m.value);}let u;for(let l in i)if(!c.has(l))if(t.mode==="loose"){if(l==="__proto__")continue;n.value[l]=i[l];}else u=u??[],u.push(l);u&&u.length>0&&n.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:u,continue:true});}else {n.value=r?r.alloc(e,n,{},o):{};let c;for(let u of Reflect.ownKeys(i)){if(u==="__proto__"||!Object.prototype.propertyIsEnumerable.call(i,u))continue;let l=t.keyType._zod.run({value:u,issues:[]},o);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof u=="string"&&bt.test(u)&&l.issues.length){let h=t.keyType._zod.run({value:Number(u),issues:[]},o);if(h instanceof Promise)throw new Error("Async schemas not supported in object keys currently");h.issues.length===0&&(l=h);}if(l.issues.length){t.mode==="loose"?n.value[u]=i[u]:a?(c=c??[],c.push(u)):n.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(h=>qe(h,o,me())),input:u,path:[u],inst:e});continue}let p=l.value;if(p==="__proto__")continue;let m=t.valueType._zod.run({value:i[u],issues:[]},o);m instanceof Promise?s.push(m.then(h=>{h.issues.length&&n.issues.push(...je(u,h.issues)),n.value[p]=h.value;})):(m.issues.length&&n.issues.push(...je(u,m.issues)),n.value[p]=m.value);}c&&c.length>0&&n.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:c,continue:true});}return s.length?Promise.all(s).then(()=>n):n};}),Zl=v("$ZodMap",(e,t)=>{G.init(e,t);let r=we.memoizer;r?.attach(e),e._zod.parse=(n,o)=>{let i=n.value;if(!(i instanceof Map))return n.issues.push({expected:"map",code:"invalid_type",input:i,inst:e}),n;let s=[];n.value=r?r.alloc(e,n,new Map,o):new Map;let a=o?.abortEarly,c=n.issues.length;for(let[u,l]of i){if(a&&n.issues.length!==c){if(Te(n,c))break;c=n.issues.length;}let f=t.keyType._zod.run({value:u,issues:[]},o),p=t.valueType._zod.run({value:l,issues:[]},o);f instanceof Promise||p instanceof Promise?s.push(Promise.all([f,p]).then(([m,h])=>{Yh(m,h,n,u,i,e,o);})):Yh(f,p,n,u,i,e,o);}return s.length?Promise.all(s).then(()=>n):n},Il(e,K$);});function Yh(e,t,r,n,o,i,s){e.issues.length&&(Jn.has(typeof n)?r.issues.push(...je(n,e.issues)):r.issues.push({code:"invalid_key",origin:"map",input:o,inst:i,issues:e.issues.map(a=>qe(a,s,me()))})),t.issues.length&&(Jn.has(typeof n)?r.issues.push(...je(n,t.issues)):r.issues.push({origin:"map",code:"invalid_element",input:o,inst:i,key:n,issues:t.issues.map(a=>qe(a,s,me()))})),r.value.set(e.value,t.value);}var Bl=v("$ZodSet",(e,t)=>{G.init(e,t);let r=we.memoizer;r?.attach(e),e._zod.parse=(n,o)=>{let i=n.value;if(!(i instanceof Set))return n.issues.push({input:i,inst:e,expected:"set",code:"invalid_type"}),n;let s=[];n.value=r?r.alloc(e,n,new Set,o):new Set;let a=o?.abortEarly,c=n.issues.length;for(let u of i){if(a&&n.issues.length!==c){if(Te(n,c))break;c=n.issues.length;}let l=t.valueType._zod.run({value:u,issues:[]},o);l instanceof Promise?s.push(l.then(f=>e0(f,n))):e0(l,n);}return s.length?Promise.all(s).then(()=>n):n},Il(e,J$);});function e0(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value);}var Ul=v("$ZodEnum",(e,t)=>{G.init(e,t);let r=Gr(t.entries),n=new Set(r);e._zod.values=n,q(e,"pattern",o=>{let i=Gr(o.def.entries).filter(s=>Jn.has(typeof s));return new RegExp(i.length?`^(${i.map(s=>tt(s.toString())).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(o,i)=>{let s=o.value;return n.has(s)||o.issues.push({code:"invalid_value",values:r,input:s,inst:e}),o};}),Gl=v("$ZodLiteral",(e,t)=>{G.init(e,t);let r=new Set(t.values);e._zod.values=r,q(e,"pattern",n=>{let o=n.def.values;return new RegExp(o.length?`^(${o.map(i=>typeof i=="string"?tt(i):i?tt(i.toString()):String(i)).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(n,o)=>{let i=n.value;return r.has(i)||n.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),n};}),Ql=v("$ZodFile",(e,t)=>{G.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;return o instanceof File||r.issues.push({expected:"file",code:"invalid_type",input:o,inst:e}),r};}),Vl=v("$ZodTransform",(e,t)=>{G.init(e,t),e._zod.optin="optional",we.memoizer?.guard(e),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Mt(e.constructor.name);let o=t.transform(r.value,r);if(n.async)return (o instanceof Promise?o:Promise.resolve(o)).then(s=>(r.value=s,r));if(o instanceof Promise)throw new We;return r.value=o,r};});function t0(e,t){return e.value=t.issues.length?void 0:t.value,e}var is=v("$ZodOptional",(e,t)=>{G.init(e,t),q(e,"optin",r=>r.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),e._zod.optout="optional",q(e,"values",r=>{let n=r.def.innerType._zod.values;return n?new Set([...n,void 0]):void 0}),q(e,"pattern",r=>{let n=r.def.innerType._zod.pattern;return n?new RegExp(`^(${yt(n.source)})?$`):void 0}),e._zod.parse=(r,n)=>{if(r.value===void 0){if(t.innerType._zod.optin!=="defaulted")return r;let o=t.innerType._zod.run({value:r.value,issues:[]},n);return o instanceof Promise?o.then(i=>t0(r,i)):t0(r,o)}return t.innerType._zod.run(r,n)};}),jl=v("$ZodExactOptional",(e,t)=>{is.init(e,t),q(e,"values",r=>r.def.innerType._zod.values),q(e,"pattern",r=>r.def.innerType._zod.pattern),e._zod.parse=(r,n)=>t.innerType._zod.run(r,n);}),ql=v("$ZodNullable",(e,t)=>{G.init(e,t),q(e,"optin",r=>r.def.innerType._zod.optin),q(e,"optout",r=>r.def.innerType._zod.optout),q(e,"pattern",r=>{let n=r.def.innerType._zod.pattern;return n?new RegExp(`^(${yt(n.source)}|null)$`):void 0}),q(e,"values",r=>r.def.innerType._zod.values?new Set([...r.def.innerType._zod.values,null]):void 0),e._zod.parse=(r,n)=>r.value===null?r:t.innerType._zod.run(r,n);}),Wl=v("$ZodDefault",(e,t)=>{G.init(e,t),e._zod.optin="defaulted",q(e,"values",r=>r.def.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);if(r.value===void 0)return r.value=t.defaultValue,r;let o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(i=>r0(i,t)):r0(o,t)};});function r0(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var Hl=v("$ZodPrefault",(e,t)=>{G.init(e,t),e._zod.optin="defaulted",q(e,"values",r=>r.def.innerType._zod.values),e._zod.parse=(r,n)=>(n.direction==="backward"||r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,n));}),Kl=v("$ZodNonOptional",(e,t)=>{G.init(e,t),q(e,"values",r=>{let n=r.def.innerType._zod.values;return n?new Set([...n].filter(o=>o!==void 0)):void 0}),e._zod.parse=(r,n)=>{let o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(i=>n0(i,e)):n0(o,e)};});function n0(e,t){return !e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}var Jl=v("$ZodSuccess",(e,t)=>{G.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Mt("ZodSuccess");let o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(i=>(r.value=i.issues.length===0,r)):(r.value=o.issues.length===0,r)};});function o0(e,t,r,n){return t.issues.length?(e.value=r.catchValue({...t,value:e.value,error:{issues:t.issues.map(o=>qe(o,n,me()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=true),e)}var Xl=v("$ZodCatch",(e,t)=>{G.init(e,t),q(e,"optin",r=>r.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),q(e,"optout",r=>r.def.innerType._zod.optout),q(e,"values",r=>r.def.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);let o=t.innerType._zod.run({value:r.value,issues:[]},n);return o instanceof Promise?o.then(i=>o0(r,i,t,n)):o0(r,o,t,n)};}),Yl=v("$ZodNaN",(e,t)=>{G.init(e,t),e._zod.parse=(r,n)=>((typeof r.value!="number"||!Number.isNaN(r.value))&&r.issues.push({input:r.value,inst:e,expected:"nan",code:"invalid_type"}),r);}),ss=v("$ZodPipe",(e,t)=>{G.init(e,t),q(e,"values",r=>r.def.in._zod.values),q(e,"optin",r=>r.def.in._zod.optin),q(e,"optout",r=>r.def.out._zod.optout),q(e,"propValues",r=>r.def.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){let i=t.out._zod.run(r,n);return i instanceof Promise?i.then(s=>Ui(s,t.in,n)):Ui(i,t.in,n)}let o=t.in._zod.run(r,n);return o instanceof Promise?o.then(i=>Ui(i,t.out,n)):Ui(o,t.out,n)};});function Ui(e,t,r){return e.issues.some(n=>n.code!=="unrecognized_keys")?(e.aborted=true,e):t._zod.run({value:e.value,issues:e.issues},r)}var $o=v("$ZodCodec",(e,t)=>{G.init(e,t),q(e,"values",r=>r.def.in._zod.values),q(e,"optin",r=>r.def.in._zod.optin),q(e,"optout",r=>r.def.out._zod.optout),q(e,"propValues",r=>r.def.in._zod.propValues),e._zod.parse=(r,n)=>{if((n.direction||"forward")==="forward"){let i=t.in._zod.run(r,n);return i instanceof Promise?i.then(s=>Gi(s,t,n)):Gi(i,t,n)}else {let i=t.out._zod.run(r,n);return i instanceof Promise?i.then(s=>Gi(s,t,n)):Gi(i,t,n)}};});function Gi(e,t,r){if(e.issues.length)return e.aborted=true,e;if((r.direction||"forward")==="forward"){let o=t.transform(e.value,e);return o instanceof Promise?o.then(i=>Qi(e,i,t.out,r)):Qi(e,o,t.out,r)}else {let o=t.reverseTransform(e.value,e);return o instanceof Promise?o.then(i=>Qi(e,i,t.in,r)):Qi(e,o,t.in,r)}}function Qi(e,t,r,n){return e.issues.length?(e.aborted=true,e):r._zod.run({value:t,issues:e.issues},n)}var ef=v("$ZodPreprocess",(e,t)=>{ss.init(e,t);}),tf=v("$ZodReadonly",(e,t)=>{G.init(e,t),q(e,"propValues",r=>r.def.innerType._zod.propValues),q(e,"values",r=>r.def.innerType._zod.values),q(e,"optin",r=>r.def.innerType?._zod?.optin),q(e,"optout",r=>r.def.innerType?._zod?.optout),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);let o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(i0):i0(o)};});function i0(e){return e.memo||(e.value=Object.freeze(e.value)),e}function Y$(e){let t=e._zod.def,r=t.pattern,n=!!t.format?.includes("int"),o,i;for(let a of t.checks??[]){let c=a._zod.def;c.pattern&&(r=c.pattern),n||(n=!!c.format?.includes("int"));let u=c.minimum??c.length,l=c.maximum??c.length;u!==void 0&&(o===void 0||u>o)&&(o=u),l!==void 0&&(i===void 0||l<i)&&(i=l);}if(r)return r.source;if(o!==void 0&&i!==void 0&&o>i)return "(?!)";if(o!==void 0||i!==void 0)return gu({minimum:o,maximum:i}).source;let s=e._zod.pattern;return (n&&s===bt?uo:s)?.source}function ju(e){let t=e._zod.def,r=e._zod.pattern?.source,n=t.innerType??e._zod.innerType;if(n){let o=n._zod.pattern?.source,i=ju(n);return r&&o&&i&&i!==o?r.replace(yt(o),()=>yt(i)):r}if(t.options){let o=t.options.map(ju);if(o.every(Boolean))return `^(${o.map(i=>yt(i)).join("|")})$`}return Y$(e)}var rf=v("$ZodTemplateLiteral",(e,t)=>{G.init(e,t);let r=[];for(let n of t.parts)if(typeof n=="object"&&n!==null){let o=ju(n);if(!o)throw new Error(`Invalid template literal part, no pattern found: ${[...n._zod.traits].shift()}`);r.push(yt(o));}else if(n===null||Ec.has(typeof n))r.push(tt(`${n}`));else throw new Error(`Invalid template literal part: ${n}`);e._zod.pattern=new RegExp(`^${r.join("")}$`),e._zod.parse=(n,o)=>typeof n.value!="string"?(n.issues.push({input:n.value,inst:e,expected:"string",code:"invalid_type"}),n):(e._zod.pattern.lastIndex=0,e._zod.pattern.test(n.value)||n.issues.push({input:n.value,inst:e,code:"invalid_format",format:t.format??"template_literal",pattern:e._zod.pattern.source}),n);}),nf=v("$ZodFunction",(e,t)=>(G.init(e,t),Object.defineProperty(e,"_def",{value:t}),e._zod.def=t,e.implement=r=>{if(typeof r!="function")throw new Error("implement() must be called with a function");return Object.defineProperty(function(...n){let o=e._def.input?Pi(e._def.input,n):n,i=Reflect.apply(r,this,o);return e._def.output?Pi(e._def.output,i):i},"_zod",{value:e._zod,enumerable:false})},e.implementAsync=r=>{if(typeof r!="function")throw new Error("implementAsync() must be called with a function");return Object.defineProperty(async function(...n){let o=e._def.input?await ki(e._def.input,n):n,i=await Reflect.apply(r,this,o);return e._def.output?await ki(e._def.output,i):i},"_zod",{value:e._zod,enumerable:false})},e._zod.parse=(r,n)=>typeof r.value!="function"?(r.issues.push({code:"invalid_type",expected:"function",input:r.value,inst:e}),r):(e._def.output&&e._def.output._zod.def.type==="promise"?r.value=e.implementAsync(r.value):r.value=e.implement(r.value),r),e.input=(...r)=>{let n=e.constructor;return Array.isArray(r[0])?new n({type:"function",input:new os({type:"tuple",items:r[0],rest:r[1]}),output:e._def.output}):new n({type:"function",input:r[0],output:e._def.output})},e.output=r=>{let n=e.constructor;return new n({type:"function",input:e._def.input,output:r})},e)),of=v("$ZodPromise",(e,t)=>{G.init(e,t),e._zod.parse=(r,n)=>Promise.resolve(r.value).then(o=>t.innerType._zod.run({value:o,issues:[]},n));}),xo=v("$ZodLazy",(e,t)=>{G.init(e,t),Pc(e._zod,"innerType",()=>{let r=t;return r._cachedInner||(r._cachedInner=t.getter()),r._cachedInner}),q(e,"pattern",r=>r.innerType?._zod?.pattern),q(e,"propValues",r=>r.innerType?._zod?.propValues),q(e,"optin",r=>r.innerType?._zod?.optin??void 0),q(e,"optout",r=>r.innerType?._zod?.optout??void 0),e._zod.parse=(r,n)=>e._zod.innerType._zod.run(r,n);}),sf=v("$ZodCustom",(e,t)=>{ce.init(e,t),G.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{let n=r.value,o=t.fn(n);if(o instanceof Promise)return o.then(i=>s0(i,r,n,e));s0(o,r,n,e);};});function s0(e,t,r,n){if(!e){let o={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(o.params=n._zod.def.params),t.issues.push(Wr(o));}}var ls=class extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform"),this.name="ZodCyclicError";}},cf="~memo",d0=[];function h0(e){return e!==null&&typeof e=="object"}function af(e){return e.map(t=>t.path?{...t,path:t.path.slice()}:{...t})}var g0=new WeakMap,tn=0,us=1,wo=2;function So(e,t,r){let n=g0.get(e);if(n!==void 0)return n?wo:tn;if(t.has(e))return wo;t.add(e);let o=tn,i=l=>{if(o!==wo&&l?._zod){let f=So(l,t,r);f>o&&(o=f);}},s=(l,f)=>{let p=tn;for(let m of Reflect.ownKeys(l)){let h=Object.getOwnPropertyDescriptor(l,m);if(!h.enumerable)continue;let d=h.get?us:h.value?._zod?So(h.value,t,r):tn;d>p&&(p=d);}return p},a=l=>{l>o&&(o=l);},c=e._zod.def,u=c.type;switch(u){case "object":{let l=jr(c);a(l?s(l):us),i(c.catchall);break}case "array":i(c.element);break;case "tuple":for(let l of c.items)i(l);i(c.rest);break;case "record":case "map":i(c.keyType),i(c.valueType);break;case "set":i(c.valueType);break;case "union":for(let l of c.options)i(l);break;case "intersection":i(c.left),i(c.right);break;case "optional":case "nullable":case "default":case "prefault":case "catch":case "readonly":case "nonoptional":case "promise":case "success":i(c.innerType);break;case "pipe":i(c.in),i(c.out);break;case "function":i(c.input),i(c.output);break;case "lazy":{let l=c._cachedInner??(r?e._zod.innerType:void 0);a(l?So(l,t,false):us);break}case "template_literal":case "string":case "number":case "int":case "boolean":case "bigint":case "symbol":case "undefined":case "null":case "void":case "never":case "any":case "unknown":case "date":case "nan":case "enum":case "literal":case "file":case "transform":case "custom":break;default:for(let l in c){let f=Object.getOwnPropertyDescriptor(c,l);if(!f||f.get)continue;let p=f.value;if(!(!p||typeof p!="object")){if(p._zod)i(p);else if(Array.isArray(p))for(let m of p)i(m);}}}return t.delete(e),ex(e,o)}function ex(e,t){return t!==us&&g0.set(e,t===wo),t}function fs(e){return So(e,new Set,true)!==tn}function tx(e,t){let r=e.buckets.get(t);return r||(r=new WeakMap,e.buckets.set(t,r)),r}var as,cs=[],rx={alloc(e,t,r){let n=as;if(!n)return r;as=void 0;let o={value:r,issues:null};return n.set(t.value,o),cs.push(o),r},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let r=e._zod.parse,n=(o,i)=>{if(i.direction!=="backward"&&ps(i,o.value))throw new ls;return r(o,i)};e._zod.parse=n,e._zod.run===r&&(e._zod.run=n);});},attach(e){var t;let r,n=false,o,i;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let s=e._zod.parse,a=(c,u)=>{if(r===void 0){let y=So(e,new Set,false);if(y===tn)return e._zod.parse=s,e._zod.run===a&&(e._zod.run=s),s(c,u);y===wo||n?r=true:n=true;}let l=c.value;if(!h0(l))return s(c,u);let f=u[cf];f||(f={buckets:new WeakMap,backEdges:void 0},u[cf]=f);let p;o===u?p=i:(p=tx(f,e),o=u,i=p);let m=p.get(l);if(m)return c.value=m.value,m.issues?m.issues.length&&c.issues.push(...af(m.issues)):(c.memo=true,f.backEdges??(f.backEdges=new WeakSet),f.backEdges.add(m.value)),c;as=p;let h=cs.length,d=s(c,u);as=void 0;let g=cs.length>h?cs.pop():void 0;return d instanceof Promise?d.then(y=>(g&&(g.issues=y.issues.length?af(y.issues):d0),y)):(g&&(g.issues=d.issues.length?af(d.issues):d0),d)};e._zod.parse=a,e._zod.run===s&&(e._zod.run=a);});}};function vo(){return rx}function ps(e,t){let r=e[cf]?.backEdges;return r!==void 0&&h0(t)&&r.has(t)}var ms={};var _0,uf=Symbol("ZodOutput"),lf=Symbol("ZodInput"),ds=class{constructor(){this._map=new WeakMap,this._idmap=new Map;}add(t,...r){let n=r[0];return this._map.set(t,n),n&&typeof n=="object"&&"id"in n&&this._idmap.set(n.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){let r=t._zod.parent;if(r){let n={...this.get(r)??{}};delete n.id;let o={...n,...this._map.get(t)};return Object.keys(o).length?o:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};function hs(){return new ds}(_0=globalThis).__zod_globalRegistry??(_0.__zod_globalRegistry=hs());var Pe=globalThis.__zod_globalRegistry;var Oe=Symbol.for("zod.compile.invalid"),y0=Symbol.for("zod.compile.fallback"),it=class extends Error{constructor(t="z.compile does not support async refinements, transforms, or checks"){super(t),this.name="ZodCompileAsyncError";}},H=class extends Error{constructor(t,r=true){super(`z.compile does not support ${t}; this schema must use the runtime parser`),this.name="ZodCompileUnsupportedError",this.islandable=r;}};function ox(e,t){try{return _s(e,{assertOnly:!0})}catch{return t}}function df(e,t){try{let r=_s(e),n=gs(e,r);return n._zod.bag.validator=ox(e,r),n}catch(r){if(t?.strict)throw r;return e}}function gs(e,t){if(fs(e))throw new H("a schema whose subtree contains a reference cycle");let r=Y(e),n=e._zod.run,o=n.__originalRun??n,i=(s,a)=>{if(a?.async||a?.direction==="backward"||a?.skipChecks||a?.[y0]||a&&ps(a,s.value))return o(s,a);let c=t(s.value);return c!==Oe?(s.value=c,s):(a&&(a[y0]=true),o(s,a))};return i.__originalRun=o,r._zod.bag.fallbackRun=o,r._zod.bag.validator=t,r._zod.run=i,n.__originalRun||ix(r,e,t),r}function ix(e,t,r){let n=e,o=t;if(typeof o.safeParse=="function"){let i=o.safeParse;n.safeParse=(s,a)=>{let c=r(s);return c!==Oe?{success:true,data:c}:i(s,a)};}if(typeof o.parse=="function"){let i=o.parse;n.parse=(s,a)=>{let c=r(s);return c!==Oe?c:i(s,a)};}}function _s(e,t){let r=true;try{r=fs(e);}catch{}if(r)throw new H("a schema whose subtree contains a reference cycle");let n={constants:new Map,constantCounter:0,varCounter:0,definite:true},o=new Yt(["input"]),i=fe(o,n,e,"input",!t?.assertOnly);o.write(i===null?"return true;":`return ${i};`);let s=["INVALID",...n.constants.keys()],a=[Oe,...n.constants.values()],c=o.content.join(`
57
57
  `),u=t?.debug?s.length>0?`// Constants: ${s.join(", ")}
58
58
  ${c}`:c:"",l=Function,f=`return (input) => {
59
59
  ${c}
60
- }`,p;try{p=new l(...s,f)(...a);}catch(m){throw new H(`this schema (generated code failed to evaluate: ${m.message})`)}return t?.debug&&(p.code=u),p.definite=n.definite,p}function B(e,t){for(let[n,o]of e.constants)if(o===t)return n;let r=`c${e.constantCounter++}`;return e.constants.set(r,t),r}function tr(e,t){return e.definite=false,B(e,t)}function D(e){return `v${e.varCounter++}`}function W$(e,t){let r=e._zod.run({value:t,issues:[]},{});if(r&&typeof r.then=="function")return Le;let n=r;return n.issues.length===0?n.value:Le}function Ee(e,t,r,n,o=true){let i=e.content.length,s=t.constants.size,a=t.constantCounter,c=t.varCounter;try{return pe(e,t,r,n,o)}catch(u){if(!(u instanceof H)||!u.islandable)throw u;if(e.content.length=i,t.constants.size>s){let l=Array.from(t.constants.keys()).slice(s);for(let f of l)t.constants.delete(f);}return t.constantCounter=a,t.varCounter=c,H$(e,t,r,n)}}function H$(e,t,r,n){t.definite=false;let o=B(t,r),i=B(t,W$),s=D(t);return e.write(`const ${s} = ${i}(${o}, ${n});`),e.write(`if (${s} === INVALID) return INVALID;`),s}var K$=new Set(["max_size","min_size","size_equals","max_length","min_length","length_equals"]);function J$(e,t,r,n){let o=r._zod.def.checks;if(!o||o.length===0)return n;let i=n;for(let s of o){let a=s._zod.def;if(a.when&&!K$.has(a.check))throw new H('check with a custom "when" condition');switch(a.check){case "greater_than":X$(e,t,a,i);break;case "less_than":Y$(e,t,a,i);break;case "multiple_of":ex(e,t,a,i);break;case "number_format":y0(e,a,i);break;case "min_length":{let c=Mt(a.minimum,"min_length"),u=of(e,t,i,`${i}.length >= ${c} && ${i}.length < ${a.minimum*2}`);e.write(`if (${u} < ${c}) return INVALID;`);break}case "max_length":{let c=Mt(a.maximum,"max_length"),u=of(e,t,i,`${i}.length > ${c}`);e.write(`if (${u} > ${c}) return INVALID;`);break}case "length_equals":{let c=Mt(a.length,"length_equals"),u=of(e,t,i,`${i}.length >= ${c} && ${i}.length <= ${a.length*2}`);e.write(`if (${u} !== ${c}) return INVALID;`);break}case "min_size":e.write(`if (${i}.size < ${Mt(a.minimum,"min_size")}) return INVALID;`);break;case "max_size":e.write(`if (${i}.size > ${Mt(a.maximum,"max_size")}) return INVALID;`);break;case "size_equals":e.write(`if (${i}.size !== ${Mt(a.size,"size_equals")}) return INVALID;`);break;case "string_format":i=b0(e,t,a,i);break;case "custom":i=sx(e,t,s,i);break;case "bigint_format":tx(e,a,i);break;case "mime_type":rx(e,t,a,i);break;case "property":ox(e,t,a,i);break;case "properties":nx(e,t,a,i);break;case "overwrite":{let c=D(t);ix(e,t,s,i,c),i=c;break}default:throw new H(`check type ${a.check}`)}}return i}function of(e,t,r,n){let o=B(t,Kt),i=D(t);return e.write(`const ${i} = typeof ${r} === "string" && ${n} ? ${o}(${r}) : ${r}.length;`),i}function Mt(e,t){if(typeof e!="number"||!Number.isFinite(e))throw new H(`${t} bound of type ${typeof e}`);return `${e}`}function _0(e,t){if(typeof t=="bigint")return `${t}n`;if(typeof t=="number"){if(Number.isNaN(t))throw new H("comparison check with NaN bound");return `${t}`}if(t instanceof Date){if(Number.isNaN(t.getTime()))throw new H("comparison check with Invalid Date bound");return B(e,t)}throw new H(`comparison check bound of type ${typeof t}`)}function X$(e,t,r,n){let o=r.inclusive?"<":"<=";e.write(`if (${n} ${o} ${_0(t,r.value)}) return INVALID;`);}function Y$(e,t,r,n){let o=r.inclusive?">":">=";e.write(`if (${n} ${o} ${_0(t,r.value)}) return INVALID;`);}function ex(e,t,r,n){if(typeof r.value=="bigint"){if(r.value===BigInt(0))throw new H("multiple_of check with a zero divisor");e.write(`if (${n} % ${r.value}n !== 0n) return INVALID;`);}else {let o=B(t,qn);e.write(`if (${o}(${n}, ${Mt(r.value,"multiple_of")}) !== 0) return INVALID;`);}}function y0(e,t,r){let n=t.format;switch(n){case "safeint":e.write(`if (!Number.isSafeInteger(${r})) return INVALID;`);break;case "int32":e.write(`if (!Number.isInteger(${r}) || ${r} < -2147483648 || ${r} > 2147483647) return INVALID;`);break;case "uint32":e.write(`if (!Number.isInteger(${r}) || ${r} < 0 || ${r} > 4294967295) return INVALID;`);break;case "float32":e.write(`if (!Number.isFinite(${r}) || ${r} < -3.4028234663852886e38 || ${r} > 3.4028234663852886e38) return INVALID;`);break;case "float64":e.write(`if (!Number.isFinite(${r})) return INVALID;`);break;default:throw new H(`number format ${n}`)}}function tx(e,t,r){let n=t.format;if(n)switch(n){case "int64":e.write(`if (${r} < -9223372036854775808n || ${r} > 9223372036854775807n) return INVALID;`);break;case "uint64":e.write(`if (${r} < 0n || ${r} > 18446744073709551615n) return INVALID;`);break;default:throw new H(`bigint format ${n}`)}}function rx(e,t,r,n){let o=r.mime;if(o&&o.length>0){let i=B(t,new Set(o));e.write(`if (!${i}.has(${n}.type)) return INVALID;`);}}function nx(e,t,r,n){if(r.when)throw new H('check with a custom "when" condition');e.write(`if (${n} == null) return INVALID;`);let o=r.shape;for(let i of Reflect.ownKeys(o)){let s=typeof i=="symbol"?B(t,i):ze(i),a=D(t);e.write(`const ${a} = ${n}[${s}];`),Ee(e,t,o[i],a,false);}}function ox(e,t,r,n){let o=`${n}[${JSON.stringify(r.property)}]`;pe(e,t,r.schema,o);}function ix(e,t,r,n,o){let i=r._zod.def.tx;if(!i)throw new H("overwrite check without a transform function");if(rr(i))throw new it("z.compile: async overwrite transforms are not supported");let s=B(t,i);e.write(`const ${o} = ${s}(${n});`);}function sf(){throw new We}function uf(e){this.issues.push(e);}function sx(e,t,r,n){let o=r._zod.def;if(o.fn){if(rr(o.fn))throw new it("z.compile: async .refine() predicates are not supported");let i=tr(t,o.fn),s=B(t,sf),a=D(t);return e.write(`const ${a} = ${i}(${n});`),e.write(`if (${a} instanceof Promise) ${s}();`),e.write(`if (!${a}) return INVALID;`),n}if(r._zod.check){if(rr(r._zod.check))throw new it("z.compile: async .superRefine() / check functions are not supported");let i=r._zod.check,a=tr(t,u=>{let l={value:u,issues:[],addIssue:uf};return i(l)instanceof Promise&&sf(),l.issues.length===0?l.value:Le}),c=D(t);return e.write(`const ${c} = ${a}(${n});`),e.write(`if (${c} === INVALID) return INVALID;`),c}throw new H("custom check without a predicate or check function")}var ax=new Set(["cidrv4","cuid","cuid2","date","datetime","duration","e164","email","emoji","ends_with","guid","includes","ipv4","ksuid","lowercase","mac","nanoid","regex","starts_with","time","ulid","uppercase","uuid","xid"]);function b0(e,t,r,n,o=true){let i=r.format;if(i==="base64"){let u=B(t,mo);return e.write(`if (!${u}(${n})) return INVALID;`),n}if(i==="base64url"){let u=B(t,ji);return e.write(`if (!${u}(${n})) return INVALID;`),n}if(i==="jwt"){let u=B(t,Hi),l=B(t,r.alg??null);return e.write(`if (!${u}(${n}, ${l})) return INVALID;`),n}if(i==="ipv6"){let u=B(t,po);return e.write(`if (!${u}(${n})) return INVALID;`),n}if(i==="cidrv6"){let u=B(t,Qi);return e.write(`if (!${u}(${n})) return INVALID;`),n}if(i==="credit_card"){let u=B(t,qi);return e.write(`if (!${u}(${n})) return INVALID;`),n}if(i==="iban"){let u=B(t,Wi);return e.write(`if (!${u}(${n})) return INVALID;`),n}let s=r;if(i==="url"||i==="httpurl"||s.normalize||s.hostname!==void 0||s.protocol!==void 0){let u=B(t,Bi),l=B(t,r),f=D(t),p=D(t);if(e.write(`const ${f} = ${n}.trim();`),e.write(`const ${p} = ${u}(${f}, ${l});`),e.write(`if (typeof ${p} === "number") return INVALID;`),s.hostname!==void 0){let d=B(t,Ui);e.write(`if (!${d}(${p}, ${l}.hostname)) return INVALID;`);}if(s.protocol!==void 0){let d=B(t,Gi);e.write(`if (!${d}(${p}, ${l}.protocol)) return INVALID;`);}if(!o)return null;let m=D(t),h=s.normalize?`${p}.href`:`${B(t,fo)}(${f})`;return e.write(`const ${m} = ${h};`),m}let a=r.fn;if(a){if(rr(a))throw new H(`async string format ${i}`);let u=B(t,a);return e.write(`if (!${u}(${n})) return INVALID;`),n}if(ax.has(i)&&r.pattern){let u=B(t,r.pattern);return e.write(`${u}.lastIndex = 0;`),e.write(`if (!${u}.test(${n})) return INVALID;`),n}let c=r.format;switch(c){case "regex":throw new H("regex format without a pattern");case "lowercase":e.write(`if (${n} !== ${n}.toLowerCase()) return INVALID;`);break;case "uppercase":e.write(`if (${n} !== ${n}.toUpperCase()) return INVALID;`);break;case "includes":e.write(`if (!${n}.includes(${ze(r.includes)})) return INVALID;`);break;case "starts_with":{let u=r.prefix;e.write(`if (${n}.slice(0, ${u.length}) !== ${ze(u)}) return INVALID;`);break}case "ends_with":{let u=r.suffix;e.write(`if (${n}.slice(-${u.length}) !== ${ze(u)}) return INVALID;`);break}default:throw new H(`string format ${c}`)}return n}function pe(e,t,r,n,o=true){let i=r._zod.def,s=i.type;if(i.coerce)throw new H(`coercion (z.coerce.${s}())`);let a=o||!!i.checks?.length,c;switch(s){case "string":c=cx(e,t,r,n,a);break;case "number":c=ux(e,r,n);break;case "boolean":c=lx(e,n);break;case "bigint":c=fx(e,r,n);break;case "symbol":c=px(e,n);break;case "undefined":c=mx(e,n);break;case "null":c=dx(e,n);break;case "any":case "unknown":c=n;break;case "never":e.write("return INVALID;"),c=n;break;case "void":c=hx(e,n);break;case "nan":c=gx(e,n);break;case "date":c=_x(e,n);break;case "object":c=yx(e,t,r,n,a);break;case "optional":c=bx(e,t,r,n,a);break;case "nullable":c=wx(e,t,r,n,a);break;case "array":c=vx(e,t,r,n,a);break;case "literal":c=Sx(e,t,r,n);break;case "enum":c=Cx(e,t,r,n);break;case "readonly":{let u=d0(e,t,r,n),l=D(t);e.write(`const ${l} = Object.freeze(${u});`),c=l;break}case "success":d0(e,t,r,n),c="true";break;case "default":case "prefault":c=Px(e,t,r,n);break;case "nonoptional":c=kx(e,t,r,n);break;case "tuple":c=Ax(e,t,r,n);break;case "union":c=Ex(e,t,r,n);break;case "intersection":c=Ix(e,t,r,n);break;case "record":c=zx(e,t,r,n);break;case "map":c=Lx(e,t,r,n);break;case "set":c=Ox(e,t,r,n);break;case "file":c=Tx(e,n);break;case "template_literal":c=Fx(e,t,r,n);break;case "lazy":c=Dx(e,t,r,n);break;case "pipe":c=Zx(e,t,r,n);break;case "custom":c=Bx(e,t,r,n);break;case "transform":c=Qx(e,t,r,n);break;case "catch":c=Gx(e,t,r,n);break;default:throw new H(`schema type ${s}`)}return c===null?null:J$(e,t,r,c)}function cx(e,t,r,n,o=true){e.write(`if (typeof ${n} !== "string") return INVALID;`);let i=r._zod.def;return i.format===void 0?n:b0(e,t,i,n,o)}function ux(e,t,r){e.write(`if (typeof ${r} !== "number" || !Number.isFinite(${r})) return INVALID;`);let n=t._zod.def;return n.check==="number_format"&&n.format&&y0(e,{format:n.format},r),r}function lx(e,t){return e.write(`if (typeof ${t} !== "boolean") return INVALID;`),t}function fx(e,t,r){e.write(`if (typeof ${r} !== "bigint") return INVALID;`);let n=t._zod.def;if(n.format)switch(n.format){case "int64":e.write(`if (${r} < -9223372036854775808n || ${r} > 9223372036854775807n) return INVALID;`);break;case "uint64":e.write(`if (${r} < 0n || ${r} > 18446744073709551615n) return INVALID;`);break}return r}function px(e,t){return e.write(`if (typeof ${t} !== "symbol") return INVALID;`),t}function mx(e,t){return e.write(`if (${t} !== undefined) return INVALID;`),t}function dx(e,t){return e.write(`if (${t} !== null) return INVALID;`),t}function hx(e,t){return e.write(`if (${t} !== undefined) return INVALID;`),t}function gx(e,t){return e.write(`if (typeof ${t} !== "number" || !Number.isNaN(${t})) return INVALID;`),t}function _x(e,t){return e.write(`if (!(${t} instanceof Date) || Number.isNaN(${t}.getTime())) return INVALID;`),t}function yx(e,t,r,n,o=true){let i=r._zod.def;e.write(`if (typeof ${n} !== "object" || ${n} === null || Array.isArray(${n})) return INVALID;`);let s=i.shape,a=Object.keys(s),c=Object.getOwnPropertySymbols(s),u=c.length?[...a,...c]:a,l=_=>typeof _=="symbol"?B(t,_):ze(_),f=_=>typeof _=="symbol"?`[${l(_)}]`:ze(_),p=s;if(a.includes("__proto__"))throw new H('object shape key "__proto__"');let m=new Map;for(let _ of u){let b=p[_],v=l(_),C=D(t);if(e.write(`const ${C} = ${n}[${v}];`),b._zod.optin!==void 0){let w=D(t);e.write(`let ${w} = (() => {`),e.indented(x=>{let E=Ee(x,t,b,C);x.write(`return ${E};`);}),e.write("})();"),b._zod.optout==="optional"?(e.write(`if (${w} === INVALID) {`),e.indented(x=>{x.write(`if (${v} in ${n}) return INVALID;`),x.write(`${w} = undefined;`);}),e.write("}")):e.write(`if (${w} === INVALID) return INVALID;`),m.set(_,w);}else {xx(b)&&e.write(`if (!(${v} in ${n})) return INVALID;`);let w=Ee(e,t,b,C,o);w!==null&&m.set(_,w);}}let h=i.catchall,d="none";if(h){let _=h._zod.def.type;if(_==="never"){let b=a.map(v=>`k !== ${ze(v)}`).join(" && ")||"true";e.write(`for (const k in ${n}) {`),e.indented(v=>{v.write(`if (${b}) return INVALID;`);}),e.write("}");}else (_==="unknown"||_==="any")&&!h._zod.def.checks?.length?d="passthrough":d="schema";}let g=D(t),y=u.some(_=>m0(p[_])||af(p[_]));if(!o){if(d==="schema"){let _=a.length>0?B(t,new Set(a)):null;e.write(`for (const k in ${n}) {`),e.indented(b=>{b.write('if (k === "__proto__") continue;'),_&&b.write(`if (${_}.has(k)) continue;`);let v=D(t);b.write(`const ${v} = ${n}[k];`),Ee(b,t,h,v,false);}),e.write("}");}return null}if(y){e.write(`const ${g} = {};`);for(let _ of u){let b=l(_),v=m.get(_);af(p[_])?e.write(`if (${b} in ${n}) ${g}[${b}] = ${v};`):m0(p[_])?e.write(`if (${v} !== undefined || ${b} in ${n}) ${g}[${b}] = ${v};`):e.write(`${g}[${b}] = ${v};`);}}else {let _=u.map(b=>`${f(b)}: ${m.get(b)}`).join(", ");e.write(`const ${g} = { ${_} };`);}if(d!=="none"){let _=a.length>0?B(t,new Set(a)):null;e.write(`for (const k in ${n}) {`),e.indented(b=>{if(b.write('if (k === "__proto__") continue;'),_&&b.write(`if (${_}.has(k)) continue;`),d==="passthrough")b.write(`${g}[k] = ${n}[k];`);else {let v=D(t);b.write(`const ${v} = ${n}[k];`);let C=Ee(b,t,h,v);b.write(`${g}[k] = ${C};`);}}),e.write("}");}return g}function bx(e,t,r,n,o=true){let i=r._zod.def;if($x(r))return pe(e,t,i.innerType,n,o);if(i.innerType._zod.optin==="defaulted"){let a=D(t),c=D(t);return e.write(`let ${a};`),e.write(`if (${n} === undefined) {`),e.indented(u=>{u.write(`const ${c} = (() => {`),u.indented(l=>{let f=pe(l,t,i.innerType,n);l.write(`return ${f};`);}),u.write("})();"),u.write(`if (${c} !== INVALID) ${a} = ${c};`);}),e.write("} else {"),e.indented(u=>{let l=pe(u,t,i.innerType,n);u.write(`${a} = ${l};`);}),e.write("}"),a}let s=o?D(t):null;return s&&e.write(`let ${s};`),e.write(`if (${n} !== undefined) {`),e.indented(a=>{let c=pe(a,t,i.innerType,n,o);s&&c!==null&&a.write(`${s} = ${c};`);}),e.write("}"),s}function $x(e){return e._zod.traits?.has("$ZodExactOptional")===true}function xx(e){return e._zod.optin===void 0&&er(e)}function er(e){if(e._zod.def.coerce)return true;let t=e._zod.def;switch(t.type){case "any":case "unknown":case "undefined":case "void":case "default":case "prefault":case "transform":case "custom":case "lazy":return true;case "string":case "number":case "boolean":case "bigint":case "symbol":case "null":case "never":case "nan":case "date":case "object":case "array":case "tuple":case "record":case "map":case "set":case "file":case "template_literal":return false;case "nonoptional":return t.innerType?er(t.innerType):false;case "literal":return !!t.values?.includes(void 0);case "enum":return !!e._zod.values?.has(void 0);case "optional":case "nullable":case "readonly":case "success":return t.innerType?er(t.innerType):true;case "catch":return true;case "union":return t.options?t.options.some(er):true;case "intersection":return !t.left||!t.right?true:er(t.left)&&er(t.right);case "pipe":return t.in?er(t.in):true;default:return true}}function af(e){return e._zod.optin==="optional"&&e._zod.optout==="optional"}function m0(e){return (e._zod.optin!=="defaulted"||e._zod.optout==="optional")&&tn(e)}function tn(e){let t=e._zod.def;switch(t.type){case "string":case "number":case "boolean":case "bigint":case "symbol":case "null":case "nan":case "date":case "object":case "array":case "tuple":case "record":case "map":case "set":case "file":case "template_literal":case "never":case "success":return false;case "literal":return !!t.values?.includes(void 0);case "enum":return !!e._zod.values?.has(void 0);case "optional":return true;case "nullable":case "readonly":case "nonoptional":return t.innerType?tn(t.innerType):true;case "union":return t.options?t.options.some(tn):true;case "intersection":return !t.left||!t.right||tn(t.left)||tn(t.right);case "pipe":return t.out?tn(t.out):true;default:return true}}function wx(e,t,r,n,o=true){let i=r._zod.def,s=o?D(t):null;return s&&e.write(`let ${s} = null;`),e.write(`if (${n} !== null) {`),e.indented(a=>{let c=pe(a,t,i.innerType,n,o);s&&c!==null&&a.write(`${s} = ${c};`);}),e.write("}"),s}function lf(e,t,r){for(let[n,o]of jr(t._zod.def.checks))e.write(`if (${r} > ${Mt(n,o._zod.def.check)}) return INVALID;`);}function vx(e,t,r,n,o=true){let i=r._zod.def;e.write(`if (!Array.isArray(${n})) return INVALID;`),lf(e,r,`${n}.length`);let s=o?D(t):null,a=D(t),c=D(t);return s&&e.write(`const ${s} = new Array(${n}.length);`),e.write(`for (let ${a} = 0; ${a} < ${n}.length; ${a}++) {`),e.indented(u=>{u.write(`const ${c} = ${n}[${a}];`);let l=Ee(u,t,i.element,c,o);s&&l!==null&&u.write(`${s}[${a}] = ${l};`);}),e.write("}"),s}function Sx(e,t,r,n){let i=r._zod.def.values;if(i.length!==1){let a=B(t,new Set(i));return e.write(`if (!${a}.has(${n})) return INVALID;`),n}let s=i[0];if(typeof s=="number"&&Number.isNaN(s)){let a=B(t,new Set(i));return e.write(`if (!${a}.has(${n})) return INVALID;`),n}if(typeof s=="string")e.write(`if (${n} !== ${ze(s)}) return INVALID;`);else if(typeof s=="number"||typeof s=="boolean")e.write(`if (${n} !== ${s}) return INVALID;`);else if(s===null)e.write(`if (${n} !== null) return INVALID;`);else if(s===void 0)e.write(`if (${n} !== undefined) return INVALID;`);else if(typeof s=="bigint")e.write(`if (${n} !== ${s}n) return INVALID;`);else throw new H(`literal type ${typeof s}`);return n}function Cx(e,t,r,n){let o=r._zod.values;if(!o)throw new H("enum schema without enumerated values");let i=B(t,o);return e.write(`if (!${i}.has(${n})) return INVALID;`),n}function d0(e,t,r,n){let o=r._zod.def;return pe(e,t,o.innerType,n)}function Px(e,t,r,n){let o=r._zod.def,s=Object.getOwnPropertyDescriptor(r._zod.def,"defaultValue")?()=>r._zod.def.defaultValue:void 0;if(r._zod.def.type==="prefault"){if(!s)return pe(e,t,o.innerType,n);let c=B(t,s),u=D(t);return e.write(`let ${u} = ${n};`),e.write(`if (${n} === undefined) ${u} = ${c}();`),pe(e,t,o.innerType,u)}let a=D(t);if(s){let c=B(t,s),u=B(t,Wn);e.write(`let ${a};`),e.write(`if (${n} === undefined) {`),e.indented(l=>{l.write(`${a} = ${u}(${c}());`);}),e.write("} else {"),e.indented(l=>{let f=pe(l,t,o.innerType,n);l.write(`${a} = ${f} === undefined ? ${u}(${c}()) : ${f};`);}),e.write("}");}else e.write(`let ${a};`),e.write(`if (${n} !== undefined) {`),e.indented(c=>{let u=pe(c,t,o.innerType,n);c.write(`${a} = ${u};`);}),e.write("}");return a}function kx(e,t,r,n){let o=r._zod.def,i=pe(e,t,o.innerType,n),s=D(t);return e.write(`const ${s} = ${i};`),e.write(`if (${s} === undefined) return INVALID;`),s}function Ax(e,t,r,n){let o=r._zod.def,i=o.items,s=o.rest;e.write(`if (!Array.isArray(${n})) return INVALID;`);let a=h0(i,"optin"),c=h0(i,"optout");s?e.write(`if (${n}.length < ${a}) return INVALID;`):e.write(`if (${n}.length < ${a} || ${n}.length > ${i.length}) return INVALID;`);let u=D(t);e.write(`const ${u} = [];`);for(let l=0;l<i.length;l++){let f=i[l];if(l>=c)e.write(`if (${u}.length === ${l}) {`),e.indented(p=>{p.write(`if (${l} < ${n}.length) {`),p.indented(m=>{let h=D(t);m.write(`const ${h} = ${n}[${l}];`);let d=Ee(m,t,f,h);m.write(`${u}[${l}] = ${d};`);}),p.write("} else {"),p.indented(m=>{if(af(f)){m.write(`${u}.length = ${l};`);return}let h=D(t),d=D(t);m.write(`const ${h} = undefined;`),m.write(`const ${d} = (() => {`),m.indented(g=>{let y=Ee(g,t,f,h);g.write(`return ${y};`);}),m.write("})();"),m.write(`if (${d} === INVALID || ${d} === undefined) ${u}.length = ${l};`),m.write(`else ${u}[${l}] = ${d};`);}),p.write("}");}),e.write("}");else {let p=D(t);e.write(`const ${p} = ${n}[${l}];`);let m=Ee(e,t,f,p);e.write(`${u}[${l}] = ${m};`);}}if(s){let l=D(t),f=D(t);e.write(`for (let ${l} = ${i.length}; ${l} < ${n}.length; ${l}++) {`),e.indented(p=>{p.write(`const ${f} = ${n}[${l}];`);let m=Ee(p,t,s,f);p.write(`${u}[${l}] = ${m};`);}),e.write("}");}return u}function h0(e,t){for(let r=e.length-1;r>=0;r--)if(!(t==="optin"?e[r]._zod.optin!==void 0:e[r]._zod.optout==="optional"))return r+1;return 0}function Ex(e,t,r,n){let o=r._zod.def,i=o.options;if(o.discriminator)return Rx(e,t,o,n);if(o.inclusive===false)throw new H("exclusive unions (z.xor)");if(i.length===0)return e.write("return INVALID;"),n;if(i.length===1)return pe(e,t,i[0],n);if(i.every(c=>c._zod.def.type==="literal"&&!c._zod.def.checks?.length)){let c=new Set(i.flatMap(l=>l._zod.def.values)),u=B(t,c);return e.write(`if (!${u}.has(${n})) return INVALID;`),n}let a=D(t);e.write(`let ${a};`);for(let c=0;c<i.length;c++){let u=i[c];c===0?e.write(`${a} = (() => {`):e.write(`if (${a} === INVALID) ${a} = (() => {`),e.indented(l=>{let f=pe(l,t,u,n);l.write(`return ${f};`);}),e.write("})();");}return e.write(`if (${a} === INVALID) return INVALID;`),a}function Rx(e,t,r,n){if(r.unionFallback)throw new H("discriminated union with unionFallback");if(r.options.length===0)return e.write("return INVALID;"),n;let o=D(t),i=D(t);e.write(`const ${o} = ${n}?.[${ze(r.discriminator)}];`),e.write(`let ${i};`);let s=true,a=new Set;for(let c of r.options){let u=c._zod.propValues?.[r.discriminator];if(!u||u.size===0)throw new H("discriminated union option without static discriminator values");for(let p of u){if(a.has(p))throw new H(`duplicate discriminator value ${String(p)}`);a.add(p);}let l=Array.from(u,p=>Mx(t,o,p)),f=s?"if":"else if";e.write(`${f} (${l.join(" || ")}) {`),e.indented(p=>{let m=pe(p,t,c,n);p.write(`${i} = ${m};`);}),e.write("}"),s=false;}return e.write("else { return INVALID; }"),i}function Mx(e,t,r){if(typeof r=="string")return `${t} === ${ze(r)}`;if(typeof r=="number")return Number.isNaN(r)?`Number.isNaN(${t})`:`${t} === ${r}`;if(typeof r=="boolean")return `${t} === ${r}`;if(r===null)return `${t} === null`;if(r===void 0)return `${t} === undefined`;if(typeof r=="bigint")return `${t} === ${r}n`;if(typeof r=="symbol"){let n=B(e,r);return `${t} === ${n}`}throw new H(`literal discriminator value ${String(r)}`)}function Ix(e,t,r,n){let o=r._zod.def;t.definite=false;let i=Ee(e,t,o.left,n),s=Ee(e,t,o.right,n),a=B(t,Yr),c=D(t);return e.write(`const ${c} = ${a}(${i}, ${s});`),e.write(`if (!${c}.valid) return INVALID;`),`${c}.data`}function zx(e,t,r,n){let o=r._zod.def,i=B(t,et);e.write(`if (!${i}(${n})) return INVALID;`);let s=D(t),a=D(t),c=D(t);e.write(`const ${s} = {};`);let u=o,l=u.partial?void 0:o.keyType._zod.values;if(l){let m=[];for(let d of l){if(!(typeof d=="string"||typeof d=="number"||typeof d=="symbol"))throw new H(`record key value ${String(d)}`);let g=typeof d=="number"?d.toString():d;if(g==="__proto__")throw new H('record key "__proto__"');m.push(g);let y=B(t,d),_=pe(e,t,o.keyType,y),b=D(t);e.write(`const ${b} = ${n}[${Nx(t,g)}];`);let v=Ee(e,t,o.valueType,b);e.write(`${s}[${_}] = ${v};`);}let h=B(t,new Set(m));return e.write(`for (const ${a} in ${n}) {`),e.indented(d=>{d.write(`if (${h}.has(${a})) continue;`),u.mode==="loose"?d.write(`if (${a} !== "__proto__") ${s}[${a}] = ${n}[${a}];`):d.write("return INVALID;");}),e.write("}"),s}let f=o.keyType._zod.def;if(!(f.type==="string"&&f.format===void 0&&!f.coerce&&(f.checks?.length??0)===0)){let m=o.mode==="loose",h=fs(o.keyType);h.definite===false&&(t.definite=false);let d=B(t,h),g=B(t,yt),y=D(t);return g0(e,t,n,a,_=>{_.write(`let ${y} = ${d}(${a});`),_.write(`if (${y} === INVALID && typeof ${a} === "string" && ${g}.test(${a})) ${y} = ${d}(Number(${a}));`),m?_.write(`if (${y} === INVALID) { ${s}[${a}] = ${n}[${a}]; continue; }`):_.write(`if (${y} === INVALID) return INVALID;`),_.write(`if (${y} === "__proto__") continue;`);let b=D(t);_.write(`const ${b} = ${n}[${a}];`);let v=Ee(_,t,o.valueType,b);_.write(`${s}[${y}] = ${v};`);}),s}return g0(e,t,n,a,m=>{m.write(`const ${c} = ${n}[${a}];`);let h=Ee(m,t,o.valueType,c);m.write(`${s}[${a}] = ${h};`);},"return INVALID;"),s}function g0(e,t,r,n,o,i){let s=B(t,Object.prototype.propertyIsEnumerable),a=D(t),c=D(t),u=D(t);e.write(`const ${a} = Object.getOwnPropertySymbols(${r});`),e.write(`const ${c} = Object.getOwnPropertyNames(${r});`),e.write(`for (let ${u} = 0; ${u} < ${c}.length; ${u}++) {`),e.indented(l=>{l.write(`const ${n} = ${c}[${u}];`),l.write(`if (${n} === "__proto__" || !${s}.call(${r}, ${n})) continue;`),o(l);}),e.write("}"),e.write(`for (let ${u} = 0; ${u} < ${a}.length; ${u}++) {`),e.indented(l=>{l.write(`const ${n} = ${a}[${u}];`),l.write(`if (!${s}.call(${r}, ${n})) continue;`),i?l.write(i):o(l);}),e.write("}");}function Nx(e,t){return typeof t=="string"?ze(t):B(e,t)}function Lx(e,t,r,n){let o=r._zod.def;e.write(`if (!(${n} instanceof Map)) return INVALID;`),lf(e,r,`${n}.size`);let i=D(t),s=D(t),a=D(t);return e.write(`const ${i} = new Map();`),e.write(`for (const [${s}, ${a}] of ${n}) {`),e.indented(c=>{let u=pe(c,t,o.keyType,s),l=pe(c,t,o.valueType,a);c.write(`${i}.set(${u}, ${l});`);}),e.write("}"),i}function Ox(e,t,r,n){let o=r._zod.def;e.write(`if (!(${n} instanceof Set)) return INVALID;`),lf(e,r,`${n}.size`);let i=D(t),s=D(t);return e.write(`const ${i} = new Set();`),e.write(`for (const ${s} of ${n}) {`),e.indented(a=>{let c=pe(a,t,o.valueType,s);a.write(`${i}.add(${c});`);}),e.write("}"),i}function Tx(e,t){return e.write(`if (!(${t} instanceof File)) return INVALID;`),t}function Fx(e,t,r,n){e.write(`if (typeof ${n} !== "string") return INVALID;`);let o=r._zod.pattern;if(o){let i=B(t,o);e.write(`${i}.lastIndex = 0;`),e.write(`if (!${i}.test(${n})) return INVALID;`);}return n}function Dx(e,t,r,n){let o=r._zod.def,i=tr(t,o.getter),s=B(t,{parser:null});e.write(`if (!${s}.parser) {`),e.indented(c=>{c.write(`const inner = ${i}();`),c.write(`${s}.parser = function(input) {`),c.indented(u=>{u.write("const result = inner._zod.run({ value: input, issues: [] }, {});"),u.write("return result.issues.length === 0 ? result.value : INVALID;");}),c.write("};");}),e.write("}");let a=D(t);return e.write(`const ${a} = ${s}.parser(${n});`),e.write(`if (${a} === INVALID) return INVALID;`),a}function Zx(e,t,r,n){let o=r._zod.def,i=pe(e,t,o.in,n);if(o.transform){if(rr(o.transform))throw new it("z.compile: async transforms in pipes are not supported");let s=o.transform,c=tr(t,l=>{let f={value:l,issues:[],addIssue:uf},p=s(l,f);return p instanceof Promise?Le:f.issues.length===0?p:Le}),u=D(t);return e.write(`const ${u} = ${c}(${i});`),e.write(`if (${u} === INVALID) return INVALID;`),pe(e,t,o.out,u)}else return pe(e,t,o.out,i)}function rr(e){return typeof e=="function"&&(e.constructor.name==="AsyncFunction"||e[Symbol.toStringTag]==="AsyncFunction")}function Bx(e,t,r,n){let o=r._zod.def;if(o.fn){if(rr(o.fn))throw new it("z.compile: async custom predicates are not supported");let i=tr(t,o.fn),s=B(t,sf),a=D(t);e.write(`const ${a} = ${i}(${n});`),e.write(`if (${a} instanceof Promise) ${s}();`),e.write(`if (!${a}) return INVALID;`);}else throw new H("custom schema without a predicate function");return n}function Ux(e,t,r){let n=e._zod.run({value:r,issues:[]},{});if(n&&typeof n.then=="function")return Le;let o=n;return o.issues.length===0?o.value:t()}function Gx(e,t,r,n){let o=r._zod.def;if(!o.catchValue[yi])throw new H("catch with a callback (only a constant catch value compiles)",false);let i=D(t);e.write(`let ${i} = (() => {`),e.indented(u=>{let l=Ee(u,t,o.innerType,n);u.write(`return ${l};`);}),e.write("})();");let s=B(t,o.innerType),a=tr(t,o.catchValue),c=B(t,Ux);return e.write(`if (${i} === INVALID) {`),e.indented(u=>{u.write(`${i} = ${c}(${s}, ${a}, ${n});`),u.write(`if (${i} === INVALID) return INVALID;`);}),e.write("}"),i}function Qx(e,t,r,n){let o=r._zod.def;if(o.transform){if(rr(o.transform))throw new it("z.compile: async transforms are not supported");let i=o.transform,a=tr(t,u=>{let l={value:u,issues:[],addIssue:uf},f=i(u,l);return f instanceof Promise?Le:l.issues.length===0?f:Le}),c=D(t);return e.write(`const ${c} = ${a}(${n});`),e.write(`if (${c} === INVALID) return INVALID;`),c}return n}function ps(e){return e.checks&&(e.checks=[...e.checks]),e}function ff(e,t){return new e(ps({type:"string",...z(t)}))}function pf(e,t){return new e(ps({type:"string",coerce:true,...z(t)}))}function ms(e,t){return new e({type:"string",format:"email",check:"string_format",abort:false,...z(t)})}function ds(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:false,...z(t)})}function hs(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:false,...z(t)})}function gs(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:false,version:"v4",...z(t)})}function _s(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:false,version:"v6",...z(t)})}function ys(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:false,version:"v7",...z(t)})}function vo(e,t){return new e({type:"string",format:"url",check:"string_format",abort:false,...z(t)})}function bs(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:false,...z(t)})}function $s(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:false,...z(t)})}function xs(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:false,...z(t)})}function ws(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:false,...z(t)})}function vs(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:false,...z(t)})}function Ss(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:false,...z(t)})}function Cs(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:false,...z(t)})}function Ps(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:false,...z(t)})}function ks(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:false,...z(t)})}function mf(e,t){return new e({type:"string",format:"mac",check:"string_format",abort:false,...z(t)})}function As(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:false,...z(t)})}function Es(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:false,...z(t)})}function Rs(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:false,...z(t)})}function Ms(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:false,...z(t)})}function Is(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:false,...z(t)})}function df(e,t){return new e({type:"string",format:"credit_card",check:"string_format",abort:false,...z(t)})}function hf(e,t){return new e({type:"string",format:"iban",check:"string_format",abort:false,...z(t)})}function zs(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:false,...z(t)})}var gf={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function So(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:false,local:false,precision:null,...z(t)})}function Co(e,t){return new e({type:"string",format:"date",check:"string_format",...z(t)})}function Po(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...z(t)})}function ko(e,t){return new e({type:"string",format:"duration",check:"string_format",...z(t)})}function _f(e,t){return new e(ps({type:"number",checks:[],...z(t)}))}function yf(e,t){return new e(ps({type:"number",coerce:true,checks:[],...z(t)}))}function bf(e,t){return new e({type:"number",check:"number_format",abort:false,format:"safeint",...z(t)})}function $f(e,t){return new e({type:"number",check:"number_format",abort:false,format:"float32",...z(t)})}function xf(e,t){return new e({type:"number",check:"number_format",abort:false,format:"float64",...z(t)})}function wf(e,t){return new e({type:"number",check:"number_format",abort:false,format:"int32",...z(t)})}function vf(e,t){return new e({type:"number",check:"number_format",abort:false,format:"uint32",...z(t)})}function Sf(e,t){return new e({type:"boolean",...z(t)})}function Cf(e,t){return new e({type:"boolean",coerce:true,...z(t)})}function Pf(e,t){return new e({type:"bigint",...z(t)})}function kf(e,t){return new e({type:"bigint",coerce:true,...z(t)})}function Af(e,t){return new e({type:"bigint",check:"bigint_format",abort:false,format:"int64",...z(t)})}function Ef(e,t){return new e({type:"bigint",check:"bigint_format",abort:false,format:"uint64",...z(t)})}function Rf(e,t){return new e({type:"symbol",...z(t)})}function Mf(e,t){return new e({type:"undefined",...z(t)})}function If(e,t){return new e({type:"null",...z(t)})}function zf(e){return new e({type:"any"})}function Nf(e){return new e({type:"unknown"})}function Lf(e,t){return new e({type:"never",...z(t)})}function Of(e,t){return new e({type:"void",...z(t)})}function Tf(e,t){return new e({type:"date",...z(t)})}function Ff(e,t){return new e({type:"date",coerce:true,...z(t)})}function Df(e,t){return new e({type:"nan",...z(t)})}function ft(e,t){return new Ni({check:"less_than",...z(t),value:e,inclusive:false})}function Xe(e,t){return new Ni({check:"less_than",...z(t),value:e,inclusive:true})}function pt(e,t){return new Li({check:"greater_than",...z(t),value:e,inclusive:false})}function Ye(e,t){return new Li({check:"greater_than",...z(t),value:e,inclusive:true})}function Ns(e){return pt(0,e)}function Ls(e){return ft(0,e)}function Os(e){return Xe(0,e)}function Ts(e){return Ye(0,e)}function It(e,t){return new $u({check:"multiple_of",...z(t),value:e})}function zt(e,t){return new vu({check:"max_size",...z(t),maximum:e})}function mt(e,t){return new Su({check:"min_size",...z(t),minimum:e})}function nr(e,t){return new Cu({check:"size_equals",...z(t),size:e})}function or(e,t){return new Pu({check:"max_length",...z(t),maximum:e})}function bt(e,t){return new ku({check:"min_length",...z(t),minimum:e})}function ir(e,t){return new Au({check:"length_equals",...z(t),length:e})}function rn(e,t){return new Eu({check:"string_format",format:"regex",...z(t),pattern:e})}function nn(e){return new Ru({check:"string_format",format:"lowercase",...z(e)})}function on(e){return new Mu({check:"string_format",format:"uppercase",...z(e)})}function sn(e,t){return new Iu({check:"string_format",format:"includes",...z(t),includes:e})}function an(e,t){return new zu({check:"string_format",format:"starts_with",...z(t),prefix:e})}function cn(e,t){return new Nu({check:"string_format",format:"ends_with",...z(t),suffix:e})}function Fs(e,t,r){return new Lu({check:"property",property:e,schema:t,...z(r)})}function un(e,t){return new Ou({check:"properties",shape:e,...z(t)})}function ln(e,t){return new Tu({check:"mime_type",mime:e,...z(t)})}function st(e){return new Fu({check:"overwrite",tx:e})}function fn(e){return st(t=>t.normalize(e))}function pn(){return st(e=>e.trim())}function mn(){return st(e=>e.toLowerCase())}function dn(){return st(e=>e.toUpperCase())}function hn(){return st(e=>xc(e))}function Zf(e,t,r){return new e({type:"array",element:t,...z(r)})}function Vx(e,t,r){return new e({type:"union",options:t,...z(r)})}function jx(e,t,r){return new e({type:"union",options:t,inclusive:false,...z(r)})}function qx(e,t,r,n){return new e({type:"union",options:r,discriminator:t,...z(n)})}function Wx(e,t,r){return new e({type:"intersection",left:t,right:r})}function Hx(e,t,r,n){let o=r instanceof G,i=o?n:r,s=o?r:null;return new e({type:"tuple",items:t,rest:s,...z(i)})}function Kx(e,t,r,n){return new e({type:"record",keyType:t,valueType:r,...z(n)})}function Jx(e,t,r,n){return new e({type:"map",keyType:t,valueType:r,...z(n)})}function Xx(e,t,r){return new e({type:"set",valueType:t,...z(r)})}function Yx(e,t,r){let n=Array.isArray(t)?Object.fromEntries(t.map(o=>[o,o])):t;return new e({type:"enum",entries:n,...z(r)})}function e3(e,t,r){return new e({type:"enum",entries:t,...z(r)})}function t3(e,t,r){return new e({type:"literal",values:Array.isArray(t)?t:[t],...z(r)})}function Bf(e,t){return new e({type:"file",...z(t)})}function r3(e,t){return new e({type:"transform",transform:t})}function n3(e,t){return new e({type:"optional",innerType:t})}function o3(e,t){return new e({type:"nullable",innerType:t})}function i3(e,t,r){return new e({type:"default",innerType:t,get defaultValue(){return typeof r=="function"?r():Wn(r)}})}function s3(e,t,r){return new e({type:"nonoptional",innerType:t,...z(r)})}function a3(e,t){return new e({type:"success",innerType:t})}function c3(e,t,r){return new e({type:"catch",innerType:t,catchValue:typeof r=="function"?r:Ac(r)})}function u3(e,t,r){return new e({type:"pipe",in:t,out:r})}function l3(e,t){return new e({type:"readonly",innerType:t})}function f3(e,t,r){return new e({type:"template_literal",parts:t,...z(r)})}function p3(e,t){return new e({type:"lazy",getter:t})}function m3(e,t){return new e({type:"promise",innerType:t})}function Uf(e,t,r){let n=z(r);return n.abort??(n.abort=true),new e({type:"custom",check:"custom",fn:t,...n})}function Gf(e,t,r){return new e({type:"custom",check:"custom",fn:t,...z(r)})}function Qf(e,t){let r=$0(n=>(n.addIssue=o=>{if(typeof o=="string")n.issues.push(qr(o,n.value,r._zod.def));else {let i=o;i.fatal&&(i.continue=false),i.code??(i.code="custom"),"input"in i||(i.input=n.value),i.inst??(i.inst=r),i.continue??(i.continue=!r._zod.def.abort),n.issues.push(qr(i));}},e(n.value,n)),t);return r}function $0(e,t){let r=new ae({check:"custom",...z(t)});return r._zod.check=e,r}function Vf(e){let t=new ae({check:"describe"});return t._zod.onattach=[r=>{let n=ke.get(r)??{};ke.add(r,{...n,description:e});}],t._zod.check=()=>{},t}function jf(e){let t=new ae({check:"meta"});return t._zod.onattach=[r=>{let n=ke.get(r)??{};ke.add(r,{...n,...e});}],t._zod.check=()=>{},t}function qf(e,t){let r=z(t),n=r.truthy??["true","1","yes","on","y","enabled"],o=r.falsy??["false","0","no","off","n","disabled"];r.case!=="sensitive"&&(n=n.map(m=>typeof m=="string"?m.toLowerCase():m),o=o.map(m=>typeof m=="string"?m.toLowerCase():m));let i=new Set(n),s=new Set(o),a=e.Codec??yo,c=e.Boolean??go,u=e.String??Yt,l=new u({type:"string",error:r.error}),f=new c({type:"boolean",error:r.error}),p=new a({type:"pipe",in:l,out:f,transform:((m,h)=>{let d=m;return r.case!=="sensitive"&&(d=d.toLowerCase()),i.has(d)?true:s.has(d)?false:(h.issues.push({code:"invalid_value",expected:"stringbool",values:[...i,...s],input:h.value,inst:p,continue:false}),{})}),reverseTransform:((m,h)=>m===true?n[0]||"true":o[0]||"false"),error:r.error});return p._zod.bag.truthy=n,p._zod.bag.falsy=o,p._zod.bag.case=r.case??"insensitive",p}function sr(e,t,r,n={}){let o=z(n),i={check:"string_format",type:"string",format:t,fn:typeof r=="function"?r:a=>r.test(a),...o};return r instanceof RegExp&&(i.pattern=r),new e(i)}function Ao(e,...t){for(let r of t)for(let n of Reflect.ownKeys(r))Object.prototype.propertyIsEnumerable.call(r,n)&&Pe(e,n,r[n]);return e}function Nt(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??ke,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??"ref",reused:e?.reused??"inline",intersections:[],deferred:[],external:e?.external??void 0}}function _e(e,t,r,n,o){let i=typeof t.unrepresentable=="function"?t.unrepresentable({zodSchema:e,path:n.path,message:o}):t.unrepresentable;if(i==="any")return false;if(i===void 0||i==="throw")throw new Error(o);return Object.assign(r,i),true}function te(e,t,r={path:[],schemaPath:[]}){var n;let o=e._zod.def,i=t.seen.get(e);if(i)return i.count++,r.schemaPath.includes(e)&&(i.cycle=r.path),i.schema;let s={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,s),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let a=e._zod.toJSONSchema?.();if(a)s.schema=a;else {let l={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,s.schema,l);else {let p=s.schema,m=t.processors[o.type];if(!m)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);m(e,t,p,l);}let f=e._zod.parent;f&&(s.ref||(s.ref=f),te(f,t,l),t.seen.get(f).isParent=true);}let c=t.metadataRegistry.get(e);return c&&Ao(s.schema,c),t.io==="input"&&Oe(e)&&(delete s.schema.examples,delete s.schema.default),t.io==="input"&&"_prefault"in s.schema&&((n=s.schema).default??(n.default=s.schema._prefault)),delete s.schema._prefault,t.seen.get(e).schema}function x0(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function Lt(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");if(e.external&&e.sharedDefsExtractedFor===e.external)return;let n=new Map;for(let s of e.seen.entries()){let a=e.metadataRegistry.get(s[0])?.id;if(a){let c=n.get(a);if(c&&c!==s[0])throw new Error(`Duplicate schema id "${a}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);n.set(a,s[0]);}}let o=s=>{let a=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let f=e.external.registry.get(s[0])?.id,p=e.external.uri??(h=>h);if(f)return {ref:p(f)};let m=s[1].defId??s[1].schema.id??`schema${e.counter++}`;return s[1].defId=m,{defId:m,ref:`${p("__shared")}#/${a}/${x0(m)}`}}let c="#",u=`${c}/${a}/`;if(s[1]===r&&!s[1].schema.id)return {ref:c};let l=s[1].schema.id??`__schema${e.counter++}`;return {defId:l,ref:u+x0(l)}},i=s=>{if(s[1].schema.$ref)return;let a=s[1],{ref:c,defId:u}=o(s);a.def={...a.schema},u&&(a.defId=u);let l=a.schema;for(let f in l)delete l[f];l.$ref=c;};if(e.cycles==="throw")for(let s of e.seen.entries()){let a=s[1];if(a.cycle)throw new Error(`Cycle detected: #/${a.cycle?.join("/")}/<root>
60
+ }`,p;try{p=new l(...s,f)(...a);}catch(m){throw new H(`this schema (generated code failed to evaluate: ${m.message})`)}return t?.debug&&(p.code=u),p.definite=n.definite,p}function B(e,t){for(let[n,o]of e.constants)if(o===t)return n;let r=`c${e.constantCounter++}`;return e.constants.set(r,t),r}function rr(e,t){return e.definite=false,B(e,t)}function D(e){return `v${e.varCounter++}`}function sx(e,t){let r=e._zod.run({value:t,issues:[]},{});if(r&&typeof r.then=="function")return Oe;let n=r;return n.issues.length===0?n.value:Oe}function Ee(e,t,r,n,o=true){let i=e.content.length,s=t.constants.size,a=t.constantCounter,c=t.varCounter;try{return fe(e,t,r,n,o)}catch(u){if(!(u instanceof H)||!u.islandable)throw u;if(e.content.length=i,t.constants.size>s){let l=Array.from(t.constants.keys()).slice(s);for(let f of l)t.constants.delete(f);}return t.constantCounter=a,t.varCounter=c,ax(e,t,r,n)}}function ax(e,t,r,n){t.definite=false;let o=B(t,r),i=B(t,sx),s=D(t);return e.write(`const ${s} = ${i}(${o}, ${n});`),e.write(`if (${s} === INVALID) return INVALID;`),s}var cx=new Set(["max_size","min_size","size_equals","max_length","min_length","length_equals"]);function ux(e,t,r,n){let o=r._zod.def.checks;if(!o||o.length===0)return n;let i=n;for(let s of o){let a=s._zod.def;if(a.when&&!cx.has(a.check))throw new H('check with a custom "when" condition');switch(a.check){case "greater_than":lx(e,t,a,i);break;case "less_than":fx(e,t,a,i);break;case "multiple_of":px(e,t,a,i);break;case "number_format":v0(e,a,i);break;case "min_length":{let c=It(a.minimum,"min_length"),u=ff(e,t,i,`${i}.length >= ${c} && ${i}.length < ${a.minimum*2}`);e.write(`if (${u} < ${c}) return INVALID;`);break}case "max_length":{let c=It(a.maximum,"max_length"),u=ff(e,t,i,`${i}.length > ${c}`);e.write(`if (${u} > ${c}) return INVALID;`);break}case "length_equals":{let c=It(a.length,"length_equals"),u=ff(e,t,i,`${i}.length >= ${c} && ${i}.length <= ${a.length*2}`);e.write(`if (${u} !== ${c}) return INVALID;`);break}case "min_size":e.write(`if (${i}.size < ${It(a.minimum,"min_size")}) return INVALID;`);break;case "max_size":e.write(`if (${i}.size > ${It(a.maximum,"max_size")}) return INVALID;`);break;case "size_equals":e.write(`if (${i}.size !== ${It(a.size,"size_equals")}) return INVALID;`);break;case "string_format":i=C0(e,t,a,i);break;case "custom":i=yx(e,t,s,i);break;case "bigint_format":mx(e,a,i);break;case "mime_type":dx(e,t,a,i);break;case "property":gx(e,t,a,i);break;case "properties":hx(e,t,a,i);break;case "overwrite":{let c=D(t);_x(e,t,s,i,c),i=c;break}default:throw new H(`check type ${a.check}`)}}return i}function ff(e,t,r,n){let o=B(t,Jt),i=D(t);return e.write(`const ${i} = typeof ${r} === "string" && ${n} ? ${o}(${r}) : ${r}.length;`),i}function It(e,t){if(typeof e!="number"||!Number.isFinite(e))throw new H(`${t} bound of type ${typeof e}`);return `${e}`}function S0(e,t){if(typeof t=="bigint")return `${t}n`;if(typeof t=="number"){if(Number.isNaN(t))throw new H("comparison check with NaN bound");return `${t}`}if(t instanceof Date){if(Number.isNaN(t.getTime()))throw new H("comparison check with Invalid Date bound");return B(e,t)}throw new H(`comparison check bound of type ${typeof t}`)}function lx(e,t,r,n){let o=r.inclusive?"<":"<=";e.write(`if (${n} ${o} ${S0(t,r.value)}) return INVALID;`);}function fx(e,t,r,n){let o=r.inclusive?">":">=";e.write(`if (${n} ${o} ${S0(t,r.value)}) return INVALID;`);}function px(e,t,r,n){if(typeof r.value=="bigint"){if(r.value===BigInt(0))throw new H("multiple_of check with a zero divisor");e.write(`if (${n} % ${r.value}n !== 0n) return INVALID;`);}else {let o=B(t,Hn);e.write(`if (${o}(${n}, ${It(r.value,"multiple_of")}) !== 0) return INVALID;`);}}function v0(e,t,r){let n=t.format;switch(n){case "safeint":e.write(`if (!Number.isSafeInteger(${r})) return INVALID;`);break;case "int32":e.write(`if (!Number.isInteger(${r}) || ${r} < -2147483648 || ${r} > 2147483647) return INVALID;`);break;case "uint32":e.write(`if (!Number.isInteger(${r}) || ${r} < 0 || ${r} > 4294967295) return INVALID;`);break;case "float32":e.write(`if (!Number.isFinite(${r}) || ${r} < -3.4028234663852886e38 || ${r} > 3.4028234663852886e38) return INVALID;`);break;case "float64":e.write(`if (!Number.isFinite(${r})) return INVALID;`);break;default:throw new H(`number format ${n}`)}}function mx(e,t,r){let n=t.format;if(n)switch(n){case "int64":e.write(`if (${r} < -9223372036854775808n || ${r} > 9223372036854775807n) return INVALID;`);break;case "uint64":e.write(`if (${r} < 0n || ${r} > 18446744073709551615n) return INVALID;`);break;default:throw new H(`bigint format ${n}`)}}function dx(e,t,r,n){let o=r.mime;if(o&&o.length>0){let i=B(t,new Set(o));e.write(`if (!${i}.has(${n}.type)) return INVALID;`);}}function hx(e,t,r,n){if(r.when)throw new H('check with a custom "when" condition');e.write(`if (${n} == null) return INVALID;`);let o=r.shape;for(let i of Reflect.ownKeys(o)){let s=typeof i=="symbol"?B(t,i):Le(i),a=D(t);e.write(`const ${a} = ${n}[${s}];`),Ee(e,t,o[i],a,false);}}function gx(e,t,r,n){let o=`${n}[${JSON.stringify(r.property)}]`;fe(e,t,r.schema,o);}function _x(e,t,r,n,o){let i=r._zod.def.tx;if(!i)throw new H("overwrite check without a transform function");if(nr(i))throw new it("z.compile: async overwrite transforms are not supported");let s=B(t,i);e.write(`const ${o} = ${s}(${n});`);}function pf(){throw new We}function hf(e){this.issues.push(e);}function yx(e,t,r,n){let o=r._zod.def;if(o.fn){if(nr(o.fn))throw new it("z.compile: async .refine() predicates are not supported");let i=rr(t,o.fn),s=B(t,pf),a=D(t);return e.write(`const ${a} = ${i}(${n});`),e.write(`if (${a} instanceof Promise) ${s}();`),e.write(`if (!${a}) return INVALID;`),n}if(r._zod.check){if(nr(r._zod.check))throw new it("z.compile: async .superRefine() / check functions are not supported");let i=r._zod.check,a=rr(t,u=>{let l={value:u,issues:[],addIssue:hf};return i(l)instanceof Promise&&pf(),l.issues.length===0?l.value:Oe}),c=D(t);return e.write(`const ${c} = ${a}(${n});`),e.write(`if (${c} === INVALID) return INVALID;`),c}throw new H("custom check without a predicate or check function")}var bx=new Set(["cidrv4","cuid","cuid2","date","datetime","duration","e164","email","emoji","ends_with","guid","includes","ipv4","ksuid","lowercase","mac","nanoid","regex","starts_with","time","ulid","uppercase","uuid","xid"]);function C0(e,t,r,n,o=true){let i=r.format;if(i==="base64"){let u=B(t,go);return e.write(`if (!${u}(${n})) return INVALID;`),n}if(i==="base64url"){let u=B(t,Xi);return e.write(`if (!${u}(${n})) return INVALID;`),n}if(i==="jwt"){let u=B(t,ts),l=B(t,r.alg??null);return e.write(`if (!${u}(${n}, ${l})) return INVALID;`),n}if(i==="ipv6"){let u=B(t,ho);return e.write(`if (!${u}(${n})) return INVALID;`),n}if(i==="cidrv6"){let u=B(t,Ki);return e.write(`if (!${u}(${n})) return INVALID;`),n}if(i==="credit_card"){let u=B(t,Yi);return e.write(`if (!${u}(${n})) return INVALID;`),n}if(i==="iban"){let u=B(t,es);return e.write(`if (!${u}(${n})) return INVALID;`),n}let s=r;if(i==="url"||i==="httpurl"||s.normalize||s.hostname!==void 0||s.protocol!==void 0){let u=B(t,qi),l=B(t,r),f=D(t),p=D(t);if(e.write(`const ${f} = ${n}.trim();`),e.write(`const ${p} = ${u}(${f}, ${l});`),e.write(`if (typeof ${p} === "number") return INVALID;`),s.hostname!==void 0){let d=B(t,Wi);e.write(`if (!${d}(${p}, ${l}.hostname)) return INVALID;`);}if(s.protocol!==void 0){let d=B(t,Hi);e.write(`if (!${d}(${p}, ${l}.protocol)) return INVALID;`);}if(!o)return null;let m=D(t),h=s.normalize?`${p}.href`:`${B(t,mo)}(${f})`;return e.write(`const ${m} = ${h};`),m}let a=r.fn;if(a){if(nr(a))throw new H(`async string format ${i}`);let u=B(t,a);return e.write(`if (!${u}(${n})) return INVALID;`),n}if(bx.has(i)&&r.pattern){let u=B(t,r.pattern);return e.write(`${u}.lastIndex = 0;`),e.write(`if (!${u}.test(${n})) return INVALID;`),n}let c=r.format;switch(c){case "regex":throw new H("regex format without a pattern");case "lowercase":e.write(`if (${n} !== ${n}.toLowerCase()) return INVALID;`);break;case "uppercase":e.write(`if (${n} !== ${n}.toUpperCase()) return INVALID;`);break;case "includes":e.write(`if (!${n}.includes(${Le(r.includes)})) return INVALID;`);break;case "starts_with":{let u=r.prefix;e.write(`if (${n}.slice(0, ${u.length}) !== ${Le(u)}) return INVALID;`);break}case "ends_with":{let u=r.suffix;e.write(`if (${n}.slice(-${u.length}) !== ${Le(u)}) return INVALID;`);break}default:throw new H(`string format ${c}`)}return n}function fe(e,t,r,n,o=true){let i=r._zod.def,s=i.type;if(i.coerce)throw new H(`coercion (z.coerce.${s}())`);let a=o||!!i.checks?.length,c;switch(s){case "string":c=$x(e,t,r,n,a);break;case "number":c=xx(e,r,n);break;case "boolean":c=wx(e,n);break;case "bigint":c=Sx(e,r,n);break;case "symbol":c=vx(e,n);break;case "undefined":c=Cx(e,n);break;case "null":c=Px(e,n);break;case "any":case "unknown":c=n;break;case "never":e.write("return INVALID;"),c=n;break;case "void":c=kx(e,n);break;case "nan":c=Ax(e,n);break;case "date":c=Ex(e,n);break;case "object":c=Rx(e,t,r,n,a);break;case "optional":c=Mx(e,t,r,n,a);break;case "nullable":c=Nx(e,t,r,n,a);break;case "array":c=Lx(e,t,r,n,a);break;case "literal":c=Tx(e,t,r,n);break;case "enum":c=Ox(e,t,r,n);break;case "readonly":{let u=$0(e,t,r,n),l=D(t);e.write(`const ${l} = Object.freeze(${u});`),c=l;break}case "success":$0(e,t,r,n),c="true";break;case "default":case "prefault":c=Fx(e,t,r,n);break;case "nonoptional":c=Dx(e,t,r,n);break;case "tuple":c=Zx(e,t,r,n);break;case "union":c=Bx(e,t,r,n);break;case "intersection":c=Qx(e,t,r,n);break;case "record":c=Vx(e,t,r,n);break;case "map":c=qx(e,t,r,n);break;case "set":c=Wx(e,t,r,n);break;case "file":c=Hx(e,n);break;case "template_literal":c=Kx(e,t,r,n);break;case "lazy":c=Jx(e,t,r,n);break;case "pipe":c=Xx(e,t,r,n);break;case "custom":c=Yx(e,t,r,n);break;case "transform":c=r5(e,t,r,n);break;case "catch":c=t5(e,t,r,n);break;default:throw new H(`schema type ${s}`)}return c===null?null:ux(e,t,r,c)}function $x(e,t,r,n,o=true){e.write(`if (typeof ${n} !== "string") return INVALID;`);let i=r._zod.def;return i.format===void 0?n:C0(e,t,i,n,o)}function xx(e,t,r){e.write(`if (typeof ${r} !== "number" || !Number.isFinite(${r})) return INVALID;`);let n=t._zod.def;return n.check==="number_format"&&n.format&&v0(e,{format:n.format},r),r}function wx(e,t){return e.write(`if (typeof ${t} !== "boolean") return INVALID;`),t}function Sx(e,t,r){e.write(`if (typeof ${r} !== "bigint") return INVALID;`);let n=t._zod.def;if(n.format)switch(n.format){case "int64":e.write(`if (${r} < -9223372036854775808n || ${r} > 9223372036854775807n) return INVALID;`);break;case "uint64":e.write(`if (${r} < 0n || ${r} > 18446744073709551615n) return INVALID;`);break}return r}function vx(e,t){return e.write(`if (typeof ${t} !== "symbol") return INVALID;`),t}function Cx(e,t){return e.write(`if (${t} !== undefined) return INVALID;`),t}function Px(e,t){return e.write(`if (${t} !== null) return INVALID;`),t}function kx(e,t){return e.write(`if (${t} !== undefined) return INVALID;`),t}function Ax(e,t){return e.write(`if (typeof ${t} !== "number" || !Number.isNaN(${t})) return INVALID;`),t}function Ex(e,t){return e.write(`if (!(${t} instanceof Date) || Number.isNaN(${t}.getTime())) return INVALID;`),t}function Rx(e,t,r,n,o=true){let i=r._zod.def;e.write(`if (typeof ${n} !== "object" || ${n} === null || Array.isArray(${n})) return INVALID;`);let s=i.shape,a=Object.keys(s),c=Object.getOwnPropertySymbols(s),u=c.length?[...a,...c]:a,l=_=>typeof _=="symbol"?B(t,_):Le(_),f=_=>typeof _=="symbol"?`[${l(_)}]`:Le(_),p=s;if(a.includes("__proto__"))throw new H('object shape key "__proto__"');let m=new Map;for(let _ of u){let b=p[_],S=l(_),C=D(t);if(e.write(`const ${C} = ${n}[${S}];`),b._zod.optin!==void 0){let w=D(t);e.write(`let ${w} = (() => {`),e.indented(x=>{let A=Ee(x,t,b,C);x.write(`return ${A};`);}),e.write("})();"),b._zod.optout==="optional"?(e.write(`if (${w} === INVALID) {`),e.indented(x=>{x.write(`if (${S} in ${n}) return INVALID;`),x.write(`${w} = undefined;`);}),e.write("}")):e.write(`if (${w} === INVALID) return INVALID;`),m.set(_,w);}else {zx(b)&&e.write(`if (!(${S} in ${n})) return INVALID;`);let w=Ee(e,t,b,C,o);w!==null&&m.set(_,w);}}let h=i.catchall,d="none";if(h){let _=h._zod.def.type;if(_==="never"){let b=a.map(S=>`k !== ${Le(S)}`).join(" && ")||"true";e.write(`for (const k in ${n}) {`),e.indented(S=>{S.write(`if (${b}) return INVALID;`);}),e.write("}");}else (_==="unknown"||_==="any")&&!h._zod.def.checks?.length?d="passthrough":d="schema";}let g=D(t),y=u.some(_=>b0(p[_])||mf(p[_]));if(!o){if(d==="schema"){let _=a.length>0?B(t,new Set(a)):null;e.write(`for (const k in ${n}) {`),e.indented(b=>{b.write('if (k === "__proto__") continue;'),_&&b.write(`if (${_}.has(k)) continue;`);let S=D(t);b.write(`const ${S} = ${n}[k];`),Ee(b,t,h,S,false);}),e.write("}");}return null}if(y){e.write(`const ${g} = {};`);for(let _ of u){let b=l(_),S=m.get(_);mf(p[_])?e.write(`if (${b} in ${n}) ${g}[${b}] = ${S};`):b0(p[_])?e.write(`if (${S} !== undefined || ${b} in ${n}) ${g}[${b}] = ${S};`):e.write(`${g}[${b}] = ${S};`);}}else {let _=u.map(b=>`${f(b)}: ${m.get(b)}`).join(", ");e.write(`const ${g} = { ${_} };`);}if(d!=="none"){let _=a.length>0?B(t,new Set(a)):null;e.write(`for (const k in ${n}) {`),e.indented(b=>{if(b.write('if (k === "__proto__") continue;'),_&&b.write(`if (${_}.has(k)) continue;`),d==="passthrough")b.write(`${g}[k] = ${n}[k];`);else {let S=D(t);b.write(`const ${S} = ${n}[k];`);let C=Ee(b,t,h,S);b.write(`${g}[k] = ${C};`);}}),e.write("}");}return g}function Mx(e,t,r,n,o=true){let i=r._zod.def;if(Ix(r))return fe(e,t,i.innerType,n,o);if(i.innerType._zod.optin==="defaulted"){let a=D(t),c=D(t);return e.write(`let ${a};`),e.write(`if (${n} === undefined) {`),e.indented(u=>{u.write(`const ${c} = (() => {`),u.indented(l=>{let f=fe(l,t,i.innerType,n);l.write(`return ${f};`);}),u.write("})();"),u.write(`if (${c} !== INVALID) ${a} = ${c};`);}),e.write("} else {"),e.indented(u=>{let l=fe(u,t,i.innerType,n);u.write(`${a} = ${l};`);}),e.write("}"),a}let s=o?D(t):null;return s&&e.write(`let ${s};`),e.write(`if (${n} !== undefined) {`),e.indented(a=>{let c=fe(a,t,i.innerType,n,o);s&&c!==null&&a.write(`${s} = ${c};`);}),e.write("}"),s}function Ix(e){return e._zod.traits?.has("$ZodExactOptional")===true}function zx(e){return e._zod.optin===void 0&&tr(e)}function tr(e){if(e._zod.def.coerce)return true;let t=e._zod.def;switch(t.type){case "any":case "unknown":case "undefined":case "void":case "default":case "prefault":case "transform":case "custom":case "lazy":return true;case "string":case "number":case "boolean":case "bigint":case "symbol":case "null":case "never":case "nan":case "date":case "object":case "array":case "tuple":case "record":case "map":case "set":case "file":case "template_literal":return false;case "nonoptional":return t.innerType?tr(t.innerType):false;case "literal":return !!t.values?.includes(void 0);case "enum":return !!e._zod.values?.has(void 0);case "optional":case "nullable":case "readonly":case "success":return t.innerType?tr(t.innerType):true;case "catch":return true;case "union":return t.options?t.options.some(tr):true;case "intersection":return !t.left||!t.right?true:tr(t.left)&&tr(t.right);case "pipe":return t.in?tr(t.in):true;default:return true}}function mf(e){return e._zod.optin==="optional"&&e._zod.optout==="optional"}function b0(e){return (e._zod.optin!=="defaulted"||e._zod.optout==="optional")&&rn(e)}function rn(e){let t=e._zod.def;switch(t.type){case "string":case "number":case "boolean":case "bigint":case "symbol":case "null":case "nan":case "date":case "object":case "array":case "tuple":case "record":case "map":case "set":case "file":case "template_literal":case "never":case "success":return false;case "literal":return !!t.values?.includes(void 0);case "enum":return !!e._zod.values?.has(void 0);case "optional":return true;case "nullable":case "readonly":case "nonoptional":return t.innerType?rn(t.innerType):true;case "union":return t.options?t.options.some(rn):true;case "intersection":return !t.left||!t.right||rn(t.left)||rn(t.right);case "pipe":return t.out?rn(t.out):true;default:return true}}function Nx(e,t,r,n,o=true){let i=r._zod.def,s=o?D(t):null;return s&&e.write(`let ${s} = null;`),e.write(`if (${n} !== null) {`),e.indented(a=>{let c=fe(a,t,i.innerType,n,o);s&&c!==null&&a.write(`${s} = ${c};`);}),e.write("}"),s}function gf(e,t,r){for(let[n,o]of qr(t._zod.def.checks))e.write(`if (${r} > ${It(n,o._zod.def.check)}) return INVALID;`);}function Lx(e,t,r,n,o=true){let i=r._zod.def;e.write(`if (!Array.isArray(${n})) return INVALID;`),gf(e,r,`${n}.length`);let s=o?D(t):null,a=D(t),c=D(t);return s&&e.write(`const ${s} = new Array(${n}.length);`),e.write(`for (let ${a} = 0; ${a} < ${n}.length; ${a}++) {`),e.indented(u=>{u.write(`const ${c} = ${n}[${a}];`);let l=Ee(u,t,i.element,c,o);s&&l!==null&&u.write(`${s}[${a}] = ${l};`);}),e.write("}"),s}function Tx(e,t,r,n){let i=r._zod.def.values;if(i.length!==1){let a=B(t,new Set(i));return e.write(`if (!${a}.has(${n})) return INVALID;`),n}let s=i[0];if(typeof s=="number"&&Number.isNaN(s)){let a=B(t,new Set(i));return e.write(`if (!${a}.has(${n})) return INVALID;`),n}if(typeof s=="string")e.write(`if (${n} !== ${Le(s)}) return INVALID;`);else if(typeof s=="number"||typeof s=="boolean")e.write(`if (${n} !== ${s}) return INVALID;`);else if(s===null)e.write(`if (${n} !== null) return INVALID;`);else if(s===void 0)e.write(`if (${n} !== undefined) return INVALID;`);else if(typeof s=="bigint")e.write(`if (${n} !== ${s}n) return INVALID;`);else throw new H(`literal type ${typeof s}`);return n}function Ox(e,t,r,n){let o=r._zod.values;if(!o)throw new H("enum schema without enumerated values");let i=B(t,o);return e.write(`if (!${i}.has(${n})) return INVALID;`),n}function $0(e,t,r,n){let o=r._zod.def;return fe(e,t,o.innerType,n)}function Fx(e,t,r,n){let o=r._zod.def,s=Object.getOwnPropertyDescriptor(r._zod.def,"defaultValue")?()=>r._zod.def.defaultValue:void 0;if(r._zod.def.type==="prefault"){if(!s)return fe(e,t,o.innerType,n);let c=B(t,s),u=D(t);return e.write(`let ${u} = ${n};`),e.write(`if (${n} === undefined) ${u} = ${c}();`),fe(e,t,o.innerType,u)}let a=D(t);if(s){let c=B(t,s),u=B(t,Kn);e.write(`let ${a};`),e.write(`if (${n} === undefined) {`),e.indented(l=>{l.write(`${a} = ${u}(${c}());`);}),e.write("} else {"),e.indented(l=>{let f=fe(l,t,o.innerType,n);l.write(`${a} = ${f} === undefined ? ${u}(${c}()) : ${f};`);}),e.write("}");}else e.write(`let ${a};`),e.write(`if (${n} !== undefined) {`),e.indented(c=>{let u=fe(c,t,o.innerType,n);c.write(`${a} = ${u};`);}),e.write("}");return a}function Dx(e,t,r,n){let o=r._zod.def,i=fe(e,t,o.innerType,n),s=D(t);return e.write(`const ${s} = ${i};`),e.write(`if (${s} === undefined) return INVALID;`),s}function Zx(e,t,r,n){let o=r._zod.def,i=o.items,s=o.rest;e.write(`if (!Array.isArray(${n})) return INVALID;`);let a=x0(i,"optin"),c=x0(i,"optout");s?e.write(`if (${n}.length < ${a}) return INVALID;`):e.write(`if (${n}.length < ${a} || ${n}.length > ${i.length}) return INVALID;`);let u=D(t);e.write(`const ${u} = [];`);for(let l=0;l<i.length;l++){let f=i[l];if(l>=c)e.write(`if (${u}.length === ${l}) {`),e.indented(p=>{p.write(`if (${l} < ${n}.length) {`),p.indented(m=>{let h=D(t);m.write(`const ${h} = ${n}[${l}];`);let d=Ee(m,t,f,h);m.write(`${u}[${l}] = ${d};`);}),p.write("} else {"),p.indented(m=>{if(mf(f)){m.write(`${u}.length = ${l};`);return}let h=D(t),d=D(t);m.write(`const ${h} = undefined;`),m.write(`const ${d} = (() => {`),m.indented(g=>{let y=Ee(g,t,f,h);g.write(`return ${y};`);}),m.write("})();"),m.write(`if (${d} === INVALID || ${d} === undefined) ${u}.length = ${l};`),m.write(`else ${u}[${l}] = ${d};`);}),p.write("}");}),e.write("}");else {let p=D(t);e.write(`const ${p} = ${n}[${l}];`);let m=Ee(e,t,f,p);e.write(`${u}[${l}] = ${m};`);}}if(s){let l=D(t),f=D(t);e.write(`for (let ${l} = ${i.length}; ${l} < ${n}.length; ${l}++) {`),e.indented(p=>{p.write(`const ${f} = ${n}[${l}];`);let m=Ee(p,t,s,f);p.write(`${u}[${l}] = ${m};`);}),e.write("}");}return u}function x0(e,t){for(let r=e.length-1;r>=0;r--)if(!(t==="optin"?e[r]._zod.optin!==void 0:e[r]._zod.optout==="optional"))return r+1;return 0}function Bx(e,t,r,n){let o=r._zod.def,i=o.options;if(o.discriminator)return Ux(e,t,o,n);if(o.inclusive===false)throw new H("exclusive unions (z.xor)");if(i.length===0)return e.write("return INVALID;"),n;if(i.length===1)return fe(e,t,i[0],n);if(i.every(c=>c._zod.def.type==="literal"&&!c._zod.def.checks?.length)){let c=new Set(i.flatMap(l=>l._zod.def.values)),u=B(t,c);return e.write(`if (!${u}.has(${n})) return INVALID;`),n}let a=D(t);e.write(`let ${a};`);for(let c=0;c<i.length;c++){let u=i[c];c===0?e.write(`${a} = (() => {`):e.write(`if (${a} === INVALID) ${a} = (() => {`),e.indented(l=>{let f=fe(l,t,u,n);l.write(`return ${f};`);}),e.write("})();");}return e.write(`if (${a} === INVALID) return INVALID;`),a}function Ux(e,t,r,n){if(r.unionFallback)throw new H("discriminated union with unionFallback");if(r.options.length===0)return e.write("return INVALID;"),n;let o=D(t),i=D(t);e.write(`const ${o} = ${n}?.[${Le(r.discriminator)}];`),e.write(`let ${i};`);let s=true,a=new Set;for(let c of r.options){let u=c._zod.propValues?.[r.discriminator];if(!u||u.size===0)throw new H("discriminated union option without static discriminator values");for(let p of u){if(a.has(p))throw new H(`duplicate discriminator value ${String(p)}`);a.add(p);}let l=Array.from(u,p=>Gx(t,o,p)),f=s?"if":"else if";e.write(`${f} (${l.join(" || ")}) {`),e.indented(p=>{let m=fe(p,t,c,n);p.write(`${i} = ${m};`);}),e.write("}"),s=false;}return e.write("else { return INVALID; }"),i}function Gx(e,t,r){if(typeof r=="string")return `${t} === ${Le(r)}`;if(typeof r=="number")return Number.isNaN(r)?`Number.isNaN(${t})`:`${t} === ${r}`;if(typeof r=="boolean")return `${t} === ${r}`;if(r===null)return `${t} === null`;if(r===void 0)return `${t} === undefined`;if(typeof r=="bigint")return `${t} === ${r}n`;if(typeof r=="symbol"){let n=B(e,r);return `${t} === ${n}`}throw new H(`literal discriminator value ${String(r)}`)}function Qx(e,t,r,n){let o=r._zod.def;t.definite=false;let i=Ee(e,t,o.left,n),s=Ee(e,t,o.right,n),a=B(t,en),c=D(t);return e.write(`const ${c} = ${a}(${i}, ${s});`),e.write(`if (!${c}.valid) return INVALID;`),`${c}.data`}function Vx(e,t,r,n){let o=r._zod.def,i=B(t,et);e.write(`if (!${i}(${n})) return INVALID;`);let s=D(t),a=D(t),c=D(t);e.write(`const ${s} = {};`);let u=o,l=u.partial?void 0:o.keyType._zod.values;if(l){let m=[];for(let d of l){if(!(typeof d=="string"||typeof d=="number"||typeof d=="symbol"))throw new H(`record key value ${String(d)}`);let g=typeof d=="number"?d.toString():d;if(g==="__proto__")throw new H('record key "__proto__"');m.push(g);let y=B(t,d),_=fe(e,t,o.keyType,y),b=D(t);e.write(`const ${b} = ${n}[${jx(t,g)}];`);let S=Ee(e,t,o.valueType,b);e.write(`${s}[${_}] = ${S};`);}let h=B(t,new Set(m));return e.write(`for (const ${a} in ${n}) {`),e.indented(d=>{d.write(`if (${h}.has(${a})) continue;`),u.mode==="loose"?d.write(`if (${a} !== "__proto__") ${s}[${a}] = ${n}[${a}];`):d.write("return INVALID;");}),e.write("}"),s}let f=o.keyType._zod.def;if(!(f.type==="string"&&f.format===void 0&&!f.coerce&&(f.checks?.length??0)===0)){let m=o.mode==="loose",h=_s(o.keyType);h.definite===false&&(t.definite=false);let d=B(t,h),g=B(t,bt),y=D(t);return w0(e,t,n,a,_=>{_.write(`let ${y} = ${d}(${a});`),_.write(`if (${y} === INVALID && typeof ${a} === "string" && ${g}.test(${a})) ${y} = ${d}(Number(${a}));`),m?_.write(`if (${y} === INVALID) { ${s}[${a}] = ${n}[${a}]; continue; }`):_.write(`if (${y} === INVALID) return INVALID;`),_.write(`if (${y} === "__proto__") continue;`);let b=D(t);_.write(`const ${b} = ${n}[${a}];`);let S=Ee(_,t,o.valueType,b);_.write(`${s}[${y}] = ${S};`);}),s}return w0(e,t,n,a,m=>{m.write(`const ${c} = ${n}[${a}];`);let h=Ee(m,t,o.valueType,c);m.write(`${s}[${a}] = ${h};`);},"return INVALID;"),s}function w0(e,t,r,n,o,i){let s=B(t,Object.prototype.propertyIsEnumerable),a=D(t),c=D(t),u=D(t);e.write(`const ${a} = Object.getOwnPropertySymbols(${r});`),e.write(`const ${c} = Object.getOwnPropertyNames(${r});`),e.write(`for (let ${u} = 0; ${u} < ${c}.length; ${u}++) {`),e.indented(l=>{l.write(`const ${n} = ${c}[${u}];`),l.write(`if (${n} === "__proto__" || !${s}.call(${r}, ${n})) continue;`),o(l);}),e.write("}"),e.write(`for (let ${u} = 0; ${u} < ${a}.length; ${u}++) {`),e.indented(l=>{l.write(`const ${n} = ${a}[${u}];`),l.write(`if (!${s}.call(${r}, ${n})) continue;`),i?l.write(i):o(l);}),e.write("}");}function jx(e,t){return typeof t=="string"?Le(t):B(e,t)}function qx(e,t,r,n){let o=r._zod.def;e.write(`if (!(${n} instanceof Map)) return INVALID;`),gf(e,r,`${n}.size`);let i=D(t),s=D(t),a=D(t);return e.write(`const ${i} = new Map();`),e.write(`for (const [${s}, ${a}] of ${n}) {`),e.indented(c=>{let u=fe(c,t,o.keyType,s),l=fe(c,t,o.valueType,a);c.write(`${i}.set(${u}, ${l});`);}),e.write("}"),i}function Wx(e,t,r,n){let o=r._zod.def;e.write(`if (!(${n} instanceof Set)) return INVALID;`),gf(e,r,`${n}.size`);let i=D(t),s=D(t);return e.write(`const ${i} = new Set();`),e.write(`for (const ${s} of ${n}) {`),e.indented(a=>{let c=fe(a,t,o.valueType,s);a.write(`${i}.add(${c});`);}),e.write("}"),i}function Hx(e,t){return e.write(`if (!(${t} instanceof File)) return INVALID;`),t}function Kx(e,t,r,n){e.write(`if (typeof ${n} !== "string") return INVALID;`);let o=r._zod.pattern;if(o){let i=B(t,o);e.write(`${i}.lastIndex = 0;`),e.write(`if (!${i}.test(${n})) return INVALID;`);}return n}function Jx(e,t,r,n){let o=r._zod.def,i=rr(t,o.getter),s=B(t,{parser:null});e.write(`if (!${s}.parser) {`),e.indented(c=>{c.write(`const inner = ${i}();`),c.write(`${s}.parser = function(input) {`),c.indented(u=>{u.write("const result = inner._zod.run({ value: input, issues: [] }, {});"),u.write("return result.issues.length === 0 ? result.value : INVALID;");}),c.write("};");}),e.write("}");let a=D(t);return e.write(`const ${a} = ${s}.parser(${n});`),e.write(`if (${a} === INVALID) return INVALID;`),a}function Xx(e,t,r,n){let o=r._zod.def,i=fe(e,t,o.in,n);if(o.transform){if(nr(o.transform))throw new it("z.compile: async transforms in pipes are not supported");let s=o.transform,c=rr(t,l=>{let f={value:l,issues:[],addIssue:hf},p=s(l,f);return p instanceof Promise?Oe:f.issues.length===0?p:Oe}),u=D(t);return e.write(`const ${u} = ${c}(${i});`),e.write(`if (${u} === INVALID) return INVALID;`),fe(e,t,o.out,u)}else return fe(e,t,o.out,i)}function nr(e){return typeof e=="function"&&(e.constructor.name==="AsyncFunction"||e[Symbol.toStringTag]==="AsyncFunction")}function Yx(e,t,r,n){let o=r._zod.def;if(o.fn){if(nr(o.fn))throw new it("z.compile: async custom predicates are not supported");let i=rr(t,o.fn),s=B(t,pf),a=D(t);e.write(`const ${a} = ${i}(${n});`),e.write(`if (${a} instanceof Promise) ${s}();`),e.write(`if (!${a}) return INVALID;`);}else throw new H("custom schema without a predicate function");return n}function e5(e,t,r){let n=e._zod.run({value:r,issues:[]},{});if(n&&typeof n.then=="function")return Oe;let o=n;return o.issues.length===0?o.value:t()}function t5(e,t,r,n){let o=r._zod.def;if(!o.catchValue[vi])throw new H("catch with a callback (only a constant catch value compiles)",false);let i=D(t);e.write(`let ${i} = (() => {`),e.indented(u=>{let l=Ee(u,t,o.innerType,n);u.write(`return ${l};`);}),e.write("})();");let s=B(t,o.innerType),a=rr(t,o.catchValue),c=B(t,e5);return e.write(`if (${i} === INVALID) {`),e.indented(u=>{u.write(`${i} = ${c}(${s}, ${a}, ${n});`),u.write(`if (${i} === INVALID) return INVALID;`);}),e.write("}"),i}function r5(e,t,r,n){let o=r._zod.def;if(o.transform){if(nr(o.transform))throw new it("z.compile: async transforms are not supported");let i=o.transform,a=rr(t,u=>{let l={value:u,issues:[],addIssue:hf},f=i(u,l);return f instanceof Promise?Oe:l.issues.length===0?f:Oe}),c=D(t);return e.write(`const ${c} = ${a}(${n});`),e.write(`if (${c} === INVALID) return INVALID;`),c}return n}function ys(e){return e.checks&&(e.checks=[...e.checks]),e}function _f(e,t){return new e(ys({type:"string",...z(t)}))}function yf(e,t){return new e(ys({type:"string",coerce:true,...z(t)}))}function bs(e,t){return new e({type:"string",format:"email",check:"string_format",abort:false,...z(t)})}function $s(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:false,...z(t)})}function xs(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:false,...z(t)})}function ws(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:false,version:"v4",...z(t)})}function Ss(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:false,version:"v6",...z(t)})}function vs(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:false,version:"v7",...z(t)})}function Co(e,t){return new e({type:"string",format:"url",check:"string_format",abort:false,...z(t)})}function Cs(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:false,...z(t)})}function Ps(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:false,...z(t)})}function ks(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:false,...z(t)})}function As(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:false,...z(t)})}function Es(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:false,...z(t)})}function Rs(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:false,...z(t)})}function Ms(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:false,...z(t)})}function Is(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:false,...z(t)})}function zs(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:false,...z(t)})}function bf(e,t){return new e({type:"string",format:"mac",check:"string_format",abort:false,...z(t)})}function Ns(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:false,...z(t)})}function Ls(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:false,...z(t)})}function Ts(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:false,...z(t)})}function Os(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:false,...z(t)})}function Fs(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:false,...z(t)})}function $f(e,t){return new e({type:"string",format:"credit_card",check:"string_format",abort:false,...z(t)})}function xf(e,t){return new e({type:"string",format:"iban",check:"string_format",abort:false,...z(t)})}function Ds(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:false,...z(t)})}var wf={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function Po(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:false,local:false,precision:null,...z(t)})}function ko(e,t){return new e({type:"string",format:"date",check:"string_format",...z(t)})}function Ao(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...z(t)})}function Eo(e,t){return new e({type:"string",format:"duration",check:"string_format",...z(t)})}function Sf(e,t){return new e(ys({type:"number",checks:[],...z(t)}))}function vf(e,t){return new e(ys({type:"number",coerce:true,checks:[],...z(t)}))}function Cf(e,t){return new e({type:"number",check:"number_format",abort:false,format:"safeint",...z(t)})}function Pf(e,t){return new e({type:"number",check:"number_format",abort:false,format:"float32",...z(t)})}function kf(e,t){return new e({type:"number",check:"number_format",abort:false,format:"float64",...z(t)})}function Af(e,t){return new e({type:"number",check:"number_format",abort:false,format:"int32",...z(t)})}function Ef(e,t){return new e({type:"number",check:"number_format",abort:false,format:"uint32",...z(t)})}function Rf(e,t){return new e({type:"boolean",...z(t)})}function Mf(e,t){return new e({type:"boolean",coerce:true,...z(t)})}function If(e,t){return new e({type:"bigint",...z(t)})}function zf(e,t){return new e({type:"bigint",coerce:true,...z(t)})}function Nf(e,t){return new e({type:"bigint",check:"bigint_format",abort:false,format:"int64",...z(t)})}function Lf(e,t){return new e({type:"bigint",check:"bigint_format",abort:false,format:"uint64",...z(t)})}function Tf(e,t){return new e({type:"symbol",...z(t)})}function Of(e,t){return new e({type:"undefined",...z(t)})}function Ff(e,t){return new e({type:"null",...z(t)})}function Df(e){return new e({type:"any"})}function Zf(e){return new e({type:"unknown"})}function Bf(e,t){return new e({type:"never",...z(t)})}function Uf(e,t){return new e({type:"void",...z(t)})}function Gf(e,t){return new e({type:"date",...z(t)})}function Qf(e,t){return new e({type:"date",coerce:true,...z(t)})}function Vf(e,t){return new e({type:"nan",...z(t)})}function ft(e,t){return new Zi({check:"less_than",...z(t),value:e,inclusive:false})}function Xe(e,t){return new Zi({check:"less_than",...z(t),value:e,inclusive:true})}function pt(e,t){return new Bi({check:"greater_than",...z(t),value:e,inclusive:false})}function Ye(e,t){return new Bi({check:"greater_than",...z(t),value:e,inclusive:true})}function Zs(e){return pt(0,e)}function Bs(e){return ft(0,e)}function Us(e){return Xe(0,e)}function Gs(e){return Ye(0,e)}function zt(e,t){return new Pu({check:"multiple_of",...z(t),value:e})}function Nt(e,t){return new Eu({check:"max_size",...z(t),maximum:e})}function mt(e,t){return new Ru({check:"min_size",...z(t),minimum:e})}function or(e,t){return new Mu({check:"size_equals",...z(t),size:e})}function ir(e,t){return new Iu({check:"max_length",...z(t),maximum:e})}function $t(e,t){return new zu({check:"min_length",...z(t),minimum:e})}function sr(e,t){return new Nu({check:"length_equals",...z(t),length:e})}function nn(e,t){return new Lu({check:"string_format",format:"regex",...z(t),pattern:e})}function on(e){return new Tu({check:"string_format",format:"lowercase",...z(e)})}function sn(e){return new Ou({check:"string_format",format:"uppercase",...z(e)})}function an(e,t){return new Fu({check:"string_format",format:"includes",...z(t),includes:e})}function cn(e,t){return new Du({check:"string_format",format:"starts_with",...z(t),prefix:e})}function un(e,t){return new Zu({check:"string_format",format:"ends_with",...z(t),suffix:e})}function Qs(e,t,r){return new Bu({check:"property",property:e,schema:t,...z(r)})}function ln(e,t){return new Uu({check:"properties",shape:e,...z(t)})}function fn(e,t){return new Gu({check:"mime_type",mime:e,...z(t)})}function st(e){return new Qu({check:"overwrite",tx:e})}function pn(e){return st(t=>t.normalize(e))}function mn(){return st(e=>e.trim())}function dn(){return st(e=>e.toLowerCase())}function hn(){return st(e=>e.toUpperCase())}function gn(){return st(e=>kc(e))}function jf(e,t,r){return new e({type:"array",element:t,...z(r)})}function n5(e,t,r){return new e({type:"union",options:t,...z(r)})}function o5(e,t,r){return new e({type:"union",options:t,inclusive:false,...z(r)})}function i5(e,t,r,n){return new e({type:"union",options:r,discriminator:t,...z(n)})}function s5(e,t,r){return new e({type:"intersection",left:t,right:r})}function a5(e,t,r,n){let o=r instanceof G,i=o?n:r,s=o?r:null;return new e({type:"tuple",items:t,rest:s,...z(i)})}function c5(e,t,r,n){return new e({type:"record",keyType:t,valueType:r,...z(n)})}function u5(e,t,r,n){return new e({type:"map",keyType:t,valueType:r,...z(n)})}function l5(e,t,r){return new e({type:"set",valueType:t,...z(r)})}function f5(e,t,r){let n=Array.isArray(t)?Object.fromEntries(t.map(o=>[o,o])):t;return new e({type:"enum",entries:n,...z(r)})}function p5(e,t,r){return new e({type:"enum",entries:t,...z(r)})}function m5(e,t,r){return new e({type:"literal",values:Array.isArray(t)?t:[t],...z(r)})}function qf(e,t){return new e({type:"file",...z(t)})}function d5(e,t){return new e({type:"transform",transform:t})}function h5(e,t){return new e({type:"optional",innerType:t})}function g5(e,t){return new e({type:"nullable",innerType:t})}function _5(e,t,r){return new e({type:"default",innerType:t,get defaultValue(){return typeof r=="function"?r():Kn(r)}})}function y5(e,t,r){return new e({type:"nonoptional",innerType:t,...z(r)})}function b5(e,t){return new e({type:"success",innerType:t})}function $5(e,t,r){return new e({type:"catch",innerType:t,catchValue:typeof r=="function"?r:Nc(r)})}function x5(e,t,r){return new e({type:"pipe",in:t,out:r})}function w5(e,t){return new e({type:"readonly",innerType:t})}function S5(e,t,r){return new e({type:"template_literal",parts:t,...z(r)})}function v5(e,t){return new e({type:"lazy",getter:t})}function C5(e,t){return new e({type:"promise",innerType:t})}function Wf(e,t,r){let n=z(r);return n.abort??(n.abort=true),new e({type:"custom",check:"custom",fn:t,...n})}function Hf(e,t,r){return new e({type:"custom",check:"custom",fn:t,...z(r)})}function Kf(e,t){let r=P0(n=>(n.addIssue=o=>{if(typeof o=="string")n.issues.push(Wr(o,n.value,r._zod.def));else {let i=o;i.fatal&&(i.continue=false),i.code??(i.code="custom"),"input"in i||(i.input=n.value),i.inst??(i.inst=r),i.continue??(i.continue=!r._zod.def.abort),n.issues.push(Wr(i));}},e(n.value,n)),t);return r}function P0(e,t){let r=new ce({check:"custom",...z(t)});return r._zod.check=e,r}function Jf(e){let t=new ce({check:"describe"});return t._zod.onattach=[r=>{let n=Pe.get(r)??{};Pe.add(r,{...n,description:e});}],t._zod.check=()=>{},t}function Xf(e){let t=new ce({check:"meta"});return t._zod.onattach=[r=>{let n=Pe.get(r)??{};Pe.add(r,{...n,...e});}],t._zod.check=()=>{},t}function Yf(e,t){let r=z(t),n=r.truthy??["true","1","yes","on","y","enabled"],o=r.falsy??["false","0","no","off","n","disabled"];r.case!=="sensitive"&&(n=n.map(m=>typeof m=="string"?m.toLowerCase():m),o=o.map(m=>typeof m=="string"?m.toLowerCase():m));let i=new Set(n),s=new Set(o),a=e.Codec??$o,c=e.Boolean??yo,u=e.String??er,l=new u({type:"string",error:r.error}),f=new c({type:"boolean",error:r.error}),p=new a({type:"pipe",in:l,out:f,transform:((m,h)=>{let d=m;return r.case!=="sensitive"&&(d=d.toLowerCase()),i.has(d)?true:s.has(d)?false:(h.issues.push({code:"invalid_value",expected:"stringbool",values:[...i,...s],input:h.value,inst:p,continue:false}),{})}),reverseTransform:((m,h)=>m===true?n[0]||"true":o[0]||"false"),error:r.error});return p._zod.bag.truthy=n,p._zod.bag.falsy=o,p._zod.bag.case=r.case??"insensitive",p}function ar(e,t,r,n={}){let o=z(n),i={check:"string_format",type:"string",format:t,fn:typeof r=="function"?r:a=>r.test(a),...o};return r instanceof RegExp&&(i.pattern=r),new e(i)}function Ro(e,...t){for(let r of t)for(let n of Reflect.ownKeys(r))Object.prototype.propertyIsEnumerable.call(r,n)&&Ce(e,n,r[n]);return e}function Lt(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??Pe,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??"ref",reused:e?.reused??"inline",intersections:[],deferred:[],external:e?.external??void 0}}function ge(e,t,r,n,o){let i=typeof t.unrepresentable=="function"?t.unrepresentable({zodSchema:e,path:n.path,message:o}):t.unrepresentable;if(i==="any")return false;if(i===void 0||i==="throw")throw new Error(o);return Object.assign(r,i),true}function te(e,t,r={path:[],schemaPath:[]}){var n;let o=e._zod.def,i=t.seen.get(e);if(i)return i.count++,r.schemaPath.includes(e)&&(i.cycle=r.path),i.schema;let s={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,s),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let a=e._zod.toJSONSchema?.();if(a)s.schema=a;else {let l={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,s.schema,l);else {let p=s.schema,m=t.processors[o.type];if(!m)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);m(e,t,p,l);}let f=e._zod.parent;f&&(s.ref||(s.ref=f),te(f,t,l),t.seen.get(f).isParent=true);}let c=t.metadataRegistry.get(e);return c&&Ro(s.schema,c),t.io==="input"&&Fe(e)&&(delete s.schema.examples,delete s.schema.default),t.io==="input"&&"_prefault"in s.schema&&((n=s.schema).default??(n.default=s.schema._prefault)),delete s.schema._prefault,t.seen.get(e).schema}function k0(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function Tt(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");if(e.external&&e.sharedDefsExtractedFor===e.external)return;let n=new Map;for(let s of e.seen.entries()){let a=e.metadataRegistry.get(s[0])?.id;if(a){let c=n.get(a);if(c&&c!==s[0])throw new Error(`Duplicate schema id "${a}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);n.set(a,s[0]);}}let o=s=>{let a=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let f=e.external.registry.get(s[0])?.id,p=e.external.uri??(h=>h);if(f)return {ref:p(f)};let m=s[1].defId??s[1].schema.id??`schema${e.counter++}`;return s[1].defId=m,{defId:m,ref:`${p("__shared")}#/${a}/${k0(m)}`}}let c="#",u=`${c}/${a}/`;if(s[1]===r&&!s[1].schema.id)return {ref:c};let l=s[1].schema.id??`__schema${e.counter++}`;return {defId:l,ref:u+k0(l)}},i=s=>{if(s[1].schema.$ref)return;let a=s[1],{ref:c,defId:u}=o(s);a.def={...a.schema},u&&(a.defId=u);let l=a.schema;for(let f in l)delete l[f];l.$ref=c;};if(e.cycles==="throw")for(let s of e.seen.entries()){let a=s[1];if(a.cycle)throw new Error(`Cycle detected: #/${a.cycle?.join("/")}/<root>
61
61
 
62
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let s of e.seen.entries()){let a=s[1];if(t===s[0]){i(s);continue}if(e.external){let u=e.external.registry.get(s[0])?.id;if(t!==s[0]&&u){i(s);continue}}if(e.metadataRegistry.get(s[0])?.id){i(s);continue}if(a.cycle){i(s);continue}a.count>1&&e.reused==="ref"&&i(s);}e.external&&(e.sharedDefsExtractedFor=e.external);}function S0(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let r=[];for(let n of t){if(!n||typeof n!="object")return;S0(n);let o=Object.keys(n);if(o.length!==1||o[0]!=="type")return;let i=n.type;for(let s of Array.isArray(i)?i:[i]){if(typeof s!="string")return;r.includes(s)||r.push(s);}}delete e.anyOf,e.type=r.length===1?r[0]:r;}var C0=new Set(["type","properties","required","additionalProperties"]),w0=["oneOf","anyOf"];function v0(e){let t=e.additionalProperties;return t===void 0||t===false||typeof t!="object"||t===null?null:Object.keys(t).length?t:null}function Wf(e){let t=[];for(let i of e){if(typeof i!="object"||i.type!=="object")return null;for(let s in i)if(!C0.has(s))return null;t.push(i);}let r={},n=new Set;for(let i of t){for(let s in i.properties){if(Object.prototype.hasOwnProperty.call(r,s))continue;let a=[];for(let u of t){let l=u.properties?.[s]??v0(u);l!=null&&(a.some(f=>JSON.stringify(f)===JSON.stringify(l))||a.push(l));}let c=a.length===1?a[0]:Wf(a)??{allOf:a};Pe(r,s,c);}for(let s of i.required??[])n.add(s);}let o={type:"object",properties:r};if(n.size&&(o.required=[...n]),t.every(i=>i.additionalProperties===false))o.additionalProperties=false;else {let i=[];for(let s of t){let a=v0(s);a&&!i.some(c=>JSON.stringify(c)===JSON.stringify(a))&&i.push(a);}i.length===1?o.additionalProperties=i[0]:i.length>1&&(o.additionalProperties={allOf:i});}return o}function d3(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let o of C0)if(o in e)return;let r=t.filter(o=>w0.some(i=>Array.isArray(o[i]))),n=null;if(!r.length)n=Wf(t);else {let o=r[0],i=w0.find(c=>Array.isArray(o[c]));if(Object.keys(o).length!==1)return;let s=t.filter(c=>c!==o),a=o[i].map(c=>Wf([...s,c]));if(a.some(c=>!c))return;n={[i]:a};}n&&(delete e.allOf,Ao(e,n));}function Ot(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let n=a=>{let c=e.seen.get(a);if(c.ref===null)return;let u=c.def??c.schema,l={...u},f=c.ref;if(c.ref=null,f){n(f);let m=e.seen.get(f),h=m.schema;if(h.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(u.allOf=u.allOf??[],u.allOf.push(h)):Ao(u,h),Ao(u,l),a._zod.parent===f)for(let g in u)g==="$ref"||g==="allOf"||g in l||delete u[g];if(h.$ref&&m.def)for(let g in u)g==="$ref"||g==="allOf"||g in m.def&&JSON.stringify(u[g])===JSON.stringify(m.def[g])&&delete u[g];}let p=a._zod.parent;if(p&&p!==f){n(p);let m=e.seen.get(p);if(m?.schema.$ref&&(u.$ref=m.schema.$ref,m.def))for(let h in u)h==="$ref"||h==="allOf"||h in m.def&&JSON.stringify(u[h])===JSON.stringify(m.def[h])&&delete u[h];}e.override({zodSchema:a,jsonSchema:u,path:c.path??[]});};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let a of [...e.seen.entries()].reverse())n(a[0]);if(e.target!=="openapi-3.0")for(let a of e.seen.entries())S0(a[1].def??a[1].schema);for(let a of e.deferred)a();if(e.intersections.length){let a=new Map;for(let c of e.seen.values())for(let u of [c.schema,c.def]){let l=u?.allOf;if(!Array.isArray(l))continue;let f=a.get(l);f?f.push(u):a.set(l,[u]);}for(let c of e.intersections)for(let u of a.get(c)??[])d3(u);}}let o={};if(e.target==="draft-2020-12"?o.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?o.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?o.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let a=e.external.registry.get(t)?.id;if(!a)throw new Error("Schema is missing an `id` property");o.$id=e.external.uri(a);}Ao(o,r.defId?r.schema:r.def??r.schema);let i=e.metadataRegistry.get(t)?.id;i!==void 0&&o.id===i&&delete o.id;let s=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let a of e.seen.entries()){let c=a[1];c.def&&c.defId&&(c.def.id===c.defId&&delete c.def.id,Pe(s,c.defId,c.def));}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(s).length>0&&(e.target==="draft-2020-12"?o.$defs=s:o.definitions=s);try{let a=JSON.parse(JSON.stringify(o));return Object.defineProperty(a,"~standard",{value:{...t["~standard"],jsonSchema:{input:gn(t,"input",e.processors),output:gn(t,"output",e.processors)}},enumerable:!1,writable:!1}),a}catch{throw new Error("Error converting schema to JSON.")}}function Oe(e,t){let r=t??{seen:new Set};if(r.seen.has(e))return false;r.seen.add(e);let n=e._zod.def;if(n.type==="transform")return true;if(n.type==="array")return Oe(n.element,r);if(n.type==="set")return Oe(n.valueType,r);if(n.type==="lazy")return Oe(n.getter(),r);if(n.type==="promise"||n.type==="optional"||n.type==="nonoptional"||n.type==="nullable"||n.type==="readonly"||n.type==="default"||n.type==="prefault"||n.type==="catch")return Oe(n.innerType,r);if(n.type==="intersection")return Oe(n.left,r)||Oe(n.right,r);if(n.type==="record"||n.type==="map")return Oe(n.keyType,r)||Oe(n.valueType,r);if(n.type==="pipe")return e._zod.traits.has("$ZodCodec")?true:Oe(n.in,r)||Oe(n.out,r);if(n.type==="object"){for(let o in n.shape)if(Oe(n.shape[o],r))return true;return false}if(n.type==="union"){for(let o of n.options)if(Oe(o,r))return true;return false}if(n.type==="tuple"){for(let o of n.items)if(Oe(o,r))return true;return !!(n.rest&&Oe(n.rest,r))}return false}var Hf=(e,t={})=>r=>{let n=Nt({...r,processors:t});return te(e,n),Lt(n,e),Ot(n,e)},gn=(e,t,r={})=>n=>{let{libraryOptions:o,target:i}=n??{},s=Nt({...o??{},target:i,io:t,processors:r});return te(e,s),Lt(s,e),Ot(s,e)};var _n=(e,t,r)=>{(e[t]===void 0||r>e[t])&&(e[t]=r);},yn=(e,t,r)=>{(e[t]===void 0||r<e[t])&&(e[t]=r);},P0=(e,t)=>{_n(e,"minimum",t),yn(e,"maximum",t);},R0=(e,t)=>{e.multipleOf??(e.multipleOf=[]),e.multipleOf.includes(t)||e.multipleOf.push(t);},M0=(e,t)=>{e.patterns??(e.patterns=new Set),e.patterns.add(t);},I0=(e,t)=>{e.mime=e.mime?e.mime.filter(r=>t.includes(r)):[...t];},z0=(e,t)=>{e.format=t,t.includes("int")&&(e.isInt=true);},k0=(e,t)=>_n(e,"minimum",t.minimum),A0=(e,t)=>yn(e,"maximum",t.maximum),E0=e=>(t,r)=>{z0(t,r.format);let[n,o]=e[r.format];_n(t,"minimum",n),yn(t,"maximum",o);},h3={greater_than:(e,t)=>_n(e,t.inclusive?"minimum":"exclusiveMinimum",t.value),less_than:(e,t)=>yn(e,t.inclusive?"maximum":"exclusiveMaximum",t.value),multiple_of:(e,t)=>R0(e,t.value),number_format:E0(Kn),bigint_format:E0(Jn),min_length:k0,max_length:A0,length_equals:(e,t)=>P0(e,t.length),min_size:k0,max_size:A0,size_equals:(e,t)=>P0(e,t.size),string_format:(e,t)=>{z0(e,t.format),t.pattern&&M0(e,t.pattern),(t.format==="base64"||t.format==="base64url")&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=true);},mime_type:(e,t)=>I0(e,t.mime)};function ye(e){let t={},r=e._zod.def,n=e._zod.traits.has("$ZodCheck")?[e,...r.checks??[]]:r.checks??[];for(let i of n)h3[i._zod.def.check]?.(t,i._zod.def);let o=e._zod.bag;o.minimum!==void 0&&_n(t,"minimum",o.minimum),o.exclusiveMinimum!==void 0&&_n(t,"exclusiveMinimum",o.exclusiveMinimum),o.maximum!==void 0&&yn(t,"maximum",o.maximum),o.exclusiveMaximum!==void 0&&yn(t,"exclusiveMaximum",o.exclusiveMaximum),o.multipleOf!==void 0&&R0(t,o.multipleOf),o.format!==void 0&&(t.format??(t.format=o.format),o.format.includes("int")&&(t.isInt=true)),o.mime&&I0(t,o.mime);for(let i of o.patterns??[])M0(t,i);return t}var g3={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},_3=new Map([[Vi,eu],[ho,tu]]),N0=e=>_3.get(e)??e,Xf=(e,t,r,n)=>{let o=r;o.type="string";let{minimum:i,maximum:s,format:a,patterns:c,contentEncoding:u,laxFormat:l}=ye(e);if(typeof i=="number"&&(o.minLength=i),typeof s=="number"&&(o.maxLength=s),a&&(o.format=g3[a]??a,o.format===""&&delete o.format,(a==="time"||l)&&delete o.format),u&&(o.contentEncoding=u),c&&c.size>0){let f=[...c].map(N0);f.length===1?o.pattern=f[0].source:f.length>1&&(o.allOf=[...f.map(p=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:p.source}))]);}},Yf=(e,t,r,n)=>{let o=r,{minimum:i,maximum:s,multipleOf:a,exclusiveMaximum:c,exclusiveMinimum:u,isInt:l}=ye(e);o.type=l?"integer":"number";let f=typeof u=="number"&&u>=(i??Number.NEGATIVE_INFINITY),p=typeof c=="number"&&c<=(s??Number.POSITIVE_INFINITY),m=t.target==="draft-04"||t.target==="openapi-3.0";if(f?m?(o.minimum=u,o.exclusiveMinimum=true):o.exclusiveMinimum=u:typeof i=="number"&&(o.minimum=i),p?m?(o.maximum=c,o.exclusiveMaximum=true):o.exclusiveMaximum=c:typeof s=="number"&&(o.maximum=s),a){let h=new Set;for(let y of a)Number.isFinite(y)&&y!==0?h.add(Math.abs(y)):_e(e,t,o,n,`A multipleOf divisor of ${y} cannot be represented in JSON Schema`);let[d,...g]=h;d!==void 0&&(o.multipleOf=d),g.length&&(o.allOf=[...o.allOf??[],...g.map(y=>({multipleOf:y}))]);}},ep=(e,t,r,n)=>{r.type="boolean";},tp=(e,t,r,n)=>{_e(e,t,r,n,"BigInt cannot be represented in JSON Schema");},rp=(e,t,r,n)=>{_e(e,t,r,n,"Symbols cannot be represented in JSON Schema");},np=(e,t,r,n)=>{t.target==="openapi-3.0"?(r.type="string",r.nullable=true,r.enum=[null]):r.type="null";},op=(e,t,r,n)=>{_e(e,t,r,n,"Undefined cannot be represented in JSON Schema");},ip=(e,t,r,n)=>{_e(e,t,r,n,"Void cannot be represented in JSON Schema");},sp=(e,t,r,n)=>{r.not={};},ap=(e,t,r,n)=>{},cp=(e,t,r,n)=>{},up=(e,t,r,n)=>{_e(e,t,r,n,"Date cannot be represented in JSON Schema");},lp=(e,t,r,n)=>{let o=e._zod.def,i=Ur(o.entries);if(i.length===0){r.not={};return}i.every(s=>typeof s=="number")&&(r.type="number"),i.every(s=>typeof s=="string")&&(r.type="string"),r.enum=i;},fp=(e,t,r,n)=>{let o=e._zod.def;if(o.values.length===0){r.not={};return}let i=[];for(let s of o.values)if(s===void 0){if(_e(e,t,r,n,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof s=="bigint"){if(_e(e,t,r,n,"BigInt literals cannot be represented in JSON Schema"))return;i.push(Number(s));}else i.push(s);if(i.length!==0)if(i.length===1){let s=i[0];r.type=s===null?"null":typeof s,t.target==="draft-04"||t.target==="openapi-3.0"?r.enum=[s]:r.const=s;}else i.every(s=>typeof s=="number")&&(r.type="number"),i.every(s=>typeof s=="string")&&(r.type="string"),i.every(s=>typeof s=="boolean")&&(r.type="boolean"),i.every(s=>s===null)&&(r.type="null"),r.enum=i;},pp=(e,t,r,n)=>{_e(e,t,r,n,"NaN cannot be represented in JSON Schema");},mp=(e,t,r,n)=>{let o=r,i=e._zod.pattern;if(!i)throw new Error("Pattern not found in template literal");o.type="string",o.pattern=i.source;},dp=(e,t,r,n)=>{let o=r;o.type="string",o.format="binary",o.contentEncoding="binary";let{minimum:i,maximum:s,mime:a}=ye(e);i!==void 0&&(o.minLength=i),s!==void 0&&(o.maxLength=s),a&&(a.length===0?o.not={}:a.length===1?o.contentMediaType=a[0]:o.anyOf=a.map(c=>({contentMediaType:c})));},hp=(e,t,r,n)=>{r.type="boolean";},gp=(e,t,r,n)=>{_e(e,t,r,n,"Custom types cannot be represented in JSON Schema");},_p=(e,t,r,n)=>{_e(e,t,r,n,"Function types cannot be represented in JSON Schema");},yp=(e,t,r,n)=>{_e(e,t,r,n,"Transforms cannot be represented in JSON Schema");},bp=(e,t,r,n)=>{_e(e,t,r,n,"Map cannot be represented in JSON Schema");},$p=(e,t,r,n)=>{_e(e,t,r,n,"Set cannot be represented in JSON Schema");},xp=(e,t,r,n)=>{let o=r,i=e._zod.def,{minimum:s,maximum:a}=ye(e);typeof s=="number"&&(o.minItems=s),typeof a=="number"&&(o.maxItems=a),o.type="array",o.items=te(i.element,t,{...n,path:[...n.path,"items"]});};function Eo(e){let t=e._zod.def;return t.type==="pipe"&&t.in._zod.traits.has("$ZodTransform")?Eo(t.out):t.type==="catch"?Eo(t.innerType):e._zod.optin}var wp=(e,t,r,n)=>{let o=r,i=e._zod.def,s=i.shape;if(Object.getOwnPropertySymbols(s).length&&_e(e,t,o,n,"Symbol keys cannot be represented in JSON Schema"))return;o.type="object",o.properties={};for(let u in s)Pe(o.properties,u,te(s[u],t,{...n,path:[...n.path,"properties",u]}));let c=[];for(let u of Object.keys(s)){let l=i.shape[u];(t.io==="input"?Eo(l)===void 0:l._zod.optout===void 0)&&c.push(u);}c.length>0&&(o.required=c),i.catchall?._zod.def.type==="never"?o.additionalProperties=false:i.catchall?i.catchall&&(o.additionalProperties=te(i.catchall,t,{...n,path:[...n.path,"additionalProperties"]})):t.io==="output"&&(o.additionalProperties=false);},Zs=(e,t,r,n)=>{let o=e._zod.def,i=o.inclusive===false,s=o.options.map((a,c)=>te(a,t,{...n,path:[...n.path,i?"oneOf":"anyOf",c]}));i?r.oneOf=s:r.anyOf=s;},vp=(e,t,r,n)=>{let o=e._zod.def,i=te(o.left,t,{...n,path:[...n.path,"allOf",0]}),s=te(o.right,t,{...n,path:[...n.path,"allOf",1]}),a=u=>"allOf"in u&&Object.keys(u).length===1,c=[...a(i)?i.allOf:[i],...a(s)?s.allOf:[s]];r.allOf=c,t.intersections.push(c);},Sp=(e,t,r,n)=>{let o=r,i=e._zod.def;o.type="array";let s=t.target==="draft-2020-12"?"prefixItems":"items",a=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",c=i.items.map((d,g)=>te(d,t,{...n,path:[...n.path,s,g]})),u=i.rest?te(i.rest,t,{...n,path:[...n.path,a,...t.target==="openapi-3.0"?[i.items.length]:[]]}):null,l=i.items.length;for(;l>0;){let d=i.items[l-1];if(!(t.io==="input"?Eo(d)!==void 0:d._zod.optout==="optional"))break;l--;}let f=i.items.length,p=!i.rest;t.target==="draft-2020-12"?(o.prefixItems=c,p?o.items=false:u&&(o.items=u),l>0&&(o.minItems=l),p&&(o.maxItems=f)):t.target==="openapi-3.0"?(o.items={anyOf:c},u&&o.items.anyOf.push(u),l>0&&(o.minItems=l),p&&(o.maxItems=f)):(o.items=c,p?o.additionalItems=false:u&&(o.additionalItems=u),l>0&&(o.minItems=l),p&&(o.maxItems=f));let{minimum:m,maximum:h}=ye(e);typeof m=="number"&&(o.minItems=m),typeof h=="number"&&(o.maxItems=h);};function Kf(e,t,r){if(t.$ref){if(r.has(t))return t;r.add(t);let h=e.get(t)?.def;if(!h)return t;let d=Kf(e,h,r);return d===h?t:d}for(let h of ["anyOf","oneOf"]){let d=t[h];if(!Array.isArray(d))continue;let g=d.map(y=>Kf(e,y,r));g.some((y,_)=>y!==d[_])&&(t={...t,[h]:g});}let n=Array.isArray(t.type)?t.type:[t.type],o=!n.includes("string")&&n.some(h=>h==="number"||h==="integer"),i=t.enum??(t.const!==void 0?[t.const]:void 0);if(!o&&!i?.some(h=>typeof h=="number"))return t;let{minimum:s,maximum:a,exclusiveMinimum:c,exclusiveMaximum:u,multipleOf:l,format:f,id:p,...m}=t;return m.enum?m.enum=m.enum.map(h=>typeof h=="number"?String(h):h):typeof m.const=="number"&&(m.const=String(m.const)),o&&(m.type="string",i||(m.pattern=(n.includes("number")?yt:ao).source)),m}var Jf=new WeakMap;function y3(e){let t=new Map;for(let n of e.seen.values())n.def&&!t.has(n.schema)&&t.set(n.schema,n);let r=new Map;for(let n of Jf.get(e)??[]){let o=e.seen.get(n),i=(o?.def??o?.schema)?.propertyNames;if(!i||i===true||r.has(i))continue;let s=Kf(t,i,new Set);s!==i&&r.set(i,s);}if(r.size)for(let n of e.seen.values())for(let o of [n.schema,n.def]){let i=o&&r.get(o.propertyNames);i&&(o.propertyNames=i);}}var Cp=(e,t,r,n)=>{let o=r,i=e._zod.def;o.type="object";let s=i.keyType,a=ye(s).patterns;if(i.mode==="loose"&&a&&a.size>0){let l=te(i.valueType,t,{...n,path:[...n.path,"patternProperties","*"]});o.patternProperties={};for(let f of a)Pe(o.patternProperties,N0(f).source,l);}else {if(t.target==="draft-07"||t.target==="draft-2020-12"){o.propertyNames=te(i.keyType,t,{...n,path:[...n.path,"propertyNames"]});let l=Jf.get(t);l||(l=[],Jf.set(t,l),t.deferred.push(()=>y3(t))),l.push(e);}o.additionalProperties=te(i.valueType,t,{...n,path:[...n.path,"additionalProperties"]});}let c=s._zod.values,u=t.io==="input"&&Eo(i.valueType)!==void 0;if(c&&!i.partial&&!u){let l=[...c].filter(f=>typeof f=="string"||typeof f=="number");l.length>0&&(o.required=l.map(String));}},Pp=(e,t,r,n)=>{let o=e._zod.def,i=te(o.innerType,t,n),s=t.seen.get(e);t.target==="openapi-3.0"?(s.ref=o.innerType,r.nullable=true):r.anyOf=[i,{type:"null"}];},kp=(e,t,r,n)=>{let o=e._zod.def;te(o.innerType,t,n);let i=t.seen.get(e);i.ref=o.innerType;},Ap=Symbol();function L0(e,t,r,n,o){let i=false,s=JSON.stringify(e,(a,c)=>typeof c!="bigint"?c:(i=true,null));return i?(_e(t,r,n,o,"BigInt defaults cannot be represented in JSON Schema"),Ap):JSON.parse(s)}var Ep=(e,t,r,n)=>{let o=e._zod.def;te(o.innerType,t,n);let i=t.seen.get(e);i.ref=o.innerType;let s=L0(o.defaultValue,e,t,r,n);s!==Ap&&(r.default=s);},Rp=(e,t,r,n)=>{let o=e._zod.def;te(o.innerType,t,n);let i=t.seen.get(e);if(i.ref=o.innerType,t.io!=="input")return;let s=L0(o.defaultValue,e,t,r,n);s!==Ap&&(r._prefault=s);},Mp=(e,t,r,n)=>{let o=e._zod.def;te(o.innerType,t,n);let i=t.seen.get(e);i.ref=o.innerType;let s;try{s=o.catchValue(void 0);}catch{_e(e,t,r,n,"Dynamic catch values are not supported in JSON Schema");return}r.default=s;},Ip=(e,t,r,n)=>{let o=e._zod.def,i=o.in._zod.traits.has("$ZodTransform"),s=t.io==="input"?i?o.out:o.in:o.out;te(s,t,n);let a=t.seen.get(e);a.ref=s;},zp=(e,t,r,n)=>{let o=e._zod.def;te(o.innerType,t,n);let i=t.seen.get(e);i.ref=o.innerType,r.readOnly=true;},Np=(e,t,r,n)=>{let o=e._zod.def;te(o.innerType,t,n);let i=t.seen.get(e);i.ref=o.innerType;},Bs=(e,t,r,n)=>{let o=e._zod.def;te(o.innerType,t,n);let i=t.seen.get(e);i.ref=o.innerType;},Lp=(e,t,r,n)=>{let o=e._zod.innerType;te(o,t,n);let i=t.seen.get(e);i.ref=o;},Ds={string:Xf,number:Yf,boolean:ep,bigint:tp,symbol:rp,null:np,undefined:op,void:ip,never:sp,any:ap,unknown:cp,date:up,enum:lp,literal:fp,nan:pp,template_literal:mp,file:dp,success:hp,custom:gp,function:_p,transform:yp,map:bp,set:$p,array:xp,object:wp,union:Zs,intersection:vp,tuple:Sp,record:Cp,nullable:Pp,nonoptional:kp,default:Ep,prefault:Rp,catch:Mp,pipe:Ip,readonly:zp,promise:Np,optional:Bs,lazy:Lp};function Us(e,t){if("_idmap"in e){let n=e,o=Nt({...t,processors:Ds}),i={};for(let c of n._idmap.entries()){let[u,l]=c;te(l,o);}let s={},a={registry:n,uri:t?.uri,defs:i};o.external=a;for(let c of n._idmap.entries()){let[u,l]=c;Lt(o,l),Pe(s,u,Ot(o,l));}if(Object.keys(i).length>0){let c=o.target==="draft-2020-12"?"$defs":"definitions";s.__shared={[c]:i};}return {schemas:s}}let r=Nt({...t,processors:Ds});return te(e,r),Lt(r,e),Ot(r,e)}var Gs=class{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(t){this.ctx.counter=t;}get seen(){return this.ctx.seen}constructor(t){let r=t?.target??"draft-2020-12";r==="draft-4"&&(r="draft-04"),r==="draft-7"&&(r="draft-07"),this.ctx=Nt({processors:Ds,target:r,...t?.metadata&&{metadata:t.metadata},...t?.unrepresentable&&{unrepresentable:t.unrepresentable},...t?.override&&{override:t.override},...t?.io&&{io:t.io}});}process(t,r={path:[],schemaPath:[]}){return te(t,this.ctx,r)}emit(t,r){r&&(r.cycles&&(this.ctx.cycles=r.cycles),r.reused&&(this.ctx.reused=r.reused),r.external&&(this.ctx.external=r.external)),this.ctx.sharedDefsExtractedFor=void 0,this.ctx.sharedEmitDoneFor=void 0,Lt(this.ctx,t);let n=Ot(this.ctx,t),{"~standard":o,...i}=n;return i}};var O0={};var Pn={};kt(Pn,{ZodAny:()=>nm,ZodArray:()=>am,ZodBase64:()=>ca,ZodBase64URL:()=>ua,ZodBigInt:()=>Sn,ZodBigIntFormat:()=>pa,ZodBoolean:()=>vn,ZodCIDRv4:()=>sa,ZodCIDRv6:()=>aa,ZodCUID:()=>Ys,ZodCUID2:()=>ea,ZodCatch:()=>Am,ZodCodec:()=>Do,ZodCreditCard:()=>Hp,ZodCustom:()=>Zo,ZodCustomStringFormat:()=>lr,ZodDate:()=>zo,ZodDefault:()=>wm,ZodDiscriminatedUnion:()=>um,ZodE164:()=>la,ZodEmail:()=>Hs,ZodEmoji:()=>Js,ZodEnum:()=>$n,ZodExactOptional:()=>ga,ZodFile:()=>ym,ZodFunction:()=>Fm,ZodGUID:()=>Ks,ZodIBAN:()=>Kp,ZodIPv4:()=>oa,ZodIPv6:()=>ia,ZodISODate:()=>Ft,ZodISODateTime:()=>Tt,ZodISODuration:()=>Zt,ZodISOTime:()=>Dt,ZodInstanceOf:()=>Bm,ZodIntersection:()=>lm,ZodJWT:()=>fa,ZodKSUID:()=>na,ZodLazy:()=>Lm,ZodLiteral:()=>_m,ZodMAC:()=>Wp,ZodMap:()=>hm,ZodNaN:()=>Rm,ZodNanoID:()=>Xs,ZodNever:()=>im,ZodNonOptional:()=>_a,ZodNull:()=>tm,ZodNullable:()=>xm,ZodNumber:()=>wn,ZodNumberFormat:()=>fr,ZodObject:()=>Lo,ZodOptional:()=>To,ZodPipe:()=>Fo,ZodPrefault:()=>Sm,ZodPreprocess:()=>Mm,ZodPromise:()=>Tm,ZodReadonly:()=>Im,ZodRecord:()=>bn,ZodSet:()=>gm,ZodString:()=>xn,ZodStringFormat:()=>ie,ZodSuccess:()=>km,ZodSymbol:()=>Yp,ZodTemplateLiteral:()=>Nm,ZodTransform:()=>bm,ZodTuple:()=>pm,ZodType:()=>j,ZodULID:()=>ta,ZodURL:()=>Io,ZodUUID:()=>dt,ZodUndefined:()=>em,ZodUnion:()=>Oo,ZodUnknown:()=>om,ZodVoid:()=>sm,ZodXID:()=>ra,ZodXor:()=>cm,_ZodString:()=>Ws,_default:()=>vm,_function:()=>H1,any:()=>P1,array:()=>No,base64:()=>s1,base64url:()=>a1,bigint:()=>x1,boolean:()=>Xp,catch:()=>Em,check:()=>K1,cidrv4:()=>o1,cidrv6:()=>i1,codec:()=>V1,creditCard:()=>u1,cuid:()=>K0,cuid2:()=>J0,currencyCode:()=>h1,custom:()=>J1,date:()=>A1,describe:()=>X1,discriminatedUnion:()=>N1,e164:()=>c1,email:()=>Z0,emoji:()=>W0,enum:()=>da,exactOptional:()=>$m,file:()=>B1,float32:()=>_1,float64:()=>y1,function:()=>H1,guid:()=>B0,hash:()=>g1,hex:()=>d1,hostname:()=>m1,httpUrl:()=>q0,iban:()=>l1,instanceof:()=>eg,int:()=>js,int32:()=>b1,int64:()=>w1,intersection:()=>fm,invertCodec:()=>j1,ipv4:()=>t1,ipv6:()=>n1,json:()=>rg,jwt:()=>f1,keyof:()=>E1,ksuid:()=>e1,lazy:()=>Om,literal:()=>Z1,looseObject:()=>I1,looseRecord:()=>O1,mac:()=>r1,map:()=>T1,meta:()=>Y1,nan:()=>Q1,nanoid:()=>H0,nativeEnum:()=>D1,never:()=>ma,nonoptional:()=>Pm,null:()=>rm,nullable:()=>Mo,nullish:()=>U1,number:()=>Jp,object:()=>R1,optional:()=>cr,partialRecord:()=>L1,pipe:()=>qs,prefault:()=>Cm,preprocess:()=>ng,promise:()=>W1,readonly:()=>zm,record:()=>dm,refine:()=>Dm,set:()=>F1,strictObject:()=>M1,string:()=>Ro,stringFormat:()=>p1,stringbool:()=>tg,success:()=>G1,superRefine:()=>Zm,symbol:()=>S1,templateLiteral:()=>q1,transform:()=>ha,tuple:()=>mm,uint32:()=>$1,uint64:()=>v1,ulid:()=>X0,undefined:()=>C1,union:()=>Cn,unknown:()=>ar,url:()=>j0,uuid:()=>U0,uuidv4:()=>G0,uuidv6:()=>Q0,uuidv7:()=>V0,void:()=>k1,xid:()=>Y0,xor:()=>z1});var $3=()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function t(i){return e[i]??null}let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",currency_code:"currency code",credit_card:"credit card number",iban:"IBAN",jwt:"JWT",template_literal:"input"},n={nan:"NaN"};function o(i,s){return i==="number"&&typeof s=="number"&&!Number.isFinite(s)?String(s):n[i]??i}return i=>{switch(i.code){case "invalid_type":{let s=o(i.expected),a=Pc(i.input),c=o(a,i.input);return `Invalid input: expected ${s}, received ${c}`}case "invalid_value":return i.values.length===1?`Invalid input: expected ${gi(i.values[0])}`:`Invalid option: expected one of ${mi(i.values,"|")}`;case "too_big":{let s=i.exact?"exactly ":i.inclusive?"<=":"<",a=t(i.origin);return a?`Too big: expected ${i.origin??"value"} to have ${s}${i.maximum.toString()} ${a.unit??"elements"}`:`Too big: expected ${i.origin??"value"} to be ${s}${i.maximum.toString()}`}case "too_small":{let s=i.exact?"exactly ":i.inclusive?">=":">",a=t(i.origin);return a?`Too small: expected ${i.origin} to have ${s}${i.minimum.toString()} ${a.unit}`:`Too small: expected ${i.origin} to be ${s}${i.minimum.toString()}`}case "invalid_format":{let s=i;return s.format==="starts_with"?`Invalid string: must start with "${s.prefix}"`:s.format==="ends_with"?`Invalid string: must end with "${s.suffix}"`:s.format==="includes"?`Invalid string: must include "${s.includes}"`:s.format==="regex"?`Invalid string: must match pattern ${s.pattern}`:`Invalid ${r[s.format]??i.format}`}case "not_multiple_of":return `Invalid number: must be a multiple of ${i.divisor}`;case "unrecognized_keys":return `Unrecognized key${i.keys.length>1?"s":""}: ${mi(i.keys,", ")}`;case "invalid_key":return `Invalid key in ${i.origin}`;case "invalid_union":return i.options&&Array.isArray(i.options)&&i.options.length>0?`Invalid discriminator value. Expected ${i.options.map(a=>`'${a}'`).join(" | ")}`:i.inclusive===false?"Invalid input: more than one option matched":"Invalid input";case "invalid_element":return `Invalid value in ${i.origin}`;default:return "Invalid input"}}};function T0(){return {localeError:$3()}}var Qs={};kt(Qs,{endsWith:()=>cn,gt:()=>pt,gte:()=>Ye,includes:()=>sn,length:()=>ir,lowercase:()=>nn,lt:()=>ft,lte:()=>Xe,maxLength:()=>or,maxSize:()=>zt,mime:()=>ln,minLength:()=>bt,minSize:()=>mt,multipleOf:()=>It,negative:()=>Ls,nonnegative:()=>Ts,nonpositive:()=>Os,normalize:()=>fn,overwrite:()=>st,positive:()=>Ns,properties:()=>un,property:()=>Fs,regex:()=>rn,size:()=>nr,slugify:()=>hn,startsWith:()=>an,toLowerCase:()=>mn,toUpperCase:()=>dn,trim:()=>pn,uppercase:()=>on});var F0=new WeakSet([Object.prototype,Error.prototype]);function Vs(e,t,r){Object.defineProperty(e,t,{configurable:true,enumerable:false,get(){let n=r(this);return Object.defineProperty(this,t,{value:n,configurable:true,writable:true}),n},set(n){Object.defineProperty(this,t,{value:n,configurable:true,writable:true});}});}var D0=(e,t)=>{Nc.init(e,t),e.name="ZodError";let r=Object.getPrototypeOf(e);F0.has(r)||(F0.add(r),Vs(r,"format",n=>o=>no(n,o)),Vs(r,"flatten",n=>o=>ro(n,o)),Vs(r,"addIssue",n=>o=>{n.issues.push(o),n.message=JSON.stringify(n.issues,Gr,2);}),Vs(r,"addIssues",n=>o=>{n.issues.push(...o),n.message=JSON.stringify(n.issues,Gr,2);}),Object.defineProperty(r,"isEmpty",{configurable:true,enumerable:false,get(){return this.issues.length===0}}));},x3=S("ZodError",D0),Ke=S("ZodError",D0,void 0,{Parent:Error});var Op=Wr(Ke),Tp=Hr(Ke),Fp=Kr(Ke),Dp=Jr(Ke),Zp=wi(Ke),Bp=vi(Ke),Up=Si(Ke),Gp=Ci(Ke),Qp=Pi(Ke),Vp=ki(Ke),jp=Ai(Ke),qp=Ei(Ke);function v3(){ve.localeError||de(T0());}function ur(){ve.memoizer||de({memoizer:wo()});}var j=S("ZodType",(e,t)=>(v3(),G.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(T.mergeDefs(t,{checks:[...t.checks??[],...e.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:true})},with(...e){return this.check(...e)},clone(e,t){return Y(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(Dm(e,t))},superRefine(e,t){return this.check(Zm(e,t))},overwrite(e){return this.check(st(e))},optional(){return cr(this)},exactOptional(){return $m(this)},nullable(){return Mo(this)},nullish(){return cr(Mo(this))},nonoptional(e){return Pm(this,e)},array(){return No(this)},or(e){return Cn([this,e])},and(e){return fm(this,e)},transform(e){return qs(this,ha(e))},default(e){return vm(this,e)},prefault(e){return Cm(this,e)},catch(e){return Em(this,e)},pipe(e){return qs(this,e)},readonly(){return zm(this)},describe(e){let t=this.clone();return ke.add(t,{description:e}),t},meta(...e){if(e.length===0)return ke.get(this);let t=this.clone();return ke.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return T.hide(this,"~standard",{...Zi(this),jsonSchema:{input:gn(this,"input"),output:gn(this,"output")}})},set"~standard"(e){T.own(this,"~standard",e);},parse:function e(t,r){return Op(this,t,r,{callee:e})},parseAsync:async function e(t,r){return await Tp(this,t,r,{callee:e})},safeParse(e,t){return Fp(this,e,t)},async safeParseAsync(e,t){return Dp(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){T.own(this,"spa",e);},validate(e,t){return oo(this,e,t)},validateAsync(e,t){return io(this,e,t)},encode:function e(t,r){return Zp(this,t,r,{callee:e})},decode:function e(t,r){return Bp(this,t,r,{callee:e})},encodeAsync:async function e(t,r){return await Up(this,t,r,{callee:e})},decodeAsync:async function e(t,r){return await Gp(this,t,r,{callee:e})},safeEncode(e,t){return Qp(this,e,t)},safeDecode(e,t){return Vp(this,e,t)},async safeEncodeAsync(e,t){return jp(this,e,t)},async safeDecodeAsync(e,t){return qp(this,e,t)},toJSONSchema(e){return Hf(this,{})(e)},get description(){return ke.get(this)?.description},get _def(){return this._zod.def}}),Ws=S("_ZodString",(e,t)=>{Yt.init(e,t),j.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Xf(e,r,n);},T.derived({format:e=>ye(e).format??null,minLength:e=>ye(e).minimum??null,maxLength:e=>ye(e).maximum??null},{regex(...e){return this.check(rn(...e))},includes(...e){return this.check(sn(...e))},startsWith(...e){return this.check(an(...e))},endsWith(...e){return this.check(cn(...e))},min(...e){return this.check(bt(...e))},max(...e){return this.check(or(...e))},length(...e){return this.check(ir(...e))},nonempty(...e){return this.check(bt(1,...e))},lowercase(e){return this.check(nn(e))},uppercase(e){return this.check(on(e))},trim(){return this.check(pn())},normalize(...e){return this.check(fn(...e))},toLowerCase(){return this.check(mn())},toUpperCase(){return this.check(dn())},slugify(){return this.check(hn())}})),xn=S("ZodString",(e,t)=>{Yt.init(e,t),Ws.init(e,t);},{email(e){return this.check(ms(Hs,e))},url(e){return this.check(vo(Io,e))},jwt(e){return this.check(zs(fa,e))},emoji(e){return this.check(bs(Js,e))},guid(e){return this.check(ds(Ks,e))},uuid(e){return this.check(hs(dt,e))},uuidv4(e){return this.check(gs(dt,e))},uuidv6(e){return this.check(_s(dt,e))},uuidv7(e){return this.check(ys(dt,e))},nanoid(e){return this.check($s(Xs,e))},cuid(e){return this.check(xs(Ys,e))},cuid2(e){return this.check(ws(ea,e))},ulid(e){return this.check(vs(ta,e))},base64(e){return this.check(Rs(ca,e))},base64url(e){return this.check(Ms(ua,e))},xid(e){return this.check(Ss(ra,e))},ksuid(e){return this.check(Cs(na,e))},ipv4(e){return this.check(Ps(oa,e))},ipv6(e){return this.check(ks(ia,e))},cidrv4(e){return this.check(As(sa,e))},cidrv6(e){return this.check(Es(aa,e))},e164(e){return this.check(Is(la,e))},datetime(e){return this.check(So(Tt,e))},date(e){return this.check(Co(Ft,e))},time(e){return this.check(Po(Dt,e))},duration(e){return this.check(ko(Zt,e))}});function Ro(e){return ff(xn,e)}var ie=S("ZodStringFormat",(e,t)=>{ee.init(e,t),Ws.init(e,t);}),Tt=S("ZodISODateTime",(e,t)=>{el.init(e,t),ie.init(e,t);}),Ft=S("ZodISODate",(e,t)=>{tl.init(e,t),ie.init(e,t);}),Dt=S("ZodISOTime",(e,t)=>{rl.init(e,t),ie.init(e,t);}),Zt=S("ZodISODuration",(e,t)=>{nl.init(e,t),ie.init(e,t);}),Hs=S("ZodEmail",(e,t)=>{Gu.init(e,t),ie.init(e,t);});function Z0(e){return ms(Hs,e)}var Ks=S("ZodGUID",(e,t)=>{Bu.init(e,t),ie.init(e,t);});function B0(e){return ds(Ks,e)}var dt=S("ZodUUID",(e,t)=>{Uu.init(e,t),ie.init(e,t);});function U0(e){return hs(dt,e)}function G0(e){return gs(dt,e)}function Q0(e){return _s(dt,e)}function V0(e){return ys(dt,e)}var Io=S("ZodURL",(e,t)=>{ju.init(e,t),ie.init(e,t);});function j0(e){return vo(Io,e)}function q0(e){return vo(Io,{protocol:so,hostname:nu,...T.normalizeParams(e)})}var Js=S("ZodEmoji",(e,t)=>{qu.init(e,t),ie.init(e,t);});function W0(e){return bs(Js,e)}var Xs=S("ZodNanoID",(e,t)=>{Wu.init(e,t),ie.init(e,t);});function H0(e){return $s(Xs,e)}var Ys=S("ZodCUID",(e,t)=>{Hu.init(e,t),ie.init(e,t);});function K0(e){return xs(Ys,e)}var ea=S("ZodCUID2",(e,t)=>{Ku.init(e,t),ie.init(e,t);});function J0(e){return ws(ea,e)}var ta=S("ZodULID",(e,t)=>{Ju.init(e,t),ie.init(e,t);});function X0(e){return vs(ta,e)}var ra=S("ZodXID",(e,t)=>{Xu.init(e,t),ie.init(e,t);});function Y0(e){return Ss(ra,e)}var na=S("ZodKSUID",(e,t)=>{Yu.init(e,t),ie.init(e,t);});function e1(e){return Cs(na,e)}var oa=S("ZodIPv4",(e,t)=>{ol.init(e,t),ie.init(e,t);});function t1(e){return Ps(oa,e)}var Wp=S("ZodMAC",(e,t)=>{sl.init(e,t),ie.init(e,t);});function r1(e){return mf(Wp,e)}var ia=S("ZodIPv6",(e,t)=>{il.init(e,t),ie.init(e,t);});function n1(e){return ks(ia,e)}var sa=S("ZodCIDRv4",(e,t)=>{al.init(e,t),ie.init(e,t);});function o1(e){return As(sa,e)}var aa=S("ZodCIDRv6",(e,t)=>{cl.init(e,t),ie.init(e,t);});function i1(e){return Es(aa,e)}var ca=S("ZodBase64",(e,t)=>{ul.init(e,t),ie.init(e,t);});function s1(e){return Rs(ca,e)}var ua=S("ZodBase64URL",(e,t)=>{ll.init(e,t),ie.init(e,t);});function a1(e){return Ms(ua,e)}var la=S("ZodE164",(e,t)=>{fl.init(e,t),ie.init(e,t);});function c1(e){return Is(la,e)}var Hp=S("ZodCreditCard",(e,t)=>{pl.init(e,t),ie.init(e,t);});function u1(e){return df(Hp,e)}var Kp=S("ZodIBAN",(e,t)=>{ml.init(e,t),ie.init(e,t);});function l1(e){return hf(Kp,e)}var fa=S("ZodJWT",(e,t)=>{dl.init(e,t),ie.init(e,t);});function f1(e){return zs(fa,e)}var lr=S("ZodCustomStringFormat",(e,t)=>{hl.init(e,t),ie.init(e,t);});function p1(e,t,r={}){return sr(lr,e,t,r)}function m1(e){return sr(lr,"hostname",ru,e)}function d1(e){return sr(lr,"hex",_u,e)}function h1(e){return sr(lr,"currency_code",iu,e)}function g1(e,t){let r=t?.enc??"hex",n=`${e}_${r}`,o=rt[n];if(!o)throw new Error(`Unrecognized hash format: ${n}`);return sr(lr,n,o,t)}var wn=S("ZodNumber",(e,t)=>{Ki.init(e,t),j.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Yf(e,r,n,o),e.isFinite=true;},T.derived({minValue:e=>{let{minimum:t,exclusiveMinimum:r}=ye(e);return Math.max(t??Number.NEGATIVE_INFINITY,r??Number.NEGATIVE_INFINITY)},maxValue:e=>{let{maximum:t,exclusiveMaximum:r}=ye(e);return Math.min(t??Number.POSITIVE_INFINITY,r??Number.POSITIVE_INFINITY)},isInt:e=>{let{isInt:t,multipleOf:r}=ye(e);return !!t||!!r?.some(Number.isSafeInteger)},format:e=>ye(e).format??null},{gt(e,t){return this.check(pt(e,t))},gte(e,t){return this.check(Ye(e,t))},min(e,t){return this.check(Ye(e,t))},lt(e,t){return this.check(ft(e,t))},lte(e,t){return this.check(Xe(e,t))},max(e,t){return this.check(Xe(e,t))},int(e){return this.check(js(e))},safe(e){return this.check(js(e))},positive(e){return this.check(pt(0,e))},nonnegative(e){return this.check(Ye(0,e))},negative(e){return this.check(ft(0,e))},nonpositive(e){return this.check(Xe(0,e))},multipleOf(e,t){return this.check(It(e,t))},step(e,t){return this.check(It(e,t))},finite(){return this}}));function Jp(e){return _f(wn,e)}var fr=S("ZodNumberFormat",(e,t)=>{gl.init(e,t),wn.init(e,t);});function js(e){return bf(fr,e)}function _1(e){return $f(fr,e)}function y1(e){return xf(fr,e)}function b1(e){return wf(fr,e)}function $1(e){return vf(fr,e)}var vn=S("ZodBoolean",(e,t)=>{go.init(e,t),j.init(e,t),e._zod.processJSONSchema=(r,n,o)=>ep(e,r,n);});function Xp(e){return Sf(vn,e)}var Sn=S("ZodBigInt",(e,t)=>{Ji.init(e,t),j.init(e,t),e._zod.processJSONSchema=(r,n,o)=>tp(e,r,n,o);},T.derived({minValue:e=>ye(e).minimum??null,maxValue:e=>ye(e).maximum??null,format:e=>ye(e).format??null},{gte(e,t){return this.check(Ye(e,t))},min(e,t){return this.check(Ye(e,t))},gt(e,t){return this.check(pt(e,t))},lt(e,t){return this.check(ft(e,t))},lte(e,t){return this.check(Xe(e,t))},max(e,t){return this.check(Xe(e,t))},positive(e){return this.check(pt(BigInt(0),e))},negative(e){return this.check(ft(BigInt(0),e))},nonpositive(e){return this.check(Xe(BigInt(0),e))},nonnegative(e){return this.check(Ye(BigInt(0),e))},multipleOf(e,t){return this.check(It(e,t))}}));function x1(e){return Pf(Sn,e)}var pa=S("ZodBigIntFormat",(e,t)=>{_l.init(e,t),Sn.init(e,t);});function w1(e){return Af(pa,e)}function v1(e){return Ef(pa,e)}var Yp=S("ZodSymbol",(e,t)=>{yl.init(e,t),j.init(e,t),e._zod.processJSONSchema=(r,n,o)=>rp(e,r,n,o);});function S1(e){return Rf(Yp,e)}var em=S("ZodUndefined",(e,t)=>{bl.init(e,t),j.init(e,t),e._zod.processJSONSchema=(r,n,o)=>op(e,r,n,o);});function C1(e){return Mf(em,e)}var tm=S("ZodNull",(e,t)=>{$l.init(e,t),j.init(e,t),e._zod.processJSONSchema=(r,n,o)=>np(e,r,n);});function rm(e){return If(tm,e)}var nm=S("ZodAny",(e,t)=>{xl.init(e,t),j.init(e,t),e._zod.processJSONSchema=(r,n,o)=>ap();});function P1(){return zf(nm)}var om=S("ZodUnknown",(e,t)=>{wl.init(e,t),j.init(e,t),e._zod.processJSONSchema=(r,n,o)=>cp();});function ar(){return Nf(om)}var im=S("ZodNever",(e,t)=>{vl.init(e,t),j.init(e,t),e._zod.processJSONSchema=(r,n,o)=>sp(e,r,n);});function ma(e){return Lf(im,e)}var sm=S("ZodVoid",(e,t)=>{Sl.init(e,t),j.init(e,t),e._zod.processJSONSchema=(r,n,o)=>ip(e,r,n,o);});function k1(e){return Of(sm,e)}var zo=S("ZodDate",(e,t)=>{Cl.init(e,t),j.init(e,t),e._zod.processJSONSchema=(r,n,o)=>up(e,r,n,o),e.min=(r,n)=>e.check(Ye(r,n)),e.max=(r,n)=>e.check(Xe(r,n));},T.derived({minDate:e=>{let{minimum:t}=ye(e);return t?new Date(t):null},maxDate:e=>{let{maximum:t}=ye(e);return t?new Date(t):null}},{}));function A1(e){return Tf(zo,e)}var am=S("ZodArray",(e,t)=>{ur(),kl.init(e,t),j.init(e,t),e._zod.processJSONSchema=(r,n,o)=>xp(e,r,n,o),e.element=t.element;},{min(e,t){return this.check(bt(e,t))},nonempty(e){return this.check(bt(1,e))},max(e,t){return this.check(or(e,t))},length(e,t){return this.check(ir(e,t))},unwrap(){return this.element}});function No(e,t){return Zf(am,e,t)}function E1(e){let t=e._zod.def.shape;return da(Object.keys(t))}var Lo=S("ZodObject",(e,t)=>{ur(),Al.init(e,t),j.init(e,t),e._zod.processJSONSchema=(r,n,o)=>wp(e,r,n,o),T.installLazyProp(e,"shape",r=>r._zod.def.shape,false);},{keyof(){return da(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(T.mergeDefs(this._zod.def,{catchall:e}))},passthrough(){return this.clone(T.mergeDefs(this._zod.def,{catchall:ar()}))},loose(){return this.clone(T.mergeDefs(this._zod.def,{catchall:ar()}))},strict(){return this.clone(T.mergeDefs(this._zod.def,{catchall:ma()}))},strip(){return this.clone(T.mergeDefs(this._zod.def,{catchall:void 0}))},extend(e){return T.extend(this,e)},safeExtend(e){return T.safeExtend(this,e)},merge(e){return T.merge(this,e)},pick(e){return T.pick(this,e)},omit(e){return T.omit(this,e)},partial(...e){return T.partial(To,this,e[0])},exactPartial(...e){return T.partial(ga,this,e[0],"exactPartial")},required(...e){return T.required(_a,this,e[0])}});function R1(e,t){let r={type:"object",shape:e??{},...T.normalizeParams(t)};return new Lo(r)}function M1(e,t){return new Lo({type:"object",shape:e,catchall:ma(),...T.normalizeParams(t)})}function I1(e,t){return new Lo({type:"object",shape:e,catchall:ar(),...T.normalizeParams(t)})}var Oo=S("ZodUnion",(e,t)=>{_o.init(e,t),j.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Zs(e,r,n,o),e.options=t.options;});function Cn(e,t){return new Oo({type:"union",options:e,...T.normalizeParams(t)})}var cm=S("ZodXor",(e,t)=>{Oo.init(e,t),El.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Zs(e,r,n,o),e.options=t.options;});function z1(e,t){return new cm({type:"union",options:e,inclusive:false,...T.normalizeParams(t)})}var um=S("ZodDiscriminatedUnion",(e,t)=>{Oo.init(e,t),Ml.init(e,t);});function N1(e,t,r){return new um({type:"union",options:t,discriminator:e,...T.normalizeParams(r)})}var lm=S("ZodIntersection",(e,t)=>{Il.init(e,t),j.init(e,t),e._zod.processJSONSchema=(r,n,o)=>vp(e,r,n,o);});function fm(e,t){return new lm({type:"intersection",left:e,right:t})}var pm=S("ZodTuple",(e,t)=>{ur(),Xi.init(e,t),j.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Sp(e,r,n,o);},{rest(e){return this.clone({...this._zod.def,rest:e})},partial(){let e=this._zod.def;if(e.checks?.length)throw new Error(".partial() cannot be used on tuple schemas containing refinements");return this.clone({...e,items:e.items.map(t=>new To({type:"optional",innerType:t}))})}});function mm(e,t,r){let n=t instanceof G,o=n?r:t,i=n?t:null;return new pm({type:"tuple",items:e,rest:i,...T.normalizeParams(o)})}var bn=S("ZodRecord",(e,t)=>{ur(),zl.init(e,t),j.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Cp(e,r,n,o),e.keyType=t.keyType,e.valueType=t.valueType;});function dm(e,t,r){return !t||!t._zod?new bn({type:"record",keyType:Ro(),valueType:e,...T.normalizeParams(t)}):new bn({type:"record",keyType:e,valueType:t,...T.normalizeParams(r)})}function L1(e,t,r){return new bn({type:"record",keyType:e,valueType:t,...T.normalizeParams(r),partial:true})}function O1(e,t,r){return new bn({type:"record",keyType:e,valueType:t,mode:"loose",...T.normalizeParams(r)})}var hm=S("ZodMap",(e,t)=>{ur(),Nl.init(e,t),j.init(e,t),e._zod.processJSONSchema=(r,n,o)=>bp(e,r,n,o),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...r)=>e.check(mt(...r)),e.nonempty=r=>e.check(mt(1,r)),e.max=(...r)=>e.check(zt(...r)),e.size=(...r)=>e.check(nr(...r));});function T1(e,t,r){return new hm({type:"map",keyType:e,valueType:t,...T.normalizeParams(r)})}var gm=S("ZodSet",(e,t)=>{ur(),Ll.init(e,t),j.init(e,t),e._zod.processJSONSchema=(r,n,o)=>$p(e,r,n,o),e.min=(...r)=>e.check(mt(...r)),e.nonempty=r=>e.check(mt(1,r)),e.max=(...r)=>e.check(zt(...r)),e.size=(...r)=>e.check(nr(...r));});function F1(e,t){return new gm({type:"set",valueType:e,...T.normalizeParams(t)})}var $n=S("ZodEnum",(e,t)=>{Ol.init(e,t),j.init(e,t),e._zod.processJSONSchema=(n,o,i)=>lp(e,n,o),e.enum=t.entries,e.options=[...e._zod.values];let r=new Set(Object.keys(t.entries));e.extract=(n,o)=>{let i={};for(let s of n)if(r.has(s))i[s]=t.entries[s];else throw new Error(`Key ${s} not found in enum`);return new $n({...t,checks:[],...T.normalizeParams(o),entries:i})},e.exclude=(n,o)=>{let i={...t.entries};for(let s of n)if(r.has(s))delete i[s];else throw new Error(`Key ${s} not found in enum`);return new $n({...t,checks:[],...T.normalizeParams(o),entries:i})};});function da(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new $n({type:"enum",entries:r,...T.normalizeParams(t)})}function D1(e,t){return new $n({type:"enum",entries:e,...T.normalizeParams(t)})}var _m=S("ZodLiteral",(e,t)=>{Tl.init(e,t),j.init(e,t),e._zod.processJSONSchema=(r,n,o)=>fp(e,r,n,o),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}});});function Z1(e,t){return new _m({type:"literal",values:Array.isArray(e)?e:[e],...T.normalizeParams(t)})}var ym=S("ZodFile",(e,t)=>{Fl.init(e,t),j.init(e,t),e._zod.processJSONSchema=(r,n,o)=>dp(e,r,n),e.min=(r,n)=>e.check(mt(r,n)),e.max=(r,n)=>e.check(zt(r,n)),e.mime=(r,n)=>e.check(ln(Array.isArray(r)?r:[r],n));});function B1(e){return Bf(ym,e)}var bm=S("ZodTransform",(e,t)=>{ur(),Dl.init(e,t),j.init(e,t),e._zod.processJSONSchema=(r,n,o)=>yp(e,r,n,o),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Rt(e.constructor.name);r.addIssue=i=>{if(typeof i=="string")r.issues.push(T.issue(i,r.value,t));else {let s=i;s.fatal&&(s.continue=false),s.code??(s.code="custom"),"input"in s||(s.input=r.value),s.inst??(s.inst=e),r.issues.push(T.issue(s));}};let o=t.transform(r.value,r);return o instanceof Promise?o.then(i=>(r.value=i,r)):(r.value=o,r)};});function ha(e){return new bm({type:"transform",transform:e})}var To=S("ZodOptional",(e,t)=>{Yi.init(e,t),j.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Bs(e,r,n,o),e.unwrap=()=>e._zod.def.innerType;});function cr(e){return new To({type:"optional",innerType:e})}var ga=S("ZodExactOptional",(e,t)=>{Zl.init(e,t),j.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Bs(e,r,n,o),e.unwrap=()=>e._zod.def.innerType;});function $m(e){return new ga({type:"optional",innerType:e})}var xm=S("ZodNullable",(e,t)=>{Bl.init(e,t),j.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Pp(e,r,n,o),e.unwrap=()=>e._zod.def.innerType;});function Mo(e){return new xm({type:"nullable",innerType:e})}function U1(e){return cr(Mo(e))}var wm=S("ZodDefault",(e,t)=>{Ul.init(e,t),j.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Ep(e,r,n,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap;});function vm(e,t){return new wm({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():T.shallowClone(t)}})}var Sm=S("ZodPrefault",(e,t)=>{Gl.init(e,t),j.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Rp(e,r,n,o),e.unwrap=()=>e._zod.def.innerType;});function Cm(e,t){return new Sm({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():T.shallowClone(t)}})}var _a=S("ZodNonOptional",(e,t)=>{Ql.init(e,t),j.init(e,t),e._zod.processJSONSchema=(r,n,o)=>kp(e,r,n,o),e.unwrap=()=>e._zod.def.innerType;});function Pm(e,t){return new _a({type:"nonoptional",innerType:e,...T.normalizeParams(t)})}var km=S("ZodSuccess",(e,t)=>{Vl.init(e,t),j.init(e,t),e._zod.processJSONSchema=(r,n,o)=>hp(e,r,n),e.unwrap=()=>e._zod.def.innerType;});function G1(e){return new km({type:"success",innerType:e})}var Am=S("ZodCatch",(e,t)=>{jl.init(e,t),j.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Mp(e,r,n,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap;});function Em(e,t){return new Am({type:"catch",innerType:e,catchValue:typeof t=="function"?t:T.constantCatch(t)})}var Rm=S("ZodNaN",(e,t)=>{ql.init(e,t),j.init(e,t),e._zod.processJSONSchema=(r,n,o)=>pp(e,r,n,o);});function Q1(e){return Df(Rm,e)}var Fo=S("ZodPipe",(e,t)=>{es.init(e,t),j.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Ip(e,r,n,o),e.in=t.in,e.out=t.out;});function qs(e,t){return new Fo({type:"pipe",in:e,out:t})}var Do=S("ZodCodec",(e,t)=>{Fo.init(e,t),yo.init(e,t);});function V1(e,t,r){return new Do({type:"pipe",in:e,out:t,transform:r.decode,reverseTransform:r.encode})}function j1(e){let t=e._zod.def;return new Do({type:"pipe",in:t.out,out:t.in,transform:t.reverseTransform,reverseTransform:t.transform})}var Mm=S("ZodPreprocess",(e,t)=>{Fo.init(e,t),Wl.init(e,t);}),Im=S("ZodReadonly",(e,t)=>{Hl.init(e,t),j.init(e,t),e._zod.processJSONSchema=(r,n,o)=>zp(e,r,n,o),e.unwrap=()=>e._zod.def.innerType;});function zm(e){return new Im({type:"readonly",innerType:e})}var Nm=S("ZodTemplateLiteral",(e,t)=>{Kl.init(e,t),j.init(e,t),e._zod.processJSONSchema=(r,n,o)=>mp(e,r,n);});function q1(e,t){return new Nm({type:"template_literal",parts:e,...T.normalizeParams(t)})}var Lm=S("ZodLazy",(e,t)=>{bo.init(e,t),j.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Lp(e,r,n,o),e.unwrap=()=>e._zod.def.getter();});function Om(e){return new Lm({type:"lazy",getter:e})}var Tm=S("ZodPromise",(e,t)=>{Xl.init(e,t),j.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Np(e,r,n,o),e.unwrap=()=>e._zod.def.innerType;});function W1(e){return new Tm({type:"promise",innerType:e})}var Fm=S("ZodFunction",(e,t)=>{Jl.init(e,t),j.init(e,t),e._zod.processJSONSchema=(r,n,o)=>_p(e,r,n,o);});function H1(e){return new Fm({type:"function",input:Array.isArray(e?.input)?mm(e?.input):e?.input??No(ar()),output:e?.output??ar()})}var Zo=S("ZodCustom",(e,t)=>{Yl.init(e,t),j.init(e,t),e._zod.processJSONSchema=(r,n,o)=>gp(e,r,n,o);});function K1(e){let t=new ae({check:"custom"});return t._zod.check=e,t}function J1(e,t){return Uf(Zo,e??(()=>true),t)}function Dm(e,t={}){return Gf(Zo,e,t)}function Zm(e,t){return Qf(e,t)}var X1=Vf,Y1=jf,Bm=S("ZodInstanceOf",(e,t)=>{Zo.init(e,t);},{properties(e,t){return this.check(un(e,t))}});function eg(e,t={}){let r=new Bm({type:"custom",check:"custom",fn:n=>n instanceof e,abort:true,...T.normalizeParams(t)});return r._zod.bag.Class=e,r._zod.check=n=>{n.value instanceof e||n.issues.push({code:"invalid_type",expected:e.name,input:n.value,inst:r,path:[...r._zod.def.path??[]]});},r}var tg=(...e)=>qf({Codec:Do,Boolean:vn,String:xn},...e);function rg(e){let t=Om(()=>Cn([Ro(e),Jp(),Xp(),rm(),No(t),dm(Ro(),t)]));return t}function ng(e,t){return new Mm({type:"pipe",in:ha(e),out:t})}var S3={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};function C3(e){de({customError:e});}function P3(){return de().customError}var Um;Um||(Um={});var Bo={};kt(Bo,{ZodISODate:()=>Ft,ZodISODateTime:()=>Tt,ZodISODuration:()=>Zt,ZodISOTime:()=>Dt,date:()=>A3,datetime:()=>k3,duration:()=>R3,time:()=>E3});function k3(e){return So(Tt,e)}function A3(e){return Co(Ft,e)}function E3(e){return Po(Dt,e)}function R3(e){return ko(Zt,e)}var L={...Pn,...Qs,iso:Bo},M3=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"]);function I3(e,t){let r=e.$schema;return r==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":r==="http://json-schema.org/draft-07/schema#"?"draft-7":r==="http://json-schema.org/draft-04/schema#"?"draft-4":t??"draft-2020-12"}function og(e,t){return e.map((r,n)=>n<t?r:r.optional())}function z3(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function N3(e,t){if(!e.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let r=e.slice(1).split("/").filter(Boolean);if(r.length===0)return t.rootSchema;let n=t.version==="draft-2020-12"?"$defs":"definitions";if(r[0]===n){let o=r[1]===void 0?void 0:z3(r[1]);if(!o||!t.defs[o])throw new Error(`Reference not found: ${e}`);return t.defs[o]}throw new Error(`Reference not found: ${e}`)}function L3(e,t){return L.transform(n=>n).check(n=>{let o=n.value;if(typeof o!="object"||o===null||Array.isArray(o))return;let i=Object.getOwnPropertyNames(o);if(t.minProperties!==void 0&&i.length<t.minProperties&&n.issues.push({origin:"object",code:"too_small",minimum:t.minProperties,inclusive:true,message:`Too small: expected object to have >=${t.minProperties} properties`,input:o,inst:e,continue:true}),t.maxProperties!==void 0&&i.length>t.maxProperties&&n.issues.push({origin:"object",code:"too_big",maximum:t.maxProperties,inclusive:true,message:`Too big: expected object to have <=${t.maxProperties} properties`,input:o,inst:e,continue:true}),t.keySchema)for(let s of i){let a=t.keySchema.safeParse(s);a.success||n.issues.push({code:"invalid_key",origin:"record",issues:a.error.issues,input:s,path:[s],continue:true});}}).pipe(e)}function Gm(e,t){if(e===null)return "z";let r=typeof e;if(r!=="object"){if(r==="number"&&Number.isNaN(e))return null;let n=String(e);return `${r[0]}${n.length}:${n}`}if(t.has(e))return null;t.add(e);try{if(Array.isArray(e)){let i=[];for(let s of e){let a=Gm(s,t);if(a===null)return null;i.push(a);}return `a${i.length}:[${i.join(",")}]`}let n=Object.keys(e).sort(),o=[];for(let i of n){let s=Gm(e[i],t);if(s===null)return null;o.push(`${i.length}:${i}=${s}`);}return `o${o.length}:{${o.join(",")}}`}finally{t.delete(e);}}var O3=new Set(["items","prefixItems","additionalItems","additionalProperties","contains","propertyNames","not","if","then","else","allOf","anyOf","oneOf","unevaluatedItems","unevaluatedProperties","contentSchema"]),T3=new Set(["properties","patternProperties","dependentSchemas","dependencies","$defs","definitions"]);function Uo(e){return typeof e!="object"||e===null?false:Array.isArray(e)?e.some(Uo):typeof e.$ref=="string"?true:Object.entries(e).some(([t,r])=>O3.has(t)?Uo(r):!T3.has(t)||typeof r!="object"||r===null?false:Object.values(r).some(Uo))}function ig(e){return e===1?"element":"elements"}function F3(e,t){return L.transform(n=>n).check(n=>{let o=n.value;if(Array.isArray(o)){if(t.uniqueItems===true){let i=new Map;for(let s=0;s<o.length;s++){let a=Gm(o[s],new Set);if(a===null)continue;let c=i.get(a);if(c===void 0){i.set(a,s);continue}n.issues.push({code:"custom",message:`Array items must be unique: element at index ${s} duplicates the one at index ${c}`,input:o,path:[s],continue:true});}}if(t.containsSchema){let i=t.minContains??1,s=t.maxContains!==void 0?t.maxContains+1:Number.POSITIVE_INFINITY,a=0;for(let c of o)if(t.containsSchema.safeParse(c).success&&++a>=s)break;a<i&&n.issues.push({code:"custom",message:`Array must contain at least ${i} matching ${ig(i)}; found ${a}`,input:o,continue:true}),t.maxContains!==void 0&&a>t.maxContains&&n.issues.push({code:"custom",message:`Array must contain at most ${t.maxContains} matching ${ig(t.maxContains)}`,input:o,continue:true});}}}).pipe(e)}function sg(e,t){if(e!==false)return e===void 0||e===true?L.any():Te(e,t)}var D3=/^(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|[+-](?:[01]\d|2[0-3]):[0-5]\d)$/;function ag(e,t){if(e.not!==void 0){if(typeof e.not=="object"&&Object.keys(e.not).length===0)return L.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(e.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(e.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(e.if!==void 0||e.then!==void 0||e.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(e.dependentSchemas!==void 0||e.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(e.$ref){let o=e.$ref;if(t.refs.has(o))return t.refs.get(o);if(t.processing.has(o))return L.lazy(()=>{if(!t.refs.has(o))throw new Error(`Circular reference not resolved: ${o}`);return t.refs.get(o)});t.processing.add(o);let i=N3(o,t),s=Te(i,t);return t.refs.set(o,s),t.processing.delete(o),s}if(e.enum!==void 0){let o=e.enum;if(t.version==="openapi-3.0"&&e.nullable===true&&o.length===1&&o[0]===null)return L.null();if(o.length===0)return L.never();if(o.length===1)return L.literal(o[0]);if(o.every(s=>typeof s=="string"))return L.enum(o);let i=o.map(s=>L.literal(s));return i.length<2?i[0]:L.union([i[0],i[1],...i.slice(2)])}if(e.const!==void 0)return L.literal(e.const);let r=e.type;if(Array.isArray(r)){let o=r.map(i=>{let s={...e,type:i};return ag(s,t)});return o.length===0?L.never():o.length===1?o[0]:L.union(o)}if(!r)return L.any();let n;switch(r){case "string":{let o=L.string();if(e.format){let i=e.format;i==="email"?o=o.check(L.email()):i==="uri"||i==="uri-reference"?o=o.check(L.url()):i==="uuid"||i==="guid"?o=o.check(L.uuid()):i==="date-time"?o=o.check(L.iso.datetime({offset:true})):i==="date"?o=o.check(L.iso.date()):i==="time"?o=o.check(L.regex(D3)):i==="duration"?o=o.check(L.iso.duration()):i==="hostname"?o=o.check(L.hostname()):i==="ipv4"?o=o.check(L.ipv4()):i==="ipv6"?o=o.check(L.ipv6()):i==="mac"?o=o.check(L.mac()):i==="cidr"?o=o.check(L.cidrv4()):i==="cidr-v6"?o=o.check(L.cidrv6()):i==="base64"?o=o.check(L.base64()):i==="base64url"?o=o.check(L.base64url()):i==="e164"?o=o.check(L.e164()):i==="credit_card"?o=o.check(L.creditCard()):i==="iban"?o=o.check(L.iban()):i==="jwt"?o=o.check(L.jwt()):i==="emoji"?o=o.check(L.emoji()):i==="nanoid"?o=o.check(L.nanoid()):i==="cuid"?o=o.check(L.cuid()):i==="cuid2"?o=o.check(L.cuid2()):i==="ulid"?o=o.check(L.ulid()):i==="xid"?o=o.check(L.xid()):i==="ksuid"&&(o=o.check(L.ksuid()));}typeof e.minLength=="number"&&(o=o.min(e.minLength)),typeof e.maxLength=="number"&&(o=o.max(e.maxLength)),e.pattern&&(o=o.regex(new RegExp(e.pattern))),n=o;break}case "number":case "integer":{let o=r==="integer"?L.number().int():L.number();typeof e.minimum=="number"&&e.exclusiveMinimum!==true&&(o=o.min(e.minimum)),typeof e.maximum=="number"&&e.exclusiveMaximum!==true&&(o=o.max(e.maximum)),typeof e.exclusiveMinimum=="number"?o=o.gt(e.exclusiveMinimum):e.exclusiveMinimum===true&&typeof e.minimum=="number"&&(o=o.gt(e.minimum)),typeof e.exclusiveMaximum=="number"?o=o.lt(e.exclusiveMaximum):e.exclusiveMaximum===true&&typeof e.maximum=="number"&&(o=o.lt(e.maximum)),typeof e.multipleOf=="number"&&(o=o.multipleOf(e.multipleOf)),n=o;break}case "boolean":{n=L.boolean();break}case "null":{n=L.null();break}case "object":{let o={},i=e.properties||{},s=new Set(e.required||[]),a=typeof e.additionalProperties=="object"?Te(e.additionalProperties,t):void 0;for(let[f,p]of Object.entries(i)){let m=Te(p,t);Pe(o,f,s.has(f)?m:m.optional());}if(e.patternProperties){let f=e.patternProperties,p=Object.keys(f),m=[];for(let d of p){let g=Te(f[d],t),y=L.string().regex(new RegExp(d));m.push(L.looseRecord(y,g));}let h=[];if(Object.keys(o).length>0&&h.push(L.object(o).passthrough()),h.push(...m),h.length===0)n=L.object({}).passthrough();else if(h.length===1)n=h[0];else {let d=L.intersection(h[0],h[1]);for(let g=2;g<h.length;g++)d=L.intersection(d,h[g]);n=d;}if(e.additionalProperties===false){let d=Object.keys(o),g=p.map(_=>new RegExp(_)),y=n;n=n.check(_=>{if(!et(_.value))return;let b=[];for(let v of Object.keys(_.value))d.includes(v)||g.some(C=>C.test(v))||b.push(v);b.length&&_.issues.push({code:"unrecognized_keys",keys:b,input:_.value,inst:y});});}}else {let f=L.object(o);e.additionalProperties===false?n=f.strict():a?n=f.catchall(a):n=f.passthrough();}let c=e.propertyNames!==void 0&&e.propertyNames!==true,u=typeof e.minProperties=="number"?e.minProperties:void 0,l=typeof e.maxProperties=="number"?e.maxProperties:void 0;if(c||u!==void 0||l!==void 0){let f;if(c){let p=typeof e.propertyNames=="object"&&e.propertyNames.type===void 0?{type:"string",...e.propertyNames}:e.propertyNames;f=Te(p,t);}n=L3(n,{keySchema:f,minProperties:u,maxProperties:l});}break}case "array":{let o=e.prefixItems,i=e.items;if(o&&Array.isArray(o)){let s=typeof e.minItems=="number"?e.minItems:0,a=o.map(f=>Te(f,t)),c=og(a,s),u=Array.isArray(i)?void 0:sg(i,t),l=L.tuple(c);n=u?l.rest(u):l,typeof e.minItems=="number"&&(n=n.check(L.minLength(e.minItems))),typeof e.maxItems=="number"&&(n=n.check(L.maxLength(e.maxItems)));}else if(Array.isArray(i)){let s=typeof e.minItems=="number"?e.minItems:0,a=i.map(f=>Te(f,t)),c=og(a,s),u=sg(e.additionalItems,t),l=L.tuple(c);n=u?l.rest(u):l,typeof e.minItems=="number"&&(n=n.check(L.minLength(e.minItems))),typeof e.maxItems=="number"&&(n=n.check(L.maxLength(e.maxItems)));}else if(i!==void 0){let s=Te(i,t),a=L.array(s);typeof e.minItems=="number"&&(a=a.min(e.minItems)),typeof e.maxItems=="number"&&(a=a.max(e.maxItems)),n=a;}else n=L.array(L.any());(e.uniqueItems===true||e.contains!==void 0)&&(n=F3(n,{uniqueItems:e.uniqueItems===true,containsSchema:e.contains!==void 0?Te(e.contains,t):void 0,minContains:typeof e.minContains=="number"?e.minContains:void 0,maxContains:typeof e.maxContains=="number"?e.maxContains:void 0}));break}default:throw new Error(`Unsupported type: ${r}`)}return n}function Te(e,t){if(typeof e=="boolean")return e?L.any():L.never();let r=ag(e,t),n=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){let a=e.anyOf.map(u=>Te(u,t)),c=L.union(a);r=n?L.intersection(r,c):c;}if(e.oneOf&&Array.isArray(e.oneOf)){let a=e.oneOf.map(u=>Te(u,t)),c=L.xor(a);r=n?L.intersection(r,c):c;}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)r=n?r:L.any();else {let a=n?r:Te(e.allOf[0],t),c=n?0:1;for(let u=c;u<e.allOf.length;u++)a=L.intersection(a,Te(e.allOf[u],t));r=a;}e.nullable===true&&t.version==="openapi-3.0"&&(r=L.nullable(r)),e.readOnly===true&&(r=L.readonly(r)),e.default!==void 0&&(r=r.default(e.default));let o={},i=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let a of i)a in e&&(o[a]=e[a]);let s=["contentEncoding","contentMediaType","contentSchema"];for(let a of s)a in e&&(o[a]=e[a]);if(e.type==="object"&&e.$ref===void 0){e.propertyNames!==void 0&&!Uo(e.propertyNames)&&(o.propertyNames=e.propertyNames);for(let a of ["minProperties","maxProperties"])e[a]!==void 0&&(o[a]=e[a]);}if(e.type==="array"&&e.$ref===void 0){e.contains!==void 0&&!Uo(e.contains)&&(o.contains=e.contains);for(let a of ["uniqueItems","minContains","maxContains"])e[a]!==void 0&&(o[a]=e[a]);}for(let a of Object.keys(e))M3.has(a)||Pe(o,a,e[a]);return Object.keys(o).length>0&&t.registry.add(r,o),e.description&&(r=r.describe(e.description)),r}function cg(e,t){if(typeof e=="boolean")return e?L.any():L.never();let r;try{r=JSON.parse(JSON.stringify(e));}catch{throw new Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}let n=I3(r,t?.defaultTarget),o=r.$defs||r.definitions||{},i={version:n,defs:o,refs:new Map,processing:new Set,rootSchema:r,registry:t?.registry??ke};return Te(r,i)}var ug=Symbol("z.visit/resolving");function Go(e,t){let r=typeof t=="function"?t:(s,a)=>{let c=t[s._zod.def.type];return c?c(s,a):s},n=new Map;function o(s){let a=n.get(s);if(a===ug)return new bo({type:"lazy",getter:()=>n.get(s)});if(a!==void 0)return a;n.set(s,ug);let c=i(s),u=r(c,c!==s);return n.set(s,u),u}function i(s){let a=s._zod.def,c=a.type;switch(c){case "object":{let u=a.shape,l=Object.keys(u),f=false,p={};for(let h of l){let d=o(u[h]);d!==u[h]&&(f=true),p[h]=d;}let m=a.catchall;return a.catchall&&(m=o(a.catchall),m!==a.catchall&&(f=true)),f?Y(s,{...a,shape:p,catchall:m}):s}case "array":{let u=o(a.element);return u===a.element?s:Y(s,{...a,element:u})}case "tuple":{let u=a.items,l=false,f=[];for(let m of u){let h=o(m);h!==m&&(l=true),f.push(h);}let p=a.rest;return a.rest&&(p=o(a.rest),p!==a.rest&&(l=true)),l?Y(s,{...a,items:f,rest:p}):s}case "record":case "map":{let u=o(a.keyType),l=o(a.valueType);return u===a.keyType&&l===a.valueType?s:Y(s,{...a,keyType:u,valueType:l})}case "set":{let u=o(a.valueType);return u===a.valueType?s:Y(s,{...a,valueType:u})}case "union":{let u=a.options,l=false,f=[];for(let p of u){let m=o(p);m!==p&&(l=true),f.push(m);}return l?Y(s,{...a,options:f}):s}case "intersection":{let u=o(a.left),l=o(a.right);return u===a.left&&l===a.right?s:Y(s,{...a,left:u,right:l})}case "optional":case "nullable":case "default":case "prefault":case "catch":case "readonly":case "nonoptional":case "promise":case "success":{let u=o(a.innerType);return u===a.innerType?s:Y(s,{...a,innerType:u})}case "pipe":{let u=o(a.in),l=o(a.out);return u===a.in&&l===a.out?s:Y(s,{...a,in:u,out:l})}case "function":{let u=o(a.input),l=o(a.output);return u===a.input&&l===a.output?s:Y(s,{...a,input:u,output:l})}case "lazy":{let u=a.getter,{_cachedInner:l,...f}=a;return Y(s,{...f,getter:()=>o(u())})}case "template_literal":case "string":case "number":case "int":case "boolean":case "bigint":case "symbol":case "undefined":case "null":case "void":case "never":case "any":case "unknown":case "date":case "nan":case "enum":case "literal":case "file":case "transform":case "custom":return s;default:return s}}return o(e)}function lg(e){return Go(e,{object:t=>t.partial(),union:t=>{let r=t._zod.def;return r.discriminator===void 0?t:Cn(r.options)}})}function Z3(e,t){if(!t?.length)return e;let r=e._zod.def;return Y(e,ot(r,{checks:[...r.checks??[],...t]}),{parent:true})}function fg(e){return Z3(e.out,e.checks)}function B3(e){return e.in._zod.traits.has("$ZodTransform")?fg(e):e.in}function pg(e){return Go(e,{pipe:t=>B3(t._zod.def),default:(t,r)=>r?cr(t._zod.def.innerType):t,catch:(t,r)=>r?t._zod.def.innerType:t})}function mg(e){return Go(e,{pipe:t=>fg(t._zod.def),prefault:(t,r)=>r?t._zod.def.innerType:t})}var Qm={};kt(Qm,{bigint:()=>V3,boolean:()=>Q3,date:()=>j3,number:()=>G3,string:()=>U3});function U3(e){return pf(xn,e)}function G3(e){return yf(wn,e)}function Q3(e){return Cf(vn,e)}function V3(e){return kf(Sn,e)}function j3(e){return Ff(zo,e)}var ba=["logo","halftone"],q3=k.enum(ba),ya={logo:["blend","badge"],halftone:["color","mono"]},W3=k.enum([...ya.logo,...ya.halftone]),pr=192,dg=e=>Math.ceil(e/3)*4,H3=k.object({width:k.number().int().min(1).max(pr),height:k.number().int().min(1).max(pr),data:k.string().max(dg(pr*pr*4))}).refine(e=>e.data.length===dg(e.width*e.height*4),{message:"Art image data does not match its width and height"}),hg=k.object({mode:q3,image:H3,intensity:k.number().min(0).max(1).optional(),variant:W3.optional(),matchEyes:k.boolean().optional()});k.enum(["solid","linear","radial","angular","image"]);var K3=k.object({type:k.literal("solid"),color:k.string()}),Vm=k.object({color:k.string(),offset:k.number().min(0).max(100)}),J3=k.object({type:k.literal("linear"),stops:k.array(Vm).min(2),angle:k.number().optional().default(0)}),X3=k.object({type:k.literal("radial"),stops:k.array(Vm).min(2)}),Y3=k.object({type:k.literal("angular"),stops:k.array(Vm).min(2),angle:k.number().optional().default(0)}),e5=k.enum(["cover","contain","tile"]),t5=k.enum(["top-left","top","top-right","left","center","right","bottom-left","bottom","bottom-right"]),r5=k.object({type:k.literal("image"),src:k.string().min(1),fit:e5.optional().default("cover"),scale:k.number().min(.1).max(4).optional().default(1),position:t5.optional().default("center"),opacity:k.number().min(0).max(1).optional().default(1),underlay:k.string().optional()}),mr=k.union([k.string(),K3,J3,X3,Y3,r5]);function dr(e,t="#000000"){return e?typeof e=="string"?{type:"solid",color:e}:e:{type:"solid",color:t}}function Qo(e){return !e||typeof e=="string"?false:e.type==="linear"||e.type==="radial"||e.type==="angular"}function gg(e){return typeof e=="object"&&e!==null&&e.type==="image"}var _g=["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"],n5=["diamond","star","banner"],yg=k.enum([..._g,...n5]);k.enum(_g);var bg=["square","rounded","gear","circle","diya","extra-rounded","message","pointy","leaf","drop","octagon","bevel","squircle","cushion","shield","petal","leaf-reverse"],o5=["curly"],$g=k.enum([...bg,...o5]);k.enum(bg);var i5=["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"],kn=24;var jm=.5,An=1.5,s5=k.enum(i5),qm=k.object({style:s5,text:k.string().max(kn).optional(),color:k.string().optional(),textColor:k.string().optional(),secondaryText:k.string().max(kn).optional(),secondaryColor:k.string().optional(),fontScale:k.number().min(jm).max(An).optional()});function re(e,t=3){let r=10**t;return Math.round(e*r)/r+0}function $(e,t=3){return String(re(e,t))}function M(e,...t){let r=e[0]??"";for(let n=0;n<t.length;n++){let o=t[n];r+=(typeof o=="number"?$(o):o)+(e[n+1]??"");}return r}var a5={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0},c5=/^[MmLlHhVvCcSsQqTtAaZz0-9.,+\-\s]*$/,Wm=/[+-]?(?:\d+\.?\d*|\.\d+)/y;function Vo(e,t=Number.POSITIVE_INFINITY){if(!c5.test(e))return null;let r=[],n=0,o=()=>{for(;n<e.length&&/[\s,]/.test(e[n]);)n++;},i=()=>{o(),Wm.lastIndex=n;let c=Wm.exec(e);if(!c)return null;let u=c[0],l=u.indexOf(".");if(l>=0&&u.length-l-1>t)return null;n=Wm.lastIndex;let f=Number(u);return Number.isFinite(f)?f:null},s=()=>{o();let c=e[n];return c==="0"||c==="1"?(n++,c==="1"?1:0):null},a=()=>(o(),n<e.length&&/[0-9.+-]/.test(e[n]));for(o();n<e.length;){let c=e[n],u=c.toUpperCase(),l=a5[u];if(l===void 0||r.length===0&&u!=="M")return null;if(n++,l===0){r.push({command:c,values:[]}),o();continue}let f=c,p=true;for(;p||a();){let m=[];for(let h=0;h<l;h++){let d=u==="A"&&(h===3||h===4)?s():i();if(d===null)return null;m.push(d);}r.push({command:f,values:m}),u==="M"&&(f=c==="M"?"L":"l"),p=false;}o();}return r}function xg(e){let t=0;for(let{command:r}of e)t+=r.toUpperCase()==="A"?4:1;return t}function Hm(e,t=1,r=0,n=0){let o="";for(let{command:i,values:s}of e){let a=i.toUpperCase(),c=i===a,u=c?r:0,l=c?n:0,f;switch(a){case "Z":f=[];break;case "H":f=[$(s[0]*t+u)];break;case "V":f=[$(s[0]*t+l)];break;case "A":f=[$(Math.abs(s[0])*t),$(Math.abs(s[1])*t),$(s[2]),String(s[3]),String(s[4]),$(s[5]*t+u),$(s[6]*t+l)];break;default:f=s.map((p,m)=>$(p*t+(m%2===0?u:l)));}o+=i+f.join(" ");}return o}function vg(e,t=.25){let r=[],n=[],o=[0,0],i=[0,0],s=()=>{n.length>2&&r.push(n),n=[];};for(let a of e)if(a.op==="M")s(),o=[a.x,a.y],i=o,n.push(o);else if(a.op==="L")i=[a.x,a.y],n.push(i);else if(a.op==="C"){let c=i,u=[a.x1,a.y1],l=[a.x2,a.y2],f=[a.x,a.y],p=Math.hypot(u[0]-c[0],u[1]-c[1])+Math.hypot(l[0]-u[0],l[1]-u[1])+Math.hypot(f[0]-l[0],f[1]-l[1]),m=Math.max(2,Math.min(64,Math.ceil(Math.sqrt(p/(4*t)))));for(let h=1;h<=m;h++){let d=h/m,g=1-d;n.push([g*g*g*c[0]+3*g*g*d*u[0]+3*g*d*d*l[0]+d*d*d*f[0],g*g*g*c[1]+3*g*g*d*u[1]+3*g*d*d*l[1]+d*d*d*f[1]]);}i=f;}else s(),i=o;return s(),r}function $a(e,t){let r=[o=>o[0]-t.x0,o=>t.x1-o[0],o=>o[1]-t.y0,o=>t.y1-o[1]],n=e;for(let o of r){if(n.length===0)break;let i=n;n=[];for(let s=0;s<i.length;s++){let a=i[s],c=i[(s+i.length-1)%i.length],u=o(a),l=o(c);u>=0?(l<0&&n.push(wg(c,a,l,u)),n.push(a)):l>=0&&n.push(wg(c,a,l,u));}}return n.length>2?n:[]}function wg(e,t,r,n){let o=r/(r-n);return [e[0]+(t[0]-e[0])*o,e[1]+(t[1]-e[1])*o]}function Sg(e){return e.filter(t=>t.length>2).map(t=>`M${t.map(([r,n])=>`${$(r)} ${$(n)}`).join("L")}Z`).join("")}function Cg(e){let t=Number.POSITIVE_INFINITY,r=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY,o=Number.NEGATIVE_INFINITY,i=(s,a)=>{t=Math.min(t,s),r=Math.min(r,a),n=Math.max(n,s),o=Math.max(o,a);};for(let s of e)s.op==="C"?(i(s.x1,s.y1),i(s.x2,s.y2),i(s.x,s.y)):s.op!=="Z"&&i(s.x,s.y);return Number.isFinite(t)?{x0:t,y0:r,x1:n,y1:o}:null}var u5={amp:"&",lt:"<",gt:">",quot:'"',apos:"'"};function Ag(e){return e.replace(/&(#x[0-9a-f]+|#\d+|[a-z]+);/gi,(t,r)=>{if(r[0]==="#"){let n=r[1].toLowerCase()==="x"?Number.parseInt(r.slice(2),16):Number.parseInt(r.slice(1),10);return Number.isInteger(n)&&n>0&&n<=1114111&&!(n>=55296&&n<=57343)?String.fromCodePoint(n):t}return u5[r.toLowerCase()]??t})}var l5=60,Km=62,Jm=47,f5=61,Pg=34,kg=39,Ym=/\s*/y,p5=/[^\s/>]*/y,m5=/[^\s>]*/y,d5=/[^\s=]*/y;function En(e,t,r){return e.lastIndex=r,e.test(t)?e.lastIndex:r}function h5(e,t){let r=e.length,n=w=>{let x=Number.POSITIVE_INFINITY,E=-1;return P=>((P<x||E>=0&&E<P)&&(x=P,E=e.indexOf(w,P)),E)},o=n("-->"),i=n("?>"),s=n("]]>"),a=n(">"),c,u=w=>{let x=e.charCodeAt(w);if(x!==Pg&&x!==kg)return w+1;let E=e.indexOf(e[w],w+1);return E<0?r:E+1},l=w=>{for(let x=w;x<r&&!c?.[x];x=u(x)){let E=e.charCodeAt(x);if(E===Km||E===Jm&&e.charCodeAt(x+1)===Km)return x}c??=new Uint8Array(r);for(let x=w;x<r&&!c[x];x=u(x))c[x]=1;return -1},f=-1,p=-1,m=-1,h=-1,d=w=>{let x=w+1;if(x<f||x>=p){f=x,p=En(p5,e,x),m=-1;for(let P=p;P>x;P--){let R=e.charCodeAt(P);if((P===p||R===Pg||R===kg)&&(h=l(P),h>=0)){m=P;break}}}if(m<=x)return -1;let E=e.charCodeAt(h)===Jm;return t.open(e.slice(x,m),e.slice(m,h),E),h+(E?2:1)},g=-1,y=-1,_=-1,b=w=>{let x=w+2;if(x<g||x>=y){g=x,y=En(m5,e,x);let E=En(Ym,e,y);_=y>x&&e.charCodeAt(E)===Km?E:-1;}return _},v=w=>{if(e.startsWith("<!--",w)){let x=o(w+4);if(x>=0)return x+3}if(e.startsWith("<?",w)){let x=i(w+2);if(x>=0)return x+2}if(e.startsWith("<![CDATA[",w)){let x=s(w+9);if(x>=0)return t.cdata(e.slice(w+9,x)),x+3}if(e.startsWith("<!",w)){let x=a(w+2);if(x>=0)return x+1}if(e.charCodeAt(w+1)===Jm){let x=b(w);return x<0?-1:(t.close(),x+1)}return d(w)},C=0;for(;C<r;)if(e.charCodeAt(C)===l5){let w=v(C);C=w<0?C+1:w;}else {let w=e.indexOf("<",C),x=w<0?r:w;t.text(e.slice(C,x)),C=x;}}function g5(e){let t={},r=0;for(;r<e.length;){let n=En(d5,e,r);if(n===r){r++;continue}let o=En(Ym,e,n);if(e.charCodeAt(o)===f5){let i=En(Ym,e,o+1),s=e[i],a=s==='"'||s==="'"?e.indexOf(s,i+1):-1;if(a>=0){t[e.slice(r,n)]=Ag(e.slice(i+1,a)),r=a+1;continue}}r=n;}return t}function va(e){let t={name:"#root",attrs:{},children:[],text:""},r=[t],n=()=>r.at(-1);h5(e,{open(i,s,a){let c=g5(s),u={name:i,attrs:c,children:[],text:""};n().children.push(u),a||r.push(u);},close(){r.length>1&&r.pop();},text(i){n().text+=Ag(i);},cdata(i){n().text+=i;}});let o=i=>{for(let s of i.children){if(s.name==="svg")return s;let a=o(s);if(a)return a}return null};return o(t)}var xa=[1,0,0,1,0,0];function Fe(e,t){let[r,n,o,i,s,a]=e,[c,u,l,f,p,m]=t;return [r*c+o*u,n*c+i*u,r*l+o*f,n*l+i*f,r*p+o*m+s,n*p+i*m+a]}function be(e,t,r){return [e[0]*t+e[2]*r+e[4],e[1]*t+e[3]*r+e[5]]}function ed(e){return Math.sqrt(Math.abs(e[0]*e[3]-e[1]*e[2]))}function Sa(e){return e?(e.match(/[+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?/gi)??[]).map(Number):[]}function hr(e){let t=xa;if(!e)return t;for(let[,r,n]of e.matchAll(/(matrix|translate|scale|rotate|skewX|skewY)\s*\(([^)]*)\)/g)){let o=Sa(n),i=xa;switch(r){case "matrix":o.length===6&&(i=o);break;case "translate":i=[1,0,0,1,o[0]??0,o[1]??0];break;case "scale":i=[o[0]??1,0,0,o[1]??o[0]??1,0,0];break;case "rotate":{let s=(o[0]??0)*Math.PI/180,a=Math.cos(s),c=Math.sin(s),[u,l]=[o[1]??0,o[2]??0];i=Fe(Fe([1,0,0,1,u,l],[a,c,-c,a,0,0]),[1,0,0,1,-u,-l]);break}case "skewX":i=[1,0,Math.tan((o[0]??0)*Math.PI/180),1,0,0];break;case "skewY":i=[1,Math.tan((o[0]??0)*Math.PI/180),0,1,0,0];break;}t=Fe(t,i);}return t}var Xm=/[+-]?(?:\d+\.?\d*|\.\d+)(?:[eE][+-]?\d+)?/y;function _5(e,t,r,n,o,i,s,a,c){if(e===a&&t===c)return [];let u=Math.abs(r),l=Math.abs(n);if(u===0||l===0)return [{op:"L",x:a,y:c}];let f=o*Math.PI/180,p=Math.cos(f),m=Math.sin(f),h=(e-a)/2,d=(t-c)/2,g=p*h+m*d,y=-m*h+p*d,_=g*g/(u*u)+y*y/(l*l);_>1&&(u*=Math.sqrt(_),l*=Math.sqrt(_));let b=u*u*l*l-u*u*y*y-l*l*g*g,v=u*u*y*y+l*l*g*g,C=(i===s?-1:1)*Math.sqrt(Math.max(0,b/v)),w=C*u*y/l,x=-C*l*g/u,E=p*w-m*x+(e+a)/2,P=m*w+p*x+(t+c)/2,R=(K,U,X,we)=>Math.atan2(K*we-U*X,K*X+U*we),I=R(1,0,(g-w)/u,(y-x)/l),N=R((g-w)/u,(y-x)/l,(-g-w)/u,(-y-x)/l);!s&&N>0?N-=2*Math.PI:s&&N<0&&(N+=2*Math.PI);let O=Math.max(1,Math.ceil(Math.abs(N)/(Math.PI/2)-1e-9)),V=N/O,Q=4/3*Math.tan(V/4),F=(K,U)=>[E+u*p*K-l*m*U,P+u*m*K+l*p*U],W=[];for(let K=0;K<O;K++){let U=I+K*V,X=U+V,[we,Me]=F(Math.cos(U)-Q*Math.sin(U),Math.sin(U)+Q*Math.cos(U)),[ge,me]=F(Math.cos(X)+Q*Math.sin(X),Math.sin(X)-Q*Math.cos(X)),[Ae,J]=K===O-1?[a,c]:F(Math.cos(X),Math.sin(X));W.push({op:"C",x1:we,y1:Me,x2:ge,y2:me,x:Ae,y:J});}return W}function gr(e){let t=[],r=0,n=0,o=0,i=0,s=0,a="",c=null,u=null,l=()=>{for(;r<e.length&&/[\s,]/.test(e[r]);)r++;},f=()=>{l(),Xm.lastIndex=r;let h=Xm.exec(e);return h?(r=Xm.lastIndex,Number(h[0])):null},p=()=>{l();let h=e[r];return h==="0"||h==="1"?(r++,h==="1"):null},m=h=>{let d=[];for(let g=0;g<h;g++){let y=f();if(y===null)return null;d.push(y);}return d};for(;l(),!(r>=e.length);){let h=e[r];if(/[MmLlHhVvCcSsQqTtAaZz]/.test(h))a=h,r++;else if(!a||a==="Z"||a==="z")break;let d=a===a.toLowerCase(),g=d?n:0,y=d?o:0,_=a.toUpperCase();if(_==="Z"){t.push({op:"Z"}),n=i,o=s,c=null,u=null;continue}if(_==="A"){let w=m(3),x=p(),E=p(),P=m(2);if(!(w&&P)||x===null||E===null)break;let[R,I,N]=w,O=P[0]+g,V=P[1]+y;t.push(..._5(n,o,R,I,N,x,E,O,V)),n=O,o=V,c=null,u=null;continue}let b={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2}[_]??0,v=m(b);if(!v)break;let C=v;switch(_){case "M":n=C[0]+g,o=C[1]+y,i=n,s=o,t.push({op:"M",x:n,y:o}),a=d?"l":"L",c=null,u=null;break;case "L":case "H":case "V":_!=="V"&&(n=C[0]+g),_==="V"?o=C[0]+y:_==="L"&&(o=C[1]+y),t.push({op:"L",x:n,y:o}),c=null,u=null;break;case "C":case "S":{let w,x;_==="C"?(w=[C[0]+g,C[1]+y],x=C.slice(2)):(w=c?[2*n-c[0],2*o-c[1]]:[n,o],x=C);let E=[x[0]+g,x[1]+y],P=[x[2]+g,x[3]+y];t.push({op:"C",x1:w[0],y1:w[1],x2:E[0],y2:E[1],x:P[0],y:P[1]}),[n,o]=P,c=E,u=null;break}case "Q":case "T":{let w,x;_==="Q"?(w=[C[0]+g,C[1]+y],x=[C[2]+g,C[3]+y]):(w=u?[2*n-u[0],2*o-u[1]]:[n,o],x=[C[0]+g,C[1]+y]),t.push({op:"C",x1:n+2/3*(w[0]-n),y1:o+2/3*(w[1]-o),x2:x[0]+2/3*(w[0]-x[0]),y2:x[1]+2/3*(w[1]-x[1]),x:x[0],y:x[1]}),[n,o]=x,u=w,c=null;break}}}return t}var wa=.5522847498;function jo(e,t,r,n){if(r<=0||n<=0)return [];let o=r*wa,i=n*wa;return [{op:"M",x:e+r,y:t},{op:"C",x1:e+r,y1:t+i,x2:e+o,y2:t+n,x:e,y:t+n},{op:"C",x1:e-o,y1:t+n,x2:e-r,y2:t+i,x:e-r,y:t},{op:"C",x1:e-r,y1:t-i,x2:e-o,y2:t-n,x:e,y:t-n},{op:"C",x1:e+o,y1:t-n,x2:e+r,y2:t-i,x:e+r,y:t},{op:"Z"}]}function Rn(e,t,r,n,o=0,i=0){if(r<=0||n<=0)return [];let s=Math.min(Math.max(o,0),r/2),a=Math.min(Math.max(i,0),n/2);if(s===0||a===0)return [{op:"M",x:e,y:t},{op:"L",x:e+r,y:t},{op:"L",x:e+r,y:t+n},{op:"L",x:e,y:t+n},{op:"Z"}];let c=s*wa,u=a*wa,l=e+r,f=t+n;return [{op:"M",x:e+s,y:t},{op:"L",x:l-s,y:t},{op:"C",x1:l-s+c,y1:t,x2:l,y2:t+a-u,x:l,y:t+a},{op:"L",x:l,y:f-a},{op:"C",x1:l,y1:f-a+u,x2:l-s+c,y2:f,x:l-s,y:f},{op:"L",x:e+s,y:f},{op:"C",x1:e+s-c,y1:f,x2:e,y2:f-a+u,x:e,y:f-a},{op:"L",x:e,y:t+a},{op:"C",x1:e,y1:t+a-u,x2:e+s-c,y2:t,x:e+s,y:t},{op:"Z"}]}var y5="qrdx.frame",b5=1,nd="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:kn},$5=["wifi","star","heart","phone","headphones","calendar","user","chat","bag","bell","cup","card","check","info","home","pin","share","download","clock","snowflake","pumpkin","tree","sparkle","gift"],Pa=.95,x5=200,w5=["frame","text","accent","background"],v5=/[\t\n\v\f\r\u0085\u2028\u2029]/g,S5=/[\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 Ho(e,t=kn){let r=e.slice(0,1e3).normalize("NFC").replace(v5," ").replace(S5,"").replace(/\s+/g," ").trim();return Array.from(r).slice(0,Math.max(0,t)).join("").trim()}var od=e=>Math.abs(e*1e3-Math.round(e*1e3))<1e-6,he=k.number().min(-4e3).max(Se.maxCoordinate).refine(od,{message:`Numbers may have at most ${Se.maxDecimals} decimals`}),De=he.refine(e=>e>0,{message:"Must be greater than 0"}),Ca=he.refine(e=>e>=0,{message:"Must not be negative"}),Wo=k.string().regex(/^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/,"Use a #rgb or #rrggbb color"),Eg=k.union([k.enum(w5),Wo]),Ig=e=>k.object({mix:k.tuple([e,e]),amount:k.number().min(0).max(1).refine(od)}).strict(),qo=k.union([Eg,Ig(Eg)]),C5=k.union([Wo,Ig(k.union([k.enum(["frame","accent","background"]),Wo]))]),_r=k.union([qo,k.object({gradient:k.object({from:qo,to:qo,direction:k.enum(["horizontal","vertical"]).optional(),steps:k.int().min(2).max(Se.maxGradientSteps).optional()}).strict()}).strict()]),td={x:he,y:he,width:De,height:De},P5=k.object({type:k.literal("rect"),...td,radius:Ca.optional(),fill:_r,hole:k.object({...td,radius:Ca.optional()}).strict().optional()}).strict(),k5=k.object({type:k.literal("circle"),cx:he,cy:he,r:De,hole:De.optional(),fill:_r}).strict(),A5=k.object({type:k.literal("ellipse"),cx:he,cy:he,rx:De,ry:De,fill:_r}).strict(),E5=k.object({type:k.literal("polygon"),points:k.array(k.tuple([he,he])).min(3).max(Se.maxPolygonPoints),fill:_r}).strict(),R5=k.object({type:k.literal("path"),d:k.string().min(2).max(Se.maxPathLength),fill:_r,fillRule:k.enum(["nonzero","evenodd"]).optional()}).strict(),M5=k.object({type:k.literal("line"),x1:he,y1:he,x2:he,y2:he,width:De,cap:k.enum(["butt","round"]).optional(),dash:k.tuple([De,De]).optional(),fill:_r}).strict(),I5=k.object({type:k.literal("icon"),icon:k.enum($5),x:he,y:he,size:De,fill:_r}).strict(),z5=k.discriminatedUnion("type",[P5,k5,A5,E5,R5,M5,I5]),zg={id:k.string().regex(/^[a-z][a-z0-9-]{0,31}$/),slot:k.enum(["primary","secondary","fixed"]),text:k.string().max(200),maxLength:k.int().min(1).max(kn).optional(),color:qo,weight:k.enum(["bold","regular"]).optional(),collapse:k.object({y:he,height:De}).strict().optional()},N5=k.object({type:k.literal("text"),...zg,box:k.object(td).strict(),align:k.enum(["start","middle","end"]).optional(),fontSize:De.optional()}).strict(),L5=k.object({type:k.literal("curved"),...zg,curve:k.object({cx:he,cy:he,radius:De,side:k.enum(["top","bottom"]),spread:k.number().min(20).max(300).refine(od).optional()}).strict(),fontSize:De}).strict(),O5=k.discriminatedUnion("type",[N5,L5]),Rg=he.refine(e=>e>=Se.minArtboard&&e<=Se.maxArtboard,{message:`Artboard sides must be ${Se.minArtboard} to ${Se.maxArtboard} units`}),T5=k.object({kind:k.literal(y5),version:k.literal(b5),artboard:k.object({width:Rg,height:Rg}).strict(),qr:k.object({x:he,y:he,size:De,padding:Ca.optional(),radius:Ca.optional(),plate:k.enum(["opaque","background"]).optional()}).strict(),colors:k.object({frame:Wo,text:C5.optional(),accent:Wo.optional()}).strict(),shapes:k.array(z5).max(Se.maxShapes),labels:k.array(O5).max(Se.maxLabels),bleed:k.union([k.literal("none"),qo]).optional()}).strict();function id(e){let t=ka(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 F5(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 ka(e){return e.qr.padding??e.qr.size*Se.defaultPadding}var sd=.52,D5=.35;function Z5(e){let t=e.fontSize??e.box.height*sd;return Math.min(t*An,e.box.height*Pa)}var rd=(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 Mg(e){let t=id(e),r=Math.min(e.qr.radius??0,(t.x1-t.x0)/2,(t.y1-t.y0)/2),n=[[t.x0+r,t.y0+r,Math.PI],[t.x1-r,t.y0+r,-Math.PI/2],[t.x1-r,t.y1-r,0],[t.x0+r,t.y1-r,Math.PI/2]],o=[];for(let[i,s,a]of n)for(let c=0;c<=8;c++){let u=a+Math.PI/2*(c/8);o.push([i+r*Math.cos(u),s+r*Math.sin(u)]);}return o}function B5([e,t],r,n){if(e<r.x-.01||t<r.y-.01||e>r.x+r.width+.01||t>r.y+r.height+.01)return false;let i=Math.min(n,r.width/2,r.height/2),s=Math.min(Math.max(e,r.x+i),r.x+r.width-i),a=Math.min(Math.max(t,r.y+i),r.y+r.height-i);return Math.hypot(e-s,t-a)<=i+.01}function U5(e){let t=0;return e.forEach(([r,n],o)=>{let[i,s]=e[(o+1)%e.length];t+=r*s-i*n;}),Math.abs(t)/2}function G5(e,t,r){let n=id(t);if(e.fill==="background"||!rd(r,n))return false;if(e.type==="rect"&&e.hole){let{hole:o}=e;return !Mg(t).every(i=>B5(i,o,o.radius??0))}if(e.type==="circle"&&e.hole){let o=e.hole;return !Mg(t).every(([i,s])=>Math.hypot(i-e.cx,s-e.cy)<=o+.01)}if(e.type==="polygon"){let o=$a(e.points,n);return o.length>2&&U5(o)>1e-6}return true}function ad(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(([n])=>n),r=e.points.map(([,n])=>n);return {bounds:{x0:Math.min(...t),y0:Math.min(...r),x1:Math.max(...t),y1:Math.max(...r)},segments:e.points.length}}case "path":{let t=Vo(e.d,Se.maxDecimals);return t?{bounds:Cg(gr(e.d)),segments:xg(t)}:{bounds:null,segments:0}}case "line":{let t=e.width/2,r=Math.hypot(e.x2-e.x1,e.y2-e.y1),n=e.dash?Math.ceil(r/(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:n*(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:x5}}}function Q5(e,t){let r=(_,b=[])=>t.addIssue({code:"custom",message:_,path:b}),n=Se,o=new TextEncoder().encode(JSON.stringify(e)).length;if(o>n.maxBytes){r(`The spec is ${o} bytes; the limit is ${n.maxBytes}`);return}let{width:i,height:s}=e.artboard,a=Math.max(i,s)*.005,c={x0:-a,y0:-a,x1:i+a,y1:s+a},u=_=>_.x0>=c.x0&&_.y0>=c.y0&&_.x1<=c.x1&&_.y1<=c.y1,{qr:l}=e,f=ka(e);f<l.size*n.minPadding-1e-9&&r(`qr.padding must be at least ${n.minPadding*100}% of qr.size`,["qr","padding"]),l.size<Math.min(i,s)*n.minQrShare-1e-9&&r(`qr.size must be at least ${n.minQrShare*100}% of the artboard's shorter side`,["qr","size"]);let p=id(e);(p.x0<-1e-9||p.y0<-1e-9||p.x1>i+1e-9||p.y1>s+1e-9)&&r("The code and its padding must sit inside the artboard",["qr"]),(l.radius??0)>(l.size+2*f)/2&&r("qr.radius is larger than half the plate",["qr","radius"]);let m=0,h=0;e.shapes.forEach((_,b)=>{let v=["shapes",b],{bounds:C,segments:w}=ad(_);if(!C){r("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",[...v,"d"]);return}if(u(C)||r("The shape extends outside the artboard",v),_.type==="rect"&&_.hole){let{hole:x}=_;(x.x<_.x||x.y<_.y||x.x+x.width>_.x+_.width+1e-9||x.y+x.height>_.y+_.height+1e-9)&&r("The hole must sit inside its rect",[...v,"hole"]);}_.type==="circle"&&_.hole&&_.hole>=_.r&&r("The hole must be smaller than the circle",[...v,"hole"]),l.plate==="background"&&G5(_,e,C)&&r('With qr.plate "background", only background fills (or a ring whose hole holds the plate) may lie under the plate',v),m+=w,typeof _.fill=="object"&&"gradient"in _.fill&&(h+=(_.fill.gradient.steps??32)*w);}),m>n.maxSegments&&r(`The shapes have ${m} segments; the limit is ${n.maxSegments}`,["shapes"]),h>n.maxGradientWork&&r("Gradient fills are too detailed (fewer steps or simpler shapes)",["shapes"]);let d=[],g=new Set,y=new Set;e.labels.forEach((_,b)=>{let v=["labels",b];g.has(_.id)&&r(`Label id "${_.id}" is used twice`,[...v,"id"]),g.add(_.id),_.slot!=="fixed"&&(y.has(_.slot)&&r(`Only one label may use the ${_.slot} slot`,[...v,"slot"]),y.add(_.slot));let C=_.maxLength??n.maxTextLength;_.text!==Ho(_.text,C)&&r(`Label text must be at most ${C} characters, trimmed, with no control or invisible characters (see sanitizeFrameText)`,[...v,"text"]);let w;if(_.type==="text"){w={x0:_.box.x,y0:_.box.y,x1:_.box.x+_.box.width,y1:_.box.y+_.box.height},_.fontSize!==void 0&&_.fontSize>_.box.height*Pa+1e-9&&r("fontSize may be at most 95% of the label's row height",[...v,"fontSize"]);let x=_.box.y+_.box.height/2,E=Z5(_)*D5,P={x0:w.x0,x1:w.x1,y0:x-E,y1:x+E};(rd(w,F5(e))||rd(P,p))&&r("The label overlaps the code or its padding",[...v,"box"]);}else {let{cx:x,cy:E,radius:P}=_.curve,R=_.fontSize*An*.6;w={x0:x-P-R,y0:E-P-R,x1:x+P+R,y1:E+P+R};let I=Math.hypot(Math.max(p.x0-x,0,x-p.x1),Math.max(p.y0-E,0,E-p.y1));Math.hypot(Math.max(Math.abs(p.x0-x),Math.abs(p.x1-x)),Math.max(Math.abs(p.y0-E),Math.abs(p.y1-E)))<=P-R||I>=P+R||r("The curved label crosses the code or its padding",[...v,"curve"]);}if(u(w)||r("The label extends outside the artboard",v),_.collapse){let x=_.collapse,E=x.y+x.height;(x.y<-1e-9||E>s+1e-9)&&r("The collapse band must sit inside the artboard",[...v,"collapse"]),E>p.y0+1e-6&&x.y<p.y1-1e-6&&r("The collapse band crosses the code or its padding",[...v,"collapse"]);for(let P of d)E>P.y+1e-6&&x.y<P.y+P.height-1e-6&&r("Collapse bands may not overlap",[...v,"collapse"]);d.push(x);}});}var cd=T5.superRefine(Q5);var V5=qm.extend({style:k.literal(nd),spec:cd}),Ng=k.discriminatedUnion("style",[qm,V5]);var j5=["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"],Lg=k.enum(j5);var q5=["square","rounded","circle"],Og=k.enum(q5),W5=k.object({src:k.string(),height:k.number(),width:k.number(),excavate:k.boolean(),x:k.number().optional(),y:k.number().optional(),padding:k.number().min(0).optional(),shape:Og.optional(),plate:k.string().optional()}),H5=.1,K5=.3;var J5=2;k.object({size:k.number().min(H5).max(K5).optional(),padding:k.number().min(0).max(J5).optional(),x:k.number().min(0).max(1).optional(),y:k.number().min(0).max(1).optional(),shape:Og.optional(),plate:k.string().optional()});var X5=k.enum(["L","M","Q","H"]),Aa=.5,ld=1,Tg=.07,Y5=["square","circle","heart"],e4=k.enum(Y5),Fg=3,yr=64,Ko=8,Dg=.42,t4=k.object({type:k.literal("silhouette"),width:k.number().int().min(Ko).max(yr),height:k.number().int().min(Ko).max(yr),cells:k.string().max(yr*yr).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"}),r4=k.union([e4,t4]);var ud=k.object({outer:mr.optional(),inner:mr.optional()}),n4=k.object({topLeft:ud.optional(),topRight:ud.optional(),bottomLeft:ud.optional()});k.object({value:k.string(),size:k.number().optional(),level:X5.optional(),bgColor:mr.optional(),fgColor:mr.optional(),eyeColor:mr.optional(),dotColor:mr.optional(),bodyPattern:Lg.optional(),cornerEyePattern:$g.optional(),cornerEyeDotPattern:yg.optional(),margin:k.number().optional(),imageSettings:W5.optional(),isOGContext:k.boolean().optional(),templateId:k.string().optional(),customProps:k.record(k.string(),k.any()).optional(),frame:Ng.optional(),art:hg.optional(),eyeColors:n4.optional(),moduleScale:k.number().min(Aa).max(ld).optional(),autoLevel:k.boolean().optional(),shape:r4.optional()});var Ze=e=>e/255,Jo=(e,t)=>(e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]-t[2])**2,se=e=>.2126*e[0]+.7152*e[1]+.0722*e[2];function o4(e){let{width:t,height:r,data:n}=e,o=[0,t-1,(r-1)*t,r*t-1].map(s=>{let a=s*4;return {color:[Ze(n[a]),Ze(n[a+1]),Ze(n[a+2])],alpha:n[a+3]/255}});if(o.some(s=>s.alpha<.9))return null;let i=o[0].color;return o.every(({color:s})=>Jo(s,i)<.006)?i:null}function i4(e){let{width:t,height:r,data:n}=e,o=o4(e),i=new Float32Array(t*r);for(let s=0;s<i.length;s++){let a=s*4,c=n[a+3]/255;if(o&&c>0){let u=Math.sqrt(Jo([Ze(n[a]),Ze(n[a+1]),Ze(n[a+2])],o));c*=Math.min(1,Math.max(0,(u-.06)/.1));}i[s]=c;}return i}var s4=8,a4=.14,Zg=.006;function c4(e,t){let{width:r,height:n,data:o}=e,i=new Float64Array(4096),s=new Float64Array(4096*3),a=0;for(let m=0;m<t.length;m++){if(t[m]<.9)continue;let h=m*4,d=Math.floor(o[h]/16)*256+Math.floor(o[h+1]/16)*16+Math.floor(o[h+2]/16);i[d]+=1,s[d*3]+=Ze(o[h]),s[d*3+1]+=Ze(o[h+1]),s[d*3+2]+=Ze(o[h+2]),a++;}if(a===0)return {palette:[],error:0};let c=[...i.keys()].filter(m=>i[m]>0).sort((m,h)=>i[h]-i[m]),u=[];for(let m of c){if(i[m]/a<Zg/2||u.length>=s4)break;let h=[s[m*3]/i[m],s[m*3+1]/i[m],s[m*3+2]/i[m]];u.every(d=>Jo(d,h)>=a4**2)&&u.push(h);}let l=[],f=0;for(let m=0;m<3;m++){l=u.map(()=>({n:0,r:0,g:0,b:0,x:0,y:0})),f=0;for(let h=0;h<t.length;h++){if(t[h]<.9)continue;let d=h*4,g=[Ze(o[d]),Ze(o[d+1]),Ze(o[d+2])],y=0,_=Number.POSITIVE_INFINITY;for(let[v,C]of u.entries()){let w=Jo(g,C);w<_&&(_=w,y=v);}let b=l[y];b.n++,b.r+=g[0],b.g+=g[1],b.b+=g[2],b.x+=h%r,b.y+=Math.floor(h/r),f+=Math.sqrt(_);}for(let[h,d]of l.entries())d.n>0&&(u[h]=[d.r/d.n,d.g/d.n,d.b/d.n]);}return {palette:u.map((m,h)=>({color:m,area:l[h].n/a,cx:l[h].n?l[h].x/l[h].n+.5:r/2,cy:l[h].n?l[h].y/l[h].n+.5:n/2})).filter(m=>m.area>=Zg).sort((m,h)=>h.area-m.area),error:f/a}}function u4(e,t,r){let n=t+2,o=r+2,i=(f,p)=>f<=0||p<=0||f>t||p>r?0:e[(p-1)*t+(f-1)],s=new Map,a=new Map,c=f=>{let p=a.get(f);if(p)return p;let m=Math.floor(f/2),h=m%n,d=Math.floor(m/n),g=i(h,d),y=f%2===1,_=y?i(h,d+1):i(h+1,d),b=g===_?.5:Math.min(1,Math.max(0,(.5-g)/(_-g))),v=y?[h-.5,d-.5+b]:[h-.5+b,d-.5];return a.set(f,v),v},u=(f,p)=>{s.set(f,p);};for(let f=0;f<o-1;f++)for(let p=0;p<n-1;p++){let m=i(p,f)>=.5,h=i(p+1,f)>=.5,d=i(p+1,f+1)>=.5,g=i(p,f+1)>=.5,y=2*(f*n+p),_=2*((f+1)*n+p),b=2*(f*n+p)+1,v=2*(f*n+p+1)+1;switch((m?8:0)+(h?4:0)+(d?2:0)+(g?1:0)){case 1:u(_,b);break;case 2:u(v,_);break;case 3:u(v,b);break;case 4:u(y,v);break;case 5:{(i(p,f)+i(p+1,f)+i(p+1,f+1)+i(p,f+1))/4>=.5?(u(y,b),u(_,v)):(u(y,v),u(_,b));break}case 6:u(y,_);break;case 7:u(y,b);break;case 8:u(b,y);break;case 9:u(_,y);break;case 10:{(i(p,f)+i(p+1,f)+i(p+1,f+1)+i(p,f+1))/4>=.5?(u(b,_),u(v,y)):(u(b,y),u(v,_));break}case 11:u(v,y);break;case 12:u(b,v);break;case 13:u(_,v);break;case 14:u(b,_);break;}}let l=[];for(let f of s.keys()){if(!s.has(f))continue;let p=[],m=f;for(;m!==void 0&&s.has(m);){p.push(c(m));let h=s.get(m);s.delete(m),m=h;}p.length>=3&&l.push(p);}return l}function l4(e){let t=0;for(let r=0;r<e.length;r++){let n=e[r],o=e[(r+1)%e.length];t+=n[0]*o[1]-o[0]*n[1];}return t/2}function Bg(e,t){if(e.length<=2)return e;let r=new Uint8Array(e.length);r[0]=1,r[e.length-1]=1;let n=[[0,e.length-1]];for(;n.length>0;){let[o,i]=n.pop(),s=e[o],a=e[i],c=a[0]-s[0],u=a[1]-s[1],l=Math.hypot(c,u)||1,f=-1,p=t;for(let m=o+1;m<i;m++){let h=e[m],d=Math.abs(u*(h[0]-s[0])-c*(h[1]-s[1]))/l;d>p&&(p=d,f=m);}f>=0&&(r[f]=1,n.push([o,f],[f,i]));}return e.filter((o,i)=>r[i]===1)}function f4(e,t){let r=0,n=-1;for(let[s,a]of e.entries()){let c=(a[0]-e[0][0])**2+(a[1]-e[0][1])**2;c>n&&(n=c,r=s);}let o=Bg(e.slice(0,r+1),t),i=Bg([...e.slice(r),e[0]],t);return [...o.slice(0,-1),...i.slice(0,-1)]}var Bt=e=>re(e,2);function p4(e,t){let r=e.length,n=(i,s)=>{let a=Math.hypot(s[0]-i[0],s[1]-i[1])||1,c=Math.min(.5,t/a);return [i[0]+(s[0]-i[0])*c,i[1]+(s[1]-i[1])*c]},o="";for(let i=0;i<r;i++){let s=e[i],a=n(s,e[(i-1+r)%r]),c=n(s,e[(i+1)%r]);o+=i===0?`M${Bt(a[0])} ${Bt(a[1])}`:`L${Bt(a[0])} ${Bt(a[1])}`,o+=`Q${Bt(s[0])} ${Bt(s[1])} ${Bt(c[0])} ${Bt(c[1])}`;}return `${o}Z`}function m4(e,t,r){let n="";for(let o of u4(e,t,r)){if(Math.abs(l4(o))<.8)continue;let i=f4(o,.18);i.length>=3&&(n+=p4(i,.9));}return n}var d4=.075;function Ug(e){let{width:t,height:r,data:n}=e,o=i4(e),i=0;for(let d of o)i+=d;let{palette:s,error:a}=c4(e,o),c={width:t,height:r,palette:s,alpha:o,coverage:i/(t*r)};if(s.length===0||a>d4)return {...c,layers:[],photographic:s.length>0};let u=s.length,l=Array.from({length:u},()=>new Float32Array(t*r)),f=s.map(d=>d.color);for(let d=0;d<o.length;d++){let g=o[d];if(g<=0)continue;let y=d*4,_=[Ze(n[y]),Ze(n[y+1]),Ze(n[y+2])],b=0,v=-1,C=Number.POSITIVE_INFINITY,w=Number.POSITIVE_INFINITY;for(let I=0;I<u;I++){let N=Jo(_,f[I]);N<C?(v=b,w=C,b=I,C=N):N<w&&(v=I,w=N);}if(v<0||C<1e-6){l[b][d]=g;continue}let x=f[b],E=f[v],P=[E[0]-x[0],E[1]-x[1],E[2]-x[2]],R=Math.min(1,Math.max(0,((_[0]-x[0])*P[0]+(_[1]-x[1])*P[1]+(_[2]-x[2])*P[2])/(P[0]**2+P[1]**2+P[2]**2)));l[b][d]=g*(1-R),l[v][d]=g*R;}let p=[],m=new Float32Array(t*r),h=new Array(u);for(let d=u-1;d>=0;d--){let g=l[d];for(let y=0;y<m.length;y++)m[y]+=g[y];h[d]=m.slice();}for(let d=0;d<u;d++){let g=m4(h[d],t,r);g&&p.push({color:f[d],d:g});}return {...c,layers:p,photographic:false}}var{QrCode:fd}=Qe,h4={"1L":3,"1M":2,"1Q":1,"1H":1,"2L":2,"3L":1};function g4(e){let t=e*4+17,r=new Uint8Array(t*t),n=(s,a)=>{s>=0&&a>=0&&s<t&&a<t&&(r[a*t+s]=1);};for(let s=0;s<t;s++)n(6,s),n(s,6);for(let[s,a]of [[3,3],[t-4,3],[3,t-4]])for(let c=-4;c<=4;c++)for(let u=-4;u<=4;u++)n(s+u,a+c);let o=[];if(e>1){let s=Math.floor(e/7)+2,a=e===32?26:Math.ceil((e*4+4)/(s*2-2))*2;o.push(6);for(let c=t-7;o.length<s;c-=a)o.splice(1,0,c);}let i=o.length-1;for(let[s,a]of o.entries())for(let[c,u]of o.entries())if(!(s===0&&c===0||s===0&&c===i||s===i&&c===0))for(let l=-2;l<=2;l++)for(let f=-2;f<=2;f++)n(a+f,u+l);for(let s=0;s<=8;s++)n(8,s),n(s,8);for(let s=0;s<8;s++)n(t-1-s,8),n(8,t-1-s);if(e>=7)for(let s=0;s<18;s++){let a=t-11+s%3,c=Math.floor(s/3);n(a,c),n(c,a);}return r}function _4(e,t){let r=e*4+17,n=ht[t].ordinal,o=fd.NUM_ERROR_CORRECTION_BLOCKS[n]?.[e]??0,i=fd.ECC_CODEWORDS_PER_BLOCK[n]?.[e]??0,s=Math.floor(fd.getNumRawDataModules(e)/8),a=o-s%o,c=Math.floor(s/o),u=Array.from({length:o},(v,C)=>c+(C<a?0:1)),l=[],f=[],p=c-i;for(let v=0;v<=c;v++)for(let C=0;C<o;C++)if(C<a){if(v===p)continue;l.push(C),f.push(v<p?v:v-1);}else l.push(C),f.push(v);if(l.length!==s)throw new Error(`Codeword map: interleave mismatch at version ${e}`);let m=g4(e),h=new Int16Array(r*r).fill(-1),d=new Int16Array(r*r).fill(-1),g=new Int8Array(r*r).fill(-1),y=s*8,_=0;for(let v=r-1;v>=1;v-=2){v===6&&(v=5);let C=(v+1&2)===0;for(let w=0;w<r;w++)for(let x=0;x<2;x++){let E=v-x,R=(C?r-1-w:w)*r+E;if(!m[R]&&_<y){let I=_>>>3;h[R]=l[I],d[R]=f[I],g[R]=7-(_&7),_++;}}}if(_!==y)throw new Error(`Codeword map: placement mismatch at version ${e}`);let b=h4[`${e}${t}`]??0;return {version:e,level:t,size:r,blocks:o,eccPerBlock:i,blockLengths:u,correctable:Math.floor((i-b)/2),block:h,codeword:d,bit:g}}var y4=8,br=new Map;function Ea(e,t){if(!(Number.isInteger(e)&&e>=1&&e<=40))throw new RangeError(`QR version must be 1\u201340, got ${e}`);let r=`${e}${t}`,n=br.get(r);if(n)return br.delete(r),br.set(r,n),n;let o=_4(e,t);if(br.size>=y4){let i=br.keys().next().value;i!==void 0&&br.delete(i);}return br.set(r,o),o}function Ra(e,t){let r=new Array(e.blocks).fill(0),n=new Set;for(let o of t){let i=e.block[o]??-1;if(i<0)continue;let s=i*4096+e.codeword[o];n.has(s)||(n.add(s),r[i]=r[i]+1);}return r}var b4={black:[0,0,0],white:[255,255,255],red:[255,0,0],green:[0,128,0],lime:[0,255,0],blue:[0,0,255],navy:[0,0,128],yellow:[255,255,0],orange:[255,165,0],purple:[128,0,128],pink:[255,192,203],gray:[128,128,128],grey:[128,128,128],silver:[192,192,192],maroon:[128,0,0],olive:[128,128,0],teal:[0,128,128],aqua:[0,255,255],cyan:[0,255,255],fuchsia:[255,0,255],magenta:[255,0,255]};function Gg(e,t){let r=e.trim(),n=Number.parseFloat(r);return Number.isNaN(n)?Number.NaN:r.endsWith("%")?n/100*t:n}function Re(e){if(!e)return null;let t=e.trim().toLowerCase();if(t==="transparent")return {r:0,g:0,b:0,a:0};let r=b4[t];if(r)return {r:r[0],g:r[1],b:r[2],a:1};if(t.startsWith("#")){let o=t.slice(1);return (o.length===3||o.length===4)&&(o=o.split("").map(i=>i+i).join("")),/^[0-9a-f]{6}([0-9a-f]{2})?$/.test(o)?{r:Number.parseInt(o.slice(0,2),16),g:Number.parseInt(o.slice(2,4),16),b:Number.parseInt(o.slice(4,6),16),a:o.length===8?Number.parseInt(o.slice(6,8),16)/255:1}:null}let n=/^rgba?\(([^)]*)\)$/.exec(t);if(n){let[o,i]=n[1].split("/"),s=o.split(/[\s,]+/).filter(Boolean);if(s.length!==(i===void 0&&s.length===4?4:3))return null;let a=i??s[3],[c,u,l]=s.slice(0,3).map(m=>Gg(m,255)),f=a===void 0?1:Gg(a,1);if([c,u,l,f].some(m=>Number.isNaN(m)))return null;let p=(m,h)=>Math.min(Math.max(m,0),h);return {r:p(c,255),g:p(u,255),b:p(l,255),a:p(f,1)}}return null}function Xo(e,t,r){let n=e/255,o=t/255,i=r/255,s=1-Math.max(n,o,i);return s>=1?[0,0,0,1]:[re((1-n-s)/(1-s)),re((1-o-s)/(1-s)),re((1-i-s)/(1-s)),re(s)]}function $r(e){return e.children}var $4=e=>e==null?null:`${e}`;function pd(e,t,r){let n=t??{},o=r;if("key"in n){let{key:i,...s}=n;i!==void 0&&(o=i),n=s;}return {type:e,props:n,key:$4(o)}}function x4(e,t){let r=e;return {type:r.type,props:{...r.props,...t},key:r.key??null}}function w4(e,t,...r){let n={...t};return r.length>0&&(n.children=r.length===1?r[0]:r),pd(e,n)}var v4={jsx:pd,jsxs:pd,createElement:w4,cloneElement:x4,Fragment:$r},Ma=v4;var Qg=e=>e===$r?Ma.Fragment:e;function A(e,t,r){return Ma.jsx(Qg(e),t,r)}function le(e,t,r){return Ma.jsxs(Qg(e),t,r)}function Mn(e,t){return Ma.cloneElement(e,t)}var S4=new Set([Symbol.for("react.element"),Symbol.for("react.transitional.element")]),Vg=Symbol.for("react.fragment");function Ia(e){if(typeof e!="object"||e===null||Array.isArray(e))return false;let t=e;return t.$$typeof!==void 0&&!S4.has(t.$$typeof)?false:(typeof t.type=="string"||typeof t.type=="function"||t.type===Vg)&&typeof t.props=="object"&&t.props!==null}var za=e=>e===$r||e===Vg;var C4=.6;var In=class{entries=new Map;limit;constructor(t){this.limit=t;}get(t,r){let n=this.entries.get(t);if(n!==void 0)return this.entries.delete(t),this.entries.set(t,n),n;let o=r();if(this.entries.size>=this.limit){let i=this.entries.keys().next().value;i!==void 0&&this.entries.delete(i);}return this.entries.set(t,o),o}},P4=new In(8);function k4(e){return P4.get(e,()=>{let t=atob(e),r=new Uint8Array(t.length);for(let n=0;n<t.length;n++)r[n]=t.charCodeAt(n);return r})}function hd(e){let{width:t,height:r,data:n}=e;if(!(Number.isInteger(t)&&Number.isInteger(r))||t<1||r<1||t>pr||r>pr||typeof n!="string")return null;try{let o=k4(n);return o.length===t*r*4?{width:t,height:r,data:o}:null}catch{return null}}function Jg(e){return !!(e&&ba.includes(e.mode)&&e.image&&hd(e.image))}function gd(e){let t=ya[e.mode];return e.variant&&t.includes(e.variant)?e.variant:t[0]}function A4(e,t){if(e===1)return [];let r=Math.floor(e/7)+2,n=e===32?26:Math.ceil((e*4+4)/(r*2-2))*2,o=[6];for(let i=t-7;o.length<r;i-=n)o.splice(1,0,i);return o}function Yo(e,t){let r=A4(e,t),n=r.length-1,o=[];for(let[i,s]of r.entries())for(let[a,c]of r.entries())i===0&&a===0||i===0&&a===n||i===n&&a===0||o.push([s,c]);return o}var nt=1,at=2,Ut=3,jg=4,qg=new Map;function E4(e){let t=qg.get(e);if(t)return t;let r=e*4+17,n=new Uint8Array(r*r),o=(i,s,a,c,u)=>{for(let l=Math.max(0,s);l<Math.min(r,s+c);l++)for(let f=Math.max(0,i);f<Math.min(r,i+a);f++)n[l*r+f]=u;};o(6,0,1,r,jg),o(0,6,r,1,jg),o(0,8,9,1,Ut),o(8,0,1,9,Ut),o(r-8,8,8,1,Ut),o(8,r-8,1,8,Ut),e>=7&&(o(r-11,0,3,6,Ut),o(0,r-11,6,3,Ut));for(let[i,s]of Yo(e,r))o(i-2,s-2,5,5,at);return o(0,0,8,8,nt),o(r-8,0,8,8,nt),o(0,r-8,8,8,nt),qg.set(e,n),n}function R4(e){let t=e[8],r=t?.[0]?1:0,n=t?.[1]?1:0,o=(1-r)*2+n;return ["M","L","H","Q"][o]??"M"}function La(e,t){let r=Re(e);return !r||r.a===0?t:[r.r/255,r.g/255,r.b/255]}var wr=(e,t,r)=>[e[0]+(t[0]-e[0])*r,e[1]+(t[1]-e[1])*r,e[2]+(t[2]-e[2])*r];function Gt(e,t,r,n){let o=se(e);if(n?o<=r:o>=r)return e;let i=se(t);return Math.abs(o-i)<1e-6?t:wr(e,t,Math.min(1,Math.max(0,(o-r)/(o-i))))}var Xg=e=>Math.max(...e)-Math.min(...e),M4=(e,t)=>(e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]-t[2])**2,md=e=>e.toString(16).padStart(2,"0");function Be(e,t=1){let r=n=>Math.min(255,Math.round(Math.round(Math.min(Math.max(n,0),1)*255)/t)*t);return `#${md(r(e[0]))}${md(r(e[1]))}${md(r(e[2]))}`}function I4(e){let t=e<0?-1:1,r=Math.abs(e),n=1/(1+.3275911*r),o=1-((((1.061405429*n-1.453152027)*n+1.421413741)*n-.284496736)*n+.254829592)*n*Math.exp(-r*r);return t*o}var _d=.3,Wg=e=>1-Math.exp(-((e/2)**2)/(2*_d**2)),z4=e=>I4(e/(2*_d*Math.SQRT2))**2,N4=(e,t,r)=>{let n=Math.min(1,Math.max(0,(r-e)/(t-e)));return n*n*(3-2*n)};function yd(e,t,r,n){let o=n==="cover"?Math.max(r/e,r/t):Math.min(r/e,r/t);return {scale:o,offsetX:(r-e*o)/2,offsetY:(r-t*o)/2}}function Yg(e,t){let{width:r,height:n,data:o}=e,i=new Float32Array(r*n*3),s=t??new Float32Array(r*n);for(let a=0;a<r*n;a++)i[a*3]=o[a*4]/255,i[a*3+1]=o[a*4+1]/255,i[a*3+2]=o[a*4+2]/255,t||(s[a]=o[a*4+3]/255);return {width:r,height:n,rgb:i,alpha:s}}function L4(e){let t=Yg(e),{rgb:r,alpha:n}=t,o=new Float64Array(256),i=0;for(let f=0;f<n.length;f++){if(n[f]<.5)continue;let p=se([r[f*3],r[f*3+1],r[f*3+2]]);o[Math.min(255,Math.floor(p*256))]+=1,i++;}let s=f=>{let p=0;for(let m=0;m<256;m++)if(p+=o[m],p>=f*i)return m/255;return 1},a=i?s(.01):0,c=i?s(.99):1;c-a<.15&&(a=0,c=1);let u=Math.min(1.6,1/(c-a)),l=(a+c)/2;for(let f=0;f<n.length;f++){let p=[r[f*3],r[f*3+1],r[f*3+2]],m=se(p),h=.5+(m-l)*u;for(let d=0;d<3;d++)r[f*3+d]=Math.min(1,Math.max(0,h+(p[d]-m)*1.12));}return t}function e_(e,t,r,n,o=1){let{width:i,height:s,rgb:a,alpha:c}=e,u=Math.min(Math.max(t-.5,0),i-1),l=Math.min(Math.max(r-.5,0),s-1),f=Math.floor(u),p=Math.floor(l),m=Math.min(f+1,i-1),h=Math.min(p+1,s-1),d=u-f,g=l-p,y=0,_=0,b=0,v=0,C=(x,E,P)=>{let R=E*i+x,I=c[R]*P;y+=a[R*3]*I,_+=a[R*3+1]*I,b+=a[R*3+2]*I,v+=I;};if(C(f,p,(1-d)*(1-g)),C(m,p,d*(1-g)),C(f,h,(1-d)*g),C(m,h,d*g),v<=0)return n;let w=v*o;return [n[0]+(y/v-n[0])*w,n[1]+(_/v-n[1])*w,n[2]+(b/v-n[2])*w]}var O4=new In(4),T4=new In(6),F4=new In(6);function bd(e,t){return T4.get(e.image.data,()=>Ug(t))}function t_(e,t,r){return F4.get(e.image.data,()=>Yg(t,r.alpha))}var $e=e=>re(e,2),r_=e=>re(e,4),vr=class{groups=new Map;add(t,r){let n=this.groups.get(t);n?n.push(r):this.groups.set(t,[r]);}cellRun(t,r,n,o){this.add(t,`M${r} ${n}h${o}.04v1.04h-${o}.04z`);}circle(t,r,n,o){this.add(t,D4(r,n,o));}toElements(t){return [...this.groups].map(([r,n],o)=>A("path",{d:n.join(""),fill:r},`${t}-${o}`))}};function D4(e,t,r){let n=$e(r*2),o=$e(r);return `M${$e(e-r)} ${$e(t)}a${o} ${o} 0 1 0 ${n} 0a${o} ${o} 0 1 0 ${-n} 0z`}function xr(e,t,r,n,o){let i=Math.min(o,r/2,n/2);if(i<=0)return `M${$e(e)} ${$e(t)}h${$e(r)}v${$e(n)}h${$e(-r)}z`;let s=$e(i);return `M${$e(e+i)} ${$e(t)}h${$e(r-2*i)}a${s} ${s} 0 0 1 ${s} ${s}v${$e(n-2*i)}a${s} ${s} 0 0 1 ${-s} ${s}h${$e(-(r-2*i))}a${s} ${s} 0 0 1 ${-s} ${-s}v${$e(-(n-2*i))}a${s} ${s} 0 0 1 ${s} ${-s}z`}function n_(e,t,r){let n="";for(let[o,i]of e){let s=(o-2+t)*r,a=(i-2+t)*r;n+=xr(s,a,5*r,5*r,r*.35),n+=xr(s+r,a+r,3*r,3*r,r*.15),n+=xr(s+2*r,a+2*r,r,r,r*.12);}return n}var Z4={blend:1,badge:1,color:.9,mono:.7},B4=.35;function o_(e,t,r){let n=Math.min(Math.max(e.intensity??C4,0),Z4[gd(e)]);return se(r)-se(t)>=B4?n:0}function U4(e){let{art:t,modules:r,version:n}=e,o=t.image&&hd(t.image);if(!(o&&ba.includes(t.mode)))return null;let i=r.length;if(i!==n*4+17)return null;let s=La(e.fgColor,[0,0,0]),a=La(e.bgColor,[1,1,1]),c=o_(t,s,a);return c<=0?null:{art:t,image:o,modules:r,size:i,version:n,kinds:E4(n),margin:e.margin,pixelSize:e.pixelSize,t:c,fg:s,bg:a,variant:gd(t),body:e.body}}function i_(e){let t=U4(e);if(!t)return null;let r;return t.art.mode==="halftone"?r=t.variant==="mono"?W4(t):q4(t):r=t.variant==="badge"?n6(t):H4(t),A("g",{"data-qrdx-art":t.art.mode,"data-qrdx-art-variant":t.variant,children:r})}function G4(e,t){return {margin:.42-.17*e+(t===3?.04:0),darkCap:.4+.3*e}}var s_=8.5,Hg=new Map;function $d(e){let t=e*4+17,r=Hg.get(e);if(!r){let i=t*2,s=new Uint8Array(i*i),a=s_*2;for(let c=0;c<i;c++)for(let u=0;u<i;u++){let l=u<a||u>=i-a,f=c<a||c>=i-a;l&&f&&!(u>=i-a&&c>=i-a)&&(s[c*i+u]=1);}for(let[c,u]of Yo(e,t))for(let l=(u-2)*2-1;l<(u+3)*2+1;l++)for(let f=(c-2)*2-1;f<(c+3)*2+1;f++)f>=0&&l>=0&&f<i&&l<i&&(s[l*i+f]=1);Hg.set(e,s),r=s;}let n=r,o=t*2;return (i,s)=>{let a=Math.floor(i*2),c=Math.floor(s*2);return a>=0&&c>=0&&a<o&&c<o&&n[c*o+a]===1}}function a_(e,t,r=false){let{image:n,size:o,kinds:i,fg:s,bg:a}=e,c=O4.get(e.art.image.data,()=>L4(n)),u=yd(n.width,n.height,o,"cover"),l=o*t,f=new Float32Array(l*l*3).fill(Number.NaN),m=1/(t*u.scale)>1.3?2:1,h=se(a)-.1*(se(a)-se(s)),d=$d(e.version);for(let g=0;g<o;g++)for(let y=0;y<o;y++){let _=i[g*o+y],b=_===nt||_===at;if(!(b&&!r))for(let v=0;v<t;v++)for(let C=0;C<t;C++){let w=0,x=0,E=0;for(let Q=0;Q<m;Q++)for(let F=0;F<m;F++){let W=y+(C+(F+.5)/m)/t,K=g+(v+(Q+.5)/m)/t,U=e_(c,(W-u.offsetX)/u.scale,(K-u.offsetY)/u.scale,a);w+=U[0],x+=U[1],E+=U[2];}let P=m*m,R=[w/P,x/P,E/P],I=y+(C+.5)/t,N=g+(v+.5)/t,O=Math.min(I,N,o-I,o-N);O<1.5&&(R=wr(R,a,.35*(1-O/1.5))),r&&(b||d(I,N))&&(R=Gt(R,a,h,false));let V=((g*t+v)*l+y*t+C)*3;f[V]=R[0],f[V+1]=R[1],f[V+2]=R[2];}}return {n:t,count:l,rgb:f}}function Q4(e,t,r){let{size:n,kinds:o,modules:i,fg:s,bg:a,t:c}=e,{n:u,count:l,rgb:f}=t,p=se(s),m=se(a),h=m-p,d=G4(c,u),g=E=>.2126*f[E]+.7152*f[E+1]+.0722*f[E+2],y=new Float32Array(n*n),_=new Float32Array(n*n);for(let E=0;E<n;E++)for(let P=0;P<n;P++){let R=o[E*n+P];if(R===nt){y[E*n+P]=m;continue}if(R===at){y[E*n+P]=i[E]?.[P]?p:m;continue}let I=0,N=0,O=0;for(let V=0;V<u;V++)for(let Q=0;Q<u;Q++){let F=g(((E*u+V)*l+P*u+Q)*3);I+=F,r.under[V*u+Q]||(N+=F,O++);}y[E*n+P]=I/(u*u),_[E*n+P]=O?N/O:I/(u*u);}let b=n+1,v=new Float64Array(b*b);for(let E=0;E<n;E++)for(let P=0;P<n;P++)v[(E+1)*b+P+1]=y[E*n+P]+v[E*b+P+1]+v[(E+1)*b+P]-v[E*b+P];let C=2,w=(E,P)=>{let R=Math.max(0,E-C),I=Math.max(0,P-C),N=Math.min(n,E+C+1),O=Math.min(n,P+C+1);return (v[O*b+N]-v[I*b+N]-v[O*b+R]+v[I*b+R])/((N-R)*(O-I))},x=r.weight;for(let E=0;E<n;E++)for(let P=0;P<n;P++){let R=o[E*n+P];if(R===nt||R===at)continue;let I=R===Ut,N=(d.margin+(I?.08:0))*h,O=(d.darkCap-(I?.12:0))*h,V=(x*((r.light-r.dark)/2)-N)/(1-x),Q=w(P,E),F=_[E*n+P],W=!!i[E]?.[P],K=0,U=a;if(W){let X=Math.min(Q+V,p+O);F>X&&(K=(F-X)/Math.max(F-p,1e-6),U=s);}else {let X=Math.max(Q-V,m-O);F<X&&(K=(X-F)/Math.max(m-F,1e-6));}if(!(K<=0)){K=Math.min(1,K);for(let X=0;X<u;X++)for(let we=0;we<u;we++){let Me=((E*u+X)*l+P*u+we)*3;for(let ge=0;ge<3;ge++)f[Me+ge]+=(U[ge]-f[Me+ge])*K;}}}}function c_(e,t,r,n){let{count:o}=t,i=new vr;for(let c=0;c<o;c++){let u=0,l=r(c*o);for(let f=1;f<=o;f++){let p=f<o?r(c*o+f):null;(f===o||p!==l)&&(l&&i.cellRun(l,u,c,f-u),u=f,l=p);}}let s=e.pixelSize/t.n,a=$e(e.margin*e.pixelSize);return A("g",{transform:`translate(${a} ${a}) scale(${r_(s)})`,children:i.toElements(n)},n)}function xd(e,t){let r=Yo(e.version,e.size);return r.length===0?[]:[A("path",{d:n_(r,e.margin,e.pixelSize),fill:t,fillRule:"evenodd"},"art-alignment")]}function u_(e){let{image:t,size:r}=e;return Math.floor(Math.min(t.width,t.height)/r)>=4&&r<=45?4:3}var V4=e=>2*_d*Math.sqrt(-2*Math.log(1-Math.min(e,.95)));function j4(e,t,r){let n=t+1,o=new Float64Array(n*n);for(let s=0;s<t;s++)for(let a=0;a<t;a++)o[(s+1)*n+a+1]=e[s*t+a]+o[s*n+a+1]+o[(s+1)*n+a]-o[s*n+a];let i=new Float32Array(t*t);for(let s=0;s<t;s++)for(let a=0;a<t;a++){let c=Math.max(0,a-r),u=Math.max(0,s-r),l=Math.min(t,a+r+1),f=Math.min(t,s+r+1);i[s*t+a]=(o[f*n+l]-o[u*n+l]-o[f*n+c]+o[u*n+c])/((l-c)*(f-u));}return i}function l_(e,t,r,n){let{size:o,kinds:i,modules:s,fg:a,bg:c}=e,u=se(a),l=se(c),f=l-u,p=j4(t,o,2),m=new Float32Array(o*o),h=new Float32Array(o*o).fill(Number.NaN);for(let d=0;d<o;d++)for(let g=0;g<o;g++){let y=d*o+g,_=i[y];if(_===nt||_===at)continue;let b=_===Ut,v=n.base+(b?.08:0),C=(n.margin+(b?.03:0))*f,w=(n.cap-(b?.04:0))*f,x=Wg(v),E=Wg(b?Math.max(n.max,.94):n.max),P=x*((n.dark+n.light)/2)+(1-x)*p[y],R=r[y],I=!!s[d]?.[g],N=I?n.dark:n.light,O=I?Math.min(P-C,u+w):Math.max(P+C,l-w),Q=(I?R<=O:R>=O)?0:(R-O)/(R-N);Q>E&&(Q=E,h[y]=Math.min(l,Math.max(u,(O-E*N)/(1-E))));let F=I?R<=O-.06:R>=O+.06;n.skip&&F&&!b||(Q=Math.max(Q,x)),m[y]=Q>0?V4(Q):0;}return {diameter:m,surround:h}}function q4(e){let{size:t,kinds:r,modules:n,fg:o,bg:i,t:s,margin:a,pixelSize:c}=e,u=u_(e),l=a_(e,u,true),f=se(o),p=se(i),m=f+.1*(p-f),h=p-.05*(p-f),{count:d,rgb:g}=l,y=(w,x,E,P)=>((x*u+P)*d+w*u+E)*3,_=new Float32Array(t*t);for(let w=0;w<t;w++)for(let x=0;x<t;x++){let E=r[w*t+x];if(E===nt||E===at){_[w*t+x]=E===at&&n[w]?.[x]?f:p;continue}let P=0;for(let R=0;R<u;R++)for(let I=0;I<u;I++){let N=y(x,w,I,R);P+=.2126*g[N]+.7152*g[N+1]+.0722*g[N+2];}_[w*t+x]=P/(u*u);}let b=l_(e,_,_,{base:.6-.28*s,max:.86,dark:m,light:h,margin:.2-.1*s,cap:.4+.14*s,skip:false});for(let w=0;w<t;w++)for(let x=0;x<t;x++){let E=b.surround[w*t+x];if(Number.isNaN(E))continue;let P=_[w*t+x],I=E<P?o:i,N=Math.min(1,Math.abs(P-E)/Math.max(Math.abs(P-se(I)),1e-6));for(let O=0;O<u;O++)for(let V=0;V<u;V++){let Q=y(x,w,V,O);for(let F=0;F<3;F++)g[Q+F]+=(I[F]-g[Q+F])*N;}}let v=[c_(e,l,w=>{let x=w*3;return Number.isNaN(g[x])?null:Be([g[x],g[x+1],g[x+2]],8)},"art-photo")],C=new vr;for(let w=0;w<t;w++)for(let x=0;x<t;x++){let E=b.diameter[w*t+x];if(!(E>0))continue;let P=0,R=0,I=0;for(let V=0;V<u;V++)for(let Q=0;Q<u;Q++){let F=y(x,w,Q,V);P+=g[F],R+=g[F+1],I+=g[F+2];}let N=[P/(u*u),R/(u*u),I/(u*u)],O=n[w]?.[x]?Gt(N,o,m,true):Gt(N,i,h,false);C.circle(Be(O,10),(x+a+.5)*c,(w+a+.5)*c,E/2*c);}return v.push(...C.toElements("art-dot"),...xd(e,Be(o))),v}function W4(e){let{size:t,kinds:r,modules:n,fg:o,bg:i}=e,s=u_(e),a=a_(e,s),c=se(o),u=se(i),l=s%2===1?1:2,f=(s-l)/2,p=P=>P>=f&&P<f+l,m=[];for(let P=0;P<s;P++)for(let R=0;R<s;R++)m.push(p(R)&&p(P));Q4(e,a,{weight:z4(l/s),dark:c,light:u,under:m});let{count:h,rgb:d}=a,g=new Float32Array(h*h),y=new Int8Array(h*h).fill(-1);for(let P=0;P<h*h;P++){let R=P*3;if(Number.isNaN(d[R])){g[P]=Number.NaN;continue}let I=(.2126*d[R]+.7152*d[R+1]+.0722*d[R+2]-c)/(u-c);g[P]=.5+(N4(0,1,I)-.5)*1.15;}for(let P=0;P<t;P++)for(let R=0;R<t;R++){let I=r[P*t+R];if(!(I===nt||I===at))for(let N=f;N<f+l;N++)for(let O=f;O<f+l;O++)y[(P*s+N)*h+R*s+O]=n[P]?.[R]?0:1;}let _=$d(e.version);for(let P=0;P<h;P++)for(let R=0;R<h;R++){let I=P*h+R;y[I]<0&&_((R+.5)/s,(P+.5)/s)&&(y[I]=1);}let b=new Uint8Array(h*h),v=.3,C=0,w=0,x=(P,R,I)=>{if(P<0||P>=h||R>=h)return;let N=R*h+P;if(!Number.isNaN(g[N])){let O=Math.floor(P/s)===Math.floor(C/s)&&Math.floor(R/s)===Math.floor(w/s);g[N]+=O?I:I*v;}};for(let P=0;P<h;P++){let R=P%2===0?1:-1;for(let I=0;I<h;I++){let N=R===1?I:h-1-I,O=P*h+N,V=g[O];if(Number.isNaN(V))continue;let Q=y[O]>=0?y[O]:V>=.5?1:0;b[O]=Q===0?1:0;let F=Math.min(.75,Math.max(-0.75,V-Q));C=N,w=P,x(N+R,P,F*7/16),x(N-R,P+1,F*3/16),x(N,P+1,F*5/16),x(N+R,P+1,F/16);}}let E=Be(o);return [c_(e,a,P=>b[P]?E:null,"art-halftone"),...xd(e,E)]}function Kg(e,t){let r=null,n=0;for(let o of e.palette){if(t&&M4(o.color,t)<.02)continue;let i=o.area*(.35+Xg(o.color))*(se(o.color)>.86?.05:1);i>n&&(n=i,r=o.color);}return r}function f_(e,t,r,n,o){let i;if(e.photographic){let s=new vr,{width:a,height:c,rgb:u,alpha:l}=t;for(let f=0;f<c;f++){let p=0,m=null;for(let h=0;h<=a;h++){let d=f*a+h,g=h<a&&l[d]>=.5?Be(n([u[d*3],u[d*3+1],u[d*3+2]]),6):null;(h===a||g!==m)&&(m&&s.cellRun(m,p,f,h-p),p=h,m=g);}}i=s.toElements(`${o}-px`);}else i=e.layers.map((s,a)=>A("path",{d:s.d,fill:Be(n(s.color)),fillRule:"evenodd"},`${o}-${a}`));return A("g",{transform:`translate(${$e(r.x)} ${$e(r.y)}) scale(${r_(r.scale)})`,children:i},o)}function H4(e){let{art:t,image:r,size:n,kinds:o,modules:i,fg:s,bg:a,t:c,margin:u,pixelSize:l}=e,f=bd(t,r),p=t_(t,r,f),m=yd(f.width,f.height,n,"contain"),h=Math.min(1,.3+1.4*c),d=F=>wr(a,F,h),g=Be(a),y=Be(s),_=[f_(f,p,{x:(u+m.offsetX)*l,y:(u+m.offsetY)*l,scale:m.scale*l},d,"art-logo")],b=s_,v=(F,W)=>xr((F+u)*l,(W+u)*l,(b+.4)*l,(b+.4)*l,1.2*l),C=Yo(e.version,n).map(([F,W])=>xr((F-2.5+u)*l,(W-2.5+u)*l,6*l,6*l,l*.8)).join("");_.push(A("path",{d:v(-0.4,-0.4)+v(n-b,-0.4)+v(-0.4,n-b)+C,fill:g},"art-plates"));let w=$d(e.version),x=se(a),E=se(s),P=new Float32Array(n*n),R=new Float32Array(n*n),I=new Array(n*n);for(let F=0;F<n;F++)for(let W=0;W<n;W++){let K=F*n+W,U=o[K];if(U===nt||U===at){P[K]=U===at&&i[F]?.[W]?E:x;continue}let X=1,we=0,Me=0,ge=0,me=0;for(let Ae=0;Ae<4;Ae++)for(let J=0;J<4;J++){let Pt=W+(J+.5)/4,Un=F+(Ae+.5)/4,ut=w(Pt,Un)?a:e_(p,(Pt-m.offsetX)/m.scale,(Un-m.offsetY)/m.scale,a,h),Gn=se(ut);X=Math.min(X,Gn),we+=Gn,Me+=ut[0],ge+=ut[1],me+=ut[2];}P[K]=we/16,R[K]=X,I[K]=[Me/16,ge/16,me/16];}let N=E+.08*(x-E),O=x-.04*(x-E),V=l_(e,P,P,{base:.74-.26*c,max:.9,dark:N,light:O,margin:.23-.1*c,cap:.4+.1*c,skip:c>=.7}),Q=new vr;for(let F=0;F<n;F++)for(let W=0;W<n;W++){let K=F*n+W,U=V.diameter[K],X=!!i[F]?.[W];if(!(U>0)||!X&&R[K]>=x-.02)continue;let we=X?Gt(I[K],s,N,true):Gt(I[K],a,O,false);Q.circle(Be(we,8),(W+u+.5)*l,(F+u+.5)*l,U/2*l);}return _.push(...Q.toElements("art-dot")),_.push(...xd(e,y)),_}var K4={L:.5,M:.72,Q:.88,H:1},p_=.32,m_=.55,J4=.6,X4=2;function d_(e,t,r){let n=t>=1?e:e*t,o=t>=1?e/t:e,i=Math.max(.7,e*.09),s=n+2*i,a=o+2*i;return {logoW:n,logoH:o,plateW:s,plateH:a,radius:Math.min(s,a)*.26,cx:r/2,cy:r/2}}var h_=e=>({cx:e.cx,cy:e.cy,w:e.plateW,h:e.plateH,r:e.radius});function g_(e,t,r){return y_(t+.5,r+.5,e)<m_}function Y4(e,t){let r=h_(e),n=m_+1,o=Math.max(0,Math.floor(e.cx-e.plateW/2-n)),i=Math.min(t-1,Math.ceil(e.cx+e.plateW/2+n)),s=Math.max(0,Math.floor(e.cy-e.plateH/2-n)),a=Math.min(t-1,Math.ceil(e.cy+e.plateH/2+n)),c=[];for(let u=s;u<=a;u++)for(let l=o;l<=i;l++)g_(r,l,u)&&c.push(u*t+l);return c}var e6=e=>Math.floor(e.correctable*J4);function dd(e,t,r){let n=d_(e,t,r.size),o=e6(r);return Ra(r,Y4(n,r.size)).every(i=>i<=o)}function __(e,t,r){if(dd(r,t,e))return r;let n=0,o=r;if(!dd(n,t,e))return -1;for(;o-n>1/64;){let i=(n+o)/2;dd(i,t,e)?n=i:o=i;}return n}var Na=new Map;function t6(e,t){let r=`${e.version}${e.level}:${t.toFixed(3)}`,n=Na.get(r);return n===void 0&&(n=__(e,t,p_*e.size),Na.size>=64&&Na.clear(),Na.set(r,n)),n}function r6(e,t){let{size:r,t:n,modules:o,version:i}=e,s=R4(o),a=(.18+.15*n)*K4[s],c=t.width/t.height,u=Math.min(p_,a)*r,l=Ea(i,s),f=Math.max(0,t6(l,c));if(f<X4)return {wantedBox:u,maxBox:f,box:0,plate:null};let p=__(l,c,Math.min(u,f));return p<0?{wantedBox:u,maxBox:f,box:0,plate:null}:{wantedBox:u,maxBox:f,box:p,plate:d_(p,c,r)}}function y_(e,t,r){let n=Math.abs(e-r.cx)-(r.w/2-r.r),o=Math.abs(t-r.cy)-(r.h/2-r.r);return Math.hypot(Math.max(n,0),Math.max(o,0))+Math.min(Math.max(n,o),0)-r.r}function b_(e,t){let{fg:r,bg:n,t:o}=e,i=se(r),s=se(n),a=Kg(t),c=Math.min(1,o/.6),u=a?Gt(a,r,i+.3*(s-i),true):r,l=wr(r,u,c),f=a?Kg(t,a):null,p=i+.42*(s-i),m=f&&se(f)<=p+.22?wr(r,Gt(f,r,p,true),c):l;return {body:l,inner:m}}function n6(e){let{art:t,image:r,size:n,kinds:o,modules:i,bg:s,margin:a,pixelSize:c,version:u}=e,l=bd(t,r),f=r6(e,l).plate,{body:p}=b_(e,l),m=Be(p),h=f&&h_(f),d=i.map(I=>[...I]);for(let I=0;I<n;I++)for(let N=0;N<n;N++){let O=o[I*n+N];(O===at||h&&O!==nt&&g_(h,N,I))&&(d[I][N]=false);}let g=[],y=e.body?.(d);if(y)g.push(A("g",{fill:m,children:y},"art-body"));else {let I=new vr;for(let N=0;N<n;N++)for(let O=0;O<n;O++)d[N]?.[O]&&o[N*n+O]!==nt&&I.circle(m,(O+a+.5)*c,(N+a+.5)*c,.45*c);g.push(...I.toElements("art-body"));}let _=Yo(u,n).filter(([I,N])=>!h||y_(I+.5,N+.5,h)>3.2);if(_.length>0&&g.push(A("path",{d:n_(_,a,c),fill:m,fillRule:"evenodd"},"art-alignment")),!f)return g;let b=t_(t,r,l),v=(f.cx-f.plateW/2+a)*c,C=(f.cy-f.plateH/2+a)*c,w=f.plateW*c,x=f.plateH*c,E=f.radius*c,P=.1*c,R=xr(v,C,w,x,E);return g.push(A("path",{d:R,fill:Be(s)},"art-plate"),A("path",{d:R+xr(v+P,C+P,w-2*P,x-2*P,E-P),fill:Be(wr(s,p,.16)),fillRule:"evenodd"},"art-plate-ring"),f_(l,b,{x:(f.cx-f.logoW/2+a)*c,y:(f.cy-f.logoH/2+a)*c,scale:f.logoW/l.width*c},I=>I,"art-logo")),g}function $_(e){let{art:t}=e;if(t.mode!=="logo"||t.matchEyes===false)return null;let r=t.image&&hd(t.image);if(!r)return null;let n=La(e.fgColor,[0,0,0]),o=La(e.bgColor,[1,1,1]),i=o_(t,n,o);if(i<=0)return null;let s=bd(t,r);if(s.palette.length===0)return null;if(gd(t)==="badge"){let{body:h,inner:d}=b_({fg:n,bg:o,t:i},s),g={outer:Be(h),inner:Be(d)};return {topLeft:g,topRight:g,bottomLeft:g}}let a=se(n),c=se(o),u=Math.min(1,i/.6),l=e.version*4+17,f=yd(s.width,s.height,l,"contain"),p=.45*Math.max(s.width,s.height),m=(h,d)=>{let g=(h-f.offsetX)/f.scale,y=(d-f.offsetY)/f.scale,_=null,b=0;for(let C of s.palette){if(se(C.color)>.86)continue;let w=(C.cx-g)**2+(C.cy-y)**2,x=C.area*(.35+Xg(C.color))*Math.exp(-w/(2*p**2));x>b&&(b=x,_=C.color);}if(!_)return {};let v=Gt(_,n,a+.42*(c-a),true);return {inner:Be(wr(n,v,u))}};return {topLeft:m(3.5,3.5),topRight:m(l-3.5,3.5),bottomLeft:m(3.5,l-3.5)}}function ne(e){if(e.length===0)return "";let[t,...r]=e;return `M${$(t[0])} ${$(t[1])}${r.map(([n,o])=>`L${$(n)} ${$(o)}`).join("")}Z`}function oe(e,t,r){return `M${$(e-r)} ${$(t)}A${$(r)} ${$(r)} 0 1 1 ${$(e+r)} ${$(t)}A${$(r)} ${$(r)} 0 1 1 ${$(e-r)} ${$(t)}Z`}function Z(e,t,r,n,o=0){let i=Math.min(r,n)/2,[s,a,c,u]=(typeof o=="number"?[o,o,o,o]:o).map(f=>Math.max(0,Math.min(f,i))),l=(f,p,m)=>f>0?`A${$(f)} ${$(f)} 0 0 1 ${$(p)} ${$(m)}`:"";return `M${$(e+s)} ${$(t)}H${$(e+r-a)}${l(a,e+r,t+a)}V${$(t+n-c)}${l(c,e+r-c,t+n)}H${$(e+u)}${l(u,e,t+n-u)}V${$(t+s)}${l(s,e+s,t)}Z`}function zn(e,t,r,n,o=-90){return Array.from({length:n},(i,s)=>{let a=(o+360/n*s)*Math.PI/180;return [e+r*Math.cos(a),t+r*Math.sin(a)]})}function Nn(e,t,r,n,o=5){return Array.from({length:o*2},(i,s)=>{let a=s%2===0?r:n,c=-Math.PI/2+Math.PI/o*s;return [e+a*Math.cos(c),t+a*Math.sin(c)]})}function ei(e,t,r,n,o=4,i=64){return Array.from({length:i},(s,a)=>{let c=2*Math.PI*a/i,u=Math.cos(c),l=Math.sin(c);return [e+r*Math.sign(u)*Math.abs(u)**(2/o),t+n*Math.sign(l)*Math.abs(l)**(2/o)]})}function Ln(e,t,r){let n=r/2,o=(i,s)=>`${$(e+i*n)} ${$(t+s*n)}`;return `M${o(0,-0.52)}C${o(.18,-0.92)} ${o(.98,-0.94)} ${o(1,-0.34)}C${o(1,.12)} ${o(.5,.48)} ${o(0,.92)}C${o(-0.5,.48)} ${o(-1,.12)} ${o(-1,-0.34)}C${o(-0.98,-0.94)} ${o(-0.18,-0.92)} ${o(0,-0.52)}Z`}function x_(e,t,r,n){if(n===0)return e;let o=n*Math.PI/180,i=Math.cos(o),s=Math.sin(o);return e.map(([a,c])=>[t+(a-t)*i-(c-r)*s,r+(a-t)*s+(c-r)*i])}function Oa(e,t,r=0){let n=Math.imul(e+2654435769,2246822507)^Math.imul(t+r,3266489909);return n=Math.imul(n^n>>>15,739982445),n=Math.imul(n^n>>>12,695872825),n^=n>>>15,(n>>>0)/4294967296}function Sr(e){let t=2166136261;for(let r=0;r<e.length;r++)t^=e.charCodeAt(r),t=Math.imul(t,16777619);return (t>>>0).toString(36)}var o6=["horizontal-line","liquid","liquid-horizontal","liquid-vertical","classy","classy-rounded","leaf","plus","hexagon","star","heart","random-dots","mosaic","octagon"];function w_(e){return o6.includes(e)}var i6={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 wd(e,t){if(e===void 0||!Number.isFinite(e))return 1;let r=t?i6[t]??1:Aa;return Math.min(ld,Math.max(Aa,r,e))}function s6(e,t,r){return e<7&&t<7||e>=r-7&&t<7||e<7&&t>=r-7}function a6(e,t){if(e===1)return [];let r=Math.floor(e/7)+2,n=e===32?26:Math.ceil((e*4+4)/(r*2-2))*2,o=[6];for(let i=t-7;o.length<r;i-=n)o.splice(1,0,i);return o}function vd(e){let t=(e-17)/4,r=Number.isInteger(t)?a6(t,e):[],n=r.length-1,o=[];for(let[i,s]of r.entries())for(let[a,c]of r.entries())i===0&&a===0||i===0&&a===n||i===n&&a===0||o.push([s,c]);return (i,s)=>o.some(([a,c])=>Math.abs(i-a)<=2&&Math.abs(s-c)<=2)}var c6={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 u6(e,t,r,n,o,i){switch(e){case "horizontal-line":{let s=n*.43;return Z(t-n/2,r-s,n,2*s)}case "leaf":{let s=n*.5;return Z(t-s,r-s,2*s,2*s,[n*.4,n*.05,n*.4,n*.05])}case "plus":{let s=n*.22,a=n*.5;return ne([[t-s,r-a],[t+s,r-a],[t+s,r-s],[t+a,r-s],[t+a,r+s],[t+s,r+s],[t+s,r+a],[t-s,r+a],[t-s,r+s],[t-a,r+s],[t-a,r-s],[t-s,r-s]])}case "hexagon":return ne(zn(t,r,n*.54,6));case "star":return ne(Nn(t,r+n*.04,n*.62,n*.34));case "heart":return Ln(t,r+n*.02,n*1.08);case "random-dots":return oe(t,r,n*(.38+.15*Oa(o,i)));case "mosaic":{let s=n*(.8+.14*Oa(o,i,1))/2,a=[[t-s,r-s],[t+s,r-s],[t+s,r+s],[t-s,r+s]];return ne(x_(a,t,r,(Oa(o,i,2)-.5)*16))}case "octagon":return ne(zn(t,r,n*.48/Math.cos(Math.PI/8),8,22.5));default:return oe(t,r,n*.45)}}function v_(e,t){let{margin:r,pixelSize:n,pattern:o}=t,i=wd(t.scale,o),s=e.length,a=t.plain?()=>false:vd(s),c=(d,g)=>!t.plain&&s6(d,g,s),u=(d,g)=>d>=0&&g>=0&&d<s&&g<s&&!!e[g]?.[d]&&!c(d,g),l=d=>(d+.5+r)*n,f=[],p=[],m=c6[o];for(let d=0;d<s;d++)for(let g=0;g<s;g++){if(!u(g,d))continue;let y=l(g),_=l(d);if(a(g,d)){f.push(M`M${y-n/2} ${_-n/2}h${n}v${n}h${-n}z`);continue}if(!m){p.push(u6(o,y,_,n*i,g,d));continue}let b=n*m.thickness*i/2,v=m.horizontal&&u(g+1,d),C=m.horizontal&&u(g-1,d),w=m.vertical&&u(g,d-1),x=m.vertical&&u(g,d+1),P=[!(w||C),!(w||v),!(x||v),!(x||C)].map((R,I)=>R?b*m.radius(I):0);p.push(Z(y-b,_-b,2*b,2*b,P)),2*b<n&&(v&&p.push(Z(y,_-b,n,2*b)),x&&p.push(Z(y-b,_,2*b,n)));}if(m?.fillets&&i===1){let d=n*.3;for(let g=0;g<s;g++)for(let y=0;y<s;y++){if(u(y,g)||c(y,g))continue;let _=l(y)-n/2,b=l(g)-n/2,v=_+n,C=b+n;u(y-1,g)&&u(y,g-1)&&u(y-1,g-1)&&p.push(M`M${_} ${b}h${d}A${d} ${d} 0 0 0 ${_} ${b+d}Z`),u(y+1,g)&&u(y,g-1)&&u(y+1,g-1)&&p.push(M`M${v} ${b}v${d}A${d} ${d} 0 0 0 ${v-d} ${b}Z`),u(y+1,g)&&u(y,g+1)&&u(y+1,g+1)&&p.push(M`M${v} ${C}h${-d}A${d} ${d} 0 0 0 ${v} ${C-d}Z`),u(y-1,g)&&u(y,g+1)&&u(y-1,g+1)&&p.push(M`M${_} ${C}v${-d}A${d} ${d} 0 0 0 ${_+d} ${C}Z`);}}let h=[];return p.length>0&&h.push(A("path",{d:p.join("")},"modules")),f.length>0&&h.push(A("path",{d:f.join("")},"alignment")),h}var S_=24,Qt=(e,t,r,n)=>{let o=n*Math.PI/180;return [e+r*Math.cos(o),t+r*Math.sin(o)]},Ta=([e,t])=>`${$(e)} ${$(t)}`;function On(e,t,r,n,o,i){let s=i-o>180?1:0;return `M${Ta(Qt(e,t,n,o))}A${$(n)} ${$(n)} 0 ${s} 1 ${Ta(Qt(e,t,n,i))}L${Ta(Qt(e,t,r,i))}A${$(r)} ${$(r)} 0 ${s} 0 ${Ta(Qt(e,t,r,o))}Z`}function ti(e,t,r,n){return `M${$(e-r)} ${$(t)}A${$(r)} ${$(n)} 0 1 1 ${$(e+r)} ${$(t)}A${$(r)} ${$(n)} 0 1 1 ${$(e-r)} ${$(t)}Z`}function l6(e){let t=0;return e.forEach(([r,n],o)=>{let[i,s]=e[(o+1)%e.length];t+=r*s-i*n;}),t/2}function C_(e){return ne(l6(e)<0?[...e].reverse():e)}function Fa(e,t,r,n,o){let i=Math.hypot(r-e,n-t)||1,s=-(n-t)/i*(o/2),a=(r-e)/i*(o/2);return C_([[e+s,t+a],[r+s,n+a],[r-s,n-a],[e-s,t-a]])}var Ue=(...e)=>({d:e.join(""),fillRule:"nonzero"}),xt=(...e)=>({d:e.join(""),fillRule:"evenodd"});function f6(){let e=[];for(let t of [0,60,120]){let[r,n]=Qt(12,12,10.5,t+180),[o,i]=Qt(12,12,10.5,t);e.push(Fa(r,n,o,i,2));}for(let t=0;t<6;t++){let r=t*60,[n,o]=Qt(12,12,6.2,r);for(let i of [-45,45]){let[s,a]=Qt(n,o,3.6,r+i);e.push(Fa(n,o,s,a,1.7));}}return Ue(...e)}var p6={wifi:()=>Ue(On(12,20,4.6,7.2,-135,-45),On(12,20,9.2,11.8,-135,-45),On(12,20,13.8,16.4,-135,-45),oe(12,20,2.2)),star:()=>Ue(ne(Nn(12,12.8,11.6,4.8))),heart:()=>Ue(Ln(12,12.4,22)),phone:()=>xt(Z(6,1.5,12,21,2.6),Z(7.8,4.2,8.4,13.4,.6),oe(12,19.8,1.1)),headphones:()=>Ue(On(12,13,7.6,9.8,-180,0),Z(2,12,5,9.5,2),Z(17,12,5,9.5,2)),calendar:()=>xt(Z(2.5,4,19,17.5,2.5),Z(4.6,9,14.8,10.6,.8),Z(7,11.4,2.6,2.6,.4),Z(10.7,11.4,2.6,2.6,.4),Z(14.4,11.4,2.6,2.6,.4),Z(7,15.1,2.6,2.6,.4),Z(10.7,15.1,2.6,2.6,.4),Z(6.5,1.4,2.4,2.6,[1.2,1.2,0,0]),Z(15.1,1.4,2.4,2.6,[1.2,1.2,0,0])),user:()=>Ue(oe(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:()=>xt(Z(2,3,20,14,4),ne([[6.5,17],[11.5,17],[5.8,21.8]]),oe(7.5,10,1.5),oe(12,10,1.5),oe(16.5,10,1.5)),bag:()=>Ue(Z(3.5,7.5,17,14.5,2),On(12,7.5,3.1,4.8,-180,0)),bell:()=>Ue("M3.5 17.2A8.5 8.5 0 0 1 20.5 17.2Z",Z(1.5,18.2,21,2.6,1.3),Z(11.2,6.6,1.6,2.6,0),Z(9.8,4.6,4.4,2.4,1.2)),cup:()=>Ue("M4 6.5H17V13.5A6.5 6.5 0 0 1 4 13.5Z",On(17,10.2,1.7,3.6,-90,90),Z(2,20.6,17,2,1),Z(7,1.6,1.6,3.4,.8),Z(11.6,1.6,1.6,3.4,.8)),card:()=>xt(Z(1.5,4.5,21,15,2.5),Z(1.5,8,21,3,0),Z(4.5,13.6,4.6,3.2,.6)),check:()=>xt(oe(12,12,10.5),ne([[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:()=>xt(oe(12,12,10.5),oe(12,7.2,1.6),Z(10.6,10,2.8,8,.8)),home:()=>xt(ne([[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]]),Z(10,14.5,4,7,[.6,.6,0,0])),pin:()=>xt("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",oe(12,9.5,3)),share:()=>Ue(Fa(6,12,18,5,1.8),Fa(6,12,18,19,1.8),oe(18,5,3.2),oe(6,12,3.2),oe(18,19,3.2)),download:()=>Ue(Z(10.6,2,2.8,9.5,0),ne([[6,10],[18,10],[12,16.5]]),ne([[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:()=>xt(oe(12,12,10.5),oe(12,12,8.4),ne([[11,5.4],[13,5.4],[13,11.3],[16.9,13.5],[15.9,15.2],[11,12.5]])),snowflake:f6,pumpkin:()=>Ue(ti(7.8,14.6,5.8,6.9),ti(16.2,14.6,5.8,6.9),ti(12,14.6,4.8,7.4),Z(10.9,3.4,2.2,4.6,.8),C_([[13,4.2],[17.2,3],[16.2,5.4],[13,6]])),tree:()=>Ue(ne([[12,1.5],[16.8,8.2],[7.2,8.2]]),ne([[12,5.2],[19,13.6],[5,13.6]]),ne([[12,9.4],[21.2,19.2],[2.8,19.2]]),Z(10.4,18.6,3.2,3.9,.4)),sparkle:()=>Ue(ne(Nn(9.5,13.5,9,2.4,4)),ne(Nn(19,5,4,1.1,4))),gift:()=>Ue(Z(3,11.2,7.8,10.6,1),Z(13.2,11.2,7.8,10.6,1),Z(2,7.4,8.8,3.2,1),Z(13.2,7.4,8.8,3.2,1),ti(8.8,4.8,2.9,1.9),ti(15.2,4.8,2.9,1.9))};function P_(e){return p6[e]()}function k_(e){return e===" "?.3:/[MWmw@%]/.test(e)?.92:/[A-Z0-9#&]/.test(e)?.72:/[il.,:;!'|1]/.test(e)?.32:.6}function Cd(e){let t=0;for(let r of e)t+=k_(r);return Math.max(t,1)}var Sd=e=>Math.round(Math.min(255,Math.max(0,e))).toString(16).padStart(2,"0");function Da(e,t,r){let n=Re(e)??{r:0,g:0,b:0},o=Re(t)??{r:255,g:255,b:255},i=Math.min(1,Math.max(0,r));return `#${Sd(n.r+(o.r-n.r)*i)}${Sd(n.g+(o.g-n.g)*i)}${Sd(n.b+(o.b-n.b)*i)}`}function A_(e,t,r,n,o,i,s,a){let c=[...e],u=o*.08,l=c.map(d=>k_(d)*o),f=l.reduce((d,g)=>d+g,0)+u*Math.max(0,c.length-1),p=i==="top"?n-o*.35:n+o*.35,m=[],h=0;return c.forEach((d,g)=>{let y=l[g],_=(h+y/2)/p;if(h+=y+u,d.trim()==="")return;let b=i==="top"?-Math.PI/2-f/2/p+_:Math.PI/2+f/2/p-_;m.push({text:d,x:t+p*Math.cos(b),y:r+p*Math.sin(b),fontSize:o,maxWidth:o*2,color:s,rotate:b*180/Math.PI+(i==="top"?90:-90),field:a});}),m}var Za=class extends Error{issues;constructor(t){super(`Invalid frame spec: ${t.slice(0,5).join("; ")}`),this.name="FrameSpecError",this.issues=t;}},E_=new WeakMap;function Pd(e){if(e&&typeof e=="object"){let r=E_.get(e);if(r)return r}if(e==null)throw new Za(['A "custom" frame needs a spec']);let t=cd.safeParse(e);if(!t.success)throw new Za(t.error.issues.map(r=>r.path.length>0?`${r.path.join(".")}: ${r.message}`:r.message));return typeof e=="object"&&E_.set(e,t.data),t.data}var m6=e=>{let t=Re(e);return !!(t&&t.a>=1)};function d6(e,t){let r=Ve(t,Ie);return m6(r)?{color:r,plate:true}:e.qr.plate==="background"?{color:r,plate:false}:{color:Ie,plate:true}}function M_(e,t,r=Ie){let n=t.color||e.colors.frame,o=t.secondaryColor||e.colors.accent||n,i=c=>c==="frame"?n:c==="accent"?o:c==="background"?r:c,s=e.colors.text,a=t.textColor||(s===void 0?n:typeof s=="string"?s:Da(i(s.mix[0]),i(s.mix[1]),s.amount));return {frame:n,text:a,accent:o}}function h6(e,t,r){let n=M_(t,e,r),o=i=>{switch(i){case "frame":return n.frame;case "text":return n.text;case "accent":return n.accent;case "background":return r;default:return i}};return i=>typeof i=="string"?o(i):Da(o(i.mix[0]),o(i.mix[1]),i.amount)}function R_(e,t,r=0,n=0){let o=Vo(e);return o?Hm(o,t,r,n):""}function g6(e,t,r,n){return `M${$(e-r)} ${$(t)}A${$(r)} ${$(n)} 0 1 1 ${$(e+r)} ${$(t)}A${$(r)} ${$(n)} 0 1 1 ${$(e-r)} ${$(t)}Z`}function _6(e,t){let[r,n,o,i]=[e.x1*t,e.y1*t,e.x2*t,e.y2*t],s=Math.hypot(o-r,i-n),a=e.width*t/2,c=s>0?(o-r)/s:1,u=s>0?(i-n)/s:0,l=-u*a,f=c*a,p=(g,y)=>{let _=[r+c*g,n+u*g],b=[r+c*y,n+u*y];if(e.cap==="round"&&y-g>2*a){let v=[_[0]+c*a,_[1]+u*a],C=[b[0]-c*a,b[1]-u*a];return `M${$(v[0]-l)} ${$(v[1]-f)}L${$(C[0]-l)} ${$(C[1]-f)}A${$(a)} ${$(a)} 0 0 1 ${$(C[0]+l)} ${$(C[1]+f)}L${$(v[0]+l)} ${$(v[1]+f)}A${$(a)} ${$(a)} 0 0 1 ${$(v[0]-l)} ${$(v[1]-f)}Z`}return `M${$(_[0]-l)} ${$(_[1]-f)}L${$(b[0]-l)} ${$(b[1]-f)}L${$(b[0]+l)} ${$(b[1]+f)}L${$(_[0]+l)} ${$(_[1]+f)}Z`};if(!e.dash)return {type:"path",d:p(0,s),fillRule:"nonzero"};let m=e.dash[0]*t,h=m+e.dash[1]*t,d=[];for(let g=0;g+m<=s+1e-6;g+=h)d.push(p(g,g+m));return {type:"path",d:d.join(""),fillRule:"nonzero"}}function y6(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:oe(e.cx*t,e.cy*t,e.r*t)+(e.hole?oe(e.cx*t,e.cy*t,e.hole*t):""),fillRule:e.hole?"evenodd":"nonzero"};case "ellipse":return {type:"path",d:g6(e.cx*t,e.cy*t,e.rx*t,e.ry*t),fillRule:"nonzero"};case "polygon":return {type:"polygon",points:e.points.map(([r,n])=>[r*t,n*t])};case "path":return {type:"path",d:R_(e.d,t),fillRule:e.fillRule??"nonzero"};case "line":return _6(e,t);default:{let r=P_(e.icon);return {type:"path",d:R_(r.d,e.size*t/S_,e.x*t,e.y*t),fillRule:r.fillRule}}}}function b6(e){if(e.type==="rect"){let{x:t,y:r,width:n,height:o,radius:i,hole:s}=e;return [...Rn(t,r,n,o,i,i),...s?Rn(s.x,s.y,s.width,s.height,s.radius,s.radius):[]]}return e.type==="polygon"?[...e.points.map(([t,r],n)=>n===0?{op:"M",x:t,y:r}:{op:"L",x:t,y:r}),{op:"Z"}]:gr(e.d)}function $6(e,t,r){let n=b6(e),o=vg(n,.2),i=e.type==="rect"?e.hole?"evenodd":"nonzero":e.type==="path"?e.fillRule??"nonzero":"nonzero",s=t.direction==="vertical",a=g=>s?g[1]:g[0],c=Number.POSITIVE_INFINITY,u=Number.NEGATIVE_INFINITY;for(let g of o)for(let y of g)c=Math.min(c,a(y)),u=Math.max(u,a(y));if(!(u>c))return [];let l=t.steps??32,f=r(t.from),p=r(t.to),m=u-c,h=m*.002,d=[];for(let g=0;g<l;g++){let y=c+m*g/l,_=Math.min(u,c+m*(g+1)/l+(g+1<l?h:0)),b=s?{x0:Number.NEGATIVE_INFINITY,x1:Number.POSITIVE_INFINITY,y0:y,y1:_}:{x0:y,x1:_,y0:Number.NEGATIVE_INFINITY,y1:Number.POSITIVE_INFINITY},v=o.map(C=>$a(C,b)).filter(C=>C.length>2);v.length!==0&&d.push({type:"path",d:Sg(v),fill:Da(f,p,(g+.5)/l),fillRule:i});}return d}function x6(e,t,r){let n=y6(e,t);return typeof e.fill=="object"&&"gradient"in e.fill?$6(n,e.fill.gradient,r):[{...n,fill:r(e.fill)}]}function w6(e,t){let r=Math.min(e.maxLength??Se.maxTextLength,Se.maxTextLength),n=e.slot==="primary"?t.text??e.text:e.slot==="secondary"?t.secondaryText??e.text:e.text;return Ho(n,r)}function v6(e){return e===void 0||!Number.isFinite(e)?1:Math.min(An,Math.max(jm,e))}function S6(e,t,r,n,o,i){let s=o(e.color),a=e.weight==="regular"?{fontWeight:400}:{};if(e.type==="curved"){let{cx:d,cy:g,radius:y,side:_,spread:b=140}=e.curve,v=y*n*(b*Math.PI/180),C=Math.min(e.fontSize*n*r,v/(Cd(t)+.08*t.length));return A_(t,d*n,g*n,y*n,C,_,s,i).map(w=>({...w,...a}))}let c=e.box.x*n,u=e.box.y*n,l=e.box.width*n,f=e.box.height*n;if(!(f>0))return [];let p=(e.fontSize??e.box.height*sd)*n,m=Math.min(p*r,f*Pa,l/Cd(t)),h=e.align??"middle";return [{text:t,x:h==="start"?c:h==="end"?c+l:c+l/2,y:u+f/2+m*.35,fontSize:m,maxWidth:l,color:s,...h!=="middle"&&{align:h},...a,field:i}]}function C6(e){let t=0,r=0,n=0,o=0;return e.map(({command:i,values:s})=>{let a=i.toUpperCase(),c=i!==a;switch(a){case "Z":return t=n,r=o,{command:"Z",values:[]};case "H":return t=(c?t:0)+s[0],{command:"H",values:[t]};case "V":return r=(c?r:0)+s[0],{command:"V",values:[r]};case "A":return t=(c?t:0)+s[5],r=(c?r:0)+s[6],{command:"A",values:[...s.slice(0,5),t,r]};default:{let u=s.map((l,f)=>c?l+(f%2===0?t:r):l);return t=u.at(-2),r=u.at(-1),a==="M"&&(n=t,o=r),{command:a,values:u}}}})}function P6(e,t){let r=Vo(e);return r?Hm(C6(r).map(({command:n,values:o})=>n==="V"?{command:n,values:[t(o[0])]}:n==="H"||n==="Z"?{command:n,values:o}:n==="A"?{command:n,values:[...o.slice(0,6),t(o[6])]}:{command:n,values:o.map((i,s)=>s%2===1?t(i):i)})):e}function k6(e,t){let r=(n,o)=>{let i=t(n);return {y:i,height:t(n+o)-i}};switch(e.type){case "rect":return {...e,...r(e.y,e.height),...e.hole&&{hole:{...e.hole,...r(e.hole.y,e.hole.height)}}};case "circle":case "ellipse":return {...e,cy:t(e.cy)};case "polygon":return {...e,points:e.points.map(([n,o])=>[n,t(o)])};case "path":return {...e,d:P6(e.d,t)};case "line":return {...e,y1:t(e.y1),y2:t(e.y2)};default:return {...e,y:t(e.y)}}}function A6(e,t){if(t.length===0)return e;let r=o=>{let i=o;for(let s of t)i-=Math.min(Math.max(o-s.y,0),s.height);return i},n=(o,i)=>t.some(s=>o>=s.y-1e-6&&i<=s.y+s.height+1e-6);return {...e,artboard:{...e.artboard,height:r(e.artboard.height)},qr:{...e.qr,y:r(e.qr.y)},shapes:e.shapes.filter(o=>{let{bounds:i}=ad(o);return !(i&&n(i.y0,i.y1))}).map(o=>k6(o,r)),labels:e.labels.map(o=>{if(o.type==="curved")return {...o,curve:{...o.curve,cy:r(o.curve.cy)}};let i=r(o.box.y);return {...o,box:{...o.box,y:i,height:r(o.box.y+o.box.height)-i}}})}}function kd(e,t,r,n,o={}){let i=new Map(t.labels.map(g=>[g.id,w6(g,r)])),s=A6(t,t.labels.flatMap(g=>g.collapse&&!i.get(g.id)?[g.collapse]:[])),a=e/s.qr.size,c=d6(s,n),u=h6(r,s,c.color),l=s.shapes.flatMap(g=>x6(g,a,u));if(c.plate){let g=ka(s)*a;l.push({type:"rect",x:s.qr.x*a-g,y:s.qr.y*a-g,width:e+2*g,height:e+2*g,radius:(s.qr.radius??0)*a,fill:c.color});}let f=v6(r.fontScale),p=s.labels.flatMap(g=>{let y=i.get(g.id);if(!y)return [];let _=(g.slot==="fixed"?void 0:o[g.slot])??g.id;return S6(g,y,f,a,u,_)}),m=p[0],h=m&&m.rotate===void 0?m:null,d=s.bleed??"none";return {width:s.artboard.width*a,height:s.artboard.height*a,qrX:s.qr.x*a,qrY:s.qr.y*a,qrSize:e,shapes:l,label:h,extraLabels:h?p.slice(1):p,squareEdges:d!=="none",color:u(d==="none"?"frame":d)}}function I_(e,t,r){return kd(e,Pd(t.spec),t,r)}var z_={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 Ad={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 N_={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 L_={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 O_={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 T_={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 F_={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 D_={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 Z_={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 Ba={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 B_={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 U_={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 G_={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 Q_={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 V_={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 j_={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 q_={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 W_={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 H_={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 xe=(e,t,r,n,o)=>({style:e,name:t,tags:o,labelOn:n,spec:r}),K_=[xe("banner-bottom","Banner",Ad,"frame",["bottom","band"]),xe("banner-top","Top banner",N_,"frame",["top","band"]),xe("banner-top-bottom","Two banners",L_,"frame",["top","bottom","band"]),xe("border","Border",O_,"background",["square","outline"]),xe("rounded-border","Rounded",Q_,"background",["border","outline"]),xe("gradient-border","Gradient",Ba,"background",["border","colorful"]),xe("focus","Focus",Z_,"background",["corners","brackets"]),xe("speech-bubble","Bubble",V_,"frame",["speech"]),xe("speech-bubble-top","Bubble top",j_,"frame",["speech"]),xe("chat-bubble","Chat",T_,"frame",["message","bubble"]),xe("circle","Circle",F_,"frame",["round","ring","curved"]),xe("badge","Ribbon",z_,"frame",["badge","banner"]),xe("sticker","Sticker",q_,"frame",["label"]),xe("polaroid","Polaroid",G_,"frame",["photo","picture"]),xe("phone","Phone",U_,"background",["mobile","screen"]),xe("ticket","Ticket",H_,"frame",["event","pass"]),xe("tag","Tag",W_,"frame",["price","label"]),xe("envelope","Envelope",D_,"frame",["mail","letter"]),xe("menu-card","Menu card",B_,"background",["menu","restaurant"])],W6=new Map(K_.map(e=>[e.style,e]));function H6(e){return W6.get(e)}Object.fromEntries(K_.map(e=>[e.style,e.spec]));({from:Ba.colors.frame,to:Ba.colors.accent});var K6={primary:"text",secondary:"secondaryText"};function J_(e,t,r){let n=H6(t.style)?.spec??Ad;return kd(e,Pd(n),t,r,K6)}var Ed="system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif";var J6="data-qrdx-frame-label";function Vt(e){return !!(e?.style&&e.style!=="none")}function Tn(e,t,r){return t.style===nd?I_(e,t,r):J_(e,t,r)}function ri(e,t){if(!Vt(t))return {width:e,height:e};let{width:r,height:n}=Tn(e,t);return {width:r,height:n}}var ce=e=>re(e,2);function X_({x:e,y:t,width:r,height:n,radius:o}){let i=ce(Math.min(o,r/2,n/2)),[s,a,c,u]=[ce(e),ce(t),ce(r),ce(n)];return i<=0?M`M${s} ${a}h${c}v${u}h${-c}z`:M`M${s+i} ${a}h${ce(c-2*i)}a${i} ${i} 0 0 1 ${i} ${i}`+M`v${ce(u-2*i)}a${i} ${i} 0 0 1 ${-i} ${i}`+M`h${ce(-(c-2*i))}a${i} ${i} 0 0 1 ${-i} ${-i}`+M`v${ce(-(u-2*i))}a${i} ${i} 0 0 1 ${i} ${-i}z`}function X6(e,t){return e.type==="rect"&&e.hole?A("path",{d:X_(e)+X_(e.hole),fill:e.fill,fillRule:"evenodd"},t):e.type==="polygon"?A("polygon",{fill:e.fill,points:e.points.map(([r,n])=>`${ce(r)},${ce(n)}`).join(" ")},t):e.type==="path"?A("path",{d:e.d,fill:e.fill,...e.fillRule==="evenodd"&&{fillRule:"evenodd"}},t):A("rect",{fill:e.fill,height:ce(e.height),width:ce(e.width),x:ce(e.x),y:ce(e.y),...e.radius>0&&{rx:ce(e.radius),ry:ce(e.radius)}},t)}function Y_(e,t){let{size:r,frame:n,bgColor:o,svgProps:i,markLabels:s}=t,a=Tn(r,n,o),c=Y6(a),u=ce(a.width),l=ce(a.height);return le("svg",{height:l,viewBox:`0 0 ${u} ${l}`,width:u,xmlns:"http://www.w3.org/2000/svg",...i,children:[A("g",{"data-qrdx-frame":n.style,children:a.shapes.map((f,p)=>X6(f,p))}),Mn(e,{x:ce(a.qrX),y:ce(a.qrY),width:r,height:r}),c.map((f,p)=>A("text",{"data-max-width":ce(f.maxWidth),fill:f.color,fontFamily:Ed,fontSize:ce(f.fontSize),fontWeight:f.fontWeight??700,textAnchor:f.align??"middle",x:ce(f.x),y:ce(f.y),...f.rotate&&{transform:`rotate(${ce(f.rotate)} ${ce(f.x)} ${ce(f.y)})`},...s&&f.field&&{[J6]:f.field},children:f.text},p))]})}function Y6(e){return [...e.label?[e.label]:[],...e.extraLabels??[]]}var ew={2:6,3:12};function e2(e){let t=[e.start],r=e.start;for(let n of e.segments){let o=n.at(-1);if(n.length===1)t.push(o);else {let i=ew[n.length];for(let s=1;s<=i;s++){let a=s/i,c=1-a;if(n.length===2){let[u]=n;t.push([c*c*r[0]+2*c*a*u[0]+a*a*o[0],c*c*r[1]+2*c*a*u[1]+a*a*o[1]]);}else {let[u,l]=n;t.push([c*c*c*r[0]+3*c*c*a*u[0]+3*c*a*a*l[0]+a*a*a*o[0],c*c*c*r[1]+3*c*c*a*u[1]+3*c*a*a*l[1]+a*a*a*o[1]]);}}}r=o;}return t}function r2(e,t){let r=[];for(let n of e)for(let o=0;o<n.length;o++){let[i,s]=n[o],[a,c]=n[(o+1)%n.length];s<=t!=c<=t&&r.push(i+(t-s)/(c-s)*(a-i));}return r.sort((n,o)=>n-o)}function n2(e,t){let r=0;for(let n of e)if(n<t)r++;else break;return r%2===1}function tw(e,t,r){return n2(r2(e,r),t)}function o2(e){let t=new Map;return (r,n)=>{let o=t.get(n);return o||(o=r2(e,n),t.set(n,o)),n2(o,r)}}function rw(e,t,r,n){let o=r[0]-e,i=r[1]-t,s=n[0]-r[0],a=n[1]-r[1],c=l=>Math.max(Math.abs(o+l*s),Math.abs(i+l*a)),u=Math.min(c(0),c(1));for(let[l,f]of [[i-o,s-a],[-(o+i),s+a]])if(f!==0){let p=l/f;p>0&&p<1&&(u=Math.min(u,c(p)));}return u}function nw(e,t,r){if(!tw(e,t,r))return 0;let n=Number.POSITIVE_INFINITY;for(let o of e)for(let i=0;i<o.length;i++)n=Math.min(n,rw(t,r,o[i],o[(i+1)%o.length]));return Number.isFinite(n)?n:0}function ow(e){let t=Number.POSITIVE_INFINITY,r=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY,o=Number.NEGATIVE_INFINITY;for(let i of e)for(let[s,a]of i)t=Math.min(t,s),r=Math.min(r,a),n=Math.max(n,s),o=Math.max(o,a);return {x0:t,y0:r,x1:n,y1:o}}function i2(e){let t=e.map(e2),r=ow(t),n=r.x1-r.x0,o=r.y1-r.y0;if(!(n>0&&o>0))return null;let i=(h,d)=>{let g=Math.max(h-r.x0,r.x1-h,d-r.y0,r.y1-d);return g>0?nw(t,h,d)/(2*g):0},s={cx:r.x0+n/2,cy:r.y0+o/2,value:0};s.value=i(s.cx,s.cy);let a=32;for(let h=1;h<a;h++)for(let d=1;d<a;d++){let g=r.x0+n*d/a,y=r.y0+o*h/a,_=i(g,y);_>s.value&&(s={cx:g,cy:y,value:_});}let c=n/a,u=o/a;for(let h=0;h<6;h++){let d=s;for(let g=-2;g<=2;g++)for(let y=-2;y<=2;y++){let _=d.cx+c*y/2,b=d.cy+u*g/2,v=i(_,b);v>s.value&&(s={cx:_,cy:b,value:v});}c/=2,u/=2;}if(s.value<=0)return null;let f=.5/Math.max(s.cx-r.x0,r.x1-s.cx,s.cy-r.y0,r.y1-s.cy),p=([h,d])=>[.5+(h-s.cx)*f,.5+(d-s.cy)*f],m=e.map(h=>({start:p(h.start),segments:h.segments.map(d=>d.map(p))}));return {rings:m,polygons:m.map(e2),half:s.value}}function s2(e,t){let r=([o,i])=>`${$(o*t)} ${$(i*t)}`,n="";for(let o of e.rings){n+=`M${r(o.start)}`;for(let i of o.segments){let s=i.length===1?"L":i.length===2?"Q":"C";n+=s+i.map(r).join(" ");}n+="Z";}return n}var iw={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]]]},t2;function a2(){return t2??=i2([iw]),t2}function sw(e){let{width:t,height:r,cells:n}=e;return Number.isInteger(t)&&Number.isInteger(r)&&t>=Ko&&r>=Ko&&t<=yr&&r<=yr&&typeof n=="string"&&n.length===t*r&&/^[01]*$/.test(n)?(o,i)=>o>=0&&i>=0&&o<t&&i<r&&n[i*t+o]==="1":null}var wt=([e,t])=>`${e},${t}`;function aw(e,t,r){let n=(c,u)=>e(c-1,u-1),o=new Map,i=(c,u)=>{for(let[l,f]of [[c,u],[u,c]]){let p=o.get(wt(l))??[];p.push(f),o.set(wt(l),p);}};for(let c=0;c<=r;c++)for(let u=0;u<=t;u++){let l=n(u,c),f=n(u+1,c),p=n(u+1,c+1),m=n(u,c+1),h=[u,c-.5],d=[u+.5,c],g=[u,c+.5],y=[u-.5,c];switch((l?8:0)+(f?4:0)+(p?2:0)+(m?1:0)){case 1:case 14:i(y,g);break;case 2:case 13:i(g,d);break;case 3:case 12:i(y,d);break;case 4:case 11:i(h,d);break;case 6:case 9:i(h,g);break;case 7:case 8:i(y,h);break;case 5:i(h,d),i(y,g);break;case 10:i(y,h),i(g,d);break;}}let s=[],a=new Set;for(let[c,u]of o){if(a.has(c)||u.length===0)continue;let[l,f]=c.split(",").map(Number),p=[[l,f]];a.add(c);let m=[l,f],h=u[0];for(;!a.has(wt(h));){a.add(wt(h)),p.push(h);let d=cw(o.get(wt(h))??[],m,a);if(!d)break;m=h,h=d;}p.length>=3&&s.push(uw(p));}return s}function cw(e,t,r){let n=wt(t);return e.find(o=>wt(o)!==n&&!r.has(wt(o)))??e.find(o=>wt(o)!==n)}function uw(e){let t=[];for(let r=0;r<e.length;r++){let n=e[(r-1+e.length)%e.length],o=e[r],i=e[(r+1)%e.length],s=(o[0]-n[0])*(i[1]-o[1])-(o[1]-n[1])*(i[0]-o[0]);Math.abs(s)>1e-9&&t.push(o);}return t.length>=3?t:e}function lw(e){let t=(i,s)=>[(i[0]+s[0])/2,(i[1]+s[1])/2],r=e.length,n=t(e[r-1],e[0]),o=e.map((i,s)=>[i,t(i,e[(s+1)%r])]);return {start:n,segments:o}}var ni=new Map;function c2(e){let t=`${e.width}x${e.height}:${e.cells}`,r=ni.get(t);if(r)return r;let n=sw(e),o;if(!n)o={outline:null,problem:"invalid"};else if(e.cells.includes("1")){let i=aw(n,e.width,e.height),s=i.length>0?i2(i.map(lw)):null;o=s&&2*s.half>=Dg?{outline:s,problem:null}:{outline:null,problem:s?"thin":"empty"};}else o={outline:null,problem:"empty"};return ni.size>16&&ni.delete(ni.keys().next().value),ni.set(t,o),o}var fw=1,u2=.5,l2=.5,pw=.5;function Ua(e){return Math.max(e,Fg)}function Rd(e){return e==="heart"?a2():typeof e=="object"&&e?.type==="silhouette"?c2(e).outline:null}function vt(e,t,r){if(r==="circle"){let s=Ua(t),a=(e/2+s)*Math.SQRT2+fw;return Math.ceil(a-e/2)}let n=Rd(r);if(!n)return t;let o=Ua(t),i=(e+2*(o+pw))/(2*n.half);return Math.ceil((i-e)/2-1e-9)}function f2(e){let t=e>>>0;return ()=>{t=t+1831565813>>>0;let r=t;return r=Math.imul(r^r>>>15,r|1),r^=r+Math.imul(r^r>>>7,r|61),((r^r>>>14)>>>0)/4294967296}}function mw(e,t,r){let n=vt(t,r,"circle"),o=Ua(r),i=t+2*n,s=i/2,a=s-u2-.5,c=f2(Number.parseInt(Sr(e),36)||1),u=n-o,l=n+t+o;return Array.from({length:i},(f,p)=>Array.from({length:i},(m,h)=>{let d=c()<l2;return h>=u&&h<l&&p>=u&&p<l?false:d&&Math.hypot(h+.5-s,p+.5-s)<=a}))}var dw=Array.from({length:8},(e,t)=>{let r=t*Math.PI/4;return [Math.cos(r),Math.sin(r)]});function p2(e,t,r,n){if(n==="circle")return mw(e,t,r);let o=Rd(n);if(!o)return null;let i=vt(t,r,n),s=Ua(r),a=t+2*i,c=o2(o.polygons),u=.5+u2,l=(h,d)=>{let g=h+.5,y=d+.5;return c(g/a,y/a)?dw.every(([_,b])=>c((g+_*u)/a,(y+b*u)/a)):false},f=f2(Number.parseInt(Sr(e),36)||1),p=i-s,m=i+t+s;return Array.from({length:a},(h,d)=>Array.from({length:a},(g,y)=>{let _=f()<l2;return y>=p&&y<m&&d>=p&&d<m?false:_&&l(y,d)}))}function m2(e,t){if(e==="circle")return {circle:t/2};let r=Rd(e);return r?{path:s2(r,t)}:null}function hw(e){return e==="top-left"?0:e==="top-right"?1:3}function Ga(e,t,r,n="circle",o="top-left"){let i=r*2,s=r,a=i/3;switch(n){case "leaf":case "leaf-reverse":case "drop":case "drop-reverse":{let c=hw(o),u=(c+2)%4,l=1.3*a,f=.7*a,p=h=>{switch(n){case "leaf":return h===c||h===u;case "leaf-reverse":return !(h===c||h===u);case "drop":return h===c;default:return h===u}},m=[0,1,2,3].map(h=>p(h)?f:l);return A("path",{d:Z(e-r,t-r,i,i,m)})}case "extra-rounded":return A("path",{d:Z(e-r,t-r,i,i,1.15*a)});case "plus":{let c=1.15*a,u=r;return A("path",{d:ne([[e-c,t-u],[e+c,t-u],[e+c,t-c],[e+u,t-c],[e+u,t+c],[e+c,t+c],[e+c,t+u],[e-c,t+u],[e-c,t+c],[e-u,t+c],[e-u,t-c],[e-c,t-c]])})}case "cross-rounded":{let c=1.15*a,u=.5*a;return A("path",{d:Z(e-r,t-c,i,2*c,u)+Z(e-c,t-r,2*c,i,u)})}case "hexagon":return A("path",{d:ne(zn(e,t,1.72*a,6))});case "octagon":return A("path",{d:ne(zn(e,t,r/Math.cos(Math.PI/8),8,22.5))});case "flower":{let c=.6*a,u=.9*a;return A("path",{d:oe(e-c,t-c,u)+oe(e+c,t-c,u)+oe(e+c,t+c,u)+oe(e-c,t+c,u)+oe(e,t,1.2*a)})}case "heart":return A("path",{d:Ln(e,t+.12*a,3.5*a)});case "squircle":return A("path",{d:ne(ei(e,t,r,r,4,64))});case "dots":{let c=[];for(let u of [-1,0,1])for(let l of [-1,0,1])c.push(oe(e+l*a*.82,t+u*a*.82,.58*a));return A("path",{d:c.join("")})}case "square":return A("rect",{height:$(i),transform:M`rotate(0,${e},${t})`,width:$(i),x:$(e-s),y:$(t-s)});case "rounded":return A("rect",{height:$(i),rx:$(r*.5),ry:$(r*.5),transform:M`rotate(0,${e},${t})`,width:$(i),x:$(e-s),y:$(t-s)});case "diamond":return A("path",{d:M`M ${e-s*.714286} ${t-s*.714286}v ${i*.714286}h ${i*.714286}v -${i*.714286}z`,transform:M`rotate(45,${e},${t})`});case "message":{let c=i/30,u=p=>(p-40)*c+e,l=p=>(p-40)*c+t,f=M`M ${u(25)} ${l(35.714285714285715)}v ${8.571428571428571*c}a ${10.714285714285714*c} ${10.714285714285714*c}, 0, 0, 0, ${10.714285714285714*c} ${10.714285714285714*c}h ${19.285714285714285*c}v -${19.285714285714285*c}a ${10.714285714285714*c} ${10.714285714285714*c}, 0, 0, 0, -${10.714285714285714*c} -${10.714285714285714*c}h -${8.571428571428571*c}a ${10.714285714285714*c} ${10.714285714285714*c}, 0, 0, 0, -${10.714285714285714*c} ${10.714285714285714*c}`;return A("path",{clipRule:"evenodd",d:f,transform:M`rotate(0,${e},${t})`})}case "message-reverse":{let c=i/30,u=p=>(p-40)*c+e,l=p=>(p-40)*c+t,f=M`M ${u(25)} ${l(35.714285714285715)}v ${8.571428571428571*c}a ${10.714285714285714*c} ${10.714285714285714*c}, 0, 0, 0, ${10.714285714285714*c} ${10.714285714285714*c}h ${19.285714285714285*c}v -${19.285714285714285*c}a ${10.714285714285714*c} ${10.714285714285714*c}, 0, 0, 0, -${10.714285714285714*c} -${10.714285714285714*c}h -${8.571428571428571*c}a ${10.714285714285714*c} ${10.714285714285714*c}, 0, 0, 0, -${10.714285714285714*c} ${10.714285714285714*c}`;return A("path",{clipRule:"evenodd",d:f,transform:M`rotate(-180,${e},${t})`})}case "diya":{let c=i/30,u=p=>(p-40)*c+e,l=p=>(p-40)*c+t,f=M`M ${u(25)} ${l(35.714285714285715)}v ${8.571428571428571*c}a ${10.714285714285714*c} ${10.714285714285714*c}, 0, 0, 0, ${10.714285714285714*c} ${10.714285714285714*c}h ${19.285714285714285*c}v -${19.285714285714285*c}a ${10.714285714285714*c} ${10.714285714285714*c}, 0, 0, 0, -${10.714285714285714*c} -${10.714285714285714*c}h -${8.571428571428571*c}H ${u(25)}z`;return A("path",{clipRule:"evenodd",d:f,transform:M`rotate(0,${e},${t})`})}case "diya-reverse":{let c=i/30,u=p=>(p-40)*c+e,l=p=>(p-40)*c+t,f=M`M ${u(25)} ${l(35.714285714285715)}v ${19.285714285714285*c}h ${19.285714285714285*c}a ${10.714285714285714*c} ${10.714285714285714*c}, 0, 0, 0, ${10.714285714285714*c} -${10.714285714285714*c}v -${19.285714285714285*c}h -${19.285714285714285*c}a ${10.714285714285714*c} ${10.714285714285714*c}, 0, 0, 0, -${10.714285714285714*c} ${10.714285714285714*c}z`;return A("path",{clipRule:"evenodd",d:f,transform:M`rotate(0,${e},${t})`})}case "rounded-triangle":{let c=i/21,u=p=>(p-40)*c+e,l=p=>(p-40)*c+t,f=M`M ${u(33.57142857142857)} ${l(29.285714285714285)}h ${12.857142857142856*c}c ${4.285714285714286*c} 0 ${4.285714285714286*c} ${4.285714285714286*c} ${4.285714285714286*c} ${4.285714285714286*c}v ${12.857142857142856*c}c 0 ${4.285714285714286*c} -${4.285714285714286*c} ${4.285714285714286*c} -${4.285714285714286*c} ${4.285714285714286*c}h -${12.857142857142856*c}c -${4.285714285714286*c} 0 -${4.285714285714286*c} -${4.285714285714286*c} -${4.285714285714286*c} -${4.285714285714286*c}v -${12.857142857142856*c}c 0 -${4.285714285714286*c} ${4.285714285714286*c} -${4.285714285714286*c} ${4.285714285714286*c} -${4.285714285714286*c}z`;return A("path",{d:f,transform:M`rotate(45,${e},${t})`})}case "star":{let c=i/27,u=p=>(p-40)*c+e,l=p=>(p-40)*c+t,f=M`M ${u(38.84615384615385)},${l(26.546153846153846)}c${.6692307692307691*c},-${1.0153846153846153*c},${2.215384615384615*c},-${1.0153846153846153*c},${2.884615384615384*c},0l${4.038461538461538*c},${6.069230769230768*c}c${.23076923076923075*c},${.3461538461538461*c},${.6*c},${.6*c},${1.0153846153846153*c},${.7153846153846153*c}l${7.223076923076922*c},${1.823076923076923*c}c${1.2*c},${.3*c},${1.6846153846153844*c},${1.7076923076923076*c},${.8999999999999999*c},${2.6538461538461533*c}l-${4.73076923076923*c},${5.584615384615384*c}c-${.2769230769230769*c},${.3230769230769231*c},-${.41538461538461535*c},${.7384615384615384*c},-${.3923076923076923*c},${1.1307692307692307*c}l${.4384615384615384*c},${7.199999999999999*c}c${.06923076923076922*c},${1.2*c},-${1.1769230769230767*c},${2.0769230769230766*c},-${2.3307692307692305*c},${1.6384615384615382*c}l-${6.9692307692307685*c},-${2.6076923076923073*c}c-${.3923076923076923*c},-${.16153846153846155*c},-${.8538461538461538*c},-${.16153846153846155*c},-${1.2461538461538462*c},0l-${6.9692307692307685*c},${2.6076923076923073*c}c-${1.1538461538461537*c},${.4384615384615384*c},-${2.4*c},-${.4384615384615384*c},-${2.3307692307692305*c},-${1.6384615384615382*c}l${.4384615384615384*c},-${7.199999999999999*c}c${.023076923076923075*c},-${.41538461538461535*c},-${.11538461538461538*c},-${.8307692307692307*c},-${.3923076923076923*c},-${1.1307692307692307*c}l-${4.73076923076923*c},-${5.584615384615384*c}c-${.7846153846153846*c},-${.923076923076923*c},-${.3230769230769231*c},-${2.3307692307692305*c},${.8999999999999999*c},-${2.6538461538461533*c}l${7.223076923076922*c},-${1.823076923076923*c}c${.41538461538461535*c},-${.11538461538461538*c},${.7846153846153846*c},-${.3461538461538461*c},${1.0153846153846153*c},-${.7153846153846153*c}l${4.038461538461538*c},-${6.069230769230768*c}z`;return A("path",{clipRule:"evenodd",d:f,transform:M`rotate(0,${e},${t})`})}case "banner":{let c=i/28;return A("g",{transform:M`translate(${e-40*c},${t-40*c}) scale(${$(c,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:$(e),cy:$(t),r:$(r),transform:M`rotate(0,${e},${t})`})}}function Fn(e,t,r,n){let o=e==="top-left"?0:e==="top-right"?1:3,i=(o+2)%4;return [0,1,2,3].map(s=>s===o||n&&s===i?r:t)}function d2(e,t,r,n){return [[e+n,t],[e+r-n,t],[e+r,t+n],[e+r,t+r-n],[e+r-n,t+r],[e+n,t+r],[e,t+r-n],[e,t+n]]}function h2(e,t,r,n){let o=r/7,i=Math.max(0,(n+Math.SQRT2-2)*o);return ne(d2(e,t,r,n*o))+ne(d2(e+o,t+o,5*o,i))}function g2(e,t,r,n,o=false){let i=r/7,s=a=>o?Fn(n,0,a,true):Fn(n,a,0,true);return Z(e,t,r,r,s(2.5*i))+Z(e+i,t+i,5*i,5*i,s(1.5*i))}function gw(e,t,r,n){let o=r/7;return Z(e,t,r,r,Fn(n,2.6*o,0,false))+Z(e+o,t+o,5*o,5*o,Fn(n,1.6*o,0,false))}function _w(e,t,r){let n=r/7,o=e+r/2,i=t+r/2;return ne(ei(o,i,3.5*n,3.5*n,4,96))+ne(ei(o,i,2.5*n,2.5*n,4,96))}function _2(e,t,r,n,o){let i=n,s=r/2,a=(s-i)*.55,c=(u,l)=>M`${e+u} ${t+l}`;return M`M${c(i,0)}`+M`C${c(i+a,0)} ${c(s-a,o)} ${c(s,o)}`+M`C${c(s+a,o)} ${c(r-i-a,0)} ${c(r-i,0)}`+M`A${i} ${i} 0 0 1 ${c(r,i)}`+M`C${c(r,i+a)} ${c(r-o,s-a)} ${c(r-o,s)}`+M`C${c(r-o,s+a)} ${c(r,r-i-a)} ${c(r,r-i)}`+M`A${i} ${i} 0 0 1 ${c(r-i,r)}`+M`C${c(r-i-a,r)} ${c(s+a,r-o)} ${c(s,r-o)}`+M`C${c(s-a,r-o)} ${c(i+a,r)} ${c(i,r)}`+M`A${i} ${i} 0 0 1 ${c(0,r-i)}`+M`C${c(0,r-i-a)} ${c(o,s+a)} ${c(o,s)}`+M`C${c(o,s-a)} ${c(0,i+a)} ${c(0,i)}`+M`A${i} ${i} 0 0 1 ${c(i,0)}Z`}function yw(e,t,r){let n=r/7,o=.12*n;return _2(e,t,r,1.4*n,o)+_2(e+n,t+n,5*n,.7*n,o)}function y2(e,t,r,n,o,i){let s=r/2,a=(c,u)=>M`${e+c} ${t+u}`;return M`M${a(n,0)}H${e+r-n}`+M`A${n} ${n} 0 0 1 ${a(r,n)}`+M`V${t+o}`+M`C${a(r,o+1.55*i)} ${a(s+1.6*i,r)} ${a(s,r)}`+M`C${a(s-1.6*i,r)} ${a(0,o+1.55*i)} ${a(0,o)}`+M`V${t+n}A${n} ${n} 0 0 1 ${a(n,0)}Z`}function bw(e,t,r){let n=r/7;return y2(e,t,r,.7*n,3.9*n,n)+y2(e+n,t+n,5*n,.35*n,2.7*n,.8*n)}function $w(e,t,r,n){let o=r/7;return Z(e,t,r,r,Fn(n,.5*o,2.5*o,false))+Z(e+o,t+o,5*o,5*o,Fn(n,.25*o,1.5*o,false))}function xw(e,t,r){let n=r/7;return M`M ${e} ${t}v ${r}h ${r}v -${r}z`+M`M ${e+n} ${t+n}h ${5*n}v ${5*n}h -${5*n}z`}function ww(e,t,r){let n=r/7,o=n*.875,i=n*.4375,s=M`M ${e+o} ${t}`+M`h ${r-2*o}`+M`a ${o} ${o} 0 0 1 ${o} ${o}`+M`v ${r-2*o}`+M`a ${o} ${o} 0 0 1 ${-o} ${o}`+M`h ${-(r-2*o)}`+M`a ${o} ${o} 0 0 1 ${-o} ${-o}`+M`v ${-(r-2*o)}`+M`a ${o} ${o} 0 0 1 ${o} ${-o}z`,a=M`M ${e+n+i} ${t+n}`+M`h ${5*n-2*i}`+M`a ${i} ${i} 0 0 1 ${i} ${i}`+M`v ${5*n-2*i}`+M`a ${i} ${i} 0 0 1 ${-i} ${i}`+M`h ${-(5*n-2*i)}`+M`a ${i} ${i} 0 0 1 ${-i} ${-i}`+M`v ${-(5*n-2*i)}`+M`a ${i} ${i} 0 0 1 ${i} ${-i}z`;return s+a}function vw(e,t,r){let n=e+r/2,o=t+r/2,i=re(r/2),s=re(r*(2.5/7));return M`M ${n-i} ${o}`+M`a ${i} ${i} 0 1 0 ${i*2} 0`+M`a ${i} ${i} 0 1 0 ${-i*2} 0z`+M`M ${n-s} ${o}`+M`a ${s} ${s} 0 1 1 ${s*2} 0`+M`a ${s} ${s} 0 1 1 ${-s*2} 0z`}function Sw(e,t,r){let n=r/74.7002,o=a=>a*n+e,i=a=>a*n+t;return M`M${o(37.3496)} ${i(0)}C${o(39.2939)} ${i(0)} ${o(40.9948)} ${i(1.03842)} ${o(41.9287)} ${i(2.59082)}C${o(43.2293)} ${i(1.34013)} ${o(45.1347)} ${i(.780267)} ${o(47.0098)} ${i(1.28027)}C${o(48.8871)} ${i(1.78928)} ${o(50.261)} ${i(3.23767)} ${o(50.7578)} ${i(4.98438)}C${o(52.3454)} ${i(4.0996)} ${o(54.3432)} ${i(4.047)} ${o(56.0303)} ${i(5.01953)}C${o(57.7094)} ${i(5.98752)} ${o(58.6586)} ${i(7.73647)} ${o(58.6924)} ${i(9.5459)}C${o(60.4517)} ${i(9.10661)} ${o(62.3883)} ${i(9.57215)} ${o(63.7598)} ${i(10.9502)}C${o(65.1282)} ${i(12.3253)} ${o(65.5963)} ${i(14.2585)} ${o(65.1641)} ${i(16.0127)}C${o(66.974)} ${i(16.044)} ${o(68.7242)} ${i(16.9982)} ${o(69.7002)} ${i(18.6797)}C${o(70.6781)} ${i(20.3647)} ${o(70.6241)} ${i(22.3635)} ${o(69.7402)} ${i(23.9502)}C${o(71.4776)} ${i(24.4496)} ${o(72.9194)} ${i(25.8232)} ${o(73.4199)} ${i(27.7002)}C${o(73.927)} ${i(29.5707)} ${o(73.3661)} ${i(31.4794)} ${o(72.1104)} ${i(32.7822)}C${o(73.6621)} ${i(33.7163)} ${o(74.7002)} ${i(35.4166)} ${o(74.7002)} ${i(37.3604)}C${o(74.7001)} ${i(39.307)} ${o(73.6582)} ${i(41.0084)} ${o(72.1025)} ${i(41.9414)}C${o(73.357)} ${i(43.245)} ${o(73.9207)} ${i(45.1525)} ${o(73.4199)} ${i(47.0303)}C${o(72.9187)} ${i(48.9027)} ${o(71.4782)} ${i(50.2735)} ${o(69.7383)} ${i(50.7734)}C${o(70.6201)} ${i(52.3601)} ${o(70.6716)} ${i(54.3549)} ${o(69.7002)} ${i(56.04)}C${o(68.7237)} ${i(57.7225)} ${o(66.9721)} ${i(58.6729)} ${o(65.1611)} ${i(58.7031)}C${o(65.598)} ${i(60.4623)} ${o(65.131)} ${i(62.3982)} ${o(63.7598)} ${i(63.7695)}C${o(62.3847)} ${i(65.138)} ${o(60.4515)} ${i(65.6061)} ${o(58.6973)} ${i(65.1738)}C${o(58.6635)} ${i(66.9833)} ${o(57.7094)} ${i(68.7322)} ${o(56.0303)} ${i(69.7002)}C${o(54.3461)} ${i(70.6777)} ${o(52.348)} ${i(70.6248)} ${o(50.7617)} ${i(69.7422)}C${o(50.2643)} ${i(71.4831)} ${o(48.8896)} ${i(72.9284)} ${o(47.0098)} ${i(73.4297)}C${o(45.1389)} ${i(73.9368)} ${o(43.2296)} ${i(73.3763)} ${o(41.9268)} ${i(72.1201)}C${o(40.9927)} ${i(73.6717)} ${o(39.2932)} ${i(74.71)} ${o(37.3496)} ${i(74.71)}C${o(35.4051)} ${i(74.7098)} ${o(33.7042)} ${i(73.6711)} ${o(32.7705)} ${i(72.1182)}C${o(31.4697)} ${i(73.3758)} ${o(29.5597)} ${i(73.9418)} ${o(27.6797)} ${i(73.4404)}V${i(73.4502)}C${o(25.8065)} ${i(72.9422)} ${o(24.434)} ${i(71.4985)} ${o(23.9346)} ${i(69.7568)}C${o(22.3504)} ${i(70.6301)} ${o(20.3591)} ${i(70.6781)} ${o(18.6797)} ${i(69.71)}C${o(16.9957)} ${i(68.7391)} ${o(16.045)} ${i(66.9831)} ${o(16.0166)} ${i(65.168)}C${o(14.2547)} ${i(65.6091)} ${o(12.3134)} ${i(65.1435)} ${o(10.9395)} ${i(63.7695)}C${o(9.5687)} ${i(62.3919)} ${o(9.10168)} ${i(60.454)} ${o(9.53809)} ${i(58.6973)}C${o(7.72791)} ${i(58.6641)} ${o(5.97815)} ${i(57.71)} ${o(5.00977)} ${i(56.0303)}C${o(4.03552)} ${i(54.3517)} ${o(4.08377)} ${i(52.3649)} ${o(4.95801)} ${i(50.7812)}C${o(3.21705)} ${i(50.2839)} ${o(1.77087)} ${i(48.9101)} ${o(1.26953)} ${i(47.0303)}V${i(47.0205)}C${o(.762081)} ${i(45.1489)} ${o(1.32758)} ${i(43.2375)} ${o(2.58496)} ${i(41.9346)}C${o(1.03604)} ${i(41)} ${o(108484e-9)} ${i(39.3019)} ${o(0)} ${i(37.3604)}C${o(0)} ${i(35.4159)} ${o(1.03815)} ${i(33.7141)} ${o(2.59082)} ${i(32.7803)}C${o(1.34044)} ${i(31.4797)} ${o(.780389)} ${i(29.575)} ${o(1.28027)} ${i(27.7002)}C${o(1.78258)} ${i(25.8232)} ${o(3.22806)} ${i(24.4482)} ${o(4.97363)} ${i(23.9512)}C${o(4.08938)} ${i(22.3638)} ${o(4.03743)} ${i(20.3664)} ${o(5.00977)} ${i(18.6797)}C${o(5.97815)} ${i(16.9999)} ${o(7.72788)} ${i(16.0496)} ${o(9.53809)} ${i(16.0166)}C${o(9.10139)} ${i(14.2576)} ${o(9.56846)} ${i(12.3214)} ${o(10.9395)} ${i(10.9502)}C${o(12.3171)} ${i(9.57911)} ${o(14.2558)} ${i(9.11137)} ${o(16.0127)} ${i(9.54785)}C${o(16.0426)} ${i(7.73421)} ${o(16.9969)} ${i(5.97989)} ${o(18.6797)} ${i(5.00977)}C${o(20.3596)} ${i(4.03474)} ${o(22.3521)} ${i(4.08468)} ${o(23.9365)} ${i(4.96094)}C${o(24.4378)} ${i(3.22749)} ${o(25.8059)} ${i(1.7898)} ${o(27.6797)} ${i(1.29004)}C${o(29.5511)} ${i(.78264)} ${o(31.4617)} ${i(1.34357)} ${o(32.7646)} ${i(2.60059)}C${o(33.6971)} ${i(1.04268)} ${o(35.4013)} ${i(152405e-9)} ${o(37.3496)} ${i(0)}ZM${o(41.0615)} ${i(9.17578)}C${o(40.1006)} ${i(10.1057)} ${o(38.793)} ${i(10.6797)} ${o(37.3496)} ${i(10.6797)}C${o(35.9064)} ${i(10.6796)} ${o(34.5985)} ${i(10.1066)} ${o(33.6377)} ${i(9.17676)}C${o(32.9511)} ${i(10.3241)} ${o(31.8358)} ${i(11.2176)} ${o(30.4404)} ${i(11.5898)}C${o(29.0527)} ${i(11.9661)} ${o(27.6436)} ${i(11.7542)} ${o(26.4766)} ${i(11.1074)}C${o(26.1072)} ${i(12.3879)} ${o(25.2629)} ${i(13.5333)} ${o(24.0195)} ${i(14.25)}C${o(22.7695)} ${i(14.9754)} ${o(21.347)} ${i(15.1322)} ${o(20.0479)} ${i(14.8047)}C${o(20.0289)} ${i(16.1454)} ${o(19.5108)} ${i(17.4793)} ${o(18.4902)} ${i(18.5)}C${o(17.4696)} ${i(19.5158)} ${o(16.1409)} ${i(20.033)} ${o(14.8066)} ${i(20.0566)}C${o(15.1312)} ${i(21.3534)} ${o(14.9738)} ${i(22.7723)} ${o(14.25)} ${i(24.0195)}C${o(13.5243)} ${i(25.2699)} ${o(12.3701)} ${i(26.1148)} ${o(11.082)} ${i(26.4795)}C${o(11.7347)} ${i(27.6479)} ${o(11.9529)} ${i(29.062)} ${o(11.5801)} ${i(30.46)}C${o(11.2085)} ${i(31.8485)} ${o(10.3194)} ${i(32.9607)} ${o(9.17578)} ${i(33.6475)}C${o(10.106)} ${i(34.6084)} ${o(10.6797)} ${i(35.9167)} ${o(10.6797)} ${i(37.3604)}C${o(10.6796)} ${i(38.805)} ${o(10.1053)} ${i(40.1141)} ${o(9.17383)} ${i(41.0752)}C${o(10.3132)} ${i(41.7614)} ${o(11.1999)} ${i(42.871)} ${o(11.5703)} ${i(44.2598)}C${o(11.946)} ${i(45.6504)} ${o(11.7335)} ${i(47.0592)} ${o(11.0889)} ${i(48.2266)}C${o(12.377)} ${i(48.593)} ${o(13.5297)} ${i(49.441)} ${o(14.25)} ${i(50.6904)}C${o(14.9754)} ${i(51.9405)} ${o(15.1322)} ${i(53.3629)} ${o(14.8047)} ${i(54.6621)}C${o(16.142)} ${i(54.6835)} ${o(17.4721)} ${i(55.2016)} ${o(18.4902)} ${i(56.2197)}C${o(19.5097)} ${i(57.2441)} ${o(20.0278)} ${i(58.5787)} ${o(20.0479)} ${i(59.918)}C${o(21.3469)} ${i(59.5917)} ${o(22.7696)} ${i(59.7493)} ${o(24.0195)} ${i(60.4697)}C${o(25.2676)} ${i(61.1892)} ${o(26.1117)} ${i(62.3406)} ${o(26.4775)} ${i(63.627)}C${o(27.6424)} ${i(62.9822)} ${o(29.0498)} ${i(62.7688)} ${o(30.4404)} ${i(63.1396)}C${o(31.8284)} ${i(63.5112)} ${o(32.9402)} ${i(64.3999)} ${o(33.627)} ${i(65.543)}C${o(34.5887)} ${i(64.6072)} ${o(35.9012)} ${i(64.0304)} ${o(37.3496)} ${i(64.0303)}C${o(38.7912)} ${i(64.0303)} ${o(40.098)} ${i(64.6023)} ${o(41.0586)} ${i(65.5303)}C${o(41.7458)} ${i(64.3887)} ${o(42.8594)} ${i(63.5007)} ${o(44.25)} ${i(63.1299)}C${o(45.643)} ${i(62.7522)} ${o(47.057)} ${i(62.9676)} ${o(48.2266)} ${i(63.6201)}C${o(48.5931)} ${i(62.3323)} ${o(49.4413)} ${i(61.1801)} ${o(50.6904)} ${i(60.46)}C${o(51.9373)} ${i(59.7364)} ${o(53.3558)} ${i(59.5781)} ${o(54.6523)} ${i(59.9023)}C${o(54.6744)} ${i(58.5659)} ${o(55.1925)} ${i(57.2372)} ${o(56.21)} ${i(56.2197)}C${o(57.2339)} ${i(55.2007)} ${o(58.5676)} ${i(54.6816)} ${o(59.9062)} ${i(54.6611)}C${o(59.5835)} ${i(53.3649)} ${o(59.7414)} ${i(51.9468)} ${o(60.46)} ${i(50.7002)}C${o(61.1797)} ${i(49.4517)} ${o(62.3312)} ${i(48.6068)} ${o(63.6182)} ${i(48.2412)}C${o(62.9651)} ${i(47.0726)} ${o(62.7473)} ${i(45.658)} ${o(63.1201)} ${i(44.2598)}C${o(63.4916)} ${i(42.8718)} ${o(64.3794)} ${i(41.7591)} ${o(65.5225)} ${i(41.0723)}C${o(64.5929)} ${i(40.1115)} ${o(64.0206)} ${i(38.8033)} ${o(64.0205)} ${i(37.3604)}C${o(64.0205)} ${i(35.9186)} ${o(64.5915)} ${i(34.611)} ${o(65.5195)} ${i(33.6504)}C${o(64.3785)} ${i(32.9631)} ${o(63.4908)} ${i(31.8501)} ${o(63.1201)} ${i(30.46)}C${o(62.7421)} ${i(29.0656)} ${o(62.9572)} ${i(27.6498)} ${o(63.6113)} ${i(26.4795)}C${o(62.3272)} ${i(26.1115)} ${o(61.1784)} ${i(25.2657)} ${o(60.46)} ${i(24.0195)}C${o(59.7364)} ${i(22.7727)} ${o(59.5781)} ${i(21.3541)} ${o(59.9023)} ${i(20.0576)}C${o(58.5626)} ${i(20.038)} ${o(57.23)} ${i(19.52)} ${o(56.21)} ${i(18.5)}C${o(55.1931)} ${i(17.4783)} ${o(54.675)} ${i(16.1482)} ${o(54.6523)} ${i(14.8125)}C${o(53.3557)} ${i(15.1357)} ${o(51.9374)} ${i(14.9785)} ${o(50.6904)} ${i(14.2598)}C${o(49.4399)} ${i(13.5339)} ${o(48.5931)} ${i(12.3801)} ${o(48.2285)} ${i(11.0918)}C${o(47.0603)} ${i(11.7439)} ${o(45.6474)} ${i(11.9624)} ${o(44.25)} ${i(11.5898)}V${i(11.5801)}C${o(42.8613)} ${i(11.2085)} ${o(41.7483)} ${i(10.3196)} ${o(41.0615)} ${i(9.17578)}Z`}function Md(e){let t=e/70;return {scale:t,transform:(n,o)=>(n-5)*t+o}}function Cw(e,t,r){let{scale:n,transform:o}=Md(r);return M`M ${o(5,e)} ${o(30,t)}v ${20*n}a ${25*n} ${25*n}, 0, 0, 0, ${25*n} ${25*n}h ${45*n}v -${45*n}a ${25*n} ${25*n}, 0, 0, 0, -${25*n} -${25*n}h -${20*n}H ${o(5,e)}zM ${o(30,e)} ${o(15,t)}h ${20*n}a ${15*n} ${15*n}, 0, 0, 1, ${15*n} ${15*n}v ${35*n}h -${35*n}a ${15*n} ${15*n}, 0, 0, 1, -${15*n} -${15*n}v -${35*n}z`}function Pw(e,t,r){let n=r/7,o=n*1.5,i=n*.75,s=M`M ${e+o} ${t}`+M`h ${r-2*o}`+M`a ${o} ${o} 0 0 1 ${o} ${o}`+M`v ${r-2*o}`+M`a ${o} ${o} 0 0 1 ${-o} ${o}`+M`h ${-(r-2*o)}`+M`a ${o} ${o} 0 0 1 ${-o} ${-o}`+M`v ${-(r-2*o)}`+M`a ${o} ${o} 0 0 1 ${o} ${-o}z`,a=M`M ${e+n+i} ${t+n}`+M`h ${5*n-2*i}`+M`a ${i} ${i} 0 0 1 ${i} ${i}`+M`v ${5*n-2*i}`+M`a ${i} ${i} 0 0 1 ${-i} ${i}`+M`h ${-(5*n-2*i)}`+M`a ${i} ${i} 0 0 1 ${-i} ${-i}`+M`v ${-(5*n-2*i)}`+M`a ${i} ${i} 0 0 1 ${i} ${-i}z`;return s+a}function kw(e,t,r){let{scale:n,transform:o}=Md(r);return M`M ${o(5,e)} ${o(40,t)}a ${35*n} ${35*n}, 0, 0, 0, ${35*n} ${35*n}h ${30*n}a ${5*n} ${5*n}, 0, 0, 0, ${5*n} -${5*n}v -${30*n}a ${35*n} ${35*n}, 0, 0, 0, -${35*n} -${35*n}a ${35*n} ${35*n}, 0, 0, 0, -${35*n} ${35*n}zM ${o(40,e)} ${o(15,t)}a ${25*n} ${25*n}, 0, 0, 1, ${25*n} ${25*n}v ${25*n}h -${25*n}a ${25*n} ${25*n}, 0, 0, 1, -${25*n} -${25*n}a ${25*n} ${25*n}, 0, 0, 1, ${25*n} -${25*n}z`}function Aw(e,t,r){let{scale:n,transform:o}=Md(r);return M`M ${o(5,e)} ${o(30,t)}v ${20*n}a ${25*n} ${25*n}, 0, 0, 0, ${25*n} ${25*n}h ${45*n}v -${45*n}a ${25*n} ${25*n}, 0, 0, 0, -${25*n} -${25*n}h -${20*n}a ${25*n} ${25*n}, 0, 0, 0, -${25*n} ${25*n}M ${o(30,e)} ${o(15,t)}h ${20*n}a ${15*n} ${15*n}, 0, 0, 1, ${15*n} ${15*n}v ${35*n}h -${35*n}a ${15*n} ${15*n}, 0, 0, 1, -${15*n} -${15*n}v -${20*n}a ${15*n} ${15*n}, 0, 0, 1, ${15*n} -${15*n}z`}function Ew(e,t,r){let n=r/70,o=e+r/2-40*n,i=t+r/2-40*n,s=(c,u)=>c*n+u;return M`M${s(35.19239999999999,o)} ${s(5.837547376725838,i)}C${s(37.69667692307692,o)} ${s(3.8737070690335305,i)}, ${s(41.218430769230764,o)} ${s(3.8737092228796843,i)}, ${s(43.722707692307694,o)} ${s(5.837547376725838,i)}L${s(46.62781538461539,o)} ${s(8.115648915187375,i)}L${s(50.23356923076923,o)} ${s(7.32361506903353,i)}C${s(53.342,o)} ${s(6.640824299802762,i)}, ${s(56.51483076923077,o)} ${s(8.168784299802759,i)}, ${s(57.91892307692308,o)} ${s(11.024719684418145,i)}L${s(59.54787692307692,o)} ${s(14.337679684418145,i)}L${s(63.14027692307692,o)} ${s(15.188578145956608,i)}C${s(66.23707692307693,o)} ${s(15.922091992110452,i)}, ${s(68.43270769230769,o)} ${s(18.675396607495067,i)}, ${s(68.45876923076924,o)} ${s(21.857768915187375,i)}L${s(68.48892307692307,o)} ${s(25.54931045364891,i)}L${s(71.35633846153846,o)} ${s(27.874602761341222,i)}C${s(73.82830769230769,o)} ${s(29.879187376725838,i)}, ${s(74.61187692307692,o)} ${s(33.312418145956606,i)}, ${s(73.25452307692306,o)} ${s(36.19103353057199,i)}L${s(71.68006153846153,o)} ${s(39.530141222879685,i)}L${s(73.25452307692306,o)} ${s(42.86924891518738,i)}C${s(74.61187692307692,o)} ${s(45.747864299802764,i)}, ${s(73.82830769230769,o)} ${s(49.18109506903353,i)}, ${s(71.35633846153846,o)} ${s(51.18567968441815,i)}L${s(68.48892307692307,o)} ${s(53.510971992110456,i)}L${s(68.45876923076924,o)} ${s(57.202664299802755,i)}C${s(68.43270769230769,o)} ${s(60.38497199211046,i)}, ${s(66.23707692307693,o)} ${s(63.13823353057199,i)}, ${s(63.14027692307692,o)} ${s(63.871833530572,i)}L${s(59.54787692307692,o)} ${s(64.72260276134121,i)}L${s(57.91892307692308,o)} ${s(68.03564891518737,i)}C${s(56.51483076923077,o)} ${s(70.89164891518737,i)}, ${s(53.342,o)} ${s(72.41958737672583,i)}, ${s(50.23356923076923,o)} ${s(71.7368181459566,i)}L${s(46.62781538461539,o)} ${s(70.94463353057199,i)}L${s(43.722707692307694,o)} ${s(73.22275660749506,i)}C${s(41.218430769230764,o)} ${s(75.18663353057198,i)}, ${s(37.69667692307692,o)} ${s(75.18663353057198,i)}, ${s(35.19239999999999,o)} ${s(73.22275660749506,i)}L${s(32.28729230769231,o)} ${s(70.94463353057199,i)}L${s(28.68153846153846,o)} ${s(71.7368181459566,i)}C${s(25.573215384615384,o)} ${s(72.41958737672583,i)}, ${s(22.400384615384613,o)} ${s(70.89164891518737,i)}, ${s(20.996141538461536,o)} ${s(68.03564891518737,i)}L${s(19.36720923076923,o)} ${s(64.72260276134121,i)}L${s(15.774852307692306,o)} ${s(63.871833530572,i)}C${s(12.67803076923077,o)} ${s(63.13823353057199,i)}, ${s(10.48237846153846,o)} ${s(60.38497199211046,i)}, ${s(10.45636,o)} ${s(57.202664299802755,i)}L${s(10.426163076923077,o)} ${s(53.510971992110456,i)}L${s(7.558747692307692,o)} ${s(51.18567968441815,i)}C${s(5.086880338461539,o)} ${s(49.18109506903353,i)}, ${s(4.303258769230769,o)} ${s(45.747864299802764,i)}, ${s(5.660599692307692,o)} ${s(42.86924891518738,i)}L${s(7.235153846153846,o)} ${s(39.530141222879685,i)}L${s(5.660599692307692,o)} ${s(36.19103353057199,i)}C${s(4.3032566153846155,o)} ${s(33.312418145956606,i)}, ${s(5.086885938461538,o)} ${s(29.879187376725838,i)}, ${s(7.558747692307692,o)} ${s(27.874602761341222,i)}L${s(10.426163076923077,o)} ${s(25.54931045364891,i)}L${s(10.45636,o)} ${s(21.857768915187375,i)}C${s(10.48237846153846,o)} ${s(18.67537506903353,i)}, ${s(12.678052307692308,o)} ${s(15.922091992110452,i)}, ${s(15.774852307692306,o)} ${s(15.188578145956608,i)}L${s(19.36720923076923,o)} ${s(14.337679684418145,i)}L${s(20.996141538461536,o)} ${s(11.024719684418145,i)}C${s(22.400384615384613,o)} ${s(8.168784299802759,i)}, ${s(25.573215384615384,o)} ${s(6.640824299802762,i)}, ${s(28.68153846153846,o)} ${s(7.32361506903353,i)}L${s(32.28729230769231,o)} ${s(8.115648915187375,i)}L${s(35.19239999999999,o)} ${s(5.837547376725838,i)}M${s(39.45766153846154,o)} ${s(13.665055069033532,i)}L${s(37.01498461538461,o)} ${s(15.58053506903353,i)}C${s(35.39098461538461,o)} ${s(16.854061222879682,i)}, ${s(33.282799999999995,o)} ${s(17.335251992110454,i)}, ${s(31.26701538461538,o)} ${s(16.892464299802757,i)}L${s(28.235046153846152,o)} ${s(16.22649506903353,i)}L${s(26.865415384615382,o)} ${s(19.012107376725837,i)}C${s(25.954812307692308,o)} ${s(20.864178145956608,i)}, ${s(24.264193846153844,o)} ${s(22.212399684418145,i)}, ${s(22.255926153846154,o)} ${s(22.688076607495066,i)}L${s(19.235393846153844,o)} ${s(23.40354122287968,i)}L${s(19.21,o)} ${s(26.507556607495065,i)}C${s(19.19313538461538,o)} ${s(28.57137199211045,i)}, ${s(18.25492,o)} ${s(30.519525838264297,i)}, ${s(16.651919999999997,o)} ${s(31.81937199211045,i)}L${s(14.240926153846154,o)} ${s(33.774633530572,i)}L${s(15.564830769230769,o)} ${s(36.58238737672584,i)}C${s(16.445064615384617,o)} ${s(38.44891045364892,i)}, ${s(16.445064615384617,o)} ${s(40.611371992110456,i)}, ${s(15.564830769230769,o)} ${s(42.47811045364892,i)}L${s(14.240926153846154,o)} ${s(45.28564891518738,i)}L${s(16.651919999999997,o)} ${s(47.240910453648915,i)}L${s(13.883236923076923,o)} ${s(50.654971992110454,i)}L${s(16.651919999999997,o)} ${s(47.240910453648915,i)}C${s(18.25492,o)} ${s(48.54075660749507,i)}, ${s(19.19313538461538,o)} ${s(50.4891258382643,i)}, ${s(19.21,o)} ${s(52.5527258382643,i)}L${s(19.235393846153844,o)} ${s(55.65684891518738,i)}L${s(22.255926153846154,o)} ${s(56.37235660749507,i)}C${s(24.264193846153844,o)} ${s(56.847925838264295,i)}, ${s(25.954812307692308,o)} ${s(58.196233530571995,i)}, ${s(26.865415384615382,o)} ${s(60.0483258382643,i)}L${s(28.235046153846152,o)} ${s(62.833895069033524,i)}L${s(31.26701538461538,o)} ${s(62.1679258382643,i)}C${s(33.282799999999995,o)} ${s(61.72509506903353,i)}, ${s(35.39098461538461,o)} ${s(62.20626429980276,i)}, ${s(37.01498461538461,o)} ${s(63.47983353057199,i)}L${s(39.45766153846154,o)} ${s(65.39524891518737,i)}L${s(41.90012307692308,o)} ${s(63.47983353057199,i)}C${s(43.524123076923075,o)} ${s(62.20626429980276,i)}, ${s(45.632307692307684,o)} ${s(61.72509506903353,i)}, ${s(47.6480923076923,o)} ${s(62.1679258382643,i)}L${s(50.68006153846154,o)} ${s(62.833895069033524,i)}L${s(52.049692307692304,o)} ${s(60.0483258382643,i)}C${s(52.960338461538456,o)} ${s(58.196233530571995,i)}, ${s(54.6508923076923,o)} ${s(56.847925838264295,i)}, ${s(56.65913846153846,o)} ${s(56.37235660749507,i)}L${s(59.67969230769231,o)} ${s(55.65684891518738,i)}L${s(59.70510769230769,o)} ${s(52.5527258382643,i)}C${s(59.72190769230769,o)} ${s(50.4891258382643,i)}, ${s(60.66012307692307,o)} ${s(48.54075660749507,i)}, ${s(62.263230769230766,o)} ${s(47.240910453648915,i)}L${s(64.67424615384616,o)} ${s(45.28564891518738,i)}L${s(63.35027692307692,o)} ${s(42.47811045364892,i)}C${s(62.47,o)} ${s(40.611371992110456,i)}, ${s(62.47,o)} ${s(38.44891045364892,i)}, ${s(63.35027692307692,o)} ${s(36.58238737672584,i)}L${s(64.67424615384616,o)} ${s(33.774633530572,i)}L${s(62.263230769230766,o)} ${s(31.81958737672584,i)}C${s(60.66012307692307,o)} ${s(30.519525838264297,i)}, ${s(59.72190769230769,o)} ${s(28.57137199211045,i)}, ${s(59.70510769230769,o)} ${s(26.507556607495065,i)}L${s(59.67969230769231,o)} ${s(23.40354122287968,i)}L${s(56.65913846153846,o)} ${s(22.688076607495066,i)}C${s(54.6508923076923,o)} ${s(22.212399684418145,i)}, ${s(52.960338461538456,o)} ${s(20.864178145956608,i)}, ${s(52.049692307692304,o)} ${s(19.012128915187375,i)}L${s(50.68006153846154,o)} ${s(16.22649506903353,i)}L${s(47.6480923076923,o)} ${s(16.892464299802757,i)}C${s(45.632307692307684,o)} ${s(17.335251992110454,i)}, ${s(43.524338461538456,o)} ${s(16.85408276134122,i)}, ${s(41.90012307692308,o)} ${s(15.58053506903353,i)}L${s(39.45766153846154,o)} ${s(13.665055069033532,i)}Z`}function Qa(e,t,r,n,o="top-left"){switch(n){case "leaf":return g2(e,t,r,o);case "leaf-reverse":return g2(e,t,r,o,true);case "drop":return gw(e,t,r,o);case "octagon":return h2(e,t,r,1.6);case "bevel":return h2(e,t,r,1.1);case "squircle":return _w(e,t,r);case "cushion":return yw(e,t,r);case "shield":return bw(e,t,r);case "petal":return $w(e,t,r,o);case "gear":return Sw(e,t,r);case "rounded":return ww(e,t,r);case "circle":return vw(e,t,r);case "diya":return Cw(e,t,r);case "extra-rounded":return Pw(e,t,r);case "message":return kw(e,t,r);case "pointy":return Aw(e,t,r);case "curly":return Ew(e,t,r);default:return xw(e,t,r)}}var Id=.22,zd=.14;function b2(e,t,r={}){if(e==="circle")return A("circle",{cx:$(t.x+t.w/2),cy:$(t.y+t.h/2),r:$(Math.min(t.w,t.h)/2),...r});let n=e==="rounded"?Math.min(t.w,t.h)*Id:0;return A("rect",{height:$(t.h),width:$(t.w),x:$(t.x),y:$(t.y),...n>0&&{rx:$(n),ry:$(n)},...r})}function Rw(e,t){let r=e.w*t,n=e.h*t;return {x:e.x+r,y:e.y+n,w:e.w-2*r,h:e.h-2*n}}function $2(e,t){let r=e.shape??"square",n=e.plate,o=n?Rw(t,zd):t,i=a=>A("image",{height:$(o.h),href:e.src,preserveAspectRatio:"none",width:$(o.w),x:$(o.x),y:$(o.y),...a&&{clipPath:`url(#${a})`}});if(r==="square"&&!n)return i();let s=r==="square"?void 0:`qrdx-logo-${Sr(`${r}|${$(o.x)}|${$(o.y)}|${$(o.w)}|${$(o.h)}`)}`;return le("g",{children:[n&&b2(r,t,{fill:n}),s&&A("clipPath",{id:s,children:b2(r,o)}),i(s)]})}var Mw=.6,Iw=["L","M","Q","H"];function zw(e){let t=Qe.QrCode.encodeText(e.value,ht[e.level]),r=Iw[t.errorCorrectionLevel.ordinal]??e.level;return {code:e,cells:t.getModules(),layoutMargin:vt(t.size,e.margin,e.shape),map:Ea(t.version,r),level:r,version:t.version}}function Nw(e,t){let{cells:r,map:n}=e,o=r.length,i=Va(r,e.code.size,e.layoutMargin,t);if(!i)return null;let s=i.excavation??{x:Math.floor(i.x),y:Math.floor(i.y),w:Math.ceil(i.x+i.w)-Math.floor(i.x),h:Math.ceil(i.y+i.h)-Math.floor(i.y)},a=[];for(let u=Math.max(0,s.y);u<Math.min(o,s.y+s.h);u++)for(let l=Math.max(0,s.x);l<Math.min(o,s.x+s.w);l++)a.push(u*o+l);let c=Ra(n,a);return {worst:Math.max(0,...c),correctable:n.correctable,budget:Math.floor(n.correctable*Mw),level:e.level,version:e.version}}var Lw=e=>!e||e.worst<=e.budget;function Ow(e,t,r,n){let o=t.map(a=>zw({...e,level:a})),i=a=>{let c=n(a);return o.every(u=>Lw(Nw(u,c)))};if(i(r))return r;let s=e.size*.005;for(let a=r-s;a>0;a-=s)if(i(a))return a;return 0}function x2(e,t){if(!t)return;let r=Math.floor(e.size*pi),n=t.width||r,o=t.height||r,i=p=>{if(p===n)return t;let m=o*p/n;return {...t,width:p,height:m,...t.x!=null&&{x:t.x+(n-p)/2},...t.y!=null&&{y:t.y+(o-m)/2}}},s=e.level??Qn,a={value:e.value,size:e.size,margin:e.margin,shape:e.shape},c=p=>oi({...e,level:s,imageSettings:p}),u=p=>{let m=Ow(a,[p],n,i);return m>0?i(m):void 0},l=c(t);if(l===s)return u(s);let f=u(l);return f&&c(f)===l?f:u(s)}var w2="data-qrdx-part",Tw="data-qrdx-eye";function v2(e,t,r){if(e)return r?{[w2]:t,[Tw]:r}:{[w2]:t}}var S2={id:"Arrow",name:"Arrow",description:"QR code with arrow",wrapper:(e,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:le("svg",{fill:"#000000",height:"300",viewBox:"0 0 300 300",width:"300",xmlns:"http://www.w3.org/2000/svg",children:[A("path",{d:"M73.57,175.23h0c.12-2.06.31-4.19.49-6.25s.48-4.13.85-6.13.79-4,1.27-5.95a30.21,30.21,0,0,1,1.94-5.28h0c.06-.18.13-.43.19-.67a3.55,3.55,0,0,0-2.8-4.19l-.18-.06a1.85,1.85,0,0,0-.54-.06c-.19,0-.31-.06-.49-.06s-.61-.06-.91-.06c-.61,0-1.21.06-1.82.06-1.21.12-2.37.25-3.52.43a62.08,62.08,0,0,0-6.8,1.45,58.45,58.45,0,0,0-6.43,2.31c-1,.42-2.07,1-3.1,1.4s-2,1.09-3,1.57a.76.76,0,0,0,.54,1.4h.07c1.09-.24,2.12-.55,3.15-.79s2.13-.48,3.16-.61A46,46,0,0,1,62,153c1.34-.06,2.73-.06,4.07-.06a62.58,62.58,0,0,0-7.23,10.43,85.58,85.58,0,0,0-6.55,15.36,107.86,107.86,0,0,0-5,32.53,104.06,104.06,0,0,0,5,32.29,90.47,90.47,0,0,0,15.54,28.52.94.94,0,0,0,1.27.19.89.89,0,0,0,.18-1.28h0a87.24,87.24,0,0,1-13.89-28.28A102.85,102.85,0,0,1,58,180.87a82.15,82.15,0,0,1,6.68-14,51.58,51.58,0,0,1,5.71-7.76c0,1.21,0,2.36.06,3.58.12,2.18.24,4.31.48,6.43s.49,4.25.85,6.37a1,1,0,0,0,.91.85A1.37,1.37,0,0,0,73.57,175.23Z",fill:t?.fgColor||"black",id:"CallToActionArrow"}),A("g",{fill:"none",transform:"translate(82, 95)scale(0.5)",children:e})]})})};var C2={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 si=593,jt=296.5,ii=146.5,M2=294.5,I2=231.228,z2="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",Fw="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",Dw="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",P2="3cf27f17c00j3ch21n1ek00l1el3cj1vv1kd00n3cl3cn1q31q500p3cp1vx00r1kb3cs3aw1ej21p00t3ax3ay17b27h00w3b02g20yq01w2d611m01x3b52aa14i01y24i1bq0203bd3be1q21q60253bf39e39f39h14e2ae02d39j11i2da02e39l0ym02f39n2lt0sz03a39p2ix0vv03b39r2d511n39t03d27d17f03f39x39y21l1en03h3a03a11vt1kf03j37w37x1q11q703l37z1k903n1vz3821eh03p21r38714d03t11h03u2db38a0vp2j303w2lz38g03x0st2rk0n804o38l2oo0q404p38n2iw0vw04r36f36h2a814k04u36k36l1vs1kg04z36o36p1n41t405236q36x36y0ss2m005d3720n02rs05f3742uf0kd0633763772on0q506537834y2fz0yt06834z2d311p06935235424f1bt06c35621j1ep06d3581yn1hl06e35a1sv1nd06g35b1pz1q906h35d35e35g1ef21t06l35h1bj24p06m35k35l11f2dd06q35n0vn2j506s35p35q0pv2ox06u35s0mz2rt06v35t33h0k32up06w2x90hi08y2ud0ke08z33r2lp0t20922fx0yu0942a514m09624d1bu0983441yl1hm09a1vp1ki09b1px1qa09d34e1n11t609e1h91yy09g1ed21u09h1a227m0831492ai09l0yh2ga09n0sp2m209p0pt2oy09q0k12uq09s2xo0h52z209t31k0en0bt2780c319z0az0e831z0cq",k2=52,Zw=240;function A2(e){let t=0;return e.split(" ").map(r=>(t+=Number.parseInt(r,36),t/1e4))}var Nd;function Bw(){if(!Nd){let e=A2(Fw),t=A2(Dw),r=[];for(let n=0;n<P2.length;n+=3){let o=Number.parseInt(P2.slice(n,n+3),36);r.push({cx:e[Math.floor(o/k2)],cy:t[o%k2]});}Nd=r;}return Nd}function Uw(e){let t=0;for(let r=0;r<e.length;r++)t=t*32-t+e.charCodeAt(r),t%=2147483647;return Math.abs(t)}function N2(e){let t=Bw(),r=Uw(e),n=()=>(r=(r*9301+49297)%233280,r/233280),o=t.map((i,s)=>s);for(let i=o.length-1;i>0;i--){let s=Math.floor(n()*(i+1));[o[i],o[s]]=[o[s],o[i]];}return o.slice(0,Zw).sort((i,s)=>i-s).map(i=>t[i])}var E2=300,Gw=49,Qw=6;function L2(e,t){if(E2/t<=Gw+.5)return e;let r=ii,n=ii+E2,o=Qw*t+t/2;return e.filter(({cx:i,cy:s})=>Math.max(r-i,i-n,r-s,s-n)>=o)}var O2="Scan the QR code * Scan the QR code * Scan the QR code * Scan the QR code *",ja=32,T2=3.5,F2=246.5,Od=.36,R2=F2+Od*ja,Ld=400;function Vw(e,t){return e===" "||/[il1|!']/.test(e)?t*.3:/[mwMW@%&]/.test(e)?t*.8:t*.6}function jw(e){let t=e.slice(0,Ld).split(" ").map(r=>Ho(r,Ld)).join(" ");return Array.from(t).slice(0,Ld)}function D2(e,t){let{fontSize:r,letterSpacing:n,position:o,rotation:i}=t,s=2*Math.PI*F2,a=[],c=0;for(let h of jw(e)){let d=Vw(h,r);if(c+d>s)break;a.push({char:h,along:c+d/2}),c+=d+n;}let u=c-(a.length>0?n:0),l=o!=="bottom",f=l?R2-Od*r:R2+Od*r,p=u/s*180,m=[];for(let{char:h,along:d}of a){if(h.trim()==="")continue;let g=d/s*360,y=l?i-p+g:i+180+p-g,_=y*Math.PI/180;m.push({char:h,x:re(jt+f*Math.sin(_)),y:re(jt-f*Math.cos(_)),rotate:re(l?y:y-180)});}return m}var Dn=(e,t)=>typeof e=="number"&&Number.isFinite(e)?e:t,Z2={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,r)=>{let n=Ve(t?.fgColor,"#000000"),o=Ve(t?.bgColor,"#ffffff"),i=r?.pixelSize??9,s=re(i/2),a=L2(N2(r?.url??""),i),c=Dn(t?.fontSize,ja),u=c>0?c:ja,l=typeof t?.customText=="string"?t.customText:O2,f=D2(l,{fontSize:u,letterSpacing:Dn(t?.fontLetterSpacing,T2),position:t?.textPosition==="bottom"?"bottom":"top",rotation:Dn(t?.textRotation,0)}),p=t?.textColor||"#ffffff",m=t?.fontFamily||Ed,h=t?.fontWeight??900,d=Dn(t?.strokeWidth,0),g=t?.strokeColor||"#000000",y=[{radius:jt,width:Dn(t?.outerStrokeWidth,d),color:t?.outerStrokeColor||g},{radius:I2,width:Dn(t?.innerStrokeWidth,d),color:t?.innerStrokeColor||g}].filter(_=>_.width>0);return le("svg",{height:si,id:"svgQrWrapper",style:{width:"100%",height:"100%"},viewBox:`0 0 ${si} ${si}`,width:si,xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",children:[A("circle",{cx:jt,cy:jt,fill:o,r:M2}),A("g",{fill:n,children:a.map((_,b)=>A("circle",{cx:_.cx,cy:_.cy,r:s},b))}),A("path",{d:z2,fill:t?.outerCircleColor||n}),y.map((_,b)=>A("circle",{cx:jt,cy:jt,fill:"none",r:_.radius,stroke:_.color,strokeWidth:_.width},b)),A("g",{"aria-hidden":"true",children:f.map((_,b)=>A("text",{fill:p,fontFamily:m,fontSize:u,fontWeight:h,textAnchor:"middle",transform:`rotate(${_.rotate} ${_.x} ${_.y})`,x:_.x,y:_.y,children:_.char},b))}),A("g",{transform:`translate(${ii} ${ii})`,children:e})]})}};var B2={id:"Halloween",name:"Halloween",description:"QR code with Halloween theme",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("svg",{fill:"none",height:"300",viewBox:"0 0 300 300",width:"300",xmlns:"http://www.w3.org/2000/svg",children:le("g",{transform:"translate(10, 10)",children:[A("circle",{cx:"138",cy:"167.682",fill:"white",r:"99.3177",stroke:"#F89941",strokeWidth:"20"}),A("rect",{fill:"url(#pattern0)",height:"110.806",width:"113",x:"81.0001",y:"124.097"}),A("ellipse",{cx:"167.989",cy:"67.8947",fill:"#F89941",rx:"35.4453",ry:"48.4419"}),A("path",{d:"M187.937 69.0763C187.937 82.6574 184.092 94.8451 178.005 103.57C171.912 112.304 163.736 117.381 154.992 117.381C146.247 117.381 138.072 112.304 131.979 103.57C125.891 94.8451 122.047 82.6574 122.047 69.0763C122.047 55.4952 125.891 43.3075 131.979 34.5823C138.072 25.8486 146.247 20.7714 154.992 20.7714C163.736 20.7714 171.912 25.8486 178.005 34.5823C184.092 43.3075 187.937 55.4952 187.937 69.0763Z",fill:"#F89941",stroke:"#E78249",strokeWidth:"5"}),A("ellipse",{cx:"154.072",cy:"69.4866",fill:"#F89941",rx:"34.0512",ry:"50.6615"}),A("path",{d:"M171.396 69.667C171.396 82.7394 167.562 94.4717 161.488 102.874C155.412 111.279 147.235 116.2 138.451 116.2C129.666 116.2 121.489 111.279 115.413 102.874C109.34 94.4717 105.506 82.7394 105.506 69.667C105.506 56.5946 109.34 44.8624 115.413 36.4603C121.489 28.0551 129.666 23.1344 138.451 23.1344C147.235 23.1344 155.412 28.0551 161.488 36.4603C167.562 44.8624 171.396 56.5946 171.396 69.667Z",fill:"#F89941",stroke:"#E78249",strokeWidth:"5"}),A("ellipse",{cx:"134.316",cy:"70.8486",fill:"#F89941",rx:"33.673",ry:"47.8511"}),A("ellipse",{fill:"#F89941",rx:"35.4453",ry:"48.4419",transform:"matrix(-1 0 0 1 106.743 68.4484)"}),A("path",{d:"M86.7942 69.6299C86.7942 83.2111 90.6388 95.3988 96.7262 104.124C102.819 112.858 110.995 117.935 119.739 117.935C128.484 117.935 136.659 112.858 142.753 104.124C148.84 95.3988 152.685 83.2111 152.685 69.6299C152.685 56.0488 148.84 43.8611 142.753 35.1359C136.659 26.4023 128.484 21.3251 119.739 21.3251C110.995 21.3251 102.819 26.4023 96.7262 35.1359C90.6388 43.8611 86.7942 56.0488 86.7942 69.6299Z",fill:"#F89941",stroke:"#E78249",strokeWidth:"5"}),A("ellipse",{fill:"#F89941",rx:"32.9438",ry:"50.3847",transform:"matrix(-1 0 0 1 119.744 69.7634)"}),A("path",{d:"M103.335 70.2207C103.335 83.293 107.169 95.0253 113.243 103.427C119.319 111.833 127.496 116.753 136.281 116.753C145.065 116.753 153.242 111.833 159.318 103.427C165.392 95.0253 169.226 83.293 169.226 70.2207C169.226 57.1483 165.392 45.416 159.318 37.014C153.242 28.6088 145.065 23.688 136.281 23.688C127.496 23.688 119.319 28.6088 113.243 37.014C107.169 45.416 103.335 57.1483 103.335 70.2207Z",fill:"#F89941",stroke:"#E78249",strokeWidth:"5"}),A("ellipse",{fill:"#F89941",rx:"32.3901",ry:"47.6163",transform:"matrix(-1 0 0 1 139.677 70.8708)"}),A("ellipse",{fill:"#F89941",rx:"33.2207",ry:"47.6163",transform:"matrix(-1 0 0 1 134.971 71.4245)"}),A("path",{d:"M158.85 46.6783C165.21 42.2516 166.538 40.633 167.867 39.0144C167.867 39.0144 169.806 43.8236 169.88 46.3566C169.954 48.8897 169.712 50.1469 167.248 51.6467C164.783 53.1464 155.406 53.0446 150.083 52.9746C149.31 52.5001 150.72 52.3371 158.85 46.6783Z",fill:"black"}),A("path",{d:"M115.765 46.5118C109.392 42.1412 108.058 40.5475 106.724 38.9538C106.724 38.9538 104.783 45.8361 104.758 46.822C104.733 47.808 104.657 50.8051 108.247 51.9995C111.837 53.194 119.234 52.7723 124.551 52.7272C125.322 52.2652 123.912 52.0991 115.765 46.5118Z",fill:"black"}),A("path",{d:"M160 90.4999C167.156 83.1595 169.5 78.2827 171.351 72.9348C172.24 70.3672 162.909 72.0429 158 72.9348C157.276 73.0664 155.751 76.9145 155 77C154.182 77.0932 151.841 73.0759 151 73.086C149.725 73.1013 147.727 73.086 145.875 73.4285C145.345 74.3645 146.367 77.5746 145.875 78.2827C145.321 78.2827 141.796 77.2604 141.242 76.4298C140.689 74.492 140.949 73.3629 140.118 72.5323C137.555 72.9075 138.023 72.6567 135.412 73.086C134.768 73.1919 133.09 77.7212 132.441 77.8195C131.615 77.9448 128.644 74.0088 127.809 74.1138C126.747 74.2475 124.821 74.4683 123.64 74.577C123.126 74.6244 123.554 77.5019 123.177 78.2827C122.898 78.8616 119.426 77.8921 118.5 77.5C118.037 76.5024 117.844 74.5583 117 74.577C111 74.1138 109.4 73.843 103.575 70.8713C103.575 70.8713 102.5 80 111 89C119.5 98 147.127 103.706 160 90.4999Z",fill:"black"}),A("path",{d:"M135.238 7.25181C137.192 1.73111 142.678 0.363204 145.935 0L148.377 1.81602C149.158 2.39714 149.842 2.40909 150.331 3.25657C150.331 4.22511 146.337 5.41975 142.429 6.582C137.545 8.03482 139.482 17.0534 142.429 19.2811C143.401 20.0152 143.524 19.9639 145.966 19.9639C148.029 19.9639 150.387 18.2474 151.566 17.3526C151.566 17.3526 151.861 20.2573 149.798 21.4777C147.735 22.698 143.578 21.8578 143.608 21.9658C144.493 23.9183 146.89 22.4887 148.029 23.3362C147.346 23.3362 146.556 24.2889 144.198 24.5329C142.672 24.5798 142.135 24.5329 140.956 23.9183C139.777 23.3037 139.482 22.8696 138.893 22.1395C136.83 23.3598 138.893 25.4305 138.893 25.4305C138.893 25.4305 134.472 25.8512 133.587 23.9183C133.264 23.2115 133.882 22.1395 133.587 21.9658C131.819 22.4539 130.935 23.4807 127.373 22.8696C124.312 22.3443 125.102 18.3211 124.451 17.3526C127.381 18.079 125.131 20.0392 129.327 19.9639C140.838 19.7576 132.796 14.1527 135.238 7.25181Z",fill:"#5D725F"}),le("defs",{children:[A("pattern",{height:"1",id:"pattern0",patternContentUnits:"objectBoundingBox",width:"1"}),A("clipPath",{id:"clip0_2087_156668",children:A("rect",{fill:"white",height:"276",width:"276"})})]}),A("g",{fill:"none",transform:"translate(80, 122)scale(0.38)",children:e})]})})})};var U2={id:"SquareBorder",name:"Square Border",description:"QR code with square decorative border",wrapper:(e,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("svg",{fill:"black",height:"300",viewBox:"0 0 316 316",width:"300",xmlns:"http://www.w3.org/2000/svg",children:le("g",{children:[A("path",{clipRule:"evenodd",d:"M308 8H8v300h300V8ZM0 0v316h316V0H0Z",fill:t?.fgColor||"black",fillRule:"evenodd"}),A("g",{fill:"none",transform:"translate(20, 20) scale(0.92)",children:e})]})})})};var G2={id:"StandardBox",name:"Standard Box",description:"QR code with standard box",wrapper:(e,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:le("svg",{fill:"#000000",height:"300",viewBox:"0 0 300 300",width:"300",xmlns:"http://www.w3.org/2000/svg",children:[A("path",{d:"M243,1.7h-186a10.25,10.25,0,0,0-10.2,10.12v186A10.13,10.13,0,0,0,57,208H243a10.13,10.13,0,0,0,10.12-10.12v-186A10.13,10.13,0,0,0,243,1.7Zm2.36,193.05a5.46,5.46,0,0,1-5.47,5.47H60.16a5.46,5.46,0,0,1-5.47-5.47V14.93a5.46,5.46,0,0,1,5.47-5.47H239.91a5.46,5.46,0,0,1,5.47,5.47Z",fill:t?.fgColor||"black"}),A("path",{d:"M243.54,238.81H173.61a2.29,2.29,0,0,1-1.62-.67l-20.55-20.55a2.33,2.33,0,0,0-3.25,0l-20.55,20.55a2.29,2.29,0,0,1-1.62.67H56.09A9.15,9.15,0,0,0,46.93,248v41.17a9.16,9.16,0,0,0,9.16,9.16H243.61a9.09,9.09,0,0,0,9.09-9.16V248A9.16,9.16,0,0,0,243.54,238.81Z",fill:t?.fgColor||"black"}),A("g",{fill:"none",transform:"translate(60, 15)scale(0.6)",children:e})]})})};var Q2={id:"StrikedBox",name:"Striked Box",description:"QR code with striked box",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:le("svg",{fill:"#22071b",height:"300",viewBox:"0 0 300 300",width:"300",xmlns:"http://www.w3.org/2000/svg",children:[A("path",{d:"M195.11,290.77l-7.28,4.88a2.16,2.16,0,0,0-.57,3,2.21,2.21,0,0,0,1.77.92,2.4,2.4,0,0,0,1.2-.35l7.28-4.88a2.14,2.14,0,0,0-2.4-3.54Z"}),A("path",{d:"M266.85,227.52l-7.28,4.87a2.16,2.16,0,0,0-.57,3,2.21,2.21,0,0,0,1.77.92,1.86,1.86,0,0,0,1.2-.35l7.28-4.88a2.13,2.13,0,1,0-2.4-3.53Z"}),A("path",{d:"M41,176.34l-9.11,6.08a2.15,2.15,0,0,0-.57,3,2.19,2.19,0,0,0,1.77.92,2.14,2.14,0,0,0,1.2-.35l9.12-6.08A2.14,2.14,0,0,0,41,176.34Z"}),A("path",{d:"M41,269.08l-9.11,6.07a2.15,2.15,0,0,0-.57,3,2.19,2.19,0,0,0,1.77.92,2.92,2.92,0,0,0,1.2-.35l9.12-6.08A2.14,2.14,0,0,0,41,269.08Z"}),A("path",{d:"M147,10.1a2.4,2.4,0,0,0,1.14-.35l7.7-5.16a2.13,2.13,0,0,0-2.4-3.53l-7.64,5.15a2.15,2.15,0,0,0-.56,3A2.19,2.19,0,0,0,147,10.1Z"}),A("path",{d:"M275.54,54.77a2.14,2.14,0,0,0-3-.56l-17.1,11.45V31.31a10.18,10.18,0,0,0-10.18-10.18H137.22l-10.39,7a2.4,2.4,0,0,1-1.2.35,2.21,2.21,0,0,1-1.77-.92,2.15,2.15,0,0,1,.57-3l1.41-.92,13.64-8.76a2.1,2.1,0,1,0-2.26-3.54L122,21.2h-8.13l-10.39,7a2.37,2.37,0,0,1-1.2.35,2.19,2.19,0,0,1-1.76-.92,2.15,2.15,0,0,1,.56-3L124,9.25a2.13,2.13,0,1,0-2.4-3.53l-23,15.48H58.2A10.18,10.18,0,0,0,48,31.38v28L31.34,70.46a2.09,2.09,0,0,0-.57,3,2,2,0,0,0,1.77.92,2.58,2.58,0,0,0,1.2-.35l14.35-9.54,3.18-2.12a2.14,2.14,0,1,1,2.41,3.53l-5.52,3.67V76.9l-7,4.66a2.15,2.15,0,0,0-.56,3,2,2,0,0,0,1.77.92,2.34,2.34,0,0,0,1.2-.36l7.35-4.94A2.13,2.13,0,0,1,52.69,84l-4.46,3v65.66L25.05,168.07a2.15,2.15,0,0,0-.57,3,2,2,0,0,0,1.77.92,2.37,2.37,0,0,0,1.2-.35l25-16.75a2,2,0,0,1,2.62.77,2.16,2.16,0,0,1-.57,3l-6.36,4.24V275a10.09,10.09,0,0,0,9.83,10.11l-5.87,4a2.15,2.15,0,0,0-.57,3,2.06,2.06,0,0,0,1.77.92,2.38,2.38,0,0,0,1.2-.36l23-15.41a2.14,2.14,0,0,1,2.41,3.54l-6.58,4.45h52l-5.58,3.75a2.14,2.14,0,0,0-.56,3,2,2,0,0,0,1.76.91,2.37,2.37,0,0,0,1.2-.35l30.54-20.28a2.15,2.15,0,0,1,3,.56,2.1,2.1,0,0,1-.57,3l-14.21,9.54H217l-4.6,3a2.16,2.16,0,0,0-.63,3,2.11,2.11,0,0,0,1.76,1,2,2,0,0,0,1.13-.36L237,277.35a2.14,2.14,0,1,1,2.33,3.6l-6.78,4.38h13a10.18,10.18,0,0,0,10.18-10.18v-91.1l-4.38,3a2.43,2.43,0,0,1-1.2.35,2.19,2.19,0,0,1-1.77-.92,2.15,2.15,0,0,1,.57-3l24.38-16.33a2.13,2.13,0,1,0-2.4-3.53l-15.48,10.25V91.53l-4.38,3a2.34,2.34,0,0,1-1.21.36,2.22,2.22,0,0,1-1.76-.92,2.15,2.15,0,0,1,.56-3l6.72-4.52,13.71-9.19a2.14,2.14,0,0,0-2.4-3.54l-11.24,7.57V75.84l-4.38,3a2.34,2.34,0,0,1-1.21.36,2.22,2.22,0,0,1-1.76-.92,2.15,2.15,0,0,1,.56-3l6.72-4.52,19.43-13.08A2.05,2.05,0,0,0,275.54,54.77ZM237,216.07h-172a5.23,5.23,0,0,1-5.23-5.24V38.94a5.22,5.22,0,0,1,5.23-5.23H237a5.22,5.22,0,0,1,5.23,5.23V210.83h.07A5.22,5.22,0,0,1,237,216.07Z"}),A("path",{d:"M270.45,139.8l-7.28,4.88a2.15,2.15,0,0,0-.56,3,2.22,2.22,0,0,0,1.76.92,2.44,2.44,0,0,0,1.21-.36l7.28-4.87a2.14,2.14,0,0,0-2.41-3.54Z"}),A("g",{fill:"none",transform:"translate(64, 38)scale(0.58)",children:e})]})})};var Td={default:C2,Arrow:S2,StandardBox:G2,SquareBorder:U2,StrikedBox:Q2,Halloween:B2,DotRing:Z2},V2={FlamQR:"DotRing"},j2=e=>{if(Object.hasOwn(Td,e))return Td[e];let t=Object.hasOwn(V2,e)?V2[e]:void 0;return t?Td[t]:void 0};var Fd=e=>Math.round(Math.min(Math.max(e,0),255)).toString(16).padStart(2,"0");function K2(e){return `#${Fd(e.r)}${Fd(e.g)}${Fd(e.b)}`}function qa(e){let t=Re(e);return !t||t.a>=1||t.a<=0?{color:e}:{color:K2(t),opacity:re(t.a,3)}}function Wa(e,t){let r=Math.min(Math.max(e.a,0),1);return {r:e.r*r+t.r*(1-r),g:e.g*r+t.g*(1-r),b:e.b*r+t.b*(1-r),a:1}}var J2={r:0,g:0,b:0,a:1};function qw(e){return [...e].map(t=>({offset:Math.min(Math.max(t.offset/100,0),1),color:Re(t.color)??J2})).sort((t,r)=>t.offset-r.offset)}function Dd(e,t){let r=e[0],n=e.at(-1);if(!(r&&n))return J2;if(t<=r.offset)return r.color;if(t>=n.offset)return n.color;for(let o=0;o+1<e.length;o++){let i=e[o],s=e[o+1];if(t>=i.offset&&t<=s.offset){let a=s.offset-i.offset,c=a>0?(t-i.offset)/a:1,u=i.color.a+(s.color.a-i.color.a)*c,l=(f,p)=>{let m=f*i.color.a+(p*s.color.a-f*i.color.a)*c;return u>0?m/u:f+(p-f)*c};return {r:l(i.color.r,s.color.r),g:l(i.color.g,s.color.g),b:l(i.color.b,s.color.b),a:u}}}return n.color}var q2=4,W2=720,Ww=2;function X2(e,t,r,n,o){let i=qw(e);if(i.length===0)return {wedges:[]};let s=i[0].color.a,a=i.every(_=>Math.abs(_.color.a-s)<.002),c=[...new Set([0,...i.map(_=>_.offset),1])].sort((_,b)=>_-b),u=[];for(let _=0;_+1<c.length;_++){let b=c[_],v=c[_+1];if(v<=b)continue;let C=Dd(i,b+1e-9),w=Dd(i,v-1e-9),x=Math.max(Math.abs(C.r*C.a-w.r*w.a),Math.abs(C.g*C.a-w.g*w.a),Math.abs(C.b*C.a-w.b*w.a),Math.abs(C.a-w.a)*255),E=Math.ceil(x/Ww),P=Math.ceil((v-b)*360/q2),R=Math.max(1,E,P);for(let I=0;I<R;I++)u.push([b+(v-b)*I/R,b+(v-b)*(I+1)/R]);}let l=u;if(u.length>W2){let _=Math.ceil(u.length/W2);l=[];for(let b=0;b<u.length;b+=_){let v=u.slice(b,b+_);l.push([v[0][0],v.at(-1)[1]]);}}let f=t-90,p=o/Math.cos(2*q2/2*(Math.PI/180)),m=_=>{let b=_*Math.PI/180;return [$(r+p*Math.cos(b)),$(n+p*Math.sin(b))]},h=`${$(r)} ${$(n)}`,d=_=>re((_%360+360)%360,4),g=l.length-1,y=l.map(([_,b],v)=>{let C=Dd(i,(_+b)/2),w=(b-_)*360,x=a&&v===0&&g>0?w:0,E=a&&v<g?w:0,P=f+_*360-x,R=f+b*360+E,[I,N]=m(P),[O,V]=m(R);return {d:`M${h}L${I} ${N}L${O} ${V}Z`,color:K2(C),...a||C.a>=1?{}:{opacity:re(C.a,3)},from:d(P),sweep:re(R-P,4)}});return a&&s<1?{wedges:y,opacity:re(s,3)}:{wedges:y}}function H2(e,t,r,n){return (Math.atan2(n-t,r-e)*180/Math.PI%360+360)%360}function Y2(e,t,r){if(e>=r.x-1e-6&&e<=r.x+r.width+1e-6&&t>=r.y-1e-6&&t<=r.y+r.height+1e-6)return null;let o=[[r.x,r.y],[r.x+r.width,r.y],[r.x,r.y+r.height],[r.x+r.width,r.y+r.height]],i=H2(e,t,r.x+r.width/2,r.y+r.height/2),s=0,a=0;for(let[c,u]of o){let l=H2(e,t,c,u)-i;l>180?l-=360:l<=-180&&(l+=360),s=Math.min(s,l),a=Math.max(a,l);}return [i+s,i+a]}function ey(e,t){let r=e[1]-e[0],n=t[1]-t[0];if(r>=360||n>=360)return true;let o=((t[0]-e[0])%360+360)%360;return o<=r||o+n>=360}function Hw(e,t){return e.slice().map((r,n)=>n<t.y||n>=t.y+t.h?r:r.map((o,i)=>i<t.x||i>=t.x+t.w?o:false))}function Kw(e,t,r){return e<7&&t<7||e>=r-7&&t<7||e<7&&t>=r-7}var Jw=.9;function Zd(e,t){let{margin:r,pixelSize:n,pattern:o="circle",plain:i=false}=t;if(w_(o))return v_(e,{margin:r,pixelSize:n,pattern:o,scale:t.scale,plain:i});let s=wd(t.scale,o),a=[],c=e.length,u=n*.45,l=i?()=>false:vd(c);return e.forEach((f,p)=>{f.forEach((m,h)=>{if(m&&(i||!Kw(h,p,c))){let d=(h+.5+r)*n,g=(p+.5+r)*n,y=`${h}-${p}`,_=a.length;if(l(h,p)){a.push(A("rect",{height:$(n),width:$(n),x:$(d-n/2),y:$(g-n/2)},y));return}switch(o){case "circle":a.push(A("circle",{cx:$(d),cy:$(g),r:$(u),transform:M`rotate(0,${d},${g})`},y));break;case "circle-large":{let b=n*.5;a.push(A("circle",{cx:$(d),cy:$(g),r:$(b),transform:M`rotate(0,${d},${g})`},y));}break;case "small-square":{let b=n*.357143;a.push(A("path",{d:M`M ${d-b} ${g-b}v ${n*.714286}h ${n*.714286}v -${n*.714286}z`,transform:M`rotate(0,${d},${g})`},y));}break;case "diamond":{let b=n*.357143;a.push(A("path",{d:M`M ${d-b} ${g-b}v ${n*.714286}h ${n*.714286}v -${n*.714286}z`,transform:M`rotate(45,${d},${g})`},y));}break;case "circle-mixed":{let b=(h+p)%3===0?Jw:(h+p)%2===0?1:1.25,v=u*b;a.push(A("circle",{cx:$(d),cy:$(g),r:$(v),transform:M`rotate(0,${d},${g})`},y));}break;case "pacman":{let b=n*.5,v=n*.357143;a.push(A("path",{d:M`M ${d-b} ${g-v}v ${n*.714286}h ${b}a ${b*.5} ${b*.5}, 0, 0, 0, 0 -${n*.714286}h -${b}v -${n*.714286}z`,transform:M`rotate(${(h+p)%2===0?0:90},${d},${g})`},y));}break;case "rounded":{let b=n*.5,v=n*.2;a.push(A("rect",{height:$(n),rx:$(v),ry:$(v),transform:M`rotate(0,${d},${g})`,width:$(n),x:$(d-b),y:$(g-b)},y));}break;case "square":{let b=n*.5;a.push(A("rect",{height:$(n),transform:M`rotate(0,${d},${g})`,width:$(n),x:$(d-b),y:$(g-b)},y));}break;case "vertical-line":{let b=n*.714286,v=n;a.push(A("path",{d:M`M ${d-n*.5} ${g-b*.5}v ${b}h ${v}v -${b}z`,transform:M`rotate(90,${d},${g})`},y));}break;default:a.push(A("circle",{cx:$(d),cy:$(g),r:$(u),transform:M`rotate(0,${d},${g})`},y));}if(s!==1&&a.length>_){let b=a.pop();a.push(A("g",{transform:M`translate(${d},${g}) scale(${$(s,6)}) translate(${-d},${-g})`,children:b},y));}}});}),a}function Xw(e,t){let r=e*Math.PI/180,n=t/2,o=t/2,i=Math.sqrt(t*t+t*t)/2,s=n-i*Math.cos(r),a=o-i*Math.sin(r),c=n+i*Math.cos(r),u=o+i*Math.sin(r);return {x1:s,y1:a,x2:c,y2:u}}function Ud(e,t){return `${e}-${Sr(JSON.stringify(t))}`}function Yw(e,t,r,n,o){let i=e;if(e===0)switch(o){case "top-left":i=0;break;case "top-right":i=90;break;case "bottom-left":i=270;break;default:i=0;}let s=i*Math.PI/180,a=t+n/2,c=r+n/2,u=Math.sqrt(n*n+n*n)/2,l=a-u*Math.cos(s),f=c-u*Math.sin(s),p=a+u*Math.cos(s),m=c+u*Math.sin(s);return {x1:l,y1:f,x2:p,y2:m}}function Ka(e,t){return t.map((r,n)=>{let{color:o,opacity:i}=qa(r.color);return A("stop",{offset:`${r.offset}%`,stopColor:o,stopOpacity:i},`${e}-stop-${n}`)})}function ry(e,t,r,n,o,i){let s=X2(t.stops,t.angle??0,r,n,o),a=s.wedges.map((c,u)=>A("path",{d:c.d,"data-arc":`${c.from} ${c.sweep}`,fill:c.color,fillOpacity:c.opacity,shapeRendering:c.opacity===void 0?void 0:"crispEdges"},`${e}-w-${u}`));return A("pattern",{"data-qrdx-conic":`${$(r)} ${$(n)}`,height:$(i),id:e,patternUnits:"userSpaceOnUse",width:$(i),x:0,y:0,children:s.opacity===void 0?a:A("g",{opacity:s.opacity,children:a})},e)}function e7(e="center"){let[t,r]=e.split("-"),n=e==="center"?"center":t,o=r??(t==="left"||t==="right"?t:"center");return {x:o==="left"?0:o==="right"?1:.5,y:n==="top"?0:n==="bottom"?1:.5}}var t7=["xMin","xMid","xMax"],r7=["YMin","YMid","YMax"];function ny(e,t,r){let n=t.scale??1,o=t.fit==="tile",i=o?r/4*n:r,s=t.underlay?qa(t.underlay):null,a=o?i:r*n,c=e7(t.position),u=o?0:c.x*(r-a),l=o?0:c.y*(r-a),f=o?"xMidYMid slice":`${t7[c.x*2]??"xMid"}${r7[c.y*2]??"YMid"} ${t.fit==="contain"?"meet":"slice"}`;return le("pattern",{height:$(i),id:e,patternUnits:"userSpaceOnUse",width:$(i),x:0,y:0,children:[s&&A("rect",{fill:s.color,fillOpacity:s.opacity,height:$(i),width:$(i),x:0,y:0}),A("image",{height:$(a),href:t.src,opacity:(t.opacity??1)<1?t.opacity:void 0,preserveAspectRatio:f,width:$(a),x:$(u),y:$(l)})]},e)}var oy=(e,t)=>Ud("img",[e,t]);function n7(e,t,r,n,o,i,s){let a=dr(e);if(a.type==="solid")return null;if(a.type==="image"){let u=oy(a,s);return {id:u,element:ny(u,a,s)}}let c=Ud(i,[a,t,r,n,o,...a.type==="angular"?[s]:[]]);if(a.type==="linear"){let u=a,l=u.angle??0,{x1:f,y1:p,x2:m,y2:h}=Yw(l,t,r,n,o);return {id:c,element:A("linearGradient",{gradientUnits:"userSpaceOnUse",id:c,x1:$(f),x2:$(m),y1:$(p),y2:$(h),children:Ka(c,u.stops)},c)}}if(a.type==="radial"){let u=a,l=t+n/2,f=r+n/2,p=n/2*.97;return {id:c,element:A("radialGradient",{cx:$(l),cy:$(f),fx:$(l),fy:$(f),gradientUnits:"userSpaceOnUse",id:c,r:$(p),children:Ka(c,u.stops)},c)}}return a.type==="angular"?{id:c,element:ry(c,a,t+n/2,r+n/2,n*.75,s)}:null}function Bd(e,t,r){let n=dr(e);if(n.type==="solid")return null;if(n.type==="image"){let i=oy(n,t);return {id:i,element:ny(i,n,t)}}let o=Ud(r,[n,t]);if(n.type==="linear"){let i=n,s=i.angle??0,{x1:a,y1:c,x2:u,y2:l}=Xw(s,t);return {id:o,element:A("linearGradient",{gradientUnits:"userSpaceOnUse",id:o,x1:$(a),x2:$(u),y1:$(c),y2:$(l),children:Ka(o,i.stops)},o)}}if(n.type==="radial"){let i=n,s=t/2,a=t/2,c=t/2*.97;return {id:o,element:A("radialGradient",{cx:$(s),cy:$(a),fx:$(s),fy:$(a),gradientUnits:"userSpaceOnUse",id:o,r:$(c),children:Ka(o,i.stops)},o)}}return n.type==="angular"?{id:o,element:ry(o,n,t/2,t/2,t*.75,t)}:null}var Ha=e=>Qo(e)||gg(e);function ty(e){let t=new Set,r=[];for(let n of e)n&&!t.has(n.id)&&(t.add(n.id),r.push(n.element));return r}function St(e,t,r){if(t)return {fill:`url(#${t})`};let n=dr(e,r),o=n.type==="solid"?n.color:n.type==="image"?n.underlay??r:r,{color:i,opacity:s}=qa(o);return s===void 0?{fill:i}:{fill:i,fillOpacity:s}}function Va(e,t,r,n){if(n==null)return null;let o=e.length,i=Math.floor(t*pi),s=(o+2*r)/t,a=(n.width||i)*s,c=(n.height||i)*s,u=n.x==null?o/2-a/2:n.x*s,l=n.y==null?o/2-c/2:n.y*s,f=null;if(n.excavate){let p=Math.max(0,n.padding??0)*s,m=Math.floor(u-p),h=Math.floor(l-p),d=Math.ceil(a+u+p-m),g=Math.ceil(c+l+p-h);f={x:m,y:h,w:d,h:g};}return {x:u,y:l,h:c,w:a,excavation:f}}function oi(e){let t=e.level??Qn,{imageSettings:r}=e,n=e.isOGContext&&r?.excavate&&(t==="L"||t==="M")?"Q":t;if(e.autoLevel&&r&&n!=="H"){let o=Qe.QrCode.encodeText(e.value,ht[n]).getModules(),i=Va(o,e.size??Je,vt(o.length,e.margin??Vn,e.shape),r);i&&(i.excavation?i.excavation.w*i.excavation.h:i.w*i.h)/(o.length*o.length)>Tg&&(n="H");}return n}function o7(e,t,r,n){let o=t/r,i=e.w*o,s=e.h*o,a=(e.x+n)*o,c=(e.y+n)*o;return {imgWidth:i,imgHeight:s,imgLeft:a,imgTop:c}}function Zn(e){let{value:t,size:r=Je,level:n=Qn,bgColor:o=Ie,fgColor:i=Zr,eyeColor:s,dotColor:a,bodyPattern:c="circle",cornerEyePattern:u="gear",cornerEyeDotPattern:l="circle",margin:f=Vn,isOGContext:p=false,imageSettings:m,templateId:h,customTemplate:d,customProps:g,frame:y,art:_,eyeColors:b,moduleScale:v,autoLevel:C,shape:w,frameLabelMarkers:x,partMarkers:E,...P}=e,R=x2({value:t,size:r,margin:f,level:n,shape:w,autoLevel:C,isOGContext:p},m),I=Vt(y),N=I?{}:P,O=ue=>I?Y_(ue,{size:r,frame:y,bgColor:o,svgProps:P,markLabels:x}):ue,V=oi({value:t,size:r,level:n,margin:f,imageSettings:R,isOGContext:p,autoLevel:C,shape:w}),Q=Qe.QrCode.encodeText(t,ht[V]),F=Q.getModules(),W=vt(F.length,f,w),K=p2(t,F.length,f,w),U=(ue,Ge)=>v2(E,ue,Ge),X=(ue,Ge)=>{let lt=m2(w,ue);return lt?"circle"in lt?A("circle",{cx:$(ue/2),cy:$(ue/2),...Ge,r:$(ue/2),...U("background")}):A("path",{d:lt.path,...Ge,...U("background")}):A("rect",{...Ge,height:ue,width:ue,x:0,y:0,...U("background")})},we=F.length+W*2,Me=Va(F,r,W,R),ge=null;if(R!=null&&Me!=null){Me.excavation!=null&&(F=Hw(F,Me.excavation));let{imgWidth:ue,imgHeight:Ge,imgLeft:lt,imgTop:Tr}=o7(Me,r,we,W);if(p){let Fr=R.shape??"square";ge=A("img",{alt:"Logo",src:R.src,style:{position:"absolute",left:`${$(lt)}px`,top:`${$(Tr)}px`,width:`${$(ue)}px`,height:`${$(Ge)}px`,...Fr!=="square"&&{borderRadius:Fr==="circle"?"50%":`${$(Math.min(ue,Ge)*Id)}px`},...R.plate&&{backgroundColor:R.plate,padding:`${$(ue*zd)}px`,boxSizing:"border-box"}}});}else ge=$2(R,{x:lt,y:Tr,w:ue,h:Ge}),E&&(ge=Mn(ge,U("logo")));}let me=r/we,Ae=F.length,J=7*me,Pt=1.5*me,Un={fgColor:Ve(i,Zr),bgColor:Ve(o,Ie)},ut=Jg(_)?i_({art:_,modules:F,version:Q.version,margin:W,pixelSize:me,...Un,body:ue=>Zd(ue,{margin:W,pixelSize:me,pattern:c,scale:v})}):null,Gn=ut&&E?Mn(ut,U("body")):ut,sh=ut&&_?$_({art:_,version:Q.version,...Un}):null,nb=ut?null:Zd(F,{margin:W,pixelSize:me,pattern:c,scale:v}),cc=K?Zd(K,{margin:0,pixelSize:me,pattern:c,scale:v,plain:true}):null,fi=dr(o,Ie),ah=dr(i,Zr),ch=Ha(fi)?Bd(fi,r,"bg-color"):null,uc=Ha(ah)?Bd(ah,r,"fg-color"):null,ob=St(o,ch?.id??null,Ie),uh=St(i,uc?.id??null,Zr),lh=Gn?le($r,{children:[Gn,cc&&A("g",{...uh,...U("body"),children:cc})]}):le("g",{...uh,...U("body"),children:[nb,cc]}),Ar=W*me,Er=W*me,Rr=(Ae-7+W)*me,Mr=W*me,Ir=W*me,zr=(Ae-7+W)*me,qt=Ve(i,Zr),Nr=ue=>b?.[ue]?.outer??sh?.[ue]?.outer??s,Lr=ue=>b?.[ue]?.inner??sh?.[ue]?.inner??a,Or=(ue,Ge,lt,Tr,Fr)=>{let gc=dr(ue,qt);return Ha(gc)?n7(gc,Ge,lt,J,Tr,Fr,r):null},lc=Or(Nr("topLeft"),Ar,Er,"top-left","corners-square-color-0-0"),fc=Or(Nr("topRight"),Rr,Mr,"top-right","corners-square-color-1-0"),pc=Or(Nr("bottomLeft"),Ir,zr,"bottom-left","corners-square-color-0-1"),mc=Or(Lr("topLeft"),Ar,Er,"top-left","corners-dot-color-0-0"),dc=Or(Lr("topRight"),Rr,Mr,"top-right","corners-dot-color-1-0"),hc=Or(Lr("bottomLeft"),Ir,zr,"bottom-left","corners-dot-color-0-1"),fh=St(Nr("topLeft"),lc?.id??null,qt),ph=St(Nr("topRight"),fc?.id??null,qt),mh=St(Nr("bottomLeft"),pc?.id??null,qt),dh=St(Lr("topLeft"),mc?.id??null,qt),hh=St(Lr("topRight"),dc?.id??null,qt),gh=St(Lr("bottomLeft"),hc?.id??null,qt),_h=Qa(Ar,Er,J,u,"top-left"),yh=Ga(Ar+J/2,Er+J/2,Pt,l,"top-left"),bh=Qa(Rr,Mr,J,u,"top-right"),$h=Ga(Rr+J/2,Mr+J/2,Pt,l,"top-right"),xh=Qa(Ir,zr,J,u,"bottom-left"),wh=Ga(Ir+J/2,zr+J/2,Pt,l,"bottom-left"),ib=le($r,{children:[A("defs",{children:ty([ch,uc,lc,fc,pc,mc,dc,hc])}),X(r,ob),lh,A("g",{...fh,...U("eye-outer","top-left"),children:A("path",{d:_h,fillRule:"evenodd",transform:M`rotate(0,${Ar+J/2},${Er+J/2})`})}),A("g",{...dh,...U("eye-centre","top-left"),children:yh}),A("g",{...ph,...U("eye-outer","top-right"),children:A("path",{d:bh,fillRule:"evenodd",transform:M`rotate(0,${Rr+J/2},${Mr+J/2})`})}),A("g",{...hh,...U("eye-centre","top-right"),children:$h}),A("g",{...mh,...U("eye-outer","bottom-left"),children:A("path",{d:xh,fillRule:"evenodd",transform:M`rotate(0,${Ir+J/2},${zr+J/2})`})}),A("g",{...gh,...U("eye-centre","bottom-left"),children:wh}),ge]}),vh=d||(h?j2(h):void 0);if(vh){let Ge=Ha(fi)?Bd(fi,300,"bg-color-template"):null,lt=St(o,Ge?.id??null,Ie),Tr=le("svg",{height:300,viewBox:"0 0 300 300",width:300,xmlns:"http://www.w3.org/2000/svg",children:[A("defs",{children:ty([Ge,uc,lc,fc,pc,mc,dc,hc])}),X(300,lt),le("g",{transform:`scale(${$(300/r,6)})`,children:[lh,A("g",{...fh,...U("eye-outer","top-left"),children:A("path",{d:_h,fillRule:"evenodd",transform:M`rotate(0,${Ar+J/2},${Er+J/2})`})}),A("g",{...dh,...U("eye-centre","top-left"),children:yh}),A("g",{...ph,...U("eye-outer","top-right"),children:A("path",{d:bh,fillRule:"evenodd",transform:M`rotate(0,${Rr+J/2},${Mr+J/2})`})}),A("g",{...hh,...U("eye-centre","top-right"),children:$h}),A("g",{...mh,...U("eye-outer","bottom-left"),children:A("path",{d:xh,fillRule:"evenodd",transform:M`rotate(0,${Ir+J/2},${zr+J/2})`})}),A("g",{...gh,...U("eye-centre","bottom-left"),children:wh}),ge]})]}),Fr=300/r,sb={pixelSize:me*Fr,url:t},Sh=vh.wrapper(Tr,{fgColor:i,bgColor:o,...g||{},...P},sb),ab={...Sh?.props?.style||{},width:void 0,height:void 0,...N.style};return O(Mn(Sh,{...N,width:r,height:r,style:ab}))}return O(A("svg",{height:r,viewBox:`0 0 ${r} ${r}`,width:r,xmlns:"http://www.w3.org/2000/svg",...N,children:ib}))}(()=>{try{new Path2D().addPath(new Path2D);}catch{return false}return true})();var i7=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"]]),s7=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"]]),a7=new Set(["children","dangerouslySetInnerHTML","key","defaultValue","defaultChecked","innerHTML","suppressContentEditableWarning","suppressHydrationWarning","ref"]),c7=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"]),u7=new Set(["autoFocus","multiple","muted"]),l7=new Set(["contentEditable","spellCheck","draggable","value","autoReverse","externalResourcesRequired","focusable","preserveAlpha"]),f7=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(" ")),iy=":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",p7=new RegExp(`^[${iy}][${iy}\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`),Ja=/^[a-zA-Z][a-zA-Z:_.\-\d]*$/,m7=/^[\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,d7="javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')",h7=e=>m7.test(e)?d7:e,ay=new Set(["area","base","br","col","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"]),g7=/["'&<>]/;function Gd(e){if(!g7.test(e))return e;let t="",r=0;for(let n=0;n<e.length;n++){let o;switch(e.charCodeAt(n)){case 34:o="&quot;";break;case 38:o="&amp;";break;case 39:o="&#x27;";break;case 60:o="&lt;";break;case 62:o="&gt;";break;default:continue}t+=e.slice(r,n)+o,r=n+1;}return t+e.slice(r)}var Ct=e=>typeof e=="function"||typeof e=="symbol",sy=new Map,_7=e=>{let t=sy.get(e);return t===void 0&&(t=e.replace(/([A-Z])/g,"-$1").toLowerCase().replace(/^ms-/,"-ms-"),sy.set(e,t)),t};function y7(e){if(typeof e=="string")return e;if(typeof e!="object"||e===null)return "";let t="";for(let r of Object.keys(e)){let n=e[r];if(n==null||typeof n=="boolean"||n==="")continue;let o;if(r.startsWith("--"))o=`${r}:${`${n}`.trim()}`;else {let i=typeof n=="number"?n===0||f7.has(r)?`${n}`:`${n}px`:`${n}`.trim();o=`${_7(r)}:${i}`;}t=t?`${t};${o}`:o;}return t}function Xa(e,t){if(t==null||a7.has(e))return null;let r=s7.get(e);if(r!==void 0)return Ct(t)||typeof t=="boolean"?null:{name:r,value:`${t}`};switch(e){case "style":{let o=y7(t);return o?{name:"style",value:o}:null}case "src":case "href":case "action":case "formAction":case "xlinkHref":return (e==="src"||e==="href")&&t===""||Ct(t)||typeof t=="boolean"?null:{name:e==="xlinkHref"?"xlink:href":e,value:h7(`${t}`)};case "capture":case "download":return t===true?{name:e,value:""}:t===false||Ct(t)?null:{name:e,value:`${t}`};case "cols":case "rows":case "size":case "span":return Ct(t)||Number.isNaN(Number(t))||!(t>=1)?null:{name:e,value:`${t}`};case "rowSpan":case "start":return Ct(t)||Number.isNaN(Number(t))?null:{name:e,value:`${t}`};}if(u7.has(e))return t&&!Ct(t)?{name:e.toLowerCase(),value:""}:null;if(l7.has(e))return Ct(t)?null:{name:e,value:`${t}`};if(c7.has(e))return t&&!Ct(t)?{name:e,value:""}:null;if(e.length>2&&(e[0]==="o"||e[0]==="O")&&(e[1]==="n"||e[1]==="N"))return null;let n=i7.get(e)??e;if(!p7.test(n)||Ct(t))return null;if(typeof t=="boolean"){let o=n.toLowerCase().slice(0,5);if(o!=="data-"&&o!=="aria-")return null}return {name:n,value:`${t}`}}var cy="http://www.w3.org/2000/svg",uy="http://www.w3.org/1999/xhtml",b7="http://www.w3.org/1999/xlink",$7="http://www.w3.org/XML/1998/namespace",x7="http://www.w3.org/2000/xmlns/";function w7(e,t,r){t==="xmlns"||t.startsWith("xmlns:")?e.setAttributeNS(x7,t,r):t.startsWith("xlink:")?e.setAttributeNS(b7,t,r):t.startsWith("xml:")?e.setAttributeNS($7,t,r):e.setAttribute(t,r);}function ai(e,t,r,n){if(t==null||typeof t=="boolean")return;if(typeof t=="string"||typeof t=="number"||typeof t=="bigint"){e.appendChild(n.createTextNode(`${t}`));return}if(Array.isArray(t)){for(let c of t)ai(e,c,r,n);return}if(!Ia(t))throw new TypeError("qrdx: can't render this value as DOM nodes");let{type:o,props:i}=t;if(za(o)){ai(e,i.children,r,n);return}if(typeof o=="function"){ai(e,o(i),r,n);return}if(!Ja.test(o))throw new TypeError(`qrdx: invalid element name: ${o}`);let s=o==="svg"?cy:r,a=n.createElementNS(s,o);for(let c of Object.keys(i)){let u=Xa(c,i[c]);u&&w7(a,u.name,u.value);}ai(a,i.children,s===cy&&o==="foreignObject"?uy:s,n),e.appendChild(a);}function Qd(e,t=document){let r=t.createDocumentFragment();return ai(r,e,uy,t),r}function ct(e){if(e==null||typeof e=="boolean")return "";if(typeof e=="string")return Gd(e);if(typeof e=="number"||typeof e=="bigint")return `${e}`;if(Array.isArray(e)){let t="";for(let r of e)t+=ct(r);return t}if(!Ia(e))throw new TypeError("qrdx: can't render this value as SVG markup");return v7(e)}function v7(e){let{type:t,props:r}=e;if(za(t))return ct(r.children);if(typeof t=="function")return ct(t(r));if(!Ja.test(t))throw new TypeError(`qrdx: invalid element name: ${t}`);let n=`<${t}`;for(let s of Object.keys(r)){let a=Xa(s,r[s]);a&&(n+=` ${a.name}="${Gd(a.value)}"`);}if(ay.has(t))return `${n}/>`;let o=r.dangerouslySetInnerHTML?.__html,i=o==null?ct(r.children):`${o}`;return `${n}>${i}</${t}>`}function ly(e){return ct(Zn(e))}var Vd=[17,18,0,1,2,3,4,5,16,6,7,8,9,10,11,12,13,14,15],S7=8,jd=class{buffer;position=0;bits=0;used=0;constructor(t){this.buffer=new Uint8Array(Math.max(t,64));}write(t,r){if(r!==0)for(this.bits|=t<<this.used,this.used+=r;this.used>=8;){if(this.position===this.buffer.length){let n=new Uint8Array(this.buffer.length*2);n.set(this.buffer),this.buffer=n;}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 gy(e,t){let r=new Uint8Array(e.length),n=[];for(let u=0;u<e.length;u++)(e[u]??0)>0&&n.push(u);if(n.length===0)return r;if(n.length===1)return r[n[0]]=1,r;let o=n.length,i=2*o-1,s=new Float64Array(i),a=new Int32Array(i),c=new Uint8Array(i);for(let u=1;;u*=2){for(let d=0;d<o;d++)s[d]=Math.max(e[n[d]]??0,u);let l=Array.from({length:o},(d,g)=>g).sort((d,g)=>s[d]-s[g]||d-g),f=0,p=o,m=d=>f<o&&(p>=d||s[l[f]]<=s[p])?l[f++]:p++;for(let d=o;d<i;d++){let g=m(d),y=m(d);s[d]=s[g]+s[y],a[g]=d,a[y]=d;}c[i-1]=0;let h=0;for(let d=i-2;d>=0;d--){let g=c[a[d]]+1;c[d]=g,d<o&&g>h&&(h=g);}if(h<=t){for(let d=0;d<o;d++)r[n[d]]=c[d];return r}}}function C7(e,t){let r=0;for(let n=0;n<t;n++)r=r<<1|e>>n&1;return r}function _y(e){let t=new Uint16Array(16),r=0;for(let a of e)a>0&&(t[a]=t[a]+1,r++);let n=new Uint16Array(16),o=0;for(let a=1;a<=15;a++)o=o+t[a-1]<<1,n[a]=o;let i=new Uint16Array(e.length),s=new Uint8Array(e.length);return e.forEach((a,c)=>{if(a===0)return;let u=n[a];n[a]=u+1,i[c]=C7(u,a),s[c]=r===1?0:a;}),{lengths:e,codes:i,emitted:s}}function Pr(e,t,r){e.write(t.codes[r],t.emitted[r]);}function P7(e){let t=[],r=i=>t.push({code:i,extra:0,extraBits:0}),n=S7,o=0;for(;o<e.length;){let i=e[o],s=1;for(;o+s<e.length&&e[o+s]===i;)s++;o+=s;let a=s;if(i===0){for(;a>0;)if(a<3)for(;a>0;a--)r(0);else if(a<=10)t.push({code:17,extra:a-3,extraBits:3}),a=0;else {let c=Math.min(a,138);t.push({code:18,extra:c-11,extraBits:7}),a-=c;}continue}for(i!==n&&(r(i),n=i,a--);a>0;)if(a<3)for(;a>0;a--)r(i);else {let c=Math.min(a,6);t.push({code:16,extra:c-3,extraBits:2}),a-=c;}}return t}function k7(e,t){let r=[];if(t.forEach((a,c)=>{a>0&&r.push(c);}),r.length<=2&&r.every(a=>a<256)){let[a=0,c]=r;e.write(1,1),e.write(r.length===2?1:0,1),a<2?(e.write(0,1),e.write(a,1)):(e.write(1,1),e.write(a,8)),c!==void 0&&e.write(c,8);return}let n=P7(t),o=new Uint32Array(19);for(let a of n)o[a.code]=o[a.code]+1;let i=_y(gy(o,7)),s=Vd.length;for(;s>4&&i.lengths[Vd[s-1]]===0;)s--;e.write(0,1),e.write(s-4,4);for(let a=0;a<s;a++)e.write(i.lengths[Vd[a]],3);e.write(0,1);for(let a of n)Pr(e,i,a.code),e.write(a.extra,a.extraBits);}function Ya(e){let t=e-1;if(t<4)return {symbol:t,extra:0,extraBits:0};let r=31-Math.clz32(t),n=t>>r-1&1,o=r-1;return {symbol:2*r+n,extra:t&(1<<o)-1,extraBits:o}}function fy(e,t,r,n){let o=0;for(;o<n&&e[t+o]===e[t+o-r];)o++;return o}function py(e,t,r){let n=e.length,o=0;for(;o<n;){let i=Math.min(4096,n-o),s=o>=1?fy(e,o,1,i):0,a=o>=t?fy(e,o,t,i):0;if(Math.max(s,a)>=3){a>=s?(r.copy(a,t===1?2:1),o+=a):(r.copy(s,2),o+=s);continue}r.literal(e[o]),o++;}}var my=20;function dy(e,t,r){for(let n=0;n<r.length;n++)e[t+n]=r.charCodeAt(n);}function hy(e,t,r){e[t]=r&255,e[t+1]=r>>>8&255,e[t+2]=r>>>16&255,e[t+3]=r>>>24&255;}function yy(e,t,r){if(!(Number.isInteger(t)&&Number.isInteger(r))||t<1||r<1||t>16384||r>16384)throw new RangeError(`WebP images are 1 to 16384 pixels wide and high (got ${t} \xD7 ${r})`);let n=t*r;if(e.length<n*4)throw new RangeError(`Expected ${n*4} bytes of RGBA for ${t} \xD7 ${r}, got ${e.length}`);let o=new Uint32Array(n),i=false;for(let C=0;C<n;C++){let w=C*4,x=e[w],E=e[w+1],P=e[w+2],R=e[w+3];R!==255&&(i=true),o[C]=(R<<24|(x-E&255)<<16|E<<8|P-E&255)>>>0;}let s=new Uint32Array(280),a=new Uint32Array(256),c=new Uint32Array(256),u=new Uint32Array(256),l=new Uint32Array(40);py(o,t,{literal(C){s[C>>>8&255]++,a[C>>>16&255]++,c[C&255]++,u[C>>>24]++;},copy(C,w){s[256+Ya(C).symbol]++,l[Ya(w).symbol]++;}});let f=[s,a,c,u,l].map(C=>gy(C,15)),[p,m,h,d,g]=f.map(_y),y=new jd(Math.ceil(n/4)+1024);y.write(47,8),y.write(t-1,14),y.write(r-1,14),y.write(i?1:0,1),y.write(0,3),y.write(1,1),y.write(2,2),y.write(0,1),y.write(0,1),y.write(0,1);for(let C of f)k7(y,C);py(o,t,{literal(C){Pr(y,p,C>>>8&255),Pr(y,m,C>>>16&255),Pr(y,h,C&255),Pr(y,d,C>>>24);},copy(C,w){let x=Ya(C);Pr(y,p,256+x.symbol),y.write(x.extra,x.extraBits);let E=Ya(w);Pr(y,g,E.symbol),y.write(E.extra,E.extraBits);}});let _=y.finish(),b=_.length+(_.length&1),v=new Uint8Array(my+b);return dy(v,0,"RIFF"),hy(v,4,v.length-8),dy(v,8,"WEBPVP8L"),hy(v,16,_.length),v.set(_,my),v}function qd(e,t,r){return String.fromCharCode(...e.subarray(t,t+r))}function A7(e){return e.length>=12&&qd(e,0,4)==="RIFF"&&qd(e,8,4)==="WEBP"}function by(e){if(!A7(e))return null;let t=12;for(;t+8<=e.length;){let r=qd(e,t,4);if(r==="VP8L")return "lossless";if(r==="VP8 ")return "lossy";let n=(e[t+4]|e[t+5]<<8|e[t+6]<<16|e[t+7]<<24)>>>0;t+=8+n+(n&1);}return null}function E7(e,t,r){return typeof e.toBlob!="function"?Promise.resolve(null):new Promise(n=>{try{e.toBlob(n,t,r);}catch{n(null);}})}async function ec(e,t={}){let r=t.quality!==void 0,n=r?Math.min(1,Math.max(0,Number(t.quality))):1,o=await E7(e,"image/webp",n);if(o){let c=new Uint8Array(await o.arrayBuffer()),u=by(c);if(u==="lossless"||r&&u==="lossy")return new Blob([c],{type:"image/webp"})}let i=e.getContext("2d");if(!i)throw new Error("Could not get canvas context");let{data:s}=i.getImageData(0,0,e.width,e.height),a=yy(s,e.width,e.height);return new Blob([a],{type:"image/webp"})}var $y=32768;async function ci(e){let t=new Uint8Array(await e.arrayBuffer()),r="";for(let n=0;n<t.length;n+=$y)r+=String.fromCharCode(...t.subarray(n,n+$y));return `data:${e.type||"application/octet-stream"};base64,${btoa(r)}`}async function kr(e){let t={...e};if(e.imageSettings?.src)try{let l=await R7(e.imageSettings.src);t={...e,imageSettings:{...e.imageSettings,src:l}};}catch{let{imageSettings:l,...f}=e;t=f;}let{hideLogo:r,url:n,logo:o,scale:i,frameLabelMarkers:s,partMarkers:a,...c}=t,u=ly({...c,templateId:t.templateId,customTemplate:t.customTemplate});return `data:image/svg+xml,${encodeURIComponent(u)}`}var R7=e=>new Promise((t,r)=>{if(e.startsWith("data:")){t(e);return}let n=new Image;n.crossOrigin="anonymous",n.onload=()=>{try{let o=document.createElement("canvas");o.width=n.naturalWidth||n.width,o.height=n.naturalHeight||n.height;let i=o.getContext("2d");if(!i){r(new Error("Could not get canvas context"));return}i.drawImage(n,0,0);let s=o.toDataURL("image/png");o.remove(),t(s);}catch(o){r(new Error(`Failed to convert image to base64: ${o}`));}},n.onerror=()=>{r(new Error(`Could not load image from ${e.slice(0,100)}... Check CORS settings or use a data URL.`));},n.src=e;});async function tc(e,t,r){let n=await kr(e),o=decodeURIComponent(n.replace("data:image/svg+xml,","")),i;try{let s=new TextEncoder().encode(o),a=Array.from(s,u=>String.fromCharCode(u)).join("");i=`data:image/svg+xml;base64,${btoa(a)}`;}catch(s){throw new Error(`Failed to encode SVG for canvas conversion: ${s}`)}return new Promise((s,a)=>{let c=document.createElement("canvas"),u=c.getContext("2d");if(!u){a(new Error("Could not get canvas context"));return}let l=new Image,{width:f,height:p}=ri(e.size||Je,e.frame);c.width=Math.round(f),c.height=Math.round(p);let m=setTimeout(()=>{c.remove(),a(new Error("SVG load timeout - image may be too large or contain invalid data"));},3e4);l.onload=()=>{clearTimeout(m);try{if(t==="image/jpeg"&&(u.fillStyle="white",u.fillRect(0,0,c.width,c.height)),u.drawImage(l,0,0,c.width,c.height),r)s(c);else if(t==="image/webp")ec(c).then(ci).then(s,a).finally(()=>c.remove());else {let h=c.toDataURL(t,1);c.remove(),s(h);}}catch(h){clearTimeout(m),c.remove(),a(new Error(`Failed to draw SVG to canvas: ${h}`));}},l.onerror=()=>{clearTimeout(m),c.remove(),a(new Error("Could not load SVG"));},l.src=i;})}var xy=["gradientUnits","gradientTransform","spreadMethod"],M7={linear:["x1","y1","x2","y2"],radial:["cx","cy","r","fx","fy","fr"]},I7={r:0,g:0,b:0,a:1};function wy(e,t){for(let r of (e.attrs.style??"").split(";")){let[n,...o]=r.split(":");if(n?.trim()===t)return o.join(":").trim()}return e.attrs[t]}function Wd(e){return e.name==="linearGradient"?"linear":e.name==="radialGradient"?"radial":null}function z7(e){let t=[],r=0;for(let n of e.children){if(n.name!=="stop")continue;let o=(n.attrs.offset??"0").trim(),i=Number.parseFloat(o),s=Number.isFinite(i)?o.endsWith("%")?i/100:i:0;r=Math.max(r,Math.min(Math.max(s,0),1));let a=wy(n,"stop-color")??"#000000",c=Re(a==="currentColor"?"#000000":a)??I7,u=Number.parseFloat(wy(n,"stop-opacity")??"1");t.push({offset:r,color:Number.isFinite(u)?{...c,a:c.a*Math.min(Math.max(u,0),1)}:c});}return t}function Sy(e){let t=new Map,r=o=>{let i=o.attrs.id;Wd(o)&&i&&!t.has(i)&&t.set(i,o);for(let s of o.children)r(s);};r(e);let n=new Map;for(let[o,i]of t){let s=Wd(i),a={},c=[],u=new Set,l=i;for(;l&&!u.has(l);){u.add(l);let f=Wd(l)===s?[...xy,...M7[s]]:xy;for(let m of f){let h=l.attrs[m];a[m]===void 0&&h!==void 0&&(a[m]=h);}c.length===0&&(c=z7(l));let p=l.attrs.href??l.attrs["xlink:href"];l=p?.startsWith("#")?t.get(p.slice(1)):void 0;}n.set(o,{kind:s,attrs:a,stops:c});}return n}function Hd(e){let t=Number.POSITIVE_INFINITY,r=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY,o=Number.NEGATIVE_INFINITY,i=(f,p)=>{t=Math.min(t,f),n=Math.max(n,f),r=Math.min(r,p),o=Math.max(o,p);},s=(f,p,m,h)=>{let d=-f+3*p-3*m+h,g=2*(f-2*p+m),y=p-f;if(Math.abs(d)<1e-12)return Math.abs(g)<1e-12?[]:[-y/g];let _=g*g-4*d*y;if(_<0)return [];let b=Math.sqrt(_);return [(-g+b)/(2*d),(-g-b)/(2*d)]},a=(f,p,m,h,d)=>{let g=1-f;return g*g*g*p+3*g*g*f*m+3*g*f*f*h+f**3*d},c=0,u=0,l=[0,0];for(let f of e)if(f.op==="M"&&(l=[f.x,f.y]),f.op==="M"||f.op==="L")i(f.x,f.y),c=f.x,u=f.y;else if(f.op==="C"){i(f.x,f.y);for(let p of [...s(c,f.x1,f.x2,f.x),...s(u,f.y1,f.y2,f.y)])p>0&&p<1&&i(a(p,c,f.x1,f.x2,f.x),a(p,u,f.y1,f.y2,f.y));c=f.x,u=f.y;}else [c,u]=l;return Number.isFinite(t)?{x:t,y:r,width:n-t,height:o-r}:null}var N7=e=>e[0]*e[3]-e[1]*e[2];function Bn(e){let t=N7(e);if(!Number.isFinite(t)||Math.abs(t)<1e-12)return null;let[r,n,o,i,s,a]=e;return [i/t,-n/t,-o/t,r/t,(o*a-i*s)/t,(n*s-r*a)/t]}function Cy(e,t,r){let{kind:n,attrs:o,stops:i}=e,s=i[0],a=i.at(-1);if(!(s&&a)||i.every(w=>w.color.a===0))return null;if(i.length===1)return s.color;let c=o.gradientUnits==="userSpaceOnUse",u=xa;if(!c){let w=Hd(t);if(!w||w.width<=0||w.height<=0)return null;u=[w.width,0,0,w.height,w.x,w.y];}let l=Fe(u,hr(o.gradientTransform));if(!Bn(l))return a.color;let[f,p]=r,m=Math.sqrt((f*f+p*p)/2),h=(w,x)=>{let E=Number.parseFloat(w);return Number.isFinite(E)?w.trim().endsWith("%")?E/100*(c?x:1):E:null},d=(w,x,E)=>h(o[w]??x,E)??h(x,E)??0;if(n==="linear"){let w=[d("x1","0%",f),d("y1","0%",p),d("x2","100%",f),d("y2","0%",p)],[x,E,P,R]=w;return x===P&&E===R?a.color:{kind:n,coords:w,matrix:l,stops:i}}let g=d("cx","50%",f),y=d("cy","50%",p),_=d("r","50%",m),b=o.fx===void 0?g:d("fx","50%",f),v=o.fy===void 0?y:d("fy","50%",p),C=Math.max(0,d("fr","0%",m));return _<0?null:_===0?a.color:{kind:n,coords:[b,v,C,g,y,_],matrix:l,stops:i}}function Py(e){return e.map(t=>$(t,6)).join(" ")}function L7(e,t){return (t==="cmyk"?Xo(e.r,e.g,e.b):[e.r/255,e.g/255,e.b/255]).map(n=>$(n,4)).join(" ")}var vy=(e,t)=>`<< /FunctionType 2 /Domain [0 1] /C0 [${e}] /C1 [${t}] /N 1 >>`;function O7(e,t){let r=[],n=e.map(a=>re(a.offset,4)),o=e.map(a=>L7(a.color,t)),i=n[0],s=n.at(-1);if(i>0){let a=o[0];r.push({from:0,to:i,c0:a,c1:a});}for(let a=0;a+1<e.length;a++){let c=n[a],u=n[a+1];u>c&&r.push({from:c,to:u,c0:o[a],c1:o[a+1]});}if(s<1){let a=o.at(-1);r.push({from:s,to:1,c0:a,c1:a});}if(r.length===1){let[a]=r;return vy(a.c0,a.c1)}return ["<< /FunctionType 3 /Domain [0 1]",`/Functions [${r.map(a=>vy(a.c0,a.c1)).join(" ")}]`,`/Bounds [${r.slice(1).map(a=>$(a.from,4)).join(" ")}]`,`/Encode [${r.map(()=>"0 1").join(" ")}] >>`].join(" ")}function ky(e,t){return [`<< /ShadingType ${e.kind==="linear"?2:3}`,`/ColorSpace /Device${t==="cmyk"?"CMYK":"RGB"}`,`/Coords [${e.coords.map(r=>$(r,6)).join(" ")}]`,`/Function ${O7(e.stops,t)}`,"/Extend [true true] >>"].join(" ")}function T7(e,t){if(e.op==="Z")return e;if(e.op==="C"){let[o,i]=be(t,e.x1,e.y1),[s,a]=be(t,e.x2,e.y2),[c,u]=be(t,e.x,e.y);return {op:"C",x1:o,y1:i,x2:s,y2:a,x:c,y:u}}let[r,n]=be(t,e.x,e.y);return {op:e.op,x:r,y:n}}var Ay={r:255,g:255,b:255,a:1},F7=/^url\(\s*#bg-color-/,rc=/^url\(\s*#([^)\s]+)\s*\)/,D7=new Set(["defs","clipPath","mask","pattern","linearGradient","radialGradient","symbol","title","desc","metadata","style","script","use","foreignObject"]);function Ce(e,t){let r=e.attrs.style;if(r)for(let n of r.split(";")){let[o,...i]=n.split(":");if(o?.trim()===t)return i.join(":").trim()}return e.attrs[t]}function fe(e,t,r=0){if(e===void 0||e==="")return r;let n=Number.parseFloat(e);return Number.isNaN(n)?r:e.trim().endsWith("%")?n/100*t:n}function Kd(e,t){if((e.name==="linearGradient"||e.name==="radialGradient")&&e.attrs.id){let r=e.children.find(o=>o.name==="stop"),n=r&&(Ce(r,"stop-color")??"#000000");n&&t.set(e.attrs.id,n);}for(let r of e.children)Kd(r,t);return t}function Jd(e,t){if(e.name==="image"){let r=e.attrs.href??e.attrs["xlink:href"];r&&t.add(r);}for(let r of e.children)Jd(r,t);return t}async function Ey(e){return typeof document>"u"||typeof Image>"u"?null:await new Promise(t=>{let r=new Image;r.crossOrigin="anonymous",r.onload=()=>{let n=document.createElement("canvas"),o=Math.max(r.naturalWidth||512,r.naturalHeight||512),i=Math.min(1024/o,4);n.width=Math.round((r.naturalWidth||512)*i),n.height=Math.round((r.naturalHeight||512)*i);let s=n.getContext("2d");if(!s){t(null);return}s.drawImage(r,0,0,n.width,n.height);try{t(n.toDataURL("image/png"));}catch{t(null);}},r.onerror=()=>t(null),r.src=e;})}function Ry(e,t){e.name==="clipPath"&&e.attrs.id&&t.set(e.attrs.id,e);for(let r of e.children)Ry(r,t);return t}function My(e,t){e.name==="pattern"&&e.attrs.id&&t.set(e.attrs.id,e);for(let r of e.children)My(r,t);return t}function Z7(e,t){let[r,n]=t,o=(i,s)=>fe(e.attrs[i],s);switch(e.name){case "path":return gr(e.attrs.d??"");case "rect":{let i=e.attrs.rx??e.attrs.ry,s=e.attrs.ry??e.attrs.rx;return Rn(o("x",r),o("y",n),o("width",r),o("height",n),fe(i,r),fe(s,n))}case "circle":{let i=o("r",Math.hypot(r,n)/Math.SQRT2);return jo(o("cx",r),o("cy",n),i,i)}case "ellipse":return jo(o("cx",r),o("cy",n),o("rx",r),o("ry",n));default:return []}}var nc=class{gradients;shadings;clipPaths=new Map;patterns=new Map;backdrop=Ay;paper=Ay;background=null;onPaper=false;inConic=false;constructor(t,r=null){this.gradients=t,this.shadings=r;}resolveColor(t){if(!t||t==="none")return null;let r=rc.exec(t);if(r)return this.resolveColor(this.gradients.get(r[1]));let n=Re(t==="currentColor"?"#000000":t);return n&&n.a>0?n:null}shadedGradient(t){let r=t?rc.exec(t)?.[1]:void 0;return r?this.shadings?.get(r):void 0}resolveFill(t,r,n,o=1){if(o<=0)return null;let i=this.patternOf(t);if(i)return {pattern:i,alpha:o};let s=this.shadedGradient(t);if(s){let u=Cy(s,r,n);if(!u)return null;if("coords"in u)return {gradient:u,alpha:o};let l={...u,a:u.a*o};return l.a>0?{color:l}:null}let a=this.resolveColor(t);if(!a)return null;let c={...a,a:a.a*o};return c.a>0?{color:c}:null}patternOf(t){let r=t?rc.exec(t)?.[1]:void 0,n=r?this.patterns.get(r):void 0;if(!(n?.attrs.patternUnits!=="userSpaceOnUse"||(n.attrs.patternContentUnits??"userSpaceOnUse")!=="userSpaceOnUse"||n.attrs.viewBox))return n}flatten(t){if(t.a>=1)return t;let r=this.background,n=r!==null&&Math.abs(r.r-t.r)<.5&&Math.abs(r.g-t.g)<.5&&Math.abs(r.b-t.b)<.5&&Math.abs(r.a-t.a)<.002;return Wa(t,this.onPaper||n?this.paper:this.backdrop)}paintPattern(t,r,n,o){let i=Hd(t);if(!i||i.width<=0||i.height<=0)return true;let[s,a]=r.viewport,c=fe(n.attrs.x,s),u=fe(n.attrs.y,a),l=fe(n.attrs.width,s),f=fe(n.attrs.height,a);if(!(l>0&&f>0))return true;let p=hr(n.attrs.patternTransform),m=Bn(p);if(!m)return true;if(!this.beginClip(t,r.matrix,r.fillRule==="evenodd"))return false;let h=this.inConic;this.inConic=n.attrs["data-qrdx-conic"]!==void 0;try{let d=[be(m,i.x,i.y),be(m,i.x+i.width,i.y),be(m,i.x,i.y+i.height),be(m,i.x+i.width,i.y+i.height)],g=d.map(([O])=>O),y=d.map(([,O])=>O),_=Math.min(...g),b=Math.max(...g),v=Math.min(...y),C=Math.max(...y),w=Math.floor((_-c)/l),x=Math.ceil((b-c)/l)-1,E=Math.floor((v-u)/f),P=Math.ceil((C-u)/f)-1,R=(x-w+1)*(P-E+1);if(R>4096)return !0;let I=(n.attrs["data-qrdx-conic"]??"").trim().split(/\s+/).map(Number),N=Fe(r.matrix,p);for(let O=E;O<=P;O++)for(let V=w;V<=x;V++){let Q=c+V*l,F=u+O*f,W=Fe(N,[1,0,0,1,Q,F]),K={x:_-Q,y:v-F,width:b-_,height:C-v},U=I.length===2&&I.every(Number.isFinite)?Y2(I[0],I[1],K):null,X=R>1&&this.beginClip([{op:"M",x:0,y:0},{op:"L",x:l,y:0},{op:"L",x:l,y:f},{op:"L",x:0,y:f},{op:"Z"}],W,!1);try{let we={matrix:W,viewport:r.viewport,fill:"#000000",fillRule:"nonzero",stroke:"none",strokeWidth:1,fontSize:16,fontWeight:"normal",textAnchor:"start",fillOpacity:1,opacity:o},Me=(ge,me)=>{for(let Ae of ge){if(Ae.name==="g"&&!Ae.attrs.transform){let J=Number.parseFloat(Ae.attrs.opacity??"1");Me(Ae.children,{...me,opacity:(me.opacity??1)*(Number.isFinite(J)?J:1)});continue}if(U&&Ae.attrs["data-arc"]){let[J,Pt]=Ae.attrs["data-arc"].split(/\s+/).map(Number);if(!ey([J,J+Pt],U))continue}this.walk(Ae,me);}};Me(n.children,we);}finally{X&&this.endClip();}}}finally{this.inConic=h,this.endClip();}return true}paintBleed(t,r,n,o){if(!this.shadedGradient(n))return false;let[i,s]=this.viewportMatrix({...t,attrs:{...t.attrs,x:"0",y:"0"}},{...r,matrix:Fe(r.matrix,hr(t.attrs.transform))}),a=Bn(i);if(!a)return false;let[c,u,l,f]=o,m=[[c,u],[l,u],[l,f],[c,f]].map(([h,d])=>be(a,h,d)).map(([h,d],g)=>({op:g===0?"M":"L",x:h,y:d}));return m.push({op:"Z"}),this.paint(m,{name:"rect",attrs:{},children:[],text:""},{...r,matrix:i,viewport:s,fill:n,fillRule:"nonzero",stroke:"none"}),true}beginClip(t,r,n){return false}endClip(){}clipOf(t,r){let n=Ce(t,"clip-path"),o=n?rc.exec(n)?.[1]:void 0,i=o?this.clipPaths.get(o):void 0;if(!i)return null;let s=[],a=false;for(let c of i.children){let u=Z7(c,r.viewport);if(u.length===0)continue;let l=hr(c.attrs.transform),f=l[0]===1&&l[1]===0&&l[2]===0&&l[3]===1&&l[4]===0&&l[5]===0;s.push(...f?u:u.map(p=>T7(p,l))),a||=Ce(c,"clip-rule")==="evenodd";}return s.length>0?{segments:s,matrix:r.matrix,evenOdd:a}:null}viewportMatrix(t,r){let n=fe(t.attrs.x,r.viewport[0]),o=fe(t.attrs.y,r.viewport[1]),i=fe(t.attrs.width,r.viewport[0],r.viewport[0]),s=fe(t.attrs.height,r.viewport[1],r.viewport[1]),a=Sa(t.attrs.viewBox);if(a.length!==4||!(a[2]&&a[3]))return [Fe(r.matrix,[1,0,0,1,n,o]),[i,s]];let[c,u,l,f]=a,p=i/l,m=s/f,h=n,d=o;if((t.attrs.preserveAspectRatio??"").trim()!=="none"){let g=t.attrs.preserveAspectRatio?.includes("slice")?Math.max(p,m):Math.min(p,m);h+=(i-l*g)/2,d+=(s-f*g)/2,p=g,m=g;}return [Fe(r.matrix,[p,0,0,m,h-c*p,d-u*m]),[l,f]]}walk(t,r,n=false){if(n&&(this.clipPaths=Ry(t,new Map),this.patterns=My(t,new Map)),D7.has(t.name)||Ce(t,"display")==="none"||Ce(t,"visibility")==="hidden")return;let o=Fe(r.matrix,hr(t.attrs.transform)),i=r.viewport;if(t.name==="svg"){let[p,m]=this.viewportMatrix(n?{...t,attrs:{...t.attrs,x:"0",y:"0"}}:t,{...r,matrix:o});o=p,i=m;}let s=Ce(t,"font-size"),a=Number.parseFloat(Ce(t,"opacity")??"1"),c=Ce(t,"fill-opacity"),u=c===void 0?r.fillOpacity??1:Number.parseFloat(c),l={fillOpacity:Number.isFinite(u)?Math.min(Math.max(u,0),1):1,opacity:(r.opacity??1)*(Number.isFinite(a)?Math.min(Math.max(a,0),1):1),matrix:o,viewport:i,fill:Ce(t,"fill")??r.fill,fillRule:Ce(t,"fill-rule")??r.fillRule,stroke:Ce(t,"stroke")??r.stroke,strokeWidth:Ce(t,"stroke-width")===void 0?r.strokeWidth:fe(Ce(t,"stroke-width"),i[0],1),fontSize:s===void 0?r.fontSize:fe(s,16,16),fontWeight:Ce(t,"font-weight")??r.fontWeight,textAnchor:Ce(t,"text-anchor")??r.textAnchor},f=this.onPaper;(t.name==="rect"||t.name==="circle"||t.name==="path")&&F7.test(Ce(t,"fill")??"")&&(this.onPaper=true);try{let p=t.attrs["clip-path"]?this.clipOf(t,l):null;if(p&&this.beginClip(p.segments,p.matrix,p.evenOdd)){try{this.paintNode(t,l);}finally{this.endClip();}return}this.paintNode(t,l);}finally{this.onPaper=f;}}paintNode(t,r){let[n,o]=r.viewport,i=(s,a)=>fe(t.attrs[s],a);switch(t.name){case "path":this.paint(gr(t.attrs.d??""),t,r);return;case "rect":{let s=t.attrs.rx??t.attrs.ry,a=t.attrs.ry??t.attrs.rx;this.paint(Rn(i("x",n),i("y",o),i("width",n),i("height",o),fe(s,n),fe(a,o)),t,r);return}case "circle":{let s=i("r",Math.hypot(n,o)/Math.SQRT2);this.paint(jo(i("cx",n),i("cy",o),s,s),t,r);return}case "ellipse":this.paint(jo(i("cx",n),i("cy",o),i("rx",n),i("ry",o)),t,r);return;case "line":this.paint([{op:"M",x:i("x1",n),y:i("y1",o)},{op:"L",x:i("x2",n),y:i("y2",o)}],t,{...r,fill:"none"});return;case "polygon":case "polyline":{let s=Sa(t.attrs.points),a=[];for(let c=0;c+1<s.length;c+=2)a.push({op:c===0?"M":"L",x:s[c],y:s[c+1]});t.name==="polygon"&&a.length>0&&a.push({op:"Z"}),this.paint(a,t,r);return}case "text":this.text(t,r);return;case "image":this.image(t,r);return;default:for(let s of t.children)this.walk(s,r);}}};var oc=1e3;async function Xd(e){let t=await kr(ic({...e,size:e.size??Je},oc));return decodeURIComponent(t.replace("data:image/svg+xml,",""))}function Yd(e){if(Vt(e.frame)){let t=Tn(oc,e.frame);return t.squareEdges?t.color:null}return Ve(e.bgColor,Ie)}function eh(e,t){let r=Yd(e);if(!(r&&Qo(e.bgColor))||Vt(e.frame)||e.templateId||e.customTemplate)return r;let n=va(t)?.children.find(i=>i.name==="rect"),o=n&&Ce(n,"fill");return o?.startsWith("url(")?o:r}function th(e,t){let r={r:255,g:255,b:255,a:1},n=Re(Ve(t.bgColor,Ie));e.paper=r,e.background=n&&!Qo(t.bgColor)?n:null,e.backdrop=n?Wa(n,r):r;}var Ny=25.4,Iy=5,zy=2e3,sc=oc,B7=5,U7=2;function G7(e,t="mm"){return t==="in"?e*Ny:e}function Q7(e){let t=oi(e),r=Qe.QrCode.encodeText(e.value,ht[t]).size;return r+vt(r,e.margin??Vn,e.shape)*2}function Ly(e,t){let r=G7(t.size,t.unit);if(!Number.isFinite(r)||r<Iy||r>zy)throw new Error(`Print size must be between ${Iy} mm and ${zy/1e3} m`);let n=Math.min(Math.max(t.bleed??0,0),20),o=r/sc,i=Vt(e.frame)?Tn(sc,e.frame):null,s=(i?.width??sc)*o,a=(i?.height??sc)*o,c=t.cropMarks?n+U7+B7+1:n,u=Q7(e);return {codeWidth:r,trimWidth:s,trimHeight:a,bleed:n,pageWidth:s+2*c,pageHeight:a+2*c,trimX:c,trimY:c,moduleSize:r/u,moduleCount:u,maxScanDistance:r*10}}var V7=[137,80,78,71,13,10,26,10];async function Ty(e,t){let r=new Blob([e]).stream().pipeThrough(t);return new Uint8Array(await new Response(r).arrayBuffer())}async function Fy(e){return typeof CompressionStream>"u"?null:await Ty(e,new CompressionStream("deflate"))}async function j7(e){if(typeof DecompressionStream>"u")return null;try{return await Ty(e,new DecompressionStream("deflate"))}catch{return null}}var rh=(e,t)=>e[t]*2**24+(e[t+1]<<16)+(e[t+2]<<8)+e[t+3]>>>0,Oy={0:1,2:3,3:1,4:2,6:4};function q7(e,t,r){let n=e+t-r,o=Math.abs(n-e),i=Math.abs(n-t),s=Math.abs(n-r);return o<=i&&o<=s?e:i<=s?t:r}async function Dy(e){if(V7.some((d,g)=>e[g]!==d))return null;let t=8,r=0,n=0,o=-1,i=null,s=null,a=[];for(;t+8<=e.length;){let d=rh(e,t),g=String.fromCharCode(...e.subarray(t+4,t+8)),y=e.subarray(t+8,t+8+d);if(t+=12+d,g==="IHDR"){r=rh(y,0),n=rh(y,4);let _=y[8];o=y[9];let b=y[12];if(_!==8||b!==0||!(o in Oy))return null}else if(g==="PLTE")i=y;else if(g==="tRNS")s=y;else if(g==="IDAT")a.push(y);else if(g==="IEND")break}if(!(r&&n)||r*n>4096*4096)return null;let c=new Uint8Array(a.reduce((d,g)=>d+g.length,0)),u=0;for(let d of a)c.set(d,u),u+=d.length;let l=await j7(c),f=Oy[o],p=r*f;if(!l||l.length<n*(p+1))return null;let m=new Uint8Array(n*p);for(let d=0;d<n;d++){let g=l[d*(p+1)],y=l.subarray(d*(p+1)+1,(d+1)*(p+1)),_=d*p;for(let b=0;b<p;b++){let v=b>=f?m[_+b-f]:0,C=d>0?m[_-p+b]:0,w=d>0&&b>=f?m[_-p+b-f]:0,x=y[b],E=0;g===1?E=v:g===2?E=C:g===3?E=v+C>>1:g===4&&(E=q7(v,C,w)),m[_+b]=x+E&255;}}let h=new Uint8Array(r*n*4);for(let d=0;d<r*n;d++){let g=d*4,y=d*f;if(o===3){let _=m[y];h[g]=i?.[_*3]??0,h[g+1]=i?.[_*3+1]??0,h[g+2]=i?.[_*3+2]??0,h[g+3]=s?.[_]??255;}else if(o===0||o===4){let _=m[y];h[g]=_,h[g+1]=_,h[g+2]=_,h[g+3]=o===4?m[y+1]:255;}else h[g]=m[y],h[g+1]=m[y+1],h[g+2]=m[y+2],h[g+3]=o===6?m[y+3]:255;}return {width:r,height:n,data:h}}var W7=25.4,Zy=72/W7,H7=50;function K7(e){let t=/^data:[^,]*?(;base64)?,(.*)$/s.exec(e);if(!t)return null;try{let r=t[1]?atob(t[2]):decodeURIComponent(t[2]),n=new Uint8Array(r.length);for(let o=0;o<r.length;o++)n[o]=r.charCodeAt(o)&255;return n}catch{return null}}function J7(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 r=e[t+1];if(r===216||r>=208&&r<=215){t+=2;continue}let n=e[t+2]<<8|e[t+3];if(r===192||r===193||r===194){let o=e[t+5]<<8|e[t+6],i=e[t+7]<<8|e[t+8],s=e[t+9];return {width:i,height:o,components:s,progressive:r===194}}t+=2+n;}return null}async function X7(e,t){let{width:r,height:n,data:o}=e,i=t?4:3,s=new Uint8Array(r*n*i);for(let c=0;c<r*n;c++){let u=o[c*4+3]/255,l=o[c*4]*u+255*(1-u),f=o[c*4+1]*u+255*(1-u),p=o[c*4+2]*u+255*(1-u);if(t){let[m,h,d,g]=Xo(l,f,p);s.set([m*255,h*255,d*255,g*255].map(Math.round),c*i);}else s.set([Math.round(l),Math.round(f),Math.round(p)],c*i);}let a=await Fy(s);return {kind:"raw",width:r,height:n,components:i,bytes:a??s,compressed:!!a}}async function Y7(e,t){let r=e;if(!/^data:image\/(png|jpe?g)[;,]/i.test(r)){let s=await Ey(r);if(!s)return null;r=s;}let n=K7(r);if(!n)return null;let o=J7(n);if(o)return o.components===1||o.components===3?{kind:"jpeg",width:o.width,height:o.height,components:o.components,bytes:n,progressive:o.progressive}:null;let i=await Dy(n);return i?await X7(i,t):null}function e8(e){let t="",r=0,n=o=>{t+=o,r+=o.length,r>=76&&(t+=`
63
- `,r=0);};for(let o=0;o<e.length;o+=4){let i=Math.min(4,e.length-o),s=0;for(let c=0;c<4;c++)s=s*256+(c<i?e[o+c]:0);if(s===0&&i===4){n("z");continue}let a=[];for(let c=0;c<5;c++)a.unshift(String.fromCharCode(s%85+33)),s=Math.floor(s/85);n(a.slice(0,i+1).join(""));}return `${t}~>`}var t8=`/qrdxdict 40 dict def
62
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let s of e.seen.entries()){let a=s[1];if(t===s[0]){i(s);continue}if(e.external){let u=e.external.registry.get(s[0])?.id;if(t!==s[0]&&u){i(s);continue}}if(e.metadataRegistry.get(s[0])?.id){i(s);continue}if(a.cycle){i(s);continue}a.count>1&&e.reused==="ref"&&i(s);}e.external&&(e.sharedDefsExtractedFor=e.external);}function R0(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let r=[];for(let n of t){if(!n||typeof n!="object")return;R0(n);let o=Object.keys(n);if(o.length!==1||o[0]!=="type")return;let i=n.type;for(let s of Array.isArray(i)?i:[i]){if(typeof s!="string")return;r.includes(s)||r.push(s);}}delete e.anyOf,e.type=r.length===1?r[0]:r;}var M0=new Set(["type","properties","required","additionalProperties"]),A0=["oneOf","anyOf"];function E0(e){let t=e.additionalProperties;return t===void 0||t===false||typeof t!="object"||t===null?null:Object.keys(t).length?t:null}function ep(e){let t=[];for(let i of e){if(typeof i!="object"||i.type!=="object")return null;for(let s in i)if(!M0.has(s))return null;t.push(i);}let r={},n=new Set;for(let i of t){for(let s in i.properties){if(Object.prototype.hasOwnProperty.call(r,s))continue;let a=[];for(let u of t){let l=u.properties?.[s]??E0(u);l!=null&&(a.some(f=>JSON.stringify(f)===JSON.stringify(l))||a.push(l));}let c=a.length===1?a[0]:ep(a)??{allOf:a};Ce(r,s,c);}for(let s of i.required??[])n.add(s);}let o={type:"object",properties:r};if(n.size&&(o.required=[...n]),t.every(i=>i.additionalProperties===false))o.additionalProperties=false;else {let i=[];for(let s of t){let a=E0(s);a&&!i.some(c=>JSON.stringify(c)===JSON.stringify(a))&&i.push(a);}i.length===1?o.additionalProperties=i[0]:i.length>1&&(o.additionalProperties={allOf:i});}return o}function P5(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let o of M0)if(o in e)return;let r=t.filter(o=>A0.some(i=>Array.isArray(o[i]))),n=null;if(!r.length)n=ep(t);else {let o=r[0],i=A0.find(c=>Array.isArray(o[c]));if(Object.keys(o).length!==1)return;let s=t.filter(c=>c!==o),a=o[i].map(c=>ep([...s,c]));if(a.some(c=>!c))return;n={[i]:a};}n&&(delete e.allOf,Ro(e,n));}function Ot(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let n=a=>{let c=e.seen.get(a);if(c.ref===null)return;let u=c.def??c.schema,l={...u},f=c.ref;if(c.ref=null,f){n(f);let m=e.seen.get(f),h=m.schema;if(h.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(u.allOf=u.allOf??[],u.allOf.push(h)):Ro(u,h),Ro(u,l),a._zod.parent===f)for(let g in u)g==="$ref"||g==="allOf"||g in l||delete u[g];if(h.$ref&&m.def)for(let g in u)g==="$ref"||g==="allOf"||g in m.def&&JSON.stringify(u[g])===JSON.stringify(m.def[g])&&delete u[g];}let p=a._zod.parent;if(p&&p!==f){n(p);let m=e.seen.get(p);if(m?.schema.$ref&&(u.$ref=m.schema.$ref,m.def))for(let h in u)h==="$ref"||h==="allOf"||h in m.def&&JSON.stringify(u[h])===JSON.stringify(m.def[h])&&delete u[h];}e.override({zodSchema:a,jsonSchema:u,path:c.path??[]});};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let a of [...e.seen.entries()].reverse())n(a[0]);if(e.target!=="openapi-3.0")for(let a of e.seen.entries())R0(a[1].def??a[1].schema);for(let a of e.deferred)a();if(e.intersections.length){let a=new Map;for(let c of e.seen.values())for(let u of [c.schema,c.def]){let l=u?.allOf;if(!Array.isArray(l))continue;let f=a.get(l);f?f.push(u):a.set(l,[u]);}for(let c of e.intersections)for(let u of a.get(c)??[])P5(u);}}let o={};if(e.target==="draft-2020-12"?o.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?o.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?o.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let a=e.external.registry.get(t)?.id;if(!a)throw new Error("Schema is missing an `id` property");o.$id=e.external.uri(a);}Ro(o,r.defId?r.schema:r.def??r.schema);let i=e.metadataRegistry.get(t)?.id;i!==void 0&&o.id===i&&delete o.id;let s=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let a of e.seen.entries()){let c=a[1];c.def&&c.defId&&(c.def.id===c.defId&&delete c.def.id,Ce(s,c.defId,c.def));}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(s).length>0&&(e.target==="draft-2020-12"?o.$defs=s:o.definitions=s);try{let a=JSON.parse(JSON.stringify(o));return Object.defineProperty(a,"~standard",{value:{...t["~standard"],jsonSchema:{input:_n(t,"input",e.processors),output:_n(t,"output",e.processors)}},enumerable:!1,writable:!1}),a}catch{throw new Error("Error converting schema to JSON.")}}function Fe(e,t){let r=t??{seen:new Set};if(r.seen.has(e))return false;r.seen.add(e);let n=e._zod.def;if(n.type==="transform")return true;if(n.type==="array")return Fe(n.element,r);if(n.type==="set")return Fe(n.valueType,r);if(n.type==="lazy")return Fe(n.getter(),r);if(n.type==="promise"||n.type==="optional"||n.type==="nonoptional"||n.type==="nullable"||n.type==="readonly"||n.type==="default"||n.type==="prefault"||n.type==="catch")return Fe(n.innerType,r);if(n.type==="intersection")return Fe(n.left,r)||Fe(n.right,r);if(n.type==="record"||n.type==="map")return Fe(n.keyType,r)||Fe(n.valueType,r);if(n.type==="pipe")return e._zod.traits.has("$ZodCodec")?true:Fe(n.in,r)||Fe(n.out,r);if(n.type==="object"){for(let o in n.shape)if(Fe(n.shape[o],r))return true;return false}if(n.type==="union"){for(let o of n.options)if(Fe(o,r))return true;return false}if(n.type==="tuple"){for(let o of n.items)if(Fe(o,r))return true;return !!(n.rest&&Fe(n.rest,r))}return false}var tp=(e,t={})=>r=>{let n=Lt({...r,processors:t});return te(e,n),Tt(n,e),Ot(n,e)},_n=(e,t,r={})=>n=>{let{libraryOptions:o,target:i}=n??{},s=Lt({...o??{},target:i,io:t,processors:r});return te(e,s),Tt(s,e),Ot(s,e)};var yn=(e,t,r)=>{(e[t]===void 0||r>e[t])&&(e[t]=r);},bn=(e,t,r)=>{(e[t]===void 0||r<e[t])&&(e[t]=r);},I0=(e,t)=>{yn(e,"minimum",t),bn(e,"maximum",t);},T0=(e,t)=>{e.multipleOf??(e.multipleOf=[]),e.multipleOf.includes(t)||e.multipleOf.push(t);},O0=(e,t)=>{e.patterns??(e.patterns=new Set),e.patterns.add(t);},F0=(e,t)=>{e.mime=e.mime?e.mime.filter(r=>t.includes(r)):[...t];},D0=(e,t)=>{e.format=t,t.includes("int")&&(e.isInt=true);},z0=(e,t)=>yn(e,"minimum",t.minimum),N0=(e,t)=>bn(e,"maximum",t.maximum),L0=e=>(t,r)=>{D0(t,r.format);let[n,o]=e[r.format];yn(t,"minimum",n),bn(t,"maximum",o);},k5={greater_than:(e,t)=>yn(e,t.inclusive?"minimum":"exclusiveMinimum",t.value),less_than:(e,t)=>bn(e,t.inclusive?"maximum":"exclusiveMaximum",t.value),multiple_of:(e,t)=>T0(e,t.value),number_format:L0(Xn),bigint_format:L0(Yn),min_length:z0,max_length:N0,length_equals:(e,t)=>I0(e,t.length),min_size:z0,max_size:N0,size_equals:(e,t)=>I0(e,t.size),string_format:(e,t)=>{D0(e,t.format),t.pattern&&O0(e,t.pattern),(t.format==="base64"||t.format==="base64url")&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=true);},mime_type:(e,t)=>F0(e,t.mime)};function _e(e){let t={},r=e._zod.def,n=e._zod.traits.has("$ZodCheck")?[e,...r.checks??[]]:r.checks??[];for(let i of n)k5[i._zod.def.check]?.(t,i._zod.def);let o=e._zod.bag;o.minimum!==void 0&&yn(t,"minimum",o.minimum),o.exclusiveMinimum!==void 0&&yn(t,"exclusiveMinimum",o.exclusiveMinimum),o.maximum!==void 0&&bn(t,"maximum",o.maximum),o.exclusiveMaximum!==void 0&&bn(t,"exclusiveMaximum",o.exclusiveMaximum),o.multipleOf!==void 0&&T0(t,o.multipleOf),o.format!==void 0&&(t.format??(t.format=o.format),o.format.includes("int")&&(t.isInt=true)),o.mime&&F0(t,o.mime);for(let i of o.patterns??[])O0(t,i);return t}var A5={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},E5=new Map([[Ji,su],[_o,au]]),Z0=e=>E5.get(e)??e,op=(e,t,r,n)=>{let o=r;o.type="string";let{minimum:i,maximum:s,format:a,patterns:c,contentEncoding:u,laxFormat:l}=_e(e);if(typeof i=="number"&&(o.minLength=i),typeof s=="number"&&(o.maxLength=s),a&&(o.format=A5[a]??a,o.format===""&&delete o.format,(a==="time"||l)&&delete o.format),u&&(o.contentEncoding=u),c&&c.size>0){let f=[...c].map(Z0);f.length===1?o.pattern=f[0].source:f.length>1&&(o.allOf=[...f.map(p=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:p.source}))]);}},ip=(e,t,r,n)=>{let o=r,{minimum:i,maximum:s,multipleOf:a,exclusiveMaximum:c,exclusiveMinimum:u,isInt:l}=_e(e);o.type=l?"integer":"number";let f=typeof u=="number"&&u>=(i??Number.NEGATIVE_INFINITY),p=typeof c=="number"&&c<=(s??Number.POSITIVE_INFINITY),m=t.target==="draft-04"||t.target==="openapi-3.0";if(f?m?(o.minimum=u,o.exclusiveMinimum=true):o.exclusiveMinimum=u:typeof i=="number"&&(o.minimum=i),p?m?(o.maximum=c,o.exclusiveMaximum=true):o.exclusiveMaximum=c:typeof s=="number"&&(o.maximum=s),a){let h=new Set;for(let y of a)Number.isFinite(y)&&y!==0?h.add(Math.abs(y)):ge(e,t,o,n,`A multipleOf divisor of ${y} cannot be represented in JSON Schema`);let[d,...g]=h;d!==void 0&&(o.multipleOf=d),g.length&&(o.allOf=[...o.allOf??[],...g.map(y=>({multipleOf:y}))]);}},sp=(e,t,r,n)=>{r.type="boolean";},ap=(e,t,r,n)=>{ge(e,t,r,n,"BigInt cannot be represented in JSON Schema");},cp=(e,t,r,n)=>{ge(e,t,r,n,"Symbols cannot be represented in JSON Schema");},up=(e,t,r,n)=>{t.target==="openapi-3.0"?(r.type="string",r.nullable=true,r.enum=[null]):r.type="null";},lp=(e,t,r,n)=>{ge(e,t,r,n,"Undefined cannot be represented in JSON Schema");},fp=(e,t,r,n)=>{ge(e,t,r,n,"Void cannot be represented in JSON Schema");},pp=(e,t,r,n)=>{r.not={};},mp=(e,t,r,n)=>{},dp=(e,t,r,n)=>{},hp=(e,t,r,n)=>{ge(e,t,r,n,"Date cannot be represented in JSON Schema");},gp=(e,t,r,n)=>{let o=e._zod.def,i=Gr(o.entries);if(i.length===0){r.not={};return}i.every(s=>typeof s=="number")&&(r.type="number"),i.every(s=>typeof s=="string")&&(r.type="string"),r.enum=i;},_p=(e,t,r,n)=>{let o=e._zod.def;if(o.values.length===0){r.not={};return}let i=[];for(let s of o.values)if(s===void 0){if(ge(e,t,r,n,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof s=="bigint"){if(ge(e,t,r,n,"BigInt literals cannot be represented in JSON Schema"))return;i.push(Number(s));}else i.push(s);if(i.length!==0)if(i.length===1){let s=i[0];r.type=s===null?"null":typeof s,t.target==="draft-04"||t.target==="openapi-3.0"?r.enum=[s]:r.const=s;}else i.every(s=>typeof s=="number")&&(r.type="number"),i.every(s=>typeof s=="string")&&(r.type="string"),i.every(s=>typeof s=="boolean")&&(r.type="boolean"),i.every(s=>s===null)&&(r.type="null"),r.enum=i;},yp=(e,t,r,n)=>{ge(e,t,r,n,"NaN cannot be represented in JSON Schema");},bp=(e,t,r,n)=>{let o=r,i=e._zod.pattern;if(!i)throw new Error("Pattern not found in template literal");o.type="string",o.pattern=i.source;},$p=(e,t,r,n)=>{let o=r;o.type="string",o.format="binary",o.contentEncoding="binary";let{minimum:i,maximum:s,mime:a}=_e(e);i!==void 0&&(o.minLength=i),s!==void 0&&(o.maxLength=s),a&&(a.length===0?o.not={}:a.length===1?o.contentMediaType=a[0]:o.anyOf=a.map(c=>({contentMediaType:c})));},xp=(e,t,r,n)=>{r.type="boolean";},wp=(e,t,r,n)=>{ge(e,t,r,n,"Custom types cannot be represented in JSON Schema");},Sp=(e,t,r,n)=>{ge(e,t,r,n,"Function types cannot be represented in JSON Schema");},vp=(e,t,r,n)=>{ge(e,t,r,n,"Transforms cannot be represented in JSON Schema");},Cp=(e,t,r,n)=>{ge(e,t,r,n,"Map cannot be represented in JSON Schema");},Pp=(e,t,r,n)=>{ge(e,t,r,n,"Set cannot be represented in JSON Schema");},kp=(e,t,r,n)=>{let o=r,i=e._zod.def,{minimum:s,maximum:a}=_e(e);typeof s=="number"&&(o.minItems=s),typeof a=="number"&&(o.maxItems=a),o.type="array",o.items=te(i.element,t,{...n,path:[...n.path,"items"]});};function Mo(e){let t=e._zod.def;return t.type==="pipe"&&t.in._zod.traits.has("$ZodTransform")?Mo(t.out):t.type==="catch"?Mo(t.innerType):e._zod.optin}var Ap=(e,t,r,n)=>{let o=r,i=e._zod.def,s=i.shape;if(Object.getOwnPropertySymbols(s).length&&ge(e,t,o,n,"Symbol keys cannot be represented in JSON Schema"))return;o.type="object",o.properties={};for(let u in s)Ce(o.properties,u,te(s[u],t,{...n,path:[...n.path,"properties",u]}));let c=[];for(let u of Object.keys(s)){let l=i.shape[u];(t.io==="input"?Mo(l)===void 0:l._zod.optout===void 0)&&c.push(u);}c.length>0&&(o.required=c),i.catchall?._zod.def.type==="never"?o.additionalProperties=false:i.catchall?i.catchall&&(o.additionalProperties=te(i.catchall,t,{...n,path:[...n.path,"additionalProperties"]})):t.io==="output"&&(o.additionalProperties=false);},js=(e,t,r,n)=>{let o=e._zod.def,i=o.inclusive===false,s=o.options.map((a,c)=>te(a,t,{...n,path:[...n.path,i?"oneOf":"anyOf",c]}));i?r.oneOf=s:r.anyOf=s;},Ep=(e,t,r,n)=>{let o=e._zod.def,i=te(o.left,t,{...n,path:[...n.path,"allOf",0]}),s=te(o.right,t,{...n,path:[...n.path,"allOf",1]}),a=u=>"allOf"in u&&Object.keys(u).length===1,c=[...a(i)?i.allOf:[i],...a(s)?s.allOf:[s]];r.allOf=c,t.intersections.push(c);},Rp=(e,t,r,n)=>{let o=r,i=e._zod.def;o.type="array";let s=t.target==="draft-2020-12"?"prefixItems":"items",a=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",c=i.items.map((d,g)=>te(d,t,{...n,path:[...n.path,s,g]})),u=i.rest?te(i.rest,t,{...n,path:[...n.path,a,...t.target==="openapi-3.0"?[i.items.length]:[]]}):null,l=i.items.length;for(;l>0;){let d=i.items[l-1];if(!(t.io==="input"?Mo(d)!==void 0:d._zod.optout==="optional"))break;l--;}let f=i.items.length,p=!i.rest;t.target==="draft-2020-12"?(o.prefixItems=c,p?o.items=false:u&&(o.items=u),l>0&&(o.minItems=l),p&&(o.maxItems=f)):t.target==="openapi-3.0"?(o.items={anyOf:c},u&&o.items.anyOf.push(u),l>0&&(o.minItems=l),p&&(o.maxItems=f)):(o.items=c,p?o.additionalItems=false:u&&(o.additionalItems=u),l>0&&(o.minItems=l),p&&(o.maxItems=f));let{minimum:m,maximum:h}=_e(e);typeof m=="number"&&(o.minItems=m),typeof h=="number"&&(o.maxItems=h);};function rp(e,t,r){if(t.$ref){if(r.has(t))return t;r.add(t);let h=e.get(t)?.def;if(!h)return t;let d=rp(e,h,r);return d===h?t:d}for(let h of ["anyOf","oneOf"]){let d=t[h];if(!Array.isArray(d))continue;let g=d.map(y=>rp(e,y,r));g.some((y,_)=>y!==d[_])&&(t={...t,[h]:g});}let n=Array.isArray(t.type)?t.type:[t.type],o=!n.includes("string")&&n.some(h=>h==="number"||h==="integer"),i=t.enum??(t.const!==void 0?[t.const]:void 0);if(!o&&!i?.some(h=>typeof h=="number"))return t;let{minimum:s,maximum:a,exclusiveMinimum:c,exclusiveMaximum:u,multipleOf:l,format:f,id:p,...m}=t;return m.enum?m.enum=m.enum.map(h=>typeof h=="number"?String(h):h):typeof m.const=="number"&&(m.const=String(m.const)),o&&(m.type="string",i||(m.pattern=(n.includes("number")?bt:uo).source)),m}var np=new WeakMap;function R5(e){let t=new Map;for(let n of e.seen.values())n.def&&!t.has(n.schema)&&t.set(n.schema,n);let r=new Map;for(let n of np.get(e)??[]){let o=e.seen.get(n),i=(o?.def??o?.schema)?.propertyNames;if(!i||i===true||r.has(i))continue;let s=rp(t,i,new Set);s!==i&&r.set(i,s);}if(r.size)for(let n of e.seen.values())for(let o of [n.schema,n.def]){let i=o&&r.get(o.propertyNames);i&&(o.propertyNames=i);}}var Mp=(e,t,r,n)=>{let o=r,i=e._zod.def;o.type="object";let s=i.keyType,a=_e(s).patterns;if(i.mode==="loose"&&a&&a.size>0){let l=te(i.valueType,t,{...n,path:[...n.path,"patternProperties","*"]});o.patternProperties={};for(let f of a)Ce(o.patternProperties,Z0(f).source,l);}else {if(t.target==="draft-07"||t.target==="draft-2020-12"){o.propertyNames=te(i.keyType,t,{...n,path:[...n.path,"propertyNames"]});let l=np.get(t);l||(l=[],np.set(t,l),t.deferred.push(()=>R5(t))),l.push(e);}o.additionalProperties=te(i.valueType,t,{...n,path:[...n.path,"additionalProperties"]});}let c=s._zod.values,u=t.io==="input"&&Mo(i.valueType)!==void 0;if(c&&!i.partial&&!u){let l=[...c].filter(f=>typeof f=="string"||typeof f=="number");l.length>0&&(o.required=l.map(String));}},Ip=(e,t,r,n)=>{let o=e._zod.def,i=te(o.innerType,t,n),s=t.seen.get(e);t.target==="openapi-3.0"?(s.ref=o.innerType,r.nullable=true):r.anyOf=[i,{type:"null"}];},zp=(e,t,r,n)=>{let o=e._zod.def;te(o.innerType,t,n);let i=t.seen.get(e);i.ref=o.innerType;},Np=Symbol();function B0(e,t,r,n,o){let i=false,s=JSON.stringify(e,(a,c)=>typeof c!="bigint"?c:(i=true,null));return i?(ge(t,r,n,o,"BigInt defaults cannot be represented in JSON Schema"),Np):JSON.parse(s)}var Lp=(e,t,r,n)=>{let o=e._zod.def;te(o.innerType,t,n);let i=t.seen.get(e);i.ref=o.innerType;let s=B0(o.defaultValue,e,t,r,n);s!==Np&&(r.default=s);},Tp=(e,t,r,n)=>{let o=e._zod.def;te(o.innerType,t,n);let i=t.seen.get(e);if(i.ref=o.innerType,t.io!=="input")return;let s=B0(o.defaultValue,e,t,r,n);s!==Np&&(r._prefault=s);},Op=(e,t,r,n)=>{let o=e._zod.def;te(o.innerType,t,n);let i=t.seen.get(e);i.ref=o.innerType;let s;try{s=o.catchValue(void 0);}catch{ge(e,t,r,n,"Dynamic catch values are not supported in JSON Schema");return}r.default=s;},Fp=(e,t,r,n)=>{let o=e._zod.def,i=o.in._zod.traits.has("$ZodTransform"),s=t.io==="input"?i?o.out:o.in:o.out;te(s,t,n);let a=t.seen.get(e);a.ref=s;},Dp=(e,t,r,n)=>{let o=e._zod.def;te(o.innerType,t,n);let i=t.seen.get(e);i.ref=o.innerType,r.readOnly=true;},Zp=(e,t,r,n)=>{let o=e._zod.def;te(o.innerType,t,n);let i=t.seen.get(e);i.ref=o.innerType;},qs=(e,t,r,n)=>{let o=e._zod.def;te(o.innerType,t,n);let i=t.seen.get(e);i.ref=o.innerType;},Bp=(e,t,r,n)=>{let o=e._zod.innerType;te(o,t,n);let i=t.seen.get(e);i.ref=o;},Vs={string:op,number:ip,boolean:sp,bigint:ap,symbol:cp,null:up,undefined:lp,void:fp,never:pp,any:mp,unknown:dp,date:hp,enum:gp,literal:_p,nan:yp,template_literal:bp,file:$p,success:xp,custom:wp,function:Sp,transform:vp,map:Cp,set:Pp,array:kp,object:Ap,union:js,intersection:Ep,tuple:Rp,record:Mp,nullable:Ip,nonoptional:zp,default:Lp,prefault:Tp,catch:Op,pipe:Fp,readonly:Dp,promise:Zp,optional:qs,lazy:Bp};function Ws(e,t){if("_idmap"in e){let n=e,o=Lt({...t,processors:Vs}),i={};for(let c of n._idmap.entries()){let[u,l]=c;te(l,o);}let s={},a={registry:n,uri:t?.uri,defs:i};o.external=a;for(let c of n._idmap.entries()){let[u,l]=c;Tt(o,l),Ce(s,u,Ot(o,l));}if(Object.keys(i).length>0){let c=o.target==="draft-2020-12"?"$defs":"definitions";s.__shared={[c]:i};}return {schemas:s}}let r=Lt({...t,processors:Vs});return te(e,r),Tt(r,e),Ot(r,e)}var Hs=class{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(t){this.ctx.counter=t;}get seen(){return this.ctx.seen}constructor(t){let r=t?.target??"draft-2020-12";r==="draft-4"&&(r="draft-04"),r==="draft-7"&&(r="draft-07"),this.ctx=Lt({processors:Vs,target:r,...t?.metadata&&{metadata:t.metadata},...t?.unrepresentable&&{unrepresentable:t.unrepresentable},...t?.override&&{override:t.override},...t?.io&&{io:t.io}});}process(t,r={path:[],schemaPath:[]}){return te(t,this.ctx,r)}emit(t,r){r&&(r.cycles&&(this.ctx.cycles=r.cycles),r.reused&&(this.ctx.reused=r.reused),r.external&&(this.ctx.external=r.external)),this.ctx.sharedDefsExtractedFor=void 0,this.ctx.sharedEmitDoneFor=void 0,Tt(this.ctx,t);let n=Ot(this.ctx,t),{"~standard":o,...i}=n;return i}};var U0={};var kn={};At(kn,{ZodAny:()=>um,ZodArray:()=>mm,ZodBase64:()=>da,ZodBase64URL:()=>ha,ZodBigInt:()=>Cn,ZodBigIntFormat:()=>ya,ZodBoolean:()=>vn,ZodCIDRv4:()=>pa,ZodCIDRv6:()=>ma,ZodCUID:()=>ia,ZodCUID2:()=>sa,ZodCatch:()=>Nm,ZodCodec:()=>Bo,ZodCreditCard:()=>tm,ZodCustom:()=>Uo,ZodCustomStringFormat:()=>fr,ZodDate:()=>Lo,ZodDefault:()=>Am,ZodDiscriminatedUnion:()=>hm,ZodE164:()=>ga,ZodEmail:()=>ta,ZodEmoji:()=>na,ZodEnum:()=>xn,ZodExactOptional:()=>wa,ZodFile:()=>vm,ZodFunction:()=>Qm,ZodGUID:()=>ra,ZodIBAN:()=>rm,ZodIPv4:()=>la,ZodIPv6:()=>fa,ZodISODate:()=>Dt,ZodISODateTime:()=>Ft,ZodISODuration:()=>Bt,ZodISOTime:()=>Zt,ZodInstanceOf:()=>qm,ZodIntersection:()=>gm,ZodJWT:()=>_a,ZodKSUID:()=>ua,ZodLazy:()=>Bm,ZodLiteral:()=>Sm,ZodMAC:()=>em,ZodMap:()=>xm,ZodNaN:()=>Tm,ZodNanoID:()=>oa,ZodNever:()=>fm,ZodNonOptional:()=>Sa,ZodNull:()=>am,ZodNullable:()=>km,ZodNumber:()=>Sn,ZodNumberFormat:()=>pr,ZodObject:()=>Oo,ZodOptional:()=>Do,ZodPipe:()=>Zo,ZodPrefault:()=>Rm,ZodPreprocess:()=>Om,ZodPromise:()=>Gm,ZodReadonly:()=>Fm,ZodRecord:()=>$n,ZodSet:()=>wm,ZodString:()=>wn,ZodStringFormat:()=>ie,ZodSuccess:()=>zm,ZodSymbol:()=>im,ZodTemplateLiteral:()=>Zm,ZodTransform:()=>Cm,ZodTuple:()=>ym,ZodType:()=>j,ZodULID:()=>aa,ZodURL:()=>No,ZodUUID:()=>dt,ZodUndefined:()=>sm,ZodUnion:()=>Fo,ZodUnknown:()=>lm,ZodVoid:()=>pm,ZodXID:()=>ca,ZodXor:()=>dm,_ZodString:()=>ea,_default:()=>Em,_function:()=>tg,any:()=>I1,array:()=>To,base64:()=>p1,base64url:()=>m1,bigint:()=>k1,boolean:()=>om,catch:()=>Lm,check:()=>rg,cidrv4:()=>l1,cidrv6:()=>f1,codec:()=>J1,creditCard:()=>h1,cuid:()=>r1,cuid2:()=>n1,currencyCode:()=>x1,custom:()=>ng,date:()=>N1,describe:()=>og,discriminatedUnion:()=>Z1,e164:()=>d1,email:()=>j0,emoji:()=>e1,enum:()=>$a,exactOptional:()=>Pm,file:()=>q1,float32:()=>S1,float64:()=>v1,function:()=>tg,guid:()=>q0,hash:()=>w1,hex:()=>$1,hostname:()=>b1,httpUrl:()=>Y0,iban:()=>g1,instanceof:()=>sg,int:()=>Xs,int32:()=>C1,int64:()=>A1,intersection:()=>_m,invertCodec:()=>X1,ipv4:()=>a1,ipv6:()=>u1,json:()=>cg,jwt:()=>_1,keyof:()=>L1,ksuid:()=>s1,lazy:()=>Um,literal:()=>j1,looseObject:()=>F1,looseRecord:()=>U1,mac:()=>c1,map:()=>G1,meta:()=>ig,nan:()=>K1,nanoid:()=>t1,nativeEnum:()=>V1,never:()=>ba,nonoptional:()=>Im,null:()=>cm,nullable:()=>zo,nullish:()=>W1,number:()=>nm,object:()=>T1,optional:()=>ur,partialRecord:()=>B1,pipe:()=>Ys,prefault:()=>Mm,preprocess:()=>ug,promise:()=>eg,readonly:()=>Dm,record:()=>$m,refine:()=>Vm,set:()=>Q1,strictObject:()=>O1,string:()=>Io,stringFormat:()=>y1,stringbool:()=>ag,success:()=>H1,superRefine:()=>jm,symbol:()=>R1,templateLiteral:()=>Y1,transform:()=>xa,tuple:()=>bm,uint32:()=>P1,uint64:()=>E1,ulid:()=>o1,undefined:()=>M1,union:()=>Pn,unknown:()=>cr,url:()=>X0,uuid:()=>W0,uuidv4:()=>H0,uuidv6:()=>K0,uuidv7:()=>J0,void:()=>z1,xid:()=>i1,xor:()=>D1});var I5=()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function t(i){return e[i]??null}let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",currency_code:"currency code",credit_card:"credit card number",iban:"IBAN",jwt:"JWT",template_literal:"input"},n={nan:"NaN"};function o(i,s){return i==="number"&&typeof s=="number"&&!Number.isFinite(s)?String(s):n[i]??i}return i=>{switch(i.code){case "invalid_type":{let s=o(i.expected),a=Ic(i.input),c=o(a,i.input);return `Invalid input: expected ${s}, received ${c}`}case "invalid_value":return i.values.length===1?`Invalid input: expected ${wi(i.values[0])}`:`Invalid option: expected one of ${bi(i.values,"|")}`;case "too_big":{let s=i.exact?"exactly ":i.inclusive?"<=":"<",a=t(i.origin);return a?`Too big: expected ${i.origin??"value"} to have ${s}${i.maximum.toString()} ${a.unit??"elements"}`:`Too big: expected ${i.origin??"value"} to be ${s}${i.maximum.toString()}`}case "too_small":{let s=i.exact?"exactly ":i.inclusive?">=":">",a=t(i.origin);return a?`Too small: expected ${i.origin} to have ${s}${i.minimum.toString()} ${a.unit}`:`Too small: expected ${i.origin} to be ${s}${i.minimum.toString()}`}case "invalid_format":{let s=i;return s.format==="starts_with"?`Invalid string: must start with "${s.prefix}"`:s.format==="ends_with"?`Invalid string: must end with "${s.suffix}"`:s.format==="includes"?`Invalid string: must include "${s.includes}"`:s.format==="regex"?`Invalid string: must match pattern ${s.pattern}`:`Invalid ${r[s.format]??i.format}`}case "not_multiple_of":return `Invalid number: must be a multiple of ${i.divisor}`;case "unrecognized_keys":return `Unrecognized key${i.keys.length>1?"s":""}: ${bi(i.keys,", ")}`;case "invalid_key":return `Invalid key in ${i.origin}`;case "invalid_union":return i.options&&Array.isArray(i.options)&&i.options.length>0?`Invalid discriminator value. Expected ${i.options.map(a=>`'${a}'`).join(" | ")}`:i.inclusive===false?"Invalid input: more than one option matched":"Invalid input";case "invalid_element":return `Invalid value in ${i.origin}`;default:return "Invalid input"}}};function G0(){return {localeError:I5()}}var Ks={};At(Ks,{endsWith:()=>un,gt:()=>pt,gte:()=>Ye,includes:()=>an,length:()=>sr,lowercase:()=>on,lt:()=>ft,lte:()=>Xe,maxLength:()=>ir,maxSize:()=>Nt,mime:()=>fn,minLength:()=>$t,minSize:()=>mt,multipleOf:()=>zt,negative:()=>Bs,nonnegative:()=>Gs,nonpositive:()=>Us,normalize:()=>pn,overwrite:()=>st,positive:()=>Zs,properties:()=>ln,property:()=>Qs,regex:()=>nn,size:()=>or,slugify:()=>gn,startsWith:()=>cn,toLowerCase:()=>dn,toUpperCase:()=>hn,trim:()=>mn,uppercase:()=>sn});var Q0=new WeakSet([Object.prototype,Error.prototype]);function Js(e,t,r){Object.defineProperty(e,t,{configurable:true,enumerable:false,get(){let n=r(this);return Object.defineProperty(this,t,{value:n,configurable:true,writable:true}),n},set(n){Object.defineProperty(this,t,{value:n,configurable:true,writable:true});}});}var V0=(e,t)=>{Zc.init(e,t),e.name="ZodError";let r=Object.getPrototypeOf(e);Q0.has(r)||(Q0.add(r),Js(r,"format",n=>o=>io(n,o)),Js(r,"flatten",n=>o=>oo(n,o)),Js(r,"addIssue",n=>o=>{n.issues.push(o),n.message=JSON.stringify(n.issues,Qr,2);}),Js(r,"addIssues",n=>o=>{n.issues.push(...o),n.message=JSON.stringify(n.issues,Qr,2);}),Object.defineProperty(r,"isEmpty",{configurable:true,enumerable:false,get(){return this.issues.length===0}}));},z5=v("ZodError",V0),Ke=v("ZodError",V0,void 0,{Parent:Error});var Up=Hr(Ke),Gp=Kr(Ke),Qp=Jr(Ke),Vp=Xr(Ke),jp=Ai(Ke),qp=Ei(Ke),Wp=Ri(Ke),Hp=Mi(Ke),Kp=Ii(Ke),Jp=zi(Ke),Xp=Ni(Ke),Yp=Li(Ke);function L5(){we.localeError||me(G0());}function lr(){we.memoizer||me({memoizer:vo()});}var j=v("ZodType",(e,t)=>(L5(),G.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(O.mergeDefs(t,{checks:[...t.checks??[],...e.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:true})},with(...e){return this.check(...e)},clone(e,t){return Y(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(Vm(e,t))},superRefine(e,t){return this.check(jm(e,t))},overwrite(e){return this.check(st(e))},optional(){return ur(this)},exactOptional(){return Pm(this)},nullable(){return zo(this)},nullish(){return ur(zo(this))},nonoptional(e){return Im(this,e)},array(){return To(this)},or(e){return Pn([this,e])},and(e){return _m(this,e)},transform(e){return Ys(this,xa(e))},default(e){return Em(this,e)},prefault(e){return Mm(this,e)},catch(e){return Lm(this,e)},pipe(e){return Ys(this,e)},readonly(){return Dm(this)},describe(e){let t=this.clone();return Pe.add(t,{description:e}),t},meta(...e){if(e.length===0)return Pe.get(this);let t=this.clone();return Pe.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return O.hide(this,"~standard",{...ji(this),jsonSchema:{input:_n(this,"input"),output:_n(this,"output")}})},set"~standard"(e){O.own(this,"~standard",e);},parse:function e(t,r){return Up(this,t,r,{callee:e})},parseAsync:async function e(t,r){return await Gp(this,t,r,{callee:e})},safeParse(e,t){return Qp(this,e,t)},async safeParseAsync(e,t){return Vp(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){O.own(this,"spa",e);},validate(e,t){return so(this,e,t)},validateAsync(e,t){return ao(this,e,t)},encode:function e(t,r){return jp(this,t,r,{callee:e})},decode:function e(t,r){return qp(this,t,r,{callee:e})},encodeAsync:async function e(t,r){return await Wp(this,t,r,{callee:e})},decodeAsync:async function e(t,r){return await Hp(this,t,r,{callee:e})},safeEncode(e,t){return Kp(this,e,t)},safeDecode(e,t){return Jp(this,e,t)},async safeEncodeAsync(e,t){return Xp(this,e,t)},async safeDecodeAsync(e,t){return Yp(this,e,t)},toJSONSchema(e){return tp(this,{})(e)},get description(){return Pe.get(this)?.description},get _def(){return this._zod.def}}),ea=v("_ZodString",(e,t)=>{er.init(e,t),j.init(e,t),e._zod.processJSONSchema=(r,n,o)=>op(e,r,n);},O.derived({format:e=>_e(e).format??null,minLength:e=>_e(e).minimum??null,maxLength:e=>_e(e).maximum??null},{regex(...e){return this.check(nn(...e))},includes(...e){return this.check(an(...e))},startsWith(...e){return this.check(cn(...e))},endsWith(...e){return this.check(un(...e))},min(...e){return this.check($t(...e))},max(...e){return this.check(ir(...e))},length(...e){return this.check(sr(...e))},nonempty(...e){return this.check($t(1,...e))},lowercase(e){return this.check(on(e))},uppercase(e){return this.check(sn(e))},trim(){return this.check(mn())},normalize(...e){return this.check(pn(...e))},toLowerCase(){return this.check(dn())},toUpperCase(){return this.check(hn())},slugify(){return this.check(gn())}})),wn=v("ZodString",(e,t)=>{er.init(e,t),ea.init(e,t);},{email(e){return this.check(bs(ta,e))},url(e){return this.check(Co(No,e))},jwt(e){return this.check(Ds(_a,e))},emoji(e){return this.check(Cs(na,e))},guid(e){return this.check($s(ra,e))},uuid(e){return this.check(xs(dt,e))},uuidv4(e){return this.check(ws(dt,e))},uuidv6(e){return this.check(Ss(dt,e))},uuidv7(e){return this.check(vs(dt,e))},nanoid(e){return this.check(Ps(oa,e))},cuid(e){return this.check(ks(ia,e))},cuid2(e){return this.check(As(sa,e))},ulid(e){return this.check(Es(aa,e))},base64(e){return this.check(Ts(da,e))},base64url(e){return this.check(Os(ha,e))},xid(e){return this.check(Rs(ca,e))},ksuid(e){return this.check(Ms(ua,e))},ipv4(e){return this.check(Is(la,e))},ipv6(e){return this.check(zs(fa,e))},cidrv4(e){return this.check(Ns(pa,e))},cidrv6(e){return this.check(Ls(ma,e))},e164(e){return this.check(Fs(ga,e))},datetime(e){return this.check(Po(Ft,e))},date(e){return this.check(ko(Dt,e))},time(e){return this.check(Ao(Zt,e))},duration(e){return this.check(Eo(Bt,e))}});function Io(e){return _f(wn,e)}var ie=v("ZodStringFormat",(e,t)=>{ee.init(e,t),ea.init(e,t);}),Ft=v("ZodISODateTime",(e,t)=>{sl.init(e,t),ie.init(e,t);}),Dt=v("ZodISODate",(e,t)=>{al.init(e,t),ie.init(e,t);}),Zt=v("ZodISOTime",(e,t)=>{cl.init(e,t),ie.init(e,t);}),Bt=v("ZodISODuration",(e,t)=>{ul.init(e,t),ie.init(e,t);}),ta=v("ZodEmail",(e,t)=>{Hu.init(e,t),ie.init(e,t);});function j0(e){return bs(ta,e)}var ra=v("ZodGUID",(e,t)=>{qu.init(e,t),ie.init(e,t);});function q0(e){return $s(ra,e)}var dt=v("ZodUUID",(e,t)=>{Wu.init(e,t),ie.init(e,t);});function W0(e){return xs(dt,e)}function H0(e){return ws(dt,e)}function K0(e){return Ss(dt,e)}function J0(e){return vs(dt,e)}var No=v("ZodURL",(e,t)=>{Xu.init(e,t),ie.init(e,t);});function X0(e){return Co(No,e)}function Y0(e){return Co(No,{protocol:co,hostname:uu,...O.normalizeParams(e)})}var na=v("ZodEmoji",(e,t)=>{Yu.init(e,t),ie.init(e,t);});function e1(e){return Cs(na,e)}var oa=v("ZodNanoID",(e,t)=>{el.init(e,t),ie.init(e,t);});function t1(e){return Ps(oa,e)}var ia=v("ZodCUID",(e,t)=>{tl.init(e,t),ie.init(e,t);});function r1(e){return ks(ia,e)}var sa=v("ZodCUID2",(e,t)=>{rl.init(e,t),ie.init(e,t);});function n1(e){return As(sa,e)}var aa=v("ZodULID",(e,t)=>{nl.init(e,t),ie.init(e,t);});function o1(e){return Es(aa,e)}var ca=v("ZodXID",(e,t)=>{ol.init(e,t),ie.init(e,t);});function i1(e){return Rs(ca,e)}var ua=v("ZodKSUID",(e,t)=>{il.init(e,t),ie.init(e,t);});function s1(e){return Ms(ua,e)}var la=v("ZodIPv4",(e,t)=>{ll.init(e,t),ie.init(e,t);});function a1(e){return Is(la,e)}var em=v("ZodMAC",(e,t)=>{pl.init(e,t),ie.init(e,t);});function c1(e){return bf(em,e)}var fa=v("ZodIPv6",(e,t)=>{fl.init(e,t),ie.init(e,t);});function u1(e){return zs(fa,e)}var pa=v("ZodCIDRv4",(e,t)=>{ml.init(e,t),ie.init(e,t);});function l1(e){return Ns(pa,e)}var ma=v("ZodCIDRv6",(e,t)=>{dl.init(e,t),ie.init(e,t);});function f1(e){return Ls(ma,e)}var da=v("ZodBase64",(e,t)=>{hl.init(e,t),ie.init(e,t);});function p1(e){return Ts(da,e)}var ha=v("ZodBase64URL",(e,t)=>{gl.init(e,t),ie.init(e,t);});function m1(e){return Os(ha,e)}var ga=v("ZodE164",(e,t)=>{_l.init(e,t),ie.init(e,t);});function d1(e){return Fs(ga,e)}var tm=v("ZodCreditCard",(e,t)=>{yl.init(e,t),ie.init(e,t);});function h1(e){return $f(tm,e)}var rm=v("ZodIBAN",(e,t)=>{bl.init(e,t),ie.init(e,t);});function g1(e){return xf(rm,e)}var _a=v("ZodJWT",(e,t)=>{$l.init(e,t),ie.init(e,t);});function _1(e){return Ds(_a,e)}var fr=v("ZodCustomStringFormat",(e,t)=>{xl.init(e,t),ie.init(e,t);});function y1(e,t,r={}){return ar(fr,e,t,r)}function b1(e){return ar(fr,"hostname",cu,e)}function $1(e){return ar(fr,"hex",Su,e)}function x1(e){return ar(fr,"currency_code",fu,e)}function w1(e,t){let r=t?.enc??"hex",n=`${e}_${r}`,o=rt[n];if(!o)throw new Error(`Unrecognized hash format: ${n}`);return ar(fr,n,o,t)}var Sn=v("ZodNumber",(e,t)=>{rs.init(e,t),j.init(e,t),e._zod.processJSONSchema=(r,n,o)=>ip(e,r,n,o),e.isFinite=true;},O.derived({minValue:e=>{let{minimum:t,exclusiveMinimum:r}=_e(e);return Math.max(t??Number.NEGATIVE_INFINITY,r??Number.NEGATIVE_INFINITY)},maxValue:e=>{let{maximum:t,exclusiveMaximum:r}=_e(e);return Math.min(t??Number.POSITIVE_INFINITY,r??Number.POSITIVE_INFINITY)},isInt:e=>{let{isInt:t,multipleOf:r}=_e(e);return !!t||!!r?.some(Number.isSafeInteger)},format:e=>_e(e).format??null},{gt(e,t){return this.check(pt(e,t))},gte(e,t){return this.check(Ye(e,t))},min(e,t){return this.check(Ye(e,t))},lt(e,t){return this.check(ft(e,t))},lte(e,t){return this.check(Xe(e,t))},max(e,t){return this.check(Xe(e,t))},int(e){return this.check(Xs(e))},safe(e){return this.check(Xs(e))},positive(e){return this.check(pt(0,e))},nonnegative(e){return this.check(Ye(0,e))},negative(e){return this.check(ft(0,e))},nonpositive(e){return this.check(Xe(0,e))},multipleOf(e,t){return this.check(zt(e,t))},step(e,t){return this.check(zt(e,t))},finite(){return this}}));function nm(e){return Sf(Sn,e)}var pr=v("ZodNumberFormat",(e,t)=>{wl.init(e,t),Sn.init(e,t);});function Xs(e){return Cf(pr,e)}function S1(e){return Pf(pr,e)}function v1(e){return kf(pr,e)}function C1(e){return Af(pr,e)}function P1(e){return Ef(pr,e)}var vn=v("ZodBoolean",(e,t)=>{yo.init(e,t),j.init(e,t),e._zod.processJSONSchema=(r,n,o)=>sp(e,r,n);});function om(e){return Rf(vn,e)}var Cn=v("ZodBigInt",(e,t)=>{ns.init(e,t),j.init(e,t),e._zod.processJSONSchema=(r,n,o)=>ap(e,r,n,o);},O.derived({minValue:e=>_e(e).minimum??null,maxValue:e=>_e(e).maximum??null,format:e=>_e(e).format??null},{gte(e,t){return this.check(Ye(e,t))},min(e,t){return this.check(Ye(e,t))},gt(e,t){return this.check(pt(e,t))},lt(e,t){return this.check(ft(e,t))},lte(e,t){return this.check(Xe(e,t))},max(e,t){return this.check(Xe(e,t))},positive(e){return this.check(pt(BigInt(0),e))},negative(e){return this.check(ft(BigInt(0),e))},nonpositive(e){return this.check(Xe(BigInt(0),e))},nonnegative(e){return this.check(Ye(BigInt(0),e))},multipleOf(e,t){return this.check(zt(e,t))}}));function k1(e){return If(Cn,e)}var ya=v("ZodBigIntFormat",(e,t)=>{Sl.init(e,t),Cn.init(e,t);});function A1(e){return Nf(ya,e)}function E1(e){return Lf(ya,e)}var im=v("ZodSymbol",(e,t)=>{vl.init(e,t),j.init(e,t),e._zod.processJSONSchema=(r,n,o)=>cp(e,r,n,o);});function R1(e){return Tf(im,e)}var sm=v("ZodUndefined",(e,t)=>{Cl.init(e,t),j.init(e,t),e._zod.processJSONSchema=(r,n,o)=>lp(e,r,n,o);});function M1(e){return Of(sm,e)}var am=v("ZodNull",(e,t)=>{Pl.init(e,t),j.init(e,t),e._zod.processJSONSchema=(r,n,o)=>up(e,r,n);});function cm(e){return Ff(am,e)}var um=v("ZodAny",(e,t)=>{kl.init(e,t),j.init(e,t),e._zod.processJSONSchema=(r,n,o)=>mp();});function I1(){return Df(um)}var lm=v("ZodUnknown",(e,t)=>{Al.init(e,t),j.init(e,t),e._zod.processJSONSchema=(r,n,o)=>dp();});function cr(){return Zf(lm)}var fm=v("ZodNever",(e,t)=>{El.init(e,t),j.init(e,t),e._zod.processJSONSchema=(r,n,o)=>pp(e,r,n);});function ba(e){return Bf(fm,e)}var pm=v("ZodVoid",(e,t)=>{Rl.init(e,t),j.init(e,t),e._zod.processJSONSchema=(r,n,o)=>fp(e,r,n,o);});function z1(e){return Uf(pm,e)}var Lo=v("ZodDate",(e,t)=>{Ml.init(e,t),j.init(e,t),e._zod.processJSONSchema=(r,n,o)=>hp(e,r,n,o),e.min=(r,n)=>e.check(Ye(r,n)),e.max=(r,n)=>e.check(Xe(r,n));},O.derived({minDate:e=>{let{minimum:t}=_e(e);return t?new Date(t):null},maxDate:e=>{let{maximum:t}=_e(e);return t?new Date(t):null}},{}));function N1(e){return Gf(Lo,e)}var mm=v("ZodArray",(e,t)=>{lr(),zl.init(e,t),j.init(e,t),e._zod.processJSONSchema=(r,n,o)=>kp(e,r,n,o),e.element=t.element;},{min(e,t){return this.check($t(e,t))},nonempty(e){return this.check($t(1,e))},max(e,t){return this.check(ir(e,t))},length(e,t){return this.check(sr(e,t))},unwrap(){return this.element}});function To(e,t){return jf(mm,e,t)}function L1(e){let t=e._zod.def.shape;return $a(Object.keys(t))}var Oo=v("ZodObject",(e,t)=>{lr(),Nl.init(e,t),j.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Ap(e,r,n,o),O.installLazyProp(e,"shape",r=>r._zod.def.shape,false);},{keyof(){return $a(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(O.mergeDefs(this._zod.def,{catchall:e}))},passthrough(){return this.clone(O.mergeDefs(this._zod.def,{catchall:cr()}))},loose(){return this.clone(O.mergeDefs(this._zod.def,{catchall:cr()}))},strict(){return this.clone(O.mergeDefs(this._zod.def,{catchall:ba()}))},strip(){return this.clone(O.mergeDefs(this._zod.def,{catchall:void 0}))},extend(e){return O.extend(this,e)},safeExtend(e){return O.safeExtend(this,e)},merge(e){return O.merge(this,e)},pick(e){return O.pick(this,e)},omit(e){return O.omit(this,e)},partial(...e){return O.partial(Do,this,e[0])},exactPartial(...e){return O.partial(wa,this,e[0],"exactPartial")},required(...e){return O.required(Sa,this,e[0])}});function T1(e,t){let r={type:"object",shape:e??{},...O.normalizeParams(t)};return new Oo(r)}function O1(e,t){return new Oo({type:"object",shape:e,catchall:ba(),...O.normalizeParams(t)})}function F1(e,t){return new Oo({type:"object",shape:e,catchall:cr(),...O.normalizeParams(t)})}var Fo=v("ZodUnion",(e,t)=>{bo.init(e,t),j.init(e,t),e._zod.processJSONSchema=(r,n,o)=>js(e,r,n,o),e.options=t.options;});function Pn(e,t){return new Fo({type:"union",options:e,...O.normalizeParams(t)})}var dm=v("ZodXor",(e,t)=>{Fo.init(e,t),Ll.init(e,t),e._zod.processJSONSchema=(r,n,o)=>js(e,r,n,o),e.options=t.options;});function D1(e,t){return new dm({type:"union",options:e,inclusive:false,...O.normalizeParams(t)})}var hm=v("ZodDiscriminatedUnion",(e,t)=>{Fo.init(e,t),Ol.init(e,t);});function Z1(e,t,r){return new hm({type:"union",options:t,discriminator:e,...O.normalizeParams(r)})}var gm=v("ZodIntersection",(e,t)=>{Fl.init(e,t),j.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Ep(e,r,n,o);});function _m(e,t){return new gm({type:"intersection",left:e,right:t})}var ym=v("ZodTuple",(e,t)=>{lr(),os.init(e,t),j.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Rp(e,r,n,o);},{rest(e){return this.clone({...this._zod.def,rest:e})},partial(){let e=this._zod.def;if(e.checks?.length)throw new Error(".partial() cannot be used on tuple schemas containing refinements");return this.clone({...e,items:e.items.map(t=>new Do({type:"optional",innerType:t}))})}});function bm(e,t,r){let n=t instanceof G,o=n?r:t,i=n?t:null;return new ym({type:"tuple",items:e,rest:i,...O.normalizeParams(o)})}var $n=v("ZodRecord",(e,t)=>{lr(),Dl.init(e,t),j.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Mp(e,r,n,o),e.keyType=t.keyType,e.valueType=t.valueType;});function $m(e,t,r){return !t||!t._zod?new $n({type:"record",keyType:Io(),valueType:e,...O.normalizeParams(t)}):new $n({type:"record",keyType:e,valueType:t,...O.normalizeParams(r)})}function B1(e,t,r){return new $n({type:"record",keyType:e,valueType:t,...O.normalizeParams(r),partial:true})}function U1(e,t,r){return new $n({type:"record",keyType:e,valueType:t,mode:"loose",...O.normalizeParams(r)})}var xm=v("ZodMap",(e,t)=>{lr(),Zl.init(e,t),j.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Cp(e,r,n,o),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...r)=>e.check(mt(...r)),e.nonempty=r=>e.check(mt(1,r)),e.max=(...r)=>e.check(Nt(...r)),e.size=(...r)=>e.check(or(...r));});function G1(e,t,r){return new xm({type:"map",keyType:e,valueType:t,...O.normalizeParams(r)})}var wm=v("ZodSet",(e,t)=>{lr(),Bl.init(e,t),j.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Pp(e,r,n,o),e.min=(...r)=>e.check(mt(...r)),e.nonempty=r=>e.check(mt(1,r)),e.max=(...r)=>e.check(Nt(...r)),e.size=(...r)=>e.check(or(...r));});function Q1(e,t){return new wm({type:"set",valueType:e,...O.normalizeParams(t)})}var xn=v("ZodEnum",(e,t)=>{Ul.init(e,t),j.init(e,t),e._zod.processJSONSchema=(n,o,i)=>gp(e,n,o),e.enum=t.entries,e.options=[...e._zod.values];let r=new Set(Object.keys(t.entries));e.extract=(n,o)=>{let i={};for(let s of n)if(r.has(s))i[s]=t.entries[s];else throw new Error(`Key ${s} not found in enum`);return new xn({...t,checks:[],...O.normalizeParams(o),entries:i})},e.exclude=(n,o)=>{let i={...t.entries};for(let s of n)if(r.has(s))delete i[s];else throw new Error(`Key ${s} not found in enum`);return new xn({...t,checks:[],...O.normalizeParams(o),entries:i})};});function $a(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new xn({type:"enum",entries:r,...O.normalizeParams(t)})}function V1(e,t){return new xn({type:"enum",entries:e,...O.normalizeParams(t)})}var Sm=v("ZodLiteral",(e,t)=>{Gl.init(e,t),j.init(e,t),e._zod.processJSONSchema=(r,n,o)=>_p(e,r,n,o),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}});});function j1(e,t){return new Sm({type:"literal",values:Array.isArray(e)?e:[e],...O.normalizeParams(t)})}var vm=v("ZodFile",(e,t)=>{Ql.init(e,t),j.init(e,t),e._zod.processJSONSchema=(r,n,o)=>$p(e,r,n),e.min=(r,n)=>e.check(mt(r,n)),e.max=(r,n)=>e.check(Nt(r,n)),e.mime=(r,n)=>e.check(fn(Array.isArray(r)?r:[r],n));});function q1(e){return qf(vm,e)}var Cm=v("ZodTransform",(e,t)=>{lr(),Vl.init(e,t),j.init(e,t),e._zod.processJSONSchema=(r,n,o)=>vp(e,r,n,o),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Mt(e.constructor.name);r.addIssue=i=>{if(typeof i=="string")r.issues.push(O.issue(i,r.value,t));else {let s=i;s.fatal&&(s.continue=false),s.code??(s.code="custom"),"input"in s||(s.input=r.value),s.inst??(s.inst=e),r.issues.push(O.issue(s));}};let o=t.transform(r.value,r);return o instanceof Promise?o.then(i=>(r.value=i,r)):(r.value=o,r)};});function xa(e){return new Cm({type:"transform",transform:e})}var Do=v("ZodOptional",(e,t)=>{is.init(e,t),j.init(e,t),e._zod.processJSONSchema=(r,n,o)=>qs(e,r,n,o),e.unwrap=()=>e._zod.def.innerType;});function ur(e){return new Do({type:"optional",innerType:e})}var wa=v("ZodExactOptional",(e,t)=>{jl.init(e,t),j.init(e,t),e._zod.processJSONSchema=(r,n,o)=>qs(e,r,n,o),e.unwrap=()=>e._zod.def.innerType;});function Pm(e){return new wa({type:"optional",innerType:e})}var km=v("ZodNullable",(e,t)=>{ql.init(e,t),j.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Ip(e,r,n,o),e.unwrap=()=>e._zod.def.innerType;});function zo(e){return new km({type:"nullable",innerType:e})}function W1(e){return ur(zo(e))}var Am=v("ZodDefault",(e,t)=>{Wl.init(e,t),j.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Lp(e,r,n,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap;});function Em(e,t){return new Am({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():O.shallowClone(t)}})}var Rm=v("ZodPrefault",(e,t)=>{Hl.init(e,t),j.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Tp(e,r,n,o),e.unwrap=()=>e._zod.def.innerType;});function Mm(e,t){return new Rm({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():O.shallowClone(t)}})}var Sa=v("ZodNonOptional",(e,t)=>{Kl.init(e,t),j.init(e,t),e._zod.processJSONSchema=(r,n,o)=>zp(e,r,n,o),e.unwrap=()=>e._zod.def.innerType;});function Im(e,t){return new Sa({type:"nonoptional",innerType:e,...O.normalizeParams(t)})}var zm=v("ZodSuccess",(e,t)=>{Jl.init(e,t),j.init(e,t),e._zod.processJSONSchema=(r,n,o)=>xp(e,r,n),e.unwrap=()=>e._zod.def.innerType;});function H1(e){return new zm({type:"success",innerType:e})}var Nm=v("ZodCatch",(e,t)=>{Xl.init(e,t),j.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Op(e,r,n,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap;});function Lm(e,t){return new Nm({type:"catch",innerType:e,catchValue:typeof t=="function"?t:O.constantCatch(t)})}var Tm=v("ZodNaN",(e,t)=>{Yl.init(e,t),j.init(e,t),e._zod.processJSONSchema=(r,n,o)=>yp(e,r,n,o);});function K1(e){return Vf(Tm,e)}var Zo=v("ZodPipe",(e,t)=>{ss.init(e,t),j.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Fp(e,r,n,o),e.in=t.in,e.out=t.out;});function Ys(e,t){return new Zo({type:"pipe",in:e,out:t})}var Bo=v("ZodCodec",(e,t)=>{Zo.init(e,t),$o.init(e,t);});function J1(e,t,r){return new Bo({type:"pipe",in:e,out:t,transform:r.decode,reverseTransform:r.encode})}function X1(e){let t=e._zod.def;return new Bo({type:"pipe",in:t.out,out:t.in,transform:t.reverseTransform,reverseTransform:t.transform})}var Om=v("ZodPreprocess",(e,t)=>{Zo.init(e,t),ef.init(e,t);}),Fm=v("ZodReadonly",(e,t)=>{tf.init(e,t),j.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Dp(e,r,n,o),e.unwrap=()=>e._zod.def.innerType;});function Dm(e){return new Fm({type:"readonly",innerType:e})}var Zm=v("ZodTemplateLiteral",(e,t)=>{rf.init(e,t),j.init(e,t),e._zod.processJSONSchema=(r,n,o)=>bp(e,r,n);});function Y1(e,t){return new Zm({type:"template_literal",parts:e,...O.normalizeParams(t)})}var Bm=v("ZodLazy",(e,t)=>{xo.init(e,t),j.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Bp(e,r,n,o),e.unwrap=()=>e._zod.def.getter();});function Um(e){return new Bm({type:"lazy",getter:e})}var Gm=v("ZodPromise",(e,t)=>{of.init(e,t),j.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Zp(e,r,n,o),e.unwrap=()=>e._zod.def.innerType;});function eg(e){return new Gm({type:"promise",innerType:e})}var Qm=v("ZodFunction",(e,t)=>{nf.init(e,t),j.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Sp(e,r,n,o);});function tg(e){return new Qm({type:"function",input:Array.isArray(e?.input)?bm(e?.input):e?.input??To(cr()),output:e?.output??cr()})}var Uo=v("ZodCustom",(e,t)=>{sf.init(e,t),j.init(e,t),e._zod.processJSONSchema=(r,n,o)=>wp(e,r,n,o);});function rg(e){let t=new ce({check:"custom"});return t._zod.check=e,t}function ng(e,t){return Wf(Uo,e??(()=>true),t)}function Vm(e,t={}){return Hf(Uo,e,t)}function jm(e,t){return Kf(e,t)}var og=Jf,ig=Xf,qm=v("ZodInstanceOf",(e,t)=>{Uo.init(e,t);},{properties(e,t){return this.check(ln(e,t))}});function sg(e,t={}){let r=new qm({type:"custom",check:"custom",fn:n=>n instanceof e,abort:true,...O.normalizeParams(t)});return r._zod.bag.Class=e,r._zod.check=n=>{n.value instanceof e||n.issues.push({code:"invalid_type",expected:e.name,input:n.value,inst:r,path:[...r._zod.def.path??[]]});},r}var ag=(...e)=>Yf({Codec:Bo,Boolean:vn,String:wn},...e);function cg(e){let t=Um(()=>Pn([Io(e),nm(),om(),cm(),To(t),$m(Io(),t)]));return t}function ug(e,t){return new Om({type:"pipe",in:xa(e),out:t})}var T5={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};function O5(e){me({customError:e});}function F5(){return me().customError}var Wm;Wm||(Wm={});var Go={};At(Go,{ZodISODate:()=>Dt,ZodISODateTime:()=>Ft,ZodISODuration:()=>Bt,ZodISOTime:()=>Zt,date:()=>Z5,datetime:()=>D5,duration:()=>U5,time:()=>B5});function D5(e){return Po(Ft,e)}function Z5(e){return ko(Dt,e)}function B5(e){return Ao(Zt,e)}function U5(e){return Eo(Bt,e)}var L={...kn,...Ks,iso:Go},G5=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"]);function Q5(e,t){let r=e.$schema;return r==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":r==="http://json-schema.org/draft-07/schema#"?"draft-7":r==="http://json-schema.org/draft-04/schema#"?"draft-4":t??"draft-2020-12"}function lg(e,t){return e.map((r,n)=>n<t?r:r.optional())}function V5(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function j5(e,t){if(!e.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let r=e.slice(1).split("/").filter(Boolean);if(r.length===0)return t.rootSchema;let n=t.version==="draft-2020-12"?"$defs":"definitions";if(r[0]===n){let o=r[1]===void 0?void 0:V5(r[1]);if(!o||!t.defs[o])throw new Error(`Reference not found: ${e}`);return t.defs[o]}throw new Error(`Reference not found: ${e}`)}function q5(e,t){return L.transform(n=>n).check(n=>{let o=n.value;if(typeof o!="object"||o===null||Array.isArray(o))return;let i=Object.getOwnPropertyNames(o);if(t.minProperties!==void 0&&i.length<t.minProperties&&n.issues.push({origin:"object",code:"too_small",minimum:t.minProperties,inclusive:true,message:`Too small: expected object to have >=${t.minProperties} properties`,input:o,inst:e,continue:true}),t.maxProperties!==void 0&&i.length>t.maxProperties&&n.issues.push({origin:"object",code:"too_big",maximum:t.maxProperties,inclusive:true,message:`Too big: expected object to have <=${t.maxProperties} properties`,input:o,inst:e,continue:true}),t.keySchema)for(let s of i){let a=t.keySchema.safeParse(s);a.success||n.issues.push({code:"invalid_key",origin:"record",issues:a.error.issues,input:s,path:[s],continue:true});}}).pipe(e)}function Hm(e,t){if(e===null)return "z";let r=typeof e;if(r!=="object"){if(r==="number"&&Number.isNaN(e))return null;let n=String(e);return `${r[0]}${n.length}:${n}`}if(t.has(e))return null;t.add(e);try{if(Array.isArray(e)){let i=[];for(let s of e){let a=Hm(s,t);if(a===null)return null;i.push(a);}return `a${i.length}:[${i.join(",")}]`}let n=Object.keys(e).sort(),o=[];for(let i of n){let s=Hm(e[i],t);if(s===null)return null;o.push(`${i.length}:${i}=${s}`);}return `o${o.length}:{${o.join(",")}}`}finally{t.delete(e);}}var W5=new Set(["items","prefixItems","additionalItems","additionalProperties","contains","propertyNames","not","if","then","else","allOf","anyOf","oneOf","unevaluatedItems","unevaluatedProperties","contentSchema"]),H5=new Set(["properties","patternProperties","dependentSchemas","dependencies","$defs","definitions"]);function Qo(e){return typeof e!="object"||e===null?false:Array.isArray(e)?e.some(Qo):typeof e.$ref=="string"?true:Object.entries(e).some(([t,r])=>W5.has(t)?Qo(r):!H5.has(t)||typeof r!="object"||r===null?false:Object.values(r).some(Qo))}function fg(e){return e===1?"element":"elements"}function K5(e,t){return L.transform(n=>n).check(n=>{let o=n.value;if(Array.isArray(o)){if(t.uniqueItems===true){let i=new Map;for(let s=0;s<o.length;s++){let a=Hm(o[s],new Set);if(a===null)continue;let c=i.get(a);if(c===void 0){i.set(a,s);continue}n.issues.push({code:"custom",message:`Array items must be unique: element at index ${s} duplicates the one at index ${c}`,input:o,path:[s],continue:true});}}if(t.containsSchema){let i=t.minContains??1,s=t.maxContains!==void 0?t.maxContains+1:Number.POSITIVE_INFINITY,a=0;for(let c of o)if(t.containsSchema.safeParse(c).success&&++a>=s)break;a<i&&n.issues.push({code:"custom",message:`Array must contain at least ${i} matching ${fg(i)}; found ${a}`,input:o,continue:true}),t.maxContains!==void 0&&a>t.maxContains&&n.issues.push({code:"custom",message:`Array must contain at most ${t.maxContains} matching ${fg(t.maxContains)}`,input:o,continue:true});}}}).pipe(e)}function pg(e,t){if(e!==false)return e===void 0||e===true?L.any():De(e,t)}var J5=/^(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|[+-](?:[01]\d|2[0-3]):[0-5]\d)$/;function mg(e,t){if(e.not!==void 0){if(typeof e.not=="object"&&Object.keys(e.not).length===0)return L.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(e.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(e.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(e.if!==void 0||e.then!==void 0||e.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(e.dependentSchemas!==void 0||e.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(e.$ref){let o=e.$ref;if(t.refs.has(o))return t.refs.get(o);if(t.processing.has(o))return L.lazy(()=>{if(!t.refs.has(o))throw new Error(`Circular reference not resolved: ${o}`);return t.refs.get(o)});t.processing.add(o);let i=j5(o,t),s=De(i,t);return t.refs.set(o,s),t.processing.delete(o),s}if(e.enum!==void 0){let o=e.enum;if(t.version==="openapi-3.0"&&e.nullable===true&&o.length===1&&o[0]===null)return L.null();if(o.length===0)return L.never();if(o.length===1)return L.literal(o[0]);if(o.every(s=>typeof s=="string"))return L.enum(o);let i=o.map(s=>L.literal(s));return i.length<2?i[0]:L.union([i[0],i[1],...i.slice(2)])}if(e.const!==void 0)return L.literal(e.const);let r=e.type;if(Array.isArray(r)){let o=r.map(i=>{let s={...e,type:i};return mg(s,t)});return o.length===0?L.never():o.length===1?o[0]:L.union(o)}if(!r)return L.any();let n;switch(r){case "string":{let o=L.string();if(e.format){let i=e.format;i==="email"?o=o.check(L.email()):i==="uri"||i==="uri-reference"?o=o.check(L.url()):i==="uuid"||i==="guid"?o=o.check(L.uuid()):i==="date-time"?o=o.check(L.iso.datetime({offset:true})):i==="date"?o=o.check(L.iso.date()):i==="time"?o=o.check(L.regex(J5)):i==="duration"?o=o.check(L.iso.duration()):i==="hostname"?o=o.check(L.hostname()):i==="ipv4"?o=o.check(L.ipv4()):i==="ipv6"?o=o.check(L.ipv6()):i==="mac"?o=o.check(L.mac()):i==="cidr"?o=o.check(L.cidrv4()):i==="cidr-v6"?o=o.check(L.cidrv6()):i==="base64"?o=o.check(L.base64()):i==="base64url"?o=o.check(L.base64url()):i==="e164"?o=o.check(L.e164()):i==="credit_card"?o=o.check(L.creditCard()):i==="iban"?o=o.check(L.iban()):i==="jwt"?o=o.check(L.jwt()):i==="emoji"?o=o.check(L.emoji()):i==="nanoid"?o=o.check(L.nanoid()):i==="cuid"?o=o.check(L.cuid()):i==="cuid2"?o=o.check(L.cuid2()):i==="ulid"?o=o.check(L.ulid()):i==="xid"?o=o.check(L.xid()):i==="ksuid"&&(o=o.check(L.ksuid()));}typeof e.minLength=="number"&&(o=o.min(e.minLength)),typeof e.maxLength=="number"&&(o=o.max(e.maxLength)),e.pattern&&(o=o.regex(new RegExp(e.pattern))),n=o;break}case "number":case "integer":{let o=r==="integer"?L.number().int():L.number();typeof e.minimum=="number"&&e.exclusiveMinimum!==true&&(o=o.min(e.minimum)),typeof e.maximum=="number"&&e.exclusiveMaximum!==true&&(o=o.max(e.maximum)),typeof e.exclusiveMinimum=="number"?o=o.gt(e.exclusiveMinimum):e.exclusiveMinimum===true&&typeof e.minimum=="number"&&(o=o.gt(e.minimum)),typeof e.exclusiveMaximum=="number"?o=o.lt(e.exclusiveMaximum):e.exclusiveMaximum===true&&typeof e.maximum=="number"&&(o=o.lt(e.maximum)),typeof e.multipleOf=="number"&&(o=o.multipleOf(e.multipleOf)),n=o;break}case "boolean":{n=L.boolean();break}case "null":{n=L.null();break}case "object":{let o={},i=e.properties||{},s=new Set(e.required||[]),a=typeof e.additionalProperties=="object"?De(e.additionalProperties,t):void 0;for(let[f,p]of Object.entries(i)){let m=De(p,t);Ce(o,f,s.has(f)?m:m.optional());}if(e.patternProperties){let f=e.patternProperties,p=Object.keys(f),m=[];for(let d of p){let g=De(f[d],t),y=L.string().regex(new RegExp(d));m.push(L.looseRecord(y,g));}let h=[];if(Object.keys(o).length>0&&h.push(L.object(o).passthrough()),h.push(...m),h.length===0)n=L.object({}).passthrough();else if(h.length===1)n=h[0];else {let d=L.intersection(h[0],h[1]);for(let g=2;g<h.length;g++)d=L.intersection(d,h[g]);n=d;}if(e.additionalProperties===false){let d=Object.keys(o),g=p.map(_=>new RegExp(_)),y=n;n=n.check(_=>{if(!et(_.value))return;let b=[];for(let S of Object.keys(_.value))d.includes(S)||g.some(C=>C.test(S))||b.push(S);b.length&&_.issues.push({code:"unrecognized_keys",keys:b,input:_.value,inst:y});});}}else {let f=L.object(o);e.additionalProperties===false?n=f.strict():a?n=f.catchall(a):n=f.passthrough();}let c=e.propertyNames!==void 0&&e.propertyNames!==true,u=typeof e.minProperties=="number"?e.minProperties:void 0,l=typeof e.maxProperties=="number"?e.maxProperties:void 0;if(c||u!==void 0||l!==void 0){let f;if(c){let p=typeof e.propertyNames=="object"&&e.propertyNames.type===void 0?{type:"string",...e.propertyNames}:e.propertyNames;f=De(p,t);}n=q5(n,{keySchema:f,minProperties:u,maxProperties:l});}break}case "array":{let o=e.prefixItems,i=e.items;if(o&&Array.isArray(o)){let s=typeof e.minItems=="number"?e.minItems:0,a=o.map(f=>De(f,t)),c=lg(a,s),u=Array.isArray(i)?void 0:pg(i,t),l=L.tuple(c);n=u?l.rest(u):l,typeof e.minItems=="number"&&(n=n.check(L.minLength(e.minItems))),typeof e.maxItems=="number"&&(n=n.check(L.maxLength(e.maxItems)));}else if(Array.isArray(i)){let s=typeof e.minItems=="number"?e.minItems:0,a=i.map(f=>De(f,t)),c=lg(a,s),u=pg(e.additionalItems,t),l=L.tuple(c);n=u?l.rest(u):l,typeof e.minItems=="number"&&(n=n.check(L.minLength(e.minItems))),typeof e.maxItems=="number"&&(n=n.check(L.maxLength(e.maxItems)));}else if(i!==void 0){let s=De(i,t),a=L.array(s);typeof e.minItems=="number"&&(a=a.min(e.minItems)),typeof e.maxItems=="number"&&(a=a.max(e.maxItems)),n=a;}else n=L.array(L.any());(e.uniqueItems===true||e.contains!==void 0)&&(n=K5(n,{uniqueItems:e.uniqueItems===true,containsSchema:e.contains!==void 0?De(e.contains,t):void 0,minContains:typeof e.minContains=="number"?e.minContains:void 0,maxContains:typeof e.maxContains=="number"?e.maxContains:void 0}));break}default:throw new Error(`Unsupported type: ${r}`)}return n}function De(e,t){if(typeof e=="boolean")return e?L.any():L.never();let r=mg(e,t),n=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){let a=e.anyOf.map(u=>De(u,t)),c=L.union(a);r=n?L.intersection(r,c):c;}if(e.oneOf&&Array.isArray(e.oneOf)){let a=e.oneOf.map(u=>De(u,t)),c=L.xor(a);r=n?L.intersection(r,c):c;}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)r=n?r:L.any();else {let a=n?r:De(e.allOf[0],t),c=n?0:1;for(let u=c;u<e.allOf.length;u++)a=L.intersection(a,De(e.allOf[u],t));r=a;}e.nullable===true&&t.version==="openapi-3.0"&&(r=L.nullable(r)),e.readOnly===true&&(r=L.readonly(r)),e.default!==void 0&&(r=r.default(e.default));let o={},i=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let a of i)a in e&&(o[a]=e[a]);let s=["contentEncoding","contentMediaType","contentSchema"];for(let a of s)a in e&&(o[a]=e[a]);if(e.type==="object"&&e.$ref===void 0){e.propertyNames!==void 0&&!Qo(e.propertyNames)&&(o.propertyNames=e.propertyNames);for(let a of ["minProperties","maxProperties"])e[a]!==void 0&&(o[a]=e[a]);}if(e.type==="array"&&e.$ref===void 0){e.contains!==void 0&&!Qo(e.contains)&&(o.contains=e.contains);for(let a of ["uniqueItems","minContains","maxContains"])e[a]!==void 0&&(o[a]=e[a]);}for(let a of Object.keys(e))G5.has(a)||Ce(o,a,e[a]);return Object.keys(o).length>0&&t.registry.add(r,o),e.description&&(r=r.describe(e.description)),r}function dg(e,t){if(typeof e=="boolean")return e?L.any():L.never();let r;try{r=JSON.parse(JSON.stringify(e));}catch{throw new Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}let n=Q5(r,t?.defaultTarget),o=r.$defs||r.definitions||{},i={version:n,defs:o,refs:new Map,processing:new Set,rootSchema:r,registry:t?.registry??Pe};return De(r,i)}var hg=Symbol("z.visit/resolving");function Vo(e,t){let r=typeof t=="function"?t:(s,a)=>{let c=t[s._zod.def.type];return c?c(s,a):s},n=new Map;function o(s){let a=n.get(s);if(a===hg)return new xo({type:"lazy",getter:()=>n.get(s)});if(a!==void 0)return a;n.set(s,hg);let c=i(s),u=r(c,c!==s);return n.set(s,u),u}function i(s){let a=s._zod.def,c=a.type;switch(c){case "object":{let u=a.shape,l=Object.keys(u),f=false,p={};for(let h of l){let d=o(u[h]);d!==u[h]&&(f=true),p[h]=d;}let m=a.catchall;return a.catchall&&(m=o(a.catchall),m!==a.catchall&&(f=true)),f?Y(s,{...a,shape:p,catchall:m}):s}case "array":{let u=o(a.element);return u===a.element?s:Y(s,{...a,element:u})}case "tuple":{let u=a.items,l=false,f=[];for(let m of u){let h=o(m);h!==m&&(l=true),f.push(h);}let p=a.rest;return a.rest&&(p=o(a.rest),p!==a.rest&&(l=true)),l?Y(s,{...a,items:f,rest:p}):s}case "record":case "map":{let u=o(a.keyType),l=o(a.valueType);return u===a.keyType&&l===a.valueType?s:Y(s,{...a,keyType:u,valueType:l})}case "set":{let u=o(a.valueType);return u===a.valueType?s:Y(s,{...a,valueType:u})}case "union":{let u=a.options,l=false,f=[];for(let p of u){let m=o(p);m!==p&&(l=true),f.push(m);}return l?Y(s,{...a,options:f}):s}case "intersection":{let u=o(a.left),l=o(a.right);return u===a.left&&l===a.right?s:Y(s,{...a,left:u,right:l})}case "optional":case "nullable":case "default":case "prefault":case "catch":case "readonly":case "nonoptional":case "promise":case "success":{let u=o(a.innerType);return u===a.innerType?s:Y(s,{...a,innerType:u})}case "pipe":{let u=o(a.in),l=o(a.out);return u===a.in&&l===a.out?s:Y(s,{...a,in:u,out:l})}case "function":{let u=o(a.input),l=o(a.output);return u===a.input&&l===a.output?s:Y(s,{...a,input:u,output:l})}case "lazy":{let u=a.getter,{_cachedInner:l,...f}=a;return Y(s,{...f,getter:()=>o(u())})}case "template_literal":case "string":case "number":case "int":case "boolean":case "bigint":case "symbol":case "undefined":case "null":case "void":case "never":case "any":case "unknown":case "date":case "nan":case "enum":case "literal":case "file":case "transform":case "custom":return s;default:return s}}return o(e)}function gg(e){return Vo(e,{object:t=>t.partial(),union:t=>{let r=t._zod.def;return r.discriminator===void 0?t:Pn(r.options)}})}function X5(e,t){if(!t?.length)return e;let r=e._zod.def;return Y(e,ot(r,{checks:[...r.checks??[],...t]}),{parent:true})}function _g(e){return X5(e.out,e.checks)}function Y5(e){return e.in._zod.traits.has("$ZodTransform")?_g(e):e.in}function yg(e){return Vo(e,{pipe:t=>Y5(t._zod.def),default:(t,r)=>r?ur(t._zod.def.innerType):t,catch:(t,r)=>r?t._zod.def.innerType:t})}function bg(e){return Vo(e,{pipe:t=>_g(t._zod.def),prefault:(t,r)=>r?t._zod.def.innerType:t})}var Km={};At(Km,{bigint:()=>n4,boolean:()=>r4,date:()=>o4,number:()=>t4,string:()=>e4});function e4(e){return yf(wn,e)}function t4(e){return vf(Sn,e)}function r4(e){return Mf(vn,e)}function n4(e){return zf(Cn,e)}function o4(e){return Qf(Lo,e)}var Ca=["logo","halftone"],i4=k.enum(Ca),va={logo:["blend","badge"],halftone:["color","mono"]},s4=k.enum([...va.logo,...va.halftone]),mr=192,$g=e=>Math.ceil(e/3)*4,a4=k.object({width:k.number().int().min(1).max(mr),height:k.number().int().min(1).max(mr),data:k.string().max($g(mr*mr*4))}).refine(e=>e.data.length===$g(e.width*e.height*4),{message:"Art image data does not match its width and height"}),xg=k.object({mode:i4,image:a4,intensity:k.number().min(0).max(1).optional(),variant:s4.optional(),matchEyes:k.boolean().optional()});k.enum(["solid","linear","radial","angular","image"]);var c4=k.object({type:k.literal("solid"),color:k.string()}),Jm=k.object({color:k.string(),offset:k.number().min(0).max(100)}),u4=k.object({type:k.literal("linear"),stops:k.array(Jm).min(2),angle:k.number().optional().default(0)}),l4=k.object({type:k.literal("radial"),stops:k.array(Jm).min(2)}),f4=k.object({type:k.literal("angular"),stops:k.array(Jm).min(2),angle:k.number().optional().default(0)}),p4=k.enum(["cover","contain","tile"]),m4=k.enum(["top-left","top","top-right","left","center","right","bottom-left","bottom","bottom-right"]),d4=k.object({type:k.literal("image"),src:k.string().min(1),fit:p4.optional().default("cover"),scale:k.number().min(.1).max(4).optional().default(1),position:m4.optional().default("center"),opacity:k.number().min(0).max(1).optional().default(1),underlay:k.string().optional()}),dr=k.union([k.string(),c4,u4,l4,f4,d4]);function hr(e,t="#000000"){return e?typeof e=="string"?{type:"solid",color:e}:e:{type:"solid",color:t}}function jo(e){return !e||typeof e=="string"?false:e.type==="linear"||e.type==="radial"||e.type==="angular"}function wg(e){return typeof e=="object"&&e!==null&&e.type==="image"}var Sg=["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"],h4=["diamond","star","banner"],vg=k.enum([...Sg,...h4]);k.enum(Sg);var Cg=["square","rounded","gear","circle","diya","extra-rounded","message","pointy","leaf","drop","octagon","bevel","squircle","cushion","shield","petal","leaf-reverse"],g4=["curly"],Pg=k.enum([...Cg,...g4]);k.enum(Cg);var _4=["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"],An=24;var Xm=.5,En=1.5,y4=k.enum(_4),Ym=k.object({style:y4,text:k.string().max(An).optional(),color:k.string().optional(),textColor:k.string().optional(),secondaryText:k.string().max(An).optional(),secondaryColor:k.string().optional(),fontScale:k.number().min(Xm).max(En).optional()});function re(e,t=3){let r=10**t;return Math.round(e*r)/r+0}function $(e,t=3){return String(re(e,t))}function R(e,...t){let r=e[0]??"";for(let n=0;n<t.length;n++){let o=t[n];r+=(typeof o=="number"?$(o):o)+(e[n+1]??"");}return r}var b4={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0},$4=/^[MmLlHhVvCcSsQqTtAaZz0-9.,+\-\s]*$/,ed=/[+-]?(?:\d+\.?\d*|\.\d+)/y;function qo(e,t=Number.POSITIVE_INFINITY){if(!$4.test(e))return null;let r=[],n=0,o=()=>{for(;n<e.length&&/[\s,]/.test(e[n]);)n++;},i=()=>{o(),ed.lastIndex=n;let c=ed.exec(e);if(!c)return null;let u=c[0],l=u.indexOf(".");if(l>=0&&u.length-l-1>t)return null;n=ed.lastIndex;let f=Number(u);return Number.isFinite(f)?f:null},s=()=>{o();let c=e[n];return c==="0"||c==="1"?(n++,c==="1"?1:0):null},a=()=>(o(),n<e.length&&/[0-9.+-]/.test(e[n]));for(o();n<e.length;){let c=e[n],u=c.toUpperCase(),l=b4[u];if(l===void 0||r.length===0&&u!=="M")return null;if(n++,l===0){r.push({command:c,values:[]}),o();continue}let f=c,p=true;for(;p||a();){let m=[];for(let h=0;h<l;h++){let d=u==="A"&&(h===3||h===4)?s():i();if(d===null)return null;m.push(d);}r.push({command:f,values:m}),u==="M"&&(f=c==="M"?"L":"l"),p=false;}o();}return r}function kg(e){let t=0;for(let{command:r}of e)t+=r.toUpperCase()==="A"?4:1;return t}function td(e,t=1,r=0,n=0){let o="";for(let{command:i,values:s}of e){let a=i.toUpperCase(),c=i===a,u=c?r:0,l=c?n:0,f;switch(a){case "Z":f=[];break;case "H":f=[$(s[0]*t+u)];break;case "V":f=[$(s[0]*t+l)];break;case "A":f=[$(Math.abs(s[0])*t),$(Math.abs(s[1])*t),$(s[2]),String(s[3]),String(s[4]),$(s[5]*t+u),$(s[6]*t+l)];break;default:f=s.map((p,m)=>$(p*t+(m%2===0?u:l)));}o+=i+f.join(" ");}return o}function Eg(e,t=.25){let r=[],n=[],o=[0,0],i=[0,0],s=()=>{n.length>2&&r.push(n),n=[];};for(let a of e)if(a.op==="M")s(),o=[a.x,a.y],i=o,n.push(o);else if(a.op==="L")i=[a.x,a.y],n.push(i);else if(a.op==="C"){let c=i,u=[a.x1,a.y1],l=[a.x2,a.y2],f=[a.x,a.y],p=Math.hypot(u[0]-c[0],u[1]-c[1])+Math.hypot(l[0]-u[0],l[1]-u[1])+Math.hypot(f[0]-l[0],f[1]-l[1]),m=Math.max(2,Math.min(64,Math.ceil(Math.sqrt(p/(4*t)))));for(let h=1;h<=m;h++){let d=h/m,g=1-d;n.push([g*g*g*c[0]+3*g*g*d*u[0]+3*g*d*d*l[0]+d*d*d*f[0],g*g*g*c[1]+3*g*g*d*u[1]+3*g*d*d*l[1]+d*d*d*f[1]]);}i=f;}else s(),i=o;return s(),r}function Pa(e,t){let r=[o=>o[0]-t.x0,o=>t.x1-o[0],o=>o[1]-t.y0,o=>t.y1-o[1]],n=e;for(let o of r){if(n.length===0)break;let i=n;n=[];for(let s=0;s<i.length;s++){let a=i[s],c=i[(s+i.length-1)%i.length],u=o(a),l=o(c);u>=0?(l<0&&n.push(Ag(c,a,l,u)),n.push(a)):l>=0&&n.push(Ag(c,a,l,u));}}return n.length>2?n:[]}function Ag(e,t,r,n){let o=r/(r-n);return [e[0]+(t[0]-e[0])*o,e[1]+(t[1]-e[1])*o]}function Rg(e){return e.filter(t=>t.length>2).map(t=>`M${t.map(([r,n])=>`${$(r)} ${$(n)}`).join("L")}Z`).join("")}function Mg(e){let t=Number.POSITIVE_INFINITY,r=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY,o=Number.NEGATIVE_INFINITY,i=(s,a)=>{t=Math.min(t,s),r=Math.min(r,a),n=Math.max(n,s),o=Math.max(o,a);};for(let s of e)s.op==="C"?(i(s.x1,s.y1),i(s.x2,s.y2),i(s.x,s.y)):s.op!=="Z"&&i(s.x,s.y);return Number.isFinite(t)?{x0:t,y0:r,x1:n,y1:o}:null}var x4={amp:"&",lt:"<",gt:">",quot:'"',apos:"'"};function Ng(e){return e.replace(/&(#x[0-9a-f]+|#\d+|[a-z]+);/gi,(t,r)=>{if(r[0]==="#"){let n=r[1].toLowerCase()==="x"?Number.parseInt(r.slice(2),16):Number.parseInt(r.slice(1),10);return Number.isInteger(n)&&n>0&&n<=1114111&&!(n>=55296&&n<=57343)?String.fromCodePoint(n):t}return x4[r.toLowerCase()]??t})}var w4=60,rd=62,nd=47,S4=61,Ig=34,zg=39,id=/\s*/y,v4=/[^\s/>]*/y,C4=/[^\s>]*/y,P4=/[^\s=]*/y;function Rn(e,t,r){return e.lastIndex=r,e.test(t)?e.lastIndex:r}function k4(e,t){let r=e.length,n=w=>{let x=Number.POSITIVE_INFINITY,A=-1;return P=>((P<x||A>=0&&A<P)&&(x=P,A=e.indexOf(w,P)),A)},o=n("-->"),i=n("?>"),s=n("]]>"),a=n(">"),c,u=w=>{let x=e.charCodeAt(w);if(x!==Ig&&x!==zg)return w+1;let A=e.indexOf(e[w],w+1);return A<0?r:A+1},l=w=>{for(let x=w;x<r&&!c?.[x];x=u(x)){let A=e.charCodeAt(x);if(A===rd||A===nd&&e.charCodeAt(x+1)===rd)return x}c??=new Uint8Array(r);for(let x=w;x<r&&!c[x];x=u(x))c[x]=1;return -1},f=-1,p=-1,m=-1,h=-1,d=w=>{let x=w+1;if(x<f||x>=p){f=x,p=Rn(v4,e,x),m=-1;for(let P=p;P>x;P--){let E=e.charCodeAt(P);if((P===p||E===Ig||E===zg)&&(h=l(P),h>=0)){m=P;break}}}if(m<=x)return -1;let A=e.charCodeAt(h)===nd;return t.open(e.slice(x,m),e.slice(m,h),A),h+(A?2:1)},g=-1,y=-1,_=-1,b=w=>{let x=w+2;if(x<g||x>=y){g=x,y=Rn(C4,e,x);let A=Rn(id,e,y);_=y>x&&e.charCodeAt(A)===rd?A:-1;}return _},S=w=>{if(e.startsWith("<!--",w)){let x=o(w+4);if(x>=0)return x+3}if(e.startsWith("<?",w)){let x=i(w+2);if(x>=0)return x+2}if(e.startsWith("<![CDATA[",w)){let x=s(w+9);if(x>=0)return t.cdata(e.slice(w+9,x)),x+3}if(e.startsWith("<!",w)){let x=a(w+2);if(x>=0)return x+1}if(e.charCodeAt(w+1)===nd){let x=b(w);return x<0?-1:(t.close(),x+1)}return d(w)},C=0;for(;C<r;)if(e.charCodeAt(C)===w4){let w=S(C);C=w<0?C+1:w;}else {let w=e.indexOf("<",C),x=w<0?r:w;t.text(e.slice(C,x)),C=x;}}function A4(e){let t={},r=0;for(;r<e.length;){let n=Rn(P4,e,r);if(n===r){r++;continue}let o=Rn(id,e,n);if(e.charCodeAt(o)===S4){let i=Rn(id,e,o+1),s=e[i],a=s==='"'||s==="'"?e.indexOf(s,i+1):-1;if(a>=0){t[e.slice(r,n)]=Ng(e.slice(i+1,a)),r=a+1;continue}}r=n;}return t}function Ea(e){let t={name:"#root",attrs:{},children:[],text:""},r=[t],n=()=>r.at(-1);k4(e,{open(i,s,a){let c=A4(s),u={name:i,attrs:c,children:[],text:""};n().children.push(u),a||r.push(u);},close(){r.length>1&&r.pop();},text(i){n().text+=Ng(i);},cdata(i){n().text+=i;}});let o=i=>{for(let s of i.children){if(s.name==="svg")return s;let a=o(s);if(a)return a}return null};return o(t)}var ka=[1,0,0,1,0,0];function Ze(e,t){let[r,n,o,i,s,a]=e,[c,u,l,f,p,m]=t;return [r*c+o*u,n*c+i*u,r*l+o*f,n*l+i*f,r*p+o*m+s,n*p+i*m+a]}function ye(e,t,r){return [e[0]*t+e[2]*r+e[4],e[1]*t+e[3]*r+e[5]]}function sd(e){return Math.sqrt(Math.abs(e[0]*e[3]-e[1]*e[2]))}function Ra(e){return e?(e.match(/[+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?/gi)??[]).map(Number):[]}function gr(e){let t=ka;if(!e)return t;for(let[,r,n]of e.matchAll(/(matrix|translate|scale|rotate|skewX|skewY)\s*\(([^)]*)\)/g)){let o=Ra(n),i=ka;switch(r){case "matrix":o.length===6&&(i=o);break;case "translate":i=[1,0,0,1,o[0]??0,o[1]??0];break;case "scale":i=[o[0]??1,0,0,o[1]??o[0]??1,0,0];break;case "rotate":{let s=(o[0]??0)*Math.PI/180,a=Math.cos(s),c=Math.sin(s),[u,l]=[o[1]??0,o[2]??0];i=Ze(Ze([1,0,0,1,u,l],[a,c,-c,a,0,0]),[1,0,0,1,-u,-l]);break}case "skewX":i=[1,0,Math.tan((o[0]??0)*Math.PI/180),1,0,0];break;case "skewY":i=[1,Math.tan((o[0]??0)*Math.PI/180),0,1,0,0];break;}t=Ze(t,i);}return t}var od=/[+-]?(?:\d+\.?\d*|\.\d+)(?:[eE][+-]?\d+)?/y;function E4(e,t,r,n,o,i,s,a,c){if(e===a&&t===c)return [];let u=Math.abs(r),l=Math.abs(n);if(u===0||l===0)return [{op:"L",x:a,y:c}];let f=o*Math.PI/180,p=Math.cos(f),m=Math.sin(f),h=(e-a)/2,d=(t-c)/2,g=p*h+m*d,y=-m*h+p*d,_=g*g/(u*u)+y*y/(l*l);_>1&&(u*=Math.sqrt(_),l*=Math.sqrt(_));let b=u*u*l*l-u*u*y*y-l*l*g*g,S=u*u*y*y+l*l*g*g,C=(i===s?-1:1)*Math.sqrt(Math.max(0,b/S)),w=C*u*y/l,x=-C*l*g/u,A=p*w-m*x+(e+a)/2,P=m*w+p*x+(t+c)/2,E=(K,U,X,xe)=>Math.atan2(K*xe-U*X,K*X+U*xe),I=E(1,0,(g-w)/u,(y-x)/l),N=E((g-w)/u,(y-x)/l,(-g-w)/u,(-y-x)/l);!s&&N>0?N-=2*Math.PI:s&&N<0&&(N+=2*Math.PI);let T=Math.max(1,Math.ceil(Math.abs(N)/(Math.PI/2)-1e-9)),V=N/T,Q=4/3*Math.tan(V/4),F=(K,U)=>[A+u*p*K-l*m*U,P+u*m*K+l*p*U],W=[];for(let K=0;K<T;K++){let U=I+K*V,X=U+V,[xe,ze]=F(Math.cos(U)-Q*Math.sin(U),Math.sin(U)+Q*Math.cos(U)),[he,pe]=F(Math.cos(X)+Q*Math.sin(X),Math.sin(X)-Q*Math.cos(X)),[ke,J]=K===T-1?[a,c]:F(Math.cos(X),Math.sin(X));W.push({op:"C",x1:xe,y1:ze,x2:he,y2:pe,x:ke,y:J});}return W}function _r(e){let t=[],r=0,n=0,o=0,i=0,s=0,a="",c=null,u=null,l=()=>{for(;r<e.length&&/[\s,]/.test(e[r]);)r++;},f=()=>{l(),od.lastIndex=r;let h=od.exec(e);return h?(r=od.lastIndex,Number(h[0])):null},p=()=>{l();let h=e[r];return h==="0"||h==="1"?(r++,h==="1"):null},m=h=>{let d=[];for(let g=0;g<h;g++){let y=f();if(y===null)return null;d.push(y);}return d};for(;l(),!(r>=e.length);){let h=e[r];if(/[MmLlHhVvCcSsQqTtAaZz]/.test(h))a=h,r++;else if(!a||a==="Z"||a==="z")break;let d=a===a.toLowerCase(),g=d?n:0,y=d?o:0,_=a.toUpperCase();if(_==="Z"){t.push({op:"Z"}),n=i,o=s,c=null,u=null;continue}if(_==="A"){let w=m(3),x=p(),A=p(),P=m(2);if(!(w&&P)||x===null||A===null)break;let[E,I,N]=w,T=P[0]+g,V=P[1]+y;t.push(...E4(n,o,E,I,N,x,A,T,V)),n=T,o=V,c=null,u=null;continue}let b={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2}[_]??0,S=m(b);if(!S)break;let C=S;switch(_){case "M":n=C[0]+g,o=C[1]+y,i=n,s=o,t.push({op:"M",x:n,y:o}),a=d?"l":"L",c=null,u=null;break;case "L":case "H":case "V":_!=="V"&&(n=C[0]+g),_==="V"?o=C[0]+y:_==="L"&&(o=C[1]+y),t.push({op:"L",x:n,y:o}),c=null,u=null;break;case "C":case "S":{let w,x;_==="C"?(w=[C[0]+g,C[1]+y],x=C.slice(2)):(w=c?[2*n-c[0],2*o-c[1]]:[n,o],x=C);let A=[x[0]+g,x[1]+y],P=[x[2]+g,x[3]+y];t.push({op:"C",x1:w[0],y1:w[1],x2:A[0],y2:A[1],x:P[0],y:P[1]}),[n,o]=P,c=A,u=null;break}case "Q":case "T":{let w,x;_==="Q"?(w=[C[0]+g,C[1]+y],x=[C[2]+g,C[3]+y]):(w=u?[2*n-u[0],2*o-u[1]]:[n,o],x=[C[0]+g,C[1]+y]),t.push({op:"C",x1:n+2/3*(w[0]-n),y1:o+2/3*(w[1]-o),x2:x[0]+2/3*(w[0]-x[0]),y2:x[1]+2/3*(w[1]-x[1]),x:x[0],y:x[1]}),[n,o]=x,u=w,c=null;break}}}return t}var Aa=.5522847498;function Wo(e,t,r,n){if(r<=0||n<=0)return [];let o=r*Aa,i=n*Aa;return [{op:"M",x:e+r,y:t},{op:"C",x1:e+r,y1:t+i,x2:e+o,y2:t+n,x:e,y:t+n},{op:"C",x1:e-o,y1:t+n,x2:e-r,y2:t+i,x:e-r,y:t},{op:"C",x1:e-r,y1:t-i,x2:e-o,y2:t-n,x:e,y:t-n},{op:"C",x1:e+o,y1:t-n,x2:e+r,y2:t-i,x:e+r,y:t},{op:"Z"}]}function Mn(e,t,r,n,o=0,i=0){if(r<=0||n<=0)return [];let s=Math.min(Math.max(o,0),r/2),a=Math.min(Math.max(i,0),n/2);if(s===0||a===0)return [{op:"M",x:e,y:t},{op:"L",x:e+r,y:t},{op:"L",x:e+r,y:t+n},{op:"L",x:e,y:t+n},{op:"Z"}];let c=s*Aa,u=a*Aa,l=e+r,f=t+n;return [{op:"M",x:e+s,y:t},{op:"L",x:l-s,y:t},{op:"C",x1:l-s+c,y1:t,x2:l,y2:t+a-u,x:l,y:t+a},{op:"L",x:l,y:f-a},{op:"C",x1:l,y1:f-a+u,x2:l-s+c,y2:f,x:l-s,y:f},{op:"L",x:e+s,y:f},{op:"C",x1:e+s-c,y1:f,x2:e,y2:f-a+u,x:e,y:f-a},{op:"L",x:e,y:t+a},{op:"C",x1:e,y1:t+a-u,x2:e+s-c,y2:t,x:e+s,y:t},{op:"Z"}]}var R4="qrdx.frame",M4=1,ud="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:An},I4=["wifi","star","heart","phone","headphones","calendar","user","chat","bag","bell","cup","card","check","info","home","pin","share","download","clock","snowflake","pumpkin","tree","sparkle","gift"],Ia=.95,z4=200,N4=["frame","text","accent","background"],L4=/[\t\n\v\f\r\u0085\u2028\u2029]/g,T4=/[\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 Ko(e,t=An){let r=e.slice(0,1e3).normalize("NFC").replace(L4," ").replace(T4,"").replace(/\s+/g," ").trim();return Array.from(r).slice(0,Math.max(0,t)).join("").trim()}var ld=e=>Math.abs(e*1e3-Math.round(e*1e3))<1e-6,de=k.number().min(-4e3).max(Se.maxCoordinate).refine(ld,{message:`Numbers may have at most ${Se.maxDecimals} decimals`}),Re=de.refine(e=>e>0,{message:"Must be greater than 0"}),Ma=de.refine(e=>e>=0,{message:"Must not be negative"}),Ho=k.string().regex(/^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/,"Use a #rgb or #rrggbb color"),Lg=k.union([k.enum(N4),Ho]),Fg=e=>k.object({mix:k.tuple([e,e]),amount:k.number().min(0).max(1).refine(ld)}).strict(),In=k.union([Lg,Fg(Lg)]),O4=k.union([Ho,Fg(k.union([k.enum(["frame","accent","background"]),Ho]))]),yr=k.union([In,k.object({gradient:k.object({from:In,to:In,direction:k.enum(["horizontal","vertical"]).optional(),steps:k.int().min(2).max(Se.maxGradientSteps).optional()}).strict()}).strict()]),ad={x:de,y:de,width:Re,height:Re},Jo=k.object({color:In,width:Re}).strict(),F4=k.object({type:k.literal("rect"),...ad,radius:Ma.optional(),fill:yr,hole:k.object({...ad,radius:Ma.optional()}).strict().optional(),stroke:Jo.optional()}).strict(),D4=k.object({type:k.literal("circle"),cx:de,cy:de,r:Re,hole:Re.optional(),fill:yr,stroke:Jo.optional()}).strict(),Z4=k.object({type:k.literal("ellipse"),cx:de,cy:de,rx:Re,ry:Re,fill:yr,stroke:Jo.optional()}).strict(),B4=k.object({type:k.literal("polygon"),points:k.array(k.tuple([de,de])).min(3).max(Se.maxPolygonPoints),fill:yr,stroke:Jo.optional()}).strict(),U4=k.object({type:k.literal("path"),d:k.string().min(2).max(Se.maxPathLength),fill:yr,fillRule:k.enum(["nonzero","evenodd"]).optional(),stroke:Jo.optional()}).strict(),G4=k.object({type:k.literal("line"),x1:de,y1:de,x2:de,y2:de,width:Re,cap:k.enum(["butt","round"]).optional(),dash:k.tuple([Re,Re]).optional(),fill:yr}).strict(),Q4=k.object({type:k.literal("icon"),icon:k.enum(I4),x:de,y:de,size:Re,fill:yr}).strict(),V4=k.discriminatedUnion("type",[F4,D4,Z4,B4,U4,G4,Q4]),Dg={id:k.string().regex(/^[a-z][a-z0-9-]{0,31}$/),slot:k.enum(["primary","secondary","fixed"]),text:k.string().max(200),maxLength:k.int().min(1).max(An).optional(),color:In,weight:k.enum(["bold","regular"]).optional(),collapse:k.object({y:de,height:Re}).strict().optional()},j4=k.object({type:k.literal("text"),...Dg,box:k.object(ad).strict(),align:k.enum(["start","middle","end"]).optional(),fontSize:Re.optional()}).strict(),q4=k.object({type:k.literal("curved"),...Dg,curve:k.object({cx:de,cy:de,radius:Re,side:k.enum(["top","bottom"]),spread:k.number().min(20).max(300).refine(ld).optional()}).strict(),fontSize:Re}).strict(),W4=k.discriminatedUnion("type",[j4,q4]),Tg=de.refine(e=>e>=Se.minArtboard&&e<=Se.maxArtboard,{message:`Artboard sides must be ${Se.minArtboard} to ${Se.maxArtboard} units`}),H4=k.object({kind:k.literal(R4),version:k.literal(M4),artboard:k.object({width:Tg,height:Tg}).strict(),qr:k.object({x:de,y:de,size:Re,padding:Ma.optional(),radius:Ma.optional(),plate:k.enum(["opaque","background","none"]).optional()}).strict(),colors:k.object({frame:Ho,text:O4.optional(),accent:Ho.optional()}).strict(),shapes:k.array(V4).max(Se.maxShapes),labels:k.array(W4).max(Se.maxLabels),bleed:k.union([k.literal("none"),In]).optional()}).strict();function fd(e){let t=za(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 K4(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 za(e){return e.qr.padding??e.qr.size*Se.defaultPadding}var pd=.52,J4=.35;function X4(e){let t=e.fontSize??e.box.height*pd;return Math.min(t*En,e.box.height*Ia)}var cd=(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 Og(e){let t=fd(e),r=Math.min(e.qr.radius??0,(t.x1-t.x0)/2,(t.y1-t.y0)/2),n=[[t.x0+r,t.y0+r,Math.PI],[t.x1-r,t.y0+r,-Math.PI/2],[t.x1-r,t.y1-r,0],[t.x0+r,t.y1-r,Math.PI/2]],o=[];for(let[i,s,a]of n)for(let c=0;c<=8;c++){let u=a+Math.PI/2*(c/8);o.push([i+r*Math.cos(u),s+r*Math.sin(u)]);}return o}function Y4([e,t],r,n){if(e<r.x-.01||t<r.y-.01||e>r.x+r.width+.01||t>r.y+r.height+.01)return false;let i=Math.min(n,r.width/2,r.height/2),s=Math.min(Math.max(e,r.x+i),r.x+r.width-i),a=Math.min(Math.max(t,r.y+i),r.y+r.height-i);return Math.hypot(e-s,t-a)<=i+.01}function e3(e){let t=0;return e.forEach(([r,n],o)=>{let[i,s]=e[(o+1)%e.length];t+=r*s-i*n;}),Math.abs(t)/2}function t3(e,t,r){let n=fd(t);if(!cd(r,n))return false;if("stroke"in e&&e.stroke)return true;if(e.fill==="background")return false;if(e.type==="rect"&&e.hole){let{hole:o}=e;return !Og(t).every(i=>Y4(i,o,o.radius??0))}if(e.type==="circle"&&e.hole){let o=e.hole;return !Og(t).every(([i,s])=>Math.hypot(i-e.cx,s-e.cy)<=o+.01)}if(e.type==="polygon"){let o=Pa(e.points,n);return o.length>2&&e3(o)>1e-6}return true}function md(e){let t=r3(e),r="stroke"in e?e.stroke:void 0;if(!(r&&t.bounds))return t;let n=e.type==="circle"||e.type==="ellipse"?r.width/2:e.type==="rect"?r.width*Math.SQRT2/2:r.width*2,{x0:o,y0:i,x1:s,y1:a}=t.bounds;return {bounds:{x0:o-n,y0:i-n,x1:s+n,y1:a+n},segments:t.segments*2}}function r3(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(([n])=>n),r=e.points.map(([,n])=>n);return {bounds:{x0:Math.min(...t),y0:Math.min(...r),x1:Math.max(...t),y1:Math.max(...r)},segments:e.points.length}}case "path":{let t=qo(e.d,Se.maxDecimals);return t?{bounds:Mg(_r(e.d)),segments:kg(t)}:{bounds:null,segments:0}}case "line":{let t=e.width/2,r=Math.hypot(e.x2-e.x1,e.y2-e.y1),n=e.dash?Math.ceil(r/(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:n*(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:z4}}}function n3(e,t){let r=(_,b=[])=>t.addIssue({code:"custom",message:_,path:b}),n=Se,o=new TextEncoder().encode(JSON.stringify(e)).length;if(o>n.maxBytes){r(`The spec is ${o} bytes; the limit is ${n.maxBytes}`);return}let{width:i,height:s}=e.artboard,a=Math.max(i,s)*.005,c={x0:-a,y0:-a,x1:i+a,y1:s+a},u=_=>_.x0>=c.x0&&_.y0>=c.y0&&_.x1<=c.x1&&_.y1<=c.y1,{qr:l}=e,f=za(e);l.plate!=="none"&&f<l.size*n.minPadding-1e-9&&r(`qr.padding must be at least ${n.minPadding*100}% of qr.size`,["qr","padding"]),l.size<Math.min(i,s)*n.minQrShare-1e-9&&r(`qr.size must be at least ${n.minQrShare*100}% of the artboard's shorter side`,["qr","size"]);let p=fd(e);(p.x0<-1e-9||p.y0<-1e-9||p.x1>i+1e-9||p.y1>s+1e-9)&&r("The code and its padding must sit inside the artboard",["qr"]),(l.radius??0)>(l.size+2*f)/2&&r("qr.radius is larger than half the plate",["qr","radius"]);let m=0,h=0;e.shapes.forEach((_,b)=>{let S=["shapes",b],{bounds:C,segments:w}=md(_);if(!C){r("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",[...S,"d"]);return}if(u(C)||r("The shape extends outside the artboard",S),_.type==="rect"&&_.hole){let{hole:x}=_;(x.x<_.x||x.y<_.y||x.x+x.width>_.x+_.width+1e-9||x.y+x.height>_.y+_.height+1e-9)&&r("The hole must sit inside its rect",[...S,"hole"]);}_.type==="circle"&&_.hole&&_.hole>=_.r&&r("The hole must be smaller than the circle",[...S,"hole"]),"stroke"in _&&_.stroke&&_.stroke.width>Math.min(i,s)*.1+1e-9&&r("A stroke may be at most 10% of the artboard's shorter side",[...S,"stroke","width"]),l.plate==="background"&&t3(_,e,C)&&r('With qr.plate "background", only background fills (or a ring whose hole holds the plate) may lie under the plate',S),m+=w,typeof _.fill=="object"&&"gradient"in _.fill&&(h+=(_.fill.gradient.steps??32)*w);}),m>n.maxSegments&&r(`The shapes have ${m} segments; the limit is ${n.maxSegments}`,["shapes"]),h>n.maxGradientWork&&r("Gradient fills are too detailed (fewer steps or simpler shapes)",["shapes"]);let d=[],g=new Set,y=new Set;e.labels.forEach((_,b)=>{let S=["labels",b];g.has(_.id)&&r(`Label id "${_.id}" is used twice`,[...S,"id"]),g.add(_.id),_.slot!=="fixed"&&(y.has(_.slot)&&r(`Only one label may use the ${_.slot} slot`,[...S,"slot"]),y.add(_.slot));let C=_.maxLength??n.maxTextLength;_.text!==Ko(_.text,C)&&r(`Label text must be at most ${C} characters, trimmed, with no control or invisible characters (see sanitizeFrameText)`,[...S,"text"]);let w;if(_.type==="text"){w={x0:_.box.x,y0:_.box.y,x1:_.box.x+_.box.width,y1:_.box.y+_.box.height},_.fontSize!==void 0&&_.fontSize>_.box.height*Ia+1e-9&&r("fontSize may be at most 95% of the label's row height",[...S,"fontSize"]);let x=_.box.y+_.box.height/2,A=X4(_)*J4,P={x0:w.x0,x1:w.x1,y0:x-A,y1:x+A};(cd(w,K4(e))||cd(P,p))&&r("The label overlaps the code or its padding",[...S,"box"]);}else {let{cx:x,cy:A,radius:P}=_.curve,E=_.fontSize*En*.6;w={x0:x-P-E,y0:A-P-E,x1:x+P+E,y1:A+P+E};let I=Math.hypot(Math.max(p.x0-x,0,x-p.x1),Math.max(p.y0-A,0,A-p.y1));Math.hypot(Math.max(Math.abs(p.x0-x),Math.abs(p.x1-x)),Math.max(Math.abs(p.y0-A),Math.abs(p.y1-A)))<=P-E||I>=P+E||r("The curved label crosses the code or its padding",[...S,"curve"]);}if(u(w)||r("The label extends outside the artboard",S),_.collapse){let x=_.collapse,A=x.y+x.height;(x.y<-1e-9||A>s+1e-9)&&r("The collapse band must sit inside the artboard",[...S,"collapse"]),A>p.y0+1e-6&&x.y<p.y1-1e-6&&r("The collapse band crosses the code or its padding",[...S,"collapse"]);for(let P of d)A>P.y+1e-6&&x.y<P.y+P.height-1e-6&&r("Collapse bands may not overlap",[...S,"collapse"]);d.push(x);}});}var dd=H4.superRefine(n3);var o3=Ym.extend({style:k.literal(ud),spec:dd}),Zg=k.discriminatedUnion("style",[Ym,o3]);var i3=["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"],Bg=k.enum(i3);var s3=["square","rounded","circle"],Ug=k.enum(s3),a3=k.object({src:k.string(),height:k.number(),width:k.number(),excavate:k.boolean(),x:k.number().optional(),y:k.number().optional(),padding:k.number().min(0).optional(),shape:Ug.optional(),plate:k.string().optional()}),c3=.1,u3=.3;var l3=2;k.object({size:k.number().min(c3).max(u3).optional(),padding:k.number().min(0).max(l3).optional(),x:k.number().min(0).max(1).optional(),y:k.number().min(0).max(1).optional(),shape:Ug.optional(),plate:k.string().optional()});var f3=k.enum(["L","M","Q","H"]),Na=.5,gd=1,Gg=.07,p3=["square","circle","heart"],m3=k.enum(p3),Qg=3,br=64,Xo=8,Vg=.42,d3=k.object({type:k.literal("silhouette"),width:k.number().int().min(Xo).max(br),height:k.number().int().min(Xo).max(br),cells:k.string().max(br*br).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"}),h3=k.union([m3,d3]);var hd=k.object({outer:dr.optional(),inner:dr.optional()}),g3=k.object({topLeft:hd.optional(),topRight:hd.optional(),bottomLeft:hd.optional()});k.object({value:k.string(),size:k.number().optional(),level:f3.optional(),bgColor:dr.optional(),fgColor:dr.optional(),eyeColor:dr.optional(),dotColor:dr.optional(),bodyPattern:Bg.optional(),cornerEyePattern:Pg.optional(),cornerEyeDotPattern:vg.optional(),margin:k.number().optional(),imageSettings:a3.optional(),isOGContext:k.boolean().optional(),templateId:k.string().optional(),customProps:k.record(k.string(),k.any()).optional(),frame:Zg.optional(),art:xg.optional(),eyeColors:g3.optional(),moduleScale:k.number().min(Na).max(gd).optional(),autoLevel:k.boolean().optional(),shape:h3.optional()});var Be=e=>e/255,Yo=(e,t)=>(e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]-t[2])**2,se=e=>.2126*e[0]+.7152*e[1]+.0722*e[2];function _3(e){let{width:t,height:r,data:n}=e,o=[0,t-1,(r-1)*t,r*t-1].map(s=>{let a=s*4;return {color:[Be(n[a]),Be(n[a+1]),Be(n[a+2])],alpha:n[a+3]/255}});if(o.some(s=>s.alpha<.9))return null;let i=o[0].color;return o.every(({color:s})=>Yo(s,i)<.006)?i:null}function y3(e){let{width:t,height:r,data:n}=e,o=_3(e),i=new Float32Array(t*r);for(let s=0;s<i.length;s++){let a=s*4,c=n[a+3]/255;if(o&&c>0){let u=Math.sqrt(Yo([Be(n[a]),Be(n[a+1]),Be(n[a+2])],o));c*=Math.min(1,Math.max(0,(u-.06)/.1));}i[s]=c;}return i}var b3=8,$3=.14,jg=.006;function x3(e,t){let{width:r,height:n,data:o}=e,i=new Float64Array(4096),s=new Float64Array(4096*3),a=0;for(let m=0;m<t.length;m++){if(t[m]<.9)continue;let h=m*4,d=Math.floor(o[h]/16)*256+Math.floor(o[h+1]/16)*16+Math.floor(o[h+2]/16);i[d]+=1,s[d*3]+=Be(o[h]),s[d*3+1]+=Be(o[h+1]),s[d*3+2]+=Be(o[h+2]),a++;}if(a===0)return {palette:[],error:0};let c=[...i.keys()].filter(m=>i[m]>0).sort((m,h)=>i[h]-i[m]),u=[];for(let m of c){if(i[m]/a<jg/2||u.length>=b3)break;let h=[s[m*3]/i[m],s[m*3+1]/i[m],s[m*3+2]/i[m]];u.every(d=>Yo(d,h)>=$3**2)&&u.push(h);}let l=[],f=0;for(let m=0;m<3;m++){l=u.map(()=>({n:0,r:0,g:0,b:0,x:0,y:0})),f=0;for(let h=0;h<t.length;h++){if(t[h]<.9)continue;let d=h*4,g=[Be(o[d]),Be(o[d+1]),Be(o[d+2])],y=0,_=Number.POSITIVE_INFINITY;for(let[S,C]of u.entries()){let w=Yo(g,C);w<_&&(_=w,y=S);}let b=l[y];b.n++,b.r+=g[0],b.g+=g[1],b.b+=g[2],b.x+=h%r,b.y+=Math.floor(h/r),f+=Math.sqrt(_);}for(let[h,d]of l.entries())d.n>0&&(u[h]=[d.r/d.n,d.g/d.n,d.b/d.n]);}return {palette:u.map((m,h)=>({color:m,area:l[h].n/a,cx:l[h].n?l[h].x/l[h].n+.5:r/2,cy:l[h].n?l[h].y/l[h].n+.5:n/2})).filter(m=>m.area>=jg).sort((m,h)=>h.area-m.area),error:f/a}}function w3(e,t,r){let n=t+2,o=r+2,i=(f,p)=>f<=0||p<=0||f>t||p>r?0:e[(p-1)*t+(f-1)],s=new Map,a=new Map,c=f=>{let p=a.get(f);if(p)return p;let m=Math.floor(f/2),h=m%n,d=Math.floor(m/n),g=i(h,d),y=f%2===1,_=y?i(h,d+1):i(h+1,d),b=g===_?.5:Math.min(1,Math.max(0,(.5-g)/(_-g))),S=y?[h-.5,d-.5+b]:[h-.5+b,d-.5];return a.set(f,S),S},u=(f,p)=>{s.set(f,p);};for(let f=0;f<o-1;f++)for(let p=0;p<n-1;p++){let m=i(p,f)>=.5,h=i(p+1,f)>=.5,d=i(p+1,f+1)>=.5,g=i(p,f+1)>=.5,y=2*(f*n+p),_=2*((f+1)*n+p),b=2*(f*n+p)+1,S=2*(f*n+p+1)+1;switch((m?8:0)+(h?4:0)+(d?2:0)+(g?1:0)){case 1:u(_,b);break;case 2:u(S,_);break;case 3:u(S,b);break;case 4:u(y,S);break;case 5:{(i(p,f)+i(p+1,f)+i(p+1,f+1)+i(p,f+1))/4>=.5?(u(y,b),u(_,S)):(u(y,S),u(_,b));break}case 6:u(y,_);break;case 7:u(y,b);break;case 8:u(b,y);break;case 9:u(_,y);break;case 10:{(i(p,f)+i(p+1,f)+i(p+1,f+1)+i(p,f+1))/4>=.5?(u(b,_),u(S,y)):(u(b,y),u(S,_));break}case 11:u(S,y);break;case 12:u(b,S);break;case 13:u(_,S);break;case 14:u(b,_);break;}}let l=[];for(let f of s.keys()){if(!s.has(f))continue;let p=[],m=f;for(;m!==void 0&&s.has(m);){p.push(c(m));let h=s.get(m);s.delete(m),m=h;}p.length>=3&&l.push(p);}return l}function S3(e){let t=0;for(let r=0;r<e.length;r++){let n=e[r],o=e[(r+1)%e.length];t+=n[0]*o[1]-o[0]*n[1];}return t/2}function qg(e,t){if(e.length<=2)return e;let r=new Uint8Array(e.length);r[0]=1,r[e.length-1]=1;let n=[[0,e.length-1]];for(;n.length>0;){let[o,i]=n.pop(),s=e[o],a=e[i],c=a[0]-s[0],u=a[1]-s[1],l=Math.hypot(c,u)||1,f=-1,p=t;for(let m=o+1;m<i;m++){let h=e[m],d=Math.abs(u*(h[0]-s[0])-c*(h[1]-s[1]))/l;d>p&&(p=d,f=m);}f>=0&&(r[f]=1,n.push([o,f],[f,i]));}return e.filter((o,i)=>r[i]===1)}function v3(e,t){let r=0,n=-1;for(let[s,a]of e.entries()){let c=(a[0]-e[0][0])**2+(a[1]-e[0][1])**2;c>n&&(n=c,r=s);}let o=qg(e.slice(0,r+1),t),i=qg([...e.slice(r),e[0]],t);return [...o.slice(0,-1),...i.slice(0,-1)]}var Ut=e=>re(e,2);function C3(e,t){let r=e.length,n=(i,s)=>{let a=Math.hypot(s[0]-i[0],s[1]-i[1])||1,c=Math.min(.5,t/a);return [i[0]+(s[0]-i[0])*c,i[1]+(s[1]-i[1])*c]},o="";for(let i=0;i<r;i++){let s=e[i],a=n(s,e[(i-1+r)%r]),c=n(s,e[(i+1)%r]);o+=i===0?`M${Ut(a[0])} ${Ut(a[1])}`:`L${Ut(a[0])} ${Ut(a[1])}`,o+=`Q${Ut(s[0])} ${Ut(s[1])} ${Ut(c[0])} ${Ut(c[1])}`;}return `${o}Z`}function P3(e,t,r){let n="";for(let o of w3(e,t,r)){if(Math.abs(S3(o))<.8)continue;let i=v3(o,.18);i.length>=3&&(n+=C3(i,.9));}return n}var k3=.075;function Wg(e){let{width:t,height:r,data:n}=e,o=y3(e),i=0;for(let d of o)i+=d;let{palette:s,error:a}=x3(e,o),c={width:t,height:r,palette:s,alpha:o,coverage:i/(t*r)};if(s.length===0||a>k3)return {...c,layers:[],photographic:s.length>0};let u=s.length,l=Array.from({length:u},()=>new Float32Array(t*r)),f=s.map(d=>d.color);for(let d=0;d<o.length;d++){let g=o[d];if(g<=0)continue;let y=d*4,_=[Be(n[y]),Be(n[y+1]),Be(n[y+2])],b=0,S=-1,C=Number.POSITIVE_INFINITY,w=Number.POSITIVE_INFINITY;for(let I=0;I<u;I++){let N=Yo(_,f[I]);N<C?(S=b,w=C,b=I,C=N):N<w&&(S=I,w=N);}if(S<0||C<1e-6){l[b][d]=g;continue}let x=f[b],A=f[S],P=[A[0]-x[0],A[1]-x[1],A[2]-x[2]],E=Math.min(1,Math.max(0,((_[0]-x[0])*P[0]+(_[1]-x[1])*P[1]+(_[2]-x[2])*P[2])/(P[0]**2+P[1]**2+P[2]**2)));l[b][d]=g*(1-E),l[S][d]=g*E;}let p=[],m=new Float32Array(t*r),h=new Array(u);for(let d=u-1;d>=0;d--){let g=l[d];for(let y=0;y<m.length;y++)m[y]+=g[y];h[d]=m.slice();}for(let d=0;d<u;d++){let g=P3(h[d],t,r);g&&p.push({color:f[d],d:g});}return {...c,layers:p,photographic:false}}var{QrCode:_d}=Ve,A3={"1L":3,"1M":2,"1Q":1,"1H":1,"2L":2,"3L":1};function E3(e){let t=e*4+17,r=new Uint8Array(t*t),n=(s,a)=>{s>=0&&a>=0&&s<t&&a<t&&(r[a*t+s]=1);};for(let s=0;s<t;s++)n(6,s),n(s,6);for(let[s,a]of [[3,3],[t-4,3],[3,t-4]])for(let c=-4;c<=4;c++)for(let u=-4;u<=4;u++)n(s+u,a+c);let o=[];if(e>1){let s=Math.floor(e/7)+2,a=e===32?26:Math.ceil((e*4+4)/(s*2-2))*2;o.push(6);for(let c=t-7;o.length<s;c-=a)o.splice(1,0,c);}let i=o.length-1;for(let[s,a]of o.entries())for(let[c,u]of o.entries())if(!(s===0&&c===0||s===0&&c===i||s===i&&c===0))for(let l=-2;l<=2;l++)for(let f=-2;f<=2;f++)n(a+f,u+l);for(let s=0;s<=8;s++)n(8,s),n(s,8);for(let s=0;s<8;s++)n(t-1-s,8),n(8,t-1-s);if(e>=7)for(let s=0;s<18;s++){let a=t-11+s%3,c=Math.floor(s/3);n(a,c),n(c,a);}return r}function R3(e,t){let r=e*4+17,n=gt[t].ordinal,o=_d.NUM_ERROR_CORRECTION_BLOCKS[n]?.[e]??0,i=_d.ECC_CODEWORDS_PER_BLOCK[n]?.[e]??0,s=Math.floor(_d.getNumRawDataModules(e)/8),a=o-s%o,c=Math.floor(s/o),u=Array.from({length:o},(S,C)=>c+(C<a?0:1)),l=[],f=[],p=c-i;for(let S=0;S<=c;S++)for(let C=0;C<o;C++)if(C<a){if(S===p)continue;l.push(C),f.push(S<p?S:S-1);}else l.push(C),f.push(S);if(l.length!==s)throw new Error(`Codeword map: interleave mismatch at version ${e}`);let m=E3(e),h=new Int16Array(r*r).fill(-1),d=new Int16Array(r*r).fill(-1),g=new Int8Array(r*r).fill(-1),y=s*8,_=0;for(let S=r-1;S>=1;S-=2){S===6&&(S=5);let C=(S+1&2)===0;for(let w=0;w<r;w++)for(let x=0;x<2;x++){let A=S-x,E=(C?r-1-w:w)*r+A;if(!m[E]&&_<y){let I=_>>>3;h[E]=l[I],d[E]=f[I],g[E]=7-(_&7),_++;}}}if(_!==y)throw new Error(`Codeword map: placement mismatch at version ${e}`);let b=A3[`${e}${t}`]??0;return {version:e,level:t,size:r,blocks:o,eccPerBlock:i,blockLengths:u,correctable:Math.floor((i-b)/2),block:h,codeword:d,bit:g}}var M3=8,$r=new Map;function La(e,t){if(!(Number.isInteger(e)&&e>=1&&e<=40))throw new RangeError(`QR version must be 1\u201340, got ${e}`);let r=`${e}${t}`,n=$r.get(r);if(n)return $r.delete(r),$r.set(r,n),n;let o=R3(e,t);if($r.size>=M3){let i=$r.keys().next().value;i!==void 0&&$r.delete(i);}return $r.set(r,o),o}function Ta(e,t){let r=new Array(e.blocks).fill(0),n=new Set;for(let o of t){let i=e.block[o]??-1;if(i<0)continue;let s=i*4096+e.codeword[o];n.has(s)||(n.add(s),r[i]=r[i]+1);}return r}var I3={black:[0,0,0],white:[255,255,255],red:[255,0,0],green:[0,128,0],lime:[0,255,0],blue:[0,0,255],navy:[0,0,128],yellow:[255,255,0],orange:[255,165,0],purple:[128,0,128],pink:[255,192,203],gray:[128,128,128],grey:[128,128,128],silver:[192,192,192],maroon:[128,0,0],olive:[128,128,0],teal:[0,128,128],aqua:[0,255,255],cyan:[0,255,255],fuchsia:[255,0,255],magenta:[255,0,255]};function Hg(e,t){let r=e.trim(),n=Number.parseFloat(r);return Number.isNaN(n)?Number.NaN:r.endsWith("%")?n/100*t:n}function Me(e){if(!e)return null;let t=e.trim().toLowerCase();if(t==="transparent")return {r:0,g:0,b:0,a:0};let r=I3[t];if(r)return {r:r[0],g:r[1],b:r[2],a:1};if(t.startsWith("#")){let o=t.slice(1);return (o.length===3||o.length===4)&&(o=o.split("").map(i=>i+i).join("")),/^[0-9a-f]{6}([0-9a-f]{2})?$/.test(o)?{r:Number.parseInt(o.slice(0,2),16),g:Number.parseInt(o.slice(2,4),16),b:Number.parseInt(o.slice(4,6),16),a:o.length===8?Number.parseInt(o.slice(6,8),16)/255:1}:null}let n=/^rgba?\(([^)]*)\)$/.exec(t);if(n){let[o,i]=n[1].split("/"),s=o.split(/[\s,]+/).filter(Boolean);if(s.length!==(i===void 0&&s.length===4?4:3))return null;let a=i??s[3],[c,u,l]=s.slice(0,3).map(m=>Hg(m,255)),f=a===void 0?1:Hg(a,1);if([c,u,l,f].some(m=>Number.isNaN(m)))return null;let p=(m,h)=>Math.min(Math.max(m,0),h);return {r:p(c,255),g:p(u,255),b:p(l,255),a:p(f,1)}}return null}function ei(e,t,r){let n=e/255,o=t/255,i=r/255,s=1-Math.max(n,o,i);return s>=1?[0,0,0,1]:[re((1-n-s)/(1-s)),re((1-o-s)/(1-s)),re((1-i-s)/(1-s)),re(s)]}function xr(e){return e.children}var z3=e=>e==null?null:`${e}`;function yd(e,t,r){let n=t??{},o=r;if("key"in n){let{key:i,...s}=n;i!==void 0&&(o=i),n=s;}return {type:e,props:n,key:z3(o)}}function N3(e,t){let r=e;return {type:r.type,props:{...r.props,...t},key:r.key??null}}function L3(e,t,...r){let n={...t};return r.length>0&&(n.children=r.length===1?r[0]:r),yd(e,n)}var T3={jsx:yd,jsxs:yd,createElement:L3,cloneElement:N3,Fragment:xr},ti=T3;var bd=e=>e===xr?ti.Fragment:e;function M(e,t,r){return ti.jsx(bd(e),t,r)}function Ie(e,t,r){return ti.jsxs(bd(e),t,r)}function $d(e,t,...r){return ti.createElement(bd(e),t??null,...r)}function zn(e,t){return ti.cloneElement(e,t)}var O3=new Set([Symbol.for("react.element"),Symbol.for("react.transitional.element")]),Kg=Symbol.for("react.fragment");function Oa(e){if(typeof e!="object"||e===null||Array.isArray(e))return false;let t=e;return t.$$typeof!==void 0&&!O3.has(t.$$typeof)?false:(typeof t.type=="string"||typeof t.type=="function"||t.type===Kg)&&typeof t.props=="object"&&t.props!==null}var Fa=e=>e===xr||e===Kg;var F3=.6;var Nn=class{entries=new Map;limit;constructor(t){this.limit=t;}get(t,r){let n=this.entries.get(t);if(n!==void 0)return this.entries.delete(t),this.entries.set(t,n),n;let o=r();if(this.entries.size>=this.limit){let i=this.entries.keys().next().value;i!==void 0&&this.entries.delete(i);}return this.entries.set(t,o),o}},D3=new Nn(8);function Z3(e){return D3.get(e,()=>{let t=atob(e),r=new Uint8Array(t.length);for(let n=0;n<t.length;n++)r[n]=t.charCodeAt(n);return r})}function Sd(e){let{width:t,height:r,data:n}=e;if(!(Number.isInteger(t)&&Number.isInteger(r))||t<1||r<1||t>mr||r>mr||typeof n!="string")return null;try{let o=Z3(n);return o.length===t*r*4?{width:t,height:r,data:o}:null}catch{return null}}function r_(e){return !!(e&&Ca.includes(e.mode)&&e.image&&Sd(e.image))}function vd(e){let t=va[e.mode];return e.variant&&t.includes(e.variant)?e.variant:t[0]}function B3(e,t){if(e===1)return [];let r=Math.floor(e/7)+2,n=e===32?26:Math.ceil((e*4+4)/(r*2-2))*2,o=[6];for(let i=t-7;o.length<r;i-=n)o.splice(1,0,i);return o}function ri(e,t){let r=B3(e,t),n=r.length-1,o=[];for(let[i,s]of r.entries())for(let[a,c]of r.entries())i===0&&a===0||i===0&&a===n||i===n&&a===0||o.push([s,c]);return o}var nt=1,at=2,Gt=3,Jg=4,Xg=new Map;function U3(e){let t=Xg.get(e);if(t)return t;let r=e*4+17,n=new Uint8Array(r*r),o=(i,s,a,c,u)=>{for(let l=Math.max(0,s);l<Math.min(r,s+c);l++)for(let f=Math.max(0,i);f<Math.min(r,i+a);f++)n[l*r+f]=u;};o(6,0,1,r,Jg),o(0,6,r,1,Jg),o(0,8,9,1,Gt),o(8,0,1,9,Gt),o(r-8,8,8,1,Gt),o(8,r-8,1,8,Gt),e>=7&&(o(r-11,0,3,6,Gt),o(0,r-11,6,3,Gt));for(let[i,s]of ri(e,r))o(i-2,s-2,5,5,at);return o(0,0,8,8,nt),o(r-8,0,8,8,nt),o(0,r-8,8,8,nt),Xg.set(e,n),n}function G3(e){let t=e[8],r=t?.[0]?1:0,n=t?.[1]?1:0,o=(1-r)*2+n;return ["M","L","H","Q"][o]??"M"}function Za(e,t){let r=Me(e);return !r||r.a===0?t:[r.r/255,r.g/255,r.b/255]}var Sr=(e,t,r)=>[e[0]+(t[0]-e[0])*r,e[1]+(t[1]-e[1])*r,e[2]+(t[2]-e[2])*r];function Qt(e,t,r,n){let o=se(e);if(n?o<=r:o>=r)return e;let i=se(t);return Math.abs(o-i)<1e-6?t:Sr(e,t,Math.min(1,Math.max(0,(o-r)/(o-i))))}var n_=e=>Math.max(...e)-Math.min(...e),Q3=(e,t)=>(e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]-t[2])**2,xd=e=>e.toString(16).padStart(2,"0");function Ue(e,t=1){let r=n=>Math.min(255,Math.round(Math.round(Math.min(Math.max(n,0),1)*255)/t)*t);return `#${xd(r(e[0]))}${xd(r(e[1]))}${xd(r(e[2]))}`}function V3(e){let t=e<0?-1:1,r=Math.abs(e),n=1/(1+.3275911*r),o=1-((((1.061405429*n-1.453152027)*n+1.421413741)*n-.284496736)*n+.254829592)*n*Math.exp(-r*r);return t*o}var Cd=.3,Yg=e=>1-Math.exp(-((e/2)**2)/(2*Cd**2)),j3=e=>V3(e/(2*Cd*Math.SQRT2))**2,q3=(e,t,r)=>{let n=Math.min(1,Math.max(0,(r-e)/(t-e)));return n*n*(3-2*n)};function Pd(e,t,r,n){let o=n==="cover"?Math.max(r/e,r/t):Math.min(r/e,r/t);return {scale:o,offsetX:(r-e*o)/2,offsetY:(r-t*o)/2}}function o_(e,t){let{width:r,height:n,data:o}=e,i=new Float32Array(r*n*3),s=t??new Float32Array(r*n);for(let a=0;a<r*n;a++)i[a*3]=o[a*4]/255,i[a*3+1]=o[a*4+1]/255,i[a*3+2]=o[a*4+2]/255,t||(s[a]=o[a*4+3]/255);return {width:r,height:n,rgb:i,alpha:s}}function W3(e){let t=o_(e),{rgb:r,alpha:n}=t,o=new Float64Array(256),i=0;for(let f=0;f<n.length;f++){if(n[f]<.5)continue;let p=se([r[f*3],r[f*3+1],r[f*3+2]]);o[Math.min(255,Math.floor(p*256))]+=1,i++;}let s=f=>{let p=0;for(let m=0;m<256;m++)if(p+=o[m],p>=f*i)return m/255;return 1},a=i?s(.01):0,c=i?s(.99):1;c-a<.15&&(a=0,c=1);let u=Math.min(1.6,1/(c-a)),l=(a+c)/2;for(let f=0;f<n.length;f++){let p=[r[f*3],r[f*3+1],r[f*3+2]],m=se(p),h=.5+(m-l)*u;for(let d=0;d<3;d++)r[f*3+d]=Math.min(1,Math.max(0,h+(p[d]-m)*1.12));}return t}function i_(e,t,r,n,o=1){let{width:i,height:s,rgb:a,alpha:c}=e,u=Math.min(Math.max(t-.5,0),i-1),l=Math.min(Math.max(r-.5,0),s-1),f=Math.floor(u),p=Math.floor(l),m=Math.min(f+1,i-1),h=Math.min(p+1,s-1),d=u-f,g=l-p,y=0,_=0,b=0,S=0,C=(x,A,P)=>{let E=A*i+x,I=c[E]*P;y+=a[E*3]*I,_+=a[E*3+1]*I,b+=a[E*3+2]*I,S+=I;};if(C(f,p,(1-d)*(1-g)),C(m,p,d*(1-g)),C(f,h,(1-d)*g),C(m,h,d*g),S<=0)return n;let w=S*o;return [n[0]+(y/S-n[0])*w,n[1]+(_/S-n[1])*w,n[2]+(b/S-n[2])*w]}var H3=new Nn(4),K3=new Nn(6),J3=new Nn(6);function kd(e,t){return K3.get(e.image.data,()=>Wg(t))}function s_(e,t,r){return J3.get(e.image.data,()=>o_(t,r.alpha))}var be=e=>re(e,2),a_=e=>re(e,4),vr=class{groups=new Map;add(t,r){let n=this.groups.get(t);n?n.push(r):this.groups.set(t,[r]);}cellRun(t,r,n,o){this.add(t,`M${r} ${n}h${o}.04v1.04h-${o}.04z`);}circle(t,r,n,o){this.add(t,X3(r,n,o));}toElements(t){return [...this.groups].map(([r,n],o)=>M("path",{d:n.join(""),fill:r},`${t}-${o}`))}};function X3(e,t,r){let n=be(r*2),o=be(r);return `M${be(e-r)} ${be(t)}a${o} ${o} 0 1 0 ${n} 0a${o} ${o} 0 1 0 ${-n} 0z`}function wr(e,t,r,n,o){let i=Math.min(o,r/2,n/2);if(i<=0)return `M${be(e)} ${be(t)}h${be(r)}v${be(n)}h${be(-r)}z`;let s=be(i);return `M${be(e+i)} ${be(t)}h${be(r-2*i)}a${s} ${s} 0 0 1 ${s} ${s}v${be(n-2*i)}a${s} ${s} 0 0 1 ${-s} ${s}h${be(-(r-2*i))}a${s} ${s} 0 0 1 ${-s} ${-s}v${be(-(n-2*i))}a${s} ${s} 0 0 1 ${s} ${-s}z`}function c_(e,t,r){let n="";for(let[o,i]of e){let s=(o-2+t)*r,a=(i-2+t)*r;n+=wr(s,a,5*r,5*r,r*.35),n+=wr(s+r,a+r,3*r,3*r,r*.15),n+=wr(s+2*r,a+2*r,r,r,r*.12);}return n}var Y3={blend:1,badge:1,color:.9,mono:.7},e6=.35;function u_(e,t,r){let n=Math.min(Math.max(e.intensity??F3,0),Y3[vd(e)]);return se(r)-se(t)>=e6?n:0}function t6(e){let{art:t,modules:r,version:n}=e,o=t.image&&Sd(t.image);if(!(o&&Ca.includes(t.mode)))return null;let i=r.length;if(i!==n*4+17)return null;let s=Za(e.fgColor,[0,0,0]),a=Za(e.bgColor,[1,1,1]),c=u_(t,s,a);return c<=0?null:{art:t,image:o,modules:r,size:i,version:n,kinds:U3(n),margin:e.margin,pixelSize:e.pixelSize,t:c,fg:s,bg:a,variant:vd(t),body:e.body}}function l_(e){let t=t6(e);if(!t)return null;let r;return t.art.mode==="halftone"?r=t.variant==="mono"?a6(t):s6(t):r=t.variant==="badge"?g6(t):c6(t),M("g",{"data-qrdx-art":t.art.mode,"data-qrdx-art-variant":t.variant,children:r})}function r6(e,t){return {margin:.42-.17*e+(t===3?.04:0),darkCap:.4+.3*e}}var f_=8.5,e_=new Map;function Ad(e){let t=e*4+17,r=e_.get(e);if(!r){let i=t*2,s=new Uint8Array(i*i),a=f_*2;for(let c=0;c<i;c++)for(let u=0;u<i;u++){let l=u<a||u>=i-a,f=c<a||c>=i-a;l&&f&&!(u>=i-a&&c>=i-a)&&(s[c*i+u]=1);}for(let[c,u]of ri(e,t))for(let l=(u-2)*2-1;l<(u+3)*2+1;l++)for(let f=(c-2)*2-1;f<(c+3)*2+1;f++)f>=0&&l>=0&&f<i&&l<i&&(s[l*i+f]=1);e_.set(e,s),r=s;}let n=r,o=t*2;return (i,s)=>{let a=Math.floor(i*2),c=Math.floor(s*2);return a>=0&&c>=0&&a<o&&c<o&&n[c*o+a]===1}}function p_(e,t,r=false){let{image:n,size:o,kinds:i,fg:s,bg:a}=e,c=H3.get(e.art.image.data,()=>W3(n)),u=Pd(n.width,n.height,o,"cover"),l=o*t,f=new Float32Array(l*l*3).fill(Number.NaN),m=1/(t*u.scale)>1.3?2:1,h=se(a)-.1*(se(a)-se(s)),d=Ad(e.version);for(let g=0;g<o;g++)for(let y=0;y<o;y++){let _=i[g*o+y],b=_===nt||_===at;if(!(b&&!r))for(let S=0;S<t;S++)for(let C=0;C<t;C++){let w=0,x=0,A=0;for(let Q=0;Q<m;Q++)for(let F=0;F<m;F++){let W=y+(C+(F+.5)/m)/t,K=g+(S+(Q+.5)/m)/t,U=i_(c,(W-u.offsetX)/u.scale,(K-u.offsetY)/u.scale,a);w+=U[0],x+=U[1],A+=U[2];}let P=m*m,E=[w/P,x/P,A/P],I=y+(C+.5)/t,N=g+(S+.5)/t,T=Math.min(I,N,o-I,o-N);T<1.5&&(E=Sr(E,a,.35*(1-T/1.5))),r&&(b||d(I,N))&&(E=Qt(E,a,h,false));let V=((g*t+S)*l+y*t+C)*3;f[V]=E[0],f[V+1]=E[1],f[V+2]=E[2];}}return {n:t,count:l,rgb:f}}function n6(e,t,r){let{size:n,kinds:o,modules:i,fg:s,bg:a,t:c}=e,{n:u,count:l,rgb:f}=t,p=se(s),m=se(a),h=m-p,d=r6(c,u),g=A=>.2126*f[A]+.7152*f[A+1]+.0722*f[A+2],y=new Float32Array(n*n),_=new Float32Array(n*n);for(let A=0;A<n;A++)for(let P=0;P<n;P++){let E=o[A*n+P];if(E===nt){y[A*n+P]=m;continue}if(E===at){y[A*n+P]=i[A]?.[P]?p:m;continue}let I=0,N=0,T=0;for(let V=0;V<u;V++)for(let Q=0;Q<u;Q++){let F=g(((A*u+V)*l+P*u+Q)*3);I+=F,r.under[V*u+Q]||(N+=F,T++);}y[A*n+P]=I/(u*u),_[A*n+P]=T?N/T:I/(u*u);}let b=n+1,S=new Float64Array(b*b);for(let A=0;A<n;A++)for(let P=0;P<n;P++)S[(A+1)*b+P+1]=y[A*n+P]+S[A*b+P+1]+S[(A+1)*b+P]-S[A*b+P];let C=2,w=(A,P)=>{let E=Math.max(0,A-C),I=Math.max(0,P-C),N=Math.min(n,A+C+1),T=Math.min(n,P+C+1);return (S[T*b+N]-S[I*b+N]-S[T*b+E]+S[I*b+E])/((N-E)*(T-I))},x=r.weight;for(let A=0;A<n;A++)for(let P=0;P<n;P++){let E=o[A*n+P];if(E===nt||E===at)continue;let I=E===Gt,N=(d.margin+(I?.08:0))*h,T=(d.darkCap-(I?.12:0))*h,V=(x*((r.light-r.dark)/2)-N)/(1-x),Q=w(P,A),F=_[A*n+P],W=!!i[A]?.[P],K=0,U=a;if(W){let X=Math.min(Q+V,p+T);F>X&&(K=(F-X)/Math.max(F-p,1e-6),U=s);}else {let X=Math.max(Q-V,m-T);F<X&&(K=(X-F)/Math.max(m-F,1e-6));}if(!(K<=0)){K=Math.min(1,K);for(let X=0;X<u;X++)for(let xe=0;xe<u;xe++){let ze=((A*u+X)*l+P*u+xe)*3;for(let he=0;he<3;he++)f[ze+he]+=(U[he]-f[ze+he])*K;}}}}function m_(e,t,r,n){let{count:o}=t,i=new vr;for(let c=0;c<o;c++){let u=0,l=r(c*o);for(let f=1;f<=o;f++){let p=f<o?r(c*o+f):null;(f===o||p!==l)&&(l&&i.cellRun(l,u,c,f-u),u=f,l=p);}}let s=e.pixelSize/t.n,a=be(e.margin*e.pixelSize);return M("g",{transform:`translate(${a} ${a}) scale(${a_(s)})`,children:i.toElements(n)},n)}function Ed(e,t){let r=ri(e.version,e.size);return r.length===0?[]:[M("path",{d:c_(r,e.margin,e.pixelSize),fill:t,fillRule:"evenodd"},"art-alignment")]}function d_(e){let{image:t,size:r}=e;return Math.floor(Math.min(t.width,t.height)/r)>=4&&r<=45?4:3}var o6=e=>2*Cd*Math.sqrt(-2*Math.log(1-Math.min(e,.95)));function i6(e,t,r){let n=t+1,o=new Float64Array(n*n);for(let s=0;s<t;s++)for(let a=0;a<t;a++)o[(s+1)*n+a+1]=e[s*t+a]+o[s*n+a+1]+o[(s+1)*n+a]-o[s*n+a];let i=new Float32Array(t*t);for(let s=0;s<t;s++)for(let a=0;a<t;a++){let c=Math.max(0,a-r),u=Math.max(0,s-r),l=Math.min(t,a+r+1),f=Math.min(t,s+r+1);i[s*t+a]=(o[f*n+l]-o[u*n+l]-o[f*n+c]+o[u*n+c])/((l-c)*(f-u));}return i}function h_(e,t,r,n){let{size:o,kinds:i,modules:s,fg:a,bg:c}=e,u=se(a),l=se(c),f=l-u,p=i6(t,o,2),m=new Float32Array(o*o),h=new Float32Array(o*o).fill(Number.NaN);for(let d=0;d<o;d++)for(let g=0;g<o;g++){let y=d*o+g,_=i[y];if(_===nt||_===at)continue;let b=_===Gt,S=n.base+(b?.08:0),C=(n.margin+(b?.03:0))*f,w=(n.cap-(b?.04:0))*f,x=Yg(S),A=Yg(b?Math.max(n.max,.94):n.max),P=x*((n.dark+n.light)/2)+(1-x)*p[y],E=r[y],I=!!s[d]?.[g],N=I?n.dark:n.light,T=I?Math.min(P-C,u+w):Math.max(P+C,l-w),Q=(I?E<=T:E>=T)?0:(E-T)/(E-N);Q>A&&(Q=A,h[y]=Math.min(l,Math.max(u,(T-A*N)/(1-A))));let F=I?E<=T-.06:E>=T+.06;n.skip&&F&&!b||(Q=Math.max(Q,x)),m[y]=Q>0?o6(Q):0;}return {diameter:m,surround:h}}function s6(e){let{size:t,kinds:r,modules:n,fg:o,bg:i,t:s,margin:a,pixelSize:c}=e,u=d_(e),l=p_(e,u,true),f=se(o),p=se(i),m=f+.1*(p-f),h=p-.05*(p-f),{count:d,rgb:g}=l,y=(w,x,A,P)=>((x*u+P)*d+w*u+A)*3,_=new Float32Array(t*t);for(let w=0;w<t;w++)for(let x=0;x<t;x++){let A=r[w*t+x];if(A===nt||A===at){_[w*t+x]=A===at&&n[w]?.[x]?f:p;continue}let P=0;for(let E=0;E<u;E++)for(let I=0;I<u;I++){let N=y(x,w,I,E);P+=.2126*g[N]+.7152*g[N+1]+.0722*g[N+2];}_[w*t+x]=P/(u*u);}let b=h_(e,_,_,{base:.6-.28*s,max:.86,dark:m,light:h,margin:.2-.1*s,cap:.4+.14*s,skip:false});for(let w=0;w<t;w++)for(let x=0;x<t;x++){let A=b.surround[w*t+x];if(Number.isNaN(A))continue;let P=_[w*t+x],I=A<P?o:i,N=Math.min(1,Math.abs(P-A)/Math.max(Math.abs(P-se(I)),1e-6));for(let T=0;T<u;T++)for(let V=0;V<u;V++){let Q=y(x,w,V,T);for(let F=0;F<3;F++)g[Q+F]+=(I[F]-g[Q+F])*N;}}let S=[m_(e,l,w=>{let x=w*3;return Number.isNaN(g[x])?null:Ue([g[x],g[x+1],g[x+2]],8)},"art-photo")],C=new vr;for(let w=0;w<t;w++)for(let x=0;x<t;x++){let A=b.diameter[w*t+x];if(!(A>0))continue;let P=0,E=0,I=0;for(let V=0;V<u;V++)for(let Q=0;Q<u;Q++){let F=y(x,w,Q,V);P+=g[F],E+=g[F+1],I+=g[F+2];}let N=[P/(u*u),E/(u*u),I/(u*u)],T=n[w]?.[x]?Qt(N,o,m,true):Qt(N,i,h,false);C.circle(Ue(T,10),(x+a+.5)*c,(w+a+.5)*c,A/2*c);}return S.push(...C.toElements("art-dot"),...Ed(e,Ue(o))),S}function a6(e){let{size:t,kinds:r,modules:n,fg:o,bg:i}=e,s=d_(e),a=p_(e,s),c=se(o),u=se(i),l=s%2===1?1:2,f=(s-l)/2,p=P=>P>=f&&P<f+l,m=[];for(let P=0;P<s;P++)for(let E=0;E<s;E++)m.push(p(E)&&p(P));n6(e,a,{weight:j3(l/s),dark:c,light:u,under:m});let{count:h,rgb:d}=a,g=new Float32Array(h*h),y=new Int8Array(h*h).fill(-1);for(let P=0;P<h*h;P++){let E=P*3;if(Number.isNaN(d[E])){g[P]=Number.NaN;continue}let I=(.2126*d[E]+.7152*d[E+1]+.0722*d[E+2]-c)/(u-c);g[P]=.5+(q3(0,1,I)-.5)*1.15;}for(let P=0;P<t;P++)for(let E=0;E<t;E++){let I=r[P*t+E];if(!(I===nt||I===at))for(let N=f;N<f+l;N++)for(let T=f;T<f+l;T++)y[(P*s+N)*h+E*s+T]=n[P]?.[E]?0:1;}let _=Ad(e.version);for(let P=0;P<h;P++)for(let E=0;E<h;E++){let I=P*h+E;y[I]<0&&_((E+.5)/s,(P+.5)/s)&&(y[I]=1);}let b=new Uint8Array(h*h),S=.3,C=0,w=0,x=(P,E,I)=>{if(P<0||P>=h||E>=h)return;let N=E*h+P;if(!Number.isNaN(g[N])){let T=Math.floor(P/s)===Math.floor(C/s)&&Math.floor(E/s)===Math.floor(w/s);g[N]+=T?I:I*S;}};for(let P=0;P<h;P++){let E=P%2===0?1:-1;for(let I=0;I<h;I++){let N=E===1?I:h-1-I,T=P*h+N,V=g[T];if(Number.isNaN(V))continue;let Q=y[T]>=0?y[T]:V>=.5?1:0;b[T]=Q===0?1:0;let F=Math.min(.75,Math.max(-0.75,V-Q));C=N,w=P,x(N+E,P,F*7/16),x(N-E,P+1,F*3/16),x(N,P+1,F*5/16),x(N+E,P+1,F/16);}}let A=Ue(o);return [m_(e,a,P=>b[P]?A:null,"art-halftone"),...Ed(e,A)]}function t_(e,t){let r=null,n=0;for(let o of e.palette){if(t&&Q3(o.color,t)<.02)continue;let i=o.area*(.35+n_(o.color))*(se(o.color)>.86?.05:1);i>n&&(n=i,r=o.color);}return r}function g_(e,t,r,n,o){let i;if(e.photographic){let s=new vr,{width:a,height:c,rgb:u,alpha:l}=t;for(let f=0;f<c;f++){let p=0,m=null;for(let h=0;h<=a;h++){let d=f*a+h,g=h<a&&l[d]>=.5?Ue(n([u[d*3],u[d*3+1],u[d*3+2]]),6):null;(h===a||g!==m)&&(m&&s.cellRun(m,p,f,h-p),p=h,m=g);}}i=s.toElements(`${o}-px`);}else i=e.layers.map((s,a)=>M("path",{d:s.d,fill:Ue(n(s.color)),fillRule:"evenodd"},`${o}-${a}`));return M("g",{transform:`translate(${be(r.x)} ${be(r.y)}) scale(${a_(r.scale)})`,children:i},o)}function c6(e){let{art:t,image:r,size:n,kinds:o,modules:i,fg:s,bg:a,t:c,margin:u,pixelSize:l}=e,f=kd(t,r),p=s_(t,r,f),m=Pd(f.width,f.height,n,"contain"),h=Math.min(1,.3+1.4*c),d=F=>Sr(a,F,h),g=Ue(a),y=Ue(s),_=[g_(f,p,{x:(u+m.offsetX)*l,y:(u+m.offsetY)*l,scale:m.scale*l},d,"art-logo")],b=f_,S=(F,W)=>wr((F+u)*l,(W+u)*l,(b+.4)*l,(b+.4)*l,1.2*l),C=ri(e.version,n).map(([F,W])=>wr((F-2.5+u)*l,(W-2.5+u)*l,6*l,6*l,l*.8)).join("");_.push(M("path",{d:S(-0.4,-0.4)+S(n-b,-0.4)+S(-0.4,n-b)+C,fill:g},"art-plates"));let w=Ad(e.version),x=se(a),A=se(s),P=new Float32Array(n*n),E=new Float32Array(n*n),I=new Array(n*n);for(let F=0;F<n;F++)for(let W=0;W<n;W++){let K=F*n+W,U=o[K];if(U===nt||U===at){P[K]=U===at&&i[F]?.[W]?A:x;continue}let X=1,xe=0,ze=0,he=0,pe=0;for(let ke=0;ke<4;ke++)for(let J=0;J<4;J++){let kt=W+(J+.5)/4,Qn=F+(ke+.5)/4,ut=w(kt,Qn)?a:i_(p,(kt-m.offsetX)/m.scale,(Qn-m.offsetY)/m.scale,a,h),Vn=se(ut);X=Math.min(X,Vn),xe+=Vn,ze+=ut[0],he+=ut[1],pe+=ut[2];}P[K]=xe/16,E[K]=X,I[K]=[ze/16,he/16,pe/16];}let N=A+.08*(x-A),T=x-.04*(x-A),V=h_(e,P,P,{base:.74-.26*c,max:.9,dark:N,light:T,margin:.23-.1*c,cap:.4+.1*c,skip:c>=.7}),Q=new vr;for(let F=0;F<n;F++)for(let W=0;W<n;W++){let K=F*n+W,U=V.diameter[K],X=!!i[F]?.[W];if(!(U>0)||!X&&E[K]>=x-.02)continue;let xe=X?Qt(I[K],s,N,true):Qt(I[K],a,T,false);Q.circle(Ue(xe,8),(W+u+.5)*l,(F+u+.5)*l,U/2*l);}return _.push(...Q.toElements("art-dot")),_.push(...Ed(e,y)),_}var u6={L:.5,M:.72,Q:.88,H:1},__=.32,y_=.55,l6=.6,f6=2;function b_(e,t,r){let n=t>=1?e:e*t,o=t>=1?e/t:e,i=Math.max(.7,e*.09),s=n+2*i,a=o+2*i;return {logoW:n,logoH:o,plateW:s,plateH:a,radius:Math.min(s,a)*.26,cx:r/2,cy:r/2}}var $_=e=>({cx:e.cx,cy:e.cy,w:e.plateW,h:e.plateH,r:e.radius});function x_(e,t,r){return S_(t+.5,r+.5,e)<y_}function p6(e,t){let r=$_(e),n=y_+1,o=Math.max(0,Math.floor(e.cx-e.plateW/2-n)),i=Math.min(t-1,Math.ceil(e.cx+e.plateW/2+n)),s=Math.max(0,Math.floor(e.cy-e.plateH/2-n)),a=Math.min(t-1,Math.ceil(e.cy+e.plateH/2+n)),c=[];for(let u=s;u<=a;u++)for(let l=o;l<=i;l++)x_(r,l,u)&&c.push(u*t+l);return c}var m6=e=>Math.floor(e.correctable*l6);function wd(e,t,r){let n=b_(e,t,r.size),o=m6(r);return Ta(r,p6(n,r.size)).every(i=>i<=o)}function w_(e,t,r){if(wd(r,t,e))return r;let n=0,o=r;if(!wd(n,t,e))return -1;for(;o-n>1/64;){let i=(n+o)/2;wd(i,t,e)?n=i:o=i;}return n}var Da=new Map;function d6(e,t){let r=`${e.version}${e.level}:${t.toFixed(3)}`,n=Da.get(r);return n===void 0&&(n=w_(e,t,__*e.size),Da.size>=64&&Da.clear(),Da.set(r,n)),n}function h6(e,t){let{size:r,t:n,modules:o,version:i}=e,s=G3(o),a=(.18+.15*n)*u6[s],c=t.width/t.height,u=Math.min(__,a)*r,l=La(i,s),f=Math.max(0,d6(l,c));if(f<f6)return {wantedBox:u,maxBox:f,box:0,plate:null};let p=w_(l,c,Math.min(u,f));return p<0?{wantedBox:u,maxBox:f,box:0,plate:null}:{wantedBox:u,maxBox:f,box:p,plate:b_(p,c,r)}}function S_(e,t,r){let n=Math.abs(e-r.cx)-(r.w/2-r.r),o=Math.abs(t-r.cy)-(r.h/2-r.r);return Math.hypot(Math.max(n,0),Math.max(o,0))+Math.min(Math.max(n,o),0)-r.r}function v_(e,t){let{fg:r,bg:n,t:o}=e,i=se(r),s=se(n),a=t_(t),c=Math.min(1,o/.6),u=a?Qt(a,r,i+.3*(s-i),true):r,l=Sr(r,u,c),f=a?t_(t,a):null,p=i+.42*(s-i),m=f&&se(f)<=p+.22?Sr(r,Qt(f,r,p,true),c):l;return {body:l,inner:m}}function g6(e){let{art:t,image:r,size:n,kinds:o,modules:i,bg:s,margin:a,pixelSize:c,version:u}=e,l=kd(t,r),f=h6(e,l).plate,{body:p}=v_(e,l),m=Ue(p),h=f&&$_(f),d=i.map(I=>[...I]);for(let I=0;I<n;I++)for(let N=0;N<n;N++){let T=o[I*n+N];(T===at||h&&T!==nt&&x_(h,N,I))&&(d[I][N]=false);}let g=[],y=e.body?.(d);if(y)g.push(M("g",{fill:m,children:y},"art-body"));else {let I=new vr;for(let N=0;N<n;N++)for(let T=0;T<n;T++)d[N]?.[T]&&o[N*n+T]!==nt&&I.circle(m,(T+a+.5)*c,(N+a+.5)*c,.45*c);g.push(...I.toElements("art-body"));}let _=ri(u,n).filter(([I,N])=>!h||S_(I+.5,N+.5,h)>3.2);if(_.length>0&&g.push(M("path",{d:c_(_,a,c),fill:m,fillRule:"evenodd"},"art-alignment")),!f)return g;let b=s_(t,r,l),S=(f.cx-f.plateW/2+a)*c,C=(f.cy-f.plateH/2+a)*c,w=f.plateW*c,x=f.plateH*c,A=f.radius*c,P=.1*c,E=wr(S,C,w,x,A);return g.push(M("path",{d:E,fill:Ue(s)},"art-plate"),M("path",{d:E+wr(S+P,C+P,w-2*P,x-2*P,A-P),fill:Ue(Sr(s,p,.16)),fillRule:"evenodd"},"art-plate-ring"),g_(l,b,{x:(f.cx-f.logoW/2+a)*c,y:(f.cy-f.logoH/2+a)*c,scale:f.logoW/l.width*c},I=>I,"art-logo")),g}function C_(e){let{art:t}=e;if(t.mode!=="logo"||t.matchEyes===false)return null;let r=t.image&&Sd(t.image);if(!r)return null;let n=Za(e.fgColor,[0,0,0]),o=Za(e.bgColor,[1,1,1]),i=u_(t,n,o);if(i<=0)return null;let s=kd(t,r);if(s.palette.length===0)return null;if(vd(t)==="badge"){let{body:h,inner:d}=v_({fg:n,bg:o,t:i},s),g={outer:Ue(h),inner:Ue(d)};return {topLeft:g,topRight:g,bottomLeft:g}}let a=se(n),c=se(o),u=Math.min(1,i/.6),l=e.version*4+17,f=Pd(s.width,s.height,l,"contain"),p=.45*Math.max(s.width,s.height),m=(h,d)=>{let g=(h-f.offsetX)/f.scale,y=(d-f.offsetY)/f.scale,_=null,b=0;for(let C of s.palette){if(se(C.color)>.86)continue;let w=(C.cx-g)**2+(C.cy-y)**2,x=C.area*(.35+n_(C.color))*Math.exp(-w/(2*p**2));x>b&&(b=x,_=C.color);}if(!_)return {};let S=Qt(_,n,a+.42*(c-a),true);return {inner:Ue(Sr(n,S,u))}};return {topLeft:m(3.5,3.5),topRight:m(l-3.5,3.5),bottomLeft:m(3.5,l-3.5)}}function ne(e){if(e.length===0)return "";let[t,...r]=e;return `M${$(t[0])} ${$(t[1])}${r.map(([n,o])=>`L${$(n)} ${$(o)}`).join("")}Z`}function oe(e,t,r){return `M${$(e-r)} ${$(t)}A${$(r)} ${$(r)} 0 1 1 ${$(e+r)} ${$(t)}A${$(r)} ${$(r)} 0 1 1 ${$(e-r)} ${$(t)}Z`}function Z(e,t,r,n,o=0){let i=Math.min(r,n)/2,[s,a,c,u]=(typeof o=="number"?[o,o,o,o]:o).map(f=>Math.max(0,Math.min(f,i))),l=(f,p,m)=>f>0?`A${$(f)} ${$(f)} 0 0 1 ${$(p)} ${$(m)}`:"";return `M${$(e+s)} ${$(t)}H${$(e+r-a)}${l(a,e+r,t+a)}V${$(t+n-c)}${l(c,e+r-c,t+n)}H${$(e+u)}${l(u,e,t+n-u)}V${$(t+s)}${l(s,e+s,t)}Z`}function Ln(e,t,r,n,o=-90){return Array.from({length:n},(i,s)=>{let a=(o+360/n*s)*Math.PI/180;return [e+r*Math.cos(a),t+r*Math.sin(a)]})}function Tn(e,t,r,n,o=5){return Array.from({length:o*2},(i,s)=>{let a=s%2===0?r:n,c=-Math.PI/2+Math.PI/o*s;return [e+a*Math.cos(c),t+a*Math.sin(c)]})}function ni(e,t,r,n,o=4,i=64){return Array.from({length:i},(s,a)=>{let c=2*Math.PI*a/i,u=Math.cos(c),l=Math.sin(c);return [e+r*Math.sign(u)*Math.abs(u)**(2/o),t+n*Math.sign(l)*Math.abs(l)**(2/o)]})}function On(e,t,r){let n=r/2,o=(i,s)=>`${$(e+i*n)} ${$(t+s*n)}`;return `M${o(0,-0.52)}C${o(.18,-0.92)} ${o(.98,-0.94)} ${o(1,-0.34)}C${o(1,.12)} ${o(.5,.48)} ${o(0,.92)}C${o(-0.5,.48)} ${o(-1,.12)} ${o(-1,-0.34)}C${o(-0.98,-0.94)} ${o(-0.18,-0.92)} ${o(0,-0.52)}Z`}function P_(e,t,r,n){if(n===0)return e;let o=n*Math.PI/180,i=Math.cos(o),s=Math.sin(o);return e.map(([a,c])=>[t+(a-t)*i-(c-r)*s,r+(a-t)*s+(c-r)*i])}function Ba(e,t,r=0){let n=Math.imul(e+2654435769,2246822507)^Math.imul(t+r,3266489909);return n=Math.imul(n^n>>>15,739982445),n=Math.imul(n^n>>>12,695872825),n^=n>>>15,(n>>>0)/4294967296}function Cr(e){let t=2166136261;for(let r=0;r<e.length;r++)t^=e.charCodeAt(r),t=Math.imul(t,16777619);return (t>>>0).toString(36)}var _6=["horizontal-line","liquid","liquid-horizontal","liquid-vertical","classy","classy-rounded","leaf","plus","hexagon","star","heart","random-dots","mosaic","octagon"];function k_(e){return _6.includes(e)}var y6={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 Rd(e,t){if(e===void 0||!Number.isFinite(e))return 1;let r=t?y6[t]??1:Na;return Math.min(gd,Math.max(Na,r,e))}function b6(e,t,r){return e<7&&t<7||e>=r-7&&t<7||e<7&&t>=r-7}function $6(e,t){if(e===1)return [];let r=Math.floor(e/7)+2,n=e===32?26:Math.ceil((e*4+4)/(r*2-2))*2,o=[6];for(let i=t-7;o.length<r;i-=n)o.splice(1,0,i);return o}function Md(e){let t=(e-17)/4,r=Number.isInteger(t)?$6(t,e):[],n=r.length-1,o=[];for(let[i,s]of r.entries())for(let[a,c]of r.entries())i===0&&a===0||i===0&&a===n||i===n&&a===0||o.push([s,c]);return (i,s)=>o.some(([a,c])=>Math.abs(i-a)<=2&&Math.abs(s-c)<=2)}var x6={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 w6(e,t,r,n,o,i){switch(e){case "horizontal-line":{let s=n*.43;return Z(t-n/2,r-s,n,2*s)}case "leaf":{let s=n*.5;return Z(t-s,r-s,2*s,2*s,[n*.4,n*.05,n*.4,n*.05])}case "plus":{let s=n*.22,a=n*.5;return ne([[t-s,r-a],[t+s,r-a],[t+s,r-s],[t+a,r-s],[t+a,r+s],[t+s,r+s],[t+s,r+a],[t-s,r+a],[t-s,r+s],[t-a,r+s],[t-a,r-s],[t-s,r-s]])}case "hexagon":return ne(Ln(t,r,n*.54,6));case "star":return ne(Tn(t,r+n*.04,n*.62,n*.34));case "heart":return On(t,r+n*.02,n*1.08);case "random-dots":return oe(t,r,n*(.38+.15*Ba(o,i)));case "mosaic":{let s=n*(.8+.14*Ba(o,i,1))/2,a=[[t-s,r-s],[t+s,r-s],[t+s,r+s],[t-s,r+s]];return ne(P_(a,t,r,(Ba(o,i,2)-.5)*16))}case "octagon":return ne(Ln(t,r,n*.48/Math.cos(Math.PI/8),8,22.5));default:return oe(t,r,n*.45)}}function A_(e,t){let{margin:r,pixelSize:n,pattern:o}=t,i=Rd(t.scale,o),s=e.length,a=t.plain?()=>false:Md(s),c=(d,g)=>!t.plain&&b6(d,g,s),u=(d,g)=>d>=0&&g>=0&&d<s&&g<s&&!!e[g]?.[d]&&!c(d,g),l=d=>(d+.5+r)*n,f=[],p=[],m=x6[o];for(let d=0;d<s;d++)for(let g=0;g<s;g++){if(!u(g,d))continue;let y=l(g),_=l(d);if(a(g,d)){f.push(R`M${y-n/2} ${_-n/2}h${n}v${n}h${-n}z`);continue}if(!m){p.push(w6(o,y,_,n*i,g,d));continue}let b=n*m.thickness*i/2,S=m.horizontal&&u(g+1,d),C=m.horizontal&&u(g-1,d),w=m.vertical&&u(g,d-1),x=m.vertical&&u(g,d+1),P=[!(w||C),!(w||S),!(x||S),!(x||C)].map((E,I)=>E?b*m.radius(I):0);p.push(Z(y-b,_-b,2*b,2*b,P)),2*b<n&&(S&&p.push(Z(y,_-b,n,2*b)),x&&p.push(Z(y-b,_,2*b,n)));}if(m?.fillets&&i===1){let d=n*.3;for(let g=0;g<s;g++)for(let y=0;y<s;y++){if(u(y,g)||c(y,g))continue;let _=l(y)-n/2,b=l(g)-n/2,S=_+n,C=b+n;u(y-1,g)&&u(y,g-1)&&u(y-1,g-1)&&p.push(R`M${_} ${b}h${d}A${d} ${d} 0 0 0 ${_} ${b+d}Z`),u(y+1,g)&&u(y,g-1)&&u(y+1,g-1)&&p.push(R`M${S} ${b}v${d}A${d} ${d} 0 0 0 ${S-d} ${b}Z`),u(y+1,g)&&u(y,g+1)&&u(y+1,g+1)&&p.push(R`M${S} ${C}h${-d}A${d} ${d} 0 0 0 ${S} ${C-d}Z`),u(y-1,g)&&u(y,g+1)&&u(y-1,g+1)&&p.push(R`M${_} ${C}v${-d}A${d} ${d} 0 0 0 ${_+d} ${C}Z`);}}let h=[];return p.length>0&&h.push(M("path",{d:p.join("")},"modules")),f.length>0&&h.push(M("path",{d:f.join("")},"alignment")),h}var E_=24,Vt=(e,t,r,n)=>{let o=n*Math.PI/180;return [e+r*Math.cos(o),t+r*Math.sin(o)]},Ua=([e,t])=>`${$(e)} ${$(t)}`;function Fn(e,t,r,n,o,i){let s=i-o>180?1:0;return `M${Ua(Vt(e,t,n,o))}A${$(n)} ${$(n)} 0 ${s} 1 ${Ua(Vt(e,t,n,i))}L${Ua(Vt(e,t,r,i))}A${$(r)} ${$(r)} 0 ${s} 0 ${Ua(Vt(e,t,r,o))}Z`}function oi(e,t,r,n){return `M${$(e-r)} ${$(t)}A${$(r)} ${$(n)} 0 1 1 ${$(e+r)} ${$(t)}A${$(r)} ${$(n)} 0 1 1 ${$(e-r)} ${$(t)}Z`}function S6(e){let t=0;return e.forEach(([r,n],o)=>{let[i,s]=e[(o+1)%e.length];t+=r*s-i*n;}),t/2}function R_(e){return ne(S6(e)<0?[...e].reverse():e)}function Ga(e,t,r,n,o){let i=Math.hypot(r-e,n-t)||1,s=-(n-t)/i*(o/2),a=(r-e)/i*(o/2);return R_([[e+s,t+a],[r+s,n+a],[r-s,n-a],[e-s,t-a]])}var Ge=(...e)=>({d:e.join(""),fillRule:"nonzero"}),wt=(...e)=>({d:e.join(""),fillRule:"evenodd"});function v6(){let e=[];for(let t of [0,60,120]){let[r,n]=Vt(12,12,10.5,t+180),[o,i]=Vt(12,12,10.5,t);e.push(Ga(r,n,o,i,2));}for(let t=0;t<6;t++){let r=t*60,[n,o]=Vt(12,12,6.2,r);for(let i of [-45,45]){let[s,a]=Vt(n,o,3.6,r+i);e.push(Ga(n,o,s,a,1.7));}}return Ge(...e)}var C6={wifi:()=>Ge(Fn(12,20,4.6,7.2,-135,-45),Fn(12,20,9.2,11.8,-135,-45),Fn(12,20,13.8,16.4,-135,-45),oe(12,20,2.2)),star:()=>Ge(ne(Tn(12,12.8,11.6,4.8))),heart:()=>Ge(On(12,12.4,22)),phone:()=>wt(Z(6,1.5,12,21,2.6),Z(7.8,4.2,8.4,13.4,.6),oe(12,19.8,1.1)),headphones:()=>Ge(Fn(12,13,7.6,9.8,-180,0),Z(2,12,5,9.5,2),Z(17,12,5,9.5,2)),calendar:()=>wt(Z(2.5,4,19,17.5,2.5),Z(4.6,9,14.8,10.6,.8),Z(7,11.4,2.6,2.6,.4),Z(10.7,11.4,2.6,2.6,.4),Z(14.4,11.4,2.6,2.6,.4),Z(7,15.1,2.6,2.6,.4),Z(10.7,15.1,2.6,2.6,.4),Z(6.5,1.4,2.4,2.6,[1.2,1.2,0,0]),Z(15.1,1.4,2.4,2.6,[1.2,1.2,0,0])),user:()=>Ge(oe(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:()=>wt(Z(2,3,20,14,4),ne([[6.5,17],[11.5,17],[5.8,21.8]]),oe(7.5,10,1.5),oe(12,10,1.5),oe(16.5,10,1.5)),bag:()=>Ge(Z(3.5,7.5,17,14.5,2),Fn(12,7.5,3.1,4.8,-180,0)),bell:()=>Ge("M3.5 17.2A8.5 8.5 0 0 1 20.5 17.2Z",Z(1.5,18.2,21,2.6,1.3),Z(11.2,6.6,1.6,2.6,0),Z(9.8,4.6,4.4,2.4,1.2)),cup:()=>Ge("M4 6.5H17V13.5A6.5 6.5 0 0 1 4 13.5Z",Fn(17,10.2,1.7,3.6,-90,90),Z(2,20.6,17,2,1),Z(7,1.6,1.6,3.4,.8),Z(11.6,1.6,1.6,3.4,.8)),card:()=>wt(Z(1.5,4.5,21,15,2.5),Z(1.5,8,21,3,0),Z(4.5,13.6,4.6,3.2,.6)),check:()=>wt(oe(12,12,10.5),ne([[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:()=>wt(oe(12,12,10.5),oe(12,7.2,1.6),Z(10.6,10,2.8,8,.8)),home:()=>wt(ne([[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]]),Z(10,14.5,4,7,[.6,.6,0,0])),pin:()=>wt("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",oe(12,9.5,3)),share:()=>Ge(Ga(6,12,18,5,1.8),Ga(6,12,18,19,1.8),oe(18,5,3.2),oe(6,12,3.2),oe(18,19,3.2)),download:()=>Ge(Z(10.6,2,2.8,9.5,0),ne([[6,10],[18,10],[12,16.5]]),ne([[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:()=>wt(oe(12,12,10.5),oe(12,12,8.4),ne([[11,5.4],[13,5.4],[13,11.3],[16.9,13.5],[15.9,15.2],[11,12.5]])),snowflake:v6,pumpkin:()=>Ge(oi(7.8,14.6,5.8,6.9),oi(16.2,14.6,5.8,6.9),oi(12,14.6,4.8,7.4),Z(10.9,3.4,2.2,4.6,.8),R_([[13,4.2],[17.2,3],[16.2,5.4],[13,6]])),tree:()=>Ge(ne([[12,1.5],[16.8,8.2],[7.2,8.2]]),ne([[12,5.2],[19,13.6],[5,13.6]]),ne([[12,9.4],[21.2,19.2],[2.8,19.2]]),Z(10.4,18.6,3.2,3.9,.4)),sparkle:()=>Ge(ne(Tn(9.5,13.5,9,2.4,4)),ne(Tn(19,5,4,1.1,4))),gift:()=>Ge(Z(3,11.2,7.8,10.6,1),Z(13.2,11.2,7.8,10.6,1),Z(2,7.4,8.8,3.2,1),Z(13.2,7.4,8.8,3.2,1),oi(8.8,4.8,2.9,1.9),oi(15.2,4.8,2.9,1.9))};function M_(e){return C6[e]()}function I_(e){return e===" "?.3:/[MWmw@%]/.test(e)?.92:/[A-Z0-9#&]/.test(e)?.72:/[il.,:;!'|1]/.test(e)?.32:.6}function zd(e){let t=0;for(let r of e)t+=I_(r);return Math.max(t,1)}var Id=e=>Math.round(Math.min(255,Math.max(0,e))).toString(16).padStart(2,"0");function Qa(e,t,r){let n=Me(e)??{r:0,g:0,b:0},o=Me(t)??{r:255,g:255,b:255},i=Math.min(1,Math.max(0,r));return `#${Id(n.r+(o.r-n.r)*i)}${Id(n.g+(o.g-n.g)*i)}${Id(n.b+(o.b-n.b)*i)}`}function z_(e,t,r,n,o,i,s,a){let c=[...e],u=o*.08,l=c.map(d=>I_(d)*o),f=l.reduce((d,g)=>d+g,0)+u*Math.max(0,c.length-1),p=i==="top"?n-o*.35:n+o*.35,m=[],h=0;return c.forEach((d,g)=>{let y=l[g],_=(h+y/2)/p;if(h+=y+u,d.trim()==="")return;let b=i==="top"?-Math.PI/2-f/2/p+_:Math.PI/2+f/2/p-_;m.push({text:d,x:t+p*Math.cos(b),y:r+p*Math.sin(b),fontSize:o,maxWidth:o*2,color:s,rotate:b*180/Math.PI+(i==="top"?90:-90),field:a});}),m}var Va=class extends Error{issues;constructor(t){super(`Invalid frame spec: ${t.slice(0,5).join("; ")}`),this.name="FrameSpecError",this.issues=t;}},N_=new WeakMap;function ii(e){if(e&&typeof e=="object"){let r=N_.get(e);if(r)return r}if(e==null)throw new Va(['A "custom" frame needs a spec']);let t=dd.safeParse(e);if(!t.success)throw new Va(t.error.issues.map(r=>r.path.length>0?`${r.path.join(".")}: ${r.message}`:r.message));return typeof e=="object"&&N_.set(e,t.data),t.data}var P6=e=>{let t=Me(e);return !!(t&&t.a>=1)};function k6(e,t){let r=Ae(t,Ne);return e.qr.plate==="none"?{color:r,plate:false}:P6(r)?{color:r,plate:true}:e.qr.plate==="background"?{color:r,plate:false}:{color:Ne,plate:true}}function T_(e,t,r=Ne){let n=t.color||e.colors.frame,o=t.secondaryColor||e.colors.accent||n,i=c=>c==="frame"?n:c==="accent"?o:c==="background"?r:c,s=e.colors.text,a=t.textColor||(s===void 0?n:typeof s=="string"?s:Qa(i(s.mix[0]),i(s.mix[1]),s.amount));return {frame:n,text:a,accent:o}}function A6(e,t,r){let n=T_(t,e,r),o=i=>{switch(i){case "frame":return n.frame;case "text":return n.text;case "accent":return n.accent;case "background":return r;default:return i}};return i=>typeof i=="string"?o(i):Qa(o(i.mix[0]),o(i.mix[1]),i.amount)}function L_(e,t,r=0,n=0){let o=qo(e);return o?td(o,t,r,n):""}function E6(e,t,r,n){return `M${$(e-r)} ${$(t)}A${$(r)} ${$(n)} 0 1 1 ${$(e+r)} ${$(t)}A${$(r)} ${$(n)} 0 1 1 ${$(e-r)} ${$(t)}Z`}function R6(e,t){let[r,n,o,i]=[e.x1*t,e.y1*t,e.x2*t,e.y2*t],s=Math.hypot(o-r,i-n),a=e.width*t/2,c=s>0?(o-r)/s:1,u=s>0?(i-n)/s:0,l=-u*a,f=c*a,p=(g,y)=>{let _=[r+c*g,n+u*g],b=[r+c*y,n+u*y];if(e.cap==="round"&&y-g>2*a){let S=[_[0]+c*a,_[1]+u*a],C=[b[0]-c*a,b[1]-u*a];return `M${$(S[0]-l)} ${$(S[1]-f)}L${$(C[0]-l)} ${$(C[1]-f)}A${$(a)} ${$(a)} 0 0 1 ${$(C[0]+l)} ${$(C[1]+f)}L${$(S[0]+l)} ${$(S[1]+f)}A${$(a)} ${$(a)} 0 0 1 ${$(S[0]-l)} ${$(S[1]-f)}Z`}return `M${$(_[0]-l)} ${$(_[1]-f)}L${$(b[0]-l)} ${$(b[1]-f)}L${$(b[0]+l)} ${$(b[1]+f)}L${$(_[0]+l)} ${$(_[1]+f)}Z`};if(!e.dash)return {type:"path",d:p(0,s),fillRule:"nonzero"};let m=e.dash[0]*t,h=m+e.dash[1]*t,d=[];for(let g=0;g+m<=s+1e-6;g+=h)d.push(p(g,g+m));return {type:"path",d:d.join(""),fillRule:"nonzero"}}function M6(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:oe(e.cx*t,e.cy*t,e.r*t)+(e.hole?oe(e.cx*t,e.cy*t,e.hole*t):""),fillRule:e.hole?"evenodd":"nonzero"};case "ellipse":return {type:"path",d:E6(e.cx*t,e.cy*t,e.rx*t,e.ry*t),fillRule:"nonzero"};case "polygon":return {type:"polygon",points:e.points.map(([r,n])=>[r*t,n*t])};case "path":return {type:"path",d:L_(e.d,t),fillRule:e.fillRule??"nonzero"};case "line":return R6(e,t);default:{let r=M_(e.icon);return {type:"path",d:L_(r.d,e.size*t/E_,e.x*t,e.y*t),fillRule:r.fillRule}}}}function I6(e){if(e.type==="rect"){let{x:t,y:r,width:n,height:o,radius:i,hole:s}=e;return [...Mn(t,r,n,o,i,i),...s?Mn(s.x,s.y,s.width,s.height,s.radius,s.radius):[]]}return e.type==="polygon"?[...e.points.map(([t,r],n)=>n===0?{op:"M",x:t,y:r}:{op:"L",x:t,y:r}),{op:"Z"}]:_r(e.d)}function z6(e,t,r){let n=I6(e),o=Eg(n,.2),i=e.type==="rect"?e.hole?"evenodd":"nonzero":e.type==="path"?e.fillRule??"nonzero":"nonzero",s=t.direction==="vertical",a=g=>s?g[1]:g[0],c=Number.POSITIVE_INFINITY,u=Number.NEGATIVE_INFINITY;for(let g of o)for(let y of g)c=Math.min(c,a(y)),u=Math.max(u,a(y));if(!(u>c))return [];let l=t.steps??32,f=r(t.from),p=r(t.to),m=u-c,h=m*.002,d=[];for(let g=0;g<l;g++){let y=c+m*g/l,_=Math.min(u,c+m*(g+1)/l+(g+1<l?h:0)),b=s?{x0:Number.NEGATIVE_INFINITY,x1:Number.POSITIVE_INFINITY,y0:y,y1:_}:{x0:y,x1:_,y0:Number.NEGATIVE_INFINITY,y1:Number.POSITIVE_INFINITY},S=o.map(C=>Pa(C,b)).filter(C=>C.length>2);S.length!==0&&d.push({type:"path",d:Rg(S),fill:Qa(f,p,(g+.5)/l),fillRule:i});}return d}function N6(e,t,r){let n=M6(e,t),o="stroke"in e&&e.stroke?{stroke:r(e.stroke.color),strokeWidth:e.stroke.width*t}:void 0;if(typeof e.fill=="object"&&"gradient"in e.fill){let i=z6(n,e.fill.gradient,r);return o?[...i,{...n,fill:"none",...o}]:i}return [{...n,fill:r(e.fill),...o}]}function L6(e,t){let r=Math.min(e.maxLength??Se.maxTextLength,Se.maxTextLength),n=e.slot==="primary"?t.text??e.text:e.slot==="secondary"?t.secondaryText??e.text:e.text;return Ko(n,r)}function T6(e){return e===void 0||!Number.isFinite(e)?1:Math.min(En,Math.max(Xm,e))}function O6(e,t,r,n,o,i){let s=o(e.color),a=e.weight==="regular"?{fontWeight:400}:{};if(e.type==="curved"){let{cx:d,cy:g,radius:y,side:_,spread:b=140}=e.curve,S=y*n*(b*Math.PI/180),C=Math.min(e.fontSize*n*r,S/(zd(t)+.08*t.length));return z_(t,d*n,g*n,y*n,C,_,s,i).map(w=>({...w,...a}))}let c=e.box.x*n,u=e.box.y*n,l=e.box.width*n,f=e.box.height*n;if(!(f>0))return [];let p=(e.fontSize??e.box.height*pd)*n,m=Math.min(p*r,f*Ia,l/zd(t)),h=e.align??"middle";return [{text:t,x:h==="start"?c:h==="end"?c+l:c+l/2,y:u+f/2+m*.35,fontSize:m,maxWidth:l,color:s,...h!=="middle"&&{align:h},...a,field:i}]}function F6(e){let t=0,r=0,n=0,o=0;return e.map(({command:i,values:s})=>{let a=i.toUpperCase(),c=i!==a;switch(a){case "Z":return t=n,r=o,{command:"Z",values:[]};case "H":return t=(c?t:0)+s[0],{command:"H",values:[t]};case "V":return r=(c?r:0)+s[0],{command:"V",values:[r]};case "A":return t=(c?t:0)+s[5],r=(c?r:0)+s[6],{command:"A",values:[...s.slice(0,5),t,r]};default:{let u=s.map((l,f)=>c?l+(f%2===0?t:r):l);return t=u.at(-2),r=u.at(-1),a==="M"&&(n=t,o=r),{command:a,values:u}}}})}function D6(e,t){let r=qo(e);return r?td(F6(r).map(({command:n,values:o})=>n==="V"?{command:n,values:[t(o[0])]}:n==="H"||n==="Z"?{command:n,values:o}:n==="A"?{command:n,values:[...o.slice(0,6),t(o[6])]}:{command:n,values:o.map((i,s)=>s%2===1?t(i):i)})):e}function Z6(e,t){let r=(n,o)=>{let i=t(n);return {y:i,height:t(n+o)-i}};switch(e.type){case "rect":return {...e,...r(e.y,e.height),...e.hole&&{hole:{...e.hole,...r(e.hole.y,e.hole.height)}}};case "circle":case "ellipse":return {...e,cy:t(e.cy)};case "polygon":return {...e,points:e.points.map(([n,o])=>[n,t(o)])};case "path":return {...e,d:D6(e.d,t)};case "line":return {...e,y1:t(e.y1),y2:t(e.y2)};default:return {...e,y:t(e.y)}}}function B6(e,t){if(t.length===0)return e;let r=o=>{let i=o;for(let s of t)i-=Math.min(Math.max(o-s.y,0),s.height);return i},n=(o,i)=>t.some(s=>o>=s.y-1e-6&&i<=s.y+s.height+1e-6);return {...e,artboard:{...e.artboard,height:r(e.artboard.height)},qr:{...e.qr,y:r(e.qr.y)},shapes:e.shapes.filter(o=>{let{bounds:i}=md(o);return !(i&&n(i.y0,i.y1))}).map(o=>Z6(o,r)),labels:e.labels.map(o=>{if(o.type==="curved")return {...o,curve:{...o.curve,cy:r(o.curve.cy)}};let i=r(o.box.y);return {...o,box:{...o.box,y:i,height:r(o.box.y+o.box.height)-i}}})}}function si(e,t,r,n,o={}){let i=new Map(t.labels.map(g=>[g.id,L6(g,r)])),s=B6(t,t.labels.flatMap(g=>g.collapse&&!i.get(g.id)?[g.collapse]:[])),a=e/s.qr.size,c=k6(s,n),u=A6(r,s,c.color),l=s.shapes.flatMap(g=>N6(g,a,u));if(c.plate){let g=za(s)*a;l.push({type:"rect",x:s.qr.x*a-g,y:s.qr.y*a-g,width:e+2*g,height:e+2*g,radius:(s.qr.radius??0)*a,fill:c.color});}let f=T6(r.fontScale),p=s.labels.flatMap(g=>{let y=i.get(g.id);if(!y)return [];let _=(g.slot==="fixed"?void 0:o[g.slot])??g.id;return O6(g,y,f,a,u,_)}),m=p[0],h=m&&m.rotate===void 0?m:null,d=s.bleed??"none";return {width:s.artboard.width*a,height:s.artboard.height*a,qrX:s.qr.x*a,qrY:s.qr.y*a,qrSize:e,shapes:l,label:h,extraLabels:h?p.slice(1):p,squareEdges:d!=="none",color:u(d==="none"?"frame":d)}}function O_(e,t,r){return si(e,ii(t.spec),t,r)}var F_={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 Nd={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 D_={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 Z_={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 B_={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 U_={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 G_={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 Q_={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 V_={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 ja={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 j_={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 q_={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 W_={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 H_={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 K_={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 J_={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 X_={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 Y_={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 e2={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 $e=(e,t,r,n,o)=>({style:e,name:t,tags:o,labelOn:n,spec:r}),t2=[$e("banner-bottom","Banner",Nd,"frame",["bottom","band"]),$e("banner-top","Top banner",D_,"frame",["top","band"]),$e("banner-top-bottom","Two banners",Z_,"frame",["top","bottom","band"]),$e("border","Border",B_,"background",["square","outline"]),$e("rounded-border","Rounded",H_,"background",["border","outline"]),$e("gradient-border","Gradient",ja,"background",["border","colorful"]),$e("focus","Focus",V_,"background",["corners","brackets"]),$e("speech-bubble","Bubble",K_,"frame",["speech"]),$e("speech-bubble-top","Bubble top",J_,"frame",["speech"]),$e("chat-bubble","Chat",U_,"frame",["message","bubble"]),$e("circle","Circle",G_,"frame",["round","ring","curved"]),$e("badge","Ribbon",F_,"frame",["badge","banner"]),$e("sticker","Sticker",X_,"frame",["label"]),$e("polaroid","Polaroid",W_,"frame",["photo","picture"]),$e("phone","Phone",q_,"background",["mobile","screen"]),$e("ticket","Ticket",e2,"frame",["event","pass"]),$e("tag","Tag",Y_,"frame",["price","label"]),$e("envelope","Envelope",Q_,"frame",["mail","letter"]),$e("menu-card","Menu card",j_,"background",["menu","restaurant"])],aw=new Map(t2.map(e=>[e.style,e]));function cw(e){return aw.get(e)}Object.fromEntries(t2.map(e=>[e.style,e.spec]));({from:ja.colors.frame,to:ja.colors.accent});var uw={primary:"text",secondary:"secondaryText"};function r2(e,t,r){let n=cw(t.style)?.spec??Nd;return si(e,ii(n),t,r,uw)}var Ld="system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif";var lw="data-qrdx-frame-label";function jt(e){return !!(e?.style&&e.style!=="none")}function Dn(e,t,r){return t.style===ud?O_(e,t,r):r2(e,t,r)}function ai(e,t){if(!jt(t))return {width:e,height:e};let{width:r,height:n}=Dn(e,t);return {width:r,height:n}}var ae=e=>re(e,2);function n2({x:e,y:t,width:r,height:n,radius:o}){let i=ae(Math.min(o,r/2,n/2)),[s,a,c,u]=[ae(e),ae(t),ae(r),ae(n)];return i<=0?R`M${s} ${a}h${c}v${u}h${-c}z`:R`M${s+i} ${a}h${ae(c-2*i)}a${i} ${i} 0 0 1 ${i} ${i}`+R`v${ae(u-2*i)}a${i} ${i} 0 0 1 ${-i} ${i}`+R`h${ae(-(c-2*i))}a${i} ${i} 0 0 1 ${-i} ${-i}`+R`v${ae(-(u-2*i))}a${i} ${i} 0 0 1 ${i} ${-i}z`}function qa(e){return e.stroke&&e.strokeWidth?{stroke:e.stroke,strokeWidth:ae(e.strokeWidth)}:{}}function o2(e,t){return e.type==="rect"&&e.hole?M("path",{d:n2(e)+n2(e.hole),fill:e.fill,fillRule:"evenodd",...qa(e)},t):e.type==="polygon"?M("polygon",{fill:e.fill,points:e.points.map(([r,n])=>`${ae(r)},${ae(n)}`).join(" "),...qa(e)},t):e.type==="path"?M("path",{d:e.d,fill:e.fill,...e.fillRule==="evenodd"&&{fillRule:"evenodd"},...qa(e)},t):$d("rect",{...qa(e),fill:e.fill,height:ae(e.height),key:t,width:ae(e.width),x:ae(e.x),y:ae(e.y),...e.radius>0&&{rx:ae(e.radius),ry:ae(e.radius)}})}function i2(e){return e.shapes.map((t,r)=>o2(t,r))}function s2(e,t){let{size:r,frame:n,bgColor:o,svgProps:i,markLabels:s}=t,a=Dn(r,n,o),c=fw(a),u=ae(a.width),l=ae(a.height);return Ie("svg",{height:l,viewBox:`0 0 ${u} ${l}`,width:u,xmlns:"http://www.w3.org/2000/svg",...i,children:[M("g",{"data-qrdx-frame":n.style,children:a.shapes.map((f,p)=>o2(f,p))}),zn(e,{x:ae(a.qrX),y:ae(a.qrY),width:r,height:r}),c.map((f,p)=>M("text",{"data-max-width":ae(f.maxWidth),fill:f.color,fontFamily:Ld,fontSize:ae(f.fontSize),fontWeight:f.fontWeight??700,textAnchor:f.align??"middle",x:ae(f.x),y:ae(f.y),...f.rotate&&{transform:`rotate(${ae(f.rotate)} ${ae(f.x)} ${ae(f.y)})`},...s&&f.field&&{[lw]:f.field},children:f.text},p))]})}function fw(e){return [...e.label?[e.label]:[],...e.extraLabels??[]]}var pw={2:6,3:12};function a2(e){let t=[e.start],r=e.start;for(let n of e.segments){let o=n.at(-1);if(n.length===1)t.push(o);else {let i=pw[n.length];for(let s=1;s<=i;s++){let a=s/i,c=1-a;if(n.length===2){let[u]=n;t.push([c*c*r[0]+2*c*a*u[0]+a*a*o[0],c*c*r[1]+2*c*a*u[1]+a*a*o[1]]);}else {let[u,l]=n;t.push([c*c*c*r[0]+3*c*c*a*u[0]+3*c*a*a*l[0]+a*a*a*o[0],c*c*c*r[1]+3*c*c*a*u[1]+3*c*a*a*l[1]+a*a*a*o[1]]);}}}r=o;}return t}function u2(e,t){let r=[];for(let n of e)for(let o=0;o<n.length;o++){let[i,s]=n[o],[a,c]=n[(o+1)%n.length];s<=t!=c<=t&&r.push(i+(t-s)/(c-s)*(a-i));}return r.sort((n,o)=>n-o)}function l2(e,t){let r=0;for(let n of e)if(n<t)r++;else break;return r%2===1}function mw(e,t,r){return l2(u2(e,r),t)}function f2(e){let t=new Map;return (r,n)=>{let o=t.get(n);return o||(o=u2(e,n),t.set(n,o)),l2(o,r)}}function dw(e,t,r,n){let o=r[0]-e,i=r[1]-t,s=n[0]-r[0],a=n[1]-r[1],c=l=>Math.max(Math.abs(o+l*s),Math.abs(i+l*a)),u=Math.min(c(0),c(1));for(let[l,f]of [[i-o,s-a],[-(o+i),s+a]])if(f!==0){let p=l/f;p>0&&p<1&&(u=Math.min(u,c(p)));}return u}function hw(e,t,r){if(!mw(e,t,r))return 0;let n=Number.POSITIVE_INFINITY;for(let o of e)for(let i=0;i<o.length;i++)n=Math.min(n,dw(t,r,o[i],o[(i+1)%o.length]));return Number.isFinite(n)?n:0}function gw(e){let t=Number.POSITIVE_INFINITY,r=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY,o=Number.NEGATIVE_INFINITY;for(let i of e)for(let[s,a]of i)t=Math.min(t,s),r=Math.min(r,a),n=Math.max(n,s),o=Math.max(o,a);return {x0:t,y0:r,x1:n,y1:o}}function p2(e){let t=e.map(a2),r=gw(t),n=r.x1-r.x0,o=r.y1-r.y0;if(!(n>0&&o>0))return null;let i=(h,d)=>{let g=Math.max(h-r.x0,r.x1-h,d-r.y0,r.y1-d);return g>0?hw(t,h,d)/(2*g):0},s={cx:r.x0+n/2,cy:r.y0+o/2,value:0};s.value=i(s.cx,s.cy);let a=32;for(let h=1;h<a;h++)for(let d=1;d<a;d++){let g=r.x0+n*d/a,y=r.y0+o*h/a,_=i(g,y);_>s.value&&(s={cx:g,cy:y,value:_});}let c=n/a,u=o/a;for(let h=0;h<6;h++){let d=s;for(let g=-2;g<=2;g++)for(let y=-2;y<=2;y++){let _=d.cx+c*y/2,b=d.cy+u*g/2,S=i(_,b);S>s.value&&(s={cx:_,cy:b,value:S});}c/=2,u/=2;}if(s.value<=0)return null;let f=.5/Math.max(s.cx-r.x0,r.x1-s.cx,s.cy-r.y0,r.y1-s.cy),p=([h,d])=>[.5+(h-s.cx)*f,.5+(d-s.cy)*f],m=e.map(h=>({start:p(h.start),segments:h.segments.map(d=>d.map(p))}));return {rings:m,polygons:m.map(a2),half:s.value}}function m2(e,t){let r=([o,i])=>`${$(o*t)} ${$(i*t)}`,n="";for(let o of e.rings){n+=`M${r(o.start)}`;for(let i of o.segments){let s=i.length===1?"L":i.length===2?"Q":"C";n+=s+i.map(r).join(" ");}n+="Z";}return n}var _w={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]]]},c2;function d2(){return c2??=p2([_w]),c2}function yw(e){let{width:t,height:r,cells:n}=e;return Number.isInteger(t)&&Number.isInteger(r)&&t>=Xo&&r>=Xo&&t<=br&&r<=br&&typeof n=="string"&&n.length===t*r&&/^[01]*$/.test(n)?(o,i)=>o>=0&&i>=0&&o<t&&i<r&&n[i*t+o]==="1":null}var St=([e,t])=>`${e},${t}`;function bw(e,t,r){let n=(c,u)=>e(c-1,u-1),o=new Map,i=(c,u)=>{for(let[l,f]of [[c,u],[u,c]]){let p=o.get(St(l))??[];p.push(f),o.set(St(l),p);}};for(let c=0;c<=r;c++)for(let u=0;u<=t;u++){let l=n(u,c),f=n(u+1,c),p=n(u+1,c+1),m=n(u,c+1),h=[u,c-.5],d=[u+.5,c],g=[u,c+.5],y=[u-.5,c];switch((l?8:0)+(f?4:0)+(p?2:0)+(m?1:0)){case 1:case 14:i(y,g);break;case 2:case 13:i(g,d);break;case 3:case 12:i(y,d);break;case 4:case 11:i(h,d);break;case 6:case 9:i(h,g);break;case 7:case 8:i(y,h);break;case 5:i(h,d),i(y,g);break;case 10:i(y,h),i(g,d);break;}}let s=[],a=new Set;for(let[c,u]of o){if(a.has(c)||u.length===0)continue;let[l,f]=c.split(",").map(Number),p=[[l,f]];a.add(c);let m=[l,f],h=u[0];for(;!a.has(St(h));){a.add(St(h)),p.push(h);let d=$w(o.get(St(h))??[],m,a);if(!d)break;m=h,h=d;}p.length>=3&&s.push(xw(p));}return s}function $w(e,t,r){let n=St(t);return e.find(o=>St(o)!==n&&!r.has(St(o)))??e.find(o=>St(o)!==n)}function xw(e){let t=[];for(let r=0;r<e.length;r++){let n=e[(r-1+e.length)%e.length],o=e[r],i=e[(r+1)%e.length],s=(o[0]-n[0])*(i[1]-o[1])-(o[1]-n[1])*(i[0]-o[0]);Math.abs(s)>1e-9&&t.push(o);}return t.length>=3?t:e}function ww(e){let t=(i,s)=>[(i[0]+s[0])/2,(i[1]+s[1])/2],r=e.length,n=t(e[r-1],e[0]),o=e.map((i,s)=>[i,t(i,e[(s+1)%r])]);return {start:n,segments:o}}var ci=new Map;function h2(e){let t=`${e.width}x${e.height}:${e.cells}`,r=ci.get(t);if(r)return r;let n=yw(e),o;if(!n)o={outline:null,problem:"invalid"};else if(e.cells.includes("1")){let i=bw(n,e.width,e.height),s=i.length>0?p2(i.map(ww)):null;o=s&&2*s.half>=Vg?{outline:s,problem:null}:{outline:null,problem:s?"thin":"empty"};}else o={outline:null,problem:"empty"};return ci.size>16&&ci.delete(ci.keys().next().value),ci.set(t,o),o}var Sw=1,g2=.5,_2=.5,vw=.5;function Wa(e){return Math.max(e,Qg)}function Td(e){return e==="heart"?d2():typeof e=="object"&&e?.type==="silhouette"?h2(e).outline:null}function vt(e,t,r){if(r==="circle"){let s=Wa(t),a=(e/2+s)*Math.SQRT2+Sw;return Math.ceil(a-e/2)}let n=Td(r);if(!n)return t;let o=Wa(t),i=(e+2*(o+vw))/(2*n.half);return Math.ceil((i-e)/2-1e-9)}function y2(e){let t=e>>>0;return ()=>{t=t+1831565813>>>0;let r=t;return r=Math.imul(r^r>>>15,r|1),r^=r+Math.imul(r^r>>>7,r|61),((r^r>>>14)>>>0)/4294967296}}function Cw(e,t,r){let n=vt(t,r,"circle"),o=Wa(r),i=t+2*n,s=i/2,a=s-g2-.5,c=y2(Number.parseInt(Cr(e),36)||1),u=n-o,l=n+t+o;return Array.from({length:i},(f,p)=>Array.from({length:i},(m,h)=>{let d=c()<_2;return h>=u&&h<l&&p>=u&&p<l?false:d&&Math.hypot(h+.5-s,p+.5-s)<=a}))}var Pw=Array.from({length:8},(e,t)=>{let r=t*Math.PI/4;return [Math.cos(r),Math.sin(r)]});function b2(e,t,r,n){if(n==="circle")return Cw(e,t,r);let o=Td(n);if(!o)return null;let i=vt(t,r,n),s=Wa(r),a=t+2*i,c=f2(o.polygons),u=.5+g2,l=(h,d)=>{let g=h+.5,y=d+.5;return c(g/a,y/a)?Pw.every(([_,b])=>c((g+_*u)/a,(y+b*u)/a)):false},f=y2(Number.parseInt(Cr(e),36)||1),p=i-s,m=i+t+s;return Array.from({length:a},(h,d)=>Array.from({length:a},(g,y)=>{let _=f()<_2;return y>=p&&y<m&&d>=p&&d<m?false:_&&l(y,d)}))}function $2(e,t){if(e==="circle")return {circle:t/2};let r=Td(e);return r?{path:m2(r,t)}:null}function kw(e){return e==="top-left"?0:e==="top-right"?1:3}function Ha(e,t,r,n="circle",o="top-left"){let i=r*2,s=r,a=i/3;switch(n){case "leaf":case "leaf-reverse":case "drop":case "drop-reverse":{let c=kw(o),u=(c+2)%4,l=1.3*a,f=.7*a,p=h=>{switch(n){case "leaf":return h===c||h===u;case "leaf-reverse":return !(h===c||h===u);case "drop":return h===c;default:return h===u}},m=[0,1,2,3].map(h=>p(h)?f:l);return M("path",{d:Z(e-r,t-r,i,i,m)})}case "extra-rounded":return M("path",{d:Z(e-r,t-r,i,i,1.15*a)});case "plus":{let c=1.15*a,u=r;return M("path",{d:ne([[e-c,t-u],[e+c,t-u],[e+c,t-c],[e+u,t-c],[e+u,t+c],[e+c,t+c],[e+c,t+u],[e-c,t+u],[e-c,t+c],[e-u,t+c],[e-u,t-c],[e-c,t-c]])})}case "cross-rounded":{let c=1.15*a,u=.5*a;return M("path",{d:Z(e-r,t-c,i,2*c,u)+Z(e-c,t-r,2*c,i,u)})}case "hexagon":return M("path",{d:ne(Ln(e,t,1.72*a,6))});case "octagon":return M("path",{d:ne(Ln(e,t,r/Math.cos(Math.PI/8),8,22.5))});case "flower":{let c=.6*a,u=.9*a;return M("path",{d:oe(e-c,t-c,u)+oe(e+c,t-c,u)+oe(e+c,t+c,u)+oe(e-c,t+c,u)+oe(e,t,1.2*a)})}case "heart":return M("path",{d:On(e,t+.12*a,3.5*a)});case "squircle":return M("path",{d:ne(ni(e,t,r,r,4,64))});case "dots":{let c=[];for(let u of [-1,0,1])for(let l of [-1,0,1])c.push(oe(e+l*a*.82,t+u*a*.82,.58*a));return M("path",{d:c.join("")})}case "square":return M("rect",{height:$(i),transform:R`rotate(0,${e},${t})`,width:$(i),x:$(e-s),y:$(t-s)});case "rounded":return M("rect",{height:$(i),rx:$(r*.5),ry:$(r*.5),transform:R`rotate(0,${e},${t})`,width:$(i),x:$(e-s),y:$(t-s)});case "diamond":return M("path",{d:R`M ${e-s*.714286} ${t-s*.714286}v ${i*.714286}h ${i*.714286}v -${i*.714286}z`,transform:R`rotate(45,${e},${t})`});case "message":{let c=i/30,u=p=>(p-40)*c+e,l=p=>(p-40)*c+t,f=R`M ${u(25)} ${l(35.714285714285715)}v ${8.571428571428571*c}a ${10.714285714285714*c} ${10.714285714285714*c}, 0, 0, 0, ${10.714285714285714*c} ${10.714285714285714*c}h ${19.285714285714285*c}v -${19.285714285714285*c}a ${10.714285714285714*c} ${10.714285714285714*c}, 0, 0, 0, -${10.714285714285714*c} -${10.714285714285714*c}h -${8.571428571428571*c}a ${10.714285714285714*c} ${10.714285714285714*c}, 0, 0, 0, -${10.714285714285714*c} ${10.714285714285714*c}`;return M("path",{clipRule:"evenodd",d:f,transform:R`rotate(0,${e},${t})`})}case "message-reverse":{let c=i/30,u=p=>(p-40)*c+e,l=p=>(p-40)*c+t,f=R`M ${u(25)} ${l(35.714285714285715)}v ${8.571428571428571*c}a ${10.714285714285714*c} ${10.714285714285714*c}, 0, 0, 0, ${10.714285714285714*c} ${10.714285714285714*c}h ${19.285714285714285*c}v -${19.285714285714285*c}a ${10.714285714285714*c} ${10.714285714285714*c}, 0, 0, 0, -${10.714285714285714*c} -${10.714285714285714*c}h -${8.571428571428571*c}a ${10.714285714285714*c} ${10.714285714285714*c}, 0, 0, 0, -${10.714285714285714*c} ${10.714285714285714*c}`;return M("path",{clipRule:"evenodd",d:f,transform:R`rotate(-180,${e},${t})`})}case "diya":{let c=i/30,u=p=>(p-40)*c+e,l=p=>(p-40)*c+t,f=R`M ${u(25)} ${l(35.714285714285715)}v ${8.571428571428571*c}a ${10.714285714285714*c} ${10.714285714285714*c}, 0, 0, 0, ${10.714285714285714*c} ${10.714285714285714*c}h ${19.285714285714285*c}v -${19.285714285714285*c}a ${10.714285714285714*c} ${10.714285714285714*c}, 0, 0, 0, -${10.714285714285714*c} -${10.714285714285714*c}h -${8.571428571428571*c}H ${u(25)}z`;return M("path",{clipRule:"evenodd",d:f,transform:R`rotate(0,${e},${t})`})}case "diya-reverse":{let c=i/30,u=p=>(p-40)*c+e,l=p=>(p-40)*c+t,f=R`M ${u(25)} ${l(35.714285714285715)}v ${19.285714285714285*c}h ${19.285714285714285*c}a ${10.714285714285714*c} ${10.714285714285714*c}, 0, 0, 0, ${10.714285714285714*c} -${10.714285714285714*c}v -${19.285714285714285*c}h -${19.285714285714285*c}a ${10.714285714285714*c} ${10.714285714285714*c}, 0, 0, 0, -${10.714285714285714*c} ${10.714285714285714*c}z`;return M("path",{clipRule:"evenodd",d:f,transform:R`rotate(0,${e},${t})`})}case "rounded-triangle":{let c=i/21,u=p=>(p-40)*c+e,l=p=>(p-40)*c+t,f=R`M ${u(33.57142857142857)} ${l(29.285714285714285)}h ${12.857142857142856*c}c ${4.285714285714286*c} 0 ${4.285714285714286*c} ${4.285714285714286*c} ${4.285714285714286*c} ${4.285714285714286*c}v ${12.857142857142856*c}c 0 ${4.285714285714286*c} -${4.285714285714286*c} ${4.285714285714286*c} -${4.285714285714286*c} ${4.285714285714286*c}h -${12.857142857142856*c}c -${4.285714285714286*c} 0 -${4.285714285714286*c} -${4.285714285714286*c} -${4.285714285714286*c} -${4.285714285714286*c}v -${12.857142857142856*c}c 0 -${4.285714285714286*c} ${4.285714285714286*c} -${4.285714285714286*c} ${4.285714285714286*c} -${4.285714285714286*c}z`;return M("path",{d:f,transform:R`rotate(45,${e},${t})`})}case "star":{let c=i/27,u=p=>(p-40)*c+e,l=p=>(p-40)*c+t,f=R`M ${u(38.84615384615385)},${l(26.546153846153846)}c${.6692307692307691*c},-${1.0153846153846153*c},${2.215384615384615*c},-${1.0153846153846153*c},${2.884615384615384*c},0l${4.038461538461538*c},${6.069230769230768*c}c${.23076923076923075*c},${.3461538461538461*c},${.6*c},${.6*c},${1.0153846153846153*c},${.7153846153846153*c}l${7.223076923076922*c},${1.823076923076923*c}c${1.2*c},${.3*c},${1.6846153846153844*c},${1.7076923076923076*c},${.8999999999999999*c},${2.6538461538461533*c}l-${4.73076923076923*c},${5.584615384615384*c}c-${.2769230769230769*c},${.3230769230769231*c},-${.41538461538461535*c},${.7384615384615384*c},-${.3923076923076923*c},${1.1307692307692307*c}l${.4384615384615384*c},${7.199999999999999*c}c${.06923076923076922*c},${1.2*c},-${1.1769230769230767*c},${2.0769230769230766*c},-${2.3307692307692305*c},${1.6384615384615382*c}l-${6.9692307692307685*c},-${2.6076923076923073*c}c-${.3923076923076923*c},-${.16153846153846155*c},-${.8538461538461538*c},-${.16153846153846155*c},-${1.2461538461538462*c},0l-${6.9692307692307685*c},${2.6076923076923073*c}c-${1.1538461538461537*c},${.4384615384615384*c},-${2.4*c},-${.4384615384615384*c},-${2.3307692307692305*c},-${1.6384615384615382*c}l${.4384615384615384*c},-${7.199999999999999*c}c${.023076923076923075*c},-${.41538461538461535*c},-${.11538461538461538*c},-${.8307692307692307*c},-${.3923076923076923*c},-${1.1307692307692307*c}l-${4.73076923076923*c},-${5.584615384615384*c}c-${.7846153846153846*c},-${.923076923076923*c},-${.3230769230769231*c},-${2.3307692307692305*c},${.8999999999999999*c},-${2.6538461538461533*c}l${7.223076923076922*c},-${1.823076923076923*c}c${.41538461538461535*c},-${.11538461538461538*c},${.7846153846153846*c},-${.3461538461538461*c},${1.0153846153846153*c},-${.7153846153846153*c}l${4.038461538461538*c},-${6.069230769230768*c}z`;return M("path",{clipRule:"evenodd",d:f,transform:R`rotate(0,${e},${t})`})}case "banner":{let c=i/28;return M("g",{transform:R`translate(${e-40*c},${t-40*c}) scale(${$(c,6)})`,children:M("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 M("circle",{cx:$(e),cy:$(t),r:$(r),transform:R`rotate(0,${e},${t})`})}}function Zn(e,t,r,n){let o=e==="top-left"?0:e==="top-right"?1:3,i=(o+2)%4;return [0,1,2,3].map(s=>s===o||n&&s===i?r:t)}function x2(e,t,r,n){return [[e+n,t],[e+r-n,t],[e+r,t+n],[e+r,t+r-n],[e+r-n,t+r],[e+n,t+r],[e,t+r-n],[e,t+n]]}function w2(e,t,r,n){let o=r/7,i=Math.max(0,(n+Math.SQRT2-2)*o);return ne(x2(e,t,r,n*o))+ne(x2(e+o,t+o,5*o,i))}function S2(e,t,r,n,o=false){let i=r/7,s=a=>o?Zn(n,0,a,true):Zn(n,a,0,true);return Z(e,t,r,r,s(2.5*i))+Z(e+i,t+i,5*i,5*i,s(1.5*i))}function Aw(e,t,r,n){let o=r/7;return Z(e,t,r,r,Zn(n,2.6*o,0,false))+Z(e+o,t+o,5*o,5*o,Zn(n,1.6*o,0,false))}function Ew(e,t,r){let n=r/7,o=e+r/2,i=t+r/2;return ne(ni(o,i,3.5*n,3.5*n,4,96))+ne(ni(o,i,2.5*n,2.5*n,4,96))}function v2(e,t,r,n,o){let i=n,s=r/2,a=(s-i)*.55,c=(u,l)=>R`${e+u} ${t+l}`;return R`M${c(i,0)}`+R`C${c(i+a,0)} ${c(s-a,o)} ${c(s,o)}`+R`C${c(s+a,o)} ${c(r-i-a,0)} ${c(r-i,0)}`+R`A${i} ${i} 0 0 1 ${c(r,i)}`+R`C${c(r,i+a)} ${c(r-o,s-a)} ${c(r-o,s)}`+R`C${c(r-o,s+a)} ${c(r,r-i-a)} ${c(r,r-i)}`+R`A${i} ${i} 0 0 1 ${c(r-i,r)}`+R`C${c(r-i-a,r)} ${c(s+a,r-o)} ${c(s,r-o)}`+R`C${c(s-a,r-o)} ${c(i+a,r)} ${c(i,r)}`+R`A${i} ${i} 0 0 1 ${c(0,r-i)}`+R`C${c(0,r-i-a)} ${c(o,s+a)} ${c(o,s)}`+R`C${c(o,s-a)} ${c(0,i+a)} ${c(0,i)}`+R`A${i} ${i} 0 0 1 ${c(i,0)}Z`}function Rw(e,t,r){let n=r/7,o=.12*n;return v2(e,t,r,1.4*n,o)+v2(e+n,t+n,5*n,.7*n,o)}function C2(e,t,r,n,o,i){let s=r/2,a=(c,u)=>R`${e+c} ${t+u}`;return R`M${a(n,0)}H${e+r-n}`+R`A${n} ${n} 0 0 1 ${a(r,n)}`+R`V${t+o}`+R`C${a(r,o+1.55*i)} ${a(s+1.6*i,r)} ${a(s,r)}`+R`C${a(s-1.6*i,r)} ${a(0,o+1.55*i)} ${a(0,o)}`+R`V${t+n}A${n} ${n} 0 0 1 ${a(n,0)}Z`}function Mw(e,t,r){let n=r/7;return C2(e,t,r,.7*n,3.9*n,n)+C2(e+n,t+n,5*n,.35*n,2.7*n,.8*n)}function Iw(e,t,r,n){let o=r/7;return Z(e,t,r,r,Zn(n,.5*o,2.5*o,false))+Z(e+o,t+o,5*o,5*o,Zn(n,.25*o,1.5*o,false))}function zw(e,t,r){let n=r/7;return R`M ${e} ${t}v ${r}h ${r}v -${r}z`+R`M ${e+n} ${t+n}h ${5*n}v ${5*n}h -${5*n}z`}function Nw(e,t,r){let n=r/7,o=n*.875,i=n*.4375,s=R`M ${e+o} ${t}`+R`h ${r-2*o}`+R`a ${o} ${o} 0 0 1 ${o} ${o}`+R`v ${r-2*o}`+R`a ${o} ${o} 0 0 1 ${-o} ${o}`+R`h ${-(r-2*o)}`+R`a ${o} ${o} 0 0 1 ${-o} ${-o}`+R`v ${-(r-2*o)}`+R`a ${o} ${o} 0 0 1 ${o} ${-o}z`,a=R`M ${e+n+i} ${t+n}`+R`h ${5*n-2*i}`+R`a ${i} ${i} 0 0 1 ${i} ${i}`+R`v ${5*n-2*i}`+R`a ${i} ${i} 0 0 1 ${-i} ${i}`+R`h ${-(5*n-2*i)}`+R`a ${i} ${i} 0 0 1 ${-i} ${-i}`+R`v ${-(5*n-2*i)}`+R`a ${i} ${i} 0 0 1 ${i} ${-i}z`;return s+a}function Lw(e,t,r){let n=e+r/2,o=t+r/2,i=re(r/2),s=re(r*(2.5/7));return R`M ${n-i} ${o}`+R`a ${i} ${i} 0 1 0 ${i*2} 0`+R`a ${i} ${i} 0 1 0 ${-i*2} 0z`+R`M ${n-s} ${o}`+R`a ${s} ${s} 0 1 1 ${s*2} 0`+R`a ${s} ${s} 0 1 1 ${-s*2} 0z`}function Tw(e,t,r){let n=r/74.7002,o=a=>a*n+e,i=a=>a*n+t;return R`M${o(37.3496)} ${i(0)}C${o(39.2939)} ${i(0)} ${o(40.9948)} ${i(1.03842)} ${o(41.9287)} ${i(2.59082)}C${o(43.2293)} ${i(1.34013)} ${o(45.1347)} ${i(.780267)} ${o(47.0098)} ${i(1.28027)}C${o(48.8871)} ${i(1.78928)} ${o(50.261)} ${i(3.23767)} ${o(50.7578)} ${i(4.98438)}C${o(52.3454)} ${i(4.0996)} ${o(54.3432)} ${i(4.047)} ${o(56.0303)} ${i(5.01953)}C${o(57.7094)} ${i(5.98752)} ${o(58.6586)} ${i(7.73647)} ${o(58.6924)} ${i(9.5459)}C${o(60.4517)} ${i(9.10661)} ${o(62.3883)} ${i(9.57215)} ${o(63.7598)} ${i(10.9502)}C${o(65.1282)} ${i(12.3253)} ${o(65.5963)} ${i(14.2585)} ${o(65.1641)} ${i(16.0127)}C${o(66.974)} ${i(16.044)} ${o(68.7242)} ${i(16.9982)} ${o(69.7002)} ${i(18.6797)}C${o(70.6781)} ${i(20.3647)} ${o(70.6241)} ${i(22.3635)} ${o(69.7402)} ${i(23.9502)}C${o(71.4776)} ${i(24.4496)} ${o(72.9194)} ${i(25.8232)} ${o(73.4199)} ${i(27.7002)}C${o(73.927)} ${i(29.5707)} ${o(73.3661)} ${i(31.4794)} ${o(72.1104)} ${i(32.7822)}C${o(73.6621)} ${i(33.7163)} ${o(74.7002)} ${i(35.4166)} ${o(74.7002)} ${i(37.3604)}C${o(74.7001)} ${i(39.307)} ${o(73.6582)} ${i(41.0084)} ${o(72.1025)} ${i(41.9414)}C${o(73.357)} ${i(43.245)} ${o(73.9207)} ${i(45.1525)} ${o(73.4199)} ${i(47.0303)}C${o(72.9187)} ${i(48.9027)} ${o(71.4782)} ${i(50.2735)} ${o(69.7383)} ${i(50.7734)}C${o(70.6201)} ${i(52.3601)} ${o(70.6716)} ${i(54.3549)} ${o(69.7002)} ${i(56.04)}C${o(68.7237)} ${i(57.7225)} ${o(66.9721)} ${i(58.6729)} ${o(65.1611)} ${i(58.7031)}C${o(65.598)} ${i(60.4623)} ${o(65.131)} ${i(62.3982)} ${o(63.7598)} ${i(63.7695)}C${o(62.3847)} ${i(65.138)} ${o(60.4515)} ${i(65.6061)} ${o(58.6973)} ${i(65.1738)}C${o(58.6635)} ${i(66.9833)} ${o(57.7094)} ${i(68.7322)} ${o(56.0303)} ${i(69.7002)}C${o(54.3461)} ${i(70.6777)} ${o(52.348)} ${i(70.6248)} ${o(50.7617)} ${i(69.7422)}C${o(50.2643)} ${i(71.4831)} ${o(48.8896)} ${i(72.9284)} ${o(47.0098)} ${i(73.4297)}C${o(45.1389)} ${i(73.9368)} ${o(43.2296)} ${i(73.3763)} ${o(41.9268)} ${i(72.1201)}C${o(40.9927)} ${i(73.6717)} ${o(39.2932)} ${i(74.71)} ${o(37.3496)} ${i(74.71)}C${o(35.4051)} ${i(74.7098)} ${o(33.7042)} ${i(73.6711)} ${o(32.7705)} ${i(72.1182)}C${o(31.4697)} ${i(73.3758)} ${o(29.5597)} ${i(73.9418)} ${o(27.6797)} ${i(73.4404)}V${i(73.4502)}C${o(25.8065)} ${i(72.9422)} ${o(24.434)} ${i(71.4985)} ${o(23.9346)} ${i(69.7568)}C${o(22.3504)} ${i(70.6301)} ${o(20.3591)} ${i(70.6781)} ${o(18.6797)} ${i(69.71)}C${o(16.9957)} ${i(68.7391)} ${o(16.045)} ${i(66.9831)} ${o(16.0166)} ${i(65.168)}C${o(14.2547)} ${i(65.6091)} ${o(12.3134)} ${i(65.1435)} ${o(10.9395)} ${i(63.7695)}C${o(9.5687)} ${i(62.3919)} ${o(9.10168)} ${i(60.454)} ${o(9.53809)} ${i(58.6973)}C${o(7.72791)} ${i(58.6641)} ${o(5.97815)} ${i(57.71)} ${o(5.00977)} ${i(56.0303)}C${o(4.03552)} ${i(54.3517)} ${o(4.08377)} ${i(52.3649)} ${o(4.95801)} ${i(50.7812)}C${o(3.21705)} ${i(50.2839)} ${o(1.77087)} ${i(48.9101)} ${o(1.26953)} ${i(47.0303)}V${i(47.0205)}C${o(.762081)} ${i(45.1489)} ${o(1.32758)} ${i(43.2375)} ${o(2.58496)} ${i(41.9346)}C${o(1.03604)} ${i(41)} ${o(108484e-9)} ${i(39.3019)} ${o(0)} ${i(37.3604)}C${o(0)} ${i(35.4159)} ${o(1.03815)} ${i(33.7141)} ${o(2.59082)} ${i(32.7803)}C${o(1.34044)} ${i(31.4797)} ${o(.780389)} ${i(29.575)} ${o(1.28027)} ${i(27.7002)}C${o(1.78258)} ${i(25.8232)} ${o(3.22806)} ${i(24.4482)} ${o(4.97363)} ${i(23.9512)}C${o(4.08938)} ${i(22.3638)} ${o(4.03743)} ${i(20.3664)} ${o(5.00977)} ${i(18.6797)}C${o(5.97815)} ${i(16.9999)} ${o(7.72788)} ${i(16.0496)} ${o(9.53809)} ${i(16.0166)}C${o(9.10139)} ${i(14.2576)} ${o(9.56846)} ${i(12.3214)} ${o(10.9395)} ${i(10.9502)}C${o(12.3171)} ${i(9.57911)} ${o(14.2558)} ${i(9.11137)} ${o(16.0127)} ${i(9.54785)}C${o(16.0426)} ${i(7.73421)} ${o(16.9969)} ${i(5.97989)} ${o(18.6797)} ${i(5.00977)}C${o(20.3596)} ${i(4.03474)} ${o(22.3521)} ${i(4.08468)} ${o(23.9365)} ${i(4.96094)}C${o(24.4378)} ${i(3.22749)} ${o(25.8059)} ${i(1.7898)} ${o(27.6797)} ${i(1.29004)}C${o(29.5511)} ${i(.78264)} ${o(31.4617)} ${i(1.34357)} ${o(32.7646)} ${i(2.60059)}C${o(33.6971)} ${i(1.04268)} ${o(35.4013)} ${i(152405e-9)} ${o(37.3496)} ${i(0)}ZM${o(41.0615)} ${i(9.17578)}C${o(40.1006)} ${i(10.1057)} ${o(38.793)} ${i(10.6797)} ${o(37.3496)} ${i(10.6797)}C${o(35.9064)} ${i(10.6796)} ${o(34.5985)} ${i(10.1066)} ${o(33.6377)} ${i(9.17676)}C${o(32.9511)} ${i(10.3241)} ${o(31.8358)} ${i(11.2176)} ${o(30.4404)} ${i(11.5898)}C${o(29.0527)} ${i(11.9661)} ${o(27.6436)} ${i(11.7542)} ${o(26.4766)} ${i(11.1074)}C${o(26.1072)} ${i(12.3879)} ${o(25.2629)} ${i(13.5333)} ${o(24.0195)} ${i(14.25)}C${o(22.7695)} ${i(14.9754)} ${o(21.347)} ${i(15.1322)} ${o(20.0479)} ${i(14.8047)}C${o(20.0289)} ${i(16.1454)} ${o(19.5108)} ${i(17.4793)} ${o(18.4902)} ${i(18.5)}C${o(17.4696)} ${i(19.5158)} ${o(16.1409)} ${i(20.033)} ${o(14.8066)} ${i(20.0566)}C${o(15.1312)} ${i(21.3534)} ${o(14.9738)} ${i(22.7723)} ${o(14.25)} ${i(24.0195)}C${o(13.5243)} ${i(25.2699)} ${o(12.3701)} ${i(26.1148)} ${o(11.082)} ${i(26.4795)}C${o(11.7347)} ${i(27.6479)} ${o(11.9529)} ${i(29.062)} ${o(11.5801)} ${i(30.46)}C${o(11.2085)} ${i(31.8485)} ${o(10.3194)} ${i(32.9607)} ${o(9.17578)} ${i(33.6475)}C${o(10.106)} ${i(34.6084)} ${o(10.6797)} ${i(35.9167)} ${o(10.6797)} ${i(37.3604)}C${o(10.6796)} ${i(38.805)} ${o(10.1053)} ${i(40.1141)} ${o(9.17383)} ${i(41.0752)}C${o(10.3132)} ${i(41.7614)} ${o(11.1999)} ${i(42.871)} ${o(11.5703)} ${i(44.2598)}C${o(11.946)} ${i(45.6504)} ${o(11.7335)} ${i(47.0592)} ${o(11.0889)} ${i(48.2266)}C${o(12.377)} ${i(48.593)} ${o(13.5297)} ${i(49.441)} ${o(14.25)} ${i(50.6904)}C${o(14.9754)} ${i(51.9405)} ${o(15.1322)} ${i(53.3629)} ${o(14.8047)} ${i(54.6621)}C${o(16.142)} ${i(54.6835)} ${o(17.4721)} ${i(55.2016)} ${o(18.4902)} ${i(56.2197)}C${o(19.5097)} ${i(57.2441)} ${o(20.0278)} ${i(58.5787)} ${o(20.0479)} ${i(59.918)}C${o(21.3469)} ${i(59.5917)} ${o(22.7696)} ${i(59.7493)} ${o(24.0195)} ${i(60.4697)}C${o(25.2676)} ${i(61.1892)} ${o(26.1117)} ${i(62.3406)} ${o(26.4775)} ${i(63.627)}C${o(27.6424)} ${i(62.9822)} ${o(29.0498)} ${i(62.7688)} ${o(30.4404)} ${i(63.1396)}C${o(31.8284)} ${i(63.5112)} ${o(32.9402)} ${i(64.3999)} ${o(33.627)} ${i(65.543)}C${o(34.5887)} ${i(64.6072)} ${o(35.9012)} ${i(64.0304)} ${o(37.3496)} ${i(64.0303)}C${o(38.7912)} ${i(64.0303)} ${o(40.098)} ${i(64.6023)} ${o(41.0586)} ${i(65.5303)}C${o(41.7458)} ${i(64.3887)} ${o(42.8594)} ${i(63.5007)} ${o(44.25)} ${i(63.1299)}C${o(45.643)} ${i(62.7522)} ${o(47.057)} ${i(62.9676)} ${o(48.2266)} ${i(63.6201)}C${o(48.5931)} ${i(62.3323)} ${o(49.4413)} ${i(61.1801)} ${o(50.6904)} ${i(60.46)}C${o(51.9373)} ${i(59.7364)} ${o(53.3558)} ${i(59.5781)} ${o(54.6523)} ${i(59.9023)}C${o(54.6744)} ${i(58.5659)} ${o(55.1925)} ${i(57.2372)} ${o(56.21)} ${i(56.2197)}C${o(57.2339)} ${i(55.2007)} ${o(58.5676)} ${i(54.6816)} ${o(59.9062)} ${i(54.6611)}C${o(59.5835)} ${i(53.3649)} ${o(59.7414)} ${i(51.9468)} ${o(60.46)} ${i(50.7002)}C${o(61.1797)} ${i(49.4517)} ${o(62.3312)} ${i(48.6068)} ${o(63.6182)} ${i(48.2412)}C${o(62.9651)} ${i(47.0726)} ${o(62.7473)} ${i(45.658)} ${o(63.1201)} ${i(44.2598)}C${o(63.4916)} ${i(42.8718)} ${o(64.3794)} ${i(41.7591)} ${o(65.5225)} ${i(41.0723)}C${o(64.5929)} ${i(40.1115)} ${o(64.0206)} ${i(38.8033)} ${o(64.0205)} ${i(37.3604)}C${o(64.0205)} ${i(35.9186)} ${o(64.5915)} ${i(34.611)} ${o(65.5195)} ${i(33.6504)}C${o(64.3785)} ${i(32.9631)} ${o(63.4908)} ${i(31.8501)} ${o(63.1201)} ${i(30.46)}C${o(62.7421)} ${i(29.0656)} ${o(62.9572)} ${i(27.6498)} ${o(63.6113)} ${i(26.4795)}C${o(62.3272)} ${i(26.1115)} ${o(61.1784)} ${i(25.2657)} ${o(60.46)} ${i(24.0195)}C${o(59.7364)} ${i(22.7727)} ${o(59.5781)} ${i(21.3541)} ${o(59.9023)} ${i(20.0576)}C${o(58.5626)} ${i(20.038)} ${o(57.23)} ${i(19.52)} ${o(56.21)} ${i(18.5)}C${o(55.1931)} ${i(17.4783)} ${o(54.675)} ${i(16.1482)} ${o(54.6523)} ${i(14.8125)}C${o(53.3557)} ${i(15.1357)} ${o(51.9374)} ${i(14.9785)} ${o(50.6904)} ${i(14.2598)}C${o(49.4399)} ${i(13.5339)} ${o(48.5931)} ${i(12.3801)} ${o(48.2285)} ${i(11.0918)}C${o(47.0603)} ${i(11.7439)} ${o(45.6474)} ${i(11.9624)} ${o(44.25)} ${i(11.5898)}V${i(11.5801)}C${o(42.8613)} ${i(11.2085)} ${o(41.7483)} ${i(10.3196)} ${o(41.0615)} ${i(9.17578)}Z`}function Od(e){let t=e/70;return {scale:t,transform:(n,o)=>(n-5)*t+o}}function Ow(e,t,r){let{scale:n,transform:o}=Od(r);return R`M ${o(5,e)} ${o(30,t)}v ${20*n}a ${25*n} ${25*n}, 0, 0, 0, ${25*n} ${25*n}h ${45*n}v -${45*n}a ${25*n} ${25*n}, 0, 0, 0, -${25*n} -${25*n}h -${20*n}H ${o(5,e)}zM ${o(30,e)} ${o(15,t)}h ${20*n}a ${15*n} ${15*n}, 0, 0, 1, ${15*n} ${15*n}v ${35*n}h -${35*n}a ${15*n} ${15*n}, 0, 0, 1, -${15*n} -${15*n}v -${35*n}z`}function Fw(e,t,r){let n=r/7,o=n*1.5,i=n*.75,s=R`M ${e+o} ${t}`+R`h ${r-2*o}`+R`a ${o} ${o} 0 0 1 ${o} ${o}`+R`v ${r-2*o}`+R`a ${o} ${o} 0 0 1 ${-o} ${o}`+R`h ${-(r-2*o)}`+R`a ${o} ${o} 0 0 1 ${-o} ${-o}`+R`v ${-(r-2*o)}`+R`a ${o} ${o} 0 0 1 ${o} ${-o}z`,a=R`M ${e+n+i} ${t+n}`+R`h ${5*n-2*i}`+R`a ${i} ${i} 0 0 1 ${i} ${i}`+R`v ${5*n-2*i}`+R`a ${i} ${i} 0 0 1 ${-i} ${i}`+R`h ${-(5*n-2*i)}`+R`a ${i} ${i} 0 0 1 ${-i} ${-i}`+R`v ${-(5*n-2*i)}`+R`a ${i} ${i} 0 0 1 ${i} ${-i}z`;return s+a}function Dw(e,t,r){let{scale:n,transform:o}=Od(r);return R`M ${o(5,e)} ${o(40,t)}a ${35*n} ${35*n}, 0, 0, 0, ${35*n} ${35*n}h ${30*n}a ${5*n} ${5*n}, 0, 0, 0, ${5*n} -${5*n}v -${30*n}a ${35*n} ${35*n}, 0, 0, 0, -${35*n} -${35*n}a ${35*n} ${35*n}, 0, 0, 0, -${35*n} ${35*n}zM ${o(40,e)} ${o(15,t)}a ${25*n} ${25*n}, 0, 0, 1, ${25*n} ${25*n}v ${25*n}h -${25*n}a ${25*n} ${25*n}, 0, 0, 1, -${25*n} -${25*n}a ${25*n} ${25*n}, 0, 0, 1, ${25*n} -${25*n}z`}function Zw(e,t,r){let{scale:n,transform:o}=Od(r);return R`M ${o(5,e)} ${o(30,t)}v ${20*n}a ${25*n} ${25*n}, 0, 0, 0, ${25*n} ${25*n}h ${45*n}v -${45*n}a ${25*n} ${25*n}, 0, 0, 0, -${25*n} -${25*n}h -${20*n}a ${25*n} ${25*n}, 0, 0, 0, -${25*n} ${25*n}M ${o(30,e)} ${o(15,t)}h ${20*n}a ${15*n} ${15*n}, 0, 0, 1, ${15*n} ${15*n}v ${35*n}h -${35*n}a ${15*n} ${15*n}, 0, 0, 1, -${15*n} -${15*n}v -${20*n}a ${15*n} ${15*n}, 0, 0, 1, ${15*n} -${15*n}z`}function Bw(e,t,r){let n=r/70,o=e+r/2-40*n,i=t+r/2-40*n,s=(c,u)=>c*n+u;return R`M${s(35.19239999999999,o)} ${s(5.837547376725838,i)}C${s(37.69667692307692,o)} ${s(3.8737070690335305,i)}, ${s(41.218430769230764,o)} ${s(3.8737092228796843,i)}, ${s(43.722707692307694,o)} ${s(5.837547376725838,i)}L${s(46.62781538461539,o)} ${s(8.115648915187375,i)}L${s(50.23356923076923,o)} ${s(7.32361506903353,i)}C${s(53.342,o)} ${s(6.640824299802762,i)}, ${s(56.51483076923077,o)} ${s(8.168784299802759,i)}, ${s(57.91892307692308,o)} ${s(11.024719684418145,i)}L${s(59.54787692307692,o)} ${s(14.337679684418145,i)}L${s(63.14027692307692,o)} ${s(15.188578145956608,i)}C${s(66.23707692307693,o)} ${s(15.922091992110452,i)}, ${s(68.43270769230769,o)} ${s(18.675396607495067,i)}, ${s(68.45876923076924,o)} ${s(21.857768915187375,i)}L${s(68.48892307692307,o)} ${s(25.54931045364891,i)}L${s(71.35633846153846,o)} ${s(27.874602761341222,i)}C${s(73.82830769230769,o)} ${s(29.879187376725838,i)}, ${s(74.61187692307692,o)} ${s(33.312418145956606,i)}, ${s(73.25452307692306,o)} ${s(36.19103353057199,i)}L${s(71.68006153846153,o)} ${s(39.530141222879685,i)}L${s(73.25452307692306,o)} ${s(42.86924891518738,i)}C${s(74.61187692307692,o)} ${s(45.747864299802764,i)}, ${s(73.82830769230769,o)} ${s(49.18109506903353,i)}, ${s(71.35633846153846,o)} ${s(51.18567968441815,i)}L${s(68.48892307692307,o)} ${s(53.510971992110456,i)}L${s(68.45876923076924,o)} ${s(57.202664299802755,i)}C${s(68.43270769230769,o)} ${s(60.38497199211046,i)}, ${s(66.23707692307693,o)} ${s(63.13823353057199,i)}, ${s(63.14027692307692,o)} ${s(63.871833530572,i)}L${s(59.54787692307692,o)} ${s(64.72260276134121,i)}L${s(57.91892307692308,o)} ${s(68.03564891518737,i)}C${s(56.51483076923077,o)} ${s(70.89164891518737,i)}, ${s(53.342,o)} ${s(72.41958737672583,i)}, ${s(50.23356923076923,o)} ${s(71.7368181459566,i)}L${s(46.62781538461539,o)} ${s(70.94463353057199,i)}L${s(43.722707692307694,o)} ${s(73.22275660749506,i)}C${s(41.218430769230764,o)} ${s(75.18663353057198,i)}, ${s(37.69667692307692,o)} ${s(75.18663353057198,i)}, ${s(35.19239999999999,o)} ${s(73.22275660749506,i)}L${s(32.28729230769231,o)} ${s(70.94463353057199,i)}L${s(28.68153846153846,o)} ${s(71.7368181459566,i)}C${s(25.573215384615384,o)} ${s(72.41958737672583,i)}, ${s(22.400384615384613,o)} ${s(70.89164891518737,i)}, ${s(20.996141538461536,o)} ${s(68.03564891518737,i)}L${s(19.36720923076923,o)} ${s(64.72260276134121,i)}L${s(15.774852307692306,o)} ${s(63.871833530572,i)}C${s(12.67803076923077,o)} ${s(63.13823353057199,i)}, ${s(10.48237846153846,o)} ${s(60.38497199211046,i)}, ${s(10.45636,o)} ${s(57.202664299802755,i)}L${s(10.426163076923077,o)} ${s(53.510971992110456,i)}L${s(7.558747692307692,o)} ${s(51.18567968441815,i)}C${s(5.086880338461539,o)} ${s(49.18109506903353,i)}, ${s(4.303258769230769,o)} ${s(45.747864299802764,i)}, ${s(5.660599692307692,o)} ${s(42.86924891518738,i)}L${s(7.235153846153846,o)} ${s(39.530141222879685,i)}L${s(5.660599692307692,o)} ${s(36.19103353057199,i)}C${s(4.3032566153846155,o)} ${s(33.312418145956606,i)}, ${s(5.086885938461538,o)} ${s(29.879187376725838,i)}, ${s(7.558747692307692,o)} ${s(27.874602761341222,i)}L${s(10.426163076923077,o)} ${s(25.54931045364891,i)}L${s(10.45636,o)} ${s(21.857768915187375,i)}C${s(10.48237846153846,o)} ${s(18.67537506903353,i)}, ${s(12.678052307692308,o)} ${s(15.922091992110452,i)}, ${s(15.774852307692306,o)} ${s(15.188578145956608,i)}L${s(19.36720923076923,o)} ${s(14.337679684418145,i)}L${s(20.996141538461536,o)} ${s(11.024719684418145,i)}C${s(22.400384615384613,o)} ${s(8.168784299802759,i)}, ${s(25.573215384615384,o)} ${s(6.640824299802762,i)}, ${s(28.68153846153846,o)} ${s(7.32361506903353,i)}L${s(32.28729230769231,o)} ${s(8.115648915187375,i)}L${s(35.19239999999999,o)} ${s(5.837547376725838,i)}M${s(39.45766153846154,o)} ${s(13.665055069033532,i)}L${s(37.01498461538461,o)} ${s(15.58053506903353,i)}C${s(35.39098461538461,o)} ${s(16.854061222879682,i)}, ${s(33.282799999999995,o)} ${s(17.335251992110454,i)}, ${s(31.26701538461538,o)} ${s(16.892464299802757,i)}L${s(28.235046153846152,o)} ${s(16.22649506903353,i)}L${s(26.865415384615382,o)} ${s(19.012107376725837,i)}C${s(25.954812307692308,o)} ${s(20.864178145956608,i)}, ${s(24.264193846153844,o)} ${s(22.212399684418145,i)}, ${s(22.255926153846154,o)} ${s(22.688076607495066,i)}L${s(19.235393846153844,o)} ${s(23.40354122287968,i)}L${s(19.21,o)} ${s(26.507556607495065,i)}C${s(19.19313538461538,o)} ${s(28.57137199211045,i)}, ${s(18.25492,o)} ${s(30.519525838264297,i)}, ${s(16.651919999999997,o)} ${s(31.81937199211045,i)}L${s(14.240926153846154,o)} ${s(33.774633530572,i)}L${s(15.564830769230769,o)} ${s(36.58238737672584,i)}C${s(16.445064615384617,o)} ${s(38.44891045364892,i)}, ${s(16.445064615384617,o)} ${s(40.611371992110456,i)}, ${s(15.564830769230769,o)} ${s(42.47811045364892,i)}L${s(14.240926153846154,o)} ${s(45.28564891518738,i)}L${s(16.651919999999997,o)} ${s(47.240910453648915,i)}L${s(13.883236923076923,o)} ${s(50.654971992110454,i)}L${s(16.651919999999997,o)} ${s(47.240910453648915,i)}C${s(18.25492,o)} ${s(48.54075660749507,i)}, ${s(19.19313538461538,o)} ${s(50.4891258382643,i)}, ${s(19.21,o)} ${s(52.5527258382643,i)}L${s(19.235393846153844,o)} ${s(55.65684891518738,i)}L${s(22.255926153846154,o)} ${s(56.37235660749507,i)}C${s(24.264193846153844,o)} ${s(56.847925838264295,i)}, ${s(25.954812307692308,o)} ${s(58.196233530571995,i)}, ${s(26.865415384615382,o)} ${s(60.0483258382643,i)}L${s(28.235046153846152,o)} ${s(62.833895069033524,i)}L${s(31.26701538461538,o)} ${s(62.1679258382643,i)}C${s(33.282799999999995,o)} ${s(61.72509506903353,i)}, ${s(35.39098461538461,o)} ${s(62.20626429980276,i)}, ${s(37.01498461538461,o)} ${s(63.47983353057199,i)}L${s(39.45766153846154,o)} ${s(65.39524891518737,i)}L${s(41.90012307692308,o)} ${s(63.47983353057199,i)}C${s(43.524123076923075,o)} ${s(62.20626429980276,i)}, ${s(45.632307692307684,o)} ${s(61.72509506903353,i)}, ${s(47.6480923076923,o)} ${s(62.1679258382643,i)}L${s(50.68006153846154,o)} ${s(62.833895069033524,i)}L${s(52.049692307692304,o)} ${s(60.0483258382643,i)}C${s(52.960338461538456,o)} ${s(58.196233530571995,i)}, ${s(54.6508923076923,o)} ${s(56.847925838264295,i)}, ${s(56.65913846153846,o)} ${s(56.37235660749507,i)}L${s(59.67969230769231,o)} ${s(55.65684891518738,i)}L${s(59.70510769230769,o)} ${s(52.5527258382643,i)}C${s(59.72190769230769,o)} ${s(50.4891258382643,i)}, ${s(60.66012307692307,o)} ${s(48.54075660749507,i)}, ${s(62.263230769230766,o)} ${s(47.240910453648915,i)}L${s(64.67424615384616,o)} ${s(45.28564891518738,i)}L${s(63.35027692307692,o)} ${s(42.47811045364892,i)}C${s(62.47,o)} ${s(40.611371992110456,i)}, ${s(62.47,o)} ${s(38.44891045364892,i)}, ${s(63.35027692307692,o)} ${s(36.58238737672584,i)}L${s(64.67424615384616,o)} ${s(33.774633530572,i)}L${s(62.263230769230766,o)} ${s(31.81958737672584,i)}C${s(60.66012307692307,o)} ${s(30.519525838264297,i)}, ${s(59.72190769230769,o)} ${s(28.57137199211045,i)}, ${s(59.70510769230769,o)} ${s(26.507556607495065,i)}L${s(59.67969230769231,o)} ${s(23.40354122287968,i)}L${s(56.65913846153846,o)} ${s(22.688076607495066,i)}C${s(54.6508923076923,o)} ${s(22.212399684418145,i)}, ${s(52.960338461538456,o)} ${s(20.864178145956608,i)}, ${s(52.049692307692304,o)} ${s(19.012128915187375,i)}L${s(50.68006153846154,o)} ${s(16.22649506903353,i)}L${s(47.6480923076923,o)} ${s(16.892464299802757,i)}C${s(45.632307692307684,o)} ${s(17.335251992110454,i)}, ${s(43.524338461538456,o)} ${s(16.85408276134122,i)}, ${s(41.90012307692308,o)} ${s(15.58053506903353,i)}L${s(39.45766153846154,o)} ${s(13.665055069033532,i)}Z`}function Ka(e,t,r,n,o="top-left"){switch(n){case "leaf":return S2(e,t,r,o);case "leaf-reverse":return S2(e,t,r,o,true);case "drop":return Aw(e,t,r,o);case "octagon":return w2(e,t,r,1.6);case "bevel":return w2(e,t,r,1.1);case "squircle":return Ew(e,t,r);case "cushion":return Rw(e,t,r);case "shield":return Mw(e,t,r);case "petal":return Iw(e,t,r,o);case "gear":return Tw(e,t,r);case "rounded":return Nw(e,t,r);case "circle":return Lw(e,t,r);case "diya":return Ow(e,t,r);case "extra-rounded":return Fw(e,t,r);case "message":return Dw(e,t,r);case "pointy":return Zw(e,t,r);case "curly":return Bw(e,t,r);default:return zw(e,t,r)}}var Fd=.22,Dd=.14;function P2(e,t,r={}){if(e==="circle")return M("circle",{cx:$(t.x+t.w/2),cy:$(t.y+t.h/2),r:$(Math.min(t.w,t.h)/2),...r});let n=e==="rounded"?Math.min(t.w,t.h)*Fd:0;return M("rect",{height:$(t.h),width:$(t.w),x:$(t.x),y:$(t.y),...n>0&&{rx:$(n),ry:$(n)},...r})}function Uw(e,t){let r=e.w*t,n=e.h*t;return {x:e.x+r,y:e.y+n,w:e.w-2*r,h:e.h-2*n}}function k2(e,t){let r=e.shape??"square",n=e.plate,o=n?Uw(t,Dd):t,i=a=>M("image",{height:$(o.h),href:e.src,preserveAspectRatio:"none",width:$(o.w),x:$(o.x),y:$(o.y),...a&&{clipPath:`url(#${a})`}});if(r==="square"&&!n)return i();let s=r==="square"?void 0:`qrdx-logo-${Cr(`${r}|${$(o.x)}|${$(o.y)}|${$(o.w)}|${$(o.h)}`)}`;return Ie("g",{children:[n&&P2(r,t,{fill:n}),s&&M("clipPath",{id:s,children:P2(r,o)}),i(s)]})}var Gw=.6,Qw=["L","M","Q","H"];function Vw(e){let t=Ve.QrCode.encodeText(e.value,gt[e.level]),r=Qw[t.errorCorrectionLevel.ordinal]??e.level;return {code:e,cells:t.getModules(),layoutMargin:vt(t.size,e.margin,e.shape),map:La(t.version,r),level:r,version:t.version}}function jw(e,t){let{cells:r,map:n}=e,o=r.length,i=Ja(r,e.code.size,e.layoutMargin,t);if(!i)return null;let s=i.excavation??{x:Math.floor(i.x),y:Math.floor(i.y),w:Math.ceil(i.x+i.w)-Math.floor(i.x),h:Math.ceil(i.y+i.h)-Math.floor(i.y)},a=[];for(let u=Math.max(0,s.y);u<Math.min(o,s.y+s.h);u++)for(let l=Math.max(0,s.x);l<Math.min(o,s.x+s.w);l++)a.push(u*o+l);let c=Ta(n,a);return {worst:Math.max(0,...c),correctable:n.correctable,budget:Math.floor(n.correctable*Gw),level:e.level,version:e.version}}var qw=e=>!e||e.worst<=e.budget;function Ww(e,t,r,n){let o=t.map(a=>Vw({...e,level:a})),i=a=>{let c=n(a);return o.every(u=>qw(jw(u,c)))};if(i(r))return r;let s=e.size*.005;for(let a=r-s;a>0;a-=s)if(i(a))return a;return 0}function A2(e,t){if(!t)return;let r=Math.floor(e.size*yi),n=t.width||r,o=t.height||r,i=p=>{if(p===n)return t;let m=o*p/n;return {...t,width:p,height:m,...t.x!=null&&{x:t.x+(n-p)/2},...t.y!=null&&{y:t.y+(o-m)/2}}},s=e.level??jn,a={value:e.value,size:e.size,margin:e.margin,shape:e.shape},c=p=>ui({...e,level:s,imageSettings:p}),u=p=>{let m=Ww(a,[p],n,i);return m>0?i(m):void 0},l=c(t);if(l===s)return u(s);let f=u(l);return f&&c(f)===l?f:u(s)}var E2="data-qrdx-part",Hw="data-qrdx-eye";function R2(e,t,r){if(e)return r?{[E2]:t,[Hw]:r}:{[E2]:t}}var li=300;function ht(e){return {id:e.id,name:e.name,description:e.description,spec:e.spec,wrapper:(t,r)=>{let n=ii(e.spec),o=r?.fgColor,i=(typeof o=="string"?o:Ae(o,""))||"black",s=si(n.qr.size,n,{color:i}),{x:a,y:c,scale:u}=e.at;return M("svg",{height:li,id:"svgQrWrapper",style:{width:"100%",height:"100%"},viewBox:`0 0 ${li} ${li}`,width:li,xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",children:Ie("g",{"data-qrdx-template":e.id,transform:`translate(${$(a)} ${$(c)})${u===1?"":` scale(${u})`}`,children:[i2(s),M("g",{fill:"none",transform:`translate(${$(s.qrX)} ${$(s.qrY)}) scale(${s.qrSize/li})`,children:t})]})})}}}var M2={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 I2=ht({id:"Arrow",name:"Arrow",description:"QR code with arrow",spec:M2,at:{x:47,y:95,scale:1}});var z2={id:"default",name:"Default",description:"Simple QR code without decorative elements",wrapper:e=>M("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:M("g",{fill:"none",transform:"translate(9, 9) scale(0.95)",children:e})})};var pi=593,qt=296.5,fi=146.5,D2=294.5,Z2=231.228,B2="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",Jw="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",Xw="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",N2="3cf27f17c00j3ch21n1ek00l1el3cj1vv1kd00n3cl3cn1q31q500p3cp1vx00r1kb3cs3aw1ej21p00t3ax3ay17b27h00w3b02g20yq01w2d611m01x3b52aa14i01y24i1bq0203bd3be1q21q60253bf39e39f39h14e2ae02d39j11i2da02e39l0ym02f39n2lt0sz03a39p2ix0vv03b39r2d511n39t03d27d17f03f39x39y21l1en03h3a03a11vt1kf03j37w37x1q11q703l37z1k903n1vz3821eh03p21r38714d03t11h03u2db38a0vp2j303w2lz38g03x0st2rk0n804o38l2oo0q404p38n2iw0vw04r36f36h2a814k04u36k36l1vs1kg04z36o36p1n41t405236q36x36y0ss2m005d3720n02rs05f3742uf0kd0633763772on0q506537834y2fz0yt06834z2d311p06935235424f1bt06c35621j1ep06d3581yn1hl06e35a1sv1nd06g35b1pz1q906h35d35e35g1ef21t06l35h1bj24p06m35k35l11f2dd06q35n0vn2j506s35p35q0pv2ox06u35s0mz2rt06v35t33h0k32up06w2x90hi08y2ud0ke08z33r2lp0t20922fx0yu0942a514m09624d1bu0983441yl1hm09a1vp1ki09b1px1qa09d34e1n11t609e1h91yy09g1ed21u09h1a227m0831492ai09l0yh2ga09n0sp2m209p0pt2oy09q0k12uq09s2xo0h52z209t31k0en0bt2780c319z0az0e831z0cq",L2=52,Yw=240;function T2(e){let t=0;return e.split(" ").map(r=>(t+=Number.parseInt(r,36),t/1e4))}var Zd;function e7(){if(!Zd){let e=T2(Jw),t=T2(Xw),r=[];for(let n=0;n<N2.length;n+=3){let o=Number.parseInt(N2.slice(n,n+3),36);r.push({cx:e[Math.floor(o/L2)],cy:t[o%L2]});}Zd=r;}return Zd}function t7(e){let t=0;for(let r=0;r<e.length;r++)t=t*32-t+e.charCodeAt(r),t%=2147483647;return Math.abs(t)}function U2(e){let t=e7(),r=t7(e),n=()=>(r=(r*9301+49297)%233280,r/233280),o=t.map((i,s)=>s);for(let i=o.length-1;i>0;i--){let s=Math.floor(n()*(i+1));[o[i],o[s]]=[o[s],o[i]];}return o.slice(0,Yw).sort((i,s)=>i-s).map(i=>t[i])}var O2=300,r7=49,n7=6;function G2(e,t){if(O2/t<=r7+.5)return e;let r=fi,n=fi+O2,o=n7*t+t/2;return e.filter(({cx:i,cy:s})=>Math.max(r-i,i-n,r-s,s-n)>=o)}var Q2="Scan the QR code * Scan the QR code * Scan the QR code * Scan the QR code *",Xa=32,V2=3.5,j2=246.5,Ud=.36,F2=j2+Ud*Xa,Bd=400;function o7(e,t){return e===" "||/[il1|!']/.test(e)?t*.3:/[mwMW@%&]/.test(e)?t*.8:t*.6}function i7(e){let t=e.slice(0,Bd).split(" ").map(r=>Ko(r,Bd)).join(" ");return Array.from(t).slice(0,Bd)}function q2(e,t){let{fontSize:r,letterSpacing:n,position:o,rotation:i}=t,s=2*Math.PI*j2,a=[],c=0;for(let h of i7(e)){let d=o7(h,r);if(c+d>s)break;a.push({char:h,along:c+d/2}),c+=d+n;}let u=c-(a.length>0?n:0),l=o!=="bottom",f=l?F2-Ud*r:F2+Ud*r,p=u/s*180,m=[];for(let{char:h,along:d}of a){if(h.trim()==="")continue;let g=d/s*360,y=l?i-p+g:i+180+p-g,_=y*Math.PI/180;m.push({char:h,x:re(qt+f*Math.sin(_)),y:re(qt-f*Math.cos(_)),rotate:re(l?y:y-180)});}return m}var Bn=(e,t)=>typeof e=="number"&&Number.isFinite(e)?e:t,W2={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,r)=>{let n=Ae(t?.fgColor,"#000000"),o=Ae(t?.bgColor,"#ffffff"),i=r?.pixelSize??9,s=re(i/2),a=G2(U2(r?.url??""),i),c=Bn(t?.fontSize,Xa),u=c>0?c:Xa,l=typeof t?.customText=="string"?t.customText:Q2,f=q2(l,{fontSize:u,letterSpacing:Bn(t?.fontLetterSpacing,V2),position:t?.textPosition==="bottom"?"bottom":"top",rotation:Bn(t?.textRotation,0)}),p=t?.textColor||"#ffffff",m=t?.fontFamily||Ld,h=t?.fontWeight??900,d=Bn(t?.strokeWidth,0),g=t?.strokeColor||"#000000",y=[{radius:qt,width:Bn(t?.outerStrokeWidth,d),color:t?.outerStrokeColor||g},{radius:Z2,width:Bn(t?.innerStrokeWidth,d),color:t?.innerStrokeColor||g}].filter(_=>_.width>0);return Ie("svg",{height:pi,id:"svgQrWrapper",style:{width:"100%",height:"100%"},viewBox:`0 0 ${pi} ${pi}`,width:pi,xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",children:[M("circle",{cx:qt,cy:qt,fill:o,r:D2}),M("g",{fill:n,children:a.map((_,b)=>M("circle",{cx:_.cx,cy:_.cy,r:s},b))}),M("path",{d:B2,fill:t?.outerCircleColor||n}),y.map((_,b)=>M("circle",{cx:qt,cy:qt,fill:"none",r:_.radius,stroke:_.color,strokeWidth:_.width},b)),M("g",{"aria-hidden":"true",children:f.map((_,b)=>M("text",{fill:p,fontFamily:m,fontSize:u,fontWeight:h,textAnchor:"middle",transform:`rotate(${_.rotate} ${_.x} ${_.y})`,x:_.x,y:_.y,children:_.char},b))}),M("g",{transform:`translate(${fi} ${fi})`,children:e})]})}};var H2={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 K2=ht({id:"Halloween",name:"Halloween",description:"QR code with Halloween theme",spec:H2,at:{x:38,y:10,scale:1}});var J2={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 X2=ht({id:"SquareBorder",name:"Square Border",description:"QR code with square decorative border",spec:J2,at:{x:0,y:0,scale:300/316}});var Y2={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 ey=ht({id:"StandardBox",name:"Standard Box",description:"QR code with standard box",spec:Y2,at:{x:46,y:1,scale:1}});var ty={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 ry=ht({id:"StrikedBox",name:"Striked Box",description:"QR code with striked box",spec:ty,at:{x:24,y:0,scale:1}});var Gd={default:z2,Arrow:I2,StandardBox:ey,SquareBorder:X2,StrikedBox:ry,Halloween:K2,DotRing:W2},ny={FlamQR:"DotRing"},oy=e=>{if(Object.hasOwn(Gd,e))return Gd[e];let t=Object.hasOwn(ny,e)?ny[e]:void 0;return t?Gd[t]:void 0};var Qd=e=>Math.round(Math.min(Math.max(e,0),255)).toString(16).padStart(2,"0");function cy(e){return `#${Qd(e.r)}${Qd(e.g)}${Qd(e.b)}`}function Ya(e){let t=Me(e);return !t||t.a>=1||t.a<=0?{color:e}:{color:cy(t),opacity:re(t.a,3)}}function ec(e,t){let r=Math.min(Math.max(e.a,0),1);return {r:e.r*r+t.r*(1-r),g:e.g*r+t.g*(1-r),b:e.b*r+t.b*(1-r),a:1}}var uy={r:0,g:0,b:0,a:1};function l7(e){return [...e].map(t=>({offset:Math.min(Math.max(t.offset/100,0),1),color:Me(t.color)??uy})).sort((t,r)=>t.offset-r.offset)}function Vd(e,t){let r=e[0],n=e.at(-1);if(!(r&&n))return uy;if(t<=r.offset)return r.color;if(t>=n.offset)return n.color;for(let o=0;o+1<e.length;o++){let i=e[o],s=e[o+1];if(t>=i.offset&&t<=s.offset){let a=s.offset-i.offset,c=a>0?(t-i.offset)/a:1,u=i.color.a+(s.color.a-i.color.a)*c,l=(f,p)=>{let m=f*i.color.a+(p*s.color.a-f*i.color.a)*c;return u>0?m/u:f+(p-f)*c};return {r:l(i.color.r,s.color.r),g:l(i.color.g,s.color.g),b:l(i.color.b,s.color.b),a:u}}}return n.color}var iy=4,sy=720,f7=2;function ly(e,t,r,n,o){let i=l7(e);if(i.length===0)return {wedges:[]};let s=i[0].color.a,a=i.every(_=>Math.abs(_.color.a-s)<.002),c=[...new Set([0,...i.map(_=>_.offset),1])].sort((_,b)=>_-b),u=[];for(let _=0;_+1<c.length;_++){let b=c[_],S=c[_+1];if(S<=b)continue;let C=Vd(i,b+1e-9),w=Vd(i,S-1e-9),x=Math.max(Math.abs(C.r*C.a-w.r*w.a),Math.abs(C.g*C.a-w.g*w.a),Math.abs(C.b*C.a-w.b*w.a),Math.abs(C.a-w.a)*255),A=Math.ceil(x/f7),P=Math.ceil((S-b)*360/iy),E=Math.max(1,A,P);for(let I=0;I<E;I++)u.push([b+(S-b)*I/E,b+(S-b)*(I+1)/E]);}let l=u;if(u.length>sy){let _=Math.ceil(u.length/sy);l=[];for(let b=0;b<u.length;b+=_){let S=u.slice(b,b+_);l.push([S[0][0],S.at(-1)[1]]);}}let f=t-90,p=o/Math.cos(2*iy/2*(Math.PI/180)),m=_=>{let b=_*Math.PI/180;return [$(r+p*Math.cos(b)),$(n+p*Math.sin(b))]},h=`${$(r)} ${$(n)}`,d=_=>re((_%360+360)%360,4),g=l.length-1,y=l.map(([_,b],S)=>{let C=Vd(i,(_+b)/2),w=(b-_)*360,x=a&&S===0&&g>0?w:0,A=a&&S<g?w:0,P=f+_*360-x,E=f+b*360+A,[I,N]=m(P),[T,V]=m(E);return {d:`M${h}L${I} ${N}L${T} ${V}Z`,color:cy(C),...a||C.a>=1?{}:{opacity:re(C.a,3)},from:d(P),sweep:re(E-P,4)}});return a&&s<1?{wedges:y,opacity:re(s,3)}:{wedges:y}}function ay(e,t,r,n){return (Math.atan2(n-t,r-e)*180/Math.PI%360+360)%360}function fy(e,t,r){if(e>=r.x-1e-6&&e<=r.x+r.width+1e-6&&t>=r.y-1e-6&&t<=r.y+r.height+1e-6)return null;let o=[[r.x,r.y],[r.x+r.width,r.y],[r.x,r.y+r.height],[r.x+r.width,r.y+r.height]],i=ay(e,t,r.x+r.width/2,r.y+r.height/2),s=0,a=0;for(let[c,u]of o){let l=ay(e,t,c,u)-i;l>180?l-=360:l<=-180&&(l+=360),s=Math.min(s,l),a=Math.max(a,l);}return [i+s,i+a]}function py(e,t){let r=e[1]-e[0],n=t[1]-t[0];if(r>=360||n>=360)return true;let o=((t[0]-e[0])%360+360)%360;return o<=r||o+n>=360}function p7(e,t){return e.slice().map((r,n)=>n<t.y||n>=t.y+t.h?r:r.map((o,i)=>i<t.x||i>=t.x+t.w?o:false))}function m7(e,t,r){return e<7&&t<7||e>=r-7&&t<7||e<7&&t>=r-7}var d7=.9;function jd(e,t){let{margin:r,pixelSize:n,pattern:o="circle",plain:i=false}=t;if(k_(o))return A_(e,{margin:r,pixelSize:n,pattern:o,scale:t.scale,plain:i});let s=Rd(t.scale,o),a=[],c=e.length,u=n*.45,l=i?()=>false:Md(c);return e.forEach((f,p)=>{f.forEach((m,h)=>{if(m&&(i||!m7(h,p,c))){let d=(h+.5+r)*n,g=(p+.5+r)*n,y=`${h}-${p}`,_=a.length;if(l(h,p)){a.push(M("rect",{height:$(n),width:$(n),x:$(d-n/2),y:$(g-n/2)},y));return}switch(o){case "circle":a.push(M("circle",{cx:$(d),cy:$(g),r:$(u),transform:R`rotate(0,${d},${g})`},y));break;case "circle-large":{let b=n*.5;a.push(M("circle",{cx:$(d),cy:$(g),r:$(b),transform:R`rotate(0,${d},${g})`},y));}break;case "small-square":{let b=n*.357143;a.push(M("path",{d:R`M ${d-b} ${g-b}v ${n*.714286}h ${n*.714286}v -${n*.714286}z`,transform:R`rotate(0,${d},${g})`},y));}break;case "diamond":{let b=n*.357143;a.push(M("path",{d:R`M ${d-b} ${g-b}v ${n*.714286}h ${n*.714286}v -${n*.714286}z`,transform:R`rotate(45,${d},${g})`},y));}break;case "circle-mixed":{let b=(h+p)%3===0?d7:(h+p)%2===0?1:1.25,S=u*b;a.push(M("circle",{cx:$(d),cy:$(g),r:$(S),transform:R`rotate(0,${d},${g})`},y));}break;case "pacman":{let b=n*.5,S=n*.357143;a.push(M("path",{d:R`M ${d-b} ${g-S}v ${n*.714286}h ${b}a ${b*.5} ${b*.5}, 0, 0, 0, 0 -${n*.714286}h -${b}v -${n*.714286}z`,transform:R`rotate(${(h+p)%2===0?0:90},${d},${g})`},y));}break;case "rounded":{let b=n*.5,S=n*.2;a.push(M("rect",{height:$(n),rx:$(S),ry:$(S),transform:R`rotate(0,${d},${g})`,width:$(n),x:$(d-b),y:$(g-b)},y));}break;case "square":{let b=n*.5;a.push(M("rect",{height:$(n),transform:R`rotate(0,${d},${g})`,width:$(n),x:$(d-b),y:$(g-b)},y));}break;case "vertical-line":{let b=n*.714286,S=n;a.push(M("path",{d:R`M ${d-n*.5} ${g-b*.5}v ${b}h ${S}v -${b}z`,transform:R`rotate(90,${d},${g})`},y));}break;default:a.push(M("circle",{cx:$(d),cy:$(g),r:$(u),transform:R`rotate(0,${d},${g})`},y));}if(s!==1&&a.length>_){let b=a.pop();a.push(M("g",{transform:R`translate(${d},${g}) scale(${$(s,6)}) translate(${-d},${-g})`,children:b},y));}}});}),a}function h7(e,t){let r=e*Math.PI/180,n=t/2,o=t/2,i=Math.sqrt(t*t+t*t)/2,s=n-i*Math.cos(r),a=o-i*Math.sin(r),c=n+i*Math.cos(r),u=o+i*Math.sin(r);return {x1:s,y1:a,x2:c,y2:u}}function Wd(e,t){return `${e}-${Cr(JSON.stringify(t))}`}function g7(e,t,r,n,o){let i=e;if(e===0)switch(o){case "top-left":i=0;break;case "top-right":i=90;break;case "bottom-left":i=270;break;default:i=0;}let s=i*Math.PI/180,a=t+n/2,c=r+n/2,u=Math.sqrt(n*n+n*n)/2,l=a-u*Math.cos(s),f=c-u*Math.sin(s),p=a+u*Math.cos(s),m=c+u*Math.sin(s);return {x1:l,y1:f,x2:p,y2:m}}function rc(e,t){return t.map((r,n)=>{let{color:o,opacity:i}=Ya(r.color);return M("stop",{offset:`${r.offset}%`,stopColor:o,stopOpacity:i},`${e}-stop-${n}`)})}function dy(e,t,r,n,o,i){let s=ly(t.stops,t.angle??0,r,n,o),a=s.wedges.map((c,u)=>M("path",{d:c.d,"data-arc":`${c.from} ${c.sweep}`,fill:c.color,fillOpacity:c.opacity,shapeRendering:c.opacity===void 0?void 0:"crispEdges"},`${e}-w-${u}`));return M("pattern",{"data-qrdx-conic":`${$(r)} ${$(n)}`,height:$(i),id:e,patternUnits:"userSpaceOnUse",width:$(i),x:0,y:0,children:s.opacity===void 0?a:M("g",{opacity:s.opacity,children:a})},e)}function _7(e="center"){let[t,r]=e.split("-"),n=e==="center"?"center":t,o=r??(t==="left"||t==="right"?t:"center");return {x:o==="left"?0:o==="right"?1:.5,y:n==="top"?0:n==="bottom"?1:.5}}var y7=["xMin","xMid","xMax"],b7=["YMin","YMid","YMax"];function hy(e,t,r){let n=t.scale??1,o=t.fit==="tile",i=o?r/4*n:r,s=t.underlay?Ya(t.underlay):null,a=o?i:r*n,c=_7(t.position),u=o?0:c.x*(r-a),l=o?0:c.y*(r-a),f=o?"xMidYMid slice":`${y7[c.x*2]??"xMid"}${b7[c.y*2]??"YMid"} ${t.fit==="contain"?"meet":"slice"}`;return Ie("pattern",{height:$(i),id:e,patternUnits:"userSpaceOnUse",width:$(i),x:0,y:0,children:[s&&M("rect",{fill:s.color,fillOpacity:s.opacity,height:$(i),width:$(i),x:0,y:0}),M("image",{height:$(a),href:t.src,opacity:(t.opacity??1)<1?t.opacity:void 0,preserveAspectRatio:f,width:$(a),x:$(u),y:$(l)})]},e)}var gy=(e,t)=>Wd("img",[e,t]);function $7(e,t,r,n,o,i,s){let a=hr(e);if(a.type==="solid")return null;if(a.type==="image"){let u=gy(a,s);return {id:u,element:hy(u,a,s)}}let c=Wd(i,[a,t,r,n,o,...a.type==="angular"?[s]:[]]);if(a.type==="linear"){let u=a,l=u.angle??0,{x1:f,y1:p,x2:m,y2:h}=g7(l,t,r,n,o);return {id:c,element:M("linearGradient",{gradientUnits:"userSpaceOnUse",id:c,x1:$(f),x2:$(m),y1:$(p),y2:$(h),children:rc(c,u.stops)},c)}}if(a.type==="radial"){let u=a,l=t+n/2,f=r+n/2,p=n/2*.97;return {id:c,element:M("radialGradient",{cx:$(l),cy:$(f),fx:$(l),fy:$(f),gradientUnits:"userSpaceOnUse",id:c,r:$(p),children:rc(c,u.stops)},c)}}return a.type==="angular"?{id:c,element:dy(c,a,t+n/2,r+n/2,n*.75,s)}:null}function qd(e,t,r){let n=hr(e);if(n.type==="solid")return null;if(n.type==="image"){let i=gy(n,t);return {id:i,element:hy(i,n,t)}}let o=Wd(r,[n,t]);if(n.type==="linear"){let i=n,s=i.angle??0,{x1:a,y1:c,x2:u,y2:l}=h7(s,t);return {id:o,element:M("linearGradient",{gradientUnits:"userSpaceOnUse",id:o,x1:$(a),x2:$(u),y1:$(c),y2:$(l),children:rc(o,i.stops)},o)}}if(n.type==="radial"){let i=n,s=t/2,a=t/2,c=t/2*.97;return {id:o,element:M("radialGradient",{cx:$(s),cy:$(a),fx:$(s),fy:$(a),gradientUnits:"userSpaceOnUse",id:o,r:$(c),children:rc(o,i.stops)},o)}}return n.type==="angular"?{id:o,element:dy(o,n,t/2,t/2,t*.75,t)}:null}var tc=e=>jo(e)||wg(e);function my(e){let t=new Set,r=[];for(let n of e)n&&!t.has(n.id)&&(t.add(n.id),r.push(n.element));return r}function Ct(e,t,r){if(t)return {fill:`url(#${t})`};let n=hr(e,r),o=n.type==="solid"?n.color:n.type==="image"?n.underlay??r:r,{color:i,opacity:s}=Ya(o);return s===void 0?{fill:i}:{fill:i,fillOpacity:s}}function Ja(e,t,r,n){if(n==null)return null;let o=e.length,i=Math.floor(t*yi),s=(o+2*r)/t,a=(n.width||i)*s,c=(n.height||i)*s,u=n.x==null?o/2-a/2:n.x*s,l=n.y==null?o/2-c/2:n.y*s,f=null;if(n.excavate){let p=Math.max(0,n.padding??0)*s,m=Math.floor(u-p),h=Math.floor(l-p),d=Math.ceil(a+u+p-m),g=Math.ceil(c+l+p-h);f={x:m,y:h,w:d,h:g};}return {x:u,y:l,h:c,w:a,excavation:f}}function ui(e){let t=e.level??jn,{imageSettings:r}=e,n=e.isOGContext&&r?.excavate&&(t==="L"||t==="M")?"Q":t;if(e.autoLevel&&r&&n!=="H"){let o=Ve.QrCode.encodeText(e.value,gt[n]).getModules(),i=Ja(o,e.size??Je,vt(o.length,e.margin??qn,e.shape),r);i&&(i.excavation?i.excavation.w*i.excavation.h:i.w*i.h)/(o.length*o.length)>Gg&&(n="H");}return n}function x7(e,t,r,n){let o=t/r,i=e.w*o,s=e.h*o,a=(e.x+n)*o,c=(e.y+n)*o;return {imgWidth:i,imgHeight:s,imgLeft:a,imgTop:c}}function Un(e){let{value:t,size:r=Je,level:n=jn,bgColor:o=Ne,fgColor:i=Br,eyeColor:s,dotColor:a,bodyPattern:c="circle",cornerEyePattern:u="gear",cornerEyeDotPattern:l="circle",margin:f=qn,isOGContext:p=false,imageSettings:m,templateId:h,customTemplate:d,customProps:g,frame:y,art:_,eyeColors:b,moduleScale:S,autoLevel:C,shape:w,frameLabelMarkers:x,partMarkers:A,...P}=e,E=A2({value:t,size:r,margin:f,level:n,shape:w,autoLevel:C,isOGContext:p},m),I=jt(y),N=I?{}:P,T=ue=>I?s2(ue,{size:r,frame:y,bgColor:o,svgProps:P,markLabels:x}):ue,V=ui({value:t,size:r,level:n,margin:f,imageSettings:E,isOGContext:p,autoLevel:C,shape:w}),Q=Ve.QrCode.encodeText(t,gt[V]),F=Q.getModules(),W=vt(F.length,f,w),K=b2(t,F.length,f,w),U=(ue,Qe)=>R2(A,ue,Qe),X=(ue,Qe)=>{let lt=$2(w,ue);return lt?"circle"in lt?M("circle",{cx:$(ue/2),cy:$(ue/2),...Qe,r:$(ue/2),...U("background")}):M("path",{d:lt.path,...Qe,...U("background")}):M("rect",{...Qe,height:ue,width:ue,x:0,y:0,...U("background")})},xe=F.length+W*2,ze=Ja(F,r,W,E),he=null;if(E!=null&&ze!=null){ze.excavation!=null&&(F=p7(F,ze.excavation));let{imgWidth:ue,imgHeight:Qe,imgLeft:lt,imgTop:Fr}=x7(ze,r,xe,W);if(p){let Dr=E.shape??"square";he=M("img",{alt:"Logo",src:E.src,style:{position:"absolute",left:`${$(lt)}px`,top:`${$(Fr)}px`,width:`${$(ue)}px`,height:`${$(Qe)}px`,...Dr!=="square"&&{borderRadius:Dr==="circle"?"50%":`${$(Math.min(ue,Qe)*Fd)}px`},...E.plate&&{backgroundColor:E.plate,padding:`${$(ue*Dd)}px`,boxSizing:"border-box"}}});}else he=k2(E,{x:lt,y:Fr,w:ue,h:Qe}),A&&(he=zn(he,U("logo")));}let pe=r/xe,ke=F.length,J=7*pe,kt=1.5*pe,Qn={fgColor:Ae(i,Br),bgColor:Ae(o,Ne)},ut=r_(_)?l_({art:_,modules:F,version:Q.version,margin:W,pixelSize:pe,...Qn,body:ue=>jd(ue,{margin:W,pixelSize:pe,pattern:c,scale:S})}):null,Vn=ut&&A?zn(ut,U("body")):ut,ph=ut&&_?C_({art:_,version:Q.version,...Qn}):null,hb=ut?null:jd(F,{margin:W,pixelSize:pe,pattern:c,scale:S}),dc=K?jd(K,{margin:0,pixelSize:pe,pattern:c,scale:S,plain:true}):null,_i=hr(o,Ne),mh=hr(i,Br),dh=tc(_i)?qd(_i,r,"bg-color"):null,hc=tc(mh)?qd(mh,r,"fg-color"):null,gb=Ct(o,dh?.id??null,Ne),hh=Ct(i,hc?.id??null,Br),gh=Vn?Ie(xr,{children:[Vn,dc&&M("g",{...hh,...U("body"),children:dc})]}):Ie("g",{...hh,...U("body"),children:[hb,dc]}),Er=W*pe,Rr=W*pe,Mr=(ke-7+W)*pe,Ir=W*pe,zr=W*pe,Nr=(ke-7+W)*pe,Wt=Ae(i,Br),Lr=ue=>b?.[ue]?.outer??ph?.[ue]?.outer??s,Tr=ue=>b?.[ue]?.inner??ph?.[ue]?.inner??a,Or=(ue,Qe,lt,Fr,Dr)=>{let wc=hr(ue,Wt);return tc(wc)?$7(wc,Qe,lt,J,Fr,Dr,r):null},gc=Or(Lr("topLeft"),Er,Rr,"top-left","corners-square-color-0-0"),_c=Or(Lr("topRight"),Mr,Ir,"top-right","corners-square-color-1-0"),yc=Or(Lr("bottomLeft"),zr,Nr,"bottom-left","corners-square-color-0-1"),bc=Or(Tr("topLeft"),Er,Rr,"top-left","corners-dot-color-0-0"),$c=Or(Tr("topRight"),Mr,Ir,"top-right","corners-dot-color-1-0"),xc=Or(Tr("bottomLeft"),zr,Nr,"bottom-left","corners-dot-color-0-1"),_h=Ct(Lr("topLeft"),gc?.id??null,Wt),yh=Ct(Lr("topRight"),_c?.id??null,Wt),bh=Ct(Lr("bottomLeft"),yc?.id??null,Wt),$h=Ct(Tr("topLeft"),bc?.id??null,Wt),xh=Ct(Tr("topRight"),$c?.id??null,Wt),wh=Ct(Tr("bottomLeft"),xc?.id??null,Wt),Sh=Ka(Er,Rr,J,u,"top-left"),vh=Ha(Er+J/2,Rr+J/2,kt,l,"top-left"),Ch=Ka(Mr,Ir,J,u,"top-right"),Ph=Ha(Mr+J/2,Ir+J/2,kt,l,"top-right"),kh=Ka(zr,Nr,J,u,"bottom-left"),Ah=Ha(zr+J/2,Nr+J/2,kt,l,"bottom-left"),_b=Ie(xr,{children:[M("defs",{children:my([dh,hc,gc,_c,yc,bc,$c,xc])}),X(r,gb),gh,M("g",{..._h,...U("eye-outer","top-left"),children:M("path",{d:Sh,fillRule:"evenodd",transform:R`rotate(0,${Er+J/2},${Rr+J/2})`})}),M("g",{...$h,...U("eye-centre","top-left"),children:vh}),M("g",{...yh,...U("eye-outer","top-right"),children:M("path",{d:Ch,fillRule:"evenodd",transform:R`rotate(0,${Mr+J/2},${Ir+J/2})`})}),M("g",{...xh,...U("eye-centre","top-right"),children:Ph}),M("g",{...bh,...U("eye-outer","bottom-left"),children:M("path",{d:kh,fillRule:"evenodd",transform:R`rotate(0,${zr+J/2},${Nr+J/2})`})}),M("g",{...wh,...U("eye-centre","bottom-left"),children:Ah}),he]}),Eh=d||(h?oy(h):void 0);if(Eh){let Qe=tc(_i)?qd(_i,300,"bg-color-template"):null,lt=Ct(o,Qe?.id??null,Ne),Fr=Ie("svg",{height:300,viewBox:"0 0 300 300",width:300,xmlns:"http://www.w3.org/2000/svg",children:[M("defs",{children:my([Qe,hc,gc,_c,yc,bc,$c,xc])}),X(300,lt),Ie("g",{transform:`scale(${$(300/r,6)})`,children:[gh,M("g",{..._h,...U("eye-outer","top-left"),children:M("path",{d:Sh,fillRule:"evenodd",transform:R`rotate(0,${Er+J/2},${Rr+J/2})`})}),M("g",{...$h,...U("eye-centre","top-left"),children:vh}),M("g",{...yh,...U("eye-outer","top-right"),children:M("path",{d:Ch,fillRule:"evenodd",transform:R`rotate(0,${Mr+J/2},${Ir+J/2})`})}),M("g",{...xh,...U("eye-centre","top-right"),children:Ph}),M("g",{...bh,...U("eye-outer","bottom-left"),children:M("path",{d:kh,fillRule:"evenodd",transform:R`rotate(0,${zr+J/2},${Nr+J/2})`})}),M("g",{...wh,...U("eye-centre","bottom-left"),children:Ah}),he]})]}),Dr=300/r,yb={pixelSize:pe*Dr,url:t},Rh=Eh.wrapper(Fr,{fgColor:i,bgColor:o,...g||{},...P},yb),bb={...Rh?.props?.style||{},width:void 0,height:void 0,...N.style};return T(zn(Rh,{...N,width:r,height:r,style:bb}))}return T(M("svg",{height:r,viewBox:`0 0 ${r} ${r}`,width:r,xmlns:"http://www.w3.org/2000/svg",...N,children:_b}))}(()=>{try{new Path2D().addPath(new Path2D);}catch{return false}return true})();var w7=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"]]),S7=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"]]),v7=new Set(["children","dangerouslySetInnerHTML","key","defaultValue","defaultChecked","innerHTML","suppressContentEditableWarning","suppressHydrationWarning","ref"]),C7=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"]),P7=new Set(["autoFocus","multiple","muted"]),k7=new Set(["contentEditable","spellCheck","draggable","value","autoReverse","externalResourcesRequired","focusable","preserveAlpha"]),A7=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(" ")),_y=":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",E7=new RegExp(`^[${_y}][${_y}\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`),nc=/^[a-zA-Z][a-zA-Z:_.\-\d]*$/,R7=/^[\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,M7="javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')",I7=e=>R7.test(e)?M7:e,by=new Set(["area","base","br","col","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"]),z7=/["'&<>]/;function Hd(e){if(!z7.test(e))return e;let t="",r=0;for(let n=0;n<e.length;n++){let o;switch(e.charCodeAt(n)){case 34:o="&quot;";break;case 38:o="&amp;";break;case 39:o="&#x27;";break;case 60:o="&lt;";break;case 62:o="&gt;";break;default:continue}t+=e.slice(r,n)+o,r=n+1;}return t+e.slice(r)}var Pt=e=>typeof e=="function"||typeof e=="symbol",yy=new Map,N7=e=>{let t=yy.get(e);return t===void 0&&(t=e.replace(/([A-Z])/g,"-$1").toLowerCase().replace(/^ms-/,"-ms-"),yy.set(e,t)),t};function L7(e){if(typeof e=="string")return e;if(typeof e!="object"||e===null)return "";let t="";for(let r of Object.keys(e)){let n=e[r];if(n==null||typeof n=="boolean"||n==="")continue;let o;if(r.startsWith("--"))o=`${r}:${`${n}`.trim()}`;else {let i=typeof n=="number"?n===0||A7.has(r)?`${n}`:`${n}px`:`${n}`.trim();o=`${N7(r)}:${i}`;}t=t?`${t};${o}`:o;}return t}function oc(e,t){if(t==null||v7.has(e))return null;let r=S7.get(e);if(r!==void 0)return Pt(t)||typeof t=="boolean"?null:{name:r,value:`${t}`};switch(e){case "style":{let o=L7(t);return o?{name:"style",value:o}:null}case "src":case "href":case "action":case "formAction":case "xlinkHref":return (e==="src"||e==="href")&&t===""||Pt(t)||typeof t=="boolean"?null:{name:e==="xlinkHref"?"xlink:href":e,value:I7(`${t}`)};case "capture":case "download":return t===true?{name:e,value:""}:t===false||Pt(t)?null:{name:e,value:`${t}`};case "cols":case "rows":case "size":case "span":return Pt(t)||Number.isNaN(Number(t))||!(t>=1)?null:{name:e,value:`${t}`};case "rowSpan":case "start":return Pt(t)||Number.isNaN(Number(t))?null:{name:e,value:`${t}`};}if(P7.has(e))return t&&!Pt(t)?{name:e.toLowerCase(),value:""}:null;if(k7.has(e))return Pt(t)?null:{name:e,value:`${t}`};if(C7.has(e))return t&&!Pt(t)?{name:e,value:""}:null;if(e.length>2&&(e[0]==="o"||e[0]==="O")&&(e[1]==="n"||e[1]==="N"))return null;let n=w7.get(e)??e;if(!E7.test(n)||Pt(t))return null;if(typeof t=="boolean"){let o=n.toLowerCase().slice(0,5);if(o!=="data-"&&o!=="aria-")return null}return {name:n,value:`${t}`}}var $y="http://www.w3.org/2000/svg",xy="http://www.w3.org/1999/xhtml",T7="http://www.w3.org/1999/xlink",O7="http://www.w3.org/XML/1998/namespace",F7="http://www.w3.org/2000/xmlns/";function D7(e,t,r){t==="xmlns"||t.startsWith("xmlns:")?e.setAttributeNS(F7,t,r):t.startsWith("xlink:")?e.setAttributeNS(T7,t,r):t.startsWith("xml:")?e.setAttributeNS(O7,t,r):e.setAttribute(t,r);}function mi(e,t,r,n){if(t==null||typeof t=="boolean")return;if(typeof t=="string"||typeof t=="number"||typeof t=="bigint"){e.appendChild(n.createTextNode(`${t}`));return}if(Array.isArray(t)){for(let c of t)mi(e,c,r,n);return}if(!Oa(t))throw new TypeError("qrdx: can't render this value as DOM nodes");let{type:o,props:i}=t;if(Fa(o)){mi(e,i.children,r,n);return}if(typeof o=="function"){mi(e,o(i),r,n);return}if(!nc.test(o))throw new TypeError(`qrdx: invalid element name: ${o}`);let s=o==="svg"?$y:r,a=n.createElementNS(s,o);for(let c of Object.keys(i)){let u=oc(c,i[c]);u&&D7(a,u.name,u.value);}mi(a,i.children,s===$y&&o==="foreignObject"?xy:s,n),e.appendChild(a);}function Kd(e,t=document){let r=t.createDocumentFragment();return mi(r,e,xy,t),r}function ct(e){if(e==null||typeof e=="boolean")return "";if(typeof e=="string")return Hd(e);if(typeof e=="number"||typeof e=="bigint")return `${e}`;if(Array.isArray(e)){let t="";for(let r of e)t+=ct(r);return t}if(!Oa(e))throw new TypeError("qrdx: can't render this value as SVG markup");return Z7(e)}function Z7(e){let{type:t,props:r}=e;if(Fa(t))return ct(r.children);if(typeof t=="function")return ct(t(r));if(!nc.test(t))throw new TypeError(`qrdx: invalid element name: ${t}`);let n=`<${t}`;for(let s of Object.keys(r)){let a=oc(s,r[s]);a&&(n+=` ${a.name}="${Hd(a.value)}"`);}if(by.has(t))return `${n}/>`;let o=r.dangerouslySetInnerHTML?.__html,i=o==null?ct(r.children):`${o}`;return `${n}>${i}</${t}>`}function wy(e){return ct(Un(e))}var Jd=[17,18,0,1,2,3,4,5,16,6,7,8,9,10,11,12,13,14,15],B7=8,Xd=class{buffer;position=0;bits=0;used=0;constructor(t){this.buffer=new Uint8Array(Math.max(t,64));}write(t,r){if(r!==0)for(this.bits|=t<<this.used,this.used+=r;this.used>=8;){if(this.position===this.buffer.length){let n=new Uint8Array(this.buffer.length*2);n.set(this.buffer),this.buffer=n;}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 Ay(e,t){let r=new Uint8Array(e.length),n=[];for(let u=0;u<e.length;u++)(e[u]??0)>0&&n.push(u);if(n.length===0)return r;if(n.length===1)return r[n[0]]=1,r;let o=n.length,i=2*o-1,s=new Float64Array(i),a=new Int32Array(i),c=new Uint8Array(i);for(let u=1;;u*=2){for(let d=0;d<o;d++)s[d]=Math.max(e[n[d]]??0,u);let l=Array.from({length:o},(d,g)=>g).sort((d,g)=>s[d]-s[g]||d-g),f=0,p=o,m=d=>f<o&&(p>=d||s[l[f]]<=s[p])?l[f++]:p++;for(let d=o;d<i;d++){let g=m(d),y=m(d);s[d]=s[g]+s[y],a[g]=d,a[y]=d;}c[i-1]=0;let h=0;for(let d=i-2;d>=0;d--){let g=c[a[d]]+1;c[d]=g,d<o&&g>h&&(h=g);}if(h<=t){for(let d=0;d<o;d++)r[n[d]]=c[d];return r}}}function U7(e,t){let r=0;for(let n=0;n<t;n++)r=r<<1|e>>n&1;return r}function Ey(e){let t=new Uint16Array(16),r=0;for(let a of e)a>0&&(t[a]=t[a]+1,r++);let n=new Uint16Array(16),o=0;for(let a=1;a<=15;a++)o=o+t[a-1]<<1,n[a]=o;let i=new Uint16Array(e.length),s=new Uint8Array(e.length);return e.forEach((a,c)=>{if(a===0)return;let u=n[a];n[a]=u+1,i[c]=U7(u,a),s[c]=r===1?0:a;}),{lengths:e,codes:i,emitted:s}}function kr(e,t,r){e.write(t.codes[r],t.emitted[r]);}function G7(e){let t=[],r=i=>t.push({code:i,extra:0,extraBits:0}),n=B7,o=0;for(;o<e.length;){let i=e[o],s=1;for(;o+s<e.length&&e[o+s]===i;)s++;o+=s;let a=s;if(i===0){for(;a>0;)if(a<3)for(;a>0;a--)r(0);else if(a<=10)t.push({code:17,extra:a-3,extraBits:3}),a=0;else {let c=Math.min(a,138);t.push({code:18,extra:c-11,extraBits:7}),a-=c;}continue}for(i!==n&&(r(i),n=i,a--);a>0;)if(a<3)for(;a>0;a--)r(i);else {let c=Math.min(a,6);t.push({code:16,extra:c-3,extraBits:2}),a-=c;}}return t}function Q7(e,t){let r=[];if(t.forEach((a,c)=>{a>0&&r.push(c);}),r.length<=2&&r.every(a=>a<256)){let[a=0,c]=r;e.write(1,1),e.write(r.length===2?1:0,1),a<2?(e.write(0,1),e.write(a,1)):(e.write(1,1),e.write(a,8)),c!==void 0&&e.write(c,8);return}let n=G7(t),o=new Uint32Array(19);for(let a of n)o[a.code]=o[a.code]+1;let i=Ey(Ay(o,7)),s=Jd.length;for(;s>4&&i.lengths[Jd[s-1]]===0;)s--;e.write(0,1),e.write(s-4,4);for(let a=0;a<s;a++)e.write(i.lengths[Jd[a]],3);e.write(0,1);for(let a of n)kr(e,i,a.code),e.write(a.extra,a.extraBits);}function ic(e){let t=e-1;if(t<4)return {symbol:t,extra:0,extraBits:0};let r=31-Math.clz32(t),n=t>>r-1&1,o=r-1;return {symbol:2*r+n,extra:t&(1<<o)-1,extraBits:o}}function Sy(e,t,r,n){let o=0;for(;o<n&&e[t+o]===e[t+o-r];)o++;return o}function vy(e,t,r){let n=e.length,o=0;for(;o<n;){let i=Math.min(4096,n-o),s=o>=1?Sy(e,o,1,i):0,a=o>=t?Sy(e,o,t,i):0;if(Math.max(s,a)>=3){a>=s?(r.copy(a,t===1?2:1),o+=a):(r.copy(s,2),o+=s);continue}r.literal(e[o]),o++;}}var Cy=20;function Py(e,t,r){for(let n=0;n<r.length;n++)e[t+n]=r.charCodeAt(n);}function ky(e,t,r){e[t]=r&255,e[t+1]=r>>>8&255,e[t+2]=r>>>16&255,e[t+3]=r>>>24&255;}function Ry(e,t,r){if(!(Number.isInteger(t)&&Number.isInteger(r))||t<1||r<1||t>16384||r>16384)throw new RangeError(`WebP images are 1 to 16384 pixels wide and high (got ${t} \xD7 ${r})`);let n=t*r;if(e.length<n*4)throw new RangeError(`Expected ${n*4} bytes of RGBA for ${t} \xD7 ${r}, got ${e.length}`);let o=new Uint32Array(n),i=false;for(let C=0;C<n;C++){let w=C*4,x=e[w],A=e[w+1],P=e[w+2],E=e[w+3];E!==255&&(i=true),o[C]=(E<<24|(x-A&255)<<16|A<<8|P-A&255)>>>0;}let s=new Uint32Array(280),a=new Uint32Array(256),c=new Uint32Array(256),u=new Uint32Array(256),l=new Uint32Array(40);vy(o,t,{literal(C){s[C>>>8&255]++,a[C>>>16&255]++,c[C&255]++,u[C>>>24]++;},copy(C,w){s[256+ic(C).symbol]++,l[ic(w).symbol]++;}});let f=[s,a,c,u,l].map(C=>Ay(C,15)),[p,m,h,d,g]=f.map(Ey),y=new Xd(Math.ceil(n/4)+1024);y.write(47,8),y.write(t-1,14),y.write(r-1,14),y.write(i?1:0,1),y.write(0,3),y.write(1,1),y.write(2,2),y.write(0,1),y.write(0,1),y.write(0,1);for(let C of f)Q7(y,C);vy(o,t,{literal(C){kr(y,p,C>>>8&255),kr(y,m,C>>>16&255),kr(y,h,C&255),kr(y,d,C>>>24);},copy(C,w){let x=ic(C);kr(y,p,256+x.symbol),y.write(x.extra,x.extraBits);let A=ic(w);kr(y,g,A.symbol),y.write(A.extra,A.extraBits);}});let _=y.finish(),b=_.length+(_.length&1),S=new Uint8Array(Cy+b);return Py(S,0,"RIFF"),ky(S,4,S.length-8),Py(S,8,"WEBPVP8L"),ky(S,16,_.length),S.set(_,Cy),S}function Yd(e,t,r){return String.fromCharCode(...e.subarray(t,t+r))}function V7(e){return e.length>=12&&Yd(e,0,4)==="RIFF"&&Yd(e,8,4)==="WEBP"}function My(e){if(!V7(e))return null;let t=12;for(;t+8<=e.length;){let r=Yd(e,t,4);if(r==="VP8L")return "lossless";if(r==="VP8 ")return "lossy";let n=(e[t+4]|e[t+5]<<8|e[t+6]<<16|e[t+7]<<24)>>>0;t+=8+n+(n&1);}return null}function j7(e,t,r){return typeof e.toBlob!="function"?Promise.resolve(null):new Promise(n=>{try{e.toBlob(n,t,r);}catch{n(null);}})}async function sc(e,t={}){let r=t.quality!==void 0,n=r?Math.min(1,Math.max(0,Number(t.quality))):1,o=await j7(e,"image/webp",n);if(o){let c=new Uint8Array(await o.arrayBuffer()),u=My(c);if(u==="lossless"||r&&u==="lossy")return new Blob([c],{type:"image/webp"})}let i=e.getContext("2d");if(!i)throw new Error("Could not get canvas context");let{data:s}=i.getImageData(0,0,e.width,e.height),a=Ry(s,e.width,e.height);return new Blob([a],{type:"image/webp"})}var Iy=32768;async function di(e){let t=new Uint8Array(await e.arrayBuffer()),r="";for(let n=0;n<t.length;n+=Iy)r+=String.fromCharCode(...t.subarray(n,n+Iy));return `data:${e.type||"application/octet-stream"};base64,${btoa(r)}`}async function Ar(e){let t={...e};if(e.imageSettings?.src)try{let l=await q7(e.imageSettings.src);t={...e,imageSettings:{...e.imageSettings,src:l}};}catch{let{imageSettings:l,...f}=e;t=f;}let{hideLogo:r,url:n,logo:o,scale:i,frameLabelMarkers:s,partMarkers:a,...c}=t,u=wy({...c,templateId:t.templateId,customTemplate:t.customTemplate});return `data:image/svg+xml,${encodeURIComponent(u)}`}var q7=e=>new Promise((t,r)=>{if(e.startsWith("data:")){t(e);return}let n=new Image;n.crossOrigin="anonymous",n.onload=()=>{try{let o=document.createElement("canvas");o.width=n.naturalWidth||n.width,o.height=n.naturalHeight||n.height;let i=o.getContext("2d");if(!i){r(new Error("Could not get canvas context"));return}i.drawImage(n,0,0);let s=o.toDataURL("image/png");o.remove(),t(s);}catch(o){r(new Error(`Failed to convert image to base64: ${o}`));}},n.onerror=()=>{r(new Error(`Could not load image from ${e.slice(0,100)}... Check CORS settings or use a data URL.`));},n.src=e;});async function ac(e,t,r){let n=await Ar(e),o=decodeURIComponent(n.replace("data:image/svg+xml,","")),i;try{let s=new TextEncoder().encode(o),a=Array.from(s,u=>String.fromCharCode(u)).join("");i=`data:image/svg+xml;base64,${btoa(a)}`;}catch(s){throw new Error(`Failed to encode SVG for canvas conversion: ${s}`)}return new Promise((s,a)=>{let c=document.createElement("canvas"),u=c.getContext("2d");if(!u){a(new Error("Could not get canvas context"));return}let l=new Image,{width:f,height:p}=ai(e.size||Je,e.frame);c.width=Math.round(f),c.height=Math.round(p);let m=setTimeout(()=>{c.remove(),a(new Error("SVG load timeout - image may be too large or contain invalid data"));},3e4);l.onload=()=>{clearTimeout(m);try{if(t==="image/jpeg"&&(u.fillStyle="white",u.fillRect(0,0,c.width,c.height)),u.drawImage(l,0,0,c.width,c.height),r)s(c);else if(t==="image/webp")sc(c).then(di).then(s,a).finally(()=>c.remove());else {let h=c.toDataURL(t,1);c.remove(),s(h);}}catch(h){clearTimeout(m),c.remove(),a(new Error(`Failed to draw SVG to canvas: ${h}`));}},l.onerror=()=>{clearTimeout(m),c.remove(),a(new Error("Could not load SVG"));},l.src=i;})}var zy=["gradientUnits","gradientTransform","spreadMethod"],W7={linear:["x1","y1","x2","y2"],radial:["cx","cy","r","fx","fy","fr"]},H7={r:0,g:0,b:0,a:1};function Ny(e,t){for(let r of (e.attrs.style??"").split(";")){let[n,...o]=r.split(":");if(n?.trim()===t)return o.join(":").trim()}return e.attrs[t]}function eh(e){return e.name==="linearGradient"?"linear":e.name==="radialGradient"?"radial":null}function K7(e){let t=[],r=0;for(let n of e.children){if(n.name!=="stop")continue;let o=(n.attrs.offset??"0").trim(),i=Number.parseFloat(o),s=Number.isFinite(i)?o.endsWith("%")?i/100:i:0;r=Math.max(r,Math.min(Math.max(s,0),1));let a=Ny(n,"stop-color")??"#000000",c=Me(a==="currentColor"?"#000000":a)??H7,u=Number.parseFloat(Ny(n,"stop-opacity")??"1");t.push({offset:r,color:Number.isFinite(u)?{...c,a:c.a*Math.min(Math.max(u,0),1)}:c});}return t}function Ty(e){let t=new Map,r=o=>{let i=o.attrs.id;eh(o)&&i&&!t.has(i)&&t.set(i,o);for(let s of o.children)r(s);};r(e);let n=new Map;for(let[o,i]of t){let s=eh(i),a={},c=[],u=new Set,l=i;for(;l&&!u.has(l);){u.add(l);let f=eh(l)===s?[...zy,...W7[s]]:zy;for(let m of f){let h=l.attrs[m];a[m]===void 0&&h!==void 0&&(a[m]=h);}c.length===0&&(c=K7(l));let p=l.attrs.href??l.attrs["xlink:href"];l=p?.startsWith("#")?t.get(p.slice(1)):void 0;}n.set(o,{kind:s,attrs:a,stops:c});}return n}function th(e){let t=Number.POSITIVE_INFINITY,r=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY,o=Number.NEGATIVE_INFINITY,i=(f,p)=>{t=Math.min(t,f),n=Math.max(n,f),r=Math.min(r,p),o=Math.max(o,p);},s=(f,p,m,h)=>{let d=-f+3*p-3*m+h,g=2*(f-2*p+m),y=p-f;if(Math.abs(d)<1e-12)return Math.abs(g)<1e-12?[]:[-y/g];let _=g*g-4*d*y;if(_<0)return [];let b=Math.sqrt(_);return [(-g+b)/(2*d),(-g-b)/(2*d)]},a=(f,p,m,h,d)=>{let g=1-f;return g*g*g*p+3*g*g*f*m+3*g*f*f*h+f**3*d},c=0,u=0,l=[0,0];for(let f of e)if(f.op==="M"&&(l=[f.x,f.y]),f.op==="M"||f.op==="L")i(f.x,f.y),c=f.x,u=f.y;else if(f.op==="C"){i(f.x,f.y);for(let p of [...s(c,f.x1,f.x2,f.x),...s(u,f.y1,f.y2,f.y)])p>0&&p<1&&i(a(p,c,f.x1,f.x2,f.x),a(p,u,f.y1,f.y2,f.y));c=f.x,u=f.y;}else [c,u]=l;return Number.isFinite(t)?{x:t,y:r,width:n-t,height:o-r}:null}var J7=e=>e[0]*e[3]-e[1]*e[2];function Gn(e){let t=J7(e);if(!Number.isFinite(t)||Math.abs(t)<1e-12)return null;let[r,n,o,i,s,a]=e;return [i/t,-n/t,-o/t,r/t,(o*a-i*s)/t,(n*s-r*a)/t]}function Oy(e,t,r){let{kind:n,attrs:o,stops:i}=e,s=i[0],a=i.at(-1);if(!(s&&a)||i.every(w=>w.color.a===0))return null;if(i.length===1)return s.color;let c=o.gradientUnits==="userSpaceOnUse",u=ka;if(!c){let w=th(t);if(!w||w.width<=0||w.height<=0)return null;u=[w.width,0,0,w.height,w.x,w.y];}let l=Ze(u,gr(o.gradientTransform));if(!Gn(l))return a.color;let[f,p]=r,m=Math.sqrt((f*f+p*p)/2),h=(w,x)=>{let A=Number.parseFloat(w);return Number.isFinite(A)?w.trim().endsWith("%")?A/100*(c?x:1):A:null},d=(w,x,A)=>h(o[w]??x,A)??h(x,A)??0;if(n==="linear"){let w=[d("x1","0%",f),d("y1","0%",p),d("x2","100%",f),d("y2","0%",p)],[x,A,P,E]=w;return x===P&&A===E?a.color:{kind:n,coords:w,matrix:l,stops:i}}let g=d("cx","50%",f),y=d("cy","50%",p),_=d("r","50%",m),b=o.fx===void 0?g:d("fx","50%",f),S=o.fy===void 0?y:d("fy","50%",p),C=Math.max(0,d("fr","0%",m));return _<0?null:_===0?a.color:{kind:n,coords:[b,S,C,g,y,_],matrix:l,stops:i}}function Fy(e){return e.map(t=>$(t,6)).join(" ")}function X7(e,t){return (t==="cmyk"?ei(e.r,e.g,e.b):[e.r/255,e.g/255,e.b/255]).map(n=>$(n,4)).join(" ")}var Ly=(e,t)=>`<< /FunctionType 2 /Domain [0 1] /C0 [${e}] /C1 [${t}] /N 1 >>`;function Y7(e,t){let r=[],n=e.map(a=>re(a.offset,4)),o=e.map(a=>X7(a.color,t)),i=n[0],s=n.at(-1);if(i>0){let a=o[0];r.push({from:0,to:i,c0:a,c1:a});}for(let a=0;a+1<e.length;a++){let c=n[a],u=n[a+1];u>c&&r.push({from:c,to:u,c0:o[a],c1:o[a+1]});}if(s<1){let a=o.at(-1);r.push({from:s,to:1,c0:a,c1:a});}if(r.length===1){let[a]=r;return Ly(a.c0,a.c1)}return ["<< /FunctionType 3 /Domain [0 1]",`/Functions [${r.map(a=>Ly(a.c0,a.c1)).join(" ")}]`,`/Bounds [${r.slice(1).map(a=>$(a.from,4)).join(" ")}]`,`/Encode [${r.map(()=>"0 1").join(" ")}] >>`].join(" ")}function Dy(e,t){return [`<< /ShadingType ${e.kind==="linear"?2:3}`,`/ColorSpace /Device${t==="cmyk"?"CMYK":"RGB"}`,`/Coords [${e.coords.map(r=>$(r,6)).join(" ")}]`,`/Function ${Y7(e.stops,t)}`,"/Extend [true true] >>"].join(" ")}function e8(e,t){if(e.op==="Z")return e;if(e.op==="C"){let[o,i]=ye(t,e.x1,e.y1),[s,a]=ye(t,e.x2,e.y2),[c,u]=ye(t,e.x,e.y);return {op:"C",x1:o,y1:i,x2:s,y2:a,x:c,y:u}}let[r,n]=ye(t,e.x,e.y);return {op:e.op,x:r,y:n}}var Zy={r:255,g:255,b:255,a:1},t8=/^url\(\s*#bg-color-/,cc=/^url\(\s*#([^)\s]+)\s*\)/,r8=new Set(["defs","clipPath","mask","pattern","linearGradient","radialGradient","symbol","title","desc","metadata","style","script","use","foreignObject"]);function ve(e,t){let r=e.attrs.style;if(r)for(let n of r.split(";")){let[o,...i]=n.split(":");if(o?.trim()===t)return i.join(":").trim()}return e.attrs[t]}function le(e,t,r=0){if(e===void 0||e==="")return r;let n=Number.parseFloat(e);return Number.isNaN(n)?r:e.trim().endsWith("%")?n/100*t:n}function rh(e,t){if((e.name==="linearGradient"||e.name==="radialGradient")&&e.attrs.id){let r=e.children.find(o=>o.name==="stop"),n=r&&(ve(r,"stop-color")??"#000000");n&&t.set(e.attrs.id,n);}for(let r of e.children)rh(r,t);return t}function nh(e,t){if(e.name==="image"){let r=e.attrs.href??e.attrs["xlink:href"];r&&t.add(r);}for(let r of e.children)nh(r,t);return t}async function By(e){return typeof document>"u"||typeof Image>"u"?null:await new Promise(t=>{let r=new Image;r.crossOrigin="anonymous",r.onload=()=>{let n=document.createElement("canvas"),o=Math.max(r.naturalWidth||512,r.naturalHeight||512),i=Math.min(1024/o,4);n.width=Math.round((r.naturalWidth||512)*i),n.height=Math.round((r.naturalHeight||512)*i);let s=n.getContext("2d");if(!s){t(null);return}s.drawImage(r,0,0,n.width,n.height);try{t(n.toDataURL("image/png"));}catch{t(null);}},r.onerror=()=>t(null),r.src=e;})}function Uy(e,t){e.name==="clipPath"&&e.attrs.id&&t.set(e.attrs.id,e);for(let r of e.children)Uy(r,t);return t}function Gy(e,t){e.name==="pattern"&&e.attrs.id&&t.set(e.attrs.id,e);for(let r of e.children)Gy(r,t);return t}function n8(e,t){let[r,n]=t,o=(i,s)=>le(e.attrs[i],s);switch(e.name){case "path":return _r(e.attrs.d??"");case "rect":{let i=e.attrs.rx??e.attrs.ry,s=e.attrs.ry??e.attrs.rx;return Mn(o("x",r),o("y",n),o("width",r),o("height",n),le(i,r),le(s,n))}case "circle":{let i=o("r",Math.hypot(r,n)/Math.SQRT2);return Wo(o("cx",r),o("cy",n),i,i)}case "ellipse":return Wo(o("cx",r),o("cy",n),o("rx",r),o("ry",n));default:return []}}var uc=class{gradients;shadings;clipPaths=new Map;patterns=new Map;backdrop=Zy;paper=Zy;background=null;onPaper=false;inConic=false;constructor(t,r=null){this.gradients=t,this.shadings=r;}resolveColor(t){if(!t||t==="none")return null;let r=cc.exec(t);if(r)return this.resolveColor(this.gradients.get(r[1]));let n=Me(t==="currentColor"?"#000000":t);return n&&n.a>0?n:null}shadedGradient(t){let r=t?cc.exec(t)?.[1]:void 0;return r?this.shadings?.get(r):void 0}resolveFill(t,r,n,o=1){if(o<=0)return null;let i=this.patternOf(t);if(i)return {pattern:i,alpha:o};let s=this.shadedGradient(t);if(s){let u=Oy(s,r,n);if(!u)return null;if("coords"in u)return {gradient:u,alpha:o};let l={...u,a:u.a*o};return l.a>0?{color:l}:null}let a=this.resolveColor(t);if(!a)return null;let c={...a,a:a.a*o};return c.a>0?{color:c}:null}patternOf(t){let r=t?cc.exec(t)?.[1]:void 0,n=r?this.patterns.get(r):void 0;if(!(n?.attrs.patternUnits!=="userSpaceOnUse"||(n.attrs.patternContentUnits??"userSpaceOnUse")!=="userSpaceOnUse"||n.attrs.viewBox))return n}flatten(t){if(t.a>=1)return t;let r=this.background,n=r!==null&&Math.abs(r.r-t.r)<.5&&Math.abs(r.g-t.g)<.5&&Math.abs(r.b-t.b)<.5&&Math.abs(r.a-t.a)<.002;return ec(t,this.onPaper||n?this.paper:this.backdrop)}paintPattern(t,r,n,o){let i=th(t);if(!i||i.width<=0||i.height<=0)return true;let[s,a]=r.viewport,c=le(n.attrs.x,s),u=le(n.attrs.y,a),l=le(n.attrs.width,s),f=le(n.attrs.height,a);if(!(l>0&&f>0))return true;let p=gr(n.attrs.patternTransform),m=Gn(p);if(!m)return true;if(!this.beginClip(t,r.matrix,r.fillRule==="evenodd"))return false;let h=this.inConic;this.inConic=n.attrs["data-qrdx-conic"]!==void 0;try{let d=[ye(m,i.x,i.y),ye(m,i.x+i.width,i.y),ye(m,i.x,i.y+i.height),ye(m,i.x+i.width,i.y+i.height)],g=d.map(([T])=>T),y=d.map(([,T])=>T),_=Math.min(...g),b=Math.max(...g),S=Math.min(...y),C=Math.max(...y),w=Math.floor((_-c)/l),x=Math.ceil((b-c)/l)-1,A=Math.floor((S-u)/f),P=Math.ceil((C-u)/f)-1,E=(x-w+1)*(P-A+1);if(E>4096)return !0;let I=(n.attrs["data-qrdx-conic"]??"").trim().split(/\s+/).map(Number),N=Ze(r.matrix,p);for(let T=A;T<=P;T++)for(let V=w;V<=x;V++){let Q=c+V*l,F=u+T*f,W=Ze(N,[1,0,0,1,Q,F]),K={x:_-Q,y:S-F,width:b-_,height:C-S},U=I.length===2&&I.every(Number.isFinite)?fy(I[0],I[1],K):null,X=E>1&&this.beginClip([{op:"M",x:0,y:0},{op:"L",x:l,y:0},{op:"L",x:l,y:f},{op:"L",x:0,y:f},{op:"Z"}],W,!1);try{let xe={matrix:W,viewport:r.viewport,fill:"#000000",fillRule:"nonzero",stroke:"none",strokeWidth:1,fontSize:16,fontWeight:"normal",textAnchor:"start",fillOpacity:1,opacity:o},ze=(he,pe)=>{for(let ke of he){if(ke.name==="g"&&!ke.attrs.transform){let J=Number.parseFloat(ke.attrs.opacity??"1");ze(ke.children,{...pe,opacity:(pe.opacity??1)*(Number.isFinite(J)?J:1)});continue}if(U&&ke.attrs["data-arc"]){let[J,kt]=ke.attrs["data-arc"].split(/\s+/).map(Number);if(!py([J,J+kt],U))continue}this.walk(ke,pe);}};ze(n.children,xe);}finally{X&&this.endClip();}}}finally{this.inConic=h,this.endClip();}return true}paintBleed(t,r,n,o){if(!this.shadedGradient(n))return false;let[i,s]=this.viewportMatrix({...t,attrs:{...t.attrs,x:"0",y:"0"}},{...r,matrix:Ze(r.matrix,gr(t.attrs.transform))}),a=Gn(i);if(!a)return false;let[c,u,l,f]=o,m=[[c,u],[l,u],[l,f],[c,f]].map(([h,d])=>ye(a,h,d)).map(([h,d],g)=>({op:g===0?"M":"L",x:h,y:d}));return m.push({op:"Z"}),this.paint(m,{name:"rect",attrs:{},children:[],text:""},{...r,matrix:i,viewport:s,fill:n,fillRule:"nonzero",stroke:"none"}),true}beginClip(t,r,n){return false}endClip(){}clipOf(t,r){let n=ve(t,"clip-path"),o=n?cc.exec(n)?.[1]:void 0,i=o?this.clipPaths.get(o):void 0;if(!i)return null;let s=[],a=false;for(let c of i.children){let u=n8(c,r.viewport);if(u.length===0)continue;let l=gr(c.attrs.transform),f=l[0]===1&&l[1]===0&&l[2]===0&&l[3]===1&&l[4]===0&&l[5]===0;s.push(...f?u:u.map(p=>e8(p,l))),a||=ve(c,"clip-rule")==="evenodd";}return s.length>0?{segments:s,matrix:r.matrix,evenOdd:a}:null}viewportMatrix(t,r){let n=le(t.attrs.x,r.viewport[0]),o=le(t.attrs.y,r.viewport[1]),i=le(t.attrs.width,r.viewport[0],r.viewport[0]),s=le(t.attrs.height,r.viewport[1],r.viewport[1]),a=Ra(t.attrs.viewBox);if(a.length!==4||!(a[2]&&a[3]))return [Ze(r.matrix,[1,0,0,1,n,o]),[i,s]];let[c,u,l,f]=a,p=i/l,m=s/f,h=n,d=o;if((t.attrs.preserveAspectRatio??"").trim()!=="none"){let g=t.attrs.preserveAspectRatio?.includes("slice")?Math.max(p,m):Math.min(p,m);h+=(i-l*g)/2,d+=(s-f*g)/2,p=g,m=g;}return [Ze(r.matrix,[p,0,0,m,h-c*p,d-u*m]),[l,f]]}walk(t,r,n=false){if(n&&(this.clipPaths=Uy(t,new Map),this.patterns=Gy(t,new Map)),r8.has(t.name)||ve(t,"display")==="none"||ve(t,"visibility")==="hidden")return;let o=Ze(r.matrix,gr(t.attrs.transform)),i=r.viewport;if(t.name==="svg"){let[p,m]=this.viewportMatrix(n?{...t,attrs:{...t.attrs,x:"0",y:"0"}}:t,{...r,matrix:o});o=p,i=m;}let s=ve(t,"font-size"),a=Number.parseFloat(ve(t,"opacity")??"1"),c=ve(t,"fill-opacity"),u=c===void 0?r.fillOpacity??1:Number.parseFloat(c),l={fillOpacity:Number.isFinite(u)?Math.min(Math.max(u,0),1):1,opacity:(r.opacity??1)*(Number.isFinite(a)?Math.min(Math.max(a,0),1):1),matrix:o,viewport:i,fill:ve(t,"fill")??r.fill,fillRule:ve(t,"fill-rule")??r.fillRule,stroke:ve(t,"stroke")??r.stroke,strokeWidth:ve(t,"stroke-width")===void 0?r.strokeWidth:le(ve(t,"stroke-width"),i[0],1),fontSize:s===void 0?r.fontSize:le(s,16,16),fontWeight:ve(t,"font-weight")??r.fontWeight,textAnchor:ve(t,"text-anchor")??r.textAnchor},f=this.onPaper;(t.name==="rect"||t.name==="circle"||t.name==="path")&&t8.test(ve(t,"fill")??"")&&(this.onPaper=true);try{let p=t.attrs["clip-path"]?this.clipOf(t,l):null;if(p&&this.beginClip(p.segments,p.matrix,p.evenOdd)){try{this.paintNode(t,l);}finally{this.endClip();}return}this.paintNode(t,l);}finally{this.onPaper=f;}}paintNode(t,r){let[n,o]=r.viewport,i=(s,a)=>le(t.attrs[s],a);switch(t.name){case "path":this.paint(_r(t.attrs.d??""),t,r);return;case "rect":{let s=t.attrs.rx??t.attrs.ry,a=t.attrs.ry??t.attrs.rx;this.paint(Mn(i("x",n),i("y",o),i("width",n),i("height",o),le(s,n),le(a,o)),t,r);return}case "circle":{let s=i("r",Math.hypot(n,o)/Math.SQRT2);this.paint(Wo(i("cx",n),i("cy",o),s,s),t,r);return}case "ellipse":this.paint(Wo(i("cx",n),i("cy",o),i("rx",n),i("ry",o)),t,r);return;case "line":this.paint([{op:"M",x:i("x1",n),y:i("y1",o)},{op:"L",x:i("x2",n),y:i("y2",o)}],t,{...r,fill:"none"});return;case "polygon":case "polyline":{let s=Ra(t.attrs.points),a=[];for(let c=0;c+1<s.length;c+=2)a.push({op:c===0?"M":"L",x:s[c],y:s[c+1]});t.name==="polygon"&&a.length>0&&a.push({op:"Z"}),this.paint(a,t,r);return}case "text":this.text(t,r);return;case "image":this.image(t,r);return;default:for(let s of t.children)this.walk(s,r);}}};var lc=1e3;async function oh(e){let t=await Ar(fc({...e,size:e.size??Je},lc));return decodeURIComponent(t.replace("data:image/svg+xml,",""))}function ih(e){if(jt(e.frame)){let t=Dn(lc,e.frame);return t.squareEdges?t.color:null}return Ae(e.bgColor,Ne)}function sh(e,t){let r=ih(e);if(!(r&&jo(e.bgColor))||jt(e.frame)||e.templateId||e.customTemplate)return r;let n=Ea(t)?.children.find(i=>i.name==="rect"),o=n&&ve(n,"fill");return o?.startsWith("url(")?o:r}function ah(e,t){let r={r:255,g:255,b:255,a:1},n=Me(Ae(t.bgColor,Ne));e.paper=r,e.background=n&&!jo(t.bgColor)?n:null,e.backdrop=n?ec(n,r):r;}var jy=25.4,Qy=5,Vy=2e3,pc=lc,o8=5,i8=2;function s8(e,t="mm"){return t==="in"?e*jy:e}function a8(e){let t=ui(e),r=Ve.QrCode.encodeText(e.value,gt[t]).size;return r+vt(r,e.margin??qn,e.shape)*2}function qy(e,t){let r=s8(t.size,t.unit);if(!Number.isFinite(r)||r<Qy||r>Vy)throw new Error(`Print size must be between ${Qy} mm and ${Vy/1e3} m`);let n=Math.min(Math.max(t.bleed??0,0),20),o=r/pc,i=jt(e.frame)?Dn(pc,e.frame):null,s=(i?.width??pc)*o,a=(i?.height??pc)*o,c=t.cropMarks?n+i8+o8+1:n,u=a8(e);return {codeWidth:r,trimWidth:s,trimHeight:a,bleed:n,pageWidth:s+2*c,pageHeight:a+2*c,trimX:c,trimY:c,moduleSize:r/u,moduleCount:u,maxScanDistance:r*10}}var c8=[137,80,78,71,13,10,26,10];async function Hy(e,t){let r=new Blob([e]).stream().pipeThrough(t);return new Uint8Array(await new Response(r).arrayBuffer())}async function Ky(e){return typeof CompressionStream>"u"?null:await Hy(e,new CompressionStream("deflate"))}async function u8(e){if(typeof DecompressionStream>"u")return null;try{return await Hy(e,new DecompressionStream("deflate"))}catch{return null}}var ch=(e,t)=>e[t]*2**24+(e[t+1]<<16)+(e[t+2]<<8)+e[t+3]>>>0,Wy={0:1,2:3,3:1,4:2,6:4};function l8(e,t,r){let n=e+t-r,o=Math.abs(n-e),i=Math.abs(n-t),s=Math.abs(n-r);return o<=i&&o<=s?e:i<=s?t:r}async function Jy(e){if(c8.some((d,g)=>e[g]!==d))return null;let t=8,r=0,n=0,o=-1,i=null,s=null,a=[];for(;t+8<=e.length;){let d=ch(e,t),g=String.fromCharCode(...e.subarray(t+4,t+8)),y=e.subarray(t+8,t+8+d);if(t+=12+d,g==="IHDR"){r=ch(y,0),n=ch(y,4);let _=y[8];o=y[9];let b=y[12];if(_!==8||b!==0||!(o in Wy))return null}else if(g==="PLTE")i=y;else if(g==="tRNS")s=y;else if(g==="IDAT")a.push(y);else if(g==="IEND")break}if(!(r&&n)||r*n>4096*4096)return null;let c=new Uint8Array(a.reduce((d,g)=>d+g.length,0)),u=0;for(let d of a)c.set(d,u),u+=d.length;let l=await u8(c),f=Wy[o],p=r*f;if(!l||l.length<n*(p+1))return null;let m=new Uint8Array(n*p);for(let d=0;d<n;d++){let g=l[d*(p+1)],y=l.subarray(d*(p+1)+1,(d+1)*(p+1)),_=d*p;for(let b=0;b<p;b++){let S=b>=f?m[_+b-f]:0,C=d>0?m[_-p+b]:0,w=d>0&&b>=f?m[_-p+b-f]:0,x=y[b],A=0;g===1?A=S:g===2?A=C:g===3?A=S+C>>1:g===4&&(A=l8(S,C,w)),m[_+b]=x+A&255;}}let h=new Uint8Array(r*n*4);for(let d=0;d<r*n;d++){let g=d*4,y=d*f;if(o===3){let _=m[y];h[g]=i?.[_*3]??0,h[g+1]=i?.[_*3+1]??0,h[g+2]=i?.[_*3+2]??0,h[g+3]=s?.[_]??255;}else if(o===0||o===4){let _=m[y];h[g]=_,h[g+1]=_,h[g+2]=_,h[g+3]=o===4?m[y+1]:255;}else h[g]=m[y],h[g+1]=m[y+1],h[g+2]=m[y+2],h[g+3]=o===6?m[y+3]:255;}return {width:r,height:n,data:h}}var f8=25.4,Xy=72/f8,p8=50;function m8(e){let t=/^data:[^,]*?(;base64)?,(.*)$/s.exec(e);if(!t)return null;try{let r=t[1]?atob(t[2]):decodeURIComponent(t[2]),n=new Uint8Array(r.length);for(let o=0;o<r.length;o++)n[o]=r.charCodeAt(o)&255;return n}catch{return null}}function d8(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 r=e[t+1];if(r===216||r>=208&&r<=215){t+=2;continue}let n=e[t+2]<<8|e[t+3];if(r===192||r===193||r===194){let o=e[t+5]<<8|e[t+6],i=e[t+7]<<8|e[t+8],s=e[t+9];return {width:i,height:o,components:s,progressive:r===194}}t+=2+n;}return null}async function h8(e,t){let{width:r,height:n,data:o}=e,i=t?4:3,s=new Uint8Array(r*n*i);for(let c=0;c<r*n;c++){let u=o[c*4+3]/255,l=o[c*4]*u+255*(1-u),f=o[c*4+1]*u+255*(1-u),p=o[c*4+2]*u+255*(1-u);if(t){let[m,h,d,g]=ei(l,f,p);s.set([m*255,h*255,d*255,g*255].map(Math.round),c*i);}else s.set([Math.round(l),Math.round(f),Math.round(p)],c*i);}let a=await Ky(s);return {kind:"raw",width:r,height:n,components:i,bytes:a??s,compressed:!!a}}async function g8(e,t){let r=e;if(!/^data:image\/(png|jpe?g)[;,]/i.test(r)){let s=await By(r);if(!s)return null;r=s;}let n=m8(r);if(!n)return null;let o=d8(n);if(o)return o.components===1||o.components===3?{kind:"jpeg",width:o.width,height:o.height,components:o.components,bytes:n,progressive:o.progressive}:null;let i=await Jy(n);return i?await h8(i,t):null}function _8(e){let t="",r=0,n=o=>{t+=o,r+=o.length,r>=76&&(t+=`
63
+ `,r=0);};for(let o=0;o<e.length;o+=4){let i=Math.min(4,e.length-o),s=0;for(let c=0;c<4;c++)s=s*256+(c<i?e[o+c]:0);if(s===0&&i===4){n("z");continue}let a=[];for(let c=0;c<5;c++)a.unshift(String.fromCharCode(s%85+33)),s=Math.floor(s/85);n(a.slice(0,i+1).join(""));}return `${t}~>`}var y8=`/qrdxdict 40 dict def
64
64
  qrdxdict begin
65
65
  /m {moveto} bind def
66
66
  /l {lineto} bind def
@@ -81,11 +81,11 @@ qrdxdict begin
81
81
  } bind def
82
82
  /QRDX-Regular /Helvetica latin1
83
83
  /QRDX-Bold /Helvetica-Bold latin1
84
- end`;function nh(e){let t="(";for(let r of e){let n=r.codePointAt(0)??63;r==="("||r===")"||r==="\\"?t+=`\\${r}`:n>=32&&n<127?t+=r:n>=160&&n<=255?t+=`\\${n.toString(8).padStart(3,"0")}`:t+="?";}return `${t})`}var oh=class extends nc{out=[];shadingNames=new Map;cmyk;images;usesLevel3=false;constructor(t,r,n,o){super(r,n),this.cmyk=t,this.images=o;}color(t){if(this.cmyk){let[r,n,o,i]=Xo(t.r,t.g,t.b);return `${$(r)} ${$(n)} ${$(o)} ${$(i)} cmyk`}return `${$(t.r/255)} ${$(t.g/255)} ${$(t.b/255)} rg`}tracePath(t,r){let n=["n"],o=false;for(let i of t)if(i.op==="M"||i.op==="L"&&!o){let[s,a]=be(r,i.x,i.y);n.push(`${$(s)} ${$(a)} m`),o=true;}else if(i.op==="L"){let[s,a]=be(r,i.x,i.y);n.push(`${$(s)} ${$(a)} l`);}else if(i.op==="C"){if(!o)continue;let[s,a]=be(r,i.x1,i.y1),[c,u]=be(r,i.x2,i.y2),[l,f]=be(r,i.x,i.y);n.push(`${$(s)} ${$(a)} ${$(c)} ${$(u)} ${$(l)} ${$(f)} c`);}else o&&n.push("h");return n.join(" ")}beginClip(t,r,n){return this.out.push(`gsave ${this.tracePath(t,r)} ${n?"eoclip":"clip"} n`),true}endClip(){this.out.push("grestore");}rect(t,r,n,o,i){this.out.push(`${this.color(t)} n ${$(r)} ${$(n)} m ${$(r+o)} ${$(n)} l ${$(r+o)} ${$(n+i)} l ${$(r)} ${$(n+i)} l h f`);}shade(t,r,n){let o=Fe(r.matrix,n.matrix);if(!Bn(o))return;let i=ky(n,this.cmyk?"cmyk":"rgb"),s=this.shadingNames.get(i);s||(s=`Sh${this.shadingNames.size}`,this.shadingNames.set(i,s)),this.usesLevel3=true;let a=r.fillRule==="evenodd"?"eoclip":"clip";this.out.push(`gsave ${this.tracePath(t,r.matrix)} ${a} n [${Py(o)}] concat ${s} shfill grestore`);}paint(t,r,n){if(t.length===0)return;let o=n.opacity??1;if(o<=0)return;let i=this.resolveFill(n.fill,t,n.viewport,(n.fillOpacity??1)*o);i&&"pattern"in i?this.paintPattern(t,n,i.pattern,i.alpha):i&&"gradient"in i&&this.shade(t,n,{...i.gradient,stops:i.gradient.stops.map(f=>({...f,color:this.flatten({...f.color,a:f.color.a*i.alpha})}))});let s=i&&"color"in i?this.flatten(i.color):null,a=n.strokeWidth>0?this.resolveColor(n.stroke):null,c=a&&this.flatten({...a,a:a.a*o});if(!(s||c))return;let u=this.tracePath(t,n.matrix),l=n.fillRule==="evenodd"?"ef":"f";s&&c?this.out.push(`gsave ${this.color(s)} ${u} ${l} grestore`):s&&this.out.push(`${this.color(s)} ${u} ${l}`),c&&this.out.push(`${this.color(c)} ${$(n.strokeWidth*ed(n.matrix))} w ${u} s`);}text(t,r){let n=t.text.replace(/\s+/g," ").trim(),o=this.resolveColor(r.fill);if(!(n&&o))return;let i=ed(r.matrix),[s,a]=be(r.matrix,fe(t.attrs.x,r.viewport[0]),fe(t.attrs.y,r.viewport[1])),u=r.fontWeight==="bold"||Number.parseInt(r.fontWeight,10)>=600?"/QRDX-Bold":"/QRDX-Regular",l=$(r.fontSize*i),f=Number.parseFloat(t.attrs["data-max-width"]??""),p=f>0?` dup stringwidth pop dup ${$(f*i)} gt {${$(f*i)} exch div ${l} mul ${u} findfont exch scalefont setfont} {pop} ifelse`:"",m=r.textAnchor==="middle"?" dup stringwidth pop 2 div neg 0 rmoveto":r.textAnchor==="end"?" dup stringwidth pop neg 0 rmoveto":"",h=Math.atan2(r.matrix[1],r.matrix[0])*180/Math.PI;if(Math.abs(h)>.01){this.out.push(`gsave ${this.color(o)} ${u} findfont ${l} scalefont setfont ${$(s)} ${$(a)} translate ${$(h)} rotate ${nh(n)}${p} 0 0 moveto${m} show grestore`);return}this.out.push(`gsave ${this.color(o)} ${u} findfont ${l} scalefont setfont ${nh(n)}${p} ${$(s)} ${$(a)} moveto${m} show grestore`);}image(t,r){let n=t.attrs.href??t.attrs["xlink:href"],o=n?this.images.get(n):void 0;if(!o)return;let i=fe(t.attrs.x,r.viewport[0]),s=fe(t.attrs.y,r.viewport[1]),a=fe(t.attrs.width,r.viewport[0]),c=fe(t.attrs.height,r.viewport[1]);if(a<=0||c<=0)return;let[u,l]=be(r.matrix,i,s),[f,p]=be(r.matrix,i+a,s+c),{components:m}=o,h=m===1?"/DeviceGray":m===4?"/DeviceCMYK":"/DeviceRGB",d=Array.from({length:m},()=>"0 1").join(" "),g="/ASCII85Decode filter";o.kind==="jpeg"?(g+=" /DCTDecode filter",o.progressive&&(this.usesLevel3=true)):o.compressed&&(g+=" /FlateDecode filter",this.usesLevel3=true),this.out.push(["gsave",`${$(Math.min(u,f))} ${$(Math.min(l,p))} translate ${$(Math.abs(f-u))} ${$(Math.abs(p-l))} scale`,`${h} setcolorspace`,`<< /ImageType 1 /Width ${o.width} /Height ${o.height} /BitsPerComponent 8 /Decode [${d}] /ImageMatrix [${o.width} 0 0 -${o.height} 0 ${o.height}] /DataSource currentfile ${g} >> image`,e8(o.bytes),"grestore"].join(`
85
- `));}};async function r8(e,t={}){let r=va(e);if(!r)throw new Error("Could not read the SVG to convert to EPS");let n=fe(r.attrs.width,0,0)||512,o=fe(r.attrs.height,0,0)||n,i=t.width??n;if(!(Number.isFinite(i)&&i>0))throw new Error("EPS width must be a positive number of points");let s=i/n,a=o*s,c=Math.max(0,t.bleed??0),u=i+2*c,l=a+2*c,f=t.colorMode==="cmyk",p=new Map;for(let _ of Jd(r,new Set)){let b=await Y7(_,f);b&&p.set(_,b);}let m=new oh(f,Kd(r,new Map),Sy(r),p);th(m,{bgColor:t.background??"#ffffff"});let d={matrix:Fe([1,0,0,-1,c,l-c],[s,0,0,s,0,0]),viewport:[n,o],fill:"#000000",fillRule:"nonzero",stroke:"none",strokeWidth:1,fontSize:16,fontWeight:"normal",textAnchor:"start"},g=c>0?t.bleedColor??void 0:void 0;if(!(g&&m.paintBleed(r,d,g,[0,0,u,l]))){let _=g?m.resolveColor(g):null;_&&m.rect(_,0,0,u,l);}m.walk(r,d,true);let y=(t.title??"QR code").replace(/[^\x20-\x7e]/g,"?");return ["%!PS-Adobe-3.0 EPSF-3.0",`%%BoundingBox: 0 0 ${Math.ceil(u)} ${Math.ceil(l)}`,`%%HiResBoundingBox: 0 0 ${$(u)} ${$(l)}`,`%%Title: ${nh(y)}`,"%%Creator: qrdx",`%%LanguageLevel: ${m.usesLevel3?3:2}`,"%%DocumentData: Clean7Bit","%%EndComments","%%BeginProlog",t8,"%%EndProlog","qrdxdict begin",...Array.from(m.shadingNames,([_,b])=>`/${b} ${_} def`),"gsave",...m.out,"grestore","end","showpage","%%Trailer","%%EOF",""].join(`
86
- `)}var n8="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 o8(e){return [e.bgColor,e.fgColor,e.eyeColor,e.dotColor,...Object.values(e.eyeColors??{}).flatMap(r=>[r?.outer,r?.inner])].some(r=>typeof r=="object"&&r?.type==="image")}async function By(e,t={}){if(o8(e))throw new Error(n8);let r=Ly(e,{size:t.sizeMm??H7,unit:"mm",bleed:t.bleedMm}),n=await Xd(e);return await r8(n,{width:r.trimWidth*Zy,bleed:r.bleed*Zy,bleedColor:r.bleed>0?eh(e,n):Yd(e),colorMode:t.colorMode,background:Ve(e.bgColor,Ie)})}function Uy(e){return `data:application/postscript;base64,${btoa(e)}`}var ih={png:{mimeType:"image/png",extension:"png",vector:false},jpg:{mimeType:"image/jpeg",extension:"jpg",vector:false},webp:{mimeType:"image/webp",extension:"webp",vector:false},svg:{mimeType:"image/svg+xml",extension:"svg",vector:true},pdf:{mimeType:"application/pdf",extension:"pdf",vector:false},eps:{mimeType:"application/postscript",extension:"eps",vector:true}};function Gy(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 ic(e,t){let{imageSettings:r,size:n}=e;if(!(r&&n)||n===t)return {...e,size:t};let o=t/n;return {...e,size:t,imageSettings:{...r,width:r.width*o,height:r.height*o,...r.x!=null&&{x:r.x*o},...r.y!=null&&{y:r.y*o},...r.padding!=null&&{padding:r.padding*o}}}}function ui(e,t){let r=document.createElement("a");r.href=e,r.download=t,document.body.appendChild(r),r.click(),document.body.removeChild(r);}var Qy=e=>(ih[e]??ih.png).mimeType;function i8(e,t,r){let{extension:n,vector:o}=ih[e];if(o)return `qr-code.${n}`;let{width:i,height:s}=ri(t.width,r);return `qr-code-${Math.round(i)}x${Math.round(s)}.${n}`}async function Vy(e,t={}){let r=await tc(e,"image/webp",true);try{return await ec(r,t)}finally{r.remove();}}var s8=25.4/72;async function jy(e){let t=await By(e,{sizeMm:(e.size??Je)*s8});return Uy(t)}async function qy(e){let t;try{({jsPDF:t}=await import('jspdf'));}catch(p){throw new Error(`PDF export needs the optional "jspdf" package. Install it with \`npm install jspdf\`. (${p})`)}let r=await kr(e),n=decodeURIComponent(r.replace("data:image/svg+xml,","")),o;try{let p=new TextEncoder().encode(n),m=Array.from(p,d=>String.fromCharCode(d)).join("");o=`data:image/svg+xml;base64,${btoa(m)}`;}catch(p){throw new Error(`Failed to encode SVG for PDF conversion: ${p}`)}let{width:i,height:s}=ri(e.size||Je,e.frame),a=await new Promise((p,m)=>{let h=new Image,d=document.createElement("canvas");d.width=Math.round(i),d.height=Math.round(s);let g=d.getContext("2d");if(!g){m(new Error("Could not get canvas context"));return}let y=setTimeout(()=>{d.remove(),m(new Error("SVG load timeout - image may be too large or contain invalid data"));},3e4);h.onload=()=>{clearTimeout(y);try{g.drawImage(h,0,0,d.width,d.height),p(d);}catch(_){clearTimeout(y),d.remove(),m(new Error(`Failed to draw image to canvas: ${_}`));}},h.onerror=()=>{clearTimeout(y),d.remove(),m(new Error("Could not load SVG for PDF conversion"));},h.src=o;}),c=a.toDataURL("image/png",1),u=i*.264583,l=s*.264583,f=new t({orientation:u>l?"landscape":"portrait",unit:"mm",format:[u,l]});return f.addImage(c,"PNG",0,0,u,l),a.remove(),f.output("dataurlstring")}async function Wy(e,t){let{format:r,size:n,filename:o,quality:i}=t,s=Gy(n.width,n.height);if(!s.isValid)throw new Error(s.error);let a=ic(e,n.width),c=o||i8(r,n,e.frame);try{if(r==="svg"){let u=await kr(a);ui(u,c);}else if(r==="pdf"){let u=await qy(a);ui(u,c);}else if(r==="eps")ui(await jy(a),c);else if(r==="webp"){let u=await Vy(a,{quality:i});ui(await ci(u),c);}else {let u=Qy(r),l=await tc(a,u);if(typeof l=="string")ui(l,c);else throw new Error("Failed to generate image data URL")}}catch(u){throw console.error(`Error downloading ${r.toUpperCase()}:`,u),u}}async function Hy(e,t,r,n={}){let o=Gy(r.width,r.height);if(!o.isValid)throw new Error(o.error);let i=ic(e,r.width);if(t==="svg")return await kr(i);if(t==="pdf")return await qy(i);if(t==="eps")return await jy(i);if(t==="webp")return await ci(await Vy(i,n));let s=Qy(t),a=await tc(i,s);if(typeof a=="string")return a;throw new Error("Failed to generate QR code data URL")}var ac={value:["value","string"],size:["size","number"],level:["level","level"],"fg-color":["fgColor","string"],"bg-color":["bgColor","string"],"eye-color":["eyeColor","string"],"dot-color":["dotColor","string"],"body-pattern":["bodyPattern","string"],"corner-eye-pattern":["cornerEyePattern","string"],"corner-eye-dot-pattern":["cornerEyeDotPattern","string"],margin:["margin","number"],"template-id":["templateId","string"],"module-scale":["moduleScale","number"],"auto-level":["autoLevel","boolean"],shape:["shape","string"]},Ky=[...Object.values(ac).map(([e])=>e),"frame","imageSettings","eyeColors","art","customTemplate","customProps"],a8=new Set(["L","M","Q","H"]),c8="QR code",Yy=Symbol.for("qrdx.code-element"),u8=/^[a-z][a-z0-9._]*(?:-[a-z0-9._]*)+$/,eb=":host{display:inline-block}:host([hidden]){display:none}svg{display:block;max-width:100%;height:auto}";function l8(e,t){switch(e){case "number":{let r=t.trim()===""?Number.NaN:Number(t);return Number.isFinite(r)?r:void 0}case "level":{let r=t.trim().toUpperCase();return a8.has(r)?r:void 0}case "boolean":return t!=="false";default:return t}}function tb(e){let t={};for(let r of Object.keys(e))e[r]!==void 0&&e[r]!==null&&(t[r]=e[r]);return t}function f8(e,t){let r=e["aria-label"];return t?.trim()||typeof r=="string"&&r.trim()||c8}function rb(e,t){return {...e,part:"svg",role:"img","aria-label":f8(e,t)}}var Jy=(e,t)=>{let r=t??e.size??Je;return {width:r,height:r}},p8=typeof HTMLElement>"u"?class{}:HTMLElement,li=class e extends p8{static observedAttributes=[...Object.keys(ac),"label","props"];static[Yy]=true;#r;#t={};#s;#o;#e=null;#a="";#n=true;#c=false;static{for(let t of Ky)Object.defineProperty(e.prototype,t,{configurable:true,enumerable:true,get(){return this.#t[t]},set(r){this.#f(t,r);}});}constructor(){super(),this.#r=this.shadowRoot??this.attachShadow({mode:"open"});let t=null;for(let r of Array.from(this.#r.children))r.localName==="style"?t=r:r.localName==="svg"&&(this.#e=r);t||(t=this.ownerDocument.createElement("style"),t.textContent=eb,this.#r.prepend(t));for(let r of [...Ky,"props","label"])if(Object.hasOwn(this,r)){let n=this[r];delete this[r],this[r]=n;}}connectedCallback(){this.#n&&this.#l();}attributeChangedCallback(t,r,n){if(r===n)return;if(t==="label"){this.#o=n??void 0,this.#i();return}if(t==="props"){this.#p(n);return}let o=ac[t];if(o){let[i,s]=o;this.#f(i,n===null?void 0:l8(s,n));}}get props(){return this.#s}set props(t){if(typeof t=="string"){this.#p(t);return}this.#s=t??void 0,this.#i();}get label(){return this.#o}set label(t){this.#o=t??void 0,this.#i();}get options(){return tb({...this.#s,...this.#t})}get svg(){return this.#n&&this.isConnected&&this.#l(),this.#e}toSVGString(){return ct(Zn(this.#u()))}async toDataURL(t="png",r={}){let n=this.#u();return await Hy(n,t,Jy(n,r.size),{quality:r.quality})}async download(t={}){let r=this.#u();return await Wy(r,{format:t.format??"png",size:Jy(r,t.size),filename:t.filename,quality:t.quality})}#u(){let t=this.options;if(!t.value)throw new Error(`qrdx: <${this.localName}> has no value`);return t}#f(t,r){if(r==null){if(!(t in this.#t))return;delete this.#t[t];}else {if(this.#t[t]===r)return;this.#t[t]=r;}this.#i();}#p(t){if(t===null||t.trim()===""){this.props=void 0;return}try{let r=JSON.parse(t);if(!r||typeof r!="object"||Array.isArray(r))throw new TypeError("props must be a JSON object");this.props=r;}catch(r){this.#d(r);}}#i(){this.#n=true,!this.#c&&(this.#c=true,queueMicrotask(()=>{this.#c=false,this.#n&&this.isConnected&&this.#l();}));}#l(){this.#n=false;let t=this.options;if(!t.value){this.#m();return}let r,n;try{r=Zn(rb(t,this.#o)),n=ct(r);}catch(i){this.#m(),this.#d(i);return}if(this.#e&&n===this.#a)return;let o=Qd(r,this.ownerDocument).firstChild;this.#e?.parentNode===this.#r?this.#e.replaceWith(o):this.#r.append(o),this.#e=o,this.#a=n;}#m(){this.#e?.remove(),this.#e=null,this.#a="";}#d(t){let r=new CustomEvent("qrdx-error",{cancelable:true,detail:{error:t}});this.dispatchEvent(r)&&console.error(`qrdx: <${this.localName}> could not draw its code`,t);}},Xy;function eA(e="qrdx-code"){let t=globalThis.customElements;if(!t)return li;let r=t.get(e);if(r){if(Yy in r)return r;throw new Error(`qrdx: <${e}> is already defined by another element; pass defineQRdxCode another tag name`)}let n=Xy===void 0?li:class extends li{};return t.define(e,n),Xy??=e,n}var m8=e=>e.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;");function d8(e){let t=[],r={...e};for(let[n,[o,i]]of Object.entries(ac)){let s=e[o];(i==="number"&&typeof s=="number"||i==="boolean"&&typeof s=="boolean"||i!=="number"&&i!=="boolean"&&typeof s=="string")&&(delete r[o],i==="boolean"?s&&t.push([n,""]):t.push([n,String(s)]));}return {attributes:t,rest:r}}function tA(e,{tagName:t="qrdx-code",label:r}={}){if(!u8.test(t))throw new Error(`qrdx: ${t} is not a custom element name`);let n=tb(e),{attributes:o,rest:i}=d8(n),{customTemplate:s,...a}=i;r!==void 0&&o.push(["label",r]),Object.keys(a).length>0&&o.push(["props",JSON.stringify(a)]);let c=o.map(([l,f])=>f===""?` ${l}`:` ${l}="${m8(f)}"`).join(""),u=n.value?ct(Zn(rb(n,r))):"";return `<${t}${c}><template shadowrootmode="open"><style>${eb}</style>${u}</template></${t}>`}/**
84
+ end`;function uh(e){let t="(";for(let r of e){let n=r.codePointAt(0)??63;r==="("||r===")"||r==="\\"?t+=`\\${r}`:n>=32&&n<127?t+=r:n>=160&&n<=255?t+=`\\${n.toString(8).padStart(3,"0")}`:t+="?";}return `${t})`}var lh=class extends uc{out=[];shadingNames=new Map;cmyk;images;usesLevel3=false;constructor(t,r,n,o){super(r,n),this.cmyk=t,this.images=o;}color(t){if(this.cmyk){let[r,n,o,i]=ei(t.r,t.g,t.b);return `${$(r)} ${$(n)} ${$(o)} ${$(i)} cmyk`}return `${$(t.r/255)} ${$(t.g/255)} ${$(t.b/255)} rg`}tracePath(t,r){let n=["n"],o=false;for(let i of t)if(i.op==="M"||i.op==="L"&&!o){let[s,a]=ye(r,i.x,i.y);n.push(`${$(s)} ${$(a)} m`),o=true;}else if(i.op==="L"){let[s,a]=ye(r,i.x,i.y);n.push(`${$(s)} ${$(a)} l`);}else if(i.op==="C"){if(!o)continue;let[s,a]=ye(r,i.x1,i.y1),[c,u]=ye(r,i.x2,i.y2),[l,f]=ye(r,i.x,i.y);n.push(`${$(s)} ${$(a)} ${$(c)} ${$(u)} ${$(l)} ${$(f)} c`);}else o&&n.push("h");return n.join(" ")}beginClip(t,r,n){return this.out.push(`gsave ${this.tracePath(t,r)} ${n?"eoclip":"clip"} n`),true}endClip(){this.out.push("grestore");}rect(t,r,n,o,i){this.out.push(`${this.color(t)} n ${$(r)} ${$(n)} m ${$(r+o)} ${$(n)} l ${$(r+o)} ${$(n+i)} l ${$(r)} ${$(n+i)} l h f`);}shade(t,r,n){let o=Ze(r.matrix,n.matrix);if(!Gn(o))return;let i=Dy(n,this.cmyk?"cmyk":"rgb"),s=this.shadingNames.get(i);s||(s=`Sh${this.shadingNames.size}`,this.shadingNames.set(i,s)),this.usesLevel3=true;let a=r.fillRule==="evenodd"?"eoclip":"clip";this.out.push(`gsave ${this.tracePath(t,r.matrix)} ${a} n [${Fy(o)}] concat ${s} shfill grestore`);}paint(t,r,n){if(t.length===0)return;let o=n.opacity??1;if(o<=0)return;let i=this.resolveFill(n.fill,t,n.viewport,(n.fillOpacity??1)*o);i&&"pattern"in i?this.paintPattern(t,n,i.pattern,i.alpha):i&&"gradient"in i&&this.shade(t,n,{...i.gradient,stops:i.gradient.stops.map(f=>({...f,color:this.flatten({...f.color,a:f.color.a*i.alpha})}))});let s=i&&"color"in i?this.flatten(i.color):null,a=n.strokeWidth>0?this.resolveColor(n.stroke):null,c=a&&this.flatten({...a,a:a.a*o});if(!(s||c))return;let u=this.tracePath(t,n.matrix),l=n.fillRule==="evenodd"?"ef":"f";s&&c?this.out.push(`gsave ${this.color(s)} ${u} ${l} grestore`):s&&this.out.push(`${this.color(s)} ${u} ${l}`),c&&this.out.push(`${this.color(c)} ${$(n.strokeWidth*sd(n.matrix))} w ${u} s`);}text(t,r){let n=t.text.replace(/\s+/g," ").trim(),o=this.resolveColor(r.fill);if(!(n&&o))return;let i=sd(r.matrix),[s,a]=ye(r.matrix,le(t.attrs.x,r.viewport[0]),le(t.attrs.y,r.viewport[1])),u=r.fontWeight==="bold"||Number.parseInt(r.fontWeight,10)>=600?"/QRDX-Bold":"/QRDX-Regular",l=$(r.fontSize*i),f=Number.parseFloat(t.attrs["data-max-width"]??""),p=f>0?` dup stringwidth pop dup ${$(f*i)} gt {${$(f*i)} exch div ${l} mul ${u} findfont exch scalefont setfont} {pop} ifelse`:"",m=r.textAnchor==="middle"?" dup stringwidth pop 2 div neg 0 rmoveto":r.textAnchor==="end"?" dup stringwidth pop neg 0 rmoveto":"",h=Math.atan2(r.matrix[1],r.matrix[0])*180/Math.PI;if(Math.abs(h)>.01){this.out.push(`gsave ${this.color(o)} ${u} findfont ${l} scalefont setfont ${$(s)} ${$(a)} translate ${$(h)} rotate ${uh(n)}${p} 0 0 moveto${m} show grestore`);return}this.out.push(`gsave ${this.color(o)} ${u} findfont ${l} scalefont setfont ${uh(n)}${p} ${$(s)} ${$(a)} moveto${m} show grestore`);}image(t,r){let n=t.attrs.href??t.attrs["xlink:href"],o=n?this.images.get(n):void 0;if(!o)return;let i=le(t.attrs.x,r.viewport[0]),s=le(t.attrs.y,r.viewport[1]),a=le(t.attrs.width,r.viewport[0]),c=le(t.attrs.height,r.viewport[1]);if(a<=0||c<=0)return;let[u,l]=ye(r.matrix,i,s),[f,p]=ye(r.matrix,i+a,s+c),{components:m}=o,h=m===1?"/DeviceGray":m===4?"/DeviceCMYK":"/DeviceRGB",d=Array.from({length:m},()=>"0 1").join(" "),g="/ASCII85Decode filter";o.kind==="jpeg"?(g+=" /DCTDecode filter",o.progressive&&(this.usesLevel3=true)):o.compressed&&(g+=" /FlateDecode filter",this.usesLevel3=true),this.out.push(["gsave",`${$(Math.min(u,f))} ${$(Math.min(l,p))} translate ${$(Math.abs(f-u))} ${$(Math.abs(p-l))} scale`,`${h} setcolorspace`,`<< /ImageType 1 /Width ${o.width} /Height ${o.height} /BitsPerComponent 8 /Decode [${d}] /ImageMatrix [${o.width} 0 0 -${o.height} 0 ${o.height}] /DataSource currentfile ${g} >> image`,_8(o.bytes),"grestore"].join(`
85
+ `));}};async function b8(e,t={}){let r=Ea(e);if(!r)throw new Error("Could not read the SVG to convert to EPS");let n=le(r.attrs.width,0,0)||512,o=le(r.attrs.height,0,0)||n,i=t.width??n;if(!(Number.isFinite(i)&&i>0))throw new Error("EPS width must be a positive number of points");let s=i/n,a=o*s,c=Math.max(0,t.bleed??0),u=i+2*c,l=a+2*c,f=t.colorMode==="cmyk",p=new Map;for(let _ of nh(r,new Set)){let b=await g8(_,f);b&&p.set(_,b);}let m=new lh(f,rh(r,new Map),Ty(r),p);ah(m,{bgColor:t.background??"#ffffff"});let d={matrix:Ze([1,0,0,-1,c,l-c],[s,0,0,s,0,0]),viewport:[n,o],fill:"#000000",fillRule:"nonzero",stroke:"none",strokeWidth:1,fontSize:16,fontWeight:"normal",textAnchor:"start"},g=c>0?t.bleedColor??void 0:void 0;if(!(g&&m.paintBleed(r,d,g,[0,0,u,l]))){let _=g?m.resolveColor(g):null;_&&m.rect(_,0,0,u,l);}m.walk(r,d,true);let y=(t.title??"QR code").replace(/[^\x20-\x7e]/g,"?");return ["%!PS-Adobe-3.0 EPSF-3.0",`%%BoundingBox: 0 0 ${Math.ceil(u)} ${Math.ceil(l)}`,`%%HiResBoundingBox: 0 0 ${$(u)} ${$(l)}`,`%%Title: ${uh(y)}`,"%%Creator: qrdx",`%%LanguageLevel: ${m.usesLevel3?3:2}`,"%%DocumentData: Clean7Bit","%%EndComments","%%BeginProlog",y8,"%%EndProlog","qrdxdict begin",...Array.from(m.shadingNames,([_,b])=>`/${b} ${_} def`),"gsave",...m.out,"grestore","end","showpage","%%Trailer","%%EOF",""].join(`
86
+ `)}var $8="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 x8(e){return [e.bgColor,e.fgColor,e.eyeColor,e.dotColor,...Object.values(e.eyeColors??{}).flatMap(r=>[r?.outer,r?.inner])].some(r=>typeof r=="object"&&r?.type==="image")}async function Yy(e,t={}){if(x8(e))throw new Error($8);let r=qy(e,{size:t.sizeMm??p8,unit:"mm",bleed:t.bleedMm}),n=await oh(e);return await b8(n,{width:r.trimWidth*Xy,bleed:r.bleed*Xy,bleedColor:r.bleed>0?sh(e,n):ih(e),colorMode:t.colorMode,background:Ae(e.bgColor,Ne)})}function eb(e){return `data:application/postscript;base64,${btoa(e)}`}var fh={png:{mimeType:"image/png",extension:"png",vector:false},jpg:{mimeType:"image/jpeg",extension:"jpg",vector:false},webp:{mimeType:"image/webp",extension:"webp",vector:false},svg:{mimeType:"image/svg+xml",extension:"svg",vector:true},pdf:{mimeType:"application/pdf",extension:"pdf",vector:false},eps:{mimeType:"application/postscript",extension:"eps",vector:true}};function tb(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 fc(e,t){let{imageSettings:r,size:n}=e;if(!(r&&n)||n===t)return {...e,size:t};let o=t/n;return {...e,size:t,imageSettings:{...r,width:r.width*o,height:r.height*o,...r.x!=null&&{x:r.x*o},...r.y!=null&&{y:r.y*o},...r.padding!=null&&{padding:r.padding*o}}}}function hi(e,t){let r=document.createElement("a");r.href=e,r.download=t,document.body.appendChild(r),r.click(),document.body.removeChild(r);}var rb=e=>(fh[e]??fh.png).mimeType;function w8(e,t,r){let{extension:n,vector:o}=fh[e];if(o)return `qr-code.${n}`;let{width:i,height:s}=ai(t.width,r);return `qr-code-${Math.round(i)}x${Math.round(s)}.${n}`}async function nb(e,t={}){let r=await ac(e,"image/webp",true);try{return await sc(r,t)}finally{r.remove();}}var S8=25.4/72;async function ob(e){let t=await Yy(e,{sizeMm:(e.size??Je)*S8});return eb(t)}async function ib(e){let t;try{({jsPDF:t}=await import('jspdf'));}catch(p){throw new Error(`PDF export needs the optional "jspdf" package. Install it with \`npm install jspdf\`. (${p})`)}let r=await Ar(e),n=decodeURIComponent(r.replace("data:image/svg+xml,","")),o;try{let p=new TextEncoder().encode(n),m=Array.from(p,d=>String.fromCharCode(d)).join("");o=`data:image/svg+xml;base64,${btoa(m)}`;}catch(p){throw new Error(`Failed to encode SVG for PDF conversion: ${p}`)}let{width:i,height:s}=ai(e.size||Je,e.frame),a=await new Promise((p,m)=>{let h=new Image,d=document.createElement("canvas");d.width=Math.round(i),d.height=Math.round(s);let g=d.getContext("2d");if(!g){m(new Error("Could not get canvas context"));return}let y=setTimeout(()=>{d.remove(),m(new Error("SVG load timeout - image may be too large or contain invalid data"));},3e4);h.onload=()=>{clearTimeout(y);try{g.drawImage(h,0,0,d.width,d.height),p(d);}catch(_){clearTimeout(y),d.remove(),m(new Error(`Failed to draw image to canvas: ${_}`));}},h.onerror=()=>{clearTimeout(y),d.remove(),m(new Error("Could not load SVG for PDF conversion"));},h.src=o;}),c=a.toDataURL("image/png",1),u=i*.264583,l=s*.264583,f=new t({orientation:u>l?"landscape":"portrait",unit:"mm",format:[u,l]});return f.addImage(c,"PNG",0,0,u,l),a.remove(),f.output("dataurlstring")}async function sb(e,t){let{format:r,size:n,filename:o,quality:i}=t,s=tb(n.width,n.height);if(!s.isValid)throw new Error(s.error);let a=fc(e,n.width),c=o||w8(r,n,e.frame);try{if(r==="svg"){let u=await Ar(a);hi(u,c);}else if(r==="pdf"){let u=await ib(a);hi(u,c);}else if(r==="eps")hi(await ob(a),c);else if(r==="webp"){let u=await nb(a,{quality:i});hi(await di(u),c);}else {let u=rb(r),l=await ac(a,u);if(typeof l=="string")hi(l,c);else throw new Error("Failed to generate image data URL")}}catch(u){throw console.error(`Error downloading ${r.toUpperCase()}:`,u),u}}async function ab(e,t,r,n={}){let o=tb(r.width,r.height);if(!o.isValid)throw new Error(o.error);let i=fc(e,r.width);if(t==="svg")return await Ar(i);if(t==="pdf")return await ib(i);if(t==="eps")return await ob(i);if(t==="webp")return await di(await nb(i,n));let s=rb(t),a=await ac(i,s);if(typeof a=="string")return a;throw new Error("Failed to generate QR code data URL")}var mc={value:["value","string"],size:["size","number"],level:["level","level"],"fg-color":["fgColor","string"],"bg-color":["bgColor","string"],"eye-color":["eyeColor","string"],"dot-color":["dotColor","string"],"body-pattern":["bodyPattern","string"],"corner-eye-pattern":["cornerEyePattern","string"],"corner-eye-dot-pattern":["cornerEyeDotPattern","string"],margin:["margin","number"],"template-id":["templateId","string"],"module-scale":["moduleScale","number"],"auto-level":["autoLevel","boolean"],shape:["shape","string"]},cb=[...Object.values(mc).map(([e])=>e),"frame","imageSettings","eyeColors","art","customTemplate","customProps"],v8=new Set(["L","M","Q","H"]),C8="QR code",fb=Symbol.for("qrdx.code-element"),P8=/^[a-z][a-z0-9._]*(?:-[a-z0-9._]*)+$/,pb=":host{display:inline-block}:host([hidden]){display:none}svg{display:block;max-width:100%;height:auto}";function k8(e,t){switch(e){case "number":{let r=t.trim()===""?Number.NaN:Number(t);return Number.isFinite(r)?r:void 0}case "level":{let r=t.trim().toUpperCase();return v8.has(r)?r:void 0}case "boolean":return t!=="false";default:return t}}function mb(e){let t={};for(let r of Object.keys(e))e[r]!==void 0&&e[r]!==null&&(t[r]=e[r]);return t}function A8(e,t){let r=e["aria-label"];return t?.trim()||typeof r=="string"&&r.trim()||C8}function db(e,t){return {...e,part:"svg",role:"img","aria-label":A8(e,t)}}var ub=(e,t)=>{let r=t??e.size??Je;return {width:r,height:r}},E8=typeof HTMLElement>"u"?class{}:HTMLElement,gi=class e extends E8{static observedAttributes=[...Object.keys(mc),"label","props"];static[fb]=true;#r;#t={};#s;#o;#e=null;#a="";#n=true;#c=false;static{for(let t of cb)Object.defineProperty(e.prototype,t,{configurable:true,enumerable:true,get(){return this.#t[t]},set(r){this.#f(t,r);}});}constructor(){super(),this.#r=this.shadowRoot??this.attachShadow({mode:"open"});let t=null;for(let r of Array.from(this.#r.children))r.localName==="style"?t=r:r.localName==="svg"&&(this.#e=r);t||(t=this.ownerDocument.createElement("style"),t.textContent=pb,this.#r.prepend(t));for(let r of [...cb,"props","label"])if(Object.hasOwn(this,r)){let n=this[r];delete this[r],this[r]=n;}}connectedCallback(){this.#n&&this.#l();}attributeChangedCallback(t,r,n){if(r===n)return;if(t==="label"){this.#o=n??void 0,this.#i();return}if(t==="props"){this.#p(n);return}let o=mc[t];if(o){let[i,s]=o;this.#f(i,n===null?void 0:k8(s,n));}}get props(){return this.#s}set props(t){if(typeof t=="string"){this.#p(t);return}this.#s=t??void 0,this.#i();}get label(){return this.#o}set label(t){this.#o=t??void 0,this.#i();}get options(){return mb({...this.#s,...this.#t})}get svg(){return this.#n&&this.isConnected&&this.#l(),this.#e}toSVGString(){return ct(Un(this.#u()))}async toDataURL(t="png",r={}){let n=this.#u();return await ab(n,t,ub(n,r.size),{quality:r.quality})}async download(t={}){let r=this.#u();return await sb(r,{format:t.format??"png",size:ub(r,t.size),filename:t.filename,quality:t.quality})}#u(){let t=this.options;if(!t.value)throw new Error(`qrdx: <${this.localName}> has no value`);return t}#f(t,r){if(r==null){if(!(t in this.#t))return;delete this.#t[t];}else {if(this.#t[t]===r)return;this.#t[t]=r;}this.#i();}#p(t){if(t===null||t.trim()===""){this.props=void 0;return}try{let r=JSON.parse(t);if(!r||typeof r!="object"||Array.isArray(r))throw new TypeError("props must be a JSON object");this.props=r;}catch(r){this.#d(r);}}#i(){this.#n=true,!this.#c&&(this.#c=true,queueMicrotask(()=>{this.#c=false,this.#n&&this.isConnected&&this.#l();}));}#l(){this.#n=false;let t=this.options;if(!t.value){this.#m();return}let r,n;try{r=Un(db(t,this.#o)),n=ct(r);}catch(i){this.#m(),this.#d(i);return}if(this.#e&&n===this.#a)return;let o=Kd(r,this.ownerDocument).firstChild;this.#e?.parentNode===this.#r?this.#e.replaceWith(o):this.#r.append(o),this.#e=o,this.#a=n;}#m(){this.#e?.remove(),this.#e=null,this.#a="";}#d(t){let r=new CustomEvent("qrdx-error",{cancelable:true,detail:{error:t}});this.dispatchEvent(r)&&console.error(`qrdx: <${this.localName}> could not draw its code`,t);}},lb;function TA(e="qrdx-code"){let t=globalThis.customElements;if(!t)return gi;let r=t.get(e);if(r){if(fb in r)return r;throw new Error(`qrdx: <${e}> is already defined by another element; pass defineQRdxCode another tag name`)}let n=lb===void 0?gi:class extends gi{};return t.define(e,n),lb??=e,n}var R8=e=>e.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;");function M8(e){let t=[],r={...e};for(let[n,[o,i]]of Object.entries(mc)){let s=e[o];(i==="number"&&typeof s=="number"||i==="boolean"&&typeof s=="boolean"||i!=="number"&&i!=="boolean"&&typeof s=="string")&&(delete r[o],i==="boolean"?s&&t.push([n,""]):t.push([n,String(s)]));}return {attributes:t,rest:r}}function OA(e,{tagName:t="qrdx-code",label:r}={}){if(!P8.test(t))throw new Error(`qrdx: ${t} is not a custom element name`);let n=mb(e),{attributes:o,rest:i}=M8(n),{customTemplate:s,...a}=i;r!==void 0&&o.push(["label",r]),Object.keys(a).length>0&&o.push(["props",JSON.stringify(a)]);let c=o.map(([l,f])=>f===""?` ${l}`:` ${l}="${R8(f)}"`).join(""),u=n.value?ct(Un(db(n,r))):"";return `<${t}${c}><template shadowrootmode="open"><style>${pb}</style>${u}</template></${t}>`}/**
87
87
  * @license QR Code generator library (TypeScript)
88
88
  * Copyright (c) Project Nayuki.
89
89
  * SPDX-License-Identifier: MIT
90
- */export{eb as QRDX_CODE_STYLES,li as QRdxCodeElement,eA as defineQRdxCode,tA as toQRdxCodeHTML};//# sourceMappingURL=element.browser.mjs.map
90
+ */export{pb as QRDX_CODE_STYLES,gi as QRdxCodeElement,TA as defineQRdxCode,OA as toQRdxCodeHTML};//# sourceMappingURL=element.browser.mjs.map
91
91
  //# sourceMappingURL=element.browser.mjs.map