qrdx 0.0.46 → 0.0.47
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +353 -300
- package/dist/index.js +27 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +27 -7
- package/dist/index.mjs.map +1 -1
- package/dist/qr-code-canvas.js +12 -0
- package/dist/qr-code-canvas.js.map +1 -0
- package/dist/qr-code-canvas.mjs +12 -0
- package/dist/qr-code-canvas.mjs.map +1 -0
- package/dist/src/api.d.ts.map +1 -1
- package/dist/src/art-trace.d.ts +46 -0
- package/dist/src/art-trace.d.ts.map +1 -0
- package/dist/src/art.d.ts +138 -0
- package/dist/src/art.d.ts.map +1 -0
- package/dist/src/body-patterns.d.ts +34 -0
- package/dist/src/body-patterns.d.ts.map +1 -0
- package/dist/src/codegen.d.ts +5 -5
- package/dist/src/codegen.d.ts.map +1 -1
- package/dist/src/codeword-map.d.ts +40 -0
- package/dist/src/codeword-map.d.ts.map +1 -0
- package/dist/src/constants.d.ts +4 -7
- package/dist/src/constants.d.ts.map +1 -1
- package/dist/src/corner-dot.d.ts +3 -1
- package/dist/src/corner-dot.d.ts.map +1 -1
- package/dist/src/corner-eye.d.ts +5 -2
- package/dist/src/corner-eye.d.ts.map +1 -1
- package/dist/src/detection.d.ts.map +1 -1
- package/dist/src/download.d.ts +22 -5
- package/dist/src/download.d.ts.map +1 -1
- package/dist/src/eps.d.ts +62 -0
- package/dist/src/eps.d.ts.map +1 -0
- package/dist/src/frame-icons.d.ts +11 -0
- package/dist/src/frame-icons.d.ts.map +1 -0
- package/dist/src/frame-import.d.ts +61 -0
- package/dist/src/frame-import.d.ts.map +1 -0
- package/dist/src/frame-spec.d.ts +24 -0
- package/dist/src/frame-spec.d.ts.map +1 -0
- package/dist/src/frame-styles.d.ts +50 -0
- package/dist/src/frame-styles.d.ts.map +1 -0
- package/dist/src/frame.d.ts +126 -0
- package/dist/src/frame.d.ts.map +1 -0
- package/dist/src/frames/builtin.d.ts +8 -0
- package/dist/src/frames/builtin.d.ts.map +1 -0
- package/dist/src/frames/official.d.ts +18 -0
- package/dist/src/frames/official.d.ts.map +1 -0
- package/dist/src/helpers.d.ts +15 -2
- package/dist/src/helpers.d.ts.map +1 -1
- package/dist/src/index.d.ts +24 -13
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/logo-budget.d.ts +54 -0
- package/dist/src/logo-budget.d.ts.map +1 -0
- package/dist/src/logo-cleanup.d.ts +25 -0
- package/dist/src/logo-cleanup.d.ts.map +1 -0
- package/dist/src/logo.d.ts +28 -0
- package/dist/src/logo.d.ts.map +1 -0
- package/dist/src/print.d.ts +73 -0
- package/dist/src/print.d.ts.map +1 -0
- package/dist/src/qr-code-canvas.d.ts +13 -0
- package/dist/src/qr-code-canvas.d.ts.map +1 -0
- package/dist/src/qr-code.d.ts +4 -2
- package/dist/src/qr-code.d.ts.map +1 -1
- package/dist/src/qr-outline.d.ts +41 -0
- package/dist/src/qr-outline.d.ts.map +1 -0
- package/dist/src/qr-shape.d.ts +72 -0
- package/dist/src/qr-shape.d.ts.map +1 -0
- package/dist/src/scan-risk.d.ts +40 -0
- package/dist/src/scan-risk.d.ts.map +1 -0
- package/dist/src/scan-score.d.ts +154 -0
- package/dist/src/scan-score.d.ts.map +1 -0
- package/dist/src/shapes.d.ts +36 -0
- package/dist/src/shapes.d.ts.map +1 -0
- package/dist/src/silhouette.d.ts +28 -0
- package/dist/src/silhouette.d.ts.map +1 -0
- package/dist/src/utils/color.d.ts.map +1 -1
- package/dist/src/utils/fmt.d.ts +24 -0
- package/dist/src/utils/fmt.d.ts.map +1 -0
- package/dist/src/utils/paint.d.ts +80 -0
- package/dist/src/utils/paint.d.ts.map +1 -0
- package/dist/src/utils/parse-color.d.ts +21 -0
- package/dist/src/utils/parse-color.d.ts.map +1 -0
- package/dist/src/utils/path-data.d.ts +24 -0
- package/dist/src/utils/path-data.d.ts.map +1 -0
- package/dist/src/utils/png.d.ts +16 -0
- package/dist/src/utils/png.d.ts.map +1 -0
- package/dist/src/utils/polygon-clip.d.ts +26 -0
- package/dist/src/utils/polygon-clip.d.ts.map +1 -0
- package/dist/src/utils/print-shared.d.ts +20 -0
- package/dist/src/utils/print-shared.d.ts.map +1 -0
- package/dist/src/utils/svg-geometry.d.ts +49 -0
- package/dist/src/utils/svg-geometry.d.ts.map +1 -0
- package/dist/src/utils/svg-gradient.d.ts +59 -0
- package/dist/src/utils/svg-gradient.d.ts.map +1 -0
- package/dist/src/utils/svg-painter.d.ts +152 -0
- package/dist/src/utils/svg-painter.d.ts.map +1 -0
- package/dist/src/utils.d.ts +18 -2
- package/dist/src/utils.d.ts.map +1 -1
- package/dist/types/art.d.ts +64 -0
- package/dist/types/art.d.ts.map +1 -0
- package/dist/types/color.d.ts +125 -7
- package/dist/types/color.d.ts.map +1 -1
- package/dist/types/corner-dot.d.ts +52 -2
- package/dist/types/corner-dot.d.ts.map +1 -1
- package/dist/types/corner-eye.d.ts +43 -2
- package/dist/types/corner-eye.d.ts.map +1 -1
- package/dist/types/frame-spec.d.ts +3509 -0
- package/dist/types/frame-spec.d.ts.map +1 -0
- package/dist/types/frame.d.ts +68 -0
- package/dist/types/frame.d.ts.map +1 -0
- package/dist/types/image-pattern.d.ts +15 -1
- package/dist/types/image-pattern.d.ts.map +1 -1
- package/dist/types/index.d.ts +15 -9
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +6 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/index.mjs +6 -0
- package/dist/types/index.mjs.map +1 -0
- package/dist/types/qr.d.ts +1684 -4
- package/dist/types/qr.d.ts.map +1 -1
- package/dist/types/template.d.ts +2 -2
- package/dist/types/template.d.ts.map +1 -1
- package/package.json +68 -25
- package/src/api.tsx +67 -17
- package/src/art-trace.ts +554 -0
- package/src/art.tsx +2226 -0
- package/src/body-patterns.tsx +389 -0
- package/src/codegen.ts +10 -5
- package/src/codeword-map.ts +265 -0
- package/src/constants.ts +4 -8
- package/src/corner-dot.tsx +209 -33
- package/src/corner-eye.ts +328 -60
- package/src/detection.ts +5 -11
- package/src/download.tsx +123 -52
- package/src/eps.ts +701 -0
- package/src/frame-icons.ts +325 -0
- package/src/frame-import.ts +1198 -0
- package/src/frame-spec.ts +518 -0
- package/src/frame-styles.ts +1095 -0
- package/src/frame.tsx +630 -0
- package/src/frames/builtin/banner-bottom.json +58 -0
- package/src/frames/builtin/circle.json +81 -0
- package/src/frames/builtin/rounded-border.json +60 -0
- package/src/frames/builtin/ticket.json +51 -0
- package/src/frames/builtin.ts +20 -0
- package/src/frames/official/attendance.json +110 -0
- package/src/frames/official/audio-guide.json +95 -0
- package/src/frames/official/book-now.json +103 -0
- package/src/frames/official/check-in.json +110 -0
- package/src/frames/official/christmas.json +131 -0
- package/src/frames/official/donate.json +77 -0
- package/src/frames/official/event-ticket.json +77 -0
- package/src/frames/official/feedback-bubble.json +73 -0
- package/src/frames/official/follow-us.json +83 -0
- package/src/frames/official/get-the-app.json +107 -0
- package/src/frames/official/halloween.json +80 -0
- package/src/frames/official/new-year.json +94 -0
- package/src/frames/official/order-at-table.json +86 -0
- package/src/frames/official/product-info.json +119 -0
- package/src/frames/official/register-product.json +77 -0
- package/src/frames/official/review-us.json +127 -0
- package/src/frames/official/rsvp-card.json +112 -0
- package/src/frames/official/save-contact.json +117 -0
- package/src/frames/official/scan-to-pay.json +94 -0
- package/src/frames/official/shop-window.json +81 -0
- package/src/frames/official/sign-rider.json +81 -0
- package/src/frames/official/table-tent.json +75 -0
- package/src/frames/official/wifi-card.json +89 -0
- package/src/frames/official/winter.json +142 -0
- package/src/frames/official.ts +77 -0
- package/src/helpers.ts +168 -11
- package/src/index.tsx +141 -172
- package/src/logo-budget.ts +226 -0
- package/src/logo-cleanup.ts +146 -0
- package/src/logo.tsx +137 -0
- package/src/print.ts +794 -0
- package/src/qr-code-canvas.tsx +241 -0
- package/src/qr-code.tsx +51 -16
- package/src/qr-outline.ts +511 -0
- package/src/qr-shape.ts +255 -0
- package/src/scan-risk.ts +197 -0
- package/src/scan-score.ts +1629 -0
- package/src/shapes.ts +169 -0
- package/src/silhouette.ts +334 -0
- package/src/utils/color.ts +10 -1
- package/src/utils/fmt.ts +59 -0
- package/src/utils/paint.ts +317 -0
- package/src/utils/parse-color.ts +135 -0
- package/src/utils/path-data.ts +182 -0
- package/src/utils/png.ts +175 -0
- package/src/utils/polygon-clip.ts +163 -0
- package/src/utils/print-shared.ts +74 -0
- package/src/utils/svg-geometry.ts +838 -0
- package/src/utils/svg-gradient.ts +407 -0
- package/src/utils/svg-painter.ts +946 -0
- package/src/utils.tsx +794 -385
- package/types/art.ts +74 -0
- package/types/color.ts +132 -12
- package/types/corner-dot.ts +41 -4
- package/types/corner-eye.ts +31 -4
- package/types/frame-spec.ts +748 -0
- package/types/frame.ts +67 -0
- package/types/image-pattern.ts +15 -0
- package/types/index.ts +106 -4
- package/types/qr.ts +180 -2
- package/types/template.ts +2 -2
- package/dist/cli.js +0 -4319
package/dist/index.js
CHANGED
|
@@ -1,11 +1,31 @@
|
|
|
1
|
-
'use strict';var zod=require('zod'),jsxRuntime=require('react/jsx-runtime'),g1=require('react'),F1=require('jsqr');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var g1__default=/*#__PURE__*/_interopDefault(g1);var F1__default=/*#__PURE__*/_interopDefault(F1);var Ke=Object.defineProperty;var S=(n,_)=>()=>(n&&(_=n(n=0)),_);var je=(n,_)=>{for(var l in _)Ke(n,l,{get:_[l],enumerable:true});};function M(n,_="#000000"){return n?typeof n=="string"?{type:"solid",color:n}:n:{type:"solid",color:_}}function e1(n){return !n||typeof n=="string"?false:n.type==="linear"||n.type==="radial"}function r1(n,_="#000000"){let l=M(n,_);return l.type==="solid"?l.color:l.stops[0]?.color||_}function o1(n){if(!n)return "#000000";if(typeof n=="string")return n;let _=M(n);if(_.type==="solid")return _.color;let o=[..._.stops].sort((t,e)=>t.offset-e.offset).map(t=>`${t.color} ${t.offset}%`).join(", ");return _.type==="linear"?`linear-gradient(${_.angle??0}deg, ${o})`:`radial-gradient(circle, ${o})`}exports.colorTypeSchema=void 0;exports.solidColorSchema=void 0;exports.gradientStopSchema=void 0;exports.linearGradientSchema=void 0;exports.radialGradientSchema=void 0;exports.colorConfigSchema=void 0;var pt=S(()=>{exports.colorTypeSchema=zod.z.enum(["solid","linear","radial"]),exports.solidColorSchema=zod.z.object({type:zod.z.literal("solid"),color:zod.z.string()}),exports.gradientStopSchema=zod.z.object({color:zod.z.string(),offset:zod.z.number().min(0).max(100)}),exports.linearGradientSchema=zod.z.object({type:zod.z.literal("linear"),stops:zod.z.array(exports.gradientStopSchema).min(2),angle:zod.z.number().optional().default(0)}),exports.radialGradientSchema=zod.z.object({type:zod.z.literal("radial"),stops:zod.z.array(exports.gradientStopSchema).min(2)}),exports.colorConfigSchema=zod.z.union([zod.z.string(),exports.solidColorSchema,exports.linearGradientSchema,exports.radialGradientSchema]);});var rt,G,mt=S(()=>{(e=>{class n{constructor(a,s,i,$){this.version=a;this.errorCorrectionLevel=s;if(a<n.MIN_VERSION||a>n.MAX_VERSION)throw new RangeError("Version value out of range");if($<-1||$>7)throw new RangeError("Mask value out of range");this.size=a*4+17;let c=[];for(let d=0;d<this.size;d++)c.push(false);for(let d=0;d<this.size;d++)this.modules.push(c.slice()),this.isFunction.push(c.slice());this.drawFunctionPatterns();let p=this.addEccAndInterleave(i);if(this.drawCodewords(p),$==-1){let d=1e9;for(let u=0;u<8;u++){this.applyMask(u),this.drawFormatBits(u);let m=this.getPenaltyScore();m<d&&($=u,d=m),this.applyMask(u);}}o(0<=$&&$<=7),this.mask=$,this.applyMask($),this.drawFormatBits($),this.isFunction=[];}static encodeText(a,s){let i=e.QrSegment.makeSegments(a);return n.encodeSegments(i,s)}static encodeBinary(a,s){let i=e.QrSegment.makeBytes(a);return n.encodeSegments([i],s)}static encodeSegments(a,s,i=1,$=40,c=-1,p=true){if(!(n.MIN_VERSION<=i&&i<=$&&$<=n.MAX_VERSION)||c<-1||c>7)throw new RangeError("Invalid value");let d,u;for(d=i;;d++){let C=n.getNumDataCodewords(d,s)*8,w=t.getTotalBits(a,d);if(w<=C){u=w;break}if(d>=$)throw new RangeError("Data too long")}for(let C of [n.Ecc.MEDIUM,n.Ecc.QUARTILE,n.Ecc.HIGH])p&&u<=n.getNumDataCodewords(d,C)*8&&(s=C);let m=[];for(let C of a){_(C.mode.modeBits,4,m),_(C.numChars,C.mode.numCharCountBits(d),m);for(let w of C.getData())m.push(w);}o(m.length==u);let f=n.getNumDataCodewords(d,s)*8;o(m.length<=f),_(0,Math.min(4,f-m.length),m),_(0,(8-m.length%8)%8,m),o(m.length%8==0);for(let C=236;m.length<f;C^=253)_(C,8,m);let v=[];for(;v.length*8<m.length;)v.push(0);return m.forEach((C,w)=>v[w>>>3]|=C<<7-(w&7)),new n(d,s,v,c)}size;mask;modules=[];isFunction=[];getModule(a,s){return 0<=a&&a<this.size&&0<=s&&s<this.size&&this.modules[s][a]}getModules(){return this.modules}drawFunctionPatterns(){for(let i=0;i<this.size;i++)this.setFunctionModule(6,i,i%2==0),this.setFunctionModule(i,6,i%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);let a=this.getAlignmentPatternPositions(),s=a.length;for(let i=0;i<s;i++)for(let $=0;$<s;$++)i==0&&$==0||i==0&&$==s-1||i==s-1&&$==0||this.drawAlignmentPattern(a[i],a[$]);this.drawFormatBits(0),this.drawVersion();}drawFormatBits(a){let s=this.errorCorrectionLevel.formatBits<<3|a,i=s;for(let c=0;c<10;c++)i=i<<1^(i>>>9)*1335;let $=(s<<10|i)^21522;o($>>>15==0);for(let c=0;c<=5;c++)this.setFunctionModule(8,c,l($,c));this.setFunctionModule(8,7,l($,6)),this.setFunctionModule(8,8,l($,7)),this.setFunctionModule(7,8,l($,8));for(let c=9;c<15;c++)this.setFunctionModule(14-c,8,l($,c));for(let c=0;c<8;c++)this.setFunctionModule(this.size-1-c,8,l($,c));for(let c=8;c<15;c++)this.setFunctionModule(8,this.size-15+c,l($,c));this.setFunctionModule(8,this.size-8,true);}drawVersion(){if(this.version<7)return;let a=this.version;for(let i=0;i<12;i++)a=a<<1^(a>>>11)*7973;let s=this.version<<12|a;o(s>>>18==0);for(let i=0;i<18;i++){let $=l(s,i),c=this.size-11+i%3,p=Math.floor(i/3);this.setFunctionModule(c,p,$),this.setFunctionModule(p,c,$);}}drawFinderPattern(a,s){for(let i=-4;i<=4;i++)for(let $=-4;$<=4;$++){let c=Math.max(Math.abs($),Math.abs(i)),p=a+$,d=s+i;0<=p&&p<this.size&&0<=d&&d<this.size&&this.setFunctionModule(p,d,c!=2&&c!=4);}}drawAlignmentPattern(a,s){for(let i=-2;i<=2;i++)for(let $=-2;$<=2;$++)this.setFunctionModule(a+$,s+i,Math.max(Math.abs($),Math.abs(i))!=1);}setFunctionModule(a,s,i){this.modules[s][a]=i,this.isFunction[s][a]=true;}addEccAndInterleave(a){let s=this.version,i=this.errorCorrectionLevel;if(a.length!=n.getNumDataCodewords(s,i))throw new RangeError("Invalid argument");let $=n.NUM_ERROR_CORRECTION_BLOCKS[i.ordinal][s],c=n.ECC_CODEWORDS_PER_BLOCK[i.ordinal][s],p=Math.floor(n.getNumRawDataModules(s)/8),d=$-p%$,u=Math.floor(p/$),m=[],f=n.reedSolomonComputeDivisor(c);for(let C=0,w=0;C<$;C++){let x=a.slice(w,w+u-c+(C<d?0:1));w+=x.length;let A=n.reedSolomonComputeRemainder(x,f);C<d&&x.push(0),m.push(x.concat(A));}let v=[];for(let C=0;C<m[0].length;C++)m.forEach((w,x)=>{(C!=u-c||x>=d)&&v.push(w[C]);});return o(v.length==p),v}drawCodewords(a){if(a.length!=Math.floor(n.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let s=0;for(let i=this.size-1;i>=1;i-=2){i==6&&(i=5);for(let $=0;$<this.size;$++)for(let c=0;c<2;c++){let p=i-c,u=(i+1&2)==0?this.size-1-$:$;!this.isFunction[u][p]&&s<a.length*8&&(this.modules[u][p]=l(a[s>>>3],7-(s&7)),s++);}}o(s==a.length*8);}applyMask(a){if(a<0||a>7)throw new RangeError("Mask value out of range");for(let s=0;s<this.size;s++)for(let i=0;i<this.size;i++){let $;switch(a){case 0:$=(i+s)%2==0;break;case 1:$=s%2==0;break;case 2:$=i%3==0;break;case 3:$=(i+s)%3==0;break;case 4:$=(Math.floor(i/3)+Math.floor(s/2))%2==0;break;case 5:$=i*s%2+i*s%3==0;break;case 6:$=(i*s%2+i*s%3)%2==0;break;case 7:$=((i+s)%2+i*s%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[s][i]&&$&&(this.modules[s][i]=!this.modules[s][i]);}}getPenaltyScore(){let a=0;for(let c=0;c<this.size;c++){let p=false,d=0,u=[0,0,0,0,0,0,0];for(let m=0;m<this.size;m++)this.modules[c][m]==p?(d++,d==5?a+=n.PENALTY_N1:d>5&&a++):(this.finderPenaltyAddHistory(d,u),p||(a+=this.finderPenaltyCountPatterns(u)*n.PENALTY_N3),p=this.modules[c][m],d=1);a+=this.finderPenaltyTerminateAndCount(p,d,u)*n.PENALTY_N3;}for(let c=0;c<this.size;c++){let p=false,d=0,u=[0,0,0,0,0,0,0];for(let m=0;m<this.size;m++)this.modules[m][c]==p?(d++,d==5?a+=n.PENALTY_N1:d>5&&a++):(this.finderPenaltyAddHistory(d,u),p||(a+=this.finderPenaltyCountPatterns(u)*n.PENALTY_N3),p=this.modules[m][c],d=1);a+=this.finderPenaltyTerminateAndCount(p,d,u)*n.PENALTY_N3;}for(let c=0;c<this.size-1;c++)for(let p=0;p<this.size-1;p++){let d=this.modules[c][p];d==this.modules[c][p+1]&&d==this.modules[c+1][p]&&d==this.modules[c+1][p+1]&&(a+=n.PENALTY_N2);}let s=0;for(let c of this.modules)s=c.reduce((p,d)=>p+(d?1:0),s);let i=this.size*this.size,$=Math.ceil(Math.abs(s*20-i*10)/i)-1;return o(0<=$&&$<=9),a+=$*n.PENALTY_N4,o(0<=a&&a<=2568888),a}getAlignmentPatternPositions(){if(this.version==1)return [];{let a=Math.floor(this.version/7)+2,s=this.version==32?26:Math.ceil((this.version*4+4)/(a*2-2))*2,i=[6];for(let $=this.size-7;i.length<a;$-=s)i.splice(1,0,$);return i}}static getNumRawDataModules(a){if(a<n.MIN_VERSION||a>n.MAX_VERSION)throw new RangeError("Version number out of range");let s=(16*a+128)*a+64;if(a>=2){let i=Math.floor(a/7)+2;s-=(25*i-10)*i-55,a>=7&&(s-=36);}return o(208<=s&&s<=29648),s}static getNumDataCodewords(a,s){return Math.floor(n.getNumRawDataModules(a)/8)-n.ECC_CODEWORDS_PER_BLOCK[s.ordinal][a]*n.NUM_ERROR_CORRECTION_BLOCKS[s.ordinal][a]}static reedSolomonComputeDivisor(a){if(a<1||a>255)throw new RangeError("Degree out of range");let s=[];for(let $=0;$<a-1;$++)s.push(0);s.push(1);let i=1;for(let $=0;$<a;$++){for(let c=0;c<s.length;c++)s[c]=n.reedSolomonMultiply(s[c],i),c+1<s.length&&(s[c]^=s[c+1]);i=n.reedSolomonMultiply(i,2);}return s}static reedSolomonComputeRemainder(a,s){let i=s.map($=>0);for(let $ of a){let c=$^i.shift();i.push(0),s.forEach((p,d)=>i[d]^=n.reedSolomonMultiply(p,c));}return i}static reedSolomonMultiply(a,s){if(a>>>8||s>>>8)throw new RangeError("Byte out of range");let i=0;for(let $=7;$>=0;$--)i=i<<1^(i>>>7)*285,i^=(s>>>$&1)*a;return o(i>>>8==0),i}finderPenaltyCountPatterns(a){let s=a[1];o(s<=this.size*3);let i=s>0&&a[2]==s&&a[3]==s*3&&a[4]==s&&a[5]==s;return (i&&a[0]>=s*4&&a[6]>=s?1:0)+(i&&a[6]>=s*4&&a[0]>=s?1:0)}finderPenaltyTerminateAndCount(a,s,i){return a&&(this.finderPenaltyAddHistory(s,i),s=0),s+=this.size,this.finderPenaltyAddHistory(s,i),this.finderPenaltyCountPatterns(i)}finderPenaltyAddHistory(a,s){s[0]==0&&(a+=this.size),s.pop(),s.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]]}e.QrCode=n;function _(r,a,s){if(a<0||a>31||r>>>a)throw new RangeError("Value out of range");for(let i=a-1;i>=0;i--)s.push(r>>>i&1);}function l(r,a){return (r>>>a&1)!=0}function o(r){if(!r)throw new Error("Assertion error")}class t{constructor(a,s,i){this.mode=a;this.numChars=s;this.bitData=i;if(s<0)throw new RangeError("Invalid argument");this.bitData=i.slice();}static makeBytes(a){let s=[];for(let i of a)_(i,8,s);return new t(t.Mode.BYTE,a.length,s)}static makeNumeric(a){if(!t.isNumeric(a))throw new RangeError("String contains non-numeric characters");let s=[];for(let i=0;i<a.length;){let $=Math.min(a.length-i,3);_(parseInt(a.substr(i,$),10),$*3+1,s),i+=$;}return new t(t.Mode.NUMERIC,a.length,s)}static makeAlphanumeric(a){if(!t.isAlphanumeric(a))throw new RangeError("String contains unencodable characters in alphanumeric mode");let s=[],i;for(i=0;i+2<=a.length;i+=2){let $=t.ALPHANUMERIC_CHARSET.indexOf(a.charAt(i))*45;$+=t.ALPHANUMERIC_CHARSET.indexOf(a.charAt(i+1)),_($,11,s);}return i<a.length&&_(t.ALPHANUMERIC_CHARSET.indexOf(a.charAt(i)),6,s),new t(t.Mode.ALPHANUMERIC,a.length,s)}static makeSegments(a){return a==""?[]:t.isNumeric(a)?[t.makeNumeric(a)]:t.isAlphanumeric(a)?[t.makeAlphanumeric(a)]:[t.makeBytes(t.toUtf8ByteArray(a))]}static makeEci(a){let s=[];if(a<0)throw new RangeError("ECI assignment value out of range");if(a<128)_(a,8,s);else if(a<16384)_(2,2,s),_(a,14,s);else if(a<1e6)_(6,3,s),_(a,21,s);else throw new RangeError("ECI assignment value out of range");return new t(t.Mode.ECI,0,s)}static isNumeric(a){return t.NUMERIC_REGEX.test(a)}static isAlphanumeric(a){return t.ALPHANUMERIC_REGEX.test(a)}getData(){return this.bitData.slice()}static getTotalBits(a,s){let i=0;for(let $ of a){let c=$.mode.numCharCountBits(s);if($.numChars>=1<<c)return 1/0;i+=4+c+$.bitData.length;}return i}static toUtf8ByteArray(a){a=encodeURI(a);let s=[];for(let i=0;i<a.length;i++)a.charAt(i)!="%"?s.push(a.charCodeAt(i)):(s.push(parseInt(a.substr(i+1,2),16)),i+=2);return s}static NUMERIC_REGEX=/^[0-9]*$/;static ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/;static ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:"}e.QrSegment=t;})(rt||={});(_=>{(o=>{class l{constructor(e,r){this.ordinal=e;this.formatBits=r;}static LOW=new l(0,1);static MEDIUM=new l(1,0);static QUARTILE=new l(2,3);static HIGH=new l(3,2)}o.Ecc=l;})(_.QrCode||={});})(rt||={});(_=>{(o=>{class l{constructor(e,r){this.modeBits=e;this.numBitsCharCount=r;}static NUMERIC=new l(1,[10,12,14]);static ALPHANUMERIC=new l(2,[9,11,13]);static BYTE=new l(4,[8,16,16]);static KANJI=new l(8,[8,10,12]);static ECI=new l(7,[0,0,0]);numCharCountBits(e){return this.numBitsCharCount[Math.floor((e+7)/17)]}}o.Mode=l;})(_.QrSegment||={});})(rt||={});G=rt;});var ot,T,nt,D,b;exports.DEFAULT_MARGIN=void 0;var le,$e,J=S(()=>{mt();ot={L:G.QrCode.Ecc.LOW,M:G.QrCode.Ecc.MEDIUM,Q:G.QrCode.Ecc.QUARTILE,H:G.QrCode.Ecc.HIGH},T=128,nt="Q",D="#FFFFFF",b="#000000",exports.DEFAULT_MARGIN=0,le=.1,$e="https://qrdx.dev/logo.png";});function j(n,_,l,o="circle"){let t=l*2,e=l;switch(o){case "square":return jsxRuntime.jsx("rect",{height:t,transform:`rotate(0,${n},${_})`,width:t,x:n-e,y:_-e});case "rounded":return jsxRuntime.jsx("rect",{height:t,rx:l*.5,ry:l*.5,transform:`rotate(0,${n},${_})`,width:t,x:n-e,y:_-e});case "diamond":return jsxRuntime.jsx("path",{d:`M ${n-e*.714286} ${_-e*.714286}v ${t*.714286}h ${t*.714286}v -${t*.714286}z`,transform:`rotate(45,${n},${_})`});case "message":{let r=t/30,a=$=>($-40)*r+n,s=$=>($-40)*r+_,i=`M ${a(25)} ${s(35.714285714285715)}v ${8.571428571428571*r}a ${10.714285714285714*r} ${10.714285714285714*r}, 0, 0, 0, ${10.714285714285714*r} ${10.714285714285714*r}h ${19.285714285714285*r}v -${19.285714285714285*r}a ${10.714285714285714*r} ${10.714285714285714*r}, 0, 0, 0, -${10.714285714285714*r} -${10.714285714285714*r}h -${8.571428571428571*r}a ${10.714285714285714*r} ${10.714285714285714*r}, 0, 0, 0, -${10.714285714285714*r} ${10.714285714285714*r}`;return jsxRuntime.jsx("path",{clipRule:"evenodd",d:i,transform:`rotate(0,${n},${_})`})}case "message-reverse":{let r=t/30,a=$=>($-40)*r+n,s=$=>($-40)*r+_,i=`M ${a(25)} ${s(35.714285714285715)}v ${8.571428571428571*r}a ${10.714285714285714*r} ${10.714285714285714*r}, 0, 0, 0, ${10.714285714285714*r} ${10.714285714285714*r}h ${19.285714285714285*r}v -${19.285714285714285*r}a ${10.714285714285714*r} ${10.714285714285714*r}, 0, 0, 0, -${10.714285714285714*r} -${10.714285714285714*r}h -${8.571428571428571*r}a ${10.714285714285714*r} ${10.714285714285714*r}, 0, 0, 0, -${10.714285714285714*r} ${10.714285714285714*r}`;return jsxRuntime.jsx("path",{clipRule:"evenodd",d:i,transform:`rotate(-180,${n},${_})`})}case "diya":{let r=t/30,a=$=>($-40)*r+n,s=$=>($-40)*r+_,i=`M ${a(25)} ${s(35.714285714285715)}v ${8.571428571428571*r}a ${10.714285714285714*r} ${10.714285714285714*r}, 0, 0, 0, ${10.714285714285714*r} ${10.714285714285714*r}h ${19.285714285714285*r}v -${19.285714285714285*r}a ${10.714285714285714*r} ${10.714285714285714*r}, 0, 0, 0, -${10.714285714285714*r} -${10.714285714285714*r}h -${8.571428571428571*r}H ${a(25)}z`;return jsxRuntime.jsx("path",{clipRule:"evenodd",d:i,transform:`rotate(0,${n},${_})`})}case "diya-reverse":{let r=t/30,a=$=>($-40)*r+n,s=$=>($-40)*r+_,i=`M ${a(25)} ${s(35.714285714285715)}v ${19.285714285714285*r}h ${19.285714285714285*r}a ${10.714285714285714*r} ${10.714285714285714*r}, 0, 0, 0, ${10.714285714285714*r} -${10.714285714285714*r}v -${19.285714285714285*r}h -${19.285714285714285*r}a ${10.714285714285714*r} ${10.714285714285714*r}, 0, 0, 0, -${10.714285714285714*r} ${10.714285714285714*r}z`;return jsxRuntime.jsx("path",{clipRule:"evenodd",d:i,transform:`rotate(0,${n},${_})`})}case "rounded-triangle":{let r=t/21,a=$=>($-40)*r+n,s=$=>($-40)*r+_,i=`M ${a(33.57142857142857)} ${s(29.285714285714285)}h ${12.857142857142856*r}c ${4.285714285714286*r} 0 ${4.285714285714286*r} ${4.285714285714286*r} ${4.285714285714286*r} ${4.285714285714286*r}v ${12.857142857142856*r}c 0 ${4.285714285714286*r} -${4.285714285714286*r} ${4.285714285714286*r} -${4.285714285714286*r} ${4.285714285714286*r}h -${12.857142857142856*r}c -${4.285714285714286*r} 0 -${4.285714285714286*r} -${4.285714285714286*r} -${4.285714285714286*r} -${4.285714285714286*r}v -${12.857142857142856*r}c 0 -${4.285714285714286*r} ${4.285714285714286*r} -${4.285714285714286*r} ${4.285714285714286*r} -${4.285714285714286*r}z`;return jsxRuntime.jsx("path",{d:i,transform:`rotate(45,${n},${_})`})}case "star":{let r=t/27,a=$=>($-40)*r+n,s=$=>($-40)*r+_,i=`M ${a(38.84615384615385)},${s(26.546153846153846)}c${.6692307692307691*r},-${1.0153846153846153*r},${2.215384615384615*r},-${1.0153846153846153*r},${2.884615384615384*r},0l${4.038461538461538*r},${6.069230769230768*r}c${.23076923076923075*r},${.3461538461538461*r},${.6*r},${.6*r},${1.0153846153846153*r},${.7153846153846153*r}l${7.223076923076922*r},${1.823076923076923*r}c${1.2*r},${.3*r},${1.6846153846153844*r},${1.7076923076923076*r},${.8999999999999999*r},${2.6538461538461533*r}l-${4.73076923076923*r},${5.584615384615384*r}c-${.2769230769230769*r},${.3230769230769231*r},-${.41538461538461535*r},${.7384615384615384*r},-${.3923076923076923*r},${1.1307692307692307*r}l${.4384615384615384*r},${7.199999999999999*r}c${.06923076923076922*r},${1.2*r},-${1.1769230769230767*r},${2.0769230769230766*r},-${2.3307692307692305*r},${1.6384615384615382*r}l-${6.9692307692307685*r},-${2.6076923076923073*r}c-${.3923076923076923*r},-${.16153846153846155*r},-${.8538461538461538*r},-${.16153846153846155*r},-${1.2461538461538462*r},0l-${6.9692307692307685*r},${2.6076923076923073*r}c-${1.1538461538461537*r},${.4384615384615384*r},-${2.4*r},-${.4384615384615384*r},-${2.3307692307692305*r},-${1.6384615384615382*r}l${.4384615384615384*r},-${7.199999999999999*r}c${.023076923076923075*r},-${.41538461538461535*r},-${.11538461538461538*r},-${.8307692307692307*r},-${.3923076923076923*r},-${1.1307692307692307*r}l-${4.73076923076923*r},-${5.584615384615384*r}c-${.7846153846153846*r},-${.923076923076923*r},-${.3230769230769231*r},-${2.3307692307692305*r},${.8999999999999999*r},-${2.6538461538461533*r}l${7.223076923076922*r},-${1.823076923076923*r}c${.41538461538461535*r},-${.11538461538461538*r},${.7846153846153846*r},-${.3461538461538461*r},${1.0153846153846153*r},-${.7153846153846153*r}l${4.038461538461538*r},-${6.069230769230768*r}z`;return jsxRuntime.jsx("path",{clipRule:"evenodd",d:i,transform:`rotate(0,${n},${_})`})}case "banner":{let r=t/28;return jsxRuntime.jsx("g",{transform:`translate(${n-40*r},${_-40*r}) scale(${r})`,children:jsxRuntime.jsx("path",{clipRule:"evenodd",d:"M38.23456923076923 26.10373C38.75864615384615 25.677388461538463, 39.510007692307695 25.677388461538463, 40.03410769230769 26.10373L41.7757 27.520484615384614C42.09088461538461 27.776892307692307, 42.5005 27.886646153846154, 42.90166923076923 27.82219230769231L45.118300000000005 27.466046153846154C45.78536153846154 27.358853846153846, 46.43606153846153 27.734546153846154, 46.676753846153844 28.365815384615384L47.47664615384615 30.463553846153847C47.621407692307685 30.843192307692306, 47.92126923076923 31.143053846153844, 48.300999999999995 31.287815384615385L50.3986923076923 32.08770769230769C51.02984615384615 32.3284, 51.405538461538455 32.9791, 51.29846153846154 33.64616153846154L50.94238461538461 35.8627923076923C50.87776923076923 36.26396153846154, 50.98761538461538 36.67357692307692, 51.244 36.98876153846154L52.6606923076923 38.73035384615385C53.08715384615384 39.254453846153844, 53.08715384615384 40.00581538461538, 52.6606923076923 40.52989230769231L51.244 42.27148461538461C50.98761538461538 42.5866923076923, 50.87776923076923 42.99628461538461, 50.94238461538461 43.397453846153844L51.29846153846154 45.614107692307684C51.405538461538455 46.28114615384615, 51.02984615384615 46.93184615384615, 50.3986923076923 47.17256153846154L48.300999999999995 47.97243076923077C47.92126923076923 48.11730769230769, 47.621407692307685 48.41707692307692, 47.47664615384615 48.796692307692304L46.676753846153844 50.89438461538461C46.43606153846153 51.52576923076923, 45.78536153846154 51.90146153846153, 45.118300000000005 51.79415384615385L42.90166923076923 51.43807692307692C42.5005 51.37369230769231, 42.09088461538461 51.48330769230769, 41.7757 51.73969230769231L40.03410769230769 53.15661538461538C39.510007692307695 53.58284615384615, 38.75864615384615 53.58284615384615, 38.23456923076923 53.15661538461538L36.492976923076924 51.73969230769231C36.17776923076923 51.48330769230769, 35.76817692307692 51.37369230769231, 35.367007692307695 51.43807692307692L33.15035384615385 51.79415384615385C32.48331538461538 51.90146153846153, 31.832615384615384 51.52576923076923, 31.5919 50.89438461538461L30.79203076923077 48.796692307692304C30.647269230769233 48.41707692307692, 30.34740769230769 48.11730769230769, 29.96776923076923 47.97243076923077L27.87000769230769 47.17256153846154C27.23874769230769 46.93184615384615, 26.86306692307692 46.28114615384615, 26.970243076923076 45.614107692307684L27.326384615384615 43.397453846153844C27.39083846153846 42.99628461538461, 27.281093846153844 42.5866923076923, 27.02469076923077 42.27148461538461L25.607936153846154 40.52989230769231C25.181594384615384 40.00581538461538, 25.181594384615384 39.254453846153844, 25.607936153846154 38.73035384615385L27.02469076923077 36.98876153846154C27.281093846153844 36.67357692307692, 27.39083846153846 36.26396153846154, 27.326384615384615 35.8627923076923L26.970243076923076 33.64616153846154C26.86306692307692 32.9791, 27.23874769230769 32.3284, 27.87000769230769 32.08770769230769L29.96776923076923 31.287815384615385C30.34740769230769 31.143053846153844, 30.647269230769233 30.843192307692306, 30.79203076923077 30.463553846153847L31.5919 28.365815384615384C31.832615384615384 27.734546153846154, 32.48331538461538 27.358853846153846, 33.15035384615385 27.466046153846154L35.367007692307695 27.82219230769231C35.76817692307692 27.886646153846154, 36.17776923076923 27.776892307692307, 36.492976923076924 27.520484615384614L38.23456923076923 26.10373Z"})})}default:return jsxRuntime.jsx("circle",{cx:n,cy:_,r:l,transform:`rotate(0,${n},${_})`})}}var ce=S(()=>{});function n1(n,_,l){let o=l/7;return `M ${n} ${_}v ${l}h ${l}v -${l}zM ${n+o} ${_+o}h ${5*o}v ${5*o}h -${5*o}z`}function a1(n,_,l){let o=l/7,t=o*.875,e=o*.4375,r=`M ${n+t} ${_}h ${l-2*t}a ${t} ${t} 0 0 1 ${t} ${t}v ${l-2*t}a ${t} ${t} 0 0 1 ${-t} ${t}h ${-(l-2*t)}a ${t} ${t} 0 0 1 ${-t} ${-t}v ${-(l-2*t)}a ${t} ${t} 0 0 1 ${t} ${-t}z`,a=`M ${n+o+e} ${_+o}h ${5*o-2*e}a ${e} ${e} 0 0 1 ${e} ${e}v ${5*o-2*e}a ${e} ${e} 0 0 1 ${-e} ${e}h ${-(5*o-2*e)}a ${e} ${e} 0 0 1 ${-e} ${-e}v ${-(5*o-2*e)}a ${e} ${e} 0 0 1 ${e} ${-e}z`;return r+a}function i1(n,_,l){let o=n+l/2,t=_+l/2,e=l/2,r=l*(2.5/7);return `M ${o-e} ${t}a ${e} ${e} 0 1 0 ${e*2} 0a ${e} ${e} 0 1 0 ${-e*2} 0zM ${o-r} ${t}a ${r} ${r} 0 1 1 ${r*2} 0a ${r} ${r} 0 1 1 ${-r*2} 0z`}function _1(n,_,l){let o=l/74.7002,t=a=>a*o+n,e=a=>a*o+_;return `M${t(37.3496)} ${e(0)}C${t(39.2939)} ${e(0)} ${t(40.9948)} ${e(1.03842)} ${t(41.9287)} ${e(2.59082)}C${t(43.2293)} ${e(1.34013)} ${t(45.1347)} ${e(.780267)} ${t(47.0098)} ${e(1.28027)}C${t(48.8871)} ${e(1.78928)} ${t(50.261)} ${e(3.23767)} ${t(50.7578)} ${e(4.98438)}C${t(52.3454)} ${e(4.0996)} ${t(54.3432)} ${e(4.047)} ${t(56.0303)} ${e(5.01953)}C${t(57.7094)} ${e(5.98752)} ${t(58.6586)} ${e(7.73647)} ${t(58.6924)} ${e(9.5459)}C${t(60.4517)} ${e(9.10661)} ${t(62.3883)} ${e(9.57215)} ${t(63.7598)} ${e(10.9502)}C${t(65.1282)} ${e(12.3253)} ${t(65.5963)} ${e(14.2585)} ${t(65.1641)} ${e(16.0127)}C${t(66.974)} ${e(16.044)} ${t(68.7242)} ${e(16.9982)} ${t(69.7002)} ${e(18.6797)}C${t(70.6781)} ${e(20.3647)} ${t(70.6241)} ${e(22.3635)} ${t(69.7402)} ${e(23.9502)}C${t(71.4776)} ${e(24.4496)} ${t(72.9194)} ${e(25.8232)} ${t(73.4199)} ${e(27.7002)}C${t(73.927)} ${e(29.5707)} ${t(73.3661)} ${e(31.4794)} ${t(72.1104)} ${e(32.7822)}C${t(73.6621)} ${e(33.7163)} ${t(74.7002)} ${e(35.4166)} ${t(74.7002)} ${e(37.3604)}C${t(74.7001)} ${e(39.307)} ${t(73.6582)} ${e(41.0084)} ${t(72.1025)} ${e(41.9414)}C${t(73.357)} ${e(43.245)} ${t(73.9207)} ${e(45.1525)} ${t(73.4199)} ${e(47.0303)}C${t(72.9187)} ${e(48.9027)} ${t(71.4782)} ${e(50.2735)} ${t(69.7383)} ${e(50.7734)}C${t(70.6201)} ${e(52.3601)} ${t(70.6716)} ${e(54.3549)} ${t(69.7002)} ${e(56.04)}C${t(68.7237)} ${e(57.7225)} ${t(66.9721)} ${e(58.6729)} ${t(65.1611)} ${e(58.7031)}C${t(65.598)} ${e(60.4623)} ${t(65.131)} ${e(62.3982)} ${t(63.7598)} ${e(63.7695)}C${t(62.3847)} ${e(65.138)} ${t(60.4515)} ${e(65.6061)} ${t(58.6973)} ${e(65.1738)}C${t(58.6635)} ${e(66.9833)} ${t(57.7094)} ${e(68.7322)} ${t(56.0303)} ${e(69.7002)}C${t(54.3461)} ${e(70.6777)} ${t(52.348)} ${e(70.6248)} ${t(50.7617)} ${e(69.7422)}C${t(50.2643)} ${e(71.4831)} ${t(48.8896)} ${e(72.9284)} ${t(47.0098)} ${e(73.4297)}C${t(45.1389)} ${e(73.9368)} ${t(43.2296)} ${e(73.3763)} ${t(41.9268)} ${e(72.1201)}C${t(40.9927)} ${e(73.6717)} ${t(39.2932)} ${e(74.71)} ${t(37.3496)} ${e(74.71)}C${t(35.4051)} ${e(74.7098)} ${t(33.7042)} ${e(73.6711)} ${t(32.7705)} ${e(72.1182)}C${t(31.4697)} ${e(73.3758)} ${t(29.5597)} ${e(73.9418)} ${t(27.6797)} ${e(73.4404)}V${e(73.4502)}C${t(25.8065)} ${e(72.9422)} ${t(24.434)} ${e(71.4985)} ${t(23.9346)} ${e(69.7568)}C${t(22.3504)} ${e(70.6301)} ${t(20.3591)} ${e(70.6781)} ${t(18.6797)} ${e(69.71)}C${t(16.9957)} ${e(68.7391)} ${t(16.045)} ${e(66.9831)} ${t(16.0166)} ${e(65.168)}C${t(14.2547)} ${e(65.6091)} ${t(12.3134)} ${e(65.1435)} ${t(10.9395)} ${e(63.7695)}C${t(9.5687)} ${e(62.3919)} ${t(9.10168)} ${e(60.454)} ${t(9.53809)} ${e(58.6973)}C${t(7.72791)} ${e(58.6641)} ${t(5.97815)} ${e(57.71)} ${t(5.00977)} ${e(56.0303)}C${t(4.03552)} ${e(54.3517)} ${t(4.08377)} ${e(52.3649)} ${t(4.95801)} ${e(50.7812)}C${t(3.21705)} ${e(50.2839)} ${t(1.77087)} ${e(48.9101)} ${t(1.26953)} ${e(47.0303)}V${e(47.0205)}C${t(.762081)} ${e(45.1489)} ${t(1.32758)} ${e(43.2375)} ${t(2.58496)} ${e(41.9346)}C${t(1.03604)} ${e(41)} ${t(108484e-9)} ${e(39.3019)} ${t(0)} ${e(37.3604)}C${t(0)} ${e(35.4159)} ${t(1.03815)} ${e(33.7141)} ${t(2.59082)} ${e(32.7803)}C${t(1.34044)} ${e(31.4797)} ${t(.780389)} ${e(29.575)} ${t(1.28027)} ${e(27.7002)}C${t(1.78258)} ${e(25.8232)} ${t(3.22806)} ${e(24.4482)} ${t(4.97363)} ${e(23.9512)}C${t(4.08938)} ${e(22.3638)} ${t(4.03743)} ${e(20.3664)} ${t(5.00977)} ${e(18.6797)}C${t(5.97815)} ${e(16.9999)} ${t(7.72788)} ${e(16.0496)} ${t(9.53809)} ${e(16.0166)}C${t(9.10139)} ${e(14.2576)} ${t(9.56846)} ${e(12.3214)} ${t(10.9395)} ${e(10.9502)}C${t(12.3171)} ${e(9.57911)} ${t(14.2558)} ${e(9.11137)} ${t(16.0127)} ${e(9.54785)}C${t(16.0426)} ${e(7.73421)} ${t(16.9969)} ${e(5.97989)} ${t(18.6797)} ${e(5.00977)}C${t(20.3596)} ${e(4.03474)} ${t(22.3521)} ${e(4.08468)} ${t(23.9365)} ${e(4.96094)}C${t(24.4378)} ${e(3.22749)} ${t(25.8059)} ${e(1.7898)} ${t(27.6797)} ${e(1.29004)}C${t(29.5511)} ${e(.78264)} ${t(31.4617)} ${e(1.34357)} ${t(32.7646)} ${e(2.60059)}C${t(33.6971)} ${e(1.04268)} ${t(35.4013)} ${e(152405e-9)} ${t(37.3496)} ${e(0)}ZM${t(41.0615)} ${e(9.17578)}C${t(40.1006)} ${e(10.1057)} ${t(38.793)} ${e(10.6797)} ${t(37.3496)} ${e(10.6797)}C${t(35.9064)} ${e(10.6796)} ${t(34.5985)} ${e(10.1066)} ${t(33.6377)} ${e(9.17676)}C${t(32.9511)} ${e(10.3241)} ${t(31.8358)} ${e(11.2176)} ${t(30.4404)} ${e(11.5898)}C${t(29.0527)} ${e(11.9661)} ${t(27.6436)} ${e(11.7542)} ${t(26.4766)} ${e(11.1074)}C${t(26.1072)} ${e(12.3879)} ${t(25.2629)} ${e(13.5333)} ${t(24.0195)} ${e(14.25)}C${t(22.7695)} ${e(14.9754)} ${t(21.347)} ${e(15.1322)} ${t(20.0479)} ${e(14.8047)}C${t(20.0289)} ${e(16.1454)} ${t(19.5108)} ${e(17.4793)} ${t(18.4902)} ${e(18.5)}C${t(17.4696)} ${e(19.5158)} ${t(16.1409)} ${e(20.033)} ${t(14.8066)} ${e(20.0566)}C${t(15.1312)} ${e(21.3534)} ${t(14.9738)} ${e(22.7723)} ${t(14.25)} ${e(24.0195)}C${t(13.5243)} ${e(25.2699)} ${t(12.3701)} ${e(26.1148)} ${t(11.082)} ${e(26.4795)}C${t(11.7347)} ${e(27.6479)} ${t(11.9529)} ${e(29.062)} ${t(11.5801)} ${e(30.46)}C${t(11.2085)} ${e(31.8485)} ${t(10.3194)} ${e(32.9607)} ${t(9.17578)} ${e(33.6475)}C${t(10.106)} ${e(34.6084)} ${t(10.6797)} ${e(35.9167)} ${t(10.6797)} ${e(37.3604)}C${t(10.6796)} ${e(38.805)} ${t(10.1053)} ${e(40.1141)} ${t(9.17383)} ${e(41.0752)}C${t(10.3132)} ${e(41.7614)} ${t(11.1999)} ${e(42.871)} ${t(11.5703)} ${e(44.2598)}C${t(11.946)} ${e(45.6504)} ${t(11.7335)} ${e(47.0592)} ${t(11.0889)} ${e(48.2266)}C${t(12.377)} ${e(48.593)} ${t(13.5297)} ${e(49.441)} ${t(14.25)} ${e(50.6904)}C${t(14.9754)} ${e(51.9405)} ${t(15.1322)} ${e(53.3629)} ${t(14.8047)} ${e(54.6621)}C${t(16.142)} ${e(54.6835)} ${t(17.4721)} ${e(55.2016)} ${t(18.4902)} ${e(56.2197)}C${t(19.5097)} ${e(57.2441)} ${t(20.0278)} ${e(58.5787)} ${t(20.0479)} ${e(59.918)}C${t(21.3469)} ${e(59.5917)} ${t(22.7696)} ${e(59.7493)} ${t(24.0195)} ${e(60.4697)}C${t(25.2676)} ${e(61.1892)} ${t(26.1117)} ${e(62.3406)} ${t(26.4775)} ${e(63.627)}C${t(27.6424)} ${e(62.9822)} ${t(29.0498)} ${e(62.7688)} ${t(30.4404)} ${e(63.1396)}C${t(31.8284)} ${e(63.5112)} ${t(32.9402)} ${e(64.3999)} ${t(33.627)} ${e(65.543)}C${t(34.5887)} ${e(64.6072)} ${t(35.9012)} ${e(64.0304)} ${t(37.3496)} ${e(64.0303)}C${t(38.7912)} ${e(64.0303)} ${t(40.098)} ${e(64.6023)} ${t(41.0586)} ${e(65.5303)}C${t(41.7458)} ${e(64.3887)} ${t(42.8594)} ${e(63.5007)} ${t(44.25)} ${e(63.1299)}C${t(45.643)} ${e(62.7522)} ${t(47.057)} ${e(62.9676)} ${t(48.2266)} ${e(63.6201)}C${t(48.5931)} ${e(62.3323)} ${t(49.4413)} ${e(61.1801)} ${t(50.6904)} ${e(60.46)}C${t(51.9373)} ${e(59.7364)} ${t(53.3558)} ${e(59.5781)} ${t(54.6523)} ${e(59.9023)}C${t(54.6744)} ${e(58.5659)} ${t(55.1925)} ${e(57.2372)} ${t(56.21)} ${e(56.2197)}C${t(57.2339)} ${e(55.2007)} ${t(58.5676)} ${e(54.6816)} ${t(59.9062)} ${e(54.6611)}C${t(59.5835)} ${e(53.3649)} ${t(59.7414)} ${e(51.9468)} ${t(60.46)} ${e(50.7002)}C${t(61.1797)} ${e(49.4517)} ${t(62.3312)} ${e(48.6068)} ${t(63.6182)} ${e(48.2412)}C${t(62.9651)} ${e(47.0726)} ${t(62.7473)} ${e(45.658)} ${t(63.1201)} ${e(44.2598)}C${t(63.4916)} ${e(42.8718)} ${t(64.3794)} ${e(41.7591)} ${t(65.5225)} ${e(41.0723)}C${t(64.5929)} ${e(40.1115)} ${t(64.0206)} ${e(38.8033)} ${t(64.0205)} ${e(37.3604)}C${t(64.0205)} ${e(35.9186)} ${t(64.5915)} ${e(34.611)} ${t(65.5195)} ${e(33.6504)}C${t(64.3785)} ${e(32.9631)} ${t(63.4908)} ${e(31.8501)} ${t(63.1201)} ${e(30.46)}C${t(62.7421)} ${e(29.0656)} ${t(62.9572)} ${e(27.6498)} ${t(63.6113)} ${e(26.4795)}C${t(62.3272)} ${e(26.1115)} ${t(61.1784)} ${e(25.2657)} ${t(60.46)} ${e(24.0195)}C${t(59.7364)} ${e(22.7727)} ${t(59.5781)} ${e(21.3541)} ${t(59.9023)} ${e(20.0576)}C${t(58.5626)} ${e(20.038)} ${t(57.23)} ${e(19.52)} ${t(56.21)} ${e(18.5)}C${t(55.1931)} ${e(17.4783)} ${t(54.675)} ${e(16.1482)} ${t(54.6523)} ${e(14.8125)}C${t(53.3557)} ${e(15.1357)} ${t(51.9374)} ${e(14.9785)} ${t(50.6904)} ${e(14.2598)}C${t(49.4399)} ${e(13.5339)} ${t(48.5931)} ${e(12.3801)} ${t(48.2285)} ${e(11.0918)}C${t(47.0603)} ${e(11.7439)} ${t(45.6474)} ${e(11.9624)} ${t(44.25)} ${e(11.5898)}V${e(11.5801)}C${t(42.8613)} ${e(11.2085)} ${t(41.7483)} ${e(10.3196)} ${t(41.0615)} ${e(9.17578)}Z`}function s1(n,_,l){let o=l/80,t=(r,a)=>r*o+a;return `M ${t(5,n)} ${t(30,_)}v ${20*o}a ${25*o} ${25*o}, 0, 0, 0, ${25*o} ${25*o}h ${45*o}v -${45*o}a ${25*o} ${25*o}, 0, 0, 0, -${25*o} -${25*o}h -${20*o}H ${t(5,n)}zM ${t(30,n)} ${t(15,_)}h ${20*o}a ${15*o} ${15*o}, 0, 0, 1, ${15*o} ${15*o}v ${35*o}h -${35*o}a ${15*o} ${15*o}, 0, 0, 1, -${15*o} -${15*o}v -${35*o}z`}function l1(n,_,l){let o=l/7,t=o*1.5,e=o*.75,r=`M ${n+t} ${_}h ${l-2*t}a ${t} ${t} 0 0 1 ${t} ${t}v ${l-2*t}a ${t} ${t} 0 0 1 ${-t} ${t}h ${-(l-2*t)}a ${t} ${t} 0 0 1 ${-t} ${-t}v ${-(l-2*t)}a ${t} ${t} 0 0 1 ${t} ${-t}z`,a=`M ${n+o+e} ${_+o}h ${5*o-2*e}a ${e} ${e} 0 0 1 ${e} ${e}v ${5*o-2*e}a ${e} ${e} 0 0 1 ${-e} ${e}h ${-(5*o-2*e)}a ${e} ${e} 0 0 1 ${-e} ${-e}v ${-(5*o-2*e)}a ${e} ${e} 0 0 1 ${e} ${-e}z`;return r+a}function $1(n,_,l){let o=l/80,t=(r,a)=>r*o+a;return `M ${t(5,n)} ${t(40,_)}a ${35*o} ${35*o}, 0, 0, 0, ${35*o} ${35*o}h ${30*o}a ${5*o} ${5*o}, 0, 0, 0, ${5*o} -${5*o}v -${30*o}a ${35*o} ${35*o}, 0, 0, 0, -${35*o} -${35*o}a ${35*o} ${35*o}, 0, 0, 0, -${35*o} ${35*o}zM ${t(40,n)} ${t(15,_)}a ${25*o} ${25*o}, 0, 0, 1, ${25*o} ${25*o}v ${25*o}h -${25*o}a ${25*o} ${25*o}, 0, 0, 1, -${25*o} -${25*o}a ${25*o} ${25*o}, 0, 0, 1, ${25*o} -${25*o}z`}function c1(n,_,l){let o=l/80,t=(r,a)=>r*o+a;return `M ${t(5,n)} ${t(30,_)}v ${20*o}a ${25*o} ${25*o}, 0, 0, 0, ${25*o} ${25*o}h ${45*o}v -${45*o}a ${25*o} ${25*o}, 0, 0, 0, -${25*o} -${25*o}h -${20*o}a ${25*o} ${25*o}, 0, 0, 0, -${25*o} ${25*o}M ${t(30,n)} ${t(15,_)}h ${20*o}a ${15*o} ${15*o}, 0, 0, 1, ${15*o} ${15*o}v ${35*o}h -${35*o}a ${15*o} ${15*o}, 0, 0, 1, -${15*o} -${15*o}v -${20*o}a ${15*o} ${15*o}, 0, 0, 1, ${15*o} -${15*o}z`}function d1(n,_,l){let o=l/70,t=n+l/2-40*o,e=_+l/2-40*o,r=(s,i)=>s*o+i;return `M${r(35.19239999999999,t)} ${r(5.837547376725838,e)}C${r(37.69667692307692,t)} ${r(3.8737070690335305,e)}, ${r(41.218430769230764,t)} ${r(3.8737092228796843,e)}, ${r(43.722707692307694,t)} ${r(5.837547376725838,e)}L${r(46.62781538461539,t)} ${r(8.115648915187375,e)}L${r(50.23356923076923,t)} ${r(7.32361506903353,e)}C${r(53.342,t)} ${r(6.640824299802762,e)}, ${r(56.51483076923077,t)} ${r(8.168784299802759,e)}, ${r(57.91892307692308,t)} ${r(11.024719684418145,e)}L${r(59.54787692307692,t)} ${r(14.337679684418145,e)}L${r(63.14027692307692,t)} ${r(15.188578145956608,e)}C${r(66.23707692307693,t)} ${r(15.922091992110452,e)}, ${r(68.43270769230769,t)} ${r(18.675396607495067,e)}, ${r(68.45876923076924,t)} ${r(21.857768915187375,e)}L${r(68.48892307692307,t)} ${r(25.54931045364891,e)}L${r(71.35633846153846,t)} ${r(27.874602761341222,e)}C${r(73.82830769230769,t)} ${r(29.879187376725838,e)}, ${r(74.61187692307692,t)} ${r(33.312418145956606,e)}, ${r(73.25452307692306,t)} ${r(36.19103353057199,e)}L${r(71.68006153846153,t)} ${r(39.530141222879685,e)}L${r(73.25452307692306,t)} ${r(42.86924891518738,e)}C${r(74.61187692307692,t)} ${r(45.747864299802764,e)}, ${r(73.82830769230769,t)} ${r(49.18109506903353,e)}, ${r(71.35633846153846,t)} ${r(51.18567968441815,e)}L${r(68.48892307692307,t)} ${r(53.510971992110456,e)}L${r(68.45876923076924,t)} ${r(57.202664299802755,e)}C${r(68.43270769230769,t)} ${r(60.38497199211046,e)}, ${r(66.23707692307693,t)} ${r(63.13823353057199,e)}, ${r(63.14027692307692,t)} ${r(63.871833530572,e)}L${r(59.54787692307692,t)} ${r(64.72260276134121,e)}L${r(57.91892307692308,t)} ${r(68.03564891518737,e)}C${r(56.51483076923077,t)} ${r(70.89164891518737,e)}, ${r(53.342,t)} ${r(72.41958737672583,e)}, ${r(50.23356923076923,t)} ${r(71.7368181459566,e)}L${r(46.62781538461539,t)} ${r(70.94463353057199,e)}L${r(43.722707692307694,t)} ${r(73.22275660749506,e)}C${r(41.218430769230764,t)} ${r(75.18663353057198,e)}, ${r(37.69667692307692,t)} ${r(75.18663353057198,e)}, ${r(35.19239999999999,t)} ${r(73.22275660749506,e)}L${r(32.28729230769231,t)} ${r(70.94463353057199,e)}L${r(28.68153846153846,t)} ${r(71.7368181459566,e)}C${r(25.573215384615384,t)} ${r(72.41958737672583,e)}, ${r(22.400384615384613,t)} ${r(70.89164891518737,e)}, ${r(20.996141538461536,t)} ${r(68.03564891518737,e)}L${r(19.36720923076923,t)} ${r(64.72260276134121,e)}L${r(15.774852307692306,t)} ${r(63.871833530572,e)}C${r(12.67803076923077,t)} ${r(63.13823353057199,e)}, ${r(10.48237846153846,t)} ${r(60.38497199211046,e)}, ${r(10.45636,t)} ${r(57.202664299802755,e)}L${r(10.426163076923077,t)} ${r(53.510971992110456,e)}L${r(7.558747692307692,t)} ${r(51.18567968441815,e)}C${r(5.086880338461539,t)} ${r(49.18109506903353,e)}, ${r(4.303258769230769,t)} ${r(45.747864299802764,e)}, ${r(5.660599692307692,t)} ${r(42.86924891518738,e)}L${r(7.235153846153846,t)} ${r(39.530141222879685,e)}L${r(5.660599692307692,t)} ${r(36.19103353057199,e)}C${r(4.3032566153846155,t)} ${r(33.312418145956606,e)}, ${r(5.086885938461538,t)} ${r(29.879187376725838,e)}, ${r(7.558747692307692,t)} ${r(27.874602761341222,e)}L${r(10.426163076923077,t)} ${r(25.54931045364891,e)}L${r(10.45636,t)} ${r(21.857768915187375,e)}C${r(10.48237846153846,t)} ${r(18.67537506903353,e)}, ${r(12.678052307692308,t)} ${r(15.922091992110452,e)}, ${r(15.774852307692306,t)} ${r(15.188578145956608,e)}L${r(19.36720923076923,t)} ${r(14.337679684418145,e)}L${r(20.996141538461536,t)} ${r(11.024719684418145,e)}C${r(22.400384615384613,t)} ${r(8.168784299802759,e)}, ${r(25.573215384615384,t)} ${r(6.640824299802762,e)}, ${r(28.68153846153846,t)} ${r(7.32361506903353,e)}L${r(32.28729230769231,t)} ${r(8.115648915187375,e)}L${r(35.19239999999999,t)} ${r(5.837547376725838,e)}M${r(39.45766153846154,t)} ${r(13.665055069033532,e)}L${r(37.01498461538461,t)} ${r(15.58053506903353,e)}C${r(35.39098461538461,t)} ${r(16.854061222879682,e)}, ${r(33.282799999999995,t)} ${r(17.335251992110454,e)}, ${r(31.26701538461538,t)} ${r(16.892464299802757,e)}L${r(28.235046153846152,t)} ${r(16.22649506903353,e)}L${r(26.865415384615382,t)} ${r(19.012107376725837,e)}C${r(25.954812307692308,t)} ${r(20.864178145956608,e)}, ${r(24.264193846153844,t)} ${r(22.212399684418145,e)}, ${r(22.255926153846154,t)} ${r(22.688076607495066,e)}L${r(19.235393846153844,t)} ${r(23.40354122287968,e)}L${r(19.21,t)} ${r(26.507556607495065,e)}C${r(19.19313538461538,t)} ${r(28.57137199211045,e)}, ${r(18.25492,t)} ${r(30.519525838264297,e)}, ${r(16.651919999999997,t)} ${r(31.81937199211045,e)}L${r(14.240926153846154,t)} ${r(33.774633530572,e)}L${r(15.564830769230769,t)} ${r(36.58238737672584,e)}C${r(16.445064615384617,t)} ${r(38.44891045364892,e)}, ${r(16.445064615384617,t)} ${r(40.611371992110456,e)}, ${r(15.564830769230769,t)} ${r(42.47811045364892,e)}L${r(14.240926153846154,t)} ${r(45.28564891518738,e)}L${r(16.651919999999997,t)} ${r(47.240910453648915,e)}L${r(13.883236923076923,t)} ${r(50.654971992110454,e)}L${r(16.651919999999997,t)} ${r(47.240910453648915,e)}C${r(18.25492,t)} ${r(48.54075660749507,e)}, ${r(19.19313538461538,t)} ${r(50.4891258382643,e)}, ${r(19.21,t)} ${r(52.5527258382643,e)}L${r(19.235393846153844,t)} ${r(55.65684891518738,e)}L${r(22.255926153846154,t)} ${r(56.37235660749507,e)}C${r(24.264193846153844,t)} ${r(56.847925838264295,e)}, ${r(25.954812307692308,t)} ${r(58.196233530571995,e)}, ${r(26.865415384615382,t)} ${r(60.0483258382643,e)}L${r(28.235046153846152,t)} ${r(62.833895069033524,e)}L${r(31.26701538461538,t)} ${r(62.1679258382643,e)}C${r(33.282799999999995,t)} ${r(61.72509506903353,e)}, ${r(35.39098461538461,t)} ${r(62.20626429980276,e)}, ${r(37.01498461538461,t)} ${r(63.47983353057199,e)}L${r(39.45766153846154,t)} ${r(65.39524891518737,e)}L${r(41.90012307692308,t)} ${r(63.47983353057199,e)}C${r(43.524123076923075,t)} ${r(62.20626429980276,e)}, ${r(45.632307692307684,t)} ${r(61.72509506903353,e)}, ${r(47.6480923076923,t)} ${r(62.1679258382643,e)}L${r(50.68006153846154,t)} ${r(62.833895069033524,e)}L${r(52.049692307692304,t)} ${r(60.0483258382643,e)}C${r(52.960338461538456,t)} ${r(58.196233530571995,e)}, ${r(54.6508923076923,t)} ${r(56.847925838264295,e)}, ${r(56.65913846153846,t)} ${r(56.37235660749507,e)}L${r(59.67969230769231,t)} ${r(55.65684891518738,e)}L${r(59.70510769230769,t)} ${r(52.5527258382643,e)}C${r(59.72190769230769,t)} ${r(50.4891258382643,e)}, ${r(60.66012307692307,t)} ${r(48.54075660749507,e)}, ${r(62.263230769230766,t)} ${r(47.240910453648915,e)}L${r(64.67424615384616,t)} ${r(45.28564891518738,e)}L${r(63.35027692307692,t)} ${r(42.47811045364892,e)}C${r(62.47,t)} ${r(40.611371992110456,e)}, ${r(62.47,t)} ${r(38.44891045364892,e)}, ${r(63.35027692307692,t)} ${r(36.58238737672584,e)}L${r(64.67424615384616,t)} ${r(33.774633530572,e)}L${r(62.263230769230766,t)} ${r(31.81958737672584,e)}C${r(60.66012307692307,t)} ${r(30.519525838264297,e)}, ${r(59.72190769230769,t)} ${r(28.57137199211045,e)}, ${r(59.70510769230769,t)} ${r(26.507556607495065,e)}L${r(59.67969230769231,t)} ${r(23.40354122287968,e)}L${r(56.65913846153846,t)} ${r(22.688076607495066,e)}C${r(54.6508923076923,t)} ${r(22.212399684418145,e)}, ${r(52.960338461538456,t)} ${r(20.864178145956608,e)}, ${r(52.049692307692304,t)} ${r(19.012128915187375,e)}L${r(50.68006153846154,t)} ${r(16.22649506903353,e)}L${r(47.6480923076923,t)} ${r(16.892464299802757,e)}C${r(45.632307692307684,t)} ${r(17.335251992110454,e)}, ${r(43.524338461538456,t)} ${r(16.85408276134122,e)}, ${r(41.90012307692308,t)} ${r(15.58053506903353,e)}L${r(39.45766153846154,t)} ${r(13.665055069033532,e)}Z`}function tt(n,_,l,o){switch(o){case "gear":return _1(n,_,l);case "rounded":return a1(n,_,l);case "circle":return i1(n,_,l);case "diya":return s1(n,_,l);case "extra-rounded":return l1(n,_,l);case "message":return $1(n,_,l);case "pointy":return c1(n,_,l);case "curly":return d1(n,_,l);default:return n1(n,_,l)}}var de=S(()=>{});exports.Arrow=void 0;var me=S(()=>{exports.Arrow={id:"Arrow",name:"Arrow",description:"QR code with arrow",wrapper:(n,_)=>jsxRuntime.jsx("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:jsxRuntime.jsxs("svg",{fill:"#000000",height:"300",viewBox:"0 0 300 300",width:"300",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("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:_?.fgColor||"black",id:"CallToActionArrow"}),jsxRuntime.jsx("g",{fill:"none",transform:"translate(82, 95)scale(0.5)",children:n})]})})};});exports.defaultTemplate=void 0;var fe=S(()=>{exports.defaultTemplate={id:"default",name:"Default",description:"Simple QR code without decorative elements",wrapper:n=>jsxRuntime.jsx("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:jsxRuntime.jsx("g",{fill:"none",transform:"translate(9, 9) scale(0.95)",children:n})})};});exports.Halloween=void 0;var ye=S(()=>{exports.Halloween={id:"Halloween",name:"Halloween",description:"QR code with Halloween theme",wrapper:n=>jsxRuntime.jsx("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:jsxRuntime.jsx("svg",{fill:"none",height:"300",viewBox:"0 0 300 300",width:"300",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsxs("g",{transform:"translate(10, 10)",children:[jsxRuntime.jsx("circle",{cx:"138",cy:"167.682",fill:"white",r:"99.3177",stroke:"#F89941",strokeWidth:"20"}),jsxRuntime.jsx("rect",{fill:"url(#pattern0)",height:"110.806",width:"113",x:"81.0001",y:"124.097"}),jsxRuntime.jsx("ellipse",{cx:"167.989",cy:"67.8947",fill:"#F89941",rx:"35.4453",ry:"48.4419"}),jsxRuntime.jsx("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"}),jsxRuntime.jsx("ellipse",{cx:"154.072",cy:"69.4866",fill:"#F89941",rx:"34.0512",ry:"50.6615"}),jsxRuntime.jsx("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"}),jsxRuntime.jsx("ellipse",{cx:"134.316",cy:"70.8486",fill:"#F89941",rx:"33.673",ry:"47.8511"}),jsxRuntime.jsx("ellipse",{fill:"#F89941",rx:"35.4453",ry:"48.4419",transform:"matrix(-1 0 0 1 106.743 68.4484)"}),jsxRuntime.jsx("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"}),jsxRuntime.jsx("ellipse",{fill:"#F89941",rx:"32.9438",ry:"50.3847",transform:"matrix(-1 0 0 1 119.744 69.7634)"}),jsxRuntime.jsx("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"}),jsxRuntime.jsx("ellipse",{fill:"#F89941",rx:"32.3901",ry:"47.6163",transform:"matrix(-1 0 0 1 139.677 70.8708)"}),jsxRuntime.jsx("ellipse",{fill:"#F89941",rx:"33.2207",ry:"47.6163",transform:"matrix(-1 0 0 1 134.971 71.4245)"}),jsxRuntime.jsx("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"}),jsxRuntime.jsx("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"}),jsxRuntime.jsx("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"}),jsxRuntime.jsx("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"}),jsxRuntime.jsxs("defs",{children:[jsxRuntime.jsx("pattern",{height:"1",id:"pattern0",patternContentUnits:"objectBoundingBox",width:"1"}),jsxRuntime.jsx("clipPath",{id:"clip0_2087_156668",children:jsxRuntime.jsx("rect",{fill:"white",height:"276",width:"276"})})]}),jsxRuntime.jsx("g",{fill:"none",transform:"translate(80, 122)scale(0.38)",children:n})]})})})};});exports.SquareBorder=void 0;var be=S(()=>{exports.SquareBorder={id:"SquareBorder",name:"Square Border",description:"QR code with square decorative border",wrapper:(n,_)=>jsxRuntime.jsx("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:jsxRuntime.jsx("svg",{fill:"black",height:"300",viewBox:"0 0 316 316",width:"300",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsxs("g",{children:[jsxRuntime.jsx("path",{clipRule:"evenodd",d:"M308 8H8v300h300V8ZM0 0v316h316V0H0Z",fill:_?.fgColor||"black",fillRule:"evenodd"}),jsxRuntime.jsx("g",{fill:"none",transform:"translate(20, 20) scale(0.92)",children:n})]})})})};});exports.StandardBox=void 0;var xe=S(()=>{exports.StandardBox={id:"StandardBox",name:"Standard Box",description:"QR code with standard box",wrapper:(n,_)=>jsxRuntime.jsx("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:jsxRuntime.jsxs("svg",{fill:"#000000",height:"300",viewBox:"0 0 300 300",width:"300",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("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:_?.fgColor||"black"}),jsxRuntime.jsx("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:_?.fgColor||"black"}),jsxRuntime.jsx("g",{fill:"none",transform:"translate(60, 15)scale(0.6)",children:n})]})})};});exports.StrikedBox=void 0;var Re=S(()=>{exports.StrikedBox={id:"StrikedBox",name:"Striked Box",description:"QR code with striked box",wrapper:n=>jsxRuntime.jsx("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:jsxRuntime.jsxs("svg",{fill:"#22071b",height:"300",viewBox:"0 0 300 300",width:"300",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("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"}),jsxRuntime.jsx("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"}),jsxRuntime.jsx("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"}),jsxRuntime.jsx("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"}),jsxRuntime.jsx("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"}),jsxRuntime.jsx("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"}),jsxRuntime.jsx("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"}),jsxRuntime.jsx("g",{fill:"none",transform:"translate(64, 38)scale(0.58)",children:n})]})})};});var zt=S(()=>{me();fe();ye();be();xe();Re();});exports.TEMPLATES=void 0;exports.getTemplate=void 0;exports.getAllTemplates=void 0;exports.getTemplateIds=void 0;var kt=S(()=>{zt();zt();exports.TEMPLATES={default:exports.defaultTemplate,Arrow:exports.Arrow,StandardBox:exports.StandardBox,SquareBorder:exports.SquareBorder,StrikedBox:exports.StrikedBox,Halloween:exports.Halloween},exports.getTemplate=n=>exports.TEMPLATES[n],exports.getAllTemplates=()=>Object.values(exports.TEMPLATES),exports.getTemplateIds=()=>Object.keys(exports.TEMPLATES);});function L(n,_="#000000"){return n?typeof n=="string"?n:n.type==="solid"?n.color:(n.type==="linear"||n.type==="radial")&&n.stops[0]?.color||_:_}var ut=S(()=>{});var Ae={};je(Ae,{QRCodeSVG:()=>Ht,SUPPORTS_PATH2D:()=>exports.SUPPORTS_PATH2D,convertImageSettingsToPixels:()=>Pe,excavateModules:()=>it,generatePath:()=>ft,getContrastLevel:()=>exports.getContrastLevel,getContrastRatio:()=>exports.getContrastRatio,getImageSettings:()=>_t,getLuminance:()=>exports.getLuminance,getSolidColor:()=>L,hexToRgb:()=>exports.hexToRgb});function it(n,_){return n.slice().map((l,o)=>o<_.y||o>=_.y+_.h?l:l.map((t,e)=>e<_.x||e>=_.x+_.w?t:false))}function ft(n,_=0){let l=[];return n.forEach((o,t)=>{let e=null;o.forEach((r,a)=>{if(!r&&e!==null){l.push(`M${e+_} ${t+_}h${a-e}v1H${e+_}z`),e=null;return}if(a===o.length-1){if(!r)return;e===null?l.push(`M${a+_},${t+_} h1v1H${a+_}z`):l.push(`M${e+_},${t+_} h${a+1-e}v1H${e+_}z`);return}r&&e===null&&(e=a);});}),l.join("")}function C1(n,_,l){return n<7&&_<7||n>=l-7&&_<7||n<7&&_>=l-7}function y1(n,_){let{margin:l,pixelSize:o,pattern:t="circle"}=_,e=[],r=n.length,a=o*.45;return n.forEach((s,i)=>{s.forEach(($,c)=>{if($&&!C1(c,i,r)){let p=(c+.5+l)*o,d=(i+.5+l)*o,u=`${c}-${i}`;switch(t){case "circle":e.push(jsxRuntime.jsx("circle",{cx:p,cy:d,r:a,transform:`rotate(0,${p},${d})`},u));break;case "circle-large":{let m=o*.5;e.push(jsxRuntime.jsx("circle",{cx:p,cy:d,r:m,transform:`rotate(0,${p},${d})`},u));}break;case "small-square":{let m=o*.357143;e.push(jsxRuntime.jsx("path",{d:`M ${p-m} ${d-m}v ${o*.714286}h ${o*.714286}v -${o*.714286}z`,transform:`rotate(0,${p},${d})`},u));}break;case "diamond":{let m=o*.357143;e.push(jsxRuntime.jsx("path",{d:`M ${p-m} ${d-m}v ${o*.714286}h ${o*.714286}v -${o*.714286}z`,transform:`rotate(45,${p},${d})`},u));}break;case "circle-mixed":{let m=(c+i)%3===0?.5:(c+i)%2===0?1:1.25,f=a*m;e.push(jsxRuntime.jsx("circle",{cx:p,cy:d,r:f,transform:`rotate(0,${p},${d})`},u));}break;case "pacman":{let m=o*.5,f=o*.357143;e.push(jsxRuntime.jsx("path",{d:`M ${p-m} ${d-f}v ${o*.714286}h ${m}a ${m*.5} ${m*.5}, 0, 0, 0, 0 -${o*.714286}h -${m}v -${o*.714286}z`,transform:`rotate(${(c+i)%2===0?0:90},${p},${d})`},u));}break;case "rounded":{let m=o*.5,f=o*.2;e.push(jsxRuntime.jsx("rect",{height:o,rx:f,ry:f,transform:`rotate(0,${p},${d})`,width:o,x:p-m,y:d-m},u));}break;case "square":{let m=o*.5;e.push(jsxRuntime.jsx("rect",{height:o,transform:`rotate(0,${p},${d})`,width:o,x:p-m,y:d-m},u));}break;case "vertical-line":{let m=o*.714286,f=o;e.push(jsxRuntime.jsx("path",{d:`M ${p-o*.5} ${d-m*.5}v ${m}h ${f}v -${m}z`,transform:`rotate(90,${p},${d})`},u));}break;default:e.push(jsxRuntime.jsx("circle",{cx:p,cy:d,r:a,transform:`rotate(0,${p},${d})`},u));}}});}),e}function w1(n,_){let l=n*Math.PI/180,o=_/2,t=_/2,e=Math.sqrt(_*_+_*_)/2,r=o-e*Math.cos(l),a=t-e*Math.sin(l),s=o+e*Math.cos(l),i=t+e*Math.sin(l);return {x1:r,y1:a,x2:s,y2:i}}function Me(n){return Le+=1,`${n}-${Date.now()}-${Le}`}function b1(n,_,l,o,t){let e=n;if(n===0)switch(t){case "top-left":e=0;break;case "top-right":e=90;break;case "bottom-left":e=270;break;default:e=0;}let r=e*Math.PI/180,a=_+o/2,s=l+o/2,i=Math.sqrt(o*o+o*o)/2,$=a-i*Math.cos(r),c=s-i*Math.sin(r),p=a+i*Math.cos(r),d=s+i*Math.sin(r);return {x1:$,y1:c,x2:p,y2:d}}function at(n,_,l,o,t,e){let r=M(n);if(r.type==="solid")return null;let a=Me(e);if(r.type==="linear"){let s=r,i=s.angle??0,{x1:$,y1:c,x2:p,y2:d}=b1(i,_,l,o,t);return {id:a,element:jsxRuntime.jsx("linearGradient",{gradientUnits:"userSpaceOnUse",id:a,x1:$,x2:p,y1:c,y2:d,children:s.stops.map((u,m)=>jsxRuntime.jsx("stop",{offset:`${u.offset}%`,stopColor:u.color},`${a}-stop-${m}`))},a)}}if(r.type==="radial"){let s=r,i=_+o/2,$=l+o/2,c=o/2*.97;return {id:a,element:jsxRuntime.jsx("radialGradient",{cx:i,cy:$,fx:i,fy:$,gradientUnits:"userSpaceOnUse",id:a,r:c,children:s.stops.map((p,d)=>jsxRuntime.jsx("stop",{offset:`${p.offset}%`,stopColor:p.color},`${a}-stop-${d}`))},a)}}return null}function Ut(n,_,l){let o=M(n);if(o.type==="solid")return null;let t=Me(l);if(o.type==="linear"){let e=o,r=e.angle??0,{x1:a,y1:s,x2:i,y2:$}=w1(r,_);return {id:t,element:jsxRuntime.jsx("linearGradient",{gradientUnits:"userSpaceOnUse",id:t,x1:a,x2:i,y1:s,y2:$,children:e.stops.map((c,p)=>jsxRuntime.jsx("stop",{offset:`${c.offset}%`,stopColor:c.color},`${t}-stop-${p}`))},t)}}if(o.type==="radial"){let e=o,r=_/2,a=_/2,s=_/2*.97;return {id:t,element:jsxRuntime.jsx("radialGradient",{cx:r,cy:a,fx:r,fy:a,gradientUnits:"userSpaceOnUse",id:t,r:s,children:e.stops.map((i,$)=>jsxRuntime.jsx("stop",{offset:`${i.offset}%`,stopColor:i.color},`${t}-stop-${$}`))},t)}}return null}function H(n,_,l){if(_)return `url(#${_})`;let o=M(n,l);return o.type==="solid"?o.color:l}function _t(n,_,l,o){if(o==null)return null;let t=n.length,e=Math.floor(_*le),r=t/_,a=(o.width||e)*r,s=(o.height||e)*r,i=o.x==null?t/2-a/2:o.x*r,$=o.y==null?t/2-s/2:o.y*r,c=null;if(o.excavate){let p=Math.floor(i),d=Math.floor($),u=Math.ceil(a+i-p),m=Math.ceil(s+$-d);c={x:p,y:d,w:u,h:m};}return {x:i,y:$,h:s,w:a,excavation:c}}function Pe(n,_,l,o){let t=_/l,e=n.w*t,r=n.h*t,a=(n.x+o)*t,s=(n.y+o)*t;return {imgWidth:e,imgHeight:r,imgLeft:a,imgTop:s}}function Ht(n){let{value:_,size:l=T,level:o=nt,bgColor:t=D,fgColor:e=b,eyeColor:r,dotColor:a,bodyPattern:s="circle",cornerEyePattern:i="gear",cornerEyeDotPattern:$="circle",margin:c=exports.DEFAULT_MARGIN,isOGContext:p=false,imageSettings:d,templateId:u,customTemplate:m,customProps:f,...v}=n,w=p&&d?.excavate&&(o==="L"||o==="M")?"Q":o,x=G.QrCode.encodeText(_,ot[w]).getModules(),A=x.length+c*2,F=_t(x,l,c,d),K=null;if(d!=null&&F!=null){F.excavation!=null&&(x=it(x,F.excavation));let{imgWidth:It,imgHeight:dt,imgLeft:wt,imgTop:bt}=Pe(F,l,A,c);p?K=jsxRuntime.jsx("img",{alt:"Logo",src:d.src,style:{position:"absolute",left:`${wt}px`,top:`${bt}px`,width:`${It}px`,height:`${dt}px`}}):K=jsxRuntime.jsx("image",{height:dt,href:d.src,preserveAspectRatio:"none",width:It,x:wt,y:bt});}let P=l/A,$t=x.length,g=7*P,z=1.5*P,Ct=y1(x,{margin:c,pixelSize:P,pattern:s}),V=M(t,D),ct=M(e,b),yt=V.type==="linear"||V.type==="radial"?Ut(V,l,"bg-color"):null,St=ct.type==="linear"||ct.type==="radial"?Ut(ct,l,"fg-color"):null,Be=H(t,yt?.id??null,D),Jt=H(e,St?.id??null,b),Q=c*P,W=c*P,Z=($t-7+c)*P,q=c*P,X=c*P,Y=($t-7+c)*P,k=M(r,L(e,b)),U=M(a,L(e,b)),Lt=k.type==="linear"||k.type==="radial"?at(k,Q,W,g,"top-left","corners-square-color-0-0"):null,Mt=k.type==="linear"||k.type==="radial"?at(k,Z,q,g,"top-right","corners-square-color-1-0"):null,Pt=k.type==="linear"||k.type==="radial"?at(k,X,Y,g,"bottom-left","corners-square-color-0-1"):null,At=U.type==="linear"||U.type==="radial"?at(U,Q,W,g,"top-left","corners-dot-color-0-0"):null,Tt=U.type==="linear"||U.type==="radial"?at(U,Z,q,g,"top-right","corners-dot-color-1-0"):null,Dt=U.type==="linear"||U.type==="radial"?at(U,X,Y,g,"bottom-left","corners-dot-color-0-1"):null,Kt=H(r,Lt?.id??null,L(e,b)),jt=H(r,Mt?.id??null,L(e,b)),te=H(r,Pt?.id??null,L(e,b)),ee=H(a,At?.id??null,L(e,b)),re=H(a,Tt?.id??null,L(e,b)),oe=H(a,Dt?.id??null,L(e,b)),Oe=tt(Q,W,g,i),He=j(Q+g/2,W+g/2,z,$),Ve=tt(Z,q,g,i),Qe=j(Z+g/2,q+g/2,z,$),We=tt(X,Y,g,i),Ze=j(X+g/2,Y+g/2,z,$),qe=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("defs",{children:[yt?.element,St?.element,Lt?.element,Mt?.element,Pt?.element,At?.element,Tt?.element,Dt?.element]}),jsxRuntime.jsx("rect",{fill:Be,height:l,width:l,x:0,y:0}),jsxRuntime.jsx("g",{fill:Jt,children:Ct}),jsxRuntime.jsx("g",{fill:Kt,children:jsxRuntime.jsx("path",{fillRule:"evenodd",d:Oe,transform:`rotate(0,${Q+g/2},${W+g/2})`})}),jsxRuntime.jsx("g",{fill:ee,children:He}),jsxRuntime.jsx("g",{fill:jt,children:jsxRuntime.jsx("path",{fillRule:"evenodd",d:Ve,transform:`rotate(0,${Z+g/2},${q+g/2})`})}),jsxRuntime.jsx("g",{fill:re,children:Qe}),jsxRuntime.jsx("g",{fill:te,children:jsxRuntime.jsx("path",{fillRule:"evenodd",d:We,transform:`rotate(0,${X+g/2},${Y+g/2})`})}),jsxRuntime.jsx("g",{fill:oe,children:Ze}),K]}),ne=m||(u?exports.getTemplate(u):void 0);if(ne){let dt=V.type==="linear"||V.type==="radial"?Ut(V,300,"bg-color-template"):null,wt=H(t,dt?.id??null,D),bt=jsxRuntime.jsxs("svg",{height:300,viewBox:"0 0 300 300",width:300,xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsxs("defs",{children:[dt?.element,St?.element,Lt?.element,Mt?.element,Pt?.element,At?.element,Tt?.element,Dt?.element]}),jsxRuntime.jsx("rect",{fill:wt,height:300,width:300,x:0,y:0}),jsxRuntime.jsxs("g",{transform:`scale(${300/l})`,children:[jsxRuntime.jsx("g",{fill:Jt,children:Ct}),jsxRuntime.jsx("g",{fill:Kt,children:jsxRuntime.jsx("path",{fillRule:"evenodd",d:tt(Q,W,g,i),transform:`rotate(0,${Q+g/2},${W+g/2})`})}),jsxRuntime.jsx("g",{fill:ee,children:j(Q+g/2,W+g/2,z,$)}),jsxRuntime.jsx("g",{fill:jt,children:jsxRuntime.jsx("path",{fillRule:"evenodd",d:tt(Z,q,g,i),transform:`rotate(0,${Z+g/2},${q+g/2})`})}),jsxRuntime.jsx("g",{fill:re,children:j(Z+g/2,q+g/2,z,$)}),jsxRuntime.jsx("g",{fill:te,children:jsxRuntime.jsx("path",{fillRule:"evenodd",d:tt(X,Y,g,i),transform:`rotate(0,${X+g/2},${Y+g/2})`})}),jsxRuntime.jsx("g",{fill:oe,children:j(X+g/2,Y+g/2,z,$)}),K]})]}),Xe=300/l,Ye={pixelSize:P*Xe,url:_},ae=ne.wrapper(bt,{fgColor:e,bgColor:t,...f||{},...v},Ye),Je={...ae?.props?.style||{},width:void 0,height:void 0};return g1__default.default.cloneElement(ae,{width:l,height:l,style:Je})}return jsxRuntime.jsx("svg",{height:l,viewBox:`0 0 ${l} ${l}`,width:l,xmlns:"http://www.w3.org/2000/svg",...v,children:qe})}var Le;exports.SUPPORTS_PATH2D=void 0;exports.hexToRgb=void 0;exports.getLuminance=void 0;exports.getContrastRatio=void 0;exports.getContrastLevel=void 0;var st=S(()=>{pt();mt();J();ce();de();kt();ut();ut();Le=0;exports.SUPPORTS_PATH2D=(()=>{try{new Path2D().addPath(new Path2D);}catch{return false}return true})(),exports.hexToRgb=n=>{let _=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(n);return _?{r:Number.parseInt(_[1],16),g:Number.parseInt(_[2],16),b:Number.parseInt(_[3],16)}:null},exports.getLuminance=(n,_,l)=>{let[o,t,e]=[n,_,l].map(r=>(r/=255,r<=.03928?r/12.92:((r+.055)/1.055)**2.4));return .2126*o+.7152*t+.0722*e},exports.getContrastRatio=(n,_)=>{let l=exports.hexToRgb(n),o=exports.hexToRgb(_);if(!(l&&o))return 1;let t=exports.getLuminance(l.r,l.g,l.b),e=exports.getLuminance(o.r,o.g,o.b),r=Math.max(t,e),a=Math.min(t,e);return (r+.05)/(a+.05)},exports.getContrastLevel=n=>n>=7?{level:"AAA",warning:false,message:"Excellent contrast"}:n>=4.5?{level:"AA",warning:false,message:"Good contrast"}:n>=3?{level:"AA Large",warning:true,message:"Low contrast - may be difficult to scan"}:{level:"Fail",warning:true,message:"Poor contrast - QR code may not scan properly"};});pt();mt();J();st();ut();pt();var R1=zod.z.object({x:zod.z.number(),y:zod.z.number(),w:zod.z.number(),h:zod.z.number()});var Te=["square","rounded","circle","diamond","message","message-reverse","diya","diya-reverse","rounded-triangle","star","banner"],Qt=zod.z.enum(Te);var De=["square","rounded","gear","circle","diya","extra-rounded","message","pointy","curly"],Wt=zod.z.enum(De);var Ie=["circle","circle-large","square","diamond","circle-mixed","pacman","rounded","small-square","vertical-line"],Zt=zod.z.enum(Ie);J();pt();var Ge=zod.z.object({src:zod.z.string(),height:zod.z.number(),width:zod.z.number(),excavate:zod.z.boolean(),x:zod.z.number().optional(),y:zod.z.number().optional()}),Fe=zod.z.enum(["L","M","Q","H"]),P1=zod.z.object({value:zod.z.string(),size:zod.z.number().optional(),level:Fe.optional(),bgColor:exports.colorConfigSchema.optional(),fgColor:exports.colorConfigSchema.optional(),eyeColor:exports.colorConfigSchema.optional(),dotColor:exports.colorConfigSchema.optional(),bodyPattern:Zt.optional(),cornerEyePattern:Wt.optional(),cornerEyeDotPattern:Qt.optional(),margin:zod.z.number().optional(),imageSettings:Ge.optional(),isOGContext:zod.z.boolean().optional(),templateId:zod.z.string().optional(),customProps:zod.z.record(zod.z.string(),zod.z.any()).optional()});var A1=zod.z.object({fgColor:zod.z.string().optional(),bgColor:zod.z.string().optional()}),T1=zod.z.object({pixelSize:zod.z.number(),url:zod.z.string()}),D1=zod.z.object({id:zod.z.string(),name:zod.z.string(),description:zod.z.string().optional()});mt();J();st();ut();async function m0(n){let{value:_,size:l=T,level:o=nt,bgColor:t=D,fgColor:e=b,margin:r=exports.DEFAULT_MARGIN,imageSettings:a,...s}=n,i=G.QrCode.encodeText(_,ot[o]).getModules(),$=i.length+r*2,c=_t(i,l,r,a),p=jsxRuntime.jsx(jsxRuntime.Fragment,{});if(a!=null&&c!=null){c.excavation!=null&&(i=it(i,c.excavation));let u=await fetch(`https://wsrv.nl/?url=${a.src}&w=100&h=100&encoding=base64`).then(m=>m.text());p=jsxRuntime.jsx("image",{height:c.h,href:u,preserveAspectRatio:"none",width:c.w,x:c.x+r,y:c.y+r});}let d=ft(i,r);return jsxRuntime.jsxs("svg",{height:l,viewBox:`0 0 ${$} ${$}`,width:l,xmlns:"http://www.w3.org/2000/svg",...s,children:[jsxRuntime.jsx("path",{d:`M0,0 h${$}v${$}H0z`,fill:L(t,D),shapeRendering:"crispEdges"}),jsxRuntime.jsx("path",{d,fill:L(e,b),shapeRendering:"crispEdges"}),p]})}var z1=(n,_,l,o)=>{let t=document.createElement("canvas");t.width=_,t.height=l;let e=t.getContext("2d");if(!e)return;e.putImageData(n,0,0);let r=t.toDataURL("image/png"),a=document.createElement("a");a.href=r,a.download=o,document.body.appendChild(a),a.click(),document.body.removeChild(a);},N1=(n,_,l,o)=>new Promise(t=>{n.complete?e():n.onload=()=>e();function e(){let r=document.createElement("canvas");requestAnimationFrame(()=>{if(!(n.naturalWidth&&n.naturalHeight)){t(null);return}let a=n.naturalWidth/n.naturalHeight<=.33||n.naturalWidth/n.naturalHeight>=3?Math.sqrt(n.naturalWidth*n.naturalHeight/12e5):n.naturalWidth/n.naturalHeight<=.5||n.naturalWidth/n.naturalHeight>=2?Math.sqrt(n.naturalWidth*n.naturalHeight/9e5):Math.sqrt(n.naturalWidth*n.naturalHeight/64e4),s=r.getContext("2d",{willReadFrequently:true});if(!s){t(null);return}let i=[1,.8,.6,.4,.2,.1];for(let $ of i){let c=Math.floor(n.naturalWidth*_*$/a),p=Math.floor(n.naturalHeight*_*$/a);r.width=c,r.height=p,s.clearRect(0,0,c,p),s.imageSmoothingEnabled=true,s.imageSmoothingQuality="high";try{s.drawImage(n,Math.floor(l),Math.floor(o),Math.floor(n.naturalWidth*_),Math.floor(n.naturalHeight*_),0,0,c,p);let d=s.getImageData(0,0,c,p);z1(d,c,p,`qr_processed_${c}x${p}_scale${$}_${Date.now()}.png`);try{let u=F1__default.default(d.data,c,p);if(u?.data){t(u);return}}catch(u){console.error("QR Detection error:",u);}}catch(d){console.error("Canvas drawing error:",d);}t(null);}t(null);});}}),g0=async(n,_,l=false)=>{if(!n)return "NO_QR";await new Promise(t=>setTimeout(t,100));let o=[{dx:0,dy:0,ratio:1},{dx:0,dy:n.naturalHeight*.35,ratio:.65},{dx:n.naturalWidth*.35,dy:n.naturalHeight*.35,ratio:.65},{dx:n.naturalWidth*.35,dy:0,ratio:.65},{dx:n.naturalWidth*.35/2,dy:n.naturalHeight*.35/2,ratio:.65}];for(let t of o)try{let e=await N1(n,t.ratio,t.dx,t.dy);if(e?.data)return l?e:e.data}catch(e){console.warn("QR decode error:",e);}return "NO_QR"};function C0(n,_,l){if(!(n&&_)||_.length!==4)return;let o=document.createElement("canvas");o.width=n.naturalWidth,o.height=n.naturalHeight;let t=o.getContext("2d");if(!t)return;t.drawImage(n,0,0),t.save(),t.strokeStyle="#ff0000",t.lineWidth=Math.max(5,Math.min(n.naturalWidth,n.naturalHeight)/200),t.shadowColor="transparent",t.shadowBlur=0,t.beginPath(),t.moveTo(_[0].x,_[0].y),t.lineTo(_[1].x,_[1].y),t.lineTo(_[3].x,_[3].y),t.lineTo(_[2].x,_[2].y),t.closePath(),t.stroke(),t.fillStyle="#ff0000",_.forEach((a,s)=>{t.fillRect(a.x-3,a.y-3,6,6),t.fillStyle="#ffffff",t.font="16px Arial",t.fillText(`${s}`,a.x+5,a.y-5),t.fillStyle="#ff0000";}),t.restore();let e=o.toDataURL("image/png"),r=document.createElement("a");r.href=e,r.download=l,document.body.appendChild(r),r.click(),document.body.removeChild(r);}J();var v0={small:{width:200,height:200},medium:{width:400,height:400},large:{width:800,height:800},xlarge:{width:1200,height:1200},"2xl":{width:1600,height:1600},"3xl":{width:2e3,height:2e3}};function Xt(n,_){return n<50||_<50?{isValid:false,error:"Size must be at least 50x50 pixels"}:n>5e3||_>5e3?{isValid:false,error:"Size must not exceed 5000x5000 pixels"}:n!==_?{isValid:false,error:"Width and height must be equal for QR codes"}:{isValid:true}}function qt(n,_){let l=document.createElement("a");l.href=n,l.download=_,document.body.appendChild(l),l.click(),document.body.removeChild(l);}function ze(n){switch(n){case "png":return "image/png";case "jpg":return "image/jpeg";case "svg":return "image/svg+xml";case "pdf":return "application/pdf";default:return "image/png"}}async function Ne(n){let{jsPDF:_}=await import('jspdf'),l=await lt(n),o=decodeURIComponent(l.replace("data:image/svg+xml,","")),t;try{let $=new TextEncoder().encode(o),c=Array.from($,d=>String.fromCharCode(d)).join("");t=`data:image/svg+xml;base64,${btoa(c)}`;}catch($){throw new Error(`Failed to encode SVG for PDF conversion: ${$}`)}let e=await new Promise(($,c)=>{let p=new Image,d=document.createElement("canvas"),u=n.size||T;d.width=u,d.height=u;let m=d.getContext("2d");if(!m){c(new Error("Could not get canvas context"));return}let f=setTimeout(()=>{d.remove(),c(new Error("SVG load timeout - image may be too large or contain invalid data"));},3e4);p.onload=()=>{clearTimeout(f);try{m.drawImage(p,0,0,u,u),$(d);}catch(v){clearTimeout(f),d.remove(),c(new Error(`Failed to draw image to canvas: ${v}`));}},p.onerror=()=>{clearTimeout(f),d.remove(),c(new Error("Could not load SVG for PDF conversion"));},p.src=t;}),r=e.toDataURL("image/png",1),s=(n.size||T)*.264583,i=new _({orientation:"portrait",unit:"mm",format:[s,s]});return i.addImage(r,"PNG",0,0,s,s),e.remove(),i.output("dataurlstring")}async function x0(n,_){let{format:l,size:o,filename:t}=_,e=Xt(o.width,o.height);if(!e.isValid)throw new Error(e.error);let r={...n,size:o.width},a=`qr-code-${o.width}x${o.height}.${l}`,s=t||a;try{if(l==="svg"){let i=await lt(r);qt(i,s);}else if(l==="pdf"){let i=await Ne(r);qt(i,s);}else {let i=ze(l),$=await Rt(r,i);if(typeof $=="string")qt($,s);else throw new Error("Failed to generate image data URL")}}catch(i){throw console.error(`Error downloading ${l.toUpperCase()}:`,i),i}}async function E0(n,_,l){let o=Xt(l.width,l.height);if(!o.isValid)throw new Error(o.error);let t={...n,size:l.width};if(_==="svg")return await lt(t);if(_==="pdf")return await Ne(t);let e=ze(_),r=await Rt(t,e);if(typeof r=="string")return r;throw new Error("Failed to generate QR code data URL")}async function R0(n,_={width:T,height:T}){try{let l=Xt(_.width,_.height);if(!l.isValid)throw new Error(l.error);let o={...n,size:_.width},t=await Rt(o,"image/png",!0),e=await new Promise((r,a)=>{t.toBlob(s=>{s?r(s):a(new Error("Failed to create blob from canvas"));},"image/png");});await navigator.clipboard.write([new ClipboardItem({"image/png":e})]),t.remove();}catch(l){throw console.error("Error copying to clipboard:",l),l}}async function S0(n){let _=await lt(n);return decodeURIComponent(_.replace("data:image/svg+xml,",""))}J();J();function Yt({value:n,size:_=1024,fgColor:l,bgColor:o,eyeColor:t,dotColor:e,bodyPattern:r,hideLogo:a,logo:s,margin:i,cornerEyePattern:$,cornerEyeDotPattern:c,level:p,templateId:d}){return {value:`${n}`,bgColor:o,fgColor:l,eyeColor:t,dotColor:e,bodyPattern:r,cornerEyePattern:$,cornerEyeDotPattern:c,level:p,templateId:d,size:_,margin:i,...!a&&{imageSettings:{src:s||$e,height:256,width:256,excavate:true}}}}st();var B1=g1.memo(({value:n,fgColor:_,hideLogo:l,logo:o,bgColor:t,eyeColor:e,dotColor:r,bodyPattern:a,cornerEyePattern:s,cornerEyeDotPattern:i,level:$,scale:c=1,margin:p=exports.DEFAULT_MARGIN,templateId:d,customTemplate:u,customProps:m})=>{let f=g1.useMemo(()=>Yt({value:n,fgColor:_,hideLogo:l,bgColor:t,eyeColor:e,dotColor:r,bodyPattern:a,cornerEyePattern:s,cornerEyeDotPattern:i,level:$,templateId:d,logo:o,margin:p}),[n,_,l,o,p,t,e,r,a,s,i,$,d]);return jsxRuntime.jsx(Ht,{bgColor:f.bgColor,bodyPattern:f.bodyPattern,cornerEyeDotPattern:f.cornerEyeDotPattern,cornerEyePattern:f.cornerEyePattern,customProps:m,customTemplate:u,dotColor:f.dotColor,eyeColor:f.eyeColor,fgColor:f.fgColor,level:$||f.level,margin:f.margin,size:f.size/8*c,templateId:f.templateId,value:f.value,...f.imageSettings&&{imageSettings:{...f.imageSettings,height:f.imageSettings?f.imageSettings.height/8*c:0,width:f.imageSettings?f.imageSettings.width/8*c:0}}})});B1.displayName="QRCode";kt();st();function O0(n){let{value:_,size:l=T,level:o=nt,bgColor:t=D,fgColor:e=b,margin:r=exports.DEFAULT_MARGIN,style:a,imageSettings:s,...i}=n,$=s?.src,c=g1.useRef(null),p=g1.useRef(null),[d,u]=g1.useState(false);g1.useEffect(()=>{if(c.current!=null){let v=c.current,C=v.getContext("2d");if(!C)return;let w=G.QrCode.encodeText(_,ot[o]).getModules(),x=w.length+r*2,A=_t(w,l,r,s),F=p.current,K=A!=null&&F!==null&&F.complete&&F.naturalHeight!==0&&F.naturalWidth!==0;K&&A.excavation!=null&&(w=it(w,A.excavation));let P=window.devicePixelRatio||1;v.height=v.width=l*P;let $t=l/x*P;C.scale($t,$t);let g=M(t,D);C.fillStyle=g.type==="solid"?g.color:g.stops[0]?.color||D,C.fillRect(0,0,x,x);let z=M(e,b);C.fillStyle=z.type==="solid"?z.color:z.stops[0]?.color||b,exports.SUPPORTS_PATH2D?C.fill(new Path2D(ft(w,r))):w.forEach((Ct,V)=>{Ct.forEach((ct,yt)=>{ct&&C.fillRect(yt+r,V+r,1,1);});}),K&&C.drawImage(F,A.x+r,A.y+r,A.w,A.h);}});let m={height:l,width:l,...a},f=null;return $!=null&&(f=jsxRuntime.jsx("img",{alt:"QR code",onLoad:()=>{u(true);},ref:p,src:$,style:{display:"none"}},$)),jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("canvas",{height:l,ref:c,style:m,width:l,...i}),f]})}async function lt(n){let{QRCodeSVG:_}=await Promise.resolve().then(()=>(st(),Ae)),{renderToStaticMarkup:l}=await import('react-dom/server'),o=await import('react'),t={...n};if(n.imageSettings?.src)try{let p=await Q1(n.imageSettings.src);t={...n,imageSettings:{...n.imageSettings,src:p}};}catch{let{imageSettings:d,...u}=n;t=u;}let{hideLogo:e,url:r,logo:a,scale:s,...i}=t,$=o.createElement(_,{...i,templateId:t.templateId,customTemplate:t.customTemplate}),c=l($);return `data:image/svg+xml,${encodeURIComponent(c)}`}var Q1=n=>new Promise((_,l)=>{if(n.startsWith("data:")){_(n);return}let o=new Image;o.crossOrigin="anonymous",o.onload=()=>{try{let t=document.createElement("canvas");t.width=o.naturalWidth||o.width,t.height=o.naturalHeight||o.height;let e=t.getContext("2d");if(!e){l(new Error("Could not get canvas context"));return}e.drawImage(o,0,0);let r=t.toDataURL("image/png");t.remove(),_(r);}catch(t){l(new Error(`Failed to convert image to base64: ${t}`));}},o.onerror=()=>{l(new Error(`Could not load image from ${n.substring(0,100)}... Check CORS settings or use a data URL.`));},o.src=n;});async function Rt(n,_,l){let o=await lt(n),t=decodeURIComponent(o.replace("data:image/svg+xml,","")),e;try{let r=new TextEncoder().encode(t),a=Array.from(r,i=>String.fromCharCode(i)).join("");e=`data:image/svg+xml;base64,${btoa(a)}`;}catch(r){throw new Error(`Failed to encode SVG for canvas conversion: ${r}`)}return new Promise((r,a)=>{let s=document.createElement("canvas"),i=s.getContext("2d");if(!i){a(new Error("Could not get canvas context"));return}let $=new Image,c=n.size||T;s.width=c,s.height=c;let p=setTimeout(()=>{s.remove(),a(new Error("SVG load timeout - image may be too large or contain invalid data"));},3e4);$.onload=()=>{clearTimeout(p);try{if(_==="image/jpeg"&&(i.fillStyle="white",i.fillRect(0,0,s.width,s.height)),i.drawImage($,0,0,c,c),l)r(s);else {let d=s.toDataURL(_,1);s.remove(),r(d);}}catch(d){clearTimeout(p),s.remove(),a(new Error(`Failed to draw SVG to canvas: ${d}`));}},$.onerror=()=>{clearTimeout(p),s.remove(),a(new Error("Could not load SVG"));},$.src=e;})}/**
|
|
1
|
+
'use strict';var zod=require('zod'),Sm=require('react'),jsxRuntime=require('react/jsx-runtime'),qrCodeCanvas_js=require('./qr-code-canvas.js');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var Sm__default=/*#__PURE__*/_interopDefault(Sm);var pu=Object.defineProperty;var z=(t,e,n)=>()=>{if(n)throw n[0];try{return t&&(e=t(t=0)),e}catch(o){throw n=[o],o}};var gu=(t,e)=>{for(var n in e)pu(t,n,{get:e[n],enumerable:true});};var yn,wt,me=z(()=>{"use strict";(a=>{class t{constructor(c,s,l,u){this.version=c;this.errorCorrectionLevel=s;if(c<t.MIN_VERSION||c>t.MAX_VERSION)throw new RangeError("Version value out of range");if(u<-1||u>7)throw new RangeError("Mask value out of range");this.size=c*4+17;let m=[];for(let d=0;d<this.size;d++)m.push(!1);for(let d=0;d<this.size;d++)this.modules.push(m.slice()),this.isFunction.push(m.slice());this.drawFunctionPatterns();let h=this.addEccAndInterleave(l);if(this.drawCodewords(h),u==-1){let d=1e9;for(let p=0;p<8;p++){this.applyMask(p),this.drawFormatBits(p);let f=this.getPenaltyScore();f<d&&(u=p,d=f),this.applyMask(p);}}o(0<=u&&u<=7),this.mask=u,this.applyMask(u),this.drawFormatBits(u),this.isFunction=[];}version;errorCorrectionLevel;static encodeText(c,s){let l=a.QrSegment.makeSegments(c);return t.encodeSegments(l,s)}static encodeBinary(c,s){let l=a.QrSegment.makeBytes(c);return t.encodeSegments([l],s)}static encodeSegments(c,s,l=1,u=40,m=-1,h=!0){if(!(t.MIN_VERSION<=l&&l<=u&&u<=t.MAX_VERSION)||m<-1||m>7)throw new RangeError("Invalid value");let d,p;for(d=l;;d++){let y=t.getNumDataCodewords(d,s)*8,_=r.getTotalBits(c,d);if(_<=y){p=_;break}if(d>=u)throw new RangeError("Data too long")}for(let y of [t.Ecc.MEDIUM,t.Ecc.QUARTILE,t.Ecc.HIGH])h&&p<=t.getNumDataCodewords(d,y)*8&&(s=y);let f=[];for(let y of c){e(y.mode.modeBits,4,f),e(y.numChars,y.mode.numCharCountBits(d),f);for(let _ of y.getData())f.push(_);}o(f.length==p);let g=t.getNumDataCodewords(d,s)*8;o(f.length<=g),e(0,Math.min(4,g-f.length),f),e(0,(8-f.length%8)%8,f),o(f.length%8==0);for(let y=236;f.length<g;y^=253)e(y,8,f);let b=[];for(;b.length*8<f.length;)b.push(0);return f.forEach((y,_)=>b[_>>>3]|=y<<7-(_&7)),new t(d,s,b,m)}size;mask;modules=[];isFunction=[];getModule(c,s){return 0<=c&&c<this.size&&0<=s&&s<this.size&&this.modules[s][c]}getModules(){return this.modules}drawFunctionPatterns(){for(let l=0;l<this.size;l++)this.setFunctionModule(6,l,l%2==0),this.setFunctionModule(l,6,l%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);let c=this.getAlignmentPatternPositions(),s=c.length;for(let l=0;l<s;l++)for(let u=0;u<s;u++)l==0&&u==0||l==0&&u==s-1||l==s-1&&u==0||this.drawAlignmentPattern(c[l],c[u]);this.drawFormatBits(0),this.drawVersion();}drawFormatBits(c){let s=this.errorCorrectionLevel.formatBits<<3|c,l=s;for(let m=0;m<10;m++)l=l<<1^(l>>>9)*1335;let u=(s<<10|l)^21522;o(u>>>15==0);for(let m=0;m<=5;m++)this.setFunctionModule(8,m,n(u,m));this.setFunctionModule(8,7,n(u,6)),this.setFunctionModule(8,8,n(u,7)),this.setFunctionModule(7,8,n(u,8));for(let m=9;m<15;m++)this.setFunctionModule(14-m,8,n(u,m));for(let m=0;m<8;m++)this.setFunctionModule(this.size-1-m,8,n(u,m));for(let m=8;m<15;m++)this.setFunctionModule(8,this.size-15+m,n(u,m));this.setFunctionModule(8,this.size-8,!0);}drawVersion(){if(this.version<7)return;let c=this.version;for(let l=0;l<12;l++)c=c<<1^(c>>>11)*7973;let s=this.version<<12|c;o(s>>>18==0);for(let l=0;l<18;l++){let u=n(s,l),m=this.size-11+l%3,h=Math.floor(l/3);this.setFunctionModule(m,h,u),this.setFunctionModule(h,m,u);}}drawFinderPattern(c,s){for(let l=-4;l<=4;l++)for(let u=-4;u<=4;u++){let m=Math.max(Math.abs(u),Math.abs(l)),h=c+u,d=s+l;0<=h&&h<this.size&&0<=d&&d<this.size&&this.setFunctionModule(h,d,m!=2&&m!=4);}}drawAlignmentPattern(c,s){for(let l=-2;l<=2;l++)for(let u=-2;u<=2;u++)this.setFunctionModule(c+u,s+l,Math.max(Math.abs(u),Math.abs(l))!=1);}setFunctionModule(c,s,l){this.modules[s][c]=l,this.isFunction[s][c]=!0;}addEccAndInterleave(c){let s=this.version,l=this.errorCorrectionLevel;if(c.length!=t.getNumDataCodewords(s,l))throw new RangeError("Invalid argument");let u=t.NUM_ERROR_CORRECTION_BLOCKS[l.ordinal][s],m=t.ECC_CODEWORDS_PER_BLOCK[l.ordinal][s],h=Math.floor(t.getNumRawDataModules(s)/8),d=u-h%u,p=Math.floor(h/u),f=[],g=t.reedSolomonComputeDivisor(m);for(let y=0,_=0;y<u;y++){let w=c.slice(_,_+p-m+(y<d?0:1));_+=w.length;let R=t.reedSolomonComputeRemainder(w,g);y<d&&w.push(0),f.push(w.concat(R));}let b=[];for(let y=0;y<f[0].length;y++)f.forEach((_,w)=>{(y!=p-m||w>=d)&&b.push(_[y]);});return o(b.length==h),b}drawCodewords(c){if(c.length!=Math.floor(t.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let s=0;for(let l=this.size-1;l>=1;l-=2){l==6&&(l=5);for(let u=0;u<this.size;u++)for(let m=0;m<2;m++){let h=l-m,p=(l+1&2)==0?this.size-1-u:u;!this.isFunction[p][h]&&s<c.length*8&&(this.modules[p][h]=n(c[s>>>3],7-(s&7)),s++);}}o(s==c.length*8);}applyMask(c){if(c<0||c>7)throw new RangeError("Mask value out of range");for(let s=0;s<this.size;s++)for(let l=0;l<this.size;l++){let u;switch(c){case 0:u=(l+s)%2==0;break;case 1:u=s%2==0;break;case 2:u=l%3==0;break;case 3:u=(l+s)%3==0;break;case 4:u=(Math.floor(l/3)+Math.floor(s/2))%2==0;break;case 5:u=l*s%2+l*s%3==0;break;case 6:u=(l*s%2+l*s%3)%2==0;break;case 7:u=((l+s)%2+l*s%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[s][l]&&u&&(this.modules[s][l]=!this.modules[s][l]);}}getPenaltyScore(){let c=0;for(let m=0;m<this.size;m++){let h=!1,d=0,p=[0,0,0,0,0,0,0];for(let f=0;f<this.size;f++)this.modules[m][f]==h?(d++,d==5?c+=t.PENALTY_N1:d>5&&c++):(this.finderPenaltyAddHistory(d,p),h||(c+=this.finderPenaltyCountPatterns(p)*t.PENALTY_N3),h=this.modules[m][f],d=1);c+=this.finderPenaltyTerminateAndCount(h,d,p)*t.PENALTY_N3;}for(let m=0;m<this.size;m++){let h=!1,d=0,p=[0,0,0,0,0,0,0];for(let f=0;f<this.size;f++)this.modules[f][m]==h?(d++,d==5?c+=t.PENALTY_N1:d>5&&c++):(this.finderPenaltyAddHistory(d,p),h||(c+=this.finderPenaltyCountPatterns(p)*t.PENALTY_N3),h=this.modules[f][m],d=1);c+=this.finderPenaltyTerminateAndCount(h,d,p)*t.PENALTY_N3;}for(let m=0;m<this.size-1;m++)for(let h=0;h<this.size-1;h++){let d=this.modules[m][h];d==this.modules[m][h+1]&&d==this.modules[m+1][h]&&d==this.modules[m+1][h+1]&&(c+=t.PENALTY_N2);}let s=0;for(let m of this.modules)s=m.reduce((h,d)=>h+(d?1:0),s);let l=this.size*this.size,u=Math.ceil(Math.abs(s*20-l*10)/l)-1;return o(0<=u&&u<=9),c+=u*t.PENALTY_N4,o(0<=c&&c<=2568888),c}getAlignmentPatternPositions(){if(this.version==1)return [];{let c=Math.floor(this.version/7)+2,s=this.version==32?26:Math.ceil((this.version*4+4)/(c*2-2))*2,l=[6];for(let u=this.size-7;l.length<c;u-=s)l.splice(1,0,u);return l}}static getNumRawDataModules(c){if(c<t.MIN_VERSION||c>t.MAX_VERSION)throw new RangeError("Version number out of range");let s=(16*c+128)*c+64;if(c>=2){let l=Math.floor(c/7)+2;s-=(25*l-10)*l-55,c>=7&&(s-=36);}return o(208<=s&&s<=29648),s}static getNumDataCodewords(c,s){return Math.floor(t.getNumRawDataModules(c)/8)-t.ECC_CODEWORDS_PER_BLOCK[s.ordinal][c]*t.NUM_ERROR_CORRECTION_BLOCKS[s.ordinal][c]}static reedSolomonComputeDivisor(c){if(c<1||c>255)throw new RangeError("Degree out of range");let s=[];for(let u=0;u<c-1;u++)s.push(0);s.push(1);let l=1;for(let u=0;u<c;u++){for(let m=0;m<s.length;m++)s[m]=t.reedSolomonMultiply(s[m],l),m+1<s.length&&(s[m]^=s[m+1]);l=t.reedSolomonMultiply(l,2);}return s}static reedSolomonComputeRemainder(c,s){let l=s.map(u=>0);for(let u of c){let m=u^l.shift();l.push(0),s.forEach((h,d)=>l[d]^=t.reedSolomonMultiply(h,m));}return l}static reedSolomonMultiply(c,s){if(c>>>8||s>>>8)throw new RangeError("Byte out of range");let l=0;for(let u=7;u>=0;u--)l=l<<1^(l>>>7)*285,l^=(s>>>u&1)*c;return o(l>>>8==0),l}finderPenaltyCountPatterns(c){let s=c[1];o(s<=this.size*3);let l=s>0&&c[2]==s&&c[3]==s*3&&c[4]==s&&c[5]==s;return (l&&c[0]>=s*4&&c[6]>=s?1:0)+(l&&c[6]>=s*4&&c[0]>=s?1:0)}finderPenaltyTerminateAndCount(c,s,l){return c&&(this.finderPenaltyAddHistory(s,l),s=0),s+=this.size,this.finderPenaltyAddHistory(s,l),this.finderPenaltyCountPatterns(l)}finderPenaltyAddHistory(c,s){s[0]==0&&(c+=this.size),s.pop(),s.unshift(c);}static MIN_VERSION=1;static MAX_VERSION=40;static PENALTY_N1=3;static PENALTY_N2=3;static PENALTY_N3=40;static PENALTY_N4=10;static ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]];static NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]]}a.QrCode=t;function e(i,c,s){if(c<0||c>31||i>>>c)throw new RangeError("Value out of range");for(let l=c-1;l>=0;l--)s.push(i>>>l&1);}function n(i,c){return (i>>>c&1)!=0}function o(i){if(!i)throw new Error("Assertion error")}class r{constructor(c,s,l){this.mode=c;this.numChars=s;this.bitData=l;if(s<0)throw new RangeError("Invalid argument");this.bitData=l.slice();}mode;numChars;bitData;static makeBytes(c){let s=[];for(let l of c)e(l,8,s);return new r(r.Mode.BYTE,c.length,s)}static makeNumeric(c){if(!r.isNumeric(c))throw new RangeError("String contains non-numeric characters");let s=[];for(let l=0;l<c.length;){let u=Math.min(c.length-l,3);e(parseInt(c.substr(l,u),10),u*3+1,s),l+=u;}return new r(r.Mode.NUMERIC,c.length,s)}static makeAlphanumeric(c){if(!r.isAlphanumeric(c))throw new RangeError("String contains unencodable characters in alphanumeric mode");let s=[],l;for(l=0;l+2<=c.length;l+=2){let u=r.ALPHANUMERIC_CHARSET.indexOf(c.charAt(l))*45;u+=r.ALPHANUMERIC_CHARSET.indexOf(c.charAt(l+1)),e(u,11,s);}return l<c.length&&e(r.ALPHANUMERIC_CHARSET.indexOf(c.charAt(l)),6,s),new r(r.Mode.ALPHANUMERIC,c.length,s)}static makeSegments(c){return c==""?[]:r.isNumeric(c)?[r.makeNumeric(c)]:r.isAlphanumeric(c)?[r.makeAlphanumeric(c)]:[r.makeBytes(r.toUtf8ByteArray(c))]}static makeEci(c){let s=[];if(c<0)throw new RangeError("ECI assignment value out of range");if(c<128)e(c,8,s);else if(c<16384)e(2,2,s),e(c,14,s);else if(c<1e6)e(6,3,s),e(c,21,s);else throw new RangeError("ECI assignment value out of range");return new r(r.Mode.ECI,0,s)}static isNumeric(c){return r.NUMERIC_REGEX.test(c)}static isAlphanumeric(c){return r.ALPHANUMERIC_REGEX.test(c)}getData(){return this.bitData.slice()}static getTotalBits(c,s){let l=0;for(let u of c){let m=u.mode.numCharCountBits(s);if(u.numChars>=1<<m)return 1/0;l+=4+m+u.bitData.length;}return l}static toUtf8ByteArray(c){c=encodeURI(c);let s=[];for(let l=0;l<c.length;l++)c.charAt(l)!="%"?s.push(c.charCodeAt(l)):(s.push(parseInt(c.substr(l+1,2),16)),l+=2);return s}static NUMERIC_REGEX=/^[0-9]*$/;static ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/;static ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:"}a.QrSegment=r;})(yn||={});(e=>{let t;(o=>{class n{constructor(a,i){this.ordinal=a;this.formatBits=i;}ordinal;formatBits;static LOW=new n(0,1);static MEDIUM=new n(1,0);static QUARTILE=new n(2,3);static HIGH=new n(3,2)}o.Ecc=n;})(t=e.QrCode||={});})(yn||={});(e=>{let t;(o=>{class n{constructor(a,i){this.modeBits=a;this.numBitsCharCount=i;}modeBits;numBitsCharCount;static NUMERIC=new n(1,[10,12,14]);static ALPHANUMERIC=new n(2,[9,11,13]);static BYTE=new n(4,[8,16,16]);static KANJI=new n(8,[8,10,12]);static ECI=new n(7,[0,0,0]);numCharCountBits(a){return this.numBitsCharCount[Math.floor((a+7)/17)]}}o.Mode=n;})(t=e.QrSegment||={});})(yn||={});wt=yn;});var Lt,bt,te,yt,Pt;exports.DEFAULT_MARGIN=void 0;var ur,vt=z(()=>{"use strict";me();Lt={L:wt.QrCode.Ecc.LOW,M:wt.QrCode.Ecc.MEDIUM,Q:wt.QrCode.Ecc.QUARTILE,H:wt.QrCode.Ecc.HIGH},bt=128,te="Q",yt="#FFFFFF",Pt="#000000",exports.DEFAULT_MARGIN=0,ur=.1;});exports.FRAME_STYLES=void 0;exports.FRAME_TEXT_MAX_LENGTH=void 0;exports.DEFAULT_FRAME_TEXT=void 0;exports.FRAME_FONT_SCALE_MIN=void 0;exports.FRAME_FONT_SCALE_MAX=void 0;exports.frameStyleSchema=void 0;exports.frameSchema=void 0;var zn=z(()=>{"use strict";exports.FRAME_STYLES=["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"],exports.FRAME_TEXT_MAX_LENGTH=24,exports.DEFAULT_FRAME_TEXT="Scan me",exports.FRAME_FONT_SCALE_MIN=.5,exports.FRAME_FONT_SCALE_MAX=1.5,exports.frameStyleSchema=zod.z.enum(exports.FRAME_STYLES),exports.frameSchema=zod.z.object({style:exports.frameStyleSchema,text:zod.z.string().max(exports.FRAME_TEXT_MAX_LENGTH).optional(),color:zod.z.string().optional(),textColor:zod.z.string().optional(),secondaryText:zod.z.string().max(exports.FRAME_TEXT_MAX_LENGTH).optional(),secondaryColor:zod.z.string().optional(),fontScale:zod.z.number().min(exports.FRAME_FONT_SCALE_MIN).max(exports.FRAME_FONT_SCALE_MAX).optional()});});function it(t,e=3){let n=10**e;return Math.round(t*n)/n+0}function x(t,e=3){return String(it(t,e))}function P(t,...e){let n=t[0]??"";for(let o=0;o<e.length;o++){let r=e[o];n+=(typeof r=="number"?x(r):r)+(t[o+1]??"");}return n}var ft=z(()=>{"use strict";});function dr(t,e=Number.POSITIVE_INFINITY){if(!yu.test(t))return null;let n=[],o=0,r=()=>{for(;o<t.length&&/[\s,]/.test(t[o]);)o++;},a=()=>{r(),Fo.lastIndex=o;let s=Fo.exec(t);if(!s)return null;let l=s[0],u=l.indexOf(".");if(u>=0&&l.length-u-1>e)return null;o=Fo.lastIndex;let m=Number(l);return Number.isFinite(m)?m:null},i=()=>{r();let s=t[o];return s==="0"||s==="1"?(o++,s==="1"?1:0):null},c=()=>(r(),o<t.length&&/[0-9.+-]/.test(t[o]));for(r();o<t.length;){let s=t[o],l=s.toUpperCase(),u=bu[l];if(u===void 0||n.length===0&&l!=="M")return null;if(o++,u===0){n.push({command:s,values:[]}),r();continue}let m=s,h=true;for(;h||c();){let d=[];for(let p=0;p<u;p++){let f=l==="A"&&(p===3||p===4)?i():a();if(f===null)return null;d.push(f);}n.push({command:m,values:d}),l==="M"&&(m=s==="M"?"L":"l"),h=false;}r();}return n}function qi(t){let e=0;for(let{command:n}of t)e+=n.toUpperCase()==="A"?4:1;return e}function Qi(t,e=1,n=0,o=0){let r="";for(let{command:a,values:i}of t){let c=a.toUpperCase(),s=a===c,l=s?n:0,u=s?o:0,m;switch(c){case "Z":m=[];break;case "H":m=[x(i[0]*e+l)];break;case "V":m=[x(i[0]*e+u)];break;case "A":m=[x(Math.abs(i[0])*e),x(Math.abs(i[1])*e),x(i[2]),String(i[3]),String(i[4]),x(i[5]*e+l),x(i[6]*e+u)];break;default:m=i.map((h,d)=>x(h*e+(d%2===0?l:u)));}r+=a+m.join(" ");}return r}var bu,yu,Fo,To=z(()=>{"use strict";ft();bu={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0},yu=/^[MmLlHhVvCcSsQqTtAaZz0-9.,+\-\s]*$/,Fo=/[+-]?(?:\d+\.?\d*|\.\d+)/y;});function hr(t,e=.25){let n=[],o=[],r=[0,0],a=[0,0],i=()=>{o.length>2&&n.push(o),o=[];};for(let c of t)if(c.op==="M")i(),r=[c.x,c.y],a=r,o.push(r);else if(c.op==="L")a=[c.x,c.y],o.push(a);else if(c.op==="C"){let s=a,l=[c.x1,c.y1],u=[c.x2,c.y2],m=[c.x,c.y],h=Math.hypot(l[0]-s[0],l[1]-s[1])+Math.hypot(u[0]-l[0],u[1]-l[1])+Math.hypot(m[0]-u[0],m[1]-u[1]),d=Math.max(2,Math.min(64,Math.ceil(Math.sqrt(h/(4*e)))));for(let p=1;p<=d;p++){let f=p/d,g=1-f;o.push([g*g*g*s[0]+3*g*g*f*l[0]+3*g*f*f*u[0]+f*f*f*m[0],g*g*g*s[1]+3*g*g*f*l[1]+3*g*f*f*u[1]+f*f*f*m[1]]);}a=m;}else i(),a=r;return i(),n}function fr(t,e){let n=[r=>r[0]-e.x0,r=>e.x1-r[0],r=>r[1]-e.y0,r=>e.y1-r[1]],o=t;for(let r of n){if(o.length===0)break;let a=o;o=[];for(let i=0;i<a.length;i++){let c=a[i],s=a[(i+a.length-1)%a.length],l=r(c),u=r(s);l>=0?(u<0&&o.push(zi(s,c,u,l)),o.push(c)):u>=0&&o.push(zi(s,c,u,l));}}return o.length>2?o:[]}function zi(t,e,n,o){let r=n/(n-o);return [t[0]+(e[0]-t[0])*r,t[1]+(e[1]-t[1])*r]}function Ui(t){return t.filter(e=>e.length>2).map(e=>`M${e.map(([n,o])=>`${x(n)} ${x(o)}`).join("L")}Z`).join("")}function We(t){let e=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,r=Number.NEGATIVE_INFINITY,a=(i,c)=>{e=Math.min(e,i),n=Math.min(n,c),o=Math.max(o,i),r=Math.max(r,c);};for(let i of t)i.op==="C"?(a(i.x1,i.y1),a(i.x2,i.y2),a(i.x,i.y)):i.op!=="Z"&&a(i.x,i.y);return Number.isFinite(e)?{x0:e,y0:n,x1:o,y1:r}:null}var pr=z(()=>{"use strict";ft();});function Vi(t){return t.replace(/&(#x[0-9a-f]+|#\d+|[a-z]+);/gi,(e,n)=>{if(n[0]==="#"){let o=n[1].toLowerCase()==="x"?Number.parseInt(n.slice(2),16):Number.parseInt(n.slice(1),10);return Number.isInteger(o)&&o>0&&o<=1114111&&!(o>=55296&&o<=57343)?String.fromCodePoint(o):e}return _u[n.toLowerCase()]??e})}function xn(t,e,n){return t.lastIndex=n,t.test(e)?t.lastIndex:n}function Mu(t,e){let n=t.length,o=S=>{let $=Number.POSITIVE_INFINITY,C=-1;return M=>((M<$||C>=0&&C<M)&&($=M,C=t.indexOf(S,M)),C)},r=o("-->"),a=o("?>"),i=o("]]>"),c=o(">"),s,l=S=>{let $=t.charCodeAt(S);if($!==Hi&&$!==Wi)return S+1;let C=t.indexOf(t[S],S+1);return C<0?n:C+1},u=S=>{for(let $=S;$<n&&!s?.[$];$=l($)){let C=t.charCodeAt($);if(C===ko||C===No&&t.charCodeAt($+1)===ko)return $}s??=new Uint8Array(n);for(let $=S;$<n&&!s[$];$=l($))s[$]=1;return -1},m=-1,h=-1,d=-1,p=-1,f=S=>{let $=S+1;if($<m||$>=h){m=$,h=xn(Su,t,$),d=-1;for(let M=h;M>$;M--){let v=t.charCodeAt(M);if((M===h||v===Hi||v===Wi)&&(p=u(M),p>=0)){d=M;break}}}if(d<=$)return -1;let C=t.charCodeAt(p)===No;return e.open(t.slice($,d),t.slice(d,p),C),p+(C?2:1)},g=-1,b=-1,y=-1,_=S=>{let $=S+2;if($<g||$>=b){g=$,b=xn(wu,t,$);let C=xn(Do,t,b);y=b>$&&t.charCodeAt(C)===ko?C:-1;}return y},w=S=>{if(t.startsWith("<!--",S)){let $=r(S+4);if($>=0)return $+3}if(t.startsWith("<?",S)){let $=a(S+2);if($>=0)return $+2}if(t.startsWith("<![CDATA[",S)){let $=i(S+9);if($>=0)return e.cdata(t.slice(S+9,$)),$+3}if(t.startsWith("<!",S)){let $=c(S+2);if($>=0)return $+1}if(t.charCodeAt(S+1)===No){let $=_(S);return $<0?-1:(e.close(),$+1)}return f(S)},R=0;for(;R<n;)if(t.charCodeAt(R)===xu){let S=w(R);R=S<0?R+1:S;}else {let S=t.indexOf("<",R),$=S<0?n:S;e.text(t.slice(R,$)),R=$;}}function Ru(t){let e={},n=0;for(;n<t.length;){let o=xn(Cu,t,n);if(o===n){n++;continue}let r=xn(Do,t,o);if(t.charCodeAt(r)===$u){let a=xn(Do,t,r+1),i=t[a],c=i==='"'||i==="'"?t.indexOf(i,a+1):-1;if(c>=0){e[t.slice(n,o)]=Vi(t.slice(a+1,c)),n=c+1;continue}}n=o;}return e}function Le(t){let e={name:"#root",attrs:{},children:[],text:""},n=[e],o=()=>n.at(-1);Mu(t,{open(a,i,c){let s=Ru(i),l={name:a,attrs:s,children:[],text:""};o().children.push(l),c||n.push(l);},close(){n.length>1&&n.pop();},text(a){o().text+=Vi(a);},cdata(a){o().text+=a;}});let r=a=>{for(let i of a.children){if(i.name==="svg")return i;let c=r(i);if(c)return c}return null};return r(e)}function pt(t,e){let[n,o,r,a,i,c]=t,[s,l,u,m,h,d]=e;return [n*s+r*l,o*s+a*l,n*u+r*m,o*u+a*m,n*h+r*d+i,o*h+a*d+c]}function Y(t,e,n){return [t[0]*e+t[2]*n+t[4],t[1]*e+t[3]*n+t[5]]}function $n(t){return Math.sqrt(Math.abs(t[0]*t[3]-t[1]*t[2]))}function Ve(t){return t?(t.match(/[+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?/gi)??[]).map(Number):[]}function ne(t){let e=gr;if(!t)return e;for(let[,n,o]of t.matchAll(/(matrix|translate|scale|rotate|skewX|skewY)\s*\(([^)]*)\)/g)){let r=Ve(o),a=gr;switch(n){case "matrix":r.length===6&&(a=r);break;case "translate":a=[1,0,0,1,r[0]??0,r[1]??0];break;case "scale":a=[r[0]??1,0,0,r[1]??r[0]??1,0,0];break;case "rotate":{let i=(r[0]??0)*Math.PI/180,c=Math.cos(i),s=Math.sin(i),[l,u]=[r[1]??0,r[2]??0];a=pt(pt([1,0,0,1,l,u],[c,s,-s,c,0,0]),[1,0,0,1,-l,-u]);break}case "skewX":a=[1,0,Math.tan((r[0]??0)*Math.PI/180),1,0,0];break;case "skewY":a=[1,Math.tan((r[0]??0)*Math.PI/180),0,1,0,0];break;}e=pt(e,a);}return e}function Eu(t,e,n,o,r,a,i,c,s){if(t===c&&e===s)return [];let l=Math.abs(n),u=Math.abs(o);if(l===0||u===0)return [{op:"L",x:c,y:s}];let m=r*Math.PI/180,h=Math.cos(m),d=Math.sin(m),p=(t-c)/2,f=(e-s)/2,g=h*p+d*f,b=-d*p+h*f,y=g*g/(l*l)+b*b/(u*u);y>1&&(l*=Math.sqrt(y),u*=Math.sqrt(y));let _=l*l*u*u-l*l*b*b-u*u*g*g,w=l*l*b*b+u*u*g*g,R=(a===i?-1:1)*Math.sqrt(Math.max(0,_/w)),S=R*l*b/u,$=-R*u*g/l,C=h*S-d*$+(t+c)/2,M=d*S+h*$+(e+s)/2,v=(G,V,q,j)=>Math.atan2(G*j-V*q,G*q+V*j),E=v(1,0,(g-S)/l,(b-$)/u),A=v((g-S)/l,(b-$)/u,(-g-S)/l,(-b-$)/u);!i&&A>0?A-=2*Math.PI:i&&A<0&&(A+=2*Math.PI);let L=Math.max(1,Math.ceil(Math.abs(A)/(Math.PI/2)-1e-9)),k=A/L,T=4/3*Math.tan(k/4),I=(G,V)=>[C+l*h*G-u*d*V,M+l*d*G+u*h*V],W=[];for(let G=0;G<L;G++){let V=E+G*k,q=V+k,[j,et]=I(Math.cos(V)-T*Math.sin(V),Math.sin(V)+T*Math.cos(V)),[ht,F]=I(Math.cos(q)+T*Math.sin(q),Math.sin(q)-T*Math.cos(q)),[Q,$t]=G===L-1?[c,s]:I(Math.cos(q),Math.sin(q));W.push({op:"C",x1:j,y1:et,x2:ht,y2:F,x:Q,y:$t});}return W}function de(t){let e=[],n=0,o=0,r=0,a=0,i=0,c="",s=null,l=null,u=()=>{for(;n<t.length&&/[\s,]/.test(t[n]);)n++;},m=()=>{u(),Oo.lastIndex=n;let p=Oo.exec(t);return p?(n=Oo.lastIndex,Number(p[0])):null},h=()=>{u();let p=t[n];return p==="0"||p==="1"?(n++,p==="1"):null},d=p=>{let f=[];for(let g=0;g<p;g++){let b=m();if(b===null)return null;f.push(b);}return f};for(;u(),!(n>=t.length);){let p=t[n];if(/[MmLlHhVvCcSsQqTtAaZz]/.test(p))c=p,n++;else if(!c||c==="Z"||c==="z")break;let f=c===c.toLowerCase(),g=f?o:0,b=f?r:0,y=c.toUpperCase();if(y==="Z"){e.push({op:"Z"}),o=a,r=i,s=null,l=null;continue}if(y==="A"){let S=d(3),$=h(),C=h(),M=d(2);if(!(S&&M)||$===null||C===null)break;let[v,E,A]=S,L=M[0]+g,k=M[1]+b;e.push(...Eu(o,r,v,E,A,$,C,L,k)),o=L,r=k,s=null,l=null;continue}let _={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2}[y]??0,w=d(_);if(!w)break;let R=w;switch(y){case "M":o=R[0]+g,r=R[1]+b,a=o,i=r,e.push({op:"M",x:o,y:r}),c=f?"l":"L",s=null,l=null;break;case "L":case "H":case "V":y!=="V"&&(o=R[0]+g),y==="V"?r=R[0]+b:y==="L"&&(r=R[1]+b),e.push({op:"L",x:o,y:r}),s=null,l=null;break;case "C":case "S":{let S,$;y==="C"?(S=[R[0]+g,R[1]+b],$=R.slice(2)):(S=s?[2*o-s[0],2*r-s[1]]:[o,r],$=R);let C=[$[0]+g,$[1]+b],M=[$[2]+g,$[3]+b];e.push({op:"C",x1:S[0],y1:S[1],x2:C[0],y2:C[1],x:M[0],y:M[1]}),[o,r]=M,s=C,l=null;break}case "Q":case "T":{let S,$;y==="Q"?(S=[R[0]+g,R[1]+b],$=[R[2]+g,R[3]+b]):(S=l?[2*o-l[0],2*r-l[1]]:[o,r],$=[R[0]+g,R[1]+b]),e.push({op:"C",x1:o+2/3*(S[0]-o),y1:r+2/3*(S[1]-r),x2:$[0]+2/3*(S[0]-$[0]),y2:$[1]+2/3*(S[1]-$[1]),x:$[0],y:$[1]}),[o,r]=$,l=S,s=null;break}}}return e}function re(t,e,n,o){if(n<=0||o<=0)return [];let r=n*br,a=o*br;return [{op:"M",x:t+n,y:e},{op:"C",x1:t+n,y1:e+a,x2:t+r,y2:e+o,x:t,y:e+o},{op:"C",x1:t-r,y1:e+o,x2:t-n,y2:e+a,x:t-n,y:e},{op:"C",x1:t-n,y1:e-a,x2:t-r,y2:e-o,x:t,y:e-o},{op:"C",x1:t+r,y1:e-o,x2:t+n,y2:e-a,x:t+n,y:e},{op:"Z"}]}function oe(t,e,n,o,r=0,a=0){if(n<=0||o<=0)return [];let i=Math.min(Math.max(r,0),n/2),c=Math.min(Math.max(a,0),o/2);if(i===0||c===0)return [{op:"M",x:t,y:e},{op:"L",x:t+n,y:e},{op:"L",x:t+n,y:e+o},{op:"L",x:t,y:e+o},{op:"Z"}];let s=i*br,l=c*br,u=t+n,m=e+o;return [{op:"M",x:t+i,y:e},{op:"L",x:u-i,y:e},{op:"C",x1:u-i+s,y1:e,x2:u,y2:e+c-l,x:u,y:e+c},{op:"L",x:u,y:m-c},{op:"C",x1:u,y1:m-c+l,x2:u-i+s,y2:m,x:u-i,y:m},{op:"L",x:t+i,y:m},{op:"C",x1:t+i-s,y1:m,x2:t,y2:m-c+l,x:t,y:m-c},{op:"L",x:t,y:e+c},{op:"C",x1:t,y1:e+c-l,x2:t+i-s,y2:e,x:t+i,y:e},{op:"Z"}]}var _u,xu,ko,No,$u,Hi,Wi,Do,Su,wu,Cu,gr,Oo,br,he=z(()=>{"use strict";_u={amp:"&",lt:"<",gt:">",quot:'"',apos:"'"};xu=60,ko=62,No=47,$u=61,Hi=34,Wi=39,Do=/\s*/y,Su=/[^\s/>]*/y,wu=/[^\s>]*/y,Cu=/[^\s=]*/y;gr=[1,0,0,1,0,0];Oo=/[+-]?(?:\d+\.?\d*|\.\d+)(?:[eE][+-]?\d+)?/y;br=.5522847498;});function wr(t,e=exports.FRAME_TEXT_MAX_LENGTH){let n=t.slice(0,1e3).normalize("NFC").replace(Pu," ").replace(vu,"").replace(/\s+/g," ").trim();return Array.from(n).slice(0,Math.max(0,e)).join("").trim()}function Au(t){for(let e of t)if((e.codePointAt(0)??0)>255)return false;return true}function es(t){let e=wn(t);return {x0:t.qr.x-e,y0:t.qr.y-e,x1:t.qr.x+t.qr.size+e,y1:t.qr.y+t.qr.size+e}}function wn(t){return t.qr.padding??t.qr.size*exports.FRAME_SPEC_LIMITS.defaultPadding}function Qu(t){switch(t.type){case "rect":return {bounds:{x0:t.x,y0:t.y,x1:t.x+t.width,y1:t.y+t.height},segments:t.hole?18:9};case "circle":return {bounds:{x0:t.cx-t.r,y0:t.cy-t.r,x1:t.cx+t.r,y1:t.cy+t.r},segments:t.hole?10:5};case "ellipse":return {bounds:{x0:t.cx-t.rx,y0:t.cy-t.ry,x1:t.cx+t.rx,y1:t.cy+t.ry},segments:5};case "polygon":{let e=t.points.map(([o])=>o),n=t.points.map(([,o])=>o);return {bounds:{x0:Math.min(...e),y0:Math.min(...n),x1:Math.max(...e),y1:Math.max(...n)},segments:t.points.length}}case "path":{let e=dr(t.d,exports.FRAME_SPEC_LIMITS.maxDecimals);return e?{bounds:We(de(t.d)),segments:qi(e)}:{bounds:null,segments:0}}case "line":{let e=t.width/2,n=Math.hypot(t.x2-t.x1,t.y2-t.y1),o=t.dash?Math.ceil(n/(t.dash[0]+t.dash[1])):1;return {bounds:{x0:Math.min(t.x1,t.x2)-e,y0:Math.min(t.y1,t.y2)-e,x1:Math.max(t.x1,t.x2)+e,y1:Math.max(t.y1,t.y2)+e},segments:o*(t.cap==="round"?4:5)}}default:return {bounds:{x0:t.x,y0:t.y,x1:t.x+t.size,y1:t.y+t.size},segments:exports.FRAME_ICON_MAX_SEGMENTS}}}function zu(t,e){let n=(b,y=[])=>e.addIssue({code:"custom",message:b,path:y}),o=exports.FRAME_SPEC_LIMITS,r=new TextEncoder().encode(JSON.stringify(t)).length;if(r>o.maxBytes){n(`The spec is ${r} bytes; the limit is ${o.maxBytes}`);return}let{width:a,height:i}=t.artboard,c=Math.max(a,i)*.005,s={x0:-c,y0:-c,x1:a+c,y1:i+c},l=b=>b.x0>=s.x0&&b.y0>=s.y0&&b.x1<=s.x1&&b.y1<=s.y1,{qr:u}=t,m=wn(t);m<u.size*o.minPadding-1e-9&&n(`qr.padding must be at least ${o.minPadding*100}% of qr.size`,["qr","padding"]),u.size<Math.min(a,i)*o.minQrShare-1e-9&&n(`qr.size must be at least ${o.minQrShare*100}% of the artboard's shorter side`,["qr","size"]);let h=es(t);(h.x0<-1e-9||h.y0<-1e-9||h.x1>a+1e-9||h.y1>i+1e-9)&&n("The code and its padding must sit inside the artboard",["qr"]),(u.radius??0)>(u.size+2*m)/2&&n("qr.radius is larger than half the plate",["qr","radius"]);let d=0,p=0;t.shapes.forEach((b,y)=>{let _=["shapes",y],{bounds:w,segments:R}=Qu(b);if(!w){n("Path data must use only M L H V C S Q T A Z, plain numbers (up to 3 decimals) and start with M",[..._,"d"]);return}if(l(w)||n("The shape extends outside the artboard",_),b.type==="rect"&&b.hole){let{hole:S}=b;(S.x<b.x||S.y<b.y||S.x+S.width>b.x+b.width+1e-9||S.y+S.height>b.y+b.height+1e-9)&&n("The hole must sit inside its rect",[..._,"hole"]);}b.type==="circle"&&b.hole&&b.hole>=b.r&&n("The hole must be smaller than the circle",[..._,"hole"]),d+=R,typeof b.fill=="object"&&"gradient"in b.fill&&(p+=(b.fill.gradient.steps??32)*R);}),d>o.maxSegments&&n(`The shapes have ${d} segments; the limit is ${o.maxSegments}`,["shapes"]),p>o.maxGradientWork&&n("Gradient fills are too detailed (fewer steps or simpler shapes)",["shapes"]);let f=new Set,g=new Set;t.labels.forEach((b,y)=>{let _=["labels",y];f.has(b.id)&&n(`Label id "${b.id}" is used twice`,[..._,"id"]),f.add(b.id),b.slot!=="fixed"&&(g.has(b.slot)&&n(`Only one label may use the ${b.slot} slot`,[..._,"slot"]),g.add(b.slot));let w=b.maxLength??o.maxTextLength;b.text!==wr(b.text,w)&&n(`Label text must be at most ${w} characters, trimmed, with no control or invisible characters (see sanitizeFrameText)`,[..._,"text"]);let R;if(b.type==="text")R={x0:b.box.x,y0:b.box.y,x1:b.box.x+b.box.width,y1:b.box.y+b.box.height},b.fontSize!==void 0&&b.fontSize>b.box.height*exports.FRAME_SPEC_LABEL_MAX_FONT+1e-9&&n("fontSize may be at most 95% of the label's row height",[..._,"fontSize"]),qu(R,h)&&n("The label overlaps the code or its padding",[..._,"box"]);else {let{cx:S,cy:$,radius:C}=b.curve,M=b.fontSize*exports.FRAME_FONT_SCALE_MAX*.6;R={x0:S-C-M,y0:$-C-M,x1:S+C+M,y1:$+C+M};let v=Math.hypot(Math.max(h.x0-S,0,S-h.x1),Math.max(h.y0-$,0,$-h.y1));Math.hypot(Math.max(Math.abs(h.x0-S),Math.abs(h.x1-S)),Math.max(Math.abs(h.y0-$),Math.abs(h.y1-$)))<=C-M||v>=C+M||n("The curved label crosses the code or its padding",[..._,"curve"]);}l(R)||n("The label extends outside the artboard",_);});}function Uu(t){let e=exports.frameSpecSchema.safeParse(t);return e.success?[]:e.error.issues.map(n=>n.path.length>0?`${n.path.join(".")}: ${n.message}`:n.message)}exports.FRAME_SPEC_KIND=void 0;exports.FRAME_SPEC_VERSION=void 0;exports.CUSTOM_FRAME_STYLE=void 0;exports.FRAME_SPEC_LIMITS=void 0;exports.FRAME_ICONS=void 0;exports.FRAME_SPEC_LABEL_MAX_FONT=void 0;exports.FRAME_ICON_MAX_SEGMENTS=void 0;exports.FRAME_COLOR_TOKENS=void 0;var Pu,vu,qo,_t,Ot,_r,yr,Bo;exports.frameSpecColorSchema=void 0;exports.frameSpecPaintSchema=void 0;var Go,Lu,Iu,Fu,Tu,ku,Nu,Ou;exports.frameSpecShapeSchema=void 0;var Ki,Du,Bu;exports.frameSpecLabelSchema=void 0;var Yi,Gu,qu;exports.frameSpecSchema=void 0;exports.customFrameSchema=void 0;exports.anyFrameSchema=void 0;var Cn=z(()=>{"use strict";To();pr();he();zn();exports.FRAME_SPEC_KIND="qrdx.frame",exports.FRAME_SPEC_VERSION=1,exports.CUSTOM_FRAME_STYLE="custom",exports.FRAME_SPEC_LIMITS={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:exports.FRAME_TEXT_MAX_LENGTH},exports.FRAME_ICONS=["wifi","star","heart","phone","headphones","calendar","user","chat","bag","bell","cup","card","check","info","home","pin","share","download","clock","snowflake","pumpkin","tree","sparkle","gift"],exports.FRAME_SPEC_LABEL_MAX_FONT=.95,exports.FRAME_ICON_MAX_SEGMENTS=200,exports.FRAME_COLOR_TOKENS=["frame","text","accent","background"],Pu=/[\t\n\v\f\r\u0085\u2028\u2029]/g,vu=/[\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;qo=t=>Math.abs(t*1e3-Math.round(t*1e3))<1e-6,_t=zod.z.number().min(-exports.FRAME_SPEC_LIMITS.maxCoordinate).max(exports.FRAME_SPEC_LIMITS.maxCoordinate).refine(qo,{message:`Numbers may have at most ${exports.FRAME_SPEC_LIMITS.maxDecimals} decimals`}),Ot=_t.refine(t=>t>0,{message:"Must be greater than 0"}),_r=_t.refine(t=>t>=0,{message:"Must not be negative"}),yr=zod.z.string().regex(/^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/,"Use a #rgb or #rrggbb color"),Bo=zod.z.union([zod.z.enum(exports.FRAME_COLOR_TOKENS),yr]),exports.frameSpecColorSchema=zod.z.union([Bo,zod.z.object({mix:zod.z.tuple([Bo,Bo]),amount:zod.z.number().min(0).max(1).refine(qo)}).strict()]),exports.frameSpecPaintSchema=zod.z.union([exports.frameSpecColorSchema,zod.z.object({gradient:zod.z.object({from:exports.frameSpecColorSchema,to:exports.frameSpecColorSchema,direction:zod.z.enum(["horizontal","vertical"]).optional(),steps:zod.z.int().min(2).max(exports.FRAME_SPEC_LIMITS.maxGradientSteps).optional()}).strict()}).strict()]),Go={x:_t,y:_t,width:Ot,height:Ot},Lu=zod.z.object({type:zod.z.literal("rect"),...Go,radius:_r.optional(),fill:exports.frameSpecPaintSchema,hole:zod.z.object({...Go,radius:_r.optional()}).strict().optional()}).strict(),Iu=zod.z.object({type:zod.z.literal("circle"),cx:_t,cy:_t,r:Ot,hole:Ot.optional(),fill:exports.frameSpecPaintSchema}).strict(),Fu=zod.z.object({type:zod.z.literal("ellipse"),cx:_t,cy:_t,rx:Ot,ry:Ot,fill:exports.frameSpecPaintSchema}).strict(),Tu=zod.z.object({type:zod.z.literal("polygon"),points:zod.z.array(zod.z.tuple([_t,_t])).min(3).max(exports.FRAME_SPEC_LIMITS.maxPolygonPoints),fill:exports.frameSpecPaintSchema}).strict(),ku=zod.z.object({type:zod.z.literal("path"),d:zod.z.string().min(2).max(exports.FRAME_SPEC_LIMITS.maxPathLength),fill:exports.frameSpecPaintSchema,fillRule:zod.z.enum(["nonzero","evenodd"]).optional()}).strict(),Nu=zod.z.object({type:zod.z.literal("line"),x1:_t,y1:_t,x2:_t,y2:_t,width:Ot,cap:zod.z.enum(["butt","round"]).optional(),dash:zod.z.tuple([Ot,Ot]).optional(),fill:exports.frameSpecPaintSchema}).strict(),Ou=zod.z.object({type:zod.z.literal("icon"),icon:zod.z.enum(exports.FRAME_ICONS),x:_t,y:_t,size:Ot,fill:exports.frameSpecPaintSchema}).strict(),exports.frameSpecShapeSchema=zod.z.discriminatedUnion("type",[Lu,Iu,Fu,Tu,ku,Nu,Ou]),Ki={id:zod.z.string().regex(/^[a-z][a-z0-9-]{0,31}$/),slot:zod.z.enum(["primary","secondary","fixed"]),text:zod.z.string().max(200),maxLength:zod.z.int().min(1).max(exports.FRAME_TEXT_MAX_LENGTH).optional(),color:exports.frameSpecColorSchema,weight:zod.z.enum(["bold","regular"]).optional()},Du=zod.z.object({type:zod.z.literal("text"),...Ki,box:zod.z.object(Go).strict(),align:zod.z.enum(["start","middle","end"]).optional(),fontSize:Ot.optional()}).strict(),Bu=zod.z.object({type:zod.z.literal("curved"),...Ki,curve:zod.z.object({cx:_t,cy:_t,radius:Ot,side:zod.z.enum(["top","bottom"]),spread:zod.z.number().min(20).max(300).refine(qo).optional()}).strict(),fontSize:Ot}).strict(),exports.frameSpecLabelSchema=zod.z.discriminatedUnion("type",[Du,Bu]),Yi=_t.refine(t=>t>=exports.FRAME_SPEC_LIMITS.minArtboard&&t<=exports.FRAME_SPEC_LIMITS.maxArtboard,{message:`Artboard sides must be ${exports.FRAME_SPEC_LIMITS.minArtboard} to ${exports.FRAME_SPEC_LIMITS.maxArtboard} units`}),Gu=zod.z.object({kind:zod.z.literal(exports.FRAME_SPEC_KIND),version:zod.z.literal(exports.FRAME_SPEC_VERSION),artboard:zod.z.object({width:Yi,height:Yi}).strict(),qr:zod.z.object({x:_t,y:_t,size:Ot,padding:_r.optional(),radius:_r.optional()}).strict(),colors:zod.z.object({frame:yr,text:yr.optional(),accent:yr.optional()}).strict(),shapes:zod.z.array(exports.frameSpecShapeSchema).max(exports.FRAME_SPEC_LIMITS.maxShapes),labels:zod.z.array(exports.frameSpecLabelSchema).max(exports.FRAME_SPEC_LIMITS.maxLabels),bleed:zod.z.union([zod.z.literal("none"),exports.frameSpecColorSchema]).optional()}).strict();qu=(t,e)=>Math.min(t.x1,e.x1)-Math.max(t.x0,e.x0)>1e-6&&Math.min(t.y1,e.y1)-Math.max(t.y0,e.y0)>1e-6;exports.frameSpecSchema=Gu.superRefine(zu);exports.customFrameSchema=exports.frameSchema.extend({style:zod.z.literal(exports.CUSTOM_FRAME_STYLE),spec:exports.frameSpecSchema}),exports.anyFrameSchema=zod.z.discriminatedUnion("style",[exports.frameSchema,exports.customFrameSchema]);});function tt(t){if(t.length===0)return "";let[e,...n]=t;return `M${x(e[0])} ${x(e[1])}${n.map(([o,r])=>`L${x(o)} ${x(r)}`).join("")}Z`}function U(t,e,n){return `M${x(t-n)} ${x(e)}A${x(n)} ${x(n)} 0 1 1 ${x(t+n)} ${x(e)}A${x(n)} ${x(n)} 0 1 1 ${x(t-n)} ${x(e)}Z`}function O(t,e,n,o,r=0){let a=Math.min(n,o)/2,[i,c,s,l]=(typeof r=="number"?[r,r,r,r]:r).map(m=>Math.max(0,Math.min(m,a))),u=(m,h,d)=>m>0?`A${x(m)} ${x(m)} 0 0 1 ${x(h)} ${x(d)}`:"";return `M${x(t+i)} ${x(e)}H${x(t+n-c)}${u(c,t+n,e+c)}V${x(e+o-s)}${u(s,t+n-s,e+o)}H${x(t+l)}${u(l,t,e+o-l)}V${x(e+i)}${u(i,t+i,e)}Z`}function Mn(t,e,n,o,r=-90){return Array.from({length:o},(a,i)=>{let c=(r+360/o*i)*Math.PI/180;return [t+n*Math.cos(c),e+n*Math.sin(c)]})}function Rn(t,e,n,o,r=5){return Array.from({length:r*2},(a,i)=>{let c=i%2===0?n:o,s=-Math.PI/2+Math.PI/r*i;return [t+c*Math.cos(s),e+c*Math.sin(s)]})}function Hn(t,e,n,o,r=4,a=64){return Array.from({length:a},(i,c)=>{let s=2*Math.PI*c/a,l=Math.cos(s),u=Math.sin(s);return [t+n*Math.sign(l)*Math.abs(l)**(2/r),e+o*Math.sign(u)*Math.abs(u)**(2/r)]})}function En(t,e,n){let o=n/2,r=(a,i)=>`${x(t+a*o)} ${x(e+i*o)}`;return `M${r(0,-0.52)}C${r(.18,-0.92)} ${r(.98,-0.94)} ${r(1,-0.34)}C${r(1,.12)} ${r(.5,.48)} ${r(0,.92)}C${r(-0.5,.48)} ${r(-1,.12)} ${r(-1,-0.34)}C${r(-0.98,-0.94)} ${r(-0.18,-0.92)} ${r(0,-0.52)}Z`}function rs(t,e,n,o){if(o===0)return t;let r=o*Math.PI/180,a=Math.cos(r),i=Math.sin(r);return t.map(([c,s])=>[e+(c-e)*a-(s-n)*i,n+(c-e)*i+(s-n)*a])}function Cr(t,e,n=0){let o=Math.imul(t+2654435769,2246822507)^Math.imul(e+n,3266489909);return o=Math.imul(o^o>>>15,739982445),o=Math.imul(o^o>>>12,695872825),o^=o>>>15,(o>>>0)/4294967296}function Xe(t){let e=2166136261;for(let n=0;n<t.length;n++)e^=t.charCodeAt(n),e=Math.imul(e,16777619);return (e>>>0).toString(36)}var ae=z(()=>{"use strict";ft();});function Pn(t,e,n,o,r,a){let i=a-r>180?1:0;return `M${Mr(Fe(t,e,o,r))}A${x(o)} ${x(o)} 0 ${i} 1 ${Mr(Fe(t,e,o,a))}L${Mr(Fe(t,e,n,a))}A${x(n)} ${x(n)} 0 ${i} 0 ${Mr(Fe(t,e,n,r))}Z`}function Wn(t,e,n,o){return `M${x(t-n)} ${x(e)}A${x(n)} ${x(o)} 0 1 1 ${x(t+n)} ${x(e)}A${x(n)} ${x(o)} 0 1 1 ${x(t-n)} ${x(e)}Z`}function Hu(t){let e=0;return t.forEach(([n,o],r)=>{let[a,i]=t[(r+1)%t.length];e+=n*i-a*o;}),e/2}function os(t){return tt(Hu(t)<0?[...t].reverse():t)}function Rr(t,e,n,o,r){let a=Math.hypot(n-t,o-e)||1,i=-(o-e)/a*(r/2),c=(n-t)/a*(r/2);return os([[t+i,e+c],[n+i,o+c],[n-i,o-c],[t-i,e-c]])}function Wu(){let t=[];for(let e of [0,60,120]){let[n,o]=Fe(12,12,10.5,e+180),[r,a]=Fe(12,12,10.5,e);t.push(Rr(n,o,r,a,2));}for(let e=0;e<6;e++){let n=e*60,[o,r]=Fe(12,12,6.2,n);for(let a of [-45,45]){let[i,c]=Fe(o,r,3.6,n+a);t.push(Rr(o,r,i,c,1.7));}}return It(...t)}function Uo(t){return Vu[t]()}exports.FRAME_ICON_BOX=void 0;var Fe,Mr,It,fe,Vu,Ho=z(()=>{"use strict";ae();ft();exports.FRAME_ICON_BOX=24,Fe=(t,e,n,o)=>{let r=o*Math.PI/180;return [t+n*Math.cos(r),e+n*Math.sin(r)]},Mr=([t,e])=>`${x(t)} ${x(e)}`;It=(...t)=>({d:t.join(""),fillRule:"nonzero"}),fe=(...t)=>({d:t.join(""),fillRule:"evenodd"});Vu={wifi:()=>It(Pn(12,20,4.6,7.2,-135,-45),Pn(12,20,9.2,11.8,-135,-45),Pn(12,20,13.8,16.4,-135,-45),U(12,20,2.2)),star:()=>It(tt(Rn(12,12.8,11.6,4.8))),heart:()=>It(En(12,12.4,22)),phone:()=>fe(O(6,1.5,12,21,2.6),O(7.8,4.2,8.4,13.4,.6),U(12,19.8,1.1)),headphones:()=>It(Pn(12,13,7.6,9.8,-180,0),O(2,12,5,9.5,2),O(17,12,5,9.5,2)),calendar:()=>fe(O(2.5,4,19,17.5,2.5),O(4.6,9,14.8,10.6,.8),O(7,11.4,2.6,2.6,.4),O(10.7,11.4,2.6,2.6,.4),O(14.4,11.4,2.6,2.6,.4),O(7,15.1,2.6,2.6,.4),O(10.7,15.1,2.6,2.6,.4),O(6.5,1.4,2.4,2.6,[1.2,1.2,0,0]),O(15.1,1.4,2.4,2.6,[1.2,1.2,0,0])),user:()=>It(U(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:()=>fe(O(2,3,20,14,4),tt([[6.5,17],[11.5,17],[5.8,21.8]]),U(7.5,10,1.5),U(12,10,1.5),U(16.5,10,1.5)),bag:()=>It(O(3.5,7.5,17,14.5,2),Pn(12,7.5,3.1,4.8,-180,0)),bell:()=>It("M3.5 17.2A8.5 8.5 0 0 1 20.5 17.2Z",O(1.5,18.2,21,2.6,1.3),O(11.2,6.6,1.6,2.6,0),O(9.8,4.6,4.4,2.4,1.2)),cup:()=>It("M4 6.5H17V13.5A6.5 6.5 0 0 1 4 13.5Z",Pn(17,10.2,1.7,3.6,-90,90),O(2,20.6,17,2,1),O(7,1.6,1.6,3.4,.8),O(11.6,1.6,1.6,3.4,.8)),card:()=>fe(O(1.5,4.5,21,15,2.5),O(1.5,8,21,3,0),O(4.5,13.6,4.6,3.2,.6)),check:()=>fe(U(12,12,10.5),tt([[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:()=>fe(U(12,12,10.5),U(12,7.2,1.6),O(10.6,10,2.8,8,.8)),home:()=>fe(tt([[12,2.5],[22.5,11.5],[19.5,11.5],[19.5,21.5],[4.5,21.5],[4.5,11.5],[1.5,11.5]]),O(10,14.5,4,7,[.6,.6,0,0])),pin:()=>fe("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",U(12,9.5,3)),share:()=>It(Rr(6,12,18,5,1.8),Rr(6,12,18,19,1.8),U(18,5,3.2),U(6,12,3.2),U(18,19,3.2)),download:()=>It(O(10.6,2,2.8,9.5,0),tt([[6,10],[18,10],[12,16.5]]),tt([[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:()=>fe(U(12,12,10.5),U(12,12,8.4),tt([[11,5.4],[13,5.4],[13,11.3],[16.9,13.5],[15.9,15.2],[11,12.5]])),snowflake:Wu,pumpkin:()=>It(Wn(7.8,14.6,5.8,6.9),Wn(16.2,14.6,5.8,6.9),Wn(12,14.6,4.8,7.4),O(10.9,3.4,2.2,4.6,.8),os([[13,4.2],[17.2,3],[16.2,5.4],[13,6]])),tree:()=>It(tt([[12,1.5],[16.8,8.2],[7.2,8.2]]),tt([[12,5.2],[19,13.6],[5,13.6]]),tt([[12,9.4],[21.2,19.2],[2.8,19.2]]),O(10.4,18.6,3.2,3.9,.4)),sparkle:()=>It(tt(Rn(9.5,13.5,9,2.4,4)),tt(Rn(19,5,4,1.1,4))),gift:()=>It(O(3,11.2,7.8,10.6,1),O(13.2,11.2,7.8,10.6,1),O(2,7.4,8.8,3.2,1),O(13.2,7.4,8.8,3.2,1),Wn(8.8,4.8,2.9,1.9),Wn(15.2,4.8,2.9,1.9))};});function as(t,e){let n=t.trim(),o=Number.parseFloat(n);return Number.isNaN(o)?Number.NaN:n.endsWith("%")?o/100*e:o}function mt(t){if(!t)return null;let e=t.trim().toLowerCase();if(e==="transparent")return {r:0,g:0,b:0,a:0};let n=Yu[e];if(n)return {r:n[0],g:n[1],b:n[2],a:1};if(e.startsWith("#")){let r=e.slice(1);return (r.length===3||r.length===4)&&(r=r.split("").map(a=>a+a).join("")),/^[0-9a-f]{6}([0-9a-f]{2})?$/.test(r)?{r:Number.parseInt(r.slice(0,2),16),g:Number.parseInt(r.slice(2,4),16),b:Number.parseInt(r.slice(4,6),16),a:r.length===8?Number.parseInt(r.slice(6,8),16)/255:1}:null}let o=/^rgba?\(([^)]*)\)$/.exec(e);if(o){let[r,a]=o[1].split("/"),i=r.split(/[\s,]+/).filter(Boolean);if(i.length!==(a===void 0&&i.length===4?4:3))return null;let c=a??i[3],[s,l,u]=i.slice(0,3).map(d=>as(d,255)),m=c===void 0?1:as(c,1);if([s,l,u,m].some(d=>Number.isNaN(d)))return null;let h=(d,p)=>Math.min(Math.max(d,0),p);return {r:h(s,255),g:h(l,255),b:h(u,255),a:h(m,1)}}return null}function Te(t,e,n){let o=t/255,r=e/255,a=n/255,i=1-Math.max(o,r,a);return i>=1?[0,0,0,1]:[it((1-o-i)/(1-i)),it((1-r-i)/(1-i)),it((1-a-i)/(1-i)),it(i)]}var Yu,Dt=z(()=>{"use strict";ft();Yu={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 ss(t){return Xu.includes(t)}function cs(t){return t===" "?.3:/[MWmw@%]/.test(t)?.92:/[A-Z0-9#&]/.test(t)?.72:/[il.,:;!'|1]/.test(t)?.32:.6}function An(t){let e=0;for(let n of t)e+=cs(n);return Math.max(e,1)}function Qt(t,e,n){let o=mt(t)??{r:0,g:0,b:0},r=mt(e)??{r:255,g:255,b:255},a=Math.min(1,Math.max(0,n));return `#${Wo(o.r+(r.r-o.r)*a)}${Wo(o.g+(r.g-o.g)*a)}${Wo(o.b+(r.b-o.b)*a)}`}function Er(t,e,n,o,r,a,i,c){let s=[...t],l=r*.08,u=s.map(f=>cs(f)*r),m=u.reduce((f,g)=>f+g,0)+l*Math.max(0,s.length-1),h=a==="top"?o-r*.35:o+r*.35,d=[],p=0;return s.forEach((f,g)=>{let b=u[g],y=(p+b/2)/h;if(p+=b+l,f.trim()==="")return;let _=a==="top"?-Math.PI/2-m/2/h+y:Math.PI/2+m/2/h-y;d.push({text:f,x:e+h*Math.cos(_),y:n+h*Math.sin(_),fontSize:r,maxWidth:r*2,color:i,rotate:_*180/Math.PI+(a==="top"?90:-90),field:c});}),d}function is(t,e,n,o){let r=t<e+o?e+o-t:t>e+n-o?t-(e+n-o):0;return o-Math.sqrt(Math.max(0,o*o-Math.min(r,o)**2))}function cm(t,e,n,o,r,a,i=48){let c=Math.max(n-o,0),s=t-2*o,l=new Set([o,t-o]);for(let g=0;g<=i;g++)l.add(t*g/i);let u=[...l].sort((g,b)=>g-b),m=t*.002,h=5,d=g=>is(g,0,t,n),p=g=>o+is(g,o,s,c),f=[];for(let g=0;g+1<u.length;g++){let b=u[g],y=Math.min(t,u[g+1]+(g+2<u.length?m:0)),_=Qt(r,a,(b+y)/2/t),w=S=>Array.from({length:h},($,C)=>{let M=C/(h-1);return S?y+(b-y)*M:b+(y-b)*M});b>=o-1e-9&&u[g+1]<=t-o+1e-9?f.push(Ft([...w(false).map(S=>[S,d(S)]),...w(true).map(S=>[S,p(S)])],_),Ft([...w(false).map(S=>[S,e-p(S)]),...w(true).map(S=>[S,e-d(S)])],_)):f.push(Ft([...w(false).map(S=>[S,d(S)]),...w(true).map(S=>[S,e-d(S)])],_));}return f}var Xu;exports.GRADIENT_FRAME_DEFAULTS=void 0;var At,Wo,qt,ct,vn,Ft,ke,ls,ju,Zu,Ju,Ku,tm,em,nm,rm,om,am,im,sm,lm,um,us,Pr=z(()=>{"use strict";ae();ft();Dt();Xu=["banner-top-bottom","speech-bubble-top","chat-bubble","circle","polaroid","phone","ticket","badge","envelope","tag","menu-card","sticker","gradient-border","focus"];exports.GRADIENT_FRAME_DEFAULTS={from:"#7c3aed",to:"#db2777"},At="#FFFFFF";Wo=t=>Math.round(Math.min(255,Math.max(0,t))).toString(16).padStart(2,"0");qt=(t,e,n,o,r=0)=>({x:t,y:e,width:n,height:o,radius:r}),ct=(t,e,n,o,r,a)=>({type:"rect",...qt(t,e,n,o,r),fill:a}),vn=(t,e,n)=>({type:"rect",...t,fill:n,hole:e}),Ft=(t,e)=>({type:"polygon",points:t,fill:e}),ke=(t,e,n="nonzero")=>({type:"path",d:t,fill:e,fillRule:n}),ls=(...t)=>t.filter(e=>e!==null),ju=t=>{let{size:e,gap:n,border:o,band:r,color:a,background:i,frame:c,fitLabel:s}=t,l=e+2*(o+n),u=l-2*o,m=e+2*n,h=r+m+r,d=u-2*n,p=c.textColor||At;return {width:l,height:h,qrX:o+n,qrY:r+n,qrSize:e,shapes:[ct(o,r,u,m,0,i),vn(qt(0,0,l,h),qt(o,r,u,m),a)],label:s(t.text,l/2,r/2,r,d,p),extraLabels:ls(s(t.secondaryText,l/2,r+m+r/2,r,d,p,"secondaryText")),squareEdges:!0,color:a}},Zu=t=>{let{size:e,gap:n,border:o,band:r,color:a,background:i,frame:c,fitLabel:s}=t,l=e+2*(o+n),u=l-2*o,m=e*.07,h=Math.max(m-o,0),d=e*.025,p=e*.08,f=r+p+d;return {width:l,height:f+l,qrX:o+n,qrY:f+o+n,qrSize:e,shapes:[ct(0,0,l,r,r/2,a),Ft([[l/2-p,r-p/2],[l/2+p,r-p/2],[l/2,r+p]],a),ct(o,f+o,u,u,h,i),vn(qt(0,f,l,l,m),qt(o,f+o,u,u,h),a)],label:s(t.text,l/2,r/2,r,u-2*n,c.textColor||At),squareEdges:!1,color:a}},Ju=t=>{let{size:e,gap:n,border:o,color:r,background:a,frame:i,fitLabel:c}=t,s=e+2*(o+n),l=s-2*o,u=e*.12,m=e+2*n,h=t.text?e*.2:o,d=o+m+h,p=e*.13,f=d-e*.02;return {width:s,height:d+p,qrX:o+n,qrY:o+n,qrSize:e,shapes:[ct(0,0,s,d,u,r),ke(P`M${s*.13} ${f}L${s*.05} ${d+p}`+P`Q${s*.16} ${d+p*.45} ${s*.32} ${f}Z`,r),ct(o,o,l,m,Math.max(u-o,0),a)],label:c(t.text,s/2,o+m+h/2,h,l-2*n,i.textColor||At),squareEdges:!1,color:r}};Ku=t=>{let{size:e,gap:n,color:o,background:r,frame:a,fontScale:i}=t,c=e*Math.SQRT1_2+n*.9,s=e*.21,l=c+s,u=c+s/2,m=l,h=a.textColor||At,d=u*(140*Math.PI/180),p=y=>Math.min(s*.5*i,d/(An(y)+.08*y.length)),f=t.text?Er(t.text,m,m,u,p(t.text),"top",h,"text"):[],g=t.secondaryText?Er(t.secondaryText,m,m,u,p(t.secondaryText),"bottom",h,"secondaryText"):[],b=s*.07;return {width:2*l,height:2*l,qrX:m-e/2,qrY:m-e/2,qrSize:e,shapes:[ke(U(m,m,c),r),ke(U(m,m,l)+U(m,m,c),o,"evenodd"),ke(U(m-u,m,b)+U(m+u,m,b),h)],label:null,extraLabels:[...f,...g],squareEdges:!1,color:o}},tm=t=>{let{size:e,gap:n,color:o,background:r,frame:a,fitLabel:i}=t,c=e*.07,s=e+2*n,l=e*.3,u=e*.025,m=s+2*c,h=c+s+l,d=e*.015;return {width:m+u,height:h+u,qrX:c+n,qrY:c+n,qrSize:e,shapes:[ct(u,u,m,h,d,Qt(o,At,.72)),ct(0,0,m,h,d,o),ct(c,c,s,s,0,r)],label:i(t.text,m/2,c+s+l/2,l*.8,s-2*n,a.textColor||At),squareEdges:!1,color:o}},em=t=>{let{size:e,gap:n,color:o,background:r,frame:a,fitLabel:i}=t,c=e*.05,s=e*.17,l=e*.15,u=t.text?e*.17:0,m=e+2*n,h=n+e+(t.text?n*.5+u:n),d=m+2*c,p=s+h+l,f=e*.036,g=e*.03;return {width:d,height:p,qrX:c+n,qrY:s+n,qrSize:e,shapes:[ct(0,0,d,p,e*.17,o),ct(c,s,m,h,e*.06,r),ct(d/2-e*.11,s/2-f/2,e*.22,f,f/2,r),ct(d/2-e*.15,s+h+l/2-g/2,e*.3,g,g/2,r)],label:i(t.text,d/2,s+n+e+n*.5+u/2,u,m-2*n,a.textColor||o),squareEdges:!1,color:o}},nm=t=>{let{size:e,gap:n,band:o,color:r,background:a,frame:i,fitLabel:c}=t,s=e*.05,l=e+2*n,u=l+2*s,m=it(s+l+s*1.2),h=m+o,d=it(e*.055),p=e*.04,f=P`M${p} 0H${u-p}A${p} ${p} 0 0 1 ${u} ${p}`+P`V${m-d}A${d} ${d} 0 0 0 ${u} ${m+d}`+P`V${h-p}A${p} ${p} 0 0 1 ${u-p} ${h}`+P`H${p}A${p} ${p} 0 0 1 0 ${h-p}`+P`V${m+d}A${d} ${d} 0 0 0 0 ${m-d}`+P`V${p}A${p} ${p} 0 0 1 ${p} 0Z`,g=[],b=e*.03,y=e*.022,_=e*.012;for(let w=d+y;w+b<=u-d-y/2;w+=b+y)g.push(O(w,m-_/2,b,_));return {width:u,height:h,qrX:s+n,qrY:s+n,qrSize:e,shapes:[ke(f,r),ct(s,s,l,l,e*.02,a),ke(g.join(""),a)],label:c(t.text,u/2,m+o/2,o,l-2*n,i.textColor||At),squareEdges:!1,color:r}},rm=t=>{let{size:e,gap:n,border:o,band:r,color:a,background:i,frame:c,fitLabel:s}=t,l=e*.18,u=e*.05,m=e+2*(o+n),h=e*.06,d=Math.max(h-o,0),p=m+2*l,f=m-o,g=l*.5,b=f+u,y=g+u*2,_=l*.28,w=Qt(a,"#000000",.28),R=Qt(a,"#000000",.5);return {width:p,height:b+r,qrX:l+o+n,qrY:o+n,qrSize:e,shapes:[Ft([[0,b],[y,b],[y,b+r],[0,b+r],[_,b+r/2]],w),Ft([[p,b],[p-_,b+r/2],[p,b+r],[p-y,b+r],[p-y,b]],w),Ft([[g,f+r],[g+u*1.6,f+r+u],[g,f+r+u]],R),Ft([[p-g,f+r],[p-g,f+r+u],[p-g-u*1.6,f+r+u]],R),ct(l+o,o,m-2*o,m-2*o,d,i),vn(qt(l,0,m,m,h),qt(l+o,o,m-2*o,m-2*o,d),a),ct(g,f,p-2*g,r,0,a)],label:s(t.text,p/2,f+r/2,r,p-2*g-2*n,c.textColor||At),squareEdges:!1,color:a}},om=t=>{let{size:e,gap:n,band:o,color:r,background:a,frame:i,fitLabel:c}=t,s=e*.08,l=e+2*n,u=l+2*s,m=e*.05,h=m+n+e+n*.6,d=e*.14,p=h+d+o+e*.02,f=m+e*.32,g=e*.012,b=h+d-m;return {width:u,height:p,qrX:s+n,qrY:m+n,qrSize:e,shapes:[ct(0,f,u,p-f,0,Qt(r,At,.45)),Ft([[0,f],[u/2,0],[u,f]],Qt(r,At,.25)),ct(s,m,l,b,0,a),vn(qt(s-g,m-g,l+2*g,b+g),qt(s,m,l,b),r),Ft([[0,h],[u/2,h+d],[u,h],[u,p],[0,p]],r)],label:c(t.text,u/2,h+d+o/2,o,l-2*n,i.textColor||At),squareEdges:!1,color:r}},am=t=>{let{size:e,gap:n,band:o,color:r,background:a,frame:i,fitLabel:c}=t,s=e*.06,l=e+2*n,u=l+2*s,m=e*.24,h=e*.04,d=m*.48,p=e*.14,f=t.text?o:s,g=m+l+f,b=e*.04,y=P`M${p} 0H${u-p}L${u} ${p}`+P`V${g-b}A${b} ${b} 0 0 1 ${u-b} ${g}`+P`H${b}A${b} ${b} 0 0 1 0 ${g-b}V${p}Z`+U(u/2,d,h);return {width:u,height:g,qrX:s+n,qrY:m+n,qrSize:e,shapes:[ke(y,r,"evenodd"),ke(U(u/2,d,h*1.7)+U(u/2,d,h),Qt(r,At,.35),"evenodd"),ct(s,m,l,l,e*.02,a)],label:c(t.text,u/2,m+l+f/2,f,l-2*n,i.textColor||At),squareEdges:!1,color:r}},im=t=>{let{size:e,color:n,background:o,frame:r,fitLabel:a}=t,i=e*.13,c=t.text?e*.26:i,s=t.secondaryText?e*.2:i,l=e+2*i,u=c+e+s,m=e*.03,h=e*.022,d=e*.045,p=e*.008,f=r.textColor||n,g=[ct(0,0,l,u,m,o),vn(qt(0,0,l,u,m),qt(h,h,l-2*h,u-2*h,Math.max(m-h,0)),n),vn(qt(d,d,l-2*d,u-2*d),qt(d+p,d+p,l-2*(d+p),u-2*(d+p)),n)];if(t.text){let b=c-e*.075,y=e*.022;g.push(ct(l*.3,b-p/2,l*.4,p,0,n),Ft([[l/2,b-y],[l/2+y,b],[l/2,b+y],[l/2-y,b]],n));}return {width:l,height:u,qrX:i,qrY:c,qrSize:e,shapes:g,label:a(t.text,l/2,e*.115,e*.17,l-2*i,f),extraLabels:ls(a(t.secondaryText,l/2,c+e+s*.45,s*.8,l-2*i,f,"secondaryText")),squareEdges:!1,color:n}},sm=t=>{let{size:e,gap:n,color:o,background:r,frame:a,fitLabel:i}=t,c=e*.025,s=e*.07,l=e*.03,u=e*.13,m=t.text?e*.17:0,h=n*1.25,d=e+2*h,p=d+2*s,f=d+2*s+m,g=p+2*c,b=f+2*c;return {width:g+l,height:b+l,qrX:c+s+h,qrY:c+s+h,qrSize:e,shapes:[ct(l,l,g,b,u+c,Qt(o,At,.7)),ct(0,0,g,b,u+c,At),ct(c,c,p,f,u,o),ct(c+s,c+s,d,d,e*.04,r)],label:i(t.text,c+p/2,c+s+d+(s+m)/2,s+m,d-2*n,a.textColor||At),squareEdges:!1,color:o}};lm=t=>{let{size:e,gap:n,background:o,frame:r,fitLabel:a}=t,i=r.color||exports.GRADIENT_FRAME_DEFAULTS.from,c=r.secondaryColor||exports.GRADIENT_FRAME_DEFAULTS.to,s=e*.05,l=e+2*(s+n),u=t.text?e*.18:0,m=e+(t.text?n+u:2*n),h=m+2*s,d=e*.1;return {width:l,height:h,qrX:s+n,qrY:s+n,qrSize:e,shapes:[ct(s,s,l-2*s,m,d-s,o),...cm(l,h,d,s,i,c)],label:a(t.text,l/2,s+n+e+u/2,u,l-2*s-2*n,r.textColor||Qt(i,c,.5)),squareEdges:!1,color:i}},um=t=>{let{size:e,gap:n,color:o,background:r,frame:a,fitLabel:i}=t,c=e*.035,s=e*.2,l=e+2*(n+c),u=t.text?e*.2:0,m=l,h=m+u,d=(p,f,g,b)=>[[p,f],[p+g*s,f],[p+g*s,f+b*c],[p+g*c,f+b*c],[p+g*c,f+b*s],[p,f+b*s]];return {width:l,height:h,qrX:c+n,qrY:c+n,qrSize:e,shapes:[ct(0,0,l,h,0,r),Ft(d(0,0,1,1),o),Ft(d(m,0,-1,1),o),Ft(d(m,m,-1,-1),o),Ft(d(0,m,1,-1),o)],label:i(t.text,l/2,m+u*.4,u,l-2*n,a.textColor||o),squareEdges:!1,color:o}},us={"banner-top-bottom":ju,"speech-bubble-top":Zu,"chat-bubble":Ju,circle:Ku,polaroid:tm,phone:em,ticket:nm,badge:rm,envelope:om,tag:am,"menu-card":im,sticker:sm,"gradient-border":lm,focus:um};});function Mt(t,e="#000000"){return t?typeof t=="string"?t:t.type==="solid"?t.color:t.type==="image"?t.underlay||e:(t.type==="linear"||t.type==="radial"||t.type==="angular")&&t.stops[0]?.color||e:e}var pe=z(()=>{"use strict";});function Yo(t){if(t&&typeof t=="object"){let n=ms.get(t);if(n)return n}if(t==null)throw new exports.FrameSpecError(['A "custom" frame needs a spec']);let e=exports.frameSpecSchema.safeParse(t);if(!e.success)throw new exports.FrameSpecError(e.error.issues.map(n=>n.path.length>0?`${n.path.join(".")}: ${n.message}`:n.message));return typeof t=="object"&&ms.set(t,e.data),e.data}function Xo(t){let e=Yo(t);return wn(e)/e.qr.size}function mm(t){let e=Mt(t,yt),n=mt(e);return n&&n.a>=1?e:yt}function dm(t,e,n){let o=t.color||e.colors.frame,r=t.textColor||e.colors.text||o,a=t.secondaryColor||e.colors.accent||o,i=c=>{switch(c){case "frame":return o;case "text":return r;case "accent":return a;case "background":return n;default:return c}};return c=>typeof c=="string"?i(c):Qt(i(c.mix[0]),i(c.mix[1]),c.amount)}function ds(t,e,n=0,o=0){let r=dr(t);return r?Qi(r,e,n,o):""}function hm(t,e,n,o){return `M${x(t-n)} ${x(e)}A${x(n)} ${x(o)} 0 1 1 ${x(t+n)} ${x(e)}A${x(n)} ${x(o)} 0 1 1 ${x(t-n)} ${x(e)}Z`}function fm(t,e){let[n,o,r,a]=[t.x1*e,t.y1*e,t.x2*e,t.y2*e],i=Math.hypot(r-n,a-o),c=t.width*e/2,s=i>0?(r-n)/i:1,l=i>0?(a-o)/i:0,u=-l*c,m=s*c,h=(g,b)=>{let y=[n+s*g,o+l*g],_=[n+s*b,o+l*b];if(t.cap==="round"&&b-g>2*c){let w=[y[0]+s*c,y[1]+l*c],R=[_[0]-s*c,_[1]-l*c];return `M${x(w[0]-u)} ${x(w[1]-m)}L${x(R[0]-u)} ${x(R[1]-m)}A${x(c)} ${x(c)} 0 0 1 ${x(R[0]+u)} ${x(R[1]+m)}L${x(w[0]+u)} ${x(w[1]+m)}A${x(c)} ${x(c)} 0 0 1 ${x(w[0]-u)} ${x(w[1]-m)}Z`}return `M${x(y[0]-u)} ${x(y[1]-m)}L${x(_[0]-u)} ${x(_[1]-m)}L${x(_[0]+u)} ${x(_[1]+m)}L${x(y[0]+u)} ${x(y[1]+m)}Z`};if(!t.dash)return {type:"path",d:h(0,i),fillRule:"nonzero"};let d=t.dash[0]*e,p=d+t.dash[1]*e,f=[];for(let g=0;g+d<=i+1e-6;g+=p)f.push(h(g,g+d));return {type:"path",d:f.join(""),fillRule:"nonzero"}}function pm(t,e){switch(t.type){case "rect":return {type:"rect",x:t.x*e,y:t.y*e,width:t.width*e,height:t.height*e,radius:(t.radius??0)*e,...t.hole&&{hole:{x:t.hole.x*e,y:t.hole.y*e,width:t.hole.width*e,height:t.hole.height*e,radius:(t.hole.radius??0)*e}}};case "circle":return {type:"path",d:U(t.cx*e,t.cy*e,t.r*e)+(t.hole?U(t.cx*e,t.cy*e,t.hole*e):""),fillRule:t.hole?"evenodd":"nonzero"};case "ellipse":return {type:"path",d:hm(t.cx*e,t.cy*e,t.rx*e,t.ry*e),fillRule:"nonzero"};case "polygon":return {type:"polygon",points:t.points.map(([n,o])=>[n*e,o*e])};case "path":return {type:"path",d:ds(t.d,e),fillRule:t.fillRule??"nonzero"};case "line":return fm(t,e);default:{let n=Uo(t.icon);return {type:"path",d:ds(n.d,t.size*e/exports.FRAME_ICON_BOX,t.x*e,t.y*e),fillRule:n.fillRule}}}}function gm(t){if(t.type==="rect"){let{x:e,y:n,width:o,height:r,radius:a,hole:i}=t;return [...oe(e,n,o,r,a,a),...i?oe(i.x,i.y,i.width,i.height,i.radius,i.radius):[]]}return t.type==="polygon"?[...t.points.map(([e,n],o)=>o===0?{op:"M",x:e,y:n}:{op:"L",x:e,y:n}),{op:"Z"}]:de(t.d)}function bm(t,e,n){let o=gm(t),r=hr(o,.2),a=t.type==="rect"?t.hole?"evenodd":"nonzero":t.type==="path"?t.fillRule??"nonzero":"nonzero",i=e.direction==="vertical",c=g=>i?g[1]:g[0],s=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY;for(let g of r)for(let b of g)s=Math.min(s,c(b)),l=Math.max(l,c(b));if(!(l>s))return [];let u=e.steps??32,m=n(e.from),h=n(e.to),d=l-s,p=d*.002,f=[];for(let g=0;g<u;g++){let b=s+d*g/u,y=Math.min(l,s+d*(g+1)/u+(g+1<u?p:0)),_=i?{x0:Number.NEGATIVE_INFINITY,x1:Number.POSITIVE_INFINITY,y0:b,y1:y}:{x0:b,x1:y,y0:Number.NEGATIVE_INFINITY,y1:Number.POSITIVE_INFINITY},w=r.map(R=>fr(R,_)).filter(R=>R.length>2);w.length!==0&&f.push({type:"path",d:Ui(w),fill:Qt(m,h,(g+.5)/u),fillRule:a});}return f}function ym(t,e,n){let o=pm(t,e);return typeof t.fill=="object"&&"gradient"in t.fill?bm(o,t.fill.gradient,n):[{...o,fill:n(t.fill)}]}function _m(t,e){let n=Math.min(t.maxLength??exports.FRAME_SPEC_LIMITS.maxTextLength,exports.FRAME_SPEC_LIMITS.maxTextLength),o=t.slot==="primary"?e.text??t.text:t.slot==="secondary"?e.secondaryText??t.text:t.text;return wr(o,n)}function xm(t){return t===void 0||!Number.isFinite(t)?1:Math.min(exports.FRAME_FONT_SCALE_MAX,Math.max(exports.FRAME_FONT_SCALE_MIN,t))}function $m(t,e,n,o){let r=_m(t,e);if(!r)return [];let a=xm(e.fontScale),i=o(t.color),c=t.weight==="regular"?{fontWeight:400}:{};if(t.type==="curved"){let{cx:f,cy:g,radius:b,side:y,spread:_=140}=t.curve,w=b*n*(_*Math.PI/180),R=Math.min(t.fontSize*n*a,w/(An(r)+.08*r.length));return Er(r,f*n,g*n,b*n,R,y,i,t.id).map(S=>({...S,...c}))}let s=t.box.x*n,l=t.box.y*n,u=t.box.width*n,m=t.box.height*n,h=(t.fontSize??t.box.height*.52)*n,d=Math.min(h*a,m*exports.FRAME_SPEC_LABEL_MAX_FONT,u/An(r)),p=t.align??"middle";return [{text:r,x:p==="start"?s:p==="end"?s+u:s+u/2,y:l+m/2+d*.35,fontSize:d,maxWidth:u,color:i,...p!=="middle"&&{align:p},...c,field:t.id}]}function jo(t,e,n){let o=Yo(e.spec),r=t/o.qr.size,a=mm(n),i=dm(e,o,a),c=o.shapes.flatMap(d=>ym(d,r,i)),s=wn(o)*r;c.push({type:"rect",x:o.qr.x*r-s,y:o.qr.y*r-s,width:t+2*s,height:t+2*s,radius:(o.qr.radius??0)*r,fill:a});let l=o.labels.flatMap(d=>$m(d,e,r,i)),u=l[0],m=u&&u.rotate===void 0?u:null,h=o.bleed??"none";return {width:o.artboard.width*r,height:o.artboard.height*r,qrX:o.qr.x*r,qrY:o.qr.y*r,qrSize:t,shapes:c,label:m,extraLabels:m?l.slice(1):l,squareEdges:h!=="none",color:i(h==="none"?"frame":h)}}exports.FrameSpecError=void 0;var ms,Zo=z(()=>{"use strict";zn();Cn();vt();Ho();Pr();ae();pe();ft();Dt();To();pr();he();exports.FrameSpecError=class extends Error{issues;constructor(e){super(`Invalid frame spec: ${e.slice(0,5).join("; ")}`),this.name="FrameSpecError",this.issues=e;}},ms=new WeakMap;});function zt(t){return !!(t?.style&&t.style!=="none")}function ta(t){return t.style===exports.CUSTOM_FRAME_STYLE?Xo(t.spec):exports.FRAME_GAP_RATIO}function gs(t){return (t.text??exports.DEFAULT_FRAME_TEXT).trim().slice(0,exports.FRAME_TEXT_MAX_LENGTH)}function bs(t){return (t.secondaryText??"").trim().slice(0,exports.FRAME_TEXT_MAX_LENGTH)}function Cm(t){return t===void 0||!Number.isFinite(t)?1:Math.min(exports.FRAME_FONT_SCALE_MAX,Math.max(exports.FRAME_FONT_SCALE_MIN,t))}function Mm(t,e,n,o,r,a,i,c){if(!t)return null;let s=Math.min(o*.52*i,r/An(t));return {text:t,x:e,y:n+s*.35,fontSize:s,maxWidth:r,color:a,field:c}}function je(t,e,n){if(e.style===exports.CUSTOM_FRAME_STYLE)return jo(t,e,n);let o=e.color||wm,r=Mt(n,yt),a=gs(e),i=t*exports.FRAME_GAP_RATIO,c=t*.04,s=t*.22,l=t+2*(c+i),u=l-2*c,m=u-2*i,h=c+i,d=Cm(e.fontScale),p=(f,g,b,y,_,w,R="text")=>Mm(f,g,b,y,_,w,d,R);if(ss(e.style))return us[e.style]({size:t,frame:e,color:o,background:r,text:a,secondaryText:bs(e),gap:i,border:c,band:s,fontScale:d,fitLabel:p});switch(e.style){case "banner-top":{let f=t+2*i;return {width:l,height:s+f+c,qrX:h,qrY:s+i,qrSize:t,shapes:[Yn(c,s,u,f,0,r),vr(ge(0,0,l,s+f+c,0),ge(c,s,u,f,0),o)],label:p(a,l/2,s/2,s,m,e.textColor||Jo),squareEdges:true,color:o}}case "border":case "rounded-border":{let f=a?t*.18:0,g=t+(a?i+f:2*i),b=g+2*c,y=e.style==="rounded-border"?t*.1:0,_=Math.max(y-c,0);return {width:l,height:b,qrX:h,qrY:c+i,qrSize:t,shapes:[Yn(c,c,u,g,_,r),vr(ge(0,0,l,b,y),ge(c,c,u,g,_),o)],label:p(a,l/2,c+i+t+f/2,f,m,e.textColor||o),squareEdges:y===0,color:o}}case "speech-bubble":{let f=t*.07,g=Math.max(f-c,0),b=t*.025,y=t*.08,_=l+b+y;return {width:l,height:_+s,qrX:h,qrY:c+i,qrSize:t,shapes:[Yn(c,c,u,u,g,r),vr(ge(0,0,l,l,f),ge(c,c,u,u,g),o),{type:"polygon",points:[[l/2-y,_+y/2],[l/2,l+b],[l/2+y,_+y/2]],fill:o},Yn(0,_,l,s,s/2,o)],label:p(a,l/2,_+s/2,s,m,e.textColor||Jo),squareEdges:false,color:o}}default:{let f=t+2*i;return {width:l,height:c+f+s,qrX:h,qrY:c+i,qrSize:t,shapes:[Yn(c,c,u,f,0,r),vr(ge(0,0,l,c+f+s,0),ge(c,c,u,f,0),o)],label:p(a,l/2,c+f+s/2,s,m,e.textColor||Jo),squareEdges:true,color:o}}}}function ge(t,e,n,o,r){return {x:t,y:e,width:n,height:o,radius:r}}function Yn(t,e,n,o,r,a){return {type:"rect",...ge(t,e,n,o,r),fill:a}}function vr(t,e,n){return {type:"rect",...t,fill:n,hole:e}}function be(t,e){if(!zt(e))return {width:t,height:t};let{width:n,height:o}=je(t,e);return {width:n,height:o}}function hs({x:t,y:e,width:n,height:o,radius:r}){let a=nt(Math.min(r,n/2,o/2)),[i,c,s,l]=[nt(t),nt(e),nt(n),nt(o)];return a<=0?P`M${i} ${c}h${s}v${l}h${-s}z`:P`M${i+a} ${c}h${nt(s-2*a)}a${a} ${a} 0 0 1 ${a} ${a}`+P`v${nt(l-2*a)}a${a} ${a} 0 0 1 ${-a} ${a}`+P`h${nt(-(s-2*a))}a${a} ${a} 0 0 1 ${-a} ${-a}`+P`v${nt(-(l-2*a))}a${a} ${a} 0 0 1 ${a} ${-a}z`}function Rm(t,e){return t.type==="rect"&&t.hole?jsxRuntime.jsx("path",{d:hs(t)+hs(t.hole),fill:t.fill,fillRule:"evenodd"},e):t.type==="polygon"?jsxRuntime.jsx("polygon",{fill:t.fill,points:t.points.map(([n,o])=>`${nt(n)},${nt(o)}`).join(" ")},e):t.type==="path"?jsxRuntime.jsx("path",{d:t.d,fill:t.fill,...t.fillRule==="evenodd"&&{fillRule:"evenodd"}},e):jsxRuntime.jsx("rect",{fill:t.fill,height:nt(t.height),width:nt(t.width),x:nt(t.x),y:nt(t.y),...t.radius>0&&{rx:nt(t.radius),ry:nt(t.radius)}},e)}function Ar(t,e){let{size:n,frame:o,bgColor:r,svgProps:a,markLabels:i}=e,c=je(n,o,r),s=ys(c),l=nt(c.width),u=nt(c.height);return jsxRuntime.jsxs("svg",{height:u,viewBox:`0 0 ${l} ${u}`,width:l,xmlns:"http://www.w3.org/2000/svg",...a,children:[jsxRuntime.jsx("g",{"data-qrdx-frame":o.style,children:c.shapes.map((m,h)=>Rm(m,h))}),Sm__default.default.cloneElement(t,{x:nt(c.qrX),y:nt(c.qrY),width:n,height:n}),s.map((m,h)=>jsxRuntime.jsx("text",{"data-max-width":nt(m.maxWidth),fill:m.color,fontFamily:exports.FRAME_FONT_FAMILY,fontSize:nt(m.fontSize),fontWeight:m.fontWeight??700,textAnchor:m.align??"middle",x:nt(m.x),y:nt(m.y),...m.rotate&&{transform:`rotate(${nt(m.rotate)} ${nt(m.x)} ${nt(m.y)})`},...i&&m.field&&{[exports.FRAME_LABEL_ATTRIBUTE]:m.field},children:m.text},h))]})}function ys(t){return [...t.label?[t.label]:[],...t.extraLabels??[]]}exports.FRAME_FONT_FAMILY=void 0;exports.FRAME_GAP_RATIO=void 0;var wm,Jo;exports.FRAME_LABEL_ATTRIBUTE=void 0;var nt,ye=z(()=>{"use strict";zn();Cn();vt();Zo();Pr();pe();ft();exports.FRAME_FONT_FAMILY="system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif",exports.FRAME_GAP_RATIO=.08,wm="#000000",Jo="#FFFFFF",exports.FRAME_LABEL_ATTRIBUTE="data-qrdx-frame-label";nt=t=>it(t,2);});exports.QR_ART_MODES=void 0;exports.qrArtModeSchema=void 0;exports.QR_ART_VARIANTS=void 0;exports.qrArtVariantSchema=void 0;exports.QR_ART_MAX_SAMPLE_SIZE=void 0;var _s;exports.qrArtImageSchema=void 0;exports.qrArtSchema=void 0;var Lr=z(()=>{"use strict";exports.QR_ART_MODES=["logo","halftone"],exports.qrArtModeSchema=zod.z.enum(exports.QR_ART_MODES),exports.QR_ART_VARIANTS={logo:["blend","badge"],halftone:["color","mono"]},exports.qrArtVariantSchema=zod.z.enum([...exports.QR_ART_VARIANTS.logo,...exports.QR_ART_VARIANTS.halftone]),exports.QR_ART_MAX_SAMPLE_SIZE=192,_s=t=>Math.ceil(t/3)*4,exports.qrArtImageSchema=zod.z.object({width:zod.z.number().int().min(1).max(exports.QR_ART_MAX_SAMPLE_SIZE),height:zod.z.number().int().min(1).max(exports.QR_ART_MAX_SAMPLE_SIZE),data:zod.z.string().max(_s(exports.QR_ART_MAX_SAMPLE_SIZE*exports.QR_ART_MAX_SAMPLE_SIZE*4))}).refine(t=>t.data.length===_s(t.width*t.height*4),{message:"Art image data does not match its width and height"}),exports.qrArtSchema=zod.z.object({mode:exports.qrArtModeSchema,image:exports.qrArtImageSchema,intensity:zod.z.number().min(0).max(1).optional(),variant:exports.qrArtVariantSchema.optional(),matchEyes:zod.z.boolean().optional()});});function Ht(t,e="#000000"){return t?typeof t=="string"?{type:"solid",color:t}:t:{type:"solid",color:e}}function In(t){return !t||typeof t=="string"?false:t.type==="linear"||t.type==="radial"||t.type==="angular"}function na(t){return typeof t=="object"&&t!==null&&t.type==="image"}function vm(t,e="#000000"){let n=Ht(t,e);return n.type==="solid"?n.color:n.type==="image"?n.underlay||e:n.stops[0]?.color||e}function As(t="center"){let[e,n]=t.split("-");return t==="center"?"center":n?`${n} ${e}`:e==="top"||e==="bottom"?`center ${e}`:`${e} center`}function Am(t){if(!t)return "#000000";if(typeof t=="string")return t;let e=Ht(t);if(e.type==="solid")return e.color;if(e.type==="image"){let r=e.fit==="tile"?`${25*(e.scale??1)}% auto`:(e.scale??1)===1?e.fit==="contain"?"contain":"cover":`${100*(e.scale??1)}% auto`,a=e.fit==="tile"?"repeat":"no-repeat";return `${`url("${e.src.replace(/"/g,"%22")}")`} ${As(e.position)} / ${r} ${a}, ${e.underlay??"transparent"}`}let o=[...e.stops].sort((r,a)=>r.offset-a.offset).map(r=>`${r.color} ${r.offset}%`).join(", ");return e.type==="linear"?`linear-gradient(${(e.angle??0)+90}deg, ${o})`:e.type==="angular"?`conic-gradient(from ${e.angle??0}deg, ${o})`:`radial-gradient(circle, ${o})`}exports.colorTypeSchema=void 0;exports.solidColorSchema=void 0;exports.gradientStopSchema=void 0;exports.linearGradientSchema=void 0;exports.radialGradientSchema=void 0;exports.angularGradientSchema=void 0;exports.imageFitSchema=void 0;exports.imagePositionSchema=void 0;exports.imagePaintSchema=void 0;exports.colorConfigSchema=void 0;var Fn=z(()=>{"use strict";exports.colorTypeSchema=zod.z.enum(["solid","linear","radial","angular","image"]),exports.solidColorSchema=zod.z.object({type:zod.z.literal("solid"),color:zod.z.string()}),exports.gradientStopSchema=zod.z.object({color:zod.z.string(),offset:zod.z.number().min(0).max(100)}),exports.linearGradientSchema=zod.z.object({type:zod.z.literal("linear"),stops:zod.z.array(exports.gradientStopSchema).min(2),angle:zod.z.number().optional().default(0)}),exports.radialGradientSchema=zod.z.object({type:zod.z.literal("radial"),stops:zod.z.array(exports.gradientStopSchema).min(2)}),exports.angularGradientSchema=zod.z.object({type:zod.z.literal("angular"),stops:zod.z.array(exports.gradientStopSchema).min(2),angle:zod.z.number().optional().default(0)}),exports.imageFitSchema=zod.z.enum(["cover","contain","tile"]),exports.imagePositionSchema=zod.z.enum(["top-left","top","top-right","left","center","right","bottom-left","bottom","bottom-right"]),exports.imagePaintSchema=zod.z.object({type:zod.z.literal("image"),src:zod.z.string().min(1),fit:exports.imageFitSchema.optional().default("cover"),scale:zod.z.number().min(.1).max(4).optional().default(1),position:exports.imagePositionSchema.optional().default("center"),opacity:zod.z.number().min(0).max(1).optional().default(1),underlay:zod.z.string().optional()}),exports.colorConfigSchema=zod.z.union([zod.z.string(),exports.solidColorSchema,exports.linearGradientSchema,exports.radialGradientSchema,exports.angularGradientSchema,exports.imagePaintSchema]);});exports.CORNER_EYE_DOT_PATTERNS=void 0;exports.RETIRED_CORNER_EYE_DOT_PATTERNS=void 0;exports.cornerEyeDotPatternSchema=void 0;exports.pickableCornerEyeDotPatternSchema=void 0;var aa=z(()=>{"use strict";exports.CORNER_EYE_DOT_PATTERNS=["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"],exports.RETIRED_CORNER_EYE_DOT_PATTERNS=["diamond","star","banner"],exports.cornerEyeDotPatternSchema=zod.z.enum([...exports.CORNER_EYE_DOT_PATTERNS,...exports.RETIRED_CORNER_EYE_DOT_PATTERNS]),exports.pickableCornerEyeDotPatternSchema=zod.z.enum(exports.CORNER_EYE_DOT_PATTERNS);});exports.CORNER_EYE_PATTERNS=void 0;exports.RETIRED_CORNER_EYE_PATTERNS=void 0;exports.cornerEyePatternSchema=void 0;exports.pickableCornerEyePatternSchema=void 0;var ca=z(()=>{"use strict";exports.CORNER_EYE_PATTERNS=["square","rounded","gear","circle","diya","extra-rounded","message","pointy","leaf","drop","octagon","bevel","squircle","cushion","shield","petal","leaf-reverse"],exports.RETIRED_CORNER_EYE_PATTERNS=["curly"],exports.cornerEyePatternSchema=zod.z.enum([...exports.CORNER_EYE_PATTERNS,...exports.RETIRED_CORNER_EYE_PATTERNS]),exports.pickableCornerEyePatternSchema=zod.z.enum(exports.CORNER_EYE_PATTERNS);});exports.BODY_PATTERN=void 0;exports.bodyPatternSchema=void 0;var ua=z(()=>{"use strict";exports.BODY_PATTERN=["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"],exports.bodyPatternSchema=zod.z.enum(exports.BODY_PATTERN);});exports.LOGO_SHAPES=void 0;exports.logoShapeSchema=void 0;exports.imageSettingsSchema=void 0;exports.LOGO_SIZE_MIN=void 0;exports.LOGO_SIZE_MAX=void 0;exports.LOGO_SIZE_DEFAULT=void 0;exports.LOGO_PADDING_MAX=void 0;exports.logoOptionsSchema=void 0;exports.errorLevelSchema=void 0;exports.MODULE_SCALE_MIN=void 0;exports.MODULE_SCALE_MAX=void 0;exports.AUTO_LEVEL_LOGO_COVERAGE=void 0;exports.QR_SHAPES=void 0;exports.qrShapeSchema=void 0;exports.QR_CIRCLE_QUIET_MIN=void 0;exports.QR_SILHOUETTE_MAX_CELLS=void 0;exports.QR_SILHOUETTE_MIN_CELLS=void 0;exports.QR_SILHOUETTE_MIN_SHARE=void 0;exports.qrSilhouetteSchema=void 0;exports.qrCodeShapeSchema=void 0;exports.EYE_POSITIONS=void 0;exports.eyeColorOverrideSchema=void 0;exports.eyeColorsSchema=void 0;exports.qrPropsSchema=void 0;var $e=z(()=>{"use strict";Lr();Fn();aa();ca();Cn();ua();exports.LOGO_SHAPES=["square","rounded","circle"],exports.logoShapeSchema=zod.z.enum(exports.LOGO_SHAPES),exports.imageSettingsSchema=zod.z.object({src:zod.z.string(),height:zod.z.number(),width:zod.z.number(),excavate:zod.z.boolean(),x:zod.z.number().optional(),y:zod.z.number().optional(),padding:zod.z.number().min(0).optional(),shape:exports.logoShapeSchema.optional(),plate:zod.z.string().optional()}),exports.LOGO_SIZE_MIN=.1,exports.LOGO_SIZE_MAX=.3,exports.LOGO_SIZE_DEFAULT=.25,exports.LOGO_PADDING_MAX=2,exports.logoOptionsSchema=zod.z.object({size:zod.z.number().min(exports.LOGO_SIZE_MIN).max(exports.LOGO_SIZE_MAX).optional(),padding:zod.z.number().min(0).max(exports.LOGO_PADDING_MAX).optional(),x:zod.z.number().min(0).max(1).optional(),y:zod.z.number().min(0).max(1).optional(),shape:exports.logoShapeSchema.optional(),plate:zod.z.string().optional()}),exports.errorLevelSchema=zod.z.enum(["L","M","Q","H"]),exports.MODULE_SCALE_MIN=.5,exports.MODULE_SCALE_MAX=1,exports.AUTO_LEVEL_LOGO_COVERAGE=.07,exports.QR_SHAPES=["square","circle","heart"],exports.qrShapeSchema=zod.z.enum(exports.QR_SHAPES),exports.QR_CIRCLE_QUIET_MIN=3,exports.QR_SILHOUETTE_MAX_CELLS=64,exports.QR_SILHOUETTE_MIN_CELLS=8,exports.QR_SILHOUETTE_MIN_SHARE=.42,exports.qrSilhouetteSchema=zod.z.object({type:zod.z.literal("silhouette"),width:zod.z.number().int().min(exports.QR_SILHOUETTE_MIN_CELLS).max(exports.QR_SILHOUETTE_MAX_CELLS),height:zod.z.number().int().min(exports.QR_SILHOUETTE_MIN_CELLS).max(exports.QR_SILHOUETTE_MAX_CELLS),cells:zod.z.string().max(exports.QR_SILHOUETTE_MAX_CELLS*exports.QR_SILHOUETTE_MAX_CELLS).regex(/^[01]*$/).describe('Row by row, "1" inside the shape and "0" outside: width \xD7 height characters')}).refine(t=>t.cells.length===t.width*t.height,{message:"Silhouette cells do not match its width and height"}),exports.qrCodeShapeSchema=zod.z.union([exports.qrShapeSchema,exports.qrSilhouetteSchema]),exports.EYE_POSITIONS=["topLeft","topRight","bottomLeft"],exports.eyeColorOverrideSchema=zod.z.object({outer:exports.colorConfigSchema.optional(),inner:exports.colorConfigSchema.optional()}),exports.eyeColorsSchema=zod.z.object({topLeft:exports.eyeColorOverrideSchema.optional(),topRight:exports.eyeColorOverrideSchema.optional(),bottomLeft:exports.eyeColorOverrideSchema.optional()}),exports.qrPropsSchema=zod.z.object({value:zod.z.string(),size:zod.z.number().optional(),level:exports.errorLevelSchema.optional(),bgColor:exports.colorConfigSchema.optional(),fgColor:exports.colorConfigSchema.optional(),eyeColor:exports.colorConfigSchema.optional(),dotColor:exports.colorConfigSchema.optional(),bodyPattern:exports.bodyPatternSchema.optional(),cornerEyePattern:exports.cornerEyePatternSchema.optional(),cornerEyeDotPattern:exports.cornerEyeDotPatternSchema.optional(),margin:zod.z.number().optional(),imageSettings:exports.imageSettingsSchema.optional(),isOGContext:zod.z.boolean().optional(),templateId:zod.z.string().optional(),customProps:zod.z.record(zod.z.string(),zod.z.any()).optional(),frame:exports.anyFrameSchema.optional(),art:exports.qrArtSchema.optional(),eyeColors:exports.eyeColorsSchema.optional(),moduleScale:zod.z.number().min(exports.MODULE_SCALE_MIN).max(exports.MODULE_SCALE_MAX).optional(),autoLevel:zod.z.boolean().optional(),shape:exports.qrCodeShapeSchema.optional()});});function Ws(t,e,n={}){if(t==="circle")return jsxRuntime.jsx("circle",{cx:x(e.x+e.w/2),cy:x(e.y+e.h/2),r:x(Math.min(e.w,e.h)/2),...n});let o=t==="rounded"?Math.min(e.w,e.h)*exports.LOGO_ROUNDED_RADIUS:0;return jsxRuntime.jsx("rect",{height:x(e.h),width:x(e.w),x:x(e.x),y:x(e.y),...o>0&&{rx:x(o),ry:x(o)},...n})}function Gm(t,e){let n=t.w*e,o=t.h*e;return {x:t.x+n,y:t.y+o,w:t.w-2*n,h:t.h-2*o}}function Gr(t,e){let n=t.shape??"square",o=t.plate,r=o?Gm(e,exports.LOGO_PLATE_INSET):e,a=c=>jsxRuntime.jsx("image",{height:x(r.h),href:t.src,preserveAspectRatio:"none",width:x(r.w),x:x(r.x),y:x(r.y),...c&&{clipPath:`url(#${c})`}});if(n==="square"&&!o)return a();let i=n==="square"?void 0:`qrdx-logo-${Xe(`${n}|${x(r.x)}|${x(r.y)}|${x(r.w)}|${x(r.h)}`)}`;return jsxRuntime.jsxs("g",{children:[o&&Ws(n,e,{fill:o}),i&&jsxRuntime.jsx("clipPath",{id:i,children:Ws(n,r)}),a(i)]})}exports.LOGO_ROUNDED_RADIUS=void 0;exports.LOGO_PLATE_INSET=void 0;var qr=z(()=>{"use strict";ae();ft();exports.LOGO_ROUNDED_RADIUS=.22,exports.LOGO_PLATE_INSET=.14;});function zm(t){let e=t*4+17,n=new Uint8Array(e*e),o=(i,c)=>{i>=0&&c>=0&&i<e&&c<e&&(n[c*e+i]=1);};for(let i=0;i<e;i++)o(6,i),o(i,6);for(let[i,c]of [[3,3],[e-4,3],[3,e-4]])for(let s=-4;s<=4;s++)for(let l=-4;l<=4;l++)o(i+l,c+s);let r=[];if(t>1){let i=Math.floor(t/7)+2,c=t===32?26:Math.ceil((t*4+4)/(i*2-2))*2;r.push(6);for(let s=e-7;r.length<i;s-=c)r.splice(1,0,s);}let a=r.length-1;for(let[i,c]of r.entries())for(let[s,l]of r.entries())if(!(i===0&&s===0||i===0&&s===a||i===a&&s===0))for(let u=-2;u<=2;u++)for(let m=-2;m<=2;m++)o(c+m,l+u);for(let i=0;i<=8;i++)o(8,i),o(i,8);for(let i=0;i<8;i++)o(e-1-i,8),o(8,e-1-i);if(t>=7)for(let i=0;i<18;i++){let c=e-11+i%3,s=Math.floor(i/3);o(c,s),o(s,c);}return n}function Um(t,e){let n=t*4+17,o=Lt[e].ordinal,r=ga.NUM_ERROR_CORRECTION_BLOCKS[o]?.[t]??0,a=ga.ECC_CODEWORDS_PER_BLOCK[o]?.[t]??0,i=Math.floor(ga.getNumRawDataModules(t)/8),c=r-i%r,s=Math.floor(i/r),l=Array.from({length:r},(w,R)=>s+(R<c?0:1)),u=[],m=[],h=s-a;for(let w=0;w<=s;w++)for(let R=0;R<r;R++)if(R<c){if(w===h)continue;u.push(R),m.push(w<h?w:w-1);}else u.push(R),m.push(w);if(u.length!==i)throw new Error(`Codeword map: interleave mismatch at version ${t}`);let d=zm(t),p=new Int16Array(n*n).fill(-1),f=new Int16Array(n*n).fill(-1),g=new Int8Array(n*n).fill(-1),b=i*8,y=0;for(let w=n-1;w>=1;w-=2){w===6&&(w=5);let R=(w+1&2)===0;for(let S=0;S<n;S++)for(let $=0;$<2;$++){let C=w-$,v=(R?n-1-S:S)*n+C;if(!d[v]&&y<b){let E=y>>>3;p[v]=u[E],f[v]=m[E],g[v]=7-(y&7),y++;}}}if(y!==b)throw new Error(`Codeword map: placement mismatch at version ${t}`);let _=Qm[`${t}${e}`]??0;return {version:t,level:e,size:n,blocks:r,eccPerBlock:a,blockLengths:l,correctable:Math.floor((a-_)/2),block:p,codeword:f,bit:g}}function Kn(t,e){if(!(Number.isInteger(t)&&t>=1&&t<=40))throw new RangeError(`QR version must be 1\u201340, got ${t}`);let n=`${t}${e}`,o=Ze.get(n);if(o)return Ze.delete(n),Ze.set(n,o),o;let r=Um(t,e);if(Ze.size>=Hm){let a=Ze.keys().next().value;a!==void 0&&Ze.delete(a);}return Ze.set(n,r),r}function tr(t,e){let n=new Array(t.blocks).fill(0),o=new Set;for(let r of e){let a=t.block[r]??-1;if(a<0)continue;let i=a*4096+t.codeword[r];o.has(i)||(o.add(i),n[a]=n[a]+1);}return n}var ga,Qm,Hm,Ze,Qr=z(()=>{"use strict";me();vt();(({QrCode:ga}=wt)),Qm={"1L":3,"1M":2,"1Q":1,"1H":1,"2L":2,"3L":1};Hm=8,Ze=new Map;});function Vs(t){let e=[t.start],n=t.start;for(let o of t.segments){let r=o.at(-1);if(o.length===1)e.push(r);else {let a=Wm[o.length];for(let i=1;i<=a;i++){let c=i/a,s=1-c;if(o.length===2){let[l]=o;e.push([s*s*n[0]+2*s*c*l[0]+c*c*r[0],s*s*n[1]+2*s*c*l[1]+c*c*r[1]]);}else {let[l,u]=o;e.push([s*s*s*n[0]+3*s*s*c*l[0]+3*s*c*c*u[0]+c*c*c*r[0],s*s*s*n[1]+3*s*s*c*l[1]+3*s*c*c*u[1]+c*c*c*r[1]]);}}}n=r;}return e}function Xs(t,e){let n=[];for(let o of t)for(let r=0;r<o.length;r++){let[a,i]=o[r],[c,s]=o[(r+1)%o.length];i<=e!=s<=e&&n.push(a+(e-i)/(s-i)*(c-a));}return n.sort((o,r)=>o-r)}function js(t,e){let n=0;for(let o of t)if(o<e)n++;else break;return n%2===1}function Vm(t,e,n){return js(Xs(t,n),e)}function Zs(t){let e=new Map;return (n,o)=>{let r=e.get(o);return r||(r=Xs(t,o),e.set(o,r)),js(r,n)}}function Ym(t,e,n,o){let r=n[0]-t,a=n[1]-e,i=o[0]-n[0],c=o[1]-n[1],s=u=>Math.max(Math.abs(r+u*i),Math.abs(a+u*c)),l=Math.min(s(0),s(1));for(let[u,m]of [[a-r,i-c],[-(r+a),i+c]])if(m!==0){let h=u/m;h>0&&h<1&&(l=Math.min(l,s(h)));}return l}function Xm(t,e,n){if(!Vm(t,e,n))return 0;let o=Number.POSITIVE_INFINITY;for(let r of t)for(let a=0;a<r.length;a++)o=Math.min(o,Ym(e,n,r[a],r[(a+1)%r.length]));return Number.isFinite(o)?o:0}function jm(t){let e=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,r=Number.NEGATIVE_INFINITY;for(let a of t)for(let[i,c]of a)e=Math.min(e,i),n=Math.min(n,c),o=Math.max(o,i),r=Math.max(r,c);return {x0:e,y0:n,x1:o,y1:r}}function Js(t){let e=t.map(Vs),n=jm(e),o=n.x1-n.x0,r=n.y1-n.y0;if(!(o>0&&r>0))return null;let a=(p,f)=>{let g=Math.max(p-n.x0,n.x1-p,f-n.y0,n.y1-f);return g>0?Xm(e,p,f)/(2*g):0},i={cx:n.x0+o/2,cy:n.y0+r/2,value:0};i.value=a(i.cx,i.cy);let c=32;for(let p=1;p<c;p++)for(let f=1;f<c;f++){let g=n.x0+o*f/c,b=n.y0+r*p/c,y=a(g,b);y>i.value&&(i={cx:g,cy:b,value:y});}let s=o/c,l=r/c;for(let p=0;p<6;p++){let f=i;for(let g=-2;g<=2;g++)for(let b=-2;b<=2;b++){let y=f.cx+s*b/2,_=f.cy+l*g/2,w=a(y,_);w>i.value&&(i={cx:y,cy:_,value:w});}s/=2,l/=2;}if(i.value<=0)return null;let m=.5/Math.max(i.cx-n.x0,n.x1-i.cx,i.cy-n.y0,n.y1-i.cy),h=([p,f])=>[.5+(p-i.cx)*m,.5+(f-i.cy)*m],d=t.map(p=>({start:h(p.start),segments:p.segments.map(f=>f.map(h))}));return {rings:d,polygons:d.map(Vs),half:i.value}}function Ks(t,e){let n=([r,a])=>`${x(r*e)} ${x(a*e)}`,o="";for(let r of t.rings){o+=`M${n(r.start)}`;for(let a of r.segments){let i=a.length===1?"L":a.length===2?"Q":"C";o+=i+a.map(n).join(" ");}o+="Z";}return o}function tc(){return Ys??=Js([Zm]),Ys}function Jm(t){let{width:e,height:n,cells:o}=t;return Number.isInteger(e)&&Number.isInteger(n)&&e>=exports.QR_SILHOUETTE_MIN_CELLS&&n>=exports.QR_SILHOUETTE_MIN_CELLS&&e<=exports.QR_SILHOUETTE_MAX_CELLS&&n<=exports.QR_SILHOUETTE_MAX_CELLS&&typeof o=="string"&&o.length===e*n&&/^[01]*$/.test(o)?(r,a)=>r>=0&&a>=0&&r<e&&a<n&&o[a*e+r]==="1":null}function Km(t,e,n){let o=(s,l)=>t(s-1,l-1),r=new Map,a=(s,l)=>{for(let[u,m]of [[s,l],[l,s]]){let h=r.get(Se(u))??[];h.push(m),r.set(Se(u),h);}};for(let s=0;s<=n;s++)for(let l=0;l<=e;l++){let u=o(l,s),m=o(l+1,s),h=o(l+1,s+1),d=o(l,s+1),p=[l,s-.5],f=[l+.5,s],g=[l,s+.5],b=[l-.5,s];switch((u?8:0)+(m?4:0)+(h?2:0)+(d?1:0)){case 1:case 14:a(b,g);break;case 2:case 13:a(g,f);break;case 3:case 12:a(b,f);break;case 4:case 11:a(p,f);break;case 6:case 9:a(p,g);break;case 7:case 8:a(b,p);break;case 5:a(p,f),a(b,g);break;case 10:a(b,p),a(g,f);break;}}let i=[],c=new Set;for(let[s,l]of r){if(c.has(s)||l.length===0)continue;let[u,m]=s.split(",").map(Number),h=[[u,m]];c.add(s);let d=[u,m],p=l[0];for(;!c.has(Se(p));){c.add(Se(p)),h.push(p);let f=t1(r.get(Se(p))??[],d,c);if(!f)break;d=p,p=f;}h.length>=3&&i.push(e1(h));}return i}function t1(t,e,n){let o=Se(e);return t.find(r=>Se(r)!==o&&!n.has(Se(r)))??t.find(r=>Se(r)!==o)}function e1(t){let e=[];for(let n=0;n<t.length;n++){let o=t[(n-1+t.length)%t.length],r=t[n],a=t[(n+1)%t.length],i=(r[0]-o[0])*(a[1]-r[1])-(r[1]-o[1])*(a[0]-r[0]);Math.abs(i)>1e-9&&e.push(r);}return e.length>=3?e:t}function n1(t){let e=(a,i)=>[(a[0]+i[0])/2,(a[1]+i[1])/2],n=t.length,o=e(t[n-1],t[0]),r=t.map((a,i)=>[a,e(a,t[(i+1)%n])]);return {start:o,segments:r}}function ba(t){let e=`${t.width}x${t.height}:${t.cells}`,n=er.get(e);if(n)return n;let o=Jm(t),r;if(!o)r={outline:null,problem:"invalid"};else if(t.cells.includes("1")){let a=Km(o,t.width,t.height),i=a.length>0?Js(a.map(n1)):null;r=i&&2*i.half>=exports.QR_SILHOUETTE_MIN_SHARE?{outline:i,problem:null}:{outline:null,problem:i?"thin":"empty"};}else r={outline:null,problem:"empty"};return er.size>16&&er.delete(er.keys().next().value),er.set(e,r),r}var Wm,Zm,Ys,Se,er,ec=z(()=>{"use strict";$e();ft();Wm={2:6,3:12};Zm={start:[0,-.58],segments:[[[.2,-.92],[1,-.97],[1,-.3]],[[1,.3],[.62,.6],[0,.92]],[[-.62,.6],[-1,.3],[-1,-.3]],[[-1,-.97],[-.2,-.92],[0,-.58]]]};Se=([t,e])=>`${t},${e}`;er=new Map;});function Je(t){return Math.max(t,exports.QR_CIRCLE_QUIET_MIN)}function zr(t){return t==="heart"?tc():typeof t=="object"&&t?.type==="silhouette"?ba(t).outline:null}function ya(t){return t==="circle"||zr(t)!==null}function i1(t){let{outline:e,problem:n}=ba(t);if(e&&!n)return {ok:true,share:2*e.half};let o=n??"invalid";return {ok:false,reason:o,message:a1[o]}}function Tt(t,e,n){if(n==="circle"){let i=Je(e),c=(t/2+i)*Math.SQRT2+r1;return Math.ceil(c-t/2)}let o=zr(n);if(!o)return e;let r=Je(e),a=(t+2*(r+o1))/(2*o.half);return Math.ceil((a-t)/2-1e-9)}function oc(t){let e=t>>>0;return ()=>{e=e+1831565813>>>0;let n=e;return n=Math.imul(n^n>>>15,n|1),n^=n+Math.imul(n^n>>>7,n|61),((n^n>>>14)>>>0)/4294967296}}function s1(t,e,n){let o=Tt(e,n,"circle"),r=Je(n),a=e+2*o,i=a/2,c=i-nc-.5,s=oc(Number.parseInt(Xe(t),36)||1),l=o-r,u=o+e+r;return Array.from({length:a},(m,h)=>Array.from({length:a},(d,p)=>{let f=s()<rc;return p>=l&&p<u&&h>=l&&h<u?false:f&&Math.hypot(p+.5-i,h+.5-i)<=c}))}function ac(t,e,n,o){if(o==="circle")return s1(t,e,n);let r=zr(o);if(!r)return null;let a=Tt(e,n,o),i=Je(n),c=e+2*a,s=Zs(r.polygons),l=.5+nc,u=(p,f)=>{let g=p+.5,b=f+.5;return s(g/c,b/c)?c1.every(([y,_])=>s((g+y*l)/c,(b+_*l)/c)):false},m=oc(Number.parseInt(Xe(t),36)||1),h=a-i,d=a+e+i;return Array.from({length:c},(p,f)=>Array.from({length:c},(g,b)=>{let y=m()<rc;return b>=h&&b<d&&f>=h&&f<d?false:y&&u(b,f)}))}function _a(t,e){if(t==="circle")return {circle:e/2};let n=zr(t);return n?{path:Ks(n,e)}:null}function l1(t,e){let n=_a(t,e);return n?"circle"in n?U(e/2,e/2,n.circle):n.path:null}var r1,nc,rc,o1,a1,c1,Ke=z(()=>{"use strict";$e();ec();ae();r1=1,nc=.5,rc=.5,o1=.5;a1={invalid:"This silhouette isn't a valid shape grid.",empty:"No shape found: use a picture with a dark or opaque shape on a light or clear background.",thin:"This shape is too thin to hold the code with its quiet zone. Try a rounder, fuller shape."};c1=Array.from({length:8},(t,e)=>{let n=e*Math.PI/4;return [Math.cos(n),Math.sin(n)]});});function xa(t){let{width:e,height:n,data:o}=t,r=[0,e-1,(n-1)*e,n*e-1].map(i=>{let c=i*4;return {color:[kt(o[c]),kt(o[c+1]),kt(o[c+2])],alpha:o[c+3]/255}});if(r.some(i=>i.alpha<.9))return null;let a=r[0].color;return r.every(({color:i})=>nr(i,a)<.006)?a:null}function u1(t){let{width:e,height:n,data:o}=t,r=xa(t),a=new Float32Array(e*n);for(let i=0;i<a.length;i++){let c=i*4,s=o[c+3]/255;if(r&&s>0){let l=Math.sqrt(nr([kt(o[c]),kt(o[c+1]),kt(o[c+2])],r));s*=Math.min(1,Math.max(0,(l-.06)/.1));}a[i]=s;}return a}function h1(t,e){let{width:n,height:o,data:r}=t,a=new Float64Array(4096),i=new Float64Array(4096*3),c=0;for(let d=0;d<e.length;d++){if(e[d]<.9)continue;let p=d*4,f=Math.floor(r[p]/16)*256+Math.floor(r[p+1]/16)*16+Math.floor(r[p+2]/16);a[f]+=1,i[f*3]+=kt(r[p]),i[f*3+1]+=kt(r[p+1]),i[f*3+2]+=kt(r[p+2]),c++;}if(c===0)return {palette:[],error:0};let s=[...a.keys()].filter(d=>a[d]>0).sort((d,p)=>a[p]-a[d]),l=[];for(let d of s){if(a[d]/c<ic/2||l.length>=m1)break;let p=[i[d*3]/a[d],i[d*3+1]/a[d],i[d*3+2]/a[d]];l.every(f=>nr(f,p)>=d1**2)&&l.push(p);}let u=[],m=0;for(let d=0;d<3;d++){u=l.map(()=>({n:0,r:0,g:0,b:0,x:0,y:0})),m=0;for(let p=0;p<e.length;p++){if(e[p]<.9)continue;let f=p*4,g=[kt(r[f]),kt(r[f+1]),kt(r[f+2])],b=0,y=Number.POSITIVE_INFINITY;for(let[w,R]of l.entries()){let S=nr(g,R);S<y&&(y=S,b=w);}let _=u[b];_.n++,_.r+=g[0],_.g+=g[1],_.b+=g[2],_.x+=p%n,_.y+=Math.floor(p/n),m+=Math.sqrt(y);}for(let[p,f]of u.entries())f.n>0&&(l[p]=[f.r/f.n,f.g/f.n,f.b/f.n]);}return {palette:l.map((d,p)=>({color:d,area:u[p].n/c,cx:u[p].n?u[p].x/u[p].n+.5:n/2,cy:u[p].n?u[p].y/u[p].n+.5:o/2})).filter(d=>d.area>=ic).sort((d,p)=>p.area-d.area),error:m/c}}function f1(t,e,n){let o=e+2,r=n+2,a=(m,h)=>m<=0||h<=0||m>e||h>n?0:t[(h-1)*e+(m-1)],i=new Map,c=new Map,s=m=>{let h=c.get(m);if(h)return h;let d=Math.floor(m/2),p=d%o,f=Math.floor(d/o),g=a(p,f),b=m%2===1,y=b?a(p,f+1):a(p+1,f),_=g===y?.5:Math.min(1,Math.max(0,(.5-g)/(y-g))),w=b?[p-.5,f-.5+_]:[p-.5+_,f-.5];return c.set(m,w),w},l=(m,h)=>{i.set(m,h);};for(let m=0;m<r-1;m++)for(let h=0;h<o-1;h++){let d=a(h,m)>=.5,p=a(h+1,m)>=.5,f=a(h+1,m+1)>=.5,g=a(h,m+1)>=.5,b=2*(m*o+h),y=2*((m+1)*o+h),_=2*(m*o+h)+1,w=2*(m*o+h+1)+1;switch((d?8:0)+(p?4:0)+(f?2:0)+(g?1:0)){case 1:l(y,_);break;case 2:l(w,y);break;case 3:l(w,_);break;case 4:l(b,w);break;case 5:{(a(h,m)+a(h+1,m)+a(h+1,m+1)+a(h,m+1))/4>=.5?(l(b,_),l(y,w)):(l(b,w),l(y,_));break}case 6:l(b,y);break;case 7:l(b,_);break;case 8:l(_,b);break;case 9:l(y,b);break;case 10:{(a(h,m)+a(h+1,m)+a(h+1,m+1)+a(h,m+1))/4>=.5?(l(_,y),l(w,b)):(l(_,b),l(w,y));break}case 11:l(w,b);break;case 12:l(_,w);break;case 13:l(y,w);break;case 14:l(_,y);break;}}let u=[];for(let m of i.keys()){if(!i.has(m))continue;let h=[],d=m;for(;d!==void 0&&i.has(d);){h.push(s(d));let p=i.get(d);i.delete(d),d=p;}h.length>=3&&u.push(h);}return u}function p1(t){let e=0;for(let n=0;n<t.length;n++){let o=t[n],r=t[(n+1)%t.length];e+=o[0]*r[1]-r[0]*o[1];}return e/2}function sc(t,e){if(t.length<=2)return t;let n=new Uint8Array(t.length);n[0]=1,n[t.length-1]=1;let o=[[0,t.length-1]];for(;o.length>0;){let[r,a]=o.pop(),i=t[r],c=t[a],s=c[0]-i[0],l=c[1]-i[1],u=Math.hypot(s,l)||1,m=-1,h=e;for(let d=r+1;d<a;d++){let p=t[d],f=Math.abs(l*(p[0]-i[0])-s*(p[1]-i[1]))/u;f>h&&(h=f,m=d);}m>=0&&(n[m]=1,o.push([r,m],[m,a]));}return t.filter((r,a)=>n[a]===1)}function g1(t,e){let n=0,o=-1;for(let[i,c]of t.entries()){let s=(c[0]-t[0][0])**2+(c[1]-t[0][1])**2;s>o&&(o=s,n=i);}let r=sc(t.slice(0,n+1),e),a=sc([...t.slice(n),t[0]],e);return [...r.slice(0,-1),...a.slice(0,-1)]}function b1(t,e){let n=t.length,o=(a,i)=>{let c=Math.hypot(i[0]-a[0],i[1]-a[1])||1,s=Math.min(.5,e/c);return [a[0]+(i[0]-a[0])*s,a[1]+(i[1]-a[1])*s]},r="";for(let a=0;a<n;a++){let i=t[a],c=o(i,t[(a-1+n)%n]),s=o(i,t[(a+1)%n]);r+=a===0?`M${Oe(c[0])} ${Oe(c[1])}`:`L${Oe(c[0])} ${Oe(c[1])}`,r+=`Q${Oe(i[0])} ${Oe(i[1])} ${Oe(s[0])} ${Oe(s[1])}`;}return `${r}Z`}function y1(t,e,n){let o="";for(let r of f1(t,e,n)){if(Math.abs(p1(r))<.8)continue;let a=g1(r,.18);a.length>=3&&(o+=b1(a,.9));}return o}function cc(t){let{width:e,height:n,data:o}=t,r=u1(t),a=0;for(let f of r)a+=f;let{palette:i,error:c}=h1(t,r),s={width:e,height:n,palette:i,alpha:r,coverage:a/(e*n)};if(i.length===0||c>_1)return {...s,layers:[],photographic:i.length>0};let l=i.length,u=Array.from({length:l},()=>new Float32Array(e*n)),m=i.map(f=>f.color);for(let f=0;f<r.length;f++){let g=r[f];if(g<=0)continue;let b=f*4,y=[kt(o[b]),kt(o[b+1]),kt(o[b+2])],_=0,w=-1,R=Number.POSITIVE_INFINITY,S=Number.POSITIVE_INFINITY;for(let E=0;E<l;E++){let A=nr(y,m[E]);A<R?(w=_,S=R,_=E,R=A):A<S&&(w=E,S=A);}if(w<0||R<1e-6){u[_][f]=g;continue}let $=m[_],C=m[w],M=[C[0]-$[0],C[1]-$[1],C[2]-$[2]],v=Math.min(1,Math.max(0,((y[0]-$[0])*M[0]+(y[1]-$[1])*M[1]+(y[2]-$[2])*M[2])/(M[0]**2+M[1]**2+M[2]**2)));u[_][f]=g*(1-v),u[w][f]=g*v;}let h=[],d=new Float32Array(e*n),p=new Array(l);for(let f=l-1;f>=0;f--){let g=u[f];for(let b=0;b<d.length;b++)d[b]+=g[b];p[f]=d.slice();}for(let f=0;f<l;f++){let g=y1(p[f],e,n);g&&h.push({color:m[f],d:g});}return {...s,layers:h,photographic:false}}var kt,nr,J,m1,d1,ic,Oe,_1,$a=z(()=>{"use strict";ft();kt=t=>t/255,nr=(t,e)=>(t[0]-e[0])**2+(t[1]-e[1])**2+(t[2]-e[2])**2,J=t=>.2126*t[0]+.7152*t[1]+.0722*t[2];m1=8,d1=.14,ic=.006;Oe=t=>it(t,2);_1=.075;});function x1(t){let e="";for(let o=0;o<t.length;o+=32768)e+=String.fromCharCode(...t.subarray(o,o+32768));return btoa(e)}function S1(t){return $1.get(t,()=>{let e=atob(t),n=new Uint8Array(e.length);for(let o=0;o<e.length;o++)n[o]=e.charCodeAt(o);return n})}function Ma(t){let{width:e,height:n,data:o}=t;if(!(Number.isInteger(e)&&Number.isInteger(n))||e<1||n<1||e>exports.QR_ART_MAX_SAMPLE_SIZE||n>exports.QR_ART_MAX_SAMPLE_SIZE||typeof o!="string")return null;try{let r=S1(o);return r.length===e*n*4?{width:e,height:n,data:r}:null}catch{return null}}function pc(t,e={}){let{width:n,height:o,data:r}=t;if(!(n>0&&o>0)||r.length<n*o*4)throw new Error("Art image pixels must be width \xD7 height \xD7 4 RGBA bytes");let a=Math.min(n,o),i=e.square?Math.floor((n-a)/2):0,c=e.square?Math.floor((o-a)/2):0,s=e.square?a:n,l=e.square?a:o,u=Math.min(Math.max(Math.round(e.maxSize??exports.QR_ART_SAMPLE_SIZES.halftone),1),exports.QR_ART_MAX_SAMPLE_SIZE),m=Math.min(1,u/Math.max(s,l)),h=Math.max(1,Math.round(s*m)),d=Math.max(1,Math.round(l*m)),p=new Uint8Array(h*d*4);for(let f=0;f<d;f++){let g=Math.floor(f*l/d),b=Math.max(g+1,Math.floor((f+1)*l/d));for(let y=0;y<h;y++){let _=Math.floor(y*s/h),w=Math.max(_+1,Math.floor((y+1)*s/h)),R=0,S=0,$=0,C=0,M=0;for(let E=g;E<b;E++)for(let A=_;A<w;A++){let L=((E+c)*n+A+i)*4,k=r[L+3]/255;R+=r[L]*k,S+=r[L+1]*k,$+=r[L+2]*k,C+=k,M++;}let v=(f*h+y)*4;p[v]=C>0?Math.round(R/C):0,p[v+1]=C>0?Math.round(S/C):0,p[v+2]=C>0?Math.round($/C):0,p[v+3]=Math.round(C/M*255);}}return {width:h,height:d,data:x1(p)}}async function w1(t){if(typeof t!="string"&&!(t instanceof Blob))return t.complete||await new Promise(n=>{t.addEventListener("load",n,{once:true}),t.addEventListener("error",n,{once:true});}),t;let e=typeof t=="string"?t:URL.createObjectURL(t);try{return await new Promise((n,o)=>{let r=new Image;r.crossOrigin="anonymous",r.onload=()=>n(r),r.onerror=()=>o(new Error("Could not load the art image")),r.src=e;})}finally{typeof t!="string"&&setTimeout(()=>URL.revokeObjectURL(e),1e3);}}async function C1(t,e={}){if(typeof document>"u")throw new Error("loadQRArtImage needs a browser; pass decoded pixels to createQRArtImage instead");let n=e.mode??"halftone",o=e.maxSize??exports.QR_ART_SAMPLE_SIZES[n],r=await w1(t),a=r.naturalWidth||r.width||o,i=r.naturalHeight||r.height||o,c=n==="halftone",s=Math.min(1,o*4/(c?Math.min(a,i):Math.max(a,i))),l=Math.max(1,Math.round(a*s)),u=Math.max(1,Math.round(i*s)),m=document.createElement("canvas");m.width=l,m.height=u;let h=m.getContext("2d",{willReadFrequently:true});if(!h)throw new Error("Could not get a canvas context");h.imageSmoothingQuality="high",h.drawImage(r,0,0,l,u);let d;try{d=h.getImageData(0,0,l,u);}catch{throw new Error("Could not read the art image (cross-origin images need CORS); upload it instead")}finally{m.remove();}return pc(d,{maxSize:o,square:c})}function Ra(t){return !!(t&&exports.QR_ART_MODES.includes(t.mode)&&t.image&&Ma(t.image))}function Wr(t){let e=exports.QR_ART_VARIANTS[t.mode];return t.variant&&e.includes(t.variant)?t.variant:e[0]}function M1(t,e){if(t===1)return [];let n=Math.floor(t/7)+2,o=t===32?26:Math.ceil((t*4+4)/(n*2-2))*2,r=[6];for(let a=e-7;r.length<n;a-=o)r.splice(1,0,a);return r}function rr(t,e){let n=M1(t,e),o=n.length-1,r=[];for(let[a,i]of n.entries())for(let[c,s]of n.entries())a===0&&c===0||a===0&&c===o||a===o&&c===0||r.push([i,s]);return r}function gc(t){let e=uc.get(t);if(e)return e;let n=t*4+17,o=new Uint8Array(n*n),r=(a,i,c,s,l)=>{for(let u=Math.max(0,i);u<Math.min(n,i+s);u++)for(let m=Math.max(0,a);m<Math.min(n,a+c);m++)o[u*n+m]=l;};r(6,0,1,n,lc),r(0,6,n,1,lc),r(0,8,9,1,De),r(8,0,1,9,De),r(n-8,8,8,1,De),r(8,n-8,1,8,De),t>=7&&(r(n-11,0,3,6,De),r(0,n-11,6,3,De));for(let[a,i]of rr(t,n))r(a-2,i-2,5,5,Xt);return r(0,0,8,8,Wt),r(n-8,0,8,8,Wt),r(0,n-8,8,8,Wt),uc.set(t,o),o}function E1(t){let e=t*4+17,n=gc(t);return Array.from({length:e},(o,r)=>Array.from({length:e},(a,i)=>n[r*e+i]!==R1))}function P1(t){let e=t[8],n=e?.[0]?1:0,o=e?.[1]?1:0,r=(1-n)*2+o;return ["M","L","H","Q"][r]??"M"}function kn(t,e){let n=mt(t);return !n||n.a===0?e:[n.r/255,n.g/255,n.b/255]}function Be(t,e,n,o){let r=J(t);if(o?r<=n:r>=n)return t;let a=J(e);return Math.abs(r-a)<1e-6?e:en(t,e,Math.min(1,Math.max(0,(r-n)/(r-a))))}function Nt(t,e=1){let n=o=>Math.min(255,Math.round(Math.round(Math.min(Math.max(o,0),1)*255)/e)*e);return `#${Sa(n(t[0]))}${Sa(n(t[1]))}${Sa(n(t[2]))}`}function A1(t){let e=t<0?-1:1,n=Math.abs(t),o=1/(1+.3275911*n),r=1-((((1.061405429*o-1.453152027)*o+1.421413741)*o-.284496736)*o+.254829592)*o*Math.exp(-n*n);return e*r}function Pa(t,e,n,o){let r=o==="cover"?Math.max(n/t,n/e):Math.min(n/t,n/e);return {scale:r,offsetX:(n-t*r)/2,offsetY:(n-e*r)/2}}function yc(t,e){let{width:n,height:o,data:r}=t,a=new Float32Array(n*o*3),i=e??new Float32Array(n*o);for(let c=0;c<n*o;c++)a[c*3]=r[c*4]/255,a[c*3+1]=r[c*4+1]/255,a[c*3+2]=r[c*4+2]/255,e||(i[c]=r[c*4+3]/255);return {width:n,height:o,rgb:a,alpha:i}}function F1(t){let e=yc(t),{rgb:n,alpha:o}=e,r=new Float64Array(256),a=0;for(let m=0;m<o.length;m++){if(o[m]<.5)continue;let h=J([n[m*3],n[m*3+1],n[m*3+2]]);r[Math.min(255,Math.floor(h*256))]+=1,a++;}let i=m=>{let h=0;for(let d=0;d<256;d++)if(h+=r[d],h>=m*a)return d/255;return 1},c=a?i(.01):0,s=a?i(.99):1;s-c<.15&&(c=0,s=1);let l=Math.min(1.6,1/(s-c)),u=(c+s)/2;for(let m=0;m<o.length;m++){let h=[n[m*3],n[m*3+1],n[m*3+2]],d=J(h),p=.5+(d-u)*l;for(let f=0;f<3;f++)n[m*3+f]=Math.min(1,Math.max(0,p+(h[f]-d)*1.12));}return e}function _c(t,e,n,o,r=1){let{width:a,height:i,rgb:c,alpha:s}=t,l=Math.min(Math.max(e-.5,0),a-1),u=Math.min(Math.max(n-.5,0),i-1),m=Math.floor(l),h=Math.floor(u),d=Math.min(m+1,a-1),p=Math.min(h+1,i-1),f=l-m,g=u-h,b=0,y=0,_=0,w=0,R=($,C,M)=>{let v=C*a+$,E=s[v]*M;b+=c[v*3]*E,y+=c[v*3+1]*E,_+=c[v*3+2]*E,w+=E;};if(R(m,h,(1-f)*(1-g)),R(d,h,f*(1-g)),R(m,p,(1-f)*g),R(d,p,f*g),w<=0)return o;let S=w*r;return [o[0]+(b/w-o[0])*S,o[1]+(y/w-o[1])*S,o[2]+(_/w-o[2])*S]}function va(t,e){return k1.get(t.image.data,()=>cc(e))}function xc(t,e,n){return N1.get(t.image.data,()=>yc(e,n.alpha))}function O1(t,e,n){let o=Rt(n*2),r=Rt(n);return `M${Rt(t-n)} ${Rt(e)}a${r} ${r} 0 1 0 ${o} 0a${r} ${r} 0 1 0 ${-o} 0z`}function tn(t,e,n,o,r){let a=Math.min(r,n/2,o/2);if(a<=0)return `M${Rt(t)} ${Rt(e)}h${Rt(n)}v${Rt(o)}h${Rt(-n)}z`;let i=Rt(a);return `M${Rt(t+a)} ${Rt(e)}h${Rt(n-2*a)}a${i} ${i} 0 0 1 ${i} ${i}v${Rt(o-2*a)}a${i} ${i} 0 0 1 ${-i} ${i}h${Rt(-(n-2*a))}a${i} ${i} 0 0 1 ${-i} ${-i}v${Rt(-(o-2*a))}a${i} ${i} 0 0 1 ${i} ${-i}z`}function Sc(t,e,n){let o="";for(let[r,a]of t){let i=(r-2+e)*n,c=(a-2+e)*n;o+=tn(i,c,5*n,5*n,n*.35),o+=tn(i+n,c+n,3*n,3*n,n*.15),o+=tn(i+2*n,c+2*n,n,n,n*.12);}return o}function B1(t,e){let n=kn(t,[0,0,0]),o=kn(e,[1,1,1]),r=J(o)-J(n);return r>=exports.QR_ART_MIN_LUMA_GAP?null:r<=-exports.QR_ART_MIN_LUMA_GAP?"inverted":"low-contrast"}function wc(t,e,n){let o=Math.min(Math.max(t.intensity??exports.DEFAULT_ART_INTENSITY,0),D1[Wr(t)]);return J(n)-J(e)>=exports.QR_ART_MIN_LUMA_GAP?o:0}function G1(t){let{art:e,modules:n,version:o}=t,r=e.image&&Ma(e.image);if(!(r&&exports.QR_ART_MODES.includes(e.mode)))return null;let a=n.length;if(a!==o*4+17)return null;let i=kn(t.fgColor,[0,0,0]),c=kn(t.bgColor,[1,1,1]),s=wc(e,i,c);return s<=0?null:{art:e,image:r,modules:n,size:a,version:o,kinds:gc(o),margin:t.margin,pixelSize:t.pixelSize,t:s,fg:i,bg:c,variant:Wr(e),body:t.body}}function Aa(t){let e=G1(t);if(!e)return null;let n;return e.art.mode==="halftone"?n=e.variant==="mono"?W1(e):H1(e):n=e.variant==="badge"?ed(e):V1(e),jsxRuntime.jsx("g",{"data-qrdx-art":e.art.mode,"data-qrdx-art-variant":e.variant,children:n})}function q1(t,e){return {margin:.42-.17*t+(e===3?.04:0),darkCap:.4+.3*t}}function La(t){let e=t*4+17,n=dc.get(t);if(!n){let a=e*2,i=new Uint8Array(a*a),c=Cc*2;for(let s=0;s<a;s++)for(let l=0;l<a;l++){let u=l<c||l>=a-c,m=s<c||s>=a-c;u&&m&&!(l>=a-c&&s>=a-c)&&(i[s*a+l]=1);}for(let[s,l]of rr(t,e))for(let u=(l-2)*2-1;u<(l+3)*2+1;u++)for(let m=(s-2)*2-1;m<(s+3)*2+1;m++)m>=0&&u>=0&&m<a&&u<a&&(i[u*a+m]=1);dc.set(t,i),n=i;}let o=n,r=e*2;return (a,i)=>{let c=Math.floor(a*2),s=Math.floor(i*2);return c>=0&&s>=0&&c<r&&s<r&&o[s*r+c]===1}}function Mc(t,e,n=false){let{image:o,size:r,kinds:a,fg:i,bg:c}=t,s=T1.get(t.art.image.data,()=>F1(o)),l=Pa(o.width,o.height,r,"cover"),u=r*e,m=new Float32Array(u*u*3).fill(Number.NaN),d=1/(e*l.scale)>1.3?2:1,p=J(c)-.1*(J(c)-J(i)),f=La(t.version);for(let g=0;g<r;g++)for(let b=0;b<r;b++){let y=a[g*r+b],_=y===Wt||y===Xt;if(!(_&&!n))for(let w=0;w<e;w++)for(let R=0;R<e;R++){let S=0,$=0,C=0;for(let T=0;T<d;T++)for(let I=0;I<d;I++){let W=b+(R+(I+.5)/d)/e,G=g+(w+(T+.5)/d)/e,V=_c(s,(W-l.offsetX)/l.scale,(G-l.offsetY)/l.scale,c);S+=V[0],$+=V[1],C+=V[2];}let M=d*d,v=[S/M,$/M,C/M],E=b+(R+.5)/e,A=g+(w+.5)/e,L=Math.min(E,A,r-E,r-A);L<1.5&&(v=en(v,c,.35*(1-L/1.5))),n&&(_||f(E,A))&&(v=Be(v,c,p,false));let k=((g*e+w)*u+b*e+R)*3;m[k]=v[0],m[k+1]=v[1],m[k+2]=v[2];}}return {n:e,count:u,rgb:m}}function Q1(t,e,n){let{size:o,kinds:r,modules:a,fg:i,bg:c,t:s}=t,{n:l,count:u,rgb:m}=e,h=J(i),d=J(c),p=d-h,f=q1(s,l),g=C=>.2126*m[C]+.7152*m[C+1]+.0722*m[C+2],b=new Float32Array(o*o),y=new Float32Array(o*o);for(let C=0;C<o;C++)for(let M=0;M<o;M++){let v=r[C*o+M];if(v===Wt){b[C*o+M]=d;continue}if(v===Xt){b[C*o+M]=a[C]?.[M]?h:d;continue}let E=0,A=0,L=0;for(let k=0;k<l;k++)for(let T=0;T<l;T++){let I=g(((C*l+k)*u+M*l+T)*3);E+=I,n.under[k*l+T]||(A+=I,L++);}b[C*o+M]=E/(l*l),y[C*o+M]=L?A/L:E/(l*l);}let _=o+1,w=new Float64Array(_*_);for(let C=0;C<o;C++)for(let M=0;M<o;M++)w[(C+1)*_+M+1]=b[C*o+M]+w[C*_+M+1]+w[(C+1)*_+M]-w[C*_+M];let R=2,S=(C,M)=>{let v=Math.max(0,C-R),E=Math.max(0,M-R),A=Math.min(o,C+R+1),L=Math.min(o,M+R+1);return (w[L*_+A]-w[E*_+A]-w[L*_+v]+w[E*_+v])/((A-v)*(L-E))},$=n.weight;for(let C=0;C<o;C++)for(let M=0;M<o;M++){let v=r[C*o+M];if(v===Wt||v===Xt)continue;let E=v===De,A=(f.margin+(E?.08:0))*p,L=(f.darkCap-(E?.12:0))*p,k=($*((n.light-n.dark)/2)-A)/(1-$),T=S(M,C),I=y[C*o+M],W=!!a[C]?.[M],G=0,V=c;if(W){let q=Math.min(T+k,h+L);I>q&&(G=(I-q)/Math.max(I-h,1e-6),V=i);}else {let q=Math.max(T-k,d-L);I<q&&(G=(q-I)/Math.max(d-I,1e-6));}if(!(G<=0)){G=Math.min(1,G);for(let q=0;q<l;q++)for(let j=0;j<l;j++){let et=((C*l+q)*u+M*l+j)*3;for(let ht=0;ht<3;ht++)m[et+ht]+=(V[ht]-m[et+ht])*G;}}}}function Rc(t,e,n,o){let{count:r}=e,a=new nn;for(let s=0;s<r;s++){let l=0,u=n(s*r);for(let m=1;m<=r;m++){let h=m<r?n(s*r+m):null;(m===r||h!==u)&&(u&&a.cellRun(u,l,s,m-l),l=m,u=h);}}let i=t.pixelSize/e.n,c=Rt(t.margin*t.pixelSize);return jsxRuntime.jsx("g",{transform:`translate(${c} ${c}) scale(${$c(i)})`,children:a.toElements(o)},o)}function Ia(t,e){let n=rr(t.version,t.size);return n.length===0?[]:[jsxRuntime.jsx("path",{d:Sc(n,t.margin,t.pixelSize),fill:e,fillRule:"evenodd"},"art-alignment")]}function Ec(t){let{image:e,size:n}=t;return Math.floor(Math.min(e.width,e.height)/n)>=4&&n<=45?4:3}function U1(t,e,n){let o=e+1,r=new Float64Array(o*o);for(let i=0;i<e;i++)for(let c=0;c<e;c++)r[(i+1)*o+c+1]=t[i*e+c]+r[i*o+c+1]+r[(i+1)*o+c]-r[i*o+c];let a=new Float32Array(e*e);for(let i=0;i<e;i++)for(let c=0;c<e;c++){let s=Math.max(0,c-n),l=Math.max(0,i-n),u=Math.min(e,c+n+1),m=Math.min(e,i+n+1);a[i*e+c]=(r[m*o+u]-r[l*o+u]-r[m*o+s]+r[l*o+s])/((u-s)*(m-l));}return a}function Pc(t,e,n,o){let{size:r,kinds:a,modules:i,fg:c,bg:s}=t,l=J(c),u=J(s),m=u-l,h=U1(e,r,2),d=new Float32Array(r*r),p=new Float32Array(r*r).fill(Number.NaN);for(let f=0;f<r;f++)for(let g=0;g<r;g++){let b=f*r+g,y=a[b];if(y===Wt||y===Xt)continue;let _=y===De,w=o.base+(_?.08:0),R=(o.margin+(_?.03:0))*m,S=(o.cap-(_?.04:0))*m,$=mc(w),C=mc(_?Math.max(o.max,.94):o.max),M=$*((o.dark+o.light)/2)+(1-$)*h[b],v=n[b],E=!!i[f]?.[g],A=E?o.dark:o.light,L=E?Math.min(M-R,l+S):Math.max(M+R,u-S),T=(E?v<=L:v>=L)?0:(v-L)/(v-A);T>C&&(T=C,p[b]=Math.min(u,Math.max(l,(L-C*A)/(1-C))));let I=E?v<=L-.06:v>=L+.06;o.skip&&I&&!_||(T=Math.max(T,$)),d[b]=T>0?z1(T):0;}return {diameter:d,surround:p}}function H1(t){let{size:e,kinds:n,modules:o,fg:r,bg:a,t:i,margin:c,pixelSize:s}=t,l=Ec(t),u=Mc(t,l,true),m=J(r),h=J(a),d=m+.1*(h-m),p=h-.05*(h-m),{count:f,rgb:g}=u,b=(S,$,C,M)=>(($*l+M)*f+S*l+C)*3,y=new Float32Array(e*e);for(let S=0;S<e;S++)for(let $=0;$<e;$++){let C=n[S*e+$];if(C===Wt||C===Xt){y[S*e+$]=C===Xt&&o[S]?.[$]?m:h;continue}let M=0;for(let v=0;v<l;v++)for(let E=0;E<l;E++){let A=b($,S,E,v);M+=.2126*g[A]+.7152*g[A+1]+.0722*g[A+2];}y[S*e+$]=M/(l*l);}let _=Pc(t,y,y,{base:.6-.28*i,max:.86,dark:d,light:p,margin:.2-.1*i,cap:.4+.14*i,skip:false});for(let S=0;S<e;S++)for(let $=0;$<e;$++){let C=_.surround[S*e+$];if(Number.isNaN(C))continue;let M=y[S*e+$],E=C<M?r:a,A=Math.min(1,Math.abs(M-C)/Math.max(Math.abs(M-J(E)),1e-6));for(let L=0;L<l;L++)for(let k=0;k<l;k++){let T=b($,S,k,L);for(let I=0;I<3;I++)g[T+I]+=(E[I]-g[T+I])*A;}}let w=[Rc(t,u,S=>{let $=S*3;return Number.isNaN(g[$])?null:Nt([g[$],g[$+1],g[$+2]],8)},"art-photo")],R=new nn;for(let S=0;S<e;S++)for(let $=0;$<e;$++){let C=_.diameter[S*e+$];if(!(C>0))continue;let M=0,v=0,E=0;for(let k=0;k<l;k++)for(let T=0;T<l;T++){let I=b($,S,T,k);M+=g[I],v+=g[I+1],E+=g[I+2];}let A=[M/(l*l),v/(l*l),E/(l*l)],L=o[S]?.[$]?Be(A,r,d,true):Be(A,a,p,false);R.circle(Nt(L,10),($+c+.5)*s,(S+c+.5)*s,C/2*s);}return w.push(...R.toElements("art-dot"),...Ia(t,Nt(r))),w}function W1(t){let{size:e,kinds:n,modules:o,fg:r,bg:a}=t,i=Ec(t),c=Mc(t,i),s=J(r),l=J(a),u=i%2===1?1:2,m=(i-u)/2,h=M=>M>=m&&M<m+u,d=[];for(let M=0;M<i;M++)for(let v=0;v<i;v++)d.push(h(v)&&h(M));Q1(t,c,{weight:L1(u/i),dark:s,light:l,under:d});let{count:p,rgb:f}=c,g=new Float32Array(p*p),b=new Int8Array(p*p).fill(-1);for(let M=0;M<p*p;M++){let v=M*3;if(Number.isNaN(f[v])){g[M]=Number.NaN;continue}let E=(.2126*f[v]+.7152*f[v+1]+.0722*f[v+2]-s)/(l-s);g[M]=.5+(I1(0,1,E)-.5)*1.15;}for(let M=0;M<e;M++)for(let v=0;v<e;v++){let E=n[M*e+v];if(!(E===Wt||E===Xt))for(let A=m;A<m+u;A++)for(let L=m;L<m+u;L++)b[(M*i+A)*p+v*i+L]=o[M]?.[v]?0:1;}let y=La(t.version);for(let M=0;M<p;M++)for(let v=0;v<p;v++){let E=M*p+v;b[E]<0&&y((v+.5)/i,(M+.5)/i)&&(b[E]=1);}let _=new Uint8Array(p*p),w=.3,R=0,S=0,$=(M,v,E)=>{if(M<0||M>=p||v>=p)return;let A=v*p+M;if(!Number.isNaN(g[A])){let L=Math.floor(M/i)===Math.floor(R/i)&&Math.floor(v/i)===Math.floor(S/i);g[A]+=L?E:E*w;}};for(let M=0;M<p;M++){let v=M%2===0?1:-1;for(let E=0;E<p;E++){let A=v===1?E:p-1-E,L=M*p+A,k=g[L];if(Number.isNaN(k))continue;let T=b[L]>=0?b[L]:k>=.5?1:0;_[L]=T===0?1:0;let I=Math.min(.75,Math.max(-0.75,k-T));R=A,S=M,$(A+v,M,I*7/16),$(A-v,M+1,I*3/16),$(A,M+1,I*5/16),$(A+v,M+1,I/16);}}let C=Nt(r);return [Rc(t,c,M=>_[M]?C:null,"art-halftone"),...Ia(t,C)]}function hc(t,e){let n=null,o=0;for(let r of t.palette){if(e&&v1(r.color,e)<.02)continue;let a=r.area*(.35+bc(r.color))*(J(r.color)>.86?.05:1);a>o&&(o=a,n=r.color);}return n}function vc(t,e,n,o,r){let a;if(t.photographic){let i=new nn,{width:c,height:s,rgb:l,alpha:u}=e;for(let m=0;m<s;m++){let h=0,d=null;for(let p=0;p<=c;p++){let f=m*c+p,g=p<c&&u[f]>=.5?Nt(o([l[f*3],l[f*3+1],l[f*3+2]]),6):null;(p===c||g!==d)&&(d&&i.cellRun(d,h,m,p-h),h=p,d=g);}}a=i.toElements(`${r}-px`);}else a=t.layers.map((i,c)=>jsxRuntime.jsx("path",{d:i.d,fill:Nt(o(i.color)),fillRule:"evenodd"},`${r}-${c}`));return jsxRuntime.jsx("g",{transform:`translate(${Rt(n.x)} ${Rt(n.y)}) scale(${$c(n.scale)})`,children:a},r)}function V1(t){let{art:e,image:n,size:o,kinds:r,modules:a,fg:i,bg:c,t:s,margin:l,pixelSize:u}=t,m=va(e,n),h=xc(e,n,m),d=Pa(m.width,m.height,o,"contain"),p=Math.min(1,.3+1.4*s),f=I=>en(c,I,p),g=Nt(c),b=Nt(i),y=[vc(m,h,{x:(l+d.offsetX)*u,y:(l+d.offsetY)*u,scale:d.scale*u},f,"art-logo")],_=Cc,w=(I,W)=>tn((I+l)*u,(W+l)*u,(_+.4)*u,(_+.4)*u,1.2*u),R=rr(t.version,o).map(([I,W])=>tn((I-2.5+l)*u,(W-2.5+l)*u,6*u,6*u,u*.8)).join("");y.push(jsxRuntime.jsx("path",{d:w(-0.4,-0.4)+w(o-_,-0.4)+w(-0.4,o-_)+R,fill:g},"art-plates"));let S=La(t.version),$=J(c),C=J(i),M=new Float32Array(o*o),v=new Float32Array(o*o),E=new Array(o*o);for(let I=0;I<o;I++)for(let W=0;W<o;W++){let G=I*o+W,V=r[G];if(V===Wt||V===Xt){M[G]=V===Xt&&a[I]?.[W]?C:$;continue}let q=1,j=0,et=0,ht=0,F=0;for(let Q=0;Q<4;Q++)for(let $t=0;$t<4;$t++){let Et=W+($t+.5)/4,Ue=I+(Q+.5)/4,le=S(Et,Ue)?c:_c(h,(Et-d.offsetX)/d.scale,(Ue-d.offsetY)/d.scale,c,p),Jt=J(le);q=Math.min(q,Jt),j+=Jt,et+=le[0],ht+=le[1],F+=le[2];}M[G]=j/16,v[G]=q,E[G]=[et/16,ht/16,F/16];}let A=C+.08*($-C),L=$-.04*($-C),k=Pc(t,M,M,{base:.74-.26*s,max:.9,dark:A,light:L,margin:.23-.1*s,cap:.4+.1*s,skip:s>=.7}),T=new nn;for(let I=0;I<o;I++)for(let W=0;W<o;W++){let G=I*o+W,V=k.diameter[G],q=!!a[I]?.[W];if(!(V>0)||!q&&v[G]>=$-.02)continue;let j=q?Be(E[G],i,A,true):Be(E[G],c,L,false);T.circle(Nt(j,8),(W+l+.5)*u,(I+l+.5)*u,V/2*u);}return y.push(...T.toElements("art-dot")),y.push(...Ia(t,b)),y}function Ic(t,e,n){let o=e>=1?t:t*e,r=e>=1?t/e:t,a=Math.max(.7,t*.09),i=o+2*a,c=r+2*a;return {logoW:o,logoH:r,plateW:i,plateH:c,radius:Math.min(i,c)*.26,cx:n/2,cy:n/2}}function Tc(t,e,n){return Nc(e+.5,n+.5,t)<Lc}function Z1(t,e){let n=Fc(t),o=Lc+1,r=Math.max(0,Math.floor(t.cx-t.plateW/2-o)),a=Math.min(e-1,Math.ceil(t.cx+t.plateW/2+o)),i=Math.max(0,Math.floor(t.cy-t.plateH/2-o)),c=Math.min(e-1,Math.ceil(t.cy+t.plateH/2+o)),s=[];for(let l=i;l<=c;l++)for(let u=r;u<=a;u++)Tc(n,u,l)&&s.push(l*e+u);return s}function wa(t,e,n){let o=Ic(t,e,n.size),r=J1(n);return tr(n,Z1(o,n.size)).every(a=>a<=r)}function kc(t,e,n){if(wa(n,e,t))return n;let o=0,r=n;if(!wa(o,e,t))return -1;for(;r-o>1/64;){let a=(o+r)/2;wa(a,e,t)?o=a:r=a;}return o}function K1(t,e){let n=`${t.version}${t.level}:${e.toFixed(3)}`,o=Ur.get(n);return o===void 0&&(o=kc(t,e,Ac*t.size),Ur.size>=64&&Ur.clear(),Ur.set(n,o)),o}function td(t,e){let{size:n,t:o,modules:r,version:a}=t,i=P1(r),c=(.18+.15*o)*Y1[i],s=e.width/e.height,l=Math.min(Ac,c)*n,u=Kn(a,i),m=Math.max(0,K1(u,s));if(m<j1)return {wantedBox:l,maxBox:m,box:0,plate:null};let h=kc(u,s,Math.min(l,m));return h<0?{wantedBox:l,maxBox:m,box:0,plate:null}:{wantedBox:l,maxBox:m,box:h,plate:Ic(h,s,n)}}function Nc(t,e,n){let o=Math.abs(t-n.cx)-(n.w/2-n.r),r=Math.abs(e-n.cy)-(n.h/2-n.r);return Math.hypot(Math.max(o,0),Math.max(r,0))+Math.min(Math.max(o,r),0)-n.r}function Oc(t,e){let{fg:n,bg:o,t:r}=t,a=J(n),i=J(o),c=hc(e),s=Math.min(1,r/.6),l=c?Be(c,n,a+.3*(i-a),true):n,u=en(n,l,s),m=c?hc(e,c):null,h=a+.42*(i-a),d=m&&J(m)<=h+.22?en(n,Be(m,n,h,true),s):u;return {body:u,inner:d}}function ed(t){let{art:e,image:n,size:o,kinds:r,modules:a,bg:i,margin:c,pixelSize:s,version:l}=t,u=va(e,n),m=td(t,u).plate,{body:h}=Oc(t,u),d=Nt(h),p=m&&Fc(m),f=a.map(E=>[...E]);for(let E=0;E<o;E++)for(let A=0;A<o;A++){let L=r[E*o+A];(L===Xt||p&&L!==Wt&&Tc(p,A,E))&&(f[E][A]=false);}let g=[],b=t.body?.(f);if(b)g.push(jsxRuntime.jsx("g",{fill:d,children:b},"art-body"));else {let E=new nn;for(let A=0;A<o;A++)for(let L=0;L<o;L++)f[A]?.[L]&&r[A*o+L]!==Wt&&E.circle(d,(L+c+.5)*s,(A+c+.5)*s,.45*s);g.push(...E.toElements("art-body"));}let y=rr(l,o).filter(([E,A])=>!p||Nc(E+.5,A+.5,p)>3.2);if(y.length>0&&g.push(jsxRuntime.jsx("path",{d:Sc(y,c,s),fill:d,fillRule:"evenodd"},"art-alignment")),!m)return g;let _=xc(e,n,u),w=(m.cx-m.plateW/2+c)*s,R=(m.cy-m.plateH/2+c)*s,S=m.plateW*s,$=m.plateH*s,C=m.radius*s,M=.1*s,v=tn(w,R,S,$,C);return g.push(jsxRuntime.jsx("path",{d:v,fill:Nt(i)},"art-plate"),jsxRuntime.jsx("path",{d:v+tn(w+M,R+M,S-2*M,$-2*M,C-M),fill:Nt(en(i,h,.16)),fillRule:"evenodd"},"art-plate-ring"),vc(u,_,{x:(m.cx-m.logoW/2+c)*s,y:(m.cy-m.logoH/2+c)*s,scale:m.logoW/u.width*s},E=>E,"art-logo")),g}function Fa(t){let{art:e}=t;if(e.mode!=="logo"||e.matchEyes===false)return null;let n=e.image&&Ma(e.image);if(!n)return null;let o=kn(t.fgColor,[0,0,0]),r=kn(t.bgColor,[1,1,1]),a=wc(e,o,r);if(a<=0)return null;let i=va(e,n);if(i.palette.length===0)return null;if(Wr(e)==="badge"){let{body:p,inner:f}=Oc({fg:o,bg:r,t:a},i),g={outer:Nt(p),inner:Nt(f)};return {topLeft:g,topRight:g,bottomLeft:g}}let c=J(o),s=J(r),l=Math.min(1,a/.6),u=t.version*4+17,m=Pa(i.width,i.height,u,"contain"),h=.45*Math.max(i.width,i.height),d=(p,f)=>{let g=(p-m.offsetX)/m.scale,b=(f-m.offsetY)/m.scale,y=null,_=0;for(let R of i.palette){if(J(R.color)>.86)continue;let S=(R.cx-g)**2+(R.cy-b)**2,$=R.area*(.35+bc(R.color))*Math.exp(-S/(2*h**2));$>_&&(_=$,y=R.color);}if(!y)return {};let w=Be(y,o,c+.42*(s-c),true);return {inner:Nt(en(o,w,l))}};return {topLeft:d(3.5,3.5),topRight:d(u-3.5,3.5),bottomLeft:d(3.5,u-3.5)}}exports.DEFAULT_ART_INTENSITY=void 0;exports.QR_ART_SAMPLE_SIZES=void 0;var Tn,$1,R1,Wt,Xt,De,lc,uc,en,bc,v1,Sa,Ea,mc,L1,I1,T1,k1,N1,Rt,$c,nn,D1;exports.QR_ART_MIN_LUMA_GAP=void 0;var Cc,dc,z1,Y1,Ac,Lc,X1,j1,Fc,J1,Ur,Ta=z(()=>{"use strict";Lr();$a();Qr();ft();Dt();exports.DEFAULT_ART_INTENSITY=.6,exports.QR_ART_SAMPLE_SIZES={logo:160,halftone:160};Tn=class{entries=new Map;limit;constructor(e){this.limit=e;}get(e,n){let o=this.entries.get(e);if(o!==void 0)return this.entries.delete(e),this.entries.set(e,o),o;let r=n();if(this.entries.size>=this.limit){let a=this.entries.keys().next().value;a!==void 0&&this.entries.delete(a);}return this.entries.set(e,r),r}},$1=new Tn(8);R1=0,Wt=1,Xt=2,De=3,lc=4,uc=new Map;en=(t,e,n)=>[t[0]+(e[0]-t[0])*n,t[1]+(e[1]-t[1])*n,t[2]+(e[2]-t[2])*n];bc=t=>Math.max(...t)-Math.min(...t),v1=(t,e)=>(t[0]-e[0])**2+(t[1]-e[1])**2+(t[2]-e[2])**2,Sa=t=>t.toString(16).padStart(2,"0");Ea=.3,mc=t=>1-Math.exp(-((t/2)**2)/(2*Ea**2)),L1=t=>A1(t/(2*Ea*Math.SQRT2))**2,I1=(t,e,n)=>{let o=Math.min(1,Math.max(0,(n-t)/(e-t)));return o*o*(3-2*o)};T1=new Tn(4),k1=new Tn(6),N1=new Tn(6);Rt=t=>it(t,2),$c=t=>it(t,4),nn=class{groups=new Map;add(e,n){let o=this.groups.get(e);o?o.push(n):this.groups.set(e,[n]);}cellRun(e,n,o,r){this.add(e,`M${n} ${o}h${r}.04v1.04h-${r}.04z`);}circle(e,n,o,r){this.add(e,O1(n,o,r));}toElements(e){return [...this.groups].map(([n,o],r)=>jsxRuntime.jsx("path",{d:o.join(""),fill:n},`${e}-${r}`))}};D1={blend:1,badge:1,color:.9,mono:.7},exports.QR_ART_MIN_LUMA_GAP=.35;Cc=8.5,dc=new Map;z1=t=>2*Ea*Math.sqrt(-2*Math.log(1-Math.min(t,.95)));Y1={L:.5,M:.72,Q:.88,H:1},Ac=.32,Lc=.55,X1=.6,j1=2;Fc=t=>({cx:t.cx,cy:t.cy,w:t.plateW,h:t.plateH,r:t.radius});J1=t=>Math.floor(t.correctable*X1);Ur=new Map;});function Bc(t){return nd.includes(t)}function Vr(t,e){if(t===void 0||!Number.isFinite(t))return 1;let n=e?exports.MODULE_SCALE_FLOOR[e]??1:exports.MODULE_SCALE_MIN;return Math.min(exports.MODULE_SCALE_MAX,Math.max(exports.MODULE_SCALE_MIN,n,t))}function rd(t,e,n){return t<7&&e<7||t>=n-7&&e<7||t<7&&e>=n-7}function od(t,e){if(t===1)return [];let n=Math.floor(t/7)+2,o=t===32?26:Math.ceil((t*4+4)/(n*2-2))*2,r=[6];for(let a=e-7;r.length<n;a-=o)r.splice(1,0,a);return r}function ka(t){let e=(t-17)/4,n=Number.isInteger(e)?od(e,t):[],o=n.length-1,r=[];for(let[a,i]of n.entries())for(let[c,s]of n.entries())a===0&&c===0||a===0&&c===o||a===o&&c===0||r.push([i,s]);return (a,i)=>r.some(([c,s])=>Math.abs(a-c)<=2&&Math.abs(i-s)<=2)}function id(t,e,n,o,r,a){switch(t){case "horizontal-line":{let i=o*.43;return O(e-o/2,n-i,o,2*i)}case "leaf":{let i=o*.5;return O(e-i,n-i,2*i,2*i,[o*.4,o*.05,o*.4,o*.05])}case "plus":{let i=o*.22,c=o*.5;return tt([[e-i,n-c],[e+i,n-c],[e+i,n-i],[e+c,n-i],[e+c,n+i],[e+i,n+i],[e+i,n+c],[e-i,n+c],[e-i,n+i],[e-c,n+i],[e-c,n-i],[e-i,n-i]])}case "hexagon":return tt(Mn(e,n,o*.54,6));case "star":return tt(Rn(e,n+o*.04,o*.62,o*.34));case "heart":return En(e,n+o*.02,o*1.08);case "random-dots":return U(e,n,o*(.38+.15*Cr(r,a)));case "mosaic":{let i=o*(.8+.14*Cr(r,a,1))/2,c=[[e-i,n-i],[e+i,n-i],[e+i,n+i],[e-i,n+i]];return tt(rs(c,e,n,(Cr(r,a,2)-.5)*16))}case "octagon":return tt(Mn(e,n,o*.48/Math.cos(Math.PI/8),8,22.5));default:return U(e,n,o*.45)}}function qc(t,e){let{margin:n,pixelSize:o,pattern:r}=e,a=Vr(e.scale,r),i=t.length,c=e.plain?()=>false:ka(i),s=(f,g)=>!e.plain&&rd(f,g,i),l=(f,g)=>f>=0&&g>=0&&f<i&&g<i&&!!t[g]?.[f]&&!s(f,g),u=f=>(f+.5+n)*o,m=[],h=[],d=ad[r];for(let f=0;f<i;f++)for(let g=0;g<i;g++){if(!l(g,f))continue;let b=u(g),y=u(f);if(c(g,f)){m.push(P`M${b-o/2} ${y-o/2}h${o}v${o}h${-o}z`);continue}if(!d){h.push(id(r,b,y,o*a,g,f));continue}let _=o*d.thickness*a/2,w=d.horizontal&&l(g+1,f),R=d.horizontal&&l(g-1,f),S=d.vertical&&l(g,f-1),$=d.vertical&&l(g,f+1),M=[!(S||R),!(S||w),!($||w),!($||R)].map((v,E)=>v?_*d.radius(E):0);h.push(O(b-_,y-_,2*_,2*_,M)),2*_<o&&(w&&h.push(O(b,y-_,o,2*_)),$&&h.push(O(b-_,y,2*_,o)));}if(d?.fillets&&a===1){let f=o*.3;for(let g=0;g<i;g++)for(let b=0;b<i;b++){if(l(b,g)||s(b,g))continue;let y=u(b)-o/2,_=u(g)-o/2,w=y+o,R=_+o;l(b-1,g)&&l(b,g-1)&&l(b-1,g-1)&&h.push(P`M${y} ${_}h${f}A${f} ${f} 0 0 0 ${y} ${_+f}Z`),l(b+1,g)&&l(b,g-1)&&l(b+1,g-1)&&h.push(P`M${w} ${_}v${f}A${f} ${f} 0 0 0 ${w-f} ${_}Z`),l(b+1,g)&&l(b,g+1)&&l(b+1,g+1)&&h.push(P`M${w} ${R}h${-f}A${f} ${f} 0 0 0 ${w} ${R-f}Z`),l(b-1,g)&&l(b,g+1)&&l(b-1,g+1)&&h.push(P`M${y} ${R}v${-f}A${f} ${f} 0 0 0 ${y+f} ${R}Z`);}}let p=[];return h.length>0&&p.push(jsxRuntime.jsx("path",{d:h.join("")},"modules")),m.length>0&&p.push(jsxRuntime.jsx("path",{d:m.join("")},"alignment")),p}var nd;exports.MODULE_SCALE_FLOOR=void 0;var ad,Na=z(()=>{"use strict";$e();ae();ft();nd=["horizontal-line","liquid","liquid-horizontal","liquid-vertical","classy","classy-rounded","leaf","plus","hexagon","star","heart","random-dots","mosaic","octagon"];exports.MODULE_SCALE_FLOOR={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};ad={liquid:{horizontal:!0,vertical:!0,thickness:1,radius:()=>1,fillets:!0},"liquid-horizontal":{horizontal:!0,vertical:!1,thickness:.86,radius:()=>1,fillets:!1},"liquid-vertical":{horizontal:!1,vertical:!0,thickness:.86,radius:()=>1,fillets:!1},classy:{horizontal:!0,vertical:!0,thickness:1,radius:t=>t===0||t===2?1:0,fillets:!1},"classy-rounded":{horizontal:!0,vertical:!0,thickness:1,radius:t=>t===0||t===2?1:.4,fillets:!1}};});function sd(t){return t==="top-left"?0:t==="top-right"?1:3}function Yr(t,e,n,o="circle",r="top-left"){let a=n*2,i=n,c=a/3;switch(o){case "leaf":case "leaf-reverse":case "drop":case "drop-reverse":{let s=sd(r),l=(s+2)%4,u=1.3*c,m=.7*c,h=p=>{switch(o){case "leaf":return p===s||p===l;case "leaf-reverse":return !(p===s||p===l);case "drop":return p===s;default:return p===l}},d=[0,1,2,3].map(p=>h(p)?m:u);return jsxRuntime.jsx("path",{d:O(t-n,e-n,a,a,d)})}case "extra-rounded":return jsxRuntime.jsx("path",{d:O(t-n,e-n,a,a,1.15*c)});case "plus":{let s=1.15*c,l=n;return jsxRuntime.jsx("path",{d:tt([[t-s,e-l],[t+s,e-l],[t+s,e-s],[t+l,e-s],[t+l,e+s],[t+s,e+s],[t+s,e+l],[t-s,e+l],[t-s,e+s],[t-l,e+s],[t-l,e-s],[t-s,e-s]])})}case "cross-rounded":{let s=1.15*c,l=.5*c;return jsxRuntime.jsx("path",{d:O(t-n,e-s,a,2*s,l)+O(t-s,e-n,2*s,a,l)})}case "hexagon":return jsxRuntime.jsx("path",{d:tt(Mn(t,e,1.72*c,6))});case "octagon":return jsxRuntime.jsx("path",{d:tt(Mn(t,e,n/Math.cos(Math.PI/8),8,22.5))});case "flower":{let s=.6*c,l=.9*c;return jsxRuntime.jsx("path",{d:U(t-s,e-s,l)+U(t+s,e-s,l)+U(t+s,e+s,l)+U(t-s,e+s,l)+U(t,e,1.2*c)})}case "heart":return jsxRuntime.jsx("path",{d:En(t,e+.12*c,3.5*c)});case "squircle":return jsxRuntime.jsx("path",{d:tt(Hn(t,e,n,n,4,64))});case "dots":{let s=[];for(let l of [-1,0,1])for(let u of [-1,0,1])s.push(U(t+u*c*.82,e+l*c*.82,.58*c));return jsxRuntime.jsx("path",{d:s.join("")})}case "square":return jsxRuntime.jsx("rect",{height:x(a),transform:P`rotate(0,${t},${e})`,width:x(a),x:x(t-i),y:x(e-i)});case "rounded":return jsxRuntime.jsx("rect",{height:x(a),rx:x(n*.5),ry:x(n*.5),transform:P`rotate(0,${t},${e})`,width:x(a),x:x(t-i),y:x(e-i)});case "diamond":return jsxRuntime.jsx("path",{d:P`M ${t-i*.714286} ${e-i*.714286}v ${a*.714286}h ${a*.714286}v -${a*.714286}z`,transform:P`rotate(45,${t},${e})`});case "message":{let s=a/30,l=h=>(h-40)*s+t,u=h=>(h-40)*s+e,m=P`M ${l(25)} ${u(35.714285714285715)}v ${8.571428571428571*s}a ${10.714285714285714*s} ${10.714285714285714*s}, 0, 0, 0, ${10.714285714285714*s} ${10.714285714285714*s}h ${19.285714285714285*s}v -${19.285714285714285*s}a ${10.714285714285714*s} ${10.714285714285714*s}, 0, 0, 0, -${10.714285714285714*s} -${10.714285714285714*s}h -${8.571428571428571*s}a ${10.714285714285714*s} ${10.714285714285714*s}, 0, 0, 0, -${10.714285714285714*s} ${10.714285714285714*s}`;return jsxRuntime.jsx("path",{clipRule:"evenodd",d:m,transform:P`rotate(0,${t},${e})`})}case "message-reverse":{let s=a/30,l=h=>(h-40)*s+t,u=h=>(h-40)*s+e,m=P`M ${l(25)} ${u(35.714285714285715)}v ${8.571428571428571*s}a ${10.714285714285714*s} ${10.714285714285714*s}, 0, 0, 0, ${10.714285714285714*s} ${10.714285714285714*s}h ${19.285714285714285*s}v -${19.285714285714285*s}a ${10.714285714285714*s} ${10.714285714285714*s}, 0, 0, 0, -${10.714285714285714*s} -${10.714285714285714*s}h -${8.571428571428571*s}a ${10.714285714285714*s} ${10.714285714285714*s}, 0, 0, 0, -${10.714285714285714*s} ${10.714285714285714*s}`;return jsxRuntime.jsx("path",{clipRule:"evenodd",d:m,transform:P`rotate(-180,${t},${e})`})}case "diya":{let s=a/30,l=h=>(h-40)*s+t,u=h=>(h-40)*s+e,m=P`M ${l(25)} ${u(35.714285714285715)}v ${8.571428571428571*s}a ${10.714285714285714*s} ${10.714285714285714*s}, 0, 0, 0, ${10.714285714285714*s} ${10.714285714285714*s}h ${19.285714285714285*s}v -${19.285714285714285*s}a ${10.714285714285714*s} ${10.714285714285714*s}, 0, 0, 0, -${10.714285714285714*s} -${10.714285714285714*s}h -${8.571428571428571*s}H ${l(25)}z`;return jsxRuntime.jsx("path",{clipRule:"evenodd",d:m,transform:P`rotate(0,${t},${e})`})}case "diya-reverse":{let s=a/30,l=h=>(h-40)*s+t,u=h=>(h-40)*s+e,m=P`M ${l(25)} ${u(35.714285714285715)}v ${19.285714285714285*s}h ${19.285714285714285*s}a ${10.714285714285714*s} ${10.714285714285714*s}, 0, 0, 0, ${10.714285714285714*s} -${10.714285714285714*s}v -${19.285714285714285*s}h -${19.285714285714285*s}a ${10.714285714285714*s} ${10.714285714285714*s}, 0, 0, 0, -${10.714285714285714*s} ${10.714285714285714*s}z`;return jsxRuntime.jsx("path",{clipRule:"evenodd",d:m,transform:P`rotate(0,${t},${e})`})}case "rounded-triangle":{let s=a/21,l=h=>(h-40)*s+t,u=h=>(h-40)*s+e,m=P`M ${l(33.57142857142857)} ${u(29.285714285714285)}h ${12.857142857142856*s}c ${4.285714285714286*s} 0 ${4.285714285714286*s} ${4.285714285714286*s} ${4.285714285714286*s} ${4.285714285714286*s}v ${12.857142857142856*s}c 0 ${4.285714285714286*s} -${4.285714285714286*s} ${4.285714285714286*s} -${4.285714285714286*s} ${4.285714285714286*s}h -${12.857142857142856*s}c -${4.285714285714286*s} 0 -${4.285714285714286*s} -${4.285714285714286*s} -${4.285714285714286*s} -${4.285714285714286*s}v -${12.857142857142856*s}c 0 -${4.285714285714286*s} ${4.285714285714286*s} -${4.285714285714286*s} ${4.285714285714286*s} -${4.285714285714286*s}z`;return jsxRuntime.jsx("path",{d:m,transform:P`rotate(45,${t},${e})`})}case "star":{let s=a/27,l=h=>(h-40)*s+t,u=h=>(h-40)*s+e,m=P`M ${l(38.84615384615385)},${u(26.546153846153846)}c${.6692307692307691*s},-${1.0153846153846153*s},${2.215384615384615*s},-${1.0153846153846153*s},${2.884615384615384*s},0l${4.038461538461538*s},${6.069230769230768*s}c${.23076923076923075*s},${.3461538461538461*s},${.6*s},${.6*s},${1.0153846153846153*s},${.7153846153846153*s}l${7.223076923076922*s},${1.823076923076923*s}c${1.2*s},${.3*s},${1.6846153846153844*s},${1.7076923076923076*s},${.8999999999999999*s},${2.6538461538461533*s}l-${4.73076923076923*s},${5.584615384615384*s}c-${.2769230769230769*s},${.3230769230769231*s},-${.41538461538461535*s},${.7384615384615384*s},-${.3923076923076923*s},${1.1307692307692307*s}l${.4384615384615384*s},${7.199999999999999*s}c${.06923076923076922*s},${1.2*s},-${1.1769230769230767*s},${2.0769230769230766*s},-${2.3307692307692305*s},${1.6384615384615382*s}l-${6.9692307692307685*s},-${2.6076923076923073*s}c-${.3923076923076923*s},-${.16153846153846155*s},-${.8538461538461538*s},-${.16153846153846155*s},-${1.2461538461538462*s},0l-${6.9692307692307685*s},${2.6076923076923073*s}c-${1.1538461538461537*s},${.4384615384615384*s},-${2.4*s},-${.4384615384615384*s},-${2.3307692307692305*s},-${1.6384615384615382*s}l${.4384615384615384*s},-${7.199999999999999*s}c${.023076923076923075*s},-${.41538461538461535*s},-${.11538461538461538*s},-${.8307692307692307*s},-${.3923076923076923*s},-${1.1307692307692307*s}l-${4.73076923076923*s},-${5.584615384615384*s}c-${.7846153846153846*s},-${.923076923076923*s},-${.3230769230769231*s},-${2.3307692307692305*s},${.8999999999999999*s},-${2.6538461538461533*s}l${7.223076923076922*s},-${1.823076923076923*s}c${.41538461538461535*s},-${.11538461538461538*s},${.7846153846153846*s},-${.3461538461538461*s},${1.0153846153846153*s},-${.7153846153846153*s}l${4.038461538461538*s},-${6.069230769230768*s}z`;return jsxRuntime.jsx("path",{clipRule:"evenodd",d:m,transform:P`rotate(0,${t},${e})`})}case "banner":{let s=a/28;return jsxRuntime.jsx("g",{transform:P`translate(${t-40*s},${e-40*s}) scale(${x(s,6)})`,children:jsxRuntime.jsx("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 jsxRuntime.jsx("circle",{cx:x(t),cy:x(e),r:x(n),transform:P`rotate(0,${t},${e})`})}}var Qc=z(()=>{"use strict";ae();ft();});function Nn(t,e,n,o){let r=t==="top-left"?0:t==="top-right"?1:3,a=(r+2)%4;return [0,1,2,3].map(i=>i===r||o&&i===a?n:e)}function zc(t,e,n,o){return [[t+o,e],[t+n-o,e],[t+n,e+o],[t+n,e+n-o],[t+n-o,e+n],[t+o,e+n],[t,e+n-o],[t,e+o]]}function Uc(t,e,n,o){let r=n/7,a=Math.max(0,(o+Math.SQRT2-2)*r);return tt(zc(t,e,n,o*r))+tt(zc(t+r,e+r,5*r,a))}function Hc(t,e,n,o,r=false){let a=n/7,i=c=>r?Nn(o,0,c,true):Nn(o,c,0,true);return O(t,e,n,n,i(2.5*a))+O(t+a,e+a,5*a,5*a,i(1.5*a))}function cd(t,e,n,o){let r=n/7;return O(t,e,n,n,Nn(o,2.6*r,0,false))+O(t+r,e+r,5*r,5*r,Nn(o,1.6*r,0,false))}function ld(t,e,n){let o=n/7,r=t+n/2,a=e+n/2;return tt(Hn(r,a,3.5*o,3.5*o,4,96))+tt(Hn(r,a,2.5*o,2.5*o,4,96))}function Wc(t,e,n,o,r){let a=o,i=n/2,c=(i-a)*.55,s=(l,u)=>P`${t+l} ${e+u}`;return P`M${s(a,0)}`+P`C${s(a+c,0)} ${s(i-c,r)} ${s(i,r)}`+P`C${s(i+c,r)} ${s(n-a-c,0)} ${s(n-a,0)}`+P`A${a} ${a} 0 0 1 ${s(n,a)}`+P`C${s(n,a+c)} ${s(n-r,i-c)} ${s(n-r,i)}`+P`C${s(n-r,i+c)} ${s(n,n-a-c)} ${s(n,n-a)}`+P`A${a} ${a} 0 0 1 ${s(n-a,n)}`+P`C${s(n-a-c,n)} ${s(i+c,n-r)} ${s(i,n-r)}`+P`C${s(i-c,n-r)} ${s(a+c,n)} ${s(a,n)}`+P`A${a} ${a} 0 0 1 ${s(0,n-a)}`+P`C${s(0,n-a-c)} ${s(r,i+c)} ${s(r,i)}`+P`C${s(r,i-c)} ${s(0,a+c)} ${s(0,a)}`+P`A${a} ${a} 0 0 1 ${s(a,0)}Z`}function ud(t,e,n){let o=n/7,r=.12*o;return Wc(t,e,n,1.4*o,r)+Wc(t+o,e+o,5*o,.7*o,r)}function Vc(t,e,n,o,r,a){let i=n/2,c=(s,l)=>P`${t+s} ${e+l}`;return P`M${c(o,0)}H${t+n-o}`+P`A${o} ${o} 0 0 1 ${c(n,o)}`+P`V${e+r}`+P`C${c(n,r+1.55*a)} ${c(i+1.6*a,n)} ${c(i,n)}`+P`C${c(i-1.6*a,n)} ${c(0,r+1.55*a)} ${c(0,r)}`+P`V${e+o}A${o} ${o} 0 0 1 ${c(o,0)}Z`}function md(t,e,n){let o=n/7;return Vc(t,e,n,.7*o,3.9*o,o)+Vc(t+o,e+o,5*o,.35*o,2.7*o,.8*o)}function dd(t,e,n,o){let r=n/7;return O(t,e,n,n,Nn(o,.5*r,2.5*r,false))+O(t+r,e+r,5*r,5*r,Nn(o,.25*r,1.5*r,false))}function hd(t,e,n){let o=n/7;return P`M ${t} ${e}v ${n}h ${n}v -${n}z`+P`M ${t+o} ${e+o}h ${5*o}v ${5*o}h -${5*o}z`}function fd(t,e,n){let o=n/7,r=o*.875,a=o*.4375,i=P`M ${t+r} ${e}`+P`h ${n-2*r}`+P`a ${r} ${r} 0 0 1 ${r} ${r}`+P`v ${n-2*r}`+P`a ${r} ${r} 0 0 1 ${-r} ${r}`+P`h ${-(n-2*r)}`+P`a ${r} ${r} 0 0 1 ${-r} ${-r}`+P`v ${-(n-2*r)}`+P`a ${r} ${r} 0 0 1 ${r} ${-r}z`,c=P`M ${t+o+a} ${e+o}`+P`h ${5*o-2*a}`+P`a ${a} ${a} 0 0 1 ${a} ${a}`+P`v ${5*o-2*a}`+P`a ${a} ${a} 0 0 1 ${-a} ${a}`+P`h ${-(5*o-2*a)}`+P`a ${a} ${a} 0 0 1 ${-a} ${-a}`+P`v ${-(5*o-2*a)}`+P`a ${a} ${a} 0 0 1 ${a} ${-a}z`;return i+c}function pd(t,e,n){let o=t+n/2,r=e+n/2,a=it(n/2),i=it(n*(2.5/7));return P`M ${o-a} ${r}`+P`a ${a} ${a} 0 1 0 ${a*2} 0`+P`a ${a} ${a} 0 1 0 ${-a*2} 0z`+P`M ${o-i} ${r}`+P`a ${i} ${i} 0 1 1 ${i*2} 0`+P`a ${i} ${i} 0 1 1 ${-i*2} 0z`}function gd(t,e,n){let o=n/74.7002,r=c=>c*o+t,a=c=>c*o+e;return P`M${r(37.3496)} ${a(0)}C${r(39.2939)} ${a(0)} ${r(40.9948)} ${a(1.03842)} ${r(41.9287)} ${a(2.59082)}C${r(43.2293)} ${a(1.34013)} ${r(45.1347)} ${a(.780267)} ${r(47.0098)} ${a(1.28027)}C${r(48.8871)} ${a(1.78928)} ${r(50.261)} ${a(3.23767)} ${r(50.7578)} ${a(4.98438)}C${r(52.3454)} ${a(4.0996)} ${r(54.3432)} ${a(4.047)} ${r(56.0303)} ${a(5.01953)}C${r(57.7094)} ${a(5.98752)} ${r(58.6586)} ${a(7.73647)} ${r(58.6924)} ${a(9.5459)}C${r(60.4517)} ${a(9.10661)} ${r(62.3883)} ${a(9.57215)} ${r(63.7598)} ${a(10.9502)}C${r(65.1282)} ${a(12.3253)} ${r(65.5963)} ${a(14.2585)} ${r(65.1641)} ${a(16.0127)}C${r(66.974)} ${a(16.044)} ${r(68.7242)} ${a(16.9982)} ${r(69.7002)} ${a(18.6797)}C${r(70.6781)} ${a(20.3647)} ${r(70.6241)} ${a(22.3635)} ${r(69.7402)} ${a(23.9502)}C${r(71.4776)} ${a(24.4496)} ${r(72.9194)} ${a(25.8232)} ${r(73.4199)} ${a(27.7002)}C${r(73.927)} ${a(29.5707)} ${r(73.3661)} ${a(31.4794)} ${r(72.1104)} ${a(32.7822)}C${r(73.6621)} ${a(33.7163)} ${r(74.7002)} ${a(35.4166)} ${r(74.7002)} ${a(37.3604)}C${r(74.7001)} ${a(39.307)} ${r(73.6582)} ${a(41.0084)} ${r(72.1025)} ${a(41.9414)}C${r(73.357)} ${a(43.245)} ${r(73.9207)} ${a(45.1525)} ${r(73.4199)} ${a(47.0303)}C${r(72.9187)} ${a(48.9027)} ${r(71.4782)} ${a(50.2735)} ${r(69.7383)} ${a(50.7734)}C${r(70.6201)} ${a(52.3601)} ${r(70.6716)} ${a(54.3549)} ${r(69.7002)} ${a(56.04)}C${r(68.7237)} ${a(57.7225)} ${r(66.9721)} ${a(58.6729)} ${r(65.1611)} ${a(58.7031)}C${r(65.598)} ${a(60.4623)} ${r(65.131)} ${a(62.3982)} ${r(63.7598)} ${a(63.7695)}C${r(62.3847)} ${a(65.138)} ${r(60.4515)} ${a(65.6061)} ${r(58.6973)} ${a(65.1738)}C${r(58.6635)} ${a(66.9833)} ${r(57.7094)} ${a(68.7322)} ${r(56.0303)} ${a(69.7002)}C${r(54.3461)} ${a(70.6777)} ${r(52.348)} ${a(70.6248)} ${r(50.7617)} ${a(69.7422)}C${r(50.2643)} ${a(71.4831)} ${r(48.8896)} ${a(72.9284)} ${r(47.0098)} ${a(73.4297)}C${r(45.1389)} ${a(73.9368)} ${r(43.2296)} ${a(73.3763)} ${r(41.9268)} ${a(72.1201)}C${r(40.9927)} ${a(73.6717)} ${r(39.2932)} ${a(74.71)} ${r(37.3496)} ${a(74.71)}C${r(35.4051)} ${a(74.7098)} ${r(33.7042)} ${a(73.6711)} ${r(32.7705)} ${a(72.1182)}C${r(31.4697)} ${a(73.3758)} ${r(29.5597)} ${a(73.9418)} ${r(27.6797)} ${a(73.4404)}V${a(73.4502)}C${r(25.8065)} ${a(72.9422)} ${r(24.434)} ${a(71.4985)} ${r(23.9346)} ${a(69.7568)}C${r(22.3504)} ${a(70.6301)} ${r(20.3591)} ${a(70.6781)} ${r(18.6797)} ${a(69.71)}C${r(16.9957)} ${a(68.7391)} ${r(16.045)} ${a(66.9831)} ${r(16.0166)} ${a(65.168)}C${r(14.2547)} ${a(65.6091)} ${r(12.3134)} ${a(65.1435)} ${r(10.9395)} ${a(63.7695)}C${r(9.5687)} ${a(62.3919)} ${r(9.10168)} ${a(60.454)} ${r(9.53809)} ${a(58.6973)}C${r(7.72791)} ${a(58.6641)} ${r(5.97815)} ${a(57.71)} ${r(5.00977)} ${a(56.0303)}C${r(4.03552)} ${a(54.3517)} ${r(4.08377)} ${a(52.3649)} ${r(4.95801)} ${a(50.7812)}C${r(3.21705)} ${a(50.2839)} ${r(1.77087)} ${a(48.9101)} ${r(1.26953)} ${a(47.0303)}V${a(47.0205)}C${r(.762081)} ${a(45.1489)} ${r(1.32758)} ${a(43.2375)} ${r(2.58496)} ${a(41.9346)}C${r(1.03604)} ${a(41)} ${r(108484e-9)} ${a(39.3019)} ${r(0)} ${a(37.3604)}C${r(0)} ${a(35.4159)} ${r(1.03815)} ${a(33.7141)} ${r(2.59082)} ${a(32.7803)}C${r(1.34044)} ${a(31.4797)} ${r(.780389)} ${a(29.575)} ${r(1.28027)} ${a(27.7002)}C${r(1.78258)} ${a(25.8232)} ${r(3.22806)} ${a(24.4482)} ${r(4.97363)} ${a(23.9512)}C${r(4.08938)} ${a(22.3638)} ${r(4.03743)} ${a(20.3664)} ${r(5.00977)} ${a(18.6797)}C${r(5.97815)} ${a(16.9999)} ${r(7.72788)} ${a(16.0496)} ${r(9.53809)} ${a(16.0166)}C${r(9.10139)} ${a(14.2576)} ${r(9.56846)} ${a(12.3214)} ${r(10.9395)} ${a(10.9502)}C${r(12.3171)} ${a(9.57911)} ${r(14.2558)} ${a(9.11137)} ${r(16.0127)} ${a(9.54785)}C${r(16.0426)} ${a(7.73421)} ${r(16.9969)} ${a(5.97989)} ${r(18.6797)} ${a(5.00977)}C${r(20.3596)} ${a(4.03474)} ${r(22.3521)} ${a(4.08468)} ${r(23.9365)} ${a(4.96094)}C${r(24.4378)} ${a(3.22749)} ${r(25.8059)} ${a(1.7898)} ${r(27.6797)} ${a(1.29004)}C${r(29.5511)} ${a(.78264)} ${r(31.4617)} ${a(1.34357)} ${r(32.7646)} ${a(2.60059)}C${r(33.6971)} ${a(1.04268)} ${r(35.4013)} ${a(152405e-9)} ${r(37.3496)} ${a(0)}ZM${r(41.0615)} ${a(9.17578)}C${r(40.1006)} ${a(10.1057)} ${r(38.793)} ${a(10.6797)} ${r(37.3496)} ${a(10.6797)}C${r(35.9064)} ${a(10.6796)} ${r(34.5985)} ${a(10.1066)} ${r(33.6377)} ${a(9.17676)}C${r(32.9511)} ${a(10.3241)} ${r(31.8358)} ${a(11.2176)} ${r(30.4404)} ${a(11.5898)}C${r(29.0527)} ${a(11.9661)} ${r(27.6436)} ${a(11.7542)} ${r(26.4766)} ${a(11.1074)}C${r(26.1072)} ${a(12.3879)} ${r(25.2629)} ${a(13.5333)} ${r(24.0195)} ${a(14.25)}C${r(22.7695)} ${a(14.9754)} ${r(21.347)} ${a(15.1322)} ${r(20.0479)} ${a(14.8047)}C${r(20.0289)} ${a(16.1454)} ${r(19.5108)} ${a(17.4793)} ${r(18.4902)} ${a(18.5)}C${r(17.4696)} ${a(19.5158)} ${r(16.1409)} ${a(20.033)} ${r(14.8066)} ${a(20.0566)}C${r(15.1312)} ${a(21.3534)} ${r(14.9738)} ${a(22.7723)} ${r(14.25)} ${a(24.0195)}C${r(13.5243)} ${a(25.2699)} ${r(12.3701)} ${a(26.1148)} ${r(11.082)} ${a(26.4795)}C${r(11.7347)} ${a(27.6479)} ${r(11.9529)} ${a(29.062)} ${r(11.5801)} ${a(30.46)}C${r(11.2085)} ${a(31.8485)} ${r(10.3194)} ${a(32.9607)} ${r(9.17578)} ${a(33.6475)}C${r(10.106)} ${a(34.6084)} ${r(10.6797)} ${a(35.9167)} ${r(10.6797)} ${a(37.3604)}C${r(10.6796)} ${a(38.805)} ${r(10.1053)} ${a(40.1141)} ${r(9.17383)} ${a(41.0752)}C${r(10.3132)} ${a(41.7614)} ${r(11.1999)} ${a(42.871)} ${r(11.5703)} ${a(44.2598)}C${r(11.946)} ${a(45.6504)} ${r(11.7335)} ${a(47.0592)} ${r(11.0889)} ${a(48.2266)}C${r(12.377)} ${a(48.593)} ${r(13.5297)} ${a(49.441)} ${r(14.25)} ${a(50.6904)}C${r(14.9754)} ${a(51.9405)} ${r(15.1322)} ${a(53.3629)} ${r(14.8047)} ${a(54.6621)}C${r(16.142)} ${a(54.6835)} ${r(17.4721)} ${a(55.2016)} ${r(18.4902)} ${a(56.2197)}C${r(19.5097)} ${a(57.2441)} ${r(20.0278)} ${a(58.5787)} ${r(20.0479)} ${a(59.918)}C${r(21.3469)} ${a(59.5917)} ${r(22.7696)} ${a(59.7493)} ${r(24.0195)} ${a(60.4697)}C${r(25.2676)} ${a(61.1892)} ${r(26.1117)} ${a(62.3406)} ${r(26.4775)} ${a(63.627)}C${r(27.6424)} ${a(62.9822)} ${r(29.0498)} ${a(62.7688)} ${r(30.4404)} ${a(63.1396)}C${r(31.8284)} ${a(63.5112)} ${r(32.9402)} ${a(64.3999)} ${r(33.627)} ${a(65.543)}C${r(34.5887)} ${a(64.6072)} ${r(35.9012)} ${a(64.0304)} ${r(37.3496)} ${a(64.0303)}C${r(38.7912)} ${a(64.0303)} ${r(40.098)} ${a(64.6023)} ${r(41.0586)} ${a(65.5303)}C${r(41.7458)} ${a(64.3887)} ${r(42.8594)} ${a(63.5007)} ${r(44.25)} ${a(63.1299)}C${r(45.643)} ${a(62.7522)} ${r(47.057)} ${a(62.9676)} ${r(48.2266)} ${a(63.6201)}C${r(48.5931)} ${a(62.3323)} ${r(49.4413)} ${a(61.1801)} ${r(50.6904)} ${a(60.46)}C${r(51.9373)} ${a(59.7364)} ${r(53.3558)} ${a(59.5781)} ${r(54.6523)} ${a(59.9023)}C${r(54.6744)} ${a(58.5659)} ${r(55.1925)} ${a(57.2372)} ${r(56.21)} ${a(56.2197)}C${r(57.2339)} ${a(55.2007)} ${r(58.5676)} ${a(54.6816)} ${r(59.9062)} ${a(54.6611)}C${r(59.5835)} ${a(53.3649)} ${r(59.7414)} ${a(51.9468)} ${r(60.46)} ${a(50.7002)}C${r(61.1797)} ${a(49.4517)} ${r(62.3312)} ${a(48.6068)} ${r(63.6182)} ${a(48.2412)}C${r(62.9651)} ${a(47.0726)} ${r(62.7473)} ${a(45.658)} ${r(63.1201)} ${a(44.2598)}C${r(63.4916)} ${a(42.8718)} ${r(64.3794)} ${a(41.7591)} ${r(65.5225)} ${a(41.0723)}C${r(64.5929)} ${a(40.1115)} ${r(64.0206)} ${a(38.8033)} ${r(64.0205)} ${a(37.3604)}C${r(64.0205)} ${a(35.9186)} ${r(64.5915)} ${a(34.611)} ${r(65.5195)} ${a(33.6504)}C${r(64.3785)} ${a(32.9631)} ${r(63.4908)} ${a(31.8501)} ${r(63.1201)} ${a(30.46)}C${r(62.7421)} ${a(29.0656)} ${r(62.9572)} ${a(27.6498)} ${r(63.6113)} ${a(26.4795)}C${r(62.3272)} ${a(26.1115)} ${r(61.1784)} ${a(25.2657)} ${r(60.46)} ${a(24.0195)}C${r(59.7364)} ${a(22.7727)} ${r(59.5781)} ${a(21.3541)} ${r(59.9023)} ${a(20.0576)}C${r(58.5626)} ${a(20.038)} ${r(57.23)} ${a(19.52)} ${r(56.21)} ${a(18.5)}C${r(55.1931)} ${a(17.4783)} ${r(54.675)} ${a(16.1482)} ${r(54.6523)} ${a(14.8125)}C${r(53.3557)} ${a(15.1357)} ${r(51.9374)} ${a(14.9785)} ${r(50.6904)} ${a(14.2598)}C${r(49.4399)} ${a(13.5339)} ${r(48.5931)} ${a(12.3801)} ${r(48.2285)} ${a(11.0918)}C${r(47.0603)} ${a(11.7439)} ${r(45.6474)} ${a(11.9624)} ${r(44.25)} ${a(11.5898)}V${a(11.5801)}C${r(42.8613)} ${a(11.2085)} ${r(41.7483)} ${a(10.3196)} ${r(41.0615)} ${a(9.17578)}Z`}function Oa(t){let e=t/70;return {scale:e,transform:(o,r)=>(o-5)*e+r}}function bd(t,e,n){let{scale:o,transform:r}=Oa(n);return P`M ${r(5,t)} ${r(30,e)}v ${20*o}a ${25*o} ${25*o}, 0, 0, 0, ${25*o} ${25*o}h ${45*o}v -${45*o}a ${25*o} ${25*o}, 0, 0, 0, -${25*o} -${25*o}h -${20*o}H ${r(5,t)}zM ${r(30,t)} ${r(15,e)}h ${20*o}a ${15*o} ${15*o}, 0, 0, 1, ${15*o} ${15*o}v ${35*o}h -${35*o}a ${15*o} ${15*o}, 0, 0, 1, -${15*o} -${15*o}v -${35*o}z`}function yd(t,e,n){let o=n/7,r=o*1.5,a=o*.75,i=P`M ${t+r} ${e}`+P`h ${n-2*r}`+P`a ${r} ${r} 0 0 1 ${r} ${r}`+P`v ${n-2*r}`+P`a ${r} ${r} 0 0 1 ${-r} ${r}`+P`h ${-(n-2*r)}`+P`a ${r} ${r} 0 0 1 ${-r} ${-r}`+P`v ${-(n-2*r)}`+P`a ${r} ${r} 0 0 1 ${r} ${-r}z`,c=P`M ${t+o+a} ${e+o}`+P`h ${5*o-2*a}`+P`a ${a} ${a} 0 0 1 ${a} ${a}`+P`v ${5*o-2*a}`+P`a ${a} ${a} 0 0 1 ${-a} ${a}`+P`h ${-(5*o-2*a)}`+P`a ${a} ${a} 0 0 1 ${-a} ${-a}`+P`v ${-(5*o-2*a)}`+P`a ${a} ${a} 0 0 1 ${a} ${-a}z`;return i+c}function _d(t,e,n){let{scale:o,transform:r}=Oa(n);return P`M ${r(5,t)} ${r(40,e)}a ${35*o} ${35*o}, 0, 0, 0, ${35*o} ${35*o}h ${30*o}a ${5*o} ${5*o}, 0, 0, 0, ${5*o} -${5*o}v -${30*o}a ${35*o} ${35*o}, 0, 0, 0, -${35*o} -${35*o}a ${35*o} ${35*o}, 0, 0, 0, -${35*o} ${35*o}zM ${r(40,t)} ${r(15,e)}a ${25*o} ${25*o}, 0, 0, 1, ${25*o} ${25*o}v ${25*o}h -${25*o}a ${25*o} ${25*o}, 0, 0, 1, -${25*o} -${25*o}a ${25*o} ${25*o}, 0, 0, 1, ${25*o} -${25*o}z`}function xd(t,e,n){let{scale:o,transform:r}=Oa(n);return P`M ${r(5,t)} ${r(30,e)}v ${20*o}a ${25*o} ${25*o}, 0, 0, 0, ${25*o} ${25*o}h ${45*o}v -${45*o}a ${25*o} ${25*o}, 0, 0, 0, -${25*o} -${25*o}h -${20*o}a ${25*o} ${25*o}, 0, 0, 0, -${25*o} ${25*o}M ${r(30,t)} ${r(15,e)}h ${20*o}a ${15*o} ${15*o}, 0, 0, 1, ${15*o} ${15*o}v ${35*o}h -${35*o}a ${15*o} ${15*o}, 0, 0, 1, -${15*o} -${15*o}v -${20*o}a ${15*o} ${15*o}, 0, 0, 1, ${15*o} -${15*o}z`}function $d(t,e,n){let o=n/70,r=t+n/2-40*o,a=e+n/2-40*o,i=(s,l)=>s*o+l;return P`M${i(35.19239999999999,r)} ${i(5.837547376725838,a)}C${i(37.69667692307692,r)} ${i(3.8737070690335305,a)}, ${i(41.218430769230764,r)} ${i(3.8737092228796843,a)}, ${i(43.722707692307694,r)} ${i(5.837547376725838,a)}L${i(46.62781538461539,r)} ${i(8.115648915187375,a)}L${i(50.23356923076923,r)} ${i(7.32361506903353,a)}C${i(53.342,r)} ${i(6.640824299802762,a)}, ${i(56.51483076923077,r)} ${i(8.168784299802759,a)}, ${i(57.91892307692308,r)} ${i(11.024719684418145,a)}L${i(59.54787692307692,r)} ${i(14.337679684418145,a)}L${i(63.14027692307692,r)} ${i(15.188578145956608,a)}C${i(66.23707692307693,r)} ${i(15.922091992110452,a)}, ${i(68.43270769230769,r)} ${i(18.675396607495067,a)}, ${i(68.45876923076924,r)} ${i(21.857768915187375,a)}L${i(68.48892307692307,r)} ${i(25.54931045364891,a)}L${i(71.35633846153846,r)} ${i(27.874602761341222,a)}C${i(73.82830769230769,r)} ${i(29.879187376725838,a)}, ${i(74.61187692307692,r)} ${i(33.312418145956606,a)}, ${i(73.25452307692306,r)} ${i(36.19103353057199,a)}L${i(71.68006153846153,r)} ${i(39.530141222879685,a)}L${i(73.25452307692306,r)} ${i(42.86924891518738,a)}C${i(74.61187692307692,r)} ${i(45.747864299802764,a)}, ${i(73.82830769230769,r)} ${i(49.18109506903353,a)}, ${i(71.35633846153846,r)} ${i(51.18567968441815,a)}L${i(68.48892307692307,r)} ${i(53.510971992110456,a)}L${i(68.45876923076924,r)} ${i(57.202664299802755,a)}C${i(68.43270769230769,r)} ${i(60.38497199211046,a)}, ${i(66.23707692307693,r)} ${i(63.13823353057199,a)}, ${i(63.14027692307692,r)} ${i(63.871833530572,a)}L${i(59.54787692307692,r)} ${i(64.72260276134121,a)}L${i(57.91892307692308,r)} ${i(68.03564891518737,a)}C${i(56.51483076923077,r)} ${i(70.89164891518737,a)}, ${i(53.342,r)} ${i(72.41958737672583,a)}, ${i(50.23356923076923,r)} ${i(71.7368181459566,a)}L${i(46.62781538461539,r)} ${i(70.94463353057199,a)}L${i(43.722707692307694,r)} ${i(73.22275660749506,a)}C${i(41.218430769230764,r)} ${i(75.18663353057198,a)}, ${i(37.69667692307692,r)} ${i(75.18663353057198,a)}, ${i(35.19239999999999,r)} ${i(73.22275660749506,a)}L${i(32.28729230769231,r)} ${i(70.94463353057199,a)}L${i(28.68153846153846,r)} ${i(71.7368181459566,a)}C${i(25.573215384615384,r)} ${i(72.41958737672583,a)}, ${i(22.400384615384613,r)} ${i(70.89164891518737,a)}, ${i(20.996141538461536,r)} ${i(68.03564891518737,a)}L${i(19.36720923076923,r)} ${i(64.72260276134121,a)}L${i(15.774852307692306,r)} ${i(63.871833530572,a)}C${i(12.67803076923077,r)} ${i(63.13823353057199,a)}, ${i(10.48237846153846,r)} ${i(60.38497199211046,a)}, ${i(10.45636,r)} ${i(57.202664299802755,a)}L${i(10.426163076923077,r)} ${i(53.510971992110456,a)}L${i(7.558747692307692,r)} ${i(51.18567968441815,a)}C${i(5.086880338461539,r)} ${i(49.18109506903353,a)}, ${i(4.303258769230769,r)} ${i(45.747864299802764,a)}, ${i(5.660599692307692,r)} ${i(42.86924891518738,a)}L${i(7.235153846153846,r)} ${i(39.530141222879685,a)}L${i(5.660599692307692,r)} ${i(36.19103353057199,a)}C${i(4.3032566153846155,r)} ${i(33.312418145956606,a)}, ${i(5.086885938461538,r)} ${i(29.879187376725838,a)}, ${i(7.558747692307692,r)} ${i(27.874602761341222,a)}L${i(10.426163076923077,r)} ${i(25.54931045364891,a)}L${i(10.45636,r)} ${i(21.857768915187375,a)}C${i(10.48237846153846,r)} ${i(18.67537506903353,a)}, ${i(12.678052307692308,r)} ${i(15.922091992110452,a)}, ${i(15.774852307692306,r)} ${i(15.188578145956608,a)}L${i(19.36720923076923,r)} ${i(14.337679684418145,a)}L${i(20.996141538461536,r)} ${i(11.024719684418145,a)}C${i(22.400384615384613,r)} ${i(8.168784299802759,a)}, ${i(25.573215384615384,r)} ${i(6.640824299802762,a)}, ${i(28.68153846153846,r)} ${i(7.32361506903353,a)}L${i(32.28729230769231,r)} ${i(8.115648915187375,a)}L${i(35.19239999999999,r)} ${i(5.837547376725838,a)}M${i(39.45766153846154,r)} ${i(13.665055069033532,a)}L${i(37.01498461538461,r)} ${i(15.58053506903353,a)}C${i(35.39098461538461,r)} ${i(16.854061222879682,a)}, ${i(33.282799999999995,r)} ${i(17.335251992110454,a)}, ${i(31.26701538461538,r)} ${i(16.892464299802757,a)}L${i(28.235046153846152,r)} ${i(16.22649506903353,a)}L${i(26.865415384615382,r)} ${i(19.012107376725837,a)}C${i(25.954812307692308,r)} ${i(20.864178145956608,a)}, ${i(24.264193846153844,r)} ${i(22.212399684418145,a)}, ${i(22.255926153846154,r)} ${i(22.688076607495066,a)}L${i(19.235393846153844,r)} ${i(23.40354122287968,a)}L${i(19.21,r)} ${i(26.507556607495065,a)}C${i(19.19313538461538,r)} ${i(28.57137199211045,a)}, ${i(18.25492,r)} ${i(30.519525838264297,a)}, ${i(16.651919999999997,r)} ${i(31.81937199211045,a)}L${i(14.240926153846154,r)} ${i(33.774633530572,a)}L${i(15.564830769230769,r)} ${i(36.58238737672584,a)}C${i(16.445064615384617,r)} ${i(38.44891045364892,a)}, ${i(16.445064615384617,r)} ${i(40.611371992110456,a)}, ${i(15.564830769230769,r)} ${i(42.47811045364892,a)}L${i(14.240926153846154,r)} ${i(45.28564891518738,a)}L${i(16.651919999999997,r)} ${i(47.240910453648915,a)}L${i(13.883236923076923,r)} ${i(50.654971992110454,a)}L${i(16.651919999999997,r)} ${i(47.240910453648915,a)}C${i(18.25492,r)} ${i(48.54075660749507,a)}, ${i(19.19313538461538,r)} ${i(50.4891258382643,a)}, ${i(19.21,r)} ${i(52.5527258382643,a)}L${i(19.235393846153844,r)} ${i(55.65684891518738,a)}L${i(22.255926153846154,r)} ${i(56.37235660749507,a)}C${i(24.264193846153844,r)} ${i(56.847925838264295,a)}, ${i(25.954812307692308,r)} ${i(58.196233530571995,a)}, ${i(26.865415384615382,r)} ${i(60.0483258382643,a)}L${i(28.235046153846152,r)} ${i(62.833895069033524,a)}L${i(31.26701538461538,r)} ${i(62.1679258382643,a)}C${i(33.282799999999995,r)} ${i(61.72509506903353,a)}, ${i(35.39098461538461,r)} ${i(62.20626429980276,a)}, ${i(37.01498461538461,r)} ${i(63.47983353057199,a)}L${i(39.45766153846154,r)} ${i(65.39524891518737,a)}L${i(41.90012307692308,r)} ${i(63.47983353057199,a)}C${i(43.524123076923075,r)} ${i(62.20626429980276,a)}, ${i(45.632307692307684,r)} ${i(61.72509506903353,a)}, ${i(47.6480923076923,r)} ${i(62.1679258382643,a)}L${i(50.68006153846154,r)} ${i(62.833895069033524,a)}L${i(52.049692307692304,r)} ${i(60.0483258382643,a)}C${i(52.960338461538456,r)} ${i(58.196233530571995,a)}, ${i(54.6508923076923,r)} ${i(56.847925838264295,a)}, ${i(56.65913846153846,r)} ${i(56.37235660749507,a)}L${i(59.67969230769231,r)} ${i(55.65684891518738,a)}L${i(59.70510769230769,r)} ${i(52.5527258382643,a)}C${i(59.72190769230769,r)} ${i(50.4891258382643,a)}, ${i(60.66012307692307,r)} ${i(48.54075660749507,a)}, ${i(62.263230769230766,r)} ${i(47.240910453648915,a)}L${i(64.67424615384616,r)} ${i(45.28564891518738,a)}L${i(63.35027692307692,r)} ${i(42.47811045364892,a)}C${i(62.47,r)} ${i(40.611371992110456,a)}, ${i(62.47,r)} ${i(38.44891045364892,a)}, ${i(63.35027692307692,r)} ${i(36.58238737672584,a)}L${i(64.67424615384616,r)} ${i(33.774633530572,a)}L${i(62.263230769230766,r)} ${i(31.81958737672584,a)}C${i(60.66012307692307,r)} ${i(30.519525838264297,a)}, ${i(59.72190769230769,r)} ${i(28.57137199211045,a)}, ${i(59.70510769230769,r)} ${i(26.507556607495065,a)}L${i(59.67969230769231,r)} ${i(23.40354122287968,a)}L${i(56.65913846153846,r)} ${i(22.688076607495066,a)}C${i(54.6508923076923,r)} ${i(22.212399684418145,a)}, ${i(52.960338461538456,r)} ${i(20.864178145956608,a)}, ${i(52.049692307692304,r)} ${i(19.012128915187375,a)}L${i(50.68006153846154,r)} ${i(16.22649506903353,a)}L${i(47.6480923076923,r)} ${i(16.892464299802757,a)}C${i(45.632307692307684,r)} ${i(17.335251992110454,a)}, ${i(43.524338461538456,r)} ${i(16.85408276134122,a)}, ${i(41.90012307692308,r)} ${i(15.58053506903353,a)}L${i(39.45766153846154,r)} ${i(13.665055069033532,a)}Z`}function Xr(t,e,n,o,r="top-left"){switch(o){case "leaf":return Hc(t,e,n,r);case "leaf-reverse":return Hc(t,e,n,r,true);case "drop":return cd(t,e,n,r);case "octagon":return Uc(t,e,n,1.6);case "bevel":return Uc(t,e,n,1.1);case "squircle":return ld(t,e,n);case "cushion":return ud(t,e,n);case "shield":return md(t,e,n);case "petal":return dd(t,e,n,r);case "gear":return gd(t,e,n);case "rounded":return fd(t,e,n);case "circle":return pd(t,e,n);case "diya":return bd(t,e,n);case "extra-rounded":return yd(t,e,n);case "message":return _d(t,e,n);case "pointy":return xd(t,e,n);case "curly":return $d(t,e,n);default:return hd(t,e,n)}}var Yc=z(()=>{"use strict";ae();ft();});exports.Arrow=void 0;var jc=z(()=>{"use strict";exports.Arrow={id:"Arrow",name:"Arrow",description:"QR code with arrow",wrapper:(t,e)=>jsxRuntime.jsx("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:jsxRuntime.jsxs("svg",{fill:"#000000",height:"300",viewBox:"0 0 300 300",width:"300",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("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:e?.fgColor||"black",id:"CallToActionArrow"}),jsxRuntime.jsx("g",{fill:"none",transform:"translate(82, 95)scale(0.5)",children:t})]})})};});exports.defaultTemplate=void 0;var Kc=z(()=>{"use strict";exports.defaultTemplate={id:"default",name:"Default",description:"Simple QR code without decorative elements",wrapper:t=>jsxRuntime.jsx("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:jsxRuntime.jsx("g",{fill:"none",transform:"translate(9, 9) scale(0.95)",children:t})})};});exports.Halloween=void 0;var nl=z(()=>{"use strict";exports.Halloween={id:"Halloween",name:"Halloween",description:"QR code with Halloween theme",wrapper:t=>jsxRuntime.jsx("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:jsxRuntime.jsx("svg",{fill:"none",height:"300",viewBox:"0 0 300 300",width:"300",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsxs("g",{transform:"translate(10, 10)",children:[jsxRuntime.jsx("circle",{cx:"138",cy:"167.682",fill:"white",r:"99.3177",stroke:"#F89941",strokeWidth:"20"}),jsxRuntime.jsx("rect",{fill:"url(#pattern0)",height:"110.806",width:"113",x:"81.0001",y:"124.097"}),jsxRuntime.jsx("ellipse",{cx:"167.989",cy:"67.8947",fill:"#F89941",rx:"35.4453",ry:"48.4419"}),jsxRuntime.jsx("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"}),jsxRuntime.jsx("ellipse",{cx:"154.072",cy:"69.4866",fill:"#F89941",rx:"34.0512",ry:"50.6615"}),jsxRuntime.jsx("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"}),jsxRuntime.jsx("ellipse",{cx:"134.316",cy:"70.8486",fill:"#F89941",rx:"33.673",ry:"47.8511"}),jsxRuntime.jsx("ellipse",{fill:"#F89941",rx:"35.4453",ry:"48.4419",transform:"matrix(-1 0 0 1 106.743 68.4484)"}),jsxRuntime.jsx("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"}),jsxRuntime.jsx("ellipse",{fill:"#F89941",rx:"32.9438",ry:"50.3847",transform:"matrix(-1 0 0 1 119.744 69.7634)"}),jsxRuntime.jsx("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"}),jsxRuntime.jsx("ellipse",{fill:"#F89941",rx:"32.3901",ry:"47.6163",transform:"matrix(-1 0 0 1 139.677 70.8708)"}),jsxRuntime.jsx("ellipse",{fill:"#F89941",rx:"33.2207",ry:"47.6163",transform:"matrix(-1 0 0 1 134.971 71.4245)"}),jsxRuntime.jsx("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"}),jsxRuntime.jsx("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"}),jsxRuntime.jsx("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"}),jsxRuntime.jsx("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"}),jsxRuntime.jsxs("defs",{children:[jsxRuntime.jsx("pattern",{height:"1",id:"pattern0",patternContentUnits:"objectBoundingBox",width:"1"}),jsxRuntime.jsx("clipPath",{id:"clip0_2087_156668",children:jsxRuntime.jsx("rect",{fill:"white",height:"276",width:"276"})})]}),jsxRuntime.jsx("g",{fill:"none",transform:"translate(80, 122)scale(0.38)",children:t})]})})})};});exports.SquareBorder=void 0;var ol=z(()=>{"use strict";exports.SquareBorder={id:"SquareBorder",name:"Square Border",description:"QR code with square decorative border",wrapper:(t,e)=>jsxRuntime.jsx("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:jsxRuntime.jsx("svg",{fill:"black",height:"300",viewBox:"0 0 316 316",width:"300",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsxs("g",{children:[jsxRuntime.jsx("path",{clipRule:"evenodd",d:"M308 8H8v300h300V8ZM0 0v316h316V0H0Z",fill:e?.fgColor||"black",fillRule:"evenodd"}),jsxRuntime.jsx("g",{fill:"none",transform:"translate(20, 20) scale(0.92)",children:t})]})})})};});exports.StandardBox=void 0;var il=z(()=>{"use strict";exports.StandardBox={id:"StandardBox",name:"Standard Box",description:"QR code with standard box",wrapper:(t,e)=>jsxRuntime.jsx("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:jsxRuntime.jsxs("svg",{fill:"#000000",height:"300",viewBox:"0 0 300 300",width:"300",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("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:e?.fgColor||"black"}),jsxRuntime.jsx("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:e?.fgColor||"black"}),jsxRuntime.jsx("g",{fill:"none",transform:"translate(60, 15)scale(0.6)",children:t})]})})};});exports.StrikedBox=void 0;var cl=z(()=>{"use strict";exports.StrikedBox={id:"StrikedBox",name:"Striked Box",description:"QR code with striked box",wrapper:t=>jsxRuntime.jsx("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:jsxRuntime.jsxs("svg",{fill:"#22071b",height:"300",viewBox:"0 0 300 300",width:"300",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("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"}),jsxRuntime.jsx("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"}),jsxRuntime.jsx("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"}),jsxRuntime.jsx("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"}),jsxRuntime.jsx("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"}),jsxRuntime.jsx("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"}),jsxRuntime.jsx("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"}),jsxRuntime.jsx("g",{fill:"none",transform:"translate(64, 38)scale(0.58)",children:t})]})})};});var Ba=z(()=>{"use strict";jc();Kc();nl();ol();il();cl();});exports.TEMPLATES=void 0;exports.getTemplate=void 0;exports.getAllTemplates=void 0;exports.getTemplateIds=void 0;var qa=z(()=>{"use strict";Ba();Ba();exports.TEMPLATES={default:exports.defaultTemplate,Arrow:exports.Arrow,StandardBox:exports.StandardBox,SquareBorder:exports.SquareBorder,StrikedBox:exports.StrikedBox,Halloween:exports.Halloween},exports.getTemplate=t=>exports.TEMPLATES[t],exports.getAllTemplates=()=>Object.values(exports.TEMPLATES),exports.getTemplateIds=()=>Object.keys(exports.TEMPLATES);});function hl(t){return `#${Qa(t.r)}${Qa(t.g)}${Qa(t.b)}`}function Jr(t){let e=mt(t);return !e||e.a>=1||e.a<=0?{color:t}:{color:hl(e),opacity:it(e.a,3)}}function Kr(t,e){let n=Math.min(Math.max(t.a,0),1);return {r:t.r*n+e.r*(1-n),g:t.g*n+e.g*(1-n),b:t.b*n+e.b*(1-n),a:1}}function Ed(t){return [...t].map(e=>({offset:Math.min(Math.max(e.offset/100,0),1),color:mt(e.color)??fl})).sort((e,n)=>e.offset-n.offset)}function za(t,e){let n=t[0],o=t.at(-1);if(!(n&&o))return fl;if(e<=n.offset)return n.color;if(e>=o.offset)return o.color;for(let r=0;r+1<t.length;r++){let a=t[r],i=t[r+1];if(e>=a.offset&&e<=i.offset){let c=i.offset-a.offset,s=c>0?(e-a.offset)/c:1,l=a.color.a+(i.color.a-a.color.a)*s,u=(m,h)=>{let d=m*a.color.a+(h*i.color.a-m*a.color.a)*s;return l>0?d/l:m+(h-m)*s};return {r:u(a.color.r,i.color.r),g:u(a.color.g,i.color.g),b:u(a.color.b,i.color.b),a:l}}}return o.color}function pl(t,e,n,o,r){let a=Ed(t);if(a.length===0)return {wedges:[]};let i=a[0].color.a,c=a.every(y=>Math.abs(y.color.a-i)<.002),s=[...new Set([0,...a.map(y=>y.offset),1])].sort((y,_)=>y-_),l=[];for(let y=0;y+1<s.length;y++){let _=s[y],w=s[y+1];if(w<=_)continue;let R=za(a,_+1e-9),S=za(a,w-1e-9),$=Math.max(Math.abs(R.r*R.a-S.r*S.a),Math.abs(R.g*R.a-S.g*S.a),Math.abs(R.b*R.a-S.b*S.a),Math.abs(R.a-S.a)*255),C=Math.ceil($/Pd),M=Math.ceil((w-_)*360/ul),v=Math.max(1,C,M);for(let E=0;E<v;E++)l.push([_+(w-_)*E/v,_+(w-_)*(E+1)/v]);}let u=l;if(l.length>ml){let y=Math.ceil(l.length/ml);u=[];for(let _=0;_<l.length;_+=y){let w=l.slice(_,_+y);u.push([w[0][0],w.at(-1)[1]]);}}let m=e-90,h=r/Math.cos(2*ul/2*(Math.PI/180)),d=y=>{let _=y*Math.PI/180;return [x(n+h*Math.cos(_)),x(o+h*Math.sin(_))]},p=`${x(n)} ${x(o)}`,f=y=>it((y%360+360)%360,4),g=u.length-1,b=u.map(([y,_],w)=>{let R=za(a,(y+_)/2),S=(_-y)*360,$=c&&w===0&&g>0?S:0,C=c&&w<g?S:0,M=m+y*360-$,v=m+_*360+C,[E,A]=d(M),[L,k]=d(v);return {d:`M${p}L${E} ${A}L${L} ${k}Z`,color:hl(R),...c||R.a>=1?{}:{opacity:it(R.a,3)},from:f(M),sweep:it(v-M,4)}});return c&&i<1?{wedges:b,opacity:it(i,3)}:{wedges:b}}function dl(t,e,n,o){return (Math.atan2(o-e,n-t)*180/Math.PI%360+360)%360}function gl(t,e,n){if(t>=n.x-1e-6&&t<=n.x+n.width+1e-6&&e>=n.y-1e-6&&e<=n.y+n.height+1e-6)return null;let r=[[n.x,n.y],[n.x+n.width,n.y],[n.x,n.y+n.height],[n.x+n.width,n.y+n.height]],a=dl(t,e,n.x+n.width/2,n.y+n.height/2),i=0,c=0;for(let[s,l]of r){let u=dl(t,e,s,l)-a;u>180?u-=360:u<=-180&&(u+=360),i=Math.min(i,u),c=Math.max(c,u);}return [a+i,a+c]}function bl(t,e){let n=t[1]-t[0],o=e[1]-e[0];if(n>=360||o>=360)return true;let r=((e[0]-t[0])%360+360)%360;return r<=n||r+o>=360}var Qa,fl,ul,ml,Pd,to=z(()=>{"use strict";ft();Dt();Qa=t=>Math.round(Math.min(Math.max(t,0),255)).toString(16).padStart(2,"0");fl={r:0,g:0,b:0,a:1};ul=4,ml=720,Pd=2;});var Ml={};gu(Ml,{QRCodeSVG:()=>Ya,SUPPORTS_PATH2D:()=>exports.SUPPORTS_PATH2D,convertImageSettingsToPixels:()=>Cl,excavateModules:()=>ro,generatePath:()=>Wa,getContrastLevel:()=>exports.getContrastLevel,getContrastRatio:()=>exports.getContrastRatio,getImageSettings:()=>Me,getLuminance:()=>exports.getLuminance,getSolidColor:()=>Mt,hexToRgb:()=>exports.hexToRgb,resolveErrorLevel:()=>Bt});function ro(t,e){return t.slice().map((n,o)=>o<e.y||o>=e.y+e.h?n:n.map((r,a)=>a<e.x||a>=e.x+e.w?r:false))}function Wa(t,e=0){let n=[];return t.forEach((o,r)=>{let a=null;o.forEach((i,c)=>{if(!i&&a!==null){n.push(P`M${a+e} ${r+e}h${c-a}v1H${a+e}z`),a=null;return}if(c===o.length-1){if(!i)return;a===null?n.push(P`M${c+e},${r+e} h1v1H${c+e}z`):n.push(P`M${a+e},${r+e} h${c+1-a}v1H${a+e}z`);return}i&&a===null&&(a=c);});}),n.join("")}function Ad(t,e,n){return t<7&&e<7||t>=n-7&&e<7||t<7&&e>=n-7}function Ua(t,e){let{margin:n,pixelSize:o,pattern:r="circle",plain:a=false}=e;if(Bc(r))return qc(t,{margin:n,pixelSize:o,pattern:r,scale:e.scale,plain:a});let i=Vr(e.scale,r),c=[],s=t.length,l=o*.45,u=a?()=>false:ka(s);return t.forEach((m,h)=>{m.forEach((d,p)=>{if(d&&(a||!Ad(p,h,s))){let f=(p+.5+n)*o,g=(h+.5+n)*o,b=`${p}-${h}`,y=c.length;if(u(p,h)){c.push(jsxRuntime.jsx("rect",{height:x(o),width:x(o),x:x(f-o/2),y:x(g-o/2)},b));return}switch(r){case "circle":c.push(jsxRuntime.jsx("circle",{cx:x(f),cy:x(g),r:x(l),transform:P`rotate(0,${f},${g})`},b));break;case "circle-large":{let _=o*.5;c.push(jsxRuntime.jsx("circle",{cx:x(f),cy:x(g),r:x(_),transform:P`rotate(0,${f},${g})`},b));}break;case "small-square":{let _=o*.357143;c.push(jsxRuntime.jsx("path",{d:P`M ${f-_} ${g-_}v ${o*.714286}h ${o*.714286}v -${o*.714286}z`,transform:P`rotate(0,${f},${g})`},b));}break;case "diamond":{let _=o*.357143;c.push(jsxRuntime.jsx("path",{d:P`M ${f-_} ${g-_}v ${o*.714286}h ${o*.714286}v -${o*.714286}z`,transform:P`rotate(45,${f},${g})`},b));}break;case "circle-mixed":{let _=(p+h)%3===0?Ld:(p+h)%2===0?1:1.25,w=l*_;c.push(jsxRuntime.jsx("circle",{cx:x(f),cy:x(g),r:x(w),transform:P`rotate(0,${f},${g})`},b));}break;case "pacman":{let _=o*.5,w=o*.357143;c.push(jsxRuntime.jsx("path",{d:P`M ${f-_} ${g-w}v ${o*.714286}h ${_}a ${_*.5} ${_*.5}, 0, 0, 0, 0 -${o*.714286}h -${_}v -${o*.714286}z`,transform:P`rotate(${(p+h)%2===0?0:90},${f},${g})`},b));}break;case "rounded":{let _=o*.5,w=o*.2;c.push(jsxRuntime.jsx("rect",{height:x(o),rx:x(w),ry:x(w),transform:P`rotate(0,${f},${g})`,width:x(o),x:x(f-_),y:x(g-_)},b));}break;case "square":{let _=o*.5;c.push(jsxRuntime.jsx("rect",{height:x(o),transform:P`rotate(0,${f},${g})`,width:x(o),x:x(f-_),y:x(g-_)},b));}break;case "vertical-line":{let _=o*.714286,w=o;c.push(jsxRuntime.jsx("path",{d:P`M ${f-o*.5} ${g-_*.5}v ${_}h ${w}v -${_}z`,transform:P`rotate(90,${f},${g})`},b));}break;default:c.push(jsxRuntime.jsx("circle",{cx:x(f),cy:x(g),r:x(l),transform:P`rotate(0,${f},${g})`},b));}if(i!==1&&c.length>y){let _=c.pop();c.push(jsxRuntime.jsx("g",{transform:P`translate(${f},${g}) scale(${x(i,6)}) translate(${-f},${-g})`,children:_},b));}}});}),c}function Id(t,e){let n=t*Math.PI/180,o=e/2,r=e/2,a=Math.sqrt(e*e+e*e)/2,i=o-a*Math.cos(n),c=r-a*Math.sin(n),s=o+a*Math.cos(n),l=r+a*Math.sin(n);return {x1:i,y1:c,x2:s,y2:l}}function Va(t,e){return `${t}-${Xe(JSON.stringify(e))}`}function Fd(t,e,n,o,r){let a=t;if(t===0)switch(r){case "top-left":a=0;break;case "top-right":a=90;break;case "bottom-left":a=270;break;default:a=0;}let i=a*Math.PI/180,c=e+o/2,s=n+o/2,l=Math.sqrt(o*o+o*o)/2,u=c-l*Math.cos(i),m=s-l*Math.sin(i),h=c+l*Math.cos(i),d=s+l*Math.sin(i);return {x1:u,y1:m,x2:h,y2:d}}function no(t,e){return e.map((n,o)=>{let{color:r,opacity:a}=Jr(n.color);return jsxRuntime.jsx("stop",{offset:`${n.offset}%`,stopColor:r,stopOpacity:a},`${t}-stop-${o}`)})}function $l(t,e,n,o,r,a){let i=pl(e.stops,e.angle??0,n,o,r),c=i.wedges.map((s,l)=>jsxRuntime.jsx("path",{d:s.d,"data-arc":`${s.from} ${s.sweep}`,fill:s.color,fillOpacity:s.opacity,shapeRendering:s.opacity===void 0?void 0:"crispEdges"},`${t}-w-${l}`));return jsxRuntime.jsx("pattern",{"data-qrdx-conic":`${x(n)} ${x(o)}`,height:x(a),id:t,patternUnits:"userSpaceOnUse",width:x(a),x:0,y:0,children:i.opacity===void 0?c:jsxRuntime.jsx("g",{opacity:i.opacity,children:c})},t)}function Td(t="center"){let[e,n]=t.split("-"),o=t==="center"?"center":e,r=n??(e==="left"||e==="right"?e:"center");return {x:r==="left"?0:r==="right"?1:.5,y:o==="top"?0:o==="bottom"?1:.5}}function Sl(t,e,n){let o=e.scale??1,r=e.fit==="tile",a=r?n/4*o:n,i=e.underlay?Jr(e.underlay):null,c=r?a:n*o,s=Td(e.position),l=r?0:s.x*(n-c),u=r?0:s.y*(n-c),m=r?"xMidYMid slice":`${kd[s.x*2]??"xMid"}${Nd[s.y*2]??"YMid"} ${e.fit==="contain"?"meet":"slice"}`;return jsxRuntime.jsxs("pattern",{height:x(a),id:t,patternUnits:"userSpaceOnUse",width:x(a),x:0,y:0,children:[i&&jsxRuntime.jsx("rect",{fill:i.color,fillOpacity:i.opacity,height:x(a),width:x(a),x:0,y:0}),jsxRuntime.jsx("image",{height:x(c),href:e.src,opacity:(e.opacity??1)<1?e.opacity:void 0,preserveAspectRatio:m,width:x(c),x:x(l),y:x(u)})]},t)}function Od(t,e,n,o,r,a,i){let c=Ht(t);if(c.type==="solid")return null;if(c.type==="image"){let l=wl(c,i);return {id:l,element:Sl(l,c,i)}}let s=Va(a,[c,e,n,o,r,...c.type==="angular"?[i]:[]]);if(c.type==="linear"){let l=c,u=l.angle??0,{x1:m,y1:h,x2:d,y2:p}=Fd(u,e,n,o,r);return {id:s,element:jsxRuntime.jsx("linearGradient",{gradientUnits:"userSpaceOnUse",id:s,x1:x(m),x2:x(d),y1:x(h),y2:x(p),children:no(s,l.stops)},s)}}if(c.type==="radial"){let l=c,u=e+o/2,m=n+o/2,h=o/2*.97;return {id:s,element:jsxRuntime.jsx("radialGradient",{cx:x(u),cy:x(m),fx:x(u),fy:x(m),gradientUnits:"userSpaceOnUse",id:s,r:x(h),children:no(s,l.stops)},s)}}return c.type==="angular"?{id:s,element:$l(s,c,e+o/2,n+o/2,o*.75,i)}:null}function Ha(t,e,n){let o=Ht(t);if(o.type==="solid")return null;if(o.type==="image"){let a=wl(o,e);return {id:a,element:Sl(a,o,e)}}let r=Va(n,[o,e]);if(o.type==="linear"){let a=o,i=a.angle??0,{x1:c,y1:s,x2:l,y2:u}=Id(i,e);return {id:r,element:jsxRuntime.jsx("linearGradient",{gradientUnits:"userSpaceOnUse",id:r,x1:x(c),x2:x(l),y1:x(s),y2:x(u),children:no(r,a.stops)},r)}}if(o.type==="radial"){let a=o,i=e/2,c=e/2,s=e/2*.97;return {id:r,element:jsxRuntime.jsx("radialGradient",{cx:x(i),cy:x(c),fx:x(i),fy:x(c),gradientUnits:"userSpaceOnUse",id:r,r:x(s),children:no(r,a.stops)},r)}}return o.type==="angular"?{id:r,element:$l(r,o,e/2,e/2,e*.75,e)}:null}function yl(t){let e=new Set,n=[];for(let o of t)o&&!e.has(o.id)&&(e.add(o.id),n.push(o.element));return n}function Ce(t,e,n){if(e)return {fill:`url(#${e})`};let o=Ht(t,n),r=o.type==="solid"?o.color:o.type==="image"?o.underlay??n:n,{color:a,opacity:i}=Jr(r);return i===void 0?{fill:a}:{fill:a,fillOpacity:i}}function Me(t,e,n,o){if(o==null)return null;let r=t.length,a=Math.floor(e*ur),i=(r+2*n)/e,c=(o.width||a)*i,s=(o.height||a)*i,l=o.x==null?r/2-c/2:o.x*i,u=o.y==null?r/2-s/2:o.y*i,m=null;if(o.excavate){let h=Math.max(0,o.padding??0)*i,d=Math.floor(l-h),p=Math.floor(u-h),f=Math.ceil(c+l+h-d),g=Math.ceil(s+u+h-p);m={x:d,y:p,w:f,h:g};}return {x:l,y:u,h:s,w:c,excavation:m}}function Bt(t){let e=t.level??te,{imageSettings:n}=t,o=t.isOGContext&&n?.excavate&&(e==="L"||e==="M")?"Q":e;if(t.autoLevel&&n&&o!=="H"){let r=wt.QrCode.encodeText(t.value,Lt[o]).getModules(),a=Me(r,t.size??bt,Tt(r.length,t.margin??exports.DEFAULT_MARGIN,t.shape),n);a&&(a.excavation?a.excavation.w*a.excavation.h:a.w*a.h)/(r.length*r.length)>exports.AUTO_LEVEL_LOGO_COVERAGE&&(o="H");}return o}function Cl(t,e,n,o){let r=e/n,a=t.w*r,i=t.h*r,c=(t.x+o)*r,s=(t.y+o)*r;return {imgWidth:a,imgHeight:i,imgLeft:c,imgTop:s}}function Ya(t){let{value:e,size:n=bt,level:o=te,bgColor:r=yt,fgColor:a=Pt,eyeColor:i,dotColor:c,bodyPattern:s="circle",cornerEyePattern:l="gear",cornerEyeDotPattern:u="circle",margin:m=exports.DEFAULT_MARGIN,isOGContext:h=false,imageSettings:d,templateId:p,customTemplate:f,customProps:g,frame:b,art:y,eyeColors:_,moduleScale:w,autoLevel:R,shape:S,frameLabelMarkers:$,...C}=t,M=oo({value:e,size:n,margin:m,level:o,shape:S,autoLevel:R,isOGContext:h},d),v=zt(b),E=v?{}:C,A=lt=>v?Ar(lt,{size:n,frame:b,bgColor:r,svgProps:C,markLabels:$}):lt,L=Bt({value:e,size:n,level:o,margin:m,imageSettings:M,isOGContext:h,autoLevel:R,shape:S}),k=wt.QrCode.encodeText(e,Lt[L]),T=k.getModules(),I=Tt(T.length,m,S),W=ac(e,T.length,m,S),G=(lt,Ut)=>{let Kt=_a(S,lt);return Kt?"circle"in Kt?jsxRuntime.jsx("circle",{cx:x(lt/2),cy:x(lt/2),...Ut,r:x(lt/2)}):jsxRuntime.jsx("path",{d:Kt.path,...Ut}):jsxRuntime.jsx("rect",{...Ut,height:lt,width:lt,x:0,y:0})},V=T.length+I*2,q=Me(T,n,I,M),j=null;if(M!=null&&q!=null){q.excavation!=null&&(T=ro(T,q.excavation));let{imgWidth:lt,imgHeight:Ut,imgLeft:Kt,imgTop:gn}=Cl(q,n,V,I);if(h){let bn=M.shape??"square";j=jsxRuntime.jsx("img",{alt:"Logo",src:M.src,style:{position:"absolute",left:`${x(Kt)}px`,top:`${x(gn)}px`,width:`${x(lt)}px`,height:`${x(Ut)}px`,...bn!=="square"&&{borderRadius:bn==="circle"?"50%":`${x(Math.min(lt,Ut)*exports.LOGO_ROUNDED_RADIUS)}px`},...M.plate&&{backgroundColor:M.plate,padding:`${x(lt*exports.LOGO_PLATE_INSET)}px`,boxSizing:"border-box"}}});}else j=Gr(M,{x:Kt,y:gn,w:lt,h:Ut});}let et=n/V,ht=T.length,F=7*et,Q=1.5*et,$t={fgColor:Mt(a,Pt),bgColor:Mt(r,yt)},Et=Ra(y)?Aa({art:y,modules:T,version:k.version,margin:I,pixelSize:et,...$t,body:lt=>Ua(lt,{margin:I,pixelSize:et,pattern:s,scale:w})}):null,Ue=Et&&y?Fa({art:y,version:k.version,...$t}):null,le=Et?null:Ua(T,{margin:I,pixelSize:et,pattern:s,scale:w}),Jt=W?Ua(W,{margin:0,pixelSize:et,pattern:s,scale:w,plain:true}):null,ue=Ht(r,yt),B=Ht(a,Pt),at=eo(ue)?Ha(ue,n,"bg-color"):null,Z=eo(B)?Ha(B,n,"fg-color"):null,St=Ce(r,at?.id??null,yt),Qn=Ce(a,Z?.id??null,Pt),Ci=Et?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[Et,Jt&&jsxRuntime.jsx("g",{...Qn,children:Jt})]}):jsxRuntime.jsxs("g",{...Qn,children:[le,Jt]}),sn=I*et,cn=I*et,ln=(ht-7+I)*et,un=I*et,mn=I*et,dn=(ht-7+I)*et,He=Mt(a,Pt),hn=lt=>_?.[lt]?.outer??Ue?.[lt]?.outer??i,fn=lt=>_?.[lt]?.inner??Ue?.[lt]?.inner??c,pn=(lt,Ut,Kt,gn,bn)=>{let Lo=Ht(lt,He);return eo(Lo)?Od(Lo,Ut,Kt,F,gn,bn,n):null},Mo=pn(hn("topLeft"),sn,cn,"top-left","corners-square-color-0-0"),Ro=pn(hn("topRight"),ln,un,"top-right","corners-square-color-1-0"),Eo=pn(hn("bottomLeft"),mn,dn,"bottom-left","corners-square-color-0-1"),Po=pn(fn("topLeft"),sn,cn,"top-left","corners-dot-color-0-0"),vo=pn(fn("topRight"),ln,un,"top-right","corners-dot-color-1-0"),Ao=pn(fn("bottomLeft"),mn,dn,"bottom-left","corners-dot-color-0-1"),Mi=Ce(hn("topLeft"),Mo?.id??null,He),Ri=Ce(hn("topRight"),Ro?.id??null,He),Ei=Ce(hn("bottomLeft"),Eo?.id??null,He),Pi=Ce(fn("topLeft"),Po?.id??null,He),vi=Ce(fn("topRight"),vo?.id??null,He),Ai=Ce(fn("bottomLeft"),Ao?.id??null,He),Li=Xr(sn,cn,F,l,"top-left"),Ii=Yr(sn+F/2,cn+F/2,Q,u,"top-left"),Fi=Xr(ln,un,F,l,"top-right"),Ti=Yr(ln+F/2,un+F/2,Q,u,"top-right"),ki=Xr(mn,dn,F,l,"bottom-left"),Ni=Yr(mn+F/2,dn+F/2,Q,u,"bottom-left"),du=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("defs",{children:yl([at,Z,Mo,Ro,Eo,Po,vo,Ao])}),G(n,St),Ci,jsxRuntime.jsx("g",{...Mi,children:jsxRuntime.jsx("path",{d:Li,fillRule:"evenodd",transform:P`rotate(0,${sn+F/2},${cn+F/2})`})}),jsxRuntime.jsx("g",{...Pi,children:Ii}),jsxRuntime.jsx("g",{...Ri,children:jsxRuntime.jsx("path",{d:Fi,fillRule:"evenodd",transform:P`rotate(0,${ln+F/2},${un+F/2})`})}),jsxRuntime.jsx("g",{...vi,children:Ti}),jsxRuntime.jsx("g",{...Ei,children:jsxRuntime.jsx("path",{d:ki,fillRule:"evenodd",transform:P`rotate(0,${mn+F/2},${dn+F/2})`})}),jsxRuntime.jsx("g",{...Ai,children:Ni}),j]}),Oi=f||(p?exports.getTemplate(p):void 0);if(Oi){let Ut=eo(ue)?Ha(ue,300,"bg-color-template"):null,Kt=Ce(r,Ut?.id??null,yt),gn=jsxRuntime.jsxs("svg",{height:300,viewBox:"0 0 300 300",width:300,xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("defs",{children:yl([Ut,Z,Mo,Ro,Eo,Po,vo,Ao])}),G(300,Kt),jsxRuntime.jsxs("g",{transform:`scale(${x(300/n,6)})`,children:[Ci,jsxRuntime.jsx("g",{...Mi,children:jsxRuntime.jsx("path",{d:Li,fillRule:"evenodd",transform:P`rotate(0,${sn+F/2},${cn+F/2})`})}),jsxRuntime.jsx("g",{...Pi,children:Ii}),jsxRuntime.jsx("g",{...Ri,children:jsxRuntime.jsx("path",{d:Fi,fillRule:"evenodd",transform:P`rotate(0,${ln+F/2},${un+F/2})`})}),jsxRuntime.jsx("g",{...vi,children:Ti}),jsxRuntime.jsx("g",{...Ei,children:jsxRuntime.jsx("path",{d:ki,fillRule:"evenodd",transform:P`rotate(0,${mn+F/2},${dn+F/2})`})}),jsxRuntime.jsx("g",{...Ai,children:Ni}),j]})]}),bn=300/n,hu={pixelSize:et*bn,url:e},Di=Oi.wrapper(gn,{fgColor:a,bgColor:r,...g||{},...C},hu),fu={...Di?.props?.style||{},width:void 0,height:void 0,...E.style};return A(Sm__default.default.cloneElement(Di,{...E,width:n,height:n,style:fu}))}return A(jsxRuntime.jsx("svg",{height:n,viewBox:`0 0 ${n} ${n}`,width:n,xmlns:"http://www.w3.org/2000/svg",...E,children:du}))}var Ld,kd,Nd,wl,eo;exports.SUPPORTS_PATH2D=void 0;exports.hexToRgb=void 0;exports.getLuminance=void 0;var _l;exports.getContrastRatio=void 0;exports.getContrastLevel=void 0;var Re=z(()=>{"use strict";Fn();$e();Ta();Na();me();vt();Qc();Yc();ye();qr();Dn();Ke();ae();qa();pe();ft();to();Dt();pe();Ld=.9;kd=["xMin","xMid","xMax"],Nd=["YMin","YMid","YMax"];wl=(t,e)=>Va("img",[t,e]);eo=t=>In(t)||na(t);exports.SUPPORTS_PATH2D=(()=>{try{new Path2D().addPath(new Path2D);}catch{return !1}return !0})(),exports.hexToRgb=t=>{let e=t.trim().replace(/^#/,"");e.length===3||e.length===4?e=e.slice(0,3).split("").map(o=>o+o).join(""):e.length===8&&(e=e.slice(0,6));let n=/^([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return n?{r:Number.parseInt(n[1],16),g:Number.parseInt(n[2],16),b:Number.parseInt(n[3],16)}:null},exports.getLuminance=(t,e,n)=>{let[o,r,a]=[t,e,n].map(i=>(i/=255,i<=.03928?i/12.92:((i+.055)/1.055)**2.4));return .2126*o+.7152*r+.0722*a},_l=t=>{let e=mt(t);if(!e)return null;let n=o=>o*e.a+255*(1-e.a);return {r:n(e.r),g:n(e.g),b:n(e.b)}},exports.getContrastRatio=(t,e)=>{let n=_l(t),o=_l(e);if(!(n&&o))return 1;let r=exports.getLuminance(n.r,n.g,n.b),a=exports.getLuminance(o.r,o.g,o.b),i=Math.max(r,a),c=Math.min(r,a);return (i+.05)/(c+.05)},exports.getContrastLevel=t=>t>=7?{level:"AAA",warning:!1,message:"Excellent contrast"}:t>=4.5?{level:"AA",warning:!1,message:"Good contrast"}:t>=3?{level:"AA Large",warning:!0,message:"Low contrast - may be difficult to scan"}:{level:"Fail",warning:!0,message:"Poor contrast - QR code may not scan properly"};});function El(t){let e=wt.QrCode.encodeText(t.value,Lt[t.level]),n=Qd[e.errorCorrectionLevel.ordinal]??t.level;return {code:t,cells:e.getModules(),layoutMargin:Tt(e.size,t.margin,t.shape),map:Kn(e.version,n),level:n,version:e.version}}function Pl(t,e){let{cells:n,map:o}=t,r=n.length,a=Me(n,t.code.size,t.layoutMargin,e);if(!a)return null;let i=a.excavation??{x:Math.floor(a.x),y:Math.floor(a.y),w:Math.ceil(a.x+a.w)-Math.floor(a.x),h:Math.ceil(a.y+a.h)-Math.floor(a.y)},c=[];for(let l=Math.max(0,i.y);l<Math.min(r,i.y+i.h);l++)for(let u=Math.max(0,i.x);u<Math.min(r,i.x+i.w);u++)c.push(l*r+u);let s=tr(o,c);return {worst:Math.max(0,...s),correctable:o.correctable,budget:Math.floor(o.correctable*exports.LOGO_EC_SAFETY),level:t.level,version:t.version}}function ao(t,e){return Pl(El(t),e)}function zd(t,e){return vl(ao(t,e))}function Xa(t,e,n,o){let r=e.map(c=>El({...t,level:c})),a=c=>{let s=o(c);return r.every(l=>vl(Pl(l,s)))};if(a(n))return n;let i=t.size*.005;for(let c=n-i;c>0;c-=i)if(a(c))return c;return 0}function oo(t,e){if(!e)return;let n=Math.floor(t.size*ur),o=e.width||n,r=e.height||n,a=h=>{if(h===o)return e;let d=r*h/o;return {...e,width:h,height:d,...e.x!=null&&{x:e.x+(o-h)/2},...e.y!=null&&{y:e.y+(r-d)/2}}},i=t.level??te,c={value:t.value,size:t.size,margin:t.margin,shape:t.shape},s=h=>Bt({...t,level:i,imageSettings:h}),l=h=>{let d=Xa(c,[h],o,a);return d>0?a(d):void 0},u=s(e);if(u===i)return l(i);let m=l(u);return m&&s(m)===u?m:l(i)}exports.LOGO_EC_SAFETY=void 0;var Qd,vl,Dn=z(()=>{"use strict";me();Qr();vt();Ke();Re();exports.LOGO_EC_SAFETY=.6,Qd=["L","M","Q","H"];vl=t=>!t||t.worst<=t.budget;});vt();ye();vt();pe();Lr();Fn();var Lm=zod.z.object({x:zod.z.number(),y:zod.z.number(),w:zod.z.number(),h:zod.z.number()});aa();ca();zn();Cn();ua();$e();var Om=zod.z.object({fgColor:zod.z.string().optional(),bgColor:zod.z.string().optional()}),Dm=zod.z.object({pixelSize:zod.z.number(),url:zod.z.string()}),Bm=zod.z.object({id:zod.z.string(),name:zod.z.string(),description:zod.z.string().optional()});me();vt();ye();qr();Dn();Re();pe();async function Cb(t){let{value:e,size:n=bt,level:o=te,bgColor:r=yt,fgColor:a=Pt,margin:i=exports.DEFAULT_MARGIN,imageSettings:c,eyeColor:s,dotColor:l,bodyPattern:u,cornerEyePattern:m,cornerEyeDotPattern:h,isOGContext:d,templateId:p,customTemplate:f,customProps:g,frame:b,art:y,eyeColors:_,moduleScale:w,frameLabelMarkers:R,autoLevel:S,...$}=t,C=oo({value:e,size:n,margin:i,level:o,autoLevel:S},c),M=Bt({value:e,size:n,level:o,margin:i,imageSettings:C,autoLevel:S}),v=wt.QrCode.encodeText(e,Lt[M]).getModules(),E=v.length+i*2,A=Me(v,n,i,C),L=jsxRuntime.jsx(jsxRuntime.Fragment,{});if(C!=null&&A!=null){A.excavation!=null&&(v=ro(v,A.excavation));let W=C.src.startsWith("data:")?C.src:await fetch(`https://wsrv.nl/?url=${encodeURIComponent(C.src)}&w=100&h=100&encoding=base64`).then(G=>{if(!G.ok)throw new Error(`Failed to load QR logo (${G.status}): ${C.src}`);return G.text()});L=Gr({...C,src:W},{x:A.x+i,y:A.y+i,w:A.w,h:A.h});}let k=Wa(v,i),T=zt(b),I=jsxRuntime.jsxs("svg",{height:n,viewBox:`0 0 ${E} ${E}`,width:n,xmlns:"http://www.w3.org/2000/svg",...T?{}:$,children:[jsxRuntime.jsx("path",{d:`M0,0 h${E}v${E}H0z`,fill:Mt(r,yt),shapeRendering:"crispEdges"}),jsxRuntime.jsx("path",{d:k,fill:Mt(a,Pt),shapeRendering:"crispEdges"}),L]});return T?Ar(I,{size:n,frame:b,bgColor:r,svgProps:$}):I}Ta();Na();var Eb=(t,e,n,o)=>{let r=document.createElement("canvas");r.width=e,r.height=n;let a=r.getContext("2d");if(!a)return;a.putImageData(t,0,0);let i=r.toDataURL("image/png"),c=document.createElement("a");c.href=i,c.download=o,document.body.appendChild(c),c.click(),document.body.removeChild(c);},Wd=async(t,e,n,o)=>{let{default:r}=await import('jsqr');return new Promise(a=>{t.complete?i():(t.onload=()=>i(),t.onerror=()=>a(null));function i(){let c=document.createElement("canvas");requestAnimationFrame(()=>{if(!(t.naturalWidth&&t.naturalHeight)){a(null);return}let s=t.naturalWidth/t.naturalHeight<=.33||t.naturalWidth/t.naturalHeight>=3?Math.sqrt(t.naturalWidth*t.naturalHeight/12e5):t.naturalWidth/t.naturalHeight<=.5||t.naturalWidth/t.naturalHeight>=2?Math.sqrt(t.naturalWidth*t.naturalHeight/9e5):Math.sqrt(t.naturalWidth*t.naturalHeight/64e4),l=c.getContext("2d",{willReadFrequently:true});if(!l){a(null);return}let u=[1,.8,.6,.4,.2,.1];for(let m of u){let h=Math.floor(t.naturalWidth*e*m/s),d=Math.floor(t.naturalHeight*e*m/s);c.width=h,c.height=d,l.clearRect(0,0,h,d),l.imageSmoothingEnabled=true,l.imageSmoothingQuality="high";try{l.drawImage(t,Math.floor(n),Math.floor(o),Math.floor(t.naturalWidth*e),Math.floor(t.naturalHeight*e),0,0,h,d);let p=l.getImageData(0,0,h,d);try{let f=r(p.data,h,d);if(f?.data){a(f);return}}catch(f){console.error("QR Detection error:",f);}}catch(p){console.error("Canvas drawing error:",p);}}a(null);});}})},Al=async(t,e,n=false)=>{if(!t)return "NO_QR";await new Promise(r=>setTimeout(r,100));let o=[{dx:0,dy:0,ratio:1},{dx:0,dy:t.naturalHeight*.35,ratio:.65},{dx:t.naturalWidth*.35,dy:t.naturalHeight*.35,ratio:.65},{dx:t.naturalWidth*.35,dy:0,ratio:.65},{dx:t.naturalWidth*.35/2,dy:t.naturalHeight*.35/2,ratio:.65}];for(let r of o)try{let a=await Wd(t,r.ratio,r.dx,r.dy);if(a?.data)return n?a:a.data}catch(a){console.warn("QR decode error:",a);}return "NO_QR"};function Pb(t,e,n){if(!(t&&e)||e.length!==4)return;let o=document.createElement("canvas");o.width=t.naturalWidth,o.height=t.naturalHeight;let r=o.getContext("2d");if(!r)return;r.drawImage(t,0,0),r.save(),r.strokeStyle="#ff0000",r.lineWidth=Math.max(5,Math.min(t.naturalWidth,t.naturalHeight)/200),r.shadowColor="transparent",r.shadowBlur=0,r.beginPath(),r.moveTo(e[0].x,e[0].y),r.lineTo(e[1].x,e[1].y),r.lineTo(e[3].x,e[3].y),r.lineTo(e[2].x,e[2].y),r.closePath(),r.stroke(),r.fillStyle="#ff0000",e.forEach((c,s)=>{r.fillRect(c.x-3,c.y-3,6,6),r.fillStyle="#ffffff",r.font="16px Arial",r.fillText(`${s}`,c.x+5,c.y-5),r.fillStyle="#ff0000";}),r.restore();let a=o.toDataURL("image/png"),i=document.createElement("a");i.href=a,i.download=n,document.body.appendChild(i),i.click(),document.body.removeChild(i);}vt();vt();me();vt();ye();Ke();Re();ft();Dt();Fn();vt();ye();pe();to();Dt();he();to();Dt();he();ft();Dt();he();var Ll=["gradientUnits","gradientTransform","spreadMethod"],Vd={linear:["x1","y1","x2","y2"],radial:["cx","cy","r","fx","fy","fr"]},Yd={r:0,g:0,b:0,a:1};function Il(t,e){for(let n of (t.attrs.style??"").split(";")){let[o,...r]=n.split(":");if(o?.trim()===e)return r.join(":").trim()}return t.attrs[e]}function Za(t){return t.name==="linearGradient"?"linear":t.name==="radialGradient"?"radial":null}function Xd(t){let e=[],n=0;for(let o of t.children){if(o.name!=="stop")continue;let r=(o.attrs.offset??"0").trim(),a=Number.parseFloat(r),i=Number.isFinite(a)?r.endsWith("%")?a/100:a:0;n=Math.max(n,Math.min(Math.max(i,0),1));let c=Il(o,"stop-color")??"#000000",s=mt(c==="currentColor"?"#000000":c)??Yd,l=Number.parseFloat(Il(o,"stop-opacity")??"1");e.push({offset:n,color:Number.isFinite(l)?{...s,a:s.a*Math.min(Math.max(l,0),1)}:s});}return e}function io(t){let e=new Map,n=r=>{let a=r.attrs.id;Za(r)&&a&&!e.has(a)&&e.set(a,r);for(let i of r.children)n(i);};n(t);let o=new Map;for(let[r,a]of e){let i=Za(a),c={},s=[],l=new Set,u=a;for(;u&&!l.has(u);){l.add(u);let m=Za(u)===i?[...Ll,...Vd[i]]:Ll;for(let d of m){let p=u.attrs[d];c[d]===void 0&&p!==void 0&&(c[d]=p);}s.length===0&&(s=Xd(u));let h=u.attrs.href??u.attrs["xlink:href"];u=h?.startsWith("#")?e.get(h.slice(1)):void 0;}o.set(r,{kind:i,attrs:c,stops:s});}return o}function Ja(t){let e=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,r=Number.NEGATIVE_INFINITY,a=(m,h)=>{e=Math.min(e,m),o=Math.max(o,m),n=Math.min(n,h),r=Math.max(r,h);},i=(m,h,d,p)=>{let f=-m+3*h-3*d+p,g=2*(m-2*h+d),b=h-m;if(Math.abs(f)<1e-12)return Math.abs(g)<1e-12?[]:[-b/g];let y=g*g-4*f*b;if(y<0)return [];let _=Math.sqrt(y);return [(-g+_)/(2*f),(-g-_)/(2*f)]},c=(m,h,d,p,f)=>{let g=1-m;return g*g*g*h+3*g*g*m*d+3*g*m*m*p+m**3*f},s=0,l=0,u=[0,0];for(let m of t)if(m.op==="M"&&(u=[m.x,m.y]),m.op==="M"||m.op==="L")a(m.x,m.y),s=m.x,l=m.y;else if(m.op==="C"){a(m.x,m.y);for(let h of [...i(s,m.x1,m.x2,m.x),...i(l,m.y1,m.y2,m.y)])h>0&&h<1&&a(c(h,s,m.x1,m.x2,m.x),c(h,l,m.y1,m.y2,m.y));s=m.x,l=m.y;}else [s,l]=u;return Number.isFinite(e)?{x:e,y:n,width:o-e,height:r-n}:null}var jd=t=>t[0]*t[3]-t[1]*t[2];function Ge(t){let e=jd(t);if(!Number.isFinite(e)||Math.abs(e)<1e-12)return null;let[n,o,r,a,i,c]=t;return [a/e,-o/e,-r/e,n/e,(r*c-a*i)/e,(o*i-n*c)/e]}function Tl(t,e,n){let{kind:o,attrs:r,stops:a}=t,i=a[0],c=a.at(-1);if(!(i&&c)||a.every(S=>S.color.a===0))return null;if(a.length===1)return i.color;let s=r.gradientUnits==="userSpaceOnUse",l=gr;if(!s){let S=Ja(e);if(!S||S.width<=0||S.height<=0)return null;l=[S.width,0,0,S.height,S.x,S.y];}let u=pt(l,ne(r.gradientTransform));if(!Ge(u))return c.color;let[m,h]=n,d=Math.sqrt((m*m+h*h)/2),p=(S,$)=>{let C=Number.parseFloat(S);return Number.isFinite(C)?S.trim().endsWith("%")?C/100*(s?$:1):C:null},f=(S,$,C)=>p(r[S]??$,C)??p($,C)??0;if(o==="linear"){let S=[f("x1","0%",m),f("y1","0%",h),f("x2","100%",m),f("y2","0%",h)],[$,C,M,v]=S;return $===M&&C===v?c.color:{kind:o,coords:S,matrix:u,stops:a}}let g=f("cx","50%",m),b=f("cy","50%",h),y=f("r","50%",d),_=r.fx===void 0?g:f("fx","50%",m),w=r.fy===void 0?b:f("fy","50%",h),R=Math.max(0,f("fr","0%",d));return y<0?null:y===0?c.color:{kind:o,coords:[_,w,R,g,b,y],matrix:u,stops:a}}function so(t){return t.map(e=>x(e,6)).join(" ")}function Zd(t,e){return (e==="cmyk"?Te(t.r,t.g,t.b):[t.r/255,t.g/255,t.b/255]).map(o=>x(o,4)).join(" ")}var Fl=(t,e)=>`<< /FunctionType 2 /Domain [0 1] /C0 [${t}] /C1 [${e}] /N 1 >>`;function Jd(t,e){let n=[],o=t.map(c=>it(c.offset,4)),r=t.map(c=>Zd(c.color,e)),a=o[0],i=o.at(-1);if(a>0){let c=r[0];n.push({from:0,to:a,c0:c,c1:c});}for(let c=0;c+1<t.length;c++){let s=o[c],l=o[c+1];l>s&&n.push({from:s,to:l,c0:r[c],c1:r[c+1]});}if(i<1){let c=r.at(-1);n.push({from:i,to:1,c0:c,c1:c});}if(n.length===1){let[c]=n;return Fl(c.c0,c.c1)}return ["<< /FunctionType 3 /Domain [0 1]",`/Functions [${n.map(c=>Fl(c.c0,c.c1)).join(" ")}]`,`/Bounds [${n.slice(1).map(c=>x(c.from,4)).join(" ")}]`,`/Encode [${n.map(()=>"0 1").join(" ")}] >>`].join(" ")}function co(t,e){return [`<< /ShadingType ${t.kind==="linear"?2:3}`,`/ColorSpace /Device${e==="cmyk"?"CMYK":"RGB"}`,`/Coords [${t.coords.map(n=>x(n,6)).join(" ")}]`,`/Function ${Jd(t.stops,e)}`,"/Extend [true true] >>"].join(" ")}function Kd(t,e){if(t.op==="Z")return t;if(t.op==="C"){let[r,a]=Y(e,t.x1,t.y1),[i,c]=Y(e,t.x2,t.y2),[s,l]=Y(e,t.x,t.y);return {op:"C",x1:r,y1:a,x2:i,y2:c,x:s,y:l}}let[n,o]=Y(e,t.x,t.y);return {op:t.op,x:n,y:o}}var kl={r:255,g:255,b:255,a:1},th=/^url\(\s*#bg-color-/,lo=/^url\(\s*#([^)\s]+)\s*\)/,eh=new Set(["defs","clipPath","mask","pattern","linearGradient","radialGradient","symbol","title","desc","metadata","style","script","use","foreignObject"]);function K(t,e){let n=t.attrs.style;if(n)for(let o of n.split(";")){let[r,...a]=o.split(":");if(r?.trim()===e)return a.join(":").trim()}return t.attrs[e]}function X(t,e,n=0){if(t===void 0||t==="")return n;let o=Number.parseFloat(t);return Number.isNaN(o)?n:t.trim().endsWith("%")?o/100*e:o}function or(t,e){if((t.name==="linearGradient"||t.name==="radialGradient")&&t.attrs.id){let n=t.children.find(r=>r.name==="stop"),o=n&&(K(n,"stop-color")??"#000000");o&&e.set(t.attrs.id,o);}for(let n of t.children)or(n,e);return e}function ar(t,e){if(t.name==="image"){let n=t.attrs.href??t.attrs["xlink:href"];n&&e.add(n);}for(let n of t.children)ar(n,e);return e}function uo(t){return /^data:image\/png[;,]/i.test(t)?"PNG":/^data:image\/jpe?g[;,]/i.test(t)?"JPEG":null}async function mo(t){return typeof document>"u"||typeof Image>"u"?null:await new Promise(e=>{let n=new Image;n.crossOrigin="anonymous",n.onload=()=>{let o=document.createElement("canvas"),r=Math.max(n.naturalWidth||512,n.naturalHeight||512),a=Math.min(1024/r,4);o.width=Math.round((n.naturalWidth||512)*a),o.height=Math.round((n.naturalHeight||512)*a);let i=o.getContext("2d");if(!i){e(null);return}i.drawImage(n,0,0,o.width,o.height);try{e(o.toDataURL("image/png"));}catch{e(null);}},n.onerror=()=>e(null),n.src=t;})}function Nl(t,e,n){let o={x:X(t.attrs.x,e[0]),y:X(t.attrs.y,e[1]),width:X(t.attrs.width,e[0]),height:X(t.attrs.height,e[1])};if(o.width<=0||o.height<=0)return null;let r=(t.attrs.preserveAspectRatio??"").trim();if(!r||r.startsWith("none")||!n||!(n.width>0&&n.height>0))return {draw:o,clip:null};let[a="xMidYMid",i="meet"]=r.split(/\s+/),c=i==="slice",s=(c?Math.max:Math.min)(o.width/n.width,o.height/n.height),l=n.width*s,u=n.height*s,m=h=>{let d=h==="x"?a.slice(0,4):a.slice(4);return d.endsWith("Min")?0:d.endsWith("Max")?1:.5};return {draw:{x:o.x+(o.width-l)*m("x"),y:o.y+(o.height-u)*m("y"),width:l,height:u},clip:c?o:null}}function Ol(t,e){t.name==="clipPath"&&t.attrs.id&&e.set(t.attrs.id,t);for(let n of t.children)Ol(n,e);return e}function Dl(t,e){t.name==="pattern"&&t.attrs.id&&e.set(t.attrs.id,t);for(let n of t.children)Dl(n,e);return e}function nh(t,e){let[n,o]=e,r=(a,i)=>X(t.attrs[a],i);switch(t.name){case "path":return de(t.attrs.d??"");case "rect":{let a=t.attrs.rx??t.attrs.ry,i=t.attrs.ry??t.attrs.rx;return oe(r("x",n),r("y",o),r("width",n),r("height",o),X(a,n),X(i,o))}case "circle":{let a=r("r",Math.hypot(n,o)/Math.SQRT2);return re(r("cx",n),r("cy",o),a,a)}case "ellipse":return re(r("cx",n),r("cy",o),r("rx",n),r("ry",o));default:return []}}var Bn=class{gradients;shadings;clipPaths=new Map;patterns=new Map;backdrop=kl;paper=kl;background=null;onPaper=false;inConic=false;constructor(e,n=null){this.gradients=e,this.shadings=n;}resolveColor(e){if(!e||e==="none")return null;let n=lo.exec(e);if(n)return this.resolveColor(this.gradients.get(n[1]));let o=mt(e==="currentColor"?"#000000":e);return o&&o.a>0?o:null}shadedGradient(e){let n=e?lo.exec(e)?.[1]:void 0;return n?this.shadings?.get(n):void 0}resolveFill(e,n,o,r=1){if(r<=0)return null;let a=this.patternOf(e);if(a)return {pattern:a,alpha:r};let i=this.shadedGradient(e);if(i){let l=Tl(i,n,o);if(!l)return null;if("coords"in l)return {gradient:l,alpha:r};let u={...l,a:l.a*r};return u.a>0?{color:u}:null}let c=this.resolveColor(e);if(!c)return null;let s={...c,a:c.a*r};return s.a>0?{color:s}:null}patternOf(e){let n=e?lo.exec(e)?.[1]:void 0,o=n?this.patterns.get(n):void 0;if(!(o?.attrs.patternUnits!=="userSpaceOnUse"||(o.attrs.patternContentUnits??"userSpaceOnUse")!=="userSpaceOnUse"||o.attrs.viewBox))return o}flatten(e){if(e.a>=1)return e;let n=this.background,o=n!==null&&Math.abs(n.r-e.r)<.5&&Math.abs(n.g-e.g)<.5&&Math.abs(n.b-e.b)<.5&&Math.abs(n.a-e.a)<.002;return Kr(e,this.onPaper||o?this.paper:this.backdrop)}paintPattern(e,n,o,r){let a=Ja(e);if(!a||a.width<=0||a.height<=0)return true;let[i,c]=n.viewport,s=X(o.attrs.x,i),l=X(o.attrs.y,c),u=X(o.attrs.width,i),m=X(o.attrs.height,c);if(!(u>0&&m>0))return true;let h=ne(o.attrs.patternTransform),d=Ge(h);if(!d)return true;if(!this.beginClip(e,n.matrix,n.fillRule==="evenodd"))return false;let p=this.inConic;this.inConic=o.attrs["data-qrdx-conic"]!==void 0;try{let f=[Y(d,a.x,a.y),Y(d,a.x+a.width,a.y),Y(d,a.x,a.y+a.height),Y(d,a.x+a.width,a.y+a.height)],g=f.map(([L])=>L),b=f.map(([,L])=>L),y=Math.min(...g),_=Math.max(...g),w=Math.min(...b),R=Math.max(...b),S=Math.floor((y-s)/u),$=Math.ceil((_-s)/u)-1,C=Math.floor((w-l)/m),M=Math.ceil((R-l)/m)-1,v=($-S+1)*(M-C+1);if(v>4096)return !0;let E=(o.attrs["data-qrdx-conic"]??"").trim().split(/\s+/).map(Number),A=pt(n.matrix,h);for(let L=C;L<=M;L++)for(let k=S;k<=$;k++){let T=s+k*u,I=l+L*m,W=pt(A,[1,0,0,1,T,I]),G={x:y-T,y:w-I,width:_-y,height:R-w},V=E.length===2&&E.every(Number.isFinite)?gl(E[0],E[1],G):null,q=v>1&&this.beginClip([{op:"M",x:0,y:0},{op:"L",x:u,y:0},{op:"L",x:u,y:m},{op:"L",x:0,y:m},{op:"Z"}],W,!1);try{let j={matrix:W,viewport:n.viewport,fill:"#000000",fillRule:"nonzero",stroke:"none",strokeWidth:1,fontSize:16,fontWeight:"normal",textAnchor:"start",fillOpacity:1,opacity:r},et=(ht,F)=>{for(let Q of ht){if(Q.name==="g"&&!Q.attrs.transform){let $t=Number.parseFloat(Q.attrs.opacity??"1");et(Q.children,{...F,opacity:(F.opacity??1)*(Number.isFinite($t)?$t:1)});continue}if(V&&Q.attrs["data-arc"]){let[$t,Et]=Q.attrs["data-arc"].split(/\s+/).map(Number);if(!bl([$t,$t+Et],V))continue}this.walk(Q,F);}};et(o.children,j);}finally{q&&this.endClip();}}}finally{this.inConic=p,this.endClip();}return true}paintBleed(e,n,o,r){if(!this.shadedGradient(o))return false;let[a,i]=this.viewportMatrix({...e,attrs:{...e.attrs,x:"0",y:"0"}},{...n,matrix:pt(n.matrix,ne(e.attrs.transform))}),c=Ge(a);if(!c)return false;let[s,l,u,m]=r,d=[[s,l],[u,l],[u,m],[s,m]].map(([p,f])=>Y(c,p,f)).map(([p,f],g)=>({op:g===0?"M":"L",x:p,y:f}));return d.push({op:"Z"}),this.paint(d,{name:"rect",attrs:{},children:[],text:""},{...n,matrix:a,viewport:i,fill:o,fillRule:"nonzero",stroke:"none"}),true}beginClip(e,n,o){return false}endClip(){}clipOf(e,n){let o=K(e,"clip-path"),r=o?lo.exec(o)?.[1]:void 0,a=r?this.clipPaths.get(r):void 0;if(!a)return null;let i=[],c=false;for(let s of a.children){let l=nh(s,n.viewport);if(l.length===0)continue;let u=ne(s.attrs.transform),m=u[0]===1&&u[1]===0&&u[2]===0&&u[3]===1&&u[4]===0&&u[5]===0;i.push(...m?l:l.map(h=>Kd(h,u))),c||=K(s,"clip-rule")==="evenodd";}return i.length>0?{segments:i,matrix:n.matrix,evenOdd:c}:null}viewportMatrix(e,n){let o=X(e.attrs.x,n.viewport[0]),r=X(e.attrs.y,n.viewport[1]),a=X(e.attrs.width,n.viewport[0],n.viewport[0]),i=X(e.attrs.height,n.viewport[1],n.viewport[1]),c=Ve(e.attrs.viewBox);if(c.length!==4||!(c[2]&&c[3]))return [pt(n.matrix,[1,0,0,1,o,r]),[a,i]];let[s,l,u,m]=c,h=a/u,d=i/m,p=o,f=r;if((e.attrs.preserveAspectRatio??"").trim()!=="none"){let g=e.attrs.preserveAspectRatio?.includes("slice")?Math.max(h,d):Math.min(h,d);p+=(a-u*g)/2,f+=(i-m*g)/2,h=g,d=g;}return [pt(n.matrix,[h,0,0,d,p-s*h,f-l*d]),[u,m]]}walk(e,n,o=false){if(o&&(this.clipPaths=Ol(e,new Map),this.patterns=Dl(e,new Map)),eh.has(e.name)||K(e,"display")==="none"||K(e,"visibility")==="hidden")return;let r=pt(n.matrix,ne(e.attrs.transform)),a=n.viewport;if(e.name==="svg"){let[h,d]=this.viewportMatrix(o?{...e,attrs:{...e.attrs,x:"0",y:"0"}}:e,{...n,matrix:r});r=h,a=d;}let i=K(e,"font-size"),c=Number.parseFloat(K(e,"opacity")??"1"),s=K(e,"fill-opacity"),l=s===void 0?n.fillOpacity??1:Number.parseFloat(s),u={fillOpacity:Number.isFinite(l)?Math.min(Math.max(l,0),1):1,opacity:(n.opacity??1)*(Number.isFinite(c)?Math.min(Math.max(c,0),1):1),matrix:r,viewport:a,fill:K(e,"fill")??n.fill,fillRule:K(e,"fill-rule")??n.fillRule,stroke:K(e,"stroke")??n.stroke,strokeWidth:K(e,"stroke-width")===void 0?n.strokeWidth:X(K(e,"stroke-width"),a[0],1),fontSize:i===void 0?n.fontSize:X(i,16,16),fontWeight:K(e,"font-weight")??n.fontWeight,textAnchor:K(e,"text-anchor")??n.textAnchor},m=this.onPaper;(e.name==="rect"||e.name==="circle"||e.name==="path")&&th.test(K(e,"fill")??"")&&(this.onPaper=true);try{let h=e.attrs["clip-path"]?this.clipOf(e,u):null;if(h&&this.beginClip(h.segments,h.matrix,h.evenOdd)){try{this.paintNode(e,u);}finally{this.endClip();}return}this.paintNode(e,u);}finally{this.onPaper=m;}}paintNode(e,n){let[o,r]=n.viewport,a=(i,c)=>X(e.attrs[i],c);switch(e.name){case "path":this.paint(de(e.attrs.d??""),e,n);return;case "rect":{let i=e.attrs.rx??e.attrs.ry,c=e.attrs.ry??e.attrs.rx;this.paint(oe(a("x",o),a("y",r),a("width",o),a("height",r),X(i,o),X(c,r)),e,n);return}case "circle":{let i=a("r",Math.hypot(o,r)/Math.SQRT2);this.paint(re(a("cx",o),a("cy",r),i,i),e,n);return}case "ellipse":this.paint(re(a("cx",o),a("cy",r),a("rx",o),a("ry",r)),e,n);return;case "line":this.paint([{op:"M",x:a("x1",o),y:a("y1",r)},{op:"L",x:a("x2",o),y:a("y2",r)}],e,{...n,fill:"none"});return;case "polygon":case "polyline":{let i=Ve(e.attrs.points),c=[];for(let s=0;s+1<i.length;s+=2)c.push({op:s===0?"M":"L",x:i[s],y:i[s+1]});e.name==="polygon"&&c.length>0&&c.push({op:"Z"}),this.paint(c,e,n);return}case "text":this.text(e,n);return;case "image":this.image(e,n);return;default:for(let i of e.children)this.walk(i,n);}}};var ho=1e3;async function ir(t){let e=await ce(an({...t,size:t.size??bt},ho));return decodeURIComponent(e.replace("data:image/svg+xml,",""))}function Ka(t){if(zt(t.frame)){let e=je(ho,t.frame);return e.squareEdges?e.color:null}return Mt(t.bgColor,yt)}function fo(t,e){let n=Ka(t);if(!(n&&In(t.bgColor))||zt(t.frame)||t.templateId||t.customTemplate)return n;let o=Le(e)?.children.find(a=>a.name==="rect"),r=o&&K(o,"fill");return r?.startsWith("url(")?r:n}function po(t,e){let n={r:255,g:255,b:255,a:1},o=mt(Mt(e.bgColor,yt));t.paper=n,t.background=o&&!In(e.bgColor)?o:null,t.backdrop=o?Kr(o,n):n;}he();Dt();var go=25.4,Bl=5,Gl=2e3,Ee=ho,ti=5,ql=2,oh=.25*(go/72);function ah(t,e="mm"){return e==="in"?t*go:t}function ih(t){let e=Bt(t),n=wt.QrCode.encodeText(t.value,Lt[e]).size;return n+Tt(n,t.margin??exports.DEFAULT_MARGIN,t.shape)*2}function bo(t,e){let n=ah(e.size,e.unit);if(!Number.isFinite(n)||n<Bl||n>Gl)throw new Error(`Print size must be between ${Bl} mm and ${Gl/1e3} m`);let o=Math.min(Math.max(e.bleed??0,0),20),r=n/Ee,a=zt(t.frame)?je(Ee,t.frame):null,i=(a?.width??Ee)*r,c=(a?.height??Ee)*r,s=e.cropMarks?o+ql+ti+1:o,l=ih(t);return {codeWidth:n,trimWidth:i,trimHeight:c,bleed:o,pageWidth:i+2*s,pageHeight:c+2*s,trimX:s,trimY:s,moduleSize:n/l,moduleCount:l,maxScanDistance:n*10}}var ei=class t{pdf;internals;names=new Map;constructor(e,n){this.pdf=e,this.internals=n;}static attach(e){let n=e.internal;return typeof e.advancedAPI!="function"||typeof e.addShadingPattern!="function"||typeof n.write!="function"||typeof n.events?.subscribe!="function"?null:new t(e,n)}name(e){let n=this.names.get(e);return n||(this.names.size===0&&this.install(),n=`Sh${this.names.size}`,this.names.set(e,n)),n}install(){this.pdf.advancedAPI(e=>{e.addShadingPattern("qrdx-shadings",{});}),this.internals.events.subscribe("putShadingPatternDict",()=>{for(let[e,n]of this.names)this.internals.write(`/${n} ${e}`);});}},ni=class extends Bn{pdf;cmyk;images;shadingResources;constructor(e,n,o,r,a){super(o,r?.gradients??null),this.pdf=e,this.cmyk=n,this.images=a,this.shadingResources=r?.resources??null;}setColor(e,n){let o=e==="fill"?this.pdf.setFillColor.bind(this.pdf):e==="draw"?this.pdf.setDrawColor.bind(this.pdf):this.pdf.setTextColor.bind(this.pdf);if(this.cmyk){let[r,a,i,c]=Te(n.r,n.g,n.b);o(r,a,i,c);}else o(Math.round(n.r),Math.round(n.g),Math.round(n.b));}setRegistrationColor(){this.cmyk?this.pdf.setDrawColor(1,1,1,1):this.pdf.setDrawColor(0,0,0);}tracePath(e,n){let o=false;for(let r of e)if(r.op==="M"){let[a,i]=Y(n,r.x,r.y);this.pdf.moveTo(a,i),o=true;}else if(r.op==="L"){let[a,i]=Y(n,r.x,r.y);o?this.pdf.lineTo(a,i):(this.pdf.moveTo(a,i),o=true);}else if(r.op==="C"){let[a,i]=Y(n,r.x1,r.y1),[c,s]=Y(n,r.x2,r.y2),[l,u]=Y(n,r.x,r.y);this.pdf.curveTo(a,i,c,s,l,u);}else o&&this.pdf.close();}shade(e,n,o){let r=this.pdf.internal,a=r.scaleFactor,i=[a,0,0,-a,0,r.pageSize.getHeight()*a],c=pt(i,pt(n.matrix,o.matrix));if(!(this.shadingResources&&Ge(c)))return;let s=this.shadingResources.name(co(o,this.cmyk?"cmyk":"rgb"));this.pdf.saveGraphicsState(),this.tracePath(e,n.matrix),this.pdf.clip(n.fillRule==="evenodd"?"evenodd":void 0),this.pdf.discardPath(),r.write(`${so(c)} cm /${s} sh`),this.pdf.restoreGraphicsState();}beginClip(e,n,o){return this.pdf.saveGraphicsState(),this.tracePath(e,n),this.pdf.clip(o?"evenodd":void 0),this.pdf.discardPath(),true}endClip(){this.pdf.restoreGraphicsState();}withAlpha(e,n,o){if(e>=1&&n>=1){o();return}this.pdf.saveGraphicsState();let r=this.pdf.GState;this.pdf.setGState(new r({opacity:e,"stroke-opacity":n}));try{o();}finally{this.pdf.restoreGraphicsState();}}opaqueGradient(e,n){let o=e.stops[0]?.color.a??1;return e.stops.every(a=>Math.abs(a.color.a-o)<.002)?{gradient:{...e,stops:e.stops.map(a=>({...a,color:{...a.color,a:1}}))},alpha:o*n}:{gradient:{...e,stops:e.stops.map(a=>({...a,color:this.flatten({...a.color,a:a.color.a*n})}))},alpha:1}}paint(e,n,o){if(e.length===0)return;let r=o.opacity??1;if(r<=0)return;let a=this.resolveFill(o.fill,e,o.viewport,(o.fillOpacity??1)*r);if(a&&"pattern"in a)this.paintPattern(e,o,a.pattern,a.alpha);else if(a&&"gradient"in a){let{gradient:m,alpha:h}=this.opaqueGradient(a.gradient,a.alpha);this.withAlpha(h,1,()=>this.shade(e,o,m));}let i=a&&"color"in a?a.color:null,c=i&&this.inConic?this.flatten(i):i,s=o.strokeWidth>0?this.resolveColor(o.stroke):null,l=s&&{...s,a:s.a*r};if(!(c||l))return;let u=o.fillRule==="evenodd";this.withAlpha(c?.a??1,l?.a??1,()=>{c&&this.setColor("fill",c),l&&(this.setColor("draw",l),this.pdf.setLineWidth(o.strokeWidth*$n(o.matrix))),this.tracePath(e,o.matrix),c&&l?u?this.pdf.fillStrokeEvenOdd():this.pdf.fillStroke():c?u?this.pdf.fillEvenOdd():this.pdf.fill():this.pdf.stroke();});}text(e,n){let o=e.text.replace(/\s+/g," ").trim(),r=this.resolveColor(n.fill);if(!(o&&r))return;let a=$n(n.matrix),[i,c]=Y(n.matrix,X(e.attrs.x,n.viewport[0]),X(e.attrs.y,n.viewport[1])),s=n.fontWeight==="bold"||Number.parseInt(n.fontWeight,10)>=600;this.pdf.setFont("helvetica",s?"bold":"normal");let l=n.fontSize*a*(72/go);this.pdf.setFontSize(l);let u=Number.parseFloat(e.attrs["data-max-width"]??"");if(u>0){let d=u*a,p=this.pdf.getTextWidth(o);p>d&&(l*=d/p,this.pdf.setFontSize(l));}this.setColor("text",r);let m=Math.atan2(n.matrix[1],n.matrix[0]);if(Math.abs(m)>2e-4){let d=n.textAnchor==="middle"?this.pdf.getTextWidth(o)/2:n.textAnchor==="end"?this.pdf.getTextWidth(o):0;this.pdf.text(o,i-d*Math.cos(m),c-d*Math.sin(m),{angle:-m*180/Math.PI,baseline:"alphabetic"});return}let h=n.textAnchor==="middle"?"center":n.textAnchor==="end"?"right":"left";this.pdf.text(o,i,c,{align:h,baseline:"alphabetic"});}aliases=new Map;image(e,n){let o=e.attrs.href??e.attrs["xlink:href"],r=o&&(uo(o)?o:this.images.get(o)),a=r&&uo(r);if(!(r&&a))return;let i=this.aliases.get(r);i||(i=`qrdx-image-${this.aliases.size}`,this.aliases.set(r,i));let c=null;if(e.attrs.preserveAspectRatio)try{let g=this.pdf.getImageProperties(r);c={width:g.width,height:g.height};}catch{c=null;}let s=Nl(e,n.viewport,c);if(!s)return;let{draw:l,clip:u}=s,[m,h]=Y(n.matrix,l.x,l.y),[d,p]=Y(n.matrix,l.x+l.width,l.y+l.height),f=u!==null&&this.beginClip([{op:"M",x:u.x,y:u.y},{op:"L",x:u.x+u.width,y:u.y},{op:"L",x:u.x+u.width,y:u.y+u.height},{op:"L",x:u.x,y:u.y+u.height},{op:"Z"}],n.matrix,false);try{this.withAlpha(n.opacity??1,1,()=>{this.pdf.addImage(r,a,Math.min(m,d),Math.min(h,p),Math.abs(d-m),Math.abs(p-h),i);});}finally{f&&this.endClip();}}};function sh(t,e,n){let{trimX:o,trimY:r,trimWidth:a,trimHeight:i,bleed:c}=n,s=c+ql,l=o,u=o+a,m=r,h=r+i;e.setRegistrationColor(),t.setLineWidth(oh);for(let d of [l,u]){let p=d===l?-1:1;for(let f of [m,h]){let g=f===m?-1:1;t.line(d+p*s,f,d+p*(s+ti),f),t.line(d,f+g*s,d,f+g*(s+ti));}}}async function ch(t,e){return (await Ql(t,e)).output("dataurlstring")}async function cy(t,e){return (await Ql(t,e)).output("arraybuffer")}async function Ql(t,e){let n=bo(t,e),o;try{({jsPDF:o}=await import('jspdf'));}catch(b){throw new Error(`PDF export needs the optional "jspdf" package. Install it with \`npm install jspdf\`. (${b})`)}let r=await ir(t),a=Le(r);if(!a)throw new Error("Failed to render the QR code for printing");let i=new Map;for(let b of ar(a,new Set))if(!uo(b)){let y=await mo(b);y&&i.set(b,y);}let c=new o({orientation:n.pageWidth>n.pageHeight?"landscape":"portrait",unit:"mm",format:[n.pageWidth,n.pageHeight],compress:true,floatPrecision:3});c.setProperties({title:"QR code",creator:"qrdx"});let s=io(a),l=s.size>0?ei.attach(c):null,u=new ni(c,e.colorMode==="cmyk",or(a,new Map),l?{gradients:s,resources:l}:null,i);po(u,t);let m=n.codeWidth/Ee,h=X(a.attrs.width,Ee,Ee),d=X(a.attrs.height,Ee,Ee),p={matrix:pt([1,0,0,1,n.trimX,n.trimY],[m,0,0,m,0,0]),viewport:[h,d],fill:"#000000",fillRule:"nonzero",stroke:"none",strokeWidth:1,fontSize:16,fontWeight:"normal",textAnchor:"start"},f=n.bleed>0?fo(t,r):null,g=[n.trimX-n.bleed,n.trimY-n.bleed,n.trimX+n.trimWidth+n.bleed,n.trimY+n.trimHeight+n.bleed];if(!(f&&u.paintBleed(a,p,f,g))){let b=f?u.resolveColor(f):null;b&&(u.setColor("fill",b),c.rect(n.trimX-n.bleed,n.trimY-n.bleed,n.trimWidth+2*n.bleed,n.trimHeight+2*n.bleed,"F"));}return u.walk(a,p,true),e.cropMarks&&sh(c,u,n),c}async function lh(t,e){let n=bo(t,{size:e.size,unit:e.unit}),o=await ir(t),r=e.unit??"mm",a=s=>`${x(r==="in"?s/go:s)}${r}`,i=/^<svg\b[^>]*>/.exec(o)?.[0];if(!i)throw new Error("Failed to render the QR code for printing");return `<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
${i.replace(/\swidth="[^"]*"/,` width="${a(n.trimWidth)}"`).replace(/\sheight="[^"]*"/,` height="${a(n.trimHeight)}"`)}${o.slice(i.length)}`}async function ly(t,e){let n=await ch(t,e);Pe(n,e.filename??"qr-code-print.pdf");}async function uy(t,e){let n=await lh(t,e);Pe(`data:image/svg+xml;charset=utf-8,${encodeURIComponent(n)}`,e.filename??"qr-code-print.svg");}pe();ft();Dt();var uh=[137,80,78,71,13,10,26,10];async function Ul(t,e){let n=new Blob([t]).stream().pipeThrough(e);return new Uint8Array(await new Response(n).arrayBuffer())}async function Hl(t){return typeof CompressionStream>"u"?null:await Ul(t,new CompressionStream("deflate"))}async function mh(t){if(typeof DecompressionStream>"u")return null;try{return await Ul(t,new DecompressionStream("deflate"))}catch{return null}}var ri=(t,e)=>t[e]*2**24+(t[e+1]<<16)+(t[e+2]<<8)+t[e+3]>>>0,zl={0:1,2:3,3:1,4:2,6:4};function dh(t,e,n){let o=t+e-n,r=Math.abs(o-t),a=Math.abs(o-e),i=Math.abs(o-n);return r<=a&&r<=i?t:a<=i?e:n}async function oi(t){if(uh.some((f,g)=>t[g]!==f))return null;let e=8,n=0,o=0,r=-1,a=null,i=null,c=[];for(;e+8<=t.length;){let f=ri(t,e),g=String.fromCharCode(...t.subarray(e+4,e+8)),b=t.subarray(e+8,e+8+f);if(e+=12+f,g==="IHDR"){n=ri(b,0),o=ri(b,4);let y=b[8];r=b[9];let _=b[12];if(y!==8||_!==0||!(r in zl))return null}else if(g==="PLTE")a=b;else if(g==="tRNS")i=b;else if(g==="IDAT")c.push(b);else if(g==="IEND")break}if(!(n&&o)||n*o>4096*4096)return null;let s=new Uint8Array(c.reduce((f,g)=>f+g.length,0)),l=0;for(let f of c)s.set(f,l),l+=f.length;let u=await mh(s),m=zl[r],h=n*m;if(!u||u.length<o*(h+1))return null;let d=new Uint8Array(o*h);for(let f=0;f<o;f++){let g=u[f*(h+1)],b=u.subarray(f*(h+1)+1,(f+1)*(h+1)),y=f*h;for(let _=0;_<h;_++){let w=_>=m?d[y+_-m]:0,R=f>0?d[y-h+_]:0,S=f>0&&_>=m?d[y-h+_-m]:0,$=b[_],C=0;g===1?C=w:g===2?C=R:g===3?C=w+R>>1:g===4&&(C=dh(w,R,S)),d[y+_]=$+C&255;}}let p=new Uint8Array(n*o*4);for(let f=0;f<n*o;f++){let g=f*4,b=f*m;if(r===3){let y=d[b];p[g]=a?.[y*3]??0,p[g+1]=a?.[y*3+1]??0,p[g+2]=a?.[y*3+2]??0,p[g+3]=i?.[y]??255;}else if(r===0||r===4){let y=d[b];p[g]=y,p[g+1]=y,p[g+2]=y,p[g+3]=r===4?d[b+1]:255;}else p[g]=d[b],p[g+1]=d[b+1],p[g+2]=d[b+2],p[g+3]=r===6?d[b+3]:255;}return {width:n,height:o,data:p}}he();var hh=25.4,Wl=72/hh,fh=50;function ph(t){let e=/^data:[^,]*?(;base64)?,(.*)$/s.exec(t);if(!e)return null;try{let n=e[1]?atob(e[2]):decodeURIComponent(e[2]),o=new Uint8Array(n.length);for(let r=0;r<n.length;r++)o[r]=n.charCodeAt(r)&255;return o}catch{return null}}function gh(t){if(t[0]!==255||t[1]!==216)return null;let e=2;for(;e+9<t.length;){if(t[e]!==255)return null;let n=t[e+1];if(n===216||n>=208&&n<=215){e+=2;continue}let o=t[e+2]<<8|t[e+3];if(n===192||n===193||n===194){let r=t[e+5]<<8|t[e+6],a=t[e+7]<<8|t[e+8],i=t[e+9];return {width:a,height:r,components:i,progressive:n===194}}e+=2+o;}return null}async function bh(t,e){let{width:n,height:o,data:r}=t,a=e?4:3,i=new Uint8Array(n*o*a);for(let s=0;s<n*o;s++){let l=r[s*4+3]/255,u=r[s*4]*l+255*(1-l),m=r[s*4+1]*l+255*(1-l),h=r[s*4+2]*l+255*(1-l);if(e){let[d,p,f,g]=Te(u,m,h);i.set([d*255,p*255,f*255,g*255].map(Math.round),s*a);}else i.set([Math.round(u),Math.round(m),Math.round(h)],s*a);}let c=await Hl(i);return {kind:"raw",width:n,height:o,components:a,bytes:c??i,compressed:!!c}}async function yh(t,e){let n=t;if(!/^data:image\/(png|jpe?g)[;,]/i.test(n)){let i=await mo(n);if(!i)return null;n=i;}let o=ph(n);if(!o)return null;let r=gh(o);if(r)return r.components===1||r.components===3?{kind:"jpeg",width:r.width,height:r.height,components:r.components,bytes:o,progressive:r.progressive}:null;let a=await oi(o);return a?await bh(a,e):null}function _h(t){let e="",n=0,o=r=>{e+=r,n+=r.length,n>=76&&(e+=`
|
|
3
|
+
`,n=0);};for(let r=0;r<t.length;r+=4){let a=Math.min(4,t.length-r),i=0;for(let s=0;s<4;s++)i=i*256+(s<a?t[r+s]:0);if(i===0&&a===4){o("z");continue}let c=[];for(let s=0;s<5;s++)c.unshift(String.fromCharCode(i%85+33)),i=Math.floor(i/85);o(c.slice(0,a+1).join(""));}return `${e}~>`}var xh=`/qrdxdict 40 dict def
|
|
4
|
+
qrdxdict begin
|
|
5
|
+
/m {moveto} bind def
|
|
6
|
+
/l {lineto} bind def
|
|
7
|
+
/c {curveto} bind def
|
|
8
|
+
/h {closepath} bind def
|
|
9
|
+
/n {newpath} bind def
|
|
10
|
+
/f {fill} bind def
|
|
11
|
+
/ef {eofill} bind def
|
|
12
|
+
/s {stroke} bind def
|
|
13
|
+
/w {setlinewidth} bind def
|
|
14
|
+
/rg {setrgbcolor} bind def
|
|
15
|
+
/cmyk {setcmykcolor} bind def
|
|
16
|
+
/latin1 {
|
|
17
|
+
findfont dup length dict begin
|
|
18
|
+
{1 index /FID ne {def} {pop pop} ifelse} forall
|
|
19
|
+
/Encoding ISOLatin1Encoding def
|
|
20
|
+
currentdict end definefont pop
|
|
21
|
+
} bind def
|
|
22
|
+
/QRDX-Regular /Helvetica latin1
|
|
23
|
+
/QRDX-Bold /Helvetica-Bold latin1
|
|
24
|
+
end`;function ai(t){let e="(";for(let n of t){let o=n.codePointAt(0)??63;n==="("||n===")"||n==="\\"?e+=`\\${n}`:o>=32&&o<127?e+=n:o>=160&&o<=255?e+=`\\${o.toString(8).padStart(3,"0")}`:e+="?";}return `${e})`}var ii=class extends Bn{out=[];shadingNames=new Map;cmyk;images;usesLevel3=false;constructor(e,n,o,r){super(n,o),this.cmyk=e,this.images=r;}color(e){if(this.cmyk){let[n,o,r,a]=Te(e.r,e.g,e.b);return `${x(n)} ${x(o)} ${x(r)} ${x(a)} cmyk`}return `${x(e.r/255)} ${x(e.g/255)} ${x(e.b/255)} rg`}tracePath(e,n){let o=["n"],r=false;for(let a of e)if(a.op==="M"||a.op==="L"&&!r){let[i,c]=Y(n,a.x,a.y);o.push(`${x(i)} ${x(c)} m`),r=true;}else if(a.op==="L"){let[i,c]=Y(n,a.x,a.y);o.push(`${x(i)} ${x(c)} l`);}else if(a.op==="C"){if(!r)continue;let[i,c]=Y(n,a.x1,a.y1),[s,l]=Y(n,a.x2,a.y2),[u,m]=Y(n,a.x,a.y);o.push(`${x(i)} ${x(c)} ${x(s)} ${x(l)} ${x(u)} ${x(m)} c`);}else r&&o.push("h");return o.join(" ")}beginClip(e,n,o){return this.out.push(`gsave ${this.tracePath(e,n)} ${o?"eoclip":"clip"} n`),true}endClip(){this.out.push("grestore");}rect(e,n,o,r,a){this.out.push(`${this.color(e)} n ${x(n)} ${x(o)} m ${x(n+r)} ${x(o)} l ${x(n+r)} ${x(o+a)} l ${x(n)} ${x(o+a)} l h f`);}shade(e,n,o){let r=pt(n.matrix,o.matrix);if(!Ge(r))return;let a=co(o,this.cmyk?"cmyk":"rgb"),i=this.shadingNames.get(a);i||(i=`Sh${this.shadingNames.size}`,this.shadingNames.set(a,i)),this.usesLevel3=true;let c=n.fillRule==="evenodd"?"eoclip":"clip";this.out.push(`gsave ${this.tracePath(e,n.matrix)} ${c} n [${so(r)}] concat ${i} shfill grestore`);}paint(e,n,o){if(e.length===0)return;let r=o.opacity??1;if(r<=0)return;let a=this.resolveFill(o.fill,e,o.viewport,(o.fillOpacity??1)*r);a&&"pattern"in a?this.paintPattern(e,o,a.pattern,a.alpha):a&&"gradient"in a&&this.shade(e,o,{...a.gradient,stops:a.gradient.stops.map(m=>({...m,color:this.flatten({...m.color,a:m.color.a*a.alpha})}))});let i=a&&"color"in a?this.flatten(a.color):null,c=o.strokeWidth>0?this.resolveColor(o.stroke):null,s=c&&this.flatten({...c,a:c.a*r});if(!(i||s))return;let l=this.tracePath(e,o.matrix),u=o.fillRule==="evenodd"?"ef":"f";i&&s?this.out.push(`gsave ${this.color(i)} ${l} ${u} grestore`):i&&this.out.push(`${this.color(i)} ${l} ${u}`),s&&this.out.push(`${this.color(s)} ${x(o.strokeWidth*$n(o.matrix))} w ${l} s`);}text(e,n){let o=e.text.replace(/\s+/g," ").trim(),r=this.resolveColor(n.fill);if(!(o&&r))return;let a=$n(n.matrix),[i,c]=Y(n.matrix,X(e.attrs.x,n.viewport[0]),X(e.attrs.y,n.viewport[1])),l=n.fontWeight==="bold"||Number.parseInt(n.fontWeight,10)>=600?"/QRDX-Bold":"/QRDX-Regular",u=x(n.fontSize*a),m=Number.parseFloat(e.attrs["data-max-width"]??""),h=m>0?` dup stringwidth pop dup ${x(m*a)} gt {${x(m*a)} exch div ${u} mul ${l} findfont exch scalefont setfont} {pop} ifelse`:"",d=n.textAnchor==="middle"?" dup stringwidth pop 2 div neg 0 rmoveto":n.textAnchor==="end"?" dup stringwidth pop neg 0 rmoveto":"",p=Math.atan2(n.matrix[1],n.matrix[0])*180/Math.PI;if(Math.abs(p)>.01){this.out.push(`gsave ${this.color(r)} ${l} findfont ${u} scalefont setfont ${x(i)} ${x(c)} translate ${x(p)} rotate ${ai(o)}${h} 0 0 moveto${d} show grestore`);return}this.out.push(`gsave ${this.color(r)} ${l} findfont ${u} scalefont setfont ${ai(o)}${h} ${x(i)} ${x(c)} moveto${d} show grestore`);}image(e,n){let o=e.attrs.href??e.attrs["xlink:href"],r=o?this.images.get(o):void 0;if(!r)return;let a=X(e.attrs.x,n.viewport[0]),i=X(e.attrs.y,n.viewport[1]),c=X(e.attrs.width,n.viewport[0]),s=X(e.attrs.height,n.viewport[1]);if(c<=0||s<=0)return;let[l,u]=Y(n.matrix,a,i),[m,h]=Y(n.matrix,a+c,i+s),{components:d}=r,p=d===1?"/DeviceGray":d===4?"/DeviceCMYK":"/DeviceRGB",f=Array.from({length:d},()=>"0 1").join(" "),g="/ASCII85Decode filter";r.kind==="jpeg"?(g+=" /DCTDecode filter",r.progressive&&(this.usesLevel3=true)):r.compressed&&(g+=" /FlateDecode filter",this.usesLevel3=true),this.out.push(["gsave",`${x(Math.min(l,m))} ${x(Math.min(u,h))} translate ${x(Math.abs(m-l))} ${x(Math.abs(h-u))} scale`,`${p} setcolorspace`,`<< /ImageType 1 /Width ${r.width} /Height ${r.height} /BitsPerComponent 8 /Decode [${f}] /ImageMatrix [${r.width} 0 0 -${r.height} 0 ${r.height}] /DataSource currentfile ${g} >> image`,_h(r.bytes),"grestore"].join(`
|
|
25
|
+
`));}};async function Vl(t,e={}){let n=Le(t);if(!n)throw new Error("Could not read the SVG to convert to EPS");let o=X(n.attrs.width,0,0)||512,r=X(n.attrs.height,0,0)||o,a=e.width??o;if(!(Number.isFinite(a)&&a>0))throw new Error("EPS width must be a positive number of points");let i=a/o,c=r*i,s=Math.max(0,e.bleed??0),l=a+2*s,u=c+2*s,m=e.colorMode==="cmyk",h=new Map;for(let y of ar(n,new Set)){let _=await yh(y,m);_&&h.set(y,_);}let d=new ii(m,or(n,new Map),io(n),h);po(d,{bgColor:e.background??"#ffffff"});let f={matrix:pt([1,0,0,-1,s,u-s],[i,0,0,i,0,0]),viewport:[o,r],fill:"#000000",fillRule:"nonzero",stroke:"none",strokeWidth:1,fontSize:16,fontWeight:"normal",textAnchor:"start"},g=s>0?e.bleedColor??void 0:void 0;if(!(g&&d.paintBleed(n,f,g,[0,0,l,u]))){let y=g?d.resolveColor(g):null;y&&d.rect(y,0,0,l,u);}d.walk(n,f,true);let b=(e.title??"QR code").replace(/[^\x20-\x7e]/g,"?");return ["%!PS-Adobe-3.0 EPSF-3.0",`%%BoundingBox: 0 0 ${Math.ceil(l)} ${Math.ceil(u)}`,`%%HiResBoundingBox: 0 0 ${x(l)} ${x(u)}`,`%%Title: ${ai(b)}`,"%%Creator: qrdx",`%%LanguageLevel: ${d.usesLevel3?3:2}`,"%%DocumentData: Clean7Bit","%%EndComments","%%BeginProlog",xh,"%%EndProlog","qrdxdict begin",...Array.from(d.shadingNames,([y,_])=>`/${_} ${y} def`),"gsave",...d.out,"grestore","end","showpage","%%Trailer","%%EOF",""].join(`
|
|
26
|
+
`)}var Yl="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 Xl(t){return [t.bgColor,t.fgColor,t.eyeColor,t.dotColor,...Object.values(t.eyeColors??{}).flatMap(n=>[n?.outer,n?.inner])].some(n=>typeof n=="object"&&n?.type==="image")}async function yo(t,e={}){if(Xl(t))throw new Error(Yl);let n=bo(t,{size:e.sizeMm??fh,unit:"mm",bleed:e.bleedMm}),o=await ir(t);return await Vl(o,{width:n.trimWidth*Wl,bleed:n.bleed*Wl,bleedColor:n.bleed>0?fo(t,o):Ka(t),colorMode:e.colorMode,background:Mt(t.bgColor,yt)})}function _o(t){return `data:application/postscript;base64,${btoa(t)}`}async function $h(t,e={}){let n=await yo(t,e);Pe(_o(n),e.filename??"qr-code-print.eps");}ye();var Ay={small:{width:200,height:200},medium:{width:400,height:400},large:{width:800,height:800},xlarge:{width:1200,height:1200},"2xl":{width:1600,height:1600},"3xl":{width:2e3,height:2e3}};function si(t,e){return t<50||e<50?{isValid:false,error:"Size must be at least 50x50 pixels"}:t>5e3||e>5e3?{isValid:false,error:"Size must not exceed 5000x5000 pixels"}:t!==e?{isValid:false,error:"Width and height must be equal for QR codes"}:{isValid:true}}function an(t,e){let{imageSettings:n,size:o}=t;if(!(n&&o)||o===e)return {...t,size:e};let r=e/o;return {...t,size:e,imageSettings:{...n,width:n.width*r,height:n.height*r,...n.x!=null&&{x:n.x*r},...n.y!=null&&{y:n.y*r},...n.padding!=null&&{padding:n.padding*r}}}}function Pe(t,e){let n=document.createElement("a");n.href=t,n.download=e,document.body.appendChild(n),n.click(),document.body.removeChild(n);}function jl(t){switch(t){case "png":return "image/png";case "jpg":return "image/jpeg";case "svg":return "image/svg+xml";case "pdf":return "application/pdf";case "eps":return "application/postscript";default:return "image/png"}}var Sh=new Set(["svg","eps"]);function wh(t,e,n){let o=t;if(Sh.has(t))return `qr-code.${o}`;let{width:r,height:a}=be(e.width,n);return `qr-code-${Math.round(r)}x${Math.round(a)}.${o}`}var Ch=25.4/72;async function Zl(t){let e=await yo(t,{sizeMm:(t.size??bt)*Ch});return _o(e)}async function Jl(t){let e;try{({jsPDF:e}=await import('jspdf'));}catch(h){throw new Error(`PDF export needs the optional "jspdf" package. Install it with \`npm install jspdf\`. (${h})`)}let n=await ce(t),o=decodeURIComponent(n.replace("data:image/svg+xml,","")),r;try{let h=new TextEncoder().encode(o),d=Array.from(h,f=>String.fromCharCode(f)).join("");r=`data:image/svg+xml;base64,${btoa(d)}`;}catch(h){throw new Error(`Failed to encode SVG for PDF conversion: ${h}`)}let{width:a,height:i}=be(t.size||bt,t.frame),c=await new Promise((h,d)=>{let p=new Image,f=document.createElement("canvas");f.width=Math.round(a),f.height=Math.round(i);let g=f.getContext("2d");if(!g){d(new Error("Could not get canvas context"));return}let b=setTimeout(()=>{f.remove(),d(new Error("SVG load timeout - image may be too large or contain invalid data"));},3e4);p.onload=()=>{clearTimeout(b);try{g.drawImage(p,0,0,f.width,f.height),h(f);}catch(y){clearTimeout(b),f.remove(),d(new Error(`Failed to draw image to canvas: ${y}`));}},p.onerror=()=>{clearTimeout(b),f.remove(),d(new Error("Could not load SVG for PDF conversion"));},p.src=r;}),s=c.toDataURL("image/png",1),l=a*.264583,u=i*.264583,m=new e({orientation:l>u?"landscape":"portrait",unit:"mm",format:[l,u]});return m.addImage(s,"PNG",0,0,l,u),c.remove(),m.output("dataurlstring")}async function Ly(t,e){let{format:n,size:o,filename:r}=e,a=si(o.width,o.height);if(!a.isValid)throw new Error(a.error);let i=an(t,o.width),c=r||wh(n,o,t.frame);try{if(n==="svg"){let s=await ce(i);Pe(s,c);}else if(n==="pdf"){let s=await Jl(i);Pe(s,c);}else if(n==="eps")Pe(await Zl(i),c);else {let s=jl(n),l=await xo(i,s);if(typeof l=="string")Pe(l,c);else throw new Error("Failed to generate image data URL")}}catch(s){throw console.error(`Error downloading ${n.toUpperCase()}:`,s),s}}async function Iy(t,e,n){let o=si(n.width,n.height);if(!o.isValid)throw new Error(o.error);let r=an(t,n.width);if(e==="svg")return await ce(r);if(e==="pdf")return await Jl(r);if(e==="eps")return await Zl(r);let a=jl(e),i=await xo(r,a);if(typeof i=="string")return i;throw new Error("Failed to generate QR code data URL")}async function Fy(t,e={width:bt,height:bt}){try{let n=si(e.width,e.height);if(!n.isValid)throw new Error(n.error);let o=an(t,e.width),r=xo(o,"image/png",!0).then(a=>new Promise((i,c)=>{let s=a;s.toBlob(l=>{s.remove(),l?i(l):c(new Error("Failed to create blob from canvas"));},"image/png");}));await navigator.clipboard.write([new ClipboardItem({"image/png":r})]);}catch(n){throw console.error("Error copying to clipboard:",n),n}}async function Ty(t){let e=await ce(t);return decodeURIComponent(e.replace("data:image/svg+xml,",""))}ye();Ho();Cn();ft();Dt();pr();he();var Gt={maxBytes:2e5,maxElements:500,maxDepth:16,maxInputSegments:4e3,maxColors:8,artboardSide:1e3,decimals:1,padding:.06},ot=class extends Error{},Mh={script:t=>`Removed ${xt(t,"script")}`,style:t=>`Removed ${xt(t,"style sheet")}: colors set with CSS classes are lost. Export with presentation attributes (Illustrator: Styling \u2192 Presentation Attributes)`,"foreign-object":t=>`Removed ${xt(t,"foreignObject element")}`,image:t=>`Removed ${xt(t,"image")}: frames are vector shapes only`,use:t=>`Removed ${xt(t,"<use> reference")}: ungroup or detach symbols before exporting`,text:t=>`Removed ${xt(t,"text element")}: add text as labels in the frame editor`,effects:t=>`Removed ${xt(t,"filter, mask, clip path or pattern")}`,animation:t=>`Removed ${xt(t,"animation")}`,unknown:t=>`Removed ${xt(t,"unsupported element")}`,"nested-svg":t=>`Removed ${xt(t,"nested <svg>")}: flatten it first`,handlers:t=>`Removed ${xt(t,"event handler attribute")}`,links:t=>`Removed ${xt(t,"link")} (href)`,"external-paint":t=>`Removed ${xt(t,"fill or stroke")} that referenced something outside the file`,gradient:t=>`Flattened ${xt(t,"gradient")} to its first color: add gradients in the frame editor`,opacity:t=>`Made ${xt(t,"semi-transparent shape")} opaque (print files have no transparency)`,"invalid-paint":t=>`${xt(t,"color")} couldn't be read and fell back to the parent color`,stroke:t=>`Removed ${xt(t,"stroke")} on paths, polygons or polylines: outline strokes before exporting (Figma: Outline stroke)`,dash:t=>`Drew ${xt(t,"dashed stroke")} as solid`,clipped:t=>`Cut ${xt(t,"shape")} at the edge of the artboard`,outside:t=>`Removed ${xt(t,"shape")} outside the artboard`,colors:t=>`Merged ${xt(t,"color")} with similar ones (${Gt.maxColors} at most)`,"qr-placed":()=>'No QR placeholder found (a rect with id "qr"): the code was centered; place it in the frame editor'};function xt(t,e){return `${t} ${e}${t===1?"":"s"}`}var mi=class{counts=new Map;add(e,n=1){this.counts.set(e,(this.counts.get(e)??0)+n);}list(){return [...this.counts].map(([e,n])=>({code:e,count:n,message:Mh[e](n)}))}},Rh=/^\s*<\?xml\s[^?>]*\?>/,ci=/[A-Za-z_][\w:.-]*/y,li=/<\/([A-Za-z_][\w:.-]*)\s*>/y,$o=/\s*/y,Eh=/[A-Za-z_:][\w:.-]*/y,Ph=/[^"<]*/y,vh=/[^'<]*/y;function Gn(t,e,n){return t.lastIndex=n,t.test(e)?t.lastIndex:n}function Kl(t,e){let n=Gn($o,t,e),o=Gn(Eh,t,n);if(n===e||o===n)return -1;let r=Gn($o,t,o);if(t[r]!=="=")return -1;let a=Gn($o,t,r+1),i=t[a];if(i!=='"'&&i!=="'")return -1;let s=Gn(i==='"'?Ph:vh,t,a+1);return t[s]===i?s+1:-1}function Ah(t,e){let n=Gn($o,t,e);return t[n]===">"?{end:n+1,selfClosing:false}:t.startsWith("/>",n)?{end:n+2,selfClosing:true}:null}function Lh(t){let e=[],n=0,o="",r=0;for(;r<t.length;){let a=t.indexOf("<",r);if(a<0)break;if(r=a,t.startsWith("<!--",r)){let l=t.indexOf("-->",r+4);if(l<0)throw new ot("The SVG has an unclosed comment");r=l+3;continue}if(t.startsWith("<![CDATA[",r)){let l=t.indexOf("]]>",r+9);if(l<0)throw new ot("The SVG has an unclosed CDATA section");r=l+3;continue}if(t.startsWith("<?",r)){let l=t.indexOf("?>",r+2);if(l<0)throw new ot("The SVG has an unclosed declaration");r=l+2;continue}if(t.startsWith("<!",r))throw new ot("DOCTYPE and other declarations are not allowed");if(t[r+1]==="/"){li.lastIndex=r;let l=li.exec(t);if(!l)throw new ot("The SVG has a malformed closing tag");if(e.pop()!==l[1])throw new ot(`The SVG closes <${l[1]}> out of order`);r=li.lastIndex;continue}ci.lastIndex=r+1;let i=ci.exec(t);if(!i)throw new ot("The SVG has a malformed tag");let c=ci.lastIndex;for(let l=Kl(t,c);l>=0;l=Kl(t,c))c=l;let s=Ah(t,c);if(!s)throw new ot(`The SVG has a malformed <${i[0]}> tag (attributes must be quoted and may not contain "<")`);if(n++,n>Gt.maxElements)throw new ot(`The SVG has more than ${Gt.maxElements} elements`);if(o||(o=i[0]),!s.selfClosing&&(e.push(i[0]),e.length>Gt.maxDepth))throw new ot(`The SVG nests elements more than ${Gt.maxDepth} deep`);r=s.end;}if(e.length>0)throw new ot(`The SVG doesn't close <${e.at(-1)}>`);return o}function Ih(t){if(typeof t!="string")throw new ot("Expected SVG markup as a string");let e=new TextEncoder().encode(t).length;if(e>Gt.maxBytes)throw new ot(`The SVG is ${Math.ceil(e/1e3)} KB; the limit is ${Gt.maxBytes/1e3} KB`);if(/<!(?:DOCTYPE|ENTITY|ATTLIST|ELEMENT|NOTATION)/i.test(t))throw new ot("DOCTYPE and entity declarations are not allowed");let n=t.replace(Rh,"");if(n.includes("<?"))throw new ot("Processing instructions (such as xml-stylesheet) are not allowed");if(Lh(n)!=="svg")throw new ot("The file must start with an <svg> element");return n}var ui=t=>Math.round(Math.min(255,Math.max(0,t))).toString(16).padStart(2,"0");function jt(t){let e=t?.replace(/!important/i,"").trim();return e===""||e==="inherit"?void 0:e}function di(t,e,n,o){let r=t.trim();if(r==="none"||r==="transparent")return null;if(/^url\(/i.test(r)){let i=/^url\(\s*['"]?#([^)'"\s]+)['"]?\s*\)/i.exec(r)?.[1],c=i?n.get(i):void 0;return c?(o.add("gradient"),di(c,e,n,o)):(o.add("external-paint"),null)}let a=mt(r==="currentColor"?e.color:r);return a?a.a<=0?null:`#${ui(a.r)}${ui(a.g)}${ui(a.b)}`:(o.add("invalid-paint"),null)}function Fh(t){let e=new Map,n=r=>{(r.name==="linearGradient"||r.name==="radialGradient")&&r.attrs.id&&e.set(r.attrs.id,r);for(let a of r.children)n(a);};n(t);let o=new Map;for(let[r,a]of e){let i=a.children.find(s=>s.name==="stop");if(!i){let s=(a.attrs.href??a.attrs["xlink:href"])?.match(/^#(.+)$/)?.[1];i=s?e.get(s)?.children.find(l=>l.name==="stop"):void 0;}let c=i&&jt(K(i,"stop-color"));c&&o.set(r,c);}return o}function t0(t,e){return t.map(n=>{if(n.op==="Z")return n;if(n.op==="C"){let[a,i]=Y(e,n.x1,n.y1),[c,s]=Y(e,n.x2,n.y2),[l,u]=Y(e,n.x,n.y);return {op:"C",x1:a,y1:i,x2:c,y2:s,x:l,y:u}}let[o,r]=Y(e,n.x,n.y);return {op:n.op,x:o,y:r}})}function Th(t){let e=0;return t.forEach(([n,o],r)=>{let[a,i]=t[(r+1)%t.length];e+=n*i-a*o;}),e/2}function fi(t){return t.length<3?[]:[...t.map(([e,n],o)=>({op:o===0?"M":"L",x:e,y:n})),{op:"Z"}]}var qe=t=>Number.isFinite(t);function ut(t,e,n=0){let o=Number.parseFloat(t.attrs[e]??"");return qe(o)?o:n}function e0(t){switch(t.name){case "path":return de(t.attrs.d??"");case "rect":{let e=t.attrs.rx??t.attrs.ry,n=t.attrs.ry??t.attrs.rx;return oe(ut(t,"x"),ut(t,"y"),ut(t,"width"),ut(t,"height"),Number.parseFloat(e??"0")||0,Number.parseFloat(n??"0")||0)}case "circle":{let e=ut(t,"r");return re(ut(t,"cx"),ut(t,"cy"),e,e)}case "ellipse":return re(ut(t,"cx"),ut(t,"cy"),ut(t,"rx"),ut(t,"ry"));case "polygon":case "polyline":{let e=Ve(t.attrs.points),n=[];for(let o=0;o+1<e.length;o+=2)n.push([e[o],e[o+1]]);return fi(n)}default:return []}}function kh(t,e){let n=e/2;switch(t.name){case "rect":{let o=ut(t,"x"),r=ut(t,"y"),a=ut(t,"width"),i=ut(t,"height"),c=Number.parseFloat(t.attrs.rx??t.attrs.ry??"0")||0,s=oe(o-n,r-n,a+e,i+e,c>0?c+n:0,c>0?c+n:0);if(a<=e||i<=e)return s;let l=Math.max(c-n,0);return [...s,...oe(o+n,r+n,a-e,i-e,l,l)]}case "circle":case "ellipse":{let o=ut(t,"cx"),r=ut(t,"cy"),a=t.name==="circle"?ut(t,"r"):ut(t,"rx"),i=t.name==="circle"?ut(t,"r"):ut(t,"ry"),c=re(o,r,a+n,i+n);return a<=n||i<=n?c:[...c,...re(o,r,a-n,i-n)]}case "line":{let[o,r,a,i]=["x1","y1","x2","y2"].map(m=>ut(t,m)),c=Math.hypot(a-o,i-r);if(c===0)return [];let s=-(i-r)/c*n,l=(a-o)/c*n,u=[[o+s,r+l],[a+s,i+l],[a-s,i-l],[o-s,r-l]];return fi(Th(u)<0?u.reverse():u)}default:return null}}var Nh=new Set(["path","rect","circle","ellipse","polygon","polyline","line"]),Oh=new Set(["defs","linearGradient","radialGradient","stop","title","desc","metadata"]),Dh={script:"script",style:"style",foreignObject:"foreign-object",image:"image",feImage:"image",use:"use",text:"text",tspan:"text",textPath:"text",filter:"effects",mask:"effects",clipPath:"effects",pattern:"effects",marker:"effects",symbol:"effects",animate:"animation",animateMotion:"animation",animateTransform:"animation",set:"animation"},Bh=/^(?:qrdx[-_ ]?)?qr(?:[-_ ]?code)?$/i;function r0(t,e){for(let n of Object.keys(t.attrs)){let o=n.toLowerCase();o.startsWith("on")?e.add("handlers"):o==="href"||o==="xlink:href"?t.name!=="linearGradient"&&t.name!=="radialGradient"&&e.add("links"):(o==="filter"||o==="mask"||o==="clip-path")&&e.add("effects");}}function o0(t,e,n,o,r){if(r0(t,o),jt(K(t,"display"))==="none"||jt(K(t,"visibility"))==="hidden")return;let a=Number.parseFloat(K(t,"opacity")??"1"),i=jt(K(t,"fill-rule")),c=Number.parseFloat(jt(K(t,"stroke-width"))??""),s={matrix:pt(e.matrix,ne(t.attrs.transform)),fill:jt(K(t,"fill"))??e.fill,fillRule:i==="evenodd"||i==="nonzero"?i:e.fillRule,stroke:jt(K(t,"stroke"))??e.stroke,strokeWidth:qe(c)&&c>=0?c:e.strokeWidth,color:jt(K(t,"color"))??e.color,opacity:e.opacity*(qe(a)?a:1)};for(let l of t.children){if(Oh.has(l.name))continue;let u=Dh[l.name];if(u){o.add(u);continue}if(l.name==="svg"){o.add("nested-svg");continue}if(l.name==="g"||l.name==="a"){o0(l,s,n,o,r);continue}if(!Nh.has(l.name)){o.add("unknown");continue}Gh(l,s,n,o,r);}}function Gh(t,e,n,o,r){if(r0(t,o),jt(K(t,"display"))==="none"||jt(K(t,"visibility"))==="hidden")return;let a=pt(e.matrix,ne(t.attrs.transform));if(t.name==="rect"&&Bh.test(t.attrs.id??"")&&!r.qrBox){r.qrBox=We(t0(e0(t),a));return}let i=g=>jt(K(t,g)),c=e.opacity*Number.parseFloat(i("opacity")??"1"),s=Number.parseFloat(i("fill-opacity")??"1"),l=Number.parseFloat(i("stroke-opacity")??"1"),u=i("fill-rule"),m={...e,fill:i("fill")??e.fill,fillRule:u==="evenodd"||u==="nonzero"?u:e.fillRule,stroke:i("stroke")??e.stroke,color:i("color")??e.color},h=Number.parseFloat(i("stroke-width")??""),d=qe(h)&&h>=0?h:e.strokeWidth,p=(g,b,y)=>{if(g.length!==0){if(r.segments+=g.length,r.segments>Gt.maxInputSegments)throw new ot(`The SVG has more than ${Gt.maxInputSegments} path segments; simplify it`);r.shapes.push({segments:t0(g,a),fill:b,fillRule:y});}},f=g=>{let b=(qe(c)?c:1)*(qe(g)?g:1);return b<=0?false:(b<1&&o.add("opacity"),true)};if(t.name!=="line"){let g=di(m.fill,m,n,o);g&&f(s)&&p(e0(t),g,m.fillRule);}if(d>0&&m.stroke!=="none"){let g=di(m.stroke,m,n,o);if(g&&f(l)){let b=kh(t,d);b?((i("stroke-dasharray")??"none")!=="none"&&o.add("dash"),p(b,g,t.name==="line"?"nonzero":"evenodd")):o.add("stroke");}}}function qh(t,e){let n=l=>{let u=10**e;return Math.round(l*u)/u+0},o=l=>x(l,e),r="",a=0,i=0,c=0,s=0;for(let l of t){if(l.op==="Z"){r+="z",a=c,i=s;continue}let u=n(l.x),m=n(l.y);if(l.op==="M")r+=`m${o(u-a)} ${o(m-i)}`,c=u,s=m;else if(l.op==="L"){if(u===a&&m===i)continue;r+=m===i?`h${o(u-a)}`:u===a?`v${o(m-i)}`:`l${o(u-a)} ${o(m-i)}`;}else r+=`c${o(n(l.x1)-a)} ${o(n(l.y1)-i)} ${o(n(l.x2)-a)} ${o(n(l.y2)-i)} ${o(u-a)} ${o(m-i)}`;a=u,i=m;}return r}var Qh=(t,e)=>t.x0<e.x1&&e.x0<t.x1&&t.y0<e.y1&&e.y0<t.y1;function zh(t){let e=[];for(let n of t){let o=We(n.segments);if(!o)continue;let r=e.at(-1);r&&r.shape.fill===n.fill&&r.shape.fillRule===n.fillRule&&!r.boxes.some(a=>Qh(a,o))?(r.shape={...r.shape,segments:[...r.shape.segments,...n.segments]},r.boxes.push(o)):e.push({shape:n,boxes:[o]});}return e.map(n=>n.shape)}var hi=t=>[Number.parseInt(t.slice(1,3),16),Number.parseInt(t.slice(3,5),16),Number.parseInt(t.slice(5,7),16)];function Uh(t,e,n){let o=new Map;for(let i of t)o.set(i.fill,(o.get(i.fill)??0)+1);let r=new Map([...o.keys()].map(i=>[i,i])),a=0;for(;o.size>e;){let i=[...o.keys()],c=[i[0],i[1]],s=Number.POSITIVE_INFINITY;for(let d=0;d<i.length;d++)for(let p=d+1;p<i.length;p++){let f=hi(i[d]),g=hi(i[p]),b=Math.hypot(f[0]-g[0],f[1]-g[1],f[2]-g[2]);b<s&&(s=b,c=[i[d],i[p]]);}let[l,u]=c,[m,h]=(o.get(l)??0)>=(o.get(u)??0)?[l,u]:[u,l];o.set(m,(o.get(m)??0)+(o.get(h)??0)),o.delete(h);for(let[d,p]of r)p===h&&r.set(d,m);a++;}return a>0&&n.add("colors",a),r}var n0=t=>{let[e,n,o]=hi(t);return .2126*e+.7152*n+.0722*o>235};function Hh(t,e={}){let n=new mi;try{let o=Ih(t),r=Le(o);if(!r)throw new ot("No <svg> element found");let a=Ve(r.attrs.viewBox),[i,c,s,l]=[0,0,0,0];if(a.length===4&&a[2]>0&&a[3]>0?[i,c,s,l]=a:(s=ut(r,"width"),l=ut(r,"height")),!(qe(s)&&qe(l)&&s>0&&l>0))throw new ot("The SVG needs a viewBox (or a width and height)");let m=Gt.artboardSide/Math.max(s,l),h=Math.round(s*m*10)/10,d=Math.round(l*m*10)/10;if(Math.min(h,d)<exports.FRAME_SPEC_LIMITS.minArtboard)throw new ot("The artboard is too narrow: its sides may differ by 20 times at most");let p=[m,0,0,m,-i*m,-c*m],f={shapes:[],qrBox:null,segments:0};o0(r,{matrix:p,fill:"#000000",fillRule:"nonzero",stroke:"none",strokeWidth:1,color:"#000000",opacity:1},Fh(r),n,f);let g={x0:0,y0:0,x1:h,y1:d},b=Math.max(h,d)*.004,y=[],_=0,w=0;for(let F of f.shapes){let Q=We(F.segments);if(!Q||Q.x1<=0||Q.y1<=0||Q.x0>=h||Q.y0>=d){_++;continue}if(Q.x0<-b||Q.y0<-b||Q.x1>h+b||Q.y1>d+b){let $t=hr(F.segments,.25).map(Et=>fr(Et,g)).filter(Et=>Et.length>2);if($t.length===0){_++;continue}w++,y.push({...F,segments:$t.flatMap(Et=>fi(Et))});}else y.push(F);}if(_>0&&n.add("outside",_),w>0&&n.add("clipped",w),y.length===0)throw new ot("The SVG has no filled shapes to use");let R=Uh(y,Gt.maxColors,n);for(let F of y)F.fill=R.get(F.fill)??F.fill;let S=new Map,$=new Map;for(let F of y){let Q=We(F.segments);S.set(F.fill,(S.get(F.fill)??0)+(Q.x1-Q.x0)*(Q.y1-Q.y0)),$.set(F.fill,($.get(F.fill)??0)+1);}let C=[...S.keys()].sort((F,Q)=>Number(n0(F))-Number(n0(Q))||S.get(Q)-S.get(F)),M=C[0],v=C[1],E=F=>F===M?"frame":F===v?"accent":F,A=f.qrBox;if(!A&&e.qr){let[F,Q]=Y(p,e.qr.x,e.qr.y);A={x0:F,y0:Q,x1:F+e.qr.size*m,y1:Q+e.qr.size*m};}let L,k,T;A?(L=Math.min(A.x1-A.x0,A.y1-A.y0),k=(A.x0+A.x1-L)/2,T=(A.y0+A.y1-L)/2):(n.add("qr-placed"),L=Math.min(h,d)*.6,k=(h-L)/2,T=(d-L)/2);let I=F=>Math.round(F*10)/10+0;if(L=Math.floor(L*10)/10,k=I(k),T=I(T),L<Math.min(h,d)*exports.FRAME_SPEC_LIMITS.minQrShare)throw new ot("The QR area must be at least half the frame's shorter side");let W=Math.min(k,T,h-k-L,d-T-L);if(W<L*exports.FRAME_SPEC_LIMITS.minPadding-1e-9)throw new ot("Leave room around the QR area: at least 4% of its size on every side, inside the artboard");let G=Math.min(Math.max(e.padding??Gt.padding,exports.FRAME_SPEC_LIMITS.minPadding),.2),V=Math.floor(Math.min(L*G,W)*10)/10,q=zh(y);if(q.length>exports.FRAME_SPEC_LIMITS.maxShapes)throw new ot(`The artwork has ${q.length} separate shapes; the limit is ${exports.FRAME_SPEC_LIMITS.maxShapes}. Combine shapes of the same color first`);let j={kind:exports.FRAME_SPEC_KIND,version:exports.FRAME_SPEC_VERSION,artboard:{width:h,height:d},qr:{x:k,y:T,size:L,padding:V},colors:{frame:M,...v&&{accent:v}},shapes:q.map(F=>({type:"path",d:qh(F.segments,Gt.decimals),fill:E(F.fill),...F.fillRule==="evenodd"&&{fillRule:"evenodd"}})),labels:[]},et=exports.frameSpecSchema.safeParse(j);if(!et.success){let F=et.error.issues[0];throw new ot(`The converted frame doesn't fit the frame format: ${F?.message??"invalid"}`)}let ht=C.map(F=>({color:F,ref:F===M?"frame":F===v?"accent":"fixed",shapes:$.get(F)??0}));return {ok:!0,spec:et.data,warnings:n.list(),palette:ht}}catch(o){return {ok:false,error:o instanceof ot?o.message:`Could not read the SVG (${o instanceof Error?o.name:"error"})`,warnings:n.list()}}}Zo();Pr();var a0={kind:"qrdx.frame",version:1,artboard:{width:1240,height:1420},qr:{x:120,y:120,size:1e3,padding:60},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 i0={kind:"qrdx.frame",version:1,artboard:{width:1978.214,height:1978.214},qr:{x:489.107,y:489.107,size:1e3,padding:50},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 s0={kind:"qrdx.frame",version:1,artboard:{width:1240,height:1340},qr:{x:120,y:120,size:1e3,padding:40},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:1160,width:1e3,height:100},fontSize:93.6}]};var c0={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 jh={"banner-bottom":a0,"rounded-border":s0,circle:i0,ticket:c0};var l0={id:"attendance",name:"Attendance",description:"A poster with a check glyph, for classes, shifts and events.",category:"use-case",contentTypes:["attendance"],tags:["attendance","school","workplace","events"],license:"CC0-1.0",spec:{kind:"qrdx.frame",version:1,artboard:{width:1240,height:1760},qr:{size:1e3,padding:80,radius:24,x:120,y:440},colors:{frame:"#111111",text:"#ffffff"},shapes:[{type:"rect",x:0,y:0,width:1240,height:1760,radius:32,fill:"background"},{type:"rect",x:0,y:0,width:1240,height:1760,radius:32,fill:"frame",hole:{x:22,y:22,width:1196,height:1716,radius:12}},{type:"rect",x:0,y:0,width:1240,height:360,radius:32,fill:"frame"},{type:"rect",x:0,y:324,width:1240,height:36,fill:"frame"},{type:"icon",icon:"check",x:550,y:50,size:140,fill:"text"}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan to mark attendance",color:"text",box:{x:80,y:210,width:1080,height:120},fontSize:86.4},{type:"text",id:"note",slot:"secondary",text:"One scan per person",color:"frame",box:{x:120,y:1560,width:1e3,height:130},weight:"regular"}]}};var u0={id:"audio-guide",name:"Audio guide",description:"Headphones around the code, for museum and tour audio guides.",category:"use-case",contentTypes:["url"],tags:["museum","tour","audio","gallery"],license:"CC0-1.0",spec:{kind:"qrdx.frame",version:1,artboard:{width:1560,height:1960},qr:{size:1e3,padding:80,radius:24,x:280,y:420},colors:{frame:"#111111",text:"#ffffff"},shapes:[{type:"path",d:"M90 780A690 690 0 0 1 1470 780L1410 780A630 630 0 0 0 150 780Z",fill:"frame"},{type:"rect",x:20,y:700,width:140,height:400,radius:60,fill:"frame"},{type:"rect",x:1400,y:700,width:140,height:400,radius:60,fill:"frame"},{type:"rect",x:170,y:300,width:1220,height:1620,radius:48,fill:"frame"}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan for the audio guide",color:"text",box:{x:280,y:1540,width:1e3,height:150},fontSize:108},{type:"text",id:"note",slot:"secondary",text:"Listen as you walk",color:{mix:["text","frame"],amount:.3},box:{x:280,y:1690,width:1e3,height:110},weight:"regular"}]}};var m0={id:"book-now",name:"Book now",description:"A calendar page with binding tabs, for salons, clinics and classes.",category:"use-case",contentTypes:["calcom","url"],tags:["booking","appointments","salon","clinic"],license:"CC0-1.0",spec:{kind:"qrdx.frame",version:1,artboard:{width:1240,height:1760},qr:{size:1e3,padding:80,radius:24,x:120,y:400},colors:{frame:"#111111",text:"#ffffff"},shapes:[{type:"rect",x:26,y:300,width:1188,height:1434,radius:24,fill:"background"},{type:"rect",x:0,y:40,width:1240,height:1720,radius:48,fill:"frame",hole:{x:26,y:300,width:1188,height:1434,radius:24}},{type:"rect",x:300,y:0,width:64,height:140,radius:32,fill:"frame"},{type:"rect",x:876,y:0,width:64,height:140,radius:32,fill:"frame"}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan to book",color:"text",box:{x:120,y:140,width:1e3,height:140},fontSize:100.8},{type:"text",id:"note",slot:"secondary",text:"Appointments online",color:"frame",box:{x:120,y:1520,width:1e3,height:140},weight:"regular"}]}};var d0={id:"check-in",name:"Check in",description:"A sign with a location pin, for check-in desks and front doors.",category:"use-case",contentTypes:["attendance","url"],tags:["check-in","reception","events","visitors"],license:"CC0-1.0",spec:{kind:"qrdx.frame",version:1,artboard:{width:1240,height:1700},qr:{size:1e3,padding:80,radius:24,x:120,y:300},colors:{frame:"#111111",text:"#ffffff"},shapes:[{type:"rect",x:0,y:0,width:1240,height:1700,radius:40,fill:"background"},{type:"rect",x:0,y:0,width:1240,height:1700,radius:40,fill:"frame",hole:{x:30,y:30,width:1180,height:1640,radius:16}},{type:"icon",icon:"pin",x:100,y:60,size:140,fill:"frame"},{type:"rect",x:0,y:1430,width:1240,height:270,radius:40,fill:"frame"},{type:"rect",x:0,y:1430,width:1240,height:44,fill:"frame"}],labels:[{type:"text",id:"cta",slot:"primary",text:"Check in here",color:"frame",box:{x:270,y:70,width:870,height:130},fontSize:93.6,align:"start"},{type:"text",id:"note",slot:"secondary",text:"Welcome",color:"text",box:{x:120,y:1460,width:1e3,height:200}}]}};var h0={id:"christmas",name:"Christmas",description:"A light card with a tree, small sparkles and a label band.",category:"seasonal",contentTypes:[],tags:["seasonal","christmas","holidays"],license:"CC0-1.0",spec:{kind:"qrdx.frame",version:1,artboard:{width:1240,height:1760},qr:{size:1e3,padding:80,radius:24,x:120,y:400},colors:{frame:"#111111",text:"#ffffff"},shapes:[{type:"rect",x:0,y:0,width:1240,height:1760,radius:48,fill:"background"},{type:"rect",x:0,y:0,width:1240,height:1760,radius:48,fill:"frame",hole:{x:24,y:24,width:1192,height:1712,radius:28}},{type:"icon",icon:"tree",x:540,y:46,size:160,fill:"frame"},{type:"icon",icon:"sparkle",x:330,y:90,size:80,fill:{mix:["frame","background"],amount:.5}},{type:"icon",icon:"sparkle",x:830,y:90,size:80,fill:{mix:["frame","background"],amount:.5}},{type:"rect",x:0,y:1520,width:1240,height:240,radius:48,fill:"frame"},{type:"rect",x:0,y:1520,width:1240,height:52,fill:"frame"}],labels:[{type:"text",id:"note",slot:"secondary",text:"Merry Christmas",color:"frame",box:{x:120,y:214,width:1e3,height:90},weight:"regular"},{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:120,y:1540,width:1e3,height:200}}]}};var f0={id:"donate",name:"Donate",description:"A heart badge over a donation prompt.",category:"use-case",contentTypes:["paypal","upi","url"],tags:["charity","donations","nonprofit"],license:"CC0-1.0",spec:{kind:"qrdx.frame",version:1,artboard:{width:1240,height:1800},qr:{size:1e3,padding:80,radius:24,x:120,y:480},colors:{frame:"#111111",text:"#ffffff"},shapes:[{type:"rect",x:0,y:0,width:1240,height:1800,radius:64,fill:"frame"},{type:"icon",icon:"heart",x:530,y:60,size:180,fill:"text"}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan to donate",color:"text",box:{x:120,y:250,width:1e3,height:130},fontSize:93.6},{type:"text",id:"note",slot:"secondary",text:"Every gift helps",color:"text",box:{x:120,y:1600,width:1e3,height:140},weight:"regular"}]}};var p0={id:"event-ticket",name:"Event ticket",description:"A ticket with notches, a perforated stub and an admission line.",category:"use-case",contentTypes:["url"],tags:["events","tickets","concert"],license:"CC0-1.0",spec:{kind:"qrdx.frame",version:1,artboard:{width:1240,height:1800},qr:{size:1e3,padding:80,radius:24,x:120,y:120},colors:{frame:"#111111",text:"#ffffff"},shapes:[{type:"path",d:"M48 0H1192A48 48 0 0 1 1240 48V1240A60 60 0 0 0 1240 1360V1752A48 48 0 0 1 1192 1800H48A48 48 0 0 1 0 1752V1360A60 60 0 0 0 0 1240V48A48 48 0 0 1 48 0Z",fill:"frame"},{type:"line",x1:96,y1:1300,x2:1152,y2:1300,width:12,dash:[36,24],fill:"background"}],labels:[{type:"text",id:"cta",slot:"primary",text:"Admit one",color:"text",box:{x:120,y:1350,width:1e3,height:230}},{type:"text",id:"note",slot:"secondary",text:"Show at the door",color:{mix:["text","frame"],amount:.3},box:{x:120,y:1590,width:1e3,height:130},weight:"regular"}]}};var g0={id:"feedback-bubble",name:"Feedback bubble",description:"A chat bubble that asks for feedback.",category:"use-case",contentTypes:["url"],tags:["feedback","survey","customer service"],license:"CC0-1.0",spec:{kind:"qrdx.frame",version:1,artboard:{width:1240,height:1720},qr:{size:1e3,padding:80,radius:24,x:120,y:120},colors:{frame:"#111111",text:"#ffffff"},shapes:[{type:"rect",x:0,y:0,width:1240,height:1540,radius:90,fill:"frame"},{type:"path",d:"M900 1500L1150 1720Q1080 1600 1110 1500Z",fill:"frame"}],labels:[{type:"text",id:"cta",slot:"primary",text:"Tell us how we did",color:"text",box:{x:120,y:1250,width:1e3,height:190}},{type:"text",id:"note",slot:"secondary",text:"",color:"text",box:{x:120,y:1420,width:1e3,height:90},weight:"regular"}]}};var b0={id:"follow-us",name:"Follow us",description:"A speech bubble with a share glyph, for a page of your social links.",category:"use-case",contentTypes:["url","instagram","tiktok","facebook"],tags:["social","followers","marketing"],license:"CC0-1.0",spec:{kind:"qrdx.frame",version:1,artboard:{width:1240,height:1760},qr:{size:1e3,padding:80,radius:24,x:120,y:300},colors:{frame:"#111111",text:"#ffffff"},shapes:[{type:"rect",x:0,y:0,width:1240,height:1640,radius:80,fill:"frame"},{type:"polygon",points:[[160,1620],[330,1620],[150,1760]],fill:"frame"},{type:"icon",icon:"share",x:110,y:70,size:120,fill:"text"}],labels:[{type:"text",id:"cta",slot:"primary",text:"Follow us",color:"text",box:{x:270,y:60,width:870,height:140},fontSize:100.8,align:"start"},{type:"text",id:"note",slot:"secondary",text:"for news and offers",color:"text",box:{x:120,y:1420,width:1e3,height:150},weight:"regular"}]}};var y0={id:"get-the-app",name:"Get the app",description:"A phone outline with a download glyph and an app prompt on the screen.",category:"use-case",contentTypes:["url"],tags:["app","download","mobile"],license:"CC0-1.0",spec:{kind:"qrdx.frame",version:1,artboard:{width:1240,height:1960},qr:{size:1e3,padding:80,radius:24,x:120,y:300},colors:{frame:"#111111",text:"#ffffff"},shapes:[{type:"rect",x:0,y:0,width:1240,height:1960,radius:150,fill:"frame"},{type:"rect",x:40,y:200,width:1160,height:1560,radius:60,fill:"background"},{type:"rect",x:530,y:88,width:180,height:32,radius:16,fill:"background"},{type:"rect",x:470,y:1836,width:300,height:28,radius:14,fill:"background"},{type:"icon",icon:"download",x:565,y:1410,size:110,fill:"frame"}],labels:[{type:"text",id:"cta",slot:"primary",text:"Get the app",color:"frame",box:{x:120,y:1530,width:1e3,height:120},fontSize:86.4},{type:"text",id:"note",slot:"secondary",text:"Free download",color:{mix:["frame","background"],amount:.35},box:{x:120,y:1650,width:1e3,height:90},weight:"regular"}]}};var _0={id:"halloween",name:"Halloween",description:"A dark card with a pumpkin. Set a secondary color to tint the pumpkin.",category:"seasonal",contentTypes:[],tags:["seasonal","halloween","october"],license:"CC0-1.0",spec:{kind:"qrdx.frame",version:1,artboard:{width:1240,height:1720},qr:{size:1e3,padding:80,radius:24,x:120,y:320},colors:{frame:"#111111",text:"#ffffff",accent:"#ffffff"},shapes:[{type:"rect",x:0,y:0,width:1240,height:1720,radius:64,fill:"frame"},{type:"icon",icon:"pumpkin",x:545,y:60,size:150,fill:"accent"}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:120,y:1430,width:1e3,height:180}},{type:"text",id:"note",slot:"secondary",text:"Happy Halloween",color:{mix:["text","frame"],amount:.3},box:{x:120,y:1600,width:1e3,height:90},weight:"regular"}]}};var x0={id:"new-year",name:"New Year",description:"A card shaded from the frame color, with sparkles. Uses a gradient fill.",category:"seasonal",contentTypes:[],tags:["seasonal","new year","celebration"],license:"CC0-1.0",spec:{kind:"qrdx.frame",version:1,artboard:{width:1240,height:1720},qr:{size:1e3,padding:80,radius:24,x:120,y:320},colors:{frame:"#111111",text:"#ffffff"},shapes:[{type:"rect",x:0,y:0,width:1240,height:1720,radius:64,fill:{gradient:{from:"frame",to:{mix:["frame","#ffffff"],amount:.28},direction:"vertical",steps:32}}},{type:"icon",icon:"sparkle",x:150,y:60,size:140,fill:"text"},{type:"icon",icon:"sparkle",x:970,y:80,size:110,fill:"text"}],labels:[{type:"text",id:"note",slot:"secondary",text:"Happy New Year",color:"text",box:{x:320,y:90,width:600,height:120},weight:"regular"},{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:120,y:1440,width:1e3,height:220}}]}};var $0={id:"order-at-table",name:"Order at table",description:"Order prompt with a service bell and a pill for the table number.",category:"use-case",contentTypes:["url"],tags:["restaurant","ordering","table"],license:"CC0-1.0",spec:{kind:"qrdx.frame",version:1,artboard:{width:1240,height:1680},qr:{size:1e3,padding:80,radius:24,x:120,y:360},colors:{frame:"#111111",text:"#ffffff"},shapes:[{type:"rect",x:0,y:0,width:1240,height:1680,radius:64,fill:"frame"},{type:"icon",icon:"bell",x:100,y:70,size:130,fill:"text"},{type:"rect",x:370,y:1480,width:500,height:140,radius:70,fill:"background"}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan to order",color:"text",box:{x:270,y:70,width:870,height:130},fontSize:93.6,align:"start"},{type:"text",id:"table",slot:"secondary",text:"Table 12",color:"frame",box:{x:390,y:1480,width:460,height:140}}]}};var S0={id:"product-info",name:"Product info",description:"A packaging label with an info glyph, for instructions and manuals.",category:"use-case",contentTypes:["url","google-drive"],tags:["packaging","instructions","manual","retail"],license:"CC0-1.0",spec:{kind:"qrdx.frame",version:1,artboard:{width:1240,height:1720},qr:{size:1e3,padding:80,radius:24,x:120,y:330},colors:{frame:"#111111",text:"#ffffff"},shapes:[{type:"rect",x:0,y:0,width:1240,height:1720,radius:20,fill:"background"},{type:"rect",x:0,y:0,width:1240,height:1720,radius:20,fill:"frame",hole:{x:24,y:24,width:1192,height:1672,radius:6}},{type:"rect",x:0,y:0,width:1240,height:250,radius:20,fill:"frame"},{type:"rect",x:0,y:226,width:1240,height:24,fill:"frame"},{type:"icon",icon:"info",x:100,y:65,size:120,fill:"text"},{type:"rect",x:120,y:1438,width:1e3,height:4,fill:"frame"}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan for instructions",color:"text",box:{x:260,y:60,width:900,height:130},fontSize:93.6,align:"start"},{type:"text",id:"note",slot:"secondary",text:"Manuals and support",color:"frame",box:{x:120,y:1470,width:1e3,height:150},weight:"regular"}]}};var w0={id:"register-product",name:"Register product",description:"A card with a check badge on its top edge, for product registration.",category:"use-case",contentTypes:["url"],tags:["warranty","registration","packaging"],license:"CC0-1.0",spec:{kind:"qrdx.frame",version:1,artboard:{width:1240,height:1720},qr:{size:1e3,padding:80,radius:24,x:120,y:420},colors:{frame:"#111111",text:"#ffffff"},shapes:[{type:"rect",x:0,y:140,width:1240,height:1580,radius:56,fill:"frame"},{type:"circle",cx:620,cy:150,r:140,fill:"background"},{type:"circle",cx:620,cy:150,r:118,fill:"frame"},{type:"icon",icon:"check",x:530,y:60,size:180,fill:"background"}],labels:[{type:"text",id:"cta",slot:"primary",text:"Register your product",color:"text",box:{x:120,y:1530,width:1e3,height:150},fontSize:108}]}};var C0={id:"review-us",name:"Review us",description:"Five stars over the code and a review prompt on a band.",category:"use-case",contentTypes:["google-review","url"],tags:["reviews","feedback","restaurant","retail"],license:"CC0-1.0",spec:{kind:"qrdx.frame",version:1,artboard:{width:1240,height:1720},qr:{size:1e3,padding:80,radius:24,x:120,y:310},colors:{frame:"#111111",text:"#ffffff"},shapes:[{type:"rect",x:0,y:0,width:1240,height:1720,radius:56,fill:"background"},{type:"rect",x:0,y:0,width:1240,height:1720,radius:56,fill:"frame",hole:{x:28,y:28,width:1184,height:1664,radius:30}},{type:"icon",icon:"star",x:240,y:74,size:120,fill:"frame"},{type:"icon",icon:"star",x:400,y:74,size:120,fill:"frame"},{type:"icon",icon:"star",x:560,y:74,size:120,fill:"frame"},{type:"icon",icon:"star",x:720,y:74,size:120,fill:"frame"},{type:"icon",icon:"star",x:880,y:74,size:120,fill:"frame"},{type:"rect",x:0,y:1430,width:1240,height:290,radius:56,fill:"frame"},{type:"rect",x:0,y:1430,width:1240,height:60,fill:"frame"}],labels:[{type:"text",id:"cta",slot:"primary",text:"Loved it? Leave a review",color:"text",box:{x:100,y:1450,width:1040,height:240}}]}};var M0={id:"rsvp-card",name:"RSVP card",description:"An invitation card with a double rule border and a diamond ornament.",category:"use-case",contentTypes:["url"],tags:["events","wedding","party","invitation"],license:"CC0-1.0",spec:{kind:"qrdx.frame",version:1,artboard:{width:1320,height:1760},qr:{size:1e3,padding:80,radius:24,x:160,y:420},colors:{frame:"#111111",text:"#111111"},shapes:[{type:"rect",x:0,y:0,width:1320,height:1760,radius:24,fill:"background"},{type:"rect",x:0,y:0,width:1320,height:1760,radius:24,fill:"frame",hole:{x:22,y:22,width:1276,height:1716,radius:4}},{type:"rect",x:50,y:50,width:1220,height:1660,fill:"frame",hole:{x:58,y:58,width:1204,height:1644}},{type:"rect",x:440,y:297,width:440,height:6,fill:"frame"},{type:"polygon",points:[[660,278],[682,300],[660,322],[638,300]],fill:"frame"}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan to RSVP",color:"text",box:{x:160,y:110,width:1e3,height:160},fontSize:115.2},{type:"text",id:"note",slot:"secondary",text:"We hope you can make it",color:"text",box:{x:160,y:1530,width:1e3,height:130},weight:"regular"}]}};var R0={id:"save-contact",name:"Save my contact",description:"A business-card style frame with a corner tab and a contact prompt.",category:"use-case",contentTypes:["vcard"],tags:["business card","contact","networking"],license:"CC0-1.0",spec:{kind:"qrdx.frame",version:1,artboard:{width:1240,height:1620},qr:{size:1e3,padding:80,radius:24,x:120,y:260},colors:{frame:"#111111",text:"#ffffff"},shapes:[{type:"rect",x:0,y:0,width:1240,height:1620,radius:48,fill:"background"},{type:"rect",x:0,y:0,width:1240,height:1620,radius:48,fill:"frame",hole:{x:24,y:24,width:1192,height:1572,radius:28}},{type:"polygon",points:[[1056,24],[1188,24],[1216,52],[1216,184]],fill:"frame"},{type:"rect",x:0,y:1380,width:1240,height:240,radius:48,fill:"frame"},{type:"rect",x:0,y:1380,width:1240,height:52,fill:"frame"},{type:"icon",icon:"user",x:110,y:1440,size:120,fill:"text"}],labels:[{type:"text",id:"name",slot:"secondary",text:"",color:"frame",box:{x:90,y:60,width:900,height:110},align:"start",weight:"regular"},{type:"text",id:"cta",slot:"primary",text:"Save my contact",color:"text",box:{x:270,y:1420,width:870,height:160},fontSize:115.2,align:"start"}]}};var E0={id:"scan-to-pay",name:"Scan to pay",description:"Payment prompt with a card glyph and a line for a note.",category:"use-case",contentTypes:["upi","paypal","venmo","url"],tags:["payments","checkout","retail"],license:"CC0-1.0",spec:{kind:"qrdx.frame",version:1,artboard:{width:1240,height:1760},qr:{size:1e3,padding:80,radius:24,x:120,y:400},colors:{frame:"#111111",text:"#ffffff"},shapes:[{type:"rect",x:28,y:300,width:1184,height:1432,radius:28,fill:"background"},{type:"rect",x:0,y:0,width:1240,height:1760,radius:56,fill:"frame",hole:{x:28,y:300,width:1184,height:1432,radius:28}},{type:"icon",icon:"card",x:130,y:85,size:130,fill:"text"}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan to pay",color:"text",box:{x:300,y:80,width:840,height:140},fontSize:100.8,align:"start"},{type:"text",id:"note",slot:"secondary",text:"Thank you",color:"frame",box:{x:120,y:1510,width:1e3,height:150},weight:"regular"}]}};var P0={id:"shop-window",name:"Shop window",description:"A landscape window sticker with a bag glyph and a shop prompt.",category:"use-case",contentTypes:["url"],tags:["retail","shop","window","sticker"],license:"CC0-1.0",spec:{kind:"qrdx.frame",version:1,artboard:{width:1840,height:1056},qr:{size:800,padding:64,radius:19.2,x:128,y:128},colors:{frame:"#111111",text:"#ffffff"},shapes:[{type:"rect",x:0,y:0,width:1840,height:1056,radius:192,fill:"frame"},{type:"icon",icon:"bag",x:1104,y:184,size:160,fill:"text"}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan to shop",color:"text",box:{x:1104,y:384,width:640,height:176},align:"start"},{type:"text",id:"note",slot:"secondary",text:"Browse the full range",color:{mix:["text","frame"],amount:.25},box:{x:1104,y:592,width:640,height:112},align:"start",weight:"regular"}]}};var v0={id:"sign-rider",name:"Sign rider",description:"A wide rider for property signs, with the prompt beside the code.",category:"use-case",contentTypes:["url"],tags:["real estate","property","signage"],license:"CC0-1.0",spec:{kind:"qrdx.frame",version:1,artboard:{width:1920,height:992},qr:{size:800,padding:64,radius:25.6,x:1024,y:96},colors:{frame:"#111111",text:"#ffffff"},shapes:[{type:"rect",x:0,y:0,width:1920,height:992,radius:38.4,fill:"frame"},{type:"icon",icon:"home",x:96,y:120,size:144,fill:"text"}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan for photos & price",color:"text",box:{x:96,y:320,width:832,height:160},align:"start"},{type:"text",id:"note",slot:"secondary",text:"Book a viewing",color:{mix:["text","frame"],amount:.25},box:{x:96,y:528,width:832,height:112},align:"start",weight:"regular"}]}};var A0={id:"table-tent",name:"Table tent topper",description:"An arched topper for table tents and menu holders.",category:"use-case",contentTypes:["url"],tags:["menu","restaurant","cafe","table"],license:"CC0-1.0",spec:{kind:"qrdx.frame",version:1,artboard:{width:1240,height:1840},qr:{size:1e3,padding:80,radius:24,x:120,y:500},colors:{frame:"#111111",text:"#ffffff"},shapes:[{type:"path",d:"M0 1840V620A620 620 0 0 1 1240 620V1840Z",fill:"frame"},{type:"icon",icon:"cup",x:550,y:120,size:140,fill:"background"}],labels:[{type:"text",id:"note",slot:"secondary",text:"",color:{mix:["background","frame"],amount:.2},box:{x:140,y:290,width:960,height:100},weight:"regular"},{type:"text",id:"cta",slot:"primary",text:"Scan for our menu",color:"text",box:{x:100,y:1610,width:1040,height:170}}]}};var L0={id:"wifi-card",name:"Wi-Fi card",description:"A dark card with a Wi-Fi glyph, a join prompt and a pill for the network name.",category:"use-case",contentTypes:["wifi"],tags:["wifi","hospitality","cafe","hotel"],license:"CC0-1.0",spec:{kind:"qrdx.frame",version:1,artboard:{width:1240,height:1660},qr:{size:1e3,padding:80,radius:24,x:120,y:390},colors:{frame:"#111111",text:"#ffffff"},shapes:[{type:"rect",x:0,y:0,width:1240,height:1660,radius:64,fill:"frame"},{type:"icon",icon:"wifi",x:555,y:60,size:130,fill:"text"},{type:"rect",x:220,y:1500,width:800,height:116,radius:58,fill:{mix:["frame","#ffffff"],amount:.16}}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan to join Wi-Fi",color:"text",box:{x:80,y:196,width:1080,height:104},fontSize:74.9},{type:"text",id:"network",slot:"secondary",text:"Guest Wi-Fi",color:"text",box:{x:240,y:1500,width:760,height:116},weight:"regular"}]}};var I0={id:"winter",name:"Winter",description:"A light card with snowflakes over the code and on the label band.",category:"seasonal",contentTypes:[],tags:["seasonal","winter","snow"],license:"CC0-1.0",spec:{kind:"qrdx.frame",version:1,artboard:{width:1240,height:1580},qr:{size:1e3,padding:80,radius:24,x:120,y:220},colors:{frame:"#111111",text:"#ffffff"},shapes:[{type:"rect",x:0,y:0,width:1240,height:1580,radius:40,fill:"background"},{type:"rect",x:0,y:0,width:1240,height:1580,radius:40,fill:"frame",hole:{x:14,y:14,width:1212,height:1552,radius:26}},{type:"icon",icon:"snowflake",x:465,y:38,size:90,fill:{mix:["frame","#ffffff"],amount:.6}},{type:"icon",icon:"snowflake",x:575,y:30,size:90,fill:{mix:["frame","#ffffff"],amount:.6}},{type:"icon",icon:"snowflake",x:685,y:38,size:90,fill:{mix:["frame","#ffffff"],amount:.6}},{type:"rect",x:0,y:1320,width:1240,height:260,radius:40,fill:"frame"},{type:"rect",x:0,y:1320,width:1240,height:44,fill:"frame"},{type:"icon",icon:"snowflake",x:80,y:1390,size:120,fill:{mix:["frame","#ffffff"],amount:.45}},{type:"icon",icon:"snowflake",x:1040,y:1390,size:120,fill:{mix:["frame","#ffffff"],amount:.45}}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:220,y:1340,width:800,height:220}}]}};var F0=[L0,A0,$0,C0,E0,p0,M0,R0,b0,y0,g0,S0,w0,f0,d0,u0,v0,m0,P0,l0,I0,_0,h0,x0];function Sf(t){return F0.find(e=>e.id===t)}qr();$a();var T0=.06,k0=.16,N0=512;function O0(t){let{width:e,height:n}=t;if(!(e>0&&n>0)||t.data.length<e*n*4)return null;let o=Uint8Array.from(t.data),r=xa({width:e,height:n,data:o});if(!r)return null;let a=d=>{let p=d*4;return Math.hypot(o[p]/255-r[0],o[p+1]/255-r[1],o[p+2]/255-r[2])},i=new Uint8Array(e*n),c=new Int32Array(e*n),s=0,l=0,u=d=>{i[d]||o[d*4+3]===0||a(d)>=k0||(i[d]=1,c[l++]=d);};for(let d=0;d<e;d++)u(d),u((n-1)*e+d);for(let d=0;d<n;d++)u(d*e),u(d*e+e-1);for(;s<l;){let d=c[s++],p=d%e;p>0&&u(d-1),p<e-1&&u(d+1),d>=e&&u(d-e),d<(n-1)*e&&u(d+e);}let m=new Uint8ClampedArray(o),h=r;for(let d=0;d<e*n;d++){if(!i[d])continue;let p=Math.min(1,Math.max(0,(a(d)-T0)/(k0-T0))),f=d*4;if(m[f+3]=Math.round(o[f+3]*p),p>0&&p<1)for(let g=0;g<3;g++){let y=(o[f+g]/255-(1-p)*h[g])/p;m[f+g]=Math.round(Math.min(1,Math.max(0,y))*255);}}return {width:e,height:n,data:m}}async function wf(t){if(typeof document>"u"||typeof Image>"u")throw new Error("removeLogoBackground needs a browser (canvas)");let e=await new Promise(c=>{let s=new Image;s.crossOrigin="anonymous",s.onload=()=>c(s),s.onerror=()=>c(null),s.src=t;});if(!e)return null;let n=e.naturalWidth||512,o=e.naturalHeight||512,r=Math.min(1,N0/Math.max(n,o)),a=document.createElement("canvas");a.width=Math.max(1,Math.round(n*r)),a.height=Math.max(1,Math.round(o*r));let i=a.getContext("2d",{willReadFrequently:true});if(!i)return null;try{i.drawImage(e,0,0,a.width,a.height);let c=i.getImageData(0,0,a.width,a.height),s=O0(c);return s?(c.data.set(s.data),i.putImageData(c,0,0),a.toDataURL("image/png")):null}catch{return null}finally{a.remove();}}vt();$e();me();vt();Dn();Ke();Re();function Cf(t,e){return wt.QrCode.encodeText(t,Lt[e??te]).size}function D0(t,e,n,o=n.size*(e?.size??exports.LOGO_SIZE_DEFAULT)){let r={src:t,width:o,height:o,excavate:true,...e?.shape&&e.shape!=="square"&&{shape:e.shape},...e?.plate&&{plate:e.plate}},a=e?.x!==void 0||e?.y!==void 0;if(!(e?.padding||a))return r;let i=Cf(n.value,n.level),c=Tt(i,n.margin,n.shape),s=n.size/(i+2*c);if(e.padding&&(r.padding=e.padding*s),a){let l=i*s,u=m=>Math.min(Math.max((m??.5)*l-o/2,0),l-o);r.x=u(e.x),r.y=u(e.y);}return r}function B0(t,e,n,o){let r=n.level??te,a=r;o&&(a=Bt({...n,imageSettings:D0(t,e,n),autoLevel:o}));let i=s=>{let l=m=>D0(t,e,{...n,level:s},m),u=Xa(n,[s],l().width,l);return u>0?l(u):void 0};if(a===r)return i(r);let c=i(a);return c&&Bt({...n,imageSettings:c,autoLevel:o})===a?c:i(r)}function Mf({value:t,level:e,margin:n,shape:o,autoLevel:r,logoOptions:a}){let c=B0("data:,",{...a,size:exports.LOGO_SIZE_MAX},{value:`${t}`,size:1024,margin:n??exports.DEFAULT_MARGIN,level:e,shape:o},r);return c?c.width/1024:0}function pi({value:t,size:e=1024,fgColor:n,bgColor:o,eyeColor:r,dotColor:a,bodyPattern:i,hideLogo:c,logo:s,logoOptions:l,margin:u,cornerEyePattern:m,cornerEyeDotPattern:h,level:d,templateId:p,frame:f,eyeColors:g,moduleScale:b,autoLevel:y,shape:_}){let w={value:`${t}`,size:e,margin:u??exports.DEFAULT_MARGIN,level:d,shape:_},R=!c&&s?B0(s,l,w,y):void 0;return {value:w.value,bgColor:o,fgColor:n,eyeColor:r,dotColor:a,bodyPattern:i,cornerEyePattern:m,cornerEyeDotPattern:h,level:d,templateId:p,size:e,margin:u,...f&&{frame:f},...g&&{eyeColors:g},...b!==void 0&&{moduleScale:b},...y&&{autoLevel:y},..._&&_!=="square"&&{shape:_},...R&&{imageSettings:R}}}Re();var Pf=Sm.memo(({value:t,fgColor:e,hideLogo:n,logo:o,logoOptions:r,bgColor:a,eyeColor:i,dotColor:c,bodyPattern:s,cornerEyePattern:l,cornerEyeDotPattern:u,level:m,size:h=bt,scale:d=1,margin:p=exports.DEFAULT_MARGIN,style:f,templateId:g,customTemplate:b,customProps:y,frame:_,art:w,eyeColors:R,moduleScale:S,autoLevel:$,shape:C,frameLabelMarkers:M})=>{let v=h*d,E=Sm.useMemo(()=>pi({value:t,fgColor:e,hideLogo:n,bgColor:a,eyeColor:i,dotColor:c,bodyPattern:s,cornerEyePattern:l,cornerEyeDotPattern:u,level:m,templateId:g,logo:o,logoOptions:r,margin:p,autoLevel:$,shape:C}),[t,e,n,o,r,p,$,C,a,i,c,s,l,u,m,g]),A=v/E.size,L=E.imageSettings&&{...E.imageSettings,height:E.imageSettings.height*A,width:E.imageSettings.width*A,...E.imageSettings.x!=null&&{x:E.imageSettings.x*A},...E.imageSettings.y!=null&&{y:E.imageSettings.y*A},...E.imageSettings.padding!=null&&{padding:E.imageSettings.padding*A}};return jsxRuntime.jsx(Ya,{art:w,bgColor:E.bgColor,bodyPattern:E.bodyPattern,cornerEyeDotPattern:E.cornerEyeDotPattern,cornerEyePattern:E.cornerEyePattern,customProps:y,customTemplate:b,dotColor:E.dotColor,eyeColor:E.eyeColor,fgColor:E.fgColor,frame:_,level:m||E.level,margin:E.margin,...R&&{eyeColors:R},...S!==void 0&&{moduleScale:S},...$&&{autoLevel:$},...C&&C!=="square"&&{shape:C},...M&&{frameLabelMarkers:M},size:v,style:f,templateId:E.templateId,value:E.value,...L&&{imageSettings:L}})});Pf.displayName="QRCode";Ke();var G0={diamond:["square","rounded","diya","extra-rounded","message","pointy","leaf","leaf-reverse","drop","bevel","squircle","cushion","shield","petal"],banner:["square","rounded","diya","leaf"],square:["curly"],diya:["curly"],message:["curly"]},q0={diamond:["square"],pacman:["rounded"],"small-square":["square","rounded"]},Q0=["circle","curly"],z0=["diamond","banner","star"],U0={circle:["square","rounded","diya","extra-rounded","message","pointy","leaf","leaf-reverse","drop","bevel","squircle","cushion","shield","petal"]},Zt=["square","liquid","classy","classy-rounded"],H0={"circle/rounded":Zt,"circle/extra-rounded":Zt,"circle/message":[...Zt,"leaf"],"circle/pointy":Zt,"circle/leaf-reverse":Zt,"circle/drop":Zt,"circle/bevel":[...Zt,"leaf"],"circle/squircle":[...Zt,"circle","diamond","circle-mixed","rounded","horizontal-line","leaf","heart","mosaic","octagon"],"circle/cushion":Zt,"circle/shield":[...Zt,"rounded","horizontal-line","leaf"],"circle/petal":Zt};function W0(t,e,n){return (U0[t]?.includes(e)??false)&&!H0[`${t}/${e}`]?.includes(n)}function gi(t){let e=t.bodyPattern??"circle",n=t.cornerEyePattern??"gear",o=t.cornerEyeDotPattern??"circle";return G0[o]?.includes(n)?{kind:"dot-eye",message:`${o} centres in ${n} eyes are missed by strict decoders`,fix:"Pick a square, rounded or circle centre, or another eye shape"}:q0[e]?.includes(n)?{kind:"body-eye",message:`${e} dots next to ${n} eyes are missed up close`,fix:"Pick a fuller dot shape or another eye shape"}:z0.includes(o)?{kind:"dot",message:`${o} centres are missed in sharp renders and up close`,fix:"Pick a square, rounded or circle centre"}:Q0.includes(n)?{kind:"eye",message:`${n} eyes only read in lenient decoders`,fix:"Pick square, rounded or gear eyes"}:W0(o,n,e)?{kind:"sharp-dot-eye",message:`${o} centres in ${n} eyes are missed by some decoders on screens and in sharp prints`,fix:"Pick a rounded centre, or gear or octagon eyes"}:null}Fn();$e();me();vt();ye();Dn();Ke();Re();Dt();var K0=[96,160,320],wo=640;function _i(){if(typeof document>"u")throw new Error("Scan scoring needs a browser (canvas + image decoding)")}function ze(t){if(t?.aborted)throw new DOMException("Scan scoring was aborted","AbortError")}var tu=()=>new Promise(t=>setTimeout(t,0));async function xi(){let{default:t}=await import('jsqr');return t}function yi(t,e){if(!t)return false;if(t.data===e)return true;try{return new TextDecoder().decode(Uint8Array.from(t.binaryData))===e}catch{return false}}function Af(t,e,n=.7){let{data:o,width:r,height:a}=t;for(let l=0;l<o.length;l+=4)for(let u=0;u<3;u++)o[l+u]=128+(o[l+u]-128)*n;let i=Math.max(1,Math.round(e*.25)),c=new Float32Array(r*a*3),s=l=>{let u=l?a:r,m=l?r:a,h=(p,f)=>l?p*r+f:f*r+p,d=[0,0,0];for(let p=0;p<u;p++){d.fill(0);for(let f=-i;f<=i;f++){let g=h(p,Math.min(Math.max(f,0),m-1))*4;for(let b=0;b<3;b++)d[b]=d[b]+o[g+b];}for(let f=0;f<m;f++){let g=h(p,f)*3;for(let _=0;_<3;_++)c[g+_]=d[_]/(2*i+1);let b=h(p,Math.max(f-i,0))*4,y=h(p,Math.min(f+i+1,m-1))*4;for(let _=0;_<3;_++)d[_]=d[_]-o[b+_]+o[y+_];}}for(let p=0;p<r*a;p++)for(let f=0;f<3;f++)o[p*4+f]=c[p*3+f];};for(let l=0;l<2;l++)s(true),s(false);}function qn(t,e){let n=document.createElement("canvas");n.width=Math.max(1,Math.round(t)),n.height=Math.max(1,Math.round(e));let o=n.getContext("2d",{willReadFrequently:true});if(!o)throw new Error("Could not get canvas context");return o.imageSmoothingEnabled=true,o.imageSmoothingQuality="high",{canvas:n,ctx:o}}var Lf=[.9,1,1.1];function $i(t,e,n,o,r){let a=0;for(let i of Lf){let c=n*i,s=e(c);Af(s,c/o),r(t(s.data,s.width,s.height))&&a++;}return a>=2?"pass":a===1?"fragile":"fail"}var bi={small:"small print or far away",medium:"typical phone distance",large:"close up"};function If(t,e){return t===e[0]&&e.length>1?bi.small:t===e.at(-1)?bi.large:bi.medium}function eu(t,e,n){if(n==="pass")return 0;let o=e===1?[45]:e===2?[20,45]:[15,20,45],r=o[Math.round(t*(o.length-1)/Math.max(e-1,1))]??20;return n==="fragile"?Math.round(r/2):r}function nu(t,e,n){let o=`${t} px (${If(t,e)})`;return n==="pass"?{id:`decode-${t}`,passed:true,message:`Reads at ${o}, with camera blur`}:{id:`decode-${t}`,passed:false,message:n==="fragile"?`Reads at ${o} only some of the time`:`Doesn't read at ${o}`,fix:t===e[0]?"Print it bigger, shorten the content (fewer modules) or use solid square dots":"Raise the contrast, use bigger dots or a simpler eye shape"}}function ru(t,e){return e?"fails":t>=85?"great":t>=65?"ok":"risky"}function Ff(t,e,n){let o=Ht(t,e);if(o.type==="solid")return [o.color];if(o.type!=="image")return o.stops.map(c=>c.color);let r=o.underlay?Co(o.underlay):null,a=n?.[o.src];if(!a)return o.underlay?[o.underlay]:[];let i=o.opacity??1;return [a.light,a.dark].flatMap(c=>{let s=Co(c);if(!s)return [];let l={...s,a:s.a*i};if(!r)return [V0(l)];let u=l.a+r.a*(1-l.a),m=(h,d)=>u>0?(h*l.a+d*r.a*(1-l.a))/u:0;return [V0({r:m(l.r,r.r),g:m(l.g,r.g),b:m(l.b,r.b),a:u})]})}var V0=({r:t,g:e,b:n,a:o})=>`rgba(${Math.round(t)}, ${Math.round(e)}, ${Math.round(n)}, ${Math.round(o*1e3)/1e3})`;function Tf(t){let e=[],n=t.width*t.height;for(let a=0;a<n;a++){let i=t.data[a*4],c=t.data[a*4+1],s=t.data[a*4+2];t.data[a*4+3]<128||e.push({lum:exports.getLuminance(i,c,s),r:i,g:c,b:s});}if(e.length===0)return null;e.sort((a,i)=>a.lum-i.lum);let o=Math.max(1,Math.round(e.length/10)),r=a=>{let i=a.reduce((s,l)=>({r:s.r+l.r,g:s.g+l.g,b:s.b+l.b}),{r:0,g:0,b:0}),c=s=>Math.round(s/a.length).toString(16).padStart(2,"0");return `#${c(i.r)}${c(i.g)}${c(i.b)}`};return {dark:r(e.slice(0,o)),light:r(e.slice(-o))}}async function kf(t){_i();let e=await lr(t),{canvas:n,ctx:o}=qn(64,64);o.drawImage(e,0,0,64,64);let r=Tf(o.getImageData(0,0,64,64));return n.remove(),r}function ou(t){let e=[t.bgColor,t.fgColor,t.eyeColor,t.dotColor,...exports.EYE_POSITIONS.flatMap(o=>[t.eyeColors?.[o]?.outer,t.eyeColors?.[o]?.inner])],n=new Set;for(let o of e)typeof o=="object"&&o?.type==="image"&&n.add(o.src);return [...n]}var sr=null;function Co(t){let e=mt(t);if(e||typeof document>"u")return e;if(sr??=document.createElement("canvas").getContext("2d"),!sr)return null;sr.fillStyle="#010203",sr.fillStyle=t;let n=String(sr.fillStyle);return n==="#010203"?null:mt(n)}var Y0=t=>exports.getLuminance(t.r,t.g,t.b),au=(t,e)=>(Math.max(t,e)+.05)/(Math.min(t,e)+.05),cr=4.5,Nf=3,X0=1.5,j0={code:7,background:12},Z0={r:255,g:255,b:255,a:1},J0=(t,e)=>({r:t.r*t.a+e.r*(1-t.a),g:t.g*t.a+e.g*(1-t.a),b:t.b*t.a+e.b*(1-t.a),a:1});function Of(t,e={}){let n=e.imageTones,o=(d,p)=>{let f=typeof d=="object"&&d?.type==="image";return Ff(d,p,n).map(g=>({color:g,picture:f}))},r=t.fgColor??Pt,a=exports.EYE_POSITIONS.flatMap(d=>{let p=t.eyeColors?.[d];return [...p?.outer?o(p.outer,Pt):[],...p?.inner?o(p.inner,Pt):[]]}),i=[...o(r,Pt),...o(t.eyeColor??r,Pt),...o(t.dotColor??r,Pt),...a],c=o(t.bgColor,yt),s=(c.length>0?c:[{color:"#ffffff",picture:false}]).map(d=>{let p=Co(d.color);return {color:p?J0(p,Z0):Z0,picture:d.picture}}),l=i.flatMap(d=>{let p=Co(d.color);return p?[{color:p,picture:d.picture}]:[]}),u=Number.POSITIVE_INFINITY,m=cr,h=false;for(let d of l)for(let p of s){let f=Y0(J0(d.color,p.color)),g=Y0(p.color),b=au(f,g),y=p.picture?j0.background:d.picture?j0.code:cr;b/y<u/m&&(u=b,m=y),f>g&&(h=true);}return {ratio:Number.isFinite(u)?u:Number.POSITIVE_INFINITY,required:m,inverted:h}}function Df(t,e){let{ratio:n,inverted:o,required:r}=Of(t,{imageTones:e});if(!Number.isFinite(n))return {checks:[],penalty:0,fails:false};let a=r/cr,i=r!==cr,c=Math.round(n*10)/10,s=[],l=0;return n>=r?s.push({id:"contrast",passed:true,message:`Contrast ${c}:1 between code and background`}):(l=n<X0*a?60:n<Nf*a?30:10,s.push({id:"contrast",passed:false,message:i?`Low contrast for a picture (${c}:1); ${r}:1 or more scans reliably`:`Low contrast (${c}:1); 4.5:1 or more scans reliably`,fix:i?"Lower the picture's opacity over a darker underlay (dots) or a lighter one (background)":"Use a darker code color or a lighter background"})),o?(l+=10,s.push({id:"polarity",passed:false,message:"Light code on a dark background; some scanner apps can't read it",fix:"Use dark modules on a light background"})):s.push({id:"polarity",passed:true,message:"Dark code on a light background"}),{checks:s,penalty:l,fails:n<X0*(r/cr)}}function Si(t){return wt.QrCode.encodeText(t.value,Lt[Bt(t)]).getModules()}function Bf(t){let{imageSettings:e}=t;if(!e)return {check:null,penalty:0};let n=Si(t),o=Me(n,t.size??bt,Tt(n.length,t.margin??exports.DEFAULT_MARGIN,t.shape),e);if(!o)return {check:null,penalty:0};let r=o.excavation??o,a=n.length,c=[[0,0],[a-8,0],[0,a-8]].some(([p,f])=>r.x<p+9&&r.x+r.w>p&&r.y<f+9&&r.y+r.h>f),s=a>21?a-9:null,l=s!==null&&r.x<s+5&&r.x+r.w>s&&r.y<s+5&&r.y+r.h>s;if(c||l)return {check:{id:"logo",passed:false,message:c?"The logo covers a corner eye":"The logo covers the small square near the bottom-right corner",fix:"Move the logo toward the center or make it smaller"},penalty:40};let u=r.w*r.h/(a*a),m=Bt(t),h=Math.round(u*100),d=ao({value:t.value,size:t.size??bt,margin:t.margin??exports.DEFAULT_MARGIN,level:m,shape:t.shape},e);return !d||d.worst<=d.budget?{check:{id:"logo",passed:true,message:`Logo covers ${h}% of the code; error correction repairs it with room to spare`},penalty:0}:{check:{id:"logo",passed:false,message:`Logo covers ${h}% of the code and spoils ${d.worst} codewords in one block, which repairs ${d.correctable}`,fix:d.level==="H"?"Use a smaller logo":"Switch error correction to H or use a smaller logo"},penalty:d.worst>d.correctable?25:10}}function Gf(t){let e=ya(t.shape)?Je(t.margin??exports.DEFAULT_MARGIN):t.margin??exports.DEFAULT_MARGIN,n=Si(t).length+2*e,o=e+(zt(t.frame)?ta(t.frame)*n:0),r=Math.round(o*10)/10;return o>=4?{check:{id:"quiet-zone",passed:true,message:`Quiet zone of ${r} modules`},penalty:0}:o>=1.5?{check:{id:"quiet-zone",passed:true,message:`Quiet zone of ${r} modules (4 is ideal)`},penalty:0}:{check:{id:"quiet-zone",passed:false,message:"No quiet zone around the code",fix:"Leave clear space (about 10% of the code width) around it wherever you place it, or add a frame"},penalty:5}}function qf(t){let e=t.cornerEyePattern??"gear";return e==="curly"?{check:{id:"eye-shape",passed:false,message:"Curly eyes fail strict decoders such as ZXing-based apps",fix:"Pick square, rounded or gear eyes"},penalty:40}:e==="circle"?{check:{id:"eye-shape",passed:false,message:"Circle eyes only read in lenient decoders; many apps miss them",fix:"Pick square, rounded or gear eyes"},penalty:20}:{check:{id:"eye-shape",passed:true,message:`No known decoder issues with ${e} eyes`},penalty:0}}function lr(t){return new Promise((e,n)=>{let o=new Image;o.crossOrigin="anonymous",o.onload=()=>e(o),o.onerror=()=>n(new Error("Could not load image")),o.src=t;})}var Qf=`data:image/svg+xml,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 10"><rect width="10" height="10" rx="2" fill="#808080"/></svg>')}`;async function zf(t){let{imageSettings:e}=t;if(!e||e.src.startsWith("data:"))return t;let n=Qf;try{let o=await lr(e.src),{canvas:r,ctx:a}=qn(o.naturalWidth||256,o.naturalHeight||256);a.drawImage(o,0,0,r.width,r.height),n=r.toDataURL("image/png");}catch{}return {...t,imageSettings:{...e,src:n}}}async function Uf(t){let e=new Map;for(let r of ou(t))if(!r.startsWith("data:"))try{let a=await lr(r),{canvas:i,ctx:c}=qn(a.naturalWidth||256,a.naturalHeight||256);c.drawImage(a,0,0,i.width,i.height),e.set(r,i.toDataURL("image/png")),i.remove();}catch{e.set(r,null);}if(e.size===0)return t;let n=r=>{if(typeof r!="object"||r?.type!=="image")return r;let a=e.get(r.src);return a===void 0?r:a?{...r,src:a}:r.underlay??Pt},o=t.eyeColors?Object.fromEntries(Object.entries(t.eyeColors).map(([r,a])=>[r,a&&{outer:n(a.outer),inner:n(a.inner)}])):void 0;return {...t,bgColor:n(t.bgColor),fgColor:n(t.fgColor),eyeColor:n(t.eyeColor),dotColor:n(t.dotColor),...o&&{eyeColors:o}}}async function iu(t,e,n,o,r){let a=[],i=0,c=Df(t,r);i+=c.penalty;let s=Bf(t);i+=s.penalty;let l=Gf(t);i+=l.penalty;let u=qf(t);i+=u.penalty;let m=gi(t),h=m?.kind==="eye"?null:m;h&&h.kind!=="sharp-dot-eye"&&(i+=10);let d=await xi();ze(o);let p=Si(t).length,f=p+2*Tt(p,t.margin??exports.DEFAULT_MARGIN,t.shape),g=[],b=false;for(let[w,R]of n.entries()){await tu(),ze(o);let S=$i(d,e,R,f,$=>yi($,t.value));i+=eu(w,n.length,S),g.push(nu(R,n,S)),w===n.length-1&&S==="fail"&&(b=true);}a.push(...g,...c.checks),s.check&&a.push(s.check),a.push(u.check,l.check),h&&a.push({id:"style-pair",passed:false,message:h.message,fix:h.fix});let y=b||c.fails,_=Math.max(0,Math.min(100,100-i));return y&&(_=Math.min(_,30)),{score:_,grade:ru(_,y),checks:a}}function su(t){return [...t.sizes??K0].filter(e=>e>0).sort((e,n)=>e-n)}async function S_(t,e={}){_i();let{signal:n}=e,o=su(e),r=await Uf(await zf(an({...t,size:t.size??bt},wo)));ze(n);let a={};for(let u of ou(t))try{let m=await kf(u);m&&(a[u]=m);}catch{}ze(n);let i=await ce(r),c=await lr(i);ze(n);let s=be(wo,t.frame);return await iu(t,u=>{let m=u/wo,h=s.width*m,d=s.height*m,p=Math.max(8,Math.round(u*.12)),{canvas:f,ctx:g}=qn(h+2*p,d+2*p);g.fillStyle="#ffffff",g.fillRect(0,0,f.width,f.height),g.drawImage(c,p,p,h,d);let b=g.getImageData(0,0,f.width,f.height);return f.remove(),b},o,n,a)}var w_=wo;async function C_(t,e,n={}){let{width:o,height:r}=e;if(!(o>0&&r>0)||e.data.length<o*r*4)throw new Error("Pixels must be width \xD7 height \xD7 4 RGBA bytes");let a=su(n),i=t.size??bt,c=be(i,t.frame),s=o*i/c.width,l={data:Hf(e),width:o,height:r};return await iu(t,m=>{let h=cu(l,m/s),d=Math.max(8,Math.round(m*.12));return Wf(h,d)},a,n.signal)}function Hf(t){let{data:e,width:n,height:o}=t,r=new Uint8ClampedArray(n*o*4);for(let a=0;a<n*o*4;a+=4){let i=e[a+3]/255;for(let c=0;c<3;c++)r[a+c]=e[a+c]*i+255*(1-i);r[a+3]=255;}return r}function Wf(t,e){let n=t.width+2*e,o=t.height+2*e,r=new Uint8ClampedArray(n*o*4).fill(255);for(let a=0;a<t.height;a++)r.set(t.data.subarray(a*t.width*4,(a+1)*t.width*4),((a+e)*n+e)*4);return {data:r,width:n,height:o,colorSpace:"srgb"}}var Qe=(t,e)=>Math.hypot(t.x-e.x,t.y-e.y);function So(t,e){return .299*t[e]+.587*t[e+1]+.114*t[e+2]}function Vf(t,e){let n=0;for(let c=0;c<256;c++)n+=c*t[c];let o=0,r=0,a=0,i=128;for(let c=0;c<256;c++){if(r+=t[c],r===0)continue;let s=e-r;if(s===0)break;o+=c*t[c];let l=o/r,u=(n-o)/s,m=r*s*(l-u)**2;m>a&&(a=m,i=c);}return i}async function Yf(t){if(!(t instanceof Blob))return t.complete||await new Promise(n=>{t.addEventListener("load",n,{once:true}),t.addEventListener("error",n,{once:true});}),t;let e=URL.createObjectURL(t);try{let n=await lr(e);return await n.decode?.().catch(()=>{}),n}finally{setTimeout(()=>URL.revokeObjectURL(e),1e3);}}async function M_(t,e={}){_i();let{signal:n}=e,o=[...e.sizes??K0].filter(B=>B>0).sort((B,at)=>B-at),r=await xi(),a=await Yf(t);ze(n);let i=a.naturalWidth||a.width,c=a.naturalHeight||a.height;if(!(i&&c))throw new Error("Could not read this image");let s=Math.min(1,1600/Math.max(i,c)),{canvas:l,ctx:u}=qn(i*s,c*s);u.fillStyle="#ffffff",u.fillRect(0,0,l.width,l.height),u.drawImage(a,0,0,l.width,l.height);let m=u.getImageData(0,0,l.width,l.height),h=r(m.data,m.width,m.height);if(ze(n),!h){let B=await Al(a,0,false);return l.remove(),typeof B!="string"||B==="NO_QR"?{data:null,version:null,score:0,grade:"fails",checks:[{id:"decode",passed:false,message:"No QR code found in this image",fix:"Try a sharper, well-lit, straight-on photo or a screenshot"}]}:{data:B,version:null,score:55,grade:"risky",checks:[{id:"decode",passed:false,message:"Decoded only after cropping; the code is small or hard to find in this image",fix:"Make the code bigger relative to its surroundings"}]}}let{location:d,version:p}=h,f=17+4*p,g=(Qe(d.topLeftCorner,d.topRightCorner)+Qe(d.bottomLeftCorner,d.bottomRightCorner)+Qe(d.topLeftCorner,d.bottomLeftCorner)+Qe(d.topRightCorner,d.bottomRightCorner))/4,b=g/f,y=[d.topLeftCorner,d.topRightCorner,d.bottomRightCorner,d.bottomLeftCorner],_=Math.max(0,Math.floor(Math.min(...y.map(B=>B.x)))),w=Math.min(m.width,Math.ceil(Math.max(...y.map(B=>B.x)))),R=Math.max(0,Math.floor(Math.min(...y.map(B=>B.y)))),S=Math.min(m.height,Math.ceil(Math.max(...y.map(B=>B.y)))),$=[],C=0,M=new Array(256).fill(0),v=0;for(let B=R;B<S;B++)for(let at=_;at<w;at++){let Z=Math.round(So(m.data,(B*m.width+at)*4));M[Z]=M[Z]+1,v++;}let E=Vf(M,v),A={dark:[0,0,0,0],light:[0,0,0,0]};for(let B=R;B<S;B++)for(let at=_;at<w;at++){let Z=(B*m.width+at)*4,St=So(m.data,Z)<=E?A.dark:A.light;St[0]=St[0]+m.data[Z],St[1]=St[1]+m.data[Z+1],St[2]=St[2]+m.data[Z+2],St[3]=St[3]+1;}let L=B=>{let at=Math.max(B[3],1);return exports.getLuminance(B[0]/at,B[1]/at,B[2]/at)},k=L(A.dark),T=L(A.light),I=au(k,T),W=Math.round(I*10)/10;I>=4.5?$.push({id:"contrast",passed:true,message:`Contrast ${W}:1 in the image`}):(C+=I<2?30:10,$.push({id:"contrast",passed:false,message:`Low contrast in the image (${W}:1)`,fix:"Use a darker code on a lighter background, or better lighting for photos"}));let V=[d.topLeftFinderPattern,d.topRightFinderPattern,d.bottomLeftFinderPattern].map(B=>{let at=Math.min(m.width-1,Math.max(0,Math.round(B.x))),Z=Math.min(m.height-1,Math.max(0,Math.round(B.y)));return So(m.data,(Z*m.width+at)*4)}).filter(B=>B>E).length>=2;V?(C+=10,$.push({id:"polarity",passed:false,message:"Light code on a dark background; some scanner apps can't read it",fix:"Use dark modules on a light background"})):$.push({id:"polarity",passed:true,message:"Dark code on a light background"});let q=Math.max(2,Math.round(b*2)),j={minX:_-q,maxX:w+q,minY:R-q,maxY:S+q};if(j.minX<0||j.minY<0||j.maxX>m.width||j.maxY>m.height)$.push({id:"quiet-zone",passed:true,skipped:true,message:"The image is cropped too tight to check the quiet zone"});else {let B=0,at=0;for(let Z=j.minY;Z<j.maxY;Z++)for(let St=j.minX;St<j.maxX;St++){if(St>=_&&St<w&&Z>=R&&Z<S)continue;let Qn=So(m.data,(Z*m.width+St)*4);(V?Qn>E:Qn<=E)&&B++,at++;}B/Math.max(at,1)>.12?(C+=10,$.push({id:"quiet-zone",passed:false,message:"Something dark touches the code; the quiet zone isn't clear",fix:"Leave clear space (about 4 modules) around the code"})):$.push({id:"quiet-zone",passed:true,message:"Clear space around the code"});}b<2?$.push({id:"resolution",passed:false,message:`Low resolution: about ${Math.round(b*10)/10} px per module`,fix:"Use a larger image, or export the code at a bigger size"}):$.push({id:"resolution",passed:true,message:`About ${Math.round(b)} px per module`});let ht=Math.round(b*4),F=Math.max(0,_-ht),Q=Math.max(0,R-ht),$t=Math.min(m.width,w+ht)-F,Et=Math.min(m.height,S+ht)-Q,Ue=B=>{let at=B/g,Z=qn($t*at,Et*at);Z.ctx.drawImage(l,F,Q,$t,Et,0,0,Z.canvas.width,Z.canvas.height);let St=Z.ctx.getImageData(0,0,Z.canvas.width,Z.canvas.height);return Z.canvas.remove(),St},le=[],Jt=false;for(let[B,at]of o.entries()){await tu(),ze(n);let Z=$i(r,Ue,at,f,St=>St?.data===h.data);C+=eu(B,o.length,Z),le.push(nu(at,o,Z)),B===o.length-1&&Z==="fail"&&(Jt=true);}l.remove();let ue=Math.max(0,Math.min(100,100-C));return Jt&&(ue=Math.min(ue,30)),{data:h.data,version:p,score:ue,grade:ru(ue,Jt),checks:[...le,...$]}}var Xf=[320];function cu(t,e){let n=Math.min(1,e),o=Math.max(1,Math.round(t.width*n)),r=Math.max(1,Math.round(t.height*n)),a=new Uint8ClampedArray(o*r*4),i=t.width/o,c=t.height/r;for(let s=0;s<r;s++){let l=Math.floor(s*c),u=Math.max(l+1,Math.min(t.height,Math.floor((s+1)*c)));for(let m=0;m<o;m++){let h=Math.floor(m*i),d=Math.max(h+1,Math.min(t.width,Math.floor((m+1)*i))),p=[0,0,0,0];for(let b=l;b<u;b++)for(let y=h;y<d;y++){let _=(b*t.width+y)*4;for(let w=0;w<4;w++)p[w]=p[w]+t.data[_+w];}let f=(u-l)*(d-h),g=(s*o+m)*4;for(let b=0;b<4;b++)a[g+b]=p[b]/f;}}return {data:a,width:o,height:r,colorSpace:"srgb"}}function jf(t){try{return new TextDecoder("utf-8",{fatal:!0}).decode(Uint8Array.from(t.binaryData))}catch{return t.data}}async function R_(t,e,n={}){let{width:o,height:r}=t;if(!(o>0&&r>0)||t.data.length<o*r*4)throw new Error("Pixels must be width \xD7 height \xD7 4 RGBA bytes");let a=await xi(),i={data:t.data instanceof Uint8ClampedArray?t.data:Uint8ClampedArray.from(t.data),width:o,height:r},c=a(i.data,o,r,{inversionAttempts:"dontInvert"});if(!c)return {data:null,version:null,passed:false};let s=jf(c),{version:l,location:u}=c;if(!yi(c,e))return {data:s,version:l,passed:false};let m=17+4*l,h=(Qe(u.topLeftCorner,u.topRightCorner)+Qe(u.bottomLeftCorner,u.bottomRightCorner)+Qe(u.topLeftCorner,u.bottomLeftCorner)+Qe(u.topRightCorner,u.bottomRightCorner))/4;for(let d of n.sizes??Xf)if($i(a,f=>cu(i,f/h),d,m,f=>yi(f,e))!=="pass")return {data:s,version:l,passed:false};return {data:s,version:l,passed:true}}$e();var Zf=16,lu=.01;function Jf(t){let e=new Float64Array(256);for(let s of t)e[Math.min(255,Math.max(0,Math.round(s*255)))]++;let n=t.length,o=0;for(let s=0;s<256;s++)o+=s*e[s];let r=0,a=0,i=0,c=128;for(let s=0;s<256;s++){if(a+=e[s],a===0)continue;let l=n-a;if(l===0)break;r+=s*e[s];let u=r/a,m=(o-r)/l,h=a*l*(u-m)**2;h>i&&(i=h,c=s);}return (c+.5)/255}function Kf(t,e){let{width:n,height:o,data:r}=t,a=n*o,i=new Uint8Array(a),c=0;for(let d=0;d<a;d++)r[d*4+3]<128&&c++;if(e==="alpha"||e==="auto"&&c>a*.02&&c<a*.98){for(let d=0;d<a;d++)i[d]=r[d*4+3]>=128?1:0;return i}let l=new Float32Array(a);for(let d=0;d<a;d++){let p=r[d*4+3]/255,f=.2126*r[d*4]+.7152*r[d*4+1]+.0722*r[d*4+2];l[d]=1-(f*p+255*(1-p))/255;}let u=Jf(l);for(let d=0;d<a;d++)i[d]=l[d]>u?1:0;let m=0,h=0;for(let d=0;d<n;d++)for(let p of [0,o-1])m++,h+=i[p*n+d];for(let d=1;d<o-1;d++)for(let p of [0,n-1])m++,h+=i[d*n+p];if(h>m/2)for(let d=0;d<a;d++)i[d]=i[d]?0:1;return i}function uu(t,e,n,o){for(let r of [1,0]){let a=new Uint8Array(t.length);for(let i=0;i<t.length;i++){if(a[i]||t[i]!==r)continue;let c=[i];a[i]=1;let s=false;for(let u of c){let m=u%e,h=(u-m)/e;(m===0||h===0||m===e-1||h===n-1)&&(s=true);for(let[d,p]of [[m-1,h],[m+1,h],[m,h-1],[m,h+1]]){if(d<0||p<0||d>=e||p>=n)continue;let f=p*e+d;!a[f]&&t[f]===r&&(a[f]=1,c.push(f));}}if((r===1||!s)&&c.length<o)for(let u of c)t[u]=r?0:1;}}}function mu(t,e={}){let{width:n,height:o,data:r}=t;if(!(n>0&&o>0)||r.length<n*o*4)throw new Error("Silhouette pixels must be width \xD7 height \xD7 4 RGBA bytes");let a=Kf(t,e.mode??"auto"),i=a.reduce(($,C)=>$+C,0);uu(a,n,o,Math.max(16,i*lu));let c=n,s=o,l=-1,u=-1;for(let $=0;$<o;$++)for(let C=0;C<n;C++)a[$*n+C]&&(c=Math.min(c,C),s=Math.min(s,$),l=Math.max(l,C),u=Math.max(u,$));if(l<0)throw new Error("No shape found: use a picture with a dark or opaque shape on a light or clear background");let m=l-c+1,h=u-s+1;if(Math.max(m,h)<Zf)throw new Error("The shape is too small to trace; use a bigger picture");let p=Math.min(Math.max(Math.round(e.cells??exports.QR_SILHOUETTE_MAX_CELLS),exports.QR_SILHOUETTE_MIN_CELLS),exports.QR_SILHOUETTE_MAX_CELLS)/Math.max(m,h),f=Math.max(exports.QR_SILHOUETTE_MIN_CELLS,Math.round(m*p)),g=Math.max(exports.QR_SILHOUETTE_MIN_CELLS,Math.round(h*p)),b=Math.max(1,Math.round(m*p)),y=Math.max(1,Math.round(h*p)),_=Math.floor((f-b)/2),w=Math.floor((g-y)/2),R=new Uint8Array(f*g);for(let $=0;$<y;$++){let C=s+Math.floor($*h/y),M=Math.max(C+1,s+Math.floor(($+1)*h/y));for(let v=0;v<b;v++){let E=c+Math.floor(v*m/b),A=Math.max(E+1,c+Math.floor((v+1)*m/b)),L=0;for(let k=C;k<M;k++)for(let T=E;T<A;T++)L+=a[k*n+T];R[($+w)*f+v+_]=L*2>=(M-C)*(A-E)?1:0;}}let S=R.reduce(($,C)=>$+C,0);if(uu(R,f,g,Math.max(4,S*lu)),!R.includes(1))throw new Error("The shape is too small to trace; use a bigger picture");return {type:"silhouette",width:f,height:g,cells:Array.from(R,$=>$?"1":"0").join("")}}var wi=512;async function tp(t){if(typeof t!="string"&&!(t instanceof Blob))return t.complete||await new Promise(n=>{t.addEventListener("load",n,{once:true}),t.addEventListener("error",n,{once:true});}),t;let e=typeof t=="string"?t:URL.createObjectURL(t);try{return await new Promise((n,o)=>{let r=new Image;r.crossOrigin="anonymous",r.onload=()=>n(r),r.onerror=()=>o(new Error("Could not load the picture")),r.src=e;})}finally{typeof t!="string"&&setTimeout(()=>URL.revokeObjectURL(e),1e3);}}async function ep(t,e={}){if(typeof document>"u")throw new Error("loadQRSilhouette needs a browser; pass decoded pixels to createQRSilhouette instead");let n=await tp(t),o=n.naturalWidth||n.width||wi,r=n.naturalHeight||n.height||wi,a=wi/Math.max(o,r),i=Math.max(1,Math.round(o*a)),c=Math.max(1,Math.round(r*a)),s=document.createElement("canvas");s.width=i,s.height=c;let l=s.getContext("2d",{willReadFrequently:true});if(!l)throw new Error("Could not get a canvas context");l.drawImage(n,0,0,i,c);let u;try{u=l.getImageData(0,0,i,c);}catch{throw new Error("Could not read the picture (cross-origin images need CORS); upload it instead")}finally{s.remove();}return mu(u,e)}qa();Re();Qr();Dn();async function ce(t){let{QRCodeSVG:e}=await Promise.resolve().then(()=>(Re(),Ml)),{renderToStaticMarkup:n}=await import('react-dom/server'),o=await import('react'),r={...t};if(t.imageSettings?.src)try{let d=await np(t.imageSettings.src);r={...t,imageSettings:{...t.imageSettings,src:d}};}catch{let{imageSettings:d,...p}=t;r=p;}let{hideLogo:a,url:i,logo:c,scale:s,frameLabelMarkers:l,...u}=r,m=o.createElement(e,{...u,templateId:r.templateId,customTemplate:r.customTemplate}),h=n(m);return `data:image/svg+xml,${encodeURIComponent(h)}`}var np=t=>new Promise((e,n)=>{if(t.startsWith("data:")){e(t);return}let o=new Image;o.crossOrigin="anonymous",o.onload=()=>{try{let r=document.createElement("canvas");r.width=o.naturalWidth||o.width,r.height=o.naturalHeight||o.height;let a=r.getContext("2d");if(!a){n(new Error("Could not get canvas context"));return}a.drawImage(o,0,0);let i=r.toDataURL("image/png");r.remove(),e(i);}catch(r){n(new Error(`Failed to convert image to base64: ${r}`));}},o.onerror=()=>{n(new Error(`Could not load image from ${t.slice(0,100)}... Check CORS settings or use a data URL.`));},o.src=t;});async function xo(t,e,n){let o=await ce(t),r=decodeURIComponent(o.replace("data:image/svg+xml,","")),a;try{let i=new TextEncoder().encode(r),c=Array.from(i,l=>String.fromCharCode(l)).join("");a=`data:image/svg+xml;base64,${btoa(c)}`;}catch(i){throw new Error(`Failed to encode SVG for canvas conversion: ${i}`)}return new Promise((i,c)=>{let s=document.createElement("canvas"),l=s.getContext("2d");if(!l){c(new Error("Could not get canvas context"));return}let u=new Image,{width:m,height:h}=be(t.size||bt,t.frame);s.width=Math.round(m),s.height=Math.round(h);let d=setTimeout(()=>{s.remove(),c(new Error("SVG load timeout - image may be too large or contain invalid data"));},3e4);u.onload=()=>{clearTimeout(d);try{if(e==="image/jpeg"&&(l.fillStyle="white",l.fillRect(0,0,s.width,s.height)),l.drawImage(u,0,0,s.width,s.height),n)i(s);else {let p=s.toDataURL(e,1);s.remove(),i(p);}}catch(p){clearTimeout(d),s.remove(),c(new Error(`Failed to draw SVG to canvas: ${p}`));}},u.onerror=()=>{clearTimeout(d),s.remove(),c(new Error("Could not load SVG"));},u.src=a;})}/**
|
|
2
27
|
* @license QR Code generator library (TypeScript)
|
|
3
28
|
* Copyright (c) Project Nayuki.
|
|
4
29
|
* SPDX-License-Identifier: MIT
|
|
5
|
-
*/
|
|
6
|
-
/**
|
|
7
|
-
* @license qrcode.react
|
|
8
|
-
* Copyright (c) Paul O'Shannessy
|
|
9
|
-
* SPDX-License-Identifier: ISC
|
|
10
|
-
*/exports.BODY_PATTERN=Ie;exports.CORNER_EYE_DOT_PATTERNS=Te;exports.CORNER_EYE_PATTERNS=De;exports.PRESET_SIZES=v0;exports.QRCode=B1;exports.QRCodeCanvas=O0;exports.QRCodeSVG=Ht;exports.baseTemplatePropsSchema=A1;exports.bodyPatternSchema=Zt;exports.convertImageSettingsToPixels=Pe;exports.copyQRCodeToClipboard=R0;exports.cornerEyeDotPatternSchema=Qt;exports.cornerEyePatternSchema=Wt;exports.downloadImageData=z1;exports.downloadImageWithBoundingBox=C0;exports.downloadQRCode=x0;exports.errorLevelSchema=Fe;exports.excavateModules=it;exports.excavationSchema=R1;exports.generatePath=ft;exports.getColorString=r1;exports.getImageSettings=_t;exports.getNormalizedColor=o1;exports.getQRAsCanvas=Rt;exports.getQRAsSVG=m0;exports.getQRAsSVGDataUri=lt;exports.getQRCodeDataUrl=E0;exports.getQRData=Yt;exports.getSVGString=S0;exports.getSolidColor=L;exports.handleImageLoad=g0;exports.imageSettingsSchema=Ge;exports.isGradient=e1;exports.normalizeColorConfig=M;exports.qrPropsSchema=P1;exports.templateConfigSchema=T1;exports.templateDefinitionBaseSchema=D1;exports.validateSize=Xt;//# sourceMappingURL=index.js.map
|
|
30
|
+
*/Object.defineProperty(exports,"QRCodeCanvas",{enumerable:true,get:function(){return qrCodeCanvas_js.QRCodeCanvas}});exports.BUILT_IN_FRAME_SPECS=jh;exports.EPS_IMAGE_FILL_REASON=Yl;exports.FRAME_IMPORT_LIMITS=Gt;exports.LOGO_CLEANUP_MAX_SIDE=N0;exports.OFFICIAL_FRAMES=F0;exports.PIXEL_SCAN_SIZES=Xf;exports.PIXEL_SCORE_MIN_CODE_WIDTH=w_;exports.PRESET_SIZES=Ay;exports.QRCode=Pf;exports.QRCodeSVG=Ya;exports.SCAN_CONTRAST_FAIL=X0;exports.SCAN_CONTRAST_LOW=Nf;exports.SCAN_CONTRAST_MIN=cr;exports.SCAN_IMAGE_CONTRAST_MIN=j0;exports.SCAN_TEST_SIZES=K0;exports.SHARP_DOT_EYE_SAFE_BODIES=H0;exports.WEAK_BODY_EYES=q0;exports.WEAK_DOTS=z0;exports.WEAK_DOT_EYES=G0;exports.WEAK_EYES=Q0;exports.WEAK_SHARP_DOT_EYES=U0;exports.baseTemplatePropsSchema=Om;exports.circleQuietZone=Je;exports.clampModuleScale=Vr;exports.convertImageSettingsToPixels=Cl;exports.copyQRCodeToClipboard=Fy;exports.createQRArtImage=pc;exports.createQRSilhouette=mu;exports.damagedCodewords=tr;exports.decodePNGPixels=oi;exports.downloadFile=Pe;exports.downloadImageData=Eb;exports.downloadImageWithBoundingBox=Pb;exports.downloadPrintEPS=$h;exports.downloadPrintPDF=ly;exports.downloadPrintSVG=uy;exports.downloadQRCode=Ly;exports.epsToDataUrl=_o;exports.excavateModules=ro;exports.excavationSchema=Lm;exports.frameLabels=ys;exports.frameSpecPadding=wn;exports.frameSpecQrZone=es;exports.generatePath=Wa;exports.getCodewordMap=Kn;exports.getColorString=vm;exports.getCustomFrameLayout=jo;exports.getDownloadFilename=wh;exports.getFrameDimensions=be;exports.getFrameGapRatio=ta;exports.getFrameIconPath=Uo;exports.getFrameLayout=je;exports.getFrameSecondaryText=bs;exports.getFrameSpecGapRatio=Xo;exports.getFrameSpecIssues=Uu;exports.getFrameText=gs;exports.getImageScanScore=M_;exports.getImageSettings=Me;exports.getImageTones=kf;exports.getImageTonesFromPixels=Tf;exports.getLayoutMargin=Tt;exports.getLogoBlockDamage=ao;exports.getLogoSizeLimit=Mf;exports.getNormalizedColor=Am;exports.getOfficialFrame=Sf;exports.getPrintLayout=bo;exports.getQRArtColorIssue=B1;exports.getQRArtEyeColors=Fa;exports.getQRArtVariant=Wr;exports.getQRAsCanvas=xo;exports.getQRAsEPS=yo;exports.getQRAsPrintPDF=ch;exports.getQRAsPrintPDFBuffer=cy;exports.getQRAsPrintSVG=lh;exports.getQRAsSVG=Cb;exports.getQRAsSVGDataUri=ce;exports.getQRCodeDataUrl=Iy;exports.getQRData=pi;exports.getQRFunctionModules=E1;exports.getQRModuleCount=ih;exports.getQRShapePath=l1;exports.getQRSilhouetteFit=i1;exports.getSVGString=Ty;exports.getScanContrast=Of;exports.getScanScore=S_;exports.getScanScoreFromPixels=C_;exports.getSolidColor=Mt;exports.getStylePairRisk=gi;exports.handleImageLoad=Al;exports.hasImageFill=Xl;exports.imagePositionCss=As;exports.importFrameSvg=Hh;exports.isFrameActive=zt;exports.isGradient=In;exports.isImagePaint=na;exports.isLatin1Text=Au;exports.isQRArtActive=Ra;exports.isShapedCode=ya;exports.isWeakSharpPair=W0;exports.loadQRArtImage=C1;exports.loadQRSilhouette=ep;exports.logoFitsBudget=zd;exports.mixFrameColors=Qt;exports.normalizeColorConfig=Ht;exports.removeLogoBackdrop=O0;exports.removeLogoBackground=wf;exports.renderQRArt=Aa;exports.resolveErrorLevel=Bt;exports.resolveFrameSpec=Yo;exports.rgbToCmyk=Te;exports.sanitizeFrameText=wr;exports.scanQRPixels=R_;exports.svgToEPS=Vl;exports.templateConfigSchema=Dm;exports.templateDefinitionBaseSchema=Bm;exports.validateSize=si;exports.withQRSize=an;//# sourceMappingURL=index.js.map
|
|
11
31
|
//# sourceMappingURL=index.js.map
|