(self.webpackChunksubstack=self.webpackChunksubstack||[]).push([["9327"],{91915:function(t){var e,r;self,r=function(){return(()=>{var t={192:(t,e)=>{var r,n,i=function(){var t,e,r=function(t,e){var r=t,n=a[e],i=null,o=0,u=null,v=[],w={},m=function(t,e){i=function(t){for(var e=Array(t),r=0;r=7&&S(t),null==u&&(u=A(r,n,v)),C(u,e)},b=function(t,e){for(var r=-1;r<=7;r+=1)if(!(t+r<=-1||o<=t+r))for(var n=-1;n<=7;n+=1)e+n<=-1||o<=e+n||(i[t+r][e+n]=0<=r&&r<=6&&(0==n||6==n)||0<=n&&n<=6&&(0==r||6==r)||2<=r&&r<=4&&2<=n&&n<=4)},_=function(){for(var t=8;t>n&1);i[Math.floor(n/3)][n%3+o-8-3]=a}for(n=0;n<18;n+=1)a=!t&&1==(e>>n&1),i[n%3+o-8-3][Math.floor(n/3)]=a},M=function(t,e){for(var r=n<<3|e,a=s.getBCHTypeInfo(r),u=0;u<15;u+=1){var h=!t&&1==(a>>u&1);u<6?i[u][8]=h:u<8?i[u+1][8]=h:i[o-15+u][8]=h}for(u=0;u<15;u+=1)h=!t&&1==(a>>u&1),u<8?i[8][o-u-1]=h:u<9?i[8][15-u-1+1]=h:i[8][15-u-1]=h;i[o-8][8]=!t},C=function(t,e){for(var r=-1,n=o-1,a=7,u=0,h=s.getMaskFunction(e),c=o-1;c>0;c-=2)for(6==c&&(c-=1);;){for(var l=0;l<2;l+=1)if(null==i[n][c-l]){var d=!1;u>>a&1)),h(n,c-l)&&(d=!d),i[n][c-l]=d,-1==(a-=1)&&(u+=1,a=7)}if((n+=r)<0||o<=n){n-=r,r=-r;break}}},A=function(t,e,r){for(var n=c.getRSBlocks(t,e),i=l(),o=0;o8*u)throw"code length overflow. ("+i.getLengthInBits()+">"+8*u+")";for(i.getLengthInBits()+4<=8*u&&i.put(0,4);i.getLengthInBits()%8!=0;)i.putBit(!1);for(;!(i.getLengthInBits()>=8*u||(i.put(236,8),i.getLengthInBits()>=8*u));)i.put(17,8);return function(t,e){for(var r=0,n=0,i=0,o=Array(e.length),a=Array(e.length),u=0;u=0?g.getAt(p):0}}var v=0;for(d=0;dn)&&(t=n,e=r)}return e}())},w.createTableTag=function(t,e){t=t||2;var r="";r+='';for(var n=0;n";for(var i=0;i';r+=""}return(r+="")+"
"},w.createSvgTag=function(t,e,r,n){var i={};"object"==typeof arguments[0]&&(t=(i=arguments[0]).cellSize,e=i.margin,r=i.alt,n=i.title),t=t||2,e=void 0===e?4*t:e,(r="string"==typeof r?{text:r}:r||{}).text=r.text||null,r.id=r.text?r.id||"qrcode-description":null,(n="string"==typeof n?{text:n}:n||{}).text=n.text||null,n.id=n.text?n.id||"qrcode-title":null;var o,a,s,u,h=w.getModuleCount()*t+2*e,c="";for(u="l"+t+",0 0,"+t+" -"+t+",0 0,-"+t+"z ",c+=''+k(n.text)+"":"",c+=r.text?''+k(r.text)+"":"",c+='',c+='"},w.createDataURL=function(t,e){t=t||2,e=void 0===e?4*t:e;var r=w.getModuleCount()*t+2*e,n=e,i=r-e;return y(r,r,function(e,r){if(n<=e&&e"};var k=function(t){for(var e="",r=0;r":e+=">";break;case"&":e+="&";break;case'"':e+=""";break;default:e+=n}}return e};return w.createASCII=function(t,e){if((t=t||1)<2)return function(t){t=void 0===t?2:t;var e,r,n,i,o,a=+w.getModuleCount()+2*t,s=t,u=a-t,h={"██":"█","█ ":"▀"," █":"▄"," ":" "},c={"██":"▀","█ ":"▀"," █":" "," ":" "},l="";for(e=0;e=u?c[o]:h[o];l+="\n"}return a%2&&t>0?l.substring(0,l.length-a-1)+Array(a+1).join("▀"):l.substring(0,l.length-1)}(e);t-=1,e=void 0===e?2*t:e;var r,n,i,o,a=w.getModuleCount()*t+2*e,s=e,u=a-e,h=Array(t+1).join("██"),c=Array(t+1).join(" "),l="",d="";for(r=0;r>>8),e.push(255&o)):e.push(63)}}return e}};var n,i,o,a={L:1,M:0,Q:3,H:2},s=(n=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],o=function(t){for(var e=0;0!=t;)e+=1,t>>>=1;return e},(i={}).getBCHTypeInfo=function(t){for(var e=t<<10;o(e)-o(1335)>=0;)e^=1335<=0;)e^=7973<5&&(r+=3+o-5)}for(n=0;n=256;)e-=255;return t[e]}}}();function h(t,e){if(void 0===t.length)throw t.length+"/"+e;var r=function(){for(var r=0;r>>7-e%8&1)},put:function(t,e){for(var n=0;n>>e-n-1&1))},getLengthInBits:function(){return e},putBit:function(r){var n=Math.floor(e/8);t.length<=n&&t.push(0),r&&(t[n]|=128>>>e%8),e+=1}};return r},d=function(t){var e=function(t){for(var e=0,n=0;n>>8&255)+(255&r),t.put(r,13),e+=2}if(e>>8)},writeBytes:function(t,r,n){r=r||0,n=n||t.length;for(var i=0;i0&&(e+=","),e+=t[r];return e+"]"}};return e},w=function(t){var e=0,r=0,n=0,i=function(t){if(65<=t&&t<=90)return t-65;if(97<=t&&t<=122)return t-97+26;if(48<=t&&t<=57)return t-48+52;if(43==t)return 62;if(47==t)return 63;throw"c:"+t};return{read:function(){for(;n<8;){if(e>=t.length){if(0==n)return -1;throw"unexpected end of file./"+n}var o=t.charAt(e);if(e+=1,"="==o)return n=0,-1;o.match(/^\s$/)||(r=r<<6|i(o.charCodeAt(0)),n+=6)}var a=r>>>n-8&255;return n-=8,a}}},y=function(t,e,r){for(var n,i,o,a,s,u,h,c,l,d,f=(n=Array(t*e),i=function(t){for(var e=1<>>e!=0)throw"length over";for(;u+e>=8;)c.writeByte(255&(t<>>=8-u,h=0,u=0;h|=t<0&&c.writeByte(h)}});l.write(e,i);var d=0,f=String.fromCharCode(n[0]);for(d+=1;da.size()&&(a.size()==1<255;)r.writeByte(255),r.writeBytes(n,o,255),o+=255;r.writeByte(n.length-o),r.writeBytes(n,o,n.length-o),r.writeByte(0),r.writeString(";")}}),g=0;g=6;)l(a>>>s-6),s-=6},c.flush=function(){if(s>0&&(l(a<<6-s),a=0,s=0),u%3!=0)for(var t=3-u%3,e=0;e>6,128|63&n):n<55296||n>=57344?e.push(224|n>>12,128|n>>6&63,128|63&n):(r++,n=65536+((1023&n)<<10|1023&t.charCodeAt(r)),e.push(240|n>>18,128|n>>12&63,128|n>>6&63,128|63&n))}return e}(t)},void 0===(n="function"==typeof(r=function(){return i})?r.apply(e,[]):r)||(t.exports=n)},676:(t,e,r)=>{"use strict";r.d(e,{default:()=>B});var n=function(){return(n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r2||o&&a||s&&u)this._basicSquare({x:e,y:r,size:n,rotation:0});else{if(2===h){var c=0;return o&&s?c=Math.PI/2:s&&a?c=Math.PI:a&&u&&(c=-Math.PI/2),void this._basicCornerRounded({x:e,y:r,size:n,rotation:c})}if(1===h)return c=0,s?c=Math.PI/2:a?c=Math.PI:u&&(c=-Math.PI/2),void this._basicSideRounded({x:e,y:r,size:n,rotation:c})}}else this._basicDot({x:e,y:r,size:n,rotation:0})},t.prototype._drawExtraRounded=function(t){var e=t.x,r=t.y,n=t.size,i=t.getNeighbor,o=i?+i(-1,0):0,a=i?+i(1,0):0,s=i?+i(0,-1):0,u=i?+i(0,1):0,h=o+a+s+u;if(0!==h){if(h>2||o&&a||s&&u)this._basicSquare({x:e,y:r,size:n,rotation:0});else{if(2===h){var c=0;return o&&s?c=Math.PI/2:s&&a?c=Math.PI:a&&u&&(c=-Math.PI/2),void this._basicCornerExtraRounded({x:e,y:r,size:n,rotation:c})}if(1===h)return c=0,s?c=Math.PI/2:a?c=Math.PI:u&&(c=-Math.PI/2),void this._basicSideRounded({x:e,y:r,size:n,rotation:c})}}else this._basicDot({x:e,y:r,size:n,rotation:0})},t.prototype._drawClassy=function(t){var e=t.x,r=t.y,n=t.size,i=t.getNeighbor,o=i?+i(-1,0):0,a=i?+i(1,0):0,s=i?+i(0,-1):0,u=i?+i(0,1):0;0!==o+a+s+u?o||s?a||u?this._basicSquare({x:e,y:r,size:n,rotation:0}):this._basicCornerRounded({x:e,y:r,size:n,rotation:Math.PI/2}):this._basicCornerRounded({x:e,y:r,size:n,rotation:-Math.PI/2}):this._basicCornersRounded({x:e,y:r,size:n,rotation:Math.PI/2})},t.prototype._drawClassyRounded=function(t){var e=t.x,r=t.y,n=t.size,i=t.getNeighbor,o=i?+i(-1,0):0,a=i?+i(1,0):0,s=i?+i(0,-1):0,u=i?+i(0,1):0;0!==o+a+s+u?o||s?a||u?this._basicSquare({x:e,y:r,size:n,rotation:0}):this._basicCornerExtraRounded({x:e,y:r,size:n,rotation:Math.PI/2}):this._basicCornerExtraRounded({x:e,y:r,size:n,rotation:-Math.PI/2}):this._basicCornersRounded({x:e,y:r,size:n,rotation:Math.PI/2})},t}();var l=function(){return(l=Object.assign||function(t){for(var e,r=1,n=arguments.length;r0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]n||i&&i=(e-i.hideXDots)/2&&t<(e+i.hideXDots)/2&&r>=(e-i.hideYDots)/2&&r<(e+i.hideYDots)/2||(null===(n=y[t])||void 0===n?void 0:n[r])||(null===(o=y[t-e+7])||void 0===o?void 0:o[r])||(null===(a=y[t])||void 0===a?void 0:a[r-e+7])||(null===(s=m[t])||void 0===s?void 0:s[r])||(null===(u=m[t-e+7])||void 0===u?void 0:u[r])||(null===(h=m[t])||void 0===h?void 0:h[r-e+7]))}),this.drawCorners(),this._options.image?[4,this.drawImage({width:i.width,height:i.height,count:e,dotSize:n})]:[3,4];case 3:l.sent(),l.label=4;case 4:return[2]}})})},t.prototype.drawBackground=function(){var t,e,r,n=this._element,i=this._options;if(n){var o=null===(t=i.backgroundOptions)||void 0===t?void 0:t.gradient,a=null===(e=i.backgroundOptions)||void 0===e?void 0:e.color;if((o||a)&&this._createColor({options:o,color:a,additionalRotation:0,x:0,y:0,height:i.height,width:i.width,name:"background-color"}),null===(r=i.backgroundOptions)||void 0===r?void 0:r.round){var s=Math.min(i.width,i.height),u=document.createElementNS("http://www.w3.org/2000/svg","rect");this._backgroundClipPath=document.createElementNS("http://www.w3.org/2000/svg","clipPath"),this._backgroundClipPath.setAttribute("id","clip-path-background-color"),this._defs.appendChild(this._backgroundClipPath),u.setAttribute("x",String((i.width-s)/2)),u.setAttribute("y",String((i.height-s)/2)),u.setAttribute("width",String(s)),u.setAttribute("height",String(s)),u.setAttribute("rx",String(s/2*i.backgroundOptions.round)),this._backgroundClipPath.appendChild(u)}}},t.prototype.drawDots=function(t){var e,r,n=this;if(!this._qr)throw"QR code is not defined";var i=this._options,o=this._qr.getModuleCount();if(o>i.width||o>i.height)throw"The canvas is too small.";var a=Math.min(i.width,i.height)-2*i.margin,s=Math.floor((i.shape===p?a/Math.sqrt(2):a)/o),u=Math.floor((i.width-o*s)/2),h=Math.floor((i.height-o*s)/2),l=new c({svg:this._element,type:i.dotsOptions.type});this._dotsClipPath=document.createElementNS("http://www.w3.org/2000/svg","clipPath"),this._dotsClipPath.setAttribute("id","clip-path-dot-color"),this._defs.appendChild(this._dotsClipPath),this._createColor({options:null===(e=i.dotsOptions)||void 0===e?void 0:e.gradient,color:i.dotsOptions.color,additionalRotation:0,x:0,y:0,height:i.height,width:i.width,name:"dot-color"});for(var d=function(e){for(var i=function(i){return t&&!t(e,i)?"continue":(null===(r=f._qr)||void 0===r?void 0:r.isDark(e,i))?(l.draw(u+e*s,h+i*s,s,function(r,a){return!(e+r<0||i+a<0||e+r>=o||i+a>=o)&&!(t&&!t(e+r,i+a))&&!!n._qr&&n._qr.isDark(e+r,i+a)}),void(l._element&&f._dotsClipPath&&f._dotsClipPath.appendChild(l._element))):"continue"},a=0;a=v-1&&g<=w-v&&x>=v-1&&x<=w-v||Math.sqrt((g-_)*(g-_)+(x-_)*(x-_))>_?b[g][x]=0:b[g][x]=+!!this._qr.isDark(x-2*v<0?x:x>=o?x-2*v:x-v,g-2*v<0?g:g>=o?g-2*v:g-v)}var S=function(t){for(var e=function(e){if(!b[t][e])return"continue";l.draw(y+t*s,m+e*s,s,function(r,n){var i;return!!(null===(i=b[t+r])||void 0===i?void 0:i[e+n])}),l._element&&M._dotsClipPath&&M._dotsClipPath.appendChild(l._element)},r=0;r0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]s?u:s)/2));else{var l=((r.rotation||0)+i)%(2*Math.PI),d=(l+2*Math.PI)%(2*Math.PI),f=o+u/2,g=a+s/2,p=o+u/2,v=a+s/2;d>=0&&d<=.25*Math.PI||d>1.75*Math.PI&&d<=2*Math.PI?(f-=u/2,g-=s/2*Math.tan(l),p+=u/2,v+=s/2*Math.tan(l)):d>.25*Math.PI&&d<=.75*Math.PI?(g-=s/2,f-=u/2/Math.tan(l),v+=s/2,p+=u/2/Math.tan(l)):d>.75*Math.PI&&d<=1.25*Math.PI?(f+=u/2,g+=s/2*Math.tan(l),p-=u/2,v-=s/2*Math.tan(l)):d>1.25*Math.PI&&d<=1.75*Math.PI&&(g+=s/2,f+=u/2/Math.tan(l),v-=s/2,p-=u/2/Math.tan(l)),(e=document.createElementNS("http://www.w3.org/2000/svg","linearGradient")).setAttribute("id",h),e.setAttribute("gradientUnits","userSpaceOnUse"),e.setAttribute("x1",String(Math.round(f))),e.setAttribute("y1",String(Math.round(g))),e.setAttribute("x2",String(Math.round(p))),e.setAttribute("y2",String(Math.round(v)))}r.colorStops.forEach(function(t){var r=t.offset,n=t.color,i=document.createElementNS("http://www.w3.org/2000/svg","stop");i.setAttribute("offset",100*r+"%"),i.setAttribute("stop-color",n),e.appendChild(i)}),c.setAttribute("fill","url('#"+h+"')"),this._defs.appendChild(e)}else n&&c.setAttribute("fill",n);this._element.appendChild(c)},t}(),_="canvas";for(var x={},S=0;S<=40;S++)x[S]=S;let M={type:_,shape:"square",width:300,height:300,data:"",margin:0,qrOptions:{typeNumber:x[0],mode:void 0,errorCorrectionLevel:"Q"},imageOptions:{hideBackgroundDots:!0,imageSize:.4,crossOrigin:void 0,margin:0},dotsOptions:{type:"square",color:"#000"},backgroundOptions:{round:0,color:"#fff"}};var C=function(){return(C=Object.assign||function(t){for(var e,r=1,n=arguments.length;rMath.min(e.width,e.height)&&(e.margin=Math.min(e.width,e.height)),e.dotsOptions=C({},e.dotsOptions),e.dotsOptions.gradient&&(e.dotsOptions.gradient=A(e.dotsOptions.gradient)),e.cornersSquareOptions&&(e.cornersSquareOptions=C({},e.cornersSquareOptions),e.cornersSquareOptions.gradient&&(e.cornersSquareOptions.gradient=A(e.cornersSquareOptions.gradient))),e.cornersDotOptions&&(e.cornersDotOptions=C({},e.cornersDotOptions),e.cornersDotOptions.gradient&&(e.cornersDotOptions.gradient=A(e.cornersDotOptions.gradient))),e.backgroundOptions&&(e.backgroundOptions=C({},e.backgroundOptions),e.backgroundOptions.gradient&&(e.backgroundOptions.gradient=A(e.backgroundOptions.gradient))),e}var O=r(192),D=r.n(O),P=function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function a(t){try{u(n.next(t))}catch(t){o(t)}}function s(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):((e=t.value)instanceof r?e:new r(function(t){t(e)})).then(a,s)}u((n=n.apply(t,e||[])).next())})},z=function(t,e){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]\r\n'+(new XMLSerializer).serializeToString(e)],{type:"image/svg+xml"})]:[2,new Promise(function(r){return e.toBlob(r,"image/"+t,1)})]:[2,null]}})})},t.prototype.download=function(t){return P(this,void 0,void 0,function(){var e,r,n,i;return z(this,function(i){switch(i.label){case 0:if(!this._qr)throw"QR code is empty";return e="png",r="qr","string"==typeof t?(e=t,console.warn("Extension is deprecated as argument for 'download' method, please pass object { name: '...', extension: '...' } as argument")):"object"==typeof t&&null!==t&&(t.name&&(r=t.name),t.extension&&(e=t.extension)),[4,this._getElement(e)];case 1:return(n=i.sent())&&("svg"===e.toLowerCase()?s("data:image/svg+xml;charset=utf-8,"+encodeURIComponent('\r\n'+(new XMLSerializer).serializeToString(n)),r+".svg"):s(n.toDataURL("image/"+e),r+"."+e)),[2]}})})},t}()}},e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={exports:{}};return t[n](i,i.exports,r),i.exports}return r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r(676)})().default},t.exports=r()}}]);