tt-pdf-generator 1.3.0 → 1.4.0
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.
|
@@ -1,14 +1,47 @@
|
|
|
1
|
-
var Rn=Object.create;var vt=Object.defineProperty;var In=Object.getOwnPropertyDescriptor;var Bn=Object.getOwnPropertyNames;var Mn=Object.getPrototypeOf,Nn=Object.prototype.hasOwnProperty;var p=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var kn=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Bn(e))!Nn.call(t,o)&&o!==r&&vt(t,o,{get:()=>e[o],enumerable:!(n=In(e,o))||n.enumerable});return t};var Y=(t,e,r)=>(r=t!=null?Rn(Mn(t)):{},kn(e||!t||!t.__esModule?vt(r,"default",{value:t,enumerable:!0}):r,t));var Nt=p((hi,Mt)=>{function Fn(t){this.value=t,this.match=function(e){return this.value>=e.height}}function On(t){this.value=t,this.match=function(e){return this.value<e.height}}function Dn(t){this.value=t,this.match=function(e){return this.value>=e.width}}function _n(t){this.value=t,this.match=function(e){return this.value<e.width}}function $n(t){this.value=t,this.match=function(e){return this.value===e.orientation}}Mt.exports=function(e,r){switch(e){case"max-height":return new Fn(r);case"min-height":return new On(r);case"max-width":return new Dn(r);case"min-width":return new _n(r);case"orientation":return new $n(r);default:throw new Error(r)}}});var Lt=p((pi,kt)=>{function Un(t,e){this.left=t,this.right=e,this.match=function(r){return t.match(r)&&e.match(r)}}function qn(t,e){this.left=t,this.right=e,this.match=function(r){return t.match(r)||e.match(r)}}kt.exports=function(e,r,n){switch(e){case"and":return new Un(r,n);case",":return new qn(r,n);default:throw new Error(value)}}});var _t=p((gi,Dt)=>{var Vn=Nt(),jn=Lt(),Ft=/[0-9]/,_e=/[a-z|\-]/i,zn=/\s/,Ot=/:/,Hn=/,/,Wn=/and$/,Jn=/@/;function Gn(t){for(var e=0,r=[];e<t.length;){var n=t[e];if(Jn.test(n))for(n=t[++e];_e.test(n)&&n!==void 0;)n=t[++e];if(zn.test(n)||n===")"||n==="("){e++;continue}if(Ot.test(n)||Hn.test(n)){e++,r.push({type:"operator",value:n});continue}if(Ft.test(n)){for(var o="";Ft.test(n);)o+=n,n=t[++e];r.push({type:"number",value:o});continue}if(_e.test(n)){for(var o="";_e.test(n)&&n!==void 0;)o+=n,n=t[++e];Wn.test(o)?r.push({type:"operator",value:o}):r.push({type:"literal",value:o});continue}throw new TypeError("Tokenizer: I dont know what this character is: "+n)}return r}function Yn(t){for(var e=[],r=[];t.length>0;){var n=t.shift();if(n.type==="number"||n.type==="literal"){e.push(n);continue}if(n.type==="operator"){if(Ot.test(n.value)){n={type:"query",key:e.pop(),value:t.shift()},e.push(n);continue}for(;r.length>0;)e.unshift(r.pop());r.push(n)}}for(;r.length>0;)e.unshift(r.pop());function o(){var i=e.shift();if(i.type==="number")return parseInt(i.value);if(i.type==="literal")return i.value;if(i.type==="operator"){var s=o(),a=o();return jn(i.value,s,a)}if(i.type==="query"){var s=i.key.value,a=i.value.value;return Vn(s,a)}}return o()}Dt.exports={parse:function(t){var e=Gn(t),r=Yn(e);return r}}});var Ut=p((mi,$t)=>{var Kn=_t();$t.exports=function(t,e){var r={};return Object.keys(t).forEach(function(n){Kn.parse(n).match(e)&&Object.assign(r,t[n])}),r}});var Vt=p((yi,qt)=>{var Qn=function(t,e,r){if(t==null)return[0,0,0];var n=(1-Math.abs(2*r-1))*e,o=t/60,i=n*(1-Math.abs(o%2-1));o=Math.floor(o);var s,a,l;o===0?(s=n,a=i,l=0):o===1?(s=i,a=n,l=0):o===2?(s=0,a=n,l=i):o===3?(s=0,a=i,l=n):o===4?(s=i,a=0,l=n):o===5&&(s=n,a=0,l=i);var u=r-n/2;return s+=u,a+=u,l+=u,[Math.abs(Math.round(s*255)),Math.abs(Math.round(a*255)),Math.abs(Math.round(l*255))]};qt.exports=Qn});var zt=p((bi,jt)=>{var Xn=Vt();function $e(t,e){return t>e?e:t}function Ue(t,e){return t<e?e:t}function Zn(t){for(t=$e(t,1e7),t=Ue(t,-1e7);t<0;)t+=360;for(;t>359;)t-=360;return t}function eo(t,e,r){t=Zn(t),e=Ue($e(e,100),0),r=Ue($e(r,100),0),e/=100,r/=100;var n=Xn(t,e,r);return"#"+n.map(function(o){return(256+o).toString(16).substr(-2)}).join("")}jt.exports=eo});var Wt=p((wi,Ht)=>{"use strict";Ht.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}});var Gt=p((Ci,Jt)=>{Jt.exports=function(e){return!e||typeof e=="string"?!1:e instanceof Array||Array.isArray(e)||e.length>=0&&(e.splice instanceof Function||Object.getOwnPropertyDescriptor(e,e.length-1)&&e.constructor.name!=="String")}});var Qt=p((Ei,Kt)=>{"use strict";var to=Gt(),ro=Array.prototype.concat,no=Array.prototype.slice,Yt=Kt.exports=function(e){for(var r=[],n=0,o=e.length;n<o;n++){var i=e[n];to(i)?r=ro.call(r,no.call(i)):r.push(i)}return r};Yt.wrap=function(t){return function(){return t(Yt(arguments))}}});var tr=p((Ai,er)=>{var ne=Wt(),oe=Qt(),Xt=Object.hasOwnProperty,Zt=Object.create(null);for(pe in ne)Xt.call(ne,pe)&&(Zt[ne[pe]]=pe);var pe,P=er.exports={to:{},get:{}};P.get=function(t){var e=t.substring(0,3).toLowerCase(),r,n;switch(e){case"hsl":r=P.get.hsl(t),n="hsl";break;case"hwb":r=P.get.hwb(t),n="hwb";break;default:r=P.get.rgb(t),n="rgb";break}return r?{model:n,value:r}:null};P.get.rgb=function(t){if(!t)return null;var e=/^#([a-f0-9]{3,4})$/i,r=/^#([a-f0-9]{6})([a-f0-9]{2})?$/i,n=/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,o=/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,i=/^(\w+)$/,s=[0,0,0,1],a,l,u;if(a=t.match(r)){for(u=a[2],a=a[1],l=0;l<3;l++){var d=l*2;s[l]=parseInt(a.slice(d,d+2),16)}u&&(s[3]=parseInt(u,16)/255)}else if(a=t.match(e)){for(a=a[1],u=a[3],l=0;l<3;l++)s[l]=parseInt(a[l]+a[l],16);u&&(s[3]=parseInt(u+u,16)/255)}else if(a=t.match(n)){for(l=0;l<3;l++)s[l]=parseInt(a[l+1],0);a[4]&&(a[5]?s[3]=parseFloat(a[4])*.01:s[3]=parseFloat(a[4]))}else if(a=t.match(o)){for(l=0;l<3;l++)s[l]=Math.round(parseFloat(a[l+1])*2.55);a[4]&&(a[5]?s[3]=parseFloat(a[4])*.01:s[3]=parseFloat(a[4]))}else return(a=t.match(i))?a[1]==="transparent"?[0,0,0,0]:Xt.call(ne,a[1])?(s=ne[a[1]],s[3]=1,s):null:null;for(l=0;l<3;l++)s[l]=F(s[l],0,255);return s[3]=F(s[3],0,1),s};P.get.hsl=function(t){if(!t)return null;var e=/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,r=t.match(e);if(r){var n=parseFloat(r[4]),o=(parseFloat(r[1])%360+360)%360,i=F(parseFloat(r[2]),0,100),s=F(parseFloat(r[3]),0,100),a=F(isNaN(n)?1:n,0,1);return[o,i,s,a]}return null};P.get.hwb=function(t){if(!t)return null;var e=/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,r=t.match(e);if(r){var n=parseFloat(r[4]),o=(parseFloat(r[1])%360+360)%360,i=F(parseFloat(r[2]),0,100),s=F(parseFloat(r[3]),0,100),a=F(isNaN(n)?1:n,0,1);return[o,i,s,a]}return null};P.to.hex=function(){var t=oe(arguments);return"#"+ge(t[0])+ge(t[1])+ge(t[2])+(t[3]<1?ge(Math.round(t[3]*255)):"")};P.to.rgb=function(){var t=oe(arguments);return t.length<4||t[3]===1?"rgb("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+")":"rgba("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+", "+t[3]+")"};P.to.rgb.percent=function(){var t=oe(arguments),e=Math.round(t[0]/255*100),r=Math.round(t[1]/255*100),n=Math.round(t[2]/255*100);return t.length<4||t[3]===1?"rgb("+e+"%, "+r+"%, "+n+"%)":"rgba("+e+"%, "+r+"%, "+n+"%, "+t[3]+")"};P.to.hsl=function(){var t=oe(arguments);return t.length<4||t[3]===1?"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)":"hsla("+t[0]+", "+t[1]+"%, "+t[2]+"%, "+t[3]+")"};P.to.hwb=function(){var t=oe(arguments),e="";return t.length>=4&&t[3]!==1&&(e=", "+t[3]),"hwb("+t[0]+", "+t[1]+"%, "+t[2]+"%"+e+")"};P.to.keyword=function(t){return Zt[t.slice(0,3)]};function F(t,e,r){return Math.min(Math.max(e,t),r)}function ge(t){var e=Math.round(t).toString(16).toUpperCase();return e.length<2?"0"+e:e}});var nr=p((xi,rr)=>{var qe=40,Ve=41,me=39,je=34,ze=92,K=47,He=44,We=58,ye=42,oo=117,so=85,io=43,ao=/^[a-f0-9?-]+$/i;rr.exports=function(t){for(var e=[],r=t,n,o,i,s,a,l,u,d,c=0,f=r.charCodeAt(c),m=r.length,y=[{nodes:e}],g=0,h,S="",R="",I="";c<m;)if(f<=32){n=c;do n+=1,f=r.charCodeAt(n);while(f<=32);s=r.slice(c,n),i=e[e.length-1],f===Ve&&g?I=s:i&&i.type==="div"?(i.after=s,i.sourceEndIndex+=s.length):f===He||f===We||f===K&&r.charCodeAt(n+1)!==ye&&(!h||h&&h.type==="function"&&h.value!=="calc")?R=s:e.push({type:"space",sourceIndex:c,sourceEndIndex:n,value:s}),c=n}else if(f===me||f===je){n=c,o=f===me?"'":'"',s={type:"string",sourceIndex:c,quote:o};do if(a=!1,n=r.indexOf(o,n+1),~n)for(l=n;r.charCodeAt(l-1)===ze;)l-=1,a=!a;else r+=o,n=r.length-1,s.unclosed=!0;while(a);s.value=r.slice(c+1,n),s.sourceEndIndex=s.unclosed?n:n+1,e.push(s),c=n+1,f=r.charCodeAt(c)}else if(f===K&&r.charCodeAt(c+1)===ye)n=r.indexOf("*/",c),s={type:"comment",sourceIndex:c,sourceEndIndex:n+2},n===-1&&(s.unclosed=!0,n=r.length,s.sourceEndIndex=n),s.value=r.slice(c+2,n),e.push(s),c=n+2,f=r.charCodeAt(c);else if((f===K||f===ye)&&h&&h.type==="function"&&h.value==="calc")s=r[c],e.push({type:"word",sourceIndex:c-R.length,sourceEndIndex:c+s.length,value:s}),c+=1,f=r.charCodeAt(c);else if(f===K||f===He||f===We)s=r[c],e.push({type:"div",sourceIndex:c-R.length,sourceEndIndex:c+s.length,value:s,before:R,after:""}),R="",c+=1,f=r.charCodeAt(c);else if(qe===f){n=c;do n+=1,f=r.charCodeAt(n);while(f<=32);if(d=c,s={type:"function",sourceIndex:c-S.length,value:S,before:r.slice(d+1,n)},c=n,S==="url"&&f!==me&&f!==je){n-=1;do if(a=!1,n=r.indexOf(")",n+1),~n)for(l=n;r.charCodeAt(l-1)===ze;)l-=1,a=!a;else r+=")",n=r.length-1,s.unclosed=!0;while(a);u=n;do u-=1,f=r.charCodeAt(u);while(f<=32);d<u?(c!==u+1?s.nodes=[{type:"word",sourceIndex:c,sourceEndIndex:u+1,value:r.slice(c,u+1)}]:s.nodes=[],s.unclosed&&u+1!==n?(s.after="",s.nodes.push({type:"space",sourceIndex:u+1,sourceEndIndex:n,value:r.slice(u+1,n)})):(s.after=r.slice(u+1,n),s.sourceEndIndex=n)):(s.after="",s.nodes=[]),c=n+1,s.sourceEndIndex=s.unclosed?n:c,f=r.charCodeAt(c),e.push(s)}else g+=1,s.after="",s.sourceEndIndex=c+1,e.push(s),y.push(s),e=s.nodes=[],h=s;S=""}else if(Ve===f&&g)c+=1,f=r.charCodeAt(c),h.after=I,h.sourceEndIndex+=I.length,I="",g-=1,y[y.length-1].sourceEndIndex=c,y.pop(),h=y[g],e=h.nodes;else{n=c;do f===ze&&(n+=1),n+=1,f=r.charCodeAt(n);while(n<m&&!(f<=32||f===me||f===je||f===He||f===We||f===K||f===qe||f===ye&&h&&h.type==="function"&&h.value==="calc"||f===K&&h.type==="function"&&h.value==="calc"||f===Ve&&g));s=r.slice(c,n),qe===f?S=s:(oo===s.charCodeAt(0)||so===s.charCodeAt(0))&&io===s.charCodeAt(1)&&ao.test(s.slice(2))?e.push({type:"unicode-range",sourceIndex:c,sourceEndIndex:n,value:s}):e.push({type:"word",sourceIndex:c,sourceEndIndex:n,value:s}),c=n}for(c=y.length-1;c;c-=1)y[c].unclosed=!0,y[c].sourceEndIndex=r.length;return y[0].nodes}});var sr=p((Ti,or)=>{var be=45,we=43,Je=46,lo=101,co=69;function uo(t){var e=t.charCodeAt(0),r;if(e===we||e===be){if(r=t.charCodeAt(1),r>=48&&r<=57)return!0;var n=t.charCodeAt(2);return r===Je&&n>=48&&n<=57}return e===Je?(r=t.charCodeAt(1),r>=48&&r<=57):e>=48&&e<=57}or.exports=function(t){var e=0,r=t.length,n,o,i;if(r===0||!uo(t))return!1;for(n=t.charCodeAt(e),(n===we||n===be)&&e++;e<r&&(n=t.charCodeAt(e),!(n<48||n>57));)e+=1;if(n=t.charCodeAt(e),o=t.charCodeAt(e+1),n===Je&&o>=48&&o<=57)for(e+=2;e<r&&(n=t.charCodeAt(e),!(n<48||n>57));)e+=1;if(n=t.charCodeAt(e),o=t.charCodeAt(e+1),i=t.charCodeAt(e+2),(n===lo||n===co)&&(o>=48&&o<=57||(o===we||o===be)&&i>=48&&i<=57))for(e+=o===we||o===be?3:2;e<r&&(n=t.charCodeAt(e),!(n<48||n>57));)e+=1;return{number:t.slice(0,e),unit:t.slice(e)}}});var wr=p((Ni,br)=>{br.exports=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}});var _=p(j=>{var tt,ss=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];j.getSymbolSize=function(e){if(!e)throw new Error('"version" cannot be null or undefined');if(e<1||e>40)throw new Error('"version" should be in range from 1 to 40');return e*4+17};j.getSymbolTotalCodewords=function(e){return ss[e]};j.getBCHDigit=function(t){let e=0;for(;t!==0;)e++,t>>>=1;return e};j.setToSJISFunction=function(e){if(typeof e!="function")throw new Error('"toSJISFunc" is not a valid function.');tt=e};j.isKanjiModeEnabled=function(){return typeof tt<"u"};j.toSJIS=function(e){return tt(e)}});var Se=p(v=>{v.L={bit:1};v.M={bit:0};v.Q={bit:3};v.H={bit:2};function is(t){if(typeof t!="string")throw new Error("Param is not a string");switch(t.toLowerCase()){case"l":case"low":return v.L;case"m":case"medium":return v.M;case"q":case"quartile":return v.Q;case"h":case"high":return v.H;default:throw new Error("Unknown EC Level: "+t)}}v.isValid=function(e){return e&&typeof e.bit<"u"&&e.bit>=0&&e.bit<4};v.from=function(e,r){if(v.isValid(e))return e;try{return is(e)}catch{return r}}});var Ar=p((Fi,Er)=>{function Cr(){this.buffer=[],this.length=0}Cr.prototype={get:function(t){let e=Math.floor(t/8);return(this.buffer[e]>>>7-t%8&1)===1},put:function(t,e){for(let r=0;r<e;r++)this.putBit((t>>>e-r-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(t){let e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}};Er.exports=Cr});var Tr=p((Oi,xr)=>{function se(t){if(!t||t<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=t,this.data=new Uint8Array(t*t),this.reservedBit=new Uint8Array(t*t)}se.prototype.set=function(t,e,r,n){let o=t*this.size+e;this.data[o]=r,n&&(this.reservedBit[o]=!0)};se.prototype.get=function(t,e){return this.data[t*this.size+e]};se.prototype.xor=function(t,e,r){this.data[t*this.size+e]^=r};se.prototype.isReserved=function(t,e){return this.reservedBit[t*this.size+e]};xr.exports=se});var Sr=p(Pe=>{var as=_().getSymbolSize;Pe.getRowColCoords=function(e){if(e===1)return[];let r=Math.floor(e/7)+2,n=as(e),o=n===145?26:Math.ceil((n-13)/(2*r-2))*2,i=[n-7];for(let s=1;s<r-1;s++)i[s]=i[s-1]-o;return i.push(6),i.reverse()};Pe.getPositions=function(e){let r=[],n=Pe.getRowColCoords(e),o=n.length;for(let i=0;i<o;i++)for(let s=0;s<o;s++)i===0&&s===0||i===0&&s===o-1||i===o-1&&s===0||r.push([n[i],n[s]]);return r}});var Rr=p(vr=>{var ls=_().getSymbolSize,Pr=7;vr.getPositions=function(e){let r=ls(e);return[[0,0],[r-Pr,0],[0,r-Pr]]}});var Ir=p(C=>{C.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};var z={N1:3,N2:3,N3:40,N4:10};C.isValid=function(e){return e!=null&&e!==""&&!isNaN(e)&&e>=0&&e<=7};C.from=function(e){return C.isValid(e)?parseInt(e,10):void 0};C.getPenaltyN1=function(e){let r=e.size,n=0,o=0,i=0,s=null,a=null;for(let l=0;l<r;l++){o=i=0,s=a=null;for(let u=0;u<r;u++){let d=e.get(l,u);d===s?o++:(o>=5&&(n+=z.N1+(o-5)),s=d,o=1),d=e.get(u,l),d===a?i++:(i>=5&&(n+=z.N1+(i-5)),a=d,i=1)}o>=5&&(n+=z.N1+(o-5)),i>=5&&(n+=z.N1+(i-5))}return n};C.getPenaltyN2=function(e){let r=e.size,n=0;for(let o=0;o<r-1;o++)for(let i=0;i<r-1;i++){let s=e.get(o,i)+e.get(o,i+1)+e.get(o+1,i)+e.get(o+1,i+1);(s===4||s===0)&&n++}return n*z.N2};C.getPenaltyN3=function(e){let r=e.size,n=0,o=0,i=0;for(let s=0;s<r;s++){o=i=0;for(let a=0;a<r;a++)o=o<<1&2047|e.get(s,a),a>=10&&(o===1488||o===93)&&n++,i=i<<1&2047|e.get(a,s),a>=10&&(i===1488||i===93)&&n++}return n*z.N3};C.getPenaltyN4=function(e){let r=0,n=e.data.length;for(let i=0;i<n;i++)r+=e.data[i];return Math.abs(Math.ceil(r*100/n/5)-10)*z.N4};function cs(t,e,r){switch(t){case C.Patterns.PATTERN000:return(e+r)%2===0;case C.Patterns.PATTERN001:return e%2===0;case C.Patterns.PATTERN010:return r%3===0;case C.Patterns.PATTERN011:return(e+r)%3===0;case C.Patterns.PATTERN100:return(Math.floor(e/2)+Math.floor(r/3))%2===0;case C.Patterns.PATTERN101:return e*r%2+e*r%3===0;case C.Patterns.PATTERN110:return(e*r%2+e*r%3)%2===0;case C.Patterns.PATTERN111:return(e*r%3+(e+r)%2)%2===0;default:throw new Error("bad maskPattern:"+t)}}C.applyMask=function(e,r){let n=r.size;for(let o=0;o<n;o++)for(let i=0;i<n;i++)r.isReserved(i,o)||r.xor(i,o,cs(e,i,o))};C.getBestMask=function(e,r){let n=Object.keys(C.Patterns).length,o=0,i=1/0;for(let s=0;s<n;s++){r(s),C.applyMask(s,e);let a=C.getPenaltyN1(e)+C.getPenaltyN2(e)+C.getPenaltyN3(e)+C.getPenaltyN4(e);C.applyMask(s,e),a<i&&(i=a,o=s)}return o}});var nt=p(rt=>{var $=Se(),ve=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],Re=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];rt.getBlocksCount=function(e,r){switch(r){case $.L:return ve[(e-1)*4+0];case $.M:return ve[(e-1)*4+1];case $.Q:return ve[(e-1)*4+2];case $.H:return ve[(e-1)*4+3];default:return}};rt.getTotalCodewordsCount=function(e,r){switch(r){case $.L:return Re[(e-1)*4+0];case $.M:return Re[(e-1)*4+1];case $.Q:return Re[(e-1)*4+2];case $.H:return Re[(e-1)*4+3];default:return}}});var Br=p(Be=>{var ie=new Uint8Array(512),Ie=new Uint8Array(256);(function(){let e=1;for(let r=0;r<255;r++)ie[r]=e,Ie[e]=r,e<<=1,e&256&&(e^=285);for(let r=255;r<512;r++)ie[r]=ie[r-255]})();Be.log=function(e){if(e<1)throw new Error("log("+e+")");return Ie[e]};Be.exp=function(e){return ie[e]};Be.mul=function(e,r){return e===0||r===0?0:ie[Ie[e]+Ie[r]]}});var Mr=p(ae=>{var ot=Br();ae.mul=function(e,r){let n=new Uint8Array(e.length+r.length-1);for(let o=0;o<e.length;o++)for(let i=0;i<r.length;i++)n[o+i]^=ot.mul(e[o],r[i]);return n};ae.mod=function(e,r){let n=new Uint8Array(e);for(;n.length-r.length>=0;){let o=n[0];for(let s=0;s<r.length;s++)n[s]^=ot.mul(r[s],o);let i=0;for(;i<n.length&&n[i]===0;)i++;n=n.slice(i)}return n};ae.generateECPolynomial=function(e){let r=new Uint8Array([1]);for(let n=0;n<e;n++)r=ae.mul(r,new Uint8Array([1,ot.exp(n)]));return r}});var Lr=p((ji,kr)=>{var Nr=Mr();function st(t){this.genPoly=void 0,this.degree=t,this.degree&&this.initialize(this.degree)}st.prototype.initialize=function(e){this.degree=e,this.genPoly=Nr.generateECPolynomial(this.degree)};st.prototype.encode=function(e){if(!this.genPoly)throw new Error("Encoder not initialized");let r=new Uint8Array(e.length+this.degree);r.set(e);let n=Nr.mod(r,this.genPoly),o=this.degree-n.length;if(o>0){let i=new Uint8Array(this.degree);return i.set(n,o),i}return n};kr.exports=st});var it=p(Fr=>{Fr.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40}});var at=p(L=>{var Or="[0-9]+",us="[A-Z $%*+\\-./:]+",le="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";le=le.replace(/u/g,"\\u");var ds="(?:(?![A-Z0-9 $%*+\\-./:]|"+le+`)(?:.|[\r
|
|
2
|
-
]))+`;
|
|
3
|
-
Make sure your charset is UTF-8`);
|
|
4
|
-
Suggested mode is: `+
|
|
1
|
+
var tu=Object.create;var On=Object.defineProperty;var nu=Object.getOwnPropertyDescriptor;var ru=Object.getOwnPropertyNames;var iu=Object.getPrototypeOf,ou=Object.prototype.hasOwnProperty;var B=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),su=(e,t)=>{for(var n in t)On(e,n,{get:t[n],enumerable:!0})},au=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of ru(t))!ou.call(e,i)&&i!==n&&On(e,i,{get:()=>t[i],enumerable:!(r=nu(t,i))||r.enumerable});return e};var Ue=(e,t,n)=>(n=e!=null?tu(iu(e)):{},au(t||!e||!e.__esModule?On(n,"default",{value:e,enumerable:!0}):n,e));var Ei=B((np,Si)=>{function lu(e){this.value=e,this.match=function(t){return this.value>=t.height}}function cu(e){this.value=e,this.match=function(t){return this.value<t.height}}function fu(e){this.value=e,this.match=function(t){return this.value>=t.width}}function hu(e){this.value=e,this.match=function(t){return this.value<t.width}}function pu(e){this.value=e,this.match=function(t){return this.value===t.orientation}}Si.exports=function(t,n){switch(t){case"max-height":return new lu(n);case"min-height":return new cu(n);case"max-width":return new fu(n);case"min-width":return new hu(n);case"orientation":return new pu(n);default:throw new Error(n)}}});var Ai=B((rp,Ii)=>{function du(e,t){this.left=e,this.right=t,this.match=function(n){return e.match(n)&&t.match(n)}}function mu(e,t){this.left=e,this.right=t,this.match=function(n){return e.match(n)||t.match(n)}}Ii.exports=function(t,n,r){switch(t){case"and":return new du(n,r);case",":return new mu(n,r);default:throw new Error(value)}}});var Ri=B((ip,Bi)=>{var gu=Ei(),xu=Ai(),Ti=/[0-9]/,Dn=/[a-z|\-]/i,yu=/\s/,Pi=/:/,wu=/,/,bu=/and$/,ku=/@/;function Cu(e){for(var t=0,n=[];t<e.length;){var r=e[t];if(ku.test(r))for(r=e[++t];Dn.test(r)&&r!==void 0;)r=e[++t];if(yu.test(r)||r===")"||r==="("){t++;continue}if(Pi.test(r)||wu.test(r)){t++,n.push({type:"operator",value:r});continue}if(Ti.test(r)){for(var i="";Ti.test(r);)i+=r,r=e[++t];n.push({type:"number",value:i});continue}if(Dn.test(r)){for(var i="";Dn.test(r)&&r!==void 0;)i+=r,r=e[++t];bu.test(i)?n.push({type:"operator",value:i}):n.push({type:"literal",value:i});continue}throw new TypeError("Tokenizer: I dont know what this character is: "+r)}return n}function Su(e){for(var t=[],n=[];e.length>0;){var r=e.shift();if(r.type==="number"||r.type==="literal"){t.push(r);continue}if(r.type==="operator"){if(Pi.test(r.value)){r={type:"query",key:t.pop(),value:e.shift()},t.push(r);continue}for(;n.length>0;)t.unshift(n.pop());n.push(r)}}for(;n.length>0;)t.unshift(n.pop());function i(){var o=t.shift();if(o.type==="number")return parseInt(o.value);if(o.type==="literal")return o.value;if(o.type==="operator"){var s=i(),a=i();return xu(o.value,s,a)}if(o.type==="query"){var s=o.key.value,a=o.value.value;return gu(s,a)}}return i()}Bi.exports={parse:function(e){var t=Cu(e),n=Su(t);return n}}});var Fi=B((op,Li)=>{var Eu=Ri();Li.exports=function(e,t){var n={};return Object.keys(e).forEach(function(r){Eu.parse(r).match(t)&&Object.assign(n,e[r])}),n}});var _i=B((sp,zi)=>{var Iu=function(e,t,n){if(e==null)return[0,0,0];var r=(1-Math.abs(2*n-1))*t,i=e/60,o=r*(1-Math.abs(i%2-1));i=Math.floor(i);var s,a,u;i===0?(s=r,a=o,u=0):i===1?(s=o,a=r,u=0):i===2?(s=0,a=r,u=o):i===3?(s=0,a=o,u=r):i===4?(s=o,a=0,u=r):i===5&&(s=r,a=0,u=o);var l=n-r/2;return s+=l,a+=l,u+=l,[Math.abs(Math.round(s*255)),Math.abs(Math.round(a*255)),Math.abs(Math.round(u*255))]};zi.exports=Iu});var vi=B((ap,Mi)=>{var Au=_i();function qn(e,t){return e>t?t:e}function Vn(e,t){return e<t?t:e}function Tu(e){for(e=qn(e,1e7),e=Vn(e,-1e7);e<0;)e+=360;for(;e>359;)e-=360;return e}function Pu(e,t,n){e=Tu(e),t=Vn(qn(t,100),0),n=Vn(qn(n,100),0),t/=100,n/=100;var r=Au(e,t,n);return"#"+r.map(function(i){return(256+i).toString(16).substr(-2)}).join("")}Mi.exports=Pu});var Oi=B((up,Ni)=>{"use strict";Ni.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}});var qi=B((lp,Di)=>{Di.exports=function(t){return!t||typeof t=="string"?!1:t instanceof Array||Array.isArray(t)||t.length>=0&&(t.splice instanceof Function||Object.getOwnPropertyDescriptor(t,t.length-1)&&t.constructor.name!=="String")}});var ji=B((cp,Ui)=>{"use strict";var Bu=qi(),Ru=Array.prototype.concat,Lu=Array.prototype.slice,Vi=Ui.exports=function(t){for(var n=[],r=0,i=t.length;r<i;r++){var o=t[r];Bu(o)?n=Ru.call(n,Lu.call(o)):n.push(o)}return n};Vi.wrap=function(e){return function(){return e(Vi(arguments))}}});var Qi=B((fp,Wi)=>{var Ct=Oi(),St=ji(),Hi=Object.hasOwnProperty,$i=Object.create(null);for(Ht in Ct)Hi.call(Ct,Ht)&&($i[Ct[Ht]]=Ht);var Ht,ae=Wi.exports={to:{},get:{}};ae.get=function(e){var t=e.substring(0,3).toLowerCase(),n,r;switch(t){case"hsl":n=ae.get.hsl(e),r="hsl";break;case"hwb":n=ae.get.hwb(e),r="hwb";break;default:n=ae.get.rgb(e),r="rgb";break}return n?{model:r,value:n}:null};ae.get.rgb=function(e){if(!e)return null;var t=/^#([a-f0-9]{3,4})$/i,n=/^#([a-f0-9]{6})([a-f0-9]{2})?$/i,r=/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,i=/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,o=/^(\w+)$/,s=[0,0,0,1],a,u,l;if(a=e.match(n)){for(l=a[2],a=a[1],u=0;u<3;u++){var c=u*2;s[u]=parseInt(a.slice(c,c+2),16)}l&&(s[3]=parseInt(l,16)/255)}else if(a=e.match(t)){for(a=a[1],l=a[3],u=0;u<3;u++)s[u]=parseInt(a[u]+a[u],16);l&&(s[3]=parseInt(l+l,16)/255)}else if(a=e.match(r)){for(u=0;u<3;u++)s[u]=parseInt(a[u+1],0);a[4]&&(a[5]?s[3]=parseFloat(a[4])*.01:s[3]=parseFloat(a[4]))}else if(a=e.match(i)){for(u=0;u<3;u++)s[u]=Math.round(parseFloat(a[u+1])*2.55);a[4]&&(a[5]?s[3]=parseFloat(a[4])*.01:s[3]=parseFloat(a[4]))}else return(a=e.match(o))?a[1]==="transparent"?[0,0,0,0]:Hi.call(Ct,a[1])?(s=Ct[a[1]],s[3]=1,s):null:null;for(u=0;u<3;u++)s[u]=Pe(s[u],0,255);return s[3]=Pe(s[3],0,1),s};ae.get.hsl=function(e){if(!e)return null;var t=/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,n=e.match(t);if(n){var r=parseFloat(n[4]),i=(parseFloat(n[1])%360+360)%360,o=Pe(parseFloat(n[2]),0,100),s=Pe(parseFloat(n[3]),0,100),a=Pe(isNaN(r)?1:r,0,1);return[i,o,s,a]}return null};ae.get.hwb=function(e){if(!e)return null;var t=/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,n=e.match(t);if(n){var r=parseFloat(n[4]),i=(parseFloat(n[1])%360+360)%360,o=Pe(parseFloat(n[2]),0,100),s=Pe(parseFloat(n[3]),0,100),a=Pe(isNaN(r)?1:r,0,1);return[i,o,s,a]}return null};ae.to.hex=function(){var e=St(arguments);return"#"+$t(e[0])+$t(e[1])+$t(e[2])+(e[3]<1?$t(Math.round(e[3]*255)):"")};ae.to.rgb=function(){var e=St(arguments);return e.length<4||e[3]===1?"rgb("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+")":"rgba("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+", "+e[3]+")"};ae.to.rgb.percent=function(){var e=St(arguments),t=Math.round(e[0]/255*100),n=Math.round(e[1]/255*100),r=Math.round(e[2]/255*100);return e.length<4||e[3]===1?"rgb("+t+"%, "+n+"%, "+r+"%)":"rgba("+t+"%, "+n+"%, "+r+"%, "+e[3]+")"};ae.to.hsl=function(){var e=St(arguments);return e.length<4||e[3]===1?"hsl("+e[0]+", "+e[1]+"%, "+e[2]+"%)":"hsla("+e[0]+", "+e[1]+"%, "+e[2]+"%, "+e[3]+")"};ae.to.hwb=function(){var e=St(arguments),t="";return e.length>=4&&e[3]!==1&&(t=", "+e[3]),"hwb("+e[0]+", "+e[1]+"%, "+e[2]+"%"+t+")"};ae.to.keyword=function(e){return $i[e.slice(0,3)]};function Pe(e,t,n){return Math.min(Math.max(t,e),n)}function $t(e){var t=Math.round(e).toString(16).toUpperCase();return t.length<2?"0"+t:t}});var Gi=B((hp,Yi)=>{var Un=40,jn=41,Wt=39,Hn=34,$n=92,rt=47,Wn=44,Qn=58,Qt=42,Fu=117,zu=85,_u=43,Mu=/^[a-f0-9?-]+$/i;Yi.exports=function(e){for(var t=[],n=e,r,i,o,s,a,u,l,c,f=0,h=n.charCodeAt(f),p=n.length,y=[{nodes:t}],b=0,C,w="",F="",S="";f<p;)if(h<=32){r=f;do r+=1,h=n.charCodeAt(r);while(h<=32);s=n.slice(f,r),o=t[t.length-1],h===jn&&b?S=s:o&&o.type==="div"?(o.after=s,o.sourceEndIndex+=s.length):h===Wn||h===Qn||h===rt&&n.charCodeAt(r+1)!==Qt&&(!C||C&&C.type==="function"&&C.value!=="calc")?F=s:t.push({type:"space",sourceIndex:f,sourceEndIndex:r,value:s}),f=r}else if(h===Wt||h===Hn){r=f,i=h===Wt?"'":'"',s={type:"string",sourceIndex:f,quote:i};do if(a=!1,r=n.indexOf(i,r+1),~r)for(u=r;n.charCodeAt(u-1)===$n;)u-=1,a=!a;else n+=i,r=n.length-1,s.unclosed=!0;while(a);s.value=n.slice(f+1,r),s.sourceEndIndex=s.unclosed?r:r+1,t.push(s),f=r+1,h=n.charCodeAt(f)}else if(h===rt&&n.charCodeAt(f+1)===Qt)r=n.indexOf("*/",f),s={type:"comment",sourceIndex:f,sourceEndIndex:r+2},r===-1&&(s.unclosed=!0,r=n.length,s.sourceEndIndex=r),s.value=n.slice(f+2,r),t.push(s),f=r+2,h=n.charCodeAt(f);else if((h===rt||h===Qt)&&C&&C.type==="function"&&C.value==="calc")s=n[f],t.push({type:"word",sourceIndex:f-F.length,sourceEndIndex:f+s.length,value:s}),f+=1,h=n.charCodeAt(f);else if(h===rt||h===Wn||h===Qn)s=n[f],t.push({type:"div",sourceIndex:f-F.length,sourceEndIndex:f+s.length,value:s,before:F,after:""}),F="",f+=1,h=n.charCodeAt(f);else if(Un===h){r=f;do r+=1,h=n.charCodeAt(r);while(h<=32);if(c=f,s={type:"function",sourceIndex:f-w.length,value:w,before:n.slice(c+1,r)},f=r,w==="url"&&h!==Wt&&h!==Hn){r-=1;do if(a=!1,r=n.indexOf(")",r+1),~r)for(u=r;n.charCodeAt(u-1)===$n;)u-=1,a=!a;else n+=")",r=n.length-1,s.unclosed=!0;while(a);l=r;do l-=1,h=n.charCodeAt(l);while(h<=32);c<l?(f!==l+1?s.nodes=[{type:"word",sourceIndex:f,sourceEndIndex:l+1,value:n.slice(f,l+1)}]:s.nodes=[],s.unclosed&&l+1!==r?(s.after="",s.nodes.push({type:"space",sourceIndex:l+1,sourceEndIndex:r,value:n.slice(l+1,r)})):(s.after=n.slice(l+1,r),s.sourceEndIndex=r)):(s.after="",s.nodes=[]),f=r+1,s.sourceEndIndex=s.unclosed?r:f,h=n.charCodeAt(f),t.push(s)}else b+=1,s.after="",s.sourceEndIndex=f+1,t.push(s),y.push(s),t=s.nodes=[],C=s;w=""}else if(jn===h&&b)f+=1,h=n.charCodeAt(f),C.after=S,C.sourceEndIndex+=S.length,S="",b-=1,y[y.length-1].sourceEndIndex=f,y.pop(),C=y[b],t=C.nodes;else{r=f;do h===$n&&(r+=1),r+=1,h=n.charCodeAt(r);while(r<p&&!(h<=32||h===Wt||h===Hn||h===Wn||h===Qn||h===rt||h===Un||h===Qt&&C&&C.type==="function"&&C.value==="calc"||h===rt&&C.type==="function"&&C.value==="calc"||h===jn&&b));s=n.slice(f,r),Un===h?w=s:(Fu===s.charCodeAt(0)||zu===s.charCodeAt(0))&&_u===s.charCodeAt(1)&&Mu.test(s.slice(2))?t.push({type:"unicode-range",sourceIndex:f,sourceEndIndex:r,value:s}):t.push({type:"word",sourceIndex:f,sourceEndIndex:r,value:s}),f=r}for(f=y.length-1;f;f-=1)y[f].unclosed=!0,y[f].sourceEndIndex=n.length;return y[0].nodes}});var Ki=B((pp,Ji)=>{var Yt=45,Gt=43,Yn=46,vu=101,Nu=69;function Ou(e){var t=e.charCodeAt(0),n;if(t===Gt||t===Yt){if(n=e.charCodeAt(1),n>=48&&n<=57)return!0;var r=e.charCodeAt(2);return n===Yn&&r>=48&&r<=57}return t===Yn?(n=e.charCodeAt(1),n>=48&&n<=57):t>=48&&t<=57}Ji.exports=function(e){var t=0,n=e.length,r,i,o;if(n===0||!Ou(e))return!1;for(r=e.charCodeAt(t),(r===Gt||r===Yt)&&t++;t<n&&(r=e.charCodeAt(t),!(r<48||r>57));)t+=1;if(r=e.charCodeAt(t),i=e.charCodeAt(t+1),r===Yn&&i>=48&&i<=57)for(t+=2;t<n&&(r=e.charCodeAt(t),!(r<48||r>57));)t+=1;if(r=e.charCodeAt(t),i=e.charCodeAt(t+1),o=e.charCodeAt(t+2),(r===vu||r===Nu)&&(i>=48&&i<=57||(i===Gt||i===Yt)&&o>=48&&o<=57))for(t+=i===Gt||i===Yt?3:2;t<n&&(r=e.charCodeAt(t),!(r<48||r>57));)t+=1;return{number:e.slice(0,t),unit:e.slice(t)}}});var fo=B((kp,co)=>{co.exports=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}});var Le=B(He=>{var nr,Fl=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];He.getSymbolSize=function(t){if(!t)throw new Error('"version" cannot be null or undefined');if(t<1||t>40)throw new Error('"version" should be in range from 1 to 40');return t*4+17};He.getSymbolTotalCodewords=function(t){return Fl[t]};He.getBCHDigit=function(e){let t=0;for(;e!==0;)t++,e>>>=1;return t};He.setToSJISFunction=function(t){if(typeof t!="function")throw new Error('"toSJISFunc" is not a valid function.');nr=t};He.isKanjiModeEnabled=function(){return typeof nr<"u"};He.toSJIS=function(t){return nr(t)}});var tn=B(he=>{he.L={bit:1};he.M={bit:0};he.Q={bit:3};he.H={bit:2};function zl(e){if(typeof e!="string")throw new Error("Param is not a string");switch(e.toLowerCase()){case"l":case"low":return he.L;case"m":case"medium":return he.M;case"q":case"quartile":return he.Q;case"h":case"high":return he.H;default:throw new Error("Unknown EC Level: "+e)}}he.isValid=function(t){return t&&typeof t.bit<"u"&&t.bit>=0&&t.bit<4};he.from=function(t,n){if(he.isValid(t))return t;try{return zl(t)}catch{return n}}});var mo=B((Ep,po)=>{function ho(){this.buffer=[],this.length=0}ho.prototype={get:function(e){let t=Math.floor(e/8);return(this.buffer[t]>>>7-e%8&1)===1},put:function(e,t){for(let n=0;n<t;n++)this.putBit((e>>>t-n-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(e){let t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}};po.exports=ho});var xo=B((Ip,go)=>{function Et(e){if(!e||e<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=e,this.data=new Uint8Array(e*e),this.reservedBit=new Uint8Array(e*e)}Et.prototype.set=function(e,t,n,r){let i=e*this.size+t;this.data[i]=n,r&&(this.reservedBit[i]=!0)};Et.prototype.get=function(e,t){return this.data[e*this.size+t]};Et.prototype.xor=function(e,t,n){this.data[e*this.size+t]^=n};Et.prototype.isReserved=function(e,t){return this.reservedBit[e*this.size+t]};go.exports=Et});var yo=B(nn=>{var _l=Le().getSymbolSize;nn.getRowColCoords=function(t){if(t===1)return[];let n=Math.floor(t/7)+2,r=_l(t),i=r===145?26:Math.ceil((r-13)/(2*n-2))*2,o=[r-7];for(let s=1;s<n-1;s++)o[s]=o[s-1]-i;return o.push(6),o.reverse()};nn.getPositions=function(t){let n=[],r=nn.getRowColCoords(t),i=r.length;for(let o=0;o<i;o++)for(let s=0;s<i;s++)o===0&&s===0||o===0&&s===i-1||o===i-1&&s===0||n.push([r[o],r[s]]);return n}});var ko=B(bo=>{var Ml=Le().getSymbolSize,wo=7;bo.getPositions=function(t){let n=Ml(t);return[[0,0],[n-wo,0],[0,n-wo]]}});var Co=B(U=>{U.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};var $e={N1:3,N2:3,N3:40,N4:10};U.isValid=function(t){return t!=null&&t!==""&&!isNaN(t)&&t>=0&&t<=7};U.from=function(t){return U.isValid(t)?parseInt(t,10):void 0};U.getPenaltyN1=function(t){let n=t.size,r=0,i=0,o=0,s=null,a=null;for(let u=0;u<n;u++){i=o=0,s=a=null;for(let l=0;l<n;l++){let c=t.get(u,l);c===s?i++:(i>=5&&(r+=$e.N1+(i-5)),s=c,i=1),c=t.get(l,u),c===a?o++:(o>=5&&(r+=$e.N1+(o-5)),a=c,o=1)}i>=5&&(r+=$e.N1+(i-5)),o>=5&&(r+=$e.N1+(o-5))}return r};U.getPenaltyN2=function(t){let n=t.size,r=0;for(let i=0;i<n-1;i++)for(let o=0;o<n-1;o++){let s=t.get(i,o)+t.get(i,o+1)+t.get(i+1,o)+t.get(i+1,o+1);(s===4||s===0)&&r++}return r*$e.N2};U.getPenaltyN3=function(t){let n=t.size,r=0,i=0,o=0;for(let s=0;s<n;s++){i=o=0;for(let a=0;a<n;a++)i=i<<1&2047|t.get(s,a),a>=10&&(i===1488||i===93)&&r++,o=o<<1&2047|t.get(a,s),a>=10&&(o===1488||o===93)&&r++}return r*$e.N3};U.getPenaltyN4=function(t){let n=0,r=t.data.length;for(let o=0;o<r;o++)n+=t.data[o];return Math.abs(Math.ceil(n*100/r/5)-10)*$e.N4};function vl(e,t,n){switch(e){case U.Patterns.PATTERN000:return(t+n)%2===0;case U.Patterns.PATTERN001:return t%2===0;case U.Patterns.PATTERN010:return n%3===0;case U.Patterns.PATTERN011:return(t+n)%3===0;case U.Patterns.PATTERN100:return(Math.floor(t/2)+Math.floor(n/3))%2===0;case U.Patterns.PATTERN101:return t*n%2+t*n%3===0;case U.Patterns.PATTERN110:return(t*n%2+t*n%3)%2===0;case U.Patterns.PATTERN111:return(t*n%3+(t+n)%2)%2===0;default:throw new Error("bad maskPattern:"+e)}}U.applyMask=function(t,n){let r=n.size;for(let i=0;i<r;i++)for(let o=0;o<r;o++)n.isReserved(o,i)||n.xor(o,i,vl(t,o,i))};U.getBestMask=function(t,n){let r=Object.keys(U.Patterns).length,i=0,o=1/0;for(let s=0;s<r;s++){n(s),U.applyMask(s,t);let a=U.getPenaltyN1(t)+U.getPenaltyN2(t)+U.getPenaltyN3(t)+U.getPenaltyN4(t);U.applyMask(s,t),a<o&&(o=a,i=s)}return i}});var ir=B(rr=>{var Fe=tn(),rn=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],on=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];rr.getBlocksCount=function(t,n){switch(n){case Fe.L:return rn[(t-1)*4+0];case Fe.M:return rn[(t-1)*4+1];case Fe.Q:return rn[(t-1)*4+2];case Fe.H:return rn[(t-1)*4+3];default:return}};rr.getTotalCodewordsCount=function(t,n){switch(n){case Fe.L:return on[(t-1)*4+0];case Fe.M:return on[(t-1)*4+1];case Fe.Q:return on[(t-1)*4+2];case Fe.H:return on[(t-1)*4+3];default:return}}});var So=B(an=>{var It=new Uint8Array(512),sn=new Uint8Array(256);(function(){let t=1;for(let n=0;n<255;n++)It[n]=t,sn[t]=n,t<<=1,t&256&&(t^=285);for(let n=255;n<512;n++)It[n]=It[n-255]})();an.log=function(t){if(t<1)throw new Error("log("+t+")");return sn[t]};an.exp=function(t){return It[t]};an.mul=function(t,n){return t===0||n===0?0:It[sn[t]+sn[n]]}});var Eo=B(At=>{var or=So();At.mul=function(t,n){let r=new Uint8Array(t.length+n.length-1);for(let i=0;i<t.length;i++)for(let o=0;o<n.length;o++)r[i+o]^=or.mul(t[i],n[o]);return r};At.mod=function(t,n){let r=new Uint8Array(t);for(;r.length-n.length>=0;){let i=r[0];for(let s=0;s<n.length;s++)r[s]^=or.mul(n[s],i);let o=0;for(;o<r.length&&r[o]===0;)o++;r=r.slice(o)}return r};At.generateECPolynomial=function(t){let n=new Uint8Array([1]);for(let r=0;r<t;r++)n=At.mul(n,new Uint8Array([1,or.exp(r)]));return n}});var To=B((Fp,Ao)=>{var Io=Eo();function sr(e){this.genPoly=void 0,this.degree=e,this.degree&&this.initialize(this.degree)}sr.prototype.initialize=function(t){this.degree=t,this.genPoly=Io.generateECPolynomial(this.degree)};sr.prototype.encode=function(t){if(!this.genPoly)throw new Error("Encoder not initialized");let n=new Uint8Array(t.length+this.degree);n.set(t);let r=Io.mod(n,this.genPoly),i=this.degree-r.length;if(i>0){let o=new Uint8Array(this.degree);return o.set(r,i),o}return r};Ao.exports=sr});var ar=B(Po=>{Po.isValid=function(t){return!isNaN(t)&&t>=1&&t<=40}});var ur=B(Ee=>{var Bo="[0-9]+",Nl="[A-Z $%*+\\-./:]+",Tt="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";Tt=Tt.replace(/u/g,"\\u");var Ol="(?:(?![A-Z0-9 $%*+\\-./:]|"+Tt+`)(?:.|[\r
|
|
2
|
+
]))+`;Ee.KANJI=new RegExp(Tt,"g");Ee.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g");Ee.BYTE=new RegExp(Ol,"g");Ee.NUMERIC=new RegExp(Bo,"g");Ee.ALPHANUMERIC=new RegExp(Nl,"g");var Dl=new RegExp("^"+Tt+"$"),ql=new RegExp("^"+Bo+"$"),Vl=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");Ee.testKanji=function(t){return Dl.test(t)};Ee.testNumeric=function(t){return ql.test(t)};Ee.testAlphanumeric=function(t){return Vl.test(t)}});var ze=B(Y=>{var Ul=ar(),lr=ur();Y.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]};Y.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]};Y.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]};Y.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]};Y.MIXED={bit:-1};Y.getCharCountIndicator=function(t,n){if(!t.ccBits)throw new Error("Invalid mode: "+t);if(!Ul.isValid(n))throw new Error("Invalid version: "+n);return n>=1&&n<10?t.ccBits[0]:n<27?t.ccBits[1]:t.ccBits[2]};Y.getBestModeForData=function(t){return lr.testNumeric(t)?Y.NUMERIC:lr.testAlphanumeric(t)?Y.ALPHANUMERIC:lr.testKanji(t)?Y.KANJI:Y.BYTE};Y.toString=function(t){if(t&&t.id)return t.id;throw new Error("Invalid mode")};Y.isValid=function(t){return t&&t.bit&&t.ccBits};function jl(e){if(typeof e!="string")throw new Error("Param is not a string");switch(e.toLowerCase()){case"numeric":return Y.NUMERIC;case"alphanumeric":return Y.ALPHANUMERIC;case"kanji":return Y.KANJI;case"byte":return Y.BYTE;default:throw new Error("Unknown mode: "+e)}}Y.from=function(t,n){if(Y.isValid(t))return t;try{return jl(t)}catch{return n}}});var _o=B(We=>{var un=Le(),Hl=ir(),Ro=tn(),_e=ze(),cr=ar(),Fo=7973,Lo=un.getBCHDigit(Fo);function $l(e,t,n){for(let r=1;r<=40;r++)if(t<=We.getCapacity(r,n,e))return r}function zo(e,t){return _e.getCharCountIndicator(e,t)+4}function Wl(e,t){let n=0;return e.forEach(function(r){let i=zo(r.mode,t);n+=i+r.getBitsLength()}),n}function Ql(e,t){for(let n=1;n<=40;n++)if(Wl(e,n)<=We.getCapacity(n,t,_e.MIXED))return n}We.from=function(t,n){return cr.isValid(t)?parseInt(t,10):n};We.getCapacity=function(t,n,r){if(!cr.isValid(t))throw new Error("Invalid QR Code version");typeof r>"u"&&(r=_e.BYTE);let i=un.getSymbolTotalCodewords(t),o=Hl.getTotalCodewordsCount(t,n),s=(i-o)*8;if(r===_e.MIXED)return s;let a=s-zo(r,t);switch(r){case _e.NUMERIC:return Math.floor(a/10*3);case _e.ALPHANUMERIC:return Math.floor(a/11*2);case _e.KANJI:return Math.floor(a/13);case _e.BYTE:default:return Math.floor(a/8)}};We.getBestVersionForData=function(t,n){let r,i=Ro.from(n,Ro.M);if(Array.isArray(t)){if(t.length>1)return Ql(t,i);if(t.length===0)return 1;r=t[0]}else r=t;return $l(r.mode,r.getLength(),i)};We.getEncodedBits=function(t){if(!cr.isValid(t)||t<7)throw new Error("Invalid QR Code version");let n=t<<12;for(;un.getBCHDigit(n)-Lo>=0;)n^=Fo<<un.getBCHDigit(n)-Lo;return t<<12|n}});var Oo=B(No=>{var fr=Le(),vo=1335,Yl=21522,Mo=fr.getBCHDigit(vo);No.getEncodedBits=function(t,n){let r=t.bit<<3|n,i=r<<10;for(;fr.getBCHDigit(i)-Mo>=0;)i^=vo<<fr.getBCHDigit(i)-Mo;return(r<<10|i)^Yl}});var qo=B((Op,Do)=>{var Gl=ze();function ot(e){this.mode=Gl.NUMERIC,this.data=e.toString()}ot.getBitsLength=function(t){return 10*Math.floor(t/3)+(t%3?t%3*3+1:0)};ot.prototype.getLength=function(){return this.data.length};ot.prototype.getBitsLength=function(){return ot.getBitsLength(this.data.length)};ot.prototype.write=function(t){let n,r,i;for(n=0;n+3<=this.data.length;n+=3)r=this.data.substr(n,3),i=parseInt(r,10),t.put(i,10);let o=this.data.length-n;o>0&&(r=this.data.substr(n),i=parseInt(r,10),t.put(i,o*3+1))};Do.exports=ot});var Uo=B((Dp,Vo)=>{var Jl=ze(),hr=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function st(e){this.mode=Jl.ALPHANUMERIC,this.data=e}st.getBitsLength=function(t){return 11*Math.floor(t/2)+6*(t%2)};st.prototype.getLength=function(){return this.data.length};st.prototype.getBitsLength=function(){return st.getBitsLength(this.data.length)};st.prototype.write=function(t){let n;for(n=0;n+2<=this.data.length;n+=2){let r=hr.indexOf(this.data[n])*45;r+=hr.indexOf(this.data[n+1]),t.put(r,11)}this.data.length%2&&t.put(hr.indexOf(this.data[n]),6)};Vo.exports=st});var Ho=B((qp,jo)=>{var Kl=ze();function at(e){this.mode=Kl.BYTE,typeof e=="string"?this.data=new TextEncoder().encode(e):this.data=new Uint8Array(e)}at.getBitsLength=function(t){return t*8};at.prototype.getLength=function(){return this.data.length};at.prototype.getBitsLength=function(){return at.getBitsLength(this.data.length)};at.prototype.write=function(e){for(let t=0,n=this.data.length;t<n;t++)e.put(this.data[t],8)};jo.exports=at});var Wo=B((Vp,$o)=>{var Xl=ze(),Zl=Le();function ut(e){this.mode=Xl.KANJI,this.data=e}ut.getBitsLength=function(t){return t*13};ut.prototype.getLength=function(){return this.data.length};ut.prototype.getBitsLength=function(){return ut.getBitsLength(this.data.length)};ut.prototype.write=function(e){let t;for(t=0;t<this.data.length;t++){let n=Zl.toSJIS(this.data[t]);if(n>=33088&&n<=40956)n-=33088;else if(n>=57408&&n<=60351)n-=49472;else throw new Error("Invalid SJIS character: "+this.data[t]+`
|
|
3
|
+
Make sure your charset is UTF-8`);n=(n>>>8&255)*192+(n&255),e.put(n,13)}};$o.exports=ut});var Qo=B((Up,pr)=>{"use strict";var Pt={single_source_shortest_paths:function(e,t,n){var r={},i={};i[t]=0;var o=Pt.PriorityQueue.make();o.push(t,0);for(var s,a,u,l,c,f,h,p,y;!o.empty();){s=o.pop(),a=s.value,l=s.cost,c=e[a]||{};for(u in c)c.hasOwnProperty(u)&&(f=c[u],h=l+f,p=i[u],y=typeof i[u]>"u",(y||p>h)&&(i[u]=h,o.push(u,h),r[u]=a))}if(typeof n<"u"&&typeof i[n]>"u"){var b=["Could not find a path from ",t," to ",n,"."].join("");throw new Error(b)}return r},extract_shortest_path_from_predecessor_list:function(e,t){for(var n=[],r=t,i;r;)n.push(r),i=e[r],r=e[r];return n.reverse(),n},find_path:function(e,t,n){var r=Pt.single_source_shortest_paths(e,t,n);return Pt.extract_shortest_path_from_predecessor_list(r,n)},PriorityQueue:{make:function(e){var t=Pt.PriorityQueue,n={},r;e=e||{};for(r in t)t.hasOwnProperty(r)&&(n[r]=t[r]);return n.queue=[],n.sorter=e.sorter||t.default_sorter,n},default_sorter:function(e,t){return e.cost-t.cost},push:function(e,t){var n={value:e,cost:t};this.queue.push(n),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};typeof pr<"u"&&(pr.exports=Pt)});var ts=B(lt=>{var N=ze(),Jo=qo(),Ko=Uo(),Xo=Ho(),Zo=Wo(),Bt=ur(),ln=Le(),ec=Qo();function Yo(e){return unescape(encodeURIComponent(e)).length}function Rt(e,t,n){let r=[],i;for(;(i=e.exec(n))!==null;)r.push({data:i[0],index:i.index,mode:t,length:i[0].length});return r}function es(e){let t=Rt(Bt.NUMERIC,N.NUMERIC,e),n=Rt(Bt.ALPHANUMERIC,N.ALPHANUMERIC,e),r,i;return ln.isKanjiModeEnabled()?(r=Rt(Bt.BYTE,N.BYTE,e),i=Rt(Bt.KANJI,N.KANJI,e)):(r=Rt(Bt.BYTE_KANJI,N.BYTE,e),i=[]),t.concat(n,r,i).sort(function(s,a){return s.index-a.index}).map(function(s){return{data:s.data,mode:s.mode,length:s.length}})}function dr(e,t){switch(t){case N.NUMERIC:return Jo.getBitsLength(e);case N.ALPHANUMERIC:return Ko.getBitsLength(e);case N.KANJI:return Zo.getBitsLength(e);case N.BYTE:return Xo.getBitsLength(e)}}function tc(e){return e.reduce(function(t,n){let r=t.length-1>=0?t[t.length-1]:null;return r&&r.mode===n.mode?(t[t.length-1].data+=n.data,t):(t.push(n),t)},[])}function nc(e){let t=[];for(let n=0;n<e.length;n++){let r=e[n];switch(r.mode){case N.NUMERIC:t.push([r,{data:r.data,mode:N.ALPHANUMERIC,length:r.length},{data:r.data,mode:N.BYTE,length:r.length}]);break;case N.ALPHANUMERIC:t.push([r,{data:r.data,mode:N.BYTE,length:r.length}]);break;case N.KANJI:t.push([r,{data:r.data,mode:N.BYTE,length:Yo(r.data)}]);break;case N.BYTE:t.push([{data:r.data,mode:N.BYTE,length:Yo(r.data)}])}}return t}function rc(e,t){let n={},r={start:{}},i=["start"];for(let o=0;o<e.length;o++){let s=e[o],a=[];for(let u=0;u<s.length;u++){let l=s[u],c=""+o+u;a.push(c),n[c]={node:l,lastCount:0},r[c]={};for(let f=0;f<i.length;f++){let h=i[f];n[h]&&n[h].node.mode===l.mode?(r[h][c]=dr(n[h].lastCount+l.length,l.mode)-dr(n[h].lastCount,l.mode),n[h].lastCount+=l.length):(n[h]&&(n[h].lastCount=l.length),r[h][c]=dr(l.length,l.mode)+4+N.getCharCountIndicator(l.mode,t))}}i=a}for(let o=0;o<i.length;o++)r[i[o]].end=0;return{map:r,table:n}}function Go(e,t){let n,r=N.getBestModeForData(e);if(n=N.from(t,r),n!==N.BYTE&&n.bit<r.bit)throw new Error('"'+e+'" cannot be encoded with mode '+N.toString(n)+`.
|
|
4
|
+
Suggested mode is: `+N.toString(r));switch(n===N.KANJI&&!ln.isKanjiModeEnabled()&&(n=N.BYTE),n){case N.NUMERIC:return new Jo(e);case N.ALPHANUMERIC:return new Ko(e);case N.KANJI:return new Zo(e);case N.BYTE:return new Xo(e)}}lt.fromArray=function(t){return t.reduce(function(n,r){return typeof r=="string"?n.push(Go(r,null)):r.data&&n.push(Go(r.data,r.mode)),n},[])};lt.fromString=function(t,n){let r=es(t,ln.isKanjiModeEnabled()),i=nc(r),o=rc(i,n),s=ec.find_path(o.map,"start","end"),a=[];for(let u=1;u<s.length-1;u++)a.push(o.table[s[u]].node);return lt.fromArray(tc(a))};lt.rawSplit=function(t){return lt.fromArray(es(t,ln.isKanjiModeEnabled()))}});var rs=B(ns=>{var fn=Le(),mr=tn(),ic=mo(),oc=xo(),sc=yo(),ac=ko(),yr=Co(),wr=ir(),uc=To(),cn=_o(),lc=Oo(),cc=ze(),gr=ts();function fc(e,t){let n=e.size,r=ac.getPositions(t);for(let i=0;i<r.length;i++){let o=r[i][0],s=r[i][1];for(let a=-1;a<=7;a++)if(!(o+a<=-1||n<=o+a))for(let u=-1;u<=7;u++)s+u<=-1||n<=s+u||(a>=0&&a<=6&&(u===0||u===6)||u>=0&&u<=6&&(a===0||a===6)||a>=2&&a<=4&&u>=2&&u<=4?e.set(o+a,s+u,!0,!0):e.set(o+a,s+u,!1,!0))}}function hc(e){let t=e.size;for(let n=8;n<t-8;n++){let r=n%2===0;e.set(n,6,r,!0),e.set(6,n,r,!0)}}function pc(e,t){let n=sc.getPositions(t);for(let r=0;r<n.length;r++){let i=n[r][0],o=n[r][1];for(let s=-2;s<=2;s++)for(let a=-2;a<=2;a++)s===-2||s===2||a===-2||a===2||s===0&&a===0?e.set(i+s,o+a,!0,!0):e.set(i+s,o+a,!1,!0)}}function dc(e,t){let n=e.size,r=cn.getEncodedBits(t),i,o,s;for(let a=0;a<18;a++)i=Math.floor(a/3),o=a%3+n-8-3,s=(r>>a&1)===1,e.set(i,o,s,!0),e.set(o,i,s,!0)}function xr(e,t,n){let r=e.size,i=lc.getEncodedBits(t,n),o,s;for(o=0;o<15;o++)s=(i>>o&1)===1,o<6?e.set(o,8,s,!0):o<8?e.set(o+1,8,s,!0):e.set(r-15+o,8,s,!0),o<8?e.set(8,r-o-1,s,!0):o<9?e.set(8,15-o-1+1,s,!0):e.set(8,15-o-1,s,!0);e.set(r-8,8,1,!0)}function mc(e,t){let n=e.size,r=-1,i=n-1,o=7,s=0;for(let a=n-1;a>0;a-=2)for(a===6&&a--;;){for(let u=0;u<2;u++)if(!e.isReserved(i,a-u)){let l=!1;s<t.length&&(l=(t[s]>>>o&1)===1),e.set(i,a-u,l),o--,o===-1&&(s++,o=7)}if(i+=r,i<0||n<=i){i-=r,r=-r;break}}}function gc(e,t,n){let r=new ic;n.forEach(function(u){r.put(u.mode.bit,4),r.put(u.getLength(),cc.getCharCountIndicator(u.mode,e)),u.write(r)});let i=fn.getSymbolTotalCodewords(e),o=wr.getTotalCodewordsCount(e,t),s=(i-o)*8;for(r.getLengthInBits()+4<=s&&r.put(0,4);r.getLengthInBits()%8!==0;)r.putBit(0);let a=(s-r.getLengthInBits())/8;for(let u=0;u<a;u++)r.put(u%2?17:236,8);return xc(r,e,t)}function xc(e,t,n){let r=fn.getSymbolTotalCodewords(t),i=wr.getTotalCodewordsCount(t,n),o=r-i,s=wr.getBlocksCount(t,n),a=r%s,u=s-a,l=Math.floor(r/s),c=Math.floor(o/s),f=c+1,h=l-c,p=new uc(h),y=0,b=new Array(s),C=new Array(s),w=0,F=new Uint8Array(e.buffer);for(let v=0;v<s;v++){let j=v<u?c:f;b[v]=F.slice(y,y+j),C[v]=p.encode(b[v]),y+=j,w=Math.max(w,j)}let S=new Uint8Array(r),D=0,M,x;for(M=0;M<w;M++)for(x=0;x<s;x++)M<b[x].length&&(S[D++]=b[x][M]);for(M=0;M<h;M++)for(x=0;x<s;x++)S[D++]=C[x][M];return S}function yc(e,t,n,r){let i;if(Array.isArray(e))i=gr.fromArray(e);else if(typeof e=="string"){let l=t;if(!l){let c=gr.rawSplit(e);l=cn.getBestVersionForData(c,n)}i=gr.fromString(e,l||40)}else throw new Error("Invalid data");let o=cn.getBestVersionForData(i,n);if(!o)throw new Error("The amount of data is too big to be stored in a QR Code");if(!t)t=o;else if(t<o)throw new Error(`
|
|
5
5
|
The chosen QR Code version cannot contain this amount of data.
|
|
6
|
-
Minimum version required to store current data is: `+
|
|
7
|
-
`);let s=
|
|
8
|
-
`;return typeof
|
|
6
|
+
Minimum version required to store current data is: `+o+`.
|
|
7
|
+
`);let s=gc(t,n,i),a=fn.getSymbolSize(t),u=new oc(a);return fc(u,t),hc(u),pc(u,t),xr(u,n,0),t>=7&&dc(u,t),mc(u,s),isNaN(r)&&(r=yr.getBestMask(u,xr.bind(null,u,n))),yr.applyMask(r,u),xr(u,n,r),{modules:u,version:t,errorCorrectionLevel:n,maskPattern:r,segments:i}}ns.create=function(t,n){if(typeof t>"u"||t==="")throw new Error("No input text");let r=mr.M,i,o;return typeof n<"u"&&(r=mr.from(n.errorCorrectionLevel,mr.M),i=cn.from(n.version),o=yr.from(n.maskPattern),n.toSJISFunc&&fn.setToSJISFunction(n.toSJISFunc)),yc(t,i,r,o)}});var br=B(Qe=>{function is(e){if(typeof e=="number"&&(e=e.toString()),typeof e!="string")throw new Error("Color should be defined as hex string");let t=e.slice().replace("#","").split("");if(t.length<3||t.length===5||t.length>8)throw new Error("Invalid hex color: "+e);(t.length===3||t.length===4)&&(t=Array.prototype.concat.apply([],t.map(function(r){return[r,r]}))),t.length===6&&t.push("F","F");let n=parseInt(t.join(""),16);return{r:n>>24&255,g:n>>16&255,b:n>>8&255,a:n&255,hex:"#"+t.slice(0,6).join("")}}Qe.getOptions=function(t){t||(t={}),t.color||(t.color={});let n=typeof t.margin>"u"||t.margin===null||t.margin<0?4:t.margin,r=t.width&&t.width>=21?t.width:void 0,i=t.scale||4;return{width:r,scale:r?4:i,margin:n,color:{dark:is(t.color.dark||"#000000ff"),light:is(t.color.light||"#ffffffff")},type:t.type,rendererOpts:t.rendererOpts||{}}};Qe.getScale=function(t,n){return n.width&&n.width>=t+n.margin*2?n.width/(t+n.margin*2):n.scale};Qe.getImageWidth=function(t,n){let r=Qe.getScale(t,n);return Math.floor((t+n.margin*2)*r)};Qe.qrToImageData=function(t,n,r){let i=n.modules.size,o=n.modules.data,s=Qe.getScale(i,r),a=Math.floor((i+r.margin*2)*s),u=r.margin*s,l=[r.color.light,r.color.dark];for(let c=0;c<a;c++)for(let f=0;f<a;f++){let h=(c*a+f)*4,p=r.color.light;if(c>=u&&f>=u&&c<a-u&&f<a-u){let y=Math.floor((c-u)/s),b=Math.floor((f-u)/s);p=l[o[y*i+b]?1:0]}t[h++]=p.r,t[h++]=p.g,t[h++]=p.b,t[h]=p.a}}});var os=B(hn=>{var kr=br();function wc(e,t,n){e.clearRect(0,0,t.width,t.height),t.style||(t.style={}),t.height=n,t.width=n,t.style.height=n+"px",t.style.width=n+"px"}function bc(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}hn.render=function(t,n,r){let i=r,o=n;typeof i>"u"&&(!n||!n.getContext)&&(i=n,n=void 0),n||(o=bc()),i=kr.getOptions(i);let s=kr.getImageWidth(t.modules.size,i),a=o.getContext("2d"),u=a.createImageData(s,s);return kr.qrToImageData(u.data,t,i),wc(a,o,s),a.putImageData(u,0,0),o};hn.renderToDataURL=function(t,n,r){let i=r;typeof i>"u"&&(!n||!n.getContext)&&(i=n,n=void 0),i||(i={});let o=hn.render(t,n,i),s=i.type||"image/png",a=i.rendererOpts||{};return o.toDataURL(s,a.quality)}});var us=B(as=>{var kc=br();function ss(e,t){let n=e.a/255,r=t+'="'+e.hex+'"';return n<1?r+" "+t+'-opacity="'+n.toFixed(2).slice(1)+'"':r}function Cr(e,t,n){let r=e+t;return typeof n<"u"&&(r+=" "+n),r}function Cc(e,t,n){let r="",i=0,o=!1,s=0;for(let a=0;a<e.length;a++){let u=Math.floor(a%t),l=Math.floor(a/t);!u&&!o&&(o=!0),e[a]?(s++,a>0&&u>0&&e[a-1]||(r+=o?Cr("M",u+n,.5+l+n):Cr("m",i,0),i=0,o=!1),u+1<t&&e[a+1]||(r+=Cr("h",s),s=0)):i++}return r}as.render=function(t,n,r){let i=kc.getOptions(n),o=t.modules.size,s=t.modules.data,a=o+i.margin*2,u=i.color.light.a?"<path "+ss(i.color.light,"fill")+' d="M0 0h'+a+"v"+a+'H0z"/>':"",l="<path "+ss(i.color.dark,"stroke")+' d="'+Cc(s,o,i.margin)+'"/>',c='viewBox="0 0 '+a+" "+a+'"',h='<svg xmlns="http://www.w3.org/2000/svg" '+(i.width?'width="'+i.width+'" height="'+i.width+'" ':"")+c+' shape-rendering="crispEdges">'+u+l+`</svg>
|
|
8
|
+
`;return typeof r=="function"&&r(null,h),h}});var cs=B(Lt=>{var Sc=fo(),Sr=rs(),ls=os(),Ec=us();function Er(e,t,n,r,i){let o=[].slice.call(arguments,1),s=o.length,a=typeof o[s-1]=="function";if(!a&&!Sc())throw new Error("Callback required as last argument");if(a){if(s<2)throw new Error("Too few arguments provided");s===2?(i=n,n=t,t=r=void 0):s===3&&(t.getContext&&typeof i>"u"?(i=r,r=void 0):(i=r,r=n,n=t,t=void 0))}else{if(s<1)throw new Error("Too few arguments provided");return s===1?(n=t,t=r=void 0):s===2&&!t.getContext&&(r=n,n=t,t=void 0),new Promise(function(u,l){try{let c=Sr.create(n,r);u(e(c,t,r))}catch(c){l(c)}})}try{let u=Sr.create(n,r);i(null,e(u,t,r))}catch(u){i(u)}}Lt.create=Sr.create;Lt.toCanvas=Er.bind(null,ls.render);Lt.toDataURL=Er.bind(null,ls.renderToDataURL);Lt.toString=Er.bind(null,function(e,t,n){return Ec.render(e,n)})});var va=B((oy,Ma)=>{"use strict";var zn=Object.prototype.hasOwnProperty,_a=Object.prototype.toString,Pa=Object.defineProperty,Ba=Object.getOwnPropertyDescriptor,Ra=function(t){return typeof Array.isArray=="function"?Array.isArray(t):_a.call(t)==="[object Array]"},La=function(t){if(!t||_a.call(t)!=="[object Object]")return!1;var n=zn.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&zn.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||zn.call(t,i)},Fa=function(t,n){Pa&&n.name==="__proto__"?Pa(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},za=function(t,n){if(n==="__proto__")if(zn.call(t,n)){if(Ba)return Ba(t,n).value}else return;return t[n]};Ma.exports=function e(){var t,n,r,i,o,s,a=arguments[0],u=1,l=arguments.length,c=!1;for(typeof a=="boolean"&&(c=a,a=arguments[1]||{},u=2),(a==null||typeof a!="object"&&typeof a!="function")&&(a={});u<l;++u)if(t=arguments[u],t!=null)for(n in t)r=za(a,n),i=za(t,n),a!==i&&(c&&i&&(La(i)||(o=Ra(i)))?(o?(o=!1,s=r&&Ra(r)?r:[]):s=r&&La(r)?r:{},Fa(a,{name:n,newValue:e(c,s,i)})):typeof i<"u"&&Fa(a,{name:n,newValue:i}));return a}});import{pdf as Xh}from"@react-pdf/renderer";import Zh from"react";import{Document as Gh,Font as Jh}from"@react-pdf/renderer";import{View as Zn,Text as Ll}from"@react-pdf/renderer";var bi=e=>Array.isArray(e)?e:[e],ki=(...e)=>(t,...n)=>{let r=t,i=e.slice().reverse();for(let o=0;o<i.length;o+=1){let s=i[o];r=s(r,...n)}return r};var uu=e=>/((-)?\d+\.?\d*)%/g.exec(`${e}`),Ci=e=>{let t=uu(e);if(t){let n=parseFloat(t[1]);return{percent:n/100,value:n}}return null};var jt=e=>typeof e=="string"?Number.parseFloat(e):e;var Du=Ue(Fi(),1),no=Ue(vi(),1),Zt=Ue(Qi(),1),ro=Ue(Gi(),1),io=Ue(Ki(),1),qu=e=>e.filter(Boolean),Vu=e=>e.reduce((t,n)=>{let r=Array.isArray(n)?Xn(n):n;return Object.keys(r).forEach(i=>{r[i]!==null&&r[i]!==void 0&&(t[i]=r[i])}),t},{}),Xn=ki(Vu,qu,bi);var Uu=e=>/rgba?/g.test(e),ju=e=>/hsla?/g.test(e),Hu=e=>{let t=Zt.default.get.rgb(e);return Zt.default.to.hex(t)},$u=e=>{let t=Zt.default.get.hsl(e).map(Math.round);return(0,no.default)(...t).toUpperCase()},oo=e=>Uu(e)?Hu(e):ju(e)?$u(e):e,Wu=e=>{if(typeof e=="number")return{value:e,unit:void 0};let t=/^(-?\d*\.?\d+)(in|mm|cm|pt|vh|vw|px|rem)?$/g.exec(e);return t?{value:parseFloat(t[1]),unit:t[2]||"pt"}:{value:e,unit:void 0}},K=(e,t)=>{let n=Wu(t),r=72,i=e.dpi||72,o=1/25.4*r,s=1/2.54*r;if(typeof n.value!="number")return n.value;switch(n.unit){case"rem":return n.value*(e.remBase||18);case"in":return n.value*r;case"mm":return n.value*o;case"cm":return n.value*s;case"vh":return n.value*(e.height/100);case"vw":return n.value*(e.width/100);case"px":return Math.round(n.value*(r/i));default:return n.value}},Be=(e,t)=>({[e]:jt(t)}),$=(e,t,n)=>({[e]:K(n,t)}),Se=(e,t)=>({[e]:oo(t)}),_=(e,t)=>({[e]:t}),Qu=/(-?\d+(\.\d+)?(in|mm|cm|pt|vw|vh|px|rem)?)\s(\S+)\s(.+)/,Yu=e=>e.match(Qu)||[],Ce=(e,t,n)=>{let r=Yu(`${t}`);if(r){let i=r[1]||t,o=r[4]||t,s=r[5]||t,a=o,u=s?oo(s):void 0,l=i?K(n,i):void 0;if(e.match(/(Top|Right|Bottom|Left)$/))return{[`${e}Color`]:u,[`${e}Style`]:a,[`${e}Width`]:l};if(e.match(/Color$/))return{borderTopColor:u,borderRightColor:u,borderBottomColor:u,borderLeftColor:u};if(e.match(/Style$/)){if(typeof a=="number")throw new Error(`Invalid border style: ${a}`);return{borderTopStyle:a,borderRightStyle:a,borderBottomStyle:a,borderLeftStyle:a}}if(e.match(/Width$/)){if(typeof l!="number")throw new Error(`Invalid border width: ${l}`);return{borderTopWidth:l,borderRightWidth:l,borderBottomWidth:l,borderLeftWidth:l}}if(e.match(/Radius$/)){let c=t?K(n,t):void 0;if(typeof c!="number")throw new Error(`Invalid border radius: ${c}`);return{borderTopLeftRadius:c,borderTopRightRadius:c,borderBottomRightRadius:c,borderBottomLeftRadius:c}}if(typeof l!="number")throw new Error(`Invalid border width: ${l}`);if(typeof a=="number")throw new Error(`Invalid border style: ${a}`);return{borderTopColor:u,borderTopStyle:a,borderTopWidth:l,borderRightColor:u,borderRightStyle:a,borderRightWidth:l,borderBottomColor:u,borderBottomStyle:a,borderBottomWidth:l,borderLeftColor:u,borderLeftStyle:a,borderLeftWidth:l}}return{[e]:t}},Gu={border:Ce,borderBottom:Ce,borderBottomColor:Se,borderBottomLeftRadius:$,borderBottomRightRadius:$,borderBottomStyle:_,borderBottomWidth:$,borderColor:Ce,borderLeft:Ce,borderLeftColor:Se,borderLeftStyle:_,borderLeftWidth:$,borderRadius:Ce,borderRight:Ce,borderRightColor:Se,borderRightStyle:_,borderRightWidth:$,borderStyle:Ce,borderTop:Ce,borderTopColor:Se,borderTopLeftRadius:$,borderTopRightRadius:$,borderTopStyle:_,borderTopWidth:$,borderWidth:Ce},Ju={backgroundColor:Se,color:Se,opacity:Be},Ku={height:$,maxHeight:$,maxWidth:$,minHeight:$,minWidth:$,width:$},Xu=[1,1,0],Zu=[1,1,"auto"],el=(e,t,n)=>{let r=Xu,i=[];t==="auto"?r=Zu:i=`${t}`.split(" ");let o=jt(i[0]||r[0]),s=jt(i[1]||r[1]),a=K(n,i[2]||r[2]);return{flexGrow:o,flexShrink:s,flexBasis:a}},tl={alignContent:_,alignItems:_,alignSelf:_,flex:el,flexBasis:$,flexDirection:_,flexFlow:_,flexGrow:Be,flexShrink:Be,flexWrap:_,justifyContent:_,justifySelf:_},nl=(e,t,n)=>{let r=`${t}`.split(" "),i=K(n,r?.[0]||t),o=K(n,r?.[1]||t);return{rowGap:i,columnGap:o}},rl={gap:nl,columnGap:$,rowGap:$},il={aspectRatio:Be,bottom:$,display:_,left:$,position:_,right:$,top:$,overflow:_,zIndex:Be},ol="px,in,mm,cm,pt,%,vw,vh",Gn=(e,t)=>{let n=e.toString();console.error(`
|
|
9
9
|
@react-pdf/stylesheet parsing error:
|
|
10
|
-
${
|
|
11
|
-
${" ".repeat(
|
|
12
|
-
Unsupported ${
|
|
13
|
-
`)},D=({expandsTo:t,maxValues:e=1,autoSupported:r=!1}={})=>(n,o,i)=>{let s=(0,dr.default)(`${o}`),a=[];for(let u=0;u<s.length;u++){let d=s[u];if(d.type==="function"||d.type==="string"||d.type==="div")return Ge(n,o),{};if(d.type==="word")if(d.value==="auto"&&r)a.push(d.value);else{let c=(0,fr.default)(d.value);if(c&&No.includes(c.unit))a.push(d.value);else return Ge(n,o),{}}}if(a.length>e)return Ge(n,o),{};let l=x(i,a[0]);if(t){let u=x(i,a[1]||a[0]),d=x(i,a[2]||a[0]),c=x(i,a[3]||a[1]||a[0]);return t({first:l,second:u,third:d,fourth:c})}return{[n]:l}},ko=D({expandsTo:({first:t,second:e,third:r,fourth:n})=>({marginTop:t,marginRight:e,marginBottom:r,marginLeft:n}),maxValues:4,autoSupported:!0}),Lo=D({expandsTo:({first:t,second:e})=>({marginTop:t,marginBottom:e}),maxValues:2,autoSupported:!0}),Fo=D({expandsTo:({first:t,second:e})=>({marginRight:t,marginLeft:e}),maxValues:2,autoSupported:!0}),Ce=D({autoSupported:!0}),Oo={margin:ko,marginBottom:Ce,marginHorizontal:Fo,marginLeft:Ce,marginRight:Ce,marginTop:Ce,marginVertical:Lo},Do=D({expandsTo:({first:t,second:e,third:r,fourth:n})=>({paddingTop:t,paddingRight:e,paddingBottom:r,paddingLeft:n}),maxValues:4}),_o=D({expandsTo:({first:t,second:e})=>({paddingTop:t,paddingBottom:e}),maxValues:2}),$o=D({expandsTo:({first:t,second:e})=>({paddingRight:t,paddingLeft:e}),maxValues:2}),Ee=D(),Uo={padding:Do,paddingBottom:Ee,paddingHorizontal:$o,paddingLeft:Ee,paddingRight:Ee,paddingTop:Ee,paddingVertical:_o},Q=t=>{switch(t){case"top":case"left":return"0%";case"right":case"bottom":return"100%";case"center":return"50%";default:return t}},qo=(t,e,r)=>{let n=`${e}`.split(" "),o=Q(x(r,n?.[0]||e)),i=Q(x(r,n?.[1]||e));return{objectPositionX:o,objectPositionY:i}},ir=(t,e,r)=>({[t]:Q(x(r,e))}),Vo={objectPosition:qo,objectPositionX:ir,objectPositionY:ir,objectFit:b},jo=t=>typeof t=="number"?t:parseInt(t,10),Ye={thin:100,hairline:100,ultralight:200,extralight:200,light:300,normal:400,medium:500,semibold:600,demibold:600,bold:700,ultrabold:800,extrabold:800,heavy:900,black:900},zo=t=>{if(!t)return Ye.normal;if(typeof t=="number")return t;let e=t.toLowerCase();return Ye[e]?Ye[e]:jo(t)},Ho=(t,e)=>({[t]:zo(e)}),Wo=(t,e,r)=>{if(t==="")return t;let n=x(r,e.fontSize||18),o=x(r,t),{percent:i}=Bt(o)||{};return i?i*n:isNaN(t)?o:o*n},Jo=(t,e,r,n)=>({[t]:Wo(e,n,r)}),Go={direction:b,fontFamily:b,fontSize:E,fontStyle:b,fontWeight:Ho,letterSpacing:E,lineHeight:Jo,maxLines:O,textAlign:b,textDecoration:b,textDecorationColor:k,textDecorationStyle:b,textIndent:b,textOverflow:b,textTransform:b,verticalAlign:b},Yo=t=>typeof t=="string"&&/^-?\d*\.?\d*$/.test(t),Ke=t=>typeof t!="string"?t:Yo(t)?parseFloat(t):t,Ko=t=>{let e=t.trim().split(/\)[ ,]|\)/);if(e.length===1)return[[e[0],!0]];let r=[];for(let n=0;n<e.length;n+=1){let o=e[n];if(o){let[i,s]=o.split("("),a=s.indexOf(",")>=0?",":" ",l=s.split(a).map(u=>u.trim());r.push({operation:i.trim(),value:l})}}return r},Ae=t=>{let e=/(-?\d*\.?\d*)(\w*)?/i,[,r,n]=e.exec(t),o=Number.parseFloat(r);return n==="rad"?o*180/Math.PI:o},Qo=({operation:t,value:e})=>{switch(t){case"scale":{let[r,n=r]=e.map(o=>Number.parseFloat(o));return{operation:"scale",value:[r,n]}}case"scaleX":return{operation:"scale",value:[Number.parseFloat(e),1]};case"scaleY":return{operation:"scale",value:[1,Number.parseFloat(e)]};case"rotate":return{operation:"rotate",value:[Ae(e)]};case"translate":return{operation:"translate",value:e.map(r=>Number.parseFloat(r))};case"translateX":return{operation:"translate",value:[Number.parseFloat(e),0]};case"translateY":return{operation:"translate",value:[0,Number.parseFloat(e)]};case"skew":return{operation:"skew",value:e.map(Ae)};case"skewX":return{operation:"skew",value:[Ae(e),0]};case"skewY":return{operation:"skew",value:[0,Ae(e)]};default:return{operation:t,value:e.map(r=>Number.parseFloat(r))}}},Xo=t=>t.map(e=>Qo(e)),ar=(t,e)=>typeof e!="string"?{[t]:e}:{[t]:Xo(Ko(e))},lr={top:!0,bottom:!0},Zo=(t,e)=>lr[t]?1:lr[e]?-1:0,es=t=>!t||t.length===0?["center","center"]:(t.length===1?[t[0],"center"]:t).sort(Zo),ts=(t,e,r)=>{let n=`${e}`.split(" "),o=es(n),i=x(r,o[0]),s=x(r,o[1]);return{transformOriginX:Q(i)||Ke(i),transformOriginY:Q(s)||Ke(s)}},cr=(t,e,r)=>{let n=x(r,e);return{[t]:Q(n)||Ke(n)}},rs={transform:ar,gradientTransform:ar,transformOrigin:ts,transformOriginX:cr,transformOriginY:cr},ns={fill:k,stroke:k,strokeDasharray:b,strokeWidth:E,fillOpacity:O,strokeOpacity:O,fillRule:b,textAnchor:b,strokeLinecap:b,strokeLinejoin:b,visibility:b,clipPath:b,dominantBaseline:b},Pi={...Ao,...xo,...To,...Ro,...Bo,...Mo,...Oo,...Uo,...Vo,...Go,...rs,...ns};import T,{useMemo as V,useContext as pr}from"react";function Te(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function"){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r}var Ze=T.createContext({style:{borderWidth:1}});function gr(t){var{children:e,weightings:r,style:n,tdStyle:o,trStyle:i}=t,s=Te(t,["children","weightings","style","tdStyle","trStyle"]);let a=V(()=>{let c=Qe([{borderColor:"#000000",borderWidth:"1px",borderStyle:"solid"},...Array.isArray(n)?n:[n]]);if(typeof c.border=="string"){let[f,m,y]=c.border.split(/\s+/);c.borderWidth=Number.parseFloat(f),c.borderStyle=m,c.borderColor=y}else typeof c.border=="number"&&(c.borderWidth=c.border);return typeof c.borderWidth=="string"&&(c.borderWidth=Number.parseFloat(c.borderWidth)),c},[n]),l=V(()=>{let c=[],f=m=>{T.Children.forEach(m,y=>{T.isValidElement(y)&&(y.type===T.Fragment?f(y.props.children):c.push(y))})};return f(e),c.map((m,y)=>T.cloneElement(m,{key:`table_row_${y}`,_firstRow:y===0,_lastRow:y===c.length-1}))},[e]),u=V(()=>[{width:"100%"},...Array.isArray(n)?n:[n],a.borderStyle==="solid"?{border:"0px"}:void 0].filter(Boolean),[n]),d=V(()=>({style:a,weightings:r,tdStyle:o,trStyle:i}),[a,r,o,i]);return T.createElement(Ze.Provider,{value:d},T.createElement(Xe,Object.assign({},s,{style:u}),l))}function et(t){var{children:e,style:r,_firstRow:n,_lastRow:o}=t,i=Te(t,["children","style","_firstRow","_lastRow"]);let{trStyle:s,weightings:a}=pr(Ze),l=V(()=>{var u,d;let c=[],f=g=>{T.Children.forEach(g,h=>{T.isValidElement(h)&&(h.type===T.Fragment?f(h.props.children):c.push(h))})};f(e);let m=[];for(let[g,h]of c.entries())!((u=h.props)===null||u===void 0)&&u.weighting?m.push((d=h.props)===null||d===void 0?void 0:d.weighting):m.push(a?.[g]);let y=(1-m.reduce((g,h)=>g+(h||0),0))/(c.length-m.filter(g=>typeof g=="number").length);return m=m.map(g=>g===void 0?y:g),c.map((g,h)=>T.cloneElement(g,{weighting:m[h],key:`table_col_${h}_cell`,_firstColumn:h===0,_lastColumn:h===c.length-1,_firstRow:n,_lastRow:o}))},[e,a,n,o]);return T.createElement(Xe,Object.assign({},i,{style:[{display:"flex",flexDirection:"row"},...Array.isArray(s)?s:[s],...Array.isArray(r)?r:[r]]}),l)}function mr(t){var{children:e,style:r}=t,n=Te(t,["children","style"]);return T.createElement(et,Object.assign({},n,{style:[{fontWeight:"bold"},...Array.isArray(r)?r:[r]]}),e)}function yr(t){var{children:e,weighting:r,_firstColumn:n,_lastColumn:o,_firstRow:i,_lastRow:s}=t,a=Te(t,["children","weighting","_firstColumn","_lastColumn","_firstRow","_lastRow"]);let l=V(()=>{let m=[],y=g=>{T.Children.forEach(g,h=>{T.isValidElement(h)&&h?.type===T.Fragment?y(h.props.children):m.push(h)})};return y(e),m.map((g,h)=>{let S=`table_cell_${h}_content`;return typeof g=="string"||typeof g=="number"?T.createElement(os,{key:S},g):g})},[e]),{tdStyle:u,style:d}=pr(Ze),c=-1*(d.borderWidth||0)+"px",f=V(()=>d.borderStyle==="solid"?{borderTop:`${d.borderWidth||0}px ${d.borderStyle} ${d.borderColor}`,borderRight:`${d.borderWidth||0}px ${d.borderStyle} ${d.borderColor}`,borderBottom:`${d.borderWidth||0}px ${d.borderStyle} ${d.borderColor}`,borderLeft:`${d.borderWidth||0}px ${d.borderStyle} ${d.borderColor}`,margin:`${c} ${o?c:"0"} ${s?c:0} ${c}`}:{borderTop:i?void 0:`${d.borderWidth||0}px ${d.borderStyle} ${d.borderColor}`,borderLeft:n?void 0:`${d.borderWidth||0}px ${d.borderStyle} ${d.borderColor}`},[d,n,o,i,i]);return T.createElement(Xe,Object.assign({wrap:!0},a,{style:[Object.assign(Object.assign({},f),{flex:r??1,display:"flex",flexDirection:"row",alignItems:"center"}),...Array.isArray(u)?u:[u],...Array.isArray(a.style)?a.style:[a.style]]}),l)}import{Image as ri,Page as ni,Text as oi,View as si}from"@react-pdf/renderer";var Cn=Y(bn());import En from"react";var An=async t=>{let e={margin:0,width:300,color:{dark:"#000",light:"#fff"}};return Cn.default.toDataURL(t,e)};function J(t){let{componentData:e,components:r,data:n,allProps:o={},images:i={}}=t;if(o.key&&delete o.key,o.styles&&delete o.styles,o.index&&delete o.index,o.className&&delete o.className,o.children&&delete o.children,Array.isArray(e)&&e.length>0)return e.map((s,a)=>J({componentData:{...s,props:{...s.props,index:a}},components:r,data:n,allProps:{},images:i}));if(typeof e=="object"&&e!==null&&"type"in e&&Object.keys(r).includes(e.type)){let{type:s,props:a={},children:l,visible:u="true"}=e,d={...o,...a},c=r[s];if(!c)return console.warn(`Component type "${s}" not found in components object`),null;let f=null;l!==void 0&&(Array.isArray(l)?f=l.map((R,I)=>J({componentData:R,components:r,data:n,allProps:d,images:i})):typeof l=="object"&&l!==null&&"type"in l?f=J({componentData:l,components:r,data:n,allProps:d,images:i}):f=l);let m={...d,key:crypto.randomUUID()};s==="Map"&&(m.data=n,m.images=i);let{mappedChild:y,mappedIsVisible:g,...h}=xn({...m,mappedChild:f,mappedIsVisible:u},n,i);return Tn(g)?En.createElement(c,h,y):null}return e}function Tt(t){let{componentData:e,components:r,data:n,allProps:o={},images:i={}}=t;if(o.key&&delete o.key,o.styles&&delete o.styles,o.index&&delete o.index,o.className&&delete o.className,o.children&&delete o.children,Array.isArray(e)&&e.length>0)return e.map((s,a)=>Tt({componentData:{...s,props:{...s.props,index:a}},components:r,data:n,allProps:{},images:i}));if(typeof e=="object"&&e!==null&&"type"in e&&Object.keys(r).includes(e.type)){let{type:s,props:a={},children:l,visible:u="true"}=e,d={...o,...a},c=r[s];if(!c)return console.warn(`Component type "${s}" not found in components object`),null;let f=null;l!==void 0&&(Array.isArray(l)?f=l.map((R,I)=>Tt({componentData:R,components:r,data:n,allProps:d,images:i})):typeof l=="object"&&l!==null&&"type"in l?f=Tt({componentData:l,components:r,data:n,allProps:d,images:i}):f=l);let m={...d,key:crypto.randomUUID()};s==="Map"&&(m.data=n,m.images=i);let{mappedChild:y,mappedIsVisible:g,...h}=xn({...m,mappedChild:f,mappedIsVisible:u},n,i);return Tn(g)?En.createElement(c,h,y):null}return e}var xn=(t,e,r)=>{let n={$data:e,$props:t,$images:r},o=/\{\{([^}]+)\}\}/g,i=s=>{let a=Array.from(s.matchAll(o));if(a.length===0)return s;if(a.length===1&&a[0][0]===s){let l=a[0][1].trim(),u=wn({obj:n,path:l});return u!==void 0?u:s}return a.reduce((l,u)=>{let d=u[1].trim(),c=wn({obj:n,path:d}),f=c!==void 0?String(c):u[0];return l.replace(u[0],f)},s)};return Object.fromEntries(Object.entries(t).map(([s,a])=>[s,typeof a=="string"?i(a):a]))},St=t=>{try{return JSON.parse(t)}catch{return null}};function wn({obj:t,path:e}){let r=e.split(".").filter(o=>o.length>0),n=t;for(let o of r){if(n==null||!(o in n))return;n=n[o]}return typeof n=="object"?JSON.stringify(n):n}function Tn(code){try{let result=eval(code);return typeof result=="boolean"?result:!1}catch(t){return console.error(`Error evaluating code "${code}":`,t),!1}}function la(t){return new Promise((e,r)=>{let n=new FileReader;n.onload=function(o){let i=o.target?.result;typeof i=="string"?e(i):r(new Error("File content is not a string"))},n.onerror=function(o){r(o)},n.readAsDataURL(t)})}var Sn=({items:t,component:e,data:r={},images:n={},itemKeyWord:o="item"})=>{let i=JSON.parse(t);if(!Array.isArray(i))return null;let s=i.map((a,l)=>({...e,props:{...e.props,[o]:a,[`${o}Index`]:l}}));return J({componentData:s,components:Oe,data:r,allProps:{},images:n})};import{Image as Xs}from"@react-pdf/renderer";import Zs from"react";import{jsx as ti}from"react/jsx-runtime";var ei=t=>{let{qrCodeText:e,...r}=t,n=Zs.useMemo(async()=>await An(e),[e]);return ti(Xs,{src:n,...r})},Pn=ei;var Oe={Page:ni,View:si,Text:oi,Image:ri,Table:gr,TH:mr,TR:et,TD:yr,QrCode:Pn,Map:Sn};import{jsx as li}from"react/jsx-runtime";var vn=({data:t,template:e})=>{let r=St(e),n=St(t);(r?.fonts||[]).forEach(l=>{ai.register(l)});let i=r?.components||[],s=r?.images||{},a=J({componentData:i,components:Oe,data:n||{},allProps:{},images:s});return li(ii,{children:a})};var ka=async(t,e)=>{try{if(!t||!e)throw new Error("Template and data are required");let r;try{if(r=JSON.parse(t),!r.components||!Array.isArray(r.components))throw new Error("Invalid template structure: missing or invalid components array")}catch(s){throw new Error(`Invalid template JSON: ${s instanceof Error?s.message:"Unknown parsing error"}`)}let n;try{if(n=JSON.parse(e),typeof n!="object"||n===null)throw new Error("Data must be a valid JSON object")}catch(s){throw new Error(`Invalid data JSON: ${s instanceof Error?s.message:"Unknown parsing error"}`)}let o=ui.createElement(vn,{data:e,template:t});return await ci(o).toBlob()}catch(r){let n=new Error(`PDF generation failed: ${r instanceof Error?r.message:"Unknown error"}`);throw n.originalError=r instanceof Error?r:void 0,n.template=t,n.data=e,n}};export{ka as generatePdf};
|
|
10
|
+
${n}: ${t},
|
|
11
|
+
${" ".repeat(n.length+2)}^
|
|
12
|
+
Unsupported ${n} value format
|
|
13
|
+
`)},Re=({expandsTo:e,maxValues:t=1,autoSupported:n=!1}={})=>(r,i,o)=>{let s=(0,ro.default)(`${i}`),a=[];for(let l=0;l<s.length;l++){let c=s[l];if(c.type==="function"||c.type==="string"||c.type==="div")return Gn(r,i),{};if(c.type==="word")if(c.value==="auto"&&n)a.push(c.value);else{let f=(0,io.default)(c.value);if(f&&ol.includes(f.unit))a.push(c.value);else return Gn(r,i),{}}}if(a.length>t)return Gn(r,i),{};let u=K(o,a[0]);if(e){let l=K(o,a[1]||a[0]),c=K(o,a[2]||a[0]),f=K(o,a[3]||a[1]||a[0]);return e({first:u,second:l,third:c,fourth:f})}return{[r]:u}},sl=Re({expandsTo:({first:e,second:t,third:n,fourth:r})=>({marginTop:e,marginRight:t,marginBottom:n,marginLeft:r}),maxValues:4,autoSupported:!0}),al=Re({expandsTo:({first:e,second:t})=>({marginTop:e,marginBottom:t}),maxValues:2,autoSupported:!0}),ul=Re({expandsTo:({first:e,second:t})=>({marginRight:e,marginLeft:t}),maxValues:2,autoSupported:!0}),Jt=Re({autoSupported:!0}),ll={margin:sl,marginBottom:Jt,marginHorizontal:ul,marginLeft:Jt,marginRight:Jt,marginTop:Jt,marginVertical:al},cl=Re({expandsTo:({first:e,second:t,third:n,fourth:r})=>({paddingTop:e,paddingRight:t,paddingBottom:n,paddingLeft:r}),maxValues:4}),fl=Re({expandsTo:({first:e,second:t})=>({paddingTop:e,paddingBottom:t}),maxValues:2}),hl=Re({expandsTo:({first:e,second:t})=>({paddingRight:e,paddingLeft:t}),maxValues:2}),Kt=Re(),pl={padding:cl,paddingBottom:Kt,paddingHorizontal:hl,paddingLeft:Kt,paddingRight:Kt,paddingTop:Kt,paddingVertical:fl},it=e=>{switch(e){case"top":case"left":return"0%";case"right":case"bottom":return"100%";case"center":return"50%";default:return e}},dl=(e,t,n)=>{let r=`${t}`.split(" "),i=it(K(n,r?.[0]||t)),o=it(K(n,r?.[1]||t));return{objectPositionX:i,objectPositionY:o}},Xi=(e,t,n)=>({[e]:it(K(n,t))}),ml={objectPosition:dl,objectPositionX:Xi,objectPositionY:Xi,objectFit:_},gl=e=>typeof e=="number"?e:parseInt(e,10),Jn={thin:100,hairline:100,ultralight:200,extralight:200,light:300,normal:400,medium:500,semibold:600,demibold:600,bold:700,ultrabold:800,extrabold:800,heavy:900,black:900},xl=e=>{if(!e)return Jn.normal;if(typeof e=="number")return e;let t=e.toLowerCase();return Jn[t]?Jn[t]:gl(e)},yl=(e,t)=>({[e]:xl(t)}),wl=(e,t,n)=>{if(e==="")return e;let r=K(n,t.fontSize||18),i=K(n,e),{percent:o}=Ci(i)||{};return o?o*r:isNaN(e)?i:i*r},bl=(e,t,n,r)=>({[e]:wl(t,r,n)}),kl={direction:_,fontFamily:_,fontSize:$,fontStyle:_,fontWeight:yl,letterSpacing:$,lineHeight:bl,maxLines:Be,textAlign:_,textDecoration:_,textDecorationColor:Se,textDecorationStyle:_,textIndent:_,textOverflow:_,textTransform:_,verticalAlign:_},Cl=e=>typeof e=="string"&&/^-?\d*\.?\d*$/.test(e),Kn=e=>typeof e!="string"?e:Cl(e)?parseFloat(e):e,Sl=e=>{let t=e.trim().split(/\)[ ,]|\)/);if(t.length===1)return[[t[0],!0]];let n=[];for(let r=0;r<t.length;r+=1){let i=t[r];if(i){let[o,s]=i.split("("),a=s.indexOf(",")>=0?",":" ",u=s.split(a).map(l=>l.trim());n.push({operation:o.trim(),value:u})}}return n},Xt=e=>{let t=/(-?\d*\.?\d*)(\w*)?/i,[,n,r]=t.exec(e),i=Number.parseFloat(n);return r==="rad"?i*180/Math.PI:i},El=({operation:e,value:t})=>{switch(e){case"scale":{let[n,r=n]=t.map(i=>Number.parseFloat(i));return{operation:"scale",value:[n,r]}}case"scaleX":return{operation:"scale",value:[Number.parseFloat(t),1]};case"scaleY":return{operation:"scale",value:[1,Number.parseFloat(t)]};case"rotate":return{operation:"rotate",value:[Xt(t)]};case"translate":return{operation:"translate",value:t.map(n=>Number.parseFloat(n))};case"translateX":return{operation:"translate",value:[Number.parseFloat(t),0]};case"translateY":return{operation:"translate",value:[0,Number.parseFloat(t)]};case"skew":return{operation:"skew",value:t.map(Xt)};case"skewX":return{operation:"skew",value:[Xt(t),0]};case"skewY":return{operation:"skew",value:[0,Xt(t)]};default:return{operation:e,value:t.map(n=>Number.parseFloat(n))}}},Il=e=>e.map(t=>El(t)),Zi=(e,t)=>typeof t!="string"?{[e]:t}:{[e]:Il(Sl(t))},eo={top:!0,bottom:!0},Al=(e,t)=>eo[e]?1:eo[t]?-1:0,Tl=e=>!e||e.length===0?["center","center"]:(e.length===1?[e[0],"center"]:e).sort(Al),Pl=(e,t,n)=>{let r=`${t}`.split(" "),i=Tl(r),o=K(n,i[0]),s=K(n,i[1]);return{transformOriginX:it(o)||Kn(o),transformOriginY:it(s)||Kn(s)}},to=(e,t,n)=>{let r=K(n,t);return{[e]:it(r)||Kn(r)}},Bl={transform:Zi,gradientTransform:Zi,transformOrigin:Pl,transformOriginX:to,transformOriginY:to},Rl={fill:Se,stroke:Se,strokeDasharray:_,strokeWidth:$,fillOpacity:Be,strokeOpacity:Be,fillRule:_,textAnchor:_,strokeLinecap:_,strokeLinejoin:_,visibility:_,clipPath:_,dominantBaseline:_},mp={...Gu,...Ju,...Ku,...tl,...rl,...il,...ll,...pl,...ml,...kl,...Bl,...Rl};import X,{useMemo as je,useContext as so}from"react";function en(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function"){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}var er=X.createContext({style:{borderWidth:1}});function ao(e){var{children:t,weightings:n,style:r,tdStyle:i,trStyle:o}=e,s=en(e,["children","weightings","style","tdStyle","trStyle"]);let a=je(()=>{let f=Xn([{borderColor:"#000000",borderWidth:"1px",borderStyle:"solid"},...Array.isArray(r)?r:[r]]);if(typeof f.border=="string"){let[h,p,y]=f.border.split(/\s+/);f.borderWidth=Number.parseFloat(h),f.borderStyle=p,f.borderColor=y}else typeof f.border=="number"&&(f.borderWidth=f.border);return typeof f.borderWidth=="string"&&(f.borderWidth=Number.parseFloat(f.borderWidth)),f},[r]),u=je(()=>{let f=[],h=p=>{X.Children.forEach(p,y=>{X.isValidElement(y)&&(y.type===X.Fragment?h(y.props.children):f.push(y))})};return h(t),f.map((p,y)=>X.cloneElement(p,{key:`table_row_${y}`,_firstRow:y===0,_lastRow:y===f.length-1}))},[t]),l=je(()=>[{width:"100%"},...Array.isArray(r)?r:[r],a.borderStyle==="solid"?{border:"0px"}:void 0].filter(Boolean),[r]),c=je(()=>({style:a,weightings:n,tdStyle:i,trStyle:o}),[a,n,i,o]);return X.createElement(er.Provider,{value:c},X.createElement(Zn,Object.assign({},s,{style:l}),u))}function tr(e){var{children:t,style:n,_firstRow:r,_lastRow:i}=e,o=en(e,["children","style","_firstRow","_lastRow"]);let{trStyle:s,weightings:a}=so(er),u=je(()=>{var l,c;let f=[],h=b=>{X.Children.forEach(b,C=>{X.isValidElement(C)&&(C.type===X.Fragment?h(C.props.children):f.push(C))})};h(t);let p=[];for(let[b,C]of f.entries())!((l=C.props)===null||l===void 0)&&l.weighting?p.push((c=C.props)===null||c===void 0?void 0:c.weighting):p.push(a?.[b]);let y=(1-p.reduce((b,C)=>b+(C||0),0))/(f.length-p.filter(b=>typeof b=="number").length);return p=p.map(b=>b===void 0?y:b),f.map((b,C)=>X.cloneElement(b,{weighting:p[C],key:`table_col_${C}_cell`,_firstColumn:C===0,_lastColumn:C===f.length-1,_firstRow:r,_lastRow:i}))},[t,a,r,i]);return X.createElement(Zn,Object.assign({},o,{style:[{display:"flex",flexDirection:"row"},...Array.isArray(s)?s:[s],...Array.isArray(n)?n:[n]]}),u)}function uo(e){var{children:t,style:n}=e,r=en(e,["children","style"]);return X.createElement(tr,Object.assign({},r,{style:[{fontWeight:"bold"},...Array.isArray(n)?n:[n]]}),t)}function lo(e){var{children:t,weighting:n,_firstColumn:r,_lastColumn:i,_firstRow:o,_lastRow:s}=e,a=en(e,["children","weighting","_firstColumn","_lastColumn","_firstRow","_lastRow"]);let u=je(()=>{let p=[],y=b=>{X.Children.forEach(b,C=>{X.isValidElement(C)&&C?.type===X.Fragment?y(C.props.children):p.push(C)})};return y(t),p.map((b,C)=>{let w=`table_cell_${C}_content`;return typeof b=="string"||typeof b=="number"?X.createElement(Ll,{key:w},b):b})},[t]),{tdStyle:l,style:c}=so(er),f=-1*(c.borderWidth||0)+"px",h=je(()=>c.borderStyle==="solid"?{borderTop:`${c.borderWidth||0}px ${c.borderStyle} ${c.borderColor}`,borderRight:`${c.borderWidth||0}px ${c.borderStyle} ${c.borderColor}`,borderBottom:`${c.borderWidth||0}px ${c.borderStyle} ${c.borderColor}`,borderLeft:`${c.borderWidth||0}px ${c.borderStyle} ${c.borderColor}`,margin:`${f} ${i?f:"0"} ${s?f:0} ${f}`}:{borderTop:o?void 0:`${c.borderWidth||0}px ${c.borderStyle} ${c.borderColor}`,borderLeft:r?void 0:`${c.borderWidth||0}px ${c.borderStyle} ${c.borderColor}`},[c,r,i,o,o]);return X.createElement(Zn,Object.assign({wrap:!0},a,{style:[Object.assign(Object.assign({},h),{flex:n??1,display:"flex",flexDirection:"row",alignItems:"center"}),...Array.isArray(l)?l:[l],...Array.isArray(a.style)?a.style:[a.style]]}),u)}import{Image as $h,Page as Wh,Text as Qh,View as Yh}from"@react-pdf/renderer";var hs=Ue(cs());import ps from"react";var ds=async e=>{let t={margin:0,width:300,color:{dark:"#000",light:"#fff"}};return hs.default.toDataURL(e,t)};function Ye(e){let{componentData:t,components:n,data:r,allProps:i={},images:o={}}=e;if(i.key&&delete i.key,i.styles&&delete i.styles,i.index&&delete i.index,i.className&&delete i.className,i.children&&delete i.children,Array.isArray(t)&&t.length>0)return t.map((s,a)=>Ye({componentData:{...s,props:{...s.props,index:a}},components:n,data:r,allProps:{},images:o}));if(typeof t=="object"&&t!==null&&"type"in t&&Object.keys(n).includes(t.type)){let{type:s,props:a={},children:u,visible:l="true"}=t,c={...i,...a},f=n[s];if(!f)return console.warn(`Component type "${s}" not found in components object`),null;let h=null;u!==void 0&&(Array.isArray(u)?h=u.map((F,S)=>Ye({componentData:F,components:n,data:r,allProps:c,images:o})):typeof u=="object"&&u!==null&&"type"in u?h=Ye({componentData:u,components:n,data:r,allProps:c,images:o}):h=u);let p={...c,key:crypto.randomUUID()};s==="Map"&&(p.data=r,p.images=o);let{mappedChild:y,mappedIsVisible:b,...C}=ms({...p,mappedChild:h,mappedIsVisible:l},r,o);return gs(b)?ps.createElement(f,C,y):null}return t}function Ir(e){let{componentData:t,components:n,data:r,allProps:i={},images:o={}}=e;if(i.key&&delete i.key,i.styles&&delete i.styles,i.index&&delete i.index,i.className&&delete i.className,i.children&&delete i.children,Array.isArray(t)&&t.length>0)return t.map((s,a)=>Ir({componentData:{...s,props:{...s.props,index:a}},components:n,data:r,allProps:{},images:o}));if(typeof t=="object"&&t!==null&&"type"in t&&Object.keys(n).includes(t.type)){let{type:s,props:a={},children:u,visible:l="true"}=t,c={...i,...a},f=n[s];if(!f)return console.warn(`Component type "${s}" not found in components object`),null;let h=null;u!==void 0&&(Array.isArray(u)?h=u.map((F,S)=>Ir({componentData:F,components:n,data:r,allProps:c,images:o})):typeof u=="object"&&u!==null&&"type"in u?h=Ir({componentData:u,components:n,data:r,allProps:c,images:o}):h=u);let p={...c,key:crypto.randomUUID()};s==="Map"&&(p.data=r,p.images=o);let{mappedChild:y,mappedIsVisible:b,...C}=ms({...p,mappedChild:h,mappedIsVisible:l},r,o);return gs(b)?ps.createElement(f,C,y):null}return t}var ms=(e,t,n)=>{let r={$data:t,$props:e,$images:n},i=/\{\{([^}]+)\}\}/g,o=s=>{let a=Array.from(s.matchAll(i));if(a.length===0)return s;if(a.length===1&&a[0][0]===s){let u=a[0][1].trim(),l=fs({obj:r,path:u});return l!==void 0?l:s}return a.reduce((u,l)=>{let c=l[1].trim(),f=fs({obj:r,path:c}),h=f!==void 0?String(f):l[0];return u.replace(l[0],h)},s)};return Object.fromEntries(Object.entries(e).map(([s,a])=>[s,typeof a=="string"?o(a):a]))},Ar=e=>{try{return JSON.parse(e)}catch{return null}};function fs({obj:e,path:t}){let n=t.split(".").filter(i=>i.length>0),r=e;for(let i of n){if(r==null||!(i in r))return;r=r[i]}return typeof r=="object"?JSON.stringify(r):r}function gs(code){try{let result=eval(code);return typeof result=="boolean"?result:!1}catch(e){return console.error(`Error evaluating code "${code}":`,e),!1}}function Kp(e){return new Promise((t,n)=>{let r=new FileReader;r.onload=function(i){let o=i.target?.result;typeof o=="string"?t(o):n(new Error("File content is not a string"))},r.onerror=function(i){n(i)},r.readAsDataURL(e)})}var xs=({items:e,component:t,data:n={},images:r={},itemKeyWord:i="item"})=>{let o=JSON.parse(e);if(!Array.isArray(o))return null;let s=o.map((a,u)=>({...t,props:{...t.props,[i]:a,[`${i}Index`]:u}}));return Ye({componentData:s,components:pn,data:n,allProps:{},images:r})};import{Image as Ic}from"@react-pdf/renderer";import Ac from"react";import{jsx as Pc}from"react/jsx-runtime";var Tc=e=>{let{qrCodeText:t,...n}=e,r=Ac.useMemo(async()=>await ds(t),[t]);return Pc(Ic,{src:r,...n})},ys=Tc;import $a from"react";import{Text as Ae,View as Te}from"@react-pdf/renderer";var Bc={};function Ge(e,t){let n=t||Bc,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return bs(e,r,i)}function bs(e,t,n){if(Rc(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return ws(e.children,t,n)}return Array.isArray(e)?ws(e,t,n):""}function ws(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=bs(e[i],t,n);return r.join("")}function Rc(e){return!!(e&&typeof e=="object")}var ks=document.createElement("i");function ct(e){let t="&"+e+";";ks.innerHTML=t;let n=ks.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function te(e,t,n,r){let i=e.length,o=0,s;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)s=Array.from(r),s.unshift(t,n),e.splice(...s);else for(n&&e.splice(t,n);o<r.length;)s=r.slice(o,o+1e4),s.unshift(t,0),e.splice(...s),o+=1e4,t+=1e4}function re(e,t){return e.length>0?(te(e,e.length,0,t),e):t}var Cs={}.hasOwnProperty;function Ss(e){let t={},n=-1;for(;++n<e.length;)Lc(t,e[n]);return t}function Lc(e,t){let n;for(n in t){let i=(Cs.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n],s;if(o)for(s in o){Cs.call(i,s)||(i[s]=[]);let a=o[s];Fc(i[s],Array.isArray(a)?a:a?[a]:[])}}}function Fc(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);te(e,0,0,r)}function dn(e,t){let n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"\uFFFD":String.fromCodePoint(n)}function Ie(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}var ue=Me(/[A-Za-z]/),ie=Me(/[\dA-Za-z]/),Es=Me(/[#-'*+\--9=?A-Z^-~]/);function Ft(e){return e!==null&&(e<32||e===127)}var zt=Me(/\d/),Is=Me(/[\dA-Fa-f]/),As=Me(/[!-/:-@[-`{-~]/);function E(e){return e!==null&&e<-2}function Q(e){return e!==null&&(e<0||e===32)}function A(e){return e===-2||e===-1||e===32}var Ts=Me(/\p{P}|\p{S}/u),Ps=Me(/\s/);function Me(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function P(e,t,n,r){let i=r?r-1:Number.POSITIVE_INFINITY,o=0;return s;function s(u){return A(u)?(e.enter(n),a(u)):t(u)}function a(u){return A(u)&&o++<i?(e.consume(u),a):(e.exit(n),t(u))}}var Bs={tokenize:zc};function zc(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),P(e,t,"linePrefix")}function i(a){return e.enter("paragraph"),o(a)}function o(a){let u=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=u),n=u,s(a)}function s(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return E(a)?(e.consume(a),e.exit("chunkText"),o):(e.consume(a),s)}}var Ls={tokenize:_c},Rs={tokenize:Mc};function _c(e){let t=this,n=[],r=0,i,o,s;return a;function a(S){if(r<n.length){let D=n[r];return t.containerState=D[1],e.attempt(D[0].continuation,u,l)(S)}return l(S)}function u(S){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&F();let D=t.events.length,M=D,x;for(;M--;)if(t.events[M][0]==="exit"&&t.events[M][1].type==="chunkFlow"){x=t.events[M][1].end;break}w(r);let v=D;for(;v<t.events.length;)t.events[v][1].end={...x},v++;return te(t.events,M+1,0,t.events.slice(D)),t.events.length=v,l(S)}return a(S)}function l(S){if(r===n.length){if(!i)return h(S);if(i.currentConstruct&&i.currentConstruct.concrete)return y(S);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Rs,c,f)(S)}function c(S){return i&&F(),w(r),h(S)}function f(S){return t.parser.lazy[t.now().line]=r!==n.length,s=t.now().offset,y(S)}function h(S){return t.containerState={},e.attempt(Rs,p,y)(S)}function p(S){return r++,n.push([t.currentConstruct,t.containerState]),h(S)}function y(S){if(S===null){i&&F(),w(0),e.consume(S);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:o}),b(S)}function b(S){if(S===null){C(e.exit("chunkFlow"),!0),w(0),e.consume(S);return}return E(S)?(e.consume(S),C(e.exit("chunkFlow")),r=0,t.interrupt=void 0,a):(e.consume(S),b)}function C(S,D){let M=t.sliceStream(S);if(D&&M.push(null),S.previous=o,o&&(o.next=S),o=S,i.defineSkip(S.start),i.write(M),t.parser.lazy[S.start.line]){let x=i.events.length;for(;x--;)if(i.events[x][1].start.offset<s&&(!i.events[x][1].end||i.events[x][1].end.offset>s))return;let v=t.events.length,j=v,O,H;for(;j--;)if(t.events[j][0]==="exit"&&t.events[j][1].type==="chunkFlow"){if(O){H=t.events[j][1].end;break}O=!0}for(w(r),x=v;x<t.events.length;)t.events[x][1].end={...H},x++;te(t.events,j+1,0,t.events.slice(v)),t.events.length=x}}function w(S){let D=n.length;for(;D-- >S;){let M=n[D];t.containerState=M[1],M[0].exit.call(t,e)}n.length=S}function F(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function Mc(e,t,n){return P(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function ft(e){if(e===null||Q(e)||Ps(e))return 1;if(Ts(e))return 2}function ht(e,t,n){let r=[],i=-1;for(;++i<e.length;){let o=e[i].resolveAll;o&&!r.includes(o)&&(t=o(t,n),r.push(o))}return t}var _t={name:"attention",resolveAll:vc,tokenize:Nc};function vc(e,t){let n=-1,r,i,o,s,a,u,l,c;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;u=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let f={...e[r][1].end},h={...e[n][1].start};Fs(f,-u),Fs(h,u),s={type:u>1?"strongSequence":"emphasisSequence",start:f,end:{...e[r][1].end}},a={type:u>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:h},o={type:u>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:u>1?"strong":"emphasis",start:{...s.start},end:{...a.end}},e[r][1].end={...s.start},e[n][1].start={...a.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=re(l,[["enter",e[r][1],t],["exit",e[r][1],t]])),l=re(l,[["enter",i,t],["enter",s,t],["exit",s,t],["enter",o,t]]),l=re(l,ht(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=re(l,[["exit",o,t],["enter",a,t],["exit",a,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(c=2,l=re(l,[["enter",e[n][1],t],["exit",e[n][1],t]])):c=0,te(e,r-1,n-r+3,l),n=r+l.length-c-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function Nc(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=ft(r),o;return s;function s(u){return o=u,e.enter("attentionSequence"),a(u)}function a(u){if(u===o)return e.consume(u),a;let l=e.exit("attentionSequence"),c=ft(u),f=!c||c===2&&i||n.includes(u),h=!i||i===2&&c||n.includes(r);return l._open=!!(o===42?f:f&&(i||!h)),l._close=!!(o===42?h:h&&(c||!f)),t(u)}}function Fs(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var Tr={name:"autolink",tokenize:Oc};function Oc(e,t,n){let r=0;return i;function i(p){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(p){return ue(p)?(e.consume(p),s):p===64?n(p):l(p)}function s(p){return p===43||p===45||p===46||ie(p)?(r=1,a(p)):l(p)}function a(p){return p===58?(e.consume(p),r=0,u):(p===43||p===45||p===46||ie(p))&&r++<32?(e.consume(p),a):(r=0,l(p))}function u(p){return p===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):p===null||p===32||p===60||Ft(p)?n(p):(e.consume(p),u)}function l(p){return p===64?(e.consume(p),c):Es(p)?(e.consume(p),l):n(p)}function c(p){return ie(p)?f(p):n(p)}function f(p){return p===46?(e.consume(p),r=0,c):p===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):h(p)}function h(p){if((p===45||ie(p))&&r++<63){let y=p===45?h:f;return e.consume(p),y}return n(p)}}var ve={partial:!0,tokenize:Dc};function Dc(e,t,n){return r;function r(o){return A(o)?P(e,i,"linePrefix")(o):i(o)}function i(o){return o===null||E(o)?t(o):n(o)}}var mn={continuation:{tokenize:Vc},exit:Uc,name:"blockQuote",tokenize:qc};function qc(e,t,n){let r=this;return i;function i(s){if(s===62){let a=r.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(s),e.exit("blockQuoteMarker"),o}return n(s)}function o(s){return A(s)?(e.enter("blockQuotePrefixWhitespace"),e.consume(s),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(s))}}function Vc(e,t,n){let r=this;return i;function i(s){return A(s)?P(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):o(s)}function o(s){return e.attempt(mn,t,n)(s)}}function Uc(e){e.exit("blockQuote")}var gn={name:"characterEscape",tokenize:jc};function jc(e,t,n){return r;function r(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),i}function i(o){return As(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}var xn={name:"characterReference",tokenize:Hc};function Hc(e,t,n){let r=this,i=0,o,s;return a;function a(f){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),u}function u(f){return f===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(f),e.exit("characterReferenceMarkerNumeric"),l):(e.enter("characterReferenceValue"),o=31,s=ie,c(f))}function l(f){return f===88||f===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(f),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,s=Is,c):(e.enter("characterReferenceValue"),o=7,s=zt,c(f))}function c(f){if(f===59&&i){let h=e.exit("characterReferenceValue");return s===ie&&!ct(r.sliceSerialize(h))?n(f):(e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return s(f)&&i++<o?(e.consume(f),c):n(f)}}var zs={partial:!0,tokenize:Wc},yn={concrete:!0,name:"codeFenced",tokenize:$c};function $c(e,t,n){let r=this,i={partial:!0,tokenize:M},o=0,s=0,a;return u;function u(x){return l(x)}function l(x){let v=r.events[r.events.length-1];return o=v&&v[1].type==="linePrefix"?v[2].sliceSerialize(v[1],!0).length:0,a=x,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),c(x)}function c(x){return x===a?(s++,e.consume(x),c):s<3?n(x):(e.exit("codeFencedFenceSequence"),A(x)?P(e,f,"whitespace")(x):f(x))}function f(x){return x===null||E(x)?(e.exit("codeFencedFence"),r.interrupt?t(x):e.check(zs,b,D)(x)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),h(x))}function h(x){return x===null||E(x)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),f(x)):A(x)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),P(e,p,"whitespace")(x)):x===96&&x===a?n(x):(e.consume(x),h)}function p(x){return x===null||E(x)?f(x):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),y(x))}function y(x){return x===null||E(x)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),f(x)):x===96&&x===a?n(x):(e.consume(x),y)}function b(x){return e.attempt(i,D,C)(x)}function C(x){return e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),w}function w(x){return o>0&&A(x)?P(e,F,"linePrefix",o+1)(x):F(x)}function F(x){return x===null||E(x)?e.check(zs,b,D)(x):(e.enter("codeFlowValue"),S(x))}function S(x){return x===null||E(x)?(e.exit("codeFlowValue"),F(x)):(e.consume(x),S)}function D(x){return e.exit("codeFenced"),t(x)}function M(x,v,j){let O=0;return H;function H(R){return x.enter("lineEnding"),x.consume(R),x.exit("lineEnding"),ce}function ce(R){return x.enter("codeFencedFence"),A(R)?P(x,q,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(R):q(R)}function q(R){return R===a?(x.enter("codeFencedFenceSequence"),I(R)):j(R)}function I(R){return R===a?(O++,x.consume(R),I):O>=s?(x.exit("codeFencedFenceSequence"),A(R)?P(x,L,"whitespace")(R):L(R)):j(R)}function L(R){return R===null||E(R)?(x.exit("codeFencedFence"),v(R)):j(R)}}}function Wc(e,t,n){let r=this;return i;function i(s){return s===null?n(s):(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}var Mt={name:"codeIndented",tokenize:Yc},Qc={partial:!0,tokenize:Gc};function Yc(e,t,n){let r=this;return i;function i(l){return e.enter("codeIndented"),P(e,o,"linePrefix",5)(l)}function o(l){let c=r.events[r.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?s(l):n(l)}function s(l){return l===null?u(l):E(l)?e.attempt(Qc,s,u)(l):(e.enter("codeFlowValue"),a(l))}function a(l){return l===null||E(l)?(e.exit("codeFlowValue"),s(l)):(e.consume(l),a)}function u(l){return e.exit("codeIndented"),t(l)}}function Gc(e,t,n){let r=this;return i;function i(s){return r.parser.lazy[r.now().line]?n(s):E(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i):P(e,o,"linePrefix",5)(s)}function o(s){let a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(s):E(s)?i(s):n(s)}}var Pr={name:"codeText",previous:Kc,resolve:Jc,tokenize:Xc};function Jc(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function Kc(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Xc(e,t,n){let r=this,i=0,o,s;return a;function a(h){return e.enter("codeText"),e.enter("codeTextSequence"),u(h)}function u(h){return h===96?(e.consume(h),i++,u):(e.exit("codeTextSequence"),l(h))}function l(h){return h===null?n(h):h===32?(e.enter("space"),e.consume(h),e.exit("space"),l):h===96?(s=e.enter("codeTextSequence"),o=0,f(h)):E(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),l):(e.enter("codeTextData"),c(h))}function c(h){return h===null||h===32||h===96||E(h)?(e.exit("codeTextData"),l(h)):(e.consume(h),c)}function f(h){return h===96?(e.consume(h),o++,f):o===i?(e.exit("codeTextSequence"),e.exit("codeText"),t(h)):(s.type="codeTextData",c(h))}}var wn=class{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){let r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){let i=n||0;this.setCursor(Math.trunc(t));let o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&vt(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),vt(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),vt(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){let n=this.left.splice(t,Number.POSITIVE_INFINITY);vt(this.right,n.reverse())}else{let n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);vt(this.left,n.reverse())}}};function vt(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function bn(e){let t={},n=-1,r,i,o,s,a,u,l,c=new wn(e);for(;++n<c.length;){for(;n in t;)n=t[n];if(r=c.get(n),n&&r[1].type==="chunkFlow"&&c.get(n-1)[1].type==="listItemPrefix"&&(u=r[1]._tokenizer.events,o=0,o<u.length&&u[o][1].type==="lineEndingBlank"&&(o+=2),o<u.length&&u[o][1].type==="content"))for(;++o<u.length&&u[o][1].type!=="content";)u[o][1].type==="chunkText"&&(u[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,Zc(c,n)),n=t[n],l=!0);else if(r[1]._container){for(o=n,i=void 0;o--;)if(s=c.get(o),s[1].type==="lineEnding"||s[1].type==="lineEndingBlank")s[0]==="enter"&&(i&&(c.get(i)[1].type="lineEndingBlank"),s[1].type="lineEnding",i=o);else if(!(s[1].type==="linePrefix"||s[1].type==="listItemIndent"))break;i&&(r[1].end={...c.get(i)[1].start},a=c.slice(i,n),a.unshift(r),c.splice(i,n-i+1,a))}}return te(e,0,Number.POSITIVE_INFINITY,c.slice(0)),!l}function Zc(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,o=[],s=n._tokenizer;s||(s=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(s._contentTypeTextTrailing=!0));let a=s.events,u=[],l={},c,f,h=-1,p=n,y=0,b=0,C=[b];for(;p;){for(;e.get(++i)[1]!==p;);o.push(i),p._tokenizer||(c=r.sliceStream(p),p.next||c.push(null),f&&s.defineSkip(p.start),p._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(c),p._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),f=p,p=p.next}for(p=n;++h<a.length;)a[h][0]==="exit"&&a[h-1][0]==="enter"&&a[h][1].type===a[h-1][1].type&&a[h][1].start.line!==a[h][1].end.line&&(b=h+1,C.push(b),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(s.events=[],p?(p._tokenizer=void 0,p.previous=void 0):C.pop(),h=C.length;h--;){let w=a.slice(C[h],C[h+1]),F=o.pop();u.push([F,F+w.length-1]),e.splice(F,2,w)}for(u.reverse(),h=-1;++h<u.length;)l[y+u[h][0]]=y+u[h][1],y+=u[h][1]-u[h][0]-1;return l}var Br={resolve:tf,tokenize:nf},ef={partial:!0,tokenize:rf};function tf(e){return bn(e),e}function nf(e,t){let n;return r;function r(a){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(a)}function i(a){return a===null?o(a):E(a)?e.check(ef,s,o)(a):(e.consume(a),i)}function o(a){return e.exit("chunkContent"),e.exit("content"),t(a)}function s(a){return e.consume(a),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function rf(e,t,n){let r=this;return i;function i(s){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),P(e,o,"linePrefix")}function o(s){if(s===null||E(s))return n(s);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(s):e.interrupt(r.parser.constructs.flow,n,t)(s)}}function kn(e,t,n,r,i,o,s,a,u){let l=u||Number.POSITIVE_INFINITY,c=0;return f;function f(w){return w===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(w),e.exit(o),h):w===null||w===32||w===41||Ft(w)?n(w):(e.enter(r),e.enter(s),e.enter(a),e.enter("chunkString",{contentType:"string"}),b(w))}function h(w){return w===62?(e.enter(o),e.consume(w),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),p(w))}function p(w){return w===62?(e.exit("chunkString"),e.exit(a),h(w)):w===null||w===60||E(w)?n(w):(e.consume(w),w===92?y:p)}function y(w){return w===60||w===62||w===92?(e.consume(w),p):p(w)}function b(w){return!c&&(w===null||w===41||Q(w))?(e.exit("chunkString"),e.exit(a),e.exit(s),e.exit(r),t(w)):c<l&&w===40?(e.consume(w),c++,b):w===41?(e.consume(w),c--,b):w===null||w===32||w===40||Ft(w)?n(w):(e.consume(w),w===92?C:b)}function C(w){return w===40||w===41||w===92?(e.consume(w),b):b(w)}}function Cn(e,t,n,r,i,o){let s=this,a=0,u;return l;function l(p){return e.enter(r),e.enter(i),e.consume(p),e.exit(i),e.enter(o),c}function c(p){return a>999||p===null||p===91||p===93&&!u||p===94&&!a&&"_hiddenFootnoteSupport"in s.parser.constructs?n(p):p===93?(e.exit(o),e.enter(i),e.consume(p),e.exit(i),e.exit(r),t):E(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),f(p))}function f(p){return p===null||p===91||p===93||E(p)||a++>999?(e.exit("chunkString"),c(p)):(e.consume(p),u||(u=!A(p)),p===92?h:f)}function h(p){return p===91||p===92||p===93?(e.consume(p),a++,f):f(p)}}function Sn(e,t,n,r,i,o){let s;return a;function a(h){return h===34||h===39||h===40?(e.enter(r),e.enter(i),e.consume(h),e.exit(i),s=h===40?41:h,u):n(h)}function u(h){return h===s?(e.enter(i),e.consume(h),e.exit(i),e.exit(r),t):(e.enter(o),l(h))}function l(h){return h===s?(e.exit(o),u(s)):h===null?n(h):E(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),P(e,l,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(h))}function c(h){return h===s||h===null||E(h)?(e.exit("chunkString"),l(h)):(e.consume(h),h===92?f:c)}function f(h){return h===s||h===92?(e.consume(h),c):c(h)}}function Je(e,t){let n;return r;function r(i){return E(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):A(i)?P(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}var Rr={name:"definition",tokenize:sf},of={partial:!0,tokenize:af};function sf(e,t,n){let r=this,i;return o;function o(p){return e.enter("definition"),s(p)}function s(p){return Cn.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function a(p){return i=Ie(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),u):n(p)}function u(p){return Q(p)?Je(e,l)(p):l(p)}function l(p){return kn(e,c,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function c(p){return e.attempt(of,f,f)(p)}function f(p){return A(p)?P(e,h,"whitespace")(p):h(p)}function h(p){return p===null||E(p)?(e.exit("definition"),r.parser.defined.push(i),t(p)):n(p)}}function af(e,t,n){return r;function r(a){return Q(a)?Je(e,i)(a):n(a)}function i(a){return Sn(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function o(a){return A(a)?P(e,s,"whitespace")(a):s(a)}function s(a){return a===null||E(a)?t(a):n(a)}}var Lr={name:"hardBreakEscape",tokenize:uf};function uf(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return E(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}var Fr={name:"headingAtx",resolve:lf,tokenize:cf};function lf(e,t){let n=e.length-2,r=3,i,o;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},te(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function cf(e,t,n){let r=0;return i;function i(c){return e.enter("atxHeading"),o(c)}function o(c){return e.enter("atxHeadingSequence"),s(c)}function s(c){return c===35&&r++<6?(e.consume(c),s):c===null||Q(c)?(e.exit("atxHeadingSequence"),a(c)):n(c)}function a(c){return c===35?(e.enter("atxHeadingSequence"),u(c)):c===null||E(c)?(e.exit("atxHeading"),t(c)):A(c)?P(e,a,"whitespace")(c):(e.enter("atxHeadingText"),l(c))}function u(c){return c===35?(e.consume(c),u):(e.exit("atxHeadingSequence"),a(c))}function l(c){return c===null||c===35||Q(c)?(e.exit("atxHeadingText"),a(c)):(e.consume(c),l)}}var _s=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],zr=["pre","script","style","textarea"];var _r={concrete:!0,name:"htmlFlow",resolveTo:pf,tokenize:df},ff={partial:!0,tokenize:gf},hf={partial:!0,tokenize:mf};function pf(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function df(e,t,n){let r=this,i,o,s,a,u;return l;function l(m){return c(m)}function c(m){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(m),f}function f(m){return m===33?(e.consume(m),h):m===47?(e.consume(m),o=!0,b):m===63?(e.consume(m),i=3,r.interrupt?t:d):ue(m)?(e.consume(m),s=String.fromCharCode(m),C):n(m)}function h(m){return m===45?(e.consume(m),i=2,p):m===91?(e.consume(m),i=5,a=0,y):ue(m)?(e.consume(m),i=4,r.interrupt?t:d):n(m)}function p(m){return m===45?(e.consume(m),r.interrupt?t:d):n(m)}function y(m){let oe="CDATA[";return m===oe.charCodeAt(a++)?(e.consume(m),a===oe.length?r.interrupt?t:q:y):n(m)}function b(m){return ue(m)?(e.consume(m),s=String.fromCharCode(m),C):n(m)}function C(m){if(m===null||m===47||m===62||Q(m)){let oe=m===47,De=s.toLowerCase();return!oe&&!o&&zr.includes(De)?(i=1,r.interrupt?t(m):q(m)):_s.includes(s.toLowerCase())?(i=6,oe?(e.consume(m),w):r.interrupt?t(m):q(m)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(m):o?F(m):S(m))}return m===45||ie(m)?(e.consume(m),s+=String.fromCharCode(m),C):n(m)}function w(m){return m===62?(e.consume(m),r.interrupt?t:q):n(m)}function F(m){return A(m)?(e.consume(m),F):H(m)}function S(m){return m===47?(e.consume(m),H):m===58||m===95||ue(m)?(e.consume(m),D):A(m)?(e.consume(m),S):H(m)}function D(m){return m===45||m===46||m===58||m===95||ie(m)?(e.consume(m),D):M(m)}function M(m){return m===61?(e.consume(m),x):A(m)?(e.consume(m),M):S(m)}function x(m){return m===null||m===60||m===61||m===62||m===96?n(m):m===34||m===39?(e.consume(m),u=m,v):A(m)?(e.consume(m),x):j(m)}function v(m){return m===u?(e.consume(m),u=null,O):m===null||E(m)?n(m):(e.consume(m),v)}function j(m){return m===null||m===34||m===39||m===47||m===60||m===61||m===62||m===96||Q(m)?M(m):(e.consume(m),j)}function O(m){return m===47||m===62||A(m)?S(m):n(m)}function H(m){return m===62?(e.consume(m),ce):n(m)}function ce(m){return m===null||E(m)?q(m):A(m)?(e.consume(m),ce):n(m)}function q(m){return m===45&&i===2?(e.consume(m),W):m===60&&i===1?(e.consume(m),G):m===62&&i===4?(e.consume(m),fe):m===63&&i===3?(e.consume(m),d):m===93&&i===5?(e.consume(m),ge):E(m)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(ff,ye,I)(m)):m===null||E(m)?(e.exit("htmlFlowData"),I(m)):(e.consume(m),q)}function I(m){return e.check(hf,L,ye)(m)}function L(m){return e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),R}function R(m){return m===null||E(m)?I(m):(e.enter("htmlFlowData"),q(m))}function W(m){return m===45?(e.consume(m),d):q(m)}function G(m){return m===47?(e.consume(m),s="",pe):q(m)}function pe(m){if(m===62){let oe=s.toLowerCase();return zr.includes(oe)?(e.consume(m),fe):q(m)}return ue(m)&&s.length<8?(e.consume(m),s+=String.fromCharCode(m),pe):q(m)}function ge(m){return m===93?(e.consume(m),d):q(m)}function d(m){return m===62?(e.consume(m),fe):m===45&&i===2?(e.consume(m),d):q(m)}function fe(m){return m===null||E(m)?(e.exit("htmlFlowData"),ye(m)):(e.consume(m),fe)}function ye(m){return e.exit("htmlFlow"),t(m)}}function mf(e,t,n){let r=this;return i;function i(s){return E(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o):n(s)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}function gf(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(ve,t,n)}}var Mr={name:"htmlText",tokenize:xf};function xf(e,t,n){let r=this,i,o,s;return a;function a(d){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(d),u}function u(d){return d===33?(e.consume(d),l):d===47?(e.consume(d),M):d===63?(e.consume(d),S):ue(d)?(e.consume(d),j):n(d)}function l(d){return d===45?(e.consume(d),c):d===91?(e.consume(d),o=0,y):ue(d)?(e.consume(d),F):n(d)}function c(d){return d===45?(e.consume(d),p):n(d)}function f(d){return d===null?n(d):d===45?(e.consume(d),h):E(d)?(s=f,G(d)):(e.consume(d),f)}function h(d){return d===45?(e.consume(d),p):f(d)}function p(d){return d===62?W(d):d===45?h(d):f(d)}function y(d){let fe="CDATA[";return d===fe.charCodeAt(o++)?(e.consume(d),o===fe.length?b:y):n(d)}function b(d){return d===null?n(d):d===93?(e.consume(d),C):E(d)?(s=b,G(d)):(e.consume(d),b)}function C(d){return d===93?(e.consume(d),w):b(d)}function w(d){return d===62?W(d):d===93?(e.consume(d),w):b(d)}function F(d){return d===null||d===62?W(d):E(d)?(s=F,G(d)):(e.consume(d),F)}function S(d){return d===null?n(d):d===63?(e.consume(d),D):E(d)?(s=S,G(d)):(e.consume(d),S)}function D(d){return d===62?W(d):S(d)}function M(d){return ue(d)?(e.consume(d),x):n(d)}function x(d){return d===45||ie(d)?(e.consume(d),x):v(d)}function v(d){return E(d)?(s=v,G(d)):A(d)?(e.consume(d),v):W(d)}function j(d){return d===45||ie(d)?(e.consume(d),j):d===47||d===62||Q(d)?O(d):n(d)}function O(d){return d===47?(e.consume(d),W):d===58||d===95||ue(d)?(e.consume(d),H):E(d)?(s=O,G(d)):A(d)?(e.consume(d),O):W(d)}function H(d){return d===45||d===46||d===58||d===95||ie(d)?(e.consume(d),H):ce(d)}function ce(d){return d===61?(e.consume(d),q):E(d)?(s=ce,G(d)):A(d)?(e.consume(d),ce):O(d)}function q(d){return d===null||d===60||d===61||d===62||d===96?n(d):d===34||d===39?(e.consume(d),i=d,I):E(d)?(s=q,G(d)):A(d)?(e.consume(d),q):(e.consume(d),L)}function I(d){return d===i?(e.consume(d),i=void 0,R):d===null?n(d):E(d)?(s=I,G(d)):(e.consume(d),I)}function L(d){return d===null||d===34||d===39||d===60||d===61||d===96?n(d):d===47||d===62||Q(d)?O(d):(e.consume(d),L)}function R(d){return d===47||d===62||Q(d)?O(d):n(d)}function W(d){return d===62?(e.consume(d),e.exit("htmlTextData"),e.exit("htmlText"),t):n(d)}function G(d){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),pe}function pe(d){return A(d)?P(e,ge,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(d):ge(d)}function ge(d){return e.enter("htmlTextData"),s(d)}}var Ke={name:"labelEnd",resolveAll:kf,resolveTo:Cf,tokenize:Sf},yf={tokenize:Ef},wf={tokenize:If},bf={tokenize:Af};function kf(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){let i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&te(e,0,e.length,n),e}function Cf(e,t){let n=e.length,r=0,i,o,s,a;for(;n--;)if(i=e[n][1],o){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(s){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(o=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(s=n);let u={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},l={type:"label",start:{...e[o][1].start},end:{...e[s][1].end}},c={type:"labelText",start:{...e[o+r+2][1].end},end:{...e[s-2][1].start}};return a=[["enter",u,t],["enter",l,t]],a=re(a,e.slice(o+1,o+r+3)),a=re(a,[["enter",c,t]]),a=re(a,ht(t.parser.constructs.insideSpan.null,e.slice(o+r+4,s-3),t)),a=re(a,[["exit",c,t],e[s-2],e[s-1],["exit",l,t]]),a=re(a,e.slice(s+1)),a=re(a,[["exit",u,t]]),te(e,o,e.length,a),e}function Sf(e,t,n){let r=this,i=r.events.length,o,s;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){o=r.events[i][1];break}return a;function a(h){return o?o._inactive?f(h):(s=r.parser.defined.includes(Ie(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(h),e.exit("labelMarker"),e.exit("labelEnd"),u):n(h)}function u(h){return h===40?e.attempt(yf,c,s?c:f)(h):h===91?e.attempt(wf,c,s?l:f)(h):s?c(h):f(h)}function l(h){return e.attempt(bf,c,f)(h)}function c(h){return t(h)}function f(h){return o._balanced=!0,n(h)}}function Ef(e,t,n){return r;function r(f){return e.enter("resource"),e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),i}function i(f){return Q(f)?Je(e,o)(f):o(f)}function o(f){return f===41?c(f):kn(e,s,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(f)}function s(f){return Q(f)?Je(e,u)(f):c(f)}function a(f){return n(f)}function u(f){return f===34||f===39||f===40?Sn(e,l,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(f):c(f)}function l(f){return Q(f)?Je(e,c)(f):c(f)}function c(f){return f===41?(e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),e.exit("resource"),t):n(f)}}function If(e,t,n){let r=this;return i;function i(a){return Cn.call(r,e,o,s,"reference","referenceMarker","referenceString")(a)}function o(a){return r.parser.defined.includes(Ie(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(a):n(a)}function s(a){return n(a)}}function Af(e,t,n){return r;function r(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),i}function i(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):n(o)}}var vr={name:"labelStartImage",resolveAll:Ke.resolveAll,tokenize:Tf};function Tf(e,t,n){let r=this;return i;function i(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),o}function o(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),s):n(a)}function s(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}var Nr={name:"labelStartLink",resolveAll:Ke.resolveAll,tokenize:Pf};function Pf(e,t,n){let r=this;return i;function i(s){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelLink"),o}function o(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):t(s)}}var Nt={name:"lineEnding",tokenize:Bf};function Bf(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),P(e,t,"linePrefix")}}var Xe={name:"thematicBreak",tokenize:Rf};function Rf(e,t,n){let r=0,i;return o;function o(l){return e.enter("thematicBreak"),s(l)}function s(l){return i=l,a(l)}function a(l){return l===i?(e.enter("thematicBreakSequence"),u(l)):r>=3&&(l===null||E(l))?(e.exit("thematicBreak"),t(l)):n(l)}function u(l){return l===i?(e.consume(l),r++,u):(e.exit("thematicBreakSequence"),A(l)?P(e,a,"whitespace")(l):a(l))}}var ne={continuation:{tokenize:_f},exit:vf,name:"list",tokenize:zf},Lf={partial:!0,tokenize:Nf},Ff={partial:!0,tokenize:Mf};function zf(e,t,n){let r=this,i=r.events[r.events.length-1],o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,s=0;return a;function a(p){let y=r.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(y==="listUnordered"?!r.containerState.marker||p===r.containerState.marker:zt(p)){if(r.containerState.type||(r.containerState.type=y,e.enter(y,{_container:!0})),y==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(Xe,n,l)(p):l(p);if(!r.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),u(p)}return n(p)}function u(p){return zt(p)&&++s<10?(e.consume(p),u):(!r.interrupt||s<2)&&(r.containerState.marker?p===r.containerState.marker:p===41||p===46)?(e.exit("listItemValue"),l(p)):n(p)}function l(p){return e.enter("listItemMarker"),e.consume(p),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||p,e.check(ve,r.interrupt?n:c,e.attempt(Lf,h,f))}function c(p){return r.containerState.initialBlankLine=!0,o++,h(p)}function f(p){return A(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),h):n(p)}function h(p){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(p)}}function _f(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(ve,i,o);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,P(e,t,"listItemIndent",r.containerState.size+1)(a)}function o(a){return r.containerState.furtherBlankLines||!A(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,s(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Ff,t,s)(a))}function s(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,P(e,e.attempt(ne,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function Mf(e,t,n){let r=this;return P(e,i,"listItemIndent",r.containerState.size+1);function i(o){let s=r.events[r.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===r.containerState.size?t(o):n(o)}}function vf(e){e.exit(this.containerState.type)}function Nf(e,t,n){let r=this;return P(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){let s=r.events[r.events.length-1];return!A(o)&&s&&s[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}var En={name:"setextUnderline",resolveTo:Of,tokenize:Df};function Of(e,t){let n=e.length,r,i,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);let s={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",s,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end={...e[o][1].end}):e[r][1]=s,e.push(["exit",s,t]),e}function Df(e,t,n){let r=this,i;return o;function o(l){let c=r.events.length,f;for(;c--;)if(r.events[c][1].type!=="lineEnding"&&r.events[c][1].type!=="linePrefix"&&r.events[c][1].type!=="content"){f=r.events[c][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(e.enter("setextHeadingLine"),i=l,s(l)):n(l)}function s(l){return e.enter("setextHeadingLineSequence"),a(l)}function a(l){return l===i?(e.consume(l),a):(e.exit("setextHeadingLineSequence"),A(l)?P(e,u,"lineSuffix")(l):u(l))}function u(l){return l===null||E(l)?(e.exit("setextHeadingLine"),t(l)):n(l)}}var Ms={tokenize:qf};function qf(e){let t=this,n=e.attempt(ve,r,e.attempt(this.parser.constructs.flowInitial,i,P(e,e.attempt(this.parser.constructs.flow,i,e.attempt(Br,i)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}var vs={resolveAll:qs()},Ns=Ds("string"),Os=Ds("text");function Ds(e){return{resolveAll:qs(e==="text"?Vf:void 0),tokenize:t};function t(n){let r=this,i=this.parser.constructs[e],o=n.attempt(i,s,a);return s;function s(c){return l(c)?o(c):a(c)}function a(c){if(c===null){n.consume(c);return}return n.enter("data"),n.consume(c),u}function u(c){return l(c)?(n.exit("data"),o(c)):(n.consume(c),u)}function l(c){if(c===null)return!0;let f=i[c],h=-1;if(f)for(;++h<f.length;){let p=f[h];if(!p.previous||p.previous.call(r,r.previous))return!0}return!1}}}function qs(e){return t;function t(n,r){let i=-1,o;for(;++i<=n.length;)o===void 0?n[i]&&n[i][1].type==="data"&&(o=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==o+2&&(n[o][1].end=n[i-1][1].end,n.splice(o+2,i-o-2),i=o+2),o=void 0);return e?e(n,r):n}}function Vf(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){let r=e[n-1][1],i=t.sliceStream(r),o=i.length,s=-1,a=0,u;for(;o--;){let l=i[o];if(typeof l=="string"){for(s=l.length;l.charCodeAt(s-1)===32;)a++,s--;if(s)break;s=-1}else if(l===-2)u=!0,a++;else if(l!==-1){o++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(a=0),a){let l={type:n===e.length||u||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?s:r.start._bufferIndex+s,_index:r.start._index+o,line:r.end.line,column:r.end.column-a,offset:r.end.offset-a},end:{...r.end}};r.end={...l.start},r.start.offset===r.end.offset?Object.assign(r,l):(e.splice(n,0,["enter",l,t],["exit",l,t]),n+=2)}n++}return e}var Or={};su(Or,{attentionMarkers:()=>Gf,contentInitial:()=>jf,disable:()=>Jf,document:()=>Uf,flow:()=>$f,flowInitial:()=>Hf,insideSpan:()=>Yf,string:()=>Wf,text:()=>Qf});var Uf={42:ne,43:ne,45:ne,48:ne,49:ne,50:ne,51:ne,52:ne,53:ne,54:ne,55:ne,56:ne,57:ne,62:mn},jf={91:Rr},Hf={[-2]:Mt,[-1]:Mt,32:Mt},$f={35:Fr,42:Xe,45:[En,Xe],60:_r,61:En,95:Xe,96:yn,126:yn},Wf={38:xn,92:gn},Qf={[-5]:Nt,[-4]:Nt,[-3]:Nt,33:vr,38:xn,42:_t,60:[Tr,Mr],91:Nr,92:[Lr,gn],93:Ke,95:_t,96:Pr},Yf={null:[_t,vs]},Gf={null:[42,95]},Jf={null:[]};function Vs(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},o=[],s=[],a=[],u=!0,l={attempt:O(v),check:O(j),consume:D,enter:M,exit:x,interrupt:O(j,{interrupt:!0})},c={code:null,containerState:{},defineSkip:w,events:[],now:C,parser:e,previous:null,sliceSerialize:y,sliceStream:b,write:p},f=t.tokenize.call(c,l),h;return t.resolveAll&&o.push(t),c;function p(I){return s=re(s,I),F(),s[s.length-1]!==null?[]:(H(t,0),c.events=ht(o,c.events,c),c.events)}function y(I,L){return Xf(b(I),L)}function b(I){return Kf(s,I)}function C(){let{_bufferIndex:I,_index:L,line:R,column:W,offset:G}=r;return{_bufferIndex:I,_index:L,line:R,column:W,offset:G}}function w(I){i[I.line]=I.column,q()}function F(){let I;for(;r._index<s.length;){let L=s[r._index];if(typeof L=="string")for(I=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===I&&r._bufferIndex<L.length;)S(L.charCodeAt(r._bufferIndex));else S(L)}}function S(I){u=void 0,h=I,f=f(I)}function D(I){E(I)?(r.line++,r.column=1,r.offset+=I===-3?2:1,q()):I!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===s[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=I,u=!0}function M(I,L){let R=L||{};return R.type=I,R.start=C(),c.events.push(["enter",R,c]),a.push(R),R}function x(I){let L=a.pop();return L.end=C(),c.events.push(["exit",L,c]),L}function v(I,L){H(I,L.from)}function j(I,L){L.restore()}function O(I,L){return R;function R(W,G,pe){let ge,d,fe,ye;return Array.isArray(W)?oe(W):"tokenize"in W?oe([W]):m(W);function m(ee){return wt;function wt(we){let qe=we!==null&&ee[we],tt=we!==null&&ee.null,Nn=[...Array.isArray(qe)?qe:qe?[qe]:[],...Array.isArray(tt)?tt:tt?[tt]:[]];return oe(Nn)(we)}}function oe(ee){return ge=ee,d=0,ee.length===0?pe:De(ee[d])}function De(ee){return wt;function wt(we){return ye=ce(),fe=ee,ee.partial||(c.currentConstruct=ee),ee.name&&c.parser.constructs.disable.null.includes(ee.name)?Ut(we):ee.tokenize.call(L?Object.assign(Object.create(c),L):c,l,vn,Ut)(we)}}function vn(ee){return u=!0,I(fe,ye),G}function Ut(ee){return u=!0,ye.restore(),++d<ge.length?De(ge[d]):pe}}}function H(I,L){I.resolveAll&&!o.includes(I)&&o.push(I),I.resolve&&te(c.events,L,c.events.length-L,I.resolve(c.events.slice(L),c)),I.resolveTo&&(c.events=I.resolveTo(c.events,c))}function ce(){let I=C(),L=c.previous,R=c.currentConstruct,W=c.events.length,G=Array.from(a);return{from:W,restore:pe};function pe(){r=I,c.previous=L,c.currentConstruct=R,c.events.length=W,a=G,q()}}function q(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Kf(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,o=t.end._bufferIndex,s;if(n===i)s=[e[n].slice(r,o)];else{if(s=e.slice(n,i),r>-1){let a=s[0];typeof a=="string"?s[0]=a.slice(r):s.shift()}o>0&&s.push(e[i].slice(0,o))}return s}function Xf(e,t){let n=-1,r=[],i;for(;++n<e.length;){let o=e[n],s;if(typeof o=="string")s=o;else switch(o){case-5:{s="\r";break}case-4:{s=`
|
|
14
|
+
`;break}case-3:{s=`\r
|
|
15
|
+
`;break}case-2:{s=t?" ":" ";break}case-1:{if(!t&&i)continue;s=" ";break}default:s=String.fromCharCode(o)}i=o===-2,r.push(s)}return r.join("")}function Dr(e){let r={constructs:Ss([Or,...(e||{}).extensions||[]]),content:i(Bs),defined:[],document:i(Ls),flow:i(Ms),lazy:{},string:i(Ns),text:i(Os)};return r;function i(o){return s;function s(a){return Vs(r,o,a)}}}function qr(e){for(;!bn(e););return e}var Us=/[\0\t\n\r]/g;function Vr(){let e=1,t="",n=!0,r;return i;function i(o,s,a){let u=[],l,c,f,h,p;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(s||void 0).decode(o)),f=0,t="",n&&(o.charCodeAt(0)===65279&&f++,n=void 0);f<o.length;){if(Us.lastIndex=f,l=Us.exec(o),h=l&&l.index!==void 0?l.index:o.length,p=o.charCodeAt(h),!l){t=o.slice(f);break}if(p===10&&f===h&&r)u.push(-3),r=void 0;else switch(r&&(u.push(-5),r=void 0),f<h&&(u.push(o.slice(f,h)),e+=h-f),p){case 0:{u.push(65533),e++;break}case 9:{for(c=Math.ceil(e/4)*4,u.push(-2);e++<c;)u.push(-1);break}case 10:{u.push(-4),e=1;break}default:r=!0,e=1}f=h+1}return a&&(r&&u.push(-5),t&&u.push(t),u.push(null)),u}}var Zf=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function In(e){return e.replace(Zf,eh)}function eh(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let i=n.charCodeAt(1),o=i===120||i===88;return dn(n.slice(o?2:1),o?16:10)}return ct(n)||e}function Ne(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?js(e.position):"start"in e||"end"in e?js(e):"line"in e||"column"in e?Ur(e):""}function Ur(e){return Hs(e&&e.line)+":"+Hs(e&&e.column)}function js(e){return Ur(e&&e.start)+"-"+Ur(e&&e.end)}function Hs(e){return e&&typeof e=="number"?e:1}var Ws={}.hasOwnProperty;function jr(e,t,n){return typeof t!="string"&&(n=t,t=void 0),th(n)(qr(Dr(n).document().write(Vr()(e,t,!0))))}function th(e){let t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(yi),autolinkProtocol:O,autolinkEmail:O,atxHeading:o(mi),blockQuote:o(we),characterEscape:O,characterReference:O,codeFenced:o(qe),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:o(qe,s),codeText:o(tt,s),codeTextData:O,data:O,codeFlowValue:O,definition:o(Nn),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:o(Ya),hardBreakEscape:o(gi),hardBreakTrailing:o(gi),htmlFlow:o(xi,s),htmlFlowData:O,htmlText:o(xi,s),htmlTextData:O,image:o(Ga),label:s,link:o(yi),listItem:o(Ja),listItemValue:h,listOrdered:o(wi,f),listUnordered:o(wi),paragraph:o(Ka),reference:m,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:o(mi),strong:o(Xa),thematicBreak:o(eu)},exit:{atxHeading:u(),atxHeadingSequence:M,autolink:u(),autolinkEmail:wt,autolinkProtocol:ee,blockQuote:u(),characterEscapeValue:H,characterReferenceMarkerHexadecimal:De,characterReferenceMarkerNumeric:De,characterReferenceValue:vn,characterReference:Ut,codeFenced:u(C),codeFencedFence:b,codeFencedFenceInfo:p,codeFencedFenceMeta:y,codeFlowValue:H,codeIndented:u(w),codeText:u(R),codeTextData:H,data:H,definition:u(),definitionDestinationString:D,definitionLabelString:F,definitionTitleString:S,emphasis:u(),hardBreakEscape:u(q),hardBreakTrailing:u(q),htmlFlow:u(I),htmlFlowData:H,htmlText:u(L),htmlTextData:H,image:u(G),label:ge,labelText:pe,lineEnding:ce,link:u(W),listItem:u(),listOrdered:u(),listUnordered:u(),paragraph:u(),referenceString:oe,resourceDestinationString:d,resourceTitleString:fe,resource:ye,setextHeading:u(j),setextHeadingLineSequence:v,setextHeadingText:x,strong:u(),thematicBreak:u()}};Qs(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(g){let k={type:"root",children:[]},T={stack:[k],tokenStack:[],config:t,enter:a,exit:l,buffer:s,resume:c,data:n},z=[],V=-1;for(;++V<g.length;)if(g[V][1].type==="listOrdered"||g[V][1].type==="listUnordered")if(g[V][0]==="enter")z.push(V);else{let de=z.pop();V=i(g,de,V)}for(V=-1;++V<g.length;){let de=t[g[V][0]];Ws.call(de,g[V][1].type)&&de[g[V][1].type].call(Object.assign({sliceSerialize:g[V][2].sliceSerialize},T),g[V][1])}if(T.tokenStack.length>0){let de=T.tokenStack[T.tokenStack.length-1];(de[1]||$s).call(T,void 0,de[0])}for(k.position={start:Oe(g.length>0?g[0][1].start:{line:1,column:1,offset:0}),end:Oe(g.length>0?g[g.length-2][1].end:{line:1,column:1,offset:0})},V=-1;++V<t.transforms.length;)k=t.transforms[V](k)||k;return k}function i(g,k,T){let z=k-1,V=-1,de=!1,Ve,be,bt,kt;for(;++z<=T;){let se=g[z];switch(se[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{se[0]==="enter"?V++:V--,kt=void 0;break}case"lineEndingBlank":{se[0]==="enter"&&(Ve&&!kt&&!V&&!bt&&(bt=z),kt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:kt=void 0}if(!V&&se[0]==="enter"&&se[1].type==="listItemPrefix"||V===-1&&se[0]==="exit"&&(se[1].type==="listUnordered"||se[1].type==="listOrdered")){if(Ve){let nt=z;for(be=void 0;nt--;){let ke=g[nt];if(ke[1].type==="lineEnding"||ke[1].type==="lineEndingBlank"){if(ke[0]==="exit")continue;be&&(g[be][1].type="lineEndingBlank",de=!0),ke[1].type="lineEnding",be=nt}else if(!(ke[1].type==="linePrefix"||ke[1].type==="blockQuotePrefix"||ke[1].type==="blockQuotePrefixWhitespace"||ke[1].type==="blockQuoteMarker"||ke[1].type==="listItemIndent"))break}bt&&(!be||bt<be)&&(Ve._spread=!0),Ve.end=Object.assign({},be?g[be][1].start:se[1].end),g.splice(be||z,0,["exit",Ve,se[2]]),z++,T++}if(se[1].type==="listItemPrefix"){let nt={type:"listItem",_spread:!1,start:Object.assign({},se[1].start),end:void 0};Ve=nt,g.splice(z,0,["enter",nt,se[2]]),z++,T++,bt=void 0,kt=!0}}}return g[k][1]._spread=de,T}function o(g,k){return T;function T(z){a.call(this,g(z),z),k&&k.call(this,z)}}function s(){this.stack.push({type:"fragment",children:[]})}function a(g,k,T){this.stack[this.stack.length-1].children.push(g),this.stack.push(g),this.tokenStack.push([k,T||void 0]),g.position={start:Oe(k.start),end:void 0}}function u(g){return k;function k(T){g&&g.call(this,T),l.call(this,T)}}function l(g,k){let T=this.stack.pop(),z=this.tokenStack.pop();if(z)z[0].type!==g.type&&(k?k.call(this,g,z[0]):(z[1]||$s).call(this,g,z[0]));else throw new Error("Cannot close `"+g.type+"` ("+Ne({start:g.start,end:g.end})+"): it\u2019s not open");T.position.end=Oe(g.end)}function c(){return Ge(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function h(g){if(this.data.expectingFirstListItemValue){let k=this.stack[this.stack.length-2];k.start=Number.parseInt(this.sliceSerialize(g),10),this.data.expectingFirstListItemValue=void 0}}function p(){let g=this.resume(),k=this.stack[this.stack.length-1];k.lang=g}function y(){let g=this.resume(),k=this.stack[this.stack.length-1];k.meta=g}function b(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function C(){let g=this.resume(),k=this.stack[this.stack.length-1];k.value=g.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function w(){let g=this.resume(),k=this.stack[this.stack.length-1];k.value=g.replace(/(\r?\n|\r)$/g,"")}function F(g){let k=this.resume(),T=this.stack[this.stack.length-1];T.label=k,T.identifier=Ie(this.sliceSerialize(g)).toLowerCase()}function S(){let g=this.resume(),k=this.stack[this.stack.length-1];k.title=g}function D(){let g=this.resume(),k=this.stack[this.stack.length-1];k.url=g}function M(g){let k=this.stack[this.stack.length-1];if(!k.depth){let T=this.sliceSerialize(g).length;k.depth=T}}function x(){this.data.setextHeadingSlurpLineEnding=!0}function v(g){let k=this.stack[this.stack.length-1];k.depth=this.sliceSerialize(g).codePointAt(0)===61?1:2}function j(){this.data.setextHeadingSlurpLineEnding=void 0}function O(g){let T=this.stack[this.stack.length-1].children,z=T[T.length-1];(!z||z.type!=="text")&&(z=Za(),z.position={start:Oe(g.start),end:void 0},T.push(z)),this.stack.push(z)}function H(g){let k=this.stack.pop();k.value+=this.sliceSerialize(g),k.position.end=Oe(g.end)}function ce(g){let k=this.stack[this.stack.length-1];if(this.data.atHardBreak){let T=k.children[k.children.length-1];T.position.end=Oe(g.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(k.type)&&(O.call(this,g),H.call(this,g))}function q(){this.data.atHardBreak=!0}function I(){let g=this.resume(),k=this.stack[this.stack.length-1];k.value=g}function L(){let g=this.resume(),k=this.stack[this.stack.length-1];k.value=g}function R(){let g=this.resume(),k=this.stack[this.stack.length-1];k.value=g}function W(){let g=this.stack[this.stack.length-1];if(this.data.inReference){let k=this.data.referenceType||"shortcut";g.type+="Reference",g.referenceType=k,delete g.url,delete g.title}else delete g.identifier,delete g.label;this.data.referenceType=void 0}function G(){let g=this.stack[this.stack.length-1];if(this.data.inReference){let k=this.data.referenceType||"shortcut";g.type+="Reference",g.referenceType=k,delete g.url,delete g.title}else delete g.identifier,delete g.label;this.data.referenceType=void 0}function pe(g){let k=this.sliceSerialize(g),T=this.stack[this.stack.length-2];T.label=In(k),T.identifier=Ie(k).toLowerCase()}function ge(){let g=this.stack[this.stack.length-1],k=this.resume(),T=this.stack[this.stack.length-1];if(this.data.inReference=!0,T.type==="link"){let z=g.children;T.children=z}else T.alt=k}function d(){let g=this.resume(),k=this.stack[this.stack.length-1];k.url=g}function fe(){let g=this.resume(),k=this.stack[this.stack.length-1];k.title=g}function ye(){this.data.inReference=void 0}function m(){this.data.referenceType="collapsed"}function oe(g){let k=this.resume(),T=this.stack[this.stack.length-1];T.label=k,T.identifier=Ie(this.sliceSerialize(g)).toLowerCase(),this.data.referenceType="full"}function De(g){this.data.characterReferenceType=g.type}function vn(g){let k=this.sliceSerialize(g),T=this.data.characterReferenceType,z;T?(z=dn(k,T==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):z=ct(k);let V=this.stack[this.stack.length-1];V.value+=z}function Ut(g){let k=this.stack.pop();k.position.end=Oe(g.end)}function ee(g){H.call(this,g);let k=this.stack[this.stack.length-1];k.url=this.sliceSerialize(g)}function wt(g){H.call(this,g);let k=this.stack[this.stack.length-1];k.url="mailto:"+this.sliceSerialize(g)}function we(){return{type:"blockquote",children:[]}}function qe(){return{type:"code",lang:null,meta:null,value:""}}function tt(){return{type:"inlineCode",value:""}}function Nn(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Ya(){return{type:"emphasis",children:[]}}function mi(){return{type:"heading",depth:0,children:[]}}function gi(){return{type:"break"}}function xi(){return{type:"html",value:""}}function Ga(){return{type:"image",title:null,url:"",alt:null}}function yi(){return{type:"link",title:null,url:"",children:[]}}function wi(g){return{type:"list",ordered:g.type==="listOrdered",start:null,spread:g._spread,children:[]}}function Ja(g){return{type:"listItem",spread:g._spread,checked:null,children:[]}}function Ka(){return{type:"paragraph",children:[]}}function Xa(){return{type:"strong",children:[]}}function Za(){return{type:"text",value:""}}function eu(){return{type:"thematicBreak"}}}function Oe(e){return{line:e.line,column:e.column,offset:e.offset}}function Qs(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?Qs(e,r):nh(e,r)}}function nh(e,t){let n;for(n in t)if(Ws.call(t,n))switch(n){case"canContainEols":{let r=t[n];r&&e[n].push(...r);break}case"transforms":{let r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{let r=t[n];r&&Object.assign(e[n],r);break}}}function $s(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Ne({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Ne({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Ne({start:t.start,end:t.end})+") is still open")}function pt(e){let t=this;t.parser=n;function n(r){return jr(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}var Ys={}.hasOwnProperty;function Gs(e,t){let n=t||{};function r(i,...o){let s=r.invalid,a=r.handlers;if(i&&Ys.call(i,e)){let u=String(i[e]);s=Ys.call(a,u)?a[u]:r.unknown}if(s)return s.call(this,i,...o)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}var rh={}.hasOwnProperty;function Hr(e,t){let n=-1,r;if(t.extensions)for(;++n<t.extensions.length;)Hr(e,t.extensions[n]);for(r in t)if(rh.call(t,r))switch(r){case"extensions":break;case"unsafe":{Js(e[r],t[r]);break}case"join":{Js(e[r],t[r]);break}case"handlers":{ih(e[r],t[r]);break}default:e.options[r]=t[r]}return e}function Js(e,t){t&&e.push(...t)}function ih(e,t){t&&Object.assign(e,t)}function Ks(e,t,n,r){let i=n.enter("blockquote"),o=n.createTracker(r);o.move("> "),o.shift(2);let s=n.indentLines(n.containerFlow(e,o.current()),oh);return i(),s}function oh(e,t,n){return">"+(n?"":" ")+e}function An(e,t){return Xs(e,t.inConstruct,!0)&&!Xs(e,t.notInConstruct,!1)}function Xs(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function $r(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
|
|
16
|
+
`&&An(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
|
|
17
|
+
`}function Zs(e,t){let n=String(e),r=n.indexOf(t),i=r,o=0,s=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++o>s&&(s=o):o=1,i=r+t.length,r=n.indexOf(t,i);return s}function Ot(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function ea(e){let t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function ta(e,t,n,r){let i=ea(n),o=e.value||"",s=i==="`"?"GraveAccent":"Tilde";if(Ot(e,n)){let f=n.enter("codeIndented"),h=n.indentLines(o,sh);return f(),h}let a=n.createTracker(r),u=i.repeat(Math.max(Zs(o,i)+1,3)),l=n.enter("codeFenced"),c=a.move(u);if(e.lang){let f=n.enter(`codeFencedLang${s}`);c+=a.move(n.safe(e.lang,{before:c,after:" ",encode:["`"],...a.current()})),f()}if(e.lang&&e.meta){let f=n.enter(`codeFencedMeta${s}`);c+=a.move(" "),c+=a.move(n.safe(e.meta,{before:c,after:`
|
|
18
|
+
`,encode:["`"],...a.current()})),f()}return c+=a.move(`
|
|
19
|
+
`),o&&(c+=a.move(o+`
|
|
20
|
+
`)),c+=a.move(u),l(),c}function sh(e,t,n){return(n?"":" ")+e}function dt(e){let t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function na(e,t,n,r){let i=dt(n),o=i==='"'?"Quote":"Apostrophe",s=n.enter("definition"),a=n.enter("label"),u=n.createTracker(r),l=u.move("[");return l+=u.move(n.safe(n.associationId(e),{before:l,after:"]",...u.current()})),l+=u.move("]: "),a(),!e.url||/[\0- \u007F]/.test(e.url)?(a=n.enter("destinationLiteral"),l+=u.move("<"),l+=u.move(n.safe(e.url,{before:l,after:">",...u.current()})),l+=u.move(">")):(a=n.enter("destinationRaw"),l+=u.move(n.safe(e.url,{before:l,after:e.title?" ":`
|
|
21
|
+
`,...u.current()}))),a(),e.title&&(a=n.enter(`title${o}`),l+=u.move(" "+i),l+=u.move(n.safe(e.title,{before:l,after:i,...u.current()})),l+=u.move(i),a()),s(),l}function ra(e){let t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function le(e){return"&#x"+e.toString(16).toUpperCase()+";"}function mt(e,t,n){let r=ft(e),i=ft(t);return r===void 0?i===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}Wr.peek=ah;function Wr(e,t,n,r){let i=ra(n),o=n.enter("emphasis"),s=n.createTracker(r),a=s.move(i),u=s.move(n.containerPhrasing(e,{after:i,before:a,...s.current()})),l=u.charCodeAt(0),c=mt(r.before.charCodeAt(r.before.length-1),l,i);c.inside&&(u=le(l)+u.slice(1));let f=u.charCodeAt(u.length-1),h=mt(r.after.charCodeAt(0),f,i);h.inside&&(u=u.slice(0,-1)+le(f));let p=s.move(i);return o(),n.attentionEncodeSurroundingInfo={after:h.outside,before:c.outside},a+u+p}function ah(e,t,n){return n.options.emphasis||"*"}var gt=function(e){if(e==null)return fh;if(typeof e=="function")return Tn(e);if(typeof e=="object")return Array.isArray(e)?uh(e):lh(e);if(typeof e=="string")return ch(e);throw new Error("Expected function, string, or object as test")};function uh(e){let t=[],n=-1;for(;++n<e.length;)t[n]=gt(e[n]);return Tn(r);function r(...i){let o=-1;for(;++o<t.length;)if(t[o].apply(this,i))return!0;return!1}}function lh(e){let t=e;return Tn(n);function n(r){let i=r,o;for(o in e)if(i[o]!==t[o])return!1;return!0}}function ch(e){return Tn(t);function t(n){return n&&n.type===e}}function Tn(e){return t;function t(n,r,i){return!!(hh(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function fh(){return!0}function hh(e){return e!==null&&typeof e=="object"&&"type"in e}var ia=[],Pn=!0,Ze=!1,Bn="skip";function Qr(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;let o=gt(i),s=r?-1:1;a(e,void 0,[])();function a(u,l,c){let f=u&&typeof u=="object"?u:{};if(typeof f.type=="string"){let p=typeof f.tagName=="string"?f.tagName:typeof f.name=="string"?f.name:void 0;Object.defineProperty(h,"name",{value:"node ("+(u.type+(p?"<"+p+">":""))+")"})}return h;function h(){let p=ia,y,b,C;if((!t||o(u,l,c[c.length-1]||void 0))&&(p=ph(n(u,c)),p[0]===Ze))return p;if("children"in u&&u.children){let w=u;if(w.children&&p[0]!==Bn)for(b=(r?w.children.length:-1)+s,C=c.concat(w);b>-1&&b<w.children.length;){let F=w.children[b];if(y=a(F,b,C)(),y[0]===Ze)return y;b=typeof y[1]=="number"?y[1]:b+s}}return p}}}function ph(e){return Array.isArray(e)?e:typeof e=="number"?[Pn,e]:e==null?ia:[e]}function Yr(e,t,n,r){let i,o,s;typeof t=="function"&&typeof n!="function"?(o=void 0,s=t,i=n):(o=t,s=n,i=r),Qr(e,o,a,i);function a(u,l){let c=l[l.length-1],f=c?c.children.indexOf(u):void 0;return s(u,f,c)}}function Rn(e,t){let n=!1;return Yr(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,Ze}),!!((!e.depth||e.depth<3)&&Ge(e)&&(t.options.setext||n))}function oa(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),o=n.createTracker(r);if(Rn(e,n)){let c=n.enter("headingSetext"),f=n.enter("phrasing"),h=n.containerPhrasing(e,{...o.current(),before:`
|
|
22
|
+
`,after:`
|
|
23
|
+
`});return f(),c(),h+`
|
|
24
|
+
`+(i===1?"=":"-").repeat(h.length-(Math.max(h.lastIndexOf("\r"),h.lastIndexOf(`
|
|
25
|
+
`))+1))}let s="#".repeat(i),a=n.enter("headingAtx"),u=n.enter("phrasing");o.move(s+" ");let l=n.containerPhrasing(e,{before:"# ",after:`
|
|
26
|
+
`,...o.current()});return/^[\t ]/.test(l)&&(l=le(l.charCodeAt(0))+l.slice(1)),l=l?s+" "+l:s,n.options.closeAtx&&(l+=" "+s),u(),a(),l}Gr.peek=dh;function Gr(e){return e.value||""}function dh(){return"<"}Jr.peek=mh;function Jr(e,t,n,r){let i=dt(n),o=i==='"'?"Quote":"Apostrophe",s=n.enter("image"),a=n.enter("label"),u=n.createTracker(r),l=u.move("![");return l+=u.move(n.safe(e.alt,{before:l,after:"]",...u.current()})),l+=u.move("]("),a(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(a=n.enter("destinationLiteral"),l+=u.move("<"),l+=u.move(n.safe(e.url,{before:l,after:">",...u.current()})),l+=u.move(">")):(a=n.enter("destinationRaw"),l+=u.move(n.safe(e.url,{before:l,after:e.title?" ":")",...u.current()}))),a(),e.title&&(a=n.enter(`title${o}`),l+=u.move(" "+i),l+=u.move(n.safe(e.title,{before:l,after:i,...u.current()})),l+=u.move(i),a()),l+=u.move(")"),s(),l}function mh(){return"!"}Kr.peek=gh;function Kr(e,t,n,r){let i=e.referenceType,o=n.enter("imageReference"),s=n.enter("label"),a=n.createTracker(r),u=a.move("!["),l=n.safe(e.alt,{before:u,after:"]",...a.current()});u+=a.move(l+"]["),s();let c=n.stack;n.stack=[],s=n.enter("reference");let f=n.safe(n.associationId(e),{before:u,after:"]",...a.current()});return s(),n.stack=c,o(),i==="full"||!l||l!==f?u+=a.move(f+"]"):i==="shortcut"?u=u.slice(0,-1):u+=a.move("]"),u}function gh(){return"!"}Xr.peek=xh;function Xr(e,t,n){let r=e.value||"",i="`",o=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++o<n.unsafe.length;){let s=n.unsafe[o],a=n.compilePattern(s),u;if(s.atBreak)for(;u=a.exec(r);){let l=u.index;r.charCodeAt(l)===10&&r.charCodeAt(l-1)===13&&l--,r=r.slice(0,l)+" "+r.slice(u.index+1)}}return i+r+i}function xh(){return"`"}function Zr(e,t){let n=Ge(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}ei.peek=yh;function ei(e,t,n,r){let i=dt(n),o=i==='"'?"Quote":"Apostrophe",s=n.createTracker(r),a,u;if(Zr(e,n)){let c=n.stack;n.stack=[],a=n.enter("autolink");let f=s.move("<");return f+=s.move(n.containerPhrasing(e,{before:f,after:">",...s.current()})),f+=s.move(">"),a(),n.stack=c,f}a=n.enter("link"),u=n.enter("label");let l=s.move("[");return l+=s.move(n.containerPhrasing(e,{before:l,after:"](",...s.current()})),l+=s.move("]("),u(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(u=n.enter("destinationLiteral"),l+=s.move("<"),l+=s.move(n.safe(e.url,{before:l,after:">",...s.current()})),l+=s.move(">")):(u=n.enter("destinationRaw"),l+=s.move(n.safe(e.url,{before:l,after:e.title?" ":")",...s.current()}))),u(),e.title&&(u=n.enter(`title${o}`),l+=s.move(" "+i),l+=s.move(n.safe(e.title,{before:l,after:i,...s.current()})),l+=s.move(i),u()),l+=s.move(")"),a(),l}function yh(e,t,n){return Zr(e,n)?"<":"["}ti.peek=wh;function ti(e,t,n,r){let i=e.referenceType,o=n.enter("linkReference"),s=n.enter("label"),a=n.createTracker(r),u=a.move("["),l=n.containerPhrasing(e,{before:u,after:"]",...a.current()});u+=a.move(l+"]["),s();let c=n.stack;n.stack=[],s=n.enter("reference");let f=n.safe(n.associationId(e),{before:u,after:"]",...a.current()});return s(),n.stack=c,o(),i==="full"||!l||l!==f?u+=a.move(f+"]"):i==="shortcut"?u=u.slice(0,-1):u+=a.move("]"),u}function wh(){return"["}function xt(e){let t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function sa(e){let t=xt(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function aa(e){let t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function Ln(e){let t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function ua(e,t,n,r){let i=n.enter("list"),o=n.bulletCurrent,s=e.ordered?aa(n):xt(n),a=e.ordered?s==="."?")":".":sa(n),u=t&&n.bulletLastUsed?s===n.bulletLastUsed:!1;if(!e.ordered){let c=e.children?e.children[0]:void 0;if((s==="*"||s==="-")&&c&&(!c.children||!c.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(u=!0),Ln(n)===s&&c){let f=-1;for(;++f<e.children.length;){let h=e.children[f];if(h&&h.type==="listItem"&&h.children&&h.children[0]&&h.children[0].type==="thematicBreak"){u=!0;break}}}}u&&(s=a),n.bulletCurrent=s;let l=n.containerFlow(e,r);return n.bulletLastUsed=s,n.bulletCurrent=o,i(),l}function la(e){let t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function ca(e,t,n,r){let i=la(n),o=n.bulletCurrent||xt(n);t&&t.type==="list"&&t.ordered&&(o=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+o);let s=o.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(s=Math.ceil(s/4)*4);let a=n.createTracker(r);a.move(o+" ".repeat(s-o.length)),a.shift(s);let u=n.enter("listItem"),l=n.indentLines(n.containerFlow(e,a.current()),c);return u(),l;function c(f,h,p){return h?(p?"":" ".repeat(s))+f:(p?o:o+" ".repeat(s-o.length))+f}}function fa(e,t,n,r){let i=n.enter("paragraph"),o=n.enter("phrasing"),s=n.containerPhrasing(e,r);return o(),i(),s}var ni=gt(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function ha(e,t,n,r){return(e.children.some(function(s){return ni(s)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function pa(e){let t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}ri.peek=bh;function ri(e,t,n,r){let i=pa(n),o=n.enter("strong"),s=n.createTracker(r),a=s.move(i+i),u=s.move(n.containerPhrasing(e,{after:i,before:a,...s.current()})),l=u.charCodeAt(0),c=mt(r.before.charCodeAt(r.before.length-1),l,i);c.inside&&(u=le(l)+u.slice(1));let f=u.charCodeAt(u.length-1),h=mt(r.after.charCodeAt(0),f,i);h.inside&&(u=u.slice(0,-1)+le(f));let p=s.move(i+i);return o(),n.attentionEncodeSurroundingInfo={after:h.outside,before:c.outside},a+u+p}function bh(e,t,n){return n.options.strong||"*"}function da(e,t,n,r){return n.safe(e.value,r)}function ma(e){let t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function ga(e,t,n){let r=(Ln(n)+(n.options.ruleSpaces?" ":"")).repeat(ma(n));return n.options.ruleSpaces?r.slice(0,-1):r}var xa={blockquote:Ks,break:$r,code:ta,definition:na,emphasis:Wr,hardBreak:$r,heading:oa,html:Gr,image:Jr,imageReference:Kr,inlineCode:Xr,link:ei,linkReference:ti,list:ua,listItem:ca,paragraph:fa,root:ha,strong:ri,text:da,thematicBreak:ga};var ya=[kh];function kh(e,t,n,r){if(t.type==="code"&&Ot(t,r)&&(e.type==="list"||e.type===t.type&&Ot(e,r)))return!1;if("spread"in n&&typeof n.spread=="boolean")return e.type==="paragraph"&&(e.type===t.type||t.type==="definition"||t.type==="heading"&&Rn(t,r))?void 0:n.spread?1:0}var et=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"],wa=[{character:" ",after:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",before:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde"]},{character:"\r",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde","codeFencedMetaGraveAccent","codeFencedMetaTilde","destinationLiteral","headingAtx"]},{character:`
|
|
27
|
+
`,inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde","codeFencedMetaGraveAccent","codeFencedMetaTilde","destinationLiteral","headingAtx"]},{character:" ",after:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",before:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde"]},{character:"!",after:"\\[",inConstruct:"phrasing",notInConstruct:et},{character:'"',inConstruct:"titleQuote"},{atBreak:!0,character:"#"},{character:"#",inConstruct:"headingAtx",after:`(?:[\r
|
|
28
|
+
]|$)`},{character:"&",after:"[#A-Za-z]",inConstruct:"phrasing"},{character:"'",inConstruct:"titleApostrophe"},{character:"(",inConstruct:"destinationRaw"},{before:"\\]",character:"(",inConstruct:"phrasing",notInConstruct:et},{atBreak:!0,before:"\\d+",character:")"},{character:")",inConstruct:"destinationRaw"},{atBreak:!0,character:"*",after:`(?:[ \r
|
|
29
|
+
*])`},{character:"*",inConstruct:"phrasing",notInConstruct:et},{atBreak:!0,character:"+",after:`(?:[ \r
|
|
30
|
+
])`},{atBreak:!0,character:"-",after:`(?:[ \r
|
|
31
|
+
-])`},{atBreak:!0,before:"\\d+",character:".",after:`(?:[ \r
|
|
32
|
+
]|$)`},{atBreak:!0,character:"<",after:"[!/?A-Za-z]"},{character:"<",after:"[!/?A-Za-z]",inConstruct:"phrasing",notInConstruct:et},{character:"<",inConstruct:"destinationLiteral"},{atBreak:!0,character:"="},{atBreak:!0,character:">"},{character:">",inConstruct:"destinationLiteral"},{atBreak:!0,character:"["},{character:"[",inConstruct:"phrasing",notInConstruct:et},{character:"[",inConstruct:["label","reference"]},{character:"\\",after:"[\\r\\n]",inConstruct:"phrasing"},{character:"]",inConstruct:["label","reference"]},{atBreak:!0,character:"_"},{character:"_",inConstruct:"phrasing",notInConstruct:et},{atBreak:!0,character:"`"},{character:"`",inConstruct:["codeFencedLangGraveAccent","codeFencedMetaGraveAccent"]},{character:"`",inConstruct:"phrasing",notInConstruct:et},{atBreak:!0,character:"~"}];function ba(e){return e.label||!e.identifier?e.label||"":In(e.identifier)}function ka(e){if(!e._compiled){let t=(e.atBreak?"[\\r\\n][\\t ]*":"")+(e.before?"(?:"+e.before+")":"");e._compiled=new RegExp((t?"("+t+")":"")+(/[|\\{}()[\]^$+*?.-]/.test(e.character)?"\\":"")+e.character+(e.after?"(?:"+e.after+")":""),"g")}return e._compiled}function Ca(e,t,n){let r=t.indexStack,i=e.children||[],o=[],s=-1,a=n.before,u;r.push(-1);let l=t.createTracker(n);for(;++s<i.length;){let c=i[s],f;if(r[r.length-1]=s,s+1<i.length){let y=t.handle.handlers[i[s+1].type];y&&y.peek&&(y=y.peek),f=y?y(i[s+1],e,t,{before:"",after:"",...l.current()}).charAt(0):""}else f=n.after;o.length>0&&(a==="\r"||a===`
|
|
33
|
+
`)&&c.type==="html"&&(o[o.length-1]=o[o.length-1].replace(/(\r?\n|\r)$/," "),a=" ",l=t.createTracker(n),l.move(o.join("")));let h=t.handle(c,e,t,{...l.current(),after:f,before:a});u&&u===h.slice(0,1)&&(h=le(u.charCodeAt(0))+h.slice(1));let p=t.attentionEncodeSurroundingInfo;t.attentionEncodeSurroundingInfo=void 0,u=void 0,p&&(o.length>0&&p.before&&a===o[o.length-1].slice(-1)&&(o[o.length-1]=o[o.length-1].slice(0,-1)+le(a.charCodeAt(0))),p.after&&(u=f)),l.move(h),o.push(h),a=h.slice(-1)}return r.pop(),o.join("")}function Sa(e,t,n){let r=t.indexStack,i=e.children||[],o=t.createTracker(n),s=[],a=-1;for(r.push(-1);++a<i.length;){let u=i[a];r[r.length-1]=a,s.push(o.move(t.handle(u,e,t,{before:`
|
|
34
|
+
`,after:`
|
|
35
|
+
`,...o.current()}))),u.type!=="list"&&(t.bulletLastUsed=void 0),a<i.length-1&&s.push(o.move(Ch(u,i[a+1],e,t)))}return r.pop(),s.join("")}function Ch(e,t,n,r){let i=r.join.length;for(;i--;){let o=r.join[i](e,t,n,r);if(o===!0||o===1)break;if(typeof o=="number")return`
|
|
36
|
+
`.repeat(1+o);if(o===!1)return`
|
|
37
|
+
|
|
38
|
+
<!---->
|
|
39
|
+
|
|
40
|
+
`}return`
|
|
41
|
+
|
|
42
|
+
`}var Sh=/\r?\n|\r/g;function Ea(e,t){let n=[],r=0,i=0,o;for(;o=Sh.exec(e);)s(e.slice(r,o.index)),n.push(o[0]),r=o.index+o[0].length,i++;return s(e.slice(r)),n.join("");function s(a){n.push(t(a,i,!a))}}function Aa(e,t,n){let r=(n.before||"")+(t||"")+(n.after||""),i=[],o=[],s={},a=-1;for(;++a<e.unsafe.length;){let c=e.unsafe[a];if(!An(e.stack,c))continue;let f=e.compilePattern(c),h;for(;h=f.exec(r);){let p="before"in c||!!c.atBreak,y="after"in c,b=h.index+(p?h[1].length:0);i.includes(b)?(s[b].before&&!p&&(s[b].before=!1),s[b].after&&!y&&(s[b].after=!1)):(i.push(b),s[b]={before:p,after:y})}}i.sort(Eh);let u=n.before?n.before.length:0,l=r.length-(n.after?n.after.length:0);for(a=-1;++a<i.length;){let c=i[a];c<u||c>=l||c+1<l&&i[a+1]===c+1&&s[c].after&&!s[c+1].before&&!s[c+1].after||i[a-1]===c-1&&s[c].before&&!s[c-1].before&&!s[c-1].after||(u!==c&&o.push(Ia(r.slice(u,c),"\\")),u=c,/[!-/:-@[-`{-~]/.test(r.charAt(c))&&(!n.encode||!n.encode.includes(r.charAt(c)))?o.push("\\"):(o.push(le(r.charCodeAt(c))),u++))}return o.push(Ia(r.slice(u,l),n.after)),o.join("")}function Eh(e,t){return e-t}function Ia(e,t){let n=/\\(?=[!-/:-@[-`{-~])/g,r=[],i=[],o=e+t,s=-1,a=0,u;for(;u=n.exec(o);)r.push(u.index);for(;++s<r.length;)a!==r[s]&&i.push(e.slice(a,r[s])),i.push("\\"),a=r[s];return i.push(e.slice(a)),i.join("")}function Ta(e){let t=e||{},n=t.now||{},r=t.lineShift||0,i=n.line||1,o=n.column||1;return{move:u,current:s,shift:a};function s(){return{now:{line:i,column:o},lineShift:r}}function a(l){r+=l}function u(l){let c=l||"",f=c.split(/\r?\n|\r/g),h=f[f.length-1];return i+=f.length-1,o=f.length===1?o+h.length:1+h.length+r,c}}function ii(e,t){let n=t||{},r={associationId:ba,containerPhrasing:Ph,containerFlow:Bh,createTracker:Ta,compilePattern:ka,enter:o,handlers:{...xa},handle:void 0,indentLines:Ea,indexStack:[],join:[...ya],options:{},safe:Rh,stack:[],unsafe:[...wa]};Hr(r,n),r.options.tightDefinitions&&r.join.push(Th),r.handle=Gs("type",{invalid:Ih,unknown:Ah,handlers:r.handlers});let i=r.handle(e,void 0,r,{before:`
|
|
43
|
+
`,after:`
|
|
44
|
+
`,now:{line:1,column:1},lineShift:0});return i&&i.charCodeAt(i.length-1)!==10&&i.charCodeAt(i.length-1)!==13&&(i+=`
|
|
45
|
+
`),i;function o(s){return r.stack.push(s),a;function a(){r.stack.pop()}}}function Ih(e){throw new Error("Cannot handle value `"+e+"`, expected node")}function Ah(e){let t=e;throw new Error("Cannot handle unknown node `"+t.type+"`")}function Th(e,t){if(e.type==="definition"&&e.type===t.type)return 0}function Ph(e,t){return Ca(e,this,t)}function Bh(e,t){return Sa(e,this,t)}function Rh(e,t){return Aa(this,e,t)}function Fn(e){let t=this;t.compiler=n;function n(r){return ii(r,{...t.data("settings"),...e,extensions:t.data("toMarkdownExtensions")||[]})}}function oi(e){if(e)throw e}var Mn=Ue(va(),1);function Dt(e){if(typeof e!="object"||e===null)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function si(){let e=[],t={run:n,use:r};return t;function n(...i){let o=-1,s=i.pop();if(typeof s!="function")throw new TypeError("Expected function as last argument, not "+s);a(null,...i);function a(u,...l){let c=e[++o],f=-1;if(u){s(u);return}for(;++f<i.length;)(l[f]===null||l[f]===void 0)&&(l[f]=i[f]);i=l,c?Na(c,a)(...l):s(null,...l)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function Na(e,t){let n;return r;function r(...s){let a=e.length>s.length,u;a&&s.push(i);try{u=e.apply(this,s)}catch(l){let c=l;if(a&&n)throw c;return i(c)}a||(u&&u.then&&typeof u.then=="function"?u.then(o,i):u instanceof Error?i(u):o(u))}function i(s,...a){n||(n=!0,t(s,...a))}function o(s){i(null,s)}}var Z=class extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},s=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?i=t:!o.cause&&t&&(s=!0,i=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){let u=r.indexOf(":");u===-1?o.ruleId=r:(o.source=r.slice(0,u),o.ruleId=r.slice(u+1))}if(!o.place&&o.ancestors&&o.ancestors){let u=o.ancestors[o.ancestors.length-1];u&&(o.place=u.position)}let a=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=a?a.line:void 0,this.name=Ne(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=s&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};Z.prototype.file="";Z.prototype.name="";Z.prototype.reason="";Z.prototype.message="";Z.prototype.stack="";Z.prototype.column=void 0;Z.prototype.line=void 0;Z.prototype.ancestors=void 0;Z.prototype.cause=void 0;Z.prototype.fatal=void 0;Z.prototype.place=void 0;Z.prototype.ruleId=void 0;Z.prototype.source=void 0;var me={basename:Lh,dirname:Fh,extname:zh,join:_h,sep:"/"};function Lh(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');qt(e);let n=0,r=-1,i=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let s=-1,a=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else s<0&&(o=!0,s=i+1),a>-1&&(e.codePointAt(i)===t.codePointAt(a--)?a<0&&(r=i):(a=-1,r=s));return n===r?r=s:r<0&&(r=e.length),e.slice(n,r)}function Fh(e){if(qt(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function zh(e){qt(e);let t=e.length,n=-1,r=0,i=-1,o=0,s;for(;t--;){let a=e.codePointAt(t);if(a===47){if(s){r=t+1;break}continue}n<0&&(s=!0,n=t+1),a===46?i<0?i=t:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||n<0||o===0||o===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function _h(...e){let t=-1,n;for(;++t<e.length;)qt(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":Mh(n)}function Mh(e){qt(e);let t=e.codePointAt(0)===47,n=vh(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function vh(e,t){let n="",r=0,i=-1,o=0,s=-1,a,u;for(;++s<=e.length;){if(s<e.length)a=e.codePointAt(s);else{if(a===47)break;a=47}if(a===47){if(!(i===s-1||o===1))if(i!==s-1&&o===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(u=n.lastIndexOf("/"),u!==n.length-1){u<0?(n="",r=0):(n=n.slice(0,u),r=n.length-1-n.lastIndexOf("/")),i=s,o=0;continue}}else if(n.length>0){n="",r=0,i=s,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,s):n=e.slice(i+1,s),r=s-i-1;i=s,o=0}else a===46&&o>-1?o++:o=-1}return n}function qt(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}var Oa={cwd:Nh};function Nh(){return"/"}function yt(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Da(e){if(typeof e=="string")e=new URL(e);else if(!yt(e)){let t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){let t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return Oh(e)}function Oh(e){if(e.hostname!==""){let r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}let t=e.pathname,n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){let r=t.codePointAt(n+2);if(r===70||r===102){let i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}var ai=["history","path","basename","stem","extname","dirname"],Vt=class{constructor(t){let n;t?yt(t)?n={path:t}:typeof t=="string"||Dh(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":Oa.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<ai.length;){let o=ai[r];o in n&&n[o]!==void 0&&n[o]!==null&&(this[o]=o==="history"?[...n[o]]:n[o])}let i;for(i in n)ai.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?me.basename(this.path):void 0}set basename(t){li(t,"basename"),ui(t,"basename"),this.path=me.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?me.dirname(this.path):void 0}set dirname(t){qa(this.basename,"dirname"),this.path=me.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?me.extname(this.path):void 0}set extname(t){if(ui(t,"extname"),qa(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=me.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){yt(t)&&(t=Da(t)),li(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?me.basename(this.path,this.extname):void 0}set stem(t){li(t,"stem"),ui(t,"stem"),this.path=me.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){let i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){let i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){let i=new Z(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}};function ui(e,t){if(e&&e.includes(me.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+me.sep+"`")}function li(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function qa(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function Dh(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}var Va=function(e){let r=this.constructor.prototype,i=r[e],o=function(){return i.apply(o,arguments)};return Object.setPrototypeOf(o,r),o};var qh={}.hasOwnProperty,pi=class e extends Va{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=si()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let r=this.attachers[n];t.use(...r)}return t.data((0,Mn.default)(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(hi("data",this.frozen),this.namespace[t]=n,this):qh.call(this.namespace,t)&&this.namespace[t]||void 0:t?(hi("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;let t=this;for(;++this.freezeIndex<this.attachers.length;){let[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);let i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();let n=_n(t),r=this.parser||this.Parser;return ci("parse",r),r(String(n),n)}process(t,n){let r=this;return this.freeze(),ci("process",this.parser||this.Parser),fi("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(o,s){let a=_n(t),u=r.parse(a);r.run(u,a,function(c,f,h){if(c||!f||!h)return l(c);let p=f,y=r.stringify(p,h);Uh(y)?h.value=y:h.result=y,l(c,h)});function l(c,f){c||!f?s(c):o?o(f):n(void 0,f)}}}processSync(t){let n=!1,r;return this.freeze(),ci("processSync",this.parser||this.Parser),fi("processSync",this.compiler||this.Compiler),this.process(t,i),ja("processSync","process",n),r;function i(o,s){n=!0,oi(o),r=s}}run(t,n,r){Ua(t),this.freeze();let i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?o(void 0,r):new Promise(o);function o(s,a){let u=_n(n);i.run(t,u,l);function l(c,f,h){let p=f||t;c?a(c):s?s(p):r(void 0,p,h)}}}runSync(t,n){let r=!1,i;return this.run(t,n,o),ja("runSync","run",r),i;function o(s,a){oi(s),i=a,r=!0}}stringify(t,n){this.freeze();let r=_n(n),i=this.compiler||this.Compiler;return fi("stringify",i),Ua(t),i(t,r)}use(t,...n){let r=this.attachers,i=this.namespace;if(hi("use",this.frozen),t!=null)if(typeof t=="function")u(t,n);else if(typeof t=="object")Array.isArray(t)?a(t):s(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function o(l){if(typeof l=="function")u(l,[]);else if(typeof l=="object")if(Array.isArray(l)){let[c,...f]=l;u(c,f)}else s(l);else throw new TypeError("Expected usable value, not `"+l+"`")}function s(l){if(!("plugins"in l)&&!("settings"in l))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");a(l.plugins),l.settings&&(i.settings=(0,Mn.default)(!0,i.settings,l.settings))}function a(l){let c=-1;if(l!=null)if(Array.isArray(l))for(;++c<l.length;){let f=l[c];o(f)}else throw new TypeError("Expected a list of plugins, not `"+l+"`")}function u(l,c){let f=-1,h=-1;for(;++f<r.length;)if(r[f][0]===l){h=f;break}if(h===-1)r.push([l,...c]);else if(c.length>0){let[p,...y]=c,b=r[h][1];Dt(b)&&Dt(p)&&(p=(0,Mn.default)(!0,b,p)),r[h]=[l,p,...y]}}}},di=new pi().freeze();function ci(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function fi(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function hi(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Ua(e){if(!Dt(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function ja(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function _n(e){return Vh(e)?e:new Vt(e)}function Vh(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function Uh(e){return typeof e=="string"||jh(e)}function jh(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}var Ha=di().use(pt).use(Fn).freeze();import{jsx as J,jsxs as Hh}from"react/jsx-runtime";var xe=(e,t=0)=>{if(!e)return null;switch(e.type){case"heading":{let n=e.depth===1?24:e.depth===2?20:e.depth===3?18:16,r=e.depth<=2?"bold":"normal";return J(Te,{style:{marginBottom:8,marginTop:e.depth===1?0:4},children:J(Ae,{style:{fontSize:n,fontWeight:r},children:e.children.map((i,o)=>xe(i,o))})},t)}case"paragraph":return J(Te,{style:{marginBottom:6},children:J(Ae,{children:e.children.map((n,r)=>xe(n,r))})},t);case"text":return e.value;case"strong":return J(Ae,{style:{fontWeight:"bold"},children:e.children.map((n,r)=>xe(n,r))},t);case"emphasis":return J(Ae,{style:{fontStyle:"italic"},children:e.children.map((n,r)=>xe(n,r))},t);case"list":return J(Te,{style:{marginBottom:8,marginLeft:0},children:e.children.map((n,r)=>Hh(Te,{style:{flexDirection:"row",marginBottom:4},children:[J(Ae,{style:{marginRight:8,width:20},children:e.ordered?`${r+1}.`:"\u2022"}),J(Te,{style:{flex:1},children:n.children.map((i,o)=>xe(i,o))})]},r))},t);case"listItem":return J($a.Fragment,{children:e.children.map((n,r)=>xe(n,r))},t);case"link":return J(Ae,{style:{color:"#0066cc"},children:e.children.map((n,r)=>xe(n,r))},t);case"code":return J(Ae,{style:{fontFamily:"Courier",backgroundColor:"#f5f5f5",padding:4},children:e.value},t);case"inlineCode":return J(Ae,{style:{fontFamily:"Courier",backgroundColor:"#f5f5f5"},children:e.value},t);case"blockquote":return J(Te,{style:{marginLeft:20,marginBottom:8,borderLeft:"2px solid #ccc",paddingLeft:10},children:e.children.map((n,r)=>xe(n,r))},t);case"break":return`
|
|
46
|
+
`;case"thematicBreak":return J(Te,{style:{borderBottom:"1px solid #ccc",marginVertical:12}},t);default:return"children"in e&&Array.isArray(e.children)?J($a.Fragment,{children:e.children.map((n,r)=>xe(n,r))},t):null}},Wa=({children:e,text:t,markdown:n,style:r,...i})=>{let o=n||t||(typeof e=="string"?e:null);if(!o||typeof o!="string")return null;try{let a=Ha().use(pt).parse(o);return J(Te,{style:r,...i,children:a.children.map((u,l)=>xe(u,l))})}catch(s){return console.error("Error parsing markdown:",s),J(Te,{style:r,...i,children:J(Ae,{children:o})})}};var pn={Page:Wh,View:Yh,Text:Qh,Image:$h,Table:ao,TH:uo,TR:tr,TD:lo,QrCode:ys,Map:xs,Markdown:Wa};import{jsx as Kh}from"react/jsx-runtime";var Qa=({data:e,template:t})=>{let n=Ar(t),r=Ar(e);(n?.fonts||[]).forEach(u=>{Jh.register(u)});let o=n?.components||[],s=n?.images||{},a=Ye({componentData:o,components:pn,data:r||{},allProps:{},images:s});return Kh(Gh,{children:a})};var aw=async(e,t)=>{try{if(!e||!t)throw new Error("Template and data are required");let n;try{if(n=JSON.parse(e),!n.components||!Array.isArray(n.components))throw new Error("Invalid template structure: missing or invalid components array")}catch(s){throw new Error(`Invalid template JSON: ${s instanceof Error?s.message:"Unknown parsing error"}`)}let r;try{if(r=JSON.parse(t),typeof r!="object"||r===null)throw new Error("Data must be a valid JSON object")}catch(s){throw new Error(`Invalid data JSON: ${s instanceof Error?s.message:"Unknown parsing error"}`)}let i=Zh.createElement(Qa,{data:t,template:e});return await Xh(i).toBlob()}catch(n){let r=new Error(`PDF generation failed: ${n instanceof Error?n.message:"Unknown error"}`);throw r.originalError=n instanceof Error?n:void 0,r.template=e,r.data=t,r}};export{aw as generatePdf};
|
|
14
47
|
//# sourceMappingURL=pdf-generator.esm.js.map
|