"use strict";(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[397],{10397:function(Ie,K,M){M.d(K,{Z:function(){return pe}});var C=M(67294),J=M(87462),q=M(82947),ee=M(93771),te=function(r,d){return C.createElement(ee.Z,(0,J.Z)({},r,{ref:d,icon:q.Z}))},ne=C.forwardRef(te),oe=ne,re=M(93967),se=M.n(re),ie=Object.defineProperty,T=Object.getOwnPropertySymbols,Q=Object.prototype.hasOwnProperty,x=Object.prototype.propertyIsEnumerable,U=(a,r,d)=>r in a?ie(a,r,{enumerable:!0,configurable:!0,writable:!0,value:d}):a[r]=d,b=(a,r)=>{for(var d in r||(r={}))Q.call(r,d)&&U(a,d,r[d]);if(T)for(var d of T(r))x.call(r,d)&&U(a,d,r[d]);return a},F=(a,r)=>{var d={};for(var i in a)Q.call(a,i)&&r.indexOf(i)<0&&(d[i]=a[i]);if(a!=null&&T)for(var i of T(a))r.indexOf(i)<0&&x.call(a,i)&&(d[i]=a[i]);return d};var I;(a=>{const r=class{constructor(e,t,n,o){if(this.version=e,this.errorCorrectionLevel=t,this.modules=[],this.isFunction=[],er.MAX_VERSION)throw new RangeError("Version value out of range");if(o<-1||o>7)throw new RangeError("Mask value out of range");this.size=e*4+17;let s=[];for(let l=0;l7)throw new RangeError("Invalid value");let l,E;for(l=n;;l++){const m=r.getNumDataCodewords(l,t)*8,R=v.getTotalBits(e,l);if(R<=m){E=R;break}if(l>=o)throw new RangeError("Data too long")}for(const m of[r.Ecc.MEDIUM,r.Ecc.QUARTILE,r.Ecc.HIGH])c&&E<=r.getNumDataCodewords(l,m)*8&&(t=m);let g=[];for(const m of e){i(m.mode.modeBits,4,g),i(m.numChars,m.mode.numCharCountBits(l),g);for(const R of m.getData())g.push(R)}u(g.length==E);const P=r.getNumDataCodewords(l,t)*8;u(g.length<=P),i(0,Math.min(4,P-g.length),g),i(0,(8-g.length%8)%8,g),u(g.length%8==0);for(let m=236;g.lengthw[R>>>3]|=m<<7-(R&7)),new r(l,t,w,s)}getModule(e,t){return 0<=e&&e>>9)*1335;const o=(t<<10|n)^21522;u(o>>>15==0);for(let s=0;s<=5;s++)this.setFunctionModule(8,s,f(o,s));this.setFunctionModule(8,7,f(o,6)),this.setFunctionModule(8,8,f(o,7)),this.setFunctionModule(7,8,f(o,8));for(let s=9;s<15;s++)this.setFunctionModule(14-s,8,f(o,s));for(let s=0;s<8;s++)this.setFunctionModule(this.size-1-s,8,f(o,s));for(let s=8;s<15;s++)this.setFunctionModule(8,this.size-15+s,f(o,s));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let e=this.version;for(let n=0;n<12;n++)e=e<<1^(e>>>11)*7973;const t=this.version<<12|e;u(t>>>18==0);for(let n=0;n<18;n++){const o=f(t,n),s=this.size-11+n%3,c=Math.floor(n/3);this.setFunctionModule(s,c,o),this.setFunctionModule(c,s,o)}}drawFinderPattern(e,t){for(let n=-4;n<=4;n++)for(let o=-4;o<=4;o++){const s=Math.max(Math.abs(o),Math.abs(n)),c=e+o,l=t+n;0<=c&&c{(m!=E-s||p>=l)&&w.push(R[m])});return u(w.length==c),w}drawCodewords(e){if(e.length!=Math.floor(r.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let t=0;for(let n=this.size-1;n>=1;n-=2){n==6&&(n=5);for(let o=0;o>>3],7-(t&7)),t++)}}u(t==e.length*8)}applyMask(e){if(e<0||e>7)throw new RangeError("Mask value out of range");for(let t=0;t5&&e++):(this.finderPenaltyAddHistory(l,E),c||(e+=this.finderPenaltyCountPatterns(E)*r.PENALTY_N3),c=this.modules[s][g],l=1);e+=this.finderPenaltyTerminateAndCount(c,l,E)*r.PENALTY_N3}for(let s=0;s5&&e++):(this.finderPenaltyAddHistory(l,E),c||(e+=this.finderPenaltyCountPatterns(E)*r.PENALTY_N3),c=this.modules[g][s],l=1);e+=this.finderPenaltyTerminateAndCount(c,l,E)*r.PENALTY_N3}for(let s=0;sc+(l?1:0),t);const n=this.size*this.size,o=Math.ceil(Math.abs(t*20-n*10)/n)-1;return u(0<=o&&o<=9),e+=o*r.PENALTY_N4,u(0<=e&&e<=2568888),e}getAlignmentPatternPositions(){if(this.version==1)return[];{const e=Math.floor(this.version/7)+2,t=this.version==32?26:Math.ceil((this.version*4+4)/(e*2-2))*2;let n=[6];for(let o=this.size-7;n.lengthr.MAX_VERSION)throw new RangeError("Version number out of range");let t=(16*e+128)*e+64;if(e>=2){const n=Math.floor(e/7)+2;t-=(25*n-10)*n-55,e>=7&&(t-=36)}return u(208<=t&&t<=29648),t}static getNumDataCodewords(e,t){return Math.floor(r.getNumRawDataModules(e)/8)-r.ECC_CODEWORDS_PER_BLOCK[t.ordinal][e]*r.NUM_ERROR_CORRECTION_BLOCKS[t.ordinal][e]}static reedSolomonComputeDivisor(e){if(e<1||e>255)throw new RangeError("Degree out of range");let t=[];for(let o=0;o0);for(const o of e){const s=o^n.shift();n.push(0),t.forEach((c,l)=>n[l]^=r.reedSolomonMultiply(c,s))}return n}static reedSolomonMultiply(e,t){if(e>>>8||t>>>8)throw new RangeError("Byte out of range");let n=0;for(let o=7;o>=0;o--)n=n<<1^(n>>>7)*285,n^=(t>>>o&1)*e;return u(n>>>8==0),n}finderPenaltyCountPatterns(e){const t=e[1];u(t<=this.size*3);const n=t>0&&e[2]==t&&e[3]==t*3&&e[4]==t&&e[5]==t;return(n&&e[0]>=t*4&&e[6]>=t?1:0)+(n&&e[6]>=t*4&&e[0]>=t?1:0)}finderPenaltyTerminateAndCount(e,t,n){return e&&(this.finderPenaltyAddHistory(t,n),t=0),t+=this.size,this.finderPenaltyAddHistory(t,n),this.finderPenaltyCountPatterns(n)}finderPenaltyAddHistory(e,t){t[0]==0&&(e+=this.size),t.pop(),t.unshift(e)}};let d=r;d.MIN_VERSION=1,d.MAX_VERSION=40,d.PENALTY_N1=3,d.PENALTY_N2=3,d.PENALTY_N3=40,d.PENALTY_N4=10,d.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]],d.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=d;function i(e,t,n){if(t<0||t>31||e>>>t)throw new RangeError("Value out of range");for(let o=t-1;o>=0;o--)n.push(e>>>o&1)}function f(e,t){return(e>>>t&1)!=0}function u(e){if(!e)throw new Error("Assertion error")}const h=class{constructor(e,t,n){if(this.mode=e,this.numChars=t,this.bitData=n,t<0)throw new RangeError("Invalid argument");this.bitData=n.slice()}static makeBytes(e){let t=[];for(const n of e)i(n,8,t);return new h(h.Mode.BYTE,e.length,t)}static makeNumeric(e){if(!h.isNumeric(e))throw new RangeError("String contains non-numeric characters");let t=[];for(let n=0;n=1<{let r;(d=>{const i=class{constructor(u,h){this.ordinal=u,this.formatBits=h}};let f=i;f.LOW=new i(0,1),f.MEDIUM=new i(1,0),f.QUARTILE=new i(2,3),f.HIGH=new i(3,2),d.Ecc=f})(r=a.QrCode||(a.QrCode={}))})(I||(I={})),(a=>{let r;(d=>{const i=class{constructor(u,h){this.modeBits=u,this.numBitsCharCount=h}numCharCountBits(u){return this.numBitsCharCount[Math.floor((u+7)/17)]}};let f=i;f.NUMERIC=new i(1,[10,12,14]),f.ALPHANUMERIC=new i(2,[9,11,13]),f.BYTE=new i(4,[8,16,16]),f.KANJI=new i(8,[8,10,12]),f.ECI=new i(7,[0,0,0]),d.Mode=f})(r=a.QrSegment||(a.QrSegment={}))})(I||(I={}));var O=I;var $={L:O.QrCode.Ecc.LOW,M:O.QrCode.Ecc.MEDIUM,Q:O.QrCode.Ecc.QUARTILE,H:O.QrCode.Ecc.HIGH},H=128,_="L",k="#FFFFFF",Y="#000000",j=!1,z=4,le=.1;function G(a,r=0){const d=[];return a.forEach(function(i,f){let u=null;i.forEach(function(h,v){if(!h&&u!==null){d.push(`M${u+r} ${f+r}h${v-u}v1H${u+r}z`),u=null;return}if(v===i.length-1){if(!h)return;u===null?d.push(`M${v+r},${f+r} h1v1H${v+r}z`):d.push(`M${u+r},${f+r} h${v+1-u}v1H${u+r}z`);return}h&&u===null&&(u=v)})}),d.join("")}function W(a,r){return a.slice().map((d,i)=>i=r.y+r.h?d:d.map((f,u)=>u=r.x+r.w?f:!1))}function X(a,r,d,i){if(i==null)return null;const f=d?z:0,u=a.length+f*2,h=Math.floor(r*le),v=u/r,e=(i.width||h)*v,t=(i.height||h)*v,n=i.x==null?a.length/2-e/2:i.x*v,o=i.y==null?a.length/2-t/2:i.y*v;let s=null;if(i.excavate){let c=Math.floor(n),l=Math.floor(o),E=Math.ceil(e+n-c),g=Math.ceil(t+o-l);s={x:c,y:l,w:E,h:g}}return{x:n,y:o,h:t,w:e,excavation:s}}var ae=function(){try{new Path2D().addPath(new Path2D)}catch(a){return!1}return!0}();function Z(a){const r=a,{value:d,size:i=H,level:f=_,bgColor:u=k,fgColor:h=Y,includeMargin:v=j,style:e,imageSettings:t}=r,n=F(r,["value","size","level","bgColor","fgColor","includeMargin","style","imageSettings"]),o=t==null?void 0:t.src,s=(0,C.useRef)(null),c=(0,C.useRef)(null),[l,E]=(0,C.useState)(!1);(0,C.useEffect)(()=>{if(s.current!=null){const w=s.current,m=w.getContext("2d");if(!m)return;let R=O.QrCode.encodeText(d,$[f]).getModules();const p=v?z:0,S=R.length+p*2,N=X(R,i,v,t),y=c.current,L=N!=null&&y!==null&&y.complete&&y.naturalHeight!==0&&y.naturalWidth!==0;L&&N.excavation!=null&&(R=W(R,N.excavation));const A=window.devicePixelRatio||1;w.height=w.width=i*A;const B=i/S*A;m.scale(B,B),m.fillStyle=u,m.fillRect(0,0,S,S),m.fillStyle=h,ae?m.fill(new Path2D(G(R,p))):R.forEach(function(D,Ae){D.forEach(function(Pe,Ne){Pe&&m.fillRect(Ne+p,Ae+p,1,1)})}),L&&m.drawImage(y,N.x+p,N.y+p,N.w,N.h)}}),(0,C.useEffect)(()=>{E(!1)},[o]);const g=b({height:i,width:i},e);let P=null;return o!=null&&(P=C.createElement("img",{src:o,key:o,style:{display:"none"},onLoad:()=>{E(!0)},ref:c})),C.createElement(C.Fragment,null,C.createElement("canvas",b({style:g,height:i,width:i,ref:s},n)),P)}function V(a){const r=a,{value:d,size:i=H,level:f=_,bgColor:u=k,fgColor:h=Y,includeMargin:v=j,imageSettings:e}=r,t=F(r,["value","size","level","bgColor","fgColor","includeMargin","imageSettings"]);let n=O.QrCode.encodeText(d,$[f]).getModules();const o=v?z:0,s=n.length+o*2,c=X(n,i,v,e);let l=null;e!=null&&c!=null&&(c.excavation!=null&&(n=W(n,c.excavation)),l=C.createElement("image",{xlinkHref:e.src,height:c.h,width:c.w,x:c.x+o,y:c.y+o,preserveAspectRatio:"none"}));const E=G(n,o);return C.createElement("svg",b({height:i,width:i,viewBox:`0 0 ${s} ${s}`},t),C.createElement("path",{fill:u,d:`M0,0 h${s}v${s}H0z`,shapeRendering:"crispEdges"}),C.createElement("path",{fill:h,d:E,shapeRendering:"crispEdges"}),l)}var Se=a=>{const r=a,{renderAs:d}=r,i=F(r,["renderAs"]);return d==="svg"?React.createElement(V,b({},i)):React.createElement(Z,b({},i))},ce=M(14726),de=M(53124),ue=M(10110),he=M(75081),fe=M(29691),ge=M(54548),me=M(10274),Ee=M(14747),Ce=M(91945),ve=M(45503);const Re=a=>{const{componentCls:r,lineWidth:d,lineType:i,colorSplit:f}=a;return{[r]:Object.assign(Object.assign({},(0,Ee.Wf)(a)),{display:"flex",justifyContent:"center",alignItems:"center",padding:a.paddingSM,backgroundColor:a.colorWhite,borderRadius:a.borderRadiusLG,border:`${(0,ge.bf)(d)} ${i} ${f}`,position:"relative",overflow:"hidden",[`& > ${r}-mask`]:{position:"absolute",insetBlockStart:0,insetInlineStart:0,zIndex:10,display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",width:"100%",height:"100%",color:a.colorText,lineHeight:a.lineHeight,background:a.QRCodeMaskBackgroundColor,textAlign:"center",[`& > ${r}-expired, & > ${r}-scanned`]:{color:a.QRCodeTextColor}},"> canvas":{alignSelf:"stretch",flex:"auto",minWidth:0},"&-icon":{marginBlockEnd:a.marginXS,fontSize:a.controlHeight}}),[`${r}-borderless`]:{borderColor:"transparent",padding:0,borderRadius:0}}},Me=a=>({QRCodeMaskBackgroundColor:new me.C(a.colorBgContainer).setAlpha(.96).toRgbString()});var we=(0,Ce.I$)("QRCode",a=>{const r=(0,ve.TS)(a,{QRCodeTextColor:a.colorText});return Re(r)},Me),pe=a=>{var r,d;const[,i]=(0,fe.ZP)(),{value:f,type:u="canvas",icon:h="",size:v=160,iconSize:e=40,color:t=i.colorText,errorLevel:n="M",status:o="active",bordered:s=!0,onRefresh:c,style:l,className:E,rootClassName:g,prefixCls:P,bgColor:w="transparent"}=a,{getPrefixCls:m}=(0,C.useContext)(de.E_),R=m("qrcode",P),[p,S,N]=we(R),y={src:h,x:void 0,y:void 0,height:e,width:e,excavate:!0},L={value:f,size:v,level:n,bgColor:w,fgColor:t,style:{width:l==null?void 0:l.width,height:l==null?void 0:l.height},imageSettings:h?y:void 0},[A]=(0,ue.Z)("QRCode");if(!f)return null;const B=se()(R,E,g,S,N,{[`${R}-borderless`]:!s}),D=Object.assign(Object.assign({backgroundColor:w},l),{width:(r=l==null?void 0:l.width)!==null&&r!==void 0?r:v,height:(d=l==null?void 0:l.height)!==null&&d!==void 0?d:v});return p(C.createElement("div",{className:B,style:D},o!=="active"&&C.createElement("div",{className:`${R}-mask`},o==="loading"&&C.createElement(he.Z,null),o==="expired"&&C.createElement(C.Fragment,null,C.createElement("p",{className:`${R}-expired`},A==null?void 0:A.expired),c&&C.createElement(ce.ZP,{type:"link",icon:C.createElement(oe,null),onClick:c},A==null?void 0:A.refresh)),o==="scanned"&&C.createElement("p",{className:`${R}-scanned`},A==null?void 0:A.scanned)),u==="canvas"?C.createElement(Z,Object.assign({},L)):C.createElement(V,Object.assign({},L))))}}}]);