@blockcerts/blockcerts-verifier 1.52.1 → 1.53.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.
Files changed (3) hide show
  1. package/dist/ie11.js +18 -18
  2. package/dist/main.js +22 -22
  3. package/package.json +2 -2
package/dist/ie11.js CHANGED
@@ -176,7 +176,7 @@ function(e){var t=function(e){var t,n,r,i,o,a,s,u,l,A;for(/[^\x00-\xFF]/.test(e)
176
176
  * Licensed under the MIT License.
177
177
  * http://opensource.org/licenses/mit-license
178
178
  */
179
- function(e){e.loadFile=function(e,t,n){return function(e,t,n){t=!1!==t,n="function"==typeof n?n:function(){};var r=void 0;try{r=function(e,t,n){var r=new XMLHttpRequest,i=0,o=function(e){var t=e.length,n=[],r=String.fromCharCode;for(i=0;i<t;i+=1)n.push(r(255&e.charCodeAt(i)));return n.join("")};if(r.open("GET",e,!t),r.overrideMimeType("text/plain; charset=x-user-defined"),!1===t&&(r.onload=function(){200===r.status?n(o(this.responseText)):n(void 0)}),r.send(null),t&&200===r.status)return o(r.responseText)}(e,t,n)}catch(e){}return r}(e,t,n)},e.loadImageFile=e.loadFile}(lr.API),function(e){function t(){return(_n.html2canvas?Promise.resolve(_n.html2canvas):Promise.resolve().then((function(){return Yi}))).catch((function(e){return Promise.reject(new Error("Could not load html2canvas: "+e))})).then((function(e){return e.default?e.default:e}))}function n(){return(_n.DOMPurify?Promise.resolve(_n.DOMPurify):Promise.resolve().then((function(){return rpe}))).catch((function(e){return Promise.reject(new Error("Could not load dompurify: "+e))})).then((function(e){return e.default?e.default:e}))}var r=function(e){var t=Ht(e);return"undefined"===t?"undefined":"string"===t||e instanceof String?"string":"number"===t||e instanceof Number?"number":"function"===t||e instanceof Function?"function":e&&e.constructor===Array?"array":e&&1===e.nodeType?"element":"object"===t?"object":"unknown"},i=function(e,t){var n=document.createElement(e);for(var r in t.className&&(n.className=t.className),t.innerHTML&&t.dompurify&&(n.innerHTML=t.dompurify.sanitize(t.innerHTML)),t.style)n.style[r]=t.style[r];return n},o=function e(t){var n=Object.assign(e.convert(Promise.resolve()),JSON.parse(JSON.stringify(e.template))),r=e.convert(Promise.resolve(),n);return(r=r.setProgress(1,e,1,[e])).set(t)};(o.prototype=Object.create(Promise.prototype)).constructor=o,o.convert=function(e,t){return e.__proto__=t||o.prototype,e},o.template={prop:{src:null,container:null,overlay:null,canvas:null,img:null,pdf:null,pageSize:null,callback:function(){}},progress:{val:0,state:null,n:0,stack:[]},opt:{filename:"file.pdf",margin:[0,0,0,0],enableLinks:!0,x:0,y:0,html2canvas:{},jsPDF:{},backgroundColor:"transparent"}},o.prototype.from=function(e,t){return this.then((function(){switch(t=t||function(e){switch(r(e)){case"string":return"string";case"element":return"canvas"===e.nodeName.toLowerCase()?"canvas":"element";default:return"unknown"}}(e)){case"string":return this.then(n).then((function(t){return this.set({src:i("div",{innerHTML:e,dompurify:t})})}));case"element":return this.set({src:e});case"canvas":return this.set({canvas:e});case"img":return this.set({img:e});default:return this.error("Unknown source type.")}}))},o.prototype.to=function(e){switch(e){case"container":return this.toContainer();case"canvas":return this.toCanvas();case"img":return this.toImg();case"pdf":return this.toPdf();default:return this.error("Invalid target.")}},o.prototype.toContainer=function(){return this.thenList([function(){return this.prop.src||this.error("Cannot duplicate - no source HTML.")},function(){return this.prop.pageSize||this.setPageSize()}]).then((function(){var e={position:"relative",display:"inline-block",width:("number"!=typeof this.opt.width||isNaN(this.opt.width)||"number"!=typeof this.opt.windowWidth||isNaN(this.opt.windowWidth)?Math.max(this.prop.src.clientWidth,this.prop.src.scrollWidth,this.prop.src.offsetWidth):this.opt.windowWidth)+"px",left:0,right:0,top:0,margin:"auto",backgroundColor:this.opt.backgroundColor},t=function e(t,n){for(var r=3===t.nodeType?document.createTextNode(t.nodeValue):t.cloneNode(!1),i=t.firstChild;i;i=i.nextSibling)!0!==n&&1===i.nodeType&&"SCRIPT"===i.nodeName||r.appendChild(e(i,n));return 1===t.nodeType&&("CANVAS"===t.nodeName?(r.width=t.width,r.height=t.height,r.getContext("2d").drawImage(t,0,0)):"TEXTAREA"!==t.nodeName&&"SELECT"!==t.nodeName||(r.value=t.value),r.addEventListener("load",(function(){r.scrollTop=t.scrollTop,r.scrollLeft=t.scrollLeft}),!0)),r}(this.prop.src,this.opt.html2canvas.javascriptEnabled);"BODY"===t.tagName&&(e.height=Math.max(document.body.scrollHeight,document.body.offsetHeight,document.documentElement.clientHeight,document.documentElement.scrollHeight,document.documentElement.offsetHeight)+"px"),this.prop.overlay=i("div",{className:"html2pdf__overlay",style:{position:"fixed",overflow:"hidden",zIndex:1e3,left:"-100000px",right:0,bottom:0,top:0}}),this.prop.container=i("div",{className:"html2pdf__container",style:e}),this.prop.container.appendChild(t),this.prop.container.firstChild.appendChild(i("div",{style:{clear:"both",border:"0 none transparent",margin:0,padding:0,height:0}})),this.prop.container.style.float="none",this.prop.overlay.appendChild(this.prop.container),document.body.appendChild(this.prop.overlay),this.prop.container.firstChild.style.position="relative",this.prop.container.height=Math.max(this.prop.container.firstChild.clientHeight,this.prop.container.firstChild.scrollHeight,this.prop.container.firstChild.offsetHeight)+"px"}))},o.prototype.toCanvas=function(){var e=[function(){return document.body.contains(this.prop.container)||this.toContainer()}];return this.thenList(e).then(t).then((function(e){var t=Object.assign({},this.opt.html2canvas);return delete t.onrendered,e(this.prop.container,t)})).then((function(e){(this.opt.html2canvas.onrendered||function(){})(e),this.prop.canvas=e,document.body.removeChild(this.prop.overlay)}))},o.prototype.toContext2d=function(){var e=[function(){return document.body.contains(this.prop.container)||this.toContainer()}];return this.thenList(e).then(t).then((function(e){var t=this.opt.jsPDF,n=this.opt.fontFaces,r="number"!=typeof this.opt.width||isNaN(this.opt.width)||"number"!=typeof this.opt.windowWidth||isNaN(this.opt.windowWidth)?1:this.opt.width/this.opt.windowWidth,i=Object.assign({async:!0,allowTaint:!0,scale:r,scrollX:this.opt.scrollX||0,scrollY:this.opt.scrollY||0,backgroundColor:"#ffffff",imageTimeout:15e3,logging:!0,proxy:null,removeContainer:!0,foreignObjectRendering:!1,useCORS:!1},this.opt.html2canvas);if(delete i.onrendered,t.context2d.autoPaging=void 0===this.opt.autoPaging||this.opt.autoPaging,t.context2d.posX=this.opt.x,t.context2d.posY=this.opt.y,t.context2d.margin=this.opt.margin,t.context2d.fontFaces=n,n)for(var o=0;o<n.length;++o){var a=n[o],s=a.src.find((function(e){return"truetype"===e.format}));s&&t.addFont(s.url,a.ref.name,a.ref.style)}return i.windowHeight=i.windowHeight||0,i.windowHeight=0==i.windowHeight?Math.max(this.prop.container.clientHeight,this.prop.container.scrollHeight,this.prop.container.offsetHeight):i.windowHeight,t.context2d.save(!0),e(this.prop.container,i)})).then((function(e){this.opt.jsPDF.context2d.restore(!0),(this.opt.html2canvas.onrendered||function(){})(e),this.prop.canvas=e,document.body.removeChild(this.prop.overlay)}))},o.prototype.toImg=function(){return this.thenList([function(){return this.prop.canvas||this.toCanvas()}]).then((function(){var e=this.prop.canvas.toDataURL("image/"+this.opt.image.type,this.opt.image.quality);this.prop.img=document.createElement("img"),this.prop.img.src=e}))},o.prototype.toPdf=function(){return this.thenList([function(){return this.toContext2d()}]).then((function(){this.prop.pdf=this.prop.pdf||this.opt.jsPDF}))},o.prototype.output=function(e,t,n){return"img"===(n=n||"pdf").toLowerCase()||"image"===n.toLowerCase()?this.outputImg(e,t):this.outputPdf(e,t)},o.prototype.outputPdf=function(e,t){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).then((function(){return this.prop.pdf.output(e,t)}))},o.prototype.outputImg=function(e){return this.thenList([function(){return this.prop.img||this.toImg()}]).then((function(){switch(e){case void 0:case"img":return this.prop.img;case"datauristring":case"dataurlstring":return this.prop.img.src;case"datauri":case"dataurl":return document.location.href=this.prop.img.src;default:throw'Image output type "'+e+'" is not supported.'}}))},o.prototype.save=function(e){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).set(e?{filename:e}:null).then((function(){this.prop.pdf.save(this.opt.filename)}))},o.prototype.doCallback=function(){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).then((function(){this.prop.callback(this.prop.pdf)}))},o.prototype.set=function(e){if("object"!==r(e))return this;var t=Object.keys(e||{}).map((function(t){if(t in o.template.prop)return function(){this.prop[t]=e[t]};switch(t){case"margin":return this.setMargin.bind(this,e.margin);case"jsPDF":return function(){return this.opt.jsPDF=e.jsPDF,this.setPageSize()};case"pageSize":return this.setPageSize.bind(this,e.pageSize);default:return function(){this.opt[t]=e[t]}}}),this);return this.then((function(){return this.thenList(t)}))},o.prototype.get=function(e,t){return this.then((function(){var n=e in o.template.prop?this.prop[e]:this.opt[e];return t?t(n):n}))},o.prototype.setMargin=function(e){return this.then((function(){switch(r(e)){case"number":e=[e,e,e,e];case"array":if(2===e.length&&(e=[e[0],e[1],e[0],e[1]]),4===e.length)break;default:return this.error("Invalid margin array.")}this.opt.margin=e})).then(this.setPageSize)},o.prototype.setPageSize=function(e){function t(e,t){return Math.floor(e*t/72*96)}return this.then((function(){(e=e||lr.getPageSize(this.opt.jsPDF)).hasOwnProperty("inner")||(e.inner={width:e.width-this.opt.margin[1]-this.opt.margin[3],height:e.height-this.opt.margin[0]-this.opt.margin[2]},e.inner.px={width:t(e.inner.width,e.k),height:t(e.inner.height,e.k)},e.inner.ratio=e.inner.height/e.inner.width),this.prop.pageSize=e}))},o.prototype.setProgress=function(e,t,n,r){return null!=e&&(this.progress.val=e),null!=t&&(this.progress.state=t),null!=n&&(this.progress.n=n),null!=r&&(this.progress.stack=r),this.progress.ratio=this.progress.val/this.progress.state,this},o.prototype.updateProgress=function(e,t,n,r){return this.setProgress(e?this.progress.val+e:null,t||null,n?this.progress.n+n:null,r?this.progress.stack.concat(r):null)},o.prototype.then=function(e,t){var n=this;return this.thenCore(e,t,(function(e,t){return n.updateProgress(null,null,1,[e]),Promise.prototype.then.call(this,(function(t){return n.updateProgress(null,e),t})).then(e,t).then((function(e){return n.updateProgress(1),e}))}))},o.prototype.thenCore=function(e,t,n){n=n||Promise.prototype.then,e&&(e=e.bind(this)),t&&(t=t.bind(this));var r=-1!==Promise.toString().indexOf("[native code]")&&"Promise"===Promise.name?this:o.convert(Object.assign({},this),Promise.prototype),i=n.call(r,e,t);return o.convert(i,this.__proto__)},o.prototype.thenExternal=function(e,t){return Promise.prototype.then.call(this,e,t)},o.prototype.thenList=function(e){var t=this;return e.forEach((function(e){t=t.thenCore(e)})),t},o.prototype.catch=function(e){e&&(e=e.bind(this));var t=Promise.prototype.catch.call(this,e);return o.convert(t,this)},o.prototype.catchExternal=function(e){return Promise.prototype.catch.call(this,e)},o.prototype.error=function(e){return this.then((function(){throw new Error(e)}))},o.prototype.using=o.prototype.set,o.prototype.saveAs=o.prototype.save,o.prototype.export=o.prototype.output,o.prototype.run=o.prototype.then,lr.getPageSize=function(e,t,n){if("object"===Ht(e)){var r=e;e=r.orientation,t=r.unit||t,n=r.format||n}t=t||"mm",n=n||"a4",e=(""+(e||"P")).toLowerCase();var i,o=(""+n).toLowerCase(),a={a0:[2383.94,3370.39],a1:[1683.78,2383.94],a2:[1190.55,1683.78],a3:[841.89,1190.55],a4:[595.28,841.89],a5:[419.53,595.28],a6:[297.64,419.53],a7:[209.76,297.64],a8:[147.4,209.76],a9:[104.88,147.4],a10:[73.7,104.88],b0:[2834.65,4008.19],b1:[2004.09,2834.65],b2:[1417.32,2004.09],b3:[1000.63,1417.32],b4:[708.66,1000.63],b5:[498.9,708.66],b6:[354.33,498.9],b7:[249.45,354.33],b8:[175.75,249.45],b9:[124.72,175.75],b10:[87.87,124.72],c0:[2599.37,3676.54],c1:[1836.85,2599.37],c2:[1298.27,1836.85],c3:[918.43,1298.27],c4:[649.13,918.43],c5:[459.21,649.13],c6:[323.15,459.21],c7:[229.61,323.15],c8:[161.57,229.61],c9:[113.39,161.57],c10:[79.37,113.39],dl:[311.81,623.62],letter:[612,792],"government-letter":[576,756],legal:[612,1008],"junior-legal":[576,360],ledger:[1224,792],tabloid:[792,1224],"credit-card":[153,243]};switch(t){case"pt":i=1;break;case"mm":i=72/25.4;break;case"cm":i=72/2.54;break;case"in":i=72;break;case"px":i=.75;break;case"pc":case"em":i=12;break;case"ex":i=6;break;default:throw"Invalid unit: "+t}var s,u=0,l=0;if(a.hasOwnProperty(o))u=a[o][1]/i,l=a[o][0]/i;else try{u=n[1],l=n[0]}catch(e){throw new Error("Invalid format: "+n)}if("p"===e||"portrait"===e)e="p",l>u&&(s=l,l=u,u=s);else{if("l"!==e&&"landscape"!==e)throw"Invalid orientation: "+e;e="l",u>l&&(s=l,l=u,u=s)}return{width:l,height:u,unit:t,k:i,orientation:e}},e.html=function(e,t){(t=t||{}).callback=t.callback||function(){},t.html2canvas=t.html2canvas||{},t.html2canvas.canvas=t.html2canvas.canvas||this.canvas,t.jsPDF=t.jsPDF||this,t.fontFaces=t.fontFaces?t.fontFaces.map(ri):null;var n=new o(t);return t.worker?n:n.from(e).doCallback()}}(lr.API),lr.API.addJS=function(e){return fi=e,this.internal.events.subscribe("postPutResources",(function(){ci=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/Names [(EmbeddedJS) "+(ci+1)+" 0 R]"),this.internal.out(">>"),this.internal.out("endobj"),hi=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/S /JavaScript"),this.internal.out("/JS ("+fi+")"),this.internal.out(">>"),this.internal.out("endobj")})),this.internal.events.subscribe("putCatalog",(function(){void 0!==ci&&void 0!==hi&&this.internal.out("/Names <</JavaScript "+ci+" 0 R>>")})),this},
179
+ function(e){e.loadFile=function(e,t,n){return function(e,t,n){t=!1!==t,n="function"==typeof n?n:function(){};var r=void 0;try{r=function(e,t,n){var r=new XMLHttpRequest,i=0,o=function(e){var t=e.length,n=[],r=String.fromCharCode;for(i=0;i<t;i+=1)n.push(r(255&e.charCodeAt(i)));return n.join("")};if(r.open("GET",e,!t),r.overrideMimeType("text/plain; charset=x-user-defined"),!1===t&&(r.onload=function(){200===r.status?n(o(this.responseText)):n(void 0)}),r.send(null),t&&200===r.status)return o(r.responseText)}(e,t,n)}catch(e){}return r}(e,t,n)},e.loadImageFile=e.loadFile}(lr.API),function(e){function t(){return(_n.html2canvas?Promise.resolve(_n.html2canvas):Promise.resolve().then((function(){return Yi}))).catch((function(e){return Promise.reject(new Error("Could not load html2canvas: "+e))})).then((function(e){return e.default?e.default:e}))}function n(){return(_n.DOMPurify?Promise.resolve(_n.DOMPurify):Promise.resolve().then((function(){return ipe}))).catch((function(e){return Promise.reject(new Error("Could not load dompurify: "+e))})).then((function(e){return e.default?e.default:e}))}var r=function(e){var t=Ht(e);return"undefined"===t?"undefined":"string"===t||e instanceof String?"string":"number"===t||e instanceof Number?"number":"function"===t||e instanceof Function?"function":e&&e.constructor===Array?"array":e&&1===e.nodeType?"element":"object"===t?"object":"unknown"},i=function(e,t){var n=document.createElement(e);for(var r in t.className&&(n.className=t.className),t.innerHTML&&t.dompurify&&(n.innerHTML=t.dompurify.sanitize(t.innerHTML)),t.style)n.style[r]=t.style[r];return n},o=function e(t){var n=Object.assign(e.convert(Promise.resolve()),JSON.parse(JSON.stringify(e.template))),r=e.convert(Promise.resolve(),n);return(r=r.setProgress(1,e,1,[e])).set(t)};(o.prototype=Object.create(Promise.prototype)).constructor=o,o.convert=function(e,t){return e.__proto__=t||o.prototype,e},o.template={prop:{src:null,container:null,overlay:null,canvas:null,img:null,pdf:null,pageSize:null,callback:function(){}},progress:{val:0,state:null,n:0,stack:[]},opt:{filename:"file.pdf",margin:[0,0,0,0],enableLinks:!0,x:0,y:0,html2canvas:{},jsPDF:{},backgroundColor:"transparent"}},o.prototype.from=function(e,t){return this.then((function(){switch(t=t||function(e){switch(r(e)){case"string":return"string";case"element":return"canvas"===e.nodeName.toLowerCase()?"canvas":"element";default:return"unknown"}}(e)){case"string":return this.then(n).then((function(t){return this.set({src:i("div",{innerHTML:e,dompurify:t})})}));case"element":return this.set({src:e});case"canvas":return this.set({canvas:e});case"img":return this.set({img:e});default:return this.error("Unknown source type.")}}))},o.prototype.to=function(e){switch(e){case"container":return this.toContainer();case"canvas":return this.toCanvas();case"img":return this.toImg();case"pdf":return this.toPdf();default:return this.error("Invalid target.")}},o.prototype.toContainer=function(){return this.thenList([function(){return this.prop.src||this.error("Cannot duplicate - no source HTML.")},function(){return this.prop.pageSize||this.setPageSize()}]).then((function(){var e={position:"relative",display:"inline-block",width:("number"!=typeof this.opt.width||isNaN(this.opt.width)||"number"!=typeof this.opt.windowWidth||isNaN(this.opt.windowWidth)?Math.max(this.prop.src.clientWidth,this.prop.src.scrollWidth,this.prop.src.offsetWidth):this.opt.windowWidth)+"px",left:0,right:0,top:0,margin:"auto",backgroundColor:this.opt.backgroundColor},t=function e(t,n){for(var r=3===t.nodeType?document.createTextNode(t.nodeValue):t.cloneNode(!1),i=t.firstChild;i;i=i.nextSibling)!0!==n&&1===i.nodeType&&"SCRIPT"===i.nodeName||r.appendChild(e(i,n));return 1===t.nodeType&&("CANVAS"===t.nodeName?(r.width=t.width,r.height=t.height,r.getContext("2d").drawImage(t,0,0)):"TEXTAREA"!==t.nodeName&&"SELECT"!==t.nodeName||(r.value=t.value),r.addEventListener("load",(function(){r.scrollTop=t.scrollTop,r.scrollLeft=t.scrollLeft}),!0)),r}(this.prop.src,this.opt.html2canvas.javascriptEnabled);"BODY"===t.tagName&&(e.height=Math.max(document.body.scrollHeight,document.body.offsetHeight,document.documentElement.clientHeight,document.documentElement.scrollHeight,document.documentElement.offsetHeight)+"px"),this.prop.overlay=i("div",{className:"html2pdf__overlay",style:{position:"fixed",overflow:"hidden",zIndex:1e3,left:"-100000px",right:0,bottom:0,top:0}}),this.prop.container=i("div",{className:"html2pdf__container",style:e}),this.prop.container.appendChild(t),this.prop.container.firstChild.appendChild(i("div",{style:{clear:"both",border:"0 none transparent",margin:0,padding:0,height:0}})),this.prop.container.style.float="none",this.prop.overlay.appendChild(this.prop.container),document.body.appendChild(this.prop.overlay),this.prop.container.firstChild.style.position="relative",this.prop.container.height=Math.max(this.prop.container.firstChild.clientHeight,this.prop.container.firstChild.scrollHeight,this.prop.container.firstChild.offsetHeight)+"px"}))},o.prototype.toCanvas=function(){var e=[function(){return document.body.contains(this.prop.container)||this.toContainer()}];return this.thenList(e).then(t).then((function(e){var t=Object.assign({},this.opt.html2canvas);return delete t.onrendered,e(this.prop.container,t)})).then((function(e){(this.opt.html2canvas.onrendered||function(){})(e),this.prop.canvas=e,document.body.removeChild(this.prop.overlay)}))},o.prototype.toContext2d=function(){var e=[function(){return document.body.contains(this.prop.container)||this.toContainer()}];return this.thenList(e).then(t).then((function(e){var t=this.opt.jsPDF,n=this.opt.fontFaces,r="number"!=typeof this.opt.width||isNaN(this.opt.width)||"number"!=typeof this.opt.windowWidth||isNaN(this.opt.windowWidth)?1:this.opt.width/this.opt.windowWidth,i=Object.assign({async:!0,allowTaint:!0,scale:r,scrollX:this.opt.scrollX||0,scrollY:this.opt.scrollY||0,backgroundColor:"#ffffff",imageTimeout:15e3,logging:!0,proxy:null,removeContainer:!0,foreignObjectRendering:!1,useCORS:!1},this.opt.html2canvas);if(delete i.onrendered,t.context2d.autoPaging=void 0===this.opt.autoPaging||this.opt.autoPaging,t.context2d.posX=this.opt.x,t.context2d.posY=this.opt.y,t.context2d.margin=this.opt.margin,t.context2d.fontFaces=n,n)for(var o=0;o<n.length;++o){var a=n[o],s=a.src.find((function(e){return"truetype"===e.format}));s&&t.addFont(s.url,a.ref.name,a.ref.style)}return i.windowHeight=i.windowHeight||0,i.windowHeight=0==i.windowHeight?Math.max(this.prop.container.clientHeight,this.prop.container.scrollHeight,this.prop.container.offsetHeight):i.windowHeight,t.context2d.save(!0),e(this.prop.container,i)})).then((function(e){this.opt.jsPDF.context2d.restore(!0),(this.opt.html2canvas.onrendered||function(){})(e),this.prop.canvas=e,document.body.removeChild(this.prop.overlay)}))},o.prototype.toImg=function(){return this.thenList([function(){return this.prop.canvas||this.toCanvas()}]).then((function(){var e=this.prop.canvas.toDataURL("image/"+this.opt.image.type,this.opt.image.quality);this.prop.img=document.createElement("img"),this.prop.img.src=e}))},o.prototype.toPdf=function(){return this.thenList([function(){return this.toContext2d()}]).then((function(){this.prop.pdf=this.prop.pdf||this.opt.jsPDF}))},o.prototype.output=function(e,t,n){return"img"===(n=n||"pdf").toLowerCase()||"image"===n.toLowerCase()?this.outputImg(e,t):this.outputPdf(e,t)},o.prototype.outputPdf=function(e,t){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).then((function(){return this.prop.pdf.output(e,t)}))},o.prototype.outputImg=function(e){return this.thenList([function(){return this.prop.img||this.toImg()}]).then((function(){switch(e){case void 0:case"img":return this.prop.img;case"datauristring":case"dataurlstring":return this.prop.img.src;case"datauri":case"dataurl":return document.location.href=this.prop.img.src;default:throw'Image output type "'+e+'" is not supported.'}}))},o.prototype.save=function(e){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).set(e?{filename:e}:null).then((function(){this.prop.pdf.save(this.opt.filename)}))},o.prototype.doCallback=function(){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).then((function(){this.prop.callback(this.prop.pdf)}))},o.prototype.set=function(e){if("object"!==r(e))return this;var t=Object.keys(e||{}).map((function(t){if(t in o.template.prop)return function(){this.prop[t]=e[t]};switch(t){case"margin":return this.setMargin.bind(this,e.margin);case"jsPDF":return function(){return this.opt.jsPDF=e.jsPDF,this.setPageSize()};case"pageSize":return this.setPageSize.bind(this,e.pageSize);default:return function(){this.opt[t]=e[t]}}}),this);return this.then((function(){return this.thenList(t)}))},o.prototype.get=function(e,t){return this.then((function(){var n=e in o.template.prop?this.prop[e]:this.opt[e];return t?t(n):n}))},o.prototype.setMargin=function(e){return this.then((function(){switch(r(e)){case"number":e=[e,e,e,e];case"array":if(2===e.length&&(e=[e[0],e[1],e[0],e[1]]),4===e.length)break;default:return this.error("Invalid margin array.")}this.opt.margin=e})).then(this.setPageSize)},o.prototype.setPageSize=function(e){function t(e,t){return Math.floor(e*t/72*96)}return this.then((function(){(e=e||lr.getPageSize(this.opt.jsPDF)).hasOwnProperty("inner")||(e.inner={width:e.width-this.opt.margin[1]-this.opt.margin[3],height:e.height-this.opt.margin[0]-this.opt.margin[2]},e.inner.px={width:t(e.inner.width,e.k),height:t(e.inner.height,e.k)},e.inner.ratio=e.inner.height/e.inner.width),this.prop.pageSize=e}))},o.prototype.setProgress=function(e,t,n,r){return null!=e&&(this.progress.val=e),null!=t&&(this.progress.state=t),null!=n&&(this.progress.n=n),null!=r&&(this.progress.stack=r),this.progress.ratio=this.progress.val/this.progress.state,this},o.prototype.updateProgress=function(e,t,n,r){return this.setProgress(e?this.progress.val+e:null,t||null,n?this.progress.n+n:null,r?this.progress.stack.concat(r):null)},o.prototype.then=function(e,t){var n=this;return this.thenCore(e,t,(function(e,t){return n.updateProgress(null,null,1,[e]),Promise.prototype.then.call(this,(function(t){return n.updateProgress(null,e),t})).then(e,t).then((function(e){return n.updateProgress(1),e}))}))},o.prototype.thenCore=function(e,t,n){n=n||Promise.prototype.then,e&&(e=e.bind(this)),t&&(t=t.bind(this));var r=-1!==Promise.toString().indexOf("[native code]")&&"Promise"===Promise.name?this:o.convert(Object.assign({},this),Promise.prototype),i=n.call(r,e,t);return o.convert(i,this.__proto__)},o.prototype.thenExternal=function(e,t){return Promise.prototype.then.call(this,e,t)},o.prototype.thenList=function(e){var t=this;return e.forEach((function(e){t=t.thenCore(e)})),t},o.prototype.catch=function(e){e&&(e=e.bind(this));var t=Promise.prototype.catch.call(this,e);return o.convert(t,this)},o.prototype.catchExternal=function(e){return Promise.prototype.catch.call(this,e)},o.prototype.error=function(e){return this.then((function(){throw new Error(e)}))},o.prototype.using=o.prototype.set,o.prototype.saveAs=o.prototype.save,o.prototype.export=o.prototype.output,o.prototype.run=o.prototype.then,lr.getPageSize=function(e,t,n){if("object"===Ht(e)){var r=e;e=r.orientation,t=r.unit||t,n=r.format||n}t=t||"mm",n=n||"a4",e=(""+(e||"P")).toLowerCase();var i,o=(""+n).toLowerCase(),a={a0:[2383.94,3370.39],a1:[1683.78,2383.94],a2:[1190.55,1683.78],a3:[841.89,1190.55],a4:[595.28,841.89],a5:[419.53,595.28],a6:[297.64,419.53],a7:[209.76,297.64],a8:[147.4,209.76],a9:[104.88,147.4],a10:[73.7,104.88],b0:[2834.65,4008.19],b1:[2004.09,2834.65],b2:[1417.32,2004.09],b3:[1000.63,1417.32],b4:[708.66,1000.63],b5:[498.9,708.66],b6:[354.33,498.9],b7:[249.45,354.33],b8:[175.75,249.45],b9:[124.72,175.75],b10:[87.87,124.72],c0:[2599.37,3676.54],c1:[1836.85,2599.37],c2:[1298.27,1836.85],c3:[918.43,1298.27],c4:[649.13,918.43],c5:[459.21,649.13],c6:[323.15,459.21],c7:[229.61,323.15],c8:[161.57,229.61],c9:[113.39,161.57],c10:[79.37,113.39],dl:[311.81,623.62],letter:[612,792],"government-letter":[576,756],legal:[612,1008],"junior-legal":[576,360],ledger:[1224,792],tabloid:[792,1224],"credit-card":[153,243]};switch(t){case"pt":i=1;break;case"mm":i=72/25.4;break;case"cm":i=72/2.54;break;case"in":i=72;break;case"px":i=.75;break;case"pc":case"em":i=12;break;case"ex":i=6;break;default:throw"Invalid unit: "+t}var s,u=0,l=0;if(a.hasOwnProperty(o))u=a[o][1]/i,l=a[o][0]/i;else try{u=n[1],l=n[0]}catch(e){throw new Error("Invalid format: "+n)}if("p"===e||"portrait"===e)e="p",l>u&&(s=l,l=u,u=s);else{if("l"!==e&&"landscape"!==e)throw"Invalid orientation: "+e;e="l",u>l&&(s=l,l=u,u=s)}return{width:l,height:u,unit:t,k:i,orientation:e}},e.html=function(e,t){(t=t||{}).callback=t.callback||function(){},t.html2canvas=t.html2canvas||{},t.html2canvas.canvas=t.html2canvas.canvas||this.canvas,t.jsPDF=t.jsPDF||this,t.fontFaces=t.fontFaces?t.fontFaces.map(ri):null;var n=new o(t);return t.worker?n:n.from(e).doCallback()}}(lr.API),lr.API.addJS=function(e){return fi=e,this.internal.events.subscribe("postPutResources",(function(){ci=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/Names [(EmbeddedJS) "+(ci+1)+" 0 R]"),this.internal.out(">>"),this.internal.out("endobj"),hi=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/S /JavaScript"),this.internal.out("/JS ("+fi+")"),this.internal.out(">>"),this.internal.out("endobj")})),this.internal.events.subscribe("putCatalog",(function(){void 0!==ci&&void 0!==hi&&this.internal.out("/Names <</JavaScript "+ci+" 0 R>>")})),this},
180
180
  /**
181
181
  * @license
182
182
  * Copyright (c) 2014 Steven Spungin (TwelveTone LLC) steven@twelvetone.tv
@@ -338,7 +338,7 @@ function(e){var t=function(e){for(var t=e.length,n=new Uint8Array(t),r=0;r<t;r++
338
338
  * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
339
339
  * ====================================================================
340
340
  */
341
- function(e){function t(){return(_n.canvg?Promise.resolve(_n.canvg):Promise.resolve().then((function(){return RFe}))).catch((function(e){return Promise.reject(new Error("Could not load canvg: "+e))})).then((function(e){return e.default?e.default:e}))}lr.API.addSvgAsImage=function(e,n,r,i,o,a,s,u){if(isNaN(n)||isNaN(r))throw Dn.error("jsPDF.addSvgAsImage: Invalid coordinates",arguments),new Error("Invalid coordinates passed to jsPDF.addSvgAsImage");if(isNaN(i)||isNaN(o))throw Dn.error("jsPDF.addSvgAsImage: Invalid measurements",arguments),new Error("Invalid measurements (width and/or height) passed to jsPDF.addSvgAsImage");var l=document.createElement("canvas");l.width=i,l.height=o;var A=l.getContext("2d");A.fillStyle="#fff",A.fillRect(0,0,l.width,l.height);var c={ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0},h=this;return t().then((function(t){return t.fromString(A,e,c)}),(function(){return Promise.reject(new Error("Could not load canvg."))})).then((function(e){return e.render(c)})).then((function(){h.addImage(l.toDataURL("image/jpeg",1),n,r,i,o,s,u)}))}}(),lr.API.putTotalPages=function(e){var t,n=0;parseInt(this.internal.getFont().id.substr(1),10)<15?(t=new RegExp(e,"g"),n=this.internal.getNumberOfPages()):(t=new RegExp(this.pdfEscape16(e,this.internal.getFont()),"g"),n=this.pdfEscape16(this.internal.getNumberOfPages()+"",this.internal.getFont()));for(var r=1;r<=this.internal.getNumberOfPages();r++)for(var i=0;i<this.internal.pages[r].length;i++)this.internal.pages[r][i]=this.internal.pages[r][i].replace(t,n);return this},lr.API.viewerPreferences=function(e,t){var n;e=e||{},t=t||!1;var r,i,o,a={HideToolbar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideMenubar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideWindowUI:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},FitWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},CenterWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},DisplayDocTitle:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.4},NonFullScreenPageMode:{defaultValue:"UseNone",value:"UseNone",type:"name",explicitSet:!1,valueSet:["UseNone","UseOutlines","UseThumbs","UseOC"],pdfVersion:1.3},Direction:{defaultValue:"L2R",value:"L2R",type:"name",explicitSet:!1,valueSet:["L2R","R2L"],pdfVersion:1.3},ViewArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},ViewClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintScaling:{defaultValue:"AppDefault",value:"AppDefault",type:"name",explicitSet:!1,valueSet:["AppDefault","None"],pdfVersion:1.6},Duplex:{defaultValue:"",value:"none",type:"name",explicitSet:!1,valueSet:["Simplex","DuplexFlipShortEdge","DuplexFlipLongEdge","none"],pdfVersion:1.7},PickTrayByPDFSize:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.7},PrintPageRange:{defaultValue:"",value:"",type:"array",explicitSet:!1,valueSet:null,pdfVersion:1.7},NumCopies:{defaultValue:1,value:1,type:"integer",explicitSet:!1,valueSet:null,pdfVersion:1.7}},s=Object.keys(a),u=[],l=0,A=0,c=0;function h(e,t){var n,r=!1;for(n=0;n<e.length;n+=1)e[n]===t&&(r=!0);return r}if(void 0===this.internal.viewerpreferences&&(this.internal.viewerpreferences={},this.internal.viewerpreferences.configuration=JSON.parse(JSON.stringify(a)),this.internal.viewerpreferences.isSubscribed=!1),n=this.internal.viewerpreferences.configuration,"reset"===e||!0===t){var f=s.length;for(c=0;c<f;c+=1)n[s[c]].value=n[s[c]].defaultValue,n[s[c]].explicitSet=!1}if("object"===Ht(e))for(i in e)if(o=e[i],h(s,i)&&void 0!==o){if("boolean"===n[i].type&&"boolean"==typeof o)n[i].value=o;else if("name"===n[i].type&&h(n[i].valueSet,o))n[i].value=o;else if("integer"===n[i].type&&Number.isInteger(o))n[i].value=o;else if("array"===n[i].type){for(l=0;l<o.length;l+=1)if(r=!0,1===o[l].length&&"number"==typeof o[l][0])u.push(String(o[l]-1));else if(o[l].length>1){for(A=0;A<o[l].length;A+=1)"number"!=typeof o[l][A]&&(r=!1);!0===r&&u.push([o[l][0]-1,o[l][1]-1].join(" "))}n[i].value="["+u.join(" ")+"]"}else n[i].value=n[i].defaultValue;n[i].explicitSet=!0}return!1===this.internal.viewerpreferences.isSubscribed&&(this.internal.events.subscribe("putCatalog",(function(){var e,t=[];for(e in n)!0===n[e].explicitSet&&("name"===n[e].type?t.push("/"+e+" /"+n[e].value):t.push("/"+e+" "+n[e].value));0!==t.length&&this.internal.write("/ViewerPreferences\n<<\n"+t.join("\n")+"\n>>")})),this.internal.viewerpreferences.isSubscribed=!0),this.internal.viewerpreferences.configuration=n,this},
341
+ function(e){function t(){return(_n.canvg?Promise.resolve(_n.canvg):Promise.resolve().then((function(){return OFe}))).catch((function(e){return Promise.reject(new Error("Could not load canvg: "+e))})).then((function(e){return e.default?e.default:e}))}lr.API.addSvgAsImage=function(e,n,r,i,o,a,s,u){if(isNaN(n)||isNaN(r))throw Dn.error("jsPDF.addSvgAsImage: Invalid coordinates",arguments),new Error("Invalid coordinates passed to jsPDF.addSvgAsImage");if(isNaN(i)||isNaN(o))throw Dn.error("jsPDF.addSvgAsImage: Invalid measurements",arguments),new Error("Invalid measurements (width and/or height) passed to jsPDF.addSvgAsImage");var l=document.createElement("canvas");l.width=i,l.height=o;var A=l.getContext("2d");A.fillStyle="#fff",A.fillRect(0,0,l.width,l.height);var c={ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0},h=this;return t().then((function(t){return t.fromString(A,e,c)}),(function(){return Promise.reject(new Error("Could not load canvg."))})).then((function(e){return e.render(c)})).then((function(){h.addImage(l.toDataURL("image/jpeg",1),n,r,i,o,s,u)}))}}(),lr.API.putTotalPages=function(e){var t,n=0;parseInt(this.internal.getFont().id.substr(1),10)<15?(t=new RegExp(e,"g"),n=this.internal.getNumberOfPages()):(t=new RegExp(this.pdfEscape16(e,this.internal.getFont()),"g"),n=this.pdfEscape16(this.internal.getNumberOfPages()+"",this.internal.getFont()));for(var r=1;r<=this.internal.getNumberOfPages();r++)for(var i=0;i<this.internal.pages[r].length;i++)this.internal.pages[r][i]=this.internal.pages[r][i].replace(t,n);return this},lr.API.viewerPreferences=function(e,t){var n;e=e||{},t=t||!1;var r,i,o,a={HideToolbar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideMenubar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideWindowUI:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},FitWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},CenterWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},DisplayDocTitle:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.4},NonFullScreenPageMode:{defaultValue:"UseNone",value:"UseNone",type:"name",explicitSet:!1,valueSet:["UseNone","UseOutlines","UseThumbs","UseOC"],pdfVersion:1.3},Direction:{defaultValue:"L2R",value:"L2R",type:"name",explicitSet:!1,valueSet:["L2R","R2L"],pdfVersion:1.3},ViewArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},ViewClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintScaling:{defaultValue:"AppDefault",value:"AppDefault",type:"name",explicitSet:!1,valueSet:["AppDefault","None"],pdfVersion:1.6},Duplex:{defaultValue:"",value:"none",type:"name",explicitSet:!1,valueSet:["Simplex","DuplexFlipShortEdge","DuplexFlipLongEdge","none"],pdfVersion:1.7},PickTrayByPDFSize:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.7},PrintPageRange:{defaultValue:"",value:"",type:"array",explicitSet:!1,valueSet:null,pdfVersion:1.7},NumCopies:{defaultValue:1,value:1,type:"integer",explicitSet:!1,valueSet:null,pdfVersion:1.7}},s=Object.keys(a),u=[],l=0,A=0,c=0;function h(e,t){var n,r=!1;for(n=0;n<e.length;n+=1)e[n]===t&&(r=!0);return r}if(void 0===this.internal.viewerpreferences&&(this.internal.viewerpreferences={},this.internal.viewerpreferences.configuration=JSON.parse(JSON.stringify(a)),this.internal.viewerpreferences.isSubscribed=!1),n=this.internal.viewerpreferences.configuration,"reset"===e||!0===t){var f=s.length;for(c=0;c<f;c+=1)n[s[c]].value=n[s[c]].defaultValue,n[s[c]].explicitSet=!1}if("object"===Ht(e))for(i in e)if(o=e[i],h(s,i)&&void 0!==o){if("boolean"===n[i].type&&"boolean"==typeof o)n[i].value=o;else if("name"===n[i].type&&h(n[i].valueSet,o))n[i].value=o;else if("integer"===n[i].type&&Number.isInteger(o))n[i].value=o;else if("array"===n[i].type){for(l=0;l<o.length;l+=1)if(r=!0,1===o[l].length&&"number"==typeof o[l][0])u.push(String(o[l]-1));else if(o[l].length>1){for(A=0;A<o[l].length;A+=1)"number"!=typeof o[l][A]&&(r=!1);!0===r&&u.push([o[l][0]-1,o[l][1]-1].join(" "))}n[i].value="["+u.join(" ")+"]"}else n[i].value=n[i].defaultValue;n[i].explicitSet=!0}return!1===this.internal.viewerpreferences.isSubscribed&&(this.internal.events.subscribe("putCatalog",(function(){var e,t=[];for(e in n)!0===n[e].explicitSet&&("name"===n[e].type?t.push("/"+e+" /"+n[e].value):t.push("/"+e+" "+n[e].value));0!==t.length&&this.internal.write("/ViewerPreferences\n<<\n"+t.join("\n")+"\n>>")})),this.internal.viewerpreferences.isSubscribed=!0),this.internal.viewerpreferences.configuration=n,this},
342
342
  /** ====================================================================
343
343
  * @license
344
344
  * jsPDF XMP metadata plugin
@@ -526,7 +526,7 @@ var ZD=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?a
526
526
  /*!
527
527
  * Copyright (c) 2010-2018 Digital Bazaar, Inc. All rights reserved.
528
528
  */
529
- var sF={},uF=sF,lF=bD;Object.assign(sF,lF);var AF=function(){function e(){s(this,e)}var t,i;return l(e,[{key:"add",value:(i=a(r().mark((function e(t){var i,o,a,s,u,l,A,c=arguments;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=c.length>1&&void 0!==c[1]?c[1]:{},o=i.suite,a=i.purpose,s=i.documentLoader,u=i.expansionMap,o){e.next=3;break}throw new TypeError('"options.suite" is required.');case 3:if(a){e.next=5;break}throw new TypeError('"options.purpose" is required.');case 5:return s=s?FD(s):PD,void 0===u?u=LD:!1===u&&(u=void 0),delete(l=n({},t)).proof,e.next=10,o.createProof({document:l,purpose:a,documentLoader:s,expansionMap:u});case 10:return A=e.sent,e.abrupt("return",(DD.addValue(t,"proof",A),t));case 12:case"end":return e.stop()}}),e)}))),function(e){return i.apply(this,arguments)})},{key:"verify",value:(t=a(r().mark((function e(t){var i,o,s,u,l,A,c,h,f,d,p,g,v,y,m,w=arguments;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=w.length>1&&void 0!==w[1]?w[1]:{},o=i.suite,s=i.purpose,u=i.documentLoader,l=i.expansionMap,o){e.next=3;break}throw new TypeError('"options.suite" is required.');case 3:if(s){e.next=5;break}throw new TypeError('"options.purpose" is required.');case 5:if(0!==(A=Array.isArray(o)?o:[o]).length){e.next=8;break}throw new TypeError("At least one suite is required.");case 8:return u=u?FD(u):PD,void 0===l?l=LD:!1===l&&(l=void 0),e.prev=9,t=n({},t),e.next=13,function(){var e=a(r().mark((function e(t){var i,o,a;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=t.document,o=DD.getValues(i,"proof"),delete i.proof,0!==o.length){e.next=3;break}throw new Error("No matching proofs found in the given document.");case 3:return a=i["@context"]||ND.SECURITY_CONTEXT_URL,e.abrupt("return",(o=o.map((function(e){return n({"@context":a},e)})),{proofSet:o,document:i}));case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()({document:t,documentLoader:u,expansionMap:l});case 13:return c=e.sent,h=c.proofSet,f=c.document,t=f,e.next=19,function(){var e=a(r().mark((function e(t){var n,i,o,s,u,l,A,c,h,f,d;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.document,i=t.suites,o=t.proofSet,s=t.purpose,u=t.documentLoader,l=t.expansionMap,A=Array.isArray(s)?s:[s],c=new Map,h=new Map,f=new Map,e.next=4,Promise.all(A.map((function(e){return(t=a(r().mark((function e(t){var n,i,o,a,s,u,l,A,c,h,f,d,p,g,v,y,m,w,b;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=t.purposeToProofs,i=t.proofToSuite,o=t.purpose,a=t.proofSet,s=t.suites,u=t.suiteMatchQueue,l=t.document,A=t.documentLoader,c=t.expansionMap,h=F(a),e.prev=2,h.s();case 4:if((f=h.n()).done){e.next=38;break}return d=f.value,e.next=8,o.match(d,{document:l,documentLoader:A,expansionMap:c});case 8:if(e.sent){e.next=10;break}return e.abrupt("continue",36);case 10:p=!1,g=F(s),e.prev=12,g.s();case 14:if((v=g.n()).done){e.next=27;break}return y=v.value,(m=u.get(y))||u.set(y,m=new Map),(w=m.get(d))||(w=y.matchProof({proof:d,document:l,documentLoader:A,expansionMap:c}),m.set(d,w)),e.next=22,w;case 22:if(!e.sent){e.next=25;break}return p=!0,i.set(d,y),e.abrupt("break",27);case 25:e.next=14;break;case 27:e.next=32;break;case 29:e.prev=29,e.t0=e.catch(12),g.e(e.t0);case 32:return e.prev=32,g.f(),e.finish(32);case 35:p&&((b=n.get(o))?b.push(d):n.set(o,[d]));case 36:e.next=4;break;case 38:e.next=43;break;case 40:e.prev=40,e.t1=e.catch(2),h.e(e.t1);case 43:return e.prev=43,h.f(),e.finish(43);case 46:case"end":return e.stop()}}),e,null,[[2,40,43,46],[12,29,32,35]])}))),function(e){return t.apply(this,arguments)})({purposeToProofs:c,proofToSuite:h,purpose:e,proofSet:o,suites:i,suiteMatchQueue:f,document:n,documentLoader:u,expansionMap:l});var t})));case 4:if(!(c.size<A.length)){e.next=6;break}return e.abrupt("return",[]);case 6:return d=new Map,e.next=9,Promise.all(k(h.entries()).map(function(){var e=a(r().mark((function e(t){var i,o,s,A,c,h,f,p,g,v;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=C(t,2),o=i[0],s=i[1],e.prev=1,h={validate:function(){var e=a(r().mark((function e(t,n){var i;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=n.verificationMethod,e.abrupt("return",(c=i,{valid:!0}));case 2:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()},e.next=5,s.verifyProof({proof:o,document:n,purpose:h,documentLoader:u,expansionMap:l});case 5:f=e.sent,p=f.verified,g=f.verificationMethod,v=f.error,c||(c=g),A={proof:o,verified:p,verificationMethod:c,error:v},e.next=15;break;case 12:e.prev=12,e.t0=e.catch(1),A={proof:o,verified:!1,error:e.t0};case 15:A.error&&MD(A.error),d.set(o,A);case 16:case"end":return e.stop()}}),e,null,[[1,12]])})));return function(t){return e.apply(this,arguments)}}()));case 9:return e.next=11,Promise.all(k(c.entries()).map(function(){var e=a(r().mark((function e(t){var i,o,a,s,A,c,f,p,g,v;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=C(t,2),o=i[0],a=i[1],s=F(a),e.prev=2,s.s();case 4:if((A=s.n()).done){e.next=23;break}if(c=A.value,(f=d.get(c)).verified){e.next=9;break}return e.abrupt("continue",21);case 9:return p=f.verificationMethod,g=h.get(c),v=void 0,e.prev=11,e.next=14,o.validate(c,{document:n,suite:g,verificationMethod:p,documentLoader:u,expansionMap:l});case 14:v=e.sent,e.next=20;break;case 17:e.prev=17,e.t0=e.catch(11),v={valid:!1,error:e.t0};case 20:f.purposeResult?Array.isArray(f.purposeResult)?f.purposeResult.push(v):f.purposeResult=[f.purposeResult,v]:f.purposeResult=v,v.valid||(MD(v.error),f.error||(f.verified=!1,f.error=v.error));case 21:e.next=4;break;case 23:e.next=28;break;case 25:e.prev=25,e.t1=e.catch(2),s.e(e.t1);case 28:return e.prev=28,s.f(),e.finish(28);case 31:case"end":return e.stop()}}),e,null,[[2,25,28,31],[11,17]])})));return function(t){return e.apply(this,arguments)}}()));case 11:return e.abrupt("return",k(d.values()));case 12:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()({document:t,suites:A,proofSet:h,purpose:s,documentLoader:u,expansionMap:l});case 19:if(0!==(d=e.sent).length){e.next=23;break}throw(p=new Error("Did not verify any proofs; insufficient proofs matched the acceptable suite(s) and required purpose(s).")).name="NotFoundError",p;case 23:if(g=d.some((function(e){return e.verified})),g){e.next=27;break}return y=(v=[]).concat.apply(v,k(d.filter((function(e){return e.error})).map((function(e){return e.error})))),m={verified:g,results:d},e.abrupt("return",(y.length>0&&(m.error=y),m));case 27:return e.abrupt("return",{verified:g,results:d});case 30:return e.prev=30,e.t0=e.catch(9),e.abrupt("return",(MD(e.t0),{verified:!1,error:e.t0}));case 33:case"end":return e.stop()}}),e,null,[[9,30]])}))),function(e){return t.apply(this,arguments)})}]),e}(),cF=RD;function hF(e){var t=Object.keys(Ul).map((function(e){return Ul[e]})).find((function(t){return t.signatureValue===e}));return t}function fF(e,t){var n=e.findIndex((function(e){return e===t}));n>-1&&e.splice(n,1)}sF.sign=function(){var e=a(r().mark((function e(t){var n,o,a,s,u,l,A,c,h,f=arguments;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=f.length>1&&void 0!==f[1]?f[1]:{},o=n.suite,a=n.purpose,s=n.documentLoader,u=n.expansionMap,l=n.addSuiteContext,A=void 0===l||l,"object"==i(t)){e.next=3;break}throw new TypeError('The "document" parameter must be an object.');case 3:return o.ensureSuiteContext({document:t,addSuiteContext:A}),e.prev=4,e.next=7,(new AF).add(t,{suite:o,purpose:a,documentLoader:s,expansionMap:u});case 7:return e.abrupt("return",e.sent);case 10:if(e.prev=10,e.t0=e.catch(4),s||"jsonld.InvalidUrl"!==e.t0.name){e.next=15;break}throw c=e.t0.details.url,(h=new Error('A URL "'.concat(c,'" could not be fetched; you need to pass "documentLoader" or resolve the URL before calling "sign".'))).cause=e.t0,h;case 15:throw e.t0;case 16:case"end":return e.stop()}}),e,null,[[4,10]])})));return function(t){return e.apply(this,arguments)}}(),sF.verify=function(){var e=a(r().mark((function e(t){var n,o,a,s,u,l,A,c,h,f=arguments;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=f.length>1&&void 0!==f[1]?f[1]:{},o=n.suite,a=n.purpose,s=n.documentLoader,u=n.expansionMap,"object"==i(t)){e.next=3;break}throw new TypeError('The "document" parameter must be an object.');case 3:return e.next=5,(new AF).verify(t,{suite:o,purpose:a,documentLoader:s,expansionMap:u});case 5:return l=e.sent,(A=l.error)&&(s||"jsonld.InvalidUrl"!==A.name?l.error=new cF(A):(c=A.details.url,h=new Error('A URL "'.concat(c,'" could not be fetched; you need to pass "documentLoader" or resolve the URL before calling "verify".')),l.error=new cF(h))),e.abrupt("return",l);case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),sF.suites=WD.suites,sF.purposes=aF.purposes,Object.assign(sF,xD);var dF={"@context":{id:"@id",type:"@type",bc:"https://w3id.org/blockcerts#",obi:"https://w3id.org/openbadges#",cp:"https://w3id.org/chainpoint#",schema:"http://schema.org/",sec:"https://w3id.org/security#",xsd:"http://www.w3.org/2001/XMLSchema#",MerkleProof2017:"sec:MerkleProof2017",RecipientProfile:"bc:RecipientProfile",SignatureLine:"bc:SignatureLine",MerkleProofVerification2017:"bc:MerkleProofVerification2017",recipientProfile:"bc:recipientProfile",signatureLines:"bc:signatureLines",introductionUrl:{"@id":"bc:introductionUrl","@type":"@id"},subtitle:"bc:subtitle",jobTitle:"schema:jobTitle",creator:{"@id":"dc:creator","@type":"@id"},expires:{"@id":"sec:expiration","@type":"xsd:dateTime"},revoked:{"@id":"sec:expiration","@type":"xsd:dateTime"},CryptographicKey:"sec:Key",signature:"sec:signature",verification:"bc:verification",publicKeys:"bc:publicKeys",ChainpointSHA256v2:"cp:ChainpointSHA256v2",BTCOpReturn:"cp:BTCOpReturn",targetHash:"cp:targetHash",merkleRoot:"cp:merkleRoot",proof:"cp:proof",anchors:"cp:anchors",sourceId:"cp:sourceId",right:"cp:right",left:"cp:left"},"obi:validation":[{"obi:validatesType":"RecipientProfile","obi:validationSchema":"https://w3id.org/blockcerts/schema/2.0-alpha/recipientSchema.json"},{"obi:validatesType":"SignatureLine","obi:validationSchema":"https://w3id.org/blockcerts/schema/2.0-alpha/signatureLineSchema.json"},{"obi:validatesType":"MerkleProof2017","obi:validationSchema":"https://w3id.org/blockcerts/schema/2.0-alpha/merkleProof2017Schema.json"}]},pF={"@context":{id:"@id",type:"@type",bc:"https://w3id.org/blockcerts#",cp:"https://w3id.org/chainpoint#",schema:"http://schema.org/",sec:"https://w3id.org/security#",xsd:"http://www.w3.org/2001/XMLSchema#",MerkleProof2019:"sec:MerkleProof2019",BlockcertsCredential:"bc:BlockcertsCredential",introductionUrl:{"@id":"bc:introductionUrl","@type":"@id"},CryptographicKey:"sec:Key",domain:"sec:domain",nonce:"sec:nonce",proofValue:"sec:proofValue",assertionMethod:{"@id":"sec:assertionMethod","@type":"@id","@container":"@set"},proofPurpose:{"@id":"sec:proofPurpose","@type":"@vocab"},verificationMethod:{"@id":"sec:verificationMethod","@type":"@id"},created:{"@id":"bc:created","@type":"xsd:dateTime"},name:{"@id":"schema:name"}}},gF={"@context":{id:"@id",type:"@type",bc:"https://w3id.org/blockcerts#",cp:"https://w3id.org/chainpoint#",vc:"https://www.w3.org/2018/credentials/v1",schema:"https://schema.org/",sec:"https://w3id.org/security#",xsd:"http://www.w3.org/2001/XMLSchema#",MerkleProof2019:"sec:MerkleProof2019",BlockcertsCredential:"bc:BlockcertsCredential",introductionUrl:{"@id":"bc:introductionUrl","@type":"@id"},metadata:"bc:metadata",display:{"@id":"bc:display","@context":{id:"@id",type:"@type",contentMediaType:{"@id":"bc:contentMediaType","@type":"@id"},contentEncoding:{"@id":"bc:contentEncoding","@type":"@id"},content:{"@id":"bc:content","@type":"@id"}}},CryptographicKey:"sec:Key",domain:"sec:domain",nonce:"sec:nonce",proofValue:"sec:proofValue",assertionMethod:{"@id":"sec:assertionMethod","@type":"@id","@container":"@set"},authentication:{"@id":"sec:authenticationMethod","@type":"@id","@container":"@set"},proofPurpose:{"@id":"sec:proofPurpose","@type":"@vocab"},verificationMethod:{"@id":"sec:verificationMethod","@type":"@id"},created:{"@id":"https://purl.org/dc/terms/created","@type":"xsd:dateTime"},challenge:"sec:challenge",expires:{"@id":"sec:expiration","@type":"xsd:dateTime"},name:{"@id":"schema:name"},description:{"@id":"schema:description"},email:{"@id":"schema:email"},publicKey:{"@id":"sec:publicKey","@type":"@id"},url:{"@id":"schema:url","@type":"@id"},image:{"@id":"schema:image","@type":"@id"}}};function vF(e){e=e.trim();for(var t=[],n=0;n<e.length;n+=2)t.push(parseInt(e.substring(n,n+2),16));return t}Rf["https://w3id.org/blockcerts/schema/2.0-alpha/context.json"]=dF,Rf["https://www.blockcerts.org/schema/2.0-alpha/context.json"]=dF,Rf["https://www.blockcerts.org/schema/3.0-alpha/context.json"]=pF,Rf["https://w3id.org/blockcerts/schema/3.0-alpha/context.json"]=pF,Rf["https://w3id.org/blockcerts/v3.0-alpha"]=pF,Rf["https://www.blockcerts.org/schema/3.0-beta/context.json"]=gF,Rf["https://w3id.org/blockcerts/schema/3.0-beta/context.json"]=gF,Rf["https://w3id.org/blockcerts/v3.0-beta"]=gF,Rf["https://w3id.org/security/suites/ed25519-2020/v1"]={"@context":{id:"@id",type:"@type","@protected":!0,proof:{"@id":"https://w3id.org/security#proof","@type":"@id","@container":"@graph"},Ed25519VerificationKey2020:{"@id":"https://w3id.org/security#Ed25519VerificationKey2020","@context":{"@protected":!0,id:"@id",type:"@type",controller:{"@id":"https://w3id.org/security#controller","@type":"@id"},revoked:{"@id":"https://w3id.org/security#revoked","@type":"http://www.w3.org/2001/XMLSchema#dateTime"},publicKeyMultibase:{"@id":"https://w3id.org/security#publicKeyMultibase","@type":"https://w3id.org/security#multibase"}}},Ed25519Signature2020:{"@id":"https://w3id.org/security#Ed25519Signature2020","@context":{"@protected":!0,id:"@id",type:"@type",challenge:"https://w3id.org/security#challenge",created:{"@id":"http://purl.org/dc/terms/created","@type":"http://www.w3.org/2001/XMLSchema#dateTime"},domain:"https://w3id.org/security#domain",expires:{"@id":"https://w3id.org/security#expiration","@type":"http://www.w3.org/2001/XMLSchema#dateTime"},nonce:"https://w3id.org/security#nonce",proofPurpose:{"@id":"https://w3id.org/security#proofPurpose","@type":"@vocab","@context":{"@protected":!0,id:"@id",type:"@type",assertionMethod:{"@id":"https://w3id.org/security#assertionMethod","@type":"@id","@container":"@set"},authentication:{"@id":"https://w3id.org/security#authenticationMethod","@type":"@id","@container":"@set"},capabilityInvocation:{"@id":"https://w3id.org/security#capabilityInvocationMethod","@type":"@id","@container":"@set"},capabilityDelegation:{"@id":"https://w3id.org/security#capabilityDelegationMethod","@type":"@id","@container":"@set"},keyAgreement:{"@id":"https://w3id.org/security#keyAgreementMethod","@type":"@id","@container":"@set"}}},proofValue:{"@id":"https://w3id.org/security#proofValue","@type":"https://w3id.org/security#multibase"},verificationMethod:{"@id":"https://w3id.org/security#verificationMethod","@type":"@id"}}}}};var yF=function(e){c(n,e);var t=b(n);function n(e,r){var i;return s(this,n),(i=t.call(this,r)).stepCode=e,i}return l(n)}(g(Error)),mF="en-US",wF={"en-US":{errors:{ensureHashesEqual:"Computed hash does not match remote hash",ensureMerkleRootEqual:"Merkle root does not match remote hash.",ensureValidReceipt:"The receipt is malformed. There was a problem navigating the merkle tree in the receipt.",failedJsonLdNormalization:"Failed JSON-LD normalization",foundUnmappedFields:"Found unmapped fields during JSON-LD normalization",identityErrorBaseMessage:"Issuer identity mismatch",deriveIssuingAddressFromPublicKey:"Unsupported blockchain for DID verification",compareIssuingAddress:"The provided verification method does not match the issuer identity",getTransactionId:"Cannot verify this certificate without a transaction ID to compare against.",invalidMerkleReceipt:"Invalid Merkle Receipt. Proof hash did not match Merkle root",isTransactionIdValid:"Cannot verify this certificate without a transaction ID to compare against.",noProofSpecified:"Document proof is an array but no target proof was specified to know what to verify."}},fr:{errors:{ensureHashesEqual:"Calcul du hash local différent du hash distant",ensureMerkleRootEqual:"Le Merkle root ne correspond pas au hash distant",ensureValidReceipt:"Erreur d'écriture du reçu. Un problème est survenu lors de la navigation de l'arbre Merkle du reçu.",failedJsonLdNormalization:"Erreur de normalisation JSON-LD",foundUnmappedFields:"Champs non liés découverts durant la normalisation JSON-LD",identityErrorBaseMessage:"Identité de l'émetteur invalide",deriveIssuingAddressFromPublicKey:"Cette blockchain n'est pas supportée pour la vérification de l'identité décentralisée.",compareIssuingAddress:"La méthode de vérification n'a pas permis d'établir l'identité de l'émetteur.",getTransactionId:"Impossible de vérifier ce certificat sans un identifiant de transaction valide",invalidMerkleReceipt:"Reçu Merkle invalide. Hash de preuve différent du Merkle root",isTransactionIdValid:"Impossible de vérifier ce certificat sans un identifiant de transaction valide",noProofSpecified:"La propriété 'proof' du document est un tableau mais aucune preuve n'a été passée pour savoir ce qu'il faut vérifier"}},es:{errors:{ensureHashesEqual:"La cadena binaria calculada no corresponde con la cadena binaria remota",ensureMerkleRootEqual:"La raíz Merkle no corresponde con la cadena binaria remota",ensureValidReceipt:"El recibo está malformado. Hubo un problema navegando el árbol Merkle en el recibo",failedJsonLdNormalization:"La normalización del JSON-LD ha fallado",foundUnmappedFields:"Se han encontrado campos no mapeados durante la normalización de JSON-LD",identityErrorBaseMessage:"Identitad del emisor inválida",deriveIssuingAddressFromPublicKey:"No se puede validar la identitad decentalisada con esta cadena binaria.",compareIssuingAddress:"El metodo de verificación no corresponde a la identitad del emisor.",getTransactionId:"No se puede verificar este certificado sin una identificación de transacción que sirva como comparación",invalidMerkleReceipt:"Recibo Merkle inválido. La cadena binaria de prueba no corresponde con la raíz Merkle",isTransactionIdValid:"No se puede verificar este certificado sin una identificación de transacción que sirva como comparación",noProofSpecified:"La propiedad 'proof' del documento es una lista, pero no prueba especifica ha sido declarada para conocer el punto de verificación"}},mt:{errors:{ensureHashesEqual:"Il-hash ikkalkulat ma jikkorrispondix mar-remote hash",ensureMerkleRootEqual:"Merkle root ma taqbilx mar-remote hash",ensureValidReceipt:"L-irċevuta hija malformata. Kien hemm problema fin-navigazzjoni tal-merkle tree fl-irċevuta",failedJsonLdNormalization:"In-normalizzazzjoni ta' JSON-LD ma rnexxietx",foundUnmappedFields:"Instabu unmapped fields matul in-normalizzazzjoni JSON-LD",identityErrorBaseMessage:"Issuer identity mismatch",deriveIssuingAddressFromPublicKey:"Unsupported blockchain for DID verification",compareIssuingAddress:"The provided verification method does not match the issuer identity",getTransactionId:"Dan iċ-ċertifikat ma jistax jiġi vverifikat mingħajr ID ta' tranżazzjoni mqabbla miegħu",invalidMerkleReceipt:"Irċevuta Merkle invalida. Il-proof hash ma kienx jaqbel mal-Merkle root",isTransactionIdValid:"Dan iċ-ċertifikat ma jistax jiġi vverifikat mingħajr ID ta' tranżazzjoni mqabbla miegħu",noProofSpecified:"Document proof is an array but no target proof was specified to know what to verify."}},"it-IT":{errors:{ensureHashesEqual:"L'hash calcolato non corrisponde all'hash remoto",ensureMerkleRootEqual:"La radice di Merkle non corrisponde all'hash remoto.",ensureValidReceipt:"La ricevuta è malformata. C'è stato un problema nella navigazione dell'albero di Merkle nella ricevuta.",failedJsonLdNormalization:"Normalizzazione JSON-LD fallita",foundUnmappedFields:"Campi non mappati trovati durante la normalizzazione JSON-LD",identityErrorBaseMessage:"Issuer identity mismatch",deriveIssuingAddressFromPublicKey:"Unsupported blockchain for DID verification",compareIssuingAddress:"The provided verification method does not match the issuer identity",getTransactionId:"Impossibile verificare questo certificato senza un ID transazione da confrontare.",invalidMerkleReceipt:"Ricevuta Merkle non valida. L'hash di prova non corrisponde alla radice di Merkle",isTransactionIdValid:"Impossibile verificare questo certificato senza un ID transazione da confrontare.",noProofSpecified:"Document proof is an array but no target proof was specified to know what to verify."}},ja:{errors:{ensureHashesEqual:"算出されたハッシュがリモートハッシュと一致しませんでした",ensureMerkleRootEqual:"Merkle rootがリモートハッシュと一致しませんでした",ensureValidReceipt:"レシートが異常です。レシート内のMerkle treeを辿る際に問題が発生しました。",failedJsonLdNormalization:"JSON-LDの正規化に失敗しました",foundUnmappedFields:"JSON-LDの正規化時にマップされていないフィールドを検出しました",identityErrorBaseMessage:"Issuer identity mismatch",deriveIssuingAddressFromPublicKey:"Unsupported blockchain for DID verification",compareIssuingAddress:"The provided verification method does not match the issuer identity",getTransactionId:"照合のための取引IDがないため、この証明書を認証できません。",invalidMerkleReceipt:"Merkleレシートが無効です。証明ハッシュがMerkle rootと一致しませんでした。",isTransactionIdValid:"照合するための取引IDがないため、この証明書を認証できません。",noProofSpecified:"Document proof is an array but no target proof was specified to know what to verify."}}};function bF(e,t){return e&&t?wF[mF]?wF[mF][e]?wF[mF][e][t]?wF[mF][e][t]||"":"[missing locale item data]":"[missing locale group data]":"[missing locale data]":""}var IF=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){e.done?i(e.value):function(e){return e instanceof n?e:new n((function(t){t(e)}))}(e.value).then(a,s)}u((r=r.apply(e,t||[])).next())}))};function BF(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(e){};return IF(this,void 0,void 0,r().mark((function i(){var o,a,s,u,l;return r().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if(e["@context"].find((function(e){return(t=e)===Object(t)&&"@vocab"in e;var t}))||e["@context"].push({"@vocab":"http://fallback.org/"}),o=JSON.parse(JSON.stringify(e)),!Array.isArray(o.proof)){i.next=9;break}if(t){i.next=5;break}throw new yF("computeLocalHash",bF("errors","noProofSpecified"));case 5:a=o.proof.findIndex((function(e){return e.proofValue===t.proofValue})),o.proof=o.proof.slice(0,a),i.next=10;break;case 9:delete o.proof;case 10:return s={algorithm:"URDNA2015",format:"application/nquads",documentLoader:function(e){return IF(this,void 0,void 0,r().mark((function t(){return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.t0=null!=n,!t.t0){t.next=4;break}return t.next=4,n(e);case 4:return t.abrupt("return",e in Rf?{contextUrl:null,document:Rf[e],documentUrl:e}:nw.documentLoader(e));case 5:case"end":return t.stop()}}),t)})))}},i.prev=11,i.next=14,nw.normalize(o,s);case 14:u=i.sent,i.next=20;break;case 17:throw i.prev=17,i.t0=i.catch(11),console.error(i.t0),new yF("computeLocalHash",bF("errors","failedJsonLdNormalization"));case 20:if(l=function(e){var t=e.split("\n"),n=/<http:\/\/fallback\.org\/(.*)>/,r=t.map((function(e){return n.exec(e)})).filter((function(e){return null!=e}));if(r.length>0){var i=r.map((function(e){return e[1]})).sort();return Array.from(new Set(i))}return null}(u),!l){i.next=23;break}throw new yF("computeLocalHash","".concat(bF("errors","foundUnmappedFields"),": ").concat(l.join(", ")));case 23:return i.abrupt("return",vk(function(e){for(var t=[],n=0;n<e.length;n++){var r=e.charCodeAt(n);r<128?t.push(r):r<2048?t.push(192|r>>6,128|63&r):r<55296||r>=57344?t.push(224|r>>12,128|r>>6&63,128|63&r):(n++,r=65536+((1023&r)<<10|1023&e.charCodeAt(n)),t.push(240|r>>18,128|r>>12&63,128|r>>6&63,128|63&r))}return t}(u)));case 24:case"end":return i.stop()}}),i,null,[[11,17]])})))}var EF,CF=function(e){c(n,e);var t=b(n);function n(e){return s(this,n),t.call(this,e||"This operation is not supported for this key type")}return l(n)}(g(Error)),xF=CF,kF=function(e){c(n,e);var t=b(n);function n(){return s(this,n),t.call(this,"This has not been implemented yet")}return l(n)}(g(Error)),SF=function(){function e(){s(this,e),this.registry=[],this.classes={}}return l(e,[{key:"find",value:function(e){return this.registry.find(e)}},{key:"define",value:function(e,t){var n=this;e.forEach((function(e){var r=e.kty;if(!r)throw new Error("Invalid type definition");n.classes[r]||(n.classes[r]=t),n.registry.push(e)}))}},{key:"normalize",value:function(e,t,n){var r=this.classes[e],i=this.find((function(e){return e[t]===n}));if(!r||!i)throw new Error("Invalid type");return new r(i)}}]),e}(),QF=kF,_F=function(){function e(t){s(this,e),this.params=t}return l(e,[{key:"fromPrivatePKCS1",value:function(e){throw new QF}},{key:"fromPrivatePKCS8",value:function(e){throw new QF}},{key:"fromPublicPKCS1",value:function(e){throw new QF}},{key:"fromPublicPKCS8",value:function(e){throw new QF}},{key:"fromPrivateBlk",value:function(e){throw new QF}},{key:"fromPublicBlk",value:function(e){throw new QF}},{key:"fromJwk",value:function(e){throw new QF}},{key:"toPrivatePKCS1",value:function(e){throw new QF}},{key:"toPrivatePKCS8",value:function(e){throw new QF}},{key:"toPublicPKCS1",value:function(e){throw new QF}},{key:"toPublicPKCS8",value:function(e){throw new QF}},{key:"toPrivateBlk",value:function(e){throw new QF}},{key:"toPublicBlk",value:function(e){throw new QF}},{key:"toPrivateJwk",value:function(e){throw new QF}},{key:"toPublicJwk",value:function(e){throw new QF}}],[{key:"formatPem",value:function(e,t){return"-----BEGIN ".concat(t," KEY-----\n")+e.match(/.{1,64}/g).join("\n")+"\n-----END ".concat(t," KEY-----")}}]),e}(),NF={},DF={},FF={},PF=Fa,UF=PF.Buffer,LF={};for(EF in PF)PF.hasOwnProperty(EF)&&"SlowBuffer"!==EF&&"Buffer"!==EF&&(LF[EF]=PF[EF]);var MF=LF.Buffer={};for(EF in UF)UF.hasOwnProperty(EF)&&"allocUnsafe"!==EF&&"allocUnsafeSlow"!==EF&&(MF[EF]=UF[EF]);if(LF.Buffer.prototype=UF.prototype,MF.from&&MF.from!==Uint8Array.from||(MF.from=function(e,t,n){if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type '+i(e));if(e&&void 0===e.length)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+i(e));return UF(e,t,n)}),MF.alloc||(MF.alloc=function(e,t,n){if("number"!=typeof e)throw new TypeError('The "size" argument must be of type number. Received type '+i(e));if(e<0||e>=2*(1<<30))throw new RangeError('The value "'+e+'" is invalid for option "size"');var r=UF(e);return t&&0!==t.length?"string"==typeof n?r.fill(t,n):r.fill(t):r.fill(0),r}),!LF.kStringMaxLength)try{LF.kStringMaxLength=lA.binding("buffer").kStringMaxLength}catch(e){}LF.constants||(LF.constants={MAX_LENGTH:LF.kMaxLength},LF.kStringMaxLength&&(LF.constants.MAX_STRING_LENGTH=LF.kStringMaxLength));var TF=LF,RF={},OF=KI.exports;function HF(e){this._reporterState={obj:null,path:[],options:e||{},errors:[]}}function KF(e,t){this.path=e,this.rethrow(t)}RF.Reporter=HF,HF.prototype.isError=function(e){return e instanceof KF},HF.prototype.save=function(){var e=this._reporterState;return{obj:e.obj,pathLen:e.path.length}},HF.prototype.restore=function(e){var t=this._reporterState;t.obj=e.obj,t.path=t.path.slice(0,e.pathLen)},HF.prototype.enterKey=function(e){return this._reporterState.path.push(e)},HF.prototype.exitKey=function(e){var t=this._reporterState;t.path=t.path.slice(0,e-1)},HF.prototype.leaveKey=function(e,t,n){var r=this._reporterState;this.exitKey(e),null!==r.obj&&(r.obj[t]=n)},HF.prototype.path=function(){return this._reporterState.path.join("/")},HF.prototype.enterObject=function(){var e=this._reporterState,t=e.obj;return e.obj={},t},HF.prototype.leaveObject=function(e){var t=this._reporterState,n=t.obj;return t.obj=e,n},HF.prototype.error=function(e){var t,n=this._reporterState,r=e instanceof KF;if(t=r?e:new KF(n.path.map((function(e){return"["+JSON.stringify(e)+"]"})).join(""),e.message||e,e.stack),!n.options.partial)throw t;return r||n.errors.push(t),t},HF.prototype.wrapResult=function(e){var t=this._reporterState;return t.options.partial?{result:this.isError(e)?null:e,errors:t.errors}:e},OF(KF,Error),KF.prototype.rethrow=function(e){if(this.message=e+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,KF),!this.stack)try{throw new Error(this.message)}catch(e){this.stack=e.stack}return this};var jF={},GF=KI.exports,qF=RF.Reporter,VF=TF.Buffer;function zF(e,t){qF.call(this,t),VF.isBuffer(e)?(this.base=e,this.offset=0,this.length=e.length):this.error("Input not Buffer")}function JF(e,t){if(Array.isArray(e))this.length=0,this.value=e.map((function(e){return JF.isEncoderBuffer(e)||(e=new JF(e,t)),this.length+=e.length,e}),this);else if("number"==typeof e){if(!(0<=e&&e<=255))return t.error("non-byte EncoderBuffer value");this.value=e,this.length=1}else if("string"==typeof e)this.value=e,this.length=VF.byteLength(e);else{if(!VF.isBuffer(e))return t.error("Unsupported type: "+i(e));this.value=e,this.length=e.length}}GF(zF,qF),jF.DecoderBuffer=zF,zF.isDecoderBuffer=function(e){return e instanceof zF||"object"==i(e)&&VF.isBuffer(e.base)&&"DecoderBuffer"===e.constructor.name&&"number"==typeof e.offset&&"number"==typeof e.length&&"function"==typeof e.save&&"function"==typeof e.restore&&"function"==typeof e.isEmpty&&"function"==typeof e.readUInt8&&"function"==typeof e.skip&&"function"==typeof e.raw},zF.prototype.save=function(){return{offset:this.offset,reporter:qF.prototype.save.call(this)}},zF.prototype.restore=function(e){var t=new zF(this.base);return t.offset=e.offset,t.length=this.offset,this.offset=e.offset,qF.prototype.restore.call(this,e.reporter),t},zF.prototype.isEmpty=function(){return this.offset===this.length},zF.prototype.readUInt8=function(e){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(e||"DecoderBuffer overrun")},zF.prototype.skip=function(e,t){if(!(this.offset+e<=this.length))return this.error(t||"DecoderBuffer overrun");var n=new zF(this.base);return n._reporterState=this._reporterState,n.offset=this.offset,n.length=this.offset+e,this.offset+=e,n},zF.prototype.raw=function(e){return this.base.slice(e?e.offset:this.offset,this.length)},jF.EncoderBuffer=JF,JF.isEncoderBuffer=function(e){return e instanceof JF||"object"==i(e)&&"EncoderBuffer"===e.constructor.name&&"number"==typeof e.length&&"function"==typeof e.join},JF.prototype.join=function(e,t){return e||(e=VF.alloc(this.length)),t||(t=0),0===this.length||(Array.isArray(this.value)?this.value.forEach((function(n){n.join(e,t),t+=n.length})):("number"==typeof this.value?e[t]=this.value:"string"==typeof this.value?e.write(this.value,t):VF.isBuffer(this.value)&&this.value.copy(e,t),t+=this.length)),e};var YF=RF.Reporter,XF=jF.EncoderBuffer,WF=jF.DecoderBuffer,ZF=xI,$F=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],eP=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat($F);function tP(e,t,n){var r={};this._baseState=r,r.name=n,r.enc=e,r.parent=t||null,r.children=null,r.tag=null,r.args=null,r.reverseArgs=null,r.choice=null,r.optional=!1,r.any=!1,r.obj=!1,r.use=null,r.useDecoder=null,r.key=null,r.default=null,r.explicit=null,r.implicit=null,r.contains=null,r.parent||(r.children=[],this._wrap())}var nP=tP,rP=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];tP.prototype.clone=function(){var e=this._baseState,t={};rP.forEach((function(n){t[n]=e[n]}));var n=new this.constructor(t.parent);return n._baseState=t,n},tP.prototype._wrap=function(){var e=this._baseState;eP.forEach((function(t){this[t]=function(){var n=new this.constructor(this);return e.children.push(n),n[t].apply(n,arguments)}}),this)},tP.prototype._init=function(e){var t=this._baseState;ZF(null===t.parent),e.call(this),t.children=t.children.filter((function(e){return e._baseState.parent===this}),this),ZF.equal(t.children.length,1,"Root node can have only one child")},tP.prototype._useArgs=function(e){var t=this._baseState,n=e.filter((function(e){return e instanceof this.constructor}),this);e=e.filter((function(e){return!(e instanceof this.constructor)}),this),0!==n.length&&(ZF(null===t.children),t.children=n,n.forEach((function(e){e._baseState.parent=this}),this)),0!==e.length&&(ZF(null===t.args),t.args=e,t.reverseArgs=e.map((function(e){if("object"!=i(e)||e.constructor!==Object)return e;var t={};return Object.keys(e).forEach((function(n){n==(0|n)&&(n|=0);var r=e[n];t[r]=n})),t})))},["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"].forEach((function(e){tP.prototype[e]=function(){var t=this._baseState;throw new Error(e+" not implemented for encoding: "+t.enc)}})),$F.forEach((function(e){tP.prototype[e]=function(){var t=this._baseState,n=Array.prototype.slice.call(arguments);return ZF(null===t.tag),t.tag=e,this._useArgs(n),this}})),tP.prototype.use=function(e){ZF(e);var t=this._baseState;return ZF(null===t.use),t.use=e,this},tP.prototype.optional=function(){return this._baseState.optional=!0,this},tP.prototype.def=function(e){var t=this._baseState;return ZF(null===t.default),t.default=e,t.optional=!0,this},tP.prototype.explicit=function(e){var t=this._baseState;return ZF(null===t.explicit&&null===t.implicit),t.explicit=e,this},tP.prototype.implicit=function(e){var t=this._baseState;return ZF(null===t.explicit&&null===t.implicit),t.implicit=e,this},tP.prototype.obj=function(){var e=this._baseState,t=Array.prototype.slice.call(arguments);return e.obj=!0,0!==t.length&&this._useArgs(t),this},tP.prototype.key=function(e){var t=this._baseState;return ZF(null===t.key),t.key=e,this},tP.prototype.any=function(){return this._baseState.any=!0,this},tP.prototype.choice=function(e){var t=this._baseState;return ZF(null===t.choice),t.choice=e,this._useArgs(Object.keys(e).map((function(t){return e[t]}))),this},tP.prototype.contains=function(e){var t=this._baseState;return ZF(null===t.use),t.contains=e,this},tP.prototype._decode=function(e,t){var n=this._baseState;if(null===n.parent)return e.wrapResult(n.children[0]._decode(e,t));var r,i=n.default,o=!0,a=null;if(null!==n.key&&(a=e.enterKey(n.key)),n.optional){var s=null;if(null!==n.explicit?s=n.explicit:null!==n.implicit?s=n.implicit:null!==n.tag&&(s=n.tag),null!==s||n.any){if(o=this._peekTag(e,s,n.any),e.isError(o))return o}else{var u=e.save();try{null===n.choice?this._decodeGeneric(n.tag,e,t):this._decodeChoice(e,t),o=!0}catch(e){o=!1}e.restore(u)}}if(n.obj&&o&&(r=e.enterObject()),o){if(null!==n.explicit){var l=this._decodeTag(e,n.explicit);if(e.isError(l))return l;e=l}var A=e.offset;if(null===n.use&&null===n.choice){var c;n.any&&(c=e.save());var h=this._decodeTag(e,null!==n.implicit?n.implicit:n.tag,n.any);if(e.isError(h))return h;n.any?i=e.raw(c):e=h}if(t&&t.track&&null!==n.tag&&t.track(e.path(),A,e.length,"tagged"),t&&t.track&&null!==n.tag&&t.track(e.path(),e.offset,e.length,"content"),n.any||(i=null===n.choice?this._decodeGeneric(n.tag,e,t):this._decodeChoice(e,t)),e.isError(i))return i;if(n.any||null!==n.choice||null===n.children||n.children.forEach((function(n){n._decode(e,t)})),n.contains&&("octstr"===n.tag||"bitstr"===n.tag)){var f=new WF(i);i=this._getUse(n.contains,e._reporterState.obj)._decode(f,t)}}return n.obj&&o&&(i=e.leaveObject(r)),null===n.key||null===i&&!0!==o?null!==a&&e.exitKey(a):e.leaveKey(a,n.key,i),i},tP.prototype._decodeGeneric=function(e,t,n){var r=this._baseState;return"seq"===e||"set"===e?null:"seqof"===e||"setof"===e?this._decodeList(t,e,r.args[0],n):/str$/.test(e)?this._decodeStr(t,e,n):"objid"===e&&r.args?this._decodeObjid(t,r.args[0],r.args[1],n):"objid"===e?this._decodeObjid(t,null,null,n):"gentime"===e||"utctime"===e?this._decodeTime(t,e,n):"null_"===e?this._decodeNull(t,n):"bool"===e?this._decodeBool(t,n):"objDesc"===e?this._decodeStr(t,e,n):"int"===e||"enum"===e?this._decodeInt(t,r.args&&r.args[0],n):null!==r.use?this._getUse(r.use,t._reporterState.obj)._decode(t,n):t.error("unknown tag: "+e)},tP.prototype._getUse=function(e,t){var n=this._baseState;return n.useDecoder=this._use(e,t),ZF(null===n.useDecoder._baseState.parent),n.useDecoder=n.useDecoder._baseState.children[0],n.implicit!==n.useDecoder._baseState.implicit&&(n.useDecoder=n.useDecoder.clone(),n.useDecoder._baseState.implicit=n.implicit),n.useDecoder},tP.prototype._decodeChoice=function(e,t){var n=this._baseState,r=null,i=!1;return Object.keys(n.choice).some((function(o){var a=e.save(),s=n.choice[o];try{var u=s._decode(e,t);if(e.isError(u))return!1;r={type:o,value:u},i=!0}catch(t){return e.restore(a),!1}return!0}),this),i?r:e.error("Choice not matched")},tP.prototype._createEncoderBuffer=function(e){return new XF(e,this.reporter)},tP.prototype._encode=function(e,t,n){var r=this._baseState;if(null===r.default||r.default!==e){var i=this._encodeValue(e,t,n);return void 0===i||this._skipDefault(i,t,n)?void 0:i}},tP.prototype._encodeValue=function(e,t,n){var r=this._baseState;if(null===r.parent)return r.children[0]._encode(e,t||new YF);var o=null;if(this.reporter=t,r.optional&&void 0===e){if(null===r.default)return;e=r.default}var a=null,s=!1;if(r.any)o=this._createEncoderBuffer(e);else if(r.choice)o=this._encodeChoice(e,t);else if(r.contains)a=this._getUse(r.contains,n)._encode(e,t),s=!0;else if(r.children)a=r.children.map((function(n){if("null_"===n._baseState.tag)return n._encode(null,t,e);if(null===n._baseState.key)return t.error("Child should have a key");var r=t.enterKey(n._baseState.key);if("object"!=i(e))return t.error("Child expected, but input is not object");var o=n._encode(e[n._baseState.key],t,e);return t.leaveKey(r),o}),this).filter((function(e){return e})),a=this._createEncoderBuffer(a);else if("seqof"===r.tag||"setof"===r.tag){if(!r.args||1!==r.args.length)return t.error("Too many args for : "+r.tag);if(!Array.isArray(e))return t.error("seqof/setof, but data is not Array");var u=this.clone();u._baseState.implicit=null,a=this._createEncoderBuffer(e.map((function(n){var r=this._baseState;return this._getUse(r.args[0],e)._encode(n,t)}),u))}else null!==r.use?o=this._getUse(r.use,n)._encode(e,t):(a=this._encodePrimitive(r.tag,e),s=!0);if(!r.any&&null===r.choice){var l=null!==r.implicit?r.implicit:r.tag,A=null===r.implicit?"universal":"context";null===l?null===r.use&&t.error("Tag could be omitted only for .use()"):null===r.use&&(o=this._encodeComposite(l,s,A,a))}return null!==r.explicit&&(o=this._encodeComposite(r.explicit,!1,"context",o)),o},tP.prototype._encodeChoice=function(e,t){var n=this._baseState,r=n.choice[e.type];return r||ZF(!1,e.type+" not found in "+JSON.stringify(Object.keys(n.choice))),r._encode(e.value,t)},tP.prototype._encodePrimitive=function(e,t){var n=this._baseState;if(/str$/.test(e))return this._encodeStr(t,e);if("objid"===e&&n.args)return this._encodeObjid(t,n.reverseArgs[0],n.args[1]);if("objid"===e)return this._encodeObjid(t,null,null);if("gentime"===e||"utctime"===e)return this._encodeTime(t,e);if("null_"===e)return this._encodeNull();if("int"===e||"enum"===e)return this._encodeInt(t,n.args&&n.reverseArgs[0]);if("bool"===e)return this._encodeBool(t);if("objDesc"===e)return this._encodeStr(t,e);throw new Error("Unsupported tag: "+e)},tP.prototype._isNumstr=function(e){return/^[0-9 ]*$/.test(e)},tP.prototype._isPrintstr=function(e){return/^[A-Za-z0-9 '()+,-./:=?]*$/.test(e)};var iP={};!function(e){function t(e){var t={};return Object.keys(e).forEach((function(n){(0|n)==n&&(n|=0);var r=e[n];t[r]=n})),t}e.tagClass={0:"universal",1:"application",2:"context",3:"private"},e.tagClassByName=t(e.tagClass),e.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"},e.tagByName=t(e.tag)}(iP);var oP=KI.exports,aP=TF.Buffer,sP=nP,uP=iP;function lP(e){this.enc="der",this.name=e.name,this.entity=e,this.tree=new cP,this.tree._init(e.body)}var AP=lP;function cP(e){sP.call(this,"der",e)}function hP(e){return e<10?"0"+e:e}lP.prototype.encode=function(e,t){return this.tree._encode(e,t).join()},oP(cP,sP),cP.prototype._encodeComposite=function(e,t,n,r){var i=function(e,t,n,r){var i;if("seqof"===e?e="seq":"setof"===e&&(e="set"),uP.tagByName.hasOwnProperty(e))i=uP.tagByName[e];else{if("number"!=typeof e||(0|e)!==e)return r.error("Unknown tag: "+e);i=e}return i>=31?r.error("Multi-octet tag encoding unsupported"):(t||(i|=32),i|=uP.tagClassByName[n||"universal"]<<6)}(e,t,n,this.reporter);if(r.length<128){var o=aP.alloc(2);return o[0]=i,o[1]=r.length,this._createEncoderBuffer([o,r])}for(var a=1,s=r.length;s>=256;s>>=8)a++;var u=aP.alloc(2+a);u[0]=i,u[1]=128|a;for(var l=1+a,A=r.length;A>0;l--,A>>=8)u[l]=255&A;return this._createEncoderBuffer([u,r])},cP.prototype._encodeStr=function(e,t){if("bitstr"===t)return this._createEncoderBuffer([0|e.unused,e.data]);if("bmpstr"===t){for(var n=aP.alloc(2*e.length),r=0;r<e.length;r++)n.writeUInt16BE(e.charCodeAt(r),2*r);return this._createEncoderBuffer(n)}return"numstr"===t?this._isNumstr(e)?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: numstr supports only digits and space"):"printstr"===t?this._isPrintstr(e)?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark"):/str$/.test(t)||"objDesc"===t?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: "+t+" unsupported")},cP.prototype._encodeObjid=function(e,t,n){if("string"==typeof e){if(!t)return this.reporter.error("string objid given, but no values map found");if(!t.hasOwnProperty(e))return this.reporter.error("objid not found in values map");e=t[e].split(/[\s.]+/g);for(var r=0;r<e.length;r++)e[r]|=0}else if(Array.isArray(e)){e=e.slice();for(var i=0;i<e.length;i++)e[i]|=0}if(!Array.isArray(e))return this.reporter.error("objid() should be either array or string, got: "+JSON.stringify(e));if(!n){if(e[1]>=40)return this.reporter.error("Second objid identifier OOB");e.splice(0,2,40*e[0]+e[1])}for(var o=0,a=0;a<e.length;a++){var s=e[a];for(o++;s>=128;s>>=7)o++}for(var u=aP.alloc(o),l=u.length-1,A=e.length-1;A>=0;A--){var c=e[A];for(u[l--]=127&c;(c>>=7)>0;)u[l--]=128|127&c}return this._createEncoderBuffer(u)},cP.prototype._encodeTime=function(e,t){var n,r=new Date(e);return"gentime"===t?n=[hP(r.getUTCFullYear()),hP(r.getUTCMonth()+1),hP(r.getUTCDate()),hP(r.getUTCHours()),hP(r.getUTCMinutes()),hP(r.getUTCSeconds()),"Z"].join(""):"utctime"===t?n=[hP(r.getUTCFullYear()%100),hP(r.getUTCMonth()+1),hP(r.getUTCDate()),hP(r.getUTCHours()),hP(r.getUTCMinutes()),hP(r.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+t+" time is not supported yet"),this._encodeStr(n,"octstr")},cP.prototype._encodeNull=function(){return this._createEncoderBuffer("")},cP.prototype._encodeInt=function(e,t){if("string"==typeof e){if(!t)return this.reporter.error("String int or enum given, but no values map");if(!t.hasOwnProperty(e))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(e));e=t[e]}if("number"!=typeof e&&!aP.isBuffer(e)){var n=e.toArray();!e.sign&&128&n[0]&&n.unshift(0),e=aP.from(n)}if(aP.isBuffer(e)){var r=e.length;0===e.length&&r++;var i=aP.alloc(r);return e.copy(i),0===e.length&&(i[0]=0),this._createEncoderBuffer(i)}if(e<128)return this._createEncoderBuffer(e);if(e<256)return this._createEncoderBuffer([0,e]);for(var o=1,a=e;a>=256;a>>=8)o++;for(var s=new Array(o),u=s.length-1;u>=0;u--)s[u]=255&e,e>>=8;return 128&s[0]&&s.unshift(0),this._createEncoderBuffer(aP.from(s))},cP.prototype._encodeBool=function(e){return this._createEncoderBuffer(e?255:0)},cP.prototype._use=function(e,t){return"function"==typeof e&&(e=e(t)),e._getEncoder("der").tree},cP.prototype._skipDefault=function(e,t,n){var r,i=this._baseState;if(null===i.default)return!1;var o=e.join();if(void 0===i.defaultBuffer&&(i.defaultBuffer=this._encodeValue(i.default,t,n).join()),o.length!==i.defaultBuffer.length)return!1;for(r=0;r<o.length;r++)if(o[r]!==i.defaultBuffer[r])return!1;return!0};var fP=KI.exports,dP=AP;function pP(e){dP.call(this,e),this.enc="pem"}fP(pP,dP);var gP=pP;pP.prototype.encode=function(e,t){for(var n=dP.prototype.encode.call(this,e).toString("base64"),r=["-----BEGIN "+t.label+"-----"],i=0;i<n.length;i+=64)r.push(n.slice(i,i+64));return r.push("-----END "+t.label+"-----"),r.join("\n")},function(e){var t=e;t.der=AP,t.pem=gP}(FF);var vP={},yP=KI.exports,mP=CI.exports,wP=jF.DecoderBuffer,bP=nP,IP=iP;function BP(e){this.enc="der",this.name=e.name,this.entity=e,this.tree=new CP,this.tree._init(e.body)}var EP=BP;function CP(e){bP.call(this,"der",e)}function xP(e,t){var n=e.readUInt8(t);if(e.isError(n))return n;var r=IP.tagClass[n>>6],i=0==(32&n);if(31==(31&n)){var o=n;for(n=0;128==(128&o);){if(o=e.readUInt8(t),e.isError(o))return o;n<<=7,n|=127&o}}else n&=31;return{cls:r,primitive:i,tag:n,tagStr:IP.tag[n]}}function kP(e,t,n){var r=e.readUInt8(n);if(e.isError(r))return r;if(!t&&128===r)return null;if(0==(128&r))return r;var i=127&r;if(i>4)return e.error("length octect is too long");r=0;for(var o=0;o<i;o++){r<<=8;var a=e.readUInt8(n);if(e.isError(a))return a;r|=a}return r}BP.prototype.decode=function(e,t){return wP.isDecoderBuffer(e)||(e=new wP(e,t)),this.tree._decode(e,t)},yP(CP,bP),CP.prototype._peekTag=function(e,t,n){if(e.isEmpty())return!1;var r=e.save(),i=xP(e,'Failed to peek tag: "'+t+'"');return e.isError(i)?i:(e.restore(r),i.tag===t||i.tagStr===t||i.tagStr+"of"===t||n)},CP.prototype._decodeTag=function(e,t,n){var r=xP(e,'Failed to decode tag of "'+t+'"');if(e.isError(r))return r;var i=kP(e,r.primitive,'Failed to get length of "'+t+'"');if(e.isError(i))return i;if(!n&&r.tag!==t&&r.tagStr!==t&&r.tagStr+"of"!==t)return e.error('Failed to match tag: "'+t+'"');if(r.primitive||null!==i)return e.skip(i,'Failed to match body of: "'+t+'"');var o=e.save(),a=this._skipUntilEnd(e,'Failed to skip indefinite length body: "'+this.tag+'"');return e.isError(a)?a:(i=e.offset-o.offset,e.restore(o),e.skip(i,'Failed to match body of: "'+t+'"'))},CP.prototype._skipUntilEnd=function(e,t){for(;;){var n=xP(e,t);if(e.isError(n))return n;var r=kP(e,n.primitive,t);if(e.isError(r))return r;var i;if(i=n.primitive||null!==r?e.skip(r):this._skipUntilEnd(e,t),e.isError(i))return i;if("end"===n.tagStr)break}},CP.prototype._decodeList=function(e,t,n,r){for(var i=[];!e.isEmpty();){var o=this._peekTag(e,"end");if(e.isError(o))return o;var a=n.decode(e,"der",r);if(e.isError(a)&&o)break;i.push(a)}return i},CP.prototype._decodeStr=function(e,t){if("bitstr"===t){var n=e.readUInt8();return e.isError(n)?n:{unused:n,data:e.raw()}}if("bmpstr"===t){var r=e.raw();if(r.length%2==1)return e.error("Decoding of string type: bmpstr length mismatch");for(var i="",o=0;o<r.length/2;o++)i+=String.fromCharCode(r.readUInt16BE(2*o));return i}if("numstr"===t){var a=e.raw().toString("ascii");return this._isNumstr(a)?a:e.error("Decoding of string type: numstr unsupported characters")}if("octstr"===t)return e.raw();if("objDesc"===t)return e.raw();if("printstr"===t){var s=e.raw().toString("ascii");return this._isPrintstr(s)?s:e.error("Decoding of string type: printstr unsupported characters")}return/str$/.test(t)?e.raw().toString():e.error("Decoding of string type: "+t+" unsupported")},CP.prototype._decodeObjid=function(e,t,n){for(var r,i=[],o=0,a=0;!e.isEmpty();)o<<=7,o|=127&(a=e.readUInt8()),0==(128&a)&&(i.push(o),o=0);128&a&&i.push(o);var s=i[0]/40|0,u=i[0]%40;if(r=n?i:[s,u].concat(i.slice(1)),t){var l=t[r.join(" ")];void 0===l&&(l=t[r.join(".")]),void 0!==l&&(r=l)}return r},CP.prototype._decodeTime=function(e,t){var n,r,i,o,a,s,u=e.raw().toString();if("gentime"===t)n=0|u.slice(0,4),r=0|u.slice(4,6),i=0|u.slice(6,8),o=0|u.slice(8,10),a=0|u.slice(10,12),s=0|u.slice(12,14);else{if("utctime"!==t)return e.error("Decoding "+t+" time is not supported yet");n=0|u.slice(0,2),r=0|u.slice(2,4),i=0|u.slice(4,6),o=0|u.slice(6,8),a=0|u.slice(8,10),s=0|u.slice(10,12),n=n<70?2e3+n:1900+n}return Date.UTC(n,r-1,i,o,a,s,0)},CP.prototype._decodeNull=function(){return null},CP.prototype._decodeBool=function(e){var t=e.readUInt8();return e.isError(t)?t:0!==t},CP.prototype._decodeInt=function(e,t){var n=e.raw(),r=new mP(n);return t&&(r=t[r.toString(10)]||r),r},CP.prototype._use=function(e,t){return"function"==typeof e&&(e=e(t)),e._getDecoder("der").tree};var SP=KI.exports,QP=TF.Buffer,_P=EP;function NP(e){_P.call(this,e),this.enc="pem"}SP(NP,_P);var DP=NP;NP.prototype.decode=function(e,t){for(var n=e.toString().split(/[\r\n]+/g),r=t.label.toUpperCase(),i=/^-----(BEGIN|END) ([^-]+)-----$/,o=-1,a=-1,s=0;s<n.length;s++){var u=n[s].match(i);if(null!==u&&u[2]===r){if(-1!==o){if("END"!==u[1])break;a=s;break}if("BEGIN"!==u[1])break;o=s}}if(-1===o||-1===a)throw new Error("PEM section not found for: "+r);var l=n.slice(o+1,a).join("");l.replace(/[^a-z0-9+/=]+/gi,"");var A=QP.from(l,"base64");return _P.prototype.decode.call(this,A,t)},function(e){var t=e;t.der=EP,t.pem=DP}(vP),function(e){var t=FF,n=vP,r=KI.exports;function i(e,t){this.name=e,this.body=t,this.decoders={},this.encoders={}}e.define=function(e,t){return new i(e,t)},i.prototype._createNamed=function(e){var t=this.name;function n(e){this._initNamed(e,t)}return r(n,e),n.prototype._initNamed=function(t,n){e.call(this,t,n)},new n(this)},i.prototype._getDecoder=function(e){return e=e||"der",this.decoders.hasOwnProperty(e)||(this.decoders[e]=this._createNamed(n[e])),this.decoders[e]},i.prototype.decode=function(e,t,n){return this._getDecoder(t).decode(e,n)},i.prototype._getEncoder=function(e){return e=e||"der",this.encoders.hasOwnProperty(e)||(this.encoders[e]=this._createNamed(t[e])),this.encoders[e]},i.prototype.encode=function(e,t,n){return this._getEncoder(t).encode(e,n)}}(DF);var FP={};!function(e){var t=FP;t.Reporter=RF.Reporter,t.DecoderBuffer=jF.DecoderBuffer,t.EncoderBuffer=jF.EncoderBuffer,t.Node=nP}();var PP={};!function(e){var t=e;t._reverse=function(e){var t={};return Object.keys(e).forEach((function(n){(0|n)==n&&(n|=0);var r=e[n];t[r]=n})),t},t.der=iP}(PP),function(e){var t=NF;t.bignum=CI.exports,t.define=DF.define,t.base=FP,t.constants=PP,t.decoders=vP,t.encoders=FF}();var UP={exports:{}},LP={},MP={};Object.defineProperty(MP,"__esModule",{value:!0}),MP.default=function(e){var t=e.length,n=t%4;if(!n)return e;var r=t,i=4-n,o=t+i,a=Yo.alloc(o);for(a.write(e);i--;)a.write("=",r++);return a.toString()},Object.defineProperty(LP,"__esModule",{value:!0});var TP=MP;function RP(e,t){return void 0===t&&(t="utf8"),Na(e)?HP(e.toString("base64")):HP(Yo.from(e,t).toString("base64"))}function OP(e){return e=e.toString(),TP.default(e).replace(/\-/g,"+").replace(/_/g,"/")}function HP(e){return e.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}var KP=RP;KP.encode=RP,KP.decode=function(e,t){return void 0===t&&(t="utf8"),Yo.from(OP(e),"base64").toString(t)},KP.toBase64=OP,KP.fromBase64=HP,KP.toBuffer=function(e){return Yo.from(OP(e),"base64")},LP.default=KP,function(e){e.exports=LP.default,e.exports.default=e.exports}(UP);var jP=UP.exports,GP=NF,qP=UP.exports,VP=function(){function e(){s(this,e)}return l(e,null,[{key:"convert",value:function(e,t,n){if(e){if(t===n)return e;var r;if("raw"===t||e instanceof Yo)r=e;else if("uint8_array"===t||Array.isArray(e))r=Yo.from(e);else if("hex"===t)r=Yo.from(e,"hex");else if("base64"===t)r=Yo.from(e,"base64");else if("base64url"===t)r=qP.toBuffer(e);else{if("bn"!==t&&"bignum"!==t)throw new Error("Invalid fromType");r=Yo.from(this.pad(e.toString(16)),"hex")}if("raw"===n)return r;if("uint8_array"===n)return Array.from(r);if("hex"===n)return r.toString("hex");if("base64"===n)return r.toString("base64");if("base64url"===n)return qP.fromBase64(r.toString("base64"));if("bn"===n||"bignum"===n)return new GP.bignum(r);throw new Error("Invalid toType")}}},{key:"pad",value:function(e){return e.length%2==1?"0".concat(e):e}}]),e}(),zP=NF,JP=function(){function e(){s(this,e),Object.defineProperty(this,"_registry",{value:{}})}return l(e,[{key:"registry",get:function(){return this._registry}},{key:"define",value:function(e,t){this._registry[e]=zP.define(e,t(this))}},{key:"normalize",value:function(e){return this.registry[e]}}]),e}(),YP=new JP;YP.define("Version",(function(e){return function(){this.int({0:"two-prime",1:"multi"})}})),YP.define("OtherPrimeInfos",(function(e){return function(){this.seq().obj(this.key("ri").int(),this.key("di").int(),this.key("ti").int())}})),YP.define("AlgorithmIdentifier",(function(e){return function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional().any())}})),YP.define("PrivateKeyInfo",(function(e){var t=e.normalize("Version"),n=e.normalize("AlgorithmIdentifier");return function(){this.seq().obj(this.key("version").use(t),this.key("algorithm").use(n),this.key("privateKey").octstr())}})),YP.define("PublicKeyInfo",(function(e){var t=e.normalize("AlgorithmIdentifier");return function(){this.seq().obj(this.key("algorithm").use(t),this.key("publicKey").bitstr())}})),YP.define("RSAPrivateKey",(function(e){var t=e.normalize("Version"),n=e.normalize("OtherPrimeInfos");return function(){this.seq().obj(this.key("version").use(t),this.key("n").int(),this.key("e").int(),this.key("d").int(),this.key("p").int(),this.key("q").int(),this.key("dp").int(),this.key("dq").int(),this.key("qi").int(),this.key("other").optional().use(n))}})),YP.define("RSAPublicKey",(function(e){return function(){this.seq().obj(this.key("n").int(),this.key("e").int())}})),YP.define("ECPrivateKey",(function(e){return function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").explicit(0).optional().choice({namedCurve:this.objid()}),this.key("publicKey").explicit(1).optional().bitstr())}}));var XP=YP,WP=VP,ZP=XP,$P=function(e){c(n,e);var t=b(n);function n(){return s(this,n),t.apply(this,arguments)}return l(n,[{key:"fromPrivatePKCS1",value:function(e){var t=ZP.normalize("RSAPrivateKey").decode(e,"der"),n=t.n,r=t.e,i=t.d,o=t.p,a=t.q,s=t.dp,u=t.dq,l=t.qi;return{n:WP.convert(n,"bn","raw"),e:WP.convert(r,"bn","raw"),d:WP.convert(i,"bn","raw"),p:WP.convert(o,"bn","raw"),q:WP.convert(a,"bn","raw"),dp:WP.convert(s,"bn","raw"),dq:WP.convert(u,"bn","raw"),qi:WP.convert(l,"bn","raw")}}},{key:"fromPrivatePKCS8",value:function(e){var t=ZP.normalize("PrivateKeyInfo"),n=ZP.normalize("RSAPrivateKey"),r=t.decode(e,"der"),i=n.decode(r.privateKey,"der"),o=i.n,a=i.e,s=i.d,u=i.p,l=i.q,A=i.dp,c=i.dq,h=i.qi;return{n:WP.convert(o,"bn","raw"),e:WP.convert(a,"bn","raw"),d:WP.convert(s,"bn","raw"),p:WP.convert(u,"bn","raw"),q:WP.convert(l,"bn","raw"),dp:WP.convert(A,"bn","raw"),dq:WP.convert(c,"bn","raw"),qi:WP.convert(h,"bn","raw")}}},{key:"fromPublicPKCS1",value:function(e){var t=ZP.normalize("RSAPublicKey").decode(e,"der"),n=t.n,r=t.e;return{n:WP.convert(n,"bn","raw"),e:WP.convert(r,"bn","raw")}}},{key:"fromPublicPKCS8",value:function(e){var t=ZP.normalize("PublicKeyInfo"),n=ZP.normalize("RSAPublicKey"),r=t.decode(e,"der"),i=n.decode(r.publicKey.data,"der"),o=i.n,a=i.e;return{n:WP.convert(o,"bn","raw"),e:WP.convert(a,"bn","raw")}}},{key:"fromJwk",value:function(e){var t=e.n,n=e.e,r=e.d,i=e.p,o=e.q,a=e.dp,s=e.dq,u=e.qi;return e.alg,{n:WP.convert(t,"base64url","raw"),e:WP.convert(n,"base64url","raw"),d:WP.convert(r,"base64url","raw"),p:WP.convert(i,"base64url","raw"),q:WP.convert(o,"base64url","raw"),dp:WP.convert(a,"base64url","raw"),dq:WP.convert(s,"base64url","raw"),qi:WP.convert(u,"base64url","raw")}}},{key:"toPrivatePKCS1",value:function(e){var t=e.n,r=e.e,i=e.d,o=e.p,a=e.q,s=e.dp,u=e.dq,l=e.qi,A=this.params.version,c=ZP.normalize("RSAPrivateKey").encode({version:A,n:WP.convert(t,"raw","bn"),e:WP.convert(r,"raw","bn"),d:WP.convert(i,"raw","bn"),p:WP.convert(o,"raw","bn"),q:WP.convert(a,"raw","bn"),dp:WP.convert(s,"raw","bn"),dq:WP.convert(u,"raw","bn"),qi:WP.convert(l,"raw","bn")},"der").toString("base64");return n.formatPem(c,"RSA PRIVATE")}},{key:"toPrivatePKCS8",value:function(e){var t=e.n,r=e.e,i=e.d,o=e.p,a=e.q,s=e.dp,u=e.dq,l=e.qi,A=this.params,c=A.oid,h=A.algParameters,f=A.version,d=ZP.normalize("PrivateKeyInfo"),p=ZP.normalize("RSAPrivateKey").encode({version:f,n:WP.convert(t,"raw","bn"),e:WP.convert(r,"raw","bn"),d:WP.convert(i,"raw","bn"),p:WP.convert(o,"raw","bn"),q:WP.convert(a,"raw","bn"),dp:WP.convert(s,"raw","bn"),dq:WP.convert(u,"raw","bn"),qi:WP.convert(l,"raw","bn")},"der"),g=d.encode({version:f,algorithm:{algorithm:c.split("."),parameters:Yo.from(h,"hex")},privateKey:p},"der").toString("base64");return n.formatPem(g,"PRIVATE")}},{key:"toPublicPKCS1",value:function(e){var t=e.n,r=e.e,i=this.params.version,o=ZP.normalize("RSAPublicKey").encode({version:i,n:WP.convert(t,"raw","bn"),e:WP.convert(r,"raw","bn")},"der").toString("base64");return n.formatPem(o,"RSA PUBLIC")}},{key:"toPublicPKCS8",value:function(e){var t=e.n,r=e.e,i=this.params,o=i.oid,a=i.algParameters,s=ZP.normalize("PublicKeyInfo"),u=ZP.normalize("RSAPublicKey").encode({n:WP.convert(t,"raw","bn"),e:WP.convert(r,"raw","bn")},"der"),l=s.encode({algorithm:{algorithm:o.split("."),parameters:Yo.from(a,"hex")},publicKey:{unused:0,data:u}},"der").toString("base64");return n.formatPem(l,"PUBLIC")}},{key:"toPrivateJwk",value:function(e){var t=e.n,n=e.e,r=e.d,i=e.p,o=e.q,a=e.dp,s=e.dq,u=e.qi;return{kty:this.params.kty,n:WP.convert(t,"raw","base64url"),e:WP.convert(n,"raw","base64url"),d:WP.convert(r,"raw","base64url"),p:WP.convert(i,"raw","base64url"),q:WP.convert(o,"raw","base64url"),dp:WP.convert(a,"raw","base64url"),dq:WP.convert(s,"raw","base64url"),qi:WP.convert(u,"raw","base64url")}}},{key:"toPublicJwk",value:function(e){var t=e.n,n=e.e;return{kty:this.params.kty,n:WP.convert(t,"raw","base64url"),e:WP.convert(n,"raw","base64url")}}}]),n}(_F),eU=$P,tU=new BI.ec("secp256k1"),nU=VP,rU=XP,iU=function(e){c(n,e);var t=b(n);function n(){return s(this,n),t.apply(this,arguments)}return l(n,[{key:"fromPrivatePKCS1",value:function(e){var t=rU.normalize("ECPrivateKey").decode(e,"der"),r=t.privateKey,i=t.publicKey.data,o=nU.convert(i,"raw","hex"),a=n.getPoint(o);return{d:r,x:a.x,y:a.y}}},{key:"fromPrivatePKCS8",value:function(e){var t=rU.normalize("PrivateKeyInfo"),r=rU.normalize("ECPrivateKey"),i=t.decode(e,"der"),o=r.decode(i.privateKey,"der"),a=o.privateKey,s=o.publicKey.data,u=nU.convert(s,"raw","hex"),l=n.getPoint(u);return{d:a,x:l.x,y:l.y}}},{key:"fromPublicPKCS8",value:function(e){var t=rU.normalize("PublicKeyInfo").decode(e,"der"),r=nU.convert(t.publicKey.data,"raw","hex");return n.getPoint(r)}},{key:"fromPrivateBlk",value:function(e){var t=tU.keyFromPrivate(e,"hex"),n=t.getPublic();return{d:nU.convert(t.priv,"bn","raw"),x:nU.convert(n.getX(),"bn","raw"),y:nU.convert(n.getY(),"bn","raw")}}},{key:"fromPublicBlk",value:function(e){return n.getPoint(e)}},{key:"fromJwk",value:function(e){var t=e.d,n=e.x,r=e.y;return{d:nU.convert(t,"base64url","raw"),x:nU.convert(n,"base64url","raw"),y:nU.convert(r,"base64url","raw")}}},{key:"toPrivatePKCS1",value:function(e){var t=this.params,r=t.namedCurve,i=t.keyVersion,o=e.d,a=e.x,s=e.y,u=rU.normalize("ECPrivateKey"),l=n.makePoint(a,s),A=u.encode({version:i,privateKey:o,parameters:{type:"namedCurve",value:r.split(".")},publicKey:{unused:0,data:l}},"der").toString("base64");return n.formatPem(A,"EC PRIVATE")}},{key:"toPrivatePKCS8",value:function(e){var t=this.params,r=t.oid,i=t.algParameters,o=t.keyVersion,a=t.infoVersion,s=e.d,u=e.x,l=e.y,A=rU.normalize("PrivateKeyInfo"),c=rU.normalize("ECPrivateKey"),h=n.makePoint(u,l),f=c.encode({version:o,privateKey:s,publicKey:{unused:0,data:h}},"der"),d=A.encode({version:a,algorithm:{algorithm:r.split("."),parameters:Yo.from(i,"hex")},privateKey:f},"der").toString("base64");return n.formatPem(d,"PRIVATE")}},{key:"toPublicPKCS8",value:function(e){var t=this.params,r=t.oid,i=t.algParameters,o=e.x,a=e.y,s=rU.normalize("PublicKeyInfo"),u=n.makePoint(o,a),l=s.encode({algorithm:{algorithm:r.split("."),parameters:Yo.from(i,"hex")},publicKey:{unused:0,data:u}},"der").toString("base64");return n.formatPem(l,"PUBLIC")}},{key:"toPrivateBlk",value:function(e){return e.d.toString("hex")}},{key:"toPublicBlk",value:function(e){return nU.convert(n.makePoint(e.x,e.y),"raw","hex")}},{key:"toPrivateJwk",value:function(e){var t=this.params,n=t.crv,r=t.kty,i=e.d,o=e.x,a=e.y;return{kty:r,crv:n,d:nU.convert(i,"raw","base64url"),x:nU.convert(o,"raw","base64url"),y:nU.convert(a,"raw","base64url")}}},{key:"toPublicJwk",value:function(e){var t=this.params,n=t.crv,r=t.kty,i=e.x,o=e.y;return{kty:r,crv:n,x:nU.convert(i,"raw","base64url"),y:nU.convert(o,"raw","base64url")}}}],[{key:"getPoint",value:function(e){var t=e.slice(2,(e.length-2)/2+2),n=e.slice((e.length-2)/2+2);return{x:nU.convert(t,"hex","raw"),y:nU.convert(n,"hex","raw")}}},{key:"makePoint",value:function(e,t){var n=Yo.from("04","hex");return Yo.concat([n,e,t],n.length+e.length+t.length)}}]),n}(_F),oU=iU,aU=VP,sU=XP,uU=function(e){c(n,e);var t=b(n);function n(){return s(this,n),t.apply(this,arguments)}return l(n,[{key:"fromPrivatePKCS8",value:function(e){var t=sU.normalize("PrivateKeyInfo").decode(e,"der").privateKey.slice(2);return{d:t,x:this.publicKeyFromPrivate(t)}}},{key:"fromPublicPKCS8",value:function(e){var t=sU.normalize("PublicKeyInfo").decode(e,"der");return{x:aU.convert(t.publicKey.data,"hex","raw")}}},{key:"fromJwk",value:function(e){var t=e.d,n=e.x;return{d:aU.convert(t,"base64url","raw"),x:aU.convert(n,"base64url","raw")}}},{key:"toPrivatePKCS8",value:function(e){var t=this.params,r=t.oid,i=t.infoVersion,o=e.d,a=sU.normalize("PrivateKeyInfo"),s=this.privateKeyPadding(o),u=a.encode({version:i,algorithm:{algorithm:r.split(".")},privateKey:s},"der").toString("base64");return n.formatPem(u,"PRIVATE")}},{key:"toPublicPKCS8",value:function(e){var t=this.params.oid,r=e.x,i=sU.normalize("PublicKeyInfo").encode({algorithm:{algorithm:t.split(".")},publicKey:{unused:0,data:aU.convert(r,"hex","raw")}},"der").toString("base64");return n.formatPem(i,"PUBLIC")}},{key:"toPrivateJwk",value:function(e){var t=this.params,n=t.crv,r=t.kty,i=e.d,o=e.x;return{kty:r,crv:n,d:aU.convert(i,"raw","base64url"),x:aU.convert(o,"raw","base64url")}}},{key:"toPublicJwk",value:function(e){var t=this.params,n=t.crv,r=t.kty,i=e.x;return{kty:r,crv:n,x:aU.convert(i,"raw","base64url")}}},{key:"privateKeyPadding",value:function(e){var t;if("Ed25519"!==this.params.crv)throw new Error("".concat(this.params.crv," is an invalid curve for EdDSA"));return t=Yo.from("0420","hex"),Yo.concat([t,e],t.length+e.length)}},{key:"publicKeyFromPrivate",value:function(e){if("Ed25519"===this.params.crv){var t=new BI.eddsa("ed25519");return Yo.from(t.keyFromSecret(e).getPublic())}throw new Error("".concat(this.params.crv," is an invalid curve for EdDSA"))}}]),n}(_F),lU=eU,AU=oU,cU=uU,hU=new SF;hU.define([{kty:"RSA",oid:"1.2.840.113549.1.1.1",algParameters:"0500",version:"two-prime"}],lU),hU.define([{kty:"EC",crv:"K-256",oid:"1.2.840.10045.2.1",namedCurve:"1.3.132.0.10",algParameters:"06052b8104000a",keyVersion:1,infoVersion:"two-prime"},{kty:"EC",crv:"P-256",oid:"1.2.840.10045.2.1",namedCurve:"1.2.840.10045.3.1.7",algParameters:"06082a8648ce3d030107",keyVersion:1,infoVersion:"two-prime"},{kty:"EC",crv:"P-384",oid:"1.2.840.10045.2.1",namedCurve:"1.3.132.0.34",algParameters:"06052b81040022",keyVersion:1,infoVersion:"two-prime"},{kty:"EC",crv:"P-521",oid:"1.2.840.10045.2.1",namedCurve:"1.3.132.0.35",algParameters:"06052b81040023",keyVersion:1,infoVersion:"two-prime"}],AU),hU.define([{kty:"OKP",crv:"Ed25519",oid:"1.3.101.112",infoVersion:"two-prime"}],cU);var fU=xF,dU=kF,pU=hU,gU=XP,vU=RegExp("\r?\n","g"),yU=function(){function e(t,n){if(s(this,e),!t)throw new fU("key is required");if(!n)throw new fU("options are required");var r=n.kty,i=n.format,o=n.selector,a=n.crv,u=n.oid;if(!n.kty)throw new fU("options.kty is required");if(!n.format)throw new fU("options.format is required");if(!n.selector)throw new fU("options.selector is required");if(!n.crv&&!n.oid)throw new fU("options.crv or options.oid is required");this.kty=r,this.format=i,this.selector=o,this.crv=a,this.oid=u,this.key=this.parseKey(t)}return l(e,[{key:"alg",get:function(){var e=this.kty,t=this.crv,n=this.oid;if(!this.algorithm){if(t)Object.defineProperty(this,"algorithm",{value:pU.normalize(e,"crv",t)});else{if(!n)throw new Error("Both crv and oid are undefined");Object.defineProperty(this,"algorithm",{value:pU.normalize(e,"oid",n)})}if(!this.algorithm)throw new Error("".concat(this.crv||this.oid," is not implemented yet"))}return this.algorithm}},{key:"parseKey",value:function(e){var t=this.alg,n=this.format,r=this.selector;if("pem"===n)switch(r){case"public_pkcs1":return t.fromPublicPKCS1(e);case"public_pkcs8":return t.fromPublicPKCS8(e);case"private_pkcs1":return t.fromPrivatePKCS1(e);case"private_pkcs8":return t.fromPrivatePKCS8(e);default:throw new Error("Invalid selector value")}if("jwk"===n)return t.fromJwk(e,r);if("blk"===n)switch(r){case"public":return t.fromPublicBlk(e);case"private":return t.fromPrivateBlk(e)}}},{key:"toJwk",value:function(e){var t=this.key,n=this.alg,r=this.selector;switch(e){case"public":return n.toPublicJwk(t);case"private":if(r.includes("public"))throw new fU("Cannot export a private key from a public key");return n.toPrivateJwk(t);default:throw new Error("Invalid key selector")}}},{key:"toString",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"pem",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"public_pkcs8",n=this.key,r=this.alg,i=this.selector;if("pem"===e)switch(t){case"public_pkcs1":return r.toPublicPKCS1(n);case"public_pkcs8":return r.toPublicPKCS8(n);case"private_pkcs1":if(i.includes("public"))throw new fU("Cannot export a private key from a public key");return r.toPrivatePKCS1(n);case"private_pkcs8":if(i.includes("public"))throw new fU("Cannot export a private key from a public key");return r.toPrivatePKCS8(n);default:throw new Error("Invalid key selector")}else if("jwk"===e)switch(t){case"public":return JSON.stringify(r.toPublicJwk(n));case"private":if(i.includes("public"))throw new fU("Cannot export a private key from a public key");return JSON.stringify(r.toPrivateJwk(n));default:throw new Error("Invalid key selector")}else if("blk"===e)switch(t){case"private":if(i.includes("public"))throw new fU("Cannot export a private key from a public key");return r.toPrivateBlk(n);case"public":return r.toPublicBlk(n);default:throw new Error("Invalid key selector")}throw new dU}}],[{key:"from",value:function(t,n){if(!t)throw new fU("key is required");if(!n)throw new fU("format is required");if("jwk"===n){var r;if("string"==typeof t)try{r=JSON.parse(t)}catch(t){throw new fU("key is not a valid JWK")}else"object"==i(t)&&(r=t);var o,a=r,s=a.kty,u=a.crv;if(!s)throw new fU("kty is required for JWK");if("EC"===s&&!u)throw new fU("crv is required for EC JWK");"RSA"===s&&(o=pU.find((function(e){return e.kty===s})).oid);var l=r.d?"private":"public";return new e(r,{kty:s,crv:u,oid:o,format:n,selector:l})}if("pem"===n){if("string"!=typeof t)throw new fU("key is not a valid PEM string");var A=t.split(vU),c=A.splice(0,1);A.splice(A.length-1,1);var h,f,d=A.join(""),p=/^-----BEGIN ((RSA|EC) )?(PUBLIC|PRIVATE) KEY-----$/.exec(c),g=p?p[2]:void 0,v=p?p[3]:void 0,y=Yo.from(d,"base64");if(!v)throw new fU("key is not a valid PEM string");if(g){if("RSA"===g)v="PRIVATE"===v?"private_pkcs1":"public_pkcs1",h=pU.find((function(e){return e.kty===g})).oid;else if("EC"===g){var m;if("PRIVATE"===v)v="private_pkcs1",m=gU.normalize("".concat(g,"PrivateKey")).decode(y,"der");else if("PUBLIC"===v){v="public_pkcs1",m=gU.normalize("".concat(g,"PrivateKey")).decode(y,"der")}var w=m.parameters.value;f=pU.find((function(e){return e.namedCurve===w.join(".")})).crv}}else{var b,I=gU.normalize("PrivateKeyInfo"),B=gU.normalize("PublicKeyInfo");"PRIVATE"===v?(v="private_pkcs8",b=I.decode(y,"der")):"PUBLIC"===v&&(v="public_pkcs8",b=B.decode(y,"der"));var E=b.algorithm,C=E.algorithm,x=E.parameters;C=C.join("."),x=x?x.toString("hex"):void 0;var k=pU.find((function(e){return e.oid===C}));if(!(g=k?k.kty:void 0))throw new fU("".concat(C," is not supported"));"RSA"===g||"OKP"===g?h=C:"EC"===g&&(f=pU.find((function(e){return e.algParameters===x})).crv)}return new e(y,{kty:g,oid:h,crv:f,format:n,selector:v})}if("blk"===n)return new e(t,{kty:"EC",crv:"K-256",format:n,selector:t.length>64?"public":"private"});throw new fU("Invalid format ".concat(n))}}]),e}(),mU=yU,wU=qN("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),bU=Yo,IU={},BU={},EU={};Object.defineProperty(EU,"__esModule",{value:!0}),EU.testnet=EU.regtest=EU.bitcoin=void 0,EU.bitcoin={messagePrefix:"Bitcoin Signed Message:\n",bech32:"bc",bip32:{public:76067358,private:76066276},pubKeyHash:0,scriptHash:5,wif:128},EU.regtest={messagePrefix:"Bitcoin Signed Message:\n",bech32:"bcrt",bip32:{public:70617039,private:70615956},pubKeyHash:111,scriptHash:196,wif:239},EU.testnet={messagePrefix:"Bitcoin Signed Message:\n",bech32:"tb",bip32:{public:70617039,private:70615956},pubKeyHash:111,scriptHash:196,wif:239};var CU={},xU={},kU={},SU={};Object.defineProperty(SU,"__esModule",{value:!0}),SU.encode=SU.decode=SU.check=void 0,SU.check=function(e){if(e.length<8)return!1;if(e.length>72)return!1;if(48!==e[0])return!1;if(e[1]!==e.length-2)return!1;if(2!==e[2])return!1;var t=e[3];if(0===t)return!1;if(5+t>=e.length)return!1;if(2!==e[4+t])return!1;var n=e[5+t];return!(0===n||6+t+n!==e.length||128&e[4]||t>1&&0===e[4]&&!(128&e[5])||128&e[t+6]||n>1&&0===e[t+6]&&!(128&e[t+7]))},SU.decode=function(e){if(e.length<8)throw new Error("DER sequence length is too short");if(e.length>72)throw new Error("DER sequence length is too long");if(48!==e[0])throw new Error("Expected DER sequence");if(e[1]!==e.length-2)throw new Error("DER sequence length is invalid");if(2!==e[2])throw new Error("Expected DER integer");var t=e[3];if(0===t)throw new Error("R length is zero");if(5+t>=e.length)throw new Error("R length is too long");if(2!==e[4+t])throw new Error("Expected DER integer (2)");var n=e[5+t];if(0===n)throw new Error("S length is zero");if(6+t+n!==e.length)throw new Error("S length is invalid");if(128&e[4])throw new Error("R value is negative");if(t>1&&0===e[4]&&!(128&e[5]))throw new Error("R value excessively padded");if(128&e[t+6])throw new Error("S value is negative");if(n>1&&0===e[t+6]&&!(128&e[t+7]))throw new Error("S value excessively padded");return{r:e.slice(4,4+t),s:e.slice(6+t)}},SU.encode=function(e,t){var n=e.length,r=t.length;if(0===n)throw new Error("R length is zero");if(0===r)throw new Error("S length is zero");if(n>33)throw new Error("R length is too long");if(r>33)throw new Error("S length is too long");if(128&e[0])throw new Error("R value is negative");if(128&t[0])throw new Error("S value is negative");if(n>1&&0===e[0]&&!(128&e[1]))throw new Error("R value excessively padded");if(r>1&&0===t[0]&&!(128&t[1]))throw new Error("S value excessively padded");var i=Yo.allocUnsafe(6+n+r);return i[0]=48,i[1]=i.length-2,i[2]=2,i[3]=e.length,e.copy(i,4),i[4+n]=2,i[5+n]=t.length,t.copy(i,6+n),i};var QU={};Object.defineProperty(QU,"__esModule",{value:!0}),QU.REVERSE_OPS=QU.OPS=void 0;var _U={OP_FALSE:0,OP_0:0,OP_PUSHDATA1:76,OP_PUSHDATA2:77,OP_PUSHDATA4:78,OP_1NEGATE:79,OP_RESERVED:80,OP_TRUE:81,OP_1:81,OP_2:82,OP_3:83,OP_4:84,OP_5:85,OP_6:86,OP_7:87,OP_8:88,OP_9:89,OP_10:90,OP_11:91,OP_12:92,OP_13:93,OP_14:94,OP_15:95,OP_16:96,OP_NOP:97,OP_VER:98,OP_IF:99,OP_NOTIF:100,OP_VERIF:101,OP_VERNOTIF:102,OP_ELSE:103,OP_ENDIF:104,OP_VERIFY:105,OP_RETURN:106,OP_TOALTSTACK:107,OP_FROMALTSTACK:108,OP_2DROP:109,OP_2DUP:110,OP_3DUP:111,OP_2OVER:112,OP_2ROT:113,OP_2SWAP:114,OP_IFDUP:115,OP_DEPTH:116,OP_DROP:117,OP_DUP:118,OP_NIP:119,OP_OVER:120,OP_PICK:121,OP_ROLL:122,OP_ROT:123,OP_SWAP:124,OP_TUCK:125,OP_CAT:126,OP_SUBSTR:127,OP_LEFT:128,OP_RIGHT:129,OP_SIZE:130,OP_INVERT:131,OP_AND:132,OP_OR:133,OP_XOR:134,OP_EQUAL:135,OP_EQUALVERIFY:136,OP_RESERVED1:137,OP_RESERVED2:138,OP_1ADD:139,OP_1SUB:140,OP_2MUL:141,OP_2DIV:142,OP_NEGATE:143,OP_ABS:144,OP_NOT:145,OP_0NOTEQUAL:146,OP_ADD:147,OP_SUB:148,OP_MUL:149,OP_DIV:150,OP_MOD:151,OP_LSHIFT:152,OP_RSHIFT:153,OP_BOOLAND:154,OP_BOOLOR:155,OP_NUMEQUAL:156,OP_NUMEQUALVERIFY:157,OP_NUMNOTEQUAL:158,OP_LESSTHAN:159,OP_GREATERTHAN:160,OP_LESSTHANOREQUAL:161,OP_GREATERTHANOREQUAL:162,OP_MIN:163,OP_MAX:164,OP_WITHIN:165,OP_RIPEMD160:166,OP_SHA1:167,OP_SHA256:168,OP_HASH160:169,OP_HASH256:170,OP_CODESEPARATOR:171,OP_CHECKSIG:172,OP_CHECKSIGVERIFY:173,OP_CHECKMULTISIG:174,OP_CHECKMULTISIGVERIFY:175,OP_NOP1:176,OP_NOP2:177,OP_CHECKLOCKTIMEVERIFY:177,OP_NOP3:178,OP_CHECKSEQUENCEVERIFY:178,OP_NOP4:179,OP_NOP5:180,OP_NOP6:181,OP_NOP7:182,OP_NOP8:183,OP_NOP9:184,OP_NOP10:185,OP_PUBKEYHASH:253,OP_PUBKEY:254,OP_INVALIDOPCODE:255};QU.OPS=_U;var NU={};QU.REVERSE_OPS=NU;for(var DU=0,FU=Object.keys(_U);DU<FU.length;DU++){var PU=FU[DU];NU[_U[PU]]=PU}var UU={};Object.defineProperty(UU,"__esModule",{value:!0}),UU.decode=UU.encode=UU.encodingLength=void 0;var LU=QU;function MU(e){return e<LU.OPS.OP_PUSHDATA1?1:e<=255?2:e<=65535?3:5}UU.encodingLength=MU,UU.encode=function(e,t,n){var r=MU(t);return 1===r?e.writeUInt8(t,n):2===r?(e.writeUInt8(LU.OPS.OP_PUSHDATA1,n),e.writeUInt8(t,n+1)):3===r?(e.writeUInt8(LU.OPS.OP_PUSHDATA2,n),e.writeUInt16LE(t,n+1)):(e.writeUInt8(LU.OPS.OP_PUSHDATA4,n),e.writeUInt32LE(t,n+1)),r},UU.decode=function(e,t){var n,r,i=e.readUInt8(t);if(i<LU.OPS.OP_PUSHDATA1)n=i,r=1;else if(i===LU.OPS.OP_PUSHDATA1){if(t+2>e.length)return null;n=e.readUInt8(t+1),r=2}else if(i===LU.OPS.OP_PUSHDATA2){if(t+3>e.length)return null;n=e.readUInt16LE(t+1),r=3}else{if(t+5>e.length)return null;if(i!==LU.OPS.OP_PUSHDATA4)throw new Error("Unexpected opcode");n=e.readUInt32LE(t+1),r=5}return{opcode:i,number:n,size:r}};var TU={};Object.defineProperty(TU,"__esModule",{value:!0}),TU.encode=TU.decode=void 0,TU.decode=function(e,t,n){t=t||4,n=void 0===n||n;var r=e.length;if(0===r)return 0;if(r>t)throw new TypeError("Script number overflow");if(n&&0==(127&e[r-1])&&(r<=1||0==(128&e[r-2])))throw new Error("Non-minimally encoded script number");if(5===r){var i=e.readUInt32LE(0),o=e.readUInt8(4);return 128&o?-(4294967296*(-129&o)+i):4294967296*o+i}for(var a=0,s=0;s<r;++s)a|=e[s]<<8*s;return 128&e[r-1]?-(a&~(128<<8*(r-1))):a},TU.encode=function(e){for(var t,n=Math.abs(e),r=(t=n)>2147483647?5:t>8388607?4:t>32767?3:t>127?2:t>0?1:0,i=Yo.allocUnsafe(r),o=e<0,a=0;a<r;++a)i.writeUInt8(255&n,a),n>>=8;return 128&i[r-1]?i.writeUInt8(o?128:0,r-1):o&&(i[r-1]|=128),i};var RU={},OU={},HU={Array:function(e){function t(t){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(e){return null!=e&&e.constructor===Array})),Boolean:function(e){return"boolean"==typeof e},Function:function(e){return"function"==typeof e},Nil:function(e){return null==e},Number:function(e){return"number"==typeof e},Object:function(e){return"object"==i(e)},String:function(e){return"string"==typeof e},"":function(){return!0}};for(var KU in HU.Null=HU.Nil,HU)HU[KU].toJSON=function(e){return e}.bind(null,KU);var jU=HU,GU=jU;function qU(e){return e.name||e.toString().match(/function (.*?)\s*\(/)[1]}function VU(e){return GU.Nil(e)?"":qU(e.constructor)}function zU(e,t){Error.captureStackTrace&&Error.captureStackTrace(e,t)}function JU(e){return GU.Function(e)?e.toJSON?e.toJSON():qU(e):GU.Array(e)?"Array":e&&GU.Object(e)?"Object":void 0!==e?e:""}function YU(e,t,n){var r=function(e){return GU.Function(e)?"":GU.String(e)?JSON.stringify(e):e&&GU.Object(e)?"":e}(t);return"Expected "+JU(e)+", got"+(""!==n?" "+n:"")+(""!==r?" "+r:"")}function XU(e,t,n){n=n||VU(t),this.message=YU(e,t,n),zU(this,XU),this.__type=e,this.__value=t,this.__valueTypeName=n}function WU(e,t,n,r,i){e?(i=i||VU(r),this.message=function(e,t,n,r,i){var o='" of type ';return"key"===t&&(o='" with key type '),YU('property "'+JU(n)+o+JU(e),r,i)}(e,n,t,r,i)):this.message='Unexpected property "'+t+'"',zU(this,XU),this.__label=n,this.__property=t,this.__type=e,this.__value=r,this.__valueTypeName=i}XU.prototype=Object.create(Error.prototype),XU.prototype.constructor=XU,WU.prototype=Object.create(Error.prototype),WU.prototype.constructor=XU;var ZU={TfTypeError:XU,TfPropertyTypeError:WU,tfCustomError:function(e,t){return new XU(e,{},t)},tfSubError:function(e,t,n){return e instanceof WU?(t=t+"."+e.__property,e=new WU(e.__type,t,e.__label,e.__value,e.__valueTypeName)):e instanceof XU&&(e=new WU(e.__type,t,n,e.__value,e.__valueTypeName)),zU(e),e},tfJSON:JU,getValueTypeName:VU},$U=jU,eL=ZU;function tL(e){return Na(e)}function nL(e){return"string"==typeof e&&/^([0-9a-f]{2})+$/i.test(e)}function rL(e,t){var n=e.toJSON();function r(r){if(!e(r))return!1;if(r.length===t)return!0;throw eL.tfCustomError(n+"(Length: "+t+")",n+"(Length: "+r.length+")")}return r.toJSON=function(){return n},r}var iL=rL.bind(null,$U.Array),oL=rL.bind(null,tL),aL=rL.bind(null,nL),sL=rL.bind(null,$U.String),uL=Math.pow(2,53)-1,lL={ArrayN:iL,Buffer:tL,BufferN:oL,Finite:function(e){return"number"==typeof e&&isFinite(e)},Hex:nL,HexN:aL,Int8:function(e){return e<<24>>24===e},Int16:function(e){return e<<16>>16===e},Int32:function(e){return(0|e)===e},Int53:function(e){return"number"==typeof e&&e>=-uL&&e<=uL&&Math.floor(e)===e},Range:function(e,t,n){function r(r,i){return n(r,i)&&r>e&&r<t}return n=n||$U.Number,r.toJSON=function(){return"".concat(n.toJSON()," between [").concat(e,", ").concat(t,"]")},r},StringN:sL,UInt8:function(e){return(255&e)===e},UInt16:function(e){return(65535&e)===e},UInt32:function(e){return e>>>0===e},UInt53:function(e){return"number"==typeof e&&e>=0&&e<=uL&&Math.floor(e)===e}};for(var AL in lL)lL[AL].toJSON=function(e){return e}.bind(null,AL);var cL=lL,hL=jU,fL=ZU.tfJSON,dL=ZU.TfTypeError,pL=ZU.TfPropertyTypeError,gL=ZU.tfSubError,vL=ZU.getValueTypeName,yL={arrayOf:function(e,t){function n(n,r){return!!hL.Array(n)&&!hL.Nil(n)&&!(void 0!==t.minLength&&n.length<t.minLength)&&!(void 0!==t.maxLength&&n.length>t.maxLength)&&(void 0===t.length||n.length===t.length)&&n.every((function(t,n){try{return wL(e,t,r)}catch(e){throw gL(e,n)}}))}return e=mL(e),t=t||{},n.toJSON=function(){var n="["+fL(e)+"]";return void 0!==t.length?n+="{"+t.length+"}":void 0===t.minLength&&void 0===t.maxLength||(n+="{"+(void 0===t.minLength?0:t.minLength)+","+(void 0===t.maxLength?1/0:t.maxLength)+"}"),n},n},maybe:function e(t){function n(n,r){return hL.Nil(n)||t(n,r,e)}return t=mL(t),n.toJSON=function(){return"?"+fL(t)},n},map:function(e,t){function n(n,r){if(!hL.Object(n))return!1;if(hL.Nil(n))return!1;for(var i in n){try{t&&wL(t,i,r)}catch(e){throw gL(e,i,"key")}try{var o=n[i];wL(e,o,r)}catch(e){throw gL(e,i)}}return!0}return e=mL(e),t&&(t=mL(t)),n.toJSON=t?function(){return"{"+fL(t)+": "+fL(e)+"}"}:function(){return"{"+fL(e)+"}"},n},object:function(e){var t={};for(var n in e)t[n]=mL(e[n]);function r(e,n){if(!hL.Object(e))return!1;if(hL.Nil(e))return!1;var r;try{for(r in t)wL(t[r],e[r],n)}catch(e){throw gL(e,r)}if(n)for(r in e)if(!t[r])throw new pL(void 0,r);return!0}return r.toJSON=function(){return fL(t)},r},anyOf:function(){var e=[].slice.call(arguments).map(mL);function t(t,n){return e.some((function(e){try{return wL(e,t,n)}catch(e){return!1}}))}return t.toJSON=function(){return e.map(fL).join("|")},t},allOf:function(){var e=[].slice.call(arguments).map(mL);function t(t,n){return e.every((function(e){try{return wL(e,t,n)}catch(e){return!1}}))}return t.toJSON=function(){return e.map(fL).join(" & ")},t},quacksLike:function(e){function t(t){return e===vL(t)}return t.toJSON=function(){return e},t},tuple:function(){var e=[].slice.call(arguments).map(mL);function t(t,n){return!hL.Nil(t)&&!hL.Nil(t.length)&&(!n||t.length===e.length)&&e.every((function(e,r){try{return wL(e,t[r],n)}catch(e){throw gL(e,r)}}))}return t.toJSON=function(){return"("+e.map(fL).join(", ")+")"},t},value:function(e){function t(t){return t===e}return t.toJSON=function(){return e},t}};function mL(e){if(hL.String(e))return"?"===e[0]?yL.maybe(e.slice(1)):hL[e]||yL.quacksLike(e);if(e&&hL.Object(e)){if(hL.Array(e)){if(1!==e.length)throw new TypeError("Expected compile() parameter of type Array of length 1");return yL.arrayOf(e[0])}return yL.object(e)}return hL.Function(e)?e:yL.value(e)}function wL(e,t,n,r){if(hL.Function(e)){if(e(t,n))return!0;throw new dL(r||e,t)}return wL(mL(e),t,n)}for(var bL in yL.oneOf=yL.anyOf,hL)wL[bL]=hL[bL];for(bL in yL)wL[bL]=yL[bL];var IL=cL;for(bL in IL)wL[bL]=IL[bL];wL.compile=mL,wL.TfTypeError=dL,wL.TfPropertyTypeError=pL;var BL=wL;!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.oneOf=e.Null=e.BufferN=e.Function=e.UInt32=e.UInt8=e.tuple=e.maybe=e.Hex=e.Buffer=e.String=e.Boolean=e.Array=e.Number=e.Hash256bit=e.Hash160bit=e.Buffer256bit=e.Network=e.ECPoint=e.Satoshi=e.Signer=e.BIP32Path=e.UInt31=e.isPoint=e.typeforce=void 0;var t=Fa;e.typeforce=BL;var n=t.Buffer.alloc(32,0),r=t.Buffer.from("fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f","hex");e.isPoint=function(e){if(!t.Buffer.isBuffer(e))return!1;if(e.length<33)return!1;var i=e[0],o=e.slice(1,33);if(0===o.compare(n))return!1;if(o.compare(r)>=0)return!1;if((2===i||3===i)&&33===e.length)return!0;var a=e.slice(33);return 0!==a.compare(n)&&!(a.compare(r)>=0)&&4===i&&65===e.length};var i=Math.pow(2,31)-1;function o(t){return e.typeforce.String(t)&&!!t.match(/^(m\/)?(\d+'?\/)*\d+'?$/)}e.UInt31=function(t){return e.typeforce.UInt32(t)&&t<=i},e.BIP32Path=o,o.toJSON=function(){return"BIP32 derivation path"},e.Signer=function(t){return(e.typeforce.Buffer(t.publicKey)||"function"==typeof t.getPublicKey)&&"function"==typeof t.sign},e.Satoshi=function(t){return e.typeforce.UInt53(t)&&t<=21e14},e.ECPoint=e.typeforce.quacksLike("Point"),e.Network=e.typeforce.compile({messagePrefix:e.typeforce.oneOf(e.typeforce.Buffer,e.typeforce.String),bip32:{public:e.typeforce.UInt32,private:e.typeforce.UInt32},pubKeyHash:e.typeforce.UInt8,scriptHash:e.typeforce.UInt8,wif:e.typeforce.UInt8}),e.Buffer256bit=e.typeforce.BufferN(32),e.Hash160bit=e.typeforce.BufferN(20),e.Hash256bit=e.typeforce.BufferN(32),e.Number=e.typeforce.Number,e.Array=e.typeforce.Array,e.Boolean=e.typeforce.Boolean,e.String=e.typeforce.String,e.Buffer=e.typeforce.Buffer,e.Hex=e.typeforce.Hex,e.maybe=e.typeforce.maybe,e.tuple=e.typeforce.tuple,e.UInt8=e.typeforce.UInt8,e.UInt32=e.typeforce.UInt32,e.Function=e.typeforce.Function,e.BufferN=e.typeforce.BufferN,e.Null=e.typeforce.Null,e.oneOf=e.typeforce.oneOf}(OU),Object.defineProperty(RU,"__esModule",{value:!0}),RU.encode=RU.decode=void 0;var EL=SU,CL=OU,xL=CL.typeforce,kL=Yo.alloc(1,0);function SL(e){for(var t=0;0===e[t];)++t;return t===e.length?kL:128&(e=e.slice(t))[0]?Yo.concat([kL,e],1+e.length):e}function QL(e){0===e[0]&&(e=e.slice(1));var t=Yo.alloc(32,0),n=Math.max(0,32-e.length);return e.copy(t,n),t}RU.decode=function(e){var t=e.readUInt8(e.length-1),n=-129&t;if(n<=0||n>=4)throw new Error("Invalid hashType "+t);var r=EL.decode(e.slice(0,-1)),i=QL(r.r),o=QL(r.s);return{signature:Yo.concat([i,o],64),hashType:t}},RU.encode=function(e,t){xL({signature:CL.BufferN(64),hashType:CL.UInt8},{signature:e,hashType:t});var n=-129&t;if(n<=0||n>=4)throw new Error("Invalid hashType "+t);var r=Yo.allocUnsafe(1);r.writeUInt8(t,0);var i=SL(e.slice(0,32)),o=SL(e.slice(32,64));return Yo.concat([EL.encode(i,o),r])},function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.signature=e.number=e.isCanonicalScriptSignature=e.isDefinedHashType=e.isCanonicalPubKey=e.toStack=e.fromASM=e.toASM=e.decompile=e.compile=e.isPushOnly=e.OPS=void 0;var t=SU,n=QU;Object.defineProperty(e,"OPS",{enumerable:!0,get:function(){return n.OPS}});var r=UU,i=TU,o=RU,a=OU,s=a.typeforce,u=n.OPS.OP_RESERVED;function l(e){return a.Buffer(e)||function(e){return a.Number(e)&&(e===n.OPS.OP_0||e>=n.OPS.OP_1&&e<=n.OPS.OP_16||e===n.OPS.OP_1NEGATE)}(e)}function A(e){return a.Array(e)&&e.every(l)}function c(e){return 0===e.length?n.OPS.OP_0:1===e.length?e[0]>=1&&e[0]<=16?u+e[0]:129===e[0]?n.OPS.OP_1NEGATE:void 0:void 0}function h(e){return Na(e)}function f(e){return Na(e)}function d(e){if(h(e))return e;s(a.Array,e);var t=e.reduce((function(e,t){return f(t)?1===t.length&&void 0!==c(t)?e+1:e+r.encodingLength(t.length)+t.length:e+1}),0),n=Yo.allocUnsafe(t),i=0;if(e.forEach((function(e){if(f(e)){var t=c(e);if(void 0!==t)return n.writeUInt8(t,i),void(i+=1);i+=r.encode(n,e.length,i),e.copy(n,i),i+=e.length}else n.writeUInt8(e,i),i+=1})),i!==n.length)throw new Error("Could not decode chunks");return n}function p(e){if(t=e,a.Array(t))return e;var t;s(a.Buffer,e);for(var i=[],o=0;o<e.length;){var u=e[o];if(u>n.OPS.OP_0&&u<=n.OPS.OP_PUSHDATA4){var l=r.decode(e,o);if(null===l)return null;if((o+=l.size)+l.number>e.length)return null;var A=e.slice(o,o+l.number);o+=l.number;var h=c(A);void 0!==h?i.push(h):i.push(A)}else i.push(u),o+=1}return i}function g(e){var t=-129&e;return t>0&&t<4}e.isPushOnly=A,e.compile=d,e.decompile=p,e.toASM=function(e){return h(e)&&(e=p(e)),e.map((function(e){if(f(e)){var t=c(e);if(void 0===t)return e.toString("hex");e=t}return n.REVERSE_OPS[e]})).join(" ")},e.fromASM=function(e){return s(a.String,e),d(e.split(" ").map((function(e){return void 0!==n.OPS[e]?n.OPS[e]:(s(a.Hex,e),Yo.from(e,"hex"))})))},e.toStack=function(e){return e=p(e),s(A,e),e.map((function(e){return f(e)?e:e===n.OPS.OP_0?Yo.allocUnsafe(0):i.encode(e-u)}))},e.isCanonicalPubKey=function(e){return a.isPoint(e)},e.isDefinedHashType=g,e.isCanonicalScriptSignature=function(e){return!!Na(e)&&!!g(e[e.length-1])&&t.check(e.slice(0,-1))},e.number=i,e.signature=o}(kU);var _L={};Object.defineProperty(_L,"__esModule",{value:!0}),_L.value=_L.prop=void 0,_L.prop=function(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get:function(){var e=n.call(this);return this[t]=e,e},set:function(e){Object.defineProperty(this,t,{configurable:!0,enumerable:!0,value:e,writable:!0})}})},_L.value=function(e){var t;return function(){return void 0!==t||(t=e()),t}},Object.defineProperty(xU,"__esModule",{value:!0}),xU.p2data=void 0;var NL=EU,DL=kU,FL=OU,PL=_L,UL=DL.OPS;xU.p2data=function(e,t){if(!e.data&&!e.output)throw new TypeError("Not enough data");t=Object.assign({validate:!0},t||{}),(0,FL.typeforce)({network:FL.typeforce.maybe(FL.typeforce.Object),output:FL.typeforce.maybe(FL.typeforce.Buffer),data:FL.typeforce.maybe(FL.typeforce.arrayOf(FL.typeforce.Buffer))},e);var n={name:"embed",network:e.network||NL.bitcoin};if(PL.prop(n,"output",(function(){if(e.data)return DL.compile([UL.OP_RETURN].concat(e.data))})),PL.prop(n,"data",(function(){if(e.output)return DL.decompile(e.output).slice(1)})),t.validate&&e.output){var r=DL.decompile(e.output);if(r[0]!==UL.OP_RETURN)throw new TypeError("Output is invalid");if(!r.slice(1).every(FL.typeforce.Buffer))throw new TypeError("Output is invalid");if(e.data&&!function(e,t){return e.length===t.length&&e.every((function(e,n){return e.equals(t[n])}))}(e.data,n.data))throw new TypeError("Data mismatch")}return Object.assign(n,e)};var LL={};Object.defineProperty(LL,"__esModule",{value:!0}),LL.p2ms=void 0;var ML=EU,TL=kU,RL=OU,OL=_L,HL=TL.OPS,KL=HL.OP_RESERVED;function jL(e,t){return e.length===t.length&&e.every((function(e,n){return e.equals(t[n])}))}LL.p2ms=function(e,t){if(!(e.input||e.output||e.pubkeys&&void 0!==e.m||e.signatures))throw new TypeError("Not enough data");function n(e){return TL.isCanonicalScriptSignature(e)||void 0!==(t.allowIncomplete&&e===HL.OP_0)}t=Object.assign({validate:!0},t||{}),(0,RL.typeforce)({network:RL.typeforce.maybe(RL.typeforce.Object),m:RL.typeforce.maybe(RL.typeforce.Number),n:RL.typeforce.maybe(RL.typeforce.Number),output:RL.typeforce.maybe(RL.typeforce.Buffer),pubkeys:RL.typeforce.maybe(RL.typeforce.arrayOf(RL.isPoint)),signatures:RL.typeforce.maybe(RL.typeforce.arrayOf(n)),input:RL.typeforce.maybe(RL.typeforce.Buffer)},e);var r={network:e.network||ML.bitcoin},i=[],o=!1;function a(e){o||(o=!0,i=TL.decompile(e),r.m=i[0]-KL,r.n=i[i.length-2]-KL,r.pubkeys=i.slice(1,-2))}if(OL.prop(r,"output",(function(){if(e.m&&r.n&&e.pubkeys)return TL.compile([].concat(KL+e.m,e.pubkeys,KL+r.n,HL.OP_CHECKMULTISIG))})),OL.prop(r,"m",(function(){if(r.output)return a(r.output),r.m})),OL.prop(r,"n",(function(){if(r.pubkeys)return r.pubkeys.length})),OL.prop(r,"pubkeys",(function(){if(e.output)return a(e.output),r.pubkeys})),OL.prop(r,"signatures",(function(){if(e.input)return TL.decompile(e.input).slice(1)})),OL.prop(r,"input",(function(){if(e.signatures)return TL.compile([HL.OP_0].concat(e.signatures))})),OL.prop(r,"witness",(function(){if(r.input)return[]})),OL.prop(r,"name",(function(){if(r.m&&r.n)return"p2ms(".concat(r.m," of ").concat(r.n,")")})),t.validate){if(e.output){if(a(e.output),!RL.typeforce.Number(i[0]))throw new TypeError("Output is invalid");if(!RL.typeforce.Number(i[i.length-2]))throw new TypeError("Output is invalid");if(i[i.length-1]!==HL.OP_CHECKMULTISIG)throw new TypeError("Output is invalid");if(r.m<=0||r.n>16||r.m>r.n||r.n!==i.length-3)throw new TypeError("Output is invalid");if(!r.pubkeys.every((function(e){return(0,RL.isPoint)(e)})))throw new TypeError("Output is invalid");if(void 0!==e.m&&e.m!==r.m)throw new TypeError("m mismatch");if(void 0!==e.n&&e.n!==r.n)throw new TypeError("n mismatch");if(e.pubkeys&&!jL(e.pubkeys,r.pubkeys))throw new TypeError("Pubkeys mismatch")}if(e.pubkeys){if(void 0!==e.n&&e.n!==e.pubkeys.length)throw new TypeError("Pubkey count mismatch");if(r.n=e.pubkeys.length,r.n<r.m)throw new TypeError("Pubkey count cannot be less than m")}if(e.signatures){if(e.signatures.length<r.m)throw new TypeError("Not enough signatures provided");if(e.signatures.length>r.m)throw new TypeError("Too many signatures provided")}if(e.input){if(e.input[0]!==HL.OP_0)throw new TypeError("Input is invalid");if(0===r.signatures.length||!r.signatures.every(n))throw new TypeError("Input has invalid signature(s)");if(e.signatures&&!jL(e.signatures,r.signatures))throw new TypeError("Signature mismatch");if(void 0!==e.m&&e.m!==e.signatures.length)throw new TypeError("Signature count mismatch")}}return Object.assign(r,e)};var GL={};Object.defineProperty(GL,"__esModule",{value:!0}),GL.p2pk=void 0;var qL=EU,VL=kU,zL=OU,JL=_L,YL=VL.OPS;GL.p2pk=function(e,t){if(!(e.input||e.output||e.pubkey||e.input||e.signature))throw new TypeError("Not enough data");t=Object.assign({validate:!0},t||{}),(0,zL.typeforce)({network:zL.typeforce.maybe(zL.typeforce.Object),output:zL.typeforce.maybe(zL.typeforce.Buffer),pubkey:zL.typeforce.maybe(zL.isPoint),signature:zL.typeforce.maybe(VL.isCanonicalScriptSignature),input:zL.typeforce.maybe(zL.typeforce.Buffer)},e);var n=JL.value((function(){return VL.decompile(e.input)})),r={name:"p2pk",network:e.network||qL.bitcoin};if(JL.prop(r,"output",(function(){if(e.pubkey)return VL.compile([e.pubkey,YL.OP_CHECKSIG])})),JL.prop(r,"pubkey",(function(){if(e.output)return e.output.slice(1,-1)})),JL.prop(r,"signature",(function(){if(e.input)return n()[0]})),JL.prop(r,"input",(function(){if(e.signature)return VL.compile([e.signature])})),JL.prop(r,"witness",(function(){if(r.input)return[]})),t.validate){if(e.output){if(e.output[e.output.length-1]!==YL.OP_CHECKSIG)throw new TypeError("Output is invalid");if(!(0,zL.isPoint)(r.pubkey))throw new TypeError("Output pubkey is invalid");if(e.pubkey&&!e.pubkey.equals(r.pubkey))throw new TypeError("Pubkey mismatch")}if(e.signature&&e.input&&!e.input.equals(r.input))throw new TypeError("Signature mismatch");if(e.input){if(1!==n().length)throw new TypeError("Input is invalid");if(!VL.isCanonicalScriptSignature(r.signature))throw new TypeError("Input has invalid signature")}}return Object.assign(r,e)};var XL={},WL={},ZL={exports:{}},$L={},eM=Do(eh),tM=eM.EventEmitter;function nM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function rM(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var iM=Fa.Buffer,oM=sb.inspect,aM=oM&&oM.custom||"inspect";function sM(e,t,n){iM.prototype.copy.call(e,t,n)}var uM=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}var t;return t=[{key:"push",value:function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,n=""+t.data;t=t.next;)n+=e+t.data;return n}},{key:"concat",value:function(e){if(0===this.length)return iM.alloc(0);for(var t=iM.allocUnsafe(e>>>0),n=this.head,r=0;n;)sM(n.data,t,r),r+=n.data.length,n=n.next;return t}},{key:"consume",value:function(e,t){var n;return e<this.head.data.length?(n=this.head.data.slice(0,e),this.head.data=this.head.data.slice(e)):n=e===this.head.data.length?this.shift():t?this._getString(e):this._getBuffer(e),n}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(e){var t=this.head,n=1,r=t.data;for(e-=r.length;t=t.next;){var i=t.data,o=e>i.length?i.length:e;if(o===i.length?r+=i:r+=i.slice(0,e),0==(e-=o)){o===i.length?(++n,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=i.slice(o));break}++n}return this.length-=n,r}},{key:"_getBuffer",value:function(e){var t=iM.allocUnsafe(e),n=this.head,r=1;for(n.data.copy(t),e-=n.data.length;n=n.next;){var i=n.data,o=e>i.length?i.length:e;if(i.copy(t,t.length-e,0,o),0==(e-=o)){o===i.length?(++r,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=i.slice(o));break}++r}return this.length-=r,t}},{key:aM,value:function(e,t){return oM(this,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?nM(Object(n),!0).forEach((function(t){rM(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nM(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},t,{depth:0,customInspect:!1}))}}],t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}();function lM(e,t){cM(e,t),AM(e)}function AM(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function cM(e,t){e.emit("error",t)}var hM={destroy:function(e,t){var n=this,r=this._readableState&&this._readableState.destroyed,i=this._writableState&&this._writableState.destroyed;return r||i?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,Xl(cM,this,e)):Xl(cM,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,(function(e){!t&&e?n._writableState?n._writableState.errorEmitted?Xl(AM,n):(n._writableState.errorEmitted=!0,Xl(lM,n,e)):Xl(lM,n,e):t?(Xl(AM,n),t(e)):Xl(AM,n)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(e,t){var n=e._readableState,r=e._writableState;n&&n.autoDestroy||r&&r.autoDestroy?e.destroy(t):e.emit("error",t)}},fM={},dM={};function pM(e,t,n){n||(n=Error);var r=function(e){var n,r;function i(n,r,i){return e.call(this,function(e,n,r){return"string"==typeof t?t:t(e,n,r)}(n,r,i))||this}return r=e,(n=i).prototype=Object.create(r.prototype),n.prototype.constructor=n,n.__proto__=r,i}(n);r.prototype.name=n.name,r.prototype.code=e,dM[e]=r}function gM(e,t){if(Array.isArray(e)){var n=e.length;return e=e.map((function(e){return String(e)})),n>2?"one of ".concat(t," ").concat(e.slice(0,n-1).join(", "),", or ")+e[n-1]:2===n?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}pM("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),pM("ERR_INVALID_ARG_TYPE",(function(e,t,n){var r,o,a;if("string"==typeof t&&(o="not ",t.substr(0,o.length)===o)?(r="must not be",t=t.replace(/^not /,"")):r="must be",function(e,t,n){return(void 0===n||n>e.length)&&(n=e.length),e.substring(n-t.length,n)===t}(e," argument"))a="The ".concat(e," ").concat(r," ").concat(gM(t,"type"));else{var s=function(e,t,n){return"number"!=typeof n&&(n=0),!(n+".".length>e.length)&&-1!==e.indexOf(".",n)}(e)?"property":"argument";a='The "'.concat(e,'" ').concat(s," ").concat(r," ").concat(gM(t,"type"))}return a+". Received type ".concat(i(n))}),TypeError),pM("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),pM("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),pM("ERR_STREAM_PREMATURE_CLOSE","Premature close"),pM("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),pM("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),pM("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),pM("ERR_STREAM_WRITE_AFTER_END","write after end"),pM("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),pM("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),pM("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),fM.codes=dM;var vM=fM.codes.ERR_INVALID_OPT_VALUE,yM=function(e,t,n,r){var i=function(e,t,n){return null!=e.highWaterMark?e.highWaterMark:t?e[n]:null}(t,r,n);if(null!=i){if(!isFinite(i)||Math.floor(i)!==i||i<0)throw new vM(r?n:"highWaterMark",i);return Math.floor(i)}return e.objectMode?16:16384},mM={},wM=jN.exports.Buffer,bM=wM.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function IM(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(wM.isEncoding===bM||!bM(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=CM,this.end=xM,t=4;break;case"utf8":this.fillLast=EM,t=4;break;case"base64":this.text=kM,this.end=SM,t=3;break;default:return this.write=QM,void(this.end=_M)}this.lastNeed=0,this.lastTotal=0,this.lastChar=wM.allocUnsafe(t)}function BM(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function EM(e){var t=this.lastTotal-this.lastNeed,n=function(e,t,n){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==n?n:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function CM(e,t){if((e.length-t)%2==0){var n=e.toString("utf16le",t);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function xM(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,n)}return t}function kM(e,t){var n=(e.length-t)%3;return 0===n?e.toString("base64",t):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-n))}function SM(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function QM(e){return e.toString(this.encoding)}function _M(e){return e&&e.length?this.write(e):""}mM.StringDecoder=IM,IM.prototype.write=function(e){if(0===e.length)return"";var t,n;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n<e.length?t?t+this.text(e,n):this.text(e,n):t||""},IM.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},IM.prototype.text=function(e,t){var n=function(e,t,n){var r=t.length-1;if(r<n)return 0;var i=BM(t[r]);return i>=0?(i>0&&(e.lastNeed=i-1),i):--r<n||-2===i?0:(i=BM(t[r]))>=0?(i>0&&(e.lastNeed=i-2),i):--r<n||-2===i?0:(i=BM(t[r]))>=0?(i>0&&(2===i?i=0:e.lastNeed=i-3),i):0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=n;var r=e.length-(n-this.lastNeed);return e.copy(this.lastChar,0,r),e.toString("utf8",t,r)},IM.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length};var NM=fM.codes.ERR_STREAM_PREMATURE_CLOSE;function DM(){}var FM,PM=function e(t,n,r){if("function"==typeof n)return e(t,null,n);n||(n={}),r=function(e){var t=!1;return function(){if(!t){t=!0;for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];e.apply(this,r)}}}(r||DM);var i=n.readable||!1!==n.readable&&t.readable,o=n.writable||!1!==n.writable&&t.writable,a=function(){t.writable||u()},s=t._writableState&&t._writableState.finished,u=function(){o=!1,s=!0,i||r.call(t)},l=t._readableState&&t._readableState.endEmitted,A=function(){i=!1,l=!0,o||r.call(t)},c=function(e){r.call(t,e)},h=function(){var e;return i&&!l?(t._readableState&&t._readableState.ended||(e=new NM),r.call(t,e)):o&&!s?(t._writableState&&t._writableState.ended||(e=new NM),r.call(t,e)):void 0},f=function(){t.req.on("finish",u)};return function(e){return e.setHeader&&"function"==typeof e.abort}(t)?(t.on("complete",u),t.on("abort",h),t.req?f():t.on("request",f)):o&&!t._writableState&&(t.on("end",a),t.on("close",a)),t.on("end",A),t.on("finish",u),!1!==n.error&&t.on("error",c),t.on("close",h),function(){t.removeListener("complete",u),t.removeListener("abort",h),t.removeListener("request",f),t.req&&t.req.removeListener("finish",u),t.removeListener("end",a),t.removeListener("close",a),t.removeListener("finish",u),t.removeListener("end",A),t.removeListener("error",c),t.removeListener("close",h)}};function UM(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var LM=PM,MM=Symbol("lastResolve"),TM=Symbol("lastReject"),RM=Symbol("error"),OM=Symbol("ended"),HM=Symbol("lastPromise"),KM=Symbol("handlePromise"),jM=Symbol("stream");function GM(e,t){return{value:e,done:t}}function qM(e){var t=e[MM];if(null!==t){var n=e[jM].read();null!==n&&(e[HM]=null,e[MM]=null,e[TM]=null,t(GM(n,!1)))}}function VM(e){Xl(qM,e)}var zM=Object.getPrototypeOf((function(){})),JM=Object.setPrototypeOf((FM={get stream(){return this[jM]},next:function(){var e=this,t=this[RM];if(null!==t)return Promise.reject(t);if(this[OM])return Promise.resolve(GM(void 0,!0));if(this[jM].destroyed)return new Promise((function(t,n){Xl((function(){e[RM]?n(e[RM]):t(GM(void 0,!0))}))}));var n,r=this[HM];if(r)n=new Promise(function(e,t){return function(n,r){e.then((function(){t[OM]?n(GM(void 0,!0)):t[KM](n,r)}),r)}}(r,this));else{var i=this[jM].read();if(null!==i)return Promise.resolve(GM(i,!1));n=new Promise(this[KM])}return this[HM]=n,n}},UM(FM,Symbol.asyncIterator,(function(){return this})),UM(FM,"return",(function(){var e=this;return new Promise((function(t,n){e[jM].destroy(null,(function(e){e?n(e):t(GM(void 0,!0))}))}))})),FM),zM),YM=function(e){var t,n=Object.create(JM,(UM(t={},jM,{value:e,writable:!0}),UM(t,MM,{value:null,writable:!0}),UM(t,TM,{value:null,writable:!0}),UM(t,RM,{value:null,writable:!0}),UM(t,OM,{value:e._readableState.endEmitted,writable:!0}),UM(t,KM,{value:function(e,t){var r=n[jM].read();r?(n[HM]=null,n[MM]=null,n[TM]=null,e(GM(r,!1))):(n[MM]=e,n[TM]=t)},writable:!0}),t));return n[HM]=null,LM(e,(function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=n[TM];return null!==t&&(n[HM]=null,n[MM]=null,n[TM]=null,t(e)),void(n[RM]=e)}var r=n[MM];null!==r&&(n[HM]=null,n[MM]=null,n[TM]=null,r(GM(void 0,!0))),n[OM]=!0})),e.on("readable",VM.bind(null,n)),n},XM=function(){throw new Error("Readable.from is not available in the browser")},WM=$L;WM.Readable=yT,yT.ReadableState=vT,eM.EventEmitter;var ZM,$M=function(e,t){return e.listeners(t).length},eT=tM,tT=Fa.Buffer,nT=No.Uint8Array||function(){},rT=sb;ZM=rT&&rT.debuglog?rT.debuglog("stream"):function(){};var iT,oT,aT,sT=uM,uT=hM,lT=yM,AT=fM.codes,cT=AT.ERR_INVALID_ARG_TYPE,hT=AT.ERR_STREAM_PUSH_AFTER_EOF,fT=AT.ERR_METHOD_NOT_IMPLEMENTED,dT=AT.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;KI.exports(yT,eT);var pT=uT.errorOrDestroy,gT=["error","close","destroy","pause","resume"];function vT(e,t,n){e=e||{},"boolean"!=typeof n&&(n=t instanceof WM.Duplex),this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=lT(this,e,"readableHighWaterMark",n),this.buffer=new sT,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(iT||(iT=mM.StringDecoder),this.decoder=new iT(e.encoding),this.encoding=e.encoding)}function yT(e){if(!(this instanceof yT))return new yT(e);var t=this instanceof WM.Duplex;this._readableState=new vT(e,this,t),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),eT.call(this)}function mT(e,t,n,r,i){ZM("readableAddChunk",t);var o,a=e._readableState;if(null===t)a.reading=!1,function(e,t){if(ZM("onEofChunk"),!t.ended){if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,t.sync?IT(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,BT(e)))}}(e,a);else if(i||(o=function(e,t){var n,r;return r=t,tT.isBuffer(r)||r instanceof nT||"string"==typeof t||void 0===t||e.objectMode||(n=new cT("chunk",["string","Buffer","Uint8Array"],t)),n}(a,t)),o)pT(e,o);else if(a.objectMode||t&&t.length>0)if("string"==typeof t||a.objectMode||Object.getPrototypeOf(t)===tT.prototype||(t=function(e){return tT.from(e)}(t)),r)a.endEmitted?pT(e,new dT):wT(e,a,t,!0);else if(a.ended)pT(e,new hT);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!n?(t=a.decoder.write(t),a.objectMode||0!==t.length?wT(e,a,t,!1):ET(e,a)):wT(e,a,t,!1)}else r||(a.reading=!1,ET(e,a));return!a.ended&&(a.length<a.highWaterMark||0===a.length)}function wT(e,t,n,r){t.flowing&&0===t.length&&!t.sync?(t.awaitDrain=0,e.emit("data",n)):(t.length+=t.objectMode?1:n.length,r?t.buffer.unshift(n):t.buffer.push(n),t.needReadable&&IT(e)),ET(e,t)}function bT(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=1073741824?e=1073741824:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function IT(e){var t=e._readableState;ZM("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(ZM("emitReadable",t.flowing),t.emittedReadable=!0,Xl(BT,e))}function BT(e){var t=e._readableState;ZM("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,QT(e)}function ET(e,t){t.readingMore||(t.readingMore=!0,Xl(CT,e,t))}function CT(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){var n=t.length;if(ZM("maybeReadMore read 0"),e.read(0),n===t.length)break}t.readingMore=!1}function xT(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function kT(e){ZM("readable nexttick read 0"),e.read(0)}function ST(e,t){ZM("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),QT(e),t.flowing&&!t.reading&&e.read(0)}function QT(e){var t=e._readableState;for(ZM("flow",t.flowing);t.flowing&&null!==e.read(););}function _T(e,t){return 0===t.length?null:(t.objectMode?n=t.buffer.shift():!e||e>=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):n=t.buffer.consume(e,t.decoder),n);var n}function NT(e){var t=e._readableState;ZM("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,Xl(DT,t,e))}function DT(e,t){if(ZM("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var n=t._writableState;(!n||n.autoDestroy&&n.finished)&&t.destroy()}}function FT(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}Object.defineProperty(yT.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),yT.prototype.destroy=uT.destroy,yT.prototype._undestroy=uT.undestroy,yT.prototype._destroy=function(e,t){t(e)},yT.prototype.push=function(e,t){var n,r=this._readableState;return r.objectMode?n=!0:"string"==typeof e&&((t=t||r.defaultEncoding)!==r.encoding&&(e=tT.from(e,t),t=""),n=!0),mT(this,e,t,!1,n)},yT.prototype.unshift=function(e){return mT(this,e,null,!0,!1)},yT.prototype.isPaused=function(){return!1===this._readableState.flowing},yT.prototype.setEncoding=function(e){iT||(iT=mM.StringDecoder);var t=new iT(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var n=this._readableState.buffer.head,r="";null!==n;)r+=t.write(n.data),n=n.next;return this._readableState.buffer.clear(),""!==r&&this._readableState.buffer.push(r),this._readableState.length=r.length,this},yT.prototype.read=function(e){ZM("read",e),e=parseInt(e,10);var t=this._readableState,n=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:t.length>0)||t.ended))return ZM("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?NT(this):IT(this),null;if(0===(e=bT(e,t))&&t.ended)return 0===t.length&&NT(this),null;var r,i=t.needReadable;return ZM("need readable",i),(0===t.length||t.length-e<t.highWaterMark)&&ZM("length less than watermark",i=!0),t.ended||t.reading?ZM("reading or ended",i=!1):i&&(ZM("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=bT(n,t))),null===(r=e>0?_T(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&NT(this)),null!==r&&this.emit("data",r),r},yT.prototype._read=function(e){pT(this,new fT("_read()"))},yT.prototype.pipe=function(e,t){var n=this,r=this._readableState;switch(r.pipesCount){case 0:r.pipes=e;break;case 1:r.pipes=[r.pipes,e];break;default:r.pipes.push(e)}r.pipesCount+=1,ZM("pipe count=%d opts=%j",r.pipesCount,t);var i=t&&!1===t.end||e===lA.stdout||e===lA.stderr?h:o;function o(){ZM("onend"),e.end()}r.endEmitted?Xl(i):n.once("end",i),e.on("unpipe",(function t(i,f){ZM("onunpipe"),i===n&&f&&!1===f.hasUnpiped&&(f.hasUnpiped=!0,ZM("cleanup"),e.removeListener("close",A),e.removeListener("finish",c),e.removeListener("drain",a),e.removeListener("error",l),e.removeListener("unpipe",t),n.removeListener("end",o),n.removeListener("end",h),n.removeListener("data",u),s=!0,!r.awaitDrain||e._writableState&&!e._writableState.needDrain||a())}));var a=function(e){return function(){var t=e._readableState;ZM("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&$M(e,"data")&&(t.flowing=!0,QT(e))}}(n);e.on("drain",a);var s=!1;function u(t){ZM("ondata");var i=e.write(t);ZM("dest.write",i),!1===i&&((1===r.pipesCount&&r.pipes===e||r.pipesCount>1&&-1!==FT(r.pipes,e))&&!s&&(ZM("false write response, pause",r.awaitDrain),r.awaitDrain++),n.pause())}function l(t){ZM("onerror",t),h(),e.removeListener("error",l),0===$M(e,"error")&&pT(e,t)}function A(){e.removeListener("finish",c),h()}function c(){ZM("onfinish"),e.removeListener("close",A),h()}function h(){ZM("unpipe"),n.unpipe(e)}return n.on("data",u),function(e,t,n){if("function"==typeof e.prependListener)return e.prependListener(t,n);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}(e,"error",l),e.once("close",A),e.once("finish",c),e.emit("pipe",n),r.flowing||(ZM("pipe resume"),n.resume()),e},yT.prototype.unpipe=function(e){var t=this._readableState,n={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,n)),this;if(!e){var r=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o<i;o++)r[o].emit("unpipe",this,{hasUnpiped:!1});return this}var a=FT(t.pipes,e);return-1===a||(t.pipes.splice(a,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,n)),this},yT.prototype.on=function(e,t){var n=eT.prototype.on.call(this,e,t),r=this._readableState;return"data"===e?(r.readableListening=this.listenerCount("readable")>0,!1!==r.flowing&&this.resume()):"readable"===e&&(r.endEmitted||r.readableListening||(r.readableListening=r.needReadable=!0,r.flowing=!1,r.emittedReadable=!1,ZM("on readable",r.length,r.reading),r.length?IT(this):r.reading||Xl(kT,this))),n},yT.prototype.addListener=yT.prototype.on,yT.prototype.removeListener=function(e,t){var n=eT.prototype.removeListener.call(this,e,t);return"readable"===e&&Xl(xT,this),n},yT.prototype.removeAllListeners=function(e){var t=eT.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||Xl(xT,this),t},yT.prototype.resume=function(){var e=this._readableState;return e.flowing||(ZM("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,Xl(ST,e,t))}(this,e)),e.paused=!1,this},yT.prototype.pause=function(){return ZM("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(ZM("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},yT.prototype.wrap=function(e){var t=this,n=this._readableState,r=!1;for(var i in e.on("end",(function(){if(ZM("wrapped end"),n.decoder&&!n.ended){var e=n.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(i){ZM("wrapped data"),n.decoder&&(i=n.decoder.write(i)),n.objectMode&&null==i||(n.objectMode||i&&i.length)&&(t.push(i)||(r=!0,e.pause()))})),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var o=0;o<gT.length;o++)e.on(gT[o],this.emit.bind(this,gT[o]));return this._read=function(t){ZM("wrapped _read",t),r&&(r=!1,e.resume())},this},"function"==typeof Symbol&&(yT.prototype[Symbol.asyncIterator]=function(){return void 0===oT&&(oT=YM),oT(this)}),Object.defineProperty(yT.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(yT.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(yT.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),yT._fromList=_T,Object.defineProperty(yT.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(yT.from=function(e,t){return void 0===aT&&(aT=XM),aT(yT,e,t)});function PT(e){try{if(!No.localStorage)return!1}catch(e){return!1}var t=No.localStorage[e];return null!=t&&"true"===String(t).toLowerCase()}var UT=$L;function LT(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,n){var r=e.entry;for(e.entry=null;r;){var i=r.callback;t.pendingcb--,i(undefined),r=r.next}t.corkedRequestsFree.next=e}(t,e)}}UT.Writable=nR,nR.WritableState=tR;var MT,TT=function(e,t){if(PT("noDeprecation"))return e;var n=!1;return function(){if(!n){if(PT("throwDeprecation"))throw new Error(t);PT("traceDeprecation")?console.trace(t):console.warn(t),n=!0}return e.apply(this,arguments)}},RT=tM,OT=Fa.Buffer,HT=No.Uint8Array||function(){},KT=hM,jT=yM,GT=fM.codes,qT=GT.ERR_INVALID_ARG_TYPE,VT=GT.ERR_METHOD_NOT_IMPLEMENTED,zT=GT.ERR_MULTIPLE_CALLBACK,JT=GT.ERR_STREAM_CANNOT_PIPE,YT=GT.ERR_STREAM_DESTROYED,XT=GT.ERR_STREAM_NULL_VALUES,WT=GT.ERR_STREAM_WRITE_AFTER_END,ZT=GT.ERR_UNKNOWN_ENCODING,$T=KT.errorOrDestroy;function eR(){}function tR(e,t,n){e=e||{},"boolean"!=typeof n&&(n=t instanceof UT.Duplex),this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=jT(this,e,"writableHighWaterMark",n),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var r=!1===e.decodeStrings;this.decodeStrings=!r,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var n=e._writableState,r=n.sync,i=n.writecb;if("function"!=typeof i)throw new zT;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(n),t)!function(e,t,n,r,i){--t.pendingcb,n?(Xl(i,r),Xl(uR,e,t),e._writableState.errorEmitted=!0,$T(e,r)):(i(r),e._writableState.errorEmitted=!0,$T(e,r),uR(e,t))}(e,n,r,t,i);else{var o=aR(n)||e.destroyed;o||n.corked||n.bufferProcessing||!n.bufferedRequest||oR(e,n),r?Xl(iR,e,n,o,i):iR(e,n,o,i)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new LT(this)}function nR(e){var t=this instanceof UT.Duplex;if(!t&&!MT.call(nR,this))return new nR(e);this._writableState=new tR(e,this,t),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),RT.call(this)}function rR(e,t,n,r,i,o,a){t.writelen=r,t.writecb=a,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new YT("write")):n?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function iR(e,t,n,r){n||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,r(),uR(e,t)}function oR(e,t){t.bufferProcessing=!0;var n=t.bufferedRequest;if(e._writev&&n&&n.next){var r=t.bufferedRequestCount,i=new Array(r),o=t.corkedRequestsFree;o.entry=n;for(var a=0,s=!0;n;)i[a]=n,n.isBuf||(s=!1),n=n.next,a+=1;i.allBuffers=s,rR(e,t,!0,t.length,i,"",o.finish),t.pendingcb++,t.lastBufferedRequest=null,o.next?(t.corkedRequestsFree=o.next,o.next=null):t.corkedRequestsFree=new LT(t),t.bufferedRequestCount=0}else{for(;n;){var u=n.chunk,l=n.encoding,A=n.callback;if(rR(e,t,!1,t.objectMode?1:u.length,u,l,A),n=n.next,t.bufferedRequestCount--,t.writing)break}null===n&&(t.lastBufferedRequest=null)}t.bufferedRequest=n,t.bufferProcessing=!1}function aR(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function sR(e,t){e._final((function(n){t.pendingcb--,n&&$T(e,n),t.prefinished=!0,e.emit("prefinish"),uR(e,t)}))}function uR(e,t){var n=aR(t);if(n&&(function(e,t){t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.pendingcb++,t.finalCalled=!0,Xl(sR,e,t)))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var r=e._readableState;(!r||r.autoDestroy&&r.endEmitted)&&e.destroy()}return n}KI.exports(nR,RT),tR.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(tR.prototype,"buffer",{get:TT((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(MT=Function.prototype[Symbol.hasInstance],Object.defineProperty(nR,Symbol.hasInstance,{value:function(e){return!!MT.call(this,e)||this===nR&&e&&e._writableState instanceof tR}})):MT=function(e){return e instanceof this},nR.prototype.pipe=function(){$T(this,new JT)},nR.prototype.write=function(e,t,n){var r,i=this._writableState,o=!1,a=!i.objectMode&&(r=e,OT.isBuffer(r)||r instanceof HT);return a&&!OT.isBuffer(e)&&(e=function(e){return OT.from(e)}(e)),"function"==typeof t&&(n=t,t=null),a?t="buffer":t||(t=i.defaultEncoding),"function"!=typeof n&&(n=eR),i.ending?function(e,t){var n=new WT;$T(e,n),Xl(t,n)}(this,n):(a||function(e,t,n,r){var i;return null===n?i=new XT:"string"==typeof n||t.objectMode||(i=new qT("chunk",["string","Buffer"],n)),!i||($T(e,i),Xl(r,i),!1)}(this,i,e,n))&&(i.pendingcb++,o=function(e,t,n,r,i,o){if(!n){var a=function(e,t,n){return e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=OT.from(t,n)),t}(t,r,i);r!==a&&(n=!0,i="buffer",r=a)}var s=t.objectMode?1:r.length;t.length+=s;var u=t.length<t.highWaterMark;if(u||(t.needDrain=!0),t.writing||t.corked){var l=t.lastBufferedRequest;t.lastBufferedRequest={chunk:r,encoding:i,isBuf:n,callback:o,next:null},l?l.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else rR(e,t,!1,s,r,i,o);return u}(this,i,a,e,t,n)),o},nR.prototype.cork=function(){this._writableState.corked++},nR.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||oR(this,e))},nR.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new ZT(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(nR.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(nR.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),nR.prototype._write=function(e,t,n){n(new VT("_write()"))},nR.prototype._writev=null,nR.prototype.end=function(e,t,n){var r=this._writableState;return"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!=e&&this.write(e,t),r.corked&&(r.corked=1,this.uncork()),r.ending||function(e,t,n){t.ending=!0,uR(e,t),n&&(t.finished?Xl(n):e.once("finish",n)),t.ended=!0,e.writable=!1}(this,r,n),this},Object.defineProperty(nR.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(nR.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),nR.prototype.destroy=KT.destroy,nR.prototype._undestroy=KT.undestroy,nR.prototype._destroy=function(e,t){t(e)};var lR=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t},AR=$L;AR.Duplex=dR,KI.exports(dR,AR.Readable);for(var cR=lR(AR.Writable.prototype),hR=0;hR<cR.length;hR++){var fR=cR[hR];dR.prototype[fR]||(dR.prototype[fR]=AR.Writable.prototype[fR])}function dR(e){if(!(this instanceof dR))return new dR(e);AR.Readable.call(this,e),AR.Writable.call(this,e),this.allowHalfOpen=!0,e&&(!1===e.readable&&(this.readable=!1),!1===e.writable&&(this.writable=!1),!1===e.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",pR)))}function pR(){this._writableState.ended||Xl(gR,this)}function gR(e){e.end()}Object.defineProperty(dR.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(dR.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(dR.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(dR.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}});var vR=$L;vR.Transform=ER;var yR=fM.codes,mR=yR.ERR_METHOD_NOT_IMPLEMENTED,wR=yR.ERR_MULTIPLE_CALLBACK,bR=yR.ERR_TRANSFORM_ALREADY_TRANSFORMING,IR=yR.ERR_TRANSFORM_WITH_LENGTH_0;function BR(e,t){var n=this._transformState;n.transforming=!1;var r=n.writecb;if(null===r)return this.emit("error",new wR);n.writechunk=null,n.writecb=null,null!=t&&this.push(t),r(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function ER(e){if(!(this instanceof ER))return new ER(e);vR.Duplex.call(this,e),this._transformState={afterTransform:BR.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",CR)}function CR(){var e=this;"function"!=typeof this._flush||this._readableState.destroyed?xR(this,null,null):this._flush((function(t,n){xR(e,t,n)}))}function xR(e,t,n){if(t)return e.emit("error",t);if(null!=n&&e.push(n),e._writableState.length)throw new IR;if(e._transformState.transforming)throw new bR;return e.push(null)}KI.exports(ER,vR.Duplex),ER.prototype.push=function(e,t){return this._transformState.needTransform=!1,vR.Duplex.prototype.push.call(this,e,t)},ER.prototype._transform=function(e,t,n){n(new mR("_transform()"))},ER.prototype._write=function(e,t,n){var r=this._transformState;if(r.writecb=n,r.writechunk=e,r.writeencoding=t,!r.transforming){var i=this._readableState;(r.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},ER.prototype._read=function(e){var t=this._transformState;null===t.writechunk||t.transforming?t.needTransform=!0:(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform))},ER.prototype._destroy=function(e,t){vR.Duplex.prototype._destroy.call(this,e,(function(e){t(e)}))};var kR,SR=$L;function QR(e){if(!(this instanceof QR))return new QR(e);Transform.call(this,e)}SR.PassThrough=QR,KI.exports(QR,SR.Transform),QR.prototype._transform=function(e,t,n){n(null,e)};var _R=fM.codes,NR=_R.ERR_MISSING_ARGS,DR=_R.ERR_STREAM_DESTROYED;function FR(e){if(e)throw e}function PR(e,t,n,r){r=function(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}(r);var i=!1;e.on("close",(function(){i=!0})),void 0===kR&&(kR=PM),kR(e,{readable:t,writable:n},(function(e){if(e)return r(e);i=!0,r()}));var o=!1;return function(t){if(!i&&!o)return o=!0,function(e){return e.setHeader&&"function"==typeof e.abort}(e)?e.abort():"function"==typeof e.destroy?e.destroy():void r(t||new DR("pipe"))}}function UR(e){e()}function LR(e,t){return e.pipe(t)}function MR(e){return e.length?"function"!=typeof e[e.length-1]?FR:e.pop():FR}var TR=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r,i=MR(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new NR("streams");var o=t.map((function(e,n){var a=n<t.length-1;return PR(e,a,n>0,(function(e){r||(r=e),e&&o.forEach(UR),a||(o.forEach(UR),i(r))}))}));return t.reduce(LR)};!function(e,t){var n=$L;(t=ZL.exports=n.Readable).Stream=n.Readable,t.Readable=n.Readable,t.Writable=n.Writable,t.Duplex=n.Duplex,t.Transform=n.Transform,t.PassThrough=n.PassThrough,t.finished=PM,t.pipeline=TR}(0,ZL.exports);var RR=jN.exports.Buffer,OR=ZL.exports;function HR(e){OR.Stream.Transform.call(this),this._block=RR.allocUnsafe(e),this._blockSize=e,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}(0,KI.exports)(HR,OR.Stream.Transform),HR.prototype._transform=function(e,t,n){var r=null;try{this.update(e,t)}catch(e){r=e}n(r)},HR.prototype._flush=function(e){var t=null;try{this.push(this.digest())}catch(e){t=e}e(t)},HR.prototype.update=function(e,t){if(function(e,t){if(!RR.isBuffer(e)&&"string"!=typeof e)throw new TypeError("Data must be a string or a buffer")}(e),this._finalized)throw new Error("Digest already called");RR.isBuffer(e)||(e=RR.from(e,t));for(var n=this._block,r=0;this._blockOffset+e.length-r>=this._blockSize;){for(var i=this._blockOffset;i<this._blockSize;)n[i++]=e[r++];this._update(),this._blockOffset=0}for(;r<e.length;)n[this._blockOffset++]=e[r++];for(var o=0,a=8*e.length;a>0;++o)this._length[o]+=a,(a=this._length[o]/4294967296|0)>0&&(this._length[o]-=4294967296*a);return this},HR.prototype._update=function(){throw new Error("_update is not implemented")},HR.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var t=this._digest();void 0!==e&&(t=t.toString(e)),this._block.fill(0),this._blockOffset=0;for(var n=0;n<4;++n)this._length[n]=0;return t},HR.prototype._digest=function(){throw new Error("_digest is not implemented")};var KR=HR,jR=KI.exports,GR=KR,qR=jN.exports.Buffer,VR=new Array(16);function zR(){GR.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function JR(e,t){return e<<t|e>>>32-t}function YR(e,t,n,r,i,o,a){return JR(e+(t&n|~t&r)+i+o|0,a)+t|0}function XR(e,t,n,r,i,o,a){return JR(e+(t&r|n&~r)+i+o|0,a)+t|0}function WR(e,t,n,r,i,o,a){return JR(e+(t^n^r)+i+o|0,a)+t|0}function ZR(e,t,n,r,i,o,a){return JR(e+(n^(t|~r))+i+o|0,a)+t|0}jR(zR,GR),zR.prototype._update=function(){for(var e=VR,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);var n=this._a,r=this._b,i=this._c,o=this._d;n=YR(n,r,i,o,e[0],3614090360,7),o=YR(o,n,r,i,e[1],3905402710,12),i=YR(i,o,n,r,e[2],606105819,17),r=YR(r,i,o,n,e[3],3250441966,22),n=YR(n,r,i,o,e[4],4118548399,7),o=YR(o,n,r,i,e[5],1200080426,12),i=YR(i,o,n,r,e[6],2821735955,17),r=YR(r,i,o,n,e[7],4249261313,22),n=YR(n,r,i,o,e[8],1770035416,7),o=YR(o,n,r,i,e[9],2336552879,12),i=YR(i,o,n,r,e[10],4294925233,17),r=YR(r,i,o,n,e[11],2304563134,22),n=YR(n,r,i,o,e[12],1804603682,7),o=YR(o,n,r,i,e[13],4254626195,12),i=YR(i,o,n,r,e[14],2792965006,17),n=XR(n,r=YR(r,i,o,n,e[15],1236535329,22),i,o,e[1],4129170786,5),o=XR(o,n,r,i,e[6],3225465664,9),i=XR(i,o,n,r,e[11],643717713,14),r=XR(r,i,o,n,e[0],3921069994,20),n=XR(n,r,i,o,e[5],3593408605,5),o=XR(o,n,r,i,e[10],38016083,9),i=XR(i,o,n,r,e[15],3634488961,14),r=XR(r,i,o,n,e[4],3889429448,20),n=XR(n,r,i,o,e[9],568446438,5),o=XR(o,n,r,i,e[14],3275163606,9),i=XR(i,o,n,r,e[3],4107603335,14),r=XR(r,i,o,n,e[8],1163531501,20),n=XR(n,r,i,o,e[13],2850285829,5),o=XR(o,n,r,i,e[2],4243563512,9),i=XR(i,o,n,r,e[7],1735328473,14),n=WR(n,r=XR(r,i,o,n,e[12],2368359562,20),i,o,e[5],4294588738,4),o=WR(o,n,r,i,e[8],2272392833,11),i=WR(i,o,n,r,e[11],1839030562,16),r=WR(r,i,o,n,e[14],4259657740,23),n=WR(n,r,i,o,e[1],2763975236,4),o=WR(o,n,r,i,e[4],1272893353,11),i=WR(i,o,n,r,e[7],4139469664,16),r=WR(r,i,o,n,e[10],3200236656,23),n=WR(n,r,i,o,e[13],681279174,4),o=WR(o,n,r,i,e[0],3936430074,11),i=WR(i,o,n,r,e[3],3572445317,16),r=WR(r,i,o,n,e[6],76029189,23),n=WR(n,r,i,o,e[9],3654602809,4),o=WR(o,n,r,i,e[12],3873151461,11),i=WR(i,o,n,r,e[15],530742520,16),n=ZR(n,r=WR(r,i,o,n,e[2],3299628645,23),i,o,e[0],4096336452,6),o=ZR(o,n,r,i,e[7],1126891415,10),i=ZR(i,o,n,r,e[14],2878612391,15),r=ZR(r,i,o,n,e[5],4237533241,21),n=ZR(n,r,i,o,e[12],1700485571,6),o=ZR(o,n,r,i,e[3],2399980690,10),i=ZR(i,o,n,r,e[10],4293915773,15),r=ZR(r,i,o,n,e[1],2240044497,21),n=ZR(n,r,i,o,e[8],1873313359,6),o=ZR(o,n,r,i,e[15],4264355552,10),i=ZR(i,o,n,r,e[6],2734768916,15),r=ZR(r,i,o,n,e[13],1309151649,21),n=ZR(n,r,i,o,e[4],4149444226,6),o=ZR(o,n,r,i,e[11],3174756917,10),i=ZR(i,o,n,r,e[2],718787259,15),r=ZR(r,i,o,n,e[9],3951481745,21),this._a=this._a+n|0,this._b=this._b+r|0,this._c=this._c+i|0,this._d=this._d+o|0},zR.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=qR.allocUnsafe(16);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e};var $R=zR,eO=Fa.Buffer,tO=KI.exports,nO=KR,rO=new Array(16),iO=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],oO=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],aO=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],sO=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],uO=[0,1518500249,1859775393,2400959708,2840853838],lO=[1352829926,1548603684,1836072691,2053994217,0];function AO(){nO.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function cO(e,t){return e<<t|e>>>32-t}function hO(e,t,n,r,i,o,a,s){return cO(e+(t^n^r)+o+a|0,s)+i|0}function fO(e,t,n,r,i,o,a,s){return cO(e+(t&n|~t&r)+o+a|0,s)+i|0}function dO(e,t,n,r,i,o,a,s){return cO(e+((t|~n)^r)+o+a|0,s)+i|0}function pO(e,t,n,r,i,o,a,s){return cO(e+(t&r|n&~r)+o+a|0,s)+i|0}function gO(e,t,n,r,i,o,a,s){return cO(e+(t^(n|~r))+o+a|0,s)+i|0}tO(AO,nO),AO.prototype._update=function(){for(var e=rO,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);for(var n=0|this._a,r=0|this._b,i=0|this._c,o=0|this._d,a=0|this._e,s=0|this._a,u=0|this._b,l=0|this._c,A=0|this._d,c=0|this._e,h=0;h<80;h+=1){var f,d;h<16?(f=hO(n,r,i,o,a,e[iO[h]],uO[0],aO[h]),d=gO(s,u,l,A,c,e[oO[h]],lO[0],sO[h])):h<32?(f=fO(n,r,i,o,a,e[iO[h]],uO[1],aO[h]),d=pO(s,u,l,A,c,e[oO[h]],lO[1],sO[h])):h<48?(f=dO(n,r,i,o,a,e[iO[h]],uO[2],aO[h]),d=dO(s,u,l,A,c,e[oO[h]],lO[2],sO[h])):h<64?(f=pO(n,r,i,o,a,e[iO[h]],uO[3],aO[h]),d=fO(s,u,l,A,c,e[oO[h]],lO[3],sO[h])):(f=gO(n,r,i,o,a,e[iO[h]],uO[4],aO[h]),d=hO(s,u,l,A,c,e[oO[h]],lO[4],sO[h])),n=a,a=o,o=cO(i,10),i=r,r=f,s=c,c=A,A=cO(l,10),l=u,u=d}var p=this._b+i+A|0;this._b=this._c+o+c|0,this._c=this._d+a+s|0,this._d=this._e+n+u|0,this._e=this._a+r+l|0,this._a=p},AO.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=eO.alloc?eO.alloc(20):new eO(20);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e.writeInt32LE(this._e,16),e};var vO=AO,yO={exports:{}},mO=jN.exports.Buffer;function wO(e,t){this._block=mO.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}wO.prototype.update=function(e,t){"string"==typeof e&&(t=t||"utf8",e=mO.from(e,t));for(var n=this._block,r=this._blockSize,i=e.length,o=this._len,a=0;a<i;){for(var s=o%r,u=Math.min(i-a,r-s),l=0;l<u;l++)n[s+l]=e[a+l];a+=u,(o+=u)%r==0&&this._update(n)}return this._len+=i,this},wO.prototype.digest=function(e){var t=this._len%this._blockSize;this._block[t]=128,this._block.fill(0,t+1),t>=this._finalSize&&(this._update(this._block),this._block.fill(0));var n=8*this._len;if(n<=4294967295)this._block.writeUInt32BE(n,this._blockSize-4);else{var r=(4294967295&n)>>>0,i=(n-r)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(r,this._blockSize-4)}this._update(this._block);var o=this._hash();return e?o.toString(e):o},wO.prototype._update=function(){throw new Error("_update must be implemented by subclass")};var bO=wO,IO=KI.exports,BO=bO,EO=jN.exports.Buffer,CO=[1518500249,1859775393,-1894007588,-899497514],xO=new Array(80);function kO(){this.init(),this._w=xO,BO.call(this,64,56)}function SO(e){return e<<30|e>>>2}function QO(e,t,n,r){return 0===e?t&n|~t&r:2===e?t&n|t&r|n&r:t^n^r}IO(kO,BO),kO.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},kO.prototype._update=function(e){for(var t,n=this._w,r=0|this._a,i=0|this._b,o=0|this._c,a=0|this._d,s=0|this._e,u=0;u<16;++u)n[u]=e.readInt32BE(4*u);for(;u<80;++u)n[u]=n[u-3]^n[u-8]^n[u-14]^n[u-16];for(var l=0;l<80;++l){var A=~~(l/20),c=0|((t=r)<<5|t>>>27)+QO(A,i,o,a)+s+n[l]+CO[A];s=a,a=o,o=SO(i),i=r,r=c}this._a=r+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=a+this._d|0,this._e=s+this._e|0},kO.prototype._hash=function(){var e=EO.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e};var _O=kO,NO=KI.exports,DO=bO,FO=jN.exports.Buffer,PO=[1518500249,1859775393,-1894007588,-899497514],UO=new Array(80);function LO(){this.init(),this._w=UO,DO.call(this,64,56)}function MO(e){return e<<5|e>>>27}function TO(e){return e<<30|e>>>2}function RO(e,t,n,r){return 0===e?t&n|~t&r:2===e?t&n|t&r|n&r:t^n^r}NO(LO,DO),LO.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},LO.prototype._update=function(e){for(var t,n=this._w,r=0|this._a,i=0|this._b,o=0|this._c,a=0|this._d,s=0|this._e,u=0;u<16;++u)n[u]=e.readInt32BE(4*u);for(;u<80;++u)n[u]=(t=n[u-3]^n[u-8]^n[u-14]^n[u-16])<<1|t>>>31;for(var l=0;l<80;++l){var A=~~(l/20),c=MO(r)+RO(A,i,o,a)+s+n[l]+PO[A]|0;s=a,a=o,o=TO(i),i=r,r=c}this._a=r+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=a+this._d|0,this._e=s+this._e|0},LO.prototype._hash=function(){var e=FO.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e};var OO=LO,HO=KI.exports,KO=bO,jO=jN.exports.Buffer,GO=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],qO=new Array(64);function VO(){this.init(),this._w=qO,KO.call(this,64,56)}function zO(e,t,n){return n^e&(t^n)}function JO(e,t,n){return e&t|n&(e|t)}function YO(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function XO(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function WO(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}function ZO(e){return(e>>>17|e<<15)^(e>>>19|e<<13)^e>>>10}HO(VO,KO),VO.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},VO.prototype._update=function(e){for(var t=this._w,n=0|this._a,r=0|this._b,i=0|this._c,o=0|this._d,a=0|this._e,s=0|this._f,u=0|this._g,l=0|this._h,A=0;A<16;++A)t[A]=e.readInt32BE(4*A);for(;A<64;++A)t[A]=ZO(t[A-2])+t[A-7]+WO(t[A-15])+t[A-16]|0;for(var c=0;c<64;++c){var h=l+XO(a)+zO(a,s,u)+GO[c]+t[c]|0,f=YO(n)+JO(n,r,i)|0;l=u,u=s,s=a,a=o+h|0,o=i,i=r,r=n,n=h+f|0}this._a=n+this._a|0,this._b=r+this._b|0,this._c=i+this._c|0,this._d=o+this._d|0,this._e=a+this._e|0,this._f=s+this._f|0,this._g=u+this._g|0,this._h=l+this._h|0},VO.prototype._hash=function(){var e=jO.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e};var $O=VO,eH=KI.exports,tH=$O,nH=bO,rH=jN.exports.Buffer,iH=new Array(64);function oH(){this.init(),this._w=iH,nH.call(this,64,56)}eH(oH,tH),oH.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},oH.prototype._hash=function(){var e=rH.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e};var aH=oH,sH=KI.exports,uH=bO,lH=jN.exports.Buffer,AH=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],cH=new Array(160);function hH(){this.init(),this._w=cH,uH.call(this,128,112)}function fH(e,t,n){return n^e&(t^n)}function dH(e,t,n){return e&t|n&(e|t)}function pH(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function gH(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function vH(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function yH(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function mH(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function wH(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function bH(e,t){return e>>>0<t>>>0?1:0}sH(hH,uH),hH.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},hH.prototype._update=function(e){for(var t=this._w,n=0|this._ah,r=0|this._bh,i=0|this._ch,o=0|this._dh,a=0|this._eh,s=0|this._fh,u=0|this._gh,l=0|this._hh,A=0|this._al,c=0|this._bl,h=0|this._cl,f=0|this._dl,d=0|this._el,p=0|this._fl,g=0|this._gl,v=0|this._hl,y=0;y<32;y+=2)t[y]=e.readInt32BE(4*y),t[y+1]=e.readInt32BE(4*y+4);for(;y<160;y+=2){var m=t[y-30],w=t[y-30+1],b=vH(m,w),I=yH(w,m),B=mH(m=t[y-4],w=t[y-4+1]),E=wH(w,m),C=t[y-14],x=t[y-14+1],k=t[y-32],S=t[y-32+1],Q=I+x|0,_=b+C+bH(Q,I)|0;_=(_=_+B+bH(Q=Q+E|0,E)|0)+k+bH(Q=Q+S|0,S)|0,t[y]=_,t[y+1]=Q}for(var N=0;N<160;N+=2){_=t[N],Q=t[N+1];var D=dH(n,r,i),F=dH(A,c,h),P=pH(n,A),U=pH(A,n),L=gH(a,d),M=gH(d,a),T=AH[N],R=AH[N+1],O=fH(a,s,u),H=fH(d,p,g),K=v+M|0,j=l+L+bH(K,v)|0;j=(j=(j=j+O+bH(K=K+H|0,H)|0)+T+bH(K=K+R|0,R)|0)+_+bH(K=K+Q|0,Q)|0;var G=U+F|0,q=P+D+bH(G,U)|0;l=u,v=g,u=s,g=p,s=a,p=d,a=o+j+bH(d=f+K|0,f)|0,o=i,f=h,i=r,h=c,r=n,c=A,n=j+q+bH(A=K+G|0,K)|0}this._al=this._al+A|0,this._bl=this._bl+c|0,this._cl=this._cl+h|0,this._dl=this._dl+f|0,this._el=this._el+d|0,this._fl=this._fl+p|0,this._gl=this._gl+g|0,this._hl=this._hl+v|0,this._ah=this._ah+n+bH(this._al,A)|0,this._bh=this._bh+r+bH(this._bl,c)|0,this._ch=this._ch+i+bH(this._cl,h)|0,this._dh=this._dh+o+bH(this._dl,f)|0,this._eh=this._eh+a+bH(this._el,d)|0,this._fh=this._fh+s+bH(this._fl,p)|0,this._gh=this._gh+u+bH(this._gl,g)|0,this._hh=this._hh+l+bH(this._hl,v)|0},hH.prototype._hash=function(){var e=lH.allocUnsafe(64);function t(t,n,r){e.writeInt32BE(t,r),e.writeInt32BE(n,r+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),t(this._gh,this._gl,48),t(this._hh,this._hl,56),e};var IH=hH,BH=KI.exports,EH=IH,CH=bO,xH=jN.exports.Buffer,kH=new Array(160);function SH(){this.init(),this._w=kH,CH.call(this,128,112)}BH(SH,EH),SH.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},SH.prototype._hash=function(){var e=xH.allocUnsafe(48);function t(t,n,r){e.writeInt32BE(t,r),e.writeInt32BE(n,r+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),e};var QH=SH,_H=yO.exports=function(e){e=e.toLowerCase();var t=_H[e];if(!t)throw new Error(e+" is not supported (we accept pull requests)");return new t};_H.sha=_O,_H.sha1=OO,_H.sha224=aH,_H.sha256=$O,_H.sha384=QH,_H.sha512=IH;var NH=Do(sh),DH=jN.exports.Buffer,FH=JQ.Transform,PH=NH.StringDecoder;function UH(e){FH.call(this),this.hashMode="string"==typeof e,this.hashMode?this[e]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}(0,KI.exports)(UH,FH),UH.prototype.update=function(e,t,n){"string"==typeof e&&(e=DH.from(e,t));var r=this._update(e);return this.hashMode?this:(n&&(r=this._toString(r,n)),r)},UH.prototype.setAutoPadding=function(){},UH.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},UH.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},UH.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},UH.prototype._transform=function(e,t,n){var r;try{this.hashMode?this._update(e):this.push(this._update(e))}catch(e){r=e}finally{n(r)}},UH.prototype._flush=function(e){var t;try{this.push(this.__final())}catch(e){t=e}e(t)},UH.prototype._finalOrDigest=function(e){var t=this.__final()||DH.alloc(0);return e&&(t=this._toString(t,e,!0)),t},UH.prototype._toString=function(e,t,n){if(this._decoder||(this._decoder=new PH(t),this._encoding=t),this._encoding!==t)throw new Error("can't switch encodings");var r=this._decoder.write(e);return n&&(r+=this._decoder.end()),r};var LH=UH,MH=KI.exports,TH=$R,RH=vO,OH=yO.exports,HH=LH;function KH(e){HH.call(this,"digest"),this._hash=e}MH(KH,HH),KH.prototype._update=function(e){this._hash.update(e)},KH.prototype._final=function(){return this._hash.digest()};var jH=function(e){return"md5"===(e=e.toLowerCase())?new TH:"rmd160"===e||"ripemd160"===e?new RH:new KH(OH(e))};Object.defineProperty(WL,"__esModule",{value:!0}),WL.taggedHash=WL.hash256=WL.hash160=WL.sha256=WL.sha1=WL.ripemd160=void 0;var GH=jH,qH=vO;function VH(e){try{return GH("rmd160").update(e).digest()}catch(t){try{return GH("ripemd160").update(e).digest()}catch(t){return(new qH).update(e).digest()}}}function zH(e){return GH("sha256").update(e).digest()}WL.ripemd160=VH,WL.sha1=function(e){return GH("sha1").update(e).digest()},WL.sha256=zH,WL.hash160=function(e){return VH(zH(e))},WL.hash256=function(e){return zH(zH(e))};var JH=Object.fromEntries(["BIP0340/challenge","BIP0340/aux","BIP0340/nonce","TapLeaf","TapBranch","TapSighash","TapTweak","KeyAgg list","KeyAgg coefficient"].map((function(e){var t=zH(Yo.from(e));return[e,Yo.concat([t,t])]})));WL.taggedHash=function(e,t){return zH(Yo.concat([JH[e],t]))};var YH=wU,XH=jN.exports.Buffer,WH=jH,ZH=function(e){function t(t){var n=t.slice(0,-4),r=t.slice(-4),i=e(n);if(!(r[0]^i[0]|r[1]^i[1]|r[2]^i[2]|r[3]^i[3]))return n}return{encode:function(t){var n=e(t);return YH.encode(XH.concat([t,n],t.length+4))},decode:function(e){var n=t(YH.decode(e));if(!n)throw new Error("Invalid checksum");return n},decodeUnsafe:function(e){var n=YH.decodeUnsafe(e);if(n)return t(n)}}}((function(e){var t=WH("sha256").update(e).digest();return WH("sha256").update(t).digest()}));Object.defineProperty(XL,"__esModule",{value:!0}),XL.p2pkh=void 0;var $H=WL,eK=EU,tK=kU,nK=OU,rK=_L,iK=ZH,oK=tK.OPS;XL.p2pkh=function(e,t){if(!(e.address||e.hash||e.output||e.pubkey||e.input))throw new TypeError("Not enough data");t=Object.assign({validate:!0},t||{}),(0,nK.typeforce)({network:nK.typeforce.maybe(nK.typeforce.Object),address:nK.typeforce.maybe(nK.typeforce.String),hash:nK.typeforce.maybe(nK.typeforce.BufferN(20)),output:nK.typeforce.maybe(nK.typeforce.BufferN(25)),pubkey:nK.typeforce.maybe(nK.isPoint),signature:nK.typeforce.maybe(tK.isCanonicalScriptSignature),input:nK.typeforce.maybe(nK.typeforce.Buffer)},e);var n=rK.value((function(){var t=iK.decode(e.address);return{version:t.readUInt8(0),hash:t.slice(1)}})),r=rK.value((function(){return tK.decompile(e.input)})),i=e.network||eK.bitcoin,o={name:"p2pkh",network:i};if(rK.prop(o,"address",(function(){if(o.hash){var e=Yo.allocUnsafe(21);return e.writeUInt8(i.pubKeyHash,0),o.hash.copy(e,1),iK.encode(e)}})),rK.prop(o,"hash",(function(){return e.output?e.output.slice(3,23):e.address?n().hash:e.pubkey||o.pubkey?$H.hash160(e.pubkey||o.pubkey):void 0})),rK.prop(o,"output",(function(){if(o.hash)return tK.compile([oK.OP_DUP,oK.OP_HASH160,o.hash,oK.OP_EQUALVERIFY,oK.OP_CHECKSIG])})),rK.prop(o,"pubkey",(function(){if(e.input)return r()[1]})),rK.prop(o,"signature",(function(){if(e.input)return r()[0]})),rK.prop(o,"input",(function(){if(e.pubkey&&e.signature)return tK.compile([e.signature,e.pubkey])})),rK.prop(o,"witness",(function(){if(o.input)return[]})),t.validate){var a=Yo.from([]);if(e.address){if(n().version!==i.pubKeyHash)throw new TypeError("Invalid version or Network mismatch");if(20!==n().hash.length)throw new TypeError("Invalid address");a=n().hash}if(e.hash){if(a.length>0&&!a.equals(e.hash))throw new TypeError("Hash mismatch");a=e.hash}if(e.output){if(25!==e.output.length||e.output[0]!==oK.OP_DUP||e.output[1]!==oK.OP_HASH160||20!==e.output[2]||e.output[23]!==oK.OP_EQUALVERIFY||e.output[24]!==oK.OP_CHECKSIG)throw new TypeError("Output is invalid");var s=e.output.slice(3,23);if(a.length>0&&!a.equals(s))throw new TypeError("Hash mismatch");a=s}if(e.pubkey){var u=$H.hash160(e.pubkey);if(a.length>0&&!a.equals(u))throw new TypeError("Hash mismatch");a=u}if(e.input){var l=r();if(2!==l.length)throw new TypeError("Input is invalid");if(!tK.isCanonicalScriptSignature(l[0]))throw new TypeError("Input has invalid signature");if(!(0,nK.isPoint)(l[1]))throw new TypeError("Input has invalid pubkey");if(e.signature&&!e.signature.equals(l[0]))throw new TypeError("Signature mismatch");if(e.pubkey&&!e.pubkey.equals(l[1]))throw new TypeError("Pubkey mismatch");var A=$H.hash160(l[1]);if(a.length>0&&!a.equals(A))throw new TypeError("Hash mismatch")}}return Object.assign(o,e)};var aK={};Object.defineProperty(aK,"__esModule",{value:!0}),aK.p2sh=void 0;var sK=WL,uK=EU,lK=kU,AK=OU,cK=_L,hK=ZH,fK=lK.OPS;aK.p2sh=function(e,t){if(!(e.address||e.hash||e.output||e.redeem||e.input))throw new TypeError("Not enough data");t=Object.assign({validate:!0},t||{}),(0,AK.typeforce)({network:AK.typeforce.maybe(AK.typeforce.Object),address:AK.typeforce.maybe(AK.typeforce.String),hash:AK.typeforce.maybe(AK.typeforce.BufferN(20)),output:AK.typeforce.maybe(AK.typeforce.BufferN(23)),redeem:AK.typeforce.maybe({network:AK.typeforce.maybe(AK.typeforce.Object),output:AK.typeforce.maybe(AK.typeforce.Buffer),input:AK.typeforce.maybe(AK.typeforce.Buffer),witness:AK.typeforce.maybe(AK.typeforce.arrayOf(AK.typeforce.Buffer))}),input:AK.typeforce.maybe(AK.typeforce.Buffer),witness:AK.typeforce.maybe(AK.typeforce.arrayOf(AK.typeforce.Buffer))},e);var n=e.network;n||(n=e.redeem&&e.redeem.network||uK.bitcoin);var r={network:n},i=cK.value((function(){var t=hK.decode(e.address);return{version:t.readUInt8(0),hash:t.slice(1)}})),o=cK.value((function(){return lK.decompile(e.input)})),a=cK.value((function(){var t=o(),r=t[t.length-1];return{network:n,output:r===fK.OP_FALSE?Yo.from([]):r,input:lK.compile(t.slice(0,-1)),witness:e.witness||[]}}));if(cK.prop(r,"address",(function(){if(r.hash){var e=Yo.allocUnsafe(21);return e.writeUInt8(r.network.scriptHash,0),r.hash.copy(e,1),hK.encode(e)}})),cK.prop(r,"hash",(function(){return e.output?e.output.slice(2,22):e.address?i().hash:r.redeem&&r.redeem.output?sK.hash160(r.redeem.output):void 0})),cK.prop(r,"output",(function(){if(r.hash)return lK.compile([fK.OP_HASH160,r.hash,fK.OP_EQUAL])})),cK.prop(r,"redeem",(function(){if(e.input)return a()})),cK.prop(r,"input",(function(){if(e.redeem&&e.redeem.input&&e.redeem.output)return lK.compile([].concat(lK.decompile(e.redeem.input),e.redeem.output))})),cK.prop(r,"witness",(function(){return r.redeem&&r.redeem.witness?r.redeem.witness:r.input?[]:void 0})),cK.prop(r,"name",(function(){var e=["p2sh"];return void 0!==r.redeem&&void 0!==r.redeem.name&&e.push(r.redeem.name),e.join("-")})),t.validate){var s=Yo.from([]);if(e.address){if(i().version!==n.scriptHash)throw new TypeError("Invalid version or Network mismatch");if(20!==i().hash.length)throw new TypeError("Invalid address");s=i().hash}if(e.hash){if(s.length>0&&!s.equals(e.hash))throw new TypeError("Hash mismatch");s=e.hash}if(e.output){if(23!==e.output.length||e.output[0]!==fK.OP_HASH160||20!==e.output[1]||e.output[22]!==fK.OP_EQUAL)throw new TypeError("Output is invalid");var u=e.output.slice(2,22);if(s.length>0&&!s.equals(u))throw new TypeError("Hash mismatch");s=u}var l=function(e){if(e.output){var t=lK.decompile(e.output);if(!t||t.length<1)throw new TypeError("Redeem.output too short");var n=sK.hash160(e.output);if(s.length>0&&!s.equals(n))throw new TypeError("Hash mismatch");s=n}if(e.input){var r=e.input.length>0,i=e.witness&&e.witness.length>0;if(!r&&!i)throw new TypeError("Empty input");if(r&&i)throw new TypeError("Input and witness provided");if(r){var o=lK.decompile(e.input);if(!lK.isPushOnly(o))throw new TypeError("Non push-only scriptSig")}}};if(e.input){var A=o();if(!A||A.length<1)throw new TypeError("Input too short");if(!Na(a().output))throw new TypeError("Input is invalid");l(a())}if(e.redeem){if(e.redeem.network&&e.redeem.network!==n)throw new TypeError("Network mismatch");if(e.input){var c=a();if(e.redeem.output&&!e.redeem.output.equals(c.output))throw new TypeError("Redeem.output mismatch");if(e.redeem.input&&!e.redeem.input.equals(c.input))throw new TypeError("Redeem.input mismatch")}l(e.redeem)}if(e.witness&&e.redeem&&e.redeem.witness&&!function(e,t){return e.length===t.length&&e.every((function(e,n){return e.equals(t[n])}))}(e.redeem.witness,e.witness))throw new TypeError("Witness and redeem.witness mismatch")}return Object.assign(r,e)};var dK={},pK={};Object.defineProperty(pK,"__esModule",{value:!0}),pK.bech32m=pK.bech32=void 0;for(var gK="qpzry9x8gf2tvdw0s3jn54khce6mua7l",vK={},yK=0;yK<gK.length;yK++){var mK=gK.charAt(yK);vK[mK]=yK}function wK(e){var t=e>>25;return(33554431&e)<<5^996825010&-(t>>0&1)^642813549&-(t>>1&1)^513874426&-(t>>2&1)^1027748829&-(t>>3&1)^705979059&-(t>>4&1)}function bK(e){for(var t=1,n=0;n<e.length;++n){var r=e.charCodeAt(n);if(r<33||r>126)return"Invalid prefix ("+e+")";t=wK(t)^r>>5}t=wK(t);for(var i=0;i<e.length;++i){var o=e.charCodeAt(i);t=wK(t)^31&o}return t}function IK(e,t,n,r){for(var i=0,o=0,a=(1<<n)-1,s=[],u=0;u<e.length;++u)for(i=i<<t|e[u],o+=t;o>=n;)o-=n,s.push(i>>o&a);if(r)o>0&&s.push(i<<n-o&a);else{if(o>=t)return"Excess padding";if(i<<n-o&a)return"Non-zero padding"}return s}function BK(e){return IK(e,8,5,!0)}function EK(e){var t=IK(e,5,8,!1);if(Array.isArray(t))return t}function CK(e){var t=IK(e,5,8,!1);if(Array.isArray(t))return t;throw new Error(t)}function xK(e){var t;function n(e,n){if(n=n||90,e.length<8)return e+" too short";if(e.length>n)return"Exceeds length limit";var r=e.toLowerCase(),i=e.toUpperCase();if(e!==r&&e!==i)return"Mixed-case string "+e;var o=(e=r).lastIndexOf("1");if(-1===o)return"No separator character for "+e;if(0===o)return"Missing prefix for "+e;var a=e.slice(0,o),s=e.slice(o+1);if(s.length<6)return"Data too short";var u=bK(a);if("string"==typeof u)return u;for(var l=[],A=0;A<s.length;++A){var c=s.charAt(A),h=vK[c];if(void 0===h)return"Unknown character "+c;u=wK(u)^h,A+6>=s.length||l.push(h)}return u!==t?"Invalid checksum for "+e:{prefix:a,words:l}}return t="bech32"===e?1:734539939,{decodeUnsafe:function(e,t){var r=n(e,t);if("object"==i(r))return r},decode:function(e,t){var r=n(e,t);if("object"==i(r))return r;throw new Error(r)},encode:function(e,n,r){if(r=r||90,e.length+7+n.length>r)throw new TypeError("Exceeds length limit");var i=bK(e=e.toLowerCase());if("string"==typeof i)throw new Error(i);for(var o=e+"1",a=0;a<n.length;++a){var s=n[a];if(s>>5!=0)throw new Error("Non 5-bit word");i=wK(i)^s,o+=gK.charAt(s)}for(var u=0;u<6;++u)i=wK(i);i^=t;for(var l=0;l<6;++l)o+=gK.charAt(i>>5*(5-l)&31);return o},toWords:BK,fromWordsUnsafe:EK,fromWords:CK}}pK.bech32=xK("bech32"),pK.bech32m=xK("bech32m"),Object.defineProperty(dK,"__esModule",{value:!0}),dK.p2wpkh=void 0;var kK=WL,SK=EU,QK=kU,_K=OU,NK=_L,DK=pK,FK=QK.OPS,PK=Yo.alloc(0);dK.p2wpkh=function(e,t){if(!(e.address||e.hash||e.output||e.pubkey||e.witness))throw new TypeError("Not enough data");t=Object.assign({validate:!0},t||{}),(0,_K.typeforce)({address:_K.typeforce.maybe(_K.typeforce.String),hash:_K.typeforce.maybe(_K.typeforce.BufferN(20)),input:_K.typeforce.maybe(_K.typeforce.BufferN(0)),network:_K.typeforce.maybe(_K.typeforce.Object),output:_K.typeforce.maybe(_K.typeforce.BufferN(22)),pubkey:_K.typeforce.maybe(_K.isPoint),signature:_K.typeforce.maybe(QK.isCanonicalScriptSignature),witness:_K.typeforce.maybe(_K.typeforce.arrayOf(_K.typeforce.Buffer))},e);var n=NK.value((function(){var t=DK.bech32.decode(e.address),n=t.words.shift(),r=DK.bech32.fromWords(t.words);return{version:n,prefix:t.prefix,data:Yo.from(r)}})),r=e.network||SK.bitcoin,i={name:"p2wpkh",network:r};if(NK.prop(i,"address",(function(){if(i.hash){var e=DK.bech32.toWords(i.hash);return e.unshift(0),DK.bech32.encode(r.bech32,e)}})),NK.prop(i,"hash",(function(){return e.output?e.output.slice(2,22):e.address?n().data:e.pubkey||i.pubkey?kK.hash160(e.pubkey||i.pubkey):void 0})),NK.prop(i,"output",(function(){if(i.hash)return QK.compile([FK.OP_0,i.hash])})),NK.prop(i,"pubkey",(function(){return e.pubkey?e.pubkey:e.witness?e.witness[1]:void 0})),NK.prop(i,"signature",(function(){if(e.witness)return e.witness[0]})),NK.prop(i,"input",(function(){if(i.witness)return PK})),NK.prop(i,"witness",(function(){if(e.pubkey&&e.signature)return[e.signature,e.pubkey]})),t.validate){var o=Yo.from([]);if(e.address){if(r&&r.bech32!==n().prefix)throw new TypeError("Invalid prefix or Network mismatch");if(0!==n().version)throw new TypeError("Invalid address version");if(20!==n().data.length)throw new TypeError("Invalid address data");o=n().data}if(e.hash){if(o.length>0&&!o.equals(e.hash))throw new TypeError("Hash mismatch");o=e.hash}if(e.output){if(22!==e.output.length||e.output[0]!==FK.OP_0||20!==e.output[1])throw new TypeError("Output is invalid");if(o.length>0&&!o.equals(e.output.slice(2)))throw new TypeError("Hash mismatch");o=e.output.slice(2)}if(e.pubkey){var a=kK.hash160(e.pubkey);if(o.length>0&&!o.equals(a))throw new TypeError("Hash mismatch");if(o=a,!(0,_K.isPoint)(e.pubkey)||33!==e.pubkey.length)throw new TypeError("Invalid pubkey for p2wpkh")}if(e.witness){if(2!==e.witness.length)throw new TypeError("Witness is invalid");if(!QK.isCanonicalScriptSignature(e.witness[0]))throw new TypeError("Witness has invalid signature");if(!(0,_K.isPoint)(e.witness[1])||33!==e.witness[1].length)throw new TypeError("Witness has invalid pubkey");if(e.signature&&!e.signature.equals(e.witness[0]))throw new TypeError("Signature mismatch");if(e.pubkey&&!e.pubkey.equals(e.witness[1]))throw new TypeError("Pubkey mismatch");var s=kK.hash160(e.witness[1]);if(o.length>0&&!o.equals(s))throw new TypeError("Hash mismatch")}}return Object.assign(i,e)};var UK={};Object.defineProperty(UK,"__esModule",{value:!0}),UK.p2wsh=void 0;var LK=WL,MK=EU,TK=kU,RK=OU,OK=_L,HK=pK,KK=TK.OPS,jK=Yo.alloc(0);function GK(e){return!(!Na(e)||65!==e.length||4!==e[0]||!(0,RK.isPoint)(e))}UK.p2wsh=function(e,t){if(!(e.address||e.hash||e.output||e.redeem||e.witness))throw new TypeError("Not enough data");t=Object.assign({validate:!0},t||{}),(0,RK.typeforce)({network:RK.typeforce.maybe(RK.typeforce.Object),address:RK.typeforce.maybe(RK.typeforce.String),hash:RK.typeforce.maybe(RK.typeforce.BufferN(32)),output:RK.typeforce.maybe(RK.typeforce.BufferN(34)),redeem:RK.typeforce.maybe({input:RK.typeforce.maybe(RK.typeforce.Buffer),network:RK.typeforce.maybe(RK.typeforce.Object),output:RK.typeforce.maybe(RK.typeforce.Buffer),witness:RK.typeforce.maybe(RK.typeforce.arrayOf(RK.typeforce.Buffer))}),input:RK.typeforce.maybe(RK.typeforce.BufferN(0)),witness:RK.typeforce.maybe(RK.typeforce.arrayOf(RK.typeforce.Buffer))},e);var n=OK.value((function(){var t=HK.bech32.decode(e.address),n=t.words.shift(),r=HK.bech32.fromWords(t.words);return{version:n,prefix:t.prefix,data:Yo.from(r)}})),r=OK.value((function(){return TK.decompile(e.redeem.input)})),i=e.network;i||(i=e.redeem&&e.redeem.network||MK.bitcoin);var o={network:i};if(OK.prop(o,"address",(function(){if(o.hash){var e=HK.bech32.toWords(o.hash);return e.unshift(0),HK.bech32.encode(i.bech32,e)}})),OK.prop(o,"hash",(function(){return e.output?e.output.slice(2):e.address?n().data:o.redeem&&o.redeem.output?LK.sha256(o.redeem.output):void 0})),OK.prop(o,"output",(function(){if(o.hash)return TK.compile([KK.OP_0,o.hash])})),OK.prop(o,"redeem",(function(){if(e.witness)return{output:e.witness[e.witness.length-1],input:jK,witness:e.witness.slice(0,-1)}})),OK.prop(o,"input",(function(){if(o.witness)return jK})),OK.prop(o,"witness",(function(){if(e.redeem&&e.redeem.input&&e.redeem.input.length>0&&e.redeem.output&&e.redeem.output.length>0){var t=TK.toStack(r());return o.redeem=Object.assign({witness:t},e.redeem),o.redeem.input=jK,[].concat(t,e.redeem.output)}if(e.redeem&&e.redeem.output&&e.redeem.witness)return[].concat(e.redeem.witness,e.redeem.output)})),OK.prop(o,"name",(function(){var e=["p2wsh"];return void 0!==o.redeem&&void 0!==o.redeem.name&&e.push(o.redeem.name),e.join("-")})),t.validate){var a=Yo.from([]);if(e.address){if(n().prefix!==i.bech32)throw new TypeError("Invalid prefix or Network mismatch");if(0!==n().version)throw new TypeError("Invalid address version");if(32!==n().data.length)throw new TypeError("Invalid address data");a=n().data}if(e.hash){if(a.length>0&&!a.equals(e.hash))throw new TypeError("Hash mismatch");a=e.hash}if(e.output){if(34!==e.output.length||e.output[0]!==KK.OP_0||32!==e.output[1])throw new TypeError("Output is invalid");var s=e.output.slice(2);if(a.length>0&&!a.equals(s))throw new TypeError("Hash mismatch");a=s}if(e.redeem){if(e.redeem.network&&e.redeem.network!==i)throw new TypeError("Network mismatch");if(e.redeem.input&&e.redeem.input.length>0&&e.redeem.witness&&e.redeem.witness.length>0)throw new TypeError("Ambiguous witness source");if(e.redeem.output){if(0===TK.decompile(e.redeem.output).length)throw new TypeError("Redeem.output is invalid");var u=LK.sha256(e.redeem.output);if(a.length>0&&!a.equals(u))throw new TypeError("Hash mismatch");a=u}if(e.redeem.input&&!TK.isPushOnly(r()))throw new TypeError("Non push-only scriptSig");if(e.witness&&e.redeem.witness&&!function(e,t){return e.length===t.length&&e.every((function(e,n){return e.equals(t[n])}))}(e.witness,e.redeem.witness))throw new TypeError("Witness and redeem.witness mismatch");if(e.redeem.input&&r().some(GK)||e.redeem.output&&(TK.decompile(e.redeem.output)||[]).some(GK))throw new TypeError("redeem.input or redeem.output contains uncompressed pubkey")}if(e.witness&&e.witness.length>0){var l=e.witness[e.witness.length-1];if(e.redeem&&e.redeem.output&&!e.redeem.output.equals(l))throw new TypeError("Witness and redeem.output mismatch");if(e.witness.some(GK)||(TK.decompile(l)||[]).some(GK))throw new TypeError("Witness contains uncompressed pubkey")}}return Object.assign(o,e)},function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.p2wsh=e.p2wpkh=e.p2sh=e.p2pkh=e.p2pk=e.p2ms=e.embed=void 0;var t=xU;Object.defineProperty(e,"embed",{enumerable:!0,get:function(){return t.p2data}});var n=LL;Object.defineProperty(e,"p2ms",{enumerable:!0,get:function(){return n.p2ms}});var r=GL;Object.defineProperty(e,"p2pk",{enumerable:!0,get:function(){return r.p2pk}});var i=XL;Object.defineProperty(e,"p2pkh",{enumerable:!0,get:function(){return i.p2pkh}});var o=aK;Object.defineProperty(e,"p2sh",{enumerable:!0,get:function(){return o.p2sh}});var a=dK;Object.defineProperty(e,"p2wpkh",{enumerable:!0,get:function(){return a.p2wpkh}});var s=UK;Object.defineProperty(e,"p2wsh",{enumerable:!0,get:function(){return s.p2wsh}})}(CU),Object.defineProperty(BU,"__esModule",{value:!0}),BU.toOutputScript=BU.fromOutputScript=BU.toBech32=BU.toBase58Check=BU.fromBech32=BU.fromBase58Check=void 0;var qK=EU,VK=CU,zK=kU,JK=OU,YK=pK,XK=ZH,WK=JK.typeforce,ZK="WARNING: Sending to a future segwit version address can lead to loss of funds. End users MUST be warned carefully in the GUI and asked if they wish to proceed with caution. Wallets should verify the segwit version from the output of fromBech32, then decide when it is safe to use which version of segwit.";function $K(e){var t=XK.decode(e);if(t.length<21)throw new TypeError(e+" is too short");if(t.length>21)throw new TypeError(e+" is too long");return{version:t.readUInt8(0),hash:t.slice(1)}}function ej(e){var t,n;try{t=YK.bech32.decode(e)}catch(e){}if(t){if(0!==(n=t.words[0]))throw new TypeError(e+" uses wrong encoding")}else if(0===(n=(t=YK.bech32m.decode(e)).words[0]))throw new TypeError(e+" uses wrong encoding");var r=YK.bech32.fromWords(t.words.slice(1));return{version:n,prefix:t.prefix,data:Yo.from(r)}}function tj(e,t,n){var r=YK.bech32.toWords(e);return r.unshift(t),0===t?YK.bech32.encode(n,r):YK.bech32m.encode(n,r)}BU.fromBase58Check=$K,BU.fromBech32=ej,BU.toBase58Check=function(e,t){WK(JK.tuple(JK.Hash160bit,JK.UInt8),arguments);var n=Yo.allocUnsafe(21);return n.writeUInt8(t,0),e.copy(n,1),XK.encode(n)},BU.toBech32=tj,BU.fromOutputScript=function(e,t){t=t||qK.bitcoin;try{return VK.p2pkh({output:e,network:t}).address}catch(e){}try{return VK.p2sh({output:e,network:t}).address}catch(e){}try{return VK.p2wpkh({output:e,network:t}).address}catch(e){}try{return VK.p2wsh({output:e,network:t}).address}catch(e){}try{return function(e,t){var n=e.slice(2);if(n.length<2||n.length>40)throw new TypeError("Invalid program length for segwit address");var r=e[0]-80;if(r<1||r>16)throw new TypeError("Invalid version for segwit address");if(e[1]!==n.length)throw new TypeError("Invalid script for segwit address");return console.warn(ZK),tj(n,r,t.bech32)}(e,t)}catch(e){}throw new Error(zK.toASM(e)+" has no matching Address")},BU.toOutputScript=function(e,t){var n,r;t=t||qK.bitcoin;try{n=$K(e)}catch(e){}if(n){if(n.version===t.pubKeyHash)return VK.p2pkh({hash:n.hash}).output;if(n.version===t.scriptHash)return VK.p2sh({hash:n.hash}).output}else{try{r=ej(e)}catch(e){}if(r){if(r.prefix!==t.bech32)throw new Error(e+" has an invalid prefix");if(0===r.version){if(20===r.data.length)return VK.p2wpkh({hash:r.data}).output;if(32===r.data.length)return VK.p2wsh({hash:r.data}).output}else if(r.version>=1&&r.version<=16&&r.data.length>=2&&r.data.length<=40)return console.warn(ZK),zK.compile([r.version+80,r.data])}}throw new Error(e+" has no matching Script")};var nj={},rj={},ij=jN.exports.Buffer;function oj(e){if(e<0||e>9007199254740991||e%1!=0)throw new RangeError("value out of range")}function aj(e){return oj(e),e<253?1:e<=65535?3:e<=4294967295?5:9}var sj={encode:function e(t,n,r){if(oj(t),n||(n=ij.allocUnsafe(aj(t))),!ij.isBuffer(n))throw new TypeError("buffer must be a Buffer instance");return r||(r=0),t<253?(n.writeUInt8(t,r),e.bytes=1):t<=65535?(n.writeUInt8(253,r),n.writeUInt16LE(t,r+1),e.bytes=3):t<=4294967295?(n.writeUInt8(254,r),n.writeUInt32LE(t,r+1),e.bytes=5):(n.writeUInt8(255,r),n.writeUInt32LE(t>>>0,r+1),n.writeUInt32LE(t/4294967296|0,r+5),e.bytes=9),n},decode:function e(t,n){if(!ij.isBuffer(t))throw new TypeError("buffer must be a Buffer instance");n||(n=0);var r=t.readUInt8(n);if(r<253)return e.bytes=1,r;if(253===r)return e.bytes=3,t.readUInt16LE(n+1);if(254===r)return e.bytes=5,t.readUInt32LE(n+1);e.bytes=9;var i=t.readUInt32LE(n+1),o=4294967296*t.readUInt32LE(n+5)+i;return oj(o),o},encodingLength:aj};Object.defineProperty(rj,"__esModule",{value:!0}),rj.BufferReader=rj.BufferWriter=rj.cloneBuffer=rj.reverseBuffer=rj.writeUInt64LE=rj.readUInt64LE=rj.varuint=void 0;var uj=OU,lj=uj.typeforce,Aj=sj;function cj(e,t){if("number"!=typeof e)throw new Error("cannot write a non-number as a number");if(e<0)throw new Error("specified a negative value for writing an unsigned value");if(e>t)throw new Error("RangeError: value out of range");if(Math.floor(e)!==e)throw new Error("value has a fractional component")}function hj(e,t){var n=e.readUInt32LE(t),r=e.readUInt32LE(t+4);return cj((r*=4294967296)+n,9007199254740991),r+n}function fj(e,t,n){return cj(t,9007199254740991),e.writeInt32LE(-1&t,n),e.writeUInt32LE(Math.floor(t/4294967296),n+4),n+8}rj.varuint=Aj,rj.readUInt64LE=hj,rj.writeUInt64LE=fj,rj.reverseBuffer=function(e){if(e.length<1)return e;for(var t=e.length-1,n=0,r=0;r<e.length/2;r++)n=e[r],e[r]=e[t],e[t]=n,t--;return e},rj.cloneBuffer=function(e){var t=Yo.allocUnsafe(e.length);return e.copy(t),t};var dj=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;s(this,e),this.buffer=t,this.offset=n,lj(uj.tuple(uj.Buffer,uj.UInt32),[t,n])}return l(e,[{key:"writeUInt8",value:function(e){this.offset=this.buffer.writeUInt8(e,this.offset)}},{key:"writeInt32",value:function(e){this.offset=this.buffer.writeInt32LE(e,this.offset)}},{key:"writeUInt32",value:function(e){this.offset=this.buffer.writeUInt32LE(e,this.offset)}},{key:"writeUInt64",value:function(e){this.offset=fj(this.buffer,e,this.offset)}},{key:"writeVarInt",value:function(e){Aj.encode(e,this.buffer,this.offset),this.offset+=Aj.encode.bytes}},{key:"writeSlice",value:function(e){if(this.buffer.length<this.offset+e.length)throw new Error("Cannot write slice out of bounds");this.offset+=e.copy(this.buffer,this.offset)}},{key:"writeVarSlice",value:function(e){this.writeVarInt(e.length),this.writeSlice(e)}},{key:"writeVector",value:function(e){var t=this;this.writeVarInt(e.length),e.forEach((function(e){return t.writeVarSlice(e)}))}},{key:"end",value:function(){if(this.buffer.length===this.offset)return this.buffer;throw new Error("buffer size ".concat(this.buffer.length,", offset ").concat(this.offset))}}],[{key:"withCapacity",value:function(t){return new e(Yo.alloc(t))}}]),e}();rj.BufferWriter=dj,rj.BufferReader=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;s(this,e),this.buffer=t,this.offset=n,lj(uj.tuple(uj.Buffer,uj.UInt32),[t,n])}return l(e,[{key:"readUInt8",value:function(){var e=this.buffer.readUInt8(this.offset);return this.offset++,e}},{key:"readInt32",value:function(){var e=this.buffer.readInt32LE(this.offset);return this.offset+=4,e}},{key:"readUInt32",value:function(){var e=this.buffer.readUInt32LE(this.offset);return this.offset+=4,e}},{key:"readUInt64",value:function(){var e=hj(this.buffer,this.offset);return this.offset+=8,e}},{key:"readVarInt",value:function(){var e=Aj.decode(this.buffer,this.offset);return this.offset+=Aj.decode.bytes,e}},{key:"readSlice",value:function(e){if(this.buffer.length<this.offset+e)throw new Error("Cannot read slice out of bounds");var t=this.buffer.slice(this.offset,this.offset+e);return this.offset+=e,t}},{key:"readVarSlice",value:function(){return this.readSlice(this.readVarInt())}},{key:"readVector",value:function(){for(var e=this.readVarInt(),t=[],n=0;n<e;n++)t.push(this.readVarSlice());return t}}]),e}();var pj={};Object.defineProperty(pj,"__esModule",{value:!0}),pj.fastMerkleRoot=void 0,pj.fastMerkleRoot=function(e,t){if(!Array.isArray(e))throw TypeError("Expected values Array");if("function"!=typeof t)throw TypeError("Expected digest Function");for(var n=e.length,r=e.concat();n>1;){for(var i=0,o=0;o<n;o+=2,++i){var a=r[o],s=o+1===n?a:r[o+1],u=Yo.concat([a,s]);r[i]=t(u)}n=i}return r[0]};var gj={};Object.defineProperty(gj,"__esModule",{value:!0}),gj.Transaction=void 0;var vj=rj,yj=WL,mj=kU,wj=kU,bj=OU,Ij=bj.typeforce;function Bj(e){var t=e.length;return vj.varuint.encodingLength(t)+t}var Ej=Yo.allocUnsafe(0),Cj=[],xj=Yo.from("0000000000000000000000000000000000000000000000000000000000000000","hex"),kj=Yo.from("0000000000000000000000000000000000000000000000000000000000000001","hex"),Sj=Yo.from("ffffffffffffffff","hex"),Qj={script:Ej,valueBuffer:Sj},_j=function(){function e(){s(this,e),this.version=1,this.locktime=0,this.ins=[],this.outs=[]}return l(e,[{key:"isCoinbase",value:function(){return 1===this.ins.length&&e.isCoinbaseHash(this.ins[0].hash)}},{key:"addInput",value:function(t,n,r,i){return Ij(bj.tuple(bj.Hash256bit,bj.UInt32,bj.maybe(bj.UInt32),bj.maybe(bj.Buffer)),arguments),bj.Null(r)&&(r=e.DEFAULT_SEQUENCE),this.ins.push({hash:t,index:n,script:i||Ej,sequence:r,witness:Cj})-1}},{key:"addOutput",value:function(e,t){return Ij(bj.tuple(bj.Buffer,bj.Satoshi),arguments),this.outs.push({script:e,value:t})-1}},{key:"hasWitnesses",value:function(){return this.ins.some((function(e){return 0!==e.witness.length}))}},{key:"weight",value:function(){return 3*this.byteLength(!1)+this.byteLength(!0)}},{key:"virtualSize",value:function(){return Math.ceil(this.weight()/4)}},{key:"byteLength",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=e&&this.hasWitnesses();return(t?10:8)+vj.varuint.encodingLength(this.ins.length)+vj.varuint.encodingLength(this.outs.length)+this.ins.reduce((function(e,t){return e+40+Bj(t.script)}),0)+this.outs.reduce((function(e,t){return e+8+Bj(t.script)}),0)+(t?this.ins.reduce((function(e,t){return e+function(e){var t=e.length;return vj.varuint.encodingLength(t)+e.reduce((function(e,t){return e+Bj(t)}),0)}(t.witness)}),0):0)}},{key:"clone",value:function(){var t=new e;return t.version=this.version,t.locktime=this.locktime,t.ins=this.ins.map((function(e){return{hash:e.hash,index:e.index,script:e.script,sequence:e.sequence,witness:e.witness}})),t.outs=this.outs.map((function(e){return{script:e.script,value:e.value}})),t}},{key:"hashForSignature",value:function(t,n,r){if(Ij(bj.tuple(bj.UInt32,bj.Buffer,bj.Number),arguments),t>=this.ins.length)return kj;var i=mj.compile(mj.decompile(n).filter((function(e){return e!==wj.OPS.OP_CODESEPARATOR}))),o=this.clone();if((31&r)===e.SIGHASH_NONE)o.outs=[],o.ins.forEach((function(e,n){n!==t&&(e.sequence=0)}));else if((31&r)===e.SIGHASH_SINGLE){if(t>=this.outs.length)return kj;o.outs.length=t+1;for(var a=0;a<t;a++)o.outs[a]=Qj;o.ins.forEach((function(e,n){n!==t&&(e.sequence=0)}))}r&e.SIGHASH_ANYONECANPAY?(o.ins=[o.ins[t]],o.ins[0].script=i):(o.ins.forEach((function(e){e.script=Ej})),o.ins[t].script=i);var s=Yo.allocUnsafe(o.byteLength(!1)+4);return s.writeInt32LE(r,s.length-4),o.__toBuffer(s,0,!1),yj.hash256(s)}},{key:"hashForWitnessV1",value:function(t,n,r,i,o,a){if(Ij(bj.tuple(bj.UInt32,Ij.arrayOf(bj.Buffer),Ij.arrayOf(bj.Satoshi),bj.UInt32),arguments),r.length!==this.ins.length||n.length!==this.ins.length)throw new Error("Must supply prevout script and value for all inputs");var s=i===e.SIGHASH_DEFAULT?e.SIGHASH_ALL:i&e.SIGHASH_OUTPUT_MASK,u=(i&e.SIGHASH_INPUT_MASK)===e.SIGHASH_ANYONECANPAY,l=s===e.SIGHASH_NONE,A=s===e.SIGHASH_SINGLE,c=Ej,h=Ej,f=Ej,d=Ej,p=Ej;if(!u){var g=vj.BufferWriter.withCapacity(36*this.ins.length);this.ins.forEach((function(e){g.writeSlice(e.hash),g.writeUInt32(e.index)})),c=yj.sha256(g.end()),g=vj.BufferWriter.withCapacity(8*this.ins.length),r.forEach((function(e){return g.writeUInt64(e)})),h=yj.sha256(g.end()),g=vj.BufferWriter.withCapacity(n.map(Bj).reduce((function(e,t){return e+t}))),n.forEach((function(e){return g.writeVarSlice(e)})),f=yj.sha256(g.end()),g=vj.BufferWriter.withCapacity(4*this.ins.length),this.ins.forEach((function(e){return g.writeUInt32(e.sequence)})),d=yj.sha256(g.end())}if(l||A){if(A&&t<this.outs.length){var v=this.outs[t],y=vj.BufferWriter.withCapacity(8+Bj(v.script));y.writeUInt64(v.value),y.writeVarSlice(v.script),p=yj.sha256(y.end())}}else{var m=this.outs.map((function(e){return 8+Bj(e.script)})).reduce((function(e,t){return e+t})),w=vj.BufferWriter.withCapacity(m);this.outs.forEach((function(e){w.writeUInt64(e.value),w.writeVarSlice(e.script)})),p=yj.sha256(w.end())}var b=(o?2:0)+(a?1:0),I=174-(u?49:0)-(l?32:0)+(a?32:0)+(o?37:0),B=vj.BufferWriter.withCapacity(I);if(B.writeUInt8(i),B.writeInt32(this.version),B.writeUInt32(this.locktime),B.writeSlice(c),B.writeSlice(h),B.writeSlice(f),B.writeSlice(d),l||A||B.writeSlice(p),B.writeUInt8(b),u){var E=this.ins[t];B.writeSlice(E.hash),B.writeUInt32(E.index),B.writeUInt64(r[t]),B.writeVarSlice(n[t]),B.writeUInt32(E.sequence)}else B.writeUInt32(t);if(a){var C=vj.BufferWriter.withCapacity(Bj(a));C.writeVarSlice(a),B.writeSlice(yj.sha256(C.end()))}return A&&B.writeSlice(p),o&&(B.writeSlice(o),B.writeUInt8(0),B.writeUInt32(4294967295)),yj.taggedHash("TapSighash",Yo.concat([Yo.of(0),B.end()]))}},{key:"hashForWitnessV0",value:function(t,n,r,i){Ij(bj.tuple(bj.UInt32,bj.Buffer,bj.Satoshi,bj.UInt32),arguments);var o,a=Yo.from([]),s=xj,u=xj,l=xj;if(i&e.SIGHASH_ANYONECANPAY||(a=Yo.allocUnsafe(36*this.ins.length),o=new vj.BufferWriter(a,0),this.ins.forEach((function(e){o.writeSlice(e.hash),o.writeUInt32(e.index)})),u=yj.hash256(a)),i&e.SIGHASH_ANYONECANPAY||(31&i)===e.SIGHASH_SINGLE||(31&i)===e.SIGHASH_NONE||(a=Yo.allocUnsafe(4*this.ins.length),o=new vj.BufferWriter(a,0),this.ins.forEach((function(e){o.writeUInt32(e.sequence)})),l=yj.hash256(a)),(31&i)!==e.SIGHASH_SINGLE&&(31&i)!==e.SIGHASH_NONE){var A=this.outs.reduce((function(e,t){return e+8+Bj(t.script)}),0);a=Yo.allocUnsafe(A),o=new vj.BufferWriter(a,0),this.outs.forEach((function(e){o.writeUInt64(e.value),o.writeVarSlice(e.script)})),s=yj.hash256(a)}else if((31&i)===e.SIGHASH_SINGLE&&t<this.outs.length){var c=this.outs[t];a=Yo.allocUnsafe(8+Bj(c.script)),(o=new vj.BufferWriter(a,0)).writeUInt64(c.value),o.writeVarSlice(c.script),s=yj.hash256(a)}a=Yo.allocUnsafe(156+Bj(n)),o=new vj.BufferWriter(a,0);var h=this.ins[t];return o.writeInt32(this.version),o.writeSlice(u),o.writeSlice(l),o.writeSlice(h.hash),o.writeUInt32(h.index),o.writeVarSlice(n),o.writeUInt64(r),o.writeUInt32(h.sequence),o.writeSlice(s),o.writeUInt32(this.locktime),o.writeUInt32(i),yj.hash256(a)}},{key:"getHash",value:function(e){return e&&this.isCoinbase()?Yo.alloc(32,0):yj.hash256(this.__toBuffer(void 0,void 0,e))}},{key:"getId",value:function(){return(0,vj.reverseBuffer)(this.getHash(!1)).toString("hex")}},{key:"toBuffer",value:function(e,t){return this.__toBuffer(e,t,!0)}},{key:"toHex",value:function(){return this.toBuffer(void 0,void 0).toString("hex")}},{key:"setInputScript",value:function(e,t){Ij(bj.tuple(bj.Number,bj.Buffer),arguments),this.ins[e].script=t}},{key:"setWitness",value:function(e,t){Ij(bj.tuple(bj.Number,[bj.Buffer]),arguments),this.ins[e].witness=t}},{key:"__toBuffer",value:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];t||(t=Yo.allocUnsafe(this.byteLength(r)));var i=new vj.BufferWriter(t,n||0);i.writeInt32(this.version);var o=r&&this.hasWitnesses();return o&&(i.writeUInt8(e.ADVANCED_TRANSACTION_MARKER),i.writeUInt8(e.ADVANCED_TRANSACTION_FLAG)),i.writeVarInt(this.ins.length),this.ins.forEach((function(e){i.writeSlice(e.hash),i.writeUInt32(e.index),i.writeVarSlice(e.script),i.writeUInt32(e.sequence)})),i.writeVarInt(this.outs.length),this.outs.forEach((function(e){void 0!==e.value?i.writeUInt64(e.value):i.writeSlice(e.valueBuffer),i.writeVarSlice(e.script)})),o&&this.ins.forEach((function(e){i.writeVector(e.witness)})),i.writeUInt32(this.locktime),void 0!==n?t.slice(n,i.offset):t}}],[{key:"fromBuffer",value:function(t,n){var r=new vj.BufferReader(t),i=new e;i.version=r.readInt32();var o=r.readUInt8(),a=r.readUInt8(),s=!1;o===e.ADVANCED_TRANSACTION_MARKER&&a===e.ADVANCED_TRANSACTION_FLAG?s=!0:r.offset-=2;for(var u=r.readVarInt(),l=0;l<u;++l)i.ins.push({hash:r.readSlice(32),index:r.readUInt32(),script:r.readVarSlice(),sequence:r.readUInt32(),witness:Cj});for(var A=r.readVarInt(),c=0;c<A;++c)i.outs.push({value:r.readUInt64(),script:r.readVarSlice()});if(s){for(var h=0;h<u;++h)i.ins[h].witness=r.readVector();if(!i.hasWitnesses())throw new Error("Transaction has superfluous witness data")}if(i.locktime=r.readUInt32(),n)return i;if(r.offset!==t.length)throw new Error("Transaction has unexpected data");return i}},{key:"fromHex",value:function(t){return e.fromBuffer(Yo.from(t,"hex"),!1)}},{key:"isCoinbaseHash",value:function(e){Ij(bj.Hash256bit,e);for(var t=0;t<32;++t)if(0!==e[t])return!1;return!0}}]),e}();gj.Transaction=_j,_j.DEFAULT_SEQUENCE=4294967295,_j.SIGHASH_DEFAULT=0,_j.SIGHASH_ALL=1,_j.SIGHASH_NONE=2,_j.SIGHASH_SINGLE=3,_j.SIGHASH_ANYONECANPAY=128,_j.SIGHASH_OUTPUT_MASK=3,_j.SIGHASH_INPUT_MASK=128,_j.ADVANCED_TRANSACTION_MARKER=0,_j.ADVANCED_TRANSACTION_FLAG=1,Object.defineProperty(nj,"__esModule",{value:!0}),nj.Block=void 0;var Nj=rj,Dj=WL,Fj=pj,Pj=gj,Uj=OU,Lj=Uj.typeforce,Mj=new TypeError("Cannot compute merkle root for zero transactions"),Tj=new TypeError("Cannot compute witness commit for non-segwit block"),Rj=function(){function e(){s(this,e),this.version=1,this.prevHash=void 0,this.merkleRoot=void 0,this.timestamp=0,this.witnessCommit=void 0,this.bits=0,this.nonce=0,this.transactions=void 0}return l(e,[{key:"getWitnessCommit",value:function(){if(!Oj(this.transactions))return null;var e=this.transactions[0].outs.filter((function(e){return e.script.slice(0,6).equals(Yo.from("6a24aa21a9ed","hex"))})).map((function(e){return e.script.slice(6,38)}));if(0===e.length)return null;var t=e[e.length-1];return t instanceof Yo&&32===t.length?t:null}},{key:"hasWitnessCommit",value:function(){return this.witnessCommit instanceof Yo&&32===this.witnessCommit.length||null!==this.getWitnessCommit()}},{key:"hasWitness",value:function(){return(e=this.transactions)instanceof Array&&e.some((function(e){return"object"==i(e)&&e.ins instanceof Array&&e.ins.some((function(e){return"object"==i(e)&&e.witness instanceof Array&&e.witness.length>0}))}));var e}},{key:"weight",value:function(){return 3*this.byteLength(!1,!1)+this.byteLength(!1,!0)}},{key:"byteLength",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return e||!this.transactions?80:80+Nj.varuint.encodingLength(this.transactions.length)+this.transactions.reduce((function(e,n){return e+n.byteLength(t)}),0)}},{key:"getHash",value:function(){return Dj.hash256(this.toBuffer(!0))}},{key:"getId",value:function(){return(0,Nj.reverseBuffer)(this.getHash()).toString("hex")}},{key:"getUTCDate",value:function(){var e=new Date(0);return e.setUTCSeconds(this.timestamp),e}},{key:"toBuffer",value:function(e){var t=Yo.allocUnsafe(this.byteLength(e)),n=new Nj.BufferWriter(t);return n.writeInt32(this.version),n.writeSlice(this.prevHash),n.writeSlice(this.merkleRoot),n.writeUInt32(this.timestamp),n.writeUInt32(this.bits),n.writeUInt32(this.nonce),e||!this.transactions||(Nj.varuint.encode(this.transactions.length,t,n.offset),n.offset+=Nj.varuint.encode.bytes,this.transactions.forEach((function(e){var r=e.byteLength();e.toBuffer(t,n.offset),n.offset+=r}))),t}},{key:"toHex",value:function(e){return this.toBuffer(e).toString("hex")}},{key:"checkTxRoots",value:function(){var e=this.hasWitnessCommit();return!(!e&&this.hasWitness())&&this.__checkMerkleRoot()&&(!e||this.__checkWitnessCommit())}},{key:"checkProofOfWork",value:function(){var t=(0,Nj.reverseBuffer)(this.getHash()),n=e.calculateTarget(this.bits);return t.compare(n)<=0}},{key:"__checkMerkleRoot",value:function(){if(!this.transactions)throw Mj;var t=e.calculateMerkleRoot(this.transactions);return 0===this.merkleRoot.compare(t)}},{key:"__checkWitnessCommit",value:function(){if(!this.transactions)throw Mj;if(!this.hasWitnessCommit())throw Tj;var t=e.calculateMerkleRoot(this.transactions,!0);return 0===this.witnessCommit.compare(t)}}],[{key:"fromBuffer",value:function(t){if(t.length<80)throw new Error("Buffer too small (< 80 bytes)");var n=new Nj.BufferReader(t),r=new e;if(r.version=n.readInt32(),r.prevHash=n.readSlice(32),r.merkleRoot=n.readSlice(32),r.timestamp=n.readUInt32(),r.bits=n.readUInt32(),r.nonce=n.readUInt32(),80===t.length)return r;var i=function(){var e=Pj.Transaction.fromBuffer(n.buffer.slice(n.offset),!0);return n.offset+=e.byteLength(),e},o=n.readVarInt();r.transactions=[];for(var a=0;a<o;++a){var s=i();r.transactions.push(s)}var u=r.getWitnessCommit();return u&&(r.witnessCommit=u),r}},{key:"fromHex",value:function(t){return e.fromBuffer(Yo.from(t,"hex"))}},{key:"calculateTarget",value:function(e){var t=((4278190080&e)>>24)-3,n=8388607&e,r=Yo.alloc(32,0);return r.writeUIntBE(n,29-t,3),r}},{key:"calculateMerkleRoot",value:function(e,t){if(Lj([{getHash:Uj.Function}],e),0===e.length)throw Mj;if(t&&!Oj(e))throw Tj;var n=e.map((function(e){return e.getHash(t)})),r=(0,Fj.fastMerkleRoot)(n,Dj.hash256);return t?Dj.hash256(Yo.concat([r,e[0].ins[0].witness[0]])):r}}]),e}();function Oj(e){return e instanceof Array&&e[0]&&e[0].ins&&e[0].ins instanceof Array&&e[0].ins[0]&&e[0].ins[0].witness&&e[0].ins[0].witness instanceof Array&&e[0].ins[0].witness.length>0}nj.Block=Rj;var Hj={},Kj={},jj={},Gj={},qj={},Vj={},zj={};!function(e){var t,n,r;Object.defineProperty(e,"__esModule",{value:!0}),(t=e.GlobalTypes||(e.GlobalTypes={}))[t.UNSIGNED_TX=0]="UNSIGNED_TX",t[t.GLOBAL_XPUB=1]="GLOBAL_XPUB",e.GLOBAL_TYPE_NAMES=["unsignedTx","globalXpub"],(n=e.InputTypes||(e.InputTypes={}))[n.NON_WITNESS_UTXO=0]="NON_WITNESS_UTXO",n[n.WITNESS_UTXO=1]="WITNESS_UTXO",n[n.PARTIAL_SIG=2]="PARTIAL_SIG",n[n.SIGHASH_TYPE=3]="SIGHASH_TYPE",n[n.REDEEM_SCRIPT=4]="REDEEM_SCRIPT",n[n.WITNESS_SCRIPT=5]="WITNESS_SCRIPT",n[n.BIP32_DERIVATION=6]="BIP32_DERIVATION",n[n.FINAL_SCRIPTSIG=7]="FINAL_SCRIPTSIG",n[n.FINAL_SCRIPTWITNESS=8]="FINAL_SCRIPTWITNESS",n[n.POR_COMMITMENT=9]="POR_COMMITMENT",n[n.TAP_KEY_SIG=19]="TAP_KEY_SIG",n[n.TAP_SCRIPT_SIG=20]="TAP_SCRIPT_SIG",n[n.TAP_LEAF_SCRIPT=21]="TAP_LEAF_SCRIPT",n[n.TAP_BIP32_DERIVATION=22]="TAP_BIP32_DERIVATION",n[n.TAP_INTERNAL_KEY=23]="TAP_INTERNAL_KEY",n[n.TAP_MERKLE_ROOT=24]="TAP_MERKLE_ROOT",e.INPUT_TYPE_NAMES=["nonWitnessUtxo","witnessUtxo","partialSig","sighashType","redeemScript","witnessScript","bip32Derivation","finalScriptSig","finalScriptWitness","porCommitment","tapKeySig","tapScriptSig","tapLeafScript","tapBip32Derivation","tapInternalKey","tapMerkleRoot"],(r=e.OutputTypes||(e.OutputTypes={}))[r.REDEEM_SCRIPT=0]="REDEEM_SCRIPT",r[r.WITNESS_SCRIPT=1]="WITNESS_SCRIPT",r[r.BIP32_DERIVATION=2]="BIP32_DERIVATION",r[r.TAP_INTERNAL_KEY=5]="TAP_INTERNAL_KEY",r[r.TAP_TREE=6]="TAP_TREE",r[r.TAP_BIP32_DERIVATION=7]="TAP_BIP32_DERIVATION",e.OUTPUT_TYPE_NAMES=["redeemScript","witnessScript","bip32Derivation","tapInternalKey","tapTree","tapBip32Derivation"]}(zj);var Jj={};Object.defineProperty(Jj,"__esModule",{value:!0});var Yj=zj;Jj.decode=function(e){if(e.key[0]!==Yj.GlobalTypes.GLOBAL_XPUB)throw new Error("Decode Error: could not decode globalXpub with key 0x"+e.key.toString("hex"));if(79!==e.key.length||![2,3].includes(e.key[46]))throw new Error("Decode Error: globalXpub has invalid extended pubkey in key 0x"+e.key.toString("hex"));if(e.value.length/4%1!=0)throw new Error("Decode Error: Global GLOBAL_XPUB value length should be multiple of 4");for(var t,n=e.key.slice(1),r={masterFingerprint:e.value.slice(0,4),extendedPubkey:n,path:"m"},i=0,o=(t=e.value.length/4-1,k(Array(t).keys()));i<o.length;i++){var a=o[i],s=e.value.readUInt32LE(4*a+4),u=!!(2147483648&s),l=2147483647&s;r.path+="/"+l.toString(10)+(u?"'":"")}return r},Jj.encode=function(e){var t=Yo.from([Yj.GlobalTypes.GLOBAL_XPUB]),n=Yo.concat([t,e.extendedPubkey]),r=e.path.split("/"),i=Yo.allocUnsafe(4*r.length);e.masterFingerprint.copy(i,0);var o=4;return r.slice(1).forEach((function(e){var t="'"===e.slice(-1),n=2147483647&parseInt(t?e.slice(0,-1):e,10);t&&(n+=2147483648),i.writeUInt32LE(n,o),o+=4})),{key:n,value:i}},Jj.expected="{ masterFingerprint: Buffer; extendedPubkey: Buffer; path: string; }",Jj.check=function(e){var t=e.extendedPubkey,n=e.masterFingerprint,r=e.path;return Na(t)&&78===t.length&&[2,3].indexOf(t[45])>-1&&Na(n)&&4===n.length&&"string"==typeof r&&!!r.match(/^m(\/\d+'?)*$/)},Jj.canAddToArray=function(e,t,n){var r=t.extendedPubkey.toString("hex");return!n.has(r)&&(n.add(r),0===e.filter((function(e){return e.extendedPubkey.equals(t.extendedPubkey)})).length)};var Xj={};Object.defineProperty(Xj,"__esModule",{value:!0});var Wj=zj;Xj.encode=function(e){return{key:Yo.from([Wj.GlobalTypes.UNSIGNED_TX]),value:e.toBuffer()}};var Zj={};Object.defineProperty(Zj,"__esModule",{value:!0});var $j=zj;Zj.decode=function(e){if(e.key[0]!==$j.InputTypes.FINAL_SCRIPTSIG)throw new Error("Decode Error: could not decode finalScriptSig with key 0x"+e.key.toString("hex"));return e.value},Zj.encode=function(e){return{key:Yo.from([$j.InputTypes.FINAL_SCRIPTSIG]),value:e}},Zj.expected="Buffer",Zj.check=function(e){return Na(e)},Zj.canAdd=function(e,t){return!!e&&!!t&&void 0===e.finalScriptSig};var eG={};Object.defineProperty(eG,"__esModule",{value:!0});var tG=zj;eG.decode=function(e){if(e.key[0]!==tG.InputTypes.FINAL_SCRIPTWITNESS)throw new Error("Decode Error: could not decode finalScriptWitness with key 0x"+e.key.toString("hex"));return e.value},eG.encode=function(e){return{key:Yo.from([tG.InputTypes.FINAL_SCRIPTWITNESS]),value:e}},eG.expected="Buffer",eG.check=function(e){return Na(e)},eG.canAdd=function(e,t){return!!e&&!!t&&void 0===e.finalScriptWitness};var nG={};Object.defineProperty(nG,"__esModule",{value:!0});var rG=zj;nG.decode=function(e){if(e.key[0]!==rG.InputTypes.NON_WITNESS_UTXO)throw new Error("Decode Error: could not decode nonWitnessUtxo with key 0x"+e.key.toString("hex"));return e.value},nG.encode=function(e){return{key:Yo.from([rG.InputTypes.NON_WITNESS_UTXO]),value:e}},nG.expected="Buffer",nG.check=function(e){return Na(e)},nG.canAdd=function(e,t){return!!e&&!!t&&void 0===e.nonWitnessUtxo};var iG={};Object.defineProperty(iG,"__esModule",{value:!0});var oG=zj;iG.decode=function(e){if(e.key[0]!==oG.InputTypes.PARTIAL_SIG)throw new Error("Decode Error: could not decode partialSig with key 0x"+e.key.toString("hex"));if(34!==e.key.length&&66!==e.key.length||![2,3,4].includes(e.key[1]))throw new Error("Decode Error: partialSig has invalid pubkey in key 0x"+e.key.toString("hex"));return{pubkey:e.key.slice(1),signature:e.value}},iG.encode=function(e){var t=Yo.from([oG.InputTypes.PARTIAL_SIG]);return{key:Yo.concat([t,e.pubkey]),value:e.signature}},iG.expected="{ pubkey: Buffer; signature: Buffer; }",iG.check=function(e){return Na(e.pubkey)&&Na(e.signature)&&[33,65].includes(e.pubkey.length)&&[2,3,4].includes(e.pubkey[0])&&function(e){if(!Na(e)||e.length<9)return!1;if(48!==e[0])return!1;if(e.length!==e[1]+3)return!1;if(2!==e[2])return!1;var t=e[3];if(t>33||t<1)return!1;if(2!==e[3+t+1])return!1;var n=e[3+t+2];return!(n>33||n<1)&&e.length===3+t+2+n+2}(e.signature)},iG.canAddToArray=function(e,t,n){var r=t.pubkey.toString("hex");return!n.has(r)&&(n.add(r),0===e.filter((function(e){return e.pubkey.equals(t.pubkey)})).length)};var aG={};Object.defineProperty(aG,"__esModule",{value:!0});var sG=zj;aG.decode=function(e){if(e.key[0]!==sG.InputTypes.POR_COMMITMENT)throw new Error("Decode Error: could not decode porCommitment with key 0x"+e.key.toString("hex"));return e.value.toString("utf8")},aG.encode=function(e){return{key:Yo.from([sG.InputTypes.POR_COMMITMENT]),value:Yo.from(e,"utf8")}},aG.expected="string",aG.check=function(e){return"string"==typeof e},aG.canAdd=function(e,t){return!!e&&!!t&&void 0===e.porCommitment};var uG={};Object.defineProperty(uG,"__esModule",{value:!0});var lG=zj;uG.decode=function(e){if(e.key[0]!==lG.InputTypes.SIGHASH_TYPE)throw new Error("Decode Error: could not decode sighashType with key 0x"+e.key.toString("hex"));return e.value.readUInt32LE(0)},uG.encode=function(e){var t=Yo.from([lG.InputTypes.SIGHASH_TYPE]),n=Yo.allocUnsafe(4);return n.writeUInt32LE(e,0),{key:t,value:n}},uG.expected="number",uG.check=function(e){return"number"==typeof e},uG.canAdd=function(e,t){return!!e&&!!t&&void 0===e.sighashType};var AG={};Object.defineProperty(AG,"__esModule",{value:!0});var cG=zj;function hG(e){return Na(e)&&(64===e.length||65===e.length)}AG.decode=function(e){if(e.key[0]!==cG.InputTypes.TAP_KEY_SIG||1!==e.key.length)throw new Error("Decode Error: could not decode tapKeySig with key 0x"+e.key.toString("hex"));if(!hG(e.value))throw new Error("Decode Error: tapKeySig not a valid 64-65-byte BIP340 signature");return e.value},AG.encode=function(e){return{key:Yo.from([cG.InputTypes.TAP_KEY_SIG]),value:e}},AG.expected="Buffer",AG.check=hG,AG.canAdd=function(e,t){return!!e&&!!t&&void 0===e.tapKeySig};var fG={};Object.defineProperty(fG,"__esModule",{value:!0});var dG=zj;fG.decode=function(e){if(e.key[0]!==dG.InputTypes.TAP_LEAF_SCRIPT)throw new Error("Decode Error: could not decode tapLeafScript with key 0x"+e.key.toString("hex"));if((e.key.length-2)%32!=0)throw new Error("Decode Error: tapLeafScript has invalid control block in key 0x"+e.key.toString("hex"));var t=e.value[e.value.length-1];if((254&e.key[1])!==t)throw new Error("Decode Error: tapLeafScript bad leaf version in key 0x"+e.key.toString("hex"));var n=e.value.slice(0,-1);return{controlBlock:e.key.slice(1),script:n,leafVersion:t}},fG.encode=function(e){var t=Yo.from([dG.InputTypes.TAP_LEAF_SCRIPT]),n=Yo.from([e.leafVersion]);return{key:Yo.concat([t,e.controlBlock]),value:Yo.concat([e.script,n])}},fG.expected="{ controlBlock: Buffer; leafVersion: number, script: Buffer; }",fG.check=function(e){return Na(e.controlBlock)&&(e.controlBlock.length-1)%32==0&&(254&e.controlBlock[0])===e.leafVersion&&Na(e.script)},fG.canAddToArray=function(e,t,n){var r=t.controlBlock.toString("hex");return!n.has(r)&&(n.add(r),0===e.filter((function(e){return e.controlBlock.equals(t.controlBlock)})).length)};var pG={};Object.defineProperty(pG,"__esModule",{value:!0});var gG=zj;function vG(e){return Na(e)&&32===e.length}pG.decode=function(e){if(e.key[0]!==gG.InputTypes.TAP_MERKLE_ROOT||1!==e.key.length)throw new Error("Decode Error: could not decode tapMerkleRoot with key 0x"+e.key.toString("hex"));if(!vG(e.value))throw new Error("Decode Error: tapMerkleRoot not a 32-byte hash");return e.value},pG.encode=function(e){return{key:Yo.from([gG.InputTypes.TAP_MERKLE_ROOT]),value:e}},pG.expected="Buffer",pG.check=vG,pG.canAdd=function(e,t){return!!e&&!!t&&void 0===e.tapMerkleRoot};var yG={};Object.defineProperty(yG,"__esModule",{value:!0});var mG=zj;yG.decode=function(e){if(e.key[0]!==mG.InputTypes.TAP_SCRIPT_SIG)throw new Error("Decode Error: could not decode tapScriptSig with key 0x"+e.key.toString("hex"));if(65!==e.key.length)throw new Error("Decode Error: tapScriptSig has invalid key 0x"+e.key.toString("hex"));if(64!==e.value.length&&65!==e.value.length)throw new Error("Decode Error: tapScriptSig has invalid signature in key 0x"+e.key.toString("hex"));return{pubkey:e.key.slice(1,33),leafHash:e.key.slice(33),signature:e.value}},yG.encode=function(e){var t=Yo.from([mG.InputTypes.TAP_SCRIPT_SIG]);return{key:Yo.concat([t,e.pubkey,e.leafHash]),value:e.signature}},yG.expected="{ pubkey: Buffer; leafHash: Buffer; signature: Buffer; }",yG.check=function(e){return Na(e.pubkey)&&Na(e.leafHash)&&Na(e.signature)&&32===e.pubkey.length&&32===e.leafHash.length&&(64===e.signature.length||65===e.signature.length)},yG.canAddToArray=function(e,t,n){var r=t.pubkey.toString("hex")+t.leafHash.toString("hex");return!n.has(r)&&(n.add(r),0===e.filter((function(e){return e.pubkey.equals(t.pubkey)&&e.leafHash.equals(t.leafHash)})).length)};var wG={},bG={},IG={};function BG(e){if(e<0||e>9007199254740991||e%1!=0)throw new RangeError("value out of range")}function EG(e){return BG(e),e<253?1:e<=65535?3:e<=4294967295?5:9}Object.defineProperty(IG,"__esModule",{value:!0}),IG.encode=function e(t,n,r){if(BG(t),n||(n=Yo.allocUnsafe(EG(t))),!Na(n))throw new TypeError("buffer must be a Buffer instance");return r||(r=0),t<253?(n.writeUInt8(t,r),Object.assign(e,{bytes:1})):t<=65535?(n.writeUInt8(253,r),n.writeUInt16LE(t,r+1),Object.assign(e,{bytes:3})):t<=4294967295?(n.writeUInt8(254,r),n.writeUInt32LE(t,r+1),Object.assign(e,{bytes:5})):(n.writeUInt8(255,r),n.writeUInt32LE(t>>>0,r+1),n.writeUInt32LE(t/4294967296|0,r+5),Object.assign(e,{bytes:9})),n},IG.decode=function e(t,n){if(!Na(t))throw new TypeError("buffer must be a Buffer instance");n||(n=0);var r=t.readUInt8(n);if(r<253)return Object.assign(e,{bytes:1}),r;if(253===r)return Object.assign(e,{bytes:3}),t.readUInt16LE(n+1);if(254===r)return Object.assign(e,{bytes:5}),t.readUInt32LE(n+1);Object.assign(e,{bytes:9});var i=t.readUInt32LE(n+1),o=4294967296*t.readUInt32LE(n+5)+i;return BG(o),o},IG.encodingLength=EG,Object.defineProperty(bG,"__esModule",{value:!0});var CG=IG;function xG(e){var t=e.key.length,n=e.value.length,r=CG.encodingLength(t),i=CG.encodingLength(n),o=Yo.allocUnsafe(r+t+i+n);return CG.encode(t,o,0),e.key.copy(o,r),CG.encode(n,o,r+t),e.value.copy(o,r+t+i),o}function kG(e,t){if("number"!=typeof e)throw new Error("cannot write a non-number as a number");if(e<0)throw new Error("specified a negative value for writing an unsigned value");if(e>t)throw new Error("RangeError: value out of range");if(Math.floor(e)!==e)throw new Error("value has a fractional component")}bG.range=function(e){return k(Array(e).keys())},bG.reverseBuffer=function(e){if(e.length<1)return e;for(var t=e.length-1,n=0,r=0;r<e.length/2;r++)n=e[r],e[r]=e[t],e[t]=n,t--;return e},bG.keyValsToBuffer=function(e){var t=e.map(xG);return t.push(Yo.from([0])),Yo.concat(t)},bG.keyValToBuffer=xG,bG.readUInt64LE=function(e,t){var n=e.readUInt32LE(t),r=e.readUInt32LE(t+4);return kG((r*=4294967296)+n,9007199254740991),r+n},bG.writeUInt64LE=function(e,t,n){return kG(t,9007199254740991),e.writeInt32LE(-1&t,n),e.writeUInt32LE(Math.floor(t/4294967296),n+4),n+8},Object.defineProperty(wG,"__esModule",{value:!0});var SG=zj,QG=bG,_G=IG;wG.decode=function(e){if(e.key[0]!==SG.InputTypes.WITNESS_UTXO)throw new Error("Decode Error: could not decode witnessUtxo with key 0x"+e.key.toString("hex"));var t=QG.readUInt64LE(e.value,0),n=8,r=_G.decode(e.value,n);n+=_G.encodingLength(r);var i=e.value.slice(n);if(i.length!==r)throw new Error("Decode Error: WITNESS_UTXO script is not proper length");return{script:i,value:t}},wG.encode=function(e){var t=e.script,n=e.value,r=_G.encodingLength(t.length),i=Yo.allocUnsafe(8+r+t.length);return QG.writeUInt64LE(i,n,0),_G.encode(t.length,i,8),t.copy(i,8+r),{key:Yo.from([SG.InputTypes.WITNESS_UTXO]),value:i}},wG.expected="{ script: Buffer; value: number; }",wG.check=function(e){return Na(e.script)&&"number"==typeof e.value},wG.canAdd=function(e,t){return!!e&&!!t&&void 0===e.witnessUtxo};var NG={};Object.defineProperty(NG,"__esModule",{value:!0});var DG=zj,FG=IG;NG.decode=function(e){if(e.key[0]!==DG.OutputTypes.TAP_TREE||1!==e.key.length)throw new Error("Decode Error: could not decode tapTree with key 0x"+e.key.toString("hex"));for(var t=0,n=[];t<e.value.length;){var r=e.value[t++],i=e.value[t++],o=FG.decode(e.value,t);t+=FG.encodingLength(o),n.push({depth:r,leafVersion:i,script:e.value.slice(t,t+o)}),t+=o}return{leaves:n}},NG.encode=function(e){var t,n=Yo.from([DG.OutputTypes.TAP_TREE]),r=(t=[]).concat.apply(t,k(e.leaves.map((function(e){return[Yo.of(e.depth,e.leafVersion),FG.encode(e.script.length),e.script]}))));return{key:n,value:Yo.concat(r)}},NG.expected="{ leaves: [{ depth: number; leafVersion: number, script: Buffer; }] }",NG.check=function(e){return Array.isArray(e.leaves)&&e.leaves.every((function(e){return e.depth>=0&&e.depth<=128&&(254&e.leafVersion)===e.leafVersion&&Na(e.script)}))},NG.canAdd=function(e,t){return!!e&&!!t&&void 0===e.tapTree};var PG={};Object.defineProperty(PG,"__esModule",{value:!0});var UG=function(e){return 33===e.length&&[2,3].includes(e[0])||65===e.length&&4===e[0]};PG.makeConverter=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:UG;return{decode:function(n){if(n.key[0]!==e)throw new Error("Decode Error: could not decode bip32Derivation with key 0x"+n.key.toString("hex"));var r=n.key.slice(1);if(!t(r))throw new Error("Decode Error: bip32Derivation has invalid pubkey in key 0x"+n.key.toString("hex"));if(n.value.length/4%1!=0)throw new Error("Decode Error: Input BIP32_DERIVATION value length should be multiple of 4");for(var i,o={masterFingerprint:n.value.slice(0,4),pubkey:r,path:"m"},a=0,s=(i=n.value.length/4-1,k(Array(i).keys()));a<s.length;a++){var u=s[a],l=n.value.readUInt32LE(4*u+4),A=!!(2147483648&l),c=2147483647&l;o.path+="/"+c.toString(10)+(A?"'":"")}return o},encode:function(t){var n=Yo.from([e]),r=Yo.concat([n,t.pubkey]),i=t.path.split("/"),o=Yo.allocUnsafe(4*i.length);t.masterFingerprint.copy(o,0);var a=4;return i.slice(1).forEach((function(e){var t="'"===e.slice(-1),n=2147483647&parseInt(t?e.slice(0,-1):e,10);t&&(n+=2147483648),o.writeUInt32LE(n,a),a+=4})),{key:r,value:o}},check:function(e){return Na(e.pubkey)&&Na(e.masterFingerprint)&&"string"==typeof e.path&&t(e.pubkey)&&4===e.masterFingerprint.length},expected:"{ masterFingerprint: Buffer; pubkey: Buffer; path: string; }",canAddToArray:function(e,t,n){var r=t.pubkey.toString("hex");return!n.has(r)&&(n.add(r),0===e.filter((function(e){return e.pubkey.equals(t.pubkey)})).length)}}};var LG={};Object.defineProperty(LG,"__esModule",{value:!0}),LG.makeChecker=function(e){return function(t){var n;if(e.includes(t.key[0])&&(33!==(n=t.key.slice(1)).length&&65!==n.length||![2,3,4].includes(n[0])))throw new Error("Format Error: invalid pubkey in key 0x"+t.key.toString("hex"));return n}};var MG={};Object.defineProperty(MG,"__esModule",{value:!0}),MG.makeConverter=function(e){return{decode:function(t){if(t.key[0]!==e)throw new Error("Decode Error: could not decode redeemScript with key 0x"+t.key.toString("hex"));return t.value},encode:function(t){return{key:Yo.from([e]),value:t}},check:function(e){return Na(e)},expected:"Buffer",canAdd:function(e,t){return!!e&&!!t&&void 0===e.redeemScript}}};var TG={};Object.defineProperty(TG,"__esModule",{value:!0});var RG=IG,OG=PG,HG=function(e){return 32===e.length};TG.makeConverter=function(e){var t=OG.makeConverter(e,HG);return{decode:function(e){for(var n=RG.decode(e.value),r=RG.encodingLength(n),i=t.decode({key:e.key,value:e.value.slice(r+32*n)}),o=new Array(n),a=0,s=r;a<n;a++,s+=32)o[a]=e.value.slice(s,s+32);return Object.assign({},i,{leafHashes:o})},encode:function(e){var n=t.encode(e),r=RG.encodingLength(e.leafHashes.length),i=Yo.allocUnsafe(r);RG.encode(e.leafHashes.length,i);var o=Yo.concat([i].concat(k(e.leafHashes),[n.value]));return Object.assign({},n,{value:o})},check:function(e){return Array.isArray(e.leafHashes)&&e.leafHashes.every((function(e){return Na(e)&&32===e.length}))&&t.check(e)},expected:"{ masterFingerprint: Buffer; pubkey: Buffer; path: string; leafHashes: Buffer[]; }",canAddToArray:t.canAddToArray}};var KG={};Object.defineProperty(KG,"__esModule",{value:!0}),KG.makeConverter=function(e){return{decode:function(t){if(t.key[0]!==e||1!==t.key.length)throw new Error("Decode Error: could not decode tapInternalKey with key 0x"+t.key.toString("hex"));if(32!==t.value.length)throw new Error("Decode Error: tapInternalKey not a 32-byte x-only pubkey");return t.value},encode:function(t){return{key:Yo.from([e]),value:t}},check:function(e){return Na(e)&&32===e.length},expected:"Buffer",canAdd:function(e,t){return!!e&&!!t&&void 0===e.tapInternalKey}}};var jG={};Object.defineProperty(jG,"__esModule",{value:!0}),jG.makeConverter=function(e){return{decode:function(t){if(t.key[0]!==e)throw new Error("Decode Error: could not decode witnessScript with key 0x"+t.key.toString("hex"));return t.value},encode:function(t){return{key:Yo.from([e]),value:t}},check:function(e){return Na(e)},expected:"Buffer",canAdd:function(e,t){return!!e&&!!t&&void 0===e.witnessScript}}},Object.defineProperty(Vj,"__esModule",{value:!0});var GG=zj,qG=Zj,VG=eG,zG=nG,JG=iG,YG=aG,XG=uG,WG=AG,ZG=fG,$G=pG,eq=yG,tq=wG,nq=NG,rq=PG,iq=LG,oq=MG,aq=TG,sq=KG,uq=jG,lq={unsignedTx:Xj,globalXpub:Jj,checkPubkey:iq.makeChecker([])};Vj.globals=lq;var Aq={nonWitnessUtxo:zG,partialSig:JG,sighashType:XG,finalScriptSig:qG,finalScriptWitness:VG,porCommitment:YG,witnessUtxo:tq,bip32Derivation:rq.makeConverter(GG.InputTypes.BIP32_DERIVATION),redeemScript:oq.makeConverter(GG.InputTypes.REDEEM_SCRIPT),witnessScript:uq.makeConverter(GG.InputTypes.WITNESS_SCRIPT),checkPubkey:iq.makeChecker([GG.InputTypes.PARTIAL_SIG,GG.InputTypes.BIP32_DERIVATION]),tapKeySig:WG,tapScriptSig:eq,tapLeafScript:ZG,tapBip32Derivation:aq.makeConverter(GG.InputTypes.TAP_BIP32_DERIVATION),tapInternalKey:sq.makeConverter(GG.InputTypes.TAP_INTERNAL_KEY),tapMerkleRoot:$G};Vj.inputs=Aq;var cq={bip32Derivation:rq.makeConverter(GG.OutputTypes.BIP32_DERIVATION),redeemScript:oq.makeConverter(GG.OutputTypes.REDEEM_SCRIPT),witnessScript:uq.makeConverter(GG.OutputTypes.WITNESS_SCRIPT),checkPubkey:iq.makeChecker([GG.OutputTypes.BIP32_DERIVATION]),tapBip32Derivation:aq.makeConverter(GG.OutputTypes.TAP_BIP32_DERIVATION),tapTree:nq,tapInternalKey:sq.makeConverter(GG.OutputTypes.TAP_INTERNAL_KEY)};Vj.outputs=cq,Object.defineProperty(qj,"__esModule",{value:!0});var hq=Vj,fq=bG,dq=IG,pq=zj;function gq(e,t,n){if(!t.equals(Yo.from([n])))throw new Error("Format Error: Invalid ".concat(e," key: ").concat(t.toString("hex")))}function vq(e,t){var n,r=t.globalMapKeyVals,i=t.inputKeyVals,o=t.outputKeyVals,a={unsignedTx:e},s=0,u=F(r);try{for(u.s();!(n=u.n()).done;){var l=n.value;switch(l.key[0]){case pq.GlobalTypes.UNSIGNED_TX:if(gq("global",l.key,pq.GlobalTypes.UNSIGNED_TX),s>0)throw new Error("Format Error: GlobalMap has multiple UNSIGNED_TX");s++;break;case pq.GlobalTypes.GLOBAL_XPUB:void 0===a.globalXpub&&(a.globalXpub=[]),a.globalXpub.push(hq.globals.globalXpub.decode(l));break;default:a.unknownKeyVals||(a.unknownKeyVals=[]),a.unknownKeyVals.push(l)}}}catch(e){u.e(e)}finally{u.f()}var A,c=i.length,h=o.length,f=[],d=[],p=F(fq.range(c));try{for(p.s();!(A=p.n()).done;){var g,v=A.value,y={},m=F(i[v]);try{for(m.s();!(g=m.n()).done;){var w=g.value;switch(hq.inputs.checkPubkey(w),w.key[0]){case pq.InputTypes.NON_WITNESS_UTXO:if(gq("input",w.key,pq.InputTypes.NON_WITNESS_UTXO),void 0!==y.nonWitnessUtxo)throw new Error("Format Error: Input has multiple NON_WITNESS_UTXO");y.nonWitnessUtxo=hq.inputs.nonWitnessUtxo.decode(w);break;case pq.InputTypes.WITNESS_UTXO:if(gq("input",w.key,pq.InputTypes.WITNESS_UTXO),void 0!==y.witnessUtxo)throw new Error("Format Error: Input has multiple WITNESS_UTXO");y.witnessUtxo=hq.inputs.witnessUtxo.decode(w);break;case pq.InputTypes.PARTIAL_SIG:void 0===y.partialSig&&(y.partialSig=[]),y.partialSig.push(hq.inputs.partialSig.decode(w));break;case pq.InputTypes.SIGHASH_TYPE:if(gq("input",w.key,pq.InputTypes.SIGHASH_TYPE),void 0!==y.sighashType)throw new Error("Format Error: Input has multiple SIGHASH_TYPE");y.sighashType=hq.inputs.sighashType.decode(w);break;case pq.InputTypes.REDEEM_SCRIPT:if(gq("input",w.key,pq.InputTypes.REDEEM_SCRIPT),void 0!==y.redeemScript)throw new Error("Format Error: Input has multiple REDEEM_SCRIPT");y.redeemScript=hq.inputs.redeemScript.decode(w);break;case pq.InputTypes.WITNESS_SCRIPT:if(gq("input",w.key,pq.InputTypes.WITNESS_SCRIPT),void 0!==y.witnessScript)throw new Error("Format Error: Input has multiple WITNESS_SCRIPT");y.witnessScript=hq.inputs.witnessScript.decode(w);break;case pq.InputTypes.BIP32_DERIVATION:void 0===y.bip32Derivation&&(y.bip32Derivation=[]),y.bip32Derivation.push(hq.inputs.bip32Derivation.decode(w));break;case pq.InputTypes.FINAL_SCRIPTSIG:gq("input",w.key,pq.InputTypes.FINAL_SCRIPTSIG),y.finalScriptSig=hq.inputs.finalScriptSig.decode(w);break;case pq.InputTypes.FINAL_SCRIPTWITNESS:gq("input",w.key,pq.InputTypes.FINAL_SCRIPTWITNESS),y.finalScriptWitness=hq.inputs.finalScriptWitness.decode(w);break;case pq.InputTypes.POR_COMMITMENT:gq("input",w.key,pq.InputTypes.POR_COMMITMENT),y.porCommitment=hq.inputs.porCommitment.decode(w);break;case pq.InputTypes.TAP_KEY_SIG:gq("input",w.key,pq.InputTypes.TAP_KEY_SIG),y.tapKeySig=hq.inputs.tapKeySig.decode(w);break;case pq.InputTypes.TAP_SCRIPT_SIG:void 0===y.tapScriptSig&&(y.tapScriptSig=[]),y.tapScriptSig.push(hq.inputs.tapScriptSig.decode(w));break;case pq.InputTypes.TAP_LEAF_SCRIPT:void 0===y.tapLeafScript&&(y.tapLeafScript=[]),y.tapLeafScript.push(hq.inputs.tapLeafScript.decode(w));break;case pq.InputTypes.TAP_BIP32_DERIVATION:void 0===y.tapBip32Derivation&&(y.tapBip32Derivation=[]),y.tapBip32Derivation.push(hq.inputs.tapBip32Derivation.decode(w));break;case pq.InputTypes.TAP_INTERNAL_KEY:gq("input",w.key,pq.InputTypes.TAP_INTERNAL_KEY),y.tapInternalKey=hq.inputs.tapInternalKey.decode(w);break;case pq.InputTypes.TAP_MERKLE_ROOT:gq("input",w.key,pq.InputTypes.TAP_MERKLE_ROOT),y.tapMerkleRoot=hq.inputs.tapMerkleRoot.decode(w);break;default:y.unknownKeyVals||(y.unknownKeyVals=[]),y.unknownKeyVals.push(w)}}}catch(e){m.e(e)}finally{m.f()}f.push(y)}}catch(e){p.e(e)}finally{p.f()}var b,I=F(fq.range(h));try{for(I.s();!(b=I.n()).done;){var B,E=b.value,C={},x=F(o[E]);try{for(x.s();!(B=x.n()).done;){var k=B.value;switch(hq.outputs.checkPubkey(k),k.key[0]){case pq.OutputTypes.REDEEM_SCRIPT:if(gq("output",k.key,pq.OutputTypes.REDEEM_SCRIPT),void 0!==C.redeemScript)throw new Error("Format Error: Output has multiple REDEEM_SCRIPT");C.redeemScript=hq.outputs.redeemScript.decode(k);break;case pq.OutputTypes.WITNESS_SCRIPT:if(gq("output",k.key,pq.OutputTypes.WITNESS_SCRIPT),void 0!==C.witnessScript)throw new Error("Format Error: Output has multiple WITNESS_SCRIPT");C.witnessScript=hq.outputs.witnessScript.decode(k);break;case pq.OutputTypes.BIP32_DERIVATION:void 0===C.bip32Derivation&&(C.bip32Derivation=[]),C.bip32Derivation.push(hq.outputs.bip32Derivation.decode(k));break;case pq.OutputTypes.TAP_INTERNAL_KEY:gq("output",k.key,pq.OutputTypes.TAP_INTERNAL_KEY),C.tapInternalKey=hq.outputs.tapInternalKey.decode(k);break;case pq.OutputTypes.TAP_TREE:gq("output",k.key,pq.OutputTypes.TAP_TREE),C.tapTree=hq.outputs.tapTree.decode(k);break;case pq.OutputTypes.TAP_BIP32_DERIVATION:void 0===C.tapBip32Derivation&&(C.tapBip32Derivation=[]),C.tapBip32Derivation.push(hq.outputs.tapBip32Derivation.decode(k));break;default:C.unknownKeyVals||(C.unknownKeyVals=[]),C.unknownKeyVals.push(k)}}}catch(e){x.e(e)}finally{x.f()}d.push(C)}}catch(e){I.e(e)}finally{I.f()}return{globalMap:a,inputs:f,outputs:d}}qj.psbtFromBuffer=function(e,t){var n=0;function r(){var t=dq.decode(e,n);n+=dq.encodingLength(t);var r=e.slice(n,n+t);return n+=t,r}function i(){return{key:r(),value:r()}}function o(){if(n>=e.length)throw new Error("Format Error: Unexpected End of PSBT");var t=0===e.readUInt8(n);return t&&n++,t}if(1886610036!==function(){var t=e.readUInt32BE(n);return n+=4,t}())throw new Error("Format Error: Invalid Magic Number");if(255!==function(){var t=e.readUInt8(n);return n+=1,t}())throw new Error("Format Error: Magic Number must be followed by 0xff separator");for(var a=[],s={};!o();){var u=i(),l=u.key.toString("hex");if(s[l])throw new Error("Format Error: Keys must be unique for global keymap: key "+l);s[l]=1,a.push(u)}var A=a.filter((function(e){return e.key[0]===pq.GlobalTypes.UNSIGNED_TX}));if(1!==A.length)throw new Error("Format Error: Only one UNSIGNED_TX allowed");var c,h=t(A[0].value),f=h.getInputOutputCounts(),d=f.inputCount,p=f.outputCount,g=[],v=[],y=F(fq.range(d));try{for(y.s();!(c=y.n()).done;){for(var m=c.value,w={},b=[];!o();){var I=i(),B=I.key.toString("hex");if(w[B])throw new Error("Format Error: Keys must be unique for each input: input index "+m+" key "+B);w[B]=1,b.push(I)}g.push(b)}}catch(e){y.e(e)}finally{y.f()}var E,C=F(fq.range(p));try{for(C.s();!(E=C.n()).done;){for(var x=E.value,k={},S=[];!o();){var Q=i(),_=Q.key.toString("hex");if(k[_])throw new Error("Format Error: Keys must be unique for each output: output index "+x+" key "+_);k[_]=1,S.push(Q)}v.push(S)}}catch(e){C.e(e)}finally{C.f()}return vq(h,{globalMapKeyVals:a,inputKeyVals:g,outputKeyVals:v})},qj.checkKeyBuffer=gq,qj.psbtFromKeyVals=vq;var yq={};Object.defineProperty(yq,"__esModule",{value:!0});var mq=Vj,wq=bG;yq.psbtToBuffer=function(e){var t=Bq({globalMap:e.globalMap,inputs:e.inputs,outputs:e.outputs}),n=t.globalKeyVals,r=t.inputKeyVals,i=t.outputKeyVals,o=wq.keyValsToBuffer(n),a=function(e){return 0===e.length?[Yo.from([0])]:e.map(wq.keyValsToBuffer)},s=a(r),u=a(i),l=Yo.allocUnsafe(5);return l.writeUIntBE(482972169471,0,5),Yo.concat([l,o].concat(s,u))};var bq=function(e,t){return e.key.compare(t.key)};function Iq(e,t){var n=new Set,r=Object.entries(e).reduce((function(e,r){var i=C(r,2),o=i[0],a=i[1];if("unknownKeyVals"===o)return e;var s=t[o];if(void 0===s)return e;var u=(Array.isArray(a)?a:[a]).map(s.encode);return u.map((function(e){return e.key.toString("hex")})).forEach((function(e){if(n.has(e))throw new Error("Serialize Error: Duplicate key: "+e);n.add(e)})),e.concat(u)}),[]),i=e.unknownKeyVals?e.unknownKeyVals.filter((function(e){return!n.has(e.key.toString("hex"))})):[];return r.concat(i).sort(bq)}function Bq(e){var t=e.globalMap,n=e.inputs,r=e.outputs;return{globalKeyVals:Iq(t,mq.globals),inputKeyVals:n.map((function(e){return Iq(e,mq.inputs)})),outputKeyVals:r.map((function(e){return Iq(e,mq.outputs)}))}}yq.psbtToKeyVals=Bq,function(e){function t(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}Object.defineProperty(e,"__esModule",{value:!0}),t(qj),t(yq)}(Gj),Object.defineProperty(jj,"__esModule",{value:!0});var Eq=Gj;function Cq(e,t,n){return function(r){if(!e.has(r)){var i=n.filter((function(e){return e.key.toString("hex")===r}))[0];t.push(i),e.add(r)}}}function xq(e){return e.globalMap.unsignedTx}function kq(e){var t=new Set;return e.forEach((function(e){var n=e.key.toString("hex");if(t.has(n))throw new Error("Combine: KeyValue Map keys should be unique");t.add(n)})),t}jj.combine=function(e){var t=e[0],n=Eq.psbtToKeyVals(t),r=e.slice(1);if(0===r.length)throw new Error("Combine: Nothing to combine");var i=xq(t);if(void 0===i)throw new Error("Combine: Self missing transaction");var o,a=kq(n.globalKeyVals),s=n.inputKeyVals.map(kq),u=n.outputKeyVals.map(kq),l=F(r);try{var A=function(){var e=o.value,t=xq(e);if(void 0===t||!t.toBuffer().equals(i.toBuffer()))throw new Error("Combine: One of the Psbts does not have the same transaction.");var r=Eq.psbtToKeyVals(e);kq(r.globalKeyVals).forEach(Cq(a,n.globalKeyVals,r.globalKeyVals)),r.inputKeyVals.map(kq).forEach((function(e,t){return e.forEach(Cq(s[t],n.inputKeyVals[t],r.inputKeyVals[t]))})),r.outputKeyVals.map(kq).forEach((function(e,t){return e.forEach(Cq(u[t],n.outputKeyVals[t],r.outputKeyVals[t]))}))};for(l.s();!(o=l.n()).done;)A()}catch(e){l.e(e)}finally{l.f()}return Eq.psbtFromKeyVals(i,{globalMapKeyVals:n.globalKeyVals,inputKeyVals:n.inputKeyVals,outputKeyVals:n.outputKeyVals})};var Sq={};!function(e){Object.defineProperty(e,"__esModule",{value:!0});var t=Vj;function n(e,t){var n=e[t];if(void 0===n)throw new Error("No input #".concat(t));return n}function r(e,t){var n=e[t];if(void 0===n)throw new Error("No output #".concat(t));return n}function i(e,t,n,r){throw new Error("Data for ".concat(e," key ").concat(t," is incorrect: Expected ").concat(n," and got ").concat(JSON.stringify(r)))}function o(e){return function(n,r){for(var o=function(){var o=s[a],u=n[o],l=t[e+"s"][o]||{},A=l.canAdd,c=l.canAddToArray,h=l.check,f=l.expected;if(h)if(!!c){if(!Array.isArray(u)||r[o]&&!Array.isArray(r[o]))throw new Error("Key type ".concat(o," must be an array"));u.every(h)||i(e,o,f,u);var d=r[o]||[],p=new Set;if(!u.every((function(e){return c(d,e,p)})))throw new Error("Can not add duplicate data to array");r[o]=d.concat(u)}else{if(h(u)||i(e,o,f,u),!A(r,u))throw new Error("Can not add duplicate data to ".concat(e));r[o]=u}},a=0,s=Object.keys(n);a<s.length;a++)o()}}e.checkForInput=n,e.checkForOutput=r,e.checkHasKey=function(e,t,n){if(e.key[0]<n)throw new Error("Use the method for your specific key instead of addUnknownKeyVal*");if(t&&0!==t.filter((function(t){return t.key.equals(e.key)})).length)throw new Error("Duplicate Key: ".concat(e.key.toString("hex")))},e.getEnumLength=function(e){var t=0;return Object.keys(e).forEach((function(e){Number(isNaN(Number(e)))&&t++})),t},e.inputCheckUncleanFinalized=function(e,t){var n=!1;if(t.nonWitnessUtxo||t.witnessUtxo){var r=!!t.redeemScript,i=!!t.witnessScript,o=!r||!!t.finalScriptSig,a=!i||!!t.finalScriptWitness,s=!!t.finalScriptSig||!!t.finalScriptWitness;n=o&&a&&s}if(!1===n)throw new Error("Input #".concat(e," has too much or too little data to clean"))},e.updateGlobal=o("global"),e.updateInput=o("input"),e.updateOutput=o("output"),e.addInputAttributes=function(t,r){var i=n(t,t.length-1);e.updateInput(r,i)},e.addOutputAttributes=function(t,n){var i=r(t,t.length-1);e.updateOutput(n,i)},e.defaultVersionSetter=function(e,t){if(!Na(t)||t.length<4)throw new Error("Set Version: Invalid Transaction");return t.writeUInt32LE(e,0),t},e.defaultLocktimeSetter=function(e,t){if(!Na(t)||t.length<4)throw new Error("Set Locktime: Invalid Transaction");return t.writeUInt32LE(e,t.length-4),t}}(Sq),Object.defineProperty(Kj,"__esModule",{value:!0});var Qq=jj,_q=Gj,Nq=zj,Dq=Sq;Kj.Psbt=function(){function e(t){s(this,e),this.inputs=[],this.outputs=[],this.globalMap={unsignedTx:t}}return l(e,[{key:"toBase64",value:function(){return this.toBuffer().toString("base64")}},{key:"toHex",value:function(){return this.toBuffer().toString("hex")}},{key:"toBuffer",value:function(){return _q.psbtToBuffer(this)}},{key:"updateGlobal",value:function(e){return Dq.updateGlobal(e,this.globalMap),this}},{key:"updateInput",value:function(e,t){var n=Dq.checkForInput(this.inputs,e);return Dq.updateInput(t,n),this}},{key:"updateOutput",value:function(e,t){var n=Dq.checkForOutput(this.outputs,e);return Dq.updateOutput(t,n),this}},{key:"addUnknownKeyValToGlobal",value:function(e){return Dq.checkHasKey(e,this.globalMap.unknownKeyVals,Dq.getEnumLength(Nq.GlobalTypes)),this.globalMap.unknownKeyVals||(this.globalMap.unknownKeyVals=[]),this.globalMap.unknownKeyVals.push(e),this}},{key:"addUnknownKeyValToInput",value:function(e,t){var n=Dq.checkForInput(this.inputs,e);return Dq.checkHasKey(t,n.unknownKeyVals,Dq.getEnumLength(Nq.InputTypes)),n.unknownKeyVals||(n.unknownKeyVals=[]),n.unknownKeyVals.push(t),this}},{key:"addUnknownKeyValToOutput",value:function(e,t){var n=Dq.checkForOutput(this.outputs,e);return Dq.checkHasKey(t,n.unknownKeyVals,Dq.getEnumLength(Nq.OutputTypes)),n.unknownKeyVals||(n.unknownKeyVals=[]),n.unknownKeyVals.push(t),this}},{key:"addInput",value:function(e){var t=this;this.globalMap.unsignedTx.addInput(e),this.inputs.push({unknownKeyVals:[]});var n=e.unknownKeyVals||[],r=this.inputs.length-1;if(!Array.isArray(n))throw new Error("unknownKeyVals must be an Array");return n.forEach((function(e){return t.addUnknownKeyValToInput(r,e)})),Dq.addInputAttributes(this.inputs,e),this}},{key:"addOutput",value:function(e){var t=this;this.globalMap.unsignedTx.addOutput(e),this.outputs.push({unknownKeyVals:[]});var n=e.unknownKeyVals||[],r=this.outputs.length-1;if(!Array.isArray(n))throw new Error("unknownKeyVals must be an Array");return n.forEach((function(e){return t.addUnknownKeyValToInput(r,e)})),Dq.addOutputAttributes(this.outputs,e),this}},{key:"clearFinalizedInput",value:function(e){var t=Dq.checkForInput(this.inputs,e);Dq.inputCheckUncleanFinalized(e,t);for(var n=0,r=Object.keys(t);n<r.length;n++){var i=r[n];["witnessUtxo","nonWitnessUtxo","finalScriptSig","finalScriptWitness","unknownKeyVals"].includes(i)||delete t[i]}return this}},{key:"combine",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=Qq.combine([this].concat(t));return Object.assign(this,r),this}},{key:"getTransaction",value:function(){return this.globalMap.unsignedTx.toBuffer()}}],[{key:"fromBase64",value:function(e,t){var n=Yo.from(e,"base64");return this.fromBuffer(n,t)}},{key:"fromHex",value:function(e,t){var n=Yo.from(e,"hex");return this.fromBuffer(n,t)}},{key:"fromBuffer",value:function(e,t){var n=_q.psbtFromBuffer(e,t),r=new this(n.globalMap.unsignedTx);return Object.assign(r,n),r}}]),e}(),Object.defineProperty(Hj,"__esModule",{value:!0}),Hj.Psbt=void 0;var Fq=Kj,Pq=IG,Uq=Sq,Lq=BU,Mq=rj,Tq=WL,Rq=CU,Oq=kU,Hq=gj,Kq={network:EU.bitcoin,maximumFeeRate:5e3},jq=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Fq.Psbt(new qq);s(this,e),this.data=n,this.opts=Object.assign({},Kq,t),this.__CACHE={__NON_WITNESS_UTXO_TX_CACHE:[],__NON_WITNESS_UTXO_BUF_CACHE:[],__TX_IN_CACHE:{},__TX:this.data.globalMap.unsignedTx.tx,__UNSAFE_SIGN_NONSEGWIT:!1},0===this.data.inputs.length&&this.setVersion(2);var r=function(e,t,n,r){return Object.defineProperty(e,t,{enumerable:n,writable:r})};r(this,"__CACHE",!1,!0),r(this,"opts",!1,!0)}return l(e,[{key:"inputCount",get:function(){return this.data.inputs.length}},{key:"version",get:function(){return this.__CACHE.__TX.version},set:function(e){this.setVersion(e)}},{key:"locktime",get:function(){return this.__CACHE.__TX.locktime},set:function(e){this.setLocktime(e)}},{key:"txInputs",get:function(){return this.__CACHE.__TX.ins.map((function(e){return{hash:(0,Mq.cloneBuffer)(e.hash),index:e.index,sequence:e.sequence}}))}},{key:"txOutputs",get:function(){var e=this;return this.__CACHE.__TX.outs.map((function(t){var n;try{n=(0,Lq.fromOutputScript)(t.script,e.opts.network)}catch(t){}return{script:(0,Mq.cloneBuffer)(t.script),value:t.value,address:n}}))}},{key:"combine",value:function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return(e=this.data).combine.apply(e,k(n.map((function(e){return e.data})))),this}},{key:"clone",value:function(){var t=e.fromBuffer(this.data.toBuffer());return t.opts=JSON.parse(JSON.stringify(this.opts)),t}},{key:"setMaximumFeeRate",value:function(e){rV(e),this.opts.maximumFeeRate=e}},{key:"setVersion",value:function(e){rV(e),iV(this.data.inputs,"setVersion");var t=this.__CACHE;return t.__TX.version=e,t.__EXTRACTED_TX=void 0,this}},{key:"setLocktime",value:function(e){rV(e),iV(this.data.inputs,"setLocktime");var t=this.__CACHE;return t.__TX.locktime=e,t.__EXTRACTED_TX=void 0,this}},{key:"setInputSequence",value:function(e,t){rV(t),iV(this.data.inputs,"setInputSequence");var n=this.__CACHE;if(n.__TX.ins.length<=e)throw new Error("Input index too high");return n.__TX.ins[e].sequence=t,n.__EXTRACTED_TX=void 0,this}},{key:"addInputs",value:function(e){var t=this;return e.forEach((function(e){return t.addInput(e)})),this}},{key:"addInput",value:function(e){if(arguments.length>1||!e||void 0===e.hash||void 0===e.index)throw new Error("Invalid arguments for Psbt.addInput. Requires single object with at least [hash] and [index]");iV(this.data.inputs,"addInput"),e.witnessScript&&IV(e.witnessScript);var t=this.__CACHE;this.data.addInput(e),aV(t,t.__TX.ins[t.__TX.ins.length-1]);var n=this.data.inputs.length-1,r=this.data.inputs[n];return r.nonWitnessUtxo&&gV(this.__CACHE,r,n),t.__FEE=void 0,t.__FEE_RATE=void 0,t.__EXTRACTED_TX=void 0,this}},{key:"addOutputs",value:function(e){var t=this;return e.forEach((function(e){return t.addOutput(e)})),this}},{key:"addOutput",value:function(e){if(arguments.length>1||!e||void 0===e.value||void 0===e.address&&void 0===e.script)throw new Error("Invalid arguments for Psbt.addOutput. Requires single object with at least [script or address] and [value]");iV(this.data.inputs,"addOutput");var t=e,n=t.address;if("string"==typeof n){var r=this.opts.network,i=(0,Lq.toOutputScript)(n,r);e=Object.assign(e,{script:i})}var o=this.__CACHE;return this.data.addOutput(e),o.__FEE=void 0,o.__FEE_RATE=void 0,o.__EXTRACTED_TX=void 0,this}},{key:"extractTransaction",value:function(e){if(!this.data.inputs.every(Jq))throw new Error("Not finalized");var t=this.__CACHE;if(e||function(e,t,n){var r=t.__FEE_RATE||e.getFeeRate(),i=t.__EXTRACTED_TX.virtualSize(),o=r*i;if(r>=n.maximumFeeRate)throw new Error("Warning: You are paying around ".concat((o/1e8).toFixed(8)," in fees, which is ").concat(r," satoshi per byte for a transaction with a VSize of ").concat(i," bytes (segwit counted as 0.25 byte per byte). Use setMaximumFeeRate method to raise your threshold, or pass true to the first arg of extractTransaction."))}(this,t,this.opts),t.__EXTRACTED_TX)return t.__EXTRACTED_TX;var n=t.__TX.clone();return vV(this.data.inputs,n,t,!0),n}},{key:"getFeeRate",value:function(){return AV("__FEE_RATE","fee rate",this.data.inputs,this.__CACHE)}},{key:"getFee",value:function(){return AV("__FEE","fee",this.data.inputs,this.__CACHE)}},{key:"finalizeAllInputs",value:function(){var e=this;return(0,Uq.checkForInput)(this.data.inputs,0),CV(this.data.inputs.length).forEach((function(t){return e.finalizeInput(t)})),this}},{key:"finalizeInput",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cV,n=(0,Uq.checkForInput)(this.data.inputs,e),r=function(e,t,n){var r=n.__TX,i={script:null,isSegwit:!1,isP2SH:!1,isP2WSH:!1};if(i.isP2SH=!!t.redeemScript,i.isP2WSH=!!t.witnessScript,t.witnessScript)i.script=t.witnessScript;else if(t.redeemScript)i.script=t.redeemScript;else if(t.nonWitnessUtxo){var o=yV(n,t,e),a=r.ins[e].index;i.script=o.outs[a].script}else t.witnessUtxo&&(i.script=t.witnessUtxo.script);return(t.witnessScript||$q(i.script))&&(i.isSegwit=!0),i}(e,n,this.__CACHE),i=r.script,o=r.isP2SH,a=r.isP2WSH,s=r.isSegwit;if(!i)throw new Error("No script found for input #".concat(e));!function(e){if(e.sighashType&&e.partialSig){var t=e.partialSig,n=e.sighashType;t.forEach((function(e){var t=Oq.signature.decode(e.signature).hashType;if(n!==t)throw new Error("Signature sighash does not match input sighash type")}))}}(n);var u=t(e,n,i,s,o,a),l=u.finalScriptSig,A=u.finalScriptWitness;if(l&&this.data.updateInput(e,{finalScriptSig:l}),A&&this.data.updateInput(e,{finalScriptWitness:A}),!l&&!A)throw new Error("Unknown error finalizing input #".concat(e));return this.data.clearFinalizedInput(e),this}},{key:"getInputType",value:function(e){var t=(0,Uq.checkForInput)(this.data.inputs,e),n=bV(mV(e,t,this.__CACHE),e,"input",t.redeemScript||function(e){if(e){var t=Oq.decompile(e);if(t){var n,r=t[t.length-1];if(Na(r)&&!wV(r)&&(n=r,!Oq.isCanonicalScriptSignature(n)))if(Oq.decompile(r))return r}}}(t.finalScriptSig),t.witnessScript||function(e){if(e){var t=pV(e),n=t[t.length-1];if(!wV(n)&&Oq.decompile(n))return n}}(t.finalScriptWitness));return("raw"===n.type?"":n.type+"-")+EV(n.meaningfulScript)}},{key:"inputHasPubkey",value:function(e,t){return function(e,t,n,r){return BV(e,bV(mV(n,t,r),n,"input",t.redeemScript,t.witnessScript).meaningfulScript)}(t,(0,Uq.checkForInput)(this.data.inputs,e),e,this.__CACHE)}},{key:"inputHasHDKey",value:function(e,t){var n=(0,Uq.checkForInput)(this.data.inputs,e),r=nV(t);return!!n.bip32Derivation&&n.bip32Derivation.some(r)}},{key:"outputHasPubkey",value:function(e,t){return function(e,t,n,r){return BV(e,bV(r.__TX.outs[n].script,n,"output",t.redeemScript,t.witnessScript).meaningfulScript)}(t,(0,Uq.checkForOutput)(this.data.outputs,e),e,this.__CACHE)}},{key:"outputHasHDKey",value:function(e,t){var n=(0,Uq.checkForOutput)(this.data.outputs,e),r=nV(t);return!!n.bip32Derivation&&n.bip32Derivation.some(r)}},{key:"validateSignaturesOfAllInputs",value:function(e){var t=this;return(0,Uq.checkForInput)(this.data.inputs,0),CV(this.data.inputs.length).map((function(n){return t.validateSignaturesOfInput(n,e)})).reduce((function(e,t){return!0===t&&e}),!0)}},{key:"validateSignaturesOfInput",value:function(e,t,n){var r=this.data.inputs[e],i=(r||{}).partialSig;if(!r||!i||i.length<1)throw new Error("No signatures to validate");if("function"!=typeof t)throw new Error("Need validator function to validate signatures");var o=n?i.filter((function(e){return e.pubkey.equals(n)})):i;if(o.length<1)throw new Error("No signatures for this pubkey");var a,s,u,l,A=[],c=F(o);try{for(c.s();!(l=c.n()).done;){var h=l.value,f=Oq.signature.decode(h.signature),d=u!==f.hashType?fV(e,Object.assign({},r,{sighashType:f.hashType}),this.__CACHE,!0):{hash:a,script:s},p=d.hash,g=d.script;u=f.hashType,a=p,s=g,oV(h.pubkey,g,"verify"),A.push(t(h.pubkey,p,f.signature))}}catch(e){c.e(e)}finally{c.f()}return A.every((function(e){return!0===e}))}},{key:"signAllInputsHD",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[Hq.Transaction.SIGHASH_ALL];if(!e||!e.publicKey||!e.fingerprint)throw new Error("Need HDSigner to sign input");var n,r=[],i=F(CV(this.data.inputs.length));try{for(i.s();!(n=i.n()).done;){var o=n.value;try{this.signInputHD(o,e,t),r.push(!0)}catch(e){r.push(!1)}}}catch(e){i.e(e)}finally{i.f()}if(r.every((function(e){return!1===e})))throw new Error("No inputs were signed");return this}},{key:"signAllInputsHDAsync",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[Hq.Transaction.SIGHASH_ALL];return new Promise((function(r,i){if(!e||!e.publicKey||!e.fingerprint)return i(new Error("Need HDSigner to sign input"));var o,a=[],s=[],u=F(CV(t.data.inputs.length));try{for(u.s();!(o=u.n()).done;){var l=o.value;s.push(t.signInputHDAsync(l,e,n).then((function(){a.push(!0)}),(function(){a.push(!1)})))}}catch(e){u.e(e)}finally{u.f()}return Promise.all(s).then((function(){if(a.every((function(e){return!1===e})))return i(new Error("No inputs were signed"));r()}))}))}},{key:"signInputHD",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[Hq.Transaction.SIGHASH_ALL];if(!t||!t.publicKey||!t.fingerprint)throw new Error("Need HDSigner to sign input");return dV(e,this.data.inputs,t).forEach((function(t){return n.signInput(e,t,r)})),this}},{key:"signInputHDAsync",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[Hq.Transaction.SIGHASH_ALL];return new Promise((function(i,o){if(!t||!t.publicKey||!t.fingerprint)return o(new Error("Need HDSigner to sign input"));var a=dV(e,n.data.inputs,t).map((function(t){return n.signInputAsync(e,t,r)}));return Promise.all(a).then((function(){i()})).catch(o)}))}},{key:"signAllInputs",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[Hq.Transaction.SIGHASH_ALL];if(!e||!e.publicKey)throw new Error("Need Signer to sign input");var n,r=[],i=F(CV(this.data.inputs.length));try{for(i.s();!(n=i.n()).done;){var o=n.value;try{this.signInput(o,e,t),r.push(!0)}catch(e){r.push(!1)}}}catch(e){i.e(e)}finally{i.f()}if(r.every((function(e){return!1===e})))throw new Error("No inputs were signed");return this}},{key:"signAllInputsAsync",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[Hq.Transaction.SIGHASH_ALL];return new Promise((function(r,i){if(!e||!e.publicKey)return i(new Error("Need Signer to sign input"));var o,a=[],s=[],u=F(t.data.inputs.entries());try{for(u.s();!(o=u.n()).done;){var l=C(o.value,1)[0];s.push(t.signInputAsync(l,e,n).then((function(){a.push(!0)}),(function(){a.push(!1)})))}}catch(e){u.e(e)}finally{u.f()}return Promise.all(s).then((function(){if(a.every((function(e){return!1===e})))return i(new Error("No inputs were signed"));r()}))}))}},{key:"signInput",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[Hq.Transaction.SIGHASH_ALL];if(!t||!t.publicKey)throw new Error("Need Signer to sign input");var r=hV(this.data.inputs,e,t.publicKey,this.__CACHE,n),i=r.hash,o=r.sighashType,a=[{pubkey:t.publicKey,signature:Oq.signature.encode(t.sign(i),o)}];return this.data.updateInput(e,{partialSig:a}),this}},{key:"signInputAsync",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[Hq.Transaction.SIGHASH_ALL];return Promise.resolve().then((function(){if(!t||!t.publicKey)throw new Error("Need Signer to sign input");var i=hV(n.data.inputs,e,t.publicKey,n.__CACHE,r),o=i.hash,a=i.sighashType;return Promise.resolve(t.sign(o)).then((function(r){var i=[{pubkey:t.publicKey,signature:Oq.signature.encode(r,a)}];n.data.updateInput(e,{partialSig:i})}))}))}},{key:"toBuffer",value:function(){return Vq(this.__CACHE),this.data.toBuffer()}},{key:"toHex",value:function(){return Vq(this.__CACHE),this.data.toHex()}},{key:"toBase64",value:function(){return Vq(this.__CACHE),this.data.toBase64()}},{key:"updateGlobal",value:function(e){return this.data.updateGlobal(e),this}},{key:"updateInput",value:function(e,t){return t.witnessScript&&IV(t.witnessScript),this.data.updateInput(e,t),t.nonWitnessUtxo&&gV(this.__CACHE,this.data.inputs[e],e),this}},{key:"updateOutput",value:function(e,t){return this.data.updateOutput(e,t),this}},{key:"addUnknownKeyValToGlobal",value:function(e){return this.data.addUnknownKeyValToGlobal(e),this}},{key:"addUnknownKeyValToInput",value:function(e,t){return this.data.addUnknownKeyValToInput(e,t),this}},{key:"addUnknownKeyValToOutput",value:function(e,t){return this.data.addUnknownKeyValToOutput(e,t),this}},{key:"clearFinalizedInput",value:function(e){return this.data.clearFinalizedInput(e),this}}],[{key:"fromBase64",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=Yo.from(e,"base64");return this.fromBuffer(n,t)}},{key:"fromHex",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=Yo.from(e,"hex");return this.fromBuffer(n,t)}},{key:"fromBuffer",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=Fq.Psbt.fromBuffer(t,Gq),i=new e(n,r);return function(e,t){e.ins.forEach((function(e){aV(t,e)}))}(i.__CACHE.__TX,i.__CACHE),i}}]),e}();Hj.Psbt=jq;var Gq=function(e){return new qq(e)},qq=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Yo.from([2,0,0,0,0,0,0,0,0,0]);s(this,e),this.tx=Hq.Transaction.fromBuffer(t),function(e){if(!e.ins.every((function(e){return e.script&&0===e.script.length&&e.witness&&0===e.witness.length})))throw new Error("Format Error: Transaction ScriptSigs are not empty")}(this.tx),Object.defineProperty(this,"tx",{enumerable:!1,writable:!0})}return l(e,[{key:"getInputOutputCounts",value:function(){return{inputCount:this.tx.ins.length,outputCount:this.tx.outs.length}}},{key:"addInput",value:function(e){if(void 0===e.hash||void 0===e.index||!Na(e.hash)&&"string"!=typeof e.hash||"number"!=typeof e.index)throw new Error("Error adding input.");var t="string"==typeof e.hash?(0,Mq.reverseBuffer)(Yo.from(e.hash,"hex")):e.hash;this.tx.addInput(t,e.index,e.sequence)}},{key:"addOutput",value:function(e){if(void 0===e.script||void 0===e.value||!Na(e.script)||"number"!=typeof e.value)throw new Error("Error adding output.");this.tx.addOutput(e.script,e.value)}},{key:"toBuffer",value:function(){return this.tx.toBuffer()}}]),e}();function Vq(e){if(!1!==e.__UNSAFE_SIGN_NONSEGWIT)throw new Error("Not BIP174 compliant, can not export")}function zq(e,t,n){if(!t)return!1;var r;if(r=n?n.map((function(e){var n=function(e){if(65===e.length){var t=1&e[64],n=e.slice(0,33);return n[0]=2|t,n}return e.slice()}(e);return t.find((function(e){return e.pubkey.equals(n)}))})).filter((function(e){return!!e})):t,r.length>e)throw new Error("Too many signatures");return r.length===e}function Jq(e){return!!e.finalScriptSig||!!e.finalScriptWitness}function Yq(e){return function(t){try{return e({output:t}),!0}catch(e){return!1}}}var Xq=Yq(Rq.p2ms),Wq=Yq(Rq.p2pk),Zq=Yq(Rq.p2pkh),$q=Yq(Rq.p2wpkh),eV=Yq(Rq.p2wsh),tV=Yq(Rq.p2sh);function nV(e){return function(t){return!!t.masterFingerprint.equals(e.fingerprint)&&!!e.derivePath(t.path).publicKey.equals(t.pubkey)}}function rV(e){if("number"!=typeof e||e!==Math.floor(e)||e>4294967295||e<0)throw new Error("Invalid 32 bit integer")}function iV(e,t){e.forEach((function(e){var n=!1,r=[];if(0===(e.partialSig||[]).length){if(!e.finalScriptSig&&!e.finalScriptWitness)return;r=function(e){var t=e.finalScriptSig&&Oq.decompile(e.finalScriptSig)||[],n=e.finalScriptWitness&&Oq.decompile(e.finalScriptWitness)||[];return t.concat(n).filter((function(e){return Na(e)&&Oq.isCanonicalScriptSignature(e)})).map((function(e){return{signature:e}}))}(e)}else r=e.partialSig;if(r.forEach((function(e){var r=Oq.signature.decode(e.signature).hashType,i=[];switch(r&Hq.Transaction.SIGHASH_ANYONECANPAY&&i.push("addInput"),31&r){case Hq.Transaction.SIGHASH_ALL:break;case Hq.Transaction.SIGHASH_SINGLE:case Hq.Transaction.SIGHASH_NONE:i.push("addOutput"),i.push("setInputSequence")}-1===i.indexOf(t)&&(n=!0)})),n)throw new Error("Can not modify transaction, signatures exist.")}))}function oV(e,t,n){if(!BV(e,t))throw new Error("Can not ".concat(n," for this input with the key ").concat(e.toString("hex")))}function aV(e,t){var n=(0,Mq.reverseBuffer)(Yo.from(t.hash)).toString("hex")+":"+t.index;if(e.__TX_IN_CACHE[n])throw new Error("Duplicate input detected.");e.__TX_IN_CACHE[n]=1}function sV(e,t){return function(n,r,i,o){var a=e({redeem:{output:i}}).output;if(!r.equals(a))throw new Error("".concat(t," for ").concat(o," #").concat(n," doesn't match the scriptPubKey in the prevout"))}}var uV=sV(Rq.p2sh,"Redeem script"),lV=sV(Rq.p2wsh,"Witness script");function AV(e,t,n,r){if(!n.every(Jq))throw new Error("PSBT must be finalized to calculate ".concat(t));if("__FEE_RATE"===e&&r.__FEE_RATE)return r.__FEE_RATE;if("__FEE"===e&&r.__FEE)return r.__FEE;var i,o=!0;return r.__EXTRACTED_TX?(i=r.__EXTRACTED_TX,o=!1):i=r.__TX.clone(),vV(n,i,r,o),"__FEE_RATE"===e?r.__FEE_RATE:"__FEE"===e?r.__FEE:void 0}function cV(e,t,n,r,i,o){var a=EV(n);if(!function(e,t,n){switch(n){case"pubkey":case"pubkeyhash":case"witnesspubkeyhash":return zq(1,e.partialSig);case"multisig":var r=Rq.p2ms({output:t});return zq(r.m,e.partialSig,r.pubkeys);default:return!1}}(t,n,a))throw new Error("Can not finalize input #".concat(e));return function(e,t,n,r,i,o){var a,s,u=function(e,t,n){var r;switch(t){case"multisig":var i=function(e,t){return Rq.p2ms({output:e}).pubkeys.map((function(e){return(t.filter((function(t){return t.pubkey.equals(e)}))[0]||{}).signature})).filter((function(e){return!!e}))}(e,n);r=Rq.p2ms({output:e,signatures:i});break;case"pubkey":r=Rq.p2pk({output:e,signature:n[0].signature});break;case"pubkeyhash":r=Rq.p2pkh({output:e,pubkey:n[0].pubkey,signature:n[0].signature});break;case"witnesspubkeyhash":r=Rq.p2wpkh({output:e,pubkey:n[0].pubkey,signature:n[0].signature})}return r}(e,t,n),l=o?Rq.p2wsh({redeem:u}):null,A=i?Rq.p2sh({redeem:l||u}):null;return r?(s=function(e){var t,n=Yo.allocUnsafe(0);function r(e){var t=n.length,r=Pq.encodingLength(e);n=Yo.concat([n,Yo.allocUnsafe(r)]),Pq.encode(e,n,t)}function i(e){r(e.length),function(e){n=Yo.concat([n,Yo.from(e)])}(e)}return r((t=e).length),t.forEach(i),n}(l?l.witness:u.witness),A&&(a=A.input)):a=A?A.input:u.input,{finalScriptSig:a,finalScriptWitness:s}}(n,a,t.partialSig,r,i,o)}function hV(e,t,n,r,i){var o=fV(t,(0,Uq.checkForInput)(e,t),r,!1,i),a=o.hash,s=o.sighashType;return oV(n,o.script,"sign"),{hash:a,sighashType:s}}function fV(e,t,n,r,i){var o,a,s=n.__TX,u=t.sighashType||Hq.Transaction.SIGHASH_ALL;if(i&&i.indexOf(u)<0){var l=function(e){var t=e&Hq.Transaction.SIGHASH_ANYONECANPAY?"SIGHASH_ANYONECANPAY | ":"";switch(31&e){case Hq.Transaction.SIGHASH_ALL:t+="SIGHASH_ALL";break;case Hq.Transaction.SIGHASH_SINGLE:t+="SIGHASH_SINGLE";break;case Hq.Transaction.SIGHASH_NONE:t+="SIGHASH_NONE"}return t}(u);throw new Error("Sighash type is not allowed. Retry the sign method passing the sighashTypes array of whitelisted types. Sighash type: ".concat(l))}if(t.nonWitnessUtxo){var A=yV(n,t,e),c=s.ins[e].hash,h=A.getHash();if(!c.equals(h))throw new Error("Non-witness UTXO hash for input #".concat(e," doesn't match the hash specified in the prevout"));var f=s.ins[e].index;a=A.outs[f]}else{if(!t.witnessUtxo)throw new Error("Need a Utxo input item for signing");a=t.witnessUtxo}var d=bV(a.script,e,"input",t.redeemScript,t.witnessScript),p=d.meaningfulScript,g=d.type;if(["p2sh-p2wsh","p2wsh"].indexOf(g)>=0)o=s.hashForWitnessV0(e,p,a.value,u);else if($q(p)){var v=Rq.p2pkh({hash:p.slice(2)}).output;o=s.hashForWitnessV0(e,v,a.value,u)}else{if(void 0===t.nonWitnessUtxo&&!1===n.__UNSAFE_SIGN_NONSEGWIT)throw new Error("Input #".concat(e," has witnessUtxo but non-segwit script: ").concat(p.toString("hex")));r||!1===n.__UNSAFE_SIGN_NONSEGWIT||console.warn("Warning: Signing non-segwit inputs without the full parent transaction means there is a chance that a miner could feed you incorrect information to trick you into paying large fees. This behavior is the same as Psbt's predecesor (TransactionBuilder - now removed) when signing non-segwit scripts. You are not able to export this Psbt with toBuffer|toBase64|toHex since it is not BIP174 compliant.\n*********************\nPROCEED WITH CAUTION!\n*********************"),o=s.hashForSignature(e,p,u)}return{script:p,sighashType:u,hash:o}}function dV(e,t,n){var r=(0,Uq.checkForInput)(t,e);if(!r.bip32Derivation||0===r.bip32Derivation.length)throw new Error("Need bip32Derivation to sign with HD");var i=r.bip32Derivation.map((function(e){return e.masterFingerprint.equals(n.fingerprint)?e:void 0})).filter((function(e){return!!e}));if(0===i.length)throw new Error("Need one bip32Derivation masterFingerprint to match the HDSigner fingerprint");var o=i.map((function(e){var t=n.derivePath(e.path);if(!e.pubkey.equals(t.publicKey))throw new Error("pubkey did not match bip32Derivation");return t}));return o}function pV(e){var t=0;function n(){var n=Pq.decode(e,t);return t+=Pq.decode.bytes,n}function r(){return r=n(),t+=r,e.slice(t-r,t);var r}return function(){for(var e=n(),t=[],i=0;i<e;i++)t.push(r());return t}()}function gV(e,t,n){e.__NON_WITNESS_UTXO_BUF_CACHE[n]=t.nonWitnessUtxo;var r=Hq.Transaction.fromBuffer(t.nonWitnessUtxo);e.__NON_WITNESS_UTXO_TX_CACHE[n]=r;var i=e,o=n;delete t.nonWitnessUtxo,Object.defineProperty(t,"nonWitnessUtxo",{enumerable:!0,get:function(){var e=i.__NON_WITNESS_UTXO_BUF_CACHE[o],t=i.__NON_WITNESS_UTXO_TX_CACHE[o];if(void 0!==e)return e;var n=t.toBuffer();return i.__NON_WITNESS_UTXO_BUF_CACHE[o]=n,n},set:function(e){i.__NON_WITNESS_UTXO_BUF_CACHE[o]=e}})}function vV(e,t,n,r){var i=0;e.forEach((function(e,o){if(r&&e.finalScriptSig&&(t.ins[o].script=e.finalScriptSig),r&&e.finalScriptWitness&&(t.ins[o].witness=pV(e.finalScriptWitness)),e.witnessUtxo)i+=e.witnessUtxo.value;else if(e.nonWitnessUtxo){var a=yV(n,e,o),s=t.ins[o].index,u=a.outs[s];i+=u.value}}));var o=t.outs.reduce((function(e,t){return e+t.value}),0),a=i-o;if(a<0)throw new Error("Outputs are spending more than Inputs");var s=t.virtualSize();n.__FEE=a,n.__EXTRACTED_TX=t,n.__FEE_RATE=Math.floor(a/s)}function yV(e,t,n){var r=e.__NON_WITNESS_UTXO_TX_CACHE;return r[n]||gV(e,t,n),r[n]}function mV(e,t,n){if(void 0!==t.witnessUtxo)return t.witnessUtxo.script;if(void 0!==t.nonWitnessUtxo)return yV(n,t,e).outs[n.__TX.ins[e].index].script;throw new Error("Can't find pubkey in input without Utxo data")}function wV(e){return 33===e.length&&Oq.isCanonicalPubKey(e)}function bV(e,t,n,r,i){var o,a=tV(e),s=a&&r&&eV(r),u=eV(e);if(a&&void 0===r)throw new Error("scriptPubkey is P2SH but redeemScript missing");if((u||s)&&void 0===i)throw new Error("scriptPubkey or redeemScript is P2WSH but witnessScript missing");return s?(o=i,uV(t,e,r,n),lV(t,r,i,n),IV(o)):u?(o=i,lV(t,e,i,n),IV(o)):a?(o=r,uV(t,e,r,n)):o=e,{meaningfulScript:o,type:s?"p2sh-p2wsh":a?"p2sh":u?"p2wsh":"raw"}}function IV(e){if($q(e)||tV(e))throw new Error("P2WPKH or P2SH can not be contained within P2WSH")}function BV(e,t){var n=(0,Tq.hash160)(e),r=Oq.decompile(t);if(null===r)throw new Error("Unknown script error");return r.some((function(t){return"number"!=typeof t&&(t.equals(e)||t.equals(n))}))}function EV(e){return $q(e)?"witnesspubkeyhash":Zq(e)?"pubkeyhash":Xq(e)?"multisig":Wq(e)?"pubkey":"nonstandard"}function CV(e){return k(Array(e).keys())}!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Transaction=e.opcodes=e.Psbt=e.Block=e.script=e.payments=e.networks=e.crypto=e.address=void 0;var t=BU;e.address=t;var n=WL;e.crypto=n;var r=EU;e.networks=r;var i=CU;e.payments=i;var o=kU;e.script=o;var a=nj;Object.defineProperty(e,"Block",{enumerable:!0,get:function(){return a.Block}});var s=Hj;Object.defineProperty(e,"Psbt",{enumerable:!0,get:function(){return s.Psbt}});var u=QU;Object.defineProperty(e,"opcodes",{enumerable:!0,get:function(){return u.OPS}});var l=gj;Object.defineProperty(e,"Transaction",{enumerable:!0,get:function(){return l.Transaction}})}(IU);var xV={exports:{}};function kV(e,t){var n=function(e){for(var t=function(e){var t=mU.from(Object.assign(Object.assign({},e),{crv:"K-256"}),"jwk").toString("blk","public"),n=hx.publicKeyConvert(bU.from(t,"hex"),!0);return bU.from(n).toString("hex")}(e),n=bU.from(t,"hex"),r=32-n.length;r>0;)n=bU.concat([bU.from("00","hex"),n]),r--;return n}(e.publicKeyJwk),r=bF("errors","identityErrorBaseMessage"),i="";switch(t.code){case Dl.Bitcoin:case Dl.Mocknet:case Dl.Testnet:i=function(e,t){return IU.payments.p2pkh({pubkey:e,network:IU.networks[t.code]}).address}(n,t);break;case Dl.Ethmain:case Dl.Ethropst:case Dl.Ethrinkeby:case Dl.Ethgoerli:case Dl.Ethsepolia:i=function(e,t){var n=e.toString("hex"),r=new BI.ec("secp256k1").keyFromPublic(n,"hex").getPublic().encode("hex").slice(2),i=Yo;return"0x".concat(xV.exports.keccak256(i.from(r,"hex")).slice(24).toString())}(n);break;default:throw new yF("deriveIssuingAddressFromPublicKey","".concat(r," - ").concat(bF("errors","deriveIssuingAddressFromPublicKey")))}return i}function SV(e){if(e){var t="string"==typeof e?e:e.code;return!!Object.keys(Ul).some((function(e){return e===t}))&&!!Ul[t].test}return!1}!function(e){!function(){var t="input is invalid type",n="object"==("undefined"==typeof window?"undefined":i(window)),r=n?window:{};r.JS_SHA3_NO_WINDOW&&(n=!1);var o=!n&&"object"==("undefined"==typeof self?"undefined":i(self));!r.JS_SHA3_NO_NODE_JS&&"object"==i(lA)&&lA.versions&&lA.versions.node?r=No:o&&(r=self);var a=!r.JS_SHA3_NO_COMMON_JS&&e.exports,s=!r.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,u="0123456789abcdef".split(""),l=[4,1024,262144,67108864],A=[0,8,16,24],c=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],h=[224,256,384,512],f=[128,256],d=["hex","buffer","arrayBuffer","array","digest"],p={128:168,256:136};!r.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!s||!r.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(e){return"object"==i(e)&&e.buffer&&e.buffer.constructor===ArrayBuffer});for(var g=function(e,t,n){return function(r){return new N(e,t,e).update(r)[n]()}},v=function(e,t,n){return function(r,i){return new N(e,t,i).update(r)[n]()}},y=function(e,t,n){return function(t,r,i,o){return B["cshake"+e].update(t,r,i,o)[n]()}},m=function(e,t,n){return function(t,r,i,o){return B["kmac"+e].update(t,r,i,o)[n]()}},w=function(e,t,n,r){for(var i=0;i<d.length;++i){var o=d[i];e[o]=t(n,r,o)}return e},b=function(e,t){var n=g(e,t,"hex");return n.create=function(){return new N(e,t,e)},n.update=function(e){return n.create().update(e)},w(n,g,e,t)},I=[{name:"keccak",padding:[1,256,65536,16777216],bits:h,createMethod:b},{name:"sha3",padding:[6,1536,393216,100663296],bits:h,createMethod:b},{name:"shake",padding:[31,7936,2031616,520093696],bits:f,createMethod:function(e,t){var n=v(e,t,"hex");return n.create=function(n){return new N(e,t,n)},n.update=function(e,t){return n.create(t).update(e)},w(n,v,e,t)}},{name:"cshake",padding:l,bits:f,createMethod:function(e,t){var n=p[e],r=y(e,0,"hex");return r.create=function(r,i,o){return i||o?new N(e,t,r).bytepad([i,o],n):B["shake"+e].create(r)},r.update=function(e,t,n,i){return r.create(t,n,i).update(e)},w(r,y,e,t)}},{name:"kmac",padding:l,bits:f,createMethod:function(e,t){var n=p[e],r=m(e,0,"hex");return r.create=function(r,i,o){return new D(e,t,i).bytepad(["KMAC",o],n).bytepad([r],n)},r.update=function(e,t,n,i){return r.create(e,n,i).update(t)},w(r,m,e,t)}}],B={},E=[],C=0;C<I.length;++C)for(var x=I[C],k=x.bits,S=0;S<k.length;++S){var Q=x.name+"_"+k[S];if(E.push(Q),B[Q]=x.createMethod(k[S],x.padding),"sha3"!==x.name){var _=x.name+k[S];E.push(_),B[_]=B[Q]}}function N(e,t,n){this.blocks=[],this.s=[],this.padding=t,this.outputBits=n,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(e<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=n>>5,this.extraBytes=(31&n)>>3;for(var r=0;r<50;++r)this.s[r]=0}function D(e,t,n){N.call(this,e,t,n)}N.prototype.update=function(e){if(this.finalized)throw new Error("finalize already called");var n,r=i(e);if("string"!==r){if("object"!==r)throw new Error(t);if(null===e)throw new Error(t);if(s&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||s&&ArrayBuffer.isView(e)))throw new Error(t);n=!0}for(var o,a,u=this.blocks,l=this.byteCount,c=e.length,h=this.blockCount,f=0,d=this.s;f<c;){if(this.reset)for(this.reset=!1,u[0]=this.block,o=1;o<h+1;++o)u[o]=0;if(n)for(o=this.start;f<c&&o<l;++f)u[o>>2]|=e[f]<<A[3&o++];else for(o=this.start;f<c&&o<l;++f)(a=e.charCodeAt(f))<128?u[o>>2]|=a<<A[3&o++]:a<2048?(u[o>>2]|=(192|a>>6)<<A[3&o++],u[o>>2]|=(128|63&a)<<A[3&o++]):a<55296||a>=57344?(u[o>>2]|=(224|a>>12)<<A[3&o++],u[o>>2]|=(128|a>>6&63)<<A[3&o++],u[o>>2]|=(128|63&a)<<A[3&o++]):(a=65536+((1023&a)<<10|1023&e.charCodeAt(++f)),u[o>>2]|=(240|a>>18)<<A[3&o++],u[o>>2]|=(128|a>>12&63)<<A[3&o++],u[o>>2]|=(128|a>>6&63)<<A[3&o++],u[o>>2]|=(128|63&a)<<A[3&o++]);if(this.lastByteIndex=o,o>=l){for(this.start=o-l,this.block=u[h],o=0;o<h;++o)d[o]^=u[o];F(d),this.reset=!0}else this.start=o}return this},N.prototype.encode=function(e,t){var n=255&e,r=1,i=[n];for(n=255&(e>>=8);n>0;)i.unshift(n),n=255&(e>>=8),++r;return t?i.push(r):i.unshift(r),this.update(i),i.length},N.prototype.encodeString=function(e){var n,r=i(e);if("string"!==r){if("object"!==r)throw new Error(t);if(null===e)throw new Error(t);if(s&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||s&&ArrayBuffer.isView(e)))throw new Error(t);n=!0}var o=0,a=e.length;if(n)o=a;else for(var u=0;u<e.length;++u){var l=e.charCodeAt(u);l<128?o+=1:l<2048?o+=2:l<55296||l>=57344?o+=3:(l=65536+((1023&l)<<10|1023&e.charCodeAt(++u)),o+=4)}return o+=this.encode(8*o),this.update(e),o},N.prototype.bytepad=function(e,t){for(var n=this.encode(t),r=0;r<e.length;++r)n+=this.encodeString(e[r]);var i=t-n%t,o=[];return o.length=i,this.update(o),this},N.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex,n=this.blockCount,r=this.s;if(e[t>>2]|=this.padding[3&t],this.lastByteIndex===this.byteCount)for(e[0]=e[n],t=1;t<n+1;++t)e[t]=0;for(e[n-1]|=2147483648,t=0;t<n;++t)r[t]^=e[t];F(r)}},N.prototype.toString=N.prototype.hex=function(){this.finalize();for(var e,t=this.blockCount,n=this.s,r=this.outputBlocks,i=this.extraBytes,o=0,a=0,s="";a<r;){for(o=0;o<t&&a<r;++o,++a)e=n[o],s+=u[e>>4&15]+u[15&e]+u[e>>12&15]+u[e>>8&15]+u[e>>20&15]+u[e>>16&15]+u[e>>28&15]+u[e>>24&15];a%t==0&&(F(n),o=0)}return i&&(e=n[o],s+=u[e>>4&15]+u[15&e],i>1&&(s+=u[e>>12&15]+u[e>>8&15]),i>2&&(s+=u[e>>20&15]+u[e>>16&15])),s},N.prototype.arrayBuffer=function(){this.finalize();var e,t=this.blockCount,n=this.s,r=this.outputBlocks,i=this.extraBytes,o=0,a=0,s=this.outputBits>>3;e=i?new ArrayBuffer(r+1<<2):new ArrayBuffer(s);for(var u=new Uint32Array(e);a<r;){for(o=0;o<t&&a<r;++o,++a)u[a]=n[o];a%t==0&&F(n)}return i&&(u[o]=n[o],e=e.slice(0,s)),e},N.prototype.buffer=N.prototype.arrayBuffer,N.prototype.digest=N.prototype.array=function(){this.finalize();for(var e,t,n=this.blockCount,r=this.s,i=this.outputBlocks,o=this.extraBytes,a=0,s=0,u=[];s<i;){for(a=0;a<n&&s<i;++a,++s)e=s<<2,t=r[a],u[e]=255&t,u[e+1]=t>>8&255,u[e+2]=t>>16&255,u[e+3]=t>>24&255;s%n==0&&F(r)}return o&&(e=s<<2,t=r[a],u[e]=255&t,o>1&&(u[e+1]=t>>8&255),o>2&&(u[e+2]=t>>16&255)),u},D.prototype=new N,D.prototype.finalize=function(){return this.encode(this.outputBits,!0),N.prototype.finalize.call(this)};var F=function(e){var t,n,r,i,o,a,s,u,l,A,h,f,d,p,g,v,y,m,w,b,I,B,E,C,x,k,S,Q,_,N,D,F,P,U,L,M,T,R,O,H,K,j,G,q,V,z,J,Y,X,W,Z,$,ee,te,ne,re,ie,oe,ae,se,ue,le,Ae;for(r=0;r<48;r+=2)i=e[0]^e[10]^e[20]^e[30]^e[40],o=e[1]^e[11]^e[21]^e[31]^e[41],a=e[2]^e[12]^e[22]^e[32]^e[42],s=e[3]^e[13]^e[23]^e[33]^e[43],u=e[4]^e[14]^e[24]^e[34]^e[44],l=e[5]^e[15]^e[25]^e[35]^e[45],A=e[6]^e[16]^e[26]^e[36]^e[46],h=e[7]^e[17]^e[27]^e[37]^e[47],t=(f=e[8]^e[18]^e[28]^e[38]^e[48])^(a<<1|s>>>31),n=(d=e[9]^e[19]^e[29]^e[39]^e[49])^(s<<1|a>>>31),e[0]^=t,e[1]^=n,e[10]^=t,e[11]^=n,e[20]^=t,e[21]^=n,e[30]^=t,e[31]^=n,e[40]^=t,e[41]^=n,t=i^(u<<1|l>>>31),n=o^(l<<1|u>>>31),e[2]^=t,e[3]^=n,e[12]^=t,e[13]^=n,e[22]^=t,e[23]^=n,e[32]^=t,e[33]^=n,e[42]^=t,e[43]^=n,t=a^(A<<1|h>>>31),n=s^(h<<1|A>>>31),e[4]^=t,e[5]^=n,e[14]^=t,e[15]^=n,e[24]^=t,e[25]^=n,e[34]^=t,e[35]^=n,e[44]^=t,e[45]^=n,t=u^(f<<1|d>>>31),n=l^(d<<1|f>>>31),e[6]^=t,e[7]^=n,e[16]^=t,e[17]^=n,e[26]^=t,e[27]^=n,e[36]^=t,e[37]^=n,e[46]^=t,e[47]^=n,t=A^(i<<1|o>>>31),n=h^(o<<1|i>>>31),e[8]^=t,e[9]^=n,e[18]^=t,e[19]^=n,e[28]^=t,e[29]^=n,e[38]^=t,e[39]^=n,e[48]^=t,e[49]^=n,p=e[0],g=e[1],z=e[11]<<4|e[10]>>>28,J=e[10]<<4|e[11]>>>28,Q=e[20]<<3|e[21]>>>29,_=e[21]<<3|e[20]>>>29,se=e[31]<<9|e[30]>>>23,ue=e[30]<<9|e[31]>>>23,j=e[40]<<18|e[41]>>>14,G=e[41]<<18|e[40]>>>14,U=e[2]<<1|e[3]>>>31,L=e[3]<<1|e[2]>>>31,v=e[13]<<12|e[12]>>>20,y=e[12]<<12|e[13]>>>20,Y=e[22]<<10|e[23]>>>22,X=e[23]<<10|e[22]>>>22,N=e[33]<<13|e[32]>>>19,D=e[32]<<13|e[33]>>>19,le=e[42]<<2|e[43]>>>30,Ae=e[43]<<2|e[42]>>>30,te=e[5]<<30|e[4]>>>2,ne=e[4]<<30|e[5]>>>2,M=e[14]<<6|e[15]>>>26,T=e[15]<<6|e[14]>>>26,m=e[25]<<11|e[24]>>>21,w=e[24]<<11|e[25]>>>21,W=e[34]<<15|e[35]>>>17,Z=e[35]<<15|e[34]>>>17,F=e[45]<<29|e[44]>>>3,P=e[44]<<29|e[45]>>>3,C=e[6]<<28|e[7]>>>4,x=e[7]<<28|e[6]>>>4,re=e[17]<<23|e[16]>>>9,ie=e[16]<<23|e[17]>>>9,R=e[26]<<25|e[27]>>>7,O=e[27]<<25|e[26]>>>7,b=e[36]<<21|e[37]>>>11,I=e[37]<<21|e[36]>>>11,$=e[47]<<24|e[46]>>>8,ee=e[46]<<24|e[47]>>>8,q=e[8]<<27|e[9]>>>5,V=e[9]<<27|e[8]>>>5,k=e[18]<<20|e[19]>>>12,S=e[19]<<20|e[18]>>>12,oe=e[29]<<7|e[28]>>>25,ae=e[28]<<7|e[29]>>>25,H=e[38]<<8|e[39]>>>24,K=e[39]<<8|e[38]>>>24,B=e[48]<<14|e[49]>>>18,E=e[49]<<14|e[48]>>>18,e[0]=p^~v&m,e[1]=g^~y&w,e[10]=C^~k&Q,e[11]=x^~S&_,e[20]=U^~M&R,e[21]=L^~T&O,e[30]=q^~z&Y,e[31]=V^~J&X,e[40]=te^~re&oe,e[41]=ne^~ie&ae,e[2]=v^~m&b,e[3]=y^~w&I,e[12]=k^~Q&N,e[13]=S^~_&D,e[22]=M^~R&H,e[23]=T^~O&K,e[32]=z^~Y&W,e[33]=J^~X&Z,e[42]=re^~oe&se,e[43]=ie^~ae&ue,e[4]=m^~b&B,e[5]=w^~I&E,e[14]=Q^~N&F,e[15]=_^~D&P,e[24]=R^~H&j,e[25]=O^~K&G,e[34]=Y^~W&$,e[35]=X^~Z&ee,e[44]=oe^~se&le,e[45]=ae^~ue&Ae,e[6]=b^~B&p,e[7]=I^~E&g,e[16]=N^~F&C,e[17]=D^~P&x,e[26]=H^~j&U,e[27]=K^~G&L,e[36]=W^~$&q,e[37]=Z^~ee&V,e[46]=se^~le&te,e[47]=ue^~Ae&ne,e[8]=B^~p&v,e[9]=E^~g&y,e[18]=F^~C&k,e[19]=P^~x&S,e[28]=j^~U&M,e[29]=G^~L&T,e[38]=$^~q&z,e[39]=ee^~V&J,e[48]=le^~te&re,e[49]=Ae^~ne&ie,e[0]^=c[r],e[1]^=c[r+1]};if(a)e.exports=B;else for(C=0;C<E.length;++C)r[E[C]]=B[E[C]]}()}(xV);var QV,_V,NV=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){e.done?i(e.value):function(e){return e instanceof n?e:new n((function(t){t(e)}))}(e.value).then(a,s)}u((r=r.apply(e,t||[])).next())}))},DV=function(e){c(n,e);var t=b(n);function n(e){var r,i=e.issuer,o=void 0===i?null:i,a=e.verificationMethod,u=void 0===a?null:a,l=e.document,A=void 0===l?null:l,c=e.proof,h=void 0===c?null:c,f=e.options,d=void 0===f?{}:f;if(s(this,n),(r=t.call(this,{type:"MerkleProof2019"})).type="MerkleProof2019",r.issuer=null,r.verificationMethod=null,r.proof=null,r.proofValue=null,r.document=null,r.explorerAPIs=[],r.documentLoader=null,r.proofVerificationProcess=["getTransactionId","computeLocalHash","fetchRemoteHash","compareHashes","checkMerkleRoot","checkReceipt"],r.identityVerificationProcess=["deriveIssuingAddressFromPublicKey","compareIssuingAddress"],r.transactionId="",!A)throw new Error("A document signed by MerkleProof2019 is required for the verification process.");return r.issuer=o,r.verificationMethod=u,r.document=A,r.setProof(h),r.setOptions(d),r.getChain(),w(r)}return l(n,[{key:"setProof",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=null!=e?e:this.document.proof;if(!t)throw new Error("The passed document is not signed.");this.proof=t,this.proofValue=n.decodeMerkleProof2019(this.proof)}},{key:"verifyProof",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{documentLoader:function(e){},verifyIdentity:!0},t=e.documentLoader,n=e.verifyIdentity;return NV(this,void 0,void 0,r().mark((function e(){var i,o;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.documentLoader=t,o="",SV(this.chain)&&(this.adaptProofVerificationProcessToMocknet(),this.adaptIdentityVerificationProcessToMocknet()),e.prev=3,e.next=6,this.verifyProcess(this.proofVerificationProcess);case 6:if(e.t0=n,!e.t0){e.next=10;break}return e.next=10,this.verifyIdentity();case 10:i=!0,e.next=16;break;case 13:e.prev=13,e.t1=e.catch(3),console.error(e.t1),i=!1,o=e.t1.message;case 16:return e.abrupt("return",{verificationMethod:this.verificationMethod,verified:i,error:o});case 17:case"end":return e.stop()}}),e,this,[[3,13]])})))}},{key:"verifyIdentity",value:function(){return NV(this,void 0,void 0,r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null==this.verificationMethod){e.next=9;break}return e.prev=1,e.next=4,this.verifyProcess(this.identityVerificationProcess);case 4:e.next=9;break;case 6:throw e.prev=6,e.t0=e.catch(1),new Error(e.t0);case 9:case"end":return e.stop()}}),e,this,[[1,6]])})))}},{key:"getProofVerificationProcess",value:function(){return this.proofVerificationProcess}},{key:"getIdentityVerificationProcess",value:function(){return this.identityVerificationProcess}},{key:"getIssuerPublicKey",value:function(){var e,t;return SV(this.chain)?"This mock chain does not support issuing addresses":null!==(t=null===(e=this.getTxData())||void 0===e?void 0:e.issuingAddress)&&void 0!==t?t:""}},{key:"getIssuanceTime",value:function(){var e,t;return null!==(t=null===(e=this.getTxData())||void 0===e?void 0:e.time)&&void 0!==t?t:""}},{key:"getChain",value:function(){return this.chain||(this.chain=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(null==e?void 0:e.anchors){var t=e.anchors[0];if("string"==typeof t)return function(e){var t,n=e.split(":");switch(n[1]){case Ul.mocknet.blinkCode:return hF(Ul.mocknet.signatureValue);case Ul.bitcoin.blinkCode:t=Ul.bitcoin.name;break;case Ul.ethmain.blinkCode:t=Ul.ethmain.name;break;default:throw new Error("Could not retrieve chain.")}var r=n[2],i=t.toLowerCase()+function(e){var t=e.substr(0,1),n=e.substr(1,e.length-1);return t.toUpperCase()+n.toLowerCase()}(r);return hF(i)}(t)}return null}(this.proofValue)),this.chain}},{key:"getTxData",value:function(){return this.txData?this.txData:(console.error("Trying to access issuing address when txData not available yet. Did you run the `verify` method yet?"),null)}},{key:"adaptProofVerificationProcessToMocknet",value:function(){fF(this.proofVerificationProcess,"getTransactionId"),fF(this.proofVerificationProcess,"fetchRemoteHash"),fF(this.proofVerificationProcess,"checkMerkleRoot")}},{key:"adaptIdentityVerificationProcessToMocknet",value:function(){this.identityVerificationProcess=[]}},{key:"setOptions",value:function(e){var t;this.explorerAPIs=null!==(t=e.explorerAPIs)&&void 0!==t?t:[],e.executeStepMethod&&"function"==typeof e.executeStepMethod&&(this.executeStep=e.executeStepMethod)}},{key:"executeStep",value:function(e,t){return NV(this,void 0,void 0,r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t();case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})))}},{key:"verifyProcess",value:function(e){return NV(this,void 0,void 0,r().mark((function t(){var n,i,o;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=F(e),t.prev=1,n.s();case 3:if((i=n.n()).done){t.next=11;break}if(this[o=i.value]){t.next=7;break}return t.abrupt("return",void console.error("verification logic for",o,"not implemented"));case 7:return t.next=9,this[o]();case 9:t.next=3;break;case 11:t.next=16;break;case 13:t.prev=13,t.t0=t.catch(1),n.e(t.t0);case 16:return t.prev=16,n.f(),t.finish(16);case 19:case"end":return t.stop()}}),t,this,[[1,13,16,19]])})))}},{key:"checkMerkleRoot",value:function(){return NV(this,void 0,void 0,r().mark((function e(){var t=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.executeStep("checkMerkleRoot",(function(){return function(e,t){if(e!==t)throw new yF("checkMerkleRoot",bF("errors","ensureMerkleRootEqual"));return!0}(t.proofValue.merkleRoot,t.txData.remoteHash)}),this.type);case 2:case"end":return e.stop()}}),e,this)})))}},{key:"compareHashes",value:function(){return NV(this,void 0,void 0,r().mark((function e(){var t=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.executeStep("compareHashes",(function(){return function(e,t){if(e!==t)throw new yF("compareHashes",bF("errors","ensureHashesEqual"));return!0}(t.localDocumentHash,t.proofValue.targetHash)}),this.type);case 2:case"end":return e.stop()}}),e,this)})))}},{key:"computeLocalHash",value:function(){return NV(this,void 0,void 0,r().mark((function e(){var t=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.executeStep("computeLocalHash",(function(){return NV(t,void 0,void 0,r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,BF(this.document,this.proof,this.documentLoader);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})))}),this.type);case 2:this.localDocumentHash=e.sent;case 3:case"end":return e.stop()}}),e,this)})))}},{key:"checkReceipt",value:function(){return NV(this,void 0,void 0,r().mark((function e(){var t=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.executeStep("checkReceipt",(function(){return function(e){var t=e.targetHash,n=e.merkleRoot;try{var r=e.path;if(r&&t)for(var i in r){var o=r[i],a=void 0;if(void 0!==o.left)a=vF("".concat(o.left).concat(t)),t=vk(a);else{if(void 0===o.right)throw new yF("checkReceipt","Trigger catch error.");a=vF("".concat(t).concat(o.right)),t=vk(a)}}}catch(e){throw new yF("checkReceipt",bF("errors","ensureValidReceipt"))}if(t!==n)throw new yF("checkReceipt",bF("errors","invalidMerkleReceipt"))}(t.proofValue)}),this.type);case 2:case"end":return e.stop()}}),e,this)})))}},{key:"getTransactionId",value:function(){return NV(this,void 0,void 0,r().mark((function e(){var t=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.transactionId=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(!e)throw new Error("DecodedProof is not set");var t=e.anchors,n=t[0];if("string"==typeof n)return n.split(":").pop();throw new Error("Could not retrieve transaction id as was provided an unexpected format")}(this.proofValue),e.next=3,this.executeStep("getTransactionId",(function(){return function(e){if("string"==typeof e&&e.length>0)return e;throw new yF("getTransactionId",bF("errors","isTransactionIdValid"))}(t.transactionId)}),this.type);case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e,this)})))}},{key:"fetchRemoteHash",value:function(){return NV(this,void 0,void 0,r().mark((function e(){var t=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.executeStep("fetchRemoteHash",(function(){return NV(t,void 0,void 0,r().mark((function e(){var t;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ff({transactionId:this.transactionId,chain:null===(t=this.chain)||void 0===t?void 0:t.code,explorerAPIs:this.explorerAPIs});case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})))}),this.type);case 2:this.txData=e.sent;case 3:case"end":return e.stop()}}),e,this)})))}},{key:"deriveIssuingAddressFromPublicKey",value:function(){return NV(this,void 0,void 0,r().mark((function e(){var t=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.executeStep("deriveIssuingAddressFromPublicKey",(function(){return kV(t.verificationMethod,t.chain)}),this.type);case 2:this.derivedIssuingAddress=e.sent;case 3:case"end":return e.stop()}}),e,this)})))}},{key:"compareIssuingAddress",value:function(){return NV(this,void 0,void 0,r().mark((function e(){var t=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.executeStep("compareIssuingAddress",(function(){return function(e,t){var n=bF("errors","identityErrorBaseMessage");if(e!==t)throw new yF("compareIssuingAddress","".concat(n," - ").concat(bF("errors","compareIssuingAddress")))}(t.getIssuerPublicKey(),t.derivedIssuingAddress)}),this.type);case 2:case"end":return e.stop()}}),e,this)})))}}],[{key:"decodeMerkleProof2019",value:function(e){return new dD.Decoder(e.proofValue).decode()}}]),n}(uF.suites.LinkedDataProof),FV=l((function e(t){s(this,e)}));function PV(e){return Array.isArray(e)?e.find((function(e){return"ChainedProof2021"!==e.type})).verificationMethod:e.verificationMethod}!function(e){e.getTransactionId="getTransactionId",e.computeLocalHash="computeLocalHash",e.fetchRemoteHash="fetchRemoteHash",e.parseIssuerKeys="parseIssuerKeys",e.compareHashes="compareHashes",e.checkImagesIntegrity="checkImagesIntegrity",e.checkMerkleRoot="checkMerkleRoot",e.checkReceipt="checkReceipt",e.retrieveVerificationMethodPublicKey="retrieveVerificationMethodPublicKey",e.deriveIssuingAddressFromPublicKey="deriveIssuingAddressFromPublicKey",e.compareIssuingAddress="compareIssuingAddress",e.checkAuthenticity="checkAuthenticity"}(QV||(QV={}));var UV=function(e){c(v,e);var t,n,i,o,u,h,f,d,p,g=b(v);function v(e){var t,n;return s(this,v),A(m(t=g.call(this,e)),"proofVerificationProcess",[QV.parseIssuerKeys,QV.checkAuthenticity]),A(m(t),"transactionId",void 0),A(m(t),"localHash",void 0),A(m(t),"documentToVerify",void 0),A(m(t),"txData",void 0),A(m(t),"chain",void 0),A(m(t),"explorerAPIs",void 0),A(m(t),"receipt",void 0),A(m(t),"issuerPublicKeyList",void 0),A(m(t),"issuer",void 0),A(m(t),"verificationMethodPublicKey",void 0),A(m(t),"derivedIssuingAddress",void 0),A(m(t),"hasDid",void 0),A(m(t),"proof",void 0),A(m(t),"type","MerkleProof2019"),A(m(t),"suite",void 0),t.executeStep=e.executeStep,t.documentToVerify=e.document,t.explorerAPIs=e.explorerAPIs,t.proof=e.proof,t.issuer=e.issuer,t.validateProofType(),t.receipt=(n=t.proof,DV.decodeMerkleProof2019(n)),t.transactionId=ek.certificates.getTransactionId(t.receipt),t.setHasDid(),t}return l(v,[{key:"init",value:(p=a(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.setVerificationSuite();case 2:this.chain=this.suite.getChain(),this.adaptVerificationProcessToChain();case 4:case"end":return e.stop()}}),e,this)}))),function(){return p.apply(this,arguments)})},{key:"verifyProof",value:(d=a(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.suite.verifyProof({verifyIdentity:!1});case 2:return e.next=4,this.verifyProcess(this.proofVerificationProcess);case 4:case"end":return e.stop()}}),e,this)}))),function(){return d.apply(this,arguments)})},{key:"verifyIdentity",value:(f=a(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.suite.verifyIdentity();case 2:case"end":return e.stop()}}),e,this)}))),function(){return f.apply(this,arguments)})},{key:"getProofVerificationSteps",value:function(e){return[].concat(k(this.suite.getProofVerificationProcess()),k(this.proofVerificationProcess)).map((function(t){return ek.verifier.convertToVerificationSubsteps(e,t)}))}},{key:"getIdentityVerificationSteps",value:function(e){return this.hasDid?this.suite.getIdentityVerificationProcess().map((function(t){return ek.verifier.convertToVerificationSubsteps(e,t)})):[]}},{key:"getIssuerPublicKey",value:function(){return this.suite.getIssuerPublicKey()}},{key:"getIssuanceTime",value:function(){return this.suite.getIssuanceTime()}},{key:"getIssuerName",value:function(){return this.issuer.name}},{key:"getIssuerProfileDomain",value:function(){var e;return null===(e=new URL(this.getIssuerProfileUrl()))||void 0===e?void 0:e.hostname}},{key:"getIssuerProfileUrl",value:function(){return this.issuer.id}},{key:"getSigningDate",value:function(){return this.proof.created}},{key:"getChain",value:function(){return this.suite.getChain()}},{key:"getReceipt",value:function(){return this.receipt}},{key:"getTransactionIdString",value:function(){return ek.certificates.getTransactionId(this.getReceipt())}},{key:"getTransactionLink",value:function(){return ek.certificates.getTransactionLink(this.getTransactionIdString(),this.getChain()).transactionLink}},{key:"getRawTransactionLink",value:function(){return ek.certificates.getTransactionLink(this.getTransactionIdString(),this.getChain()).rawTransactionLink}},{key:"executeStep",value:(h=a(r().mark((function e(t,n,i){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:throw new Error("executeStep method needs to be overwritten by injecting from Verifier");case 1:case"end":return e.stop()}}),e)}))),function(e,t,n){return h.apply(this,arguments)})},{key:"setVerificationSuite",value:(u=a(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.setIssuerFromProofVerificationMethod();case 2:this.verificationMethodPublicKey=kk(this.getTargetVerificationMethodContainer(),PV(this.proof)),this.suite=new DV({document:this.documentToVerify,proof:this.proof,verificationMethod:this.verificationMethodPublicKey,options:{explorerAPIs:this.explorerAPIs,executeStepMethod:this.executeStep}});case 4:case"end":return e.stop()}}),e,this)}))),function(){return u.apply(this,arguments)})},{key:"adaptVerificationProcessToChain",value:function(){ek.chains.isMockChain(this.chain)&&(nd(this.proofVerificationProcess,QV.parseIssuerKeys),nd(this.proofVerificationProcess,QV.checkAuthenticity))}},{key:"getTargetVerificationMethodContainer",value:function(){var e;return null!==(e=this.issuer.didDocument)&&void 0!==e?e:this.issuer}},{key:"isProofChain",value:function(){return"ChainedProof2021"===this.proof.type}},{key:"setIssuerFromProofVerificationMethod",value:(o=a(r().mark((function e(){var t;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.isProofChain()){e.next=5;break}return t=this.proof.verificationMethod.split("#")[0],e.next=4,ek.verifier.getIssuerProfile(t);case 4:this.issuer=e.sent;case 5:case"end":return e.stop()}}),e,this)}))),function(){return o.apply(this,arguments)})},{key:"setHasDid",value:function(){if(this.isProofChain()){var e=this.proof.verificationMethod.split("#")[0];this.hasDid=ld(e)}else this.hasDid=!!this.issuer.didDocument}},{key:"validateProofType",value:function(){var e=this.isProofChain()?this.proof.chainedProofType:this.proof.type;if(e!==this.type)throw new Error("Incompatible proof type passed. Expected: ".concat(this.type,", Got: ").concat(e))}},{key:"verifyProcess",value:(i=a(r().mark((function e(t){var n,i,o;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=F(t),e.prev=1,n.s();case 3:if((i=n.n()).done){e.next=11;break}if(this[o=i.value]){e.next=7;break}return e.abrupt("return",void console.error("verification logic for",o,"not implemented"));case 7:return e.next=9,this[o]();case 9:e.next=3;break;case 11:e.next=16;break;case 13:e.prev=13,e.t0=e.catch(1),n.e(e.t0);case 16:return e.prev=16,n.f(),e.finish(16);case 19:case"end":return e.stop()}}),e,this,[[1,13,16,19]])}))),function(e){return i.apply(this,arguments)})},{key:"parseIssuerKeys",value:(n=a(r().mark((function e(){var t=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.executeStep(QV.parseIssuerKeys,(function(){return ek.verifier.parseIssuerKeys(t.issuer)}),this.type);case 2:this.issuerPublicKeyList=e.sent;case 3:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"checkAuthenticity",value:(t=a(r().mark((function e(){var t=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.executeStep(QV.checkAuthenticity,(function(){return Ck(t.issuerPublicKeyList,t.getIssuerPublicKey(),t.getIssuanceTime())}),this.type);case 2:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}]),v}(FV);!function(e){e.getTransactionId="getTransactionId",e.computeLocalHash="computeLocalHash",e.fetchRemoteHash="fetchRemoteHash",e.parseIssuerKeys="parseIssuerKeys",e.compareHashes="compareHashes",e.checkMerkleRoot="checkMerkleRoot",e.checkReceipt="checkReceipt",e.checkAuthenticity="checkAuthenticity"}(_V||(_V={}));var LV=function(e){c(I,e);var t,n,i,o,u,h,f,d,p,g,v,y,w=b(I);function I(e){var t;return s(this,I),A(m(t=w.call(this,e)),"verificationProcess",[_V.getTransactionId,_V.computeLocalHash,_V.fetchRemoteHash,_V.compareHashes,_V.checkMerkleRoot,_V.checkReceipt,_V.parseIssuerKeys,_V.checkAuthenticity]),A(m(t),"transactionId",void 0),A(m(t),"localHash",void 0),A(m(t),"documentToVerify",void 0),A(m(t),"txData",void 0),A(m(t),"chain",void 0),A(m(t),"explorerAPIs",void 0),A(m(t),"receipt",void 0),A(m(t),"issuerPublicKeyList",void 0),A(m(t),"issuer",void 0),A(m(t),"proof",void 0),A(m(t),"type","MerkleProof2017"),e.executeStep&&(t.executeStep=e.executeStep),t.documentToVerify=e.document,t.explorerAPIs=e.explorerAPIs,t.issuer=e.issuer,t.proof=e.proof,t.validateProofType(),t.receipt=t.documentToVerify.signature,t.chain=ek.certificates.getChain("",t.receipt),t.transactionId=ek.certificates.getTransactionId(t.receipt),t.adaptVerificationProcessToChain(),t}return l(I,[{key:"init",value:(y=a(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)}))),function(){return y.apply(this,arguments)})},{key:"verifyProof",value:(v=a(r().mark((function e(){var t,n,i;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=F(this.verificationProcess),e.prev=1,t.s();case 3:if((n=t.n()).done){e.next=11;break}if(this[i=n.value]){e.next=7;break}return e.abrupt("return",void console.error("verification logic for",i,"not implemented"));case 7:return e.next=9,this[i]();case 9:e.next=3;break;case 11:e.next=16;break;case 13:e.prev=13,e.t0=e.catch(1),t.e(e.t0);case 16:return e.prev=16,t.f(),e.finish(16);case 19:case"end":return e.stop()}}),e,this,[[1,13,16,19]])}))),function(){return v.apply(this,arguments)})},{key:"verifyIdentity",value:(g=a(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)}))),function(){return g.apply(this,arguments)})},{key:"getProofVerificationSteps",value:function(e){return this.verificationProcess.map((function(t){return ek.verifier.convertToVerificationSubsteps(e,t)}))}},{key:"getIdentityVerificationSteps",value:function(){return[]}},{key:"getIssuerPublicKey",value:function(){return ek.chains.isMockChain(this.chain)?"This mock chain does not support issuing addresses":this.txData?this.txData.issuingAddress:void console.error("Trying to access issuing address when txData not available yet. Did you run the `verify` method yet?")}},{key:"getIssuerName",value:function(){return this.issuer.name}},{key:"getIssuerProfileDomain",value:function(){var e;return null===(e=new URL(this.getIssuerProfileUrl()))||void 0===e?void 0:e.hostname}},{key:"getIssuerProfileUrl",value:function(){return this.issuer.id}},{key:"getSigningDate",value:function(){return this.documentToVerify.issuedOn}},{key:"getChain",value:function(){return this.chain}},{key:"getReceipt",value:function(){return this.receipt}},{key:"getTransactionIdString",value:function(){return ek.certificates.getTransactionId(this.getReceipt())}},{key:"getTransactionLink",value:function(){return ek.certificates.getTransactionLink(this.getTransactionIdString(),this.getChain()).transactionLink}},{key:"getRawTransactionLink",value:function(){return ek.certificates.getTransactionLink(this.getTransactionIdString(),this.getChain()).rawTransactionLink}},{key:"validateProofType",value:function(){if(this.proof.type[0]!==this.type)throw new Error("Incompatible proof type passed. Expected: ".concat(this.type,", Got: ").concat(this.proof.type[0]))}},{key:"adaptVerificationProcessToChain",value:function(){ek.chains.isMockChain(this.chain)&&(nd(this.verificationProcess,_V.getTransactionId),nd(this.verificationProcess,_V.fetchRemoteHash),nd(this.verificationProcess,_V.parseIssuerKeys),nd(this.verificationProcess,_V.checkMerkleRoot),nd(this.verificationProcess,_V.checkAuthenticity))}},{key:"executeStep",value:(p=a(r().mark((function e(t,n,i){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:throw new Error("doAction method needs to be overwritten by injecting from CVJS");case 1:case"end":return e.stop()}}),e)}))),function(e,t,n){return p.apply(this,arguments)})},{key:"getTransactionId",value:(d=a(r().mark((function e(){var t=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.executeStep(_V.getTransactionId,(function(){return function(e){if("string"==typeof e&&e.length>0)return e;throw new $f("getTransactionId",zf("errors","isTransactionIdValid"))}(t.transactionId)}),this.type);case 2:case"end":return e.stop()}}),e,this)}))),function(){return d.apply(this,arguments)})},{key:"computeLocalHash",value:(f=a(r().mark((function e(){var t=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.executeStep(_V.computeLocalHash,a(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Bk(t.documentToVerify);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)}))),this.type);case 2:this.localHash=e.sent;case 3:case"end":return e.stop()}}),e,this)}))),function(){return f.apply(this,arguments)})},{key:"fetchRemoteHash",value:(h=a(r().mark((function e(){var t=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.executeStep(_V.fetchRemoteHash,a(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,ek.verifier.lookForTx({transactionId:t.transactionId,chain:t.chain.code,explorerAPIs:t.explorerAPIs});case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)}))),this.type);case 2:this.txData=e.sent;case 3:case"end":return e.stop()}}),e,this)}))),function(){return h.apply(this,arguments)})},{key:"compareHashes",value:(u=a(r().mark((function e(){var t=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.executeStep(_V.compareHashes,(function(){return function(e,t){if(e!==t)throw new $f("compareHashes",zf("errors","ensureHashesEqual"));return!0}(t.localHash,t.receipt.targetHash)}),this.type);case 2:case"end":return e.stop()}}),e,this)}))),function(){return u.apply(this,arguments)})},{key:"checkMerkleRoot",value:(o=a(r().mark((function e(){var t=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.executeStep(_V.checkMerkleRoot,(function(){return function(e,t){if(e!==t)throw new $f("checkMerkleRoot",zf("errors","ensureMerkleRootEqual"));return!0}(t.receipt.merkleRoot,t.txData.remoteHash)}),this.type);case 2:case"end":return e.stop()}}),e,this)}))),function(){return o.apply(this,arguments)})},{key:"checkReceipt",value:(i=a(r().mark((function e(){var t=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.executeStep(_V.checkReceipt,(function(){return function(e){var t=e.targetHash,n=e.merkleRoot;try{var r=e.proof||e.path;if(r)for(var i in r){var o=r[i],a=void 0;if(void 0!==o.left)a=yk("".concat(o.left).concat(t)),t=vk(a);else{if(void 0===o.right)throw new $f("checkReceipt","Trigger catch error.");a=yk("".concat(t).concat(o.right)),t=vk(a)}}}catch(e){throw new $f("checkReceipt",zf("errors","ensureValidReceipt"))}if(t!==n)throw new $f("checkReceipt",zf("errors","invalidMerkleReceipt"))}(t.receipt)}),this.type);case 2:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"parseIssuerKeys",value:(n=a(r().mark((function e(){var t=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.executeStep(_V.parseIssuerKeys,(function(){return ek.verifier.parseIssuerKeys(t.issuer)}),this.type);case 2:this.issuerPublicKeyList=e.sent;case 3:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"checkAuthenticity",value:(t=a(r().mark((function e(){var t=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.executeStep(_V.checkAuthenticity,(function(){return Ck(t.issuerPublicKeyList,t.txData.issuingAddress,t.txData.time)}),this.type);case 2:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}]),I}(FV),MV={};function TV(e,t){return function(e,t,n){if(!(e instanceof Uint8Array))throw new TypeError('"input" must be a Uint8Array.');if(void 0!==n&&"number"!=typeof n)throw new TypeError('"maxline" must be a number.');if(0===e.length)return"";var r="",i=0,o=t.length,a=t.charAt(0),s=[0];for(i=0;i<e.length;++i){for(var u=e[i],l=0;l<s.length;++l)u+=s[l]<<8,s[l]=u%o,u=u/o|0;for(;u>0;)s.push(u%o),u=u/o|0}for(i=0;0===e[i]&&i<e.length-1;++i)r+=a;for(i=s.length-1;i>=0;--i)r+=t[s[i]];if(n){var A=new RegExp(".{1,"+n+"}","g");r=r.match(A).join("\r\n")}return r}(e,"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",t)}function RV(e){return function(e,t){if("string"!=typeof e)throw new TypeError('"input" must be a string.');if(0===e.length)return new Uint8Array;var n=MV[t];if(!n){n=MV[t]=[];for(var r=0;r<t.length;++r)n[t.charCodeAt(r)]=r}e=e.replace(/\s/g,"");for(var i=t.length,o=t.charAt(0),a=[0],s=0;s<e.length;s++){var u=n[e.charCodeAt(s)];if(void 0===u)return;for(var l=u,A=0;A<a.length;++A)l+=a[A]*i,a[A]=255&l,l>>=8;for(;l>0;)a.push(255&l),l>>=8}for(var c=0;e[c]===o&&c<e.length-1;++c)a.push(0);return new Uint8Array(a.reverse())}
529
+ var sF={},uF=sF,lF=bD;Object.assign(sF,lF);var AF=function(){function e(){s(this,e)}var t,i;return l(e,[{key:"add",value:(i=a(r().mark((function e(t){var i,o,a,s,u,l,A,c=arguments;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=c.length>1&&void 0!==c[1]?c[1]:{},o=i.suite,a=i.purpose,s=i.documentLoader,u=i.expansionMap,o){e.next=3;break}throw new TypeError('"options.suite" is required.');case 3:if(a){e.next=5;break}throw new TypeError('"options.purpose" is required.');case 5:return s=s?FD(s):PD,void 0===u?u=LD:!1===u&&(u=void 0),delete(l=n({},t)).proof,e.next=10,o.createProof({document:l,purpose:a,documentLoader:s,expansionMap:u});case 10:return A=e.sent,e.abrupt("return",(DD.addValue(t,"proof",A),t));case 12:case"end":return e.stop()}}),e)}))),function(e){return i.apply(this,arguments)})},{key:"verify",value:(t=a(r().mark((function e(t){var i,o,s,u,l,A,c,h,f,d,p,g,v,y,m,w=arguments;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=w.length>1&&void 0!==w[1]?w[1]:{},o=i.suite,s=i.purpose,u=i.documentLoader,l=i.expansionMap,o){e.next=3;break}throw new TypeError('"options.suite" is required.');case 3:if(s){e.next=5;break}throw new TypeError('"options.purpose" is required.');case 5:if(0!==(A=Array.isArray(o)?o:[o]).length){e.next=8;break}throw new TypeError("At least one suite is required.");case 8:return u=u?FD(u):PD,void 0===l?l=LD:!1===l&&(l=void 0),e.prev=9,t=n({},t),e.next=13,function(){var e=a(r().mark((function e(t){var i,o,a;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=t.document,o=DD.getValues(i,"proof"),delete i.proof,0!==o.length){e.next=3;break}throw new Error("No matching proofs found in the given document.");case 3:return a=i["@context"]||ND.SECURITY_CONTEXT_URL,e.abrupt("return",(o=o.map((function(e){return n({"@context":a},e)})),{proofSet:o,document:i}));case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()({document:t,documentLoader:u,expansionMap:l});case 13:return c=e.sent,h=c.proofSet,f=c.document,t=f,e.next=19,function(){var e=a(r().mark((function e(t){var n,i,o,s,u,l,A,c,h,f,d;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.document,i=t.suites,o=t.proofSet,s=t.purpose,u=t.documentLoader,l=t.expansionMap,A=Array.isArray(s)?s:[s],c=new Map,h=new Map,f=new Map,e.next=4,Promise.all(A.map((function(e){return(t=a(r().mark((function e(t){var n,i,o,a,s,u,l,A,c,h,f,d,p,g,v,y,m,w,b;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=t.purposeToProofs,i=t.proofToSuite,o=t.purpose,a=t.proofSet,s=t.suites,u=t.suiteMatchQueue,l=t.document,A=t.documentLoader,c=t.expansionMap,h=F(a),e.prev=2,h.s();case 4:if((f=h.n()).done){e.next=38;break}return d=f.value,e.next=8,o.match(d,{document:l,documentLoader:A,expansionMap:c});case 8:if(e.sent){e.next=10;break}return e.abrupt("continue",36);case 10:p=!1,g=F(s),e.prev=12,g.s();case 14:if((v=g.n()).done){e.next=27;break}return y=v.value,(m=u.get(y))||u.set(y,m=new Map),(w=m.get(d))||(w=y.matchProof({proof:d,document:l,documentLoader:A,expansionMap:c}),m.set(d,w)),e.next=22,w;case 22:if(!e.sent){e.next=25;break}return p=!0,i.set(d,y),e.abrupt("break",27);case 25:e.next=14;break;case 27:e.next=32;break;case 29:e.prev=29,e.t0=e.catch(12),g.e(e.t0);case 32:return e.prev=32,g.f(),e.finish(32);case 35:p&&((b=n.get(o))?b.push(d):n.set(o,[d]));case 36:e.next=4;break;case 38:e.next=43;break;case 40:e.prev=40,e.t1=e.catch(2),h.e(e.t1);case 43:return e.prev=43,h.f(),e.finish(43);case 46:case"end":return e.stop()}}),e,null,[[2,40,43,46],[12,29,32,35]])}))),function(e){return t.apply(this,arguments)})({purposeToProofs:c,proofToSuite:h,purpose:e,proofSet:o,suites:i,suiteMatchQueue:f,document:n,documentLoader:u,expansionMap:l});var t})));case 4:if(!(c.size<A.length)){e.next=6;break}return e.abrupt("return",[]);case 6:return d=new Map,e.next=9,Promise.all(k(h.entries()).map(function(){var e=a(r().mark((function e(t){var i,o,s,A,c,h,f,p,g,v;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=C(t,2),o=i[0],s=i[1],e.prev=1,h={validate:function(){var e=a(r().mark((function e(t,n){var i;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=n.verificationMethod,e.abrupt("return",(c=i,{valid:!0}));case 2:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()},e.next=5,s.verifyProof({proof:o,document:n,purpose:h,documentLoader:u,expansionMap:l});case 5:f=e.sent,p=f.verified,g=f.verificationMethod,v=f.error,c||(c=g),A={proof:o,verified:p,verificationMethod:c,error:v},e.next=15;break;case 12:e.prev=12,e.t0=e.catch(1),A={proof:o,verified:!1,error:e.t0};case 15:A.error&&MD(A.error),d.set(o,A);case 16:case"end":return e.stop()}}),e,null,[[1,12]])})));return function(t){return e.apply(this,arguments)}}()));case 9:return e.next=11,Promise.all(k(c.entries()).map(function(){var e=a(r().mark((function e(t){var i,o,a,s,A,c,f,p,g,v;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=C(t,2),o=i[0],a=i[1],s=F(a),e.prev=2,s.s();case 4:if((A=s.n()).done){e.next=23;break}if(c=A.value,(f=d.get(c)).verified){e.next=9;break}return e.abrupt("continue",21);case 9:return p=f.verificationMethod,g=h.get(c),v=void 0,e.prev=11,e.next=14,o.validate(c,{document:n,suite:g,verificationMethod:p,documentLoader:u,expansionMap:l});case 14:v=e.sent,e.next=20;break;case 17:e.prev=17,e.t0=e.catch(11),v={valid:!1,error:e.t0};case 20:f.purposeResult?Array.isArray(f.purposeResult)?f.purposeResult.push(v):f.purposeResult=[f.purposeResult,v]:f.purposeResult=v,v.valid||(MD(v.error),f.error||(f.verified=!1,f.error=v.error));case 21:e.next=4;break;case 23:e.next=28;break;case 25:e.prev=25,e.t1=e.catch(2),s.e(e.t1);case 28:return e.prev=28,s.f(),e.finish(28);case 31:case"end":return e.stop()}}),e,null,[[2,25,28,31],[11,17]])})));return function(t){return e.apply(this,arguments)}}()));case 11:return e.abrupt("return",k(d.values()));case 12:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()({document:t,suites:A,proofSet:h,purpose:s,documentLoader:u,expansionMap:l});case 19:if(0!==(d=e.sent).length){e.next=23;break}throw(p=new Error("Did not verify any proofs; insufficient proofs matched the acceptable suite(s) and required purpose(s).")).name="NotFoundError",p;case 23:if(g=d.some((function(e){return e.verified})),g){e.next=27;break}return y=(v=[]).concat.apply(v,k(d.filter((function(e){return e.error})).map((function(e){return e.error})))),m={verified:g,results:d},e.abrupt("return",(y.length>0&&(m.error=y),m));case 27:return e.abrupt("return",{verified:g,results:d});case 30:return e.prev=30,e.t0=e.catch(9),e.abrupt("return",(MD(e.t0),{verified:!1,error:e.t0}));case 33:case"end":return e.stop()}}),e,null,[[9,30]])}))),function(e){return t.apply(this,arguments)})}]),e}(),cF=RD;function hF(e){var t=Object.keys(Ul).map((function(e){return Ul[e]})).find((function(t){return t.signatureValue===e}));return t}function fF(e,t){var n=e.findIndex((function(e){return e===t}));n>-1&&e.splice(n,1)}sF.sign=function(){var e=a(r().mark((function e(t){var n,o,a,s,u,l,A,c,h,f=arguments;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=f.length>1&&void 0!==f[1]?f[1]:{},o=n.suite,a=n.purpose,s=n.documentLoader,u=n.expansionMap,l=n.addSuiteContext,A=void 0===l||l,"object"==i(t)){e.next=3;break}throw new TypeError('The "document" parameter must be an object.');case 3:return o.ensureSuiteContext({document:t,addSuiteContext:A}),e.prev=4,e.next=7,(new AF).add(t,{suite:o,purpose:a,documentLoader:s,expansionMap:u});case 7:return e.abrupt("return",e.sent);case 10:if(e.prev=10,e.t0=e.catch(4),s||"jsonld.InvalidUrl"!==e.t0.name){e.next=15;break}throw c=e.t0.details.url,(h=new Error('A URL "'.concat(c,'" could not be fetched; you need to pass "documentLoader" or resolve the URL before calling "sign".'))).cause=e.t0,h;case 15:throw e.t0;case 16:case"end":return e.stop()}}),e,null,[[4,10]])})));return function(t){return e.apply(this,arguments)}}(),sF.verify=function(){var e=a(r().mark((function e(t){var n,o,a,s,u,l,A,c,h,f=arguments;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=f.length>1&&void 0!==f[1]?f[1]:{},o=n.suite,a=n.purpose,s=n.documentLoader,u=n.expansionMap,"object"==i(t)){e.next=3;break}throw new TypeError('The "document" parameter must be an object.');case 3:return e.next=5,(new AF).verify(t,{suite:o,purpose:a,documentLoader:s,expansionMap:u});case 5:return l=e.sent,(A=l.error)&&(s||"jsonld.InvalidUrl"!==A.name?l.error=new cF(A):(c=A.details.url,h=new Error('A URL "'.concat(c,'" could not be fetched; you need to pass "documentLoader" or resolve the URL before calling "verify".')),l.error=new cF(h))),e.abrupt("return",l);case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),sF.suites=WD.suites,sF.purposes=aF.purposes,Object.assign(sF,xD);var dF={"@context":{id:"@id",type:"@type",bc:"https://w3id.org/blockcerts#",obi:"https://w3id.org/openbadges#",cp:"https://w3id.org/chainpoint#",schema:"http://schema.org/",sec:"https://w3id.org/security#",xsd:"http://www.w3.org/2001/XMLSchema#",MerkleProof2017:"sec:MerkleProof2017",RecipientProfile:"bc:RecipientProfile",SignatureLine:"bc:SignatureLine",MerkleProofVerification2017:"bc:MerkleProofVerification2017",recipientProfile:"bc:recipientProfile",signatureLines:"bc:signatureLines",introductionUrl:{"@id":"bc:introductionUrl","@type":"@id"},subtitle:"bc:subtitle",jobTitle:"schema:jobTitle",creator:{"@id":"dc:creator","@type":"@id"},expires:{"@id":"sec:expiration","@type":"xsd:dateTime"},revoked:{"@id":"sec:expiration","@type":"xsd:dateTime"},CryptographicKey:"sec:Key",signature:"sec:signature",verification:"bc:verification",publicKeys:"bc:publicKeys",ChainpointSHA256v2:"cp:ChainpointSHA256v2",BTCOpReturn:"cp:BTCOpReturn",targetHash:"cp:targetHash",merkleRoot:"cp:merkleRoot",proof:"cp:proof",anchors:"cp:anchors",sourceId:"cp:sourceId",right:"cp:right",left:"cp:left"},"obi:validation":[{"obi:validatesType":"RecipientProfile","obi:validationSchema":"https://w3id.org/blockcerts/schema/2.0-alpha/recipientSchema.json"},{"obi:validatesType":"SignatureLine","obi:validationSchema":"https://w3id.org/blockcerts/schema/2.0-alpha/signatureLineSchema.json"},{"obi:validatesType":"MerkleProof2017","obi:validationSchema":"https://w3id.org/blockcerts/schema/2.0-alpha/merkleProof2017Schema.json"}]},pF={"@context":{id:"@id",type:"@type",bc:"https://w3id.org/blockcerts#",cp:"https://w3id.org/chainpoint#",schema:"http://schema.org/",sec:"https://w3id.org/security#",xsd:"http://www.w3.org/2001/XMLSchema#",MerkleProof2019:"sec:MerkleProof2019",BlockcertsCredential:"bc:BlockcertsCredential",introductionUrl:{"@id":"bc:introductionUrl","@type":"@id"},CryptographicKey:"sec:Key",domain:"sec:domain",nonce:"sec:nonce",proofValue:"sec:proofValue",assertionMethod:{"@id":"sec:assertionMethod","@type":"@id","@container":"@set"},proofPurpose:{"@id":"sec:proofPurpose","@type":"@vocab"},verificationMethod:{"@id":"sec:verificationMethod","@type":"@id"},created:{"@id":"bc:created","@type":"xsd:dateTime"},name:{"@id":"schema:name"}}},gF={"@context":{id:"@id",type:"@type",bc:"https://w3id.org/blockcerts#",cp:"https://w3id.org/chainpoint#",vc:"https://www.w3.org/2018/credentials/v1",schema:"https://schema.org/",sec:"https://w3id.org/security#",xsd:"http://www.w3.org/2001/XMLSchema#",MerkleProof2019:"sec:MerkleProof2019",BlockcertsCredential:"bc:BlockcertsCredential",introductionUrl:{"@id":"bc:introductionUrl","@type":"@id"},metadata:"bc:metadata",display:{"@id":"bc:display","@context":{id:"@id",type:"@type",contentMediaType:{"@id":"bc:contentMediaType","@type":"@id"},contentEncoding:{"@id":"bc:contentEncoding","@type":"@id"},content:{"@id":"bc:content","@type":"@id"}}},CryptographicKey:"sec:Key",domain:"sec:domain",nonce:"sec:nonce",proofValue:"sec:proofValue",assertionMethod:{"@id":"sec:assertionMethod","@type":"@id","@container":"@set"},authentication:{"@id":"sec:authenticationMethod","@type":"@id","@container":"@set"},proofPurpose:{"@id":"sec:proofPurpose","@type":"@vocab"},verificationMethod:{"@id":"sec:verificationMethod","@type":"@id"},created:{"@id":"https://purl.org/dc/terms/created","@type":"xsd:dateTime"},challenge:"sec:challenge",expires:{"@id":"sec:expiration","@type":"xsd:dateTime"},name:{"@id":"schema:name"},description:{"@id":"schema:description"},email:{"@id":"schema:email"},publicKey:{"@id":"sec:publicKey","@type":"@id"},url:{"@id":"schema:url","@type":"@id"},image:{"@id":"schema:image","@type":"@id"}}};function vF(e){e=e.trim();for(var t=[],n=0;n<e.length;n+=2)t.push(parseInt(e.substring(n,n+2),16));return t}Rf["https://w3id.org/blockcerts/schema/2.0-alpha/context.json"]=dF,Rf["https://www.blockcerts.org/schema/2.0-alpha/context.json"]=dF,Rf["https://www.blockcerts.org/schema/3.0-alpha/context.json"]=pF,Rf["https://w3id.org/blockcerts/schema/3.0-alpha/context.json"]=pF,Rf["https://w3id.org/blockcerts/v3.0-alpha"]=pF,Rf["https://www.blockcerts.org/schema/3.0-beta/context.json"]=gF,Rf["https://w3id.org/blockcerts/schema/3.0-beta/context.json"]=gF,Rf["https://w3id.org/blockcerts/v3.0-beta"]=gF,Rf["https://w3id.org/security/suites/ed25519-2020/v1"]={"@context":{id:"@id",type:"@type","@protected":!0,proof:{"@id":"https://w3id.org/security#proof","@type":"@id","@container":"@graph"},Ed25519VerificationKey2020:{"@id":"https://w3id.org/security#Ed25519VerificationKey2020","@context":{"@protected":!0,id:"@id",type:"@type",controller:{"@id":"https://w3id.org/security#controller","@type":"@id"},revoked:{"@id":"https://w3id.org/security#revoked","@type":"http://www.w3.org/2001/XMLSchema#dateTime"},publicKeyMultibase:{"@id":"https://w3id.org/security#publicKeyMultibase","@type":"https://w3id.org/security#multibase"}}},Ed25519Signature2020:{"@id":"https://w3id.org/security#Ed25519Signature2020","@context":{"@protected":!0,id:"@id",type:"@type",challenge:"https://w3id.org/security#challenge",created:{"@id":"http://purl.org/dc/terms/created","@type":"http://www.w3.org/2001/XMLSchema#dateTime"},domain:"https://w3id.org/security#domain",expires:{"@id":"https://w3id.org/security#expiration","@type":"http://www.w3.org/2001/XMLSchema#dateTime"},nonce:"https://w3id.org/security#nonce",proofPurpose:{"@id":"https://w3id.org/security#proofPurpose","@type":"@vocab","@context":{"@protected":!0,id:"@id",type:"@type",assertionMethod:{"@id":"https://w3id.org/security#assertionMethod","@type":"@id","@container":"@set"},authentication:{"@id":"https://w3id.org/security#authenticationMethod","@type":"@id","@container":"@set"},capabilityInvocation:{"@id":"https://w3id.org/security#capabilityInvocationMethod","@type":"@id","@container":"@set"},capabilityDelegation:{"@id":"https://w3id.org/security#capabilityDelegationMethod","@type":"@id","@container":"@set"},keyAgreement:{"@id":"https://w3id.org/security#keyAgreementMethod","@type":"@id","@container":"@set"}}},proofValue:{"@id":"https://w3id.org/security#proofValue","@type":"https://w3id.org/security#multibase"},verificationMethod:{"@id":"https://w3id.org/security#verificationMethod","@type":"@id"}}}}};var yF=function(e){c(n,e);var t=b(n);function n(e,r){var i;return s(this,n),(i=t.call(this,r)).stepCode=e,i}return l(n)}(g(Error)),mF="en-US",wF={"en-US":{errors:{ensureHashesEqual:"Computed hash does not match remote hash",ensureMerkleRootEqual:"Merkle root does not match remote hash.",ensureValidReceipt:"The receipt is malformed. There was a problem navigating the merkle tree in the receipt.",failedJsonLdNormalization:"Failed JSON-LD normalization",foundUnmappedFields:"Found unmapped fields during JSON-LD normalization",identityErrorBaseMessage:"Issuer identity mismatch",deriveIssuingAddressFromPublicKey:"Unsupported blockchain for DID verification",compareIssuingAddress:"The provided verification method does not match the issuer identity",getTransactionId:"Cannot verify this certificate without a transaction ID to compare against.",invalidMerkleReceipt:"Invalid Merkle Receipt. Proof hash did not match Merkle root",isTransactionIdValid:"Cannot verify this certificate without a transaction ID to compare against.",noProofSpecified:"Document proof is an array but no target proof was specified to know what to verify."}},fr:{errors:{ensureHashesEqual:"Calcul du hash local différent du hash distant",ensureMerkleRootEqual:"Le Merkle root ne correspond pas au hash distant",ensureValidReceipt:"Erreur d'écriture du reçu. Un problème est survenu lors de la navigation de l'arbre Merkle du reçu.",failedJsonLdNormalization:"Erreur de normalisation JSON-LD",foundUnmappedFields:"Champs non liés découverts durant la normalisation JSON-LD",identityErrorBaseMessage:"Identité de l'émetteur invalide",deriveIssuingAddressFromPublicKey:"Cette blockchain n'est pas supportée pour la vérification de l'identité décentralisée.",compareIssuingAddress:"La méthode de vérification n'a pas permis d'établir l'identité de l'émetteur.",getTransactionId:"Impossible de vérifier ce certificat sans un identifiant de transaction valide",invalidMerkleReceipt:"Reçu Merkle invalide. Hash de preuve différent du Merkle root",isTransactionIdValid:"Impossible de vérifier ce certificat sans un identifiant de transaction valide",noProofSpecified:"La propriété 'proof' du document est un tableau mais aucune preuve n'a été passée pour savoir ce qu'il faut vérifier"}},es:{errors:{ensureHashesEqual:"La cadena binaria calculada no corresponde con la cadena binaria remota",ensureMerkleRootEqual:"La raíz Merkle no corresponde con la cadena binaria remota",ensureValidReceipt:"El recibo está malformado. Hubo un problema navegando el árbol Merkle en el recibo",failedJsonLdNormalization:"La normalización del JSON-LD ha fallado",foundUnmappedFields:"Se han encontrado campos no mapeados durante la normalización de JSON-LD",identityErrorBaseMessage:"Identitad del emisor inválida",deriveIssuingAddressFromPublicKey:"No se puede validar la identitad decentalisada con esta cadena binaria.",compareIssuingAddress:"El metodo de verificación no corresponde a la identitad del emisor.",getTransactionId:"No se puede verificar este certificado sin una identificación de transacción que sirva como comparación",invalidMerkleReceipt:"Recibo Merkle inválido. La cadena binaria de prueba no corresponde con la raíz Merkle",isTransactionIdValid:"No se puede verificar este certificado sin una identificación de transacción que sirva como comparación",noProofSpecified:"La propiedad 'proof' del documento es una lista, pero no prueba especifica ha sido declarada para conocer el punto de verificación"}},mt:{errors:{ensureHashesEqual:"Il-hash ikkalkulat ma jikkorrispondix mar-remote hash",ensureMerkleRootEqual:"Merkle root ma taqbilx mar-remote hash",ensureValidReceipt:"L-irċevuta hija malformata. Kien hemm problema fin-navigazzjoni tal-merkle tree fl-irċevuta",failedJsonLdNormalization:"In-normalizzazzjoni ta' JSON-LD ma rnexxietx",foundUnmappedFields:"Instabu unmapped fields matul in-normalizzazzjoni JSON-LD",identityErrorBaseMessage:"Issuer identity mismatch",deriveIssuingAddressFromPublicKey:"Unsupported blockchain for DID verification",compareIssuingAddress:"The provided verification method does not match the issuer identity",getTransactionId:"Dan iċ-ċertifikat ma jistax jiġi vverifikat mingħajr ID ta' tranżazzjoni mqabbla miegħu",invalidMerkleReceipt:"Irċevuta Merkle invalida. Il-proof hash ma kienx jaqbel mal-Merkle root",isTransactionIdValid:"Dan iċ-ċertifikat ma jistax jiġi vverifikat mingħajr ID ta' tranżazzjoni mqabbla miegħu",noProofSpecified:"Document proof is an array but no target proof was specified to know what to verify."}},"it-IT":{errors:{ensureHashesEqual:"L'hash calcolato non corrisponde all'hash remoto",ensureMerkleRootEqual:"La radice di Merkle non corrisponde all'hash remoto.",ensureValidReceipt:"La ricevuta è malformata. C'è stato un problema nella navigazione dell'albero di Merkle nella ricevuta.",failedJsonLdNormalization:"Normalizzazione JSON-LD fallita",foundUnmappedFields:"Campi non mappati trovati durante la normalizzazione JSON-LD",identityErrorBaseMessage:"Issuer identity mismatch",deriveIssuingAddressFromPublicKey:"Unsupported blockchain for DID verification",compareIssuingAddress:"The provided verification method does not match the issuer identity",getTransactionId:"Impossibile verificare questo certificato senza un ID transazione da confrontare.",invalidMerkleReceipt:"Ricevuta Merkle non valida. L'hash di prova non corrisponde alla radice di Merkle",isTransactionIdValid:"Impossibile verificare questo certificato senza un ID transazione da confrontare.",noProofSpecified:"Document proof is an array but no target proof was specified to know what to verify."}},ja:{errors:{ensureHashesEqual:"算出されたハッシュがリモートハッシュと一致しませんでした",ensureMerkleRootEqual:"Merkle rootがリモートハッシュと一致しませんでした",ensureValidReceipt:"レシートが異常です。レシート内のMerkle treeを辿る際に問題が発生しました。",failedJsonLdNormalization:"JSON-LDの正規化に失敗しました",foundUnmappedFields:"JSON-LDの正規化時にマップされていないフィールドを検出しました",identityErrorBaseMessage:"Issuer identity mismatch",deriveIssuingAddressFromPublicKey:"Unsupported blockchain for DID verification",compareIssuingAddress:"The provided verification method does not match the issuer identity",getTransactionId:"照合のための取引IDがないため、この証明書を認証できません。",invalidMerkleReceipt:"Merkleレシートが無効です。証明ハッシュがMerkle rootと一致しませんでした。",isTransactionIdValid:"照合するための取引IDがないため、この証明書を認証できません。",noProofSpecified:"Document proof is an array but no target proof was specified to know what to verify."}}};function bF(e,t){return e&&t?wF[mF]?wF[mF][e]?wF[mF][e][t]?wF[mF][e][t]||"":"[missing locale item data]":"[missing locale group data]":"[missing locale data]":""}var IF=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){e.done?i(e.value):function(e){return e instanceof n?e:new n((function(t){t(e)}))}(e.value).then(a,s)}u((r=r.apply(e,t||[])).next())}))};function BF(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(e){};return IF(this,void 0,void 0,r().mark((function i(){var o,a,s,u,l;return r().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if(e["@context"].find((function(e){return(t=e)===Object(t)&&"@vocab"in e;var t}))||e["@context"].push({"@vocab":"http://fallback.org/"}),o=JSON.parse(JSON.stringify(e)),!Array.isArray(o.proof)){i.next=9;break}if(t){i.next=5;break}throw new yF("computeLocalHash",bF("errors","noProofSpecified"));case 5:a=o.proof.findIndex((function(e){return e.proofValue===t.proofValue})),o.proof=o.proof.slice(0,a),i.next=10;break;case 9:delete o.proof;case 10:return s={algorithm:"URDNA2015",format:"application/nquads",documentLoader:function(e){return IF(this,void 0,void 0,r().mark((function t(){return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.t0=null!=n,!t.t0){t.next=4;break}return t.next=4,n(e);case 4:return t.abrupt("return",e in Rf?{contextUrl:null,document:Rf[e],documentUrl:e}:nw.documentLoader(e));case 5:case"end":return t.stop()}}),t)})))}},i.prev=11,i.next=14,nw.normalize(o,s);case 14:u=i.sent,i.next=20;break;case 17:throw i.prev=17,i.t0=i.catch(11),console.error(i.t0),new yF("computeLocalHash",bF("errors","failedJsonLdNormalization"));case 20:if(l=function(e){var t=e.split("\n"),n=/<http:\/\/fallback\.org\/(.*)>/,r=t.map((function(e){return n.exec(e)})).filter((function(e){return null!=e}));if(r.length>0){var i=r.map((function(e){return e[1]})).sort();return Array.from(new Set(i))}return null}(u),!l){i.next=23;break}throw new yF("computeLocalHash","".concat(bF("errors","foundUnmappedFields"),": ").concat(l.join(", ")));case 23:return i.abrupt("return",vk(function(e){for(var t=[],n=0;n<e.length;n++){var r=e.charCodeAt(n);r<128?t.push(r):r<2048?t.push(192|r>>6,128|63&r):r<55296||r>=57344?t.push(224|r>>12,128|r>>6&63,128|63&r):(n++,r=65536+((1023&r)<<10|1023&e.charCodeAt(n)),t.push(240|r>>18,128|r>>12&63,128|r>>6&63,128|63&r))}return t}(u)));case 24:case"end":return i.stop()}}),i,null,[[11,17]])})))}var EF,CF=function(e){c(n,e);var t=b(n);function n(e){return s(this,n),t.call(this,e||"This operation is not supported for this key type")}return l(n)}(g(Error)),xF=CF,kF=function(e){c(n,e);var t=b(n);function n(){return s(this,n),t.call(this,"This has not been implemented yet")}return l(n)}(g(Error)),SF=function(){function e(){s(this,e),this.registry=[],this.classes={}}return l(e,[{key:"find",value:function(e){return this.registry.find(e)}},{key:"define",value:function(e,t){var n=this;e.forEach((function(e){var r=e.kty;if(!r)throw new Error("Invalid type definition");n.classes[r]||(n.classes[r]=t),n.registry.push(e)}))}},{key:"normalize",value:function(e,t,n){var r=this.classes[e],i=this.find((function(e){return e[t]===n}));if(!r||!i)throw new Error("Invalid type");return new r(i)}}]),e}(),QF=kF,_F=function(){function e(t){s(this,e),this.params=t}return l(e,[{key:"fromPrivatePKCS1",value:function(e){throw new QF}},{key:"fromPrivatePKCS8",value:function(e){throw new QF}},{key:"fromPublicPKCS1",value:function(e){throw new QF}},{key:"fromPublicPKCS8",value:function(e){throw new QF}},{key:"fromPrivateBlk",value:function(e){throw new QF}},{key:"fromPublicBlk",value:function(e){throw new QF}},{key:"fromJwk",value:function(e){throw new QF}},{key:"toPrivatePKCS1",value:function(e){throw new QF}},{key:"toPrivatePKCS8",value:function(e){throw new QF}},{key:"toPublicPKCS1",value:function(e){throw new QF}},{key:"toPublicPKCS8",value:function(e){throw new QF}},{key:"toPrivateBlk",value:function(e){throw new QF}},{key:"toPublicBlk",value:function(e){throw new QF}},{key:"toPrivateJwk",value:function(e){throw new QF}},{key:"toPublicJwk",value:function(e){throw new QF}}],[{key:"formatPem",value:function(e,t){return"-----BEGIN ".concat(t," KEY-----\n")+e.match(/.{1,64}/g).join("\n")+"\n-----END ".concat(t," KEY-----")}}]),e}(),NF={},DF={},FF={},PF=Fa,UF=PF.Buffer,LF={};for(EF in PF)PF.hasOwnProperty(EF)&&"SlowBuffer"!==EF&&"Buffer"!==EF&&(LF[EF]=PF[EF]);var MF=LF.Buffer={};for(EF in UF)UF.hasOwnProperty(EF)&&"allocUnsafe"!==EF&&"allocUnsafeSlow"!==EF&&(MF[EF]=UF[EF]);if(LF.Buffer.prototype=UF.prototype,MF.from&&MF.from!==Uint8Array.from||(MF.from=function(e,t,n){if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type '+i(e));if(e&&void 0===e.length)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+i(e));return UF(e,t,n)}),MF.alloc||(MF.alloc=function(e,t,n){if("number"!=typeof e)throw new TypeError('The "size" argument must be of type number. Received type '+i(e));if(e<0||e>=2*(1<<30))throw new RangeError('The value "'+e+'" is invalid for option "size"');var r=UF(e);return t&&0!==t.length?"string"==typeof n?r.fill(t,n):r.fill(t):r.fill(0),r}),!LF.kStringMaxLength)try{LF.kStringMaxLength=lA.binding("buffer").kStringMaxLength}catch(e){}LF.constants||(LF.constants={MAX_LENGTH:LF.kMaxLength},LF.kStringMaxLength&&(LF.constants.MAX_STRING_LENGTH=LF.kStringMaxLength));var TF=LF,RF={},OF=KI.exports;function HF(e){this._reporterState={obj:null,path:[],options:e||{},errors:[]}}function KF(e,t){this.path=e,this.rethrow(t)}RF.Reporter=HF,HF.prototype.isError=function(e){return e instanceof KF},HF.prototype.save=function(){var e=this._reporterState;return{obj:e.obj,pathLen:e.path.length}},HF.prototype.restore=function(e){var t=this._reporterState;t.obj=e.obj,t.path=t.path.slice(0,e.pathLen)},HF.prototype.enterKey=function(e){return this._reporterState.path.push(e)},HF.prototype.exitKey=function(e){var t=this._reporterState;t.path=t.path.slice(0,e-1)},HF.prototype.leaveKey=function(e,t,n){var r=this._reporterState;this.exitKey(e),null!==r.obj&&(r.obj[t]=n)},HF.prototype.path=function(){return this._reporterState.path.join("/")},HF.prototype.enterObject=function(){var e=this._reporterState,t=e.obj;return e.obj={},t},HF.prototype.leaveObject=function(e){var t=this._reporterState,n=t.obj;return t.obj=e,n},HF.prototype.error=function(e){var t,n=this._reporterState,r=e instanceof KF;if(t=r?e:new KF(n.path.map((function(e){return"["+JSON.stringify(e)+"]"})).join(""),e.message||e,e.stack),!n.options.partial)throw t;return r||n.errors.push(t),t},HF.prototype.wrapResult=function(e){var t=this._reporterState;return t.options.partial?{result:this.isError(e)?null:e,errors:t.errors}:e},OF(KF,Error),KF.prototype.rethrow=function(e){if(this.message=e+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,KF),!this.stack)try{throw new Error(this.message)}catch(e){this.stack=e.stack}return this};var jF={},GF=KI.exports,qF=RF.Reporter,VF=TF.Buffer;function zF(e,t){qF.call(this,t),VF.isBuffer(e)?(this.base=e,this.offset=0,this.length=e.length):this.error("Input not Buffer")}function JF(e,t){if(Array.isArray(e))this.length=0,this.value=e.map((function(e){return JF.isEncoderBuffer(e)||(e=new JF(e,t)),this.length+=e.length,e}),this);else if("number"==typeof e){if(!(0<=e&&e<=255))return t.error("non-byte EncoderBuffer value");this.value=e,this.length=1}else if("string"==typeof e)this.value=e,this.length=VF.byteLength(e);else{if(!VF.isBuffer(e))return t.error("Unsupported type: "+i(e));this.value=e,this.length=e.length}}GF(zF,qF),jF.DecoderBuffer=zF,zF.isDecoderBuffer=function(e){return e instanceof zF||"object"==i(e)&&VF.isBuffer(e.base)&&"DecoderBuffer"===e.constructor.name&&"number"==typeof e.offset&&"number"==typeof e.length&&"function"==typeof e.save&&"function"==typeof e.restore&&"function"==typeof e.isEmpty&&"function"==typeof e.readUInt8&&"function"==typeof e.skip&&"function"==typeof e.raw},zF.prototype.save=function(){return{offset:this.offset,reporter:qF.prototype.save.call(this)}},zF.prototype.restore=function(e){var t=new zF(this.base);return t.offset=e.offset,t.length=this.offset,this.offset=e.offset,qF.prototype.restore.call(this,e.reporter),t},zF.prototype.isEmpty=function(){return this.offset===this.length},zF.prototype.readUInt8=function(e){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(e||"DecoderBuffer overrun")},zF.prototype.skip=function(e,t){if(!(this.offset+e<=this.length))return this.error(t||"DecoderBuffer overrun");var n=new zF(this.base);return n._reporterState=this._reporterState,n.offset=this.offset,n.length=this.offset+e,this.offset+=e,n},zF.prototype.raw=function(e){return this.base.slice(e?e.offset:this.offset,this.length)},jF.EncoderBuffer=JF,JF.isEncoderBuffer=function(e){return e instanceof JF||"object"==i(e)&&"EncoderBuffer"===e.constructor.name&&"number"==typeof e.length&&"function"==typeof e.join},JF.prototype.join=function(e,t){return e||(e=VF.alloc(this.length)),t||(t=0),0===this.length||(Array.isArray(this.value)?this.value.forEach((function(n){n.join(e,t),t+=n.length})):("number"==typeof this.value?e[t]=this.value:"string"==typeof this.value?e.write(this.value,t):VF.isBuffer(this.value)&&this.value.copy(e,t),t+=this.length)),e};var YF=RF.Reporter,XF=jF.EncoderBuffer,WF=jF.DecoderBuffer,ZF=xI,$F=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],eP=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat($F);function tP(e,t,n){var r={};this._baseState=r,r.name=n,r.enc=e,r.parent=t||null,r.children=null,r.tag=null,r.args=null,r.reverseArgs=null,r.choice=null,r.optional=!1,r.any=!1,r.obj=!1,r.use=null,r.useDecoder=null,r.key=null,r.default=null,r.explicit=null,r.implicit=null,r.contains=null,r.parent||(r.children=[],this._wrap())}var nP=tP,rP=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];tP.prototype.clone=function(){var e=this._baseState,t={};rP.forEach((function(n){t[n]=e[n]}));var n=new this.constructor(t.parent);return n._baseState=t,n},tP.prototype._wrap=function(){var e=this._baseState;eP.forEach((function(t){this[t]=function(){var n=new this.constructor(this);return e.children.push(n),n[t].apply(n,arguments)}}),this)},tP.prototype._init=function(e){var t=this._baseState;ZF(null===t.parent),e.call(this),t.children=t.children.filter((function(e){return e._baseState.parent===this}),this),ZF.equal(t.children.length,1,"Root node can have only one child")},tP.prototype._useArgs=function(e){var t=this._baseState,n=e.filter((function(e){return e instanceof this.constructor}),this);e=e.filter((function(e){return!(e instanceof this.constructor)}),this),0!==n.length&&(ZF(null===t.children),t.children=n,n.forEach((function(e){e._baseState.parent=this}),this)),0!==e.length&&(ZF(null===t.args),t.args=e,t.reverseArgs=e.map((function(e){if("object"!=i(e)||e.constructor!==Object)return e;var t={};return Object.keys(e).forEach((function(n){n==(0|n)&&(n|=0);var r=e[n];t[r]=n})),t})))},["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"].forEach((function(e){tP.prototype[e]=function(){var t=this._baseState;throw new Error(e+" not implemented for encoding: "+t.enc)}})),$F.forEach((function(e){tP.prototype[e]=function(){var t=this._baseState,n=Array.prototype.slice.call(arguments);return ZF(null===t.tag),t.tag=e,this._useArgs(n),this}})),tP.prototype.use=function(e){ZF(e);var t=this._baseState;return ZF(null===t.use),t.use=e,this},tP.prototype.optional=function(){return this._baseState.optional=!0,this},tP.prototype.def=function(e){var t=this._baseState;return ZF(null===t.default),t.default=e,t.optional=!0,this},tP.prototype.explicit=function(e){var t=this._baseState;return ZF(null===t.explicit&&null===t.implicit),t.explicit=e,this},tP.prototype.implicit=function(e){var t=this._baseState;return ZF(null===t.explicit&&null===t.implicit),t.implicit=e,this},tP.prototype.obj=function(){var e=this._baseState,t=Array.prototype.slice.call(arguments);return e.obj=!0,0!==t.length&&this._useArgs(t),this},tP.prototype.key=function(e){var t=this._baseState;return ZF(null===t.key),t.key=e,this},tP.prototype.any=function(){return this._baseState.any=!0,this},tP.prototype.choice=function(e){var t=this._baseState;return ZF(null===t.choice),t.choice=e,this._useArgs(Object.keys(e).map((function(t){return e[t]}))),this},tP.prototype.contains=function(e){var t=this._baseState;return ZF(null===t.use),t.contains=e,this},tP.prototype._decode=function(e,t){var n=this._baseState;if(null===n.parent)return e.wrapResult(n.children[0]._decode(e,t));var r,i=n.default,o=!0,a=null;if(null!==n.key&&(a=e.enterKey(n.key)),n.optional){var s=null;if(null!==n.explicit?s=n.explicit:null!==n.implicit?s=n.implicit:null!==n.tag&&(s=n.tag),null!==s||n.any){if(o=this._peekTag(e,s,n.any),e.isError(o))return o}else{var u=e.save();try{null===n.choice?this._decodeGeneric(n.tag,e,t):this._decodeChoice(e,t),o=!0}catch(e){o=!1}e.restore(u)}}if(n.obj&&o&&(r=e.enterObject()),o){if(null!==n.explicit){var l=this._decodeTag(e,n.explicit);if(e.isError(l))return l;e=l}var A=e.offset;if(null===n.use&&null===n.choice){var c;n.any&&(c=e.save());var h=this._decodeTag(e,null!==n.implicit?n.implicit:n.tag,n.any);if(e.isError(h))return h;n.any?i=e.raw(c):e=h}if(t&&t.track&&null!==n.tag&&t.track(e.path(),A,e.length,"tagged"),t&&t.track&&null!==n.tag&&t.track(e.path(),e.offset,e.length,"content"),n.any||(i=null===n.choice?this._decodeGeneric(n.tag,e,t):this._decodeChoice(e,t)),e.isError(i))return i;if(n.any||null!==n.choice||null===n.children||n.children.forEach((function(n){n._decode(e,t)})),n.contains&&("octstr"===n.tag||"bitstr"===n.tag)){var f=new WF(i);i=this._getUse(n.contains,e._reporterState.obj)._decode(f,t)}}return n.obj&&o&&(i=e.leaveObject(r)),null===n.key||null===i&&!0!==o?null!==a&&e.exitKey(a):e.leaveKey(a,n.key,i),i},tP.prototype._decodeGeneric=function(e,t,n){var r=this._baseState;return"seq"===e||"set"===e?null:"seqof"===e||"setof"===e?this._decodeList(t,e,r.args[0],n):/str$/.test(e)?this._decodeStr(t,e,n):"objid"===e&&r.args?this._decodeObjid(t,r.args[0],r.args[1],n):"objid"===e?this._decodeObjid(t,null,null,n):"gentime"===e||"utctime"===e?this._decodeTime(t,e,n):"null_"===e?this._decodeNull(t,n):"bool"===e?this._decodeBool(t,n):"objDesc"===e?this._decodeStr(t,e,n):"int"===e||"enum"===e?this._decodeInt(t,r.args&&r.args[0],n):null!==r.use?this._getUse(r.use,t._reporterState.obj)._decode(t,n):t.error("unknown tag: "+e)},tP.prototype._getUse=function(e,t){var n=this._baseState;return n.useDecoder=this._use(e,t),ZF(null===n.useDecoder._baseState.parent),n.useDecoder=n.useDecoder._baseState.children[0],n.implicit!==n.useDecoder._baseState.implicit&&(n.useDecoder=n.useDecoder.clone(),n.useDecoder._baseState.implicit=n.implicit),n.useDecoder},tP.prototype._decodeChoice=function(e,t){var n=this._baseState,r=null,i=!1;return Object.keys(n.choice).some((function(o){var a=e.save(),s=n.choice[o];try{var u=s._decode(e,t);if(e.isError(u))return!1;r={type:o,value:u},i=!0}catch(t){return e.restore(a),!1}return!0}),this),i?r:e.error("Choice not matched")},tP.prototype._createEncoderBuffer=function(e){return new XF(e,this.reporter)},tP.prototype._encode=function(e,t,n){var r=this._baseState;if(null===r.default||r.default!==e){var i=this._encodeValue(e,t,n);return void 0===i||this._skipDefault(i,t,n)?void 0:i}},tP.prototype._encodeValue=function(e,t,n){var r=this._baseState;if(null===r.parent)return r.children[0]._encode(e,t||new YF);var o=null;if(this.reporter=t,r.optional&&void 0===e){if(null===r.default)return;e=r.default}var a=null,s=!1;if(r.any)o=this._createEncoderBuffer(e);else if(r.choice)o=this._encodeChoice(e,t);else if(r.contains)a=this._getUse(r.contains,n)._encode(e,t),s=!0;else if(r.children)a=r.children.map((function(n){if("null_"===n._baseState.tag)return n._encode(null,t,e);if(null===n._baseState.key)return t.error("Child should have a key");var r=t.enterKey(n._baseState.key);if("object"!=i(e))return t.error("Child expected, but input is not object");var o=n._encode(e[n._baseState.key],t,e);return t.leaveKey(r),o}),this).filter((function(e){return e})),a=this._createEncoderBuffer(a);else if("seqof"===r.tag||"setof"===r.tag){if(!r.args||1!==r.args.length)return t.error("Too many args for : "+r.tag);if(!Array.isArray(e))return t.error("seqof/setof, but data is not Array");var u=this.clone();u._baseState.implicit=null,a=this._createEncoderBuffer(e.map((function(n){var r=this._baseState;return this._getUse(r.args[0],e)._encode(n,t)}),u))}else null!==r.use?o=this._getUse(r.use,n)._encode(e,t):(a=this._encodePrimitive(r.tag,e),s=!0);if(!r.any&&null===r.choice){var l=null!==r.implicit?r.implicit:r.tag,A=null===r.implicit?"universal":"context";null===l?null===r.use&&t.error("Tag could be omitted only for .use()"):null===r.use&&(o=this._encodeComposite(l,s,A,a))}return null!==r.explicit&&(o=this._encodeComposite(r.explicit,!1,"context",o)),o},tP.prototype._encodeChoice=function(e,t){var n=this._baseState,r=n.choice[e.type];return r||ZF(!1,e.type+" not found in "+JSON.stringify(Object.keys(n.choice))),r._encode(e.value,t)},tP.prototype._encodePrimitive=function(e,t){var n=this._baseState;if(/str$/.test(e))return this._encodeStr(t,e);if("objid"===e&&n.args)return this._encodeObjid(t,n.reverseArgs[0],n.args[1]);if("objid"===e)return this._encodeObjid(t,null,null);if("gentime"===e||"utctime"===e)return this._encodeTime(t,e);if("null_"===e)return this._encodeNull();if("int"===e||"enum"===e)return this._encodeInt(t,n.args&&n.reverseArgs[0]);if("bool"===e)return this._encodeBool(t);if("objDesc"===e)return this._encodeStr(t,e);throw new Error("Unsupported tag: "+e)},tP.prototype._isNumstr=function(e){return/^[0-9 ]*$/.test(e)},tP.prototype._isPrintstr=function(e){return/^[A-Za-z0-9 '()+,-./:=?]*$/.test(e)};var iP={};!function(e){function t(e){var t={};return Object.keys(e).forEach((function(n){(0|n)==n&&(n|=0);var r=e[n];t[r]=n})),t}e.tagClass={0:"universal",1:"application",2:"context",3:"private"},e.tagClassByName=t(e.tagClass),e.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"},e.tagByName=t(e.tag)}(iP);var oP=KI.exports,aP=TF.Buffer,sP=nP,uP=iP;function lP(e){this.enc="der",this.name=e.name,this.entity=e,this.tree=new cP,this.tree._init(e.body)}var AP=lP;function cP(e){sP.call(this,"der",e)}function hP(e){return e<10?"0"+e:e}lP.prototype.encode=function(e,t){return this.tree._encode(e,t).join()},oP(cP,sP),cP.prototype._encodeComposite=function(e,t,n,r){var i=function(e,t,n,r){var i;if("seqof"===e?e="seq":"setof"===e&&(e="set"),uP.tagByName.hasOwnProperty(e))i=uP.tagByName[e];else{if("number"!=typeof e||(0|e)!==e)return r.error("Unknown tag: "+e);i=e}return i>=31?r.error("Multi-octet tag encoding unsupported"):(t||(i|=32),i|=uP.tagClassByName[n||"universal"]<<6)}(e,t,n,this.reporter);if(r.length<128){var o=aP.alloc(2);return o[0]=i,o[1]=r.length,this._createEncoderBuffer([o,r])}for(var a=1,s=r.length;s>=256;s>>=8)a++;var u=aP.alloc(2+a);u[0]=i,u[1]=128|a;for(var l=1+a,A=r.length;A>0;l--,A>>=8)u[l]=255&A;return this._createEncoderBuffer([u,r])},cP.prototype._encodeStr=function(e,t){if("bitstr"===t)return this._createEncoderBuffer([0|e.unused,e.data]);if("bmpstr"===t){for(var n=aP.alloc(2*e.length),r=0;r<e.length;r++)n.writeUInt16BE(e.charCodeAt(r),2*r);return this._createEncoderBuffer(n)}return"numstr"===t?this._isNumstr(e)?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: numstr supports only digits and space"):"printstr"===t?this._isPrintstr(e)?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark"):/str$/.test(t)||"objDesc"===t?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: "+t+" unsupported")},cP.prototype._encodeObjid=function(e,t,n){if("string"==typeof e){if(!t)return this.reporter.error("string objid given, but no values map found");if(!t.hasOwnProperty(e))return this.reporter.error("objid not found in values map");e=t[e].split(/[\s.]+/g);for(var r=0;r<e.length;r++)e[r]|=0}else if(Array.isArray(e)){e=e.slice();for(var i=0;i<e.length;i++)e[i]|=0}if(!Array.isArray(e))return this.reporter.error("objid() should be either array or string, got: "+JSON.stringify(e));if(!n){if(e[1]>=40)return this.reporter.error("Second objid identifier OOB");e.splice(0,2,40*e[0]+e[1])}for(var o=0,a=0;a<e.length;a++){var s=e[a];for(o++;s>=128;s>>=7)o++}for(var u=aP.alloc(o),l=u.length-1,A=e.length-1;A>=0;A--){var c=e[A];for(u[l--]=127&c;(c>>=7)>0;)u[l--]=128|127&c}return this._createEncoderBuffer(u)},cP.prototype._encodeTime=function(e,t){var n,r=new Date(e);return"gentime"===t?n=[hP(r.getUTCFullYear()),hP(r.getUTCMonth()+1),hP(r.getUTCDate()),hP(r.getUTCHours()),hP(r.getUTCMinutes()),hP(r.getUTCSeconds()),"Z"].join(""):"utctime"===t?n=[hP(r.getUTCFullYear()%100),hP(r.getUTCMonth()+1),hP(r.getUTCDate()),hP(r.getUTCHours()),hP(r.getUTCMinutes()),hP(r.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+t+" time is not supported yet"),this._encodeStr(n,"octstr")},cP.prototype._encodeNull=function(){return this._createEncoderBuffer("")},cP.prototype._encodeInt=function(e,t){if("string"==typeof e){if(!t)return this.reporter.error("String int or enum given, but no values map");if(!t.hasOwnProperty(e))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(e));e=t[e]}if("number"!=typeof e&&!aP.isBuffer(e)){var n=e.toArray();!e.sign&&128&n[0]&&n.unshift(0),e=aP.from(n)}if(aP.isBuffer(e)){var r=e.length;0===e.length&&r++;var i=aP.alloc(r);return e.copy(i),0===e.length&&(i[0]=0),this._createEncoderBuffer(i)}if(e<128)return this._createEncoderBuffer(e);if(e<256)return this._createEncoderBuffer([0,e]);for(var o=1,a=e;a>=256;a>>=8)o++;for(var s=new Array(o),u=s.length-1;u>=0;u--)s[u]=255&e,e>>=8;return 128&s[0]&&s.unshift(0),this._createEncoderBuffer(aP.from(s))},cP.prototype._encodeBool=function(e){return this._createEncoderBuffer(e?255:0)},cP.prototype._use=function(e,t){return"function"==typeof e&&(e=e(t)),e._getEncoder("der").tree},cP.prototype._skipDefault=function(e,t,n){var r,i=this._baseState;if(null===i.default)return!1;var o=e.join();if(void 0===i.defaultBuffer&&(i.defaultBuffer=this._encodeValue(i.default,t,n).join()),o.length!==i.defaultBuffer.length)return!1;for(r=0;r<o.length;r++)if(o[r]!==i.defaultBuffer[r])return!1;return!0};var fP=KI.exports,dP=AP;function pP(e){dP.call(this,e),this.enc="pem"}fP(pP,dP);var gP=pP;pP.prototype.encode=function(e,t){for(var n=dP.prototype.encode.call(this,e).toString("base64"),r=["-----BEGIN "+t.label+"-----"],i=0;i<n.length;i+=64)r.push(n.slice(i,i+64));return r.push("-----END "+t.label+"-----"),r.join("\n")},function(e){var t=e;t.der=AP,t.pem=gP}(FF);var vP={},yP=KI.exports,mP=CI.exports,wP=jF.DecoderBuffer,bP=nP,IP=iP;function BP(e){this.enc="der",this.name=e.name,this.entity=e,this.tree=new CP,this.tree._init(e.body)}var EP=BP;function CP(e){bP.call(this,"der",e)}function xP(e,t){var n=e.readUInt8(t);if(e.isError(n))return n;var r=IP.tagClass[n>>6],i=0==(32&n);if(31==(31&n)){var o=n;for(n=0;128==(128&o);){if(o=e.readUInt8(t),e.isError(o))return o;n<<=7,n|=127&o}}else n&=31;return{cls:r,primitive:i,tag:n,tagStr:IP.tag[n]}}function kP(e,t,n){var r=e.readUInt8(n);if(e.isError(r))return r;if(!t&&128===r)return null;if(0==(128&r))return r;var i=127&r;if(i>4)return e.error("length octect is too long");r=0;for(var o=0;o<i;o++){r<<=8;var a=e.readUInt8(n);if(e.isError(a))return a;r|=a}return r}BP.prototype.decode=function(e,t){return wP.isDecoderBuffer(e)||(e=new wP(e,t)),this.tree._decode(e,t)},yP(CP,bP),CP.prototype._peekTag=function(e,t,n){if(e.isEmpty())return!1;var r=e.save(),i=xP(e,'Failed to peek tag: "'+t+'"');return e.isError(i)?i:(e.restore(r),i.tag===t||i.tagStr===t||i.tagStr+"of"===t||n)},CP.prototype._decodeTag=function(e,t,n){var r=xP(e,'Failed to decode tag of "'+t+'"');if(e.isError(r))return r;var i=kP(e,r.primitive,'Failed to get length of "'+t+'"');if(e.isError(i))return i;if(!n&&r.tag!==t&&r.tagStr!==t&&r.tagStr+"of"!==t)return e.error('Failed to match tag: "'+t+'"');if(r.primitive||null!==i)return e.skip(i,'Failed to match body of: "'+t+'"');var o=e.save(),a=this._skipUntilEnd(e,'Failed to skip indefinite length body: "'+this.tag+'"');return e.isError(a)?a:(i=e.offset-o.offset,e.restore(o),e.skip(i,'Failed to match body of: "'+t+'"'))},CP.prototype._skipUntilEnd=function(e,t){for(;;){var n=xP(e,t);if(e.isError(n))return n;var r=kP(e,n.primitive,t);if(e.isError(r))return r;var i;if(i=n.primitive||null!==r?e.skip(r):this._skipUntilEnd(e,t),e.isError(i))return i;if("end"===n.tagStr)break}},CP.prototype._decodeList=function(e,t,n,r){for(var i=[];!e.isEmpty();){var o=this._peekTag(e,"end");if(e.isError(o))return o;var a=n.decode(e,"der",r);if(e.isError(a)&&o)break;i.push(a)}return i},CP.prototype._decodeStr=function(e,t){if("bitstr"===t){var n=e.readUInt8();return e.isError(n)?n:{unused:n,data:e.raw()}}if("bmpstr"===t){var r=e.raw();if(r.length%2==1)return e.error("Decoding of string type: bmpstr length mismatch");for(var i="",o=0;o<r.length/2;o++)i+=String.fromCharCode(r.readUInt16BE(2*o));return i}if("numstr"===t){var a=e.raw().toString("ascii");return this._isNumstr(a)?a:e.error("Decoding of string type: numstr unsupported characters")}if("octstr"===t)return e.raw();if("objDesc"===t)return e.raw();if("printstr"===t){var s=e.raw().toString("ascii");return this._isPrintstr(s)?s:e.error("Decoding of string type: printstr unsupported characters")}return/str$/.test(t)?e.raw().toString():e.error("Decoding of string type: "+t+" unsupported")},CP.prototype._decodeObjid=function(e,t,n){for(var r,i=[],o=0,a=0;!e.isEmpty();)o<<=7,o|=127&(a=e.readUInt8()),0==(128&a)&&(i.push(o),o=0);128&a&&i.push(o);var s=i[0]/40|0,u=i[0]%40;if(r=n?i:[s,u].concat(i.slice(1)),t){var l=t[r.join(" ")];void 0===l&&(l=t[r.join(".")]),void 0!==l&&(r=l)}return r},CP.prototype._decodeTime=function(e,t){var n,r,i,o,a,s,u=e.raw().toString();if("gentime"===t)n=0|u.slice(0,4),r=0|u.slice(4,6),i=0|u.slice(6,8),o=0|u.slice(8,10),a=0|u.slice(10,12),s=0|u.slice(12,14);else{if("utctime"!==t)return e.error("Decoding "+t+" time is not supported yet");n=0|u.slice(0,2),r=0|u.slice(2,4),i=0|u.slice(4,6),o=0|u.slice(6,8),a=0|u.slice(8,10),s=0|u.slice(10,12),n=n<70?2e3+n:1900+n}return Date.UTC(n,r-1,i,o,a,s,0)},CP.prototype._decodeNull=function(){return null},CP.prototype._decodeBool=function(e){var t=e.readUInt8();return e.isError(t)?t:0!==t},CP.prototype._decodeInt=function(e,t){var n=e.raw(),r=new mP(n);return t&&(r=t[r.toString(10)]||r),r},CP.prototype._use=function(e,t){return"function"==typeof e&&(e=e(t)),e._getDecoder("der").tree};var SP=KI.exports,QP=TF.Buffer,_P=EP;function NP(e){_P.call(this,e),this.enc="pem"}SP(NP,_P);var DP=NP;NP.prototype.decode=function(e,t){for(var n=e.toString().split(/[\r\n]+/g),r=t.label.toUpperCase(),i=/^-----(BEGIN|END) ([^-]+)-----$/,o=-1,a=-1,s=0;s<n.length;s++){var u=n[s].match(i);if(null!==u&&u[2]===r){if(-1!==o){if("END"!==u[1])break;a=s;break}if("BEGIN"!==u[1])break;o=s}}if(-1===o||-1===a)throw new Error("PEM section not found for: "+r);var l=n.slice(o+1,a).join("");l.replace(/[^a-z0-9+/=]+/gi,"");var A=QP.from(l,"base64");return _P.prototype.decode.call(this,A,t)},function(e){var t=e;t.der=EP,t.pem=DP}(vP),function(e){var t=FF,n=vP,r=KI.exports;function i(e,t){this.name=e,this.body=t,this.decoders={},this.encoders={}}e.define=function(e,t){return new i(e,t)},i.prototype._createNamed=function(e){var t=this.name;function n(e){this._initNamed(e,t)}return r(n,e),n.prototype._initNamed=function(t,n){e.call(this,t,n)},new n(this)},i.prototype._getDecoder=function(e){return e=e||"der",this.decoders.hasOwnProperty(e)||(this.decoders[e]=this._createNamed(n[e])),this.decoders[e]},i.prototype.decode=function(e,t,n){return this._getDecoder(t).decode(e,n)},i.prototype._getEncoder=function(e){return e=e||"der",this.encoders.hasOwnProperty(e)||(this.encoders[e]=this._createNamed(t[e])),this.encoders[e]},i.prototype.encode=function(e,t,n){return this._getEncoder(t).encode(e,n)}}(DF);var FP={};!function(e){var t=FP;t.Reporter=RF.Reporter,t.DecoderBuffer=jF.DecoderBuffer,t.EncoderBuffer=jF.EncoderBuffer,t.Node=nP}();var PP={};!function(e){var t=e;t._reverse=function(e){var t={};return Object.keys(e).forEach((function(n){(0|n)==n&&(n|=0);var r=e[n];t[r]=n})),t},t.der=iP}(PP),function(e){var t=NF;t.bignum=CI.exports,t.define=DF.define,t.base=FP,t.constants=PP,t.decoders=vP,t.encoders=FF}();var UP={exports:{}},LP={},MP={};Object.defineProperty(MP,"__esModule",{value:!0}),MP.default=function(e){var t=e.length,n=t%4;if(!n)return e;var r=t,i=4-n,o=t+i,a=Yo.alloc(o);for(a.write(e);i--;)a.write("=",r++);return a.toString()},Object.defineProperty(LP,"__esModule",{value:!0});var TP=MP;function RP(e,t){return void 0===t&&(t="utf8"),Na(e)?HP(e.toString("base64")):HP(Yo.from(e,t).toString("base64"))}function OP(e){return e=e.toString(),TP.default(e).replace(/\-/g,"+").replace(/_/g,"/")}function HP(e){return e.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}var KP=RP;KP.encode=RP,KP.decode=function(e,t){return void 0===t&&(t="utf8"),Yo.from(OP(e),"base64").toString(t)},KP.toBase64=OP,KP.fromBase64=HP,KP.toBuffer=function(e){return Yo.from(OP(e),"base64")},LP.default=KP,function(e){e.exports=LP.default,e.exports.default=e.exports}(UP);var jP=UP.exports,GP=NF,qP=UP.exports,VP=function(){function e(){s(this,e)}return l(e,null,[{key:"convert",value:function(e,t,n){if(e){if(t===n)return e;var r;if("raw"===t||e instanceof Yo)r=e;else if("uint8_array"===t||Array.isArray(e))r=Yo.from(e);else if("hex"===t)r=Yo.from(e,"hex");else if("base64"===t)r=Yo.from(e,"base64");else if("base64url"===t)r=qP.toBuffer(e);else{if("bn"!==t&&"bignum"!==t)throw new Error("Invalid fromType");r=Yo.from(this.pad(e.toString(16)),"hex")}if("raw"===n)return r;if("uint8_array"===n)return Array.from(r);if("hex"===n)return r.toString("hex");if("base64"===n)return r.toString("base64");if("base64url"===n)return qP.fromBase64(r.toString("base64"));if("bn"===n||"bignum"===n)return new GP.bignum(r);throw new Error("Invalid toType")}}},{key:"pad",value:function(e){return e.length%2==1?"0".concat(e):e}}]),e}(),zP=NF,JP=function(){function e(){s(this,e),Object.defineProperty(this,"_registry",{value:{}})}return l(e,[{key:"registry",get:function(){return this._registry}},{key:"define",value:function(e,t){this._registry[e]=zP.define(e,t(this))}},{key:"normalize",value:function(e){return this.registry[e]}}]),e}(),YP=new JP;YP.define("Version",(function(e){return function(){this.int({0:"two-prime",1:"multi"})}})),YP.define("OtherPrimeInfos",(function(e){return function(){this.seq().obj(this.key("ri").int(),this.key("di").int(),this.key("ti").int())}})),YP.define("AlgorithmIdentifier",(function(e){return function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional().any())}})),YP.define("PrivateKeyInfo",(function(e){var t=e.normalize("Version"),n=e.normalize("AlgorithmIdentifier");return function(){this.seq().obj(this.key("version").use(t),this.key("algorithm").use(n),this.key("privateKey").octstr())}})),YP.define("PublicKeyInfo",(function(e){var t=e.normalize("AlgorithmIdentifier");return function(){this.seq().obj(this.key("algorithm").use(t),this.key("publicKey").bitstr())}})),YP.define("RSAPrivateKey",(function(e){var t=e.normalize("Version"),n=e.normalize("OtherPrimeInfos");return function(){this.seq().obj(this.key("version").use(t),this.key("n").int(),this.key("e").int(),this.key("d").int(),this.key("p").int(),this.key("q").int(),this.key("dp").int(),this.key("dq").int(),this.key("qi").int(),this.key("other").optional().use(n))}})),YP.define("RSAPublicKey",(function(e){return function(){this.seq().obj(this.key("n").int(),this.key("e").int())}})),YP.define("ECPrivateKey",(function(e){return function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").explicit(0).optional().choice({namedCurve:this.objid()}),this.key("publicKey").explicit(1).optional().bitstr())}}));var XP=YP,WP=VP,ZP=XP,$P=function(e){c(n,e);var t=b(n);function n(){return s(this,n),t.apply(this,arguments)}return l(n,[{key:"fromPrivatePKCS1",value:function(e){var t=ZP.normalize("RSAPrivateKey").decode(e,"der"),n=t.n,r=t.e,i=t.d,o=t.p,a=t.q,s=t.dp,u=t.dq,l=t.qi;return{n:WP.convert(n,"bn","raw"),e:WP.convert(r,"bn","raw"),d:WP.convert(i,"bn","raw"),p:WP.convert(o,"bn","raw"),q:WP.convert(a,"bn","raw"),dp:WP.convert(s,"bn","raw"),dq:WP.convert(u,"bn","raw"),qi:WP.convert(l,"bn","raw")}}},{key:"fromPrivatePKCS8",value:function(e){var t=ZP.normalize("PrivateKeyInfo"),n=ZP.normalize("RSAPrivateKey"),r=t.decode(e,"der"),i=n.decode(r.privateKey,"der"),o=i.n,a=i.e,s=i.d,u=i.p,l=i.q,A=i.dp,c=i.dq,h=i.qi;return{n:WP.convert(o,"bn","raw"),e:WP.convert(a,"bn","raw"),d:WP.convert(s,"bn","raw"),p:WP.convert(u,"bn","raw"),q:WP.convert(l,"bn","raw"),dp:WP.convert(A,"bn","raw"),dq:WP.convert(c,"bn","raw"),qi:WP.convert(h,"bn","raw")}}},{key:"fromPublicPKCS1",value:function(e){var t=ZP.normalize("RSAPublicKey").decode(e,"der"),n=t.n,r=t.e;return{n:WP.convert(n,"bn","raw"),e:WP.convert(r,"bn","raw")}}},{key:"fromPublicPKCS8",value:function(e){var t=ZP.normalize("PublicKeyInfo"),n=ZP.normalize("RSAPublicKey"),r=t.decode(e,"der"),i=n.decode(r.publicKey.data,"der"),o=i.n,a=i.e;return{n:WP.convert(o,"bn","raw"),e:WP.convert(a,"bn","raw")}}},{key:"fromJwk",value:function(e){var t=e.n,n=e.e,r=e.d,i=e.p,o=e.q,a=e.dp,s=e.dq,u=e.qi;return e.alg,{n:WP.convert(t,"base64url","raw"),e:WP.convert(n,"base64url","raw"),d:WP.convert(r,"base64url","raw"),p:WP.convert(i,"base64url","raw"),q:WP.convert(o,"base64url","raw"),dp:WP.convert(a,"base64url","raw"),dq:WP.convert(s,"base64url","raw"),qi:WP.convert(u,"base64url","raw")}}},{key:"toPrivatePKCS1",value:function(e){var t=e.n,r=e.e,i=e.d,o=e.p,a=e.q,s=e.dp,u=e.dq,l=e.qi,A=this.params.version,c=ZP.normalize("RSAPrivateKey").encode({version:A,n:WP.convert(t,"raw","bn"),e:WP.convert(r,"raw","bn"),d:WP.convert(i,"raw","bn"),p:WP.convert(o,"raw","bn"),q:WP.convert(a,"raw","bn"),dp:WP.convert(s,"raw","bn"),dq:WP.convert(u,"raw","bn"),qi:WP.convert(l,"raw","bn")},"der").toString("base64");return n.formatPem(c,"RSA PRIVATE")}},{key:"toPrivatePKCS8",value:function(e){var t=e.n,r=e.e,i=e.d,o=e.p,a=e.q,s=e.dp,u=e.dq,l=e.qi,A=this.params,c=A.oid,h=A.algParameters,f=A.version,d=ZP.normalize("PrivateKeyInfo"),p=ZP.normalize("RSAPrivateKey").encode({version:f,n:WP.convert(t,"raw","bn"),e:WP.convert(r,"raw","bn"),d:WP.convert(i,"raw","bn"),p:WP.convert(o,"raw","bn"),q:WP.convert(a,"raw","bn"),dp:WP.convert(s,"raw","bn"),dq:WP.convert(u,"raw","bn"),qi:WP.convert(l,"raw","bn")},"der"),g=d.encode({version:f,algorithm:{algorithm:c.split("."),parameters:Yo.from(h,"hex")},privateKey:p},"der").toString("base64");return n.formatPem(g,"PRIVATE")}},{key:"toPublicPKCS1",value:function(e){var t=e.n,r=e.e,i=this.params.version,o=ZP.normalize("RSAPublicKey").encode({version:i,n:WP.convert(t,"raw","bn"),e:WP.convert(r,"raw","bn")},"der").toString("base64");return n.formatPem(o,"RSA PUBLIC")}},{key:"toPublicPKCS8",value:function(e){var t=e.n,r=e.e,i=this.params,o=i.oid,a=i.algParameters,s=ZP.normalize("PublicKeyInfo"),u=ZP.normalize("RSAPublicKey").encode({n:WP.convert(t,"raw","bn"),e:WP.convert(r,"raw","bn")},"der"),l=s.encode({algorithm:{algorithm:o.split("."),parameters:Yo.from(a,"hex")},publicKey:{unused:0,data:u}},"der").toString("base64");return n.formatPem(l,"PUBLIC")}},{key:"toPrivateJwk",value:function(e){var t=e.n,n=e.e,r=e.d,i=e.p,o=e.q,a=e.dp,s=e.dq,u=e.qi;return{kty:this.params.kty,n:WP.convert(t,"raw","base64url"),e:WP.convert(n,"raw","base64url"),d:WP.convert(r,"raw","base64url"),p:WP.convert(i,"raw","base64url"),q:WP.convert(o,"raw","base64url"),dp:WP.convert(a,"raw","base64url"),dq:WP.convert(s,"raw","base64url"),qi:WP.convert(u,"raw","base64url")}}},{key:"toPublicJwk",value:function(e){var t=e.n,n=e.e;return{kty:this.params.kty,n:WP.convert(t,"raw","base64url"),e:WP.convert(n,"raw","base64url")}}}]),n}(_F),eU=$P,tU=new BI.ec("secp256k1"),nU=VP,rU=XP,iU=function(e){c(n,e);var t=b(n);function n(){return s(this,n),t.apply(this,arguments)}return l(n,[{key:"fromPrivatePKCS1",value:function(e){var t=rU.normalize("ECPrivateKey").decode(e,"der"),r=t.privateKey,i=t.publicKey.data,o=nU.convert(i,"raw","hex"),a=n.getPoint(o);return{d:r,x:a.x,y:a.y}}},{key:"fromPrivatePKCS8",value:function(e){var t=rU.normalize("PrivateKeyInfo"),r=rU.normalize("ECPrivateKey"),i=t.decode(e,"der"),o=r.decode(i.privateKey,"der"),a=o.privateKey,s=o.publicKey.data,u=nU.convert(s,"raw","hex"),l=n.getPoint(u);return{d:a,x:l.x,y:l.y}}},{key:"fromPublicPKCS8",value:function(e){var t=rU.normalize("PublicKeyInfo").decode(e,"der"),r=nU.convert(t.publicKey.data,"raw","hex");return n.getPoint(r)}},{key:"fromPrivateBlk",value:function(e){var t=tU.keyFromPrivate(e,"hex"),n=t.getPublic();return{d:nU.convert(t.priv,"bn","raw"),x:nU.convert(n.getX(),"bn","raw"),y:nU.convert(n.getY(),"bn","raw")}}},{key:"fromPublicBlk",value:function(e){return n.getPoint(e)}},{key:"fromJwk",value:function(e){var t=e.d,n=e.x,r=e.y;return{d:nU.convert(t,"base64url","raw"),x:nU.convert(n,"base64url","raw"),y:nU.convert(r,"base64url","raw")}}},{key:"toPrivatePKCS1",value:function(e){var t=this.params,r=t.namedCurve,i=t.keyVersion,o=e.d,a=e.x,s=e.y,u=rU.normalize("ECPrivateKey"),l=n.makePoint(a,s),A=u.encode({version:i,privateKey:o,parameters:{type:"namedCurve",value:r.split(".")},publicKey:{unused:0,data:l}},"der").toString("base64");return n.formatPem(A,"EC PRIVATE")}},{key:"toPrivatePKCS8",value:function(e){var t=this.params,r=t.oid,i=t.algParameters,o=t.keyVersion,a=t.infoVersion,s=e.d,u=e.x,l=e.y,A=rU.normalize("PrivateKeyInfo"),c=rU.normalize("ECPrivateKey"),h=n.makePoint(u,l),f=c.encode({version:o,privateKey:s,publicKey:{unused:0,data:h}},"der"),d=A.encode({version:a,algorithm:{algorithm:r.split("."),parameters:Yo.from(i,"hex")},privateKey:f},"der").toString("base64");return n.formatPem(d,"PRIVATE")}},{key:"toPublicPKCS8",value:function(e){var t=this.params,r=t.oid,i=t.algParameters,o=e.x,a=e.y,s=rU.normalize("PublicKeyInfo"),u=n.makePoint(o,a),l=s.encode({algorithm:{algorithm:r.split("."),parameters:Yo.from(i,"hex")},publicKey:{unused:0,data:u}},"der").toString("base64");return n.formatPem(l,"PUBLIC")}},{key:"toPrivateBlk",value:function(e){return e.d.toString("hex")}},{key:"toPublicBlk",value:function(e){return nU.convert(n.makePoint(e.x,e.y),"raw","hex")}},{key:"toPrivateJwk",value:function(e){var t=this.params,n=t.crv,r=t.kty,i=e.d,o=e.x,a=e.y;return{kty:r,crv:n,d:nU.convert(i,"raw","base64url"),x:nU.convert(o,"raw","base64url"),y:nU.convert(a,"raw","base64url")}}},{key:"toPublicJwk",value:function(e){var t=this.params,n=t.crv,r=t.kty,i=e.x,o=e.y;return{kty:r,crv:n,x:nU.convert(i,"raw","base64url"),y:nU.convert(o,"raw","base64url")}}}],[{key:"getPoint",value:function(e){var t=e.slice(2,(e.length-2)/2+2),n=e.slice((e.length-2)/2+2);return{x:nU.convert(t,"hex","raw"),y:nU.convert(n,"hex","raw")}}},{key:"makePoint",value:function(e,t){var n=Yo.from("04","hex");return Yo.concat([n,e,t],n.length+e.length+t.length)}}]),n}(_F),oU=iU,aU=VP,sU=XP,uU=function(e){c(n,e);var t=b(n);function n(){return s(this,n),t.apply(this,arguments)}return l(n,[{key:"fromPrivatePKCS8",value:function(e){var t=sU.normalize("PrivateKeyInfo").decode(e,"der").privateKey.slice(2);return{d:t,x:this.publicKeyFromPrivate(t)}}},{key:"fromPublicPKCS8",value:function(e){var t=sU.normalize("PublicKeyInfo").decode(e,"der");return{x:aU.convert(t.publicKey.data,"hex","raw")}}},{key:"fromJwk",value:function(e){var t=e.d,n=e.x;return{d:aU.convert(t,"base64url","raw"),x:aU.convert(n,"base64url","raw")}}},{key:"toPrivatePKCS8",value:function(e){var t=this.params,r=t.oid,i=t.infoVersion,o=e.d,a=sU.normalize("PrivateKeyInfo"),s=this.privateKeyPadding(o),u=a.encode({version:i,algorithm:{algorithm:r.split(".")},privateKey:s},"der").toString("base64");return n.formatPem(u,"PRIVATE")}},{key:"toPublicPKCS8",value:function(e){var t=this.params.oid,r=e.x,i=sU.normalize("PublicKeyInfo").encode({algorithm:{algorithm:t.split(".")},publicKey:{unused:0,data:aU.convert(r,"hex","raw")}},"der").toString("base64");return n.formatPem(i,"PUBLIC")}},{key:"toPrivateJwk",value:function(e){var t=this.params,n=t.crv,r=t.kty,i=e.d,o=e.x;return{kty:r,crv:n,d:aU.convert(i,"raw","base64url"),x:aU.convert(o,"raw","base64url")}}},{key:"toPublicJwk",value:function(e){var t=this.params,n=t.crv,r=t.kty,i=e.x;return{kty:r,crv:n,x:aU.convert(i,"raw","base64url")}}},{key:"privateKeyPadding",value:function(e){var t;if("Ed25519"!==this.params.crv)throw new Error("".concat(this.params.crv," is an invalid curve for EdDSA"));return t=Yo.from("0420","hex"),Yo.concat([t,e],t.length+e.length)}},{key:"publicKeyFromPrivate",value:function(e){if("Ed25519"===this.params.crv){var t=new BI.eddsa("ed25519");return Yo.from(t.keyFromSecret(e).getPublic())}throw new Error("".concat(this.params.crv," is an invalid curve for EdDSA"))}}]),n}(_F),lU=eU,AU=oU,cU=uU,hU=new SF;hU.define([{kty:"RSA",oid:"1.2.840.113549.1.1.1",algParameters:"0500",version:"two-prime"}],lU),hU.define([{kty:"EC",crv:"K-256",oid:"1.2.840.10045.2.1",namedCurve:"1.3.132.0.10",algParameters:"06052b8104000a",keyVersion:1,infoVersion:"two-prime"},{kty:"EC",crv:"P-256",oid:"1.2.840.10045.2.1",namedCurve:"1.2.840.10045.3.1.7",algParameters:"06082a8648ce3d030107",keyVersion:1,infoVersion:"two-prime"},{kty:"EC",crv:"P-384",oid:"1.2.840.10045.2.1",namedCurve:"1.3.132.0.34",algParameters:"06052b81040022",keyVersion:1,infoVersion:"two-prime"},{kty:"EC",crv:"P-521",oid:"1.2.840.10045.2.1",namedCurve:"1.3.132.0.35",algParameters:"06052b81040023",keyVersion:1,infoVersion:"two-prime"}],AU),hU.define([{kty:"OKP",crv:"Ed25519",oid:"1.3.101.112",infoVersion:"two-prime"}],cU);var fU=xF,dU=kF,pU=hU,gU=XP,vU=RegExp("\r?\n","g"),yU=function(){function e(t,n){if(s(this,e),!t)throw new fU("key is required");if(!n)throw new fU("options are required");var r=n.kty,i=n.format,o=n.selector,a=n.crv,u=n.oid;if(!n.kty)throw new fU("options.kty is required");if(!n.format)throw new fU("options.format is required");if(!n.selector)throw new fU("options.selector is required");if(!n.crv&&!n.oid)throw new fU("options.crv or options.oid is required");this.kty=r,this.format=i,this.selector=o,this.crv=a,this.oid=u,this.key=this.parseKey(t)}return l(e,[{key:"alg",get:function(){var e=this.kty,t=this.crv,n=this.oid;if(!this.algorithm){if(t)Object.defineProperty(this,"algorithm",{value:pU.normalize(e,"crv",t)});else{if(!n)throw new Error("Both crv and oid are undefined");Object.defineProperty(this,"algorithm",{value:pU.normalize(e,"oid",n)})}if(!this.algorithm)throw new Error("".concat(this.crv||this.oid," is not implemented yet"))}return this.algorithm}},{key:"parseKey",value:function(e){var t=this.alg,n=this.format,r=this.selector;if("pem"===n)switch(r){case"public_pkcs1":return t.fromPublicPKCS1(e);case"public_pkcs8":return t.fromPublicPKCS8(e);case"private_pkcs1":return t.fromPrivatePKCS1(e);case"private_pkcs8":return t.fromPrivatePKCS8(e);default:throw new Error("Invalid selector value")}if("jwk"===n)return t.fromJwk(e,r);if("blk"===n)switch(r){case"public":return t.fromPublicBlk(e);case"private":return t.fromPrivateBlk(e)}}},{key:"toJwk",value:function(e){var t=this.key,n=this.alg,r=this.selector;switch(e){case"public":return n.toPublicJwk(t);case"private":if(r.includes("public"))throw new fU("Cannot export a private key from a public key");return n.toPrivateJwk(t);default:throw new Error("Invalid key selector")}}},{key:"toString",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"pem",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"public_pkcs8",n=this.key,r=this.alg,i=this.selector;if("pem"===e)switch(t){case"public_pkcs1":return r.toPublicPKCS1(n);case"public_pkcs8":return r.toPublicPKCS8(n);case"private_pkcs1":if(i.includes("public"))throw new fU("Cannot export a private key from a public key");return r.toPrivatePKCS1(n);case"private_pkcs8":if(i.includes("public"))throw new fU("Cannot export a private key from a public key");return r.toPrivatePKCS8(n);default:throw new Error("Invalid key selector")}else if("jwk"===e)switch(t){case"public":return JSON.stringify(r.toPublicJwk(n));case"private":if(i.includes("public"))throw new fU("Cannot export a private key from a public key");return JSON.stringify(r.toPrivateJwk(n));default:throw new Error("Invalid key selector")}else if("blk"===e)switch(t){case"private":if(i.includes("public"))throw new fU("Cannot export a private key from a public key");return r.toPrivateBlk(n);case"public":return r.toPublicBlk(n);default:throw new Error("Invalid key selector")}throw new dU}}],[{key:"from",value:function(t,n){if(!t)throw new fU("key is required");if(!n)throw new fU("format is required");if("jwk"===n){var r;if("string"==typeof t)try{r=JSON.parse(t)}catch(t){throw new fU("key is not a valid JWK")}else"object"==i(t)&&(r=t);var o,a=r,s=a.kty,u=a.crv;if(!s)throw new fU("kty is required for JWK");if("EC"===s&&!u)throw new fU("crv is required for EC JWK");"RSA"===s&&(o=pU.find((function(e){return e.kty===s})).oid);var l=r.d?"private":"public";return new e(r,{kty:s,crv:u,oid:o,format:n,selector:l})}if("pem"===n){if("string"!=typeof t)throw new fU("key is not a valid PEM string");var A=t.split(vU),c=A.splice(0,1);A.splice(A.length-1,1);var h,f,d=A.join(""),p=/^-----BEGIN ((RSA|EC) )?(PUBLIC|PRIVATE) KEY-----$/.exec(c),g=p?p[2]:void 0,v=p?p[3]:void 0,y=Yo.from(d,"base64");if(!v)throw new fU("key is not a valid PEM string");if(g){if("RSA"===g)v="PRIVATE"===v?"private_pkcs1":"public_pkcs1",h=pU.find((function(e){return e.kty===g})).oid;else if("EC"===g){var m;if("PRIVATE"===v)v="private_pkcs1",m=gU.normalize("".concat(g,"PrivateKey")).decode(y,"der");else if("PUBLIC"===v){v="public_pkcs1",m=gU.normalize("".concat(g,"PrivateKey")).decode(y,"der")}var w=m.parameters.value;f=pU.find((function(e){return e.namedCurve===w.join(".")})).crv}}else{var b,I=gU.normalize("PrivateKeyInfo"),B=gU.normalize("PublicKeyInfo");"PRIVATE"===v?(v="private_pkcs8",b=I.decode(y,"der")):"PUBLIC"===v&&(v="public_pkcs8",b=B.decode(y,"der"));var E=b.algorithm,C=E.algorithm,x=E.parameters;C=C.join("."),x=x?x.toString("hex"):void 0;var k=pU.find((function(e){return e.oid===C}));if(!(g=k?k.kty:void 0))throw new fU("".concat(C," is not supported"));"RSA"===g||"OKP"===g?h=C:"EC"===g&&(f=pU.find((function(e){return e.algParameters===x})).crv)}return new e(y,{kty:g,oid:h,crv:f,format:n,selector:v})}if("blk"===n)return new e(t,{kty:"EC",crv:"K-256",format:n,selector:t.length>64?"public":"private"});throw new fU("Invalid format ".concat(n))}}]),e}(),mU=yU,wU=qN("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),bU=Yo,IU={},BU={},EU={};Object.defineProperty(EU,"__esModule",{value:!0}),EU.testnet=EU.regtest=EU.bitcoin=void 0,EU.bitcoin={messagePrefix:"Bitcoin Signed Message:\n",bech32:"bc",bip32:{public:76067358,private:76066276},pubKeyHash:0,scriptHash:5,wif:128},EU.regtest={messagePrefix:"Bitcoin Signed Message:\n",bech32:"bcrt",bip32:{public:70617039,private:70615956},pubKeyHash:111,scriptHash:196,wif:239},EU.testnet={messagePrefix:"Bitcoin Signed Message:\n",bech32:"tb",bip32:{public:70617039,private:70615956},pubKeyHash:111,scriptHash:196,wif:239};var CU={},xU={},kU={},SU={};Object.defineProperty(SU,"__esModule",{value:!0}),SU.encode=SU.decode=SU.check=void 0,SU.check=function(e){if(e.length<8)return!1;if(e.length>72)return!1;if(48!==e[0])return!1;if(e[1]!==e.length-2)return!1;if(2!==e[2])return!1;var t=e[3];if(0===t)return!1;if(5+t>=e.length)return!1;if(2!==e[4+t])return!1;var n=e[5+t];return!(0===n||6+t+n!==e.length||128&e[4]||t>1&&0===e[4]&&!(128&e[5])||128&e[t+6]||n>1&&0===e[t+6]&&!(128&e[t+7]))},SU.decode=function(e){if(e.length<8)throw new Error("DER sequence length is too short");if(e.length>72)throw new Error("DER sequence length is too long");if(48!==e[0])throw new Error("Expected DER sequence");if(e[1]!==e.length-2)throw new Error("DER sequence length is invalid");if(2!==e[2])throw new Error("Expected DER integer");var t=e[3];if(0===t)throw new Error("R length is zero");if(5+t>=e.length)throw new Error("R length is too long");if(2!==e[4+t])throw new Error("Expected DER integer (2)");var n=e[5+t];if(0===n)throw new Error("S length is zero");if(6+t+n!==e.length)throw new Error("S length is invalid");if(128&e[4])throw new Error("R value is negative");if(t>1&&0===e[4]&&!(128&e[5]))throw new Error("R value excessively padded");if(128&e[t+6])throw new Error("S value is negative");if(n>1&&0===e[t+6]&&!(128&e[t+7]))throw new Error("S value excessively padded");return{r:e.slice(4,4+t),s:e.slice(6+t)}},SU.encode=function(e,t){var n=e.length,r=t.length;if(0===n)throw new Error("R length is zero");if(0===r)throw new Error("S length is zero");if(n>33)throw new Error("R length is too long");if(r>33)throw new Error("S length is too long");if(128&e[0])throw new Error("R value is negative");if(128&t[0])throw new Error("S value is negative");if(n>1&&0===e[0]&&!(128&e[1]))throw new Error("R value excessively padded");if(r>1&&0===t[0]&&!(128&t[1]))throw new Error("S value excessively padded");var i=Yo.allocUnsafe(6+n+r);return i[0]=48,i[1]=i.length-2,i[2]=2,i[3]=e.length,e.copy(i,4),i[4+n]=2,i[5+n]=t.length,t.copy(i,6+n),i};var QU={};Object.defineProperty(QU,"__esModule",{value:!0}),QU.REVERSE_OPS=QU.OPS=void 0;var _U={OP_FALSE:0,OP_0:0,OP_PUSHDATA1:76,OP_PUSHDATA2:77,OP_PUSHDATA4:78,OP_1NEGATE:79,OP_RESERVED:80,OP_TRUE:81,OP_1:81,OP_2:82,OP_3:83,OP_4:84,OP_5:85,OP_6:86,OP_7:87,OP_8:88,OP_9:89,OP_10:90,OP_11:91,OP_12:92,OP_13:93,OP_14:94,OP_15:95,OP_16:96,OP_NOP:97,OP_VER:98,OP_IF:99,OP_NOTIF:100,OP_VERIF:101,OP_VERNOTIF:102,OP_ELSE:103,OP_ENDIF:104,OP_VERIFY:105,OP_RETURN:106,OP_TOALTSTACK:107,OP_FROMALTSTACK:108,OP_2DROP:109,OP_2DUP:110,OP_3DUP:111,OP_2OVER:112,OP_2ROT:113,OP_2SWAP:114,OP_IFDUP:115,OP_DEPTH:116,OP_DROP:117,OP_DUP:118,OP_NIP:119,OP_OVER:120,OP_PICK:121,OP_ROLL:122,OP_ROT:123,OP_SWAP:124,OP_TUCK:125,OP_CAT:126,OP_SUBSTR:127,OP_LEFT:128,OP_RIGHT:129,OP_SIZE:130,OP_INVERT:131,OP_AND:132,OP_OR:133,OP_XOR:134,OP_EQUAL:135,OP_EQUALVERIFY:136,OP_RESERVED1:137,OP_RESERVED2:138,OP_1ADD:139,OP_1SUB:140,OP_2MUL:141,OP_2DIV:142,OP_NEGATE:143,OP_ABS:144,OP_NOT:145,OP_0NOTEQUAL:146,OP_ADD:147,OP_SUB:148,OP_MUL:149,OP_DIV:150,OP_MOD:151,OP_LSHIFT:152,OP_RSHIFT:153,OP_BOOLAND:154,OP_BOOLOR:155,OP_NUMEQUAL:156,OP_NUMEQUALVERIFY:157,OP_NUMNOTEQUAL:158,OP_LESSTHAN:159,OP_GREATERTHAN:160,OP_LESSTHANOREQUAL:161,OP_GREATERTHANOREQUAL:162,OP_MIN:163,OP_MAX:164,OP_WITHIN:165,OP_RIPEMD160:166,OP_SHA1:167,OP_SHA256:168,OP_HASH160:169,OP_HASH256:170,OP_CODESEPARATOR:171,OP_CHECKSIG:172,OP_CHECKSIGVERIFY:173,OP_CHECKMULTISIG:174,OP_CHECKMULTISIGVERIFY:175,OP_NOP1:176,OP_NOP2:177,OP_CHECKLOCKTIMEVERIFY:177,OP_NOP3:178,OP_CHECKSEQUENCEVERIFY:178,OP_NOP4:179,OP_NOP5:180,OP_NOP6:181,OP_NOP7:182,OP_NOP8:183,OP_NOP9:184,OP_NOP10:185,OP_PUBKEYHASH:253,OP_PUBKEY:254,OP_INVALIDOPCODE:255};QU.OPS=_U;var NU={};QU.REVERSE_OPS=NU;for(var DU=0,FU=Object.keys(_U);DU<FU.length;DU++){var PU=FU[DU];NU[_U[PU]]=PU}var UU={};Object.defineProperty(UU,"__esModule",{value:!0}),UU.decode=UU.encode=UU.encodingLength=void 0;var LU=QU;function MU(e){return e<LU.OPS.OP_PUSHDATA1?1:e<=255?2:e<=65535?3:5}UU.encodingLength=MU,UU.encode=function(e,t,n){var r=MU(t);return 1===r?e.writeUInt8(t,n):2===r?(e.writeUInt8(LU.OPS.OP_PUSHDATA1,n),e.writeUInt8(t,n+1)):3===r?(e.writeUInt8(LU.OPS.OP_PUSHDATA2,n),e.writeUInt16LE(t,n+1)):(e.writeUInt8(LU.OPS.OP_PUSHDATA4,n),e.writeUInt32LE(t,n+1)),r},UU.decode=function(e,t){var n,r,i=e.readUInt8(t);if(i<LU.OPS.OP_PUSHDATA1)n=i,r=1;else if(i===LU.OPS.OP_PUSHDATA1){if(t+2>e.length)return null;n=e.readUInt8(t+1),r=2}else if(i===LU.OPS.OP_PUSHDATA2){if(t+3>e.length)return null;n=e.readUInt16LE(t+1),r=3}else{if(t+5>e.length)return null;if(i!==LU.OPS.OP_PUSHDATA4)throw new Error("Unexpected opcode");n=e.readUInt32LE(t+1),r=5}return{opcode:i,number:n,size:r}};var TU={};Object.defineProperty(TU,"__esModule",{value:!0}),TU.encode=TU.decode=void 0,TU.decode=function(e,t,n){t=t||4,n=void 0===n||n;var r=e.length;if(0===r)return 0;if(r>t)throw new TypeError("Script number overflow");if(n&&0==(127&e[r-1])&&(r<=1||0==(128&e[r-2])))throw new Error("Non-minimally encoded script number");if(5===r){var i=e.readUInt32LE(0),o=e.readUInt8(4);return 128&o?-(4294967296*(-129&o)+i):4294967296*o+i}for(var a=0,s=0;s<r;++s)a|=e[s]<<8*s;return 128&e[r-1]?-(a&~(128<<8*(r-1))):a},TU.encode=function(e){for(var t,n=Math.abs(e),r=(t=n)>2147483647?5:t>8388607?4:t>32767?3:t>127?2:t>0?1:0,i=Yo.allocUnsafe(r),o=e<0,a=0;a<r;++a)i.writeUInt8(255&n,a),n>>=8;return 128&i[r-1]?i.writeUInt8(o?128:0,r-1):o&&(i[r-1]|=128),i};var RU={},OU={},HU={Array:function(e){function t(t){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(e){return null!=e&&e.constructor===Array})),Boolean:function(e){return"boolean"==typeof e},Function:function(e){return"function"==typeof e},Nil:function(e){return null==e},Number:function(e){return"number"==typeof e},Object:function(e){return"object"==i(e)},String:function(e){return"string"==typeof e},"":function(){return!0}};for(var KU in HU.Null=HU.Nil,HU)HU[KU].toJSON=function(e){return e}.bind(null,KU);var jU=HU,GU=jU;function qU(e){return e.name||e.toString().match(/function (.*?)\s*\(/)[1]}function VU(e){return GU.Nil(e)?"":qU(e.constructor)}function zU(e,t){Error.captureStackTrace&&Error.captureStackTrace(e,t)}function JU(e){return GU.Function(e)?e.toJSON?e.toJSON():qU(e):GU.Array(e)?"Array":e&&GU.Object(e)?"Object":void 0!==e?e:""}function YU(e,t,n){var r=function(e){return GU.Function(e)?"":GU.String(e)?JSON.stringify(e):e&&GU.Object(e)?"":e}(t);return"Expected "+JU(e)+", got"+(""!==n?" "+n:"")+(""!==r?" "+r:"")}function XU(e,t,n){n=n||VU(t),this.message=YU(e,t,n),zU(this,XU),this.__type=e,this.__value=t,this.__valueTypeName=n}function WU(e,t,n,r,i){e?(i=i||VU(r),this.message=function(e,t,n,r,i){var o='" of type ';return"key"===t&&(o='" with key type '),YU('property "'+JU(n)+o+JU(e),r,i)}(e,n,t,r,i)):this.message='Unexpected property "'+t+'"',zU(this,XU),this.__label=n,this.__property=t,this.__type=e,this.__value=r,this.__valueTypeName=i}XU.prototype=Object.create(Error.prototype),XU.prototype.constructor=XU,WU.prototype=Object.create(Error.prototype),WU.prototype.constructor=XU;var ZU={TfTypeError:XU,TfPropertyTypeError:WU,tfCustomError:function(e,t){return new XU(e,{},t)},tfSubError:function(e,t,n){return e instanceof WU?(t=t+"."+e.__property,e=new WU(e.__type,t,e.__label,e.__value,e.__valueTypeName)):e instanceof XU&&(e=new WU(e.__type,t,n,e.__value,e.__valueTypeName)),zU(e),e},tfJSON:JU,getValueTypeName:VU},$U=jU,eL=ZU;function tL(e){return Na(e)}function nL(e){return"string"==typeof e&&/^([0-9a-f]{2})+$/i.test(e)}function rL(e,t){var n=e.toJSON();function r(r){if(!e(r))return!1;if(r.length===t)return!0;throw eL.tfCustomError(n+"(Length: "+t+")",n+"(Length: "+r.length+")")}return r.toJSON=function(){return n},r}var iL=rL.bind(null,$U.Array),oL=rL.bind(null,tL),aL=rL.bind(null,nL),sL=rL.bind(null,$U.String),uL=Math.pow(2,53)-1,lL={ArrayN:iL,Buffer:tL,BufferN:oL,Finite:function(e){return"number"==typeof e&&isFinite(e)},Hex:nL,HexN:aL,Int8:function(e){return e<<24>>24===e},Int16:function(e){return e<<16>>16===e},Int32:function(e){return(0|e)===e},Int53:function(e){return"number"==typeof e&&e>=-uL&&e<=uL&&Math.floor(e)===e},Range:function(e,t,n){function r(r,i){return n(r,i)&&r>e&&r<t}return n=n||$U.Number,r.toJSON=function(){return"".concat(n.toJSON()," between [").concat(e,", ").concat(t,"]")},r},StringN:sL,UInt8:function(e){return(255&e)===e},UInt16:function(e){return(65535&e)===e},UInt32:function(e){return e>>>0===e},UInt53:function(e){return"number"==typeof e&&e>=0&&e<=uL&&Math.floor(e)===e}};for(var AL in lL)lL[AL].toJSON=function(e){return e}.bind(null,AL);var cL=lL,hL=jU,fL=ZU.tfJSON,dL=ZU.TfTypeError,pL=ZU.TfPropertyTypeError,gL=ZU.tfSubError,vL=ZU.getValueTypeName,yL={arrayOf:function(e,t){function n(n,r){return!!hL.Array(n)&&!hL.Nil(n)&&!(void 0!==t.minLength&&n.length<t.minLength)&&!(void 0!==t.maxLength&&n.length>t.maxLength)&&(void 0===t.length||n.length===t.length)&&n.every((function(t,n){try{return wL(e,t,r)}catch(e){throw gL(e,n)}}))}return e=mL(e),t=t||{},n.toJSON=function(){var n="["+fL(e)+"]";return void 0!==t.length?n+="{"+t.length+"}":void 0===t.minLength&&void 0===t.maxLength||(n+="{"+(void 0===t.minLength?0:t.minLength)+","+(void 0===t.maxLength?1/0:t.maxLength)+"}"),n},n},maybe:function e(t){function n(n,r){return hL.Nil(n)||t(n,r,e)}return t=mL(t),n.toJSON=function(){return"?"+fL(t)},n},map:function(e,t){function n(n,r){if(!hL.Object(n))return!1;if(hL.Nil(n))return!1;for(var i in n){try{t&&wL(t,i,r)}catch(e){throw gL(e,i,"key")}try{var o=n[i];wL(e,o,r)}catch(e){throw gL(e,i)}}return!0}return e=mL(e),t&&(t=mL(t)),n.toJSON=t?function(){return"{"+fL(t)+": "+fL(e)+"}"}:function(){return"{"+fL(e)+"}"},n},object:function(e){var t={};for(var n in e)t[n]=mL(e[n]);function r(e,n){if(!hL.Object(e))return!1;if(hL.Nil(e))return!1;var r;try{for(r in t)wL(t[r],e[r],n)}catch(e){throw gL(e,r)}if(n)for(r in e)if(!t[r])throw new pL(void 0,r);return!0}return r.toJSON=function(){return fL(t)},r},anyOf:function(){var e=[].slice.call(arguments).map(mL);function t(t,n){return e.some((function(e){try{return wL(e,t,n)}catch(e){return!1}}))}return t.toJSON=function(){return e.map(fL).join("|")},t},allOf:function(){var e=[].slice.call(arguments).map(mL);function t(t,n){return e.every((function(e){try{return wL(e,t,n)}catch(e){return!1}}))}return t.toJSON=function(){return e.map(fL).join(" & ")},t},quacksLike:function(e){function t(t){return e===vL(t)}return t.toJSON=function(){return e},t},tuple:function(){var e=[].slice.call(arguments).map(mL);function t(t,n){return!hL.Nil(t)&&!hL.Nil(t.length)&&(!n||t.length===e.length)&&e.every((function(e,r){try{return wL(e,t[r],n)}catch(e){throw gL(e,r)}}))}return t.toJSON=function(){return"("+e.map(fL).join(", ")+")"},t},value:function(e){function t(t){return t===e}return t.toJSON=function(){return e},t}};function mL(e){if(hL.String(e))return"?"===e[0]?yL.maybe(e.slice(1)):hL[e]||yL.quacksLike(e);if(e&&hL.Object(e)){if(hL.Array(e)){if(1!==e.length)throw new TypeError("Expected compile() parameter of type Array of length 1");return yL.arrayOf(e[0])}return yL.object(e)}return hL.Function(e)?e:yL.value(e)}function wL(e,t,n,r){if(hL.Function(e)){if(e(t,n))return!0;throw new dL(r||e,t)}return wL(mL(e),t,n)}for(var bL in yL.oneOf=yL.anyOf,hL)wL[bL]=hL[bL];for(bL in yL)wL[bL]=yL[bL];var IL=cL;for(bL in IL)wL[bL]=IL[bL];wL.compile=mL,wL.TfTypeError=dL,wL.TfPropertyTypeError=pL;var BL=wL;!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.oneOf=e.Null=e.BufferN=e.Function=e.UInt32=e.UInt8=e.tuple=e.maybe=e.Hex=e.Buffer=e.String=e.Boolean=e.Array=e.Number=e.Hash256bit=e.Hash160bit=e.Buffer256bit=e.Network=e.ECPoint=e.Satoshi=e.Signer=e.BIP32Path=e.UInt31=e.isPoint=e.typeforce=void 0;var t=Fa;e.typeforce=BL;var n=t.Buffer.alloc(32,0),r=t.Buffer.from("fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f","hex");e.isPoint=function(e){if(!t.Buffer.isBuffer(e))return!1;if(e.length<33)return!1;var i=e[0],o=e.slice(1,33);if(0===o.compare(n))return!1;if(o.compare(r)>=0)return!1;if((2===i||3===i)&&33===e.length)return!0;var a=e.slice(33);return 0!==a.compare(n)&&!(a.compare(r)>=0)&&4===i&&65===e.length};var i=Math.pow(2,31)-1;function o(t){return e.typeforce.String(t)&&!!t.match(/^(m\/)?(\d+'?\/)*\d+'?$/)}e.UInt31=function(t){return e.typeforce.UInt32(t)&&t<=i},e.BIP32Path=o,o.toJSON=function(){return"BIP32 derivation path"},e.Signer=function(t){return(e.typeforce.Buffer(t.publicKey)||"function"==typeof t.getPublicKey)&&"function"==typeof t.sign},e.Satoshi=function(t){return e.typeforce.UInt53(t)&&t<=21e14},e.ECPoint=e.typeforce.quacksLike("Point"),e.Network=e.typeforce.compile({messagePrefix:e.typeforce.oneOf(e.typeforce.Buffer,e.typeforce.String),bip32:{public:e.typeforce.UInt32,private:e.typeforce.UInt32},pubKeyHash:e.typeforce.UInt8,scriptHash:e.typeforce.UInt8,wif:e.typeforce.UInt8}),e.Buffer256bit=e.typeforce.BufferN(32),e.Hash160bit=e.typeforce.BufferN(20),e.Hash256bit=e.typeforce.BufferN(32),e.Number=e.typeforce.Number,e.Array=e.typeforce.Array,e.Boolean=e.typeforce.Boolean,e.String=e.typeforce.String,e.Buffer=e.typeforce.Buffer,e.Hex=e.typeforce.Hex,e.maybe=e.typeforce.maybe,e.tuple=e.typeforce.tuple,e.UInt8=e.typeforce.UInt8,e.UInt32=e.typeforce.UInt32,e.Function=e.typeforce.Function,e.BufferN=e.typeforce.BufferN,e.Null=e.typeforce.Null,e.oneOf=e.typeforce.oneOf}(OU),Object.defineProperty(RU,"__esModule",{value:!0}),RU.encode=RU.decode=void 0;var EL=SU,CL=OU,xL=CL.typeforce,kL=Yo.alloc(1,0);function SL(e){for(var t=0;0===e[t];)++t;return t===e.length?kL:128&(e=e.slice(t))[0]?Yo.concat([kL,e],1+e.length):e}function QL(e){0===e[0]&&(e=e.slice(1));var t=Yo.alloc(32,0),n=Math.max(0,32-e.length);return e.copy(t,n),t}RU.decode=function(e){var t=e.readUInt8(e.length-1),n=-129&t;if(n<=0||n>=4)throw new Error("Invalid hashType "+t);var r=EL.decode(e.slice(0,-1)),i=QL(r.r),o=QL(r.s);return{signature:Yo.concat([i,o],64),hashType:t}},RU.encode=function(e,t){xL({signature:CL.BufferN(64),hashType:CL.UInt8},{signature:e,hashType:t});var n=-129&t;if(n<=0||n>=4)throw new Error("Invalid hashType "+t);var r=Yo.allocUnsafe(1);r.writeUInt8(t,0);var i=SL(e.slice(0,32)),o=SL(e.slice(32,64));return Yo.concat([EL.encode(i,o),r])},function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.signature=e.number=e.isCanonicalScriptSignature=e.isDefinedHashType=e.isCanonicalPubKey=e.toStack=e.fromASM=e.toASM=e.decompile=e.compile=e.isPushOnly=e.OPS=void 0;var t=SU,n=QU;Object.defineProperty(e,"OPS",{enumerable:!0,get:function(){return n.OPS}});var r=UU,i=TU,o=RU,a=OU,s=a.typeforce,u=n.OPS.OP_RESERVED;function l(e){return a.Buffer(e)||function(e){return a.Number(e)&&(e===n.OPS.OP_0||e>=n.OPS.OP_1&&e<=n.OPS.OP_16||e===n.OPS.OP_1NEGATE)}(e)}function A(e){return a.Array(e)&&e.every(l)}function c(e){return 0===e.length?n.OPS.OP_0:1===e.length?e[0]>=1&&e[0]<=16?u+e[0]:129===e[0]?n.OPS.OP_1NEGATE:void 0:void 0}function h(e){return Na(e)}function f(e){return Na(e)}function d(e){if(h(e))return e;s(a.Array,e);var t=e.reduce((function(e,t){return f(t)?1===t.length&&void 0!==c(t)?e+1:e+r.encodingLength(t.length)+t.length:e+1}),0),n=Yo.allocUnsafe(t),i=0;if(e.forEach((function(e){if(f(e)){var t=c(e);if(void 0!==t)return n.writeUInt8(t,i),void(i+=1);i+=r.encode(n,e.length,i),e.copy(n,i),i+=e.length}else n.writeUInt8(e,i),i+=1})),i!==n.length)throw new Error("Could not decode chunks");return n}function p(e){if(t=e,a.Array(t))return e;var t;s(a.Buffer,e);for(var i=[],o=0;o<e.length;){var u=e[o];if(u>n.OPS.OP_0&&u<=n.OPS.OP_PUSHDATA4){var l=r.decode(e,o);if(null===l)return null;if((o+=l.size)+l.number>e.length)return null;var A=e.slice(o,o+l.number);o+=l.number;var h=c(A);void 0!==h?i.push(h):i.push(A)}else i.push(u),o+=1}return i}function g(e){var t=-129&e;return t>0&&t<4}e.isPushOnly=A,e.compile=d,e.decompile=p,e.toASM=function(e){return h(e)&&(e=p(e)),e.map((function(e){if(f(e)){var t=c(e);if(void 0===t)return e.toString("hex");e=t}return n.REVERSE_OPS[e]})).join(" ")},e.fromASM=function(e){return s(a.String,e),d(e.split(" ").map((function(e){return void 0!==n.OPS[e]?n.OPS[e]:(s(a.Hex,e),Yo.from(e,"hex"))})))},e.toStack=function(e){return e=p(e),s(A,e),e.map((function(e){return f(e)?e:e===n.OPS.OP_0?Yo.allocUnsafe(0):i.encode(e-u)}))},e.isCanonicalPubKey=function(e){return a.isPoint(e)},e.isDefinedHashType=g,e.isCanonicalScriptSignature=function(e){return!!Na(e)&&!!g(e[e.length-1])&&t.check(e.slice(0,-1))},e.number=i,e.signature=o}(kU);var _L={};Object.defineProperty(_L,"__esModule",{value:!0}),_L.value=_L.prop=void 0,_L.prop=function(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get:function(){var e=n.call(this);return this[t]=e,e},set:function(e){Object.defineProperty(this,t,{configurable:!0,enumerable:!0,value:e,writable:!0})}})},_L.value=function(e){var t;return function(){return void 0!==t||(t=e()),t}},Object.defineProperty(xU,"__esModule",{value:!0}),xU.p2data=void 0;var NL=EU,DL=kU,FL=OU,PL=_L,UL=DL.OPS;xU.p2data=function(e,t){if(!e.data&&!e.output)throw new TypeError("Not enough data");t=Object.assign({validate:!0},t||{}),(0,FL.typeforce)({network:FL.typeforce.maybe(FL.typeforce.Object),output:FL.typeforce.maybe(FL.typeforce.Buffer),data:FL.typeforce.maybe(FL.typeforce.arrayOf(FL.typeforce.Buffer))},e);var n={name:"embed",network:e.network||NL.bitcoin};if(PL.prop(n,"output",(function(){if(e.data)return DL.compile([UL.OP_RETURN].concat(e.data))})),PL.prop(n,"data",(function(){if(e.output)return DL.decompile(e.output).slice(1)})),t.validate&&e.output){var r=DL.decompile(e.output);if(r[0]!==UL.OP_RETURN)throw new TypeError("Output is invalid");if(!r.slice(1).every(FL.typeforce.Buffer))throw new TypeError("Output is invalid");if(e.data&&!function(e,t){return e.length===t.length&&e.every((function(e,n){return e.equals(t[n])}))}(e.data,n.data))throw new TypeError("Data mismatch")}return Object.assign(n,e)};var LL={};Object.defineProperty(LL,"__esModule",{value:!0}),LL.p2ms=void 0;var ML=EU,TL=kU,RL=OU,OL=_L,HL=TL.OPS,KL=HL.OP_RESERVED;function jL(e,t){return e.length===t.length&&e.every((function(e,n){return e.equals(t[n])}))}LL.p2ms=function(e,t){if(!(e.input||e.output||e.pubkeys&&void 0!==e.m||e.signatures))throw new TypeError("Not enough data");function n(e){return TL.isCanonicalScriptSignature(e)||void 0!==(t.allowIncomplete&&e===HL.OP_0)}t=Object.assign({validate:!0},t||{}),(0,RL.typeforce)({network:RL.typeforce.maybe(RL.typeforce.Object),m:RL.typeforce.maybe(RL.typeforce.Number),n:RL.typeforce.maybe(RL.typeforce.Number),output:RL.typeforce.maybe(RL.typeforce.Buffer),pubkeys:RL.typeforce.maybe(RL.typeforce.arrayOf(RL.isPoint)),signatures:RL.typeforce.maybe(RL.typeforce.arrayOf(n)),input:RL.typeforce.maybe(RL.typeforce.Buffer)},e);var r={network:e.network||ML.bitcoin},i=[],o=!1;function a(e){o||(o=!0,i=TL.decompile(e),r.m=i[0]-KL,r.n=i[i.length-2]-KL,r.pubkeys=i.slice(1,-2))}if(OL.prop(r,"output",(function(){if(e.m&&r.n&&e.pubkeys)return TL.compile([].concat(KL+e.m,e.pubkeys,KL+r.n,HL.OP_CHECKMULTISIG))})),OL.prop(r,"m",(function(){if(r.output)return a(r.output),r.m})),OL.prop(r,"n",(function(){if(r.pubkeys)return r.pubkeys.length})),OL.prop(r,"pubkeys",(function(){if(e.output)return a(e.output),r.pubkeys})),OL.prop(r,"signatures",(function(){if(e.input)return TL.decompile(e.input).slice(1)})),OL.prop(r,"input",(function(){if(e.signatures)return TL.compile([HL.OP_0].concat(e.signatures))})),OL.prop(r,"witness",(function(){if(r.input)return[]})),OL.prop(r,"name",(function(){if(r.m&&r.n)return"p2ms(".concat(r.m," of ").concat(r.n,")")})),t.validate){if(e.output){if(a(e.output),!RL.typeforce.Number(i[0]))throw new TypeError("Output is invalid");if(!RL.typeforce.Number(i[i.length-2]))throw new TypeError("Output is invalid");if(i[i.length-1]!==HL.OP_CHECKMULTISIG)throw new TypeError("Output is invalid");if(r.m<=0||r.n>16||r.m>r.n||r.n!==i.length-3)throw new TypeError("Output is invalid");if(!r.pubkeys.every((function(e){return(0,RL.isPoint)(e)})))throw new TypeError("Output is invalid");if(void 0!==e.m&&e.m!==r.m)throw new TypeError("m mismatch");if(void 0!==e.n&&e.n!==r.n)throw new TypeError("n mismatch");if(e.pubkeys&&!jL(e.pubkeys,r.pubkeys))throw new TypeError("Pubkeys mismatch")}if(e.pubkeys){if(void 0!==e.n&&e.n!==e.pubkeys.length)throw new TypeError("Pubkey count mismatch");if(r.n=e.pubkeys.length,r.n<r.m)throw new TypeError("Pubkey count cannot be less than m")}if(e.signatures){if(e.signatures.length<r.m)throw new TypeError("Not enough signatures provided");if(e.signatures.length>r.m)throw new TypeError("Too many signatures provided")}if(e.input){if(e.input[0]!==HL.OP_0)throw new TypeError("Input is invalid");if(0===r.signatures.length||!r.signatures.every(n))throw new TypeError("Input has invalid signature(s)");if(e.signatures&&!jL(e.signatures,r.signatures))throw new TypeError("Signature mismatch");if(void 0!==e.m&&e.m!==e.signatures.length)throw new TypeError("Signature count mismatch")}}return Object.assign(r,e)};var GL={};Object.defineProperty(GL,"__esModule",{value:!0}),GL.p2pk=void 0;var qL=EU,VL=kU,zL=OU,JL=_L,YL=VL.OPS;GL.p2pk=function(e,t){if(!(e.input||e.output||e.pubkey||e.input||e.signature))throw new TypeError("Not enough data");t=Object.assign({validate:!0},t||{}),(0,zL.typeforce)({network:zL.typeforce.maybe(zL.typeforce.Object),output:zL.typeforce.maybe(zL.typeforce.Buffer),pubkey:zL.typeforce.maybe(zL.isPoint),signature:zL.typeforce.maybe(VL.isCanonicalScriptSignature),input:zL.typeforce.maybe(zL.typeforce.Buffer)},e);var n=JL.value((function(){return VL.decompile(e.input)})),r={name:"p2pk",network:e.network||qL.bitcoin};if(JL.prop(r,"output",(function(){if(e.pubkey)return VL.compile([e.pubkey,YL.OP_CHECKSIG])})),JL.prop(r,"pubkey",(function(){if(e.output)return e.output.slice(1,-1)})),JL.prop(r,"signature",(function(){if(e.input)return n()[0]})),JL.prop(r,"input",(function(){if(e.signature)return VL.compile([e.signature])})),JL.prop(r,"witness",(function(){if(r.input)return[]})),t.validate){if(e.output){if(e.output[e.output.length-1]!==YL.OP_CHECKSIG)throw new TypeError("Output is invalid");if(!(0,zL.isPoint)(r.pubkey))throw new TypeError("Output pubkey is invalid");if(e.pubkey&&!e.pubkey.equals(r.pubkey))throw new TypeError("Pubkey mismatch")}if(e.signature&&e.input&&!e.input.equals(r.input))throw new TypeError("Signature mismatch");if(e.input){if(1!==n().length)throw new TypeError("Input is invalid");if(!VL.isCanonicalScriptSignature(r.signature))throw new TypeError("Input has invalid signature")}}return Object.assign(r,e)};var XL={},WL={},ZL={exports:{}},$L={},eM=Do(eh),tM=eM.EventEmitter;function nM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function rM(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var iM=Fa.Buffer,oM=sb.inspect,aM=oM&&oM.custom||"inspect";function sM(e,t,n){iM.prototype.copy.call(e,t,n)}var uM=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}var t;return t=[{key:"push",value:function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,n=""+t.data;t=t.next;)n+=e+t.data;return n}},{key:"concat",value:function(e){if(0===this.length)return iM.alloc(0);for(var t=iM.allocUnsafe(e>>>0),n=this.head,r=0;n;)sM(n.data,t,r),r+=n.data.length,n=n.next;return t}},{key:"consume",value:function(e,t){var n;return e<this.head.data.length?(n=this.head.data.slice(0,e),this.head.data=this.head.data.slice(e)):n=e===this.head.data.length?this.shift():t?this._getString(e):this._getBuffer(e),n}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(e){var t=this.head,n=1,r=t.data;for(e-=r.length;t=t.next;){var i=t.data,o=e>i.length?i.length:e;if(o===i.length?r+=i:r+=i.slice(0,e),0==(e-=o)){o===i.length?(++n,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=i.slice(o));break}++n}return this.length-=n,r}},{key:"_getBuffer",value:function(e){var t=iM.allocUnsafe(e),n=this.head,r=1;for(n.data.copy(t),e-=n.data.length;n=n.next;){var i=n.data,o=e>i.length?i.length:e;if(i.copy(t,t.length-e,0,o),0==(e-=o)){o===i.length?(++r,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=i.slice(o));break}++r}return this.length-=r,t}},{key:aM,value:function(e,t){return oM(this,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?nM(Object(n),!0).forEach((function(t){rM(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nM(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},t,{depth:0,customInspect:!1}))}}],t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}();function lM(e,t){cM(e,t),AM(e)}function AM(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function cM(e,t){e.emit("error",t)}var hM={destroy:function(e,t){var n=this,r=this._readableState&&this._readableState.destroyed,i=this._writableState&&this._writableState.destroyed;return r||i?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,Xl(cM,this,e)):Xl(cM,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,(function(e){!t&&e?n._writableState?n._writableState.errorEmitted?Xl(AM,n):(n._writableState.errorEmitted=!0,Xl(lM,n,e)):Xl(lM,n,e):t?(Xl(AM,n),t(e)):Xl(AM,n)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(e,t){var n=e._readableState,r=e._writableState;n&&n.autoDestroy||r&&r.autoDestroy?e.destroy(t):e.emit("error",t)}},fM={},dM={};function pM(e,t,n){n||(n=Error);var r=function(e){var n,r;function i(n,r,i){return e.call(this,function(e,n,r){return"string"==typeof t?t:t(e,n,r)}(n,r,i))||this}return r=e,(n=i).prototype=Object.create(r.prototype),n.prototype.constructor=n,n.__proto__=r,i}(n);r.prototype.name=n.name,r.prototype.code=e,dM[e]=r}function gM(e,t){if(Array.isArray(e)){var n=e.length;return e=e.map((function(e){return String(e)})),n>2?"one of ".concat(t," ").concat(e.slice(0,n-1).join(", "),", or ")+e[n-1]:2===n?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}pM("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),pM("ERR_INVALID_ARG_TYPE",(function(e,t,n){var r,o,a;if("string"==typeof t&&(o="not ",t.substr(0,o.length)===o)?(r="must not be",t=t.replace(/^not /,"")):r="must be",function(e,t,n){return(void 0===n||n>e.length)&&(n=e.length),e.substring(n-t.length,n)===t}(e," argument"))a="The ".concat(e," ").concat(r," ").concat(gM(t,"type"));else{var s=function(e,t,n){return"number"!=typeof n&&(n=0),!(n+".".length>e.length)&&-1!==e.indexOf(".",n)}(e)?"property":"argument";a='The "'.concat(e,'" ').concat(s," ").concat(r," ").concat(gM(t,"type"))}return a+". Received type ".concat(i(n))}),TypeError),pM("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),pM("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),pM("ERR_STREAM_PREMATURE_CLOSE","Premature close"),pM("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),pM("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),pM("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),pM("ERR_STREAM_WRITE_AFTER_END","write after end"),pM("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),pM("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),pM("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),fM.codes=dM;var vM=fM.codes.ERR_INVALID_OPT_VALUE,yM=function(e,t,n,r){var i=function(e,t,n){return null!=e.highWaterMark?e.highWaterMark:t?e[n]:null}(t,r,n);if(null!=i){if(!isFinite(i)||Math.floor(i)!==i||i<0)throw new vM(r?n:"highWaterMark",i);return Math.floor(i)}return e.objectMode?16:16384},mM={},wM=jN.exports.Buffer,bM=wM.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function IM(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(wM.isEncoding===bM||!bM(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=CM,this.end=xM,t=4;break;case"utf8":this.fillLast=EM,t=4;break;case"base64":this.text=kM,this.end=SM,t=3;break;default:return this.write=QM,void(this.end=_M)}this.lastNeed=0,this.lastTotal=0,this.lastChar=wM.allocUnsafe(t)}function BM(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function EM(e){var t=this.lastTotal-this.lastNeed,n=function(e,t,n){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==n?n:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function CM(e,t){if((e.length-t)%2==0){var n=e.toString("utf16le",t);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function xM(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,n)}return t}function kM(e,t){var n=(e.length-t)%3;return 0===n?e.toString("base64",t):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-n))}function SM(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function QM(e){return e.toString(this.encoding)}function _M(e){return e&&e.length?this.write(e):""}mM.StringDecoder=IM,IM.prototype.write=function(e){if(0===e.length)return"";var t,n;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n<e.length?t?t+this.text(e,n):this.text(e,n):t||""},IM.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},IM.prototype.text=function(e,t){var n=function(e,t,n){var r=t.length-1;if(r<n)return 0;var i=BM(t[r]);return i>=0?(i>0&&(e.lastNeed=i-1),i):--r<n||-2===i?0:(i=BM(t[r]))>=0?(i>0&&(e.lastNeed=i-2),i):--r<n||-2===i?0:(i=BM(t[r]))>=0?(i>0&&(2===i?i=0:e.lastNeed=i-3),i):0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=n;var r=e.length-(n-this.lastNeed);return e.copy(this.lastChar,0,r),e.toString("utf8",t,r)},IM.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length};var NM=fM.codes.ERR_STREAM_PREMATURE_CLOSE;function DM(){}var FM,PM=function e(t,n,r){if("function"==typeof n)return e(t,null,n);n||(n={}),r=function(e){var t=!1;return function(){if(!t){t=!0;for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];e.apply(this,r)}}}(r||DM);var i=n.readable||!1!==n.readable&&t.readable,o=n.writable||!1!==n.writable&&t.writable,a=function(){t.writable||u()},s=t._writableState&&t._writableState.finished,u=function(){o=!1,s=!0,i||r.call(t)},l=t._readableState&&t._readableState.endEmitted,A=function(){i=!1,l=!0,o||r.call(t)},c=function(e){r.call(t,e)},h=function(){var e;return i&&!l?(t._readableState&&t._readableState.ended||(e=new NM),r.call(t,e)):o&&!s?(t._writableState&&t._writableState.ended||(e=new NM),r.call(t,e)):void 0},f=function(){t.req.on("finish",u)};return function(e){return e.setHeader&&"function"==typeof e.abort}(t)?(t.on("complete",u),t.on("abort",h),t.req?f():t.on("request",f)):o&&!t._writableState&&(t.on("end",a),t.on("close",a)),t.on("end",A),t.on("finish",u),!1!==n.error&&t.on("error",c),t.on("close",h),function(){t.removeListener("complete",u),t.removeListener("abort",h),t.removeListener("request",f),t.req&&t.req.removeListener("finish",u),t.removeListener("end",a),t.removeListener("close",a),t.removeListener("finish",u),t.removeListener("end",A),t.removeListener("error",c),t.removeListener("close",h)}};function UM(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var LM=PM,MM=Symbol("lastResolve"),TM=Symbol("lastReject"),RM=Symbol("error"),OM=Symbol("ended"),HM=Symbol("lastPromise"),KM=Symbol("handlePromise"),jM=Symbol("stream");function GM(e,t){return{value:e,done:t}}function qM(e){var t=e[MM];if(null!==t){var n=e[jM].read();null!==n&&(e[HM]=null,e[MM]=null,e[TM]=null,t(GM(n,!1)))}}function VM(e){Xl(qM,e)}var zM=Object.getPrototypeOf((function(){})),JM=Object.setPrototypeOf((FM={get stream(){return this[jM]},next:function(){var e=this,t=this[RM];if(null!==t)return Promise.reject(t);if(this[OM])return Promise.resolve(GM(void 0,!0));if(this[jM].destroyed)return new Promise((function(t,n){Xl((function(){e[RM]?n(e[RM]):t(GM(void 0,!0))}))}));var n,r=this[HM];if(r)n=new Promise(function(e,t){return function(n,r){e.then((function(){t[OM]?n(GM(void 0,!0)):t[KM](n,r)}),r)}}(r,this));else{var i=this[jM].read();if(null!==i)return Promise.resolve(GM(i,!1));n=new Promise(this[KM])}return this[HM]=n,n}},UM(FM,Symbol.asyncIterator,(function(){return this})),UM(FM,"return",(function(){var e=this;return new Promise((function(t,n){e[jM].destroy(null,(function(e){e?n(e):t(GM(void 0,!0))}))}))})),FM),zM),YM=function(e){var t,n=Object.create(JM,(UM(t={},jM,{value:e,writable:!0}),UM(t,MM,{value:null,writable:!0}),UM(t,TM,{value:null,writable:!0}),UM(t,RM,{value:null,writable:!0}),UM(t,OM,{value:e._readableState.endEmitted,writable:!0}),UM(t,KM,{value:function(e,t){var r=n[jM].read();r?(n[HM]=null,n[MM]=null,n[TM]=null,e(GM(r,!1))):(n[MM]=e,n[TM]=t)},writable:!0}),t));return n[HM]=null,LM(e,(function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=n[TM];return null!==t&&(n[HM]=null,n[MM]=null,n[TM]=null,t(e)),void(n[RM]=e)}var r=n[MM];null!==r&&(n[HM]=null,n[MM]=null,n[TM]=null,r(GM(void 0,!0))),n[OM]=!0})),e.on("readable",VM.bind(null,n)),n},XM=function(){throw new Error("Readable.from is not available in the browser")},WM=$L;WM.Readable=yT,yT.ReadableState=vT,eM.EventEmitter;var ZM,$M=function(e,t){return e.listeners(t).length},eT=tM,tT=Fa.Buffer,nT=No.Uint8Array||function(){},rT=sb;ZM=rT&&rT.debuglog?rT.debuglog("stream"):function(){};var iT,oT,aT,sT=uM,uT=hM,lT=yM,AT=fM.codes,cT=AT.ERR_INVALID_ARG_TYPE,hT=AT.ERR_STREAM_PUSH_AFTER_EOF,fT=AT.ERR_METHOD_NOT_IMPLEMENTED,dT=AT.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;KI.exports(yT,eT);var pT=uT.errorOrDestroy,gT=["error","close","destroy","pause","resume"];function vT(e,t,n){e=e||{},"boolean"!=typeof n&&(n=t instanceof WM.Duplex),this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=lT(this,e,"readableHighWaterMark",n),this.buffer=new sT,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(iT||(iT=mM.StringDecoder),this.decoder=new iT(e.encoding),this.encoding=e.encoding)}function yT(e){if(!(this instanceof yT))return new yT(e);var t=this instanceof WM.Duplex;this._readableState=new vT(e,this,t),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),eT.call(this)}function mT(e,t,n,r,i){ZM("readableAddChunk",t);var o,a=e._readableState;if(null===t)a.reading=!1,function(e,t){if(ZM("onEofChunk"),!t.ended){if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,t.sync?IT(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,BT(e)))}}(e,a);else if(i||(o=function(e,t){var n,r;return r=t,tT.isBuffer(r)||r instanceof nT||"string"==typeof t||void 0===t||e.objectMode||(n=new cT("chunk",["string","Buffer","Uint8Array"],t)),n}(a,t)),o)pT(e,o);else if(a.objectMode||t&&t.length>0)if("string"==typeof t||a.objectMode||Object.getPrototypeOf(t)===tT.prototype||(t=function(e){return tT.from(e)}(t)),r)a.endEmitted?pT(e,new dT):wT(e,a,t,!0);else if(a.ended)pT(e,new hT);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!n?(t=a.decoder.write(t),a.objectMode||0!==t.length?wT(e,a,t,!1):ET(e,a)):wT(e,a,t,!1)}else r||(a.reading=!1,ET(e,a));return!a.ended&&(a.length<a.highWaterMark||0===a.length)}function wT(e,t,n,r){t.flowing&&0===t.length&&!t.sync?(t.awaitDrain=0,e.emit("data",n)):(t.length+=t.objectMode?1:n.length,r?t.buffer.unshift(n):t.buffer.push(n),t.needReadable&&IT(e)),ET(e,t)}function bT(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=1073741824?e=1073741824:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function IT(e){var t=e._readableState;ZM("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(ZM("emitReadable",t.flowing),t.emittedReadable=!0,Xl(BT,e))}function BT(e){var t=e._readableState;ZM("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,QT(e)}function ET(e,t){t.readingMore||(t.readingMore=!0,Xl(CT,e,t))}function CT(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){var n=t.length;if(ZM("maybeReadMore read 0"),e.read(0),n===t.length)break}t.readingMore=!1}function xT(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function kT(e){ZM("readable nexttick read 0"),e.read(0)}function ST(e,t){ZM("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),QT(e),t.flowing&&!t.reading&&e.read(0)}function QT(e){var t=e._readableState;for(ZM("flow",t.flowing);t.flowing&&null!==e.read(););}function _T(e,t){return 0===t.length?null:(t.objectMode?n=t.buffer.shift():!e||e>=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):n=t.buffer.consume(e,t.decoder),n);var n}function NT(e){var t=e._readableState;ZM("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,Xl(DT,t,e))}function DT(e,t){if(ZM("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var n=t._writableState;(!n||n.autoDestroy&&n.finished)&&t.destroy()}}function FT(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}Object.defineProperty(yT.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),yT.prototype.destroy=uT.destroy,yT.prototype._undestroy=uT.undestroy,yT.prototype._destroy=function(e,t){t(e)},yT.prototype.push=function(e,t){var n,r=this._readableState;return r.objectMode?n=!0:"string"==typeof e&&((t=t||r.defaultEncoding)!==r.encoding&&(e=tT.from(e,t),t=""),n=!0),mT(this,e,t,!1,n)},yT.prototype.unshift=function(e){return mT(this,e,null,!0,!1)},yT.prototype.isPaused=function(){return!1===this._readableState.flowing},yT.prototype.setEncoding=function(e){iT||(iT=mM.StringDecoder);var t=new iT(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var n=this._readableState.buffer.head,r="";null!==n;)r+=t.write(n.data),n=n.next;return this._readableState.buffer.clear(),""!==r&&this._readableState.buffer.push(r),this._readableState.length=r.length,this},yT.prototype.read=function(e){ZM("read",e),e=parseInt(e,10);var t=this._readableState,n=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:t.length>0)||t.ended))return ZM("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?NT(this):IT(this),null;if(0===(e=bT(e,t))&&t.ended)return 0===t.length&&NT(this),null;var r,i=t.needReadable;return ZM("need readable",i),(0===t.length||t.length-e<t.highWaterMark)&&ZM("length less than watermark",i=!0),t.ended||t.reading?ZM("reading or ended",i=!1):i&&(ZM("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=bT(n,t))),null===(r=e>0?_T(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&NT(this)),null!==r&&this.emit("data",r),r},yT.prototype._read=function(e){pT(this,new fT("_read()"))},yT.prototype.pipe=function(e,t){var n=this,r=this._readableState;switch(r.pipesCount){case 0:r.pipes=e;break;case 1:r.pipes=[r.pipes,e];break;default:r.pipes.push(e)}r.pipesCount+=1,ZM("pipe count=%d opts=%j",r.pipesCount,t);var i=t&&!1===t.end||e===lA.stdout||e===lA.stderr?h:o;function o(){ZM("onend"),e.end()}r.endEmitted?Xl(i):n.once("end",i),e.on("unpipe",(function t(i,f){ZM("onunpipe"),i===n&&f&&!1===f.hasUnpiped&&(f.hasUnpiped=!0,ZM("cleanup"),e.removeListener("close",A),e.removeListener("finish",c),e.removeListener("drain",a),e.removeListener("error",l),e.removeListener("unpipe",t),n.removeListener("end",o),n.removeListener("end",h),n.removeListener("data",u),s=!0,!r.awaitDrain||e._writableState&&!e._writableState.needDrain||a())}));var a=function(e){return function(){var t=e._readableState;ZM("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&$M(e,"data")&&(t.flowing=!0,QT(e))}}(n);e.on("drain",a);var s=!1;function u(t){ZM("ondata");var i=e.write(t);ZM("dest.write",i),!1===i&&((1===r.pipesCount&&r.pipes===e||r.pipesCount>1&&-1!==FT(r.pipes,e))&&!s&&(ZM("false write response, pause",r.awaitDrain),r.awaitDrain++),n.pause())}function l(t){ZM("onerror",t),h(),e.removeListener("error",l),0===$M(e,"error")&&pT(e,t)}function A(){e.removeListener("finish",c),h()}function c(){ZM("onfinish"),e.removeListener("close",A),h()}function h(){ZM("unpipe"),n.unpipe(e)}return n.on("data",u),function(e,t,n){if("function"==typeof e.prependListener)return e.prependListener(t,n);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}(e,"error",l),e.once("close",A),e.once("finish",c),e.emit("pipe",n),r.flowing||(ZM("pipe resume"),n.resume()),e},yT.prototype.unpipe=function(e){var t=this._readableState,n={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,n)),this;if(!e){var r=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o<i;o++)r[o].emit("unpipe",this,{hasUnpiped:!1});return this}var a=FT(t.pipes,e);return-1===a||(t.pipes.splice(a,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,n)),this},yT.prototype.on=function(e,t){var n=eT.prototype.on.call(this,e,t),r=this._readableState;return"data"===e?(r.readableListening=this.listenerCount("readable")>0,!1!==r.flowing&&this.resume()):"readable"===e&&(r.endEmitted||r.readableListening||(r.readableListening=r.needReadable=!0,r.flowing=!1,r.emittedReadable=!1,ZM("on readable",r.length,r.reading),r.length?IT(this):r.reading||Xl(kT,this))),n},yT.prototype.addListener=yT.prototype.on,yT.prototype.removeListener=function(e,t){var n=eT.prototype.removeListener.call(this,e,t);return"readable"===e&&Xl(xT,this),n},yT.prototype.removeAllListeners=function(e){var t=eT.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||Xl(xT,this),t},yT.prototype.resume=function(){var e=this._readableState;return e.flowing||(ZM("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,Xl(ST,e,t))}(this,e)),e.paused=!1,this},yT.prototype.pause=function(){return ZM("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(ZM("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},yT.prototype.wrap=function(e){var t=this,n=this._readableState,r=!1;for(var i in e.on("end",(function(){if(ZM("wrapped end"),n.decoder&&!n.ended){var e=n.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(i){ZM("wrapped data"),n.decoder&&(i=n.decoder.write(i)),n.objectMode&&null==i||(n.objectMode||i&&i.length)&&(t.push(i)||(r=!0,e.pause()))})),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var o=0;o<gT.length;o++)e.on(gT[o],this.emit.bind(this,gT[o]));return this._read=function(t){ZM("wrapped _read",t),r&&(r=!1,e.resume())},this},"function"==typeof Symbol&&(yT.prototype[Symbol.asyncIterator]=function(){return void 0===oT&&(oT=YM),oT(this)}),Object.defineProperty(yT.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(yT.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(yT.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),yT._fromList=_T,Object.defineProperty(yT.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(yT.from=function(e,t){return void 0===aT&&(aT=XM),aT(yT,e,t)});function PT(e){try{if(!No.localStorage)return!1}catch(e){return!1}var t=No.localStorage[e];return null!=t&&"true"===String(t).toLowerCase()}var UT=$L;function LT(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,n){var r=e.entry;for(e.entry=null;r;){var i=r.callback;t.pendingcb--,i(undefined),r=r.next}t.corkedRequestsFree.next=e}(t,e)}}UT.Writable=nR,nR.WritableState=tR;var MT,TT=function(e,t){if(PT("noDeprecation"))return e;var n=!1;return function(){if(!n){if(PT("throwDeprecation"))throw new Error(t);PT("traceDeprecation")?console.trace(t):console.warn(t),n=!0}return e.apply(this,arguments)}},RT=tM,OT=Fa.Buffer,HT=No.Uint8Array||function(){},KT=hM,jT=yM,GT=fM.codes,qT=GT.ERR_INVALID_ARG_TYPE,VT=GT.ERR_METHOD_NOT_IMPLEMENTED,zT=GT.ERR_MULTIPLE_CALLBACK,JT=GT.ERR_STREAM_CANNOT_PIPE,YT=GT.ERR_STREAM_DESTROYED,XT=GT.ERR_STREAM_NULL_VALUES,WT=GT.ERR_STREAM_WRITE_AFTER_END,ZT=GT.ERR_UNKNOWN_ENCODING,$T=KT.errorOrDestroy;function eR(){}function tR(e,t,n){e=e||{},"boolean"!=typeof n&&(n=t instanceof UT.Duplex),this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=jT(this,e,"writableHighWaterMark",n),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var r=!1===e.decodeStrings;this.decodeStrings=!r,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var n=e._writableState,r=n.sync,i=n.writecb;if("function"!=typeof i)throw new zT;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(n),t)!function(e,t,n,r,i){--t.pendingcb,n?(Xl(i,r),Xl(uR,e,t),e._writableState.errorEmitted=!0,$T(e,r)):(i(r),e._writableState.errorEmitted=!0,$T(e,r),uR(e,t))}(e,n,r,t,i);else{var o=aR(n)||e.destroyed;o||n.corked||n.bufferProcessing||!n.bufferedRequest||oR(e,n),r?Xl(iR,e,n,o,i):iR(e,n,o,i)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new LT(this)}function nR(e){var t=this instanceof UT.Duplex;if(!t&&!MT.call(nR,this))return new nR(e);this._writableState=new tR(e,this,t),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),RT.call(this)}function rR(e,t,n,r,i,o,a){t.writelen=r,t.writecb=a,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new YT("write")):n?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function iR(e,t,n,r){n||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,r(),uR(e,t)}function oR(e,t){t.bufferProcessing=!0;var n=t.bufferedRequest;if(e._writev&&n&&n.next){var r=t.bufferedRequestCount,i=new Array(r),o=t.corkedRequestsFree;o.entry=n;for(var a=0,s=!0;n;)i[a]=n,n.isBuf||(s=!1),n=n.next,a+=1;i.allBuffers=s,rR(e,t,!0,t.length,i,"",o.finish),t.pendingcb++,t.lastBufferedRequest=null,o.next?(t.corkedRequestsFree=o.next,o.next=null):t.corkedRequestsFree=new LT(t),t.bufferedRequestCount=0}else{for(;n;){var u=n.chunk,l=n.encoding,A=n.callback;if(rR(e,t,!1,t.objectMode?1:u.length,u,l,A),n=n.next,t.bufferedRequestCount--,t.writing)break}null===n&&(t.lastBufferedRequest=null)}t.bufferedRequest=n,t.bufferProcessing=!1}function aR(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function sR(e,t){e._final((function(n){t.pendingcb--,n&&$T(e,n),t.prefinished=!0,e.emit("prefinish"),uR(e,t)}))}function uR(e,t){var n=aR(t);if(n&&(function(e,t){t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.pendingcb++,t.finalCalled=!0,Xl(sR,e,t)))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var r=e._readableState;(!r||r.autoDestroy&&r.endEmitted)&&e.destroy()}return n}KI.exports(nR,RT),tR.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(tR.prototype,"buffer",{get:TT((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(MT=Function.prototype[Symbol.hasInstance],Object.defineProperty(nR,Symbol.hasInstance,{value:function(e){return!!MT.call(this,e)||this===nR&&e&&e._writableState instanceof tR}})):MT=function(e){return e instanceof this},nR.prototype.pipe=function(){$T(this,new JT)},nR.prototype.write=function(e,t,n){var r,i=this._writableState,o=!1,a=!i.objectMode&&(r=e,OT.isBuffer(r)||r instanceof HT);return a&&!OT.isBuffer(e)&&(e=function(e){return OT.from(e)}(e)),"function"==typeof t&&(n=t,t=null),a?t="buffer":t||(t=i.defaultEncoding),"function"!=typeof n&&(n=eR),i.ending?function(e,t){var n=new WT;$T(e,n),Xl(t,n)}(this,n):(a||function(e,t,n,r){var i;return null===n?i=new XT:"string"==typeof n||t.objectMode||(i=new qT("chunk",["string","Buffer"],n)),!i||($T(e,i),Xl(r,i),!1)}(this,i,e,n))&&(i.pendingcb++,o=function(e,t,n,r,i,o){if(!n){var a=function(e,t,n){return e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=OT.from(t,n)),t}(t,r,i);r!==a&&(n=!0,i="buffer",r=a)}var s=t.objectMode?1:r.length;t.length+=s;var u=t.length<t.highWaterMark;if(u||(t.needDrain=!0),t.writing||t.corked){var l=t.lastBufferedRequest;t.lastBufferedRequest={chunk:r,encoding:i,isBuf:n,callback:o,next:null},l?l.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else rR(e,t,!1,s,r,i,o);return u}(this,i,a,e,t,n)),o},nR.prototype.cork=function(){this._writableState.corked++},nR.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||oR(this,e))},nR.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new ZT(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(nR.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(nR.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),nR.prototype._write=function(e,t,n){n(new VT("_write()"))},nR.prototype._writev=null,nR.prototype.end=function(e,t,n){var r=this._writableState;return"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!=e&&this.write(e,t),r.corked&&(r.corked=1,this.uncork()),r.ending||function(e,t,n){t.ending=!0,uR(e,t),n&&(t.finished?Xl(n):e.once("finish",n)),t.ended=!0,e.writable=!1}(this,r,n),this},Object.defineProperty(nR.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(nR.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),nR.prototype.destroy=KT.destroy,nR.prototype._undestroy=KT.undestroy,nR.prototype._destroy=function(e,t){t(e)};var lR=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t},AR=$L;AR.Duplex=dR,KI.exports(dR,AR.Readable);for(var cR=lR(AR.Writable.prototype),hR=0;hR<cR.length;hR++){var fR=cR[hR];dR.prototype[fR]||(dR.prototype[fR]=AR.Writable.prototype[fR])}function dR(e){if(!(this instanceof dR))return new dR(e);AR.Readable.call(this,e),AR.Writable.call(this,e),this.allowHalfOpen=!0,e&&(!1===e.readable&&(this.readable=!1),!1===e.writable&&(this.writable=!1),!1===e.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",pR)))}function pR(){this._writableState.ended||Xl(gR,this)}function gR(e){e.end()}Object.defineProperty(dR.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(dR.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(dR.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(dR.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}});var vR=$L;vR.Transform=ER;var yR=fM.codes,mR=yR.ERR_METHOD_NOT_IMPLEMENTED,wR=yR.ERR_MULTIPLE_CALLBACK,bR=yR.ERR_TRANSFORM_ALREADY_TRANSFORMING,IR=yR.ERR_TRANSFORM_WITH_LENGTH_0;function BR(e,t){var n=this._transformState;n.transforming=!1;var r=n.writecb;if(null===r)return this.emit("error",new wR);n.writechunk=null,n.writecb=null,null!=t&&this.push(t),r(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function ER(e){if(!(this instanceof ER))return new ER(e);vR.Duplex.call(this,e),this._transformState={afterTransform:BR.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",CR)}function CR(){var e=this;"function"!=typeof this._flush||this._readableState.destroyed?xR(this,null,null):this._flush((function(t,n){xR(e,t,n)}))}function xR(e,t,n){if(t)return e.emit("error",t);if(null!=n&&e.push(n),e._writableState.length)throw new IR;if(e._transformState.transforming)throw new bR;return e.push(null)}KI.exports(ER,vR.Duplex),ER.prototype.push=function(e,t){return this._transformState.needTransform=!1,vR.Duplex.prototype.push.call(this,e,t)},ER.prototype._transform=function(e,t,n){n(new mR("_transform()"))},ER.prototype._write=function(e,t,n){var r=this._transformState;if(r.writecb=n,r.writechunk=e,r.writeencoding=t,!r.transforming){var i=this._readableState;(r.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},ER.prototype._read=function(e){var t=this._transformState;null===t.writechunk||t.transforming?t.needTransform=!0:(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform))},ER.prototype._destroy=function(e,t){vR.Duplex.prototype._destroy.call(this,e,(function(e){t(e)}))};var kR,SR=$L;function QR(e){if(!(this instanceof QR))return new QR(e);Transform.call(this,e)}SR.PassThrough=QR,KI.exports(QR,SR.Transform),QR.prototype._transform=function(e,t,n){n(null,e)};var _R=fM.codes,NR=_R.ERR_MISSING_ARGS,DR=_R.ERR_STREAM_DESTROYED;function FR(e){if(e)throw e}function PR(e,t,n,r){r=function(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}(r);var i=!1;e.on("close",(function(){i=!0})),void 0===kR&&(kR=PM),kR(e,{readable:t,writable:n},(function(e){if(e)return r(e);i=!0,r()}));var o=!1;return function(t){if(!i&&!o)return o=!0,function(e){return e.setHeader&&"function"==typeof e.abort}(e)?e.abort():"function"==typeof e.destroy?e.destroy():void r(t||new DR("pipe"))}}function UR(e){e()}function LR(e,t){return e.pipe(t)}function MR(e){return e.length?"function"!=typeof e[e.length-1]?FR:e.pop():FR}var TR=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r,i=MR(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new NR("streams");var o=t.map((function(e,n){var a=n<t.length-1;return PR(e,a,n>0,(function(e){r||(r=e),e&&o.forEach(UR),a||(o.forEach(UR),i(r))}))}));return t.reduce(LR)};!function(e,t){var n=$L;(t=ZL.exports=n.Readable).Stream=n.Readable,t.Readable=n.Readable,t.Writable=n.Writable,t.Duplex=n.Duplex,t.Transform=n.Transform,t.PassThrough=n.PassThrough,t.finished=PM,t.pipeline=TR}(0,ZL.exports);var RR=jN.exports.Buffer,OR=ZL.exports;function HR(e){OR.Stream.Transform.call(this),this._block=RR.allocUnsafe(e),this._blockSize=e,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}(0,KI.exports)(HR,OR.Stream.Transform),HR.prototype._transform=function(e,t,n){var r=null;try{this.update(e,t)}catch(e){r=e}n(r)},HR.prototype._flush=function(e){var t=null;try{this.push(this.digest())}catch(e){t=e}e(t)},HR.prototype.update=function(e,t){if(function(e,t){if(!RR.isBuffer(e)&&"string"!=typeof e)throw new TypeError("Data must be a string or a buffer")}(e),this._finalized)throw new Error("Digest already called");RR.isBuffer(e)||(e=RR.from(e,t));for(var n=this._block,r=0;this._blockOffset+e.length-r>=this._blockSize;){for(var i=this._blockOffset;i<this._blockSize;)n[i++]=e[r++];this._update(),this._blockOffset=0}for(;r<e.length;)n[this._blockOffset++]=e[r++];for(var o=0,a=8*e.length;a>0;++o)this._length[o]+=a,(a=this._length[o]/4294967296|0)>0&&(this._length[o]-=4294967296*a);return this},HR.prototype._update=function(){throw new Error("_update is not implemented")},HR.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var t=this._digest();void 0!==e&&(t=t.toString(e)),this._block.fill(0),this._blockOffset=0;for(var n=0;n<4;++n)this._length[n]=0;return t},HR.prototype._digest=function(){throw new Error("_digest is not implemented")};var KR=HR,jR=KI.exports,GR=KR,qR=jN.exports.Buffer,VR=new Array(16);function zR(){GR.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function JR(e,t){return e<<t|e>>>32-t}function YR(e,t,n,r,i,o,a){return JR(e+(t&n|~t&r)+i+o|0,a)+t|0}function XR(e,t,n,r,i,o,a){return JR(e+(t&r|n&~r)+i+o|0,a)+t|0}function WR(e,t,n,r,i,o,a){return JR(e+(t^n^r)+i+o|0,a)+t|0}function ZR(e,t,n,r,i,o,a){return JR(e+(n^(t|~r))+i+o|0,a)+t|0}jR(zR,GR),zR.prototype._update=function(){for(var e=VR,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);var n=this._a,r=this._b,i=this._c,o=this._d;n=YR(n,r,i,o,e[0],3614090360,7),o=YR(o,n,r,i,e[1],3905402710,12),i=YR(i,o,n,r,e[2],606105819,17),r=YR(r,i,o,n,e[3],3250441966,22),n=YR(n,r,i,o,e[4],4118548399,7),o=YR(o,n,r,i,e[5],1200080426,12),i=YR(i,o,n,r,e[6],2821735955,17),r=YR(r,i,o,n,e[7],4249261313,22),n=YR(n,r,i,o,e[8],1770035416,7),o=YR(o,n,r,i,e[9],2336552879,12),i=YR(i,o,n,r,e[10],4294925233,17),r=YR(r,i,o,n,e[11],2304563134,22),n=YR(n,r,i,o,e[12],1804603682,7),o=YR(o,n,r,i,e[13],4254626195,12),i=YR(i,o,n,r,e[14],2792965006,17),n=XR(n,r=YR(r,i,o,n,e[15],1236535329,22),i,o,e[1],4129170786,5),o=XR(o,n,r,i,e[6],3225465664,9),i=XR(i,o,n,r,e[11],643717713,14),r=XR(r,i,o,n,e[0],3921069994,20),n=XR(n,r,i,o,e[5],3593408605,5),o=XR(o,n,r,i,e[10],38016083,9),i=XR(i,o,n,r,e[15],3634488961,14),r=XR(r,i,o,n,e[4],3889429448,20),n=XR(n,r,i,o,e[9],568446438,5),o=XR(o,n,r,i,e[14],3275163606,9),i=XR(i,o,n,r,e[3],4107603335,14),r=XR(r,i,o,n,e[8],1163531501,20),n=XR(n,r,i,o,e[13],2850285829,5),o=XR(o,n,r,i,e[2],4243563512,9),i=XR(i,o,n,r,e[7],1735328473,14),n=WR(n,r=XR(r,i,o,n,e[12],2368359562,20),i,o,e[5],4294588738,4),o=WR(o,n,r,i,e[8],2272392833,11),i=WR(i,o,n,r,e[11],1839030562,16),r=WR(r,i,o,n,e[14],4259657740,23),n=WR(n,r,i,o,e[1],2763975236,4),o=WR(o,n,r,i,e[4],1272893353,11),i=WR(i,o,n,r,e[7],4139469664,16),r=WR(r,i,o,n,e[10],3200236656,23),n=WR(n,r,i,o,e[13],681279174,4),o=WR(o,n,r,i,e[0],3936430074,11),i=WR(i,o,n,r,e[3],3572445317,16),r=WR(r,i,o,n,e[6],76029189,23),n=WR(n,r,i,o,e[9],3654602809,4),o=WR(o,n,r,i,e[12],3873151461,11),i=WR(i,o,n,r,e[15],530742520,16),n=ZR(n,r=WR(r,i,o,n,e[2],3299628645,23),i,o,e[0],4096336452,6),o=ZR(o,n,r,i,e[7],1126891415,10),i=ZR(i,o,n,r,e[14],2878612391,15),r=ZR(r,i,o,n,e[5],4237533241,21),n=ZR(n,r,i,o,e[12],1700485571,6),o=ZR(o,n,r,i,e[3],2399980690,10),i=ZR(i,o,n,r,e[10],4293915773,15),r=ZR(r,i,o,n,e[1],2240044497,21),n=ZR(n,r,i,o,e[8],1873313359,6),o=ZR(o,n,r,i,e[15],4264355552,10),i=ZR(i,o,n,r,e[6],2734768916,15),r=ZR(r,i,o,n,e[13],1309151649,21),n=ZR(n,r,i,o,e[4],4149444226,6),o=ZR(o,n,r,i,e[11],3174756917,10),i=ZR(i,o,n,r,e[2],718787259,15),r=ZR(r,i,o,n,e[9],3951481745,21),this._a=this._a+n|0,this._b=this._b+r|0,this._c=this._c+i|0,this._d=this._d+o|0},zR.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=qR.allocUnsafe(16);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e};var $R=zR,eO=Fa.Buffer,tO=KI.exports,nO=KR,rO=new Array(16),iO=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],oO=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],aO=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],sO=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],uO=[0,1518500249,1859775393,2400959708,2840853838],lO=[1352829926,1548603684,1836072691,2053994217,0];function AO(){nO.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function cO(e,t){return e<<t|e>>>32-t}function hO(e,t,n,r,i,o,a,s){return cO(e+(t^n^r)+o+a|0,s)+i|0}function fO(e,t,n,r,i,o,a,s){return cO(e+(t&n|~t&r)+o+a|0,s)+i|0}function dO(e,t,n,r,i,o,a,s){return cO(e+((t|~n)^r)+o+a|0,s)+i|0}function pO(e,t,n,r,i,o,a,s){return cO(e+(t&r|n&~r)+o+a|0,s)+i|0}function gO(e,t,n,r,i,o,a,s){return cO(e+(t^(n|~r))+o+a|0,s)+i|0}tO(AO,nO),AO.prototype._update=function(){for(var e=rO,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);for(var n=0|this._a,r=0|this._b,i=0|this._c,o=0|this._d,a=0|this._e,s=0|this._a,u=0|this._b,l=0|this._c,A=0|this._d,c=0|this._e,h=0;h<80;h+=1){var f,d;h<16?(f=hO(n,r,i,o,a,e[iO[h]],uO[0],aO[h]),d=gO(s,u,l,A,c,e[oO[h]],lO[0],sO[h])):h<32?(f=fO(n,r,i,o,a,e[iO[h]],uO[1],aO[h]),d=pO(s,u,l,A,c,e[oO[h]],lO[1],sO[h])):h<48?(f=dO(n,r,i,o,a,e[iO[h]],uO[2],aO[h]),d=dO(s,u,l,A,c,e[oO[h]],lO[2],sO[h])):h<64?(f=pO(n,r,i,o,a,e[iO[h]],uO[3],aO[h]),d=fO(s,u,l,A,c,e[oO[h]],lO[3],sO[h])):(f=gO(n,r,i,o,a,e[iO[h]],uO[4],aO[h]),d=hO(s,u,l,A,c,e[oO[h]],lO[4],sO[h])),n=a,a=o,o=cO(i,10),i=r,r=f,s=c,c=A,A=cO(l,10),l=u,u=d}var p=this._b+i+A|0;this._b=this._c+o+c|0,this._c=this._d+a+s|0,this._d=this._e+n+u|0,this._e=this._a+r+l|0,this._a=p},AO.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=eO.alloc?eO.alloc(20):new eO(20);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e.writeInt32LE(this._e,16),e};var vO=AO,yO={exports:{}},mO=jN.exports.Buffer;function wO(e,t){this._block=mO.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}wO.prototype.update=function(e,t){"string"==typeof e&&(t=t||"utf8",e=mO.from(e,t));for(var n=this._block,r=this._blockSize,i=e.length,o=this._len,a=0;a<i;){for(var s=o%r,u=Math.min(i-a,r-s),l=0;l<u;l++)n[s+l]=e[a+l];a+=u,(o+=u)%r==0&&this._update(n)}return this._len+=i,this},wO.prototype.digest=function(e){var t=this._len%this._blockSize;this._block[t]=128,this._block.fill(0,t+1),t>=this._finalSize&&(this._update(this._block),this._block.fill(0));var n=8*this._len;if(n<=4294967295)this._block.writeUInt32BE(n,this._blockSize-4);else{var r=(4294967295&n)>>>0,i=(n-r)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(r,this._blockSize-4)}this._update(this._block);var o=this._hash();return e?o.toString(e):o},wO.prototype._update=function(){throw new Error("_update must be implemented by subclass")};var bO=wO,IO=KI.exports,BO=bO,EO=jN.exports.Buffer,CO=[1518500249,1859775393,-1894007588,-899497514],xO=new Array(80);function kO(){this.init(),this._w=xO,BO.call(this,64,56)}function SO(e){return e<<30|e>>>2}function QO(e,t,n,r){return 0===e?t&n|~t&r:2===e?t&n|t&r|n&r:t^n^r}IO(kO,BO),kO.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},kO.prototype._update=function(e){for(var t,n=this._w,r=0|this._a,i=0|this._b,o=0|this._c,a=0|this._d,s=0|this._e,u=0;u<16;++u)n[u]=e.readInt32BE(4*u);for(;u<80;++u)n[u]=n[u-3]^n[u-8]^n[u-14]^n[u-16];for(var l=0;l<80;++l){var A=~~(l/20),c=0|((t=r)<<5|t>>>27)+QO(A,i,o,a)+s+n[l]+CO[A];s=a,a=o,o=SO(i),i=r,r=c}this._a=r+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=a+this._d|0,this._e=s+this._e|0},kO.prototype._hash=function(){var e=EO.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e};var _O=kO,NO=KI.exports,DO=bO,FO=jN.exports.Buffer,PO=[1518500249,1859775393,-1894007588,-899497514],UO=new Array(80);function LO(){this.init(),this._w=UO,DO.call(this,64,56)}function MO(e){return e<<5|e>>>27}function TO(e){return e<<30|e>>>2}function RO(e,t,n,r){return 0===e?t&n|~t&r:2===e?t&n|t&r|n&r:t^n^r}NO(LO,DO),LO.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},LO.prototype._update=function(e){for(var t,n=this._w,r=0|this._a,i=0|this._b,o=0|this._c,a=0|this._d,s=0|this._e,u=0;u<16;++u)n[u]=e.readInt32BE(4*u);for(;u<80;++u)n[u]=(t=n[u-3]^n[u-8]^n[u-14]^n[u-16])<<1|t>>>31;for(var l=0;l<80;++l){var A=~~(l/20),c=MO(r)+RO(A,i,o,a)+s+n[l]+PO[A]|0;s=a,a=o,o=TO(i),i=r,r=c}this._a=r+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=a+this._d|0,this._e=s+this._e|0},LO.prototype._hash=function(){var e=FO.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e};var OO=LO,HO=KI.exports,KO=bO,jO=jN.exports.Buffer,GO=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],qO=new Array(64);function VO(){this.init(),this._w=qO,KO.call(this,64,56)}function zO(e,t,n){return n^e&(t^n)}function JO(e,t,n){return e&t|n&(e|t)}function YO(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function XO(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function WO(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}function ZO(e){return(e>>>17|e<<15)^(e>>>19|e<<13)^e>>>10}HO(VO,KO),VO.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},VO.prototype._update=function(e){for(var t=this._w,n=0|this._a,r=0|this._b,i=0|this._c,o=0|this._d,a=0|this._e,s=0|this._f,u=0|this._g,l=0|this._h,A=0;A<16;++A)t[A]=e.readInt32BE(4*A);for(;A<64;++A)t[A]=ZO(t[A-2])+t[A-7]+WO(t[A-15])+t[A-16]|0;for(var c=0;c<64;++c){var h=l+XO(a)+zO(a,s,u)+GO[c]+t[c]|0,f=YO(n)+JO(n,r,i)|0;l=u,u=s,s=a,a=o+h|0,o=i,i=r,r=n,n=h+f|0}this._a=n+this._a|0,this._b=r+this._b|0,this._c=i+this._c|0,this._d=o+this._d|0,this._e=a+this._e|0,this._f=s+this._f|0,this._g=u+this._g|0,this._h=l+this._h|0},VO.prototype._hash=function(){var e=jO.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e};var $O=VO,eH=KI.exports,tH=$O,nH=bO,rH=jN.exports.Buffer,iH=new Array(64);function oH(){this.init(),this._w=iH,nH.call(this,64,56)}eH(oH,tH),oH.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},oH.prototype._hash=function(){var e=rH.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e};var aH=oH,sH=KI.exports,uH=bO,lH=jN.exports.Buffer,AH=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],cH=new Array(160);function hH(){this.init(),this._w=cH,uH.call(this,128,112)}function fH(e,t,n){return n^e&(t^n)}function dH(e,t,n){return e&t|n&(e|t)}function pH(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function gH(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function vH(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function yH(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function mH(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function wH(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function bH(e,t){return e>>>0<t>>>0?1:0}sH(hH,uH),hH.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},hH.prototype._update=function(e){for(var t=this._w,n=0|this._ah,r=0|this._bh,i=0|this._ch,o=0|this._dh,a=0|this._eh,s=0|this._fh,u=0|this._gh,l=0|this._hh,A=0|this._al,c=0|this._bl,h=0|this._cl,f=0|this._dl,d=0|this._el,p=0|this._fl,g=0|this._gl,v=0|this._hl,y=0;y<32;y+=2)t[y]=e.readInt32BE(4*y),t[y+1]=e.readInt32BE(4*y+4);for(;y<160;y+=2){var m=t[y-30],w=t[y-30+1],b=vH(m,w),I=yH(w,m),B=mH(m=t[y-4],w=t[y-4+1]),E=wH(w,m),C=t[y-14],x=t[y-14+1],k=t[y-32],S=t[y-32+1],Q=I+x|0,_=b+C+bH(Q,I)|0;_=(_=_+B+bH(Q=Q+E|0,E)|0)+k+bH(Q=Q+S|0,S)|0,t[y]=_,t[y+1]=Q}for(var N=0;N<160;N+=2){_=t[N],Q=t[N+1];var D=dH(n,r,i),F=dH(A,c,h),P=pH(n,A),U=pH(A,n),L=gH(a,d),M=gH(d,a),T=AH[N],R=AH[N+1],O=fH(a,s,u),H=fH(d,p,g),K=v+M|0,j=l+L+bH(K,v)|0;j=(j=(j=j+O+bH(K=K+H|0,H)|0)+T+bH(K=K+R|0,R)|0)+_+bH(K=K+Q|0,Q)|0;var G=U+F|0,q=P+D+bH(G,U)|0;l=u,v=g,u=s,g=p,s=a,p=d,a=o+j+bH(d=f+K|0,f)|0,o=i,f=h,i=r,h=c,r=n,c=A,n=j+q+bH(A=K+G|0,K)|0}this._al=this._al+A|0,this._bl=this._bl+c|0,this._cl=this._cl+h|0,this._dl=this._dl+f|0,this._el=this._el+d|0,this._fl=this._fl+p|0,this._gl=this._gl+g|0,this._hl=this._hl+v|0,this._ah=this._ah+n+bH(this._al,A)|0,this._bh=this._bh+r+bH(this._bl,c)|0,this._ch=this._ch+i+bH(this._cl,h)|0,this._dh=this._dh+o+bH(this._dl,f)|0,this._eh=this._eh+a+bH(this._el,d)|0,this._fh=this._fh+s+bH(this._fl,p)|0,this._gh=this._gh+u+bH(this._gl,g)|0,this._hh=this._hh+l+bH(this._hl,v)|0},hH.prototype._hash=function(){var e=lH.allocUnsafe(64);function t(t,n,r){e.writeInt32BE(t,r),e.writeInt32BE(n,r+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),t(this._gh,this._gl,48),t(this._hh,this._hl,56),e};var IH=hH,BH=KI.exports,EH=IH,CH=bO,xH=jN.exports.Buffer,kH=new Array(160);function SH(){this.init(),this._w=kH,CH.call(this,128,112)}BH(SH,EH),SH.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},SH.prototype._hash=function(){var e=xH.allocUnsafe(48);function t(t,n,r){e.writeInt32BE(t,r),e.writeInt32BE(n,r+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),e};var QH=SH,_H=yO.exports=function(e){e=e.toLowerCase();var t=_H[e];if(!t)throw new Error(e+" is not supported (we accept pull requests)");return new t};_H.sha=_O,_H.sha1=OO,_H.sha224=aH,_H.sha256=$O,_H.sha384=QH,_H.sha512=IH;var NH=Do(sh),DH=jN.exports.Buffer,FH=JQ.Transform,PH=NH.StringDecoder;function UH(e){FH.call(this),this.hashMode="string"==typeof e,this.hashMode?this[e]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}(0,KI.exports)(UH,FH),UH.prototype.update=function(e,t,n){"string"==typeof e&&(e=DH.from(e,t));var r=this._update(e);return this.hashMode?this:(n&&(r=this._toString(r,n)),r)},UH.prototype.setAutoPadding=function(){},UH.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},UH.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},UH.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},UH.prototype._transform=function(e,t,n){var r;try{this.hashMode?this._update(e):this.push(this._update(e))}catch(e){r=e}finally{n(r)}},UH.prototype._flush=function(e){var t;try{this.push(this.__final())}catch(e){t=e}e(t)},UH.prototype._finalOrDigest=function(e){var t=this.__final()||DH.alloc(0);return e&&(t=this._toString(t,e,!0)),t},UH.prototype._toString=function(e,t,n){if(this._decoder||(this._decoder=new PH(t),this._encoding=t),this._encoding!==t)throw new Error("can't switch encodings");var r=this._decoder.write(e);return n&&(r+=this._decoder.end()),r};var LH=UH,MH=KI.exports,TH=$R,RH=vO,OH=yO.exports,HH=LH;function KH(e){HH.call(this,"digest"),this._hash=e}MH(KH,HH),KH.prototype._update=function(e){this._hash.update(e)},KH.prototype._final=function(){return this._hash.digest()};var jH=function(e){return"md5"===(e=e.toLowerCase())?new TH:"rmd160"===e||"ripemd160"===e?new RH:new KH(OH(e))};Object.defineProperty(WL,"__esModule",{value:!0}),WL.taggedHash=WL.hash256=WL.hash160=WL.sha256=WL.sha1=WL.ripemd160=void 0;var GH=jH,qH=vO;function VH(e){try{return GH("rmd160").update(e).digest()}catch(t){try{return GH("ripemd160").update(e).digest()}catch(t){return(new qH).update(e).digest()}}}function zH(e){return GH("sha256").update(e).digest()}WL.ripemd160=VH,WL.sha1=function(e){return GH("sha1").update(e).digest()},WL.sha256=zH,WL.hash160=function(e){return VH(zH(e))},WL.hash256=function(e){return zH(zH(e))};var JH=Object.fromEntries(["BIP0340/challenge","BIP0340/aux","BIP0340/nonce","TapLeaf","TapBranch","TapSighash","TapTweak","KeyAgg list","KeyAgg coefficient"].map((function(e){var t=zH(Yo.from(e));return[e,Yo.concat([t,t])]})));WL.taggedHash=function(e,t){return zH(Yo.concat([JH[e],t]))};var YH=wU,XH=jN.exports.Buffer,WH=jH,ZH=function(e){function t(t){var n=t.slice(0,-4),r=t.slice(-4),i=e(n);if(!(r[0]^i[0]|r[1]^i[1]|r[2]^i[2]|r[3]^i[3]))return n}return{encode:function(t){var n=e(t);return YH.encode(XH.concat([t,n],t.length+4))},decode:function(e){var n=t(YH.decode(e));if(!n)throw new Error("Invalid checksum");return n},decodeUnsafe:function(e){var n=YH.decodeUnsafe(e);if(n)return t(n)}}}((function(e){var t=WH("sha256").update(e).digest();return WH("sha256").update(t).digest()}));Object.defineProperty(XL,"__esModule",{value:!0}),XL.p2pkh=void 0;var $H=WL,eK=EU,tK=kU,nK=OU,rK=_L,iK=ZH,oK=tK.OPS;XL.p2pkh=function(e,t){if(!(e.address||e.hash||e.output||e.pubkey||e.input))throw new TypeError("Not enough data");t=Object.assign({validate:!0},t||{}),(0,nK.typeforce)({network:nK.typeforce.maybe(nK.typeforce.Object),address:nK.typeforce.maybe(nK.typeforce.String),hash:nK.typeforce.maybe(nK.typeforce.BufferN(20)),output:nK.typeforce.maybe(nK.typeforce.BufferN(25)),pubkey:nK.typeforce.maybe(nK.isPoint),signature:nK.typeforce.maybe(tK.isCanonicalScriptSignature),input:nK.typeforce.maybe(nK.typeforce.Buffer)},e);var n=rK.value((function(){var t=iK.decode(e.address);return{version:t.readUInt8(0),hash:t.slice(1)}})),r=rK.value((function(){return tK.decompile(e.input)})),i=e.network||eK.bitcoin,o={name:"p2pkh",network:i};if(rK.prop(o,"address",(function(){if(o.hash){var e=Yo.allocUnsafe(21);return e.writeUInt8(i.pubKeyHash,0),o.hash.copy(e,1),iK.encode(e)}})),rK.prop(o,"hash",(function(){return e.output?e.output.slice(3,23):e.address?n().hash:e.pubkey||o.pubkey?$H.hash160(e.pubkey||o.pubkey):void 0})),rK.prop(o,"output",(function(){if(o.hash)return tK.compile([oK.OP_DUP,oK.OP_HASH160,o.hash,oK.OP_EQUALVERIFY,oK.OP_CHECKSIG])})),rK.prop(o,"pubkey",(function(){if(e.input)return r()[1]})),rK.prop(o,"signature",(function(){if(e.input)return r()[0]})),rK.prop(o,"input",(function(){if(e.pubkey&&e.signature)return tK.compile([e.signature,e.pubkey])})),rK.prop(o,"witness",(function(){if(o.input)return[]})),t.validate){var a=Yo.from([]);if(e.address){if(n().version!==i.pubKeyHash)throw new TypeError("Invalid version or Network mismatch");if(20!==n().hash.length)throw new TypeError("Invalid address");a=n().hash}if(e.hash){if(a.length>0&&!a.equals(e.hash))throw new TypeError("Hash mismatch");a=e.hash}if(e.output){if(25!==e.output.length||e.output[0]!==oK.OP_DUP||e.output[1]!==oK.OP_HASH160||20!==e.output[2]||e.output[23]!==oK.OP_EQUALVERIFY||e.output[24]!==oK.OP_CHECKSIG)throw new TypeError("Output is invalid");var s=e.output.slice(3,23);if(a.length>0&&!a.equals(s))throw new TypeError("Hash mismatch");a=s}if(e.pubkey){var u=$H.hash160(e.pubkey);if(a.length>0&&!a.equals(u))throw new TypeError("Hash mismatch");a=u}if(e.input){var l=r();if(2!==l.length)throw new TypeError("Input is invalid");if(!tK.isCanonicalScriptSignature(l[0]))throw new TypeError("Input has invalid signature");if(!(0,nK.isPoint)(l[1]))throw new TypeError("Input has invalid pubkey");if(e.signature&&!e.signature.equals(l[0]))throw new TypeError("Signature mismatch");if(e.pubkey&&!e.pubkey.equals(l[1]))throw new TypeError("Pubkey mismatch");var A=$H.hash160(l[1]);if(a.length>0&&!a.equals(A))throw new TypeError("Hash mismatch")}}return Object.assign(o,e)};var aK={};Object.defineProperty(aK,"__esModule",{value:!0}),aK.p2sh=void 0;var sK=WL,uK=EU,lK=kU,AK=OU,cK=_L,hK=ZH,fK=lK.OPS;aK.p2sh=function(e,t){if(!(e.address||e.hash||e.output||e.redeem||e.input))throw new TypeError("Not enough data");t=Object.assign({validate:!0},t||{}),(0,AK.typeforce)({network:AK.typeforce.maybe(AK.typeforce.Object),address:AK.typeforce.maybe(AK.typeforce.String),hash:AK.typeforce.maybe(AK.typeforce.BufferN(20)),output:AK.typeforce.maybe(AK.typeforce.BufferN(23)),redeem:AK.typeforce.maybe({network:AK.typeforce.maybe(AK.typeforce.Object),output:AK.typeforce.maybe(AK.typeforce.Buffer),input:AK.typeforce.maybe(AK.typeforce.Buffer),witness:AK.typeforce.maybe(AK.typeforce.arrayOf(AK.typeforce.Buffer))}),input:AK.typeforce.maybe(AK.typeforce.Buffer),witness:AK.typeforce.maybe(AK.typeforce.arrayOf(AK.typeforce.Buffer))},e);var n=e.network;n||(n=e.redeem&&e.redeem.network||uK.bitcoin);var r={network:n},i=cK.value((function(){var t=hK.decode(e.address);return{version:t.readUInt8(0),hash:t.slice(1)}})),o=cK.value((function(){return lK.decompile(e.input)})),a=cK.value((function(){var t=o(),r=t[t.length-1];return{network:n,output:r===fK.OP_FALSE?Yo.from([]):r,input:lK.compile(t.slice(0,-1)),witness:e.witness||[]}}));if(cK.prop(r,"address",(function(){if(r.hash){var e=Yo.allocUnsafe(21);return e.writeUInt8(r.network.scriptHash,0),r.hash.copy(e,1),hK.encode(e)}})),cK.prop(r,"hash",(function(){return e.output?e.output.slice(2,22):e.address?i().hash:r.redeem&&r.redeem.output?sK.hash160(r.redeem.output):void 0})),cK.prop(r,"output",(function(){if(r.hash)return lK.compile([fK.OP_HASH160,r.hash,fK.OP_EQUAL])})),cK.prop(r,"redeem",(function(){if(e.input)return a()})),cK.prop(r,"input",(function(){if(e.redeem&&e.redeem.input&&e.redeem.output)return lK.compile([].concat(lK.decompile(e.redeem.input),e.redeem.output))})),cK.prop(r,"witness",(function(){return r.redeem&&r.redeem.witness?r.redeem.witness:r.input?[]:void 0})),cK.prop(r,"name",(function(){var e=["p2sh"];return void 0!==r.redeem&&void 0!==r.redeem.name&&e.push(r.redeem.name),e.join("-")})),t.validate){var s=Yo.from([]);if(e.address){if(i().version!==n.scriptHash)throw new TypeError("Invalid version or Network mismatch");if(20!==i().hash.length)throw new TypeError("Invalid address");s=i().hash}if(e.hash){if(s.length>0&&!s.equals(e.hash))throw new TypeError("Hash mismatch");s=e.hash}if(e.output){if(23!==e.output.length||e.output[0]!==fK.OP_HASH160||20!==e.output[1]||e.output[22]!==fK.OP_EQUAL)throw new TypeError("Output is invalid");var u=e.output.slice(2,22);if(s.length>0&&!s.equals(u))throw new TypeError("Hash mismatch");s=u}var l=function(e){if(e.output){var t=lK.decompile(e.output);if(!t||t.length<1)throw new TypeError("Redeem.output too short");var n=sK.hash160(e.output);if(s.length>0&&!s.equals(n))throw new TypeError("Hash mismatch");s=n}if(e.input){var r=e.input.length>0,i=e.witness&&e.witness.length>0;if(!r&&!i)throw new TypeError("Empty input");if(r&&i)throw new TypeError("Input and witness provided");if(r){var o=lK.decompile(e.input);if(!lK.isPushOnly(o))throw new TypeError("Non push-only scriptSig")}}};if(e.input){var A=o();if(!A||A.length<1)throw new TypeError("Input too short");if(!Na(a().output))throw new TypeError("Input is invalid");l(a())}if(e.redeem){if(e.redeem.network&&e.redeem.network!==n)throw new TypeError("Network mismatch");if(e.input){var c=a();if(e.redeem.output&&!e.redeem.output.equals(c.output))throw new TypeError("Redeem.output mismatch");if(e.redeem.input&&!e.redeem.input.equals(c.input))throw new TypeError("Redeem.input mismatch")}l(e.redeem)}if(e.witness&&e.redeem&&e.redeem.witness&&!function(e,t){return e.length===t.length&&e.every((function(e,n){return e.equals(t[n])}))}(e.redeem.witness,e.witness))throw new TypeError("Witness and redeem.witness mismatch")}return Object.assign(r,e)};var dK={},pK={};Object.defineProperty(pK,"__esModule",{value:!0}),pK.bech32m=pK.bech32=void 0;for(var gK="qpzry9x8gf2tvdw0s3jn54khce6mua7l",vK={},yK=0;yK<gK.length;yK++){var mK=gK.charAt(yK);vK[mK]=yK}function wK(e){var t=e>>25;return(33554431&e)<<5^996825010&-(t>>0&1)^642813549&-(t>>1&1)^513874426&-(t>>2&1)^1027748829&-(t>>3&1)^705979059&-(t>>4&1)}function bK(e){for(var t=1,n=0;n<e.length;++n){var r=e.charCodeAt(n);if(r<33||r>126)return"Invalid prefix ("+e+")";t=wK(t)^r>>5}t=wK(t);for(var i=0;i<e.length;++i){var o=e.charCodeAt(i);t=wK(t)^31&o}return t}function IK(e,t,n,r){for(var i=0,o=0,a=(1<<n)-1,s=[],u=0;u<e.length;++u)for(i=i<<t|e[u],o+=t;o>=n;)o-=n,s.push(i>>o&a);if(r)o>0&&s.push(i<<n-o&a);else{if(o>=t)return"Excess padding";if(i<<n-o&a)return"Non-zero padding"}return s}function BK(e){return IK(e,8,5,!0)}function EK(e){var t=IK(e,5,8,!1);if(Array.isArray(t))return t}function CK(e){var t=IK(e,5,8,!1);if(Array.isArray(t))return t;throw new Error(t)}function xK(e){var t;function n(e,n){if(n=n||90,e.length<8)return e+" too short";if(e.length>n)return"Exceeds length limit";var r=e.toLowerCase(),i=e.toUpperCase();if(e!==r&&e!==i)return"Mixed-case string "+e;var o=(e=r).lastIndexOf("1");if(-1===o)return"No separator character for "+e;if(0===o)return"Missing prefix for "+e;var a=e.slice(0,o),s=e.slice(o+1);if(s.length<6)return"Data too short";var u=bK(a);if("string"==typeof u)return u;for(var l=[],A=0;A<s.length;++A){var c=s.charAt(A),h=vK[c];if(void 0===h)return"Unknown character "+c;u=wK(u)^h,A+6>=s.length||l.push(h)}return u!==t?"Invalid checksum for "+e:{prefix:a,words:l}}return t="bech32"===e?1:734539939,{decodeUnsafe:function(e,t){var r=n(e,t);if("object"==i(r))return r},decode:function(e,t){var r=n(e,t);if("object"==i(r))return r;throw new Error(r)},encode:function(e,n,r){if(r=r||90,e.length+7+n.length>r)throw new TypeError("Exceeds length limit");var i=bK(e=e.toLowerCase());if("string"==typeof i)throw new Error(i);for(var o=e+"1",a=0;a<n.length;++a){var s=n[a];if(s>>5!=0)throw new Error("Non 5-bit word");i=wK(i)^s,o+=gK.charAt(s)}for(var u=0;u<6;++u)i=wK(i);i^=t;for(var l=0;l<6;++l)o+=gK.charAt(i>>5*(5-l)&31);return o},toWords:BK,fromWordsUnsafe:EK,fromWords:CK}}pK.bech32=xK("bech32"),pK.bech32m=xK("bech32m"),Object.defineProperty(dK,"__esModule",{value:!0}),dK.p2wpkh=void 0;var kK=WL,SK=EU,QK=kU,_K=OU,NK=_L,DK=pK,FK=QK.OPS,PK=Yo.alloc(0);dK.p2wpkh=function(e,t){if(!(e.address||e.hash||e.output||e.pubkey||e.witness))throw new TypeError("Not enough data");t=Object.assign({validate:!0},t||{}),(0,_K.typeforce)({address:_K.typeforce.maybe(_K.typeforce.String),hash:_K.typeforce.maybe(_K.typeforce.BufferN(20)),input:_K.typeforce.maybe(_K.typeforce.BufferN(0)),network:_K.typeforce.maybe(_K.typeforce.Object),output:_K.typeforce.maybe(_K.typeforce.BufferN(22)),pubkey:_K.typeforce.maybe(_K.isPoint),signature:_K.typeforce.maybe(QK.isCanonicalScriptSignature),witness:_K.typeforce.maybe(_K.typeforce.arrayOf(_K.typeforce.Buffer))},e);var n=NK.value((function(){var t=DK.bech32.decode(e.address),n=t.words.shift(),r=DK.bech32.fromWords(t.words);return{version:n,prefix:t.prefix,data:Yo.from(r)}})),r=e.network||SK.bitcoin,i={name:"p2wpkh",network:r};if(NK.prop(i,"address",(function(){if(i.hash){var e=DK.bech32.toWords(i.hash);return e.unshift(0),DK.bech32.encode(r.bech32,e)}})),NK.prop(i,"hash",(function(){return e.output?e.output.slice(2,22):e.address?n().data:e.pubkey||i.pubkey?kK.hash160(e.pubkey||i.pubkey):void 0})),NK.prop(i,"output",(function(){if(i.hash)return QK.compile([FK.OP_0,i.hash])})),NK.prop(i,"pubkey",(function(){return e.pubkey?e.pubkey:e.witness?e.witness[1]:void 0})),NK.prop(i,"signature",(function(){if(e.witness)return e.witness[0]})),NK.prop(i,"input",(function(){if(i.witness)return PK})),NK.prop(i,"witness",(function(){if(e.pubkey&&e.signature)return[e.signature,e.pubkey]})),t.validate){var o=Yo.from([]);if(e.address){if(r&&r.bech32!==n().prefix)throw new TypeError("Invalid prefix or Network mismatch");if(0!==n().version)throw new TypeError("Invalid address version");if(20!==n().data.length)throw new TypeError("Invalid address data");o=n().data}if(e.hash){if(o.length>0&&!o.equals(e.hash))throw new TypeError("Hash mismatch");o=e.hash}if(e.output){if(22!==e.output.length||e.output[0]!==FK.OP_0||20!==e.output[1])throw new TypeError("Output is invalid");if(o.length>0&&!o.equals(e.output.slice(2)))throw new TypeError("Hash mismatch");o=e.output.slice(2)}if(e.pubkey){var a=kK.hash160(e.pubkey);if(o.length>0&&!o.equals(a))throw new TypeError("Hash mismatch");if(o=a,!(0,_K.isPoint)(e.pubkey)||33!==e.pubkey.length)throw new TypeError("Invalid pubkey for p2wpkh")}if(e.witness){if(2!==e.witness.length)throw new TypeError("Witness is invalid");if(!QK.isCanonicalScriptSignature(e.witness[0]))throw new TypeError("Witness has invalid signature");if(!(0,_K.isPoint)(e.witness[1])||33!==e.witness[1].length)throw new TypeError("Witness has invalid pubkey");if(e.signature&&!e.signature.equals(e.witness[0]))throw new TypeError("Signature mismatch");if(e.pubkey&&!e.pubkey.equals(e.witness[1]))throw new TypeError("Pubkey mismatch");var s=kK.hash160(e.witness[1]);if(o.length>0&&!o.equals(s))throw new TypeError("Hash mismatch")}}return Object.assign(i,e)};var UK={};Object.defineProperty(UK,"__esModule",{value:!0}),UK.p2wsh=void 0;var LK=WL,MK=EU,TK=kU,RK=OU,OK=_L,HK=pK,KK=TK.OPS,jK=Yo.alloc(0);function GK(e){return!(!Na(e)||65!==e.length||4!==e[0]||!(0,RK.isPoint)(e))}UK.p2wsh=function(e,t){if(!(e.address||e.hash||e.output||e.redeem||e.witness))throw new TypeError("Not enough data");t=Object.assign({validate:!0},t||{}),(0,RK.typeforce)({network:RK.typeforce.maybe(RK.typeforce.Object),address:RK.typeforce.maybe(RK.typeforce.String),hash:RK.typeforce.maybe(RK.typeforce.BufferN(32)),output:RK.typeforce.maybe(RK.typeforce.BufferN(34)),redeem:RK.typeforce.maybe({input:RK.typeforce.maybe(RK.typeforce.Buffer),network:RK.typeforce.maybe(RK.typeforce.Object),output:RK.typeforce.maybe(RK.typeforce.Buffer),witness:RK.typeforce.maybe(RK.typeforce.arrayOf(RK.typeforce.Buffer))}),input:RK.typeforce.maybe(RK.typeforce.BufferN(0)),witness:RK.typeforce.maybe(RK.typeforce.arrayOf(RK.typeforce.Buffer))},e);var n=OK.value((function(){var t=HK.bech32.decode(e.address),n=t.words.shift(),r=HK.bech32.fromWords(t.words);return{version:n,prefix:t.prefix,data:Yo.from(r)}})),r=OK.value((function(){return TK.decompile(e.redeem.input)})),i=e.network;i||(i=e.redeem&&e.redeem.network||MK.bitcoin);var o={network:i};if(OK.prop(o,"address",(function(){if(o.hash){var e=HK.bech32.toWords(o.hash);return e.unshift(0),HK.bech32.encode(i.bech32,e)}})),OK.prop(o,"hash",(function(){return e.output?e.output.slice(2):e.address?n().data:o.redeem&&o.redeem.output?LK.sha256(o.redeem.output):void 0})),OK.prop(o,"output",(function(){if(o.hash)return TK.compile([KK.OP_0,o.hash])})),OK.prop(o,"redeem",(function(){if(e.witness)return{output:e.witness[e.witness.length-1],input:jK,witness:e.witness.slice(0,-1)}})),OK.prop(o,"input",(function(){if(o.witness)return jK})),OK.prop(o,"witness",(function(){if(e.redeem&&e.redeem.input&&e.redeem.input.length>0&&e.redeem.output&&e.redeem.output.length>0){var t=TK.toStack(r());return o.redeem=Object.assign({witness:t},e.redeem),o.redeem.input=jK,[].concat(t,e.redeem.output)}if(e.redeem&&e.redeem.output&&e.redeem.witness)return[].concat(e.redeem.witness,e.redeem.output)})),OK.prop(o,"name",(function(){var e=["p2wsh"];return void 0!==o.redeem&&void 0!==o.redeem.name&&e.push(o.redeem.name),e.join("-")})),t.validate){var a=Yo.from([]);if(e.address){if(n().prefix!==i.bech32)throw new TypeError("Invalid prefix or Network mismatch");if(0!==n().version)throw new TypeError("Invalid address version");if(32!==n().data.length)throw new TypeError("Invalid address data");a=n().data}if(e.hash){if(a.length>0&&!a.equals(e.hash))throw new TypeError("Hash mismatch");a=e.hash}if(e.output){if(34!==e.output.length||e.output[0]!==KK.OP_0||32!==e.output[1])throw new TypeError("Output is invalid");var s=e.output.slice(2);if(a.length>0&&!a.equals(s))throw new TypeError("Hash mismatch");a=s}if(e.redeem){if(e.redeem.network&&e.redeem.network!==i)throw new TypeError("Network mismatch");if(e.redeem.input&&e.redeem.input.length>0&&e.redeem.witness&&e.redeem.witness.length>0)throw new TypeError("Ambiguous witness source");if(e.redeem.output){if(0===TK.decompile(e.redeem.output).length)throw new TypeError("Redeem.output is invalid");var u=LK.sha256(e.redeem.output);if(a.length>0&&!a.equals(u))throw new TypeError("Hash mismatch");a=u}if(e.redeem.input&&!TK.isPushOnly(r()))throw new TypeError("Non push-only scriptSig");if(e.witness&&e.redeem.witness&&!function(e,t){return e.length===t.length&&e.every((function(e,n){return e.equals(t[n])}))}(e.witness,e.redeem.witness))throw new TypeError("Witness and redeem.witness mismatch");if(e.redeem.input&&r().some(GK)||e.redeem.output&&(TK.decompile(e.redeem.output)||[]).some(GK))throw new TypeError("redeem.input or redeem.output contains uncompressed pubkey")}if(e.witness&&e.witness.length>0){var l=e.witness[e.witness.length-1];if(e.redeem&&e.redeem.output&&!e.redeem.output.equals(l))throw new TypeError("Witness and redeem.output mismatch");if(e.witness.some(GK)||(TK.decompile(l)||[]).some(GK))throw new TypeError("Witness contains uncompressed pubkey")}}return Object.assign(o,e)},function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.p2wsh=e.p2wpkh=e.p2sh=e.p2pkh=e.p2pk=e.p2ms=e.embed=void 0;var t=xU;Object.defineProperty(e,"embed",{enumerable:!0,get:function(){return t.p2data}});var n=LL;Object.defineProperty(e,"p2ms",{enumerable:!0,get:function(){return n.p2ms}});var r=GL;Object.defineProperty(e,"p2pk",{enumerable:!0,get:function(){return r.p2pk}});var i=XL;Object.defineProperty(e,"p2pkh",{enumerable:!0,get:function(){return i.p2pkh}});var o=aK;Object.defineProperty(e,"p2sh",{enumerable:!0,get:function(){return o.p2sh}});var a=dK;Object.defineProperty(e,"p2wpkh",{enumerable:!0,get:function(){return a.p2wpkh}});var s=UK;Object.defineProperty(e,"p2wsh",{enumerable:!0,get:function(){return s.p2wsh}})}(CU),Object.defineProperty(BU,"__esModule",{value:!0}),BU.toOutputScript=BU.fromOutputScript=BU.toBech32=BU.toBase58Check=BU.fromBech32=BU.fromBase58Check=void 0;var qK=EU,VK=CU,zK=kU,JK=OU,YK=pK,XK=ZH,WK=JK.typeforce,ZK="WARNING: Sending to a future segwit version address can lead to loss of funds. End users MUST be warned carefully in the GUI and asked if they wish to proceed with caution. Wallets should verify the segwit version from the output of fromBech32, then decide when it is safe to use which version of segwit.";function $K(e){var t=XK.decode(e);if(t.length<21)throw new TypeError(e+" is too short");if(t.length>21)throw new TypeError(e+" is too long");return{version:t.readUInt8(0),hash:t.slice(1)}}function ej(e){var t,n;try{t=YK.bech32.decode(e)}catch(e){}if(t){if(0!==(n=t.words[0]))throw new TypeError(e+" uses wrong encoding")}else if(0===(n=(t=YK.bech32m.decode(e)).words[0]))throw new TypeError(e+" uses wrong encoding");var r=YK.bech32.fromWords(t.words.slice(1));return{version:n,prefix:t.prefix,data:Yo.from(r)}}function tj(e,t,n){var r=YK.bech32.toWords(e);return r.unshift(t),0===t?YK.bech32.encode(n,r):YK.bech32m.encode(n,r)}BU.fromBase58Check=$K,BU.fromBech32=ej,BU.toBase58Check=function(e,t){WK(JK.tuple(JK.Hash160bit,JK.UInt8),arguments);var n=Yo.allocUnsafe(21);return n.writeUInt8(t,0),e.copy(n,1),XK.encode(n)},BU.toBech32=tj,BU.fromOutputScript=function(e,t){t=t||qK.bitcoin;try{return VK.p2pkh({output:e,network:t}).address}catch(e){}try{return VK.p2sh({output:e,network:t}).address}catch(e){}try{return VK.p2wpkh({output:e,network:t}).address}catch(e){}try{return VK.p2wsh({output:e,network:t}).address}catch(e){}try{return function(e,t){var n=e.slice(2);if(n.length<2||n.length>40)throw new TypeError("Invalid program length for segwit address");var r=e[0]-80;if(r<1||r>16)throw new TypeError("Invalid version for segwit address");if(e[1]!==n.length)throw new TypeError("Invalid script for segwit address");return console.warn(ZK),tj(n,r,t.bech32)}(e,t)}catch(e){}throw new Error(zK.toASM(e)+" has no matching Address")},BU.toOutputScript=function(e,t){var n,r;t=t||qK.bitcoin;try{n=$K(e)}catch(e){}if(n){if(n.version===t.pubKeyHash)return VK.p2pkh({hash:n.hash}).output;if(n.version===t.scriptHash)return VK.p2sh({hash:n.hash}).output}else{try{r=ej(e)}catch(e){}if(r){if(r.prefix!==t.bech32)throw new Error(e+" has an invalid prefix");if(0===r.version){if(20===r.data.length)return VK.p2wpkh({hash:r.data}).output;if(32===r.data.length)return VK.p2wsh({hash:r.data}).output}else if(r.version>=1&&r.version<=16&&r.data.length>=2&&r.data.length<=40)return console.warn(ZK),zK.compile([r.version+80,r.data])}}throw new Error(e+" has no matching Script")};var nj={},rj={},ij=jN.exports.Buffer;function oj(e){if(e<0||e>9007199254740991||e%1!=0)throw new RangeError("value out of range")}function aj(e){return oj(e),e<253?1:e<=65535?3:e<=4294967295?5:9}var sj={encode:function e(t,n,r){if(oj(t),n||(n=ij.allocUnsafe(aj(t))),!ij.isBuffer(n))throw new TypeError("buffer must be a Buffer instance");return r||(r=0),t<253?(n.writeUInt8(t,r),e.bytes=1):t<=65535?(n.writeUInt8(253,r),n.writeUInt16LE(t,r+1),e.bytes=3):t<=4294967295?(n.writeUInt8(254,r),n.writeUInt32LE(t,r+1),e.bytes=5):(n.writeUInt8(255,r),n.writeUInt32LE(t>>>0,r+1),n.writeUInt32LE(t/4294967296|0,r+5),e.bytes=9),n},decode:function e(t,n){if(!ij.isBuffer(t))throw new TypeError("buffer must be a Buffer instance");n||(n=0);var r=t.readUInt8(n);if(r<253)return e.bytes=1,r;if(253===r)return e.bytes=3,t.readUInt16LE(n+1);if(254===r)return e.bytes=5,t.readUInt32LE(n+1);e.bytes=9;var i=t.readUInt32LE(n+1),o=4294967296*t.readUInt32LE(n+5)+i;return oj(o),o},encodingLength:aj};Object.defineProperty(rj,"__esModule",{value:!0}),rj.BufferReader=rj.BufferWriter=rj.cloneBuffer=rj.reverseBuffer=rj.writeUInt64LE=rj.readUInt64LE=rj.varuint=void 0;var uj=OU,lj=uj.typeforce,Aj=sj;function cj(e,t){if("number"!=typeof e)throw new Error("cannot write a non-number as a number");if(e<0)throw new Error("specified a negative value for writing an unsigned value");if(e>t)throw new Error("RangeError: value out of range");if(Math.floor(e)!==e)throw new Error("value has a fractional component")}function hj(e,t){var n=e.readUInt32LE(t),r=e.readUInt32LE(t+4);return cj((r*=4294967296)+n,9007199254740991),r+n}function fj(e,t,n){return cj(t,9007199254740991),e.writeInt32LE(-1&t,n),e.writeUInt32LE(Math.floor(t/4294967296),n+4),n+8}rj.varuint=Aj,rj.readUInt64LE=hj,rj.writeUInt64LE=fj,rj.reverseBuffer=function(e){if(e.length<1)return e;for(var t=e.length-1,n=0,r=0;r<e.length/2;r++)n=e[r],e[r]=e[t],e[t]=n,t--;return e},rj.cloneBuffer=function(e){var t=Yo.allocUnsafe(e.length);return e.copy(t),t};var dj=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;s(this,e),this.buffer=t,this.offset=n,lj(uj.tuple(uj.Buffer,uj.UInt32),[t,n])}return l(e,[{key:"writeUInt8",value:function(e){this.offset=this.buffer.writeUInt8(e,this.offset)}},{key:"writeInt32",value:function(e){this.offset=this.buffer.writeInt32LE(e,this.offset)}},{key:"writeUInt32",value:function(e){this.offset=this.buffer.writeUInt32LE(e,this.offset)}},{key:"writeUInt64",value:function(e){this.offset=fj(this.buffer,e,this.offset)}},{key:"writeVarInt",value:function(e){Aj.encode(e,this.buffer,this.offset),this.offset+=Aj.encode.bytes}},{key:"writeSlice",value:function(e){if(this.buffer.length<this.offset+e.length)throw new Error("Cannot write slice out of bounds");this.offset+=e.copy(this.buffer,this.offset)}},{key:"writeVarSlice",value:function(e){this.writeVarInt(e.length),this.writeSlice(e)}},{key:"writeVector",value:function(e){var t=this;this.writeVarInt(e.length),e.forEach((function(e){return t.writeVarSlice(e)}))}},{key:"end",value:function(){if(this.buffer.length===this.offset)return this.buffer;throw new Error("buffer size ".concat(this.buffer.length,", offset ").concat(this.offset))}}],[{key:"withCapacity",value:function(t){return new e(Yo.alloc(t))}}]),e}();rj.BufferWriter=dj,rj.BufferReader=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;s(this,e),this.buffer=t,this.offset=n,lj(uj.tuple(uj.Buffer,uj.UInt32),[t,n])}return l(e,[{key:"readUInt8",value:function(){var e=this.buffer.readUInt8(this.offset);return this.offset++,e}},{key:"readInt32",value:function(){var e=this.buffer.readInt32LE(this.offset);return this.offset+=4,e}},{key:"readUInt32",value:function(){var e=this.buffer.readUInt32LE(this.offset);return this.offset+=4,e}},{key:"readUInt64",value:function(){var e=hj(this.buffer,this.offset);return this.offset+=8,e}},{key:"readVarInt",value:function(){var e=Aj.decode(this.buffer,this.offset);return this.offset+=Aj.decode.bytes,e}},{key:"readSlice",value:function(e){if(this.buffer.length<this.offset+e)throw new Error("Cannot read slice out of bounds");var t=this.buffer.slice(this.offset,this.offset+e);return this.offset+=e,t}},{key:"readVarSlice",value:function(){return this.readSlice(this.readVarInt())}},{key:"readVector",value:function(){for(var e=this.readVarInt(),t=[],n=0;n<e;n++)t.push(this.readVarSlice());return t}}]),e}();var pj={};Object.defineProperty(pj,"__esModule",{value:!0}),pj.fastMerkleRoot=void 0,pj.fastMerkleRoot=function(e,t){if(!Array.isArray(e))throw TypeError("Expected values Array");if("function"!=typeof t)throw TypeError("Expected digest Function");for(var n=e.length,r=e.concat();n>1;){for(var i=0,o=0;o<n;o+=2,++i){var a=r[o],s=o+1===n?a:r[o+1],u=Yo.concat([a,s]);r[i]=t(u)}n=i}return r[0]};var gj={};Object.defineProperty(gj,"__esModule",{value:!0}),gj.Transaction=void 0;var vj=rj,yj=WL,mj=kU,wj=kU,bj=OU,Ij=bj.typeforce;function Bj(e){var t=e.length;return vj.varuint.encodingLength(t)+t}var Ej=Yo.allocUnsafe(0),Cj=[],xj=Yo.from("0000000000000000000000000000000000000000000000000000000000000000","hex"),kj=Yo.from("0000000000000000000000000000000000000000000000000000000000000001","hex"),Sj=Yo.from("ffffffffffffffff","hex"),Qj={script:Ej,valueBuffer:Sj},_j=function(){function e(){s(this,e),this.version=1,this.locktime=0,this.ins=[],this.outs=[]}return l(e,[{key:"isCoinbase",value:function(){return 1===this.ins.length&&e.isCoinbaseHash(this.ins[0].hash)}},{key:"addInput",value:function(t,n,r,i){return Ij(bj.tuple(bj.Hash256bit,bj.UInt32,bj.maybe(bj.UInt32),bj.maybe(bj.Buffer)),arguments),bj.Null(r)&&(r=e.DEFAULT_SEQUENCE),this.ins.push({hash:t,index:n,script:i||Ej,sequence:r,witness:Cj})-1}},{key:"addOutput",value:function(e,t){return Ij(bj.tuple(bj.Buffer,bj.Satoshi),arguments),this.outs.push({script:e,value:t})-1}},{key:"hasWitnesses",value:function(){return this.ins.some((function(e){return 0!==e.witness.length}))}},{key:"weight",value:function(){return 3*this.byteLength(!1)+this.byteLength(!0)}},{key:"virtualSize",value:function(){return Math.ceil(this.weight()/4)}},{key:"byteLength",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=e&&this.hasWitnesses();return(t?10:8)+vj.varuint.encodingLength(this.ins.length)+vj.varuint.encodingLength(this.outs.length)+this.ins.reduce((function(e,t){return e+40+Bj(t.script)}),0)+this.outs.reduce((function(e,t){return e+8+Bj(t.script)}),0)+(t?this.ins.reduce((function(e,t){return e+function(e){var t=e.length;return vj.varuint.encodingLength(t)+e.reduce((function(e,t){return e+Bj(t)}),0)}(t.witness)}),0):0)}},{key:"clone",value:function(){var t=new e;return t.version=this.version,t.locktime=this.locktime,t.ins=this.ins.map((function(e){return{hash:e.hash,index:e.index,script:e.script,sequence:e.sequence,witness:e.witness}})),t.outs=this.outs.map((function(e){return{script:e.script,value:e.value}})),t}},{key:"hashForSignature",value:function(t,n,r){if(Ij(bj.tuple(bj.UInt32,bj.Buffer,bj.Number),arguments),t>=this.ins.length)return kj;var i=mj.compile(mj.decompile(n).filter((function(e){return e!==wj.OPS.OP_CODESEPARATOR}))),o=this.clone();if((31&r)===e.SIGHASH_NONE)o.outs=[],o.ins.forEach((function(e,n){n!==t&&(e.sequence=0)}));else if((31&r)===e.SIGHASH_SINGLE){if(t>=this.outs.length)return kj;o.outs.length=t+1;for(var a=0;a<t;a++)o.outs[a]=Qj;o.ins.forEach((function(e,n){n!==t&&(e.sequence=0)}))}r&e.SIGHASH_ANYONECANPAY?(o.ins=[o.ins[t]],o.ins[0].script=i):(o.ins.forEach((function(e){e.script=Ej})),o.ins[t].script=i);var s=Yo.allocUnsafe(o.byteLength(!1)+4);return s.writeInt32LE(r,s.length-4),o.__toBuffer(s,0,!1),yj.hash256(s)}},{key:"hashForWitnessV1",value:function(t,n,r,i,o,a){if(Ij(bj.tuple(bj.UInt32,Ij.arrayOf(bj.Buffer),Ij.arrayOf(bj.Satoshi),bj.UInt32),arguments),r.length!==this.ins.length||n.length!==this.ins.length)throw new Error("Must supply prevout script and value for all inputs");var s=i===e.SIGHASH_DEFAULT?e.SIGHASH_ALL:i&e.SIGHASH_OUTPUT_MASK,u=(i&e.SIGHASH_INPUT_MASK)===e.SIGHASH_ANYONECANPAY,l=s===e.SIGHASH_NONE,A=s===e.SIGHASH_SINGLE,c=Ej,h=Ej,f=Ej,d=Ej,p=Ej;if(!u){var g=vj.BufferWriter.withCapacity(36*this.ins.length);this.ins.forEach((function(e){g.writeSlice(e.hash),g.writeUInt32(e.index)})),c=yj.sha256(g.end()),g=vj.BufferWriter.withCapacity(8*this.ins.length),r.forEach((function(e){return g.writeUInt64(e)})),h=yj.sha256(g.end()),g=vj.BufferWriter.withCapacity(n.map(Bj).reduce((function(e,t){return e+t}))),n.forEach((function(e){return g.writeVarSlice(e)})),f=yj.sha256(g.end()),g=vj.BufferWriter.withCapacity(4*this.ins.length),this.ins.forEach((function(e){return g.writeUInt32(e.sequence)})),d=yj.sha256(g.end())}if(l||A){if(A&&t<this.outs.length){var v=this.outs[t],y=vj.BufferWriter.withCapacity(8+Bj(v.script));y.writeUInt64(v.value),y.writeVarSlice(v.script),p=yj.sha256(y.end())}}else{var m=this.outs.map((function(e){return 8+Bj(e.script)})).reduce((function(e,t){return e+t})),w=vj.BufferWriter.withCapacity(m);this.outs.forEach((function(e){w.writeUInt64(e.value),w.writeVarSlice(e.script)})),p=yj.sha256(w.end())}var b=(o?2:0)+(a?1:0),I=174-(u?49:0)-(l?32:0)+(a?32:0)+(o?37:0),B=vj.BufferWriter.withCapacity(I);if(B.writeUInt8(i),B.writeInt32(this.version),B.writeUInt32(this.locktime),B.writeSlice(c),B.writeSlice(h),B.writeSlice(f),B.writeSlice(d),l||A||B.writeSlice(p),B.writeUInt8(b),u){var E=this.ins[t];B.writeSlice(E.hash),B.writeUInt32(E.index),B.writeUInt64(r[t]),B.writeVarSlice(n[t]),B.writeUInt32(E.sequence)}else B.writeUInt32(t);if(a){var C=vj.BufferWriter.withCapacity(Bj(a));C.writeVarSlice(a),B.writeSlice(yj.sha256(C.end()))}return A&&B.writeSlice(p),o&&(B.writeSlice(o),B.writeUInt8(0),B.writeUInt32(4294967295)),yj.taggedHash("TapSighash",Yo.concat([Yo.of(0),B.end()]))}},{key:"hashForWitnessV0",value:function(t,n,r,i){Ij(bj.tuple(bj.UInt32,bj.Buffer,bj.Satoshi,bj.UInt32),arguments);var o,a=Yo.from([]),s=xj,u=xj,l=xj;if(i&e.SIGHASH_ANYONECANPAY||(a=Yo.allocUnsafe(36*this.ins.length),o=new vj.BufferWriter(a,0),this.ins.forEach((function(e){o.writeSlice(e.hash),o.writeUInt32(e.index)})),u=yj.hash256(a)),i&e.SIGHASH_ANYONECANPAY||(31&i)===e.SIGHASH_SINGLE||(31&i)===e.SIGHASH_NONE||(a=Yo.allocUnsafe(4*this.ins.length),o=new vj.BufferWriter(a,0),this.ins.forEach((function(e){o.writeUInt32(e.sequence)})),l=yj.hash256(a)),(31&i)!==e.SIGHASH_SINGLE&&(31&i)!==e.SIGHASH_NONE){var A=this.outs.reduce((function(e,t){return e+8+Bj(t.script)}),0);a=Yo.allocUnsafe(A),o=new vj.BufferWriter(a,0),this.outs.forEach((function(e){o.writeUInt64(e.value),o.writeVarSlice(e.script)})),s=yj.hash256(a)}else if((31&i)===e.SIGHASH_SINGLE&&t<this.outs.length){var c=this.outs[t];a=Yo.allocUnsafe(8+Bj(c.script)),(o=new vj.BufferWriter(a,0)).writeUInt64(c.value),o.writeVarSlice(c.script),s=yj.hash256(a)}a=Yo.allocUnsafe(156+Bj(n)),o=new vj.BufferWriter(a,0);var h=this.ins[t];return o.writeInt32(this.version),o.writeSlice(u),o.writeSlice(l),o.writeSlice(h.hash),o.writeUInt32(h.index),o.writeVarSlice(n),o.writeUInt64(r),o.writeUInt32(h.sequence),o.writeSlice(s),o.writeUInt32(this.locktime),o.writeUInt32(i),yj.hash256(a)}},{key:"getHash",value:function(e){return e&&this.isCoinbase()?Yo.alloc(32,0):yj.hash256(this.__toBuffer(void 0,void 0,e))}},{key:"getId",value:function(){return(0,vj.reverseBuffer)(this.getHash(!1)).toString("hex")}},{key:"toBuffer",value:function(e,t){return this.__toBuffer(e,t,!0)}},{key:"toHex",value:function(){return this.toBuffer(void 0,void 0).toString("hex")}},{key:"setInputScript",value:function(e,t){Ij(bj.tuple(bj.Number,bj.Buffer),arguments),this.ins[e].script=t}},{key:"setWitness",value:function(e,t){Ij(bj.tuple(bj.Number,[bj.Buffer]),arguments),this.ins[e].witness=t}},{key:"__toBuffer",value:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];t||(t=Yo.allocUnsafe(this.byteLength(r)));var i=new vj.BufferWriter(t,n||0);i.writeInt32(this.version);var o=r&&this.hasWitnesses();return o&&(i.writeUInt8(e.ADVANCED_TRANSACTION_MARKER),i.writeUInt8(e.ADVANCED_TRANSACTION_FLAG)),i.writeVarInt(this.ins.length),this.ins.forEach((function(e){i.writeSlice(e.hash),i.writeUInt32(e.index),i.writeVarSlice(e.script),i.writeUInt32(e.sequence)})),i.writeVarInt(this.outs.length),this.outs.forEach((function(e){void 0!==e.value?i.writeUInt64(e.value):i.writeSlice(e.valueBuffer),i.writeVarSlice(e.script)})),o&&this.ins.forEach((function(e){i.writeVector(e.witness)})),i.writeUInt32(this.locktime),void 0!==n?t.slice(n,i.offset):t}}],[{key:"fromBuffer",value:function(t,n){var r=new vj.BufferReader(t),i=new e;i.version=r.readInt32();var o=r.readUInt8(),a=r.readUInt8(),s=!1;o===e.ADVANCED_TRANSACTION_MARKER&&a===e.ADVANCED_TRANSACTION_FLAG?s=!0:r.offset-=2;for(var u=r.readVarInt(),l=0;l<u;++l)i.ins.push({hash:r.readSlice(32),index:r.readUInt32(),script:r.readVarSlice(),sequence:r.readUInt32(),witness:Cj});for(var A=r.readVarInt(),c=0;c<A;++c)i.outs.push({value:r.readUInt64(),script:r.readVarSlice()});if(s){for(var h=0;h<u;++h)i.ins[h].witness=r.readVector();if(!i.hasWitnesses())throw new Error("Transaction has superfluous witness data")}if(i.locktime=r.readUInt32(),n)return i;if(r.offset!==t.length)throw new Error("Transaction has unexpected data");return i}},{key:"fromHex",value:function(t){return e.fromBuffer(Yo.from(t,"hex"),!1)}},{key:"isCoinbaseHash",value:function(e){Ij(bj.Hash256bit,e);for(var t=0;t<32;++t)if(0!==e[t])return!1;return!0}}]),e}();gj.Transaction=_j,_j.DEFAULT_SEQUENCE=4294967295,_j.SIGHASH_DEFAULT=0,_j.SIGHASH_ALL=1,_j.SIGHASH_NONE=2,_j.SIGHASH_SINGLE=3,_j.SIGHASH_ANYONECANPAY=128,_j.SIGHASH_OUTPUT_MASK=3,_j.SIGHASH_INPUT_MASK=128,_j.ADVANCED_TRANSACTION_MARKER=0,_j.ADVANCED_TRANSACTION_FLAG=1,Object.defineProperty(nj,"__esModule",{value:!0}),nj.Block=void 0;var Nj=rj,Dj=WL,Fj=pj,Pj=gj,Uj=OU,Lj=Uj.typeforce,Mj=new TypeError("Cannot compute merkle root for zero transactions"),Tj=new TypeError("Cannot compute witness commit for non-segwit block"),Rj=function(){function e(){s(this,e),this.version=1,this.prevHash=void 0,this.merkleRoot=void 0,this.timestamp=0,this.witnessCommit=void 0,this.bits=0,this.nonce=0,this.transactions=void 0}return l(e,[{key:"getWitnessCommit",value:function(){if(!Oj(this.transactions))return null;var e=this.transactions[0].outs.filter((function(e){return e.script.slice(0,6).equals(Yo.from("6a24aa21a9ed","hex"))})).map((function(e){return e.script.slice(6,38)}));if(0===e.length)return null;var t=e[e.length-1];return t instanceof Yo&&32===t.length?t:null}},{key:"hasWitnessCommit",value:function(){return this.witnessCommit instanceof Yo&&32===this.witnessCommit.length||null!==this.getWitnessCommit()}},{key:"hasWitness",value:function(){return(e=this.transactions)instanceof Array&&e.some((function(e){return"object"==i(e)&&e.ins instanceof Array&&e.ins.some((function(e){return"object"==i(e)&&e.witness instanceof Array&&e.witness.length>0}))}));var e}},{key:"weight",value:function(){return 3*this.byteLength(!1,!1)+this.byteLength(!1,!0)}},{key:"byteLength",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return e||!this.transactions?80:80+Nj.varuint.encodingLength(this.transactions.length)+this.transactions.reduce((function(e,n){return e+n.byteLength(t)}),0)}},{key:"getHash",value:function(){return Dj.hash256(this.toBuffer(!0))}},{key:"getId",value:function(){return(0,Nj.reverseBuffer)(this.getHash()).toString("hex")}},{key:"getUTCDate",value:function(){var e=new Date(0);return e.setUTCSeconds(this.timestamp),e}},{key:"toBuffer",value:function(e){var t=Yo.allocUnsafe(this.byteLength(e)),n=new Nj.BufferWriter(t);return n.writeInt32(this.version),n.writeSlice(this.prevHash),n.writeSlice(this.merkleRoot),n.writeUInt32(this.timestamp),n.writeUInt32(this.bits),n.writeUInt32(this.nonce),e||!this.transactions||(Nj.varuint.encode(this.transactions.length,t,n.offset),n.offset+=Nj.varuint.encode.bytes,this.transactions.forEach((function(e){var r=e.byteLength();e.toBuffer(t,n.offset),n.offset+=r}))),t}},{key:"toHex",value:function(e){return this.toBuffer(e).toString("hex")}},{key:"checkTxRoots",value:function(){var e=this.hasWitnessCommit();return!(!e&&this.hasWitness())&&this.__checkMerkleRoot()&&(!e||this.__checkWitnessCommit())}},{key:"checkProofOfWork",value:function(){var t=(0,Nj.reverseBuffer)(this.getHash()),n=e.calculateTarget(this.bits);return t.compare(n)<=0}},{key:"__checkMerkleRoot",value:function(){if(!this.transactions)throw Mj;var t=e.calculateMerkleRoot(this.transactions);return 0===this.merkleRoot.compare(t)}},{key:"__checkWitnessCommit",value:function(){if(!this.transactions)throw Mj;if(!this.hasWitnessCommit())throw Tj;var t=e.calculateMerkleRoot(this.transactions,!0);return 0===this.witnessCommit.compare(t)}}],[{key:"fromBuffer",value:function(t){if(t.length<80)throw new Error("Buffer too small (< 80 bytes)");var n=new Nj.BufferReader(t),r=new e;if(r.version=n.readInt32(),r.prevHash=n.readSlice(32),r.merkleRoot=n.readSlice(32),r.timestamp=n.readUInt32(),r.bits=n.readUInt32(),r.nonce=n.readUInt32(),80===t.length)return r;var i=function(){var e=Pj.Transaction.fromBuffer(n.buffer.slice(n.offset),!0);return n.offset+=e.byteLength(),e},o=n.readVarInt();r.transactions=[];for(var a=0;a<o;++a){var s=i();r.transactions.push(s)}var u=r.getWitnessCommit();return u&&(r.witnessCommit=u),r}},{key:"fromHex",value:function(t){return e.fromBuffer(Yo.from(t,"hex"))}},{key:"calculateTarget",value:function(e){var t=((4278190080&e)>>24)-3,n=8388607&e,r=Yo.alloc(32,0);return r.writeUIntBE(n,29-t,3),r}},{key:"calculateMerkleRoot",value:function(e,t){if(Lj([{getHash:Uj.Function}],e),0===e.length)throw Mj;if(t&&!Oj(e))throw Tj;var n=e.map((function(e){return e.getHash(t)})),r=(0,Fj.fastMerkleRoot)(n,Dj.hash256);return t?Dj.hash256(Yo.concat([r,e[0].ins[0].witness[0]])):r}}]),e}();function Oj(e){return e instanceof Array&&e[0]&&e[0].ins&&e[0].ins instanceof Array&&e[0].ins[0]&&e[0].ins[0].witness&&e[0].ins[0].witness instanceof Array&&e[0].ins[0].witness.length>0}nj.Block=Rj;var Hj={},Kj={},jj={},Gj={},qj={},Vj={},zj={};!function(e){var t,n,r;Object.defineProperty(e,"__esModule",{value:!0}),(t=e.GlobalTypes||(e.GlobalTypes={}))[t.UNSIGNED_TX=0]="UNSIGNED_TX",t[t.GLOBAL_XPUB=1]="GLOBAL_XPUB",e.GLOBAL_TYPE_NAMES=["unsignedTx","globalXpub"],(n=e.InputTypes||(e.InputTypes={}))[n.NON_WITNESS_UTXO=0]="NON_WITNESS_UTXO",n[n.WITNESS_UTXO=1]="WITNESS_UTXO",n[n.PARTIAL_SIG=2]="PARTIAL_SIG",n[n.SIGHASH_TYPE=3]="SIGHASH_TYPE",n[n.REDEEM_SCRIPT=4]="REDEEM_SCRIPT",n[n.WITNESS_SCRIPT=5]="WITNESS_SCRIPT",n[n.BIP32_DERIVATION=6]="BIP32_DERIVATION",n[n.FINAL_SCRIPTSIG=7]="FINAL_SCRIPTSIG",n[n.FINAL_SCRIPTWITNESS=8]="FINAL_SCRIPTWITNESS",n[n.POR_COMMITMENT=9]="POR_COMMITMENT",n[n.TAP_KEY_SIG=19]="TAP_KEY_SIG",n[n.TAP_SCRIPT_SIG=20]="TAP_SCRIPT_SIG",n[n.TAP_LEAF_SCRIPT=21]="TAP_LEAF_SCRIPT",n[n.TAP_BIP32_DERIVATION=22]="TAP_BIP32_DERIVATION",n[n.TAP_INTERNAL_KEY=23]="TAP_INTERNAL_KEY",n[n.TAP_MERKLE_ROOT=24]="TAP_MERKLE_ROOT",e.INPUT_TYPE_NAMES=["nonWitnessUtxo","witnessUtxo","partialSig","sighashType","redeemScript","witnessScript","bip32Derivation","finalScriptSig","finalScriptWitness","porCommitment","tapKeySig","tapScriptSig","tapLeafScript","tapBip32Derivation","tapInternalKey","tapMerkleRoot"],(r=e.OutputTypes||(e.OutputTypes={}))[r.REDEEM_SCRIPT=0]="REDEEM_SCRIPT",r[r.WITNESS_SCRIPT=1]="WITNESS_SCRIPT",r[r.BIP32_DERIVATION=2]="BIP32_DERIVATION",r[r.TAP_INTERNAL_KEY=5]="TAP_INTERNAL_KEY",r[r.TAP_TREE=6]="TAP_TREE",r[r.TAP_BIP32_DERIVATION=7]="TAP_BIP32_DERIVATION",e.OUTPUT_TYPE_NAMES=["redeemScript","witnessScript","bip32Derivation","tapInternalKey","tapTree","tapBip32Derivation"]}(zj);var Jj={};Object.defineProperty(Jj,"__esModule",{value:!0});var Yj=zj;Jj.decode=function(e){if(e.key[0]!==Yj.GlobalTypes.GLOBAL_XPUB)throw new Error("Decode Error: could not decode globalXpub with key 0x"+e.key.toString("hex"));if(79!==e.key.length||![2,3].includes(e.key[46]))throw new Error("Decode Error: globalXpub has invalid extended pubkey in key 0x"+e.key.toString("hex"));if(e.value.length/4%1!=0)throw new Error("Decode Error: Global GLOBAL_XPUB value length should be multiple of 4");for(var t,n=e.key.slice(1),r={masterFingerprint:e.value.slice(0,4),extendedPubkey:n,path:"m"},i=0,o=(t=e.value.length/4-1,k(Array(t).keys()));i<o.length;i++){var a=o[i],s=e.value.readUInt32LE(4*a+4),u=!!(2147483648&s),l=2147483647&s;r.path+="/"+l.toString(10)+(u?"'":"")}return r},Jj.encode=function(e){var t=Yo.from([Yj.GlobalTypes.GLOBAL_XPUB]),n=Yo.concat([t,e.extendedPubkey]),r=e.path.split("/"),i=Yo.allocUnsafe(4*r.length);e.masterFingerprint.copy(i,0);var o=4;return r.slice(1).forEach((function(e){var t="'"===e.slice(-1),n=2147483647&parseInt(t?e.slice(0,-1):e,10);t&&(n+=2147483648),i.writeUInt32LE(n,o),o+=4})),{key:n,value:i}},Jj.expected="{ masterFingerprint: Buffer; extendedPubkey: Buffer; path: string; }",Jj.check=function(e){var t=e.extendedPubkey,n=e.masterFingerprint,r=e.path;return Na(t)&&78===t.length&&[2,3].indexOf(t[45])>-1&&Na(n)&&4===n.length&&"string"==typeof r&&!!r.match(/^m(\/\d+'?)*$/)},Jj.canAddToArray=function(e,t,n){var r=t.extendedPubkey.toString("hex");return!n.has(r)&&(n.add(r),0===e.filter((function(e){return e.extendedPubkey.equals(t.extendedPubkey)})).length)};var Xj={};Object.defineProperty(Xj,"__esModule",{value:!0});var Wj=zj;Xj.encode=function(e){return{key:Yo.from([Wj.GlobalTypes.UNSIGNED_TX]),value:e.toBuffer()}};var Zj={};Object.defineProperty(Zj,"__esModule",{value:!0});var $j=zj;Zj.decode=function(e){if(e.key[0]!==$j.InputTypes.FINAL_SCRIPTSIG)throw new Error("Decode Error: could not decode finalScriptSig with key 0x"+e.key.toString("hex"));return e.value},Zj.encode=function(e){return{key:Yo.from([$j.InputTypes.FINAL_SCRIPTSIG]),value:e}},Zj.expected="Buffer",Zj.check=function(e){return Na(e)},Zj.canAdd=function(e,t){return!!e&&!!t&&void 0===e.finalScriptSig};var eG={};Object.defineProperty(eG,"__esModule",{value:!0});var tG=zj;eG.decode=function(e){if(e.key[0]!==tG.InputTypes.FINAL_SCRIPTWITNESS)throw new Error("Decode Error: could not decode finalScriptWitness with key 0x"+e.key.toString("hex"));return e.value},eG.encode=function(e){return{key:Yo.from([tG.InputTypes.FINAL_SCRIPTWITNESS]),value:e}},eG.expected="Buffer",eG.check=function(e){return Na(e)},eG.canAdd=function(e,t){return!!e&&!!t&&void 0===e.finalScriptWitness};var nG={};Object.defineProperty(nG,"__esModule",{value:!0});var rG=zj;nG.decode=function(e){if(e.key[0]!==rG.InputTypes.NON_WITNESS_UTXO)throw new Error("Decode Error: could not decode nonWitnessUtxo with key 0x"+e.key.toString("hex"));return e.value},nG.encode=function(e){return{key:Yo.from([rG.InputTypes.NON_WITNESS_UTXO]),value:e}},nG.expected="Buffer",nG.check=function(e){return Na(e)},nG.canAdd=function(e,t){return!!e&&!!t&&void 0===e.nonWitnessUtxo};var iG={};Object.defineProperty(iG,"__esModule",{value:!0});var oG=zj;iG.decode=function(e){if(e.key[0]!==oG.InputTypes.PARTIAL_SIG)throw new Error("Decode Error: could not decode partialSig with key 0x"+e.key.toString("hex"));if(34!==e.key.length&&66!==e.key.length||![2,3,4].includes(e.key[1]))throw new Error("Decode Error: partialSig has invalid pubkey in key 0x"+e.key.toString("hex"));return{pubkey:e.key.slice(1),signature:e.value}},iG.encode=function(e){var t=Yo.from([oG.InputTypes.PARTIAL_SIG]);return{key:Yo.concat([t,e.pubkey]),value:e.signature}},iG.expected="{ pubkey: Buffer; signature: Buffer; }",iG.check=function(e){return Na(e.pubkey)&&Na(e.signature)&&[33,65].includes(e.pubkey.length)&&[2,3,4].includes(e.pubkey[0])&&function(e){if(!Na(e)||e.length<9)return!1;if(48!==e[0])return!1;if(e.length!==e[1]+3)return!1;if(2!==e[2])return!1;var t=e[3];if(t>33||t<1)return!1;if(2!==e[3+t+1])return!1;var n=e[3+t+2];return!(n>33||n<1)&&e.length===3+t+2+n+2}(e.signature)},iG.canAddToArray=function(e,t,n){var r=t.pubkey.toString("hex");return!n.has(r)&&(n.add(r),0===e.filter((function(e){return e.pubkey.equals(t.pubkey)})).length)};var aG={};Object.defineProperty(aG,"__esModule",{value:!0});var sG=zj;aG.decode=function(e){if(e.key[0]!==sG.InputTypes.POR_COMMITMENT)throw new Error("Decode Error: could not decode porCommitment with key 0x"+e.key.toString("hex"));return e.value.toString("utf8")},aG.encode=function(e){return{key:Yo.from([sG.InputTypes.POR_COMMITMENT]),value:Yo.from(e,"utf8")}},aG.expected="string",aG.check=function(e){return"string"==typeof e},aG.canAdd=function(e,t){return!!e&&!!t&&void 0===e.porCommitment};var uG={};Object.defineProperty(uG,"__esModule",{value:!0});var lG=zj;uG.decode=function(e){if(e.key[0]!==lG.InputTypes.SIGHASH_TYPE)throw new Error("Decode Error: could not decode sighashType with key 0x"+e.key.toString("hex"));return e.value.readUInt32LE(0)},uG.encode=function(e){var t=Yo.from([lG.InputTypes.SIGHASH_TYPE]),n=Yo.allocUnsafe(4);return n.writeUInt32LE(e,0),{key:t,value:n}},uG.expected="number",uG.check=function(e){return"number"==typeof e},uG.canAdd=function(e,t){return!!e&&!!t&&void 0===e.sighashType};var AG={};Object.defineProperty(AG,"__esModule",{value:!0});var cG=zj;function hG(e){return Na(e)&&(64===e.length||65===e.length)}AG.decode=function(e){if(e.key[0]!==cG.InputTypes.TAP_KEY_SIG||1!==e.key.length)throw new Error("Decode Error: could not decode tapKeySig with key 0x"+e.key.toString("hex"));if(!hG(e.value))throw new Error("Decode Error: tapKeySig not a valid 64-65-byte BIP340 signature");return e.value},AG.encode=function(e){return{key:Yo.from([cG.InputTypes.TAP_KEY_SIG]),value:e}},AG.expected="Buffer",AG.check=hG,AG.canAdd=function(e,t){return!!e&&!!t&&void 0===e.tapKeySig};var fG={};Object.defineProperty(fG,"__esModule",{value:!0});var dG=zj;fG.decode=function(e){if(e.key[0]!==dG.InputTypes.TAP_LEAF_SCRIPT)throw new Error("Decode Error: could not decode tapLeafScript with key 0x"+e.key.toString("hex"));if((e.key.length-2)%32!=0)throw new Error("Decode Error: tapLeafScript has invalid control block in key 0x"+e.key.toString("hex"));var t=e.value[e.value.length-1];if((254&e.key[1])!==t)throw new Error("Decode Error: tapLeafScript bad leaf version in key 0x"+e.key.toString("hex"));var n=e.value.slice(0,-1);return{controlBlock:e.key.slice(1),script:n,leafVersion:t}},fG.encode=function(e){var t=Yo.from([dG.InputTypes.TAP_LEAF_SCRIPT]),n=Yo.from([e.leafVersion]);return{key:Yo.concat([t,e.controlBlock]),value:Yo.concat([e.script,n])}},fG.expected="{ controlBlock: Buffer; leafVersion: number, script: Buffer; }",fG.check=function(e){return Na(e.controlBlock)&&(e.controlBlock.length-1)%32==0&&(254&e.controlBlock[0])===e.leafVersion&&Na(e.script)},fG.canAddToArray=function(e,t,n){var r=t.controlBlock.toString("hex");return!n.has(r)&&(n.add(r),0===e.filter((function(e){return e.controlBlock.equals(t.controlBlock)})).length)};var pG={};Object.defineProperty(pG,"__esModule",{value:!0});var gG=zj;function vG(e){return Na(e)&&32===e.length}pG.decode=function(e){if(e.key[0]!==gG.InputTypes.TAP_MERKLE_ROOT||1!==e.key.length)throw new Error("Decode Error: could not decode tapMerkleRoot with key 0x"+e.key.toString("hex"));if(!vG(e.value))throw new Error("Decode Error: tapMerkleRoot not a 32-byte hash");return e.value},pG.encode=function(e){return{key:Yo.from([gG.InputTypes.TAP_MERKLE_ROOT]),value:e}},pG.expected="Buffer",pG.check=vG,pG.canAdd=function(e,t){return!!e&&!!t&&void 0===e.tapMerkleRoot};var yG={};Object.defineProperty(yG,"__esModule",{value:!0});var mG=zj;yG.decode=function(e){if(e.key[0]!==mG.InputTypes.TAP_SCRIPT_SIG)throw new Error("Decode Error: could not decode tapScriptSig with key 0x"+e.key.toString("hex"));if(65!==e.key.length)throw new Error("Decode Error: tapScriptSig has invalid key 0x"+e.key.toString("hex"));if(64!==e.value.length&&65!==e.value.length)throw new Error("Decode Error: tapScriptSig has invalid signature in key 0x"+e.key.toString("hex"));return{pubkey:e.key.slice(1,33),leafHash:e.key.slice(33),signature:e.value}},yG.encode=function(e){var t=Yo.from([mG.InputTypes.TAP_SCRIPT_SIG]);return{key:Yo.concat([t,e.pubkey,e.leafHash]),value:e.signature}},yG.expected="{ pubkey: Buffer; leafHash: Buffer; signature: Buffer; }",yG.check=function(e){return Na(e.pubkey)&&Na(e.leafHash)&&Na(e.signature)&&32===e.pubkey.length&&32===e.leafHash.length&&(64===e.signature.length||65===e.signature.length)},yG.canAddToArray=function(e,t,n){var r=t.pubkey.toString("hex")+t.leafHash.toString("hex");return!n.has(r)&&(n.add(r),0===e.filter((function(e){return e.pubkey.equals(t.pubkey)&&e.leafHash.equals(t.leafHash)})).length)};var wG={},bG={},IG={};function BG(e){if(e<0||e>9007199254740991||e%1!=0)throw new RangeError("value out of range")}function EG(e){return BG(e),e<253?1:e<=65535?3:e<=4294967295?5:9}Object.defineProperty(IG,"__esModule",{value:!0}),IG.encode=function e(t,n,r){if(BG(t),n||(n=Yo.allocUnsafe(EG(t))),!Na(n))throw new TypeError("buffer must be a Buffer instance");return r||(r=0),t<253?(n.writeUInt8(t,r),Object.assign(e,{bytes:1})):t<=65535?(n.writeUInt8(253,r),n.writeUInt16LE(t,r+1),Object.assign(e,{bytes:3})):t<=4294967295?(n.writeUInt8(254,r),n.writeUInt32LE(t,r+1),Object.assign(e,{bytes:5})):(n.writeUInt8(255,r),n.writeUInt32LE(t>>>0,r+1),n.writeUInt32LE(t/4294967296|0,r+5),Object.assign(e,{bytes:9})),n},IG.decode=function e(t,n){if(!Na(t))throw new TypeError("buffer must be a Buffer instance");n||(n=0);var r=t.readUInt8(n);if(r<253)return Object.assign(e,{bytes:1}),r;if(253===r)return Object.assign(e,{bytes:3}),t.readUInt16LE(n+1);if(254===r)return Object.assign(e,{bytes:5}),t.readUInt32LE(n+1);Object.assign(e,{bytes:9});var i=t.readUInt32LE(n+1),o=4294967296*t.readUInt32LE(n+5)+i;return BG(o),o},IG.encodingLength=EG,Object.defineProperty(bG,"__esModule",{value:!0});var CG=IG;function xG(e){var t=e.key.length,n=e.value.length,r=CG.encodingLength(t),i=CG.encodingLength(n),o=Yo.allocUnsafe(r+t+i+n);return CG.encode(t,o,0),e.key.copy(o,r),CG.encode(n,o,r+t),e.value.copy(o,r+t+i),o}function kG(e,t){if("number"!=typeof e)throw new Error("cannot write a non-number as a number");if(e<0)throw new Error("specified a negative value for writing an unsigned value");if(e>t)throw new Error("RangeError: value out of range");if(Math.floor(e)!==e)throw new Error("value has a fractional component")}bG.range=function(e){return k(Array(e).keys())},bG.reverseBuffer=function(e){if(e.length<1)return e;for(var t=e.length-1,n=0,r=0;r<e.length/2;r++)n=e[r],e[r]=e[t],e[t]=n,t--;return e},bG.keyValsToBuffer=function(e){var t=e.map(xG);return t.push(Yo.from([0])),Yo.concat(t)},bG.keyValToBuffer=xG,bG.readUInt64LE=function(e,t){var n=e.readUInt32LE(t),r=e.readUInt32LE(t+4);return kG((r*=4294967296)+n,9007199254740991),r+n},bG.writeUInt64LE=function(e,t,n){return kG(t,9007199254740991),e.writeInt32LE(-1&t,n),e.writeUInt32LE(Math.floor(t/4294967296),n+4),n+8},Object.defineProperty(wG,"__esModule",{value:!0});var SG=zj,QG=bG,_G=IG;wG.decode=function(e){if(e.key[0]!==SG.InputTypes.WITNESS_UTXO)throw new Error("Decode Error: could not decode witnessUtxo with key 0x"+e.key.toString("hex"));var t=QG.readUInt64LE(e.value,0),n=8,r=_G.decode(e.value,n);n+=_G.encodingLength(r);var i=e.value.slice(n);if(i.length!==r)throw new Error("Decode Error: WITNESS_UTXO script is not proper length");return{script:i,value:t}},wG.encode=function(e){var t=e.script,n=e.value,r=_G.encodingLength(t.length),i=Yo.allocUnsafe(8+r+t.length);return QG.writeUInt64LE(i,n,0),_G.encode(t.length,i,8),t.copy(i,8+r),{key:Yo.from([SG.InputTypes.WITNESS_UTXO]),value:i}},wG.expected="{ script: Buffer; value: number; }",wG.check=function(e){return Na(e.script)&&"number"==typeof e.value},wG.canAdd=function(e,t){return!!e&&!!t&&void 0===e.witnessUtxo};var NG={};Object.defineProperty(NG,"__esModule",{value:!0});var DG=zj,FG=IG;NG.decode=function(e){if(e.key[0]!==DG.OutputTypes.TAP_TREE||1!==e.key.length)throw new Error("Decode Error: could not decode tapTree with key 0x"+e.key.toString("hex"));for(var t=0,n=[];t<e.value.length;){var r=e.value[t++],i=e.value[t++],o=FG.decode(e.value,t);t+=FG.encodingLength(o),n.push({depth:r,leafVersion:i,script:e.value.slice(t,t+o)}),t+=o}return{leaves:n}},NG.encode=function(e){var t,n=Yo.from([DG.OutputTypes.TAP_TREE]),r=(t=[]).concat.apply(t,k(e.leaves.map((function(e){return[Yo.of(e.depth,e.leafVersion),FG.encode(e.script.length),e.script]}))));return{key:n,value:Yo.concat(r)}},NG.expected="{ leaves: [{ depth: number; leafVersion: number, script: Buffer; }] }",NG.check=function(e){return Array.isArray(e.leaves)&&e.leaves.every((function(e){return e.depth>=0&&e.depth<=128&&(254&e.leafVersion)===e.leafVersion&&Na(e.script)}))},NG.canAdd=function(e,t){return!!e&&!!t&&void 0===e.tapTree};var PG={};Object.defineProperty(PG,"__esModule",{value:!0});var UG=function(e){return 33===e.length&&[2,3].includes(e[0])||65===e.length&&4===e[0]};PG.makeConverter=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:UG;return{decode:function(n){if(n.key[0]!==e)throw new Error("Decode Error: could not decode bip32Derivation with key 0x"+n.key.toString("hex"));var r=n.key.slice(1);if(!t(r))throw new Error("Decode Error: bip32Derivation has invalid pubkey in key 0x"+n.key.toString("hex"));if(n.value.length/4%1!=0)throw new Error("Decode Error: Input BIP32_DERIVATION value length should be multiple of 4");for(var i,o={masterFingerprint:n.value.slice(0,4),pubkey:r,path:"m"},a=0,s=(i=n.value.length/4-1,k(Array(i).keys()));a<s.length;a++){var u=s[a],l=n.value.readUInt32LE(4*u+4),A=!!(2147483648&l),c=2147483647&l;o.path+="/"+c.toString(10)+(A?"'":"")}return o},encode:function(t){var n=Yo.from([e]),r=Yo.concat([n,t.pubkey]),i=t.path.split("/"),o=Yo.allocUnsafe(4*i.length);t.masterFingerprint.copy(o,0);var a=4;return i.slice(1).forEach((function(e){var t="'"===e.slice(-1),n=2147483647&parseInt(t?e.slice(0,-1):e,10);t&&(n+=2147483648),o.writeUInt32LE(n,a),a+=4})),{key:r,value:o}},check:function(e){return Na(e.pubkey)&&Na(e.masterFingerprint)&&"string"==typeof e.path&&t(e.pubkey)&&4===e.masterFingerprint.length},expected:"{ masterFingerprint: Buffer; pubkey: Buffer; path: string; }",canAddToArray:function(e,t,n){var r=t.pubkey.toString("hex");return!n.has(r)&&(n.add(r),0===e.filter((function(e){return e.pubkey.equals(t.pubkey)})).length)}}};var LG={};Object.defineProperty(LG,"__esModule",{value:!0}),LG.makeChecker=function(e){return function(t){var n;if(e.includes(t.key[0])&&(33!==(n=t.key.slice(1)).length&&65!==n.length||![2,3,4].includes(n[0])))throw new Error("Format Error: invalid pubkey in key 0x"+t.key.toString("hex"));return n}};var MG={};Object.defineProperty(MG,"__esModule",{value:!0}),MG.makeConverter=function(e){return{decode:function(t){if(t.key[0]!==e)throw new Error("Decode Error: could not decode redeemScript with key 0x"+t.key.toString("hex"));return t.value},encode:function(t){return{key:Yo.from([e]),value:t}},check:function(e){return Na(e)},expected:"Buffer",canAdd:function(e,t){return!!e&&!!t&&void 0===e.redeemScript}}};var TG={};Object.defineProperty(TG,"__esModule",{value:!0});var RG=IG,OG=PG,HG=function(e){return 32===e.length};TG.makeConverter=function(e){var t=OG.makeConverter(e,HG);return{decode:function(e){for(var n=RG.decode(e.value),r=RG.encodingLength(n),i=t.decode({key:e.key,value:e.value.slice(r+32*n)}),o=new Array(n),a=0,s=r;a<n;a++,s+=32)o[a]=e.value.slice(s,s+32);return Object.assign({},i,{leafHashes:o})},encode:function(e){var n=t.encode(e),r=RG.encodingLength(e.leafHashes.length),i=Yo.allocUnsafe(r);RG.encode(e.leafHashes.length,i);var o=Yo.concat([i].concat(k(e.leafHashes),[n.value]));return Object.assign({},n,{value:o})},check:function(e){return Array.isArray(e.leafHashes)&&e.leafHashes.every((function(e){return Na(e)&&32===e.length}))&&t.check(e)},expected:"{ masterFingerprint: Buffer; pubkey: Buffer; path: string; leafHashes: Buffer[]; }",canAddToArray:t.canAddToArray}};var KG={};Object.defineProperty(KG,"__esModule",{value:!0}),KG.makeConverter=function(e){return{decode:function(t){if(t.key[0]!==e||1!==t.key.length)throw new Error("Decode Error: could not decode tapInternalKey with key 0x"+t.key.toString("hex"));if(32!==t.value.length)throw new Error("Decode Error: tapInternalKey not a 32-byte x-only pubkey");return t.value},encode:function(t){return{key:Yo.from([e]),value:t}},check:function(e){return Na(e)&&32===e.length},expected:"Buffer",canAdd:function(e,t){return!!e&&!!t&&void 0===e.tapInternalKey}}};var jG={};Object.defineProperty(jG,"__esModule",{value:!0}),jG.makeConverter=function(e){return{decode:function(t){if(t.key[0]!==e)throw new Error("Decode Error: could not decode witnessScript with key 0x"+t.key.toString("hex"));return t.value},encode:function(t){return{key:Yo.from([e]),value:t}},check:function(e){return Na(e)},expected:"Buffer",canAdd:function(e,t){return!!e&&!!t&&void 0===e.witnessScript}}},Object.defineProperty(Vj,"__esModule",{value:!0});var GG=zj,qG=Zj,VG=eG,zG=nG,JG=iG,YG=aG,XG=uG,WG=AG,ZG=fG,$G=pG,eq=yG,tq=wG,nq=NG,rq=PG,iq=LG,oq=MG,aq=TG,sq=KG,uq=jG,lq={unsignedTx:Xj,globalXpub:Jj,checkPubkey:iq.makeChecker([])};Vj.globals=lq;var Aq={nonWitnessUtxo:zG,partialSig:JG,sighashType:XG,finalScriptSig:qG,finalScriptWitness:VG,porCommitment:YG,witnessUtxo:tq,bip32Derivation:rq.makeConverter(GG.InputTypes.BIP32_DERIVATION),redeemScript:oq.makeConverter(GG.InputTypes.REDEEM_SCRIPT),witnessScript:uq.makeConverter(GG.InputTypes.WITNESS_SCRIPT),checkPubkey:iq.makeChecker([GG.InputTypes.PARTIAL_SIG,GG.InputTypes.BIP32_DERIVATION]),tapKeySig:WG,tapScriptSig:eq,tapLeafScript:ZG,tapBip32Derivation:aq.makeConverter(GG.InputTypes.TAP_BIP32_DERIVATION),tapInternalKey:sq.makeConverter(GG.InputTypes.TAP_INTERNAL_KEY),tapMerkleRoot:$G};Vj.inputs=Aq;var cq={bip32Derivation:rq.makeConverter(GG.OutputTypes.BIP32_DERIVATION),redeemScript:oq.makeConverter(GG.OutputTypes.REDEEM_SCRIPT),witnessScript:uq.makeConverter(GG.OutputTypes.WITNESS_SCRIPT),checkPubkey:iq.makeChecker([GG.OutputTypes.BIP32_DERIVATION]),tapBip32Derivation:aq.makeConverter(GG.OutputTypes.TAP_BIP32_DERIVATION),tapTree:nq,tapInternalKey:sq.makeConverter(GG.OutputTypes.TAP_INTERNAL_KEY)};Vj.outputs=cq,Object.defineProperty(qj,"__esModule",{value:!0});var hq=Vj,fq=bG,dq=IG,pq=zj;function gq(e,t,n){if(!t.equals(Yo.from([n])))throw new Error("Format Error: Invalid ".concat(e," key: ").concat(t.toString("hex")))}function vq(e,t){var n,r=t.globalMapKeyVals,i=t.inputKeyVals,o=t.outputKeyVals,a={unsignedTx:e},s=0,u=F(r);try{for(u.s();!(n=u.n()).done;){var l=n.value;switch(l.key[0]){case pq.GlobalTypes.UNSIGNED_TX:if(gq("global",l.key,pq.GlobalTypes.UNSIGNED_TX),s>0)throw new Error("Format Error: GlobalMap has multiple UNSIGNED_TX");s++;break;case pq.GlobalTypes.GLOBAL_XPUB:void 0===a.globalXpub&&(a.globalXpub=[]),a.globalXpub.push(hq.globals.globalXpub.decode(l));break;default:a.unknownKeyVals||(a.unknownKeyVals=[]),a.unknownKeyVals.push(l)}}}catch(e){u.e(e)}finally{u.f()}var A,c=i.length,h=o.length,f=[],d=[],p=F(fq.range(c));try{for(p.s();!(A=p.n()).done;){var g,v=A.value,y={},m=F(i[v]);try{for(m.s();!(g=m.n()).done;){var w=g.value;switch(hq.inputs.checkPubkey(w),w.key[0]){case pq.InputTypes.NON_WITNESS_UTXO:if(gq("input",w.key,pq.InputTypes.NON_WITNESS_UTXO),void 0!==y.nonWitnessUtxo)throw new Error("Format Error: Input has multiple NON_WITNESS_UTXO");y.nonWitnessUtxo=hq.inputs.nonWitnessUtxo.decode(w);break;case pq.InputTypes.WITNESS_UTXO:if(gq("input",w.key,pq.InputTypes.WITNESS_UTXO),void 0!==y.witnessUtxo)throw new Error("Format Error: Input has multiple WITNESS_UTXO");y.witnessUtxo=hq.inputs.witnessUtxo.decode(w);break;case pq.InputTypes.PARTIAL_SIG:void 0===y.partialSig&&(y.partialSig=[]),y.partialSig.push(hq.inputs.partialSig.decode(w));break;case pq.InputTypes.SIGHASH_TYPE:if(gq("input",w.key,pq.InputTypes.SIGHASH_TYPE),void 0!==y.sighashType)throw new Error("Format Error: Input has multiple SIGHASH_TYPE");y.sighashType=hq.inputs.sighashType.decode(w);break;case pq.InputTypes.REDEEM_SCRIPT:if(gq("input",w.key,pq.InputTypes.REDEEM_SCRIPT),void 0!==y.redeemScript)throw new Error("Format Error: Input has multiple REDEEM_SCRIPT");y.redeemScript=hq.inputs.redeemScript.decode(w);break;case pq.InputTypes.WITNESS_SCRIPT:if(gq("input",w.key,pq.InputTypes.WITNESS_SCRIPT),void 0!==y.witnessScript)throw new Error("Format Error: Input has multiple WITNESS_SCRIPT");y.witnessScript=hq.inputs.witnessScript.decode(w);break;case pq.InputTypes.BIP32_DERIVATION:void 0===y.bip32Derivation&&(y.bip32Derivation=[]),y.bip32Derivation.push(hq.inputs.bip32Derivation.decode(w));break;case pq.InputTypes.FINAL_SCRIPTSIG:gq("input",w.key,pq.InputTypes.FINAL_SCRIPTSIG),y.finalScriptSig=hq.inputs.finalScriptSig.decode(w);break;case pq.InputTypes.FINAL_SCRIPTWITNESS:gq("input",w.key,pq.InputTypes.FINAL_SCRIPTWITNESS),y.finalScriptWitness=hq.inputs.finalScriptWitness.decode(w);break;case pq.InputTypes.POR_COMMITMENT:gq("input",w.key,pq.InputTypes.POR_COMMITMENT),y.porCommitment=hq.inputs.porCommitment.decode(w);break;case pq.InputTypes.TAP_KEY_SIG:gq("input",w.key,pq.InputTypes.TAP_KEY_SIG),y.tapKeySig=hq.inputs.tapKeySig.decode(w);break;case pq.InputTypes.TAP_SCRIPT_SIG:void 0===y.tapScriptSig&&(y.tapScriptSig=[]),y.tapScriptSig.push(hq.inputs.tapScriptSig.decode(w));break;case pq.InputTypes.TAP_LEAF_SCRIPT:void 0===y.tapLeafScript&&(y.tapLeafScript=[]),y.tapLeafScript.push(hq.inputs.tapLeafScript.decode(w));break;case pq.InputTypes.TAP_BIP32_DERIVATION:void 0===y.tapBip32Derivation&&(y.tapBip32Derivation=[]),y.tapBip32Derivation.push(hq.inputs.tapBip32Derivation.decode(w));break;case pq.InputTypes.TAP_INTERNAL_KEY:gq("input",w.key,pq.InputTypes.TAP_INTERNAL_KEY),y.tapInternalKey=hq.inputs.tapInternalKey.decode(w);break;case pq.InputTypes.TAP_MERKLE_ROOT:gq("input",w.key,pq.InputTypes.TAP_MERKLE_ROOT),y.tapMerkleRoot=hq.inputs.tapMerkleRoot.decode(w);break;default:y.unknownKeyVals||(y.unknownKeyVals=[]),y.unknownKeyVals.push(w)}}}catch(e){m.e(e)}finally{m.f()}f.push(y)}}catch(e){p.e(e)}finally{p.f()}var b,I=F(fq.range(h));try{for(I.s();!(b=I.n()).done;){var B,E=b.value,C={},x=F(o[E]);try{for(x.s();!(B=x.n()).done;){var k=B.value;switch(hq.outputs.checkPubkey(k),k.key[0]){case pq.OutputTypes.REDEEM_SCRIPT:if(gq("output",k.key,pq.OutputTypes.REDEEM_SCRIPT),void 0!==C.redeemScript)throw new Error("Format Error: Output has multiple REDEEM_SCRIPT");C.redeemScript=hq.outputs.redeemScript.decode(k);break;case pq.OutputTypes.WITNESS_SCRIPT:if(gq("output",k.key,pq.OutputTypes.WITNESS_SCRIPT),void 0!==C.witnessScript)throw new Error("Format Error: Output has multiple WITNESS_SCRIPT");C.witnessScript=hq.outputs.witnessScript.decode(k);break;case pq.OutputTypes.BIP32_DERIVATION:void 0===C.bip32Derivation&&(C.bip32Derivation=[]),C.bip32Derivation.push(hq.outputs.bip32Derivation.decode(k));break;case pq.OutputTypes.TAP_INTERNAL_KEY:gq("output",k.key,pq.OutputTypes.TAP_INTERNAL_KEY),C.tapInternalKey=hq.outputs.tapInternalKey.decode(k);break;case pq.OutputTypes.TAP_TREE:gq("output",k.key,pq.OutputTypes.TAP_TREE),C.tapTree=hq.outputs.tapTree.decode(k);break;case pq.OutputTypes.TAP_BIP32_DERIVATION:void 0===C.tapBip32Derivation&&(C.tapBip32Derivation=[]),C.tapBip32Derivation.push(hq.outputs.tapBip32Derivation.decode(k));break;default:C.unknownKeyVals||(C.unknownKeyVals=[]),C.unknownKeyVals.push(k)}}}catch(e){x.e(e)}finally{x.f()}d.push(C)}}catch(e){I.e(e)}finally{I.f()}return{globalMap:a,inputs:f,outputs:d}}qj.psbtFromBuffer=function(e,t){var n=0;function r(){var t=dq.decode(e,n);n+=dq.encodingLength(t);var r=e.slice(n,n+t);return n+=t,r}function i(){return{key:r(),value:r()}}function o(){if(n>=e.length)throw new Error("Format Error: Unexpected End of PSBT");var t=0===e.readUInt8(n);return t&&n++,t}if(1886610036!==function(){var t=e.readUInt32BE(n);return n+=4,t}())throw new Error("Format Error: Invalid Magic Number");if(255!==function(){var t=e.readUInt8(n);return n+=1,t}())throw new Error("Format Error: Magic Number must be followed by 0xff separator");for(var a=[],s={};!o();){var u=i(),l=u.key.toString("hex");if(s[l])throw new Error("Format Error: Keys must be unique for global keymap: key "+l);s[l]=1,a.push(u)}var A=a.filter((function(e){return e.key[0]===pq.GlobalTypes.UNSIGNED_TX}));if(1!==A.length)throw new Error("Format Error: Only one UNSIGNED_TX allowed");var c,h=t(A[0].value),f=h.getInputOutputCounts(),d=f.inputCount,p=f.outputCount,g=[],v=[],y=F(fq.range(d));try{for(y.s();!(c=y.n()).done;){for(var m=c.value,w={},b=[];!o();){var I=i(),B=I.key.toString("hex");if(w[B])throw new Error("Format Error: Keys must be unique for each input: input index "+m+" key "+B);w[B]=1,b.push(I)}g.push(b)}}catch(e){y.e(e)}finally{y.f()}var E,C=F(fq.range(p));try{for(C.s();!(E=C.n()).done;){for(var x=E.value,k={},S=[];!o();){var Q=i(),_=Q.key.toString("hex");if(k[_])throw new Error("Format Error: Keys must be unique for each output: output index "+x+" key "+_);k[_]=1,S.push(Q)}v.push(S)}}catch(e){C.e(e)}finally{C.f()}return vq(h,{globalMapKeyVals:a,inputKeyVals:g,outputKeyVals:v})},qj.checkKeyBuffer=gq,qj.psbtFromKeyVals=vq;var yq={};Object.defineProperty(yq,"__esModule",{value:!0});var mq=Vj,wq=bG;yq.psbtToBuffer=function(e){var t=Bq({globalMap:e.globalMap,inputs:e.inputs,outputs:e.outputs}),n=t.globalKeyVals,r=t.inputKeyVals,i=t.outputKeyVals,o=wq.keyValsToBuffer(n),a=function(e){return 0===e.length?[Yo.from([0])]:e.map(wq.keyValsToBuffer)},s=a(r),u=a(i),l=Yo.allocUnsafe(5);return l.writeUIntBE(482972169471,0,5),Yo.concat([l,o].concat(s,u))};var bq=function(e,t){return e.key.compare(t.key)};function Iq(e,t){var n=new Set,r=Object.entries(e).reduce((function(e,r){var i=C(r,2),o=i[0],a=i[1];if("unknownKeyVals"===o)return e;var s=t[o];if(void 0===s)return e;var u=(Array.isArray(a)?a:[a]).map(s.encode);return u.map((function(e){return e.key.toString("hex")})).forEach((function(e){if(n.has(e))throw new Error("Serialize Error: Duplicate key: "+e);n.add(e)})),e.concat(u)}),[]),i=e.unknownKeyVals?e.unknownKeyVals.filter((function(e){return!n.has(e.key.toString("hex"))})):[];return r.concat(i).sort(bq)}function Bq(e){var t=e.globalMap,n=e.inputs,r=e.outputs;return{globalKeyVals:Iq(t,mq.globals),inputKeyVals:n.map((function(e){return Iq(e,mq.inputs)})),outputKeyVals:r.map((function(e){return Iq(e,mq.outputs)}))}}yq.psbtToKeyVals=Bq,function(e){function t(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}Object.defineProperty(e,"__esModule",{value:!0}),t(qj),t(yq)}(Gj),Object.defineProperty(jj,"__esModule",{value:!0});var Eq=Gj;function Cq(e,t,n){return function(r){if(!e.has(r)){var i=n.filter((function(e){return e.key.toString("hex")===r}))[0];t.push(i),e.add(r)}}}function xq(e){return e.globalMap.unsignedTx}function kq(e){var t=new Set;return e.forEach((function(e){var n=e.key.toString("hex");if(t.has(n))throw new Error("Combine: KeyValue Map keys should be unique");t.add(n)})),t}jj.combine=function(e){var t=e[0],n=Eq.psbtToKeyVals(t),r=e.slice(1);if(0===r.length)throw new Error("Combine: Nothing to combine");var i=xq(t);if(void 0===i)throw new Error("Combine: Self missing transaction");var o,a=kq(n.globalKeyVals),s=n.inputKeyVals.map(kq),u=n.outputKeyVals.map(kq),l=F(r);try{var A=function(){var e=o.value,t=xq(e);if(void 0===t||!t.toBuffer().equals(i.toBuffer()))throw new Error("Combine: One of the Psbts does not have the same transaction.");var r=Eq.psbtToKeyVals(e);kq(r.globalKeyVals).forEach(Cq(a,n.globalKeyVals,r.globalKeyVals)),r.inputKeyVals.map(kq).forEach((function(e,t){return e.forEach(Cq(s[t],n.inputKeyVals[t],r.inputKeyVals[t]))})),r.outputKeyVals.map(kq).forEach((function(e,t){return e.forEach(Cq(u[t],n.outputKeyVals[t],r.outputKeyVals[t]))}))};for(l.s();!(o=l.n()).done;)A()}catch(e){l.e(e)}finally{l.f()}return Eq.psbtFromKeyVals(i,{globalMapKeyVals:n.globalKeyVals,inputKeyVals:n.inputKeyVals,outputKeyVals:n.outputKeyVals})};var Sq={};!function(e){Object.defineProperty(e,"__esModule",{value:!0});var t=Vj;function n(e,t){var n=e[t];if(void 0===n)throw new Error("No input #".concat(t));return n}function r(e,t){var n=e[t];if(void 0===n)throw new Error("No output #".concat(t));return n}function i(e,t,n,r){throw new Error("Data for ".concat(e," key ").concat(t," is incorrect: Expected ").concat(n," and got ").concat(JSON.stringify(r)))}function o(e){return function(n,r){for(var o=function(){var o=s[a],u=n[o],l=t[e+"s"][o]||{},A=l.canAdd,c=l.canAddToArray,h=l.check,f=l.expected;if(h)if(!!c){if(!Array.isArray(u)||r[o]&&!Array.isArray(r[o]))throw new Error("Key type ".concat(o," must be an array"));u.every(h)||i(e,o,f,u);var d=r[o]||[],p=new Set;if(!u.every((function(e){return c(d,e,p)})))throw new Error("Can not add duplicate data to array");r[o]=d.concat(u)}else{if(h(u)||i(e,o,f,u),!A(r,u))throw new Error("Can not add duplicate data to ".concat(e));r[o]=u}},a=0,s=Object.keys(n);a<s.length;a++)o()}}e.checkForInput=n,e.checkForOutput=r,e.checkHasKey=function(e,t,n){if(e.key[0]<n)throw new Error("Use the method for your specific key instead of addUnknownKeyVal*");if(t&&0!==t.filter((function(t){return t.key.equals(e.key)})).length)throw new Error("Duplicate Key: ".concat(e.key.toString("hex")))},e.getEnumLength=function(e){var t=0;return Object.keys(e).forEach((function(e){Number(isNaN(Number(e)))&&t++})),t},e.inputCheckUncleanFinalized=function(e,t){var n=!1;if(t.nonWitnessUtxo||t.witnessUtxo){var r=!!t.redeemScript,i=!!t.witnessScript,o=!r||!!t.finalScriptSig,a=!i||!!t.finalScriptWitness,s=!!t.finalScriptSig||!!t.finalScriptWitness;n=o&&a&&s}if(!1===n)throw new Error("Input #".concat(e," has too much or too little data to clean"))},e.updateGlobal=o("global"),e.updateInput=o("input"),e.updateOutput=o("output"),e.addInputAttributes=function(t,r){var i=n(t,t.length-1);e.updateInput(r,i)},e.addOutputAttributes=function(t,n){var i=r(t,t.length-1);e.updateOutput(n,i)},e.defaultVersionSetter=function(e,t){if(!Na(t)||t.length<4)throw new Error("Set Version: Invalid Transaction");return t.writeUInt32LE(e,0),t},e.defaultLocktimeSetter=function(e,t){if(!Na(t)||t.length<4)throw new Error("Set Locktime: Invalid Transaction");return t.writeUInt32LE(e,t.length-4),t}}(Sq),Object.defineProperty(Kj,"__esModule",{value:!0});var Qq=jj,_q=Gj,Nq=zj,Dq=Sq;Kj.Psbt=function(){function e(t){s(this,e),this.inputs=[],this.outputs=[],this.globalMap={unsignedTx:t}}return l(e,[{key:"toBase64",value:function(){return this.toBuffer().toString("base64")}},{key:"toHex",value:function(){return this.toBuffer().toString("hex")}},{key:"toBuffer",value:function(){return _q.psbtToBuffer(this)}},{key:"updateGlobal",value:function(e){return Dq.updateGlobal(e,this.globalMap),this}},{key:"updateInput",value:function(e,t){var n=Dq.checkForInput(this.inputs,e);return Dq.updateInput(t,n),this}},{key:"updateOutput",value:function(e,t){var n=Dq.checkForOutput(this.outputs,e);return Dq.updateOutput(t,n),this}},{key:"addUnknownKeyValToGlobal",value:function(e){return Dq.checkHasKey(e,this.globalMap.unknownKeyVals,Dq.getEnumLength(Nq.GlobalTypes)),this.globalMap.unknownKeyVals||(this.globalMap.unknownKeyVals=[]),this.globalMap.unknownKeyVals.push(e),this}},{key:"addUnknownKeyValToInput",value:function(e,t){var n=Dq.checkForInput(this.inputs,e);return Dq.checkHasKey(t,n.unknownKeyVals,Dq.getEnumLength(Nq.InputTypes)),n.unknownKeyVals||(n.unknownKeyVals=[]),n.unknownKeyVals.push(t),this}},{key:"addUnknownKeyValToOutput",value:function(e,t){var n=Dq.checkForOutput(this.outputs,e);return Dq.checkHasKey(t,n.unknownKeyVals,Dq.getEnumLength(Nq.OutputTypes)),n.unknownKeyVals||(n.unknownKeyVals=[]),n.unknownKeyVals.push(t),this}},{key:"addInput",value:function(e){var t=this;this.globalMap.unsignedTx.addInput(e),this.inputs.push({unknownKeyVals:[]});var n=e.unknownKeyVals||[],r=this.inputs.length-1;if(!Array.isArray(n))throw new Error("unknownKeyVals must be an Array");return n.forEach((function(e){return t.addUnknownKeyValToInput(r,e)})),Dq.addInputAttributes(this.inputs,e),this}},{key:"addOutput",value:function(e){var t=this;this.globalMap.unsignedTx.addOutput(e),this.outputs.push({unknownKeyVals:[]});var n=e.unknownKeyVals||[],r=this.outputs.length-1;if(!Array.isArray(n))throw new Error("unknownKeyVals must be an Array");return n.forEach((function(e){return t.addUnknownKeyValToInput(r,e)})),Dq.addOutputAttributes(this.outputs,e),this}},{key:"clearFinalizedInput",value:function(e){var t=Dq.checkForInput(this.inputs,e);Dq.inputCheckUncleanFinalized(e,t);for(var n=0,r=Object.keys(t);n<r.length;n++){var i=r[n];["witnessUtxo","nonWitnessUtxo","finalScriptSig","finalScriptWitness","unknownKeyVals"].includes(i)||delete t[i]}return this}},{key:"combine",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=Qq.combine([this].concat(t));return Object.assign(this,r),this}},{key:"getTransaction",value:function(){return this.globalMap.unsignedTx.toBuffer()}}],[{key:"fromBase64",value:function(e,t){var n=Yo.from(e,"base64");return this.fromBuffer(n,t)}},{key:"fromHex",value:function(e,t){var n=Yo.from(e,"hex");return this.fromBuffer(n,t)}},{key:"fromBuffer",value:function(e,t){var n=_q.psbtFromBuffer(e,t),r=new this(n.globalMap.unsignedTx);return Object.assign(r,n),r}}]),e}(),Object.defineProperty(Hj,"__esModule",{value:!0}),Hj.Psbt=void 0;var Fq=Kj,Pq=IG,Uq=Sq,Lq=BU,Mq=rj,Tq=WL,Rq=CU,Oq=kU,Hq=gj,Kq={network:EU.bitcoin,maximumFeeRate:5e3},jq=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Fq.Psbt(new qq);s(this,e),this.data=n,this.opts=Object.assign({},Kq,t),this.__CACHE={__NON_WITNESS_UTXO_TX_CACHE:[],__NON_WITNESS_UTXO_BUF_CACHE:[],__TX_IN_CACHE:{},__TX:this.data.globalMap.unsignedTx.tx,__UNSAFE_SIGN_NONSEGWIT:!1},0===this.data.inputs.length&&this.setVersion(2);var r=function(e,t,n,r){return Object.defineProperty(e,t,{enumerable:n,writable:r})};r(this,"__CACHE",!1,!0),r(this,"opts",!1,!0)}return l(e,[{key:"inputCount",get:function(){return this.data.inputs.length}},{key:"version",get:function(){return this.__CACHE.__TX.version},set:function(e){this.setVersion(e)}},{key:"locktime",get:function(){return this.__CACHE.__TX.locktime},set:function(e){this.setLocktime(e)}},{key:"txInputs",get:function(){return this.__CACHE.__TX.ins.map((function(e){return{hash:(0,Mq.cloneBuffer)(e.hash),index:e.index,sequence:e.sequence}}))}},{key:"txOutputs",get:function(){var e=this;return this.__CACHE.__TX.outs.map((function(t){var n;try{n=(0,Lq.fromOutputScript)(t.script,e.opts.network)}catch(t){}return{script:(0,Mq.cloneBuffer)(t.script),value:t.value,address:n}}))}},{key:"combine",value:function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return(e=this.data).combine.apply(e,k(n.map((function(e){return e.data})))),this}},{key:"clone",value:function(){var t=e.fromBuffer(this.data.toBuffer());return t.opts=JSON.parse(JSON.stringify(this.opts)),t}},{key:"setMaximumFeeRate",value:function(e){rV(e),this.opts.maximumFeeRate=e}},{key:"setVersion",value:function(e){rV(e),iV(this.data.inputs,"setVersion");var t=this.__CACHE;return t.__TX.version=e,t.__EXTRACTED_TX=void 0,this}},{key:"setLocktime",value:function(e){rV(e),iV(this.data.inputs,"setLocktime");var t=this.__CACHE;return t.__TX.locktime=e,t.__EXTRACTED_TX=void 0,this}},{key:"setInputSequence",value:function(e,t){rV(t),iV(this.data.inputs,"setInputSequence");var n=this.__CACHE;if(n.__TX.ins.length<=e)throw new Error("Input index too high");return n.__TX.ins[e].sequence=t,n.__EXTRACTED_TX=void 0,this}},{key:"addInputs",value:function(e){var t=this;return e.forEach((function(e){return t.addInput(e)})),this}},{key:"addInput",value:function(e){if(arguments.length>1||!e||void 0===e.hash||void 0===e.index)throw new Error("Invalid arguments for Psbt.addInput. Requires single object with at least [hash] and [index]");iV(this.data.inputs,"addInput"),e.witnessScript&&IV(e.witnessScript);var t=this.__CACHE;this.data.addInput(e),aV(t,t.__TX.ins[t.__TX.ins.length-1]);var n=this.data.inputs.length-1,r=this.data.inputs[n];return r.nonWitnessUtxo&&gV(this.__CACHE,r,n),t.__FEE=void 0,t.__FEE_RATE=void 0,t.__EXTRACTED_TX=void 0,this}},{key:"addOutputs",value:function(e){var t=this;return e.forEach((function(e){return t.addOutput(e)})),this}},{key:"addOutput",value:function(e){if(arguments.length>1||!e||void 0===e.value||void 0===e.address&&void 0===e.script)throw new Error("Invalid arguments for Psbt.addOutput. Requires single object with at least [script or address] and [value]");iV(this.data.inputs,"addOutput");var t=e,n=t.address;if("string"==typeof n){var r=this.opts.network,i=(0,Lq.toOutputScript)(n,r);e=Object.assign(e,{script:i})}var o=this.__CACHE;return this.data.addOutput(e),o.__FEE=void 0,o.__FEE_RATE=void 0,o.__EXTRACTED_TX=void 0,this}},{key:"extractTransaction",value:function(e){if(!this.data.inputs.every(Jq))throw new Error("Not finalized");var t=this.__CACHE;if(e||function(e,t,n){var r=t.__FEE_RATE||e.getFeeRate(),i=t.__EXTRACTED_TX.virtualSize(),o=r*i;if(r>=n.maximumFeeRate)throw new Error("Warning: You are paying around ".concat((o/1e8).toFixed(8)," in fees, which is ").concat(r," satoshi per byte for a transaction with a VSize of ").concat(i," bytes (segwit counted as 0.25 byte per byte). Use setMaximumFeeRate method to raise your threshold, or pass true to the first arg of extractTransaction."))}(this,t,this.opts),t.__EXTRACTED_TX)return t.__EXTRACTED_TX;var n=t.__TX.clone();return vV(this.data.inputs,n,t,!0),n}},{key:"getFeeRate",value:function(){return AV("__FEE_RATE","fee rate",this.data.inputs,this.__CACHE)}},{key:"getFee",value:function(){return AV("__FEE","fee",this.data.inputs,this.__CACHE)}},{key:"finalizeAllInputs",value:function(){var e=this;return(0,Uq.checkForInput)(this.data.inputs,0),CV(this.data.inputs.length).forEach((function(t){return e.finalizeInput(t)})),this}},{key:"finalizeInput",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cV,n=(0,Uq.checkForInput)(this.data.inputs,e),r=function(e,t,n){var r=n.__TX,i={script:null,isSegwit:!1,isP2SH:!1,isP2WSH:!1};if(i.isP2SH=!!t.redeemScript,i.isP2WSH=!!t.witnessScript,t.witnessScript)i.script=t.witnessScript;else if(t.redeemScript)i.script=t.redeemScript;else if(t.nonWitnessUtxo){var o=yV(n,t,e),a=r.ins[e].index;i.script=o.outs[a].script}else t.witnessUtxo&&(i.script=t.witnessUtxo.script);return(t.witnessScript||$q(i.script))&&(i.isSegwit=!0),i}(e,n,this.__CACHE),i=r.script,o=r.isP2SH,a=r.isP2WSH,s=r.isSegwit;if(!i)throw new Error("No script found for input #".concat(e));!function(e){if(e.sighashType&&e.partialSig){var t=e.partialSig,n=e.sighashType;t.forEach((function(e){var t=Oq.signature.decode(e.signature).hashType;if(n!==t)throw new Error("Signature sighash does not match input sighash type")}))}}(n);var u=t(e,n,i,s,o,a),l=u.finalScriptSig,A=u.finalScriptWitness;if(l&&this.data.updateInput(e,{finalScriptSig:l}),A&&this.data.updateInput(e,{finalScriptWitness:A}),!l&&!A)throw new Error("Unknown error finalizing input #".concat(e));return this.data.clearFinalizedInput(e),this}},{key:"getInputType",value:function(e){var t=(0,Uq.checkForInput)(this.data.inputs,e),n=bV(mV(e,t,this.__CACHE),e,"input",t.redeemScript||function(e){if(e){var t=Oq.decompile(e);if(t){var n,r=t[t.length-1];if(Na(r)&&!wV(r)&&(n=r,!Oq.isCanonicalScriptSignature(n)))if(Oq.decompile(r))return r}}}(t.finalScriptSig),t.witnessScript||function(e){if(e){var t=pV(e),n=t[t.length-1];if(!wV(n)&&Oq.decompile(n))return n}}(t.finalScriptWitness));return("raw"===n.type?"":n.type+"-")+EV(n.meaningfulScript)}},{key:"inputHasPubkey",value:function(e,t){return function(e,t,n,r){return BV(e,bV(mV(n,t,r),n,"input",t.redeemScript,t.witnessScript).meaningfulScript)}(t,(0,Uq.checkForInput)(this.data.inputs,e),e,this.__CACHE)}},{key:"inputHasHDKey",value:function(e,t){var n=(0,Uq.checkForInput)(this.data.inputs,e),r=nV(t);return!!n.bip32Derivation&&n.bip32Derivation.some(r)}},{key:"outputHasPubkey",value:function(e,t){return function(e,t,n,r){return BV(e,bV(r.__TX.outs[n].script,n,"output",t.redeemScript,t.witnessScript).meaningfulScript)}(t,(0,Uq.checkForOutput)(this.data.outputs,e),e,this.__CACHE)}},{key:"outputHasHDKey",value:function(e,t){var n=(0,Uq.checkForOutput)(this.data.outputs,e),r=nV(t);return!!n.bip32Derivation&&n.bip32Derivation.some(r)}},{key:"validateSignaturesOfAllInputs",value:function(e){var t=this;return(0,Uq.checkForInput)(this.data.inputs,0),CV(this.data.inputs.length).map((function(n){return t.validateSignaturesOfInput(n,e)})).reduce((function(e,t){return!0===t&&e}),!0)}},{key:"validateSignaturesOfInput",value:function(e,t,n){var r=this.data.inputs[e],i=(r||{}).partialSig;if(!r||!i||i.length<1)throw new Error("No signatures to validate");if("function"!=typeof t)throw new Error("Need validator function to validate signatures");var o=n?i.filter((function(e){return e.pubkey.equals(n)})):i;if(o.length<1)throw new Error("No signatures for this pubkey");var a,s,u,l,A=[],c=F(o);try{for(c.s();!(l=c.n()).done;){var h=l.value,f=Oq.signature.decode(h.signature),d=u!==f.hashType?fV(e,Object.assign({},r,{sighashType:f.hashType}),this.__CACHE,!0):{hash:a,script:s},p=d.hash,g=d.script;u=f.hashType,a=p,s=g,oV(h.pubkey,g,"verify"),A.push(t(h.pubkey,p,f.signature))}}catch(e){c.e(e)}finally{c.f()}return A.every((function(e){return!0===e}))}},{key:"signAllInputsHD",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[Hq.Transaction.SIGHASH_ALL];if(!e||!e.publicKey||!e.fingerprint)throw new Error("Need HDSigner to sign input");var n,r=[],i=F(CV(this.data.inputs.length));try{for(i.s();!(n=i.n()).done;){var o=n.value;try{this.signInputHD(o,e,t),r.push(!0)}catch(e){r.push(!1)}}}catch(e){i.e(e)}finally{i.f()}if(r.every((function(e){return!1===e})))throw new Error("No inputs were signed");return this}},{key:"signAllInputsHDAsync",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[Hq.Transaction.SIGHASH_ALL];return new Promise((function(r,i){if(!e||!e.publicKey||!e.fingerprint)return i(new Error("Need HDSigner to sign input"));var o,a=[],s=[],u=F(CV(t.data.inputs.length));try{for(u.s();!(o=u.n()).done;){var l=o.value;s.push(t.signInputHDAsync(l,e,n).then((function(){a.push(!0)}),(function(){a.push(!1)})))}}catch(e){u.e(e)}finally{u.f()}return Promise.all(s).then((function(){if(a.every((function(e){return!1===e})))return i(new Error("No inputs were signed"));r()}))}))}},{key:"signInputHD",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[Hq.Transaction.SIGHASH_ALL];if(!t||!t.publicKey||!t.fingerprint)throw new Error("Need HDSigner to sign input");return dV(e,this.data.inputs,t).forEach((function(t){return n.signInput(e,t,r)})),this}},{key:"signInputHDAsync",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[Hq.Transaction.SIGHASH_ALL];return new Promise((function(i,o){if(!t||!t.publicKey||!t.fingerprint)return o(new Error("Need HDSigner to sign input"));var a=dV(e,n.data.inputs,t).map((function(t){return n.signInputAsync(e,t,r)}));return Promise.all(a).then((function(){i()})).catch(o)}))}},{key:"signAllInputs",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[Hq.Transaction.SIGHASH_ALL];if(!e||!e.publicKey)throw new Error("Need Signer to sign input");var n,r=[],i=F(CV(this.data.inputs.length));try{for(i.s();!(n=i.n()).done;){var o=n.value;try{this.signInput(o,e,t),r.push(!0)}catch(e){r.push(!1)}}}catch(e){i.e(e)}finally{i.f()}if(r.every((function(e){return!1===e})))throw new Error("No inputs were signed");return this}},{key:"signAllInputsAsync",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[Hq.Transaction.SIGHASH_ALL];return new Promise((function(r,i){if(!e||!e.publicKey)return i(new Error("Need Signer to sign input"));var o,a=[],s=[],u=F(t.data.inputs.entries());try{for(u.s();!(o=u.n()).done;){var l=C(o.value,1)[0];s.push(t.signInputAsync(l,e,n).then((function(){a.push(!0)}),(function(){a.push(!1)})))}}catch(e){u.e(e)}finally{u.f()}return Promise.all(s).then((function(){if(a.every((function(e){return!1===e})))return i(new Error("No inputs were signed"));r()}))}))}},{key:"signInput",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[Hq.Transaction.SIGHASH_ALL];if(!t||!t.publicKey)throw new Error("Need Signer to sign input");var r=hV(this.data.inputs,e,t.publicKey,this.__CACHE,n),i=r.hash,o=r.sighashType,a=[{pubkey:t.publicKey,signature:Oq.signature.encode(t.sign(i),o)}];return this.data.updateInput(e,{partialSig:a}),this}},{key:"signInputAsync",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[Hq.Transaction.SIGHASH_ALL];return Promise.resolve().then((function(){if(!t||!t.publicKey)throw new Error("Need Signer to sign input");var i=hV(n.data.inputs,e,t.publicKey,n.__CACHE,r),o=i.hash,a=i.sighashType;return Promise.resolve(t.sign(o)).then((function(r){var i=[{pubkey:t.publicKey,signature:Oq.signature.encode(r,a)}];n.data.updateInput(e,{partialSig:i})}))}))}},{key:"toBuffer",value:function(){return Vq(this.__CACHE),this.data.toBuffer()}},{key:"toHex",value:function(){return Vq(this.__CACHE),this.data.toHex()}},{key:"toBase64",value:function(){return Vq(this.__CACHE),this.data.toBase64()}},{key:"updateGlobal",value:function(e){return this.data.updateGlobal(e),this}},{key:"updateInput",value:function(e,t){return t.witnessScript&&IV(t.witnessScript),this.data.updateInput(e,t),t.nonWitnessUtxo&&gV(this.__CACHE,this.data.inputs[e],e),this}},{key:"updateOutput",value:function(e,t){return this.data.updateOutput(e,t),this}},{key:"addUnknownKeyValToGlobal",value:function(e){return this.data.addUnknownKeyValToGlobal(e),this}},{key:"addUnknownKeyValToInput",value:function(e,t){return this.data.addUnknownKeyValToInput(e,t),this}},{key:"addUnknownKeyValToOutput",value:function(e,t){return this.data.addUnknownKeyValToOutput(e,t),this}},{key:"clearFinalizedInput",value:function(e){return this.data.clearFinalizedInput(e),this}}],[{key:"fromBase64",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=Yo.from(e,"base64");return this.fromBuffer(n,t)}},{key:"fromHex",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=Yo.from(e,"hex");return this.fromBuffer(n,t)}},{key:"fromBuffer",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=Fq.Psbt.fromBuffer(t,Gq),i=new e(n,r);return function(e,t){e.ins.forEach((function(e){aV(t,e)}))}(i.__CACHE.__TX,i.__CACHE),i}}]),e}();Hj.Psbt=jq;var Gq=function(e){return new qq(e)},qq=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Yo.from([2,0,0,0,0,0,0,0,0,0]);s(this,e),this.tx=Hq.Transaction.fromBuffer(t),function(e){if(!e.ins.every((function(e){return e.script&&0===e.script.length&&e.witness&&0===e.witness.length})))throw new Error("Format Error: Transaction ScriptSigs are not empty")}(this.tx),Object.defineProperty(this,"tx",{enumerable:!1,writable:!0})}return l(e,[{key:"getInputOutputCounts",value:function(){return{inputCount:this.tx.ins.length,outputCount:this.tx.outs.length}}},{key:"addInput",value:function(e){if(void 0===e.hash||void 0===e.index||!Na(e.hash)&&"string"!=typeof e.hash||"number"!=typeof e.index)throw new Error("Error adding input.");var t="string"==typeof e.hash?(0,Mq.reverseBuffer)(Yo.from(e.hash,"hex")):e.hash;this.tx.addInput(t,e.index,e.sequence)}},{key:"addOutput",value:function(e){if(void 0===e.script||void 0===e.value||!Na(e.script)||"number"!=typeof e.value)throw new Error("Error adding output.");this.tx.addOutput(e.script,e.value)}},{key:"toBuffer",value:function(){return this.tx.toBuffer()}}]),e}();function Vq(e){if(!1!==e.__UNSAFE_SIGN_NONSEGWIT)throw new Error("Not BIP174 compliant, can not export")}function zq(e,t,n){if(!t)return!1;var r;if(r=n?n.map((function(e){var n=function(e){if(65===e.length){var t=1&e[64],n=e.slice(0,33);return n[0]=2|t,n}return e.slice()}(e);return t.find((function(e){return e.pubkey.equals(n)}))})).filter((function(e){return!!e})):t,r.length>e)throw new Error("Too many signatures");return r.length===e}function Jq(e){return!!e.finalScriptSig||!!e.finalScriptWitness}function Yq(e){return function(t){try{return e({output:t}),!0}catch(e){return!1}}}var Xq=Yq(Rq.p2ms),Wq=Yq(Rq.p2pk),Zq=Yq(Rq.p2pkh),$q=Yq(Rq.p2wpkh),eV=Yq(Rq.p2wsh),tV=Yq(Rq.p2sh);function nV(e){return function(t){return!!t.masterFingerprint.equals(e.fingerprint)&&!!e.derivePath(t.path).publicKey.equals(t.pubkey)}}function rV(e){if("number"!=typeof e||e!==Math.floor(e)||e>4294967295||e<0)throw new Error("Invalid 32 bit integer")}function iV(e,t){e.forEach((function(e){var n=!1,r=[];if(0===(e.partialSig||[]).length){if(!e.finalScriptSig&&!e.finalScriptWitness)return;r=function(e){var t=e.finalScriptSig&&Oq.decompile(e.finalScriptSig)||[],n=e.finalScriptWitness&&Oq.decompile(e.finalScriptWitness)||[];return t.concat(n).filter((function(e){return Na(e)&&Oq.isCanonicalScriptSignature(e)})).map((function(e){return{signature:e}}))}(e)}else r=e.partialSig;if(r.forEach((function(e){var r=Oq.signature.decode(e.signature).hashType,i=[];switch(r&Hq.Transaction.SIGHASH_ANYONECANPAY&&i.push("addInput"),31&r){case Hq.Transaction.SIGHASH_ALL:break;case Hq.Transaction.SIGHASH_SINGLE:case Hq.Transaction.SIGHASH_NONE:i.push("addOutput"),i.push("setInputSequence")}-1===i.indexOf(t)&&(n=!0)})),n)throw new Error("Can not modify transaction, signatures exist.")}))}function oV(e,t,n){if(!BV(e,t))throw new Error("Can not ".concat(n," for this input with the key ").concat(e.toString("hex")))}function aV(e,t){var n=(0,Mq.reverseBuffer)(Yo.from(t.hash)).toString("hex")+":"+t.index;if(e.__TX_IN_CACHE[n])throw new Error("Duplicate input detected.");e.__TX_IN_CACHE[n]=1}function sV(e,t){return function(n,r,i,o){var a=e({redeem:{output:i}}).output;if(!r.equals(a))throw new Error("".concat(t," for ").concat(o," #").concat(n," doesn't match the scriptPubKey in the prevout"))}}var uV=sV(Rq.p2sh,"Redeem script"),lV=sV(Rq.p2wsh,"Witness script");function AV(e,t,n,r){if(!n.every(Jq))throw new Error("PSBT must be finalized to calculate ".concat(t));if("__FEE_RATE"===e&&r.__FEE_RATE)return r.__FEE_RATE;if("__FEE"===e&&r.__FEE)return r.__FEE;var i,o=!0;return r.__EXTRACTED_TX?(i=r.__EXTRACTED_TX,o=!1):i=r.__TX.clone(),vV(n,i,r,o),"__FEE_RATE"===e?r.__FEE_RATE:"__FEE"===e?r.__FEE:void 0}function cV(e,t,n,r,i,o){var a=EV(n);if(!function(e,t,n){switch(n){case"pubkey":case"pubkeyhash":case"witnesspubkeyhash":return zq(1,e.partialSig);case"multisig":var r=Rq.p2ms({output:t});return zq(r.m,e.partialSig,r.pubkeys);default:return!1}}(t,n,a))throw new Error("Can not finalize input #".concat(e));return function(e,t,n,r,i,o){var a,s,u=function(e,t,n){var r;switch(t){case"multisig":var i=function(e,t){return Rq.p2ms({output:e}).pubkeys.map((function(e){return(t.filter((function(t){return t.pubkey.equals(e)}))[0]||{}).signature})).filter((function(e){return!!e}))}(e,n);r=Rq.p2ms({output:e,signatures:i});break;case"pubkey":r=Rq.p2pk({output:e,signature:n[0].signature});break;case"pubkeyhash":r=Rq.p2pkh({output:e,pubkey:n[0].pubkey,signature:n[0].signature});break;case"witnesspubkeyhash":r=Rq.p2wpkh({output:e,pubkey:n[0].pubkey,signature:n[0].signature})}return r}(e,t,n),l=o?Rq.p2wsh({redeem:u}):null,A=i?Rq.p2sh({redeem:l||u}):null;return r?(s=function(e){var t,n=Yo.allocUnsafe(0);function r(e){var t=n.length,r=Pq.encodingLength(e);n=Yo.concat([n,Yo.allocUnsafe(r)]),Pq.encode(e,n,t)}function i(e){r(e.length),function(e){n=Yo.concat([n,Yo.from(e)])}(e)}return r((t=e).length),t.forEach(i),n}(l?l.witness:u.witness),A&&(a=A.input)):a=A?A.input:u.input,{finalScriptSig:a,finalScriptWitness:s}}(n,a,t.partialSig,r,i,o)}function hV(e,t,n,r,i){var o=fV(t,(0,Uq.checkForInput)(e,t),r,!1,i),a=o.hash,s=o.sighashType;return oV(n,o.script,"sign"),{hash:a,sighashType:s}}function fV(e,t,n,r,i){var o,a,s=n.__TX,u=t.sighashType||Hq.Transaction.SIGHASH_ALL;if(i&&i.indexOf(u)<0){var l=function(e){var t=e&Hq.Transaction.SIGHASH_ANYONECANPAY?"SIGHASH_ANYONECANPAY | ":"";switch(31&e){case Hq.Transaction.SIGHASH_ALL:t+="SIGHASH_ALL";break;case Hq.Transaction.SIGHASH_SINGLE:t+="SIGHASH_SINGLE";break;case Hq.Transaction.SIGHASH_NONE:t+="SIGHASH_NONE"}return t}(u);throw new Error("Sighash type is not allowed. Retry the sign method passing the sighashTypes array of whitelisted types. Sighash type: ".concat(l))}if(t.nonWitnessUtxo){var A=yV(n,t,e),c=s.ins[e].hash,h=A.getHash();if(!c.equals(h))throw new Error("Non-witness UTXO hash for input #".concat(e," doesn't match the hash specified in the prevout"));var f=s.ins[e].index;a=A.outs[f]}else{if(!t.witnessUtxo)throw new Error("Need a Utxo input item for signing");a=t.witnessUtxo}var d=bV(a.script,e,"input",t.redeemScript,t.witnessScript),p=d.meaningfulScript,g=d.type;if(["p2sh-p2wsh","p2wsh"].indexOf(g)>=0)o=s.hashForWitnessV0(e,p,a.value,u);else if($q(p)){var v=Rq.p2pkh({hash:p.slice(2)}).output;o=s.hashForWitnessV0(e,v,a.value,u)}else{if(void 0===t.nonWitnessUtxo&&!1===n.__UNSAFE_SIGN_NONSEGWIT)throw new Error("Input #".concat(e," has witnessUtxo but non-segwit script: ").concat(p.toString("hex")));r||!1===n.__UNSAFE_SIGN_NONSEGWIT||console.warn("Warning: Signing non-segwit inputs without the full parent transaction means there is a chance that a miner could feed you incorrect information to trick you into paying large fees. This behavior is the same as Psbt's predecesor (TransactionBuilder - now removed) when signing non-segwit scripts. You are not able to export this Psbt with toBuffer|toBase64|toHex since it is not BIP174 compliant.\n*********************\nPROCEED WITH CAUTION!\n*********************"),o=s.hashForSignature(e,p,u)}return{script:p,sighashType:u,hash:o}}function dV(e,t,n){var r=(0,Uq.checkForInput)(t,e);if(!r.bip32Derivation||0===r.bip32Derivation.length)throw new Error("Need bip32Derivation to sign with HD");var i=r.bip32Derivation.map((function(e){return e.masterFingerprint.equals(n.fingerprint)?e:void 0})).filter((function(e){return!!e}));if(0===i.length)throw new Error("Need one bip32Derivation masterFingerprint to match the HDSigner fingerprint");var o=i.map((function(e){var t=n.derivePath(e.path);if(!e.pubkey.equals(t.publicKey))throw new Error("pubkey did not match bip32Derivation");return t}));return o}function pV(e){var t=0;function n(){var n=Pq.decode(e,t);return t+=Pq.decode.bytes,n}function r(){return r=n(),t+=r,e.slice(t-r,t);var r}return function(){for(var e=n(),t=[],i=0;i<e;i++)t.push(r());return t}()}function gV(e,t,n){e.__NON_WITNESS_UTXO_BUF_CACHE[n]=t.nonWitnessUtxo;var r=Hq.Transaction.fromBuffer(t.nonWitnessUtxo);e.__NON_WITNESS_UTXO_TX_CACHE[n]=r;var i=e,o=n;delete t.nonWitnessUtxo,Object.defineProperty(t,"nonWitnessUtxo",{enumerable:!0,get:function(){var e=i.__NON_WITNESS_UTXO_BUF_CACHE[o],t=i.__NON_WITNESS_UTXO_TX_CACHE[o];if(void 0!==e)return e;var n=t.toBuffer();return i.__NON_WITNESS_UTXO_BUF_CACHE[o]=n,n},set:function(e){i.__NON_WITNESS_UTXO_BUF_CACHE[o]=e}})}function vV(e,t,n,r){var i=0;e.forEach((function(e,o){if(r&&e.finalScriptSig&&(t.ins[o].script=e.finalScriptSig),r&&e.finalScriptWitness&&(t.ins[o].witness=pV(e.finalScriptWitness)),e.witnessUtxo)i+=e.witnessUtxo.value;else if(e.nonWitnessUtxo){var a=yV(n,e,o),s=t.ins[o].index,u=a.outs[s];i+=u.value}}));var o=t.outs.reduce((function(e,t){return e+t.value}),0),a=i-o;if(a<0)throw new Error("Outputs are spending more than Inputs");var s=t.virtualSize();n.__FEE=a,n.__EXTRACTED_TX=t,n.__FEE_RATE=Math.floor(a/s)}function yV(e,t,n){var r=e.__NON_WITNESS_UTXO_TX_CACHE;return r[n]||gV(e,t,n),r[n]}function mV(e,t,n){if(void 0!==t.witnessUtxo)return t.witnessUtxo.script;if(void 0!==t.nonWitnessUtxo)return yV(n,t,e).outs[n.__TX.ins[e].index].script;throw new Error("Can't find pubkey in input without Utxo data")}function wV(e){return 33===e.length&&Oq.isCanonicalPubKey(e)}function bV(e,t,n,r,i){var o,a=tV(e),s=a&&r&&eV(r),u=eV(e);if(a&&void 0===r)throw new Error("scriptPubkey is P2SH but redeemScript missing");if((u||s)&&void 0===i)throw new Error("scriptPubkey or redeemScript is P2WSH but witnessScript missing");return s?(o=i,uV(t,e,r,n),lV(t,r,i,n),IV(o)):u?(o=i,lV(t,e,i,n),IV(o)):a?(o=r,uV(t,e,r,n)):o=e,{meaningfulScript:o,type:s?"p2sh-p2wsh":a?"p2sh":u?"p2wsh":"raw"}}function IV(e){if($q(e)||tV(e))throw new Error("P2WPKH or P2SH can not be contained within P2WSH")}function BV(e,t){var n=(0,Tq.hash160)(e),r=Oq.decompile(t);if(null===r)throw new Error("Unknown script error");return r.some((function(t){return"number"!=typeof t&&(t.equals(e)||t.equals(n))}))}function EV(e){return $q(e)?"witnesspubkeyhash":Zq(e)?"pubkeyhash":Xq(e)?"multisig":Wq(e)?"pubkey":"nonstandard"}function CV(e){return k(Array(e).keys())}!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Transaction=e.opcodes=e.Psbt=e.Block=e.script=e.payments=e.networks=e.crypto=e.address=void 0;var t=BU;e.address=t;var n=WL;e.crypto=n;var r=EU;e.networks=r;var i=CU;e.payments=i;var o=kU;e.script=o;var a=nj;Object.defineProperty(e,"Block",{enumerable:!0,get:function(){return a.Block}});var s=Hj;Object.defineProperty(e,"Psbt",{enumerable:!0,get:function(){return s.Psbt}});var u=QU;Object.defineProperty(e,"opcodes",{enumerable:!0,get:function(){return u.OPS}});var l=gj;Object.defineProperty(e,"Transaction",{enumerable:!0,get:function(){return l.Transaction}})}(IU);var xV={exports:{}};function kV(e,t){var n=function(e){for(var t=function(e){var t=mU.from(Object.assign(Object.assign({},e),{crv:"K-256"}),"jwk").toString("blk","public"),n=hx.publicKeyConvert(bU.from(t,"hex"),!0);return bU.from(n).toString("hex")}(e),n=bU.from(t,"hex"),r=32-n.length;r>0;)n=bU.concat([bU.from("00","hex"),n]),r--;return n}(e.publicKeyJwk),r=bF("errors","identityErrorBaseMessage"),i="";switch(t.code){case Dl.Bitcoin:case Dl.Mocknet:case Dl.Testnet:i=function(e,t){return IU.payments.p2pkh({pubkey:e,network:IU.networks[t.code]}).address}(n,t);break;case Dl.Ethmain:case Dl.Ethropst:case Dl.Ethrinkeby:case Dl.Ethgoerli:case Dl.Ethsepolia:i=function(e,t){var n=e.toString("hex"),r=new BI.ec("secp256k1").keyFromPublic(n,"hex").getPublic().encode("hex").slice(2),i=Yo;return"0x".concat(xV.exports.keccak256(i.from(r,"hex")).slice(24).toString())}(n);break;default:throw new yF("deriveIssuingAddressFromPublicKey","".concat(r," - ").concat(bF("errors","deriveIssuingAddressFromPublicKey")))}return i}function SV(e){if(e){var t="string"==typeof e?e:e.code;return!!Object.keys(Ul).some((function(e){return e===t}))&&!!Ul[t].test}return!1}!function(e){!function(){var t="input is invalid type",n="object"==("undefined"==typeof window?"undefined":i(window)),r=n?window:{};r.JS_SHA3_NO_WINDOW&&(n=!1);var o=!n&&"object"==("undefined"==typeof self?"undefined":i(self));!r.JS_SHA3_NO_NODE_JS&&"object"==i(lA)&&lA.versions&&lA.versions.node?r=No:o&&(r=self);var a=!r.JS_SHA3_NO_COMMON_JS&&e.exports,s=!r.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,u="0123456789abcdef".split(""),l=[4,1024,262144,67108864],A=[0,8,16,24],c=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],h=[224,256,384,512],f=[128,256],d=["hex","buffer","arrayBuffer","array","digest"],p={128:168,256:136};!r.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!s||!r.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(e){return"object"==i(e)&&e.buffer&&e.buffer.constructor===ArrayBuffer});for(var g=function(e,t,n){return function(r){return new N(e,t,e).update(r)[n]()}},v=function(e,t,n){return function(r,i){return new N(e,t,i).update(r)[n]()}},y=function(e,t,n){return function(t,r,i,o){return B["cshake"+e].update(t,r,i,o)[n]()}},m=function(e,t,n){return function(t,r,i,o){return B["kmac"+e].update(t,r,i,o)[n]()}},w=function(e,t,n,r){for(var i=0;i<d.length;++i){var o=d[i];e[o]=t(n,r,o)}return e},b=function(e,t){var n=g(e,t,"hex");return n.create=function(){return new N(e,t,e)},n.update=function(e){return n.create().update(e)},w(n,g,e,t)},I=[{name:"keccak",padding:[1,256,65536,16777216],bits:h,createMethod:b},{name:"sha3",padding:[6,1536,393216,100663296],bits:h,createMethod:b},{name:"shake",padding:[31,7936,2031616,520093696],bits:f,createMethod:function(e,t){var n=v(e,t,"hex");return n.create=function(n){return new N(e,t,n)},n.update=function(e,t){return n.create(t).update(e)},w(n,v,e,t)}},{name:"cshake",padding:l,bits:f,createMethod:function(e,t){var n=p[e],r=y(e,0,"hex");return r.create=function(r,i,o){return i||o?new N(e,t,r).bytepad([i,o],n):B["shake"+e].create(r)},r.update=function(e,t,n,i){return r.create(t,n,i).update(e)},w(r,y,e,t)}},{name:"kmac",padding:l,bits:f,createMethod:function(e,t){var n=p[e],r=m(e,0,"hex");return r.create=function(r,i,o){return new D(e,t,i).bytepad(["KMAC",o],n).bytepad([r],n)},r.update=function(e,t,n,i){return r.create(e,n,i).update(t)},w(r,m,e,t)}}],B={},E=[],C=0;C<I.length;++C)for(var x=I[C],k=x.bits,S=0;S<k.length;++S){var Q=x.name+"_"+k[S];if(E.push(Q),B[Q]=x.createMethod(k[S],x.padding),"sha3"!==x.name){var _=x.name+k[S];E.push(_),B[_]=B[Q]}}function N(e,t,n){this.blocks=[],this.s=[],this.padding=t,this.outputBits=n,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(e<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=n>>5,this.extraBytes=(31&n)>>3;for(var r=0;r<50;++r)this.s[r]=0}function D(e,t,n){N.call(this,e,t,n)}N.prototype.update=function(e){if(this.finalized)throw new Error("finalize already called");var n,r=i(e);if("string"!==r){if("object"!==r)throw new Error(t);if(null===e)throw new Error(t);if(s&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||s&&ArrayBuffer.isView(e)))throw new Error(t);n=!0}for(var o,a,u=this.blocks,l=this.byteCount,c=e.length,h=this.blockCount,f=0,d=this.s;f<c;){if(this.reset)for(this.reset=!1,u[0]=this.block,o=1;o<h+1;++o)u[o]=0;if(n)for(o=this.start;f<c&&o<l;++f)u[o>>2]|=e[f]<<A[3&o++];else for(o=this.start;f<c&&o<l;++f)(a=e.charCodeAt(f))<128?u[o>>2]|=a<<A[3&o++]:a<2048?(u[o>>2]|=(192|a>>6)<<A[3&o++],u[o>>2]|=(128|63&a)<<A[3&o++]):a<55296||a>=57344?(u[o>>2]|=(224|a>>12)<<A[3&o++],u[o>>2]|=(128|a>>6&63)<<A[3&o++],u[o>>2]|=(128|63&a)<<A[3&o++]):(a=65536+((1023&a)<<10|1023&e.charCodeAt(++f)),u[o>>2]|=(240|a>>18)<<A[3&o++],u[o>>2]|=(128|a>>12&63)<<A[3&o++],u[o>>2]|=(128|a>>6&63)<<A[3&o++],u[o>>2]|=(128|63&a)<<A[3&o++]);if(this.lastByteIndex=o,o>=l){for(this.start=o-l,this.block=u[h],o=0;o<h;++o)d[o]^=u[o];F(d),this.reset=!0}else this.start=o}return this},N.prototype.encode=function(e,t){var n=255&e,r=1,i=[n];for(n=255&(e>>=8);n>0;)i.unshift(n),n=255&(e>>=8),++r;return t?i.push(r):i.unshift(r),this.update(i),i.length},N.prototype.encodeString=function(e){var n,r=i(e);if("string"!==r){if("object"!==r)throw new Error(t);if(null===e)throw new Error(t);if(s&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||s&&ArrayBuffer.isView(e)))throw new Error(t);n=!0}var o=0,a=e.length;if(n)o=a;else for(var u=0;u<e.length;++u){var l=e.charCodeAt(u);l<128?o+=1:l<2048?o+=2:l<55296||l>=57344?o+=3:(l=65536+((1023&l)<<10|1023&e.charCodeAt(++u)),o+=4)}return o+=this.encode(8*o),this.update(e),o},N.prototype.bytepad=function(e,t){for(var n=this.encode(t),r=0;r<e.length;++r)n+=this.encodeString(e[r]);var i=t-n%t,o=[];return o.length=i,this.update(o),this},N.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex,n=this.blockCount,r=this.s;if(e[t>>2]|=this.padding[3&t],this.lastByteIndex===this.byteCount)for(e[0]=e[n],t=1;t<n+1;++t)e[t]=0;for(e[n-1]|=2147483648,t=0;t<n;++t)r[t]^=e[t];F(r)}},N.prototype.toString=N.prototype.hex=function(){this.finalize();for(var e,t=this.blockCount,n=this.s,r=this.outputBlocks,i=this.extraBytes,o=0,a=0,s="";a<r;){for(o=0;o<t&&a<r;++o,++a)e=n[o],s+=u[e>>4&15]+u[15&e]+u[e>>12&15]+u[e>>8&15]+u[e>>20&15]+u[e>>16&15]+u[e>>28&15]+u[e>>24&15];a%t==0&&(F(n),o=0)}return i&&(e=n[o],s+=u[e>>4&15]+u[15&e],i>1&&(s+=u[e>>12&15]+u[e>>8&15]),i>2&&(s+=u[e>>20&15]+u[e>>16&15])),s},N.prototype.arrayBuffer=function(){this.finalize();var e,t=this.blockCount,n=this.s,r=this.outputBlocks,i=this.extraBytes,o=0,a=0,s=this.outputBits>>3;e=i?new ArrayBuffer(r+1<<2):new ArrayBuffer(s);for(var u=new Uint32Array(e);a<r;){for(o=0;o<t&&a<r;++o,++a)u[a]=n[o];a%t==0&&F(n)}return i&&(u[o]=n[o],e=e.slice(0,s)),e},N.prototype.buffer=N.prototype.arrayBuffer,N.prototype.digest=N.prototype.array=function(){this.finalize();for(var e,t,n=this.blockCount,r=this.s,i=this.outputBlocks,o=this.extraBytes,a=0,s=0,u=[];s<i;){for(a=0;a<n&&s<i;++a,++s)e=s<<2,t=r[a],u[e]=255&t,u[e+1]=t>>8&255,u[e+2]=t>>16&255,u[e+3]=t>>24&255;s%n==0&&F(r)}return o&&(e=s<<2,t=r[a],u[e]=255&t,o>1&&(u[e+1]=t>>8&255),o>2&&(u[e+2]=t>>16&255)),u},D.prototype=new N,D.prototype.finalize=function(){return this.encode(this.outputBits,!0),N.prototype.finalize.call(this)};var F=function(e){var t,n,r,i,o,a,s,u,l,A,h,f,d,p,g,v,y,m,w,b,I,B,E,C,x,k,S,Q,_,N,D,F,P,U,L,M,T,R,O,H,K,j,G,q,V,z,J,Y,X,W,Z,$,ee,te,ne,re,ie,oe,ae,se,ue,le,Ae;for(r=0;r<48;r+=2)i=e[0]^e[10]^e[20]^e[30]^e[40],o=e[1]^e[11]^e[21]^e[31]^e[41],a=e[2]^e[12]^e[22]^e[32]^e[42],s=e[3]^e[13]^e[23]^e[33]^e[43],u=e[4]^e[14]^e[24]^e[34]^e[44],l=e[5]^e[15]^e[25]^e[35]^e[45],A=e[6]^e[16]^e[26]^e[36]^e[46],h=e[7]^e[17]^e[27]^e[37]^e[47],t=(f=e[8]^e[18]^e[28]^e[38]^e[48])^(a<<1|s>>>31),n=(d=e[9]^e[19]^e[29]^e[39]^e[49])^(s<<1|a>>>31),e[0]^=t,e[1]^=n,e[10]^=t,e[11]^=n,e[20]^=t,e[21]^=n,e[30]^=t,e[31]^=n,e[40]^=t,e[41]^=n,t=i^(u<<1|l>>>31),n=o^(l<<1|u>>>31),e[2]^=t,e[3]^=n,e[12]^=t,e[13]^=n,e[22]^=t,e[23]^=n,e[32]^=t,e[33]^=n,e[42]^=t,e[43]^=n,t=a^(A<<1|h>>>31),n=s^(h<<1|A>>>31),e[4]^=t,e[5]^=n,e[14]^=t,e[15]^=n,e[24]^=t,e[25]^=n,e[34]^=t,e[35]^=n,e[44]^=t,e[45]^=n,t=u^(f<<1|d>>>31),n=l^(d<<1|f>>>31),e[6]^=t,e[7]^=n,e[16]^=t,e[17]^=n,e[26]^=t,e[27]^=n,e[36]^=t,e[37]^=n,e[46]^=t,e[47]^=n,t=A^(i<<1|o>>>31),n=h^(o<<1|i>>>31),e[8]^=t,e[9]^=n,e[18]^=t,e[19]^=n,e[28]^=t,e[29]^=n,e[38]^=t,e[39]^=n,e[48]^=t,e[49]^=n,p=e[0],g=e[1],z=e[11]<<4|e[10]>>>28,J=e[10]<<4|e[11]>>>28,Q=e[20]<<3|e[21]>>>29,_=e[21]<<3|e[20]>>>29,se=e[31]<<9|e[30]>>>23,ue=e[30]<<9|e[31]>>>23,j=e[40]<<18|e[41]>>>14,G=e[41]<<18|e[40]>>>14,U=e[2]<<1|e[3]>>>31,L=e[3]<<1|e[2]>>>31,v=e[13]<<12|e[12]>>>20,y=e[12]<<12|e[13]>>>20,Y=e[22]<<10|e[23]>>>22,X=e[23]<<10|e[22]>>>22,N=e[33]<<13|e[32]>>>19,D=e[32]<<13|e[33]>>>19,le=e[42]<<2|e[43]>>>30,Ae=e[43]<<2|e[42]>>>30,te=e[5]<<30|e[4]>>>2,ne=e[4]<<30|e[5]>>>2,M=e[14]<<6|e[15]>>>26,T=e[15]<<6|e[14]>>>26,m=e[25]<<11|e[24]>>>21,w=e[24]<<11|e[25]>>>21,W=e[34]<<15|e[35]>>>17,Z=e[35]<<15|e[34]>>>17,F=e[45]<<29|e[44]>>>3,P=e[44]<<29|e[45]>>>3,C=e[6]<<28|e[7]>>>4,x=e[7]<<28|e[6]>>>4,re=e[17]<<23|e[16]>>>9,ie=e[16]<<23|e[17]>>>9,R=e[26]<<25|e[27]>>>7,O=e[27]<<25|e[26]>>>7,b=e[36]<<21|e[37]>>>11,I=e[37]<<21|e[36]>>>11,$=e[47]<<24|e[46]>>>8,ee=e[46]<<24|e[47]>>>8,q=e[8]<<27|e[9]>>>5,V=e[9]<<27|e[8]>>>5,k=e[18]<<20|e[19]>>>12,S=e[19]<<20|e[18]>>>12,oe=e[29]<<7|e[28]>>>25,ae=e[28]<<7|e[29]>>>25,H=e[38]<<8|e[39]>>>24,K=e[39]<<8|e[38]>>>24,B=e[48]<<14|e[49]>>>18,E=e[49]<<14|e[48]>>>18,e[0]=p^~v&m,e[1]=g^~y&w,e[10]=C^~k&Q,e[11]=x^~S&_,e[20]=U^~M&R,e[21]=L^~T&O,e[30]=q^~z&Y,e[31]=V^~J&X,e[40]=te^~re&oe,e[41]=ne^~ie&ae,e[2]=v^~m&b,e[3]=y^~w&I,e[12]=k^~Q&N,e[13]=S^~_&D,e[22]=M^~R&H,e[23]=T^~O&K,e[32]=z^~Y&W,e[33]=J^~X&Z,e[42]=re^~oe&se,e[43]=ie^~ae&ue,e[4]=m^~b&B,e[5]=w^~I&E,e[14]=Q^~N&F,e[15]=_^~D&P,e[24]=R^~H&j,e[25]=O^~K&G,e[34]=Y^~W&$,e[35]=X^~Z&ee,e[44]=oe^~se&le,e[45]=ae^~ue&Ae,e[6]=b^~B&p,e[7]=I^~E&g,e[16]=N^~F&C,e[17]=D^~P&x,e[26]=H^~j&U,e[27]=K^~G&L,e[36]=W^~$&q,e[37]=Z^~ee&V,e[46]=se^~le&te,e[47]=ue^~Ae&ne,e[8]=B^~p&v,e[9]=E^~g&y,e[18]=F^~C&k,e[19]=P^~x&S,e[28]=j^~U&M,e[29]=G^~L&T,e[38]=$^~q&z,e[39]=ee^~V&J,e[48]=le^~te&re,e[49]=Ae^~ne&ie,e[0]^=c[r],e[1]^=c[r+1]};if(a)e.exports=B;else for(C=0;C<E.length;++C)r[E[C]]=B[E[C]]}()}(xV);var QV,_V,NV=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){e.done?i(e.value):function(e){return e instanceof n?e:new n((function(t){t(e)}))}(e.value).then(a,s)}u((r=r.apply(e,t||[])).next())}))},DV=function(e){c(n,e);var t=b(n);function n(e){var r,i=e.issuer,o=void 0===i?null:i,a=e.verificationMethod,u=void 0===a?null:a,l=e.document,A=void 0===l?null:l,c=e.proof,h=void 0===c?null:c,f=e.options,d=void 0===f?{}:f;if(s(this,n),(r=t.call(this,{type:"MerkleProof2019"})).type="MerkleProof2019",r.issuer=null,r.verificationMethod=null,r.proof=null,r.proofValue=null,r.document=null,r.explorerAPIs=[],r.documentLoader=null,r.proofVerificationProcess=["getTransactionId","computeLocalHash","fetchRemoteHash","compareHashes","checkMerkleRoot","checkReceipt"],r.identityVerificationProcess=["deriveIssuingAddressFromPublicKey","compareIssuingAddress"],r.transactionId="",!A)throw new Error("A document signed by MerkleProof2019 is required for the verification process.");return r.issuer=o,r.verificationMethod=u,r.document=A,r.setProof(h),r.setOptions(d),r.getChain(),SV(r.chain)&&(r.adaptProofVerificationProcessToMocknet(),r.adaptIdentityVerificationProcessToMocknet()),w(r)}return l(n,[{key:"setProof",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=null!=e?e:this.document.proof;if(!t)throw new Error("The passed document is not signed.");this.proof=t,this.proofValue=n.decodeMerkleProof2019(this.proof)}},{key:"verifyProof",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{documentLoader:function(e){},verifyIdentity:!0},t=e.documentLoader,n=e.verifyIdentity;return NV(this,void 0,void 0,r().mark((function e(){var i,o;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.documentLoader=t,o="",e.prev=2,e.next=5,this.verifyProcess(this.proofVerificationProcess);case 5:if(e.t0=n,!e.t0){e.next=9;break}return e.next=9,this.verifyIdentity();case 9:i=!0,e.next=15;break;case 12:e.prev=12,e.t1=e.catch(2),console.error(e.t1),i=!1,o=e.t1.message;case 15:return e.abrupt("return",{verificationMethod:this.verificationMethod,verified:i,error:o});case 16:case"end":return e.stop()}}),e,this,[[2,12]])})))}},{key:"verifyIdentity",value:function(){return NV(this,void 0,void 0,r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null==this.verificationMethod){e.next=9;break}return e.prev=1,e.next=4,this.verifyProcess(this.identityVerificationProcess);case 4:e.next=9;break;case 6:throw e.prev=6,e.t0=e.catch(1),new Error(e.t0);case 9:case"end":return e.stop()}}),e,this,[[1,6]])})))}},{key:"getProofVerificationProcess",value:function(){return this.proofVerificationProcess}},{key:"getIdentityVerificationProcess",value:function(){return this.identityVerificationProcess}},{key:"getIssuerPublicKey",value:function(){var e,t;return SV(this.chain)?"This mock chain does not support issuing addresses":null!==(t=null===(e=this.getTxData())||void 0===e?void 0:e.issuingAddress)&&void 0!==t?t:""}},{key:"getIssuanceTime",value:function(){var e,t;return null!==(t=null===(e=this.getTxData())||void 0===e?void 0:e.time)&&void 0!==t?t:""}},{key:"getChain",value:function(){return this.chain||(this.chain=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(null==e?void 0:e.anchors){var t=e.anchors[0];if("string"==typeof t)return function(e){var t,n=e.split(":");switch(n[1]){case Ul.mocknet.blinkCode:return hF(Ul.mocknet.signatureValue);case Ul.bitcoin.blinkCode:t=Ul.bitcoin.name;break;case Ul.ethmain.blinkCode:t=Ul.ethmain.name;break;default:throw new Error("Could not retrieve chain.")}var r=n[2],i=t.toLowerCase()+function(e){var t=e.substr(0,1),n=e.substr(1,e.length-1);return t.toUpperCase()+n.toLowerCase()}(r);return hF(i)}(t)}return null}(this.proofValue)),this.chain}},{key:"getTxData",value:function(){return this.txData?this.txData:(console.error("Trying to access issuing address when txData not available yet. Did you run the `verify` method yet?"),null)}},{key:"adaptProofVerificationProcessToMocknet",value:function(){fF(this.proofVerificationProcess,"getTransactionId"),fF(this.proofVerificationProcess,"fetchRemoteHash"),fF(this.proofVerificationProcess,"checkMerkleRoot")}},{key:"adaptIdentityVerificationProcessToMocknet",value:function(){this.identityVerificationProcess=[]}},{key:"setOptions",value:function(e){var t;this.explorerAPIs=null!==(t=e.explorerAPIs)&&void 0!==t?t:[],e.executeStepMethod&&"function"==typeof e.executeStepMethod&&(this.executeStep=e.executeStepMethod)}},{key:"executeStep",value:function(e,t){return NV(this,void 0,void 0,r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t();case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})))}},{key:"verifyProcess",value:function(e){return NV(this,void 0,void 0,r().mark((function t(){var n,i,o;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=F(e),t.prev=1,n.s();case 3:if((i=n.n()).done){t.next=11;break}if(this[o=i.value]){t.next=7;break}return t.abrupt("return",void console.error("verification logic for",o,"not implemented"));case 7:return t.next=9,this[o]();case 9:t.next=3;break;case 11:t.next=16;break;case 13:t.prev=13,t.t0=t.catch(1),n.e(t.t0);case 16:return t.prev=16,n.f(),t.finish(16);case 19:case"end":return t.stop()}}),t,this,[[1,13,16,19]])})))}},{key:"checkMerkleRoot",value:function(){return NV(this,void 0,void 0,r().mark((function e(){var t=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.executeStep("checkMerkleRoot",(function(){return function(e,t){if(e!==t)throw new yF("checkMerkleRoot",bF("errors","ensureMerkleRootEqual"));return!0}(t.proofValue.merkleRoot,t.txData.remoteHash)}),this.type);case 2:case"end":return e.stop()}}),e,this)})))}},{key:"compareHashes",value:function(){return NV(this,void 0,void 0,r().mark((function e(){var t=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.executeStep("compareHashes",(function(){return function(e,t){if(e!==t)throw new yF("compareHashes",bF("errors","ensureHashesEqual"));return!0}(t.localDocumentHash,t.proofValue.targetHash)}),this.type);case 2:case"end":return e.stop()}}),e,this)})))}},{key:"computeLocalHash",value:function(){return NV(this,void 0,void 0,r().mark((function e(){var t=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.executeStep("computeLocalHash",(function(){return NV(t,void 0,void 0,r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,BF(this.document,this.proof,this.documentLoader);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})))}),this.type);case 2:this.localDocumentHash=e.sent;case 3:case"end":return e.stop()}}),e,this)})))}},{key:"checkReceipt",value:function(){return NV(this,void 0,void 0,r().mark((function e(){var t=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.executeStep("checkReceipt",(function(){return function(e){var t=e.targetHash,n=e.merkleRoot;try{var r=e.path;if(r&&t)for(var i in r){var o=r[i],a=void 0;if(void 0!==o.left)a=vF("".concat(o.left).concat(t)),t=vk(a);else{if(void 0===o.right)throw new yF("checkReceipt","Trigger catch error.");a=vF("".concat(t).concat(o.right)),t=vk(a)}}}catch(e){throw new yF("checkReceipt",bF("errors","ensureValidReceipt"))}if(t!==n)throw new yF("checkReceipt",bF("errors","invalidMerkleReceipt"))}(t.proofValue)}),this.type);case 2:case"end":return e.stop()}}),e,this)})))}},{key:"getTransactionId",value:function(){return NV(this,void 0,void 0,r().mark((function e(){var t=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.transactionId=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(!e)throw new Error("DecodedProof is not set");var t=e.anchors,n=t[0];if("string"==typeof n)return n.split(":").pop();throw new Error("Could not retrieve transaction id as was provided an unexpected format")}(this.proofValue),e.next=3,this.executeStep("getTransactionId",(function(){return function(e){if("string"==typeof e&&e.length>0)return e;throw new yF("getTransactionId",bF("errors","isTransactionIdValid"))}(t.transactionId)}),this.type);case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e,this)})))}},{key:"fetchRemoteHash",value:function(){return NV(this,void 0,void 0,r().mark((function e(){var t=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.executeStep("fetchRemoteHash",(function(){return NV(t,void 0,void 0,r().mark((function e(){var t;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ff({transactionId:this.transactionId,chain:null===(t=this.chain)||void 0===t?void 0:t.code,explorerAPIs:this.explorerAPIs});case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})))}),this.type);case 2:this.txData=e.sent;case 3:case"end":return e.stop()}}),e,this)})))}},{key:"deriveIssuingAddressFromPublicKey",value:function(){return NV(this,void 0,void 0,r().mark((function e(){var t=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.executeStep("deriveIssuingAddressFromPublicKey",(function(){return kV(t.verificationMethod,t.chain)}),this.type);case 2:this.derivedIssuingAddress=e.sent;case 3:case"end":return e.stop()}}),e,this)})))}},{key:"compareIssuingAddress",value:function(){return NV(this,void 0,void 0,r().mark((function e(){var t=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.executeStep("compareIssuingAddress",(function(){return function(e,t){var n=bF("errors","identityErrorBaseMessage");if(e!==t)throw new yF("compareIssuingAddress","".concat(n," - ").concat(bF("errors","compareIssuingAddress")))}(t.getIssuerPublicKey(),t.derivedIssuingAddress)}),this.type);case 2:case"end":return e.stop()}}),e,this)})))}}],[{key:"decodeMerkleProof2019",value:function(e){return new dD.Decoder(e.proofValue).decode()}}]),n}(uF.suites.LinkedDataProof),FV=l((function e(t){s(this,e)}));function PV(e){return Array.isArray(e)?e.find((function(e){return"ChainedProof2021"!==e.type})).verificationMethod:e.verificationMethod}!function(e){e.getTransactionId="getTransactionId",e.computeLocalHash="computeLocalHash",e.fetchRemoteHash="fetchRemoteHash",e.parseIssuerKeys="parseIssuerKeys",e.compareHashes="compareHashes",e.checkImagesIntegrity="checkImagesIntegrity",e.checkMerkleRoot="checkMerkleRoot",e.checkReceipt="checkReceipt",e.retrieveVerificationMethodPublicKey="retrieveVerificationMethodPublicKey",e.deriveIssuingAddressFromPublicKey="deriveIssuingAddressFromPublicKey",e.compareIssuingAddress="compareIssuingAddress",e.checkAuthenticity="checkAuthenticity"}(QV||(QV={}));var UV=function(e){c(v,e);var t,n,i,o,u,h,f,d,p,g=b(v);function v(e){var t,n;return s(this,v),A(m(t=g.call(this,e)),"proofVerificationProcess",[QV.parseIssuerKeys,QV.checkAuthenticity]),A(m(t),"transactionId",void 0),A(m(t),"localHash",void 0),A(m(t),"documentToVerify",void 0),A(m(t),"txData",void 0),A(m(t),"chain",void 0),A(m(t),"explorerAPIs",void 0),A(m(t),"receipt",void 0),A(m(t),"issuerPublicKeyList",void 0),A(m(t),"issuer",void 0),A(m(t),"verificationMethodPublicKey",void 0),A(m(t),"derivedIssuingAddress",void 0),A(m(t),"hasDid",void 0),A(m(t),"proof",void 0),A(m(t),"type","MerkleProof2019"),A(m(t),"suite",void 0),t.executeStep=e.executeStep,t.documentToVerify=e.document,t.explorerAPIs=e.explorerAPIs,t.proof=e.proof,t.issuer=e.issuer,t.validateProofType(),t.receipt=(n=t.proof,DV.decodeMerkleProof2019(n)),t.transactionId=ek.certificates.getTransactionId(t.receipt),t.setHasDid(),t}return l(v,[{key:"init",value:(p=a(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.setVerificationSuite();case 2:this.chain=this.suite.getChain(),this.adaptVerificationProcessToChain();case 4:case"end":return e.stop()}}),e,this)}))),function(){return p.apply(this,arguments)})},{key:"verifyProof",value:(d=a(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.suite.verifyProof({verifyIdentity:!1});case 2:return e.next=4,this.verifyProcess(this.proofVerificationProcess);case 4:case"end":return e.stop()}}),e,this)}))),function(){return d.apply(this,arguments)})},{key:"verifyIdentity",value:(f=a(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.suite.verifyIdentity();case 2:case"end":return e.stop()}}),e,this)}))),function(){return f.apply(this,arguments)})},{key:"getProofVerificationSteps",value:function(e){return[].concat(k(this.suite.getProofVerificationProcess()),k(this.proofVerificationProcess)).map((function(t){return ek.verifier.convertToVerificationSubsteps(e,t)}))}},{key:"getIdentityVerificationSteps",value:function(e){return this.hasDid?this.suite.getIdentityVerificationProcess().map((function(t){return ek.verifier.convertToVerificationSubsteps(e,t)})):[]}},{key:"getIssuerPublicKey",value:function(){return this.suite.getIssuerPublicKey()}},{key:"getIssuanceTime",value:function(){return this.suite.getIssuanceTime()}},{key:"getIssuerName",value:function(){return this.issuer.name}},{key:"getIssuerProfileDomain",value:function(){var e;return null===(e=new URL(this.getIssuerProfileUrl()))||void 0===e?void 0:e.hostname}},{key:"getIssuerProfileUrl",value:function(){return this.issuer.id}},{key:"getSigningDate",value:function(){return this.proof.created}},{key:"getChain",value:function(){return this.suite.getChain()}},{key:"getReceipt",value:function(){return this.receipt}},{key:"getTransactionIdString",value:function(){return ek.certificates.getTransactionId(this.getReceipt())}},{key:"getTransactionLink",value:function(){return ek.certificates.getTransactionLink(this.getTransactionIdString(),this.getChain()).transactionLink}},{key:"getRawTransactionLink",value:function(){return ek.certificates.getTransactionLink(this.getTransactionIdString(),this.getChain()).rawTransactionLink}},{key:"executeStep",value:(h=a(r().mark((function e(t,n,i){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:throw new Error("executeStep method needs to be overwritten by injecting from Verifier");case 1:case"end":return e.stop()}}),e)}))),function(e,t,n){return h.apply(this,arguments)})},{key:"setVerificationSuite",value:(u=a(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.setIssuerFromProofVerificationMethod();case 2:this.verificationMethodPublicKey=kk(this.getTargetVerificationMethodContainer(),PV(this.proof)),this.suite=new DV({document:this.documentToVerify,proof:this.proof,verificationMethod:this.verificationMethodPublicKey,options:{explorerAPIs:this.explorerAPIs,executeStepMethod:this.executeStep}});case 4:case"end":return e.stop()}}),e,this)}))),function(){return u.apply(this,arguments)})},{key:"adaptVerificationProcessToChain",value:function(){ek.chains.isMockChain(this.chain)&&(nd(this.proofVerificationProcess,QV.parseIssuerKeys),nd(this.proofVerificationProcess,QV.checkAuthenticity))}},{key:"getTargetVerificationMethodContainer",value:function(){var e;return null!==(e=this.issuer.didDocument)&&void 0!==e?e:this.issuer}},{key:"isProofChain",value:function(){return"ChainedProof2021"===this.proof.type}},{key:"setIssuerFromProofVerificationMethod",value:(o=a(r().mark((function e(){var t;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.isProofChain()){e.next=5;break}return t=this.proof.verificationMethod.split("#")[0],e.next=4,ek.verifier.getIssuerProfile(t);case 4:this.issuer=e.sent;case 5:case"end":return e.stop()}}),e,this)}))),function(){return o.apply(this,arguments)})},{key:"setHasDid",value:function(){if(this.isProofChain()){var e=this.proof.verificationMethod.split("#")[0];this.hasDid=ld(e)}else this.hasDid=!!this.issuer.didDocument}},{key:"validateProofType",value:function(){var e=this.isProofChain()?this.proof.chainedProofType:this.proof.type;if(e!==this.type)throw new Error("Incompatible proof type passed. Expected: ".concat(this.type,", Got: ").concat(e))}},{key:"verifyProcess",value:(i=a(r().mark((function e(t){var n,i,o;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=F(t),e.prev=1,n.s();case 3:if((i=n.n()).done){e.next=11;break}if(this[o=i.value]){e.next=7;break}return e.abrupt("return",void console.error("verification logic for",o,"not implemented"));case 7:return e.next=9,this[o]();case 9:e.next=3;break;case 11:e.next=16;break;case 13:e.prev=13,e.t0=e.catch(1),n.e(e.t0);case 16:return e.prev=16,n.f(),e.finish(16);case 19:case"end":return e.stop()}}),e,this,[[1,13,16,19]])}))),function(e){return i.apply(this,arguments)})},{key:"parseIssuerKeys",value:(n=a(r().mark((function e(){var t=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.executeStep(QV.parseIssuerKeys,(function(){return ek.verifier.parseIssuerKeys(t.issuer)}),this.type);case 2:this.issuerPublicKeyList=e.sent;case 3:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"checkAuthenticity",value:(t=a(r().mark((function e(){var t=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.executeStep(QV.checkAuthenticity,(function(){return Ck(t.issuerPublicKeyList,t.getIssuerPublicKey(),t.getIssuanceTime())}),this.type);case 2:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}]),v}(FV);!function(e){e.getTransactionId="getTransactionId",e.computeLocalHash="computeLocalHash",e.fetchRemoteHash="fetchRemoteHash",e.parseIssuerKeys="parseIssuerKeys",e.compareHashes="compareHashes",e.checkMerkleRoot="checkMerkleRoot",e.checkReceipt="checkReceipt",e.checkAuthenticity="checkAuthenticity"}(_V||(_V={}));var LV=function(e){c(I,e);var t,n,i,o,u,h,f,d,p,g,v,y,w=b(I);function I(e){var t;return s(this,I),A(m(t=w.call(this,e)),"verificationProcess",[_V.getTransactionId,_V.computeLocalHash,_V.fetchRemoteHash,_V.compareHashes,_V.checkMerkleRoot,_V.checkReceipt,_V.parseIssuerKeys,_V.checkAuthenticity]),A(m(t),"transactionId",void 0),A(m(t),"localHash",void 0),A(m(t),"documentToVerify",void 0),A(m(t),"txData",void 0),A(m(t),"chain",void 0),A(m(t),"explorerAPIs",void 0),A(m(t),"receipt",void 0),A(m(t),"issuerPublicKeyList",void 0),A(m(t),"issuer",void 0),A(m(t),"proof",void 0),A(m(t),"type","MerkleProof2017"),e.executeStep&&(t.executeStep=e.executeStep),t.documentToVerify=e.document,t.explorerAPIs=e.explorerAPIs,t.issuer=e.issuer,t.proof=e.proof,t.validateProofType(),t.receipt=t.documentToVerify.signature,t.chain=ek.certificates.getChain("",t.receipt),t.transactionId=ek.certificates.getTransactionId(t.receipt),t.adaptVerificationProcessToChain(),t}return l(I,[{key:"init",value:(y=a(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)}))),function(){return y.apply(this,arguments)})},{key:"verifyProof",value:(v=a(r().mark((function e(){var t,n,i;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=F(this.verificationProcess),e.prev=1,t.s();case 3:if((n=t.n()).done){e.next=11;break}if(this[i=n.value]){e.next=7;break}return e.abrupt("return",void console.error("verification logic for",i,"not implemented"));case 7:return e.next=9,this[i]();case 9:e.next=3;break;case 11:e.next=16;break;case 13:e.prev=13,e.t0=e.catch(1),t.e(e.t0);case 16:return e.prev=16,t.f(),e.finish(16);case 19:case"end":return e.stop()}}),e,this,[[1,13,16,19]])}))),function(){return v.apply(this,arguments)})},{key:"verifyIdentity",value:(g=a(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)}))),function(){return g.apply(this,arguments)})},{key:"getProofVerificationSteps",value:function(e){return this.verificationProcess.map((function(t){return ek.verifier.convertToVerificationSubsteps(e,t)}))}},{key:"getIdentityVerificationSteps",value:function(){return[]}},{key:"getIssuerPublicKey",value:function(){return ek.chains.isMockChain(this.chain)?"This mock chain does not support issuing addresses":this.txData?this.txData.issuingAddress:void console.error("Trying to access issuing address when txData not available yet. Did you run the `verify` method yet?")}},{key:"getIssuerName",value:function(){return this.issuer.name}},{key:"getIssuerProfileDomain",value:function(){var e;return null===(e=new URL(this.getIssuerProfileUrl()))||void 0===e?void 0:e.hostname}},{key:"getIssuerProfileUrl",value:function(){return this.issuer.id}},{key:"getSigningDate",value:function(){return this.documentToVerify.issuedOn}},{key:"getChain",value:function(){return this.chain}},{key:"getReceipt",value:function(){return this.receipt}},{key:"getTransactionIdString",value:function(){return ek.certificates.getTransactionId(this.getReceipt())}},{key:"getTransactionLink",value:function(){return ek.certificates.getTransactionLink(this.getTransactionIdString(),this.getChain()).transactionLink}},{key:"getRawTransactionLink",value:function(){return ek.certificates.getTransactionLink(this.getTransactionIdString(),this.getChain()).rawTransactionLink}},{key:"validateProofType",value:function(){if(this.proof.type[0]!==this.type)throw new Error("Incompatible proof type passed. Expected: ".concat(this.type,", Got: ").concat(this.proof.type[0]))}},{key:"adaptVerificationProcessToChain",value:function(){ek.chains.isMockChain(this.chain)&&(nd(this.verificationProcess,_V.getTransactionId),nd(this.verificationProcess,_V.fetchRemoteHash),nd(this.verificationProcess,_V.parseIssuerKeys),nd(this.verificationProcess,_V.checkMerkleRoot),nd(this.verificationProcess,_V.checkAuthenticity))}},{key:"executeStep",value:(p=a(r().mark((function e(t,n,i){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:throw new Error("doAction method needs to be overwritten by injecting from CVJS");case 1:case"end":return e.stop()}}),e)}))),function(e,t,n){return p.apply(this,arguments)})},{key:"getTransactionId",value:(d=a(r().mark((function e(){var t=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.executeStep(_V.getTransactionId,(function(){return function(e){if("string"==typeof e&&e.length>0)return e;throw new $f("getTransactionId",zf("errors","isTransactionIdValid"))}(t.transactionId)}),this.type);case 2:case"end":return e.stop()}}),e,this)}))),function(){return d.apply(this,arguments)})},{key:"computeLocalHash",value:(f=a(r().mark((function e(){var t=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.executeStep(_V.computeLocalHash,a(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Bk(t.documentToVerify);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)}))),this.type);case 2:this.localHash=e.sent;case 3:case"end":return e.stop()}}),e,this)}))),function(){return f.apply(this,arguments)})},{key:"fetchRemoteHash",value:(h=a(r().mark((function e(){var t=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.executeStep(_V.fetchRemoteHash,a(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,ek.verifier.lookForTx({transactionId:t.transactionId,chain:t.chain.code,explorerAPIs:t.explorerAPIs});case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)}))),this.type);case 2:this.txData=e.sent;case 3:case"end":return e.stop()}}),e,this)}))),function(){return h.apply(this,arguments)})},{key:"compareHashes",value:(u=a(r().mark((function e(){var t=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.executeStep(_V.compareHashes,(function(){return function(e,t){if(e!==t)throw new $f("compareHashes",zf("errors","ensureHashesEqual"));return!0}(t.localHash,t.receipt.targetHash)}),this.type);case 2:case"end":return e.stop()}}),e,this)}))),function(){return u.apply(this,arguments)})},{key:"checkMerkleRoot",value:(o=a(r().mark((function e(){var t=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.executeStep(_V.checkMerkleRoot,(function(){return function(e,t){if(e!==t)throw new $f("checkMerkleRoot",zf("errors","ensureMerkleRootEqual"));return!0}(t.receipt.merkleRoot,t.txData.remoteHash)}),this.type);case 2:case"end":return e.stop()}}),e,this)}))),function(){return o.apply(this,arguments)})},{key:"checkReceipt",value:(i=a(r().mark((function e(){var t=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.executeStep(_V.checkReceipt,(function(){return function(e){var t=e.targetHash,n=e.merkleRoot;try{var r=e.proof||e.path;if(r)for(var i in r){var o=r[i],a=void 0;if(void 0!==o.left)a=yk("".concat(o.left).concat(t)),t=vk(a);else{if(void 0===o.right)throw new $f("checkReceipt","Trigger catch error.");a=yk("".concat(t).concat(o.right)),t=vk(a)}}}catch(e){throw new $f("checkReceipt",zf("errors","ensureValidReceipt"))}if(t!==n)throw new $f("checkReceipt",zf("errors","invalidMerkleReceipt"))}(t.receipt)}),this.type);case 2:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"parseIssuerKeys",value:(n=a(r().mark((function e(){var t=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.executeStep(_V.parseIssuerKeys,(function(){return ek.verifier.parseIssuerKeys(t.issuer)}),this.type);case 2:this.issuerPublicKeyList=e.sent;case 3:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"checkAuthenticity",value:(t=a(r().mark((function e(){var t=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.executeStep(_V.checkAuthenticity,(function(){return Ck(t.issuerPublicKeyList,t.txData.issuingAddress,t.txData.time)}),this.type);case 2:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}]),I}(FV),MV={};function TV(e,t){return function(e,t,n){if(!(e instanceof Uint8Array))throw new TypeError('"input" must be a Uint8Array.');if(void 0!==n&&"number"!=typeof n)throw new TypeError('"maxline" must be a number.');if(0===e.length)return"";var r="",i=0,o=t.length,a=t.charAt(0),s=[0];for(i=0;i<e.length;++i){for(var u=e[i],l=0;l<s.length;++l)u+=s[l]<<8,s[l]=u%o,u=u/o|0;for(;u>0;)s.push(u%o),u=u/o|0}for(i=0;0===e[i]&&i<e.length-1;++i)r+=a;for(i=s.length-1;i>=0;--i)r+=t[s[i]];if(n){var A=new RegExp(".{1,"+n+"}","g");r=r.match(A).join("\r\n")}return r}(e,"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",t)}function RV(e){return function(e,t){if("string"!=typeof e)throw new TypeError('"input" must be a string.');if(0===e.length)return new Uint8Array;var n=MV[t];if(!n){n=MV[t]=[];for(var r=0;r<t.length;++r)n[t.charCodeAt(r)]=r}e=e.replace(/\s/g,"");for(var i=t.length,o=t.charAt(0),a=[0],s=0;s<e.length;s++){var u=n[e.charCodeAt(s)];if(void 0===u)return;for(var l=u,A=0;A<a.length;++A)l+=a[A]*i,a[A]=255&l,l>>=8;for(;l>0;)a.push(255&l),l>>=8}for(var c=0;e[c]===o&&c<e.length-1;++c)a.push(0);return new Uint8Array(a.reverse())}
530
530
  /*!
531
531
  * Copyright (c) 2019-2022 Digital Bazaar, Inc. All rights reserved.
532
532
  */(e,"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")}
@@ -736,27 +736,27 @@ var _fe,Nfe,Dfe,Ffe=function(e){return function(e){return e.__litDirective=!0,e}
736
736
  <span class='buv-u-visually-hidden'>${r}</span>
737
737
  <slot></slot>
738
738
  </a>
739
- `}),{mapStateToProps:(e,t)=>({isTestChain:gAe(e,parseInt(t.index,10)),status:rfe(e,t.suiteType)}),ownProps:{suiteType:String,index:String}});window.customElements.define("buv-suite-verification-status",Mfe);const Tfe=TAe((function({recipientName:e,issuedOn:t,issueDate:n,issuerName:r,issuerProfileDomain:i=[],issuerProfileUrl:o=[],issuerPublicKey:a=[],transactionId:s=[],direction:u,hideRecipientName:l,signatureSuiteType:A=[]}){const c=[];l||c.push({title:so("text.recipient"),value:e}),c.push({title:so("text.issueDate"),value:qe`<time datetime$='${t}'>${n}</time>`},{title:so("text.issuerName"),value:r||so("errors.noIssuerName")});for(let e=0;e<a.length;e++){let t="";a.length>1&&(t=`${co(e+1)} `),A[e]&&c.push({title:`${t}${so("text.signatureSuiteType")}`,value:qe`<buv-suite-verification-status suiteType$='${A[e]}' index$='${e}'>
740
- ${A[e]}
741
- </buv-suite-verification-status>`}),i[e]&&c.push({title:`${t}${so("text.issuerProfileDomain")}`,value:qe`<a href$='${o[e]}' target="_blank">${i[e]}</a>`}),a[e]&&c.push({title:`${t}${so("text.issuerPublicKey")}`,value:a[e]}),s[e]&&c.push({title:`${t}${so("text.transactionId")}`,value:s[e]})}const h="column"===u,f=c.map((e=>function({title:e,value:t,isDisplayColumn:n,renderInline:r=!1}){const i=["buv-c-certificate-details__group",n?"":"buv-c-certificate-details__group--row"].join(" "),o=["buv-c-certificate-details__title",n?"":"buv-o-text-11"].join(" "),a=["buv-c-certificate-details__value",r?"buv-c-certificate-details--inline":""].join(" ");return qe`<div class$='${i}'>
739
+ `}),{mapStateToProps:(e,t)=>({isTestChain:gAe(e,parseInt(t.index,10)),status:rfe(e,t.suiteType)}),ownProps:{suiteType:String,index:String}});function Tfe(e){return e?` (${e})`:""}window.customElements.define("buv-suite-verification-status",Mfe);const Rfe=TAe((function({recipientName:e,issuedOn:t,issueDate:n,issuerName:r,issuerProfileDomain:i=[],issuerProfileUrl:o=[],issuerPublicKey:a=[],transactionId:s=[],direction:u,hideRecipientName:l,signatureSuiteType:A=[],chain:c=[]}){const h=[];l||h.push({title:so("text.recipient"),value:e}),h.push({title:so("text.issueDate"),value:qe`<time datetime$='${t}'>${n}</time>`},{title:so("text.issuerName"),value:r||so("errors.noIssuerName")});for(let e=0;e<a.length;e++){let t="";a.length>1&&(t=`${co(e+1)} `),A[e]&&h.push({title:`${t}${so("text.signatureSuiteType")}`,value:qe`<buv-suite-verification-status suiteType$='${A[e]}' index$='${e}'>
740
+ ${A[e]}${Tfe(c[e])}
741
+ </buv-suite-verification-status>`}),i[e]&&h.push({title:`${t}${so("text.issuerProfileDomain")}`,value:qe`<a href$='${o[e]}' target="_blank">${i[e]}</a>`}),a[e]&&h.push({title:`${t}${so("text.issuerPublicKey")}`,value:a[e]}),s[e]&&h.push({title:`${t}${so("text.transactionId")}`,value:s[e]})}const f="column"===u,d=h.map((e=>function({title:e,value:t,isDisplayColumn:n,renderInline:r=!1}){const i=["buv-c-certificate-details__group",n?"":"buv-c-certificate-details__group--row"].join(" "),o=["buv-c-certificate-details__title",n?"":"buv-o-text-11"].join(" "),a=["buv-c-certificate-details__value",r?"buv-c-certificate-details--inline":""].join(" ");return qe`<div class$='${i}'>
742
742
  <dt class$='${o}'>${e}</dt>
743
743
  <dd class$='${a}'>${t}</dd>
744
- </div>`}(Object.assign(Object.assign({},e),{isDisplayColumn:h})))),d=["buv-c-certificate-details","buv-o-text-13",h?"buv-c-certificate-details--column":""].join(" ");return qe`
744
+ </div>`}(Object.assign(Object.assign({},e),{isDisplayColumn:f})))),p=["buv-c-certificate-details","buv-o-text-13",f?"buv-c-certificate-details--column":""].join(" ");return qe`
745
745
  ${Ufe}
746
- <dl class$='${d}'>
747
- ${f}
746
+ <dl class$='${p}'>
747
+ ${d}
748
748
  </dl>
749
- `}),{mapStateToProps:e=>({recipientName:iAe(e),issueDate:rAe(e),issuedOn:nAe(e),issuerName:aAe(e),transactionId:fAe(e),issuerPublicKey:bAe(e),issuerProfileDomain:BAe(e),issuerProfileUrl:IAe(e),signatureSuiteType:EAe(e)}),ownProps:{direction:String,hideRecipientName:Boolean}});var Rfe;window.customElements.define("buv-certificate-details",Tfe);var Ofe,Hfe,Kfe=qe(Rfe||(Rfe=E(['<style>.buv-o-text-11{font-size:11px}.buv-o-text-12{font-size:12px}.buv-o-text-13{font-size:13px}.buv-o-text-15{font-size:15px;line-height:20px}.buv-o-text-bold{font-weight:bold}.buv-o-text-11{font-size:11px}.buv-o-text-12{font-size:12px}.buv-o-text-13{font-size:13px}.buv-o-text-15{font-size:15px;line-height:20px}.buv-o-text-bold{font-weight:bold}.buv-c-certificate--fixed-width{max-width:460px;min-width:0;margin:0 auto}.buv-c-full-certificate{box-shadow:0 1px 5px rgba(0,0,0,.15);padding:20px;background-color:#fff;display:block;font-family:serif;text-align:center;color:#49555f;font-size:12px;overflow:auto;word-wrap:break-word;height:100vh;max-height:calc(100vh - 150px);line-height:initial}.buv-c-full-certificate section{max-width:100%;padding:0}.buv-c-full-certificate img{max-width:100%;height:auto;width:inherit}@media only screen and (min-width: 640px){.buv-c-full-certificate{font-size:16px}}.buv-c-full-certificate__button{margin-top:15px}.buv-c-full-certificate__details{display:flex;justify-content:space-between;margin-top:15px}.buv-c-full-certificate__details-list{min-width:calc(100% - 190px);width:calc(100% - 105px)}.buv-c-full-certificate .buv-c-full-certificate-img{max-width:125px;max-height:125px}.buv-c-full-certificate__titles::before,.buv-c-full-certificate__titles::after{content:" ";display:block;background-color:#edf1f4;width:30%;text-align:center;margin:20px auto;height:2px}.buv-c-full-certificate__title{font-weight:normal;margin:0}.buv-c-full-certificate__title--name{color:#000;font-size:30px;margin-bottom:10px}.buv-c-full-certificate__title--main{font-size:21px;margin-bottom:10px}.buv-c-full-certificate__title--sub{font-size:16px;font-style:italic}.buv-c-full-certificate__description{margin:0 0 40px;line-height:1.5}.buv-c-full-certificate-signatures{list-style-type:none;display:flex;justify-content:space-around;width:100%;margin:0 0 20px;padding:0}.buv-c-full-certificate-signatures__signature{margin-right:30px;display:flex;flex-direction:column;justify-content:center}.buv-c-full-certificate-signatures__signature:last-child{margin:0}.buv-c-full-certificate-img--secondary{max-width:150px;max-height:150px}</style>'])));var jfe=TAe((function(e){var t=e.hasCertificateDefinition,n=e.certificateImage,r=e.certificateTitle,i=e.certificateSeal,o=e.certificateSignatures,a=e.certificateSubtitle,s=e.certificateDescription,u=e.recipientName,l=e.issuerName;if(!t)return null;var A=o.map((function(e){return qe(Ofe||(Ofe=E(["\n <li class='buv-c-full-certificate-signatures__signature'>\n <img class='buv-c-full-certificate-img--secondary' src='","' alt='"," ","'/>\n <span class='buv-o-text-12'>","</span>\n </li>\n "])),e.image,so("text.signed"),e.jobTitle,e.jobTitle)}));return qe(Hfe||(Hfe=E(["\n ","\n <section class='buv-c-full-certificate'>\n <img class='buv-c-full-certificate-img' src='","' alt='","'/>\n <div class='buv-c-full-certificate__titles'>\n <h1 class='buv-c-full-certificate__title buv-c-full-certificate__title--name'>","</h1>\n <h2 class='buv-c-full-certificate__title buv-c-full-certificate__title--main'>","</h2>\n <h3 class='buv-c-full-certificate__title buv-c-full-certificate__title--sub'>","</h3>\n </div>\n <p class='buv-c-full-certificate__description'>","</p>\n <ul class='buv-c-full-certificate-signatures'>\n ","\n </ul>\n <img class='buv-c-full-certificate-img--secondary' src='","' alt='"," ","'/>\n </section>\n "])),Kfe,n,r,u,r,a,s,A,i,so("text.certified"),l)}),{mapStateToProps:function(e){return{hasCertificateDefinition:!!eAe(e),certificateImage:xAe(e),certificateTitle:oAe(e),certificateSubtitle:kAe(e),certificateDescription:SAe(e),certificateSeal:_Ae(e),certificateSignatures:QAe(e),recipientName:iAe(e),issuerName:aAe(e)}}});function Gfe(e,t){if(Array.prototype.indexOf)return e.indexOf(t);for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}function qfe(e,t){for(var n=e.length-1;n>=0;n--)!0===t(e[n])&&e.splice(n,1)}function Vfe(e){throw new Error("Unhandled case for value: '".concat(e,"'"))}window.customElements.define("buv-full-certificate-v1",jfe);var zfe=function(){function e(e){void 0===e&&(e={}),this.tagName="",this.attrs={},this.innerHTML="",this.whitespaceRegex=/\s+/,this.tagName=e.tagName||"",this.attrs=e.attrs||{},this.innerHTML=e.innerHtml||e.innerHTML||""}return e.prototype.setTagName=function(e){return this.tagName=e,this},e.prototype.getTagName=function(){return this.tagName||""},e.prototype.setAttr=function(e,t){return this.getAttrs()[e]=t,this},e.prototype.getAttr=function(e){return this.getAttrs()[e]},e.prototype.setAttrs=function(e){return Object.assign(this.getAttrs(),e),this},e.prototype.getAttrs=function(){return this.attrs||(this.attrs={})},e.prototype.setClass=function(e){return this.setAttr("class",e)},e.prototype.addClass=function(e){for(var t,n=this.getClass(),r=this.whitespaceRegex,i=n?n.split(r):[],o=e.split(r);t=o.shift();)-1===Gfe(i,t)&&i.push(t);return this.getAttrs().class=i.join(" "),this},e.prototype.removeClass=function(e){for(var t,n=this.getClass(),r=this.whitespaceRegex,i=n?n.split(r):[],o=e.split(r);i.length&&(t=o.shift());){var a=Gfe(i,t);-1!==a&&i.splice(a,1)}return this.getAttrs().class=i.join(" "),this},e.prototype.getClass=function(){return this.getAttrs().class||""},e.prototype.hasClass=function(e){return-1!==(" "+this.getClass()+" ").indexOf(" "+e+" ")},e.prototype.setInnerHTML=function(e){return this.innerHTML=e,this},e.prototype.setInnerHtml=function(e){return this.setInnerHTML(e)},e.prototype.getInnerHTML=function(){return this.innerHTML||""},e.prototype.getInnerHtml=function(){return this.getInnerHTML()},e.prototype.toAnchorString=function(){var e=this.getTagName(),t=this.buildAttrsStr();return["<",e,t=t?" "+t:"",">",this.getInnerHtml(),"</",e,">"].join("")},e.prototype.buildAttrsStr=function(){if(!this.attrs)return"";var e=this.getAttrs(),t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(n+'="'+e[n]+'"');return t.join(" ")},e}();var Jfe,Yfe=function(){function e(e){void 0===e&&(e={}),this.newWindow=!1,this.truncate={},this.className="",this.newWindow=e.newWindow||!1,this.truncate=e.truncate||{},this.className=e.className||""}return e.prototype.build=function(e){return new zfe({tagName:"a",attrs:this.createAttrs(e),innerHtml:this.processAnchorText(e.getAnchorText())})},e.prototype.createAttrs=function(e){var t={href:e.getAnchorHref()},n=this.createCssClass(e);return n&&(t.class=n),this.newWindow&&(t.target="_blank",t.rel="noopener noreferrer"),this.truncate&&this.truncate.length&&this.truncate.length<e.getAnchorText().length&&(t.title=e.getAnchorHref()),t},e.prototype.createCssClass=function(e){var t=this.className;if(t){for(var n=[t],r=e.getCssClassSuffixes(),i=0,o=r.length;i<o;i++)n.push(t+"-"+r[i]);return n.join(" ")}return""},e.prototype.processAnchorText=function(e){return e=this.doTruncate(e)},e.prototype.doTruncate=function(e){var t=this.truncate;if(!t||!t.length)return e;var n=t.length,r=t.location;return"smart"===r?function(e,t,n){var r,i;null==n?(n="&hellip;",i=3,r=8):(i=n.length,r=n.length);var o=function(e){var t="";return e.scheme&&e.host&&(t+=e.scheme+"://"),e.host&&(t+=e.host),e.path&&(t+="/"+e.path),e.query&&(t+="?"+e.query),e.fragment&&(t+="#"+e.fragment),t},a=function(e,t){var r=t/2,i=Math.ceil(r),o=-1*Math.floor(r),a="";return o<0&&(a=e.substr(o)),e.substr(0,i)+n+a};if(e.length<=t)return e;var s=t-i,u=function(e){var t={},n=e,r=n.match(/^([a-z]+):\/\//i);return r&&(t.scheme=r[1],n=n.substr(r[0].length)),(r=n.match(/^(.*?)(?=(\?|#|\/|$))/i))&&(t.host=r[1],n=n.substr(r[0].length)),(r=n.match(/^\/(.*?)(?=(\?|#|$))/i))&&(t.path=r[1],n=n.substr(r[0].length)),(r=n.match(/^\?(.*?)(?=(#|$))/i))&&(t.query=r[1],n=n.substr(r[0].length)),(r=n.match(/^#(.*?)$/i))&&(t.fragment=r[1]),t}(e);if(u.query){var l=u.query.match(/^(.*?)(?=(\?|\#))(.*?)$/i);l&&(u.query=u.query.substr(0,l[1].length),e=o(u))}if(e.length<=t)return e;if(u.host&&(u.host=u.host.replace(/^www\./,""),e=o(u)),e.length<=t)return e;var A="";if(u.host&&(A+=u.host),A.length>=s)return u.host.length==t?(u.host.substr(0,t-i)+n).substr(0,s+r):a(A,s).substr(0,s+r);var c="";if(u.path&&(c+="/"+u.path),u.query&&(c+="?"+u.query),c){if((A+c).length>=s)return(A+c).length==t?(A+c).substr(0,t):(A+a(c,s-A.length)).substr(0,s+r);A+=c}if(u.fragment){var h="#"+u.fragment;if((A+h).length>=s)return(A+h).length==t?(A+h).substr(0,t):(A+a(h,s-A.length)).substr(0,s+r);A+=h}if(u.scheme&&u.host){var f=u.scheme+"://";if((A+f).length<s)return(f+A).substr(0,t)}if(A.length<=t)return A;var d="";return s>0&&(d=A.substr(-1*Math.floor(s/2))),(A.substr(0,Math.ceil(s/2))+n+d).substr(0,s+r)}(e,n):"middle"===r?function(e,t,n){if(e.length<=t)return e;var r,i;null==n?(n="&hellip;",r=8,i=3):(r=n.length,i=n.length);var o=t-i,a="";return o>0&&(a=e.substr(-1*Math.floor(o/2))),(e.substr(0,Math.ceil(o/2))+n+a).substr(0,o+r)}(e,n):function(e,t,n){return function(e,t,n){var r;return e.length>t&&(null==n?(n="&hellip;",r=3):r=n.length,e=e.substring(0,t-r)+n),e}(e,t,n)}(e,n)},e}(),Xfe=function(){function e(e){this.__jsduckDummyDocProp=null,this.matchedText="",this.offset=0,this.tagBuilder=e.tagBuilder,this.matchedText=e.matchedText,this.offset=e.offset}return e.prototype.getMatchedText=function(){return this.matchedText},e.prototype.setOffset=function(e){this.offset=e},e.prototype.getOffset=function(){return this.offset},e.prototype.getCssClassSuffixes=function(){return[this.getType()]},e.prototype.buildTag=function(){return this.tagBuilder.build(this)},e}(),Wfe=function(e){function t(t){var n=e.call(this,t)||this;return n.email="",n.email=t.email,n}return Pt(t,e),t.prototype.getType=function(){return"email"},t.prototype.getEmail=function(){return this.email},t.prototype.getAnchorHref=function(){return"mailto:"+this.email},t.prototype.getAnchorText=function(){return this.email},t}(Xfe),Zfe=function(e){function t(t){var n=e.call(this,t)||this;return n.serviceName="",n.hashtag="",n.serviceName=t.serviceName,n.hashtag=t.hashtag,n}return Pt(t,e),t.prototype.getType=function(){return"hashtag"},t.prototype.getServiceName=function(){return this.serviceName},t.prototype.getHashtag=function(){return this.hashtag},t.prototype.getAnchorHref=function(){var e=this.serviceName,t=this.hashtag;switch(e){case"twitter":return"https://twitter.com/hashtag/"+t;case"facebook":return"https://www.facebook.com/hashtag/"+t;case"instagram":return"https://instagram.com/explore/tags/"+t;case"tiktok":return"https://www.tiktok.com/tag/"+t;default:throw new Error("Unknown service name to point hashtag to: "+e)}},t.prototype.getAnchorText=function(){return"#"+this.hashtag},t}(Xfe),$fe=function(e){function t(t){var n=e.call(this,t)||this;return n.serviceName="twitter",n.mention="",n.mention=t.mention,n.serviceName=t.serviceName,n}return Pt(t,e),t.prototype.getType=function(){return"mention"},t.prototype.getMention=function(){return this.mention},t.prototype.getServiceName=function(){return this.serviceName},t.prototype.getAnchorHref=function(){switch(this.serviceName){case"twitter":return"https://twitter.com/"+this.mention;case"instagram":return"https://instagram.com/"+this.mention;case"soundcloud":return"https://soundcloud.com/"+this.mention;case"tiktok":return"https://www.tiktok.com/@"+this.mention;default:throw new Error("Unknown service name to point mention to: "+this.serviceName)}},t.prototype.getAnchorText=function(){return"@"+this.mention},t.prototype.getCssClassSuffixes=function(){var t=e.prototype.getCssClassSuffixes.call(this),n=this.getServiceName();return n&&t.push(n),t},t}(Xfe),ede=function(e){function t(t){var n=e.call(this,t)||this;return n.number="",n.plusSign=!1,n.number=t.number,n.plusSign=t.plusSign,n}return Pt(t,e),t.prototype.getType=function(){return"phone"},t.prototype.getPhoneNumber=function(){return this.number},t.prototype.getNumber=function(){return this.getPhoneNumber()},t.prototype.getAnchorHref=function(){return"tel:"+(this.plusSign?"+":"")+this.number},t.prototype.getAnchorText=function(){return this.matchedText},t}(Xfe),tde=function(e){function t(t){var n=e.call(this,t)||this;return n.url="",n.urlMatchType="scheme",n.protocolUrlMatch=!1,n.protocolRelativeMatch=!1,n.stripPrefix={scheme:!0,www:!0},n.stripTrailingSlash=!0,n.decodePercentEncoding=!0,n.schemePrefixRegex=/^(https?:\/\/)?/i,n.wwwPrefixRegex=/^(https?:\/\/)?(www\.)?/i,n.protocolRelativeRegex=/^\/\//,n.protocolPrepended=!1,n.urlMatchType=t.urlMatchType,n.url=t.url,n.protocolUrlMatch=t.protocolUrlMatch,n.protocolRelativeMatch=t.protocolRelativeMatch,n.stripPrefix=t.stripPrefix,n.stripTrailingSlash=t.stripTrailingSlash,n.decodePercentEncoding=t.decodePercentEncoding,n}return Pt(t,e),t.prototype.getType=function(){return"url"},t.prototype.getUrlMatchType=function(){return this.urlMatchType},t.prototype.getUrl=function(){var e=this.url;return this.protocolRelativeMatch||this.protocolUrlMatch||this.protocolPrepended||(e=this.url="http://"+e,this.protocolPrepended=!0),e},t.prototype.getAnchorHref=function(){return this.getUrl().replace(/&amp;/g,"&")},t.prototype.getAnchorText=function(){var e=this.getMatchedText();return this.protocolRelativeMatch&&(e=this.stripProtocolRelativePrefix(e)),this.stripPrefix.scheme&&(e=this.stripSchemePrefix(e)),this.stripPrefix.www&&(e=this.stripWwwPrefix(e)),this.stripTrailingSlash&&(e=this.removeTrailingSlash(e)),this.decodePercentEncoding&&(e=this.removePercentEncoding(e)),e},t.prototype.stripSchemePrefix=function(e){return e.replace(this.schemePrefixRegex,"")},t.prototype.stripWwwPrefix=function(e){return e.replace(this.wwwPrefixRegex,"$1")},t.prototype.stripProtocolRelativePrefix=function(e){return e.replace(this.protocolRelativeRegex,"")},t.prototype.removeTrailingSlash=function(e){return"/"===e.charAt(e.length-1)&&(e=e.slice(0,-1)),e},t.prototype.removePercentEncoding=function(e){var t=e.replace(/%22/gi,"&quot;").replace(/%26/gi,"&amp;").replace(/%27/gi,"&#39;").replace(/%3C/gi,"&lt;").replace(/%3E/gi,"&gt;");try{return decodeURIComponent(t)}catch(e){return t}},t}(Xfe),nde=function(e){this.__jsduckDummyDocProp=null,this.tagBuilder=e.tagBuilder},rde=/[A-Za-z]/,ide=/[\d]/,ode=/[\D]/,ade=/\s/,sde=/['"]/,ude=/[\x00-\x1F\x7F]/,lde=/A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC/.source,Ade=lde+/\u2700-\u27bf\udde6-\uddff\ud800-\udbff\udc00-\udfff\ufe0e\ufe0f\u0300-\u036f\ufe20-\ufe23\u20d0-\u20f0\ud83c\udffb-\udfff\u200d\u3299\u3297\u303d\u3030\u24c2\ud83c\udd70-\udd71\udd7e-\udd7f\udd8e\udd91-\udd9a\udde6-\uddff\ude01-\ude02\ude1a\ude2f\ude32-\ude3a\ude50-\ude51\u203c\u2049\u25aa-\u25ab\u25b6\u25c0\u25fb-\u25fe\u00a9\u00ae\u2122\u2139\udc04\u2600-\u26FF\u2b05\u2b06\u2b07\u2b1b\u2b1c\u2b50\u2b55\u231a\u231b\u2328\u23cf\u23e9-\u23f3\u23f8-\u23fa\udccf\u2935\u2934\u2190-\u21ff/.source+/\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D4-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C03\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D01-\u0D03\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF5\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F/.source,cde=/0-9\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0BE6-\u0BEF\u0C66-\u0C6F\u0CE6-\u0CEF\u0D66-\u0D6F\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F29\u1040-\u1049\u1090-\u1099\u17E0-\u17E9\u1810-\u1819\u1946-\u194F\u19D0-\u19D9\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\uA620-\uA629\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19/.source,hde=Ade+cde,fde=Ade+cde,dde="(?:["+cde+"]{1,3}\\.){3}["+cde+"]{1,3}",pde="["+fde+"](?:["+fde+"\\-]{0,61}["+fde+"])?",gde=function(e){return"(?=("+pde+"))\\"+e},vde=function(e){return"(?:"+gde(e)+"(?:\\."+gde(e+1)+"){0,126}|"+dde+")"},yde=new RegExp("[".concat(fde,"]")),mde=/(?:xn--vermgensberatung-pwb|xn--vermgensberater-ctb|xn--clchc0ea0b2g2a9gcd|xn--w4r85el8fhu5dnra|northwesternmutual|travelersinsurance|vermögensberatung|xn--3oq18vl8pn36a|xn--5su34j936bgsg|xn--bck1b9a5dre4c|xn--mgbah1a3hjkrd|xn--mgbai9azgqp6j|xn--mgberp4a5d4ar|xn--xkc2dl3a5ee0h|vermögensberater|xn--fzys8d69uvgm|xn--mgba7c0bbn0a|xn--mgbcpq6gpa1a|xn--xkc2al3hye2a|americanexpress|kerryproperties|sandvikcoromant|xn--i1b6b1a6a2e|xn--kcrx77d1x4a|xn--lgbbat1ad8j|xn--mgba3a4f16a|xn--mgbaakc7dvf|xn--mgbc0a9azcg|xn--nqv7fs00ema|afamilycompany|americanfamily|bananarepublic|cancerresearch|cookingchannel|kerrylogistics|weatherchannel|xn--54b7fta0cc|xn--6qq986b3xl|xn--80aqecdr1a|xn--b4w605ferd|xn--fiq228c5hs|xn--h2breg3eve|xn--jlq480n2rg|xn--jlq61u9w7b|xn--mgba3a3ejt|xn--mgbaam7a8h|xn--mgbayh7gpa|xn--mgbbh1a71e|xn--mgbca7dzdo|xn--mgbi4ecexp|xn--mgbx4cd0ab|xn--rvc1e0am3e|international|lifeinsurance|travelchannel|wolterskluwer|xn--cckwcxetd|xn--eckvdtc9d|xn--fpcrj9c3d|xn--fzc2c9e2c|xn--h2brj9c8c|xn--tiq49xqyj|xn--yfro4i67o|xn--ygbi2ammx|construction|lplfinancial|scholarships|versicherung|xn--3e0b707e|xn--45br5cyl|xn--4dbrk0ce|xn--80adxhks|xn--80asehdb|xn--8y0a063a|xn--gckr3f0f|xn--mgb9awbf|xn--mgbab2bd|xn--mgbgu82a|xn--mgbpl2fh|xn--mgbt3dhd|xn--mk1bu44c|xn--ngbc5azd|xn--ngbe9e0a|xn--ogbpf8fl|xn--qcka1pmc|accountants|barclaycard|blackfriday|blockbuster|bridgestone|calvinklein|contractors|creditunion|engineering|enterprises|foodnetwork|investments|kerryhotels|lamborghini|motorcycles|olayangroup|photography|playstation|productions|progressive|redumbrella|williamhill|xn--11b4c3d|xn--1ck2e1b|xn--1qqw23a|xn--2scrj9c|xn--3bst00m|xn--3ds443g|xn--3hcrj9c|xn--42c2d9a|xn--45brj9c|xn--55qw42g|xn--6frz82g|xn--80ao21a|xn--9krt00a|xn--cck2b3b|xn--czr694b|xn--d1acj3b|xn--efvy88h|xn--fct429k|xn--fjq720a|xn--flw351e|xn--g2xx48c|xn--gecrj9c|xn--gk3at1e|xn--h2brj9c|xn--hxt814e|xn--imr513n|xn--j6w193g|xn--jvr189m|xn--kprw13d|xn--kpry57d|xn--mgbbh1a|xn--mgbtx2b|xn--mix891f|xn--nyqy26a|xn--otu796d|xn--pgbs0dh|xn--q9jyb4c|xn--rhqv96g|xn--rovu88b|xn--s9brj9c|xn--ses554g|xn--t60b56a|xn--vuq861b|xn--w4rs40l|xn--xhq521b|xn--zfr164b|சிங்கப்பூர்|accountant|apartments|associates|basketball|bnpparibas|boehringer|capitalone|consulting|creditcard|cuisinella|eurovision|extraspace|foundation|healthcare|immobilien|industries|management|mitsubishi|nextdirect|properties|protection|prudential|realestate|republican|restaurant|schaeffler|swiftcover|tatamotors|technology|university|vlaanderen|volkswagen|xn--30rr7y|xn--3pxu8k|xn--45q11c|xn--4gbrim|xn--55qx5d|xn--5tzm5g|xn--80aswg|xn--90a3ac|xn--9dbq2a|xn--9et52u|xn--c2br7g|xn--cg4bki|xn--czrs0t|xn--czru2d|xn--fiq64b|xn--fiqs8s|xn--fiqz9s|xn--io0a7i|xn--kput3i|xn--mxtq1m|xn--o3cw4h|xn--pssy2u|xn--q7ce6a|xn--unup4y|xn--wgbh1c|xn--wgbl6a|xn--y9a3aq|accenture|alfaromeo|allfinanz|amsterdam|analytics|aquarelle|barcelona|bloomberg|christmas|community|directory|education|equipment|fairwinds|financial|firestone|fresenius|frontdoor|furniture|goldpoint|hisamitsu|homedepot|homegoods|homesense|institute|insurance|kuokgroup|lancaster|landrover|lifestyle|marketing|marshalls|melbourne|microsoft|panasonic|passagens|pramerica|richardli|scjohnson|shangrila|solutions|statebank|statefarm|stockholm|travelers|vacations|xn--90ais|xn--c1avg|xn--d1alf|xn--e1a4c|xn--fhbei|xn--j1aef|xn--j1amh|xn--l1acc|xn--ngbrx|xn--nqv7f|xn--p1acf|xn--qxa6a|xn--tckwe|xn--vhquv|yodobashi|موريتانيا|abudhabi|airforce|allstate|attorney|barclays|barefoot|bargains|baseball|boutique|bradesco|broadway|brussels|budapest|builders|business|capetown|catering|catholic|cipriani|cityeats|cleaning|clinique|clothing|commbank|computer|delivery|deloitte|democrat|diamonds|discount|discover|download|engineer|ericsson|etisalat|exchange|feedback|fidelity|firmdale|football|frontier|goodyear|grainger|graphics|guardian|hdfcbank|helsinki|holdings|hospital|infiniti|ipiranga|istanbul|jpmorgan|lighting|lundbeck|marriott|maserati|mckinsey|memorial|merckmsd|mortgage|observer|partners|pharmacy|pictures|plumbing|property|redstone|reliance|saarland|samsclub|security|services|shopping|showtime|softbank|software|stcgroup|supplies|training|vanguard|ventures|verisign|woodside|xn--90ae|xn--node|xn--p1ai|xn--qxam|yokohama|السعودية|abogado|academy|agakhan|alibaba|android|athleta|auction|audible|auspost|avianca|banamex|bauhaus|bentley|bestbuy|booking|brother|bugatti|capital|caravan|careers|channel|charity|chintai|citadel|clubmed|college|cologne|comcast|company|compare|contact|cooking|corsica|country|coupons|courses|cricket|cruises|dentist|digital|domains|exposed|express|farmers|fashion|ferrari|ferrero|finance|fishing|fitness|flights|florist|flowers|forsale|frogans|fujitsu|gallery|genting|godaddy|grocery|guitars|hamburg|hangout|hitachi|holiday|hosting|hoteles|hotmail|hyundai|ismaili|jewelry|juniper|kitchen|komatsu|lacaixa|lanxess|lasalle|latrobe|leclerc|limited|lincoln|markets|monster|netbank|netflix|network|neustar|okinawa|oldnavy|organic|origins|philips|pioneer|politie|realtor|recipes|rentals|reviews|rexroth|samsung|sandvik|schmidt|schwarz|science|shiksha|singles|staples|storage|support|surgery|systems|temasek|theater|theatre|tickets|tiffany|toshiba|trading|walmart|wanggou|watches|weather|website|wedding|whoswho|windows|winners|xfinity|yamaxun|youtube|zuerich|католик|اتصالات|البحرين|الجزائر|العليان|پاکستان|كاثوليك|இந்தியா|abarth|abbott|abbvie|africa|agency|airbus|airtel|alipay|alsace|alstom|amazon|anquan|aramco|author|bayern|beauty|berlin|bharti|bostik|boston|broker|camera|career|casino|center|chanel|chrome|church|circle|claims|clinic|coffee|comsec|condos|coupon|credit|cruise|dating|datsun|dealer|degree|dental|design|direct|doctor|dunlop|dupont|durban|emerck|energy|estate|events|expert|family|flickr|futbol|gallup|garden|george|giving|global|google|gratis|health|hermes|hiphop|hockey|hotels|hughes|imamat|insure|intuit|jaguar|joburg|juegos|kaufen|kinder|kindle|kosher|lancia|latino|lawyer|lefrak|living|locker|london|luxury|madrid|maison|makeup|market|mattel|mobile|monash|mormon|moscow|museum|mutual|nagoya|natura|nissan|nissay|norton|nowruz|office|olayan|online|oracle|orange|otsuka|pfizer|photos|physio|pictet|quebec|racing|realty|reisen|repair|report|review|rocher|rogers|ryukyu|safety|sakura|sanofi|school|schule|search|secure|select|shouji|soccer|social|stream|studio|supply|suzuki|swatch|sydney|taipei|taobao|target|tattoo|tennis|tienda|tjmaxx|tkmaxx|toyota|travel|unicom|viajes|viking|villas|virgin|vision|voting|voyage|vuelos|walter|webcam|xihuan|yachts|yandex|zappos|москва|онлайн|ابوظبي|ارامكو|الاردن|المغرب|امارات|فلسطين|مليسيا|भारतम्|இலங்கை|ファッション|actor|adult|aetna|amfam|amica|apple|archi|audio|autos|azure|baidu|beats|bible|bingo|black|boats|bosch|build|canon|cards|chase|cheap|cisco|citic|click|cloud|coach|codes|crown|cymru|dabur|dance|deals|delta|drive|dubai|earth|edeka|email|epson|faith|fedex|final|forex|forum|gallo|games|gifts|gives|glade|glass|globo|gmail|green|gripe|group|gucci|guide|homes|honda|horse|house|hyatt|ikano|irish|jetzt|koeln|kyoto|lamer|lease|legal|lexus|lilly|linde|lipsy|lixil|loans|locus|lotte|lotto|macys|mango|media|miami|money|movie|nexus|nikon|ninja|nokia|nowtv|omega|osaka|paris|parts|party|phone|photo|pizza|place|poker|praxi|press|prime|promo|quest|radio|rehab|reise|ricoh|rocks|rodeo|rugby|salon|sener|seven|sharp|shell|shoes|skype|sling|smart|smile|solar|space|sport|stada|store|study|style|sucks|swiss|tatar|tires|tirol|tmall|today|tokyo|tools|toray|total|tours|trade|trust|tunes|tushu|ubank|vegas|video|vodka|volvo|wales|watch|weber|weibo|works|world|xerox|yahoo|ישראל|ایران|بازار|بھارت|سودان|سورية|همراه|भारोत|संगठन|বাংলা|భారత్|ഭാരതം|嘉里大酒店|aarp|able|adac|aero|akdn|ally|amex|arab|army|arpa|arte|asda|asia|audi|auto|baby|band|bank|bbva|beer|best|bike|bing|blog|blue|bofa|bond|book|buzz|cafe|call|camp|care|cars|casa|case|cash|cbre|cern|chat|citi|city|club|cool|coop|cyou|data|date|dclk|deal|dell|desi|diet|dish|docs|duck|dvag|erni|fage|fail|fans|farm|fast|fiat|fido|film|fire|fish|flir|food|ford|free|fund|game|gbiz|gent|ggee|gift|gmbh|gold|golf|goog|guge|guru|hair|haus|hdfc|help|here|hgtv|host|hsbc|icbc|ieee|imdb|immo|info|itau|java|jeep|jobs|jprs|kddi|kiwi|kpmg|kred|land|lego|lgbt|lidl|life|like|limo|link|live|loan|loft|love|ltda|luxe|maif|meet|meme|menu|mini|mint|mobi|moda|moto|name|navy|news|next|nico|nike|ollo|open|page|pars|pccw|pics|ping|pink|play|plus|pohl|porn|post|prod|prof|qpon|raid|read|reit|rent|rest|rich|rmit|room|rsvp|ruhr|safe|sale|sarl|save|saxo|scot|seat|seek|sexy|shaw|shia|shop|show|silk|sina|site|skin|sncf|sohu|song|sony|spot|star|surf|talk|taxi|team|tech|teva|tiaa|tips|town|toys|tube|vana|visa|viva|vivo|vote|voto|wang|weir|wien|wiki|wine|work|xbox|yoga|zara|zero|zone|дети|сайт|بارت|بيتك|ڀارت|تونس|شبكة|عراق|عمان|موقع|भारत|ভারত|ভাৰত|ਭਾਰਤ|ભારત|ଭାରତ|ಭಾರತ|ලංකා|アマゾン|グーグル|クラウド|ポイント|大众汽车|组织机构|電訊盈科|香格里拉|aaa|abb|abc|aco|ads|aeg|afl|aig|anz|aol|app|art|aws|axa|bar|bbc|bbt|bcg|bcn|bet|bid|bio|biz|bms|bmw|bom|boo|bot|box|buy|bzh|cab|cal|cam|car|cat|cba|cbn|cbs|ceo|cfa|cfd|com|cpa|crs|csc|dad|day|dds|dev|dhl|diy|dnp|dog|dot|dtv|dvr|eat|eco|edu|esq|eus|fan|fit|fly|foo|fox|frl|ftr|fun|fyi|gal|gap|gay|gdn|gea|gle|gmo|gmx|goo|gop|got|gov|hbo|hiv|hkt|hot|how|ibm|ice|icu|ifm|inc|ing|ink|int|ist|itv|jcb|jio|jll|jmp|jnj|jot|joy|kfh|kia|kim|kpn|krd|lat|law|lds|llc|llp|lol|lpl|ltd|man|map|mba|med|men|mil|mit|mlb|mls|mma|moe|moi|mom|mov|msd|mtn|mtr|nab|nba|nec|net|new|nfl|ngo|nhk|now|nra|nrw|ntt|nyc|obi|off|one|ong|onl|ooo|org|ott|ovh|pay|pet|phd|pid|pin|pnc|pro|pru|pub|pwc|qvc|red|ren|ril|rio|rip|run|rwe|sap|sas|sbi|sbs|sca|scb|ses|sew|sex|sfr|ski|sky|soy|spa|srl|stc|tab|tax|tci|tdk|tel|thd|tjx|top|trv|tui|tvs|ubs|uno|uol|ups|vet|vig|vin|vip|wed|win|wme|wow|wtc|wtf|xin|xxx|xyz|you|yun|zip|бел|ком|қаз|мкд|мон|орг|рус|срб|укр|հայ|קום|عرب|قطر|كوم|مصر|कॉम|नेट|คอม|ไทย|ລາວ|ストア|セール|みんな|中文网|亚马逊|天主教|我爱你|新加坡|淡马锡|诺基亚|飞利浦|ac|ad|ae|af|ag|ai|al|am|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cu|cv|cw|cx|cy|cz|de|dj|dk|dm|do|dz|ec|ee|eg|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|ss|st|su|sv|sx|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|za|zm|zw|ελ|ευ|бг|ею|рф|გე|닷넷|닷컴|삼성|한국|コム|世界|中信|中国|中國|企业|佛山|信息|健康|八卦|公司|公益|台湾|台灣|商城|商店|商标|嘉里|在线|大拿|娱乐|家電|广东|微博|慈善|手机|招聘|政务|政府|新闻|时尚|書籍|机构|游戏|澳門|点看|移动|网址|网店|网站|网络|联通|谷歌|购物|通販|集团|食品|餐厅|香港)/,wde=new RegExp("[".concat(fde,"!#$%&'*+/=?^_`{|}~-]")),bde=new RegExp("^".concat(mde.source,"$")),Ide=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.localPartCharRegex=wde,t.strictTldRegex=bde,t}return Pt(t,e),t.prototype.parseMatches=function(e){for(var t=this.tagBuilder,n=this.localPartCharRegex,r=this.strictTldRegex,i=[],o=e.length,a=new Bde,s={m:"a",a:"i",i:"l",l:"t",t:"o",o:":"},u=0,l=0,A=a;u<o;){var c=e.charAt(u);switch(l){case 0:h(c);break;case 1:f(e.charAt(u-1),c);break;case 2:d(c);break;case 3:p(c);break;case 4:g(c);break;case 5:v(c);break;case 6:y(c);break;case 7:m(c);break;default:Vfe(l)}u++}return I(),i;function h(e){"m"===e?w(1):n.test(e)&&w()}function f(e,t){":"===e?n.test(t)?(l=2,A=new Bde(Ut(Ut({},A),{hasMailtoPrefix:!0}))):b():s[e]===t||(n.test(t)?l=2:"."===t?l=3:"@"===t?l=4:b())}function d(e){"."===e?l=3:"@"===e?l=4:n.test(e)||b()}function p(e){"."===e||"@"===e?b():n.test(e)?l=2:b()}function g(e){yde.test(e)?l=5:b()}function v(e){"."===e?l=7:"-"===e?l=6:yde.test(e)||I()}function y(e){"-"===e||"."===e?I():yde.test(e)?l=5:I()}function m(e){"."===e||"-"===e?I():yde.test(e)?(l=5,A=new Bde(Ut(Ut({},A),{hasDomainDot:!0}))):I()}function w(e){void 0===e&&(e=2),l=e,A=new Bde({idx:u})}function b(){l=0,A=a}function I(){if(A.hasDomainDot){var n=e.slice(A.idx,u);/[-.]$/.test(n)&&(n=n.slice(0,-1));var o=A.hasMailtoPrefix?n.slice("mailto:".length):n;(function(e){var t=(e.split(".").pop()||"").toLowerCase();return r.test(t)})(o)&&i.push(new Wfe({tagBuilder:t,matchedText:n,offset:A.idx,email:o}))}b()}},t}(nde),Bde=function(e){void 0===e&&(e={}),this.idx=void 0!==e.idx?e.idx:-1,this.hasMailtoPrefix=!!e.hasMailtoPrefix,this.hasDomainDot=!!e.hasDomainDot},Ede=function(){function e(){}return e.isValid=function(e,t){return!(t&&!this.isValidUriScheme(t)||this.urlMatchDoesNotHaveProtocolOrDot(e,t)||this.urlMatchDoesNotHaveAtLeastOneWordChar(e,t)&&!this.isValidIpAddress(e)||this.containsMultipleDots(e))},e.isValidIpAddress=function(e){var t=new RegExp(this.hasFullProtocolRegex.source+this.ipRegex.source);return null!==e.match(t)},e.containsMultipleDots=function(e){var t=e;return this.hasFullProtocolRegex.test(e)&&(t=e.split("://")[1]),t.split("/")[0].indexOf("..")>-1},e.isValidUriScheme=function(e){var t=e.match(this.uriSchemeRegex),n=t&&t[0].toLowerCase();return"javascript:"!==n&&"vbscript:"!==n},e.urlMatchDoesNotHaveProtocolOrDot=function(e,t){return!(!e||t&&this.hasFullProtocolRegex.test(t)||-1!==e.indexOf("."))},e.urlMatchDoesNotHaveAtLeastOneWordChar=function(e,t){return!(!e||!t)&&(!this.hasFullProtocolRegex.test(t)&&!this.hasWordCharAfterProtocolRegex.test(e))},e.hasFullProtocolRegex=/^[A-Za-z][-.+A-Za-z0-9]*:\/\//,e.uriSchemeRegex=/^[A-Za-z][-.+A-Za-z0-9]*:/,e.hasWordCharAfterProtocolRegex=new RegExp(":[^\\s]*?["+lde+"]"),e.ipRegex=/[0-9][0-9]?[0-9]?\.[0-9][0-9]?[0-9]?\.[0-9][0-9]?[0-9]?\.[0-9][0-9]?[0-9]?(:[0-9]*)?\/?$/,e}(),Cde=(Jfe=new RegExp("[/?#](?:["+fde+"\\-+&@#/%=~_()|'$*\\[\\]{}?!:,.;^✓]*["+fde+"\\-+&@#/%=~_()|'$*\\[\\]{}✓])?"),new RegExp(["(?:","(",/(?:[A-Za-z][-.+A-Za-z0-9]{0,63}:(?![A-Za-z][-.+A-Za-z0-9]{0,63}:\/\/)(?!\d+\/?)(?:\/\/)?)/.source,vde(2),")","|","(","(//)?",/(?:www\.)/.source,vde(6),")","|","(","(//)?",vde(10)+"\\.",mde.source,"(?![-"+hde+"])",")",")","(?::[0-9]+)?","(?:"+Jfe.source+")?"].join(""),"gi")),xde=new RegExp("["+fde+"]"),kde=function(e){function t(t){var n=e.call(this,t)||this;return n.stripPrefix={scheme:!0,www:!0},n.stripTrailingSlash=!0,n.decodePercentEncoding=!0,n.matcherRegex=Cde,n.wordCharRegExp=xde,n.stripPrefix=t.stripPrefix,n.stripTrailingSlash=t.stripTrailingSlash,n.decodePercentEncoding=t.decodePercentEncoding,n}return Pt(t,e),t.prototype.parseMatches=function(e){for(var t,n=this.matcherRegex,r=this.stripPrefix,i=this.stripTrailingSlash,o=this.decodePercentEncoding,a=this.tagBuilder,s=[],u=function(){var n=t[0],u=t[1],A=t[4],c=t[5],h=t[9],f=t.index,d=c||h,p=e.charAt(f-1);if(!Ede.isValid(n,u))return"continue";if(f>0&&"@"===p)return"continue";if(f>0&&d&&l.wordCharRegExp.test(p))return"continue";if(/\?$/.test(n)&&(n=n.substr(0,n.length-1)),l.matchHasUnbalancedClosingParen(n))n=n.substr(0,n.length-1);else{var g=l.matchHasInvalidCharAfterTld(n,u);g>-1&&(n=n.substr(0,g))}var v=["http://","https://"].find((function(e){return!!u&&-1!==u.indexOf(e)}));if(v){var y=n.indexOf(v);n=n.substr(y),u=u.substr(y),f+=y}var m=u?"scheme":A?"www":"tld",w=!!u;s.push(new tde({tagBuilder:a,matchedText:n,offset:f,urlMatchType:m,url:n,protocolUrlMatch:w,protocolRelativeMatch:!!d,stripPrefix:r,stripTrailingSlash:i,decodePercentEncoding:o}))},l=this;null!==(t=n.exec(e));)u();return s},t.prototype.matchHasUnbalancedClosingParen=function(e){var t,n=e.charAt(e.length-1);if(")"===n)t="(";else if("]"===n)t="[";else{if("}"!==n)return!1;t="{"}for(var r=0,i=0,o=e.length-1;i<o;i++){var a=e.charAt(i);a===t?r++:a===n&&(r=Math.max(r-1,0))}return 0===r},t.prototype.matchHasInvalidCharAfterTld=function(e,t){if(!e)return-1;var n=0;t&&(n=e.indexOf(":"),e=e.slice(n));var r=new RegExp("^((.?//)?[-."+fde+"]*[-"+fde+"]\\.[-"+fde+"]+)").exec(e);return null===r?-1:(n+=r[1].length,e=e.slice(r[1].length),/^[^-.A-Za-z0-9:\/?#]/.test(e)?n:-1)},t}(nde),Sde=new RegExp("#[_".concat(fde,"]{1,139}(?![_").concat(fde,"])"),"g"),Qde=new RegExp("[^"+fde+"]"),_de=function(e){function t(t){var n=e.call(this,t)||this;return n.serviceName="twitter",n.matcherRegex=Sde,n.nonWordCharRegex=Qde,n.serviceName=t.serviceName,n}return Pt(t,e),t.prototype.parseMatches=function(e){for(var t,n=this.matcherRegex,r=this.nonWordCharRegex,i=this.serviceName,o=this.tagBuilder,a=[];null!==(t=n.exec(e));){var s=t.index,u=e.charAt(s-1);if(0===s||r.test(u)){var l=t[0],A=t[0].slice(1);a.push(new Zfe({tagBuilder:o,matchedText:l,offset:s,serviceName:i,hashtag:A}))}}return a},t}(nde),Nde=new RegExp("".concat(/(?:(?:(?:(\+)?\d{1,3}[-\040.]?)?\(?\d{3}\)?[-\040.]?\d{3}[-\040.]?\d{4})|(?:(\+)(?:9[976]\d|8[987530]\d|6[987]\d|5[90]\d|42\d|3[875]\d|2[98654321]\d|9[8543210]|8[6421]|6[6543210]|5[87654321]|4[987654310]|3[9643210]|2[70]|7|1)[-\040.]?(?:\d[-\040.]?){6,12}\d+))([,;]+[0-9]+#?)*/.source,"|").concat(/(0([1-9]{1}-?[1-9]\d{3}|[1-9]{2}-?\d{3}|[1-9]{2}\d{1}-?\d{2}|[1-9]{2}\d{2}-?\d{1})-?\d{4}|0[789]0-?\d{4}-?\d{4}|050-?\d{4}-?\d{4})/.source),"g"),Dde=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.matcherRegex=Nde,t}return Pt(t,e),t.prototype.parseMatches=function(e){for(var t,n=this.matcherRegex,r=this.tagBuilder,i=[];null!==(t=n.exec(e));){var o=t[0],a=o.replace(/[^0-9,;#]/g,""),s=!(!t[1]&&!t[2]),u=0==t.index?"":e.substr(t.index-1,1),l=e.substr(t.index+o.length,1),A=!u.match(/\d/)&&!l.match(/\d/);this.testMatch(t[3])&&this.testMatch(o)&&A&&i.push(new ede({tagBuilder:r,matchedText:o,offset:t.index,number:a,plusSign:s}))}return i},t.prototype.testMatch=function(e){return ode.test(e)},t}(nde),Fde=new RegExp("@[_".concat(fde,"]{1,50}(?![_").concat(fde,"])"),"g"),Pde=new RegExp("@[_.".concat(fde,"]{1,30}(?![_").concat(fde,"])"),"g"),Ude=new RegExp("@[-_.".concat(fde,"]{1,50}(?![-_").concat(fde,"])"),"g"),Lde=new RegExp("@[_.".concat(fde,"]{1,23}[_").concat(fde,"](?![_").concat(fde,"])"),"g"),Mde=new RegExp("[^"+fde+"]"),Tde=function(e){function t(t){var n=e.call(this,t)||this;return n.serviceName="twitter",n.matcherRegexes={twitter:Fde,instagram:Pde,soundcloud:Ude,tiktok:Lde},n.nonWordCharRegex=Mde,n.serviceName=t.serviceName,n}return Pt(t,e),t.prototype.parseMatches=function(e){var t,n=this.serviceName,r=this.matcherRegexes[this.serviceName],i=this.nonWordCharRegex,o=this.tagBuilder,a=[];if(!r)return a;for(;null!==(t=r.exec(e));){var s=t.index,u=e.charAt(s-1);if(0===s||i.test(u)){var l=t[0].replace(/\.+$/g,""),A=l.slice(1);a.push(new $fe({tagBuilder:o,matchedText:l,offset:s,serviceName:n,mention:A}))}}return a},t}(nde);function Rde(e,t){for(var n,r=t.onOpenTag,i=t.onCloseTag,o=t.onText,a=t.onComment,s=t.onDoctype,u=new Ode,l=0,A=e.length,c=0,h=0,f=u;l<A;){var d=e.charAt(l);switch(c){case 0:p(d);break;case 1:g(d);break;case 2:y(d);break;case 3:v(d);break;case 4:m(d);break;case 5:w(d);break;case 6:b(d);break;case 7:I(d);break;case 8:B(d);break;case 9:E(d);break;case 10:C(d);break;case 11:x(d);break;case 12:k(d);break;case 13:S();break;case 14:Q(d);break;case 15:_(d);break;case 16:N(d);break;case 17:D(d);break;case 18:F(d);break;case 19:P(d);break;case 20:U(d);break;default:Vfe(c)}l++}function p(e){"<"===e&&M()}function g(e){"!"===e?c=13:"/"===e?(c=2,f=new Ode(Ut(Ut({},f),{isClosing:!0}))):"<"===e?M():rde.test(e)?(c=3,f=new Ode(Ut(Ut({},f),{isOpening:!0}))):(c=0,f=u)}function v(e){ade.test(e)?(f=new Ode(Ut(Ut({},f),{name:R()})),c=4):"<"===e?M():"/"===e?(f=new Ode(Ut(Ut({},f),{name:R()})),c=12):">"===e?(f=new Ode(Ut(Ut({},f),{name:R()})),T()):rde.test(e)||ide.test(e)||":"===e||L()}function y(e){">"===e?L():rde.test(e)?c=3:L()}function m(e){ade.test(e)||("/"===e?c=12:">"===e?T():"<"===e?M():"="===e||sde.test(e)||ude.test(e)?L():c=5)}function w(e){ade.test(e)?c=6:"/"===e?c=12:"="===e?c=7:">"===e?T():"<"===e?M():sde.test(e)&&L()}function b(e){ade.test(e)||("/"===e?c=12:"="===e?c=7:">"===e?T():"<"===e?M():sde.test(e)?L():c=5)}function I(e){ade.test(e)||('"'===e?c=8:"'"===e?c=9:/[>=`]/.test(e)?L():"<"===e?M():c=10)}function B(e){'"'===e&&(c=11)}function E(e){"'"===e&&(c=11)}function C(e){ade.test(e)?c=4:">"===e?T():"<"===e&&M()}function x(e){ade.test(e)?c=4:"/"===e?c=12:">"===e?T():"<"===e?M():(c=4,l--)}function k(e){">"===e?(f=new Ode(Ut(Ut({},f),{isClosing:!0})),T()):c=4}function S(t){"--"===e.substr(l,2)?(l+=2,f=new Ode(Ut(Ut({},f),{type:"comment"})),c=14):"DOCTYPE"===e.substr(l,7).toUpperCase()?(l+=7,f=new Ode(Ut(Ut({},f),{type:"doctype"})),c=20):L()}function Q(e){"-"===e?c=15:">"===e?L():c=16}function _(e){"-"===e?c=18:">"===e?L():c=16}function N(e){"-"===e&&(c=17)}function D(e){c="-"===e?18:16}function F(e){">"===e?T():"!"===e?c=19:"-"===e||(c=16)}function P(e){"-"===e?c=17:">"===e?T():c=16}function U(e){">"===e?T():"<"===e&&M()}function L(){c=0,f=u}function M(){c=1,f=new Ode({idx:l})}function T(){var t=e.slice(h,f.idx);t&&o(t,h),"comment"===f.type?a(f.idx):"doctype"===f.type?s(f.idx):(f.isOpening&&r(f.name,f.idx),f.isClosing&&i(f.name,f.idx)),L(),h=l+1}function R(){var t=f.idx+(f.isClosing?2:1);return e.slice(t,l).toLowerCase()}h<l&&(n=e.slice(h,l),o(n,h),h=l+1)}var Ode=function(e){void 0===e&&(e={}),this.idx=void 0!==e.idx?e.idx:-1,this.type=e.type||"tag",this.name=e.name||"",this.isOpening=!!e.isOpening,this.isClosing=!!e.isClosing},Hde=function(){function e(t){void 0===t&&(t={}),this.version=e.version,this.urls={},this.email=!0,this.phone=!0,this.hashtag=!1,this.mention=!1,this.newWindow=!0,this.stripPrefix={scheme:!0,www:!0},this.stripTrailingSlash=!0,this.decodePercentEncoding=!0,this.truncate={length:0,location:"end"},this.className="",this.replaceFn=null,this.context=void 0,this.sanitizeHtml=!1,this.matchers=null,this.tagBuilder=null,this.urls=this.normalizeUrlsCfg(t.urls),this.email="boolean"==typeof t.email?t.email:this.email,this.phone="boolean"==typeof t.phone?t.phone:this.phone,this.hashtag=t.hashtag||this.hashtag,this.mention=t.mention||this.mention,this.newWindow="boolean"==typeof t.newWindow?t.newWindow:this.newWindow,this.stripPrefix=this.normalizeStripPrefixCfg(t.stripPrefix),this.stripTrailingSlash="boolean"==typeof t.stripTrailingSlash?t.stripTrailingSlash:this.stripTrailingSlash,this.decodePercentEncoding="boolean"==typeof t.decodePercentEncoding?t.decodePercentEncoding:this.decodePercentEncoding,this.sanitizeHtml=t.sanitizeHtml||!1;var n=this.mention;if(!1!==n&&-1===["twitter","instagram","soundcloud","tiktok"].indexOf(n))throw new Error("invalid `mention` cfg '".concat(n,"' - see docs"));var r=this.hashtag;if(!1!==r&&-1===["twitter","facebook","instagram","tiktok"].indexOf(r))throw new Error("invalid `hashtag` cfg '".concat(r,"' - see docs"));this.truncate=this.normalizeTruncateCfg(t.truncate),this.className=t.className||this.className,this.replaceFn=t.replaceFn||this.replaceFn,this.context=t.context||this}return e.link=function(t,n){return new e(n).link(t)},e.parse=function(t,n){return new e(n).parse(t)},e.prototype.normalizeUrlsCfg=function(e){return null==e&&(e=!0),"boolean"==typeof e?{schemeMatches:e,wwwMatches:e,tldMatches:e}:{schemeMatches:"boolean"!=typeof e.schemeMatches||e.schemeMatches,wwwMatches:"boolean"!=typeof e.wwwMatches||e.wwwMatches,tldMatches:"boolean"!=typeof e.tldMatches||e.tldMatches}},e.prototype.normalizeStripPrefixCfg=function(e){return null==e&&(e=!0),"boolean"==typeof e?{scheme:e,www:e}:{scheme:"boolean"!=typeof e.scheme||e.scheme,www:"boolean"!=typeof e.www||e.www}},e.prototype.normalizeTruncateCfg=function(e){return"number"==typeof e?{length:e,location:"end"}:function(e,t){for(var n in t)t.hasOwnProperty(n)&&void 0===e[n]&&(e[n]=t[n]);return e}(e||{},{length:Number.POSITIVE_INFINITY,location:"end"})},e.prototype.parse=function(e){var t=this,n=["a","style","script"],r=0,i=[];return Rde(e,{onOpenTag:function(e){n.indexOf(e)>=0&&r++},onText:function(e,n){if(0===r){var o=function(e,t){if(!t.global)throw new Error("`splitRegex` must have the 'g' flag set");for(var n,r=[],i=0;n=t.exec(e);)r.push(e.substring(i,n.index)),r.push(n[0]),i=n.index+n[0].length;return r.push(e.substring(i)),r}(e,/(&nbsp;|&#160;|&lt;|&#60;|&gt;|&#62;|&quot;|&#34;|&#39;)/gi),a=n;o.forEach((function(e,n){if(n%2==0){var r=t.parseText(e,a);i.push.apply(i,r)}a+=e.length}))}},onCloseTag:function(e){n.indexOf(e)>=0&&(r=Math.max(r-1,0))},onComment:function(e){},onDoctype:function(e){}}),i=this.compactMatches(i),i=this.removeUnwantedMatches(i)},e.prototype.compactMatches=function(e){e.sort((function(e,t){return e.getOffset()-t.getOffset()}));for(var t=0;t<e.length-1;){var n=e[t],r=n.getOffset(),i=n.getMatchedText().length,o=r+i;if(t+1<e.length){if(e[t+1].getOffset()===r){var a=e[t+1].getMatchedText().length>i?t:t+1;e.splice(a,1);continue}if(e[t+1].getOffset()<o){e.splice(t+1,1);continue}}t++}return e},e.prototype.removeUnwantedMatches=function(e){return this.hashtag||qfe(e,(function(e){return"hashtag"===e.getType()})),this.email||qfe(e,(function(e){return"email"===e.getType()})),this.phone||qfe(e,(function(e){return"phone"===e.getType()})),this.mention||qfe(e,(function(e){return"mention"===e.getType()})),this.urls.schemeMatches||qfe(e,(function(e){return"url"===e.getType()&&"scheme"===e.getUrlMatchType()})),this.urls.wwwMatches||qfe(e,(function(e){return"url"===e.getType()&&"www"===e.getUrlMatchType()})),this.urls.tldMatches||qfe(e,(function(e){return"url"===e.getType()&&"tld"===e.getUrlMatchType()})),e},e.prototype.parseText=function(e,t){void 0===t&&(t=0),t=t||0;for(var n=this.getMatchers(),r=[],i=0,o=n.length;i<o;i++){for(var a=n[i].parseMatches(e),s=0,u=a.length;s<u;s++)a[s].setOffset(t+a[s].getOffset());r.push.apply(r,a)}return r},e.prototype.link=function(e){if(!e)return"";this.sanitizeHtml&&(e=e.replace(/</g,"&lt;").replace(/>/g,"&gt;"));for(var t=this.parse(e),n=[],r=0,i=0,o=t.length;i<o;i++){var a=t[i];n.push(e.substring(r,a.getOffset())),n.push(this.createMatchReturnVal(a)),r=a.getOffset()+a.getMatchedText().length}return n.push(e.substring(r)),n.join("")},e.prototype.createMatchReturnVal=function(e){var t;return this.replaceFn&&(t=this.replaceFn.call(this.context,e)),"string"==typeof t?t:!1===t?e.getMatchedText():t instanceof zfe?t.toAnchorString():e.buildTag().toAnchorString()},e.prototype.getMatchers=function(){if(this.matchers)return this.matchers;var e=this.getTagBuilder(),t=[new _de({tagBuilder:e,serviceName:this.hashtag}),new Ide({tagBuilder:e}),new Dde({tagBuilder:e}),new Tde({tagBuilder:e,serviceName:this.mention}),new kde({tagBuilder:e,stripPrefix:this.stripPrefix,stripTrailingSlash:this.stripTrailingSlash,decodePercentEncoding:this.decodePercentEncoding})];return this.matchers=t},e.prototype.getTagBuilder=function(){var e=this.tagBuilder;return e||(e=this.tagBuilder=new Yfe({newWindow:this.newWindow,truncate:this.truncate,className:this.className})),e},e.version="3.15.0",e.AnchorTagBuilder=Yfe,e.HtmlTag=zfe,e.matcher={Email:Ide,Hashtag:_de,Matcher:nde,Mention:Tde,Phone:Dde,Url:kde},e.match={Email:Wfe,Hashtag:Zfe,Match:Xfe,Mention:$fe,Phone:ede,Url:tde},e}();function Kde(e){return Hde.link(e,{stripPrefix:!1,email:!1,phone:!1})}const jde=TAe((function({clickableUrls:e,hasCertificateDefinition:t,displayHTML:n}){return t?qe`
749
+ `}),{mapStateToProps:e=>({recipientName:iAe(e),issueDate:rAe(e),issuedOn:nAe(e),issuerName:aAe(e),transactionId:fAe(e),issuerPublicKey:bAe(e),issuerProfileDomain:BAe(e),issuerProfileUrl:IAe(e),signatureSuiteType:EAe(e),chain:dAe(e)}),ownProps:{direction:String,hideRecipientName:Boolean}});var Ofe;window.customElements.define("buv-certificate-details",Rfe);var Hfe,Kfe,jfe=qe(Ofe||(Ofe=E(['<style>.buv-o-text-11{font-size:11px}.buv-o-text-12{font-size:12px}.buv-o-text-13{font-size:13px}.buv-o-text-15{font-size:15px;line-height:20px}.buv-o-text-bold{font-weight:bold}.buv-o-text-11{font-size:11px}.buv-o-text-12{font-size:12px}.buv-o-text-13{font-size:13px}.buv-o-text-15{font-size:15px;line-height:20px}.buv-o-text-bold{font-weight:bold}.buv-c-certificate--fixed-width{max-width:460px;min-width:0;margin:0 auto}.buv-c-full-certificate{box-shadow:0 1px 5px rgba(0,0,0,.15);padding:20px;background-color:#fff;display:block;font-family:serif;text-align:center;color:#49555f;font-size:12px;overflow:auto;word-wrap:break-word;height:100vh;max-height:calc(100vh - 150px);line-height:initial}.buv-c-full-certificate section{max-width:100%;padding:0}.buv-c-full-certificate img{max-width:100%;height:auto;width:inherit}@media only screen and (min-width: 640px){.buv-c-full-certificate{font-size:16px}}.buv-c-full-certificate__button{margin-top:15px}.buv-c-full-certificate__details{display:flex;justify-content:space-between;margin-top:15px}.buv-c-full-certificate__details-list{min-width:calc(100% - 190px);width:calc(100% - 105px)}.buv-c-full-certificate .buv-c-full-certificate-img{max-width:125px;max-height:125px}.buv-c-full-certificate__titles::before,.buv-c-full-certificate__titles::after{content:" ";display:block;background-color:#edf1f4;width:30%;text-align:center;margin:20px auto;height:2px}.buv-c-full-certificate__title{font-weight:normal;margin:0}.buv-c-full-certificate__title--name{color:#000;font-size:30px;margin-bottom:10px}.buv-c-full-certificate__title--main{font-size:21px;margin-bottom:10px}.buv-c-full-certificate__title--sub{font-size:16px;font-style:italic}.buv-c-full-certificate__description{margin:0 0 40px;line-height:1.5}.buv-c-full-certificate-signatures{list-style-type:none;display:flex;justify-content:space-around;width:100%;margin:0 0 20px;padding:0}.buv-c-full-certificate-signatures__signature{margin-right:30px;display:flex;flex-direction:column;justify-content:center}.buv-c-full-certificate-signatures__signature:last-child{margin:0}.buv-c-full-certificate-img--secondary{max-width:150px;max-height:150px}</style>'])));var Gfe=TAe((function(e){var t=e.hasCertificateDefinition,n=e.certificateImage,r=e.certificateTitle,i=e.certificateSeal,o=e.certificateSignatures,a=e.certificateSubtitle,s=e.certificateDescription,u=e.recipientName,l=e.issuerName;if(!t)return null;var A=o.map((function(e){return qe(Hfe||(Hfe=E(["\n <li class='buv-c-full-certificate-signatures__signature'>\n <img class='buv-c-full-certificate-img--secondary' src='","' alt='"," ","'/>\n <span class='buv-o-text-12'>","</span>\n </li>\n "])),e.image,so("text.signed"),e.jobTitle,e.jobTitle)}));return qe(Kfe||(Kfe=E(["\n ","\n <section class='buv-c-full-certificate'>\n <img class='buv-c-full-certificate-img' src='","' alt='","'/>\n <div class='buv-c-full-certificate__titles'>\n <h1 class='buv-c-full-certificate__title buv-c-full-certificate__title--name'>","</h1>\n <h2 class='buv-c-full-certificate__title buv-c-full-certificate__title--main'>","</h2>\n <h3 class='buv-c-full-certificate__title buv-c-full-certificate__title--sub'>","</h3>\n </div>\n <p class='buv-c-full-certificate__description'>","</p>\n <ul class='buv-c-full-certificate-signatures'>\n ","\n </ul>\n <img class='buv-c-full-certificate-img--secondary' src='","' alt='"," ","'/>\n </section>\n "])),jfe,n,r,u,r,a,s,A,i,so("text.certified"),l)}),{mapStateToProps:function(e){return{hasCertificateDefinition:!!eAe(e),certificateImage:xAe(e),certificateTitle:oAe(e),certificateSubtitle:kAe(e),certificateDescription:SAe(e),certificateSeal:_Ae(e),certificateSignatures:QAe(e),recipientName:iAe(e),issuerName:aAe(e)}}});function qfe(e,t){if(Array.prototype.indexOf)return e.indexOf(t);for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}function Vfe(e,t){for(var n=e.length-1;n>=0;n--)!0===t(e[n])&&e.splice(n,1)}function zfe(e){throw new Error("Unhandled case for value: '".concat(e,"'"))}window.customElements.define("buv-full-certificate-v1",Gfe);var Jfe=function(){function e(e){void 0===e&&(e={}),this.tagName="",this.attrs={},this.innerHTML="",this.whitespaceRegex=/\s+/,this.tagName=e.tagName||"",this.attrs=e.attrs||{},this.innerHTML=e.innerHtml||e.innerHTML||""}return e.prototype.setTagName=function(e){return this.tagName=e,this},e.prototype.getTagName=function(){return this.tagName||""},e.prototype.setAttr=function(e,t){return this.getAttrs()[e]=t,this},e.prototype.getAttr=function(e){return this.getAttrs()[e]},e.prototype.setAttrs=function(e){return Object.assign(this.getAttrs(),e),this},e.prototype.getAttrs=function(){return this.attrs||(this.attrs={})},e.prototype.setClass=function(e){return this.setAttr("class",e)},e.prototype.addClass=function(e){for(var t,n=this.getClass(),r=this.whitespaceRegex,i=n?n.split(r):[],o=e.split(r);t=o.shift();)-1===qfe(i,t)&&i.push(t);return this.getAttrs().class=i.join(" "),this},e.prototype.removeClass=function(e){for(var t,n=this.getClass(),r=this.whitespaceRegex,i=n?n.split(r):[],o=e.split(r);i.length&&(t=o.shift());){var a=qfe(i,t);-1!==a&&i.splice(a,1)}return this.getAttrs().class=i.join(" "),this},e.prototype.getClass=function(){return this.getAttrs().class||""},e.prototype.hasClass=function(e){return-1!==(" "+this.getClass()+" ").indexOf(" "+e+" ")},e.prototype.setInnerHTML=function(e){return this.innerHTML=e,this},e.prototype.setInnerHtml=function(e){return this.setInnerHTML(e)},e.prototype.getInnerHTML=function(){return this.innerHTML||""},e.prototype.getInnerHtml=function(){return this.getInnerHTML()},e.prototype.toAnchorString=function(){var e=this.getTagName(),t=this.buildAttrsStr();return["<",e,t=t?" "+t:"",">",this.getInnerHtml(),"</",e,">"].join("")},e.prototype.buildAttrsStr=function(){if(!this.attrs)return"";var e=this.getAttrs(),t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(n+'="'+e[n]+'"');return t.join(" ")},e}();var Yfe,Xfe=function(){function e(e){void 0===e&&(e={}),this.newWindow=!1,this.truncate={},this.className="",this.newWindow=e.newWindow||!1,this.truncate=e.truncate||{},this.className=e.className||""}return e.prototype.build=function(e){return new Jfe({tagName:"a",attrs:this.createAttrs(e),innerHtml:this.processAnchorText(e.getAnchorText())})},e.prototype.createAttrs=function(e){var t={href:e.getAnchorHref()},n=this.createCssClass(e);return n&&(t.class=n),this.newWindow&&(t.target="_blank",t.rel="noopener noreferrer"),this.truncate&&this.truncate.length&&this.truncate.length<e.getAnchorText().length&&(t.title=e.getAnchorHref()),t},e.prototype.createCssClass=function(e){var t=this.className;if(t){for(var n=[t],r=e.getCssClassSuffixes(),i=0,o=r.length;i<o;i++)n.push(t+"-"+r[i]);return n.join(" ")}return""},e.prototype.processAnchorText=function(e){return e=this.doTruncate(e)},e.prototype.doTruncate=function(e){var t=this.truncate;if(!t||!t.length)return e;var n=t.length,r=t.location;return"smart"===r?function(e,t,n){var r,i;null==n?(n="&hellip;",i=3,r=8):(i=n.length,r=n.length);var o=function(e){var t="";return e.scheme&&e.host&&(t+=e.scheme+"://"),e.host&&(t+=e.host),e.path&&(t+="/"+e.path),e.query&&(t+="?"+e.query),e.fragment&&(t+="#"+e.fragment),t},a=function(e,t){var r=t/2,i=Math.ceil(r),o=-1*Math.floor(r),a="";return o<0&&(a=e.substr(o)),e.substr(0,i)+n+a};if(e.length<=t)return e;var s=t-i,u=function(e){var t={},n=e,r=n.match(/^([a-z]+):\/\//i);return r&&(t.scheme=r[1],n=n.substr(r[0].length)),(r=n.match(/^(.*?)(?=(\?|#|\/|$))/i))&&(t.host=r[1],n=n.substr(r[0].length)),(r=n.match(/^\/(.*?)(?=(\?|#|$))/i))&&(t.path=r[1],n=n.substr(r[0].length)),(r=n.match(/^\?(.*?)(?=(#|$))/i))&&(t.query=r[1],n=n.substr(r[0].length)),(r=n.match(/^#(.*?)$/i))&&(t.fragment=r[1]),t}(e);if(u.query){var l=u.query.match(/^(.*?)(?=(\?|\#))(.*?)$/i);l&&(u.query=u.query.substr(0,l[1].length),e=o(u))}if(e.length<=t)return e;if(u.host&&(u.host=u.host.replace(/^www\./,""),e=o(u)),e.length<=t)return e;var A="";if(u.host&&(A+=u.host),A.length>=s)return u.host.length==t?(u.host.substr(0,t-i)+n).substr(0,s+r):a(A,s).substr(0,s+r);var c="";if(u.path&&(c+="/"+u.path),u.query&&(c+="?"+u.query),c){if((A+c).length>=s)return(A+c).length==t?(A+c).substr(0,t):(A+a(c,s-A.length)).substr(0,s+r);A+=c}if(u.fragment){var h="#"+u.fragment;if((A+h).length>=s)return(A+h).length==t?(A+h).substr(0,t):(A+a(h,s-A.length)).substr(0,s+r);A+=h}if(u.scheme&&u.host){var f=u.scheme+"://";if((A+f).length<s)return(f+A).substr(0,t)}if(A.length<=t)return A;var d="";return s>0&&(d=A.substr(-1*Math.floor(s/2))),(A.substr(0,Math.ceil(s/2))+n+d).substr(0,s+r)}(e,n):"middle"===r?function(e,t,n){if(e.length<=t)return e;var r,i;null==n?(n="&hellip;",r=8,i=3):(r=n.length,i=n.length);var o=t-i,a="";return o>0&&(a=e.substr(-1*Math.floor(o/2))),(e.substr(0,Math.ceil(o/2))+n+a).substr(0,o+r)}(e,n):function(e,t,n){return function(e,t,n){var r;return e.length>t&&(null==n?(n="&hellip;",r=3):r=n.length,e=e.substring(0,t-r)+n),e}(e,t,n)}(e,n)},e}(),Wfe=function(){function e(e){this.__jsduckDummyDocProp=null,this.matchedText="",this.offset=0,this.tagBuilder=e.tagBuilder,this.matchedText=e.matchedText,this.offset=e.offset}return e.prototype.getMatchedText=function(){return this.matchedText},e.prototype.setOffset=function(e){this.offset=e},e.prototype.getOffset=function(){return this.offset},e.prototype.getCssClassSuffixes=function(){return[this.getType()]},e.prototype.buildTag=function(){return this.tagBuilder.build(this)},e}(),Zfe=function(e){function t(t){var n=e.call(this,t)||this;return n.email="",n.email=t.email,n}return Pt(t,e),t.prototype.getType=function(){return"email"},t.prototype.getEmail=function(){return this.email},t.prototype.getAnchorHref=function(){return"mailto:"+this.email},t.prototype.getAnchorText=function(){return this.email},t}(Wfe),$fe=function(e){function t(t){var n=e.call(this,t)||this;return n.serviceName="",n.hashtag="",n.serviceName=t.serviceName,n.hashtag=t.hashtag,n}return Pt(t,e),t.prototype.getType=function(){return"hashtag"},t.prototype.getServiceName=function(){return this.serviceName},t.prototype.getHashtag=function(){return this.hashtag},t.prototype.getAnchorHref=function(){var e=this.serviceName,t=this.hashtag;switch(e){case"twitter":return"https://twitter.com/hashtag/"+t;case"facebook":return"https://www.facebook.com/hashtag/"+t;case"instagram":return"https://instagram.com/explore/tags/"+t;case"tiktok":return"https://www.tiktok.com/tag/"+t;default:throw new Error("Unknown service name to point hashtag to: "+e)}},t.prototype.getAnchorText=function(){return"#"+this.hashtag},t}(Wfe),ede=function(e){function t(t){var n=e.call(this,t)||this;return n.serviceName="twitter",n.mention="",n.mention=t.mention,n.serviceName=t.serviceName,n}return Pt(t,e),t.prototype.getType=function(){return"mention"},t.prototype.getMention=function(){return this.mention},t.prototype.getServiceName=function(){return this.serviceName},t.prototype.getAnchorHref=function(){switch(this.serviceName){case"twitter":return"https://twitter.com/"+this.mention;case"instagram":return"https://instagram.com/"+this.mention;case"soundcloud":return"https://soundcloud.com/"+this.mention;case"tiktok":return"https://www.tiktok.com/@"+this.mention;default:throw new Error("Unknown service name to point mention to: "+this.serviceName)}},t.prototype.getAnchorText=function(){return"@"+this.mention},t.prototype.getCssClassSuffixes=function(){var t=e.prototype.getCssClassSuffixes.call(this),n=this.getServiceName();return n&&t.push(n),t},t}(Wfe),tde=function(e){function t(t){var n=e.call(this,t)||this;return n.number="",n.plusSign=!1,n.number=t.number,n.plusSign=t.plusSign,n}return Pt(t,e),t.prototype.getType=function(){return"phone"},t.prototype.getPhoneNumber=function(){return this.number},t.prototype.getNumber=function(){return this.getPhoneNumber()},t.prototype.getAnchorHref=function(){return"tel:"+(this.plusSign?"+":"")+this.number},t.prototype.getAnchorText=function(){return this.matchedText},t}(Wfe),nde=function(e){function t(t){var n=e.call(this,t)||this;return n.url="",n.urlMatchType="scheme",n.protocolUrlMatch=!1,n.protocolRelativeMatch=!1,n.stripPrefix={scheme:!0,www:!0},n.stripTrailingSlash=!0,n.decodePercentEncoding=!0,n.schemePrefixRegex=/^(https?:\/\/)?/i,n.wwwPrefixRegex=/^(https?:\/\/)?(www\.)?/i,n.protocolRelativeRegex=/^\/\//,n.protocolPrepended=!1,n.urlMatchType=t.urlMatchType,n.url=t.url,n.protocolUrlMatch=t.protocolUrlMatch,n.protocolRelativeMatch=t.protocolRelativeMatch,n.stripPrefix=t.stripPrefix,n.stripTrailingSlash=t.stripTrailingSlash,n.decodePercentEncoding=t.decodePercentEncoding,n}return Pt(t,e),t.prototype.getType=function(){return"url"},t.prototype.getUrlMatchType=function(){return this.urlMatchType},t.prototype.getUrl=function(){var e=this.url;return this.protocolRelativeMatch||this.protocolUrlMatch||this.protocolPrepended||(e=this.url="http://"+e,this.protocolPrepended=!0),e},t.prototype.getAnchorHref=function(){return this.getUrl().replace(/&amp;/g,"&")},t.prototype.getAnchorText=function(){var e=this.getMatchedText();return this.protocolRelativeMatch&&(e=this.stripProtocolRelativePrefix(e)),this.stripPrefix.scheme&&(e=this.stripSchemePrefix(e)),this.stripPrefix.www&&(e=this.stripWwwPrefix(e)),this.stripTrailingSlash&&(e=this.removeTrailingSlash(e)),this.decodePercentEncoding&&(e=this.removePercentEncoding(e)),e},t.prototype.stripSchemePrefix=function(e){return e.replace(this.schemePrefixRegex,"")},t.prototype.stripWwwPrefix=function(e){return e.replace(this.wwwPrefixRegex,"$1")},t.prototype.stripProtocolRelativePrefix=function(e){return e.replace(this.protocolRelativeRegex,"")},t.prototype.removeTrailingSlash=function(e){return"/"===e.charAt(e.length-1)&&(e=e.slice(0,-1)),e},t.prototype.removePercentEncoding=function(e){var t=e.replace(/%22/gi,"&quot;").replace(/%26/gi,"&amp;").replace(/%27/gi,"&#39;").replace(/%3C/gi,"&lt;").replace(/%3E/gi,"&gt;");try{return decodeURIComponent(t)}catch(e){return t}},t}(Wfe),rde=function(e){this.__jsduckDummyDocProp=null,this.tagBuilder=e.tagBuilder},ide=/[A-Za-z]/,ode=/[\d]/,ade=/[\D]/,sde=/\s/,ude=/['"]/,lde=/[\x00-\x1F\x7F]/,Ade=/A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC/.source,cde=Ade+/\u2700-\u27bf\udde6-\uddff\ud800-\udbff\udc00-\udfff\ufe0e\ufe0f\u0300-\u036f\ufe20-\ufe23\u20d0-\u20f0\ud83c\udffb-\udfff\u200d\u3299\u3297\u303d\u3030\u24c2\ud83c\udd70-\udd71\udd7e-\udd7f\udd8e\udd91-\udd9a\udde6-\uddff\ude01-\ude02\ude1a\ude2f\ude32-\ude3a\ude50-\ude51\u203c\u2049\u25aa-\u25ab\u25b6\u25c0\u25fb-\u25fe\u00a9\u00ae\u2122\u2139\udc04\u2600-\u26FF\u2b05\u2b06\u2b07\u2b1b\u2b1c\u2b50\u2b55\u231a\u231b\u2328\u23cf\u23e9-\u23f3\u23f8-\u23fa\udccf\u2935\u2934\u2190-\u21ff/.source+/\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D4-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C03\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D01-\u0D03\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF5\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F/.source,hde=/0-9\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0BE6-\u0BEF\u0C66-\u0C6F\u0CE6-\u0CEF\u0D66-\u0D6F\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F29\u1040-\u1049\u1090-\u1099\u17E0-\u17E9\u1810-\u1819\u1946-\u194F\u19D0-\u19D9\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\uA620-\uA629\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19/.source,fde=cde+hde,dde=cde+hde,pde="(?:["+hde+"]{1,3}\\.){3}["+hde+"]{1,3}",gde="["+dde+"](?:["+dde+"\\-]{0,61}["+dde+"])?",vde=function(e){return"(?=("+gde+"))\\"+e},yde=function(e){return"(?:"+vde(e)+"(?:\\."+vde(e+1)+"){0,126}|"+pde+")"},mde=new RegExp("[".concat(dde,"]")),wde=/(?:xn--vermgensberatung-pwb|xn--vermgensberater-ctb|xn--clchc0ea0b2g2a9gcd|xn--w4r85el8fhu5dnra|northwesternmutual|travelersinsurance|vermögensberatung|xn--3oq18vl8pn36a|xn--5su34j936bgsg|xn--bck1b9a5dre4c|xn--mgbah1a3hjkrd|xn--mgbai9azgqp6j|xn--mgberp4a5d4ar|xn--xkc2dl3a5ee0h|vermögensberater|xn--fzys8d69uvgm|xn--mgba7c0bbn0a|xn--mgbcpq6gpa1a|xn--xkc2al3hye2a|americanexpress|kerryproperties|sandvikcoromant|xn--i1b6b1a6a2e|xn--kcrx77d1x4a|xn--lgbbat1ad8j|xn--mgba3a4f16a|xn--mgbaakc7dvf|xn--mgbc0a9azcg|xn--nqv7fs00ema|afamilycompany|americanfamily|bananarepublic|cancerresearch|cookingchannel|kerrylogistics|weatherchannel|xn--54b7fta0cc|xn--6qq986b3xl|xn--80aqecdr1a|xn--b4w605ferd|xn--fiq228c5hs|xn--h2breg3eve|xn--jlq480n2rg|xn--jlq61u9w7b|xn--mgba3a3ejt|xn--mgbaam7a8h|xn--mgbayh7gpa|xn--mgbbh1a71e|xn--mgbca7dzdo|xn--mgbi4ecexp|xn--mgbx4cd0ab|xn--rvc1e0am3e|international|lifeinsurance|travelchannel|wolterskluwer|xn--cckwcxetd|xn--eckvdtc9d|xn--fpcrj9c3d|xn--fzc2c9e2c|xn--h2brj9c8c|xn--tiq49xqyj|xn--yfro4i67o|xn--ygbi2ammx|construction|lplfinancial|scholarships|versicherung|xn--3e0b707e|xn--45br5cyl|xn--4dbrk0ce|xn--80adxhks|xn--80asehdb|xn--8y0a063a|xn--gckr3f0f|xn--mgb9awbf|xn--mgbab2bd|xn--mgbgu82a|xn--mgbpl2fh|xn--mgbt3dhd|xn--mk1bu44c|xn--ngbc5azd|xn--ngbe9e0a|xn--ogbpf8fl|xn--qcka1pmc|accountants|barclaycard|blackfriday|blockbuster|bridgestone|calvinklein|contractors|creditunion|engineering|enterprises|foodnetwork|investments|kerryhotels|lamborghini|motorcycles|olayangroup|photography|playstation|productions|progressive|redumbrella|williamhill|xn--11b4c3d|xn--1ck2e1b|xn--1qqw23a|xn--2scrj9c|xn--3bst00m|xn--3ds443g|xn--3hcrj9c|xn--42c2d9a|xn--45brj9c|xn--55qw42g|xn--6frz82g|xn--80ao21a|xn--9krt00a|xn--cck2b3b|xn--czr694b|xn--d1acj3b|xn--efvy88h|xn--fct429k|xn--fjq720a|xn--flw351e|xn--g2xx48c|xn--gecrj9c|xn--gk3at1e|xn--h2brj9c|xn--hxt814e|xn--imr513n|xn--j6w193g|xn--jvr189m|xn--kprw13d|xn--kpry57d|xn--mgbbh1a|xn--mgbtx2b|xn--mix891f|xn--nyqy26a|xn--otu796d|xn--pgbs0dh|xn--q9jyb4c|xn--rhqv96g|xn--rovu88b|xn--s9brj9c|xn--ses554g|xn--t60b56a|xn--vuq861b|xn--w4rs40l|xn--xhq521b|xn--zfr164b|சிங்கப்பூர்|accountant|apartments|associates|basketball|bnpparibas|boehringer|capitalone|consulting|creditcard|cuisinella|eurovision|extraspace|foundation|healthcare|immobilien|industries|management|mitsubishi|nextdirect|properties|protection|prudential|realestate|republican|restaurant|schaeffler|swiftcover|tatamotors|technology|university|vlaanderen|volkswagen|xn--30rr7y|xn--3pxu8k|xn--45q11c|xn--4gbrim|xn--55qx5d|xn--5tzm5g|xn--80aswg|xn--90a3ac|xn--9dbq2a|xn--9et52u|xn--c2br7g|xn--cg4bki|xn--czrs0t|xn--czru2d|xn--fiq64b|xn--fiqs8s|xn--fiqz9s|xn--io0a7i|xn--kput3i|xn--mxtq1m|xn--o3cw4h|xn--pssy2u|xn--q7ce6a|xn--unup4y|xn--wgbh1c|xn--wgbl6a|xn--y9a3aq|accenture|alfaromeo|allfinanz|amsterdam|analytics|aquarelle|barcelona|bloomberg|christmas|community|directory|education|equipment|fairwinds|financial|firestone|fresenius|frontdoor|furniture|goldpoint|hisamitsu|homedepot|homegoods|homesense|institute|insurance|kuokgroup|lancaster|landrover|lifestyle|marketing|marshalls|melbourne|microsoft|panasonic|passagens|pramerica|richardli|scjohnson|shangrila|solutions|statebank|statefarm|stockholm|travelers|vacations|xn--90ais|xn--c1avg|xn--d1alf|xn--e1a4c|xn--fhbei|xn--j1aef|xn--j1amh|xn--l1acc|xn--ngbrx|xn--nqv7f|xn--p1acf|xn--qxa6a|xn--tckwe|xn--vhquv|yodobashi|موريتانيا|abudhabi|airforce|allstate|attorney|barclays|barefoot|bargains|baseball|boutique|bradesco|broadway|brussels|budapest|builders|business|capetown|catering|catholic|cipriani|cityeats|cleaning|clinique|clothing|commbank|computer|delivery|deloitte|democrat|diamonds|discount|discover|download|engineer|ericsson|etisalat|exchange|feedback|fidelity|firmdale|football|frontier|goodyear|grainger|graphics|guardian|hdfcbank|helsinki|holdings|hospital|infiniti|ipiranga|istanbul|jpmorgan|lighting|lundbeck|marriott|maserati|mckinsey|memorial|merckmsd|mortgage|observer|partners|pharmacy|pictures|plumbing|property|redstone|reliance|saarland|samsclub|security|services|shopping|showtime|softbank|software|stcgroup|supplies|training|vanguard|ventures|verisign|woodside|xn--90ae|xn--node|xn--p1ai|xn--qxam|yokohama|السعودية|abogado|academy|agakhan|alibaba|android|athleta|auction|audible|auspost|avianca|banamex|bauhaus|bentley|bestbuy|booking|brother|bugatti|capital|caravan|careers|channel|charity|chintai|citadel|clubmed|college|cologne|comcast|company|compare|contact|cooking|corsica|country|coupons|courses|cricket|cruises|dentist|digital|domains|exposed|express|farmers|fashion|ferrari|ferrero|finance|fishing|fitness|flights|florist|flowers|forsale|frogans|fujitsu|gallery|genting|godaddy|grocery|guitars|hamburg|hangout|hitachi|holiday|hosting|hoteles|hotmail|hyundai|ismaili|jewelry|juniper|kitchen|komatsu|lacaixa|lanxess|lasalle|latrobe|leclerc|limited|lincoln|markets|monster|netbank|netflix|network|neustar|okinawa|oldnavy|organic|origins|philips|pioneer|politie|realtor|recipes|rentals|reviews|rexroth|samsung|sandvik|schmidt|schwarz|science|shiksha|singles|staples|storage|support|surgery|systems|temasek|theater|theatre|tickets|tiffany|toshiba|trading|walmart|wanggou|watches|weather|website|wedding|whoswho|windows|winners|xfinity|yamaxun|youtube|zuerich|католик|اتصالات|البحرين|الجزائر|العليان|پاکستان|كاثوليك|இந்தியா|abarth|abbott|abbvie|africa|agency|airbus|airtel|alipay|alsace|alstom|amazon|anquan|aramco|author|bayern|beauty|berlin|bharti|bostik|boston|broker|camera|career|casino|center|chanel|chrome|church|circle|claims|clinic|coffee|comsec|condos|coupon|credit|cruise|dating|datsun|dealer|degree|dental|design|direct|doctor|dunlop|dupont|durban|emerck|energy|estate|events|expert|family|flickr|futbol|gallup|garden|george|giving|global|google|gratis|health|hermes|hiphop|hockey|hotels|hughes|imamat|insure|intuit|jaguar|joburg|juegos|kaufen|kinder|kindle|kosher|lancia|latino|lawyer|lefrak|living|locker|london|luxury|madrid|maison|makeup|market|mattel|mobile|monash|mormon|moscow|museum|mutual|nagoya|natura|nissan|nissay|norton|nowruz|office|olayan|online|oracle|orange|otsuka|pfizer|photos|physio|pictet|quebec|racing|realty|reisen|repair|report|review|rocher|rogers|ryukyu|safety|sakura|sanofi|school|schule|search|secure|select|shouji|soccer|social|stream|studio|supply|suzuki|swatch|sydney|taipei|taobao|target|tattoo|tennis|tienda|tjmaxx|tkmaxx|toyota|travel|unicom|viajes|viking|villas|virgin|vision|voting|voyage|vuelos|walter|webcam|xihuan|yachts|yandex|zappos|москва|онлайн|ابوظبي|ارامكو|الاردن|المغرب|امارات|فلسطين|مليسيا|भारतम्|இலங்கை|ファッション|actor|adult|aetna|amfam|amica|apple|archi|audio|autos|azure|baidu|beats|bible|bingo|black|boats|bosch|build|canon|cards|chase|cheap|cisco|citic|click|cloud|coach|codes|crown|cymru|dabur|dance|deals|delta|drive|dubai|earth|edeka|email|epson|faith|fedex|final|forex|forum|gallo|games|gifts|gives|glade|glass|globo|gmail|green|gripe|group|gucci|guide|homes|honda|horse|house|hyatt|ikano|irish|jetzt|koeln|kyoto|lamer|lease|legal|lexus|lilly|linde|lipsy|lixil|loans|locus|lotte|lotto|macys|mango|media|miami|money|movie|nexus|nikon|ninja|nokia|nowtv|omega|osaka|paris|parts|party|phone|photo|pizza|place|poker|praxi|press|prime|promo|quest|radio|rehab|reise|ricoh|rocks|rodeo|rugby|salon|sener|seven|sharp|shell|shoes|skype|sling|smart|smile|solar|space|sport|stada|store|study|style|sucks|swiss|tatar|tires|tirol|tmall|today|tokyo|tools|toray|total|tours|trade|trust|tunes|tushu|ubank|vegas|video|vodka|volvo|wales|watch|weber|weibo|works|world|xerox|yahoo|ישראל|ایران|بازار|بھارت|سودان|سورية|همراه|भारोत|संगठन|বাংলা|భారత్|ഭാരതം|嘉里大酒店|aarp|able|adac|aero|akdn|ally|amex|arab|army|arpa|arte|asda|asia|audi|auto|baby|band|bank|bbva|beer|best|bike|bing|blog|blue|bofa|bond|book|buzz|cafe|call|camp|care|cars|casa|case|cash|cbre|cern|chat|citi|city|club|cool|coop|cyou|data|date|dclk|deal|dell|desi|diet|dish|docs|duck|dvag|erni|fage|fail|fans|farm|fast|fiat|fido|film|fire|fish|flir|food|ford|free|fund|game|gbiz|gent|ggee|gift|gmbh|gold|golf|goog|guge|guru|hair|haus|hdfc|help|here|hgtv|host|hsbc|icbc|ieee|imdb|immo|info|itau|java|jeep|jobs|jprs|kddi|kiwi|kpmg|kred|land|lego|lgbt|lidl|life|like|limo|link|live|loan|loft|love|ltda|luxe|maif|meet|meme|menu|mini|mint|mobi|moda|moto|name|navy|news|next|nico|nike|ollo|open|page|pars|pccw|pics|ping|pink|play|plus|pohl|porn|post|prod|prof|qpon|raid|read|reit|rent|rest|rich|rmit|room|rsvp|ruhr|safe|sale|sarl|save|saxo|scot|seat|seek|sexy|shaw|shia|shop|show|silk|sina|site|skin|sncf|sohu|song|sony|spot|star|surf|talk|taxi|team|tech|teva|tiaa|tips|town|toys|tube|vana|visa|viva|vivo|vote|voto|wang|weir|wien|wiki|wine|work|xbox|yoga|zara|zero|zone|дети|сайт|بارت|بيتك|ڀارت|تونس|شبكة|عراق|عمان|موقع|भारत|ভারত|ভাৰত|ਭਾਰਤ|ભારત|ଭାରତ|ಭಾರತ|ලංකා|アマゾン|グーグル|クラウド|ポイント|大众汽车|组织机构|電訊盈科|香格里拉|aaa|abb|abc|aco|ads|aeg|afl|aig|anz|aol|app|art|aws|axa|bar|bbc|bbt|bcg|bcn|bet|bid|bio|biz|bms|bmw|bom|boo|bot|box|buy|bzh|cab|cal|cam|car|cat|cba|cbn|cbs|ceo|cfa|cfd|com|cpa|crs|csc|dad|day|dds|dev|dhl|diy|dnp|dog|dot|dtv|dvr|eat|eco|edu|esq|eus|fan|fit|fly|foo|fox|frl|ftr|fun|fyi|gal|gap|gay|gdn|gea|gle|gmo|gmx|goo|gop|got|gov|hbo|hiv|hkt|hot|how|ibm|ice|icu|ifm|inc|ing|ink|int|ist|itv|jcb|jio|jll|jmp|jnj|jot|joy|kfh|kia|kim|kpn|krd|lat|law|lds|llc|llp|lol|lpl|ltd|man|map|mba|med|men|mil|mit|mlb|mls|mma|moe|moi|mom|mov|msd|mtn|mtr|nab|nba|nec|net|new|nfl|ngo|nhk|now|nra|nrw|ntt|nyc|obi|off|one|ong|onl|ooo|org|ott|ovh|pay|pet|phd|pid|pin|pnc|pro|pru|pub|pwc|qvc|red|ren|ril|rio|rip|run|rwe|sap|sas|sbi|sbs|sca|scb|ses|sew|sex|sfr|ski|sky|soy|spa|srl|stc|tab|tax|tci|tdk|tel|thd|tjx|top|trv|tui|tvs|ubs|uno|uol|ups|vet|vig|vin|vip|wed|win|wme|wow|wtc|wtf|xin|xxx|xyz|you|yun|zip|бел|ком|қаз|мкд|мон|орг|рус|срб|укр|հայ|קום|عرب|قطر|كوم|مصر|कॉम|नेट|คอม|ไทย|ລາວ|ストア|セール|みんな|中文网|亚马逊|天主教|我爱你|新加坡|淡马锡|诺基亚|飞利浦|ac|ad|ae|af|ag|ai|al|am|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cu|cv|cw|cx|cy|cz|de|dj|dk|dm|do|dz|ec|ee|eg|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|ss|st|su|sv|sx|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|za|zm|zw|ελ|ευ|бг|ею|рф|გე|닷넷|닷컴|삼성|한국|コム|世界|中信|中国|中國|企业|佛山|信息|健康|八卦|公司|公益|台湾|台灣|商城|商店|商标|嘉里|在线|大拿|娱乐|家電|广东|微博|慈善|手机|招聘|政务|政府|新闻|时尚|書籍|机构|游戏|澳門|点看|移动|网址|网店|网站|网络|联通|谷歌|购物|通販|集团|食品|餐厅|香港)/,bde=new RegExp("[".concat(dde,"!#$%&'*+/=?^_`{|}~-]")),Ide=new RegExp("^".concat(wde.source,"$")),Bde=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.localPartCharRegex=bde,t.strictTldRegex=Ide,t}return Pt(t,e),t.prototype.parseMatches=function(e){for(var t=this.tagBuilder,n=this.localPartCharRegex,r=this.strictTldRegex,i=[],o=e.length,a=new Ede,s={m:"a",a:"i",i:"l",l:"t",t:"o",o:":"},u=0,l=0,A=a;u<o;){var c=e.charAt(u);switch(l){case 0:h(c);break;case 1:f(e.charAt(u-1),c);break;case 2:d(c);break;case 3:p(c);break;case 4:g(c);break;case 5:v(c);break;case 6:y(c);break;case 7:m(c);break;default:zfe(l)}u++}return I(),i;function h(e){"m"===e?w(1):n.test(e)&&w()}function f(e,t){":"===e?n.test(t)?(l=2,A=new Ede(Ut(Ut({},A),{hasMailtoPrefix:!0}))):b():s[e]===t||(n.test(t)?l=2:"."===t?l=3:"@"===t?l=4:b())}function d(e){"."===e?l=3:"@"===e?l=4:n.test(e)||b()}function p(e){"."===e||"@"===e?b():n.test(e)?l=2:b()}function g(e){mde.test(e)?l=5:b()}function v(e){"."===e?l=7:"-"===e?l=6:mde.test(e)||I()}function y(e){"-"===e||"."===e?I():mde.test(e)?l=5:I()}function m(e){"."===e||"-"===e?I():mde.test(e)?(l=5,A=new Ede(Ut(Ut({},A),{hasDomainDot:!0}))):I()}function w(e){void 0===e&&(e=2),l=e,A=new Ede({idx:u})}function b(){l=0,A=a}function I(){if(A.hasDomainDot){var n=e.slice(A.idx,u);/[-.]$/.test(n)&&(n=n.slice(0,-1));var o=A.hasMailtoPrefix?n.slice("mailto:".length):n;(function(e){var t=(e.split(".").pop()||"").toLowerCase();return r.test(t)})(o)&&i.push(new Zfe({tagBuilder:t,matchedText:n,offset:A.idx,email:o}))}b()}},t}(rde),Ede=function(e){void 0===e&&(e={}),this.idx=void 0!==e.idx?e.idx:-1,this.hasMailtoPrefix=!!e.hasMailtoPrefix,this.hasDomainDot=!!e.hasDomainDot},Cde=function(){function e(){}return e.isValid=function(e,t){return!(t&&!this.isValidUriScheme(t)||this.urlMatchDoesNotHaveProtocolOrDot(e,t)||this.urlMatchDoesNotHaveAtLeastOneWordChar(e,t)&&!this.isValidIpAddress(e)||this.containsMultipleDots(e))},e.isValidIpAddress=function(e){var t=new RegExp(this.hasFullProtocolRegex.source+this.ipRegex.source);return null!==e.match(t)},e.containsMultipleDots=function(e){var t=e;return this.hasFullProtocolRegex.test(e)&&(t=e.split("://")[1]),t.split("/")[0].indexOf("..")>-1},e.isValidUriScheme=function(e){var t=e.match(this.uriSchemeRegex),n=t&&t[0].toLowerCase();return"javascript:"!==n&&"vbscript:"!==n},e.urlMatchDoesNotHaveProtocolOrDot=function(e,t){return!(!e||t&&this.hasFullProtocolRegex.test(t)||-1!==e.indexOf("."))},e.urlMatchDoesNotHaveAtLeastOneWordChar=function(e,t){return!(!e||!t)&&(!this.hasFullProtocolRegex.test(t)&&!this.hasWordCharAfterProtocolRegex.test(e))},e.hasFullProtocolRegex=/^[A-Za-z][-.+A-Za-z0-9]*:\/\//,e.uriSchemeRegex=/^[A-Za-z][-.+A-Za-z0-9]*:/,e.hasWordCharAfterProtocolRegex=new RegExp(":[^\\s]*?["+Ade+"]"),e.ipRegex=/[0-9][0-9]?[0-9]?\.[0-9][0-9]?[0-9]?\.[0-9][0-9]?[0-9]?\.[0-9][0-9]?[0-9]?(:[0-9]*)?\/?$/,e}(),xde=(Yfe=new RegExp("[/?#](?:["+dde+"\\-+&@#/%=~_()|'$*\\[\\]{}?!:,.;^✓]*["+dde+"\\-+&@#/%=~_()|'$*\\[\\]{}✓])?"),new RegExp(["(?:","(",/(?:[A-Za-z][-.+A-Za-z0-9]{0,63}:(?![A-Za-z][-.+A-Za-z0-9]{0,63}:\/\/)(?!\d+\/?)(?:\/\/)?)/.source,yde(2),")","|","(","(//)?",/(?:www\.)/.source,yde(6),")","|","(","(//)?",yde(10)+"\\.",wde.source,"(?![-"+fde+"])",")",")","(?::[0-9]+)?","(?:"+Yfe.source+")?"].join(""),"gi")),kde=new RegExp("["+dde+"]"),Sde=function(e){function t(t){var n=e.call(this,t)||this;return n.stripPrefix={scheme:!0,www:!0},n.stripTrailingSlash=!0,n.decodePercentEncoding=!0,n.matcherRegex=xde,n.wordCharRegExp=kde,n.stripPrefix=t.stripPrefix,n.stripTrailingSlash=t.stripTrailingSlash,n.decodePercentEncoding=t.decodePercentEncoding,n}return Pt(t,e),t.prototype.parseMatches=function(e){for(var t,n=this.matcherRegex,r=this.stripPrefix,i=this.stripTrailingSlash,o=this.decodePercentEncoding,a=this.tagBuilder,s=[],u=function(){var n=t[0],u=t[1],A=t[4],c=t[5],h=t[9],f=t.index,d=c||h,p=e.charAt(f-1);if(!Cde.isValid(n,u))return"continue";if(f>0&&"@"===p)return"continue";if(f>0&&d&&l.wordCharRegExp.test(p))return"continue";if(/\?$/.test(n)&&(n=n.substr(0,n.length-1)),l.matchHasUnbalancedClosingParen(n))n=n.substr(0,n.length-1);else{var g=l.matchHasInvalidCharAfterTld(n,u);g>-1&&(n=n.substr(0,g))}var v=["http://","https://"].find((function(e){return!!u&&-1!==u.indexOf(e)}));if(v){var y=n.indexOf(v);n=n.substr(y),u=u.substr(y),f+=y}var m=u?"scheme":A?"www":"tld",w=!!u;s.push(new nde({tagBuilder:a,matchedText:n,offset:f,urlMatchType:m,url:n,protocolUrlMatch:w,protocolRelativeMatch:!!d,stripPrefix:r,stripTrailingSlash:i,decodePercentEncoding:o}))},l=this;null!==(t=n.exec(e));)u();return s},t.prototype.matchHasUnbalancedClosingParen=function(e){var t,n=e.charAt(e.length-1);if(")"===n)t="(";else if("]"===n)t="[";else{if("}"!==n)return!1;t="{"}for(var r=0,i=0,o=e.length-1;i<o;i++){var a=e.charAt(i);a===t?r++:a===n&&(r=Math.max(r-1,0))}return 0===r},t.prototype.matchHasInvalidCharAfterTld=function(e,t){if(!e)return-1;var n=0;t&&(n=e.indexOf(":"),e=e.slice(n));var r=new RegExp("^((.?//)?[-."+dde+"]*[-"+dde+"]\\.[-"+dde+"]+)").exec(e);return null===r?-1:(n+=r[1].length,e=e.slice(r[1].length),/^[^-.A-Za-z0-9:\/?#]/.test(e)?n:-1)},t}(rde),Qde=new RegExp("#[_".concat(dde,"]{1,139}(?![_").concat(dde,"])"),"g"),_de=new RegExp("[^"+dde+"]"),Nde=function(e){function t(t){var n=e.call(this,t)||this;return n.serviceName="twitter",n.matcherRegex=Qde,n.nonWordCharRegex=_de,n.serviceName=t.serviceName,n}return Pt(t,e),t.prototype.parseMatches=function(e){for(var t,n=this.matcherRegex,r=this.nonWordCharRegex,i=this.serviceName,o=this.tagBuilder,a=[];null!==(t=n.exec(e));){var s=t.index,u=e.charAt(s-1);if(0===s||r.test(u)){var l=t[0],A=t[0].slice(1);a.push(new $fe({tagBuilder:o,matchedText:l,offset:s,serviceName:i,hashtag:A}))}}return a},t}(rde),Dde=new RegExp("".concat(/(?:(?:(?:(\+)?\d{1,3}[-\040.]?)?\(?\d{3}\)?[-\040.]?\d{3}[-\040.]?\d{4})|(?:(\+)(?:9[976]\d|8[987530]\d|6[987]\d|5[90]\d|42\d|3[875]\d|2[98654321]\d|9[8543210]|8[6421]|6[6543210]|5[87654321]|4[987654310]|3[9643210]|2[70]|7|1)[-\040.]?(?:\d[-\040.]?){6,12}\d+))([,;]+[0-9]+#?)*/.source,"|").concat(/(0([1-9]{1}-?[1-9]\d{3}|[1-9]{2}-?\d{3}|[1-9]{2}\d{1}-?\d{2}|[1-9]{2}\d{2}-?\d{1})-?\d{4}|0[789]0-?\d{4}-?\d{4}|050-?\d{4}-?\d{4})/.source),"g"),Fde=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.matcherRegex=Dde,t}return Pt(t,e),t.prototype.parseMatches=function(e){for(var t,n=this.matcherRegex,r=this.tagBuilder,i=[];null!==(t=n.exec(e));){var o=t[0],a=o.replace(/[^0-9,;#]/g,""),s=!(!t[1]&&!t[2]),u=0==t.index?"":e.substr(t.index-1,1),l=e.substr(t.index+o.length,1),A=!u.match(/\d/)&&!l.match(/\d/);this.testMatch(t[3])&&this.testMatch(o)&&A&&i.push(new tde({tagBuilder:r,matchedText:o,offset:t.index,number:a,plusSign:s}))}return i},t.prototype.testMatch=function(e){return ade.test(e)},t}(rde),Pde=new RegExp("@[_".concat(dde,"]{1,50}(?![_").concat(dde,"])"),"g"),Ude=new RegExp("@[_.".concat(dde,"]{1,30}(?![_").concat(dde,"])"),"g"),Lde=new RegExp("@[-_.".concat(dde,"]{1,50}(?![-_").concat(dde,"])"),"g"),Mde=new RegExp("@[_.".concat(dde,"]{1,23}[_").concat(dde,"](?![_").concat(dde,"])"),"g"),Tde=new RegExp("[^"+dde+"]"),Rde=function(e){function t(t){var n=e.call(this,t)||this;return n.serviceName="twitter",n.matcherRegexes={twitter:Pde,instagram:Ude,soundcloud:Lde,tiktok:Mde},n.nonWordCharRegex=Tde,n.serviceName=t.serviceName,n}return Pt(t,e),t.prototype.parseMatches=function(e){var t,n=this.serviceName,r=this.matcherRegexes[this.serviceName],i=this.nonWordCharRegex,o=this.tagBuilder,a=[];if(!r)return a;for(;null!==(t=r.exec(e));){var s=t.index,u=e.charAt(s-1);if(0===s||i.test(u)){var l=t[0].replace(/\.+$/g,""),A=l.slice(1);a.push(new ede({tagBuilder:o,matchedText:l,offset:s,serviceName:n,mention:A}))}}return a},t}(rde);function Ode(e,t){for(var n,r=t.onOpenTag,i=t.onCloseTag,o=t.onText,a=t.onComment,s=t.onDoctype,u=new Hde,l=0,A=e.length,c=0,h=0,f=u;l<A;){var d=e.charAt(l);switch(c){case 0:p(d);break;case 1:g(d);break;case 2:y(d);break;case 3:v(d);break;case 4:m(d);break;case 5:w(d);break;case 6:b(d);break;case 7:I(d);break;case 8:B(d);break;case 9:E(d);break;case 10:C(d);break;case 11:x(d);break;case 12:k(d);break;case 13:S();break;case 14:Q(d);break;case 15:_(d);break;case 16:N(d);break;case 17:D(d);break;case 18:F(d);break;case 19:P(d);break;case 20:U(d);break;default:zfe(c)}l++}function p(e){"<"===e&&M()}function g(e){"!"===e?c=13:"/"===e?(c=2,f=new Hde(Ut(Ut({},f),{isClosing:!0}))):"<"===e?M():ide.test(e)?(c=3,f=new Hde(Ut(Ut({},f),{isOpening:!0}))):(c=0,f=u)}function v(e){sde.test(e)?(f=new Hde(Ut(Ut({},f),{name:R()})),c=4):"<"===e?M():"/"===e?(f=new Hde(Ut(Ut({},f),{name:R()})),c=12):">"===e?(f=new Hde(Ut(Ut({},f),{name:R()})),T()):ide.test(e)||ode.test(e)||":"===e||L()}function y(e){">"===e?L():ide.test(e)?c=3:L()}function m(e){sde.test(e)||("/"===e?c=12:">"===e?T():"<"===e?M():"="===e||ude.test(e)||lde.test(e)?L():c=5)}function w(e){sde.test(e)?c=6:"/"===e?c=12:"="===e?c=7:">"===e?T():"<"===e?M():ude.test(e)&&L()}function b(e){sde.test(e)||("/"===e?c=12:"="===e?c=7:">"===e?T():"<"===e?M():ude.test(e)?L():c=5)}function I(e){sde.test(e)||('"'===e?c=8:"'"===e?c=9:/[>=`]/.test(e)?L():"<"===e?M():c=10)}function B(e){'"'===e&&(c=11)}function E(e){"'"===e&&(c=11)}function C(e){sde.test(e)?c=4:">"===e?T():"<"===e&&M()}function x(e){sde.test(e)?c=4:"/"===e?c=12:">"===e?T():"<"===e?M():(c=4,l--)}function k(e){">"===e?(f=new Hde(Ut(Ut({},f),{isClosing:!0})),T()):c=4}function S(t){"--"===e.substr(l,2)?(l+=2,f=new Hde(Ut(Ut({},f),{type:"comment"})),c=14):"DOCTYPE"===e.substr(l,7).toUpperCase()?(l+=7,f=new Hde(Ut(Ut({},f),{type:"doctype"})),c=20):L()}function Q(e){"-"===e?c=15:">"===e?L():c=16}function _(e){"-"===e?c=18:">"===e?L():c=16}function N(e){"-"===e&&(c=17)}function D(e){c="-"===e?18:16}function F(e){">"===e?T():"!"===e?c=19:"-"===e||(c=16)}function P(e){"-"===e?c=17:">"===e?T():c=16}function U(e){">"===e?T():"<"===e&&M()}function L(){c=0,f=u}function M(){c=1,f=new Hde({idx:l})}function T(){var t=e.slice(h,f.idx);t&&o(t,h),"comment"===f.type?a(f.idx):"doctype"===f.type?s(f.idx):(f.isOpening&&r(f.name,f.idx),f.isClosing&&i(f.name,f.idx)),L(),h=l+1}function R(){var t=f.idx+(f.isClosing?2:1);return e.slice(t,l).toLowerCase()}h<l&&(n=e.slice(h,l),o(n,h),h=l+1)}var Hde=function(e){void 0===e&&(e={}),this.idx=void 0!==e.idx?e.idx:-1,this.type=e.type||"tag",this.name=e.name||"",this.isOpening=!!e.isOpening,this.isClosing=!!e.isClosing},Kde=function(){function e(t){void 0===t&&(t={}),this.version=e.version,this.urls={},this.email=!0,this.phone=!0,this.hashtag=!1,this.mention=!1,this.newWindow=!0,this.stripPrefix={scheme:!0,www:!0},this.stripTrailingSlash=!0,this.decodePercentEncoding=!0,this.truncate={length:0,location:"end"},this.className="",this.replaceFn=null,this.context=void 0,this.sanitizeHtml=!1,this.matchers=null,this.tagBuilder=null,this.urls=this.normalizeUrlsCfg(t.urls),this.email="boolean"==typeof t.email?t.email:this.email,this.phone="boolean"==typeof t.phone?t.phone:this.phone,this.hashtag=t.hashtag||this.hashtag,this.mention=t.mention||this.mention,this.newWindow="boolean"==typeof t.newWindow?t.newWindow:this.newWindow,this.stripPrefix=this.normalizeStripPrefixCfg(t.stripPrefix),this.stripTrailingSlash="boolean"==typeof t.stripTrailingSlash?t.stripTrailingSlash:this.stripTrailingSlash,this.decodePercentEncoding="boolean"==typeof t.decodePercentEncoding?t.decodePercentEncoding:this.decodePercentEncoding,this.sanitizeHtml=t.sanitizeHtml||!1;var n=this.mention;if(!1!==n&&-1===["twitter","instagram","soundcloud","tiktok"].indexOf(n))throw new Error("invalid `mention` cfg '".concat(n,"' - see docs"));var r=this.hashtag;if(!1!==r&&-1===["twitter","facebook","instagram","tiktok"].indexOf(r))throw new Error("invalid `hashtag` cfg '".concat(r,"' - see docs"));this.truncate=this.normalizeTruncateCfg(t.truncate),this.className=t.className||this.className,this.replaceFn=t.replaceFn||this.replaceFn,this.context=t.context||this}return e.link=function(t,n){return new e(n).link(t)},e.parse=function(t,n){return new e(n).parse(t)},e.prototype.normalizeUrlsCfg=function(e){return null==e&&(e=!0),"boolean"==typeof e?{schemeMatches:e,wwwMatches:e,tldMatches:e}:{schemeMatches:"boolean"!=typeof e.schemeMatches||e.schemeMatches,wwwMatches:"boolean"!=typeof e.wwwMatches||e.wwwMatches,tldMatches:"boolean"!=typeof e.tldMatches||e.tldMatches}},e.prototype.normalizeStripPrefixCfg=function(e){return null==e&&(e=!0),"boolean"==typeof e?{scheme:e,www:e}:{scheme:"boolean"!=typeof e.scheme||e.scheme,www:"boolean"!=typeof e.www||e.www}},e.prototype.normalizeTruncateCfg=function(e){return"number"==typeof e?{length:e,location:"end"}:function(e,t){for(var n in t)t.hasOwnProperty(n)&&void 0===e[n]&&(e[n]=t[n]);return e}(e||{},{length:Number.POSITIVE_INFINITY,location:"end"})},e.prototype.parse=function(e){var t=this,n=["a","style","script"],r=0,i=[];return Ode(e,{onOpenTag:function(e){n.indexOf(e)>=0&&r++},onText:function(e,n){if(0===r){var o=function(e,t){if(!t.global)throw new Error("`splitRegex` must have the 'g' flag set");for(var n,r=[],i=0;n=t.exec(e);)r.push(e.substring(i,n.index)),r.push(n[0]),i=n.index+n[0].length;return r.push(e.substring(i)),r}(e,/(&nbsp;|&#160;|&lt;|&#60;|&gt;|&#62;|&quot;|&#34;|&#39;)/gi),a=n;o.forEach((function(e,n){if(n%2==0){var r=t.parseText(e,a);i.push.apply(i,r)}a+=e.length}))}},onCloseTag:function(e){n.indexOf(e)>=0&&(r=Math.max(r-1,0))},onComment:function(e){},onDoctype:function(e){}}),i=this.compactMatches(i),i=this.removeUnwantedMatches(i)},e.prototype.compactMatches=function(e){e.sort((function(e,t){return e.getOffset()-t.getOffset()}));for(var t=0;t<e.length-1;){var n=e[t],r=n.getOffset(),i=n.getMatchedText().length,o=r+i;if(t+1<e.length){if(e[t+1].getOffset()===r){var a=e[t+1].getMatchedText().length>i?t:t+1;e.splice(a,1);continue}if(e[t+1].getOffset()<o){e.splice(t+1,1);continue}}t++}return e},e.prototype.removeUnwantedMatches=function(e){return this.hashtag||Vfe(e,(function(e){return"hashtag"===e.getType()})),this.email||Vfe(e,(function(e){return"email"===e.getType()})),this.phone||Vfe(e,(function(e){return"phone"===e.getType()})),this.mention||Vfe(e,(function(e){return"mention"===e.getType()})),this.urls.schemeMatches||Vfe(e,(function(e){return"url"===e.getType()&&"scheme"===e.getUrlMatchType()})),this.urls.wwwMatches||Vfe(e,(function(e){return"url"===e.getType()&&"www"===e.getUrlMatchType()})),this.urls.tldMatches||Vfe(e,(function(e){return"url"===e.getType()&&"tld"===e.getUrlMatchType()})),e},e.prototype.parseText=function(e,t){void 0===t&&(t=0),t=t||0;for(var n=this.getMatchers(),r=[],i=0,o=n.length;i<o;i++){for(var a=n[i].parseMatches(e),s=0,u=a.length;s<u;s++)a[s].setOffset(t+a[s].getOffset());r.push.apply(r,a)}return r},e.prototype.link=function(e){if(!e)return"";this.sanitizeHtml&&(e=e.replace(/</g,"&lt;").replace(/>/g,"&gt;"));for(var t=this.parse(e),n=[],r=0,i=0,o=t.length;i<o;i++){var a=t[i];n.push(e.substring(r,a.getOffset())),n.push(this.createMatchReturnVal(a)),r=a.getOffset()+a.getMatchedText().length}return n.push(e.substring(r)),n.join("")},e.prototype.createMatchReturnVal=function(e){var t;return this.replaceFn&&(t=this.replaceFn.call(this.context,e)),"string"==typeof t?t:!1===t?e.getMatchedText():t instanceof Jfe?t.toAnchorString():e.buildTag().toAnchorString()},e.prototype.getMatchers=function(){if(this.matchers)return this.matchers;var e=this.getTagBuilder(),t=[new Nde({tagBuilder:e,serviceName:this.hashtag}),new Bde({tagBuilder:e}),new Fde({tagBuilder:e}),new Rde({tagBuilder:e,serviceName:this.mention}),new Sde({tagBuilder:e,stripPrefix:this.stripPrefix,stripTrailingSlash:this.stripTrailingSlash,decodePercentEncoding:this.decodePercentEncoding})];return this.matchers=t},e.prototype.getTagBuilder=function(){var e=this.tagBuilder;return e||(e=this.tagBuilder=new Xfe({newWindow:this.newWindow,truncate:this.truncate,className:this.className})),e},e.version="3.15.0",e.AnchorTagBuilder=Xfe,e.HtmlTag=Jfe,e.matcher={Email:Bde,Hashtag:Nde,Matcher:rde,Mention:Rde,Phone:Fde,Url:Sde},e.match={Email:Zfe,Hashtag:$fe,Match:Wfe,Mention:ede,Phone:tde,Url:nde},e}();function jde(e){return Kde.link(e,{stripPrefix:!1,email:!1,phone:!1})}const Gde=TAe((function({clickableUrls:e,hasCertificateDefinition:t,displayHTML:n}){return t?qe`
750
750
  ${Pfe}
751
- ${n?function(e,t){const n=["buv-c-full-certificate","qa-fullscreen-certificate"];Hue.certificates.displayHtmlHasNoWidthConstraint(e)&&n.push("buv-c-certificate--fixed-width");const r=t?Kde(e):e;return qe`<section class$=${n.join(" ")}>${Ffe(r)}</section>`}(n,e):qe`<buv-full-certificate-v1></buv-full-certificate-v1>`}
751
+ ${n?function(e,t){const n=["buv-c-full-certificate","qa-fullscreen-certificate"];Hue.certificates.displayHtmlHasNoWidthConstraint(e)&&n.push("buv-c-certificate--fixed-width");const r=t?jde(e):e;return qe`<section class$=${n.join(" ")}>${Ffe(r)}</section>`}(n,e):qe`<buv-full-certificate-v1></buv-full-certificate-v1>`}
752
752
  <div class='buv-c-full-certificate__details'>
753
753
  <buv-certificate-details class='buv-c-full-certificate__details-list'></buv-certificate-details>
754
754
  <buv-final-verification-step class='buv-c-fullscreen-certificate__verification-status' isVisible hideLink standalone>
755
755
  <buv-verify-button type='link'>${so("text.verifyAgain")}</buv-verify-button>
756
756
  </buv-final-verification-step>
757
757
  </div>
758
- `:null}),{mapStateToProps:e=>({hasCertificateDefinition:!!eAe(e),displayHTML:uAe(e),clickableUrls:rce(e)})});var Gde;window.customElements.define("buv-full-certificate",jde);var qde=qe(Gde||(Gde=E(["<style>.buv-o-text-11{font-size:11px}.buv-o-text-12{font-size:12px}.buv-o-text-13{font-size:13px}.buv-o-text-15{font-size:15px;line-height:20px}.buv-o-text-bold{font-weight:bold}.buv-c-certificate--fixed-width{max-width:460px;min-width:0;margin:0 auto}.buv-c-fullscreen-certificate{z-index:200;position:fixed;top:0;left:0;background-color:#fff;width:100vw;height:100vh;overflow:auto;box-sizing:border-box}@media only screen and (max-width: 750px){.buv-c-fullscreen-certificate{padding-top:170px}}.buv-c-fullscreen-certificate-header{box-shadow:0 1px 5px rgba(0,0,0,.15);width:100%;background-color:#fff}@media only screen and (max-width: 750px){.buv-c-fullscreen-certificate-header{position:fixed;top:0;z-index:10}}.buv-c-fullscreen-certificate-header__content{max-width:1440px;margin:0 auto;padding:20px;display:flex;align-items:center;position:relative;box-sizing:border-box}@media only screen and (max-width: 750px){.buv-c-fullscreen-certificate-header__content{flex-direction:column;justify-content:left;align-items:unset}}.buv-c-fullscreen-certificate__title{margin:0 30px 0 0}@media only screen and (max-width: 750px){.buv-c-fullscreen-certificate__title{margin-bottom:10px}}.buv-c-fullscreen-certificate__close{top:27px;right:20px}.buv-c-fullscreen-certificate__content{padding:20px;display:flex;max-width:1440px;margin:20px auto 0}@media only screen and (max-width: 750px){.buv-c-fullscreen-certificate__content{flex-direction:column-reverse;margin-top:0}}.buv-c-fullscreen-certificate__details{display:flex;flex-grow:1;flex-direction:column;max-width:280px;min-width:220px;margin-right:20px}@media only screen and (max-width: 750px){.buv-c-fullscreen-certificate__details{max-width:100vw;margin:20px 0 0}}.buv-c-fullscreen-certificate__verification-status{margin-bottom:15px}@media only screen and (max-width: 750px){.buv-c-fullscreen-certificate__verification-status{position:absolute;top:90px;width:calc(100% - 40px);margin:0}}.buv-c-fullscreen-certificate__details-item{margin-top:5px}.buv-c-fullscreen-certificate__separator{margin-top:30px;padding-top:30px;border-top:1px solid #f1f2f3}.buv-c-fullscreen-certificate__certificate{box-shadow:0 1px 5px rgba(0,0,0,.15);padding:20px;background-color:#fff;font-family:serif;text-align:center;color:#49555f;font-size:12px;word-wrap:break-word;min-height:calc(100vh - 145px);box-sizing:border-box;margin:0 auto;min-width:600px;line-height:initial}@media only screen and (max-width: 750px){.buv-c-fullscreen-certificate__certificate{min-width:unset;width:100%;overflow:auto}}.buv-c-fullscreen-certificate__verify-other{margin-top:20px}</style>"])));const Vde=TAe((function({clickableUrls:e,hasCertificateDefinition:t,recipientName:n,displayHTML:r,onClose:i,disableDownloadPdf:o}){if(!t)return null;const a=["buv-c-fullscreen-certificate__certificate","qa-fullscreen-certificate"];return r&&Hue.certificates.displayHtmlHasNoWidthConstraint(r)&&a.push("buv-c-certificate--fixed-width"),qe`
759
- ${qde}
758
+ `:null}),{mapStateToProps:e=>({hasCertificateDefinition:!!eAe(e),displayHTML:uAe(e),clickableUrls:rce(e)})});var qde;window.customElements.define("buv-full-certificate",Gde);var Vde=qe(qde||(qde=E(["<style>.buv-o-text-11{font-size:11px}.buv-o-text-12{font-size:12px}.buv-o-text-13{font-size:13px}.buv-o-text-15{font-size:15px;line-height:20px}.buv-o-text-bold{font-weight:bold}.buv-c-certificate--fixed-width{max-width:460px;min-width:0;margin:0 auto}.buv-c-fullscreen-certificate{z-index:200;position:fixed;top:0;left:0;background-color:#fff;width:100vw;height:100vh;overflow:auto;box-sizing:border-box}@media only screen and (max-width: 750px){.buv-c-fullscreen-certificate{padding-top:170px}}.buv-c-fullscreen-certificate-header{box-shadow:0 1px 5px rgba(0,0,0,.15);width:100%;background-color:#fff}@media only screen and (max-width: 750px){.buv-c-fullscreen-certificate-header{position:fixed;top:0;z-index:10}}.buv-c-fullscreen-certificate-header__content{max-width:1440px;margin:0 auto;padding:20px;display:flex;align-items:center;position:relative;box-sizing:border-box}@media only screen and (max-width: 750px){.buv-c-fullscreen-certificate-header__content{flex-direction:column;justify-content:left;align-items:unset}}.buv-c-fullscreen-certificate__title{margin:0 30px 0 0}@media only screen and (max-width: 750px){.buv-c-fullscreen-certificate__title{margin-bottom:10px}}.buv-c-fullscreen-certificate__close{top:27px;right:20px}.buv-c-fullscreen-certificate__content{padding:20px;display:flex;max-width:1440px;margin:20px auto 0}@media only screen and (max-width: 750px){.buv-c-fullscreen-certificate__content{flex-direction:column-reverse;margin-top:0}}.buv-c-fullscreen-certificate__details{display:flex;flex-grow:1;flex-direction:column;max-width:280px;min-width:220px;margin-right:20px}@media only screen and (max-width: 750px){.buv-c-fullscreen-certificate__details{max-width:100vw;margin:20px 0 0}}.buv-c-fullscreen-certificate__verification-status{margin-bottom:15px}@media only screen and (max-width: 750px){.buv-c-fullscreen-certificate__verification-status{position:absolute;top:90px;width:calc(100% - 40px);margin:0}}.buv-c-fullscreen-certificate__details-item{margin-top:5px}.buv-c-fullscreen-certificate__separator{margin-top:30px;padding-top:30px;border-top:1px solid #f1f2f3}.buv-c-fullscreen-certificate__certificate{box-shadow:0 1px 5px rgba(0,0,0,.15);padding:20px;background-color:#fff;font-family:serif;text-align:center;color:#49555f;font-size:12px;word-wrap:break-word;min-height:calc(100vh - 145px);box-sizing:border-box;margin:0 auto;min-width:600px;line-height:initial}@media only screen and (max-width: 750px){.buv-c-fullscreen-certificate__certificate{min-width:unset;width:100%;overflow:auto}}.buv-c-fullscreen-certificate__verify-other{margin-top:20px}</style>"])));const zde=TAe((function({clickableUrls:e,hasCertificateDefinition:t,recipientName:n,displayHTML:r,onClose:i,disableDownloadPdf:o}){if(!t)return null;const a=["buv-c-fullscreen-certificate__certificate","qa-fullscreen-certificate"];return r&&Hue.certificates.displayHtmlHasNoWidthConstraint(r)&&a.push("buv-c-certificate--fixed-width"),qe`
759
+ ${Vde}
760
760
  <section class='buv-c-fullscreen-certificate'>
761
761
  <header class='buv-c-fullscreen-certificate-header'>
762
762
  <div class='buv-c-fullscreen-certificate-header__content'>
@@ -778,12 +778,12 @@ var _fe,Nfe,Dfe,Ffe=function(e){return function(e){return e.__litDirective=!0,e}
778
778
  <buv-verify-other-certificate class='buv-c-fullscreen-certificate__verify-other'></buv-verify-other-certificate>
779
779
  </div>
780
780
  <div class$=${a.join(" ")}>
781
- ${r?function(e,t){const n=t?Kde(e):e;return qe`${Ffe(n)}`}(r,e):qe`<buv-full-certificate-v1></buv-full-certificate-v1>`}
781
+ ${r?function(e,t){const n=t?jde(e):e;return qe`${Ffe(n)}`}(r,e):qe`<buv-full-certificate-v1></buv-full-certificate-v1>`}
782
782
  </div>
783
783
  </section>
784
784
  </section>
785
- `}),{mapDispatchToProps:{onClose:xhe},mapStateToProps:e=>({recipientName:iAe(e),hasCertificateDefinition:!!eAe(e),displayHTML:uAe(e),clickableUrls:rce(e),disableDownloadPdf:XAe(e)})});var zde,Jde,Yde,Xde,Wde;window.customElements.define("buv-fullscreen-certificate",Vde);var Zde=function(e){c(r,e);var t=b(r);function r(){var e;return s(this,r),(e=t.call(this)).hasRenderedOnce=!1,e}return l(r,[{key:"_firstRendered",value:function(){this.onLoad(this._props),this.hasRenderedOnce=!0}},{key:"_propertiesChanged",value:function(e,t,n){this._props=e,B(h(r.prototype),"_propertiesChanged",this).call(this,e,t,n),t.src!==n.src&&this.hasRenderedOnce&&this.onLoad({src:t.src}),t.explorerAPIs&&!n.explorerAPIs&&this.onLoad({explorerAPIs:t.explorerAPIs})}},{key:"renderCertificate",value:function(e){switch(e.displayMode){case FAe:return qe(zde||(zde=E(["<buv-full-certificate></buv-full-certificate>"])));case"fullscreen":return qe(Jde||(Jde=E(["<buv-fullscreen-certificate></buv-fullscreen-certificate>"])));default:return qe(Yde||(Yde=E(["<buv-card-certificate></buv-card-certificate>"])))}}},{key:"_render",value:function(e){var t=e.hasCertificate?"buv-c-verifier-body buv-c-verifier-body--padded":"";return qe(Xde||(Xde=E(["\n ","\n <section class='buv-c-verifier-main'>\n <buv-drag-and-drop>\n <div class='buv-c-verifier-layout'>\n <section class$='","'>\n ","\n <buv-certificate-input></buv-certificate-input>\n <buv-action-menu></buv-action-menu>\n ","\n <buv-verification-modal></buv-verification-modal>\n </section>\n <buv-footer interactive></buv-footer>\n </div>\n </buv-drag-and-drop>\n </section>\n "])),kfe,t,Yhe(e.errorMessage,!0),this.renderCertificate(e))}}],[{key:"properties",get:function(){return n({onLoad:Function,errorMessage:String,hasCertificate:Boolean},dce)}}]),r}(Xe);function $de(e){return e.errorMessage}window.customElements.define("buv-raw",Zde);const epe={onLoad:function(e={}){return function(t){const n=function(e){return Object.keys(dce).reduce((function(t,n){return e[n]&&(t[n]=e[n]),t}),{})}(e),{src:r,locale:i}=n;t({type:dt,payload:{options:n}}),Hue.certificates.isPathToCertificateValidURI(r)?t(lce(r)):function(e){try{return JSON.parse(e),!0}catch(e){return!1}}(r)&&t(uce(JSON.parse(r))),gce(i)}}},tpe=TAe((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return qe(Wde||(Wde=E(["<buv-raw\n src='","'\n onLoad='","'\n errorMessage='","'\n hasCertificate='","'\n disableAutoVerify='","'\n disableVerify='","'\n allowDownload='","'\n disableDownloadPdf='","'\n allowSocialShare='","'\n displayMode='","'\n showMetadata='","'\n clickableUrls='","'\n theme='","'\n locale='","'\n explorerAPIs='","'\n didResolverUrl='","'\n ></buv-raw>"])),e.src,e.onLoad,e.errorMessage,e.hasCertificate,e["disable-auto-verify"],e["disable-verify"],e["allow-download"],e["disable-download-pdf"],e["allow-social-share"],e["display-mode"],e["show-metadata"],e["clickable-urls"],e.theme,e.locale,e.explorerAPIs,e["did-resolver-url"])}),{mapDispatchToProps:epe,mapStateToProps:e=>({errorMessage:$de(e),hasCertificate:!!eAe(e)}),ownProps:Object.assign(Object.assign({},Zde.properties),fce)});window.customElements.define("blockcerts-verifier",tpe);var npe={exports:{}};
786
- /*! @license DOMPurify 2.3.8 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.3.8/LICENSE */!function(e,t){e.exports=function(){function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(e,n){return t=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},t(e,n)}function n(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function r(e,i,o){return r=n()?Reflect.construct:function(e,n,r){var i=[null];i.push.apply(i,n);var o=new(Function.bind.apply(e,i));return r&&t(o,r.prototype),o},r.apply(null,arguments)}function i(e){return o(e)||a(e)||s(e)||l()}function o(e){if(Array.isArray(e))return u(e)}function a(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function s(e,t){if(e){if("string"==typeof e)return u(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(e,t):void 0}}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function l(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var A=Object.hasOwnProperty,c=Object.setPrototypeOf,h=Object.isFrozen,f=Object.getPrototypeOf,d=Object.getOwnPropertyDescriptor,p=Object.freeze,g=Object.seal,v=Object.create,y="undefined"!=typeof Reflect&&Reflect,m=y.apply,w=y.construct;m||(m=function(e,t,n){return e.apply(t,n)}),p||(p=function(e){return e}),g||(g=function(e){return e}),w||(w=function(e,t){return r(e,i(t))});var b=N(Array.prototype.forEach),I=N(Array.prototype.pop),B=N(Array.prototype.push),E=N(String.prototype.toLowerCase),C=N(String.prototype.match),x=N(String.prototype.replace),k=N(String.prototype.indexOf),S=N(String.prototype.trim),Q=N(RegExp.prototype.test),_=D(TypeError);function N(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return m(e,t,r)}}function D(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return w(e,n)}}function F(e,t){c&&c(e,null);for(var n=t.length;n--;){var r=t[n];if("string"==typeof r){var i=E(r);i!==r&&(h(t)||(t[n]=i),r=i)}e[r]=!0}return e}function P(e){var t,n=v(null);for(t in e)m(A,e,[t])&&(n[t]=e[t]);return n}function U(e,t){for(;null!==e;){var n=d(e,t);if(n){if(n.get)return N(n.get);if("function"==typeof n.value)return N(n.value)}e=f(e)}function r(e){return console.warn("fallback value for",e),null}return r}var L=p(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),M=p(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),T=p(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),R=p(["animate","color-profile","cursor","discard","fedropshadow","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),O=p(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover"]),H=p(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),K=p(["#text"]),j=p(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),G=p(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),q=p(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),V=p(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),z=g(/\{\{[\w\W]*|[\w\W]*\}\}/gm),J=g(/<%[\w\W]*|[\w\W]*%>/gm),Y=g(/^data-[\-\w.\u00B7-\uFFFF]/),X=g(/^aria-[\-\w]+$/),W=g(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Z=g(/^(?:\w+script|data):/i),$=g(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),ee=g(/^html$/i),te=function(){return"undefined"==typeof window?null:window},ne=function(t,n){if("object"!==e(t)||"function"!=typeof t.createPolicy)return null;var r=null,i="data-tt-policy-suffix";n.currentScript&&n.currentScript.hasAttribute(i)&&(r=n.currentScript.getAttribute(i));var o="dompurify"+(r?"#"+r:"");try{return t.createPolicy(o,{createHTML:function(e){return e}})}catch(e){return console.warn("TrustedTypes policy "+o+" could not be created."),null}};function re(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:te(),n=function(e){return re(e)};if(n.version="2.3.8",n.removed=[],!t||!t.document||9!==t.document.nodeType)return n.isSupported=!1,n;var r=t.document,o=t.document,a=t.DocumentFragment,s=t.HTMLTemplateElement,u=t.Node,l=t.Element,A=t.NodeFilter,c=t.NamedNodeMap,h=void 0===c?t.NamedNodeMap||t.MozNamedAttrMap:c,f=t.HTMLFormElement,d=t.DOMParser,g=t.trustedTypes,v=l.prototype,y=U(v,"cloneNode"),m=U(v,"nextSibling"),w=U(v,"childNodes"),N=U(v,"parentNode");if("function"==typeof s){var D=o.createElement("template");D.content&&D.content.ownerDocument&&(o=D.content.ownerDocument)}var ie=ne(g,r),oe=ie?ie.createHTML(""):"",ae=o,se=ae.implementation,ue=ae.createNodeIterator,le=ae.createDocumentFragment,Ae=ae.getElementsByTagName,ce=r.importNode,he={};try{he=P(o).documentMode?o.documentMode:{}}catch(e){}var fe={};n.isSupported="function"==typeof N&&se&&void 0!==se.createHTMLDocument&&9!==he;var de,pe,ge=z,ve=J,ye=Y,me=X,we=Z,be=$,Ie=W,Be=null,Ee=F({},[].concat(i(L),i(M),i(T),i(O),i(K))),Ce=null,xe=F({},[].concat(i(j),i(G),i(q),i(V))),ke=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Se=null,Qe=null,_e=!0,Ne=!0,De=!1,Fe=!1,Pe=!1,Ue=!1,Le=!1,Me=!1,Te=!1,Re=!1,Oe=!0,He=!0,Ke=!1,je={},Ge=null,qe=F({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),Ve=null,ze=F({},["audio","video","img","source","image","track"]),Je=null,Ye=F({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Xe="http://www.w3.org/1998/Math/MathML",We="http://www.w3.org/2000/svg",Ze="http://www.w3.org/1999/xhtml",$e=Ze,et=!1,tt=["application/xhtml+xml","text/html"],nt="text/html",rt=null,it=o.createElement("form"),ot=function(e){return e instanceof RegExp||e instanceof Function},at=function(t){rt&&rt===t||(t&&"object"===e(t)||(t={}),t=P(t),Be="ALLOWED_TAGS"in t?F({},t.ALLOWED_TAGS):Ee,Ce="ALLOWED_ATTR"in t?F({},t.ALLOWED_ATTR):xe,Je="ADD_URI_SAFE_ATTR"in t?F(P(Ye),t.ADD_URI_SAFE_ATTR):Ye,Ve="ADD_DATA_URI_TAGS"in t?F(P(ze),t.ADD_DATA_URI_TAGS):ze,Ge="FORBID_CONTENTS"in t?F({},t.FORBID_CONTENTS):qe,Se="FORBID_TAGS"in t?F({},t.FORBID_TAGS):{},Qe="FORBID_ATTR"in t?F({},t.FORBID_ATTR):{},je="USE_PROFILES"in t&&t.USE_PROFILES,_e=!1!==t.ALLOW_ARIA_ATTR,Ne=!1!==t.ALLOW_DATA_ATTR,De=t.ALLOW_UNKNOWN_PROTOCOLS||!1,Fe=t.SAFE_FOR_TEMPLATES||!1,Pe=t.WHOLE_DOCUMENT||!1,Me=t.RETURN_DOM||!1,Te=t.RETURN_DOM_FRAGMENT||!1,Re=t.RETURN_TRUSTED_TYPE||!1,Le=t.FORCE_BODY||!1,Oe=!1!==t.SANITIZE_DOM,He=!1!==t.KEEP_CONTENT,Ke=t.IN_PLACE||!1,Ie=t.ALLOWED_URI_REGEXP||Ie,$e=t.NAMESPACE||Ze,t.CUSTOM_ELEMENT_HANDLING&&ot(t.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(ke.tagNameCheck=t.CUSTOM_ELEMENT_HANDLING.tagNameCheck),t.CUSTOM_ELEMENT_HANDLING&&ot(t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(ke.attributeNameCheck=t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),t.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(ke.allowCustomizedBuiltInElements=t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),de=de=-1===tt.indexOf(t.PARSER_MEDIA_TYPE)?nt:t.PARSER_MEDIA_TYPE,pe="application/xhtml+xml"===de?function(e){return e}:E,Fe&&(Ne=!1),Te&&(Me=!0),je&&(Be=F({},i(K)),Ce=[],!0===je.html&&(F(Be,L),F(Ce,j)),!0===je.svg&&(F(Be,M),F(Ce,G),F(Ce,V)),!0===je.svgFilters&&(F(Be,T),F(Ce,G),F(Ce,V)),!0===je.mathMl&&(F(Be,O),F(Ce,q),F(Ce,V))),t.ADD_TAGS&&(Be===Ee&&(Be=P(Be)),F(Be,t.ADD_TAGS)),t.ADD_ATTR&&(Ce===xe&&(Ce=P(Ce)),F(Ce,t.ADD_ATTR)),t.ADD_URI_SAFE_ATTR&&F(Je,t.ADD_URI_SAFE_ATTR),t.FORBID_CONTENTS&&(Ge===qe&&(Ge=P(Ge)),F(Ge,t.FORBID_CONTENTS)),He&&(Be["#text"]=!0),Pe&&F(Be,["html","head","body"]),Be.table&&(F(Be,["tbody"]),delete Se.tbody),p&&p(t),rt=t)},st=F({},["mi","mo","mn","ms","mtext"]),ut=F({},["foreignobject","desc","title","annotation-xml"]),lt=F({},["title","style","font","a","script"]),At=F({},M);F(At,T),F(At,R);var ct=F({},O);F(ct,H);var ht=function(e){var t=N(e);t&&t.tagName||(t={namespaceURI:Ze,tagName:"template"});var n=E(e.tagName),r=E(t.tagName);return e.namespaceURI===We?t.namespaceURI===Ze?"svg"===n:t.namespaceURI===Xe?"svg"===n&&("annotation-xml"===r||st[r]):Boolean(At[n]):e.namespaceURI===Xe?t.namespaceURI===Ze?"math"===n:t.namespaceURI===We?"math"===n&&ut[r]:Boolean(ct[n]):e.namespaceURI===Ze&&!(t.namespaceURI===We&&!ut[r])&&!(t.namespaceURI===Xe&&!st[r])&&!ct[n]&&(lt[n]||!At[n])},ft=function(e){B(n.removed,{element:e});try{e.parentNode.removeChild(e)}catch(t){try{e.outerHTML=oe}catch(t){e.remove()}}},dt=function(e,t){try{B(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){B(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e&&!Ce[e])if(Me||Te)try{ft(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},pt=function(e){var t,n;if(Le)e="<remove></remove>"+e;else{var r=C(e,/^[\r\n\t ]+/);n=r&&r[0]}"application/xhtml+xml"===de&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");var i=ie?ie.createHTML(e):e;if($e===Ze)try{t=(new d).parseFromString(i,de)}catch(e){}if(!t||!t.documentElement){t=se.createDocument($e,"template",null);try{t.documentElement.innerHTML=et?"":i}catch(e){}}var a=t.body||t.documentElement;return e&&n&&a.insertBefore(o.createTextNode(n),a.childNodes[0]||null),$e===Ze?Ae.call(t,Pe?"html":"body")[0]:Pe?t.documentElement:a},gt=function(e){return ue.call(e.ownerDocument||e,e,A.SHOW_ELEMENT|A.SHOW_COMMENT|A.SHOW_TEXT,null,!1)},vt=function(e){return e instanceof f&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof h)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore)},yt=function(t){return"object"===e(u)?t instanceof u:t&&"object"===e(t)&&"number"==typeof t.nodeType&&"string"==typeof t.nodeName},mt=function(e,t,r){fe[e]&&b(fe[e],(function(e){e.call(n,t,r,rt)}))},wt=function(e){var t;if(mt("beforeSanitizeElements",e,null),vt(e))return ft(e),!0;if(Q(/[\u0080-\uFFFF]/,e.nodeName))return ft(e),!0;var r=pe(e.nodeName);if(mt("uponSanitizeElement",e,{tagName:r,allowedTags:Be}),e.hasChildNodes()&&!yt(e.firstElementChild)&&(!yt(e.content)||!yt(e.content.firstElementChild))&&Q(/<[/\w]/g,e.innerHTML)&&Q(/<[/\w]/g,e.textContent))return ft(e),!0;if("select"===r&&Q(/<template/i,e.innerHTML))return ft(e),!0;if(!Be[r]||Se[r]){if(!Se[r]&&It(r)){if(ke.tagNameCheck instanceof RegExp&&Q(ke.tagNameCheck,r))return!1;if(ke.tagNameCheck instanceof Function&&ke.tagNameCheck(r))return!1}if(He&&!Ge[r]){var i=N(e)||e.parentNode,o=w(e)||e.childNodes;if(o&&i)for(var a=o.length-1;a>=0;--a)i.insertBefore(y(o[a],!0),m(e))}return ft(e),!0}return e instanceof l&&!ht(e)?(ft(e),!0):"noscript"!==r&&"noembed"!==r||!Q(/<\/no(script|embed)/i,e.innerHTML)?(Fe&&3===e.nodeType&&(t=e.textContent,t=x(t,ge," "),t=x(t,ve," "),e.textContent!==t&&(B(n.removed,{element:e.cloneNode()}),e.textContent=t)),mt("afterSanitizeElements",e,null),!1):(ft(e),!0)},bt=function(e,t,n){if(Oe&&("id"===t||"name"===t)&&(n in o||n in it))return!1;if(Ne&&!Qe[t]&&Q(ye,t));else if(_e&&Q(me,t));else if(!Ce[t]||Qe[t]){if(!(It(e)&&(ke.tagNameCheck instanceof RegExp&&Q(ke.tagNameCheck,e)||ke.tagNameCheck instanceof Function&&ke.tagNameCheck(e))&&(ke.attributeNameCheck instanceof RegExp&&Q(ke.attributeNameCheck,t)||ke.attributeNameCheck instanceof Function&&ke.attributeNameCheck(t))||"is"===t&&ke.allowCustomizedBuiltInElements&&(ke.tagNameCheck instanceof RegExp&&Q(ke.tagNameCheck,n)||ke.tagNameCheck instanceof Function&&ke.tagNameCheck(n))))return!1}else if(Je[t]);else if(Q(Ie,x(n,be,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==k(n,"data:")||!Ve[e])if(De&&!Q(we,x(n,be,"")));else if(n)return!1;return!0},It=function(e){return e.indexOf("-")>0},Bt=function(e){var t,r,i,o;mt("beforeSanitizeAttributes",e,null);var a=e.attributes;if(a){var s={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Ce};for(o=a.length;o--;){var u=t=a[o],l=u.name,A=u.namespaceURI;if(r="value"===l?t.value:S(t.value),i=pe(l),s.attrName=i,s.attrValue=r,s.keepAttr=!0,s.forceKeepAttr=void 0,mt("uponSanitizeAttribute",e,s),r=s.attrValue,!s.forceKeepAttr&&(dt(l,e),s.keepAttr))if(Q(/\/>/i,r))dt(l,e);else{Fe&&(r=x(r,ge," "),r=x(r,ve," "));var c=pe(e.nodeName);if(bt(c,i,r))try{A?e.setAttributeNS(A,l,r):e.setAttribute(l,r),I(n.removed)}catch(e){}}}mt("afterSanitizeAttributes",e,null)}},Et=function e(t){var n,r=gt(t);for(mt("beforeSanitizeShadowDOM",t,null);n=r.nextNode();)mt("uponSanitizeShadowNode",n,null),wt(n)||(n.content instanceof a&&e(n.content),Bt(n));mt("afterSanitizeShadowDOM",t,null)};return n.sanitize=function(i,o){var s,l,A,c,h;if((et=!i)&&(i="\x3c!--\x3e"),"string"!=typeof i&&!yt(i)){if("function"!=typeof i.toString)throw _("toString is not a function");if("string"!=typeof(i=i.toString()))throw _("dirty is not a string, aborting")}if(!n.isSupported){if("object"===e(t.toStaticHTML)||"function"==typeof t.toStaticHTML){if("string"==typeof i)return t.toStaticHTML(i);if(yt(i))return t.toStaticHTML(i.outerHTML)}return i}if(Ue||at(o),n.removed=[],"string"==typeof i&&(Ke=!1),Ke){if(i.nodeName){var f=pe(i.nodeName);if(!Be[f]||Se[f])throw _("root node is forbidden and cannot be sanitized in-place")}}else if(i instanceof u)1===(l=(s=pt("\x3c!----\x3e")).ownerDocument.importNode(i,!0)).nodeType&&"BODY"===l.nodeName||"HTML"===l.nodeName?s=l:s.appendChild(l);else{if(!Me&&!Fe&&!Pe&&-1===i.indexOf("<"))return ie&&Re?ie.createHTML(i):i;if(!(s=pt(i)))return Me?null:Re?oe:""}s&&Le&&ft(s.firstChild);for(var d=gt(Ke?i:s);A=d.nextNode();)3===A.nodeType&&A===c||wt(A)||(A.content instanceof a&&Et(A.content),Bt(A),c=A);if(c=null,Ke)return i;if(Me){if(Te)for(h=le.call(s.ownerDocument);s.firstChild;)h.appendChild(s.firstChild);else h=s;return Ce.shadowroot&&(h=ce.call(r,h,!0)),h}var p=Pe?s.outerHTML:s.innerHTML;return Pe&&Be["!doctype"]&&s.ownerDocument&&s.ownerDocument.doctype&&s.ownerDocument.doctype.name&&Q(ee,s.ownerDocument.doctype.name)&&(p="<!DOCTYPE "+s.ownerDocument.doctype.name+">\n"+p),Fe&&(p=x(p,ge," "),p=x(p,ve," ")),ie&&Re?ie.createHTML(p):p},n.setConfig=function(e){at(e),Ue=!0},n.clearConfig=function(){rt=null,Ue=!1},n.isValidAttribute=function(e,t,n){rt||at({});var r=pe(e),i=pe(t);return bt(r,i,n)},n.addHook=function(e,t){"function"==typeof t&&(fe[e]=fe[e]||[],B(fe[e],t))},n.removeHook=function(e){if(fe[e])return I(fe[e])},n.removeHooks=function(e){fe[e]&&(fe[e]=[])},n.removeAllHooks=function(){fe={}},n}return re()}()}(npe);var rpe=e({__proto__:null,default:npe.exports},[npe.exports]),ipe=function(e){return e&&e.Math==Math&&e},ope=ipe("object"==("undefined"==typeof globalThis?"undefined":i(globalThis))&&globalThis)||ipe("object"==("undefined"==typeof window?"undefined":i(window))&&window)||ipe("object"==("undefined"==typeof self?"undefined":i(self))&&self)||ipe("object"==i(Tt)&&Tt)||function(){return this}()||Function("return this")(),ape={},spe=function(e){try{return!!e()}catch(e){return!0}},upe=!spe((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),lpe=!spe((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")})),Ape=lpe,cpe=Function.prototype.call,hpe=Ape?cpe.bind(cpe):function(){return cpe.apply(cpe,arguments)},fpe={},dpe={}.propertyIsEnumerable,ppe=Object.getOwnPropertyDescriptor,gpe=ppe&&!dpe.call({1:2},1);fpe.f=gpe?function(e){var t=ppe(this,e);return!!t&&t.enumerable}:dpe;var vpe,ype,mpe=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},wpe=lpe,bpe=Function.prototype,Ipe=bpe.bind,Bpe=bpe.call,Epe=wpe&&Ipe.bind(Bpe,Bpe),Cpe=wpe?function(e){return e&&Epe(e)}:function(e){return e&&function(){return Bpe.apply(e,arguments)}},xpe=Cpe,kpe=xpe({}.toString),Spe=xpe("".slice),Qpe=function(e){return Spe(kpe(e),8,-1)},_pe=spe,Npe=Qpe,Dpe=Object,Fpe=Cpe("".split),Ppe=_pe((function(){return!Dpe("z").propertyIsEnumerable(0)}))?function(e){return"String"==Npe(e)?Fpe(e,""):Dpe(e)}:Dpe,Upe=TypeError,Lpe=function(e){if(null==e)throw Upe("Can't call method on "+e);return e},Mpe=Ppe,Tpe=Lpe,Rpe=function(e){return Mpe(Tpe(e))},Ope=function(e){return"function"==typeof e},Hpe=Ope,Kpe=function(e){return"object"==i(e)?null!==e:Hpe(e)},jpe=ope,Gpe=Ope,qpe=function(e){return Gpe(e)?e:void 0},Vpe=function(e,t){return arguments.length<2?qpe(jpe[e]):jpe[e]&&jpe[e][t]},zpe=Cpe({}.isPrototypeOf),Jpe=Vpe("navigator","userAgent")||"",Ype=ope,Xpe=Jpe,Wpe=Ype.process,Zpe=Ype.Deno,$pe=Wpe&&Wpe.versions||Zpe&&Zpe.version,ege=$pe&&$pe.v8;ege&&(ype=(vpe=ege.split("."))[0]>0&&vpe[0]<4?1:+(vpe[0]+vpe[1])),!ype&&Xpe&&(!(vpe=Xpe.match(/Edge\/(\d+)/))||vpe[1]>=74)&&(vpe=Xpe.match(/Chrome\/(\d+)/))&&(ype=+vpe[1]);var tge=ype,nge=tge,rge=spe,ige=!!Object.getOwnPropertySymbols&&!rge((function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&nge&&nge<41})),oge=ige&&!Symbol.sham&&"symbol"==i(Symbol.iterator),age=Vpe,sge=Ope,uge=zpe,lge=Object,Age=oge?function(e){return"symbol"==i(e)}:function(e){var t=age("Symbol");return sge(t)&&uge(t.prototype,lge(e))},cge=String,hge=function(e){try{return cge(e)}catch(e){return"Object"}},fge=Ope,dge=hge,pge=TypeError,gge=function(e){if(fge(e))return e;throw pge(dge(e)+" is not a function")},vge=gge,yge=function(e,t){var n=e[t];return null==n?void 0:vge(n)},mge=hpe,wge=Ope,bge=Kpe,Ige=TypeError,Bge={exports:{}},Ege=ope,Cge=Object.defineProperty,xge=function(e,t){try{Cge(Ege,e,{value:t,configurable:!0,writable:!0})}catch(n){Ege[e]=t}return t},kge=xge,Sge="__core-js_shared__",Qge=ope[Sge]||kge(Sge,{}),_ge=Qge;(Bge.exports=function(e,t){return _ge[e]||(_ge[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.24.1",mode:"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.24.1/LICENSE",source:"https://github.com/zloirock/core-js"});var Nge=Lpe,Dge=Object,Fge=function(e){return Dge(Nge(e))},Pge=Fge,Uge=Cpe({}.hasOwnProperty),Lge=Object.hasOwn||function(e,t){return Uge(Pge(e),t)},Mge=Cpe,Tge=0,Rge=Math.random(),Oge=Mge(1..toString),Hge=function(e){return"Symbol("+(void 0===e?"":e)+")_"+Oge(++Tge+Rge,36)},Kge=ope,jge=Bge.exports,Gge=Lge,qge=Hge,Vge=ige,zge=oge,Jge=jge("wks"),Yge=Kge.Symbol,Xge=Yge&&Yge.for,Wge=zge?Yge:Yge&&Yge.withoutSetter||qge,Zge=function(e){if(!Gge(Jge,e)||!Vge&&"string"!=typeof Jge[e]){var t="Symbol."+e;Vge&&Gge(Yge,e)?Jge[e]=Yge[e]:Jge[e]=zge&&Xge?Xge(t):Wge(t)}return Jge[e]},$ge=hpe,eve=Kpe,tve=Age,nve=yge,rve=function(e,t){var n,r;if("string"===t&&wge(n=e.toString)&&!bge(r=mge(n,e)))return r;if(wge(n=e.valueOf)&&!bge(r=mge(n,e)))return r;if("string"!==t&&wge(n=e.toString)&&!bge(r=mge(n,e)))return r;throw Ige("Can't convert object to primitive value")},ive=TypeError,ove=Zge("toPrimitive"),ave=function(e,t){if(!eve(e)||tve(e))return e;var n,r=nve(e,ove);if(r){if(void 0===t&&(t="default"),n=$ge(r,e,t),!eve(n)||tve(n))return n;throw ive("Can't convert object to primitive value")}return void 0===t&&(t="number"),rve(e,t)},sve=Age,uve=function(e){var t=ave(e,"string");return sve(t)?t:t+""},lve=Kpe,Ave=ope.document,cve=lve(Ave)&&lve(Ave.createElement),hve=function(e){return cve?Ave.createElement(e):{}},fve=hve,dve=!upe&&!spe((function(){return 7!=Object.defineProperty(fve("div"),"a",{get:function(){return 7}}).a})),pve=upe,gve=hpe,vve=fpe,yve=mpe,mve=Rpe,wve=uve,bve=Lge,Ive=dve,Bve=Object.getOwnPropertyDescriptor;ape.f=pve?Bve:function(e,t){if(e=mve(e),t=wve(t),Ive)try{return Bve(e,t)}catch(e){}if(bve(e,t))return yve(!gve(vve.f,e,t),e[t])};var Eve={},Cve=upe&&spe((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),xve=Kpe,kve=String,Sve=TypeError,Qve=function(e){if(xve(e))return e;throw Sve(kve(e)+" is not an object")},_ve=upe,Nve=dve,Dve=Cve,Fve=Qve,Pve=uve,Uve=TypeError,Lve=Object.defineProperty,Mve=Object.getOwnPropertyDescriptor,Tve="enumerable",Rve="configurable",Ove="writable";Eve.f=_ve?Dve?function(e,t,n){if(Fve(e),t=Pve(t),Fve(n),"function"==typeof e&&"prototype"===t&&"value"in n&&Ove in n&&!n.writable){var r=Mve(e,t);r&&r.writable&&(e[t]=n.value,n={configurable:Rve in n?n.configurable:r.configurable,enumerable:Tve in n?n.enumerable:r.enumerable,writable:!1})}return Lve(e,t,n)}:Lve:function(e,t,n){if(Fve(e),t=Pve(t),Fve(n),Nve)try{return Lve(e,t,n)}catch(e){}if("get"in n||"set"in n)throw Uve("Accessors not supported");return"value"in n&&(e[t]=n.value),e};var Hve=Eve,Kve=mpe,jve=upe?function(e,t,n){return Hve.f(e,t,Kve(1,n))}:function(e,t,n){return e[t]=n,e},Gve={exports:{}},qve=upe,Vve=Lge,zve=Function.prototype,Jve=qve&&Object.getOwnPropertyDescriptor,Yve=Vve(zve,"name"),Xve={EXISTS:Yve,PROPER:Yve&&"something"===function(){}.name,CONFIGURABLE:Yve&&(!qve||qve&&Jve(zve,"name").configurable)},Wve=Ope,Zve=Qge,$ve=Cpe(Function.toString);Wve(Zve.inspectSource)||(Zve.inspectSource=function(e){return $ve(e)});var eye,tye,nye,rye=Zve.inspectSource,iye=Ope,oye=rye,aye=ope.WeakMap,sye=iye(aye)&&/native code/.test(oye(aye)),uye=Bge.exports,lye=Hge,Aye=uye("keys"),cye=function(e){return Aye[e]||(Aye[e]=lye(e))},hye={},fye=sye,dye=ope,pye=Cpe,gye=Kpe,vye=jve,yye=Lge,mye=Qge,wye=cye,bye=hye,Iye="Object already initialized",Bye=dye.TypeError,Eye=dye.WeakMap;if(fye||mye.state){var Cye=mye.state||(mye.state=new Eye),xye=pye(Cye.get),kye=pye(Cye.has),Sye=pye(Cye.set);eye=function(e,t){if(kye(Cye,e))throw new Bye(Iye);return t.facade=e,Sye(Cye,e,t),t},tye=function(e){return xye(Cye,e)||{}},nye=function(e){return kye(Cye,e)}}else{var Qye=wye("state");bye[Qye]=!0,eye=function(e,t){if(yye(e,Qye))throw new Bye(Iye);return t.facade=e,vye(e,Qye,t),t},tye=function(e){return yye(e,Qye)?e[Qye]:{}},nye=function(e){return yye(e,Qye)}}var _ye={set:eye,get:tye,has:nye,enforce:function(e){return nye(e)?tye(e):eye(e,{})},getterFor:function(e){return function(t){var n;if(!gye(t)||(n=tye(t)).type!==e)throw Bye("Incompatible receiver, "+e+" required");return n}}},Nye=spe,Dye=Ope,Fye=Lge,Pye=upe,Uye=Xve.CONFIGURABLE,Lye=rye,Mye=_ye.enforce,Tye=_ye.get,Rye=Object.defineProperty,Oye=Pye&&!Nye((function(){return 8!==Rye((function(){}),"length",{value:8}).length})),Hye=String(String).split("String"),Kye=Gve.exports=function(e,t,n){"Symbol("===String(t).slice(0,7)&&(t="["+String(t).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),n&&n.getter&&(t="get "+t),n&&n.setter&&(t="set "+t),(!Fye(e,"name")||Uye&&e.name!==t)&&(Pye?Rye(e,"name",{value:t,configurable:!0}):e.name=t),Oye&&n&&Fye(n,"arity")&&e.length!==n.arity&&Rye(e,"length",{value:n.arity});try{n&&Fye(n,"constructor")&&n.constructor?Pye&&Rye(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var r=Mye(e);return Fye(r,"source")||(r.source=Hye.join("string"==typeof t?t:"")),e};Function.prototype.toString=Kye((function(){return Dye(this)&&Tye(this).source||Lye(this)}),"toString");var jye=Ope,Gye=Eve,qye=Gve.exports,Vye=xge,zye=function(e,t,n,r){r||(r={});var i=r.enumerable,o=void 0!==r.name?r.name:t;if(jye(n)&&qye(n,o,r),r.global)i?e[t]=n:Vye(t,n);else{try{r.unsafe?e[t]&&(i=!0):delete e[t]}catch(e){}i?e[t]=n:Gye.f(e,t,{value:n,enumerable:!1,configurable:!r.nonConfigurable,writable:!r.nonWritable})}return e},Jye={},Yye=Math.ceil,Xye=Math.floor,Wye=Math.trunc||function(e){var t=+e;return(t>0?Xye:Yye)(t)},Zye=Wye,$ye=function(e){var t=+e;return t!=t||0===t?0:Zye(t)},eme=$ye,tme=Math.max,nme=Math.min,rme=function(e,t){var n=eme(e);return n<0?tme(n+t,0):nme(n,t)},ime=$ye,ome=Math.min,ame=function(e){return e>0?ome(ime(e),9007199254740991):0},sme=ame,ume=function(e){return sme(e.length)},lme=Rpe,Ame=rme,cme=ume,hme=function(e){return function(t,n,r){var i,o=lme(t),a=cme(o),s=Ame(r,a);if(e&&n!=n){for(;a>s;)if((i=o[s++])!=i)return!0}else for(;a>s;s++)if((e||s in o)&&o[s]===n)return e||s||0;return!e&&-1}},fme={includes:hme(!0),indexOf:hme(!1)},dme=Lge,pme=Rpe,gme=fme.indexOf,vme=hye,yme=Cpe([].push),mme=function(e,t){var n,r=pme(e),i=0,o=[];for(n in r)!dme(vme,n)&&dme(r,n)&&yme(o,n);for(;t.length>i;)dme(r,n=t[i++])&&(~gme(o,n)||yme(o,n));return o},wme=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],bme=mme,Ime=wme.concat("length","prototype");Jye.f=Object.getOwnPropertyNames||function(e){return bme(e,Ime)};var Bme={};Bme.f=Object.getOwnPropertySymbols;var Eme=Vpe,Cme=Jye,xme=Bme,kme=Qve,Sme=Cpe([].concat),Qme=Eme("Reflect","ownKeys")||function(e){var t=Cme.f(kme(e)),n=xme.f;return n?Sme(t,n(e)):t},_me=Lge,Nme=Qme,Dme=ape,Fme=Eve,Pme=spe,Ume=Ope,Lme=/#|\.prototype\./,Mme=function(e,t){var n=Rme[Tme(e)];return n==Hme||n!=Ome&&(Ume(t)?Pme(t):!!t)},Tme=Mme.normalize=function(e){return String(e).replace(Lme,".").toLowerCase()},Rme=Mme.data={},Ome=Mme.NATIVE="N",Hme=Mme.POLYFILL="P",Kme=Mme,jme=ope,Gme=ape.f,qme=jve,Vme=zye,zme=xge,Jme=function(e,t,n){for(var r=Nme(t),i=Fme.f,o=Dme.f,a=0;a<r.length;a++){var s=r[a];_me(e,s)||n&&_me(n,s)||i(e,s,o(t,s))}},Yme=Kme,Xme=function(e,t){var n,r,o,a,s,u=e.target,l=e.global,A=e.stat;if(n=l?jme:A?jme[u]||zme(u,{}):(jme[u]||{}).prototype)for(r in t){if(a=t[r],o=e.dontCallGetSet?(s=Gme(n,r))&&s.value:n[r],!Yme(l?r:u+(A?".":"#")+r,e.forced)&&void 0!==o){if(i(a)==i(o))continue;Jme(a,o)}(e.sham||o&&o.sham)&&qme(a,"sham",!0),Vme(n,r,a,e)}},Wme="process"==Qpe(ope.process),Zme=Ope,$me=String,ewe=TypeError,twe=Cpe,nwe=Qve,rwe=function(e){if("object"==i(e)||Zme(e))return e;throw ewe("Can't set "+$me(e)+" as a prototype")},iwe=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,n={};try{(e=twe(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(n,[]),t=n instanceof Array}catch(e){}return function(n,r){return nwe(n),rwe(r),t?e(n,r):n.__proto__=r,n}}():void 0),owe=Eve.f,awe=Lge,swe=Zge("toStringTag"),uwe=function(e,t,n){e&&!n&&(e=e.prototype),e&&!awe(e,swe)&&owe(e,swe,{configurable:!0,value:t})},lwe=Vpe,Awe=Eve,cwe=upe,hwe=Zge("species"),fwe=zpe,dwe=TypeError,pwe={};pwe[Zge("toStringTag")]="z";var gwe="[object z]"===String(pwe),vwe=Ope,ywe=Qpe,mwe=Zge("toStringTag"),wwe=Object,bwe="Arguments"==ywe(function(){return arguments}()),Iwe=gwe?ywe:function(e){var t,n,r;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=wwe(e),mwe))?n:bwe?ywe(t):"Object"==(r=ywe(t))&&vwe(t.callee)?"Arguments":r},Bwe=Cpe,Ewe=spe,Cwe=Ope,xwe=Iwe,kwe=rye,Swe=function(){},Qwe=[],_we=Vpe("Reflect","construct"),Nwe=/^\s*(?:class|function)\b/,Dwe=Bwe(Nwe.exec),Fwe=!Nwe.exec(Swe),Pwe=function(e){if(!Cwe(e))return!1;try{return _we(Swe,Qwe,e),!0}catch(e){return!1}},Uwe=function(e){if(!Cwe(e))return!1;switch(xwe(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return Fwe||!!Dwe(Nwe,kwe(e))}catch(e){return!0}};Uwe.sham=!0;var Lwe,Mwe,Twe,Rwe,Owe=!_we||Ewe((function(){var e;return Pwe(Pwe.call)||!Pwe(Object)||!Pwe((function(){e=!0}))||e}))?Uwe:Pwe,Hwe=Owe,Kwe=hge,jwe=TypeError,Gwe=Qve,qwe=function(e){if(Hwe(e))return e;throw jwe(Kwe(e)+" is not a constructor")},Vwe=Zge("species"),zwe=function(e,t){var n,r=Gwe(e).constructor;return void 0===r||null==(n=Gwe(r)[Vwe])?t:qwe(n)},Jwe=lpe,Ywe=Function.prototype,Xwe=Ywe.apply,Wwe=Ywe.call,Zwe="object"==("undefined"==typeof Reflect?"undefined":i(Reflect))&&Reflect.apply||(Jwe?Wwe.bind(Xwe):function(){return Wwe.apply(Xwe,arguments)}),$we=gge,ebe=lpe,tbe=Cpe(Cpe.bind),nbe=function(e,t){return $we(e),void 0===t?e:ebe?tbe(e,t):function(){return e.apply(t,arguments)}},rbe=Vpe("document","documentElement"),ibe=Cpe([].slice),obe=TypeError,abe=/(?:ipad|iphone|ipod).*applewebkit/i.test(Jpe),sbe=ope,ube=Zwe,lbe=nbe,Abe=Ope,cbe=Lge,hbe=spe,fbe=rbe,dbe=ibe,pbe=hve,gbe=function(e,t){if(e<t)throw obe("Not enough arguments");return e},vbe=abe,ybe=Wme,mbe=sbe.setImmediate,wbe=sbe.clearImmediate,bbe=sbe.process,Ibe=sbe.Dispatch,Bbe=sbe.Function,Ebe=sbe.MessageChannel,Cbe=sbe.String,xbe=0,kbe={},Sbe="onreadystatechange";try{Lwe=sbe.location}catch(e){}var Qbe=function(e){if(cbe(kbe,e)){var t=kbe[e];delete kbe[e],t()}},_be=function(e){return function(){Qbe(e)}},Nbe=function(e){Qbe(e.data)},Dbe=function(e){sbe.postMessage(Cbe(e),Lwe.protocol+"//"+Lwe.host)};mbe&&wbe||(mbe=function(e){gbe(arguments.length,1);var t=Abe(e)?e:Bbe(e),n=dbe(arguments,1);return kbe[++xbe]=function(){ube(t,void 0,n)},Mwe(xbe),xbe},wbe=function(e){delete kbe[e]},ybe?Mwe=function(e){bbe.nextTick(_be(e))}:Ibe&&Ibe.now?Mwe=function(e){Ibe.now(_be(e))}:Ebe&&!vbe?(Rwe=(Twe=new Ebe).port2,Twe.port1.onmessage=Nbe,Mwe=lbe(Rwe.postMessage,Rwe)):sbe.addEventListener&&Abe(sbe.postMessage)&&!sbe.importScripts&&Lwe&&"file:"!==Lwe.protocol&&!hbe(Dbe)?(Mwe=Dbe,sbe.addEventListener("message",Nbe,!1)):Mwe=Sbe in pbe("script")?function(e){fbe.appendChild(pbe("script")).onreadystatechange=function(){fbe.removeChild(this),Qbe(e)}}:function(e){setTimeout(_be(e),0)});var Fbe,Pbe,Ube,Lbe,Mbe,Tbe,Rbe,Obe,Hbe={set:mbe,clear:wbe},Kbe=ope,jbe=/ipad|iphone|ipod/i.test(Jpe)&&void 0!==Kbe.Pebble,Gbe=/web0s(?!.*chrome)/i.test(Jpe),qbe=ope,Vbe=nbe,zbe=ape.f,Jbe=Hbe.set,Ybe=abe,Xbe=jbe,Wbe=Gbe,Zbe=Wme,$be=qbe.MutationObserver||qbe.WebKitMutationObserver,eIe=qbe.document,tIe=qbe.process,nIe=qbe.Promise,rIe=zbe(qbe,"queueMicrotask"),iIe=rIe&&rIe.value;iIe||(Fbe=function(){var e,t;for(Zbe&&(e=tIe.domain)&&e.exit();Pbe;){t=Pbe.fn,Pbe=Pbe.next;try{t()}catch(e){throw Pbe?Lbe():Ube=void 0,e}}Ube=void 0,e&&e.enter()},Ybe||Zbe||Wbe||!$be||!eIe?!Xbe&&nIe&&nIe.resolve?((Rbe=nIe.resolve(void 0)).constructor=nIe,Obe=Vbe(Rbe.then,Rbe),Lbe=function(){Obe(Fbe)}):Zbe?Lbe=function(){tIe.nextTick(Fbe)}:(Jbe=Vbe(Jbe,qbe),Lbe=function(){Jbe(Fbe)}):(Mbe=!0,Tbe=eIe.createTextNode(""),new $be(Fbe).observe(Tbe,{characterData:!0}),Lbe=function(){Tbe.data=Mbe=!Mbe}));var oIe=iIe||function(e){var t={fn:e,next:void 0};Ube&&(Ube.next=t),Pbe||(Pbe=t,Lbe()),Ube=t},aIe=ope,sIe=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}},uIe=function(){this.head=null,this.tail=null};uIe.prototype={add:function(e){var t={item:e,next:null};this.head?this.tail.next=t:this.head=t,this.tail=t},get:function(){var e=this.head;if(e)return this.head=e.next,this.tail===e&&(this.tail=null),e.item}};var lIe=uIe,AIe=ope.Promise,cIe="object"==("undefined"==typeof Deno?"undefined":i(Deno))&&Deno&&"object"==i(Deno.version),hIe=!cIe&&!Wme&&"object"==("undefined"==typeof window?"undefined":i(window))&&"object"==("undefined"==typeof document?"undefined":i(document)),fIe=ope,dIe=AIe,pIe=Ope,gIe=Kme,vIe=rye,yIe=Zge,mIe=hIe,wIe=cIe,bIe=tge;dIe&&dIe.prototype;var IIe=yIe("species"),BIe=!1,EIe=pIe(fIe.PromiseRejectionEvent),CIe=gIe("Promise",(function(){var e=vIe(dIe),t=e!==String(dIe);if(!t&&66===bIe)return!0;if(!bIe||bIe<51||!/native code/.test(e)){var n=new dIe((function(e){e(1)})),r=function(e){e((function(){}),(function(){}))};if((n.constructor={})[IIe]=r,!(BIe=n.then((function(){}))instanceof r))return!0}return!t&&(mIe||wIe)&&!EIe})),xIe={CONSTRUCTOR:CIe,REJECTION_EVENT:EIe,SUBCLASSING:BIe},kIe={},SIe=gge,QIe=function(e){var t,n;this.promise=new e((function(e,r){if(void 0!==t||void 0!==n)throw TypeError("Bad Promise constructor");t=e,n=r})),this.resolve=SIe(t),this.reject=SIe(n)};kIe.f=function(e){return new QIe(e)};var _Ie,NIe,DIe,FIe=Xme,PIe=Wme,UIe=ope,LIe=hpe,MIe=zye,TIe=iwe,RIe=uwe,OIe=function(e){var t=lwe(e),n=Awe.f;cwe&&t&&!t[hwe]&&n(t,hwe,{configurable:!0,get:function(){return this}})},HIe=gge,KIe=Ope,jIe=Kpe,GIe=function(e,t){if(fwe(t,e))return e;throw dwe("Incorrect invocation")},qIe=zwe,VIe=Hbe.set,zIe=oIe,JIe=function(e,t){var n=aIe.console;n&&n.error&&(1==arguments.length?n.error(e):n.error(e,t))},YIe=sIe,XIe=lIe,WIe=_ye,ZIe=AIe,$Ie=kIe,eBe="Promise",tBe=xIe.CONSTRUCTOR,nBe=xIe.REJECTION_EVENT,rBe=xIe.SUBCLASSING,iBe=WIe.getterFor(eBe),oBe=WIe.set,aBe=ZIe&&ZIe.prototype,sBe=ZIe,uBe=aBe,lBe=UIe.TypeError,ABe=UIe.document,cBe=UIe.process,hBe=$Ie.f,fBe=hBe,dBe=!!(ABe&&ABe.createEvent&&UIe.dispatchEvent),pBe="unhandledrejection",gBe=function(e){var t;return!(!jIe(e)||!KIe(t=e.then))&&t},vBe=function(e,t){var n,r,i,o=t.value,a=1==t.state,s=a?e.ok:e.fail,u=e.resolve,l=e.reject,A=e.domain;try{s?(a||(2===t.rejection&&IBe(t),t.rejection=1),!0===s?n=o:(A&&A.enter(),n=s(o),A&&(A.exit(),i=!0)),n===e.promise?l(lBe("Promise-chain cycle")):(r=gBe(n))?LIe(r,n,u,l):u(n)):l(o)}catch(e){A&&!i&&A.exit(),l(e)}},yBe=function(e,t){e.notified||(e.notified=!0,zIe((function(){for(var n,r=e.reactions;n=r.get();)vBe(n,e);e.notified=!1,t&&!e.rejection&&wBe(e)})))},mBe=function(e,t,n){var r,i;dBe?((r=ABe.createEvent("Event")).promise=t,r.reason=n,r.initEvent(e,!1,!0),UIe.dispatchEvent(r)):r={promise:t,reason:n},!nBe&&(i=UIe["on"+e])?i(r):e===pBe&&JIe("Unhandled promise rejection",n)},wBe=function(e){LIe(VIe,UIe,(function(){var t,n=e.facade,r=e.value;if(bBe(e)&&(t=YIe((function(){PIe?cBe.emit("unhandledRejection",r,n):mBe(pBe,n,r)})),e.rejection=PIe||bBe(e)?2:1,t.error))throw t.value}))},bBe=function(e){return 1!==e.rejection&&!e.parent},IBe=function(e){LIe(VIe,UIe,(function(){var t=e.facade;PIe?cBe.emit("rejectionHandled",t):mBe("rejectionhandled",t,e.value)}))},BBe=function(e,t,n){return function(r){e(t,r,n)}},EBe=function(e,t,n){e.done||(e.done=!0,n&&(e=n),e.value=t,e.state=2,yBe(e,!0))},CBe=function e(t,n,r){if(!t.done){t.done=!0,r&&(t=r);try{if(t.facade===n)throw lBe("Promise can't be resolved itself");var i=gBe(n);i?zIe((function(){var r={done:!1};try{LIe(i,n,BBe(e,r,t),BBe(EBe,r,t))}catch(e){EBe(r,e,t)}})):(t.value=n,t.state=1,yBe(t,!1))}catch(e){EBe({done:!1},e,t)}}};if(tBe&&(uBe=(sBe=function(e){GIe(this,uBe),HIe(e),LIe(_Ie,this);var t=iBe(this);try{e(BBe(CBe,t),BBe(EBe,t))}catch(e){EBe(t,e)}}).prototype,(_Ie=function(e){oBe(this,{type:eBe,done:!1,notified:!1,parent:!1,reactions:new XIe,rejection:!1,state:0,value:void 0})}).prototype=MIe(uBe,"then",(function(e,t){var n=iBe(this),r=hBe(qIe(this,sBe));return n.parent=!0,r.ok=!KIe(e)||e,r.fail=KIe(t)&&t,r.domain=PIe?cBe.domain:void 0,0==n.state?n.reactions.add(r):zIe((function(){vBe(r,n)})),r.promise})),NIe=function(){var e=new _Ie,t=iBe(e);this.promise=e,this.resolve=BBe(CBe,t),this.reject=BBe(EBe,t)},$Ie.f=hBe=function(e){return e===sBe||undefined===e?new NIe(e):fBe(e)},KIe(ZIe)&&aBe!==Object.prototype)){DIe=aBe.then,rBe||MIe(aBe,"then",(function(e,t){var n=this;return new sBe((function(e,t){LIe(DIe,n,e,t)})).then(e,t)}),{unsafe:!0});try{delete aBe.constructor}catch(e){}TIe&&TIe(aBe,uBe)}FIe({global:!0,constructor:!0,wrap:!0,forced:tBe},{Promise:sBe}),RIe(sBe,eBe,!1),OIe(eBe);var xBe={},kBe=xBe,SBe=Zge("iterator"),QBe=Array.prototype,_Be=Iwe,NBe=yge,DBe=xBe,FBe=Zge("iterator"),PBe=function(e){if(null!=e)return NBe(e,FBe)||NBe(e,"@@iterator")||DBe[_Be(e)]},UBe=hpe,LBe=gge,MBe=Qve,TBe=hge,RBe=PBe,OBe=TypeError,HBe=hpe,KBe=Qve,jBe=yge,GBe=nbe,qBe=hpe,VBe=Qve,zBe=hge,JBe=function(e){return void 0!==e&&(kBe.Array===e||QBe[SBe]===e)},YBe=ume,XBe=zpe,WBe=function(e,t){var n=arguments.length<2?RBe(e):t;if(LBe(n))return MBe(UBe(n,e));throw OBe(TBe(e)+" is not iterable")},ZBe=PBe,$Be=function(e,t,n){var r,i;KBe(e);try{if(!(r=jBe(e,"return"))){if("throw"===t)throw n;return n}r=HBe(r,e)}catch(e){i=!0,r=e}if("throw"===t)throw n;if(i)throw r;return KBe(r),n},eEe=TypeError,tEe=function(e,t){this.stopped=e,this.result=t},nEe=tEe.prototype,rEe=function(e,t,n){var r,o,a,s,u,l,A,c=n&&n.that,h=!(!n||!n.AS_ENTRIES),f=!(!n||!n.IS_RECORD),d=!(!n||!n.IS_ITERATOR),p=!(!n||!n.INTERRUPTED),g=GBe(t,c),v=function(e){return r&&$Be(r,"normal",e),new tEe(!0,e)},y=function(e){return h?(VBe(e),p?g(e[0],e[1],v):g(e[0],e[1])):p?g(e,v):g(e)};if(f)r=e.iterator;else if(d)r=e;else{if(!(o=ZBe(e)))throw eEe(zBe(e)+" is not iterable");if(JBe(o)){for(a=0,s=YBe(e);s>a;a++)if((u=y(e[a]))&&XBe(nEe,u))return u;return new tEe(!1)}r=WBe(e,o)}for(l=f?e.next:r.next;!(A=qBe(l,r)).done;){try{u=y(A.value)}catch(e){$Be(r,"throw",e)}if("object"==i(u)&&u&&XBe(nEe,u))return u}return new tEe(!1)},iEe=Zge("iterator"),oEe=!1;try{var aEe=0,sEe={next:function(){return{done:!!aEe++}},return:function(){oEe=!0}};sEe[iEe]=function(){return this},Array.from(sEe,(function(){throw 2}))}catch(e){}var uEe=AIe,lEe=function(e,t){if(!t&&!oEe)return!1;var n=!1;try{var r={};r[iEe]=function(){return{next:function(){return{done:n=!0}}}},e(r)}catch(e){}return n},AEe=xIe.CONSTRUCTOR||!lEe((function(e){uEe.all(e).then(void 0,(function(){}))})),cEe=hpe,hEe=gge,fEe=kIe,dEe=sIe,pEe=rEe;Xme({target:"Promise",stat:!0,forced:AEe},{all:function(e){var t=this,n=fEe.f(t),r=n.resolve,i=n.reject,o=dEe((function(){var n=hEe(t.resolve),o=[],a=0,s=1;pEe(e,(function(e){var u=a++,l=!1;s++,cEe(n,t,e).then((function(e){l||(l=!0,o[u]=e,--s||r(o))}),i)})),--s||r(o)}));return o.error&&i(o.value),n.promise}});var gEe=Xme,vEe=xIe.CONSTRUCTOR,yEe=AIe,mEe=Vpe,wEe=Ope,bEe=zye,IEe=yEe&&yEe.prototype;if(gEe({target:"Promise",proto:!0,forced:vEe,real:!0},{catch:function(e){return this.then(void 0,e)}}),wEe(yEe)){var BEe=mEe("Promise").prototype.catch;IEe.catch!==BEe&&bEe(IEe,"catch",BEe,{unsafe:!0})}var EEe=hpe,CEe=gge,xEe=kIe,kEe=sIe,SEe=rEe;Xme({target:"Promise",stat:!0,forced:AEe},{race:function(e){var t=this,n=xEe.f(t),r=n.reject,i=kEe((function(){var i=CEe(t.resolve);SEe(e,(function(e){EEe(i,t,e).then(n.resolve,r)}))}));return i.error&&r(i.value),n.promise}});var QEe=hpe,_Ee=kIe;Xme({target:"Promise",stat:!0,forced:xIe.CONSTRUCTOR},{reject:function(e){var t=_Ee.f(this);return QEe(t.reject,void 0,e),t.promise}});var NEe=Qve,DEe=Kpe,FEe=kIe,PEe=Xme,UEe=xIe.CONSTRUCTOR,LEe=function(e,t){if(NEe(e),DEe(t)&&t.constructor===e)return t;var n=FEe.f(e);return(0,n.resolve)(t),n.promise};Vpe("Promise"),PEe({target:"Promise",stat:!0,forced:UEe},{resolve:function(e){return LEe(this,e)}});var MEe={exports:{}};!function(e){function t(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}e.exports=function(e){return function(){var n=this,r=arguments;return new Promise((function(i,o){var a=e.apply(n,r);function s(e){t(a,i,o,s,u,"next",e)}function u(e){t(a,i,o,s,u,"throw",e)}s(void 0)}))}},e.exports.__esModule=!0,e.exports.default=e.exports}(MEe);var TEe=Rt(MEe.exports),REe=Iwe,OEe=String,HEe=function(e){if("Symbol"===REe(e))throw TypeError("Cannot convert a Symbol value to a string");return OEe(e)},KEe=Qve,jEe=function(){var e=KEe(this),t="";return e.hasIndices&&(t+="d"),e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.unicodeSets&&(t+="v"),e.sticky&&(t+="y"),t},GEe=spe,qEe=ope.RegExp,VEe=GEe((function(){var e=qEe("a","y");return e.lastIndex=2,null!=e.exec("abcd")})),zEe=VEe||GEe((function(){return!qEe("a","y").sticky})),JEe=VEe||GEe((function(){var e=qEe("^r","gy");return e.lastIndex=2,null!=e.exec("str")})),YEe={BROKEN_CARET:JEe,MISSED_STICKY:zEe,UNSUPPORTED_Y:VEe},XEe={},WEe=mme,ZEe=wme,$Ee=Object.keys||function(e){return WEe(e,ZEe)},eCe=upe,tCe=Cve,nCe=Eve,rCe=Qve,iCe=Rpe,oCe=$Ee;XEe.f=eCe&&!tCe?Object.defineProperties:function(e,t){rCe(e);for(var n,r=iCe(t),i=oCe(t),o=i.length,a=0;o>a;)nCe.f(e,n=i[a++],r[n]);return e};var aCe,sCe=Qve,uCe=XEe,lCe=wme,ACe=hye,cCe=rbe,hCe=hve,fCe=cye("IE_PROTO"),dCe=function(){},pCe=function(e){return"<script>"+e+"</"+"script>"},gCe=function(e){e.write(pCe("")),e.close();var t=e.parentWindow.Object;return e=null,t},vCe=function(){try{aCe=new ActiveXObject("htmlfile")}catch(e){}var e,t;vCe="undefined"!=typeof document?document.domain&&aCe?gCe(aCe):((t=hCe("iframe")).style.display="none",cCe.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(pCe("document.F=Object")),e.close(),e.F):gCe(aCe);for(var n=lCe.length;n--;)delete vCe.prototype[lCe[n]];return vCe()};ACe[fCe]=!0;var yCe,mCe,wCe=Object.create||function(e,t){var n;return null!==e?(dCe.prototype=sCe(e),n=new dCe,dCe.prototype=null,n[fCe]=e):n=vCe(),void 0===t?n:uCe.f(n,t)},bCe=spe,ICe=ope.RegExp,BCe=bCe((function(){var e=ICe(".","s");return!(e.dotAll&&e.exec("\n")&&"s"===e.flags)})),ECe=spe,CCe=ope.RegExp,xCe=ECe((function(){var e=CCe("(?<a>b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$<a>c")})),kCe=hpe,SCe=Cpe,QCe=HEe,_Ce=jEe,NCe=YEe,DCe=Bge.exports,FCe=wCe,PCe=_ye.get,UCe=BCe,LCe=xCe,MCe=DCe("native-string-replace",String.prototype.replace),TCe=RegExp.prototype.exec,RCe=TCe,OCe=SCe("".charAt),HCe=SCe("".indexOf),KCe=SCe("".replace),jCe=SCe("".slice),GCe=(mCe=/b*/g,kCe(TCe,yCe=/a/,"a"),kCe(TCe,mCe,"a"),0!==yCe.lastIndex||0!==mCe.lastIndex),qCe=NCe.BROKEN_CARET,VCe=void 0!==/()??/.exec("")[1];(GCe||VCe||qCe||UCe||LCe)&&(RCe=function(e){var t,n,r,i,o,a,s,u=this,l=PCe(u),A=QCe(e),c=l.raw;if(c)return c.lastIndex=u.lastIndex,t=kCe(RCe,c,A),u.lastIndex=c.lastIndex,t;var h=l.groups,f=qCe&&u.sticky,d=kCe(_Ce,u),p=u.source,g=0,v=A;if(f&&(d=KCe(d,"y",""),-1===HCe(d,"g")&&(d+="g"),v=jCe(A,u.lastIndex),u.lastIndex>0&&(!u.multiline||u.multiline&&"\n"!==OCe(A,u.lastIndex-1))&&(p="(?: "+p+")",v=" "+v,g++),n=new RegExp("^(?:"+p+")",d)),VCe&&(n=new RegExp("^"+p+"$(?!\\s)",d)),GCe&&(r=u.lastIndex),i=kCe(TCe,f?n:u,v),f?i?(i.input=jCe(i.input,g),i[0]=jCe(i[0],g),i.index=u.lastIndex,u.lastIndex+=i[0].length):u.lastIndex=0:GCe&&i&&(u.lastIndex=u.global?i.index+i[0].length:r),VCe&&i&&i.length>1&&kCe(MCe,i[0],n,(function(){for(o=1;o<arguments.length-2;o++)void 0===arguments[o]&&(i[o]=void 0)})),i&&h)for(i.groups=a=FCe(null),o=0;o<h.length;o++)a[(s=h[o])[0]]=i[s[1]];return i});var zCe=RCe;Xme({target:"RegExp",proto:!0,forced:/./.exec!==zCe},{exec:zCe});var JCe=Cpe,YCe=zye,XCe=zCe,WCe=spe,ZCe=Zge,$Ce=jve,exe=ZCe("species"),txe=RegExp.prototype,nxe=function(e,t,n,r){var i=ZCe(e),o=!WCe((function(){var t={};return t[i]=function(){return 7},7!=""[e](t)})),a=o&&!WCe((function(){var t=!1,n=/a/;return"split"===e&&((n={}).constructor={},n.constructor[exe]=function(){return n},n.flags="",n[i]=/./[i]),n.exec=function(){return t=!0,null},n[i](""),!t}));if(!o||!a||n){var s=JCe(/./[i]),u=t(i,""[e],(function(e,t,n,r,i){var a=JCe(e),u=t.exec;return u===XCe||u===txe.exec?o&&!i?{done:!0,value:s(t,n,r)}:{done:!0,value:a(n,t,r)}:{done:!1}}));YCe(String.prototype,e,u[0]),YCe(txe,i,u[1])}r&&$Ce(txe[i],"sham",!0)},rxe=Cpe,ixe=$ye,oxe=HEe,axe=Lpe,sxe=rxe("".charAt),uxe=rxe("".charCodeAt),lxe=rxe("".slice),Axe=function(e){return function(t,n){var r,i,o=oxe(axe(t)),a=ixe(n),s=o.length;return a<0||a>=s?e?"":void 0:(r=uxe(o,a))<55296||r>56319||a+1===s||(i=uxe(o,a+1))<56320||i>57343?e?sxe(o,a):r:e?lxe(o,a,a+2):i-56320+(r-55296<<10)+65536}},cxe={codeAt:Axe(!1),charAt:Axe(!0)}.charAt,hxe=function(e,t,n){return t+(n?cxe(e,t).length:1)},fxe=hpe,dxe=Qve,pxe=Ope,gxe=Qpe,vxe=zCe,yxe=TypeError,mxe=function(e,t){var n=e.exec;if(pxe(n)){var r=fxe(n,e,t);return null!==r&&dxe(r),r}if("RegExp"===gxe(e))return fxe(vxe,e,t);throw yxe("RegExp#exec called on incompatible receiver")},wxe=hpe,bxe=Qve,Ixe=ame,Bxe=HEe,Exe=Lpe,Cxe=yge,xxe=hxe,kxe=mxe;nxe("match",(function(e,t,n){return[function(t){var n=Exe(this),r=null==t?void 0:Cxe(t,e);return r?wxe(r,t,n):new RegExp(t)[e](Bxe(n))},function(e){var r=bxe(this),i=Bxe(e),o=n(t,r,i);if(o.done)return o.value;if(!r.global)return kxe(r,i);var a=r.unicode;r.lastIndex=0;for(var s,u=[],l=0;null!==(s=kxe(r,i));){var A=Bxe(s[0]);u[l]=A,""===A&&(r.lastIndex=xxe(i,Ixe(r.lastIndex),a)),l++}return 0===l?null:u}]}));var Sxe=Cpe,Qxe=Fge,_xe=Math.floor,Nxe=Sxe("".charAt),Dxe=Sxe("".replace),Fxe=Sxe("".slice),Pxe=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,Uxe=/\$([$&'`]|\d{1,2})/g,Lxe=Zwe,Mxe=hpe,Txe=Cpe,Rxe=nxe,Oxe=spe,Hxe=Qve,Kxe=Ope,jxe=$ye,Gxe=ame,qxe=HEe,Vxe=Lpe,zxe=hxe,Jxe=yge,Yxe=function(e,t,n,r,i,o){var a=n+e.length,s=r.length,u=Uxe;return void 0!==i&&(i=Qxe(i),u=Pxe),Dxe(o,u,(function(o,u){var l;switch(Nxe(u,0)){case"$":return"$";case"&":return e;case"`":return Fxe(t,0,n);case"'":return Fxe(t,a);case"<":l=i[Fxe(u,1,-1)];break;default:var A=+u;if(0===A)return o;if(A>s){var c=_xe(A/10);return 0===c?o:c<=s?void 0===r[c-1]?Nxe(u,1):r[c-1]+Nxe(u,1):o}l=r[A-1]}return void 0===l?"":l}))},Xxe=mxe,Wxe=Zge("replace"),Zxe=Math.max,$xe=Math.min,eke=Txe([].concat),tke=Txe([].push),nke=Txe("".indexOf),rke=Txe("".slice),ike=function(e){return void 0===e?e:String(e)},oke="$0"==="a".replace(/./,"$0"),ake=!!/./[Wxe]&&""===/./[Wxe]("a","$0"),ske=!Oxe((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")}));Rxe("replace",(function(e,t,n){var r=ake?"$":"$0";return[function(e,n){var r=Vxe(this),i=null==e?void 0:Jxe(e,Wxe);return i?Mxe(i,e,r,n):Mxe(t,qxe(r),e,n)},function(e,i){var o=Hxe(this),a=qxe(e);if("string"==typeof i&&-1===nke(i,r)&&-1===nke(i,"$<")){var s=n(t,o,a,i);if(s.done)return s.value}var u=Kxe(i);u||(i=qxe(i));var l=o.global;if(l){var A=o.unicode;o.lastIndex=0}for(var c=[];;){var h=Xxe(o,a);if(null===h)break;if(tke(c,h),!l)break;""===qxe(h[0])&&(o.lastIndex=zxe(a,Gxe(o.lastIndex),A))}for(var f="",d=0,p=0;p<c.length;p++){for(var g=qxe((h=c[p])[0]),v=Zxe($xe(jxe(h.index),a.length),0),y=[],m=1;m<h.length;m++)tke(y,ike(h[m]));var w=h.groups;if(u){var b=eke([g],y,v,a);void 0!==w&&tke(b,w);var I=qxe(Lxe(i,void 0,b))}else I=Yxe(g,a,v,y,w,i);v>=d&&(f+=rke(a,d,v)+I,d=v+g.length)}return f+rke(a,d)}]}),!ske||!oke||ake);var uke,lke=Kpe,Ake=Qpe,cke=Zge("match"),hke=function(e){var t;return lke(e)&&(void 0!==(t=e[cke])?!!t:"RegExp"==Ake(e))},fke=hke,dke=TypeError,pke=function(e){if(fke(e))throw dke("The method doesn't accept regular expressions");return e},gke=Zge("match"),vke=function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[gke]=!1,"/./"[e](t)}catch(e){}}return!1},yke=Xme,mke=Cpe,wke=ape.f,bke=ame,Ike=HEe,Bke=pke,Eke=Lpe,Cke=vke,xke=mke("".startsWith),kke=mke("".slice),Ske=Math.min,Qke=Cke("startsWith");yke({target:"String",proto:!0,forced:!!(Qke||(uke=wke(String.prototype,"startsWith"),!uke||uke.writable))&&!Qke},{startsWith:function(e){var t=Ike(Eke(this));Bke(e);var n=bke(Ske(arguments.length>1?arguments[1]:void 0,t.length)),r=Ike(e);return xke?xke(t,r,n):kke(t,n,n+r.length)===r}});var _ke=Zge,Nke=wCe,Dke=Eve.f,Fke=_ke("unscopables"),Pke=Array.prototype;null==Pke[Fke]&&Dke(Pke,Fke,{configurable:!0,value:Nke(null)});var Uke,Lke,Mke,Tke=!spe((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),Rke=Lge,Oke=Ope,Hke=Fge,Kke=Tke,jke=cye("IE_PROTO"),Gke=Object,qke=Gke.prototype,Vke=Kke?Gke.getPrototypeOf:function(e){var t=Hke(e);if(Rke(t,jke))return t[jke];var n=t.constructor;return Oke(n)&&t instanceof n?n.prototype:t instanceof Gke?qke:null},zke=spe,Jke=Ope,Yke=Vke,Xke=zye,Wke=Zge("iterator"),Zke=!1;[].keys&&("next"in(Mke=[].keys())?(Lke=Yke(Yke(Mke)))!==Object.prototype&&(Uke=Lke):Zke=!0);var $ke=null==Uke||zke((function(){var e={};return Uke[Wke].call(e)!==e}));$ke&&(Uke={}),Jke(Uke[Wke])||Xke(Uke,Wke,(function(){return this}));var eSe={IteratorPrototype:Uke,BUGGY_SAFARI_ITERATORS:Zke},tSe=eSe.IteratorPrototype,nSe=wCe,rSe=mpe,iSe=uwe,oSe=xBe,aSe=function(){return this},sSe=Xme,uSe=hpe,lSe=Ope,ASe=function(e,t,n,r){var i=t+" Iterator";return e.prototype=nSe(tSe,{next:rSe(+!r,n)}),iSe(e,i,!1),oSe[i]=aSe,e},cSe=Vke,hSe=iwe,fSe=uwe,dSe=jve,pSe=zye,gSe=xBe,vSe=Xve.PROPER,ySe=Xve.CONFIGURABLE,mSe=eSe.IteratorPrototype,wSe=eSe.BUGGY_SAFARI_ITERATORS,bSe=Zge("iterator"),ISe="keys",BSe="values",ESe="entries",CSe=function(){return this},xSe=Rpe,kSe=function(e){Pke[Fke][e]=!0},SSe=xBe,QSe=_ye,_Se=Eve.f,NSe=function(e,t,n,r,i,o,a){ASe(n,t,r);var s,u,l,A=function(e){if(e===i&&p)return p;if(!wSe&&e in f)return f[e];switch(e){case ISe:case BSe:case ESe:return function(){return new n(this,e)}}return function(){return new n(this)}},c=t+" Iterator",h=!1,f=e.prototype,d=f[bSe]||f["@@iterator"]||i&&f[i],p=!wSe&&d||A(i),g="Array"==t&&f.entries||d;if(g&&(s=cSe(g.call(new e)))!==Object.prototype&&s.next&&(cSe(s)!==mSe&&(hSe?hSe(s,mSe):lSe(s[bSe])||pSe(s,bSe,CSe)),fSe(s,c,!0)),vSe&&i==BSe&&d&&d.name!==BSe&&(ySe?dSe(f,"name",BSe):(h=!0,p=function(){return uSe(d,this)})),i)if(u={values:A(BSe),keys:o?p:A(ISe),entries:A(ESe)},a)for(l in u)(wSe||h||!(l in f))&&pSe(f,l,u[l]);else sSe({target:t,proto:!0,forced:wSe||h},u);return f[bSe]!==p&&pSe(f,bSe,p,{name:i}),gSe[t]=p,u},DSe=upe,FSe="Array Iterator",PSe=QSe.set,USe=QSe.getterFor(FSe),LSe=NSe(Array,"Array",(function(e,t){PSe(this,{type:FSe,target:xSe(e),index:0,kind:t})}),(function(){var e=USe(this),t=e.target,n=e.kind,r=e.index++;return!t||r>=t.length?(e.target=void 0,{value:void 0,done:!0}):"keys"==n?{value:r,done:!1}:"values"==n?{value:t[r],done:!1}:{value:[r,t[r]],done:!1}}),"values"),MSe=SSe.Arguments=SSe.Array;if(kSe("keys"),kSe("values"),kSe("entries"),DSe&&"values"!==MSe.name)try{_Se(MSe,"name",{value:"values"})}catch(e){}var TSe=hve("span").classList,RSe=TSe&&TSe.constructor&&TSe.constructor.prototype,OSe=RSe===Object.prototype?void 0:RSe,HSe=ope,KSe={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},jSe=OSe,GSe=LSe,qSe=jve,VSe=Zge,zSe=VSe("iterator"),JSe=VSe("toStringTag"),YSe=GSe.values,XSe=function(e,t){if(e){if(e[zSe]!==YSe)try{qSe(e,zSe,YSe)}catch(t){e[zSe]=YSe}if(e[JSe]||qSe(e,JSe,t),KSe[t])for(var n in GSe)if(e[n]!==GSe[n])try{qSe(e,n,GSe[n])}catch(t){e[n]=GSe[n]}}};for(var WSe in KSe)XSe(HSe[WSe]&&HSe[WSe].prototype,WSe);XSe(jSe,"DOMTokenList");var ZSe={exports:{}};!function(e){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},e.exports.__esModule=!0,e.exports.default=e.exports}(ZSe);var $Se=Rt(ZSe.exports),eQe=gge,tQe=Fge,nQe=Ppe,rQe=ume,iQe=TypeError,oQe=function(e){return function(t,n,r,i){eQe(n);var o=tQe(t),a=nQe(o),s=rQe(o),u=e?s-1:0,l=e?-1:1;if(r<2)for(;;){if(u in a){i=a[u],u+=l;break}if(u+=l,e?u<0:s<=u)throw iQe("Reduce of empty array with no initial value")}for(;e?u>=0:s>u;u+=l)u in a&&(i=n(i,a[u],u,o));return i}},aQe={left:oQe(!1),right:oQe(!0)},sQe=spe,uQe=function(e,t){var n=[][e];return!!n&&sQe((function(){n.call(null,t||function(){return 1},1)}))},lQe=aQe.left,AQe=tge,cQe=Wme;Xme({target:"Array",proto:!0,forced:!uQe("reduce")||!cQe&&AQe>79&&AQe<83},{reduce:function(e){var t=arguments.length;return lQe(this,e,t,t>1?arguments[1]:void 0)}});var hQe=Xme,fQe=Cpe,dQe=ape.f,pQe=ame,gQe=HEe,vQe=pke,yQe=Lpe,mQe=vke,wQe=fQe("".endsWith),bQe=fQe("".slice),IQe=Math.min,BQe=mQe("endsWith"),EQe=!BQe&&!!function(){var e=dQe(String.prototype,"endsWith");return e&&!e.writable}();hQe({target:"String",proto:!0,forced:!EQe&&!BQe},{endsWith:function(e){var t=gQe(yQe(this));vQe(e);var n=arguments.length>1?arguments[1]:void 0,r=t.length,i=void 0===n?r:IQe(pQe(n),r),o=gQe(e);return wQe?wQe(t,o,i):bQe(t,i-o.length,i)===o}});var CQe=uve,xQe=Eve,kQe=mpe,SQe=rme,QQe=ume,_Qe=function(e,t,n){var r=CQe(t);r in e?xQe.f(e,r,kQe(0,n)):e[r]=n},NQe=Array,DQe=Math.max,FQe=Zwe,PQe=hpe,UQe=Cpe,LQe=nxe,MQe=hke,TQe=Qve,RQe=Lpe,OQe=zwe,HQe=hxe,KQe=ame,jQe=HEe,GQe=yge,qQe=function(e,t,n){for(var r=QQe(e),i=SQe(t,r),o=SQe(void 0===n?r:n,r),a=NQe(DQe(o-i,0)),s=0;i<o;i++,s++)_Qe(a,s,e[i]);return a.length=s,a},VQe=mxe,zQe=zCe,JQe=spe,YQe=YEe.UNSUPPORTED_Y,XQe=4294967295,WQe=Math.min,ZQe=[].push,$Qe=UQe(/./.exec),e_e=UQe(ZQe),t_e=UQe("".slice),n_e=!JQe((function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var n="ab".split(e);return 2!==n.length||"a"!==n[0]||"b"!==n[1]}));LQe("split",(function(e,t,n){var r;return r="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(e,n){var r=jQe(RQe(this)),i=void 0===n?XQe:n>>>0;if(0===i)return[];if(void 0===e)return[r];if(!MQe(e))return PQe(t,r,e,i);for(var o,a,s,u=[],l=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),A=0,c=new RegExp(e.source,l+"g");(o=PQe(zQe,c,r))&&!((a=c.lastIndex)>A&&(e_e(u,t_e(r,A,o.index)),o.length>1&&o.index<r.length&&FQe(ZQe,u,qQe(o,1)),s=o[0].length,A=a,u.length>=i));)c.lastIndex===o.index&&c.lastIndex++;return A===r.length?!s&&$Qe(c,"")||e_e(u,""):e_e(u,t_e(r,A)),u.length>i?qQe(u,0,i):u}:"0".split(void 0,0).length?function(e,n){return void 0===e&&0===n?[]:PQe(t,this,e,n)}:t,[function(t,n){var i=RQe(this),o=null==t?void 0:GQe(t,e);return o?PQe(o,t,i,n):PQe(r,jQe(i),t,n)},function(e,i){var o=TQe(this),a=jQe(e),s=n(r,o,a,i,r!==t);if(s.done)return s.value;var u=OQe(o,RegExp),l=o.unicode,A=(o.ignoreCase?"i":"")+(o.multiline?"m":"")+(o.unicode?"u":"")+(YQe?"g":"y"),c=new u(YQe?"^(?:"+o.source+")":o,A),h=void 0===i?XQe:i>>>0;if(0===h)return[];if(0===a.length)return null===VQe(c,a)?[a]:[];for(var f=0,d=0,p=[];d<a.length;){c.lastIndex=YQe?0:d;var g,v=VQe(c,YQe?t_e(a,d):a);if(null===v||(g=WQe(KQe(c.lastIndex+(YQe?d:0)),a.length))===f)d=HQe(a,d,l);else{if(e_e(p,t_e(a,f,d)),p.length===h)return p;for(var y=1;y<=v.length-1;y++)if(e_e(p,v[y]),p.length===h)return p;d=f=g}}return e_e(p,t_e(a,f)),p}]}),!n_e,YQe);var r_e={exports:{}},i_e={exports:{}};(function(){var e,t,n,r,i,o;"undefined"!=typeof performance&&null!==performance&&performance.now?i_e.exports=function(){return performance.now()}:"undefined"!=typeof process&&null!==process&&process.hrtime?(i_e.exports=function(){return(e()-i)/1e6},t=process.hrtime,e=function(){var e;return 1e9*(e=t())[0]+e[1]},r=e(),o=1e9*process.uptime(),i=r-o):Date.now?(i_e.exports=function(){return Date.now()-n},n=Date.now()):(i_e.exports=function(){return(new Date).getTime()-n},n=(new Date).getTime())}).call(Tt);for(var o_e=i_e.exports,a_e="undefined"==typeof window?Tt:window,s_e=["moz","webkit"],u_e="AnimationFrame",l_e=a_e["request"+u_e],A_e=a_e["cancel"+u_e]||a_e["cancelRequest"+u_e],c_e=0;!l_e&&c_e<s_e.length;c_e++)l_e=a_e[s_e[c_e]+"Request"+u_e],A_e=a_e[s_e[c_e]+"Cancel"+u_e]||a_e[s_e[c_e]+"CancelRequest"+u_e];if(!l_e||!A_e){var h_e=0,f_e=0,d_e=[];l_e=function(e){if(0===d_e.length){var t=o_e(),n=Math.max(0,16.666666666666668-(t-h_e));h_e=n+t,setTimeout((function(){var e=d_e.slice(0);d_e.length=0;for(var t=0;t<e.length;t++)if(!e[t].cancelled)try{e[t].callback(h_e)}catch(e){setTimeout((function(){throw e}),0)}}),Math.round(n))}return d_e.push({handle:++f_e,callback:e,cancelled:!1}),f_e},A_e=function(e){for(var t=0;t<d_e.length;t++)d_e[t].handle===e&&(d_e[t].cancelled=!0)}}r_e.exports=function(e){return l_e.call(a_e,e)},r_e.exports.cancel=function(){A_e.apply(a_e,arguments)},r_e.exports.polyfill=function(e){e||(e=a_e),e.requestAnimationFrame=l_e,e.cancelAnimationFrame=A_e};var p_e="\t\n\v\f\r                 \u2028\u2029\ufeff",g_e=Lpe,v_e=HEe,y_e=Cpe("".replace),m_e="[\t\n\v\f\r                 \u2028\u2029\ufeff]",w_e=RegExp("^"+m_e+m_e+"*"),b_e=RegExp(m_e+m_e+"*$"),I_e=function(e){return function(t){var n=v_e(g_e(t));return 1&e&&(n=y_e(n,w_e,"")),2&e&&(n=y_e(n,b_e,"")),n}},B_e={start:I_e(1),end:I_e(2),trim:I_e(3)},E_e=Xve.PROPER,C_e=spe,x_e=p_e,k_e=B_e.trim;Xme({target:"String",proto:!0,forced:function(e){return C_e((function(){return!!x_e[e]()||"​…᠎"!=="​…᠎"[e]()||E_e&&x_e[e].name!==e}))}("trim")},{trim:function(){return k_e(this)}});var S_e=function(e){this.ok=!1,this.alpha=1,"#"==e.charAt(0)&&(e=e.substr(1,6)),e=(e=e.replace(/ /g,"")).toLowerCase();var t={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dodgerblue:"1e90ff",feldspar:"d19275",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslateblue:"8470ff",lightslategray:"778899",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370d8",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"d87093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"ff0000",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",violetred:"d02090",wheat:"f5deb3",white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32"};e=t[e]||e;for(var n=[{re:/^rgba\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3}),\s*((?:\d?\.)?\d)\)$/,example:["rgba(123, 234, 45, 0.8)","rgba(255,234,245,1.0)"],process:function(e){return[parseInt(e[1]),parseInt(e[2]),parseInt(e[3]),parseFloat(e[4])]}},{re:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,example:["rgb(123, 234, 45)","rgb(255,234,245)"],process:function(e){return[parseInt(e[1]),parseInt(e[2]),parseInt(e[3])]}},{re:/^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,example:["#00ff00","336699"],process:function(e){return[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16)]}},{re:/^([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,example:["#fb0","f0f"],process:function(e){return[parseInt(e[1]+e[1],16),parseInt(e[2]+e[2],16),parseInt(e[3]+e[3],16)]}}],r=0;r<n.length;r++){var i=n[r].re,o=n[r].process,a=i.exec(e);if(a){var s=o(a);this.r=s[0],this.g=s[1],this.b=s[2],s.length>3&&(this.alpha=s[3]),this.ok=!0}}this.r=this.r<0||isNaN(this.r)?0:this.r>255?255:this.r,this.g=this.g<0||isNaN(this.g)?0:this.g>255?255:this.g,this.b=this.b<0||isNaN(this.b)?0:this.b>255?255:this.b,this.alpha=this.alpha<0?0:this.alpha>1||isNaN(this.alpha)?1:this.alpha,this.toRGB=function(){return"rgb("+this.r+", "+this.g+", "+this.b+")"},this.toRGBA=function(){return"rgba("+this.r+", "+this.g+", "+this.b+", "+this.alpha+")"},this.toHex=function(){var e=this.r.toString(16),t=this.g.toString(16),n=this.b.toString(16);return 1==e.length&&(e="0"+e),1==t.length&&(t="0"+t),1==n.length&&(n="0"+n),"#"+e+t+n},this.getHelpXML=function(){for(var e=new Array,r=0;r<n.length;r++)for(var i=n[r].example,o=0;o<i.length;o++)e[e.length]=i[o];for(var a in t)e[e.length]=a;var s=document.createElement("ul");s.setAttribute("id","rgbcolor-examples");for(r=0;r<e.length;r++)try{var u=document.createElement("li"),l=new RGBColor(e[r]),A=document.createElement("div");A.style.cssText="margin: 3px; border: 1px solid black; background:"+l.toHex()+"; color:"+l.toHex(),A.appendChild(document.createTextNode("test"));var c=document.createTextNode(" "+e[r]+" -> "+l.toRGB()+" -> "+l.toHex());u.appendChild(A),u.appendChild(c),s.appendChild(u)}catch(e){}return s}},Q_e=Xme,__e=fme.indexOf,N_e=uQe,D_e=Cpe([].indexOf),F_e=!!D_e&&1/D_e([1],1,-0)<0,P_e=N_e("indexOf");Q_e({target:"Array",proto:!0,forced:F_e||!P_e},{indexOf:function(e){var t=arguments.length>1?arguments[1]:void 0;return F_e?D_e(this,e,t)||0:__e(this,e,t)}});var U_e=Xme,L_e=pke,M_e=Lpe,T_e=HEe,R_e=vke,O_e=Cpe("".indexOf);U_e({target:"String",proto:!0,forced:!R_e("includes")},{includes:function(e){return!!~O_e(T_e(M_e(this)),T_e(L_e(e)),arguments.length>1?arguments[1]:void 0)}});var H_e=Qpe,K_e=Xme,j_e=Array.isArray||function(e){return"Array"==H_e(e)},G_e=Cpe([].reverse),q_e=[1,2];K_e({target:"Array",proto:!0,forced:String(q_e)===String(q_e.reverse())},{reverse:function(){return j_e(this)&&(this.length=this.length),G_e(this)}});
785
+ `}),{mapDispatchToProps:{onClose:xhe},mapStateToProps:e=>({recipientName:iAe(e),hasCertificateDefinition:!!eAe(e),displayHTML:uAe(e),clickableUrls:rce(e),disableDownloadPdf:XAe(e)})});var Jde,Yde,Xde,Wde,Zde;window.customElements.define("buv-fullscreen-certificate",zde);var $de=function(e){c(r,e);var t=b(r);function r(){var e;return s(this,r),(e=t.call(this)).hasRenderedOnce=!1,e}return l(r,[{key:"_firstRendered",value:function(){this.onLoad(this._props),this.hasRenderedOnce=!0}},{key:"_propertiesChanged",value:function(e,t,n){this._props=e,B(h(r.prototype),"_propertiesChanged",this).call(this,e,t,n),t.src!==n.src&&this.hasRenderedOnce&&this.onLoad({src:t.src}),t.explorerAPIs&&!n.explorerAPIs&&this.onLoad({explorerAPIs:t.explorerAPIs})}},{key:"renderCertificate",value:function(e){switch(e.displayMode){case FAe:return qe(Jde||(Jde=E(["<buv-full-certificate></buv-full-certificate>"])));case"fullscreen":return qe(Yde||(Yde=E(["<buv-fullscreen-certificate></buv-fullscreen-certificate>"])));default:return qe(Xde||(Xde=E(["<buv-card-certificate></buv-card-certificate>"])))}}},{key:"_render",value:function(e){var t=e.hasCertificate?"buv-c-verifier-body buv-c-verifier-body--padded":"";return qe(Wde||(Wde=E(["\n ","\n <section class='buv-c-verifier-main'>\n <buv-drag-and-drop>\n <div class='buv-c-verifier-layout'>\n <section class$='","'>\n ","\n <buv-certificate-input></buv-certificate-input>\n <buv-action-menu></buv-action-menu>\n ","\n <buv-verification-modal></buv-verification-modal>\n </section>\n <buv-footer interactive></buv-footer>\n </div>\n </buv-drag-and-drop>\n </section>\n "])),kfe,t,Yhe(e.errorMessage,!0),this.renderCertificate(e))}}],[{key:"properties",get:function(){return n({onLoad:Function,errorMessage:String,hasCertificate:Boolean},dce)}}]),r}(Xe);function epe(e){return e.errorMessage}window.customElements.define("buv-raw",$de);const tpe={onLoad:function(e={}){return function(t){const n=function(e){return Object.keys(dce).reduce((function(t,n){return e[n]&&(t[n]=e[n]),t}),{})}(e),{src:r,locale:i}=n;t({type:dt,payload:{options:n}}),Hue.certificates.isPathToCertificateValidURI(r)?t(lce(r)):function(e){try{return JSON.parse(e),!0}catch(e){return!1}}(r)&&t(uce(JSON.parse(r))),gce(i)}}},npe=TAe((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return qe(Zde||(Zde=E(["<buv-raw\n src='","'\n onLoad='","'\n errorMessage='","'\n hasCertificate='","'\n disableAutoVerify='","'\n disableVerify='","'\n allowDownload='","'\n disableDownloadPdf='","'\n allowSocialShare='","'\n displayMode='","'\n showMetadata='","'\n clickableUrls='","'\n theme='","'\n locale='","'\n explorerAPIs='","'\n didResolverUrl='","'\n ></buv-raw>"])),e.src,e.onLoad,e.errorMessage,e.hasCertificate,e["disable-auto-verify"],e["disable-verify"],e["allow-download"],e["disable-download-pdf"],e["allow-social-share"],e["display-mode"],e["show-metadata"],e["clickable-urls"],e.theme,e.locale,e.explorerAPIs,e["did-resolver-url"])}),{mapDispatchToProps:tpe,mapStateToProps:e=>({errorMessage:epe(e),hasCertificate:!!eAe(e)}),ownProps:Object.assign(Object.assign({},$de.properties),fce)});window.customElements.define("blockcerts-verifier",npe);var rpe={exports:{}};
786
+ /*! @license DOMPurify 2.3.8 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.3.8/LICENSE */!function(e,t){e.exports=function(){function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(e,n){return t=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},t(e,n)}function n(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function r(e,i,o){return r=n()?Reflect.construct:function(e,n,r){var i=[null];i.push.apply(i,n);var o=new(Function.bind.apply(e,i));return r&&t(o,r.prototype),o},r.apply(null,arguments)}function i(e){return o(e)||a(e)||s(e)||l()}function o(e){if(Array.isArray(e))return u(e)}function a(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function s(e,t){if(e){if("string"==typeof e)return u(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(e,t):void 0}}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function l(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var A=Object.hasOwnProperty,c=Object.setPrototypeOf,h=Object.isFrozen,f=Object.getPrototypeOf,d=Object.getOwnPropertyDescriptor,p=Object.freeze,g=Object.seal,v=Object.create,y="undefined"!=typeof Reflect&&Reflect,m=y.apply,w=y.construct;m||(m=function(e,t,n){return e.apply(t,n)}),p||(p=function(e){return e}),g||(g=function(e){return e}),w||(w=function(e,t){return r(e,i(t))});var b=N(Array.prototype.forEach),I=N(Array.prototype.pop),B=N(Array.prototype.push),E=N(String.prototype.toLowerCase),C=N(String.prototype.match),x=N(String.prototype.replace),k=N(String.prototype.indexOf),S=N(String.prototype.trim),Q=N(RegExp.prototype.test),_=D(TypeError);function N(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return m(e,t,r)}}function D(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return w(e,n)}}function F(e,t){c&&c(e,null);for(var n=t.length;n--;){var r=t[n];if("string"==typeof r){var i=E(r);i!==r&&(h(t)||(t[n]=i),r=i)}e[r]=!0}return e}function P(e){var t,n=v(null);for(t in e)m(A,e,[t])&&(n[t]=e[t]);return n}function U(e,t){for(;null!==e;){var n=d(e,t);if(n){if(n.get)return N(n.get);if("function"==typeof n.value)return N(n.value)}e=f(e)}function r(e){return console.warn("fallback value for",e),null}return r}var L=p(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),M=p(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),T=p(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),R=p(["animate","color-profile","cursor","discard","fedropshadow","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),O=p(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover"]),H=p(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),K=p(["#text"]),j=p(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),G=p(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),q=p(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),V=p(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),z=g(/\{\{[\w\W]*|[\w\W]*\}\}/gm),J=g(/<%[\w\W]*|[\w\W]*%>/gm),Y=g(/^data-[\-\w.\u00B7-\uFFFF]/),X=g(/^aria-[\-\w]+$/),W=g(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Z=g(/^(?:\w+script|data):/i),$=g(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),ee=g(/^html$/i),te=function(){return"undefined"==typeof window?null:window},ne=function(t,n){if("object"!==e(t)||"function"!=typeof t.createPolicy)return null;var r=null,i="data-tt-policy-suffix";n.currentScript&&n.currentScript.hasAttribute(i)&&(r=n.currentScript.getAttribute(i));var o="dompurify"+(r?"#"+r:"");try{return t.createPolicy(o,{createHTML:function(e){return e}})}catch(e){return console.warn("TrustedTypes policy "+o+" could not be created."),null}};function re(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:te(),n=function(e){return re(e)};if(n.version="2.3.8",n.removed=[],!t||!t.document||9!==t.document.nodeType)return n.isSupported=!1,n;var r=t.document,o=t.document,a=t.DocumentFragment,s=t.HTMLTemplateElement,u=t.Node,l=t.Element,A=t.NodeFilter,c=t.NamedNodeMap,h=void 0===c?t.NamedNodeMap||t.MozNamedAttrMap:c,f=t.HTMLFormElement,d=t.DOMParser,g=t.trustedTypes,v=l.prototype,y=U(v,"cloneNode"),m=U(v,"nextSibling"),w=U(v,"childNodes"),N=U(v,"parentNode");if("function"==typeof s){var D=o.createElement("template");D.content&&D.content.ownerDocument&&(o=D.content.ownerDocument)}var ie=ne(g,r),oe=ie?ie.createHTML(""):"",ae=o,se=ae.implementation,ue=ae.createNodeIterator,le=ae.createDocumentFragment,Ae=ae.getElementsByTagName,ce=r.importNode,he={};try{he=P(o).documentMode?o.documentMode:{}}catch(e){}var fe={};n.isSupported="function"==typeof N&&se&&void 0!==se.createHTMLDocument&&9!==he;var de,pe,ge=z,ve=J,ye=Y,me=X,we=Z,be=$,Ie=W,Be=null,Ee=F({},[].concat(i(L),i(M),i(T),i(O),i(K))),Ce=null,xe=F({},[].concat(i(j),i(G),i(q),i(V))),ke=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Se=null,Qe=null,_e=!0,Ne=!0,De=!1,Fe=!1,Pe=!1,Ue=!1,Le=!1,Me=!1,Te=!1,Re=!1,Oe=!0,He=!0,Ke=!1,je={},Ge=null,qe=F({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),Ve=null,ze=F({},["audio","video","img","source","image","track"]),Je=null,Ye=F({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Xe="http://www.w3.org/1998/Math/MathML",We="http://www.w3.org/2000/svg",Ze="http://www.w3.org/1999/xhtml",$e=Ze,et=!1,tt=["application/xhtml+xml","text/html"],nt="text/html",rt=null,it=o.createElement("form"),ot=function(e){return e instanceof RegExp||e instanceof Function},at=function(t){rt&&rt===t||(t&&"object"===e(t)||(t={}),t=P(t),Be="ALLOWED_TAGS"in t?F({},t.ALLOWED_TAGS):Ee,Ce="ALLOWED_ATTR"in t?F({},t.ALLOWED_ATTR):xe,Je="ADD_URI_SAFE_ATTR"in t?F(P(Ye),t.ADD_URI_SAFE_ATTR):Ye,Ve="ADD_DATA_URI_TAGS"in t?F(P(ze),t.ADD_DATA_URI_TAGS):ze,Ge="FORBID_CONTENTS"in t?F({},t.FORBID_CONTENTS):qe,Se="FORBID_TAGS"in t?F({},t.FORBID_TAGS):{},Qe="FORBID_ATTR"in t?F({},t.FORBID_ATTR):{},je="USE_PROFILES"in t&&t.USE_PROFILES,_e=!1!==t.ALLOW_ARIA_ATTR,Ne=!1!==t.ALLOW_DATA_ATTR,De=t.ALLOW_UNKNOWN_PROTOCOLS||!1,Fe=t.SAFE_FOR_TEMPLATES||!1,Pe=t.WHOLE_DOCUMENT||!1,Me=t.RETURN_DOM||!1,Te=t.RETURN_DOM_FRAGMENT||!1,Re=t.RETURN_TRUSTED_TYPE||!1,Le=t.FORCE_BODY||!1,Oe=!1!==t.SANITIZE_DOM,He=!1!==t.KEEP_CONTENT,Ke=t.IN_PLACE||!1,Ie=t.ALLOWED_URI_REGEXP||Ie,$e=t.NAMESPACE||Ze,t.CUSTOM_ELEMENT_HANDLING&&ot(t.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(ke.tagNameCheck=t.CUSTOM_ELEMENT_HANDLING.tagNameCheck),t.CUSTOM_ELEMENT_HANDLING&&ot(t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(ke.attributeNameCheck=t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),t.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(ke.allowCustomizedBuiltInElements=t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),de=de=-1===tt.indexOf(t.PARSER_MEDIA_TYPE)?nt:t.PARSER_MEDIA_TYPE,pe="application/xhtml+xml"===de?function(e){return e}:E,Fe&&(Ne=!1),Te&&(Me=!0),je&&(Be=F({},i(K)),Ce=[],!0===je.html&&(F(Be,L),F(Ce,j)),!0===je.svg&&(F(Be,M),F(Ce,G),F(Ce,V)),!0===je.svgFilters&&(F(Be,T),F(Ce,G),F(Ce,V)),!0===je.mathMl&&(F(Be,O),F(Ce,q),F(Ce,V))),t.ADD_TAGS&&(Be===Ee&&(Be=P(Be)),F(Be,t.ADD_TAGS)),t.ADD_ATTR&&(Ce===xe&&(Ce=P(Ce)),F(Ce,t.ADD_ATTR)),t.ADD_URI_SAFE_ATTR&&F(Je,t.ADD_URI_SAFE_ATTR),t.FORBID_CONTENTS&&(Ge===qe&&(Ge=P(Ge)),F(Ge,t.FORBID_CONTENTS)),He&&(Be["#text"]=!0),Pe&&F(Be,["html","head","body"]),Be.table&&(F(Be,["tbody"]),delete Se.tbody),p&&p(t),rt=t)},st=F({},["mi","mo","mn","ms","mtext"]),ut=F({},["foreignobject","desc","title","annotation-xml"]),lt=F({},["title","style","font","a","script"]),At=F({},M);F(At,T),F(At,R);var ct=F({},O);F(ct,H);var ht=function(e){var t=N(e);t&&t.tagName||(t={namespaceURI:Ze,tagName:"template"});var n=E(e.tagName),r=E(t.tagName);return e.namespaceURI===We?t.namespaceURI===Ze?"svg"===n:t.namespaceURI===Xe?"svg"===n&&("annotation-xml"===r||st[r]):Boolean(At[n]):e.namespaceURI===Xe?t.namespaceURI===Ze?"math"===n:t.namespaceURI===We?"math"===n&&ut[r]:Boolean(ct[n]):e.namespaceURI===Ze&&!(t.namespaceURI===We&&!ut[r])&&!(t.namespaceURI===Xe&&!st[r])&&!ct[n]&&(lt[n]||!At[n])},ft=function(e){B(n.removed,{element:e});try{e.parentNode.removeChild(e)}catch(t){try{e.outerHTML=oe}catch(t){e.remove()}}},dt=function(e,t){try{B(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){B(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e&&!Ce[e])if(Me||Te)try{ft(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},pt=function(e){var t,n;if(Le)e="<remove></remove>"+e;else{var r=C(e,/^[\r\n\t ]+/);n=r&&r[0]}"application/xhtml+xml"===de&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");var i=ie?ie.createHTML(e):e;if($e===Ze)try{t=(new d).parseFromString(i,de)}catch(e){}if(!t||!t.documentElement){t=se.createDocument($e,"template",null);try{t.documentElement.innerHTML=et?"":i}catch(e){}}var a=t.body||t.documentElement;return e&&n&&a.insertBefore(o.createTextNode(n),a.childNodes[0]||null),$e===Ze?Ae.call(t,Pe?"html":"body")[0]:Pe?t.documentElement:a},gt=function(e){return ue.call(e.ownerDocument||e,e,A.SHOW_ELEMENT|A.SHOW_COMMENT|A.SHOW_TEXT,null,!1)},vt=function(e){return e instanceof f&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof h)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore)},yt=function(t){return"object"===e(u)?t instanceof u:t&&"object"===e(t)&&"number"==typeof t.nodeType&&"string"==typeof t.nodeName},mt=function(e,t,r){fe[e]&&b(fe[e],(function(e){e.call(n,t,r,rt)}))},wt=function(e){var t;if(mt("beforeSanitizeElements",e,null),vt(e))return ft(e),!0;if(Q(/[\u0080-\uFFFF]/,e.nodeName))return ft(e),!0;var r=pe(e.nodeName);if(mt("uponSanitizeElement",e,{tagName:r,allowedTags:Be}),e.hasChildNodes()&&!yt(e.firstElementChild)&&(!yt(e.content)||!yt(e.content.firstElementChild))&&Q(/<[/\w]/g,e.innerHTML)&&Q(/<[/\w]/g,e.textContent))return ft(e),!0;if("select"===r&&Q(/<template/i,e.innerHTML))return ft(e),!0;if(!Be[r]||Se[r]){if(!Se[r]&&It(r)){if(ke.tagNameCheck instanceof RegExp&&Q(ke.tagNameCheck,r))return!1;if(ke.tagNameCheck instanceof Function&&ke.tagNameCheck(r))return!1}if(He&&!Ge[r]){var i=N(e)||e.parentNode,o=w(e)||e.childNodes;if(o&&i)for(var a=o.length-1;a>=0;--a)i.insertBefore(y(o[a],!0),m(e))}return ft(e),!0}return e instanceof l&&!ht(e)?(ft(e),!0):"noscript"!==r&&"noembed"!==r||!Q(/<\/no(script|embed)/i,e.innerHTML)?(Fe&&3===e.nodeType&&(t=e.textContent,t=x(t,ge," "),t=x(t,ve," "),e.textContent!==t&&(B(n.removed,{element:e.cloneNode()}),e.textContent=t)),mt("afterSanitizeElements",e,null),!1):(ft(e),!0)},bt=function(e,t,n){if(Oe&&("id"===t||"name"===t)&&(n in o||n in it))return!1;if(Ne&&!Qe[t]&&Q(ye,t));else if(_e&&Q(me,t));else if(!Ce[t]||Qe[t]){if(!(It(e)&&(ke.tagNameCheck instanceof RegExp&&Q(ke.tagNameCheck,e)||ke.tagNameCheck instanceof Function&&ke.tagNameCheck(e))&&(ke.attributeNameCheck instanceof RegExp&&Q(ke.attributeNameCheck,t)||ke.attributeNameCheck instanceof Function&&ke.attributeNameCheck(t))||"is"===t&&ke.allowCustomizedBuiltInElements&&(ke.tagNameCheck instanceof RegExp&&Q(ke.tagNameCheck,n)||ke.tagNameCheck instanceof Function&&ke.tagNameCheck(n))))return!1}else if(Je[t]);else if(Q(Ie,x(n,be,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==k(n,"data:")||!Ve[e])if(De&&!Q(we,x(n,be,"")));else if(n)return!1;return!0},It=function(e){return e.indexOf("-")>0},Bt=function(e){var t,r,i,o;mt("beforeSanitizeAttributes",e,null);var a=e.attributes;if(a){var s={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Ce};for(o=a.length;o--;){var u=t=a[o],l=u.name,A=u.namespaceURI;if(r="value"===l?t.value:S(t.value),i=pe(l),s.attrName=i,s.attrValue=r,s.keepAttr=!0,s.forceKeepAttr=void 0,mt("uponSanitizeAttribute",e,s),r=s.attrValue,!s.forceKeepAttr&&(dt(l,e),s.keepAttr))if(Q(/\/>/i,r))dt(l,e);else{Fe&&(r=x(r,ge," "),r=x(r,ve," "));var c=pe(e.nodeName);if(bt(c,i,r))try{A?e.setAttributeNS(A,l,r):e.setAttribute(l,r),I(n.removed)}catch(e){}}}mt("afterSanitizeAttributes",e,null)}},Et=function e(t){var n,r=gt(t);for(mt("beforeSanitizeShadowDOM",t,null);n=r.nextNode();)mt("uponSanitizeShadowNode",n,null),wt(n)||(n.content instanceof a&&e(n.content),Bt(n));mt("afterSanitizeShadowDOM",t,null)};return n.sanitize=function(i,o){var s,l,A,c,h;if((et=!i)&&(i="\x3c!--\x3e"),"string"!=typeof i&&!yt(i)){if("function"!=typeof i.toString)throw _("toString is not a function");if("string"!=typeof(i=i.toString()))throw _("dirty is not a string, aborting")}if(!n.isSupported){if("object"===e(t.toStaticHTML)||"function"==typeof t.toStaticHTML){if("string"==typeof i)return t.toStaticHTML(i);if(yt(i))return t.toStaticHTML(i.outerHTML)}return i}if(Ue||at(o),n.removed=[],"string"==typeof i&&(Ke=!1),Ke){if(i.nodeName){var f=pe(i.nodeName);if(!Be[f]||Se[f])throw _("root node is forbidden and cannot be sanitized in-place")}}else if(i instanceof u)1===(l=(s=pt("\x3c!----\x3e")).ownerDocument.importNode(i,!0)).nodeType&&"BODY"===l.nodeName||"HTML"===l.nodeName?s=l:s.appendChild(l);else{if(!Me&&!Fe&&!Pe&&-1===i.indexOf("<"))return ie&&Re?ie.createHTML(i):i;if(!(s=pt(i)))return Me?null:Re?oe:""}s&&Le&&ft(s.firstChild);for(var d=gt(Ke?i:s);A=d.nextNode();)3===A.nodeType&&A===c||wt(A)||(A.content instanceof a&&Et(A.content),Bt(A),c=A);if(c=null,Ke)return i;if(Me){if(Te)for(h=le.call(s.ownerDocument);s.firstChild;)h.appendChild(s.firstChild);else h=s;return Ce.shadowroot&&(h=ce.call(r,h,!0)),h}var p=Pe?s.outerHTML:s.innerHTML;return Pe&&Be["!doctype"]&&s.ownerDocument&&s.ownerDocument.doctype&&s.ownerDocument.doctype.name&&Q(ee,s.ownerDocument.doctype.name)&&(p="<!DOCTYPE "+s.ownerDocument.doctype.name+">\n"+p),Fe&&(p=x(p,ge," "),p=x(p,ve," ")),ie&&Re?ie.createHTML(p):p},n.setConfig=function(e){at(e),Ue=!0},n.clearConfig=function(){rt=null,Ue=!1},n.isValidAttribute=function(e,t,n){rt||at({});var r=pe(e),i=pe(t);return bt(r,i,n)},n.addHook=function(e,t){"function"==typeof t&&(fe[e]=fe[e]||[],B(fe[e],t))},n.removeHook=function(e){if(fe[e])return I(fe[e])},n.removeHooks=function(e){fe[e]&&(fe[e]=[])},n.removeAllHooks=function(){fe={}},n}return re()}()}(rpe);var ipe=e({__proto__:null,default:rpe.exports},[rpe.exports]),ope=function(e){return e&&e.Math==Math&&e},ape=ope("object"==("undefined"==typeof globalThis?"undefined":i(globalThis))&&globalThis)||ope("object"==("undefined"==typeof window?"undefined":i(window))&&window)||ope("object"==("undefined"==typeof self?"undefined":i(self))&&self)||ope("object"==i(Tt)&&Tt)||function(){return this}()||Function("return this")(),spe={},upe=function(e){try{return!!e()}catch(e){return!0}},lpe=!upe((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),Ape=!upe((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")})),cpe=Ape,hpe=Function.prototype.call,fpe=cpe?hpe.bind(hpe):function(){return hpe.apply(hpe,arguments)},dpe={},ppe={}.propertyIsEnumerable,gpe=Object.getOwnPropertyDescriptor,vpe=gpe&&!ppe.call({1:2},1);dpe.f=vpe?function(e){var t=gpe(this,e);return!!t&&t.enumerable}:ppe;var ype,mpe,wpe=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},bpe=Ape,Ipe=Function.prototype,Bpe=Ipe.bind,Epe=Ipe.call,Cpe=bpe&&Bpe.bind(Epe,Epe),xpe=bpe?function(e){return e&&Cpe(e)}:function(e){return e&&function(){return Epe.apply(e,arguments)}},kpe=xpe,Spe=kpe({}.toString),Qpe=kpe("".slice),_pe=function(e){return Qpe(Spe(e),8,-1)},Npe=upe,Dpe=_pe,Fpe=Object,Ppe=xpe("".split),Upe=Npe((function(){return!Fpe("z").propertyIsEnumerable(0)}))?function(e){return"String"==Dpe(e)?Ppe(e,""):Fpe(e)}:Fpe,Lpe=TypeError,Mpe=function(e){if(null==e)throw Lpe("Can't call method on "+e);return e},Tpe=Upe,Rpe=Mpe,Ope=function(e){return Tpe(Rpe(e))},Hpe=function(e){return"function"==typeof e},Kpe=Hpe,jpe=function(e){return"object"==i(e)?null!==e:Kpe(e)},Gpe=ape,qpe=Hpe,Vpe=function(e){return qpe(e)?e:void 0},zpe=function(e,t){return arguments.length<2?Vpe(Gpe[e]):Gpe[e]&&Gpe[e][t]},Jpe=xpe({}.isPrototypeOf),Ype=zpe("navigator","userAgent")||"",Xpe=ape,Wpe=Ype,Zpe=Xpe.process,$pe=Xpe.Deno,ege=Zpe&&Zpe.versions||$pe&&$pe.version,tge=ege&&ege.v8;tge&&(mpe=(ype=tge.split("."))[0]>0&&ype[0]<4?1:+(ype[0]+ype[1])),!mpe&&Wpe&&(!(ype=Wpe.match(/Edge\/(\d+)/))||ype[1]>=74)&&(ype=Wpe.match(/Chrome\/(\d+)/))&&(mpe=+ype[1]);var nge=mpe,rge=nge,ige=upe,oge=!!Object.getOwnPropertySymbols&&!ige((function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&rge&&rge<41})),age=oge&&!Symbol.sham&&"symbol"==i(Symbol.iterator),sge=zpe,uge=Hpe,lge=Jpe,Age=Object,cge=age?function(e){return"symbol"==i(e)}:function(e){var t=sge("Symbol");return uge(t)&&lge(t.prototype,Age(e))},hge=String,fge=function(e){try{return hge(e)}catch(e){return"Object"}},dge=Hpe,pge=fge,gge=TypeError,vge=function(e){if(dge(e))return e;throw gge(pge(e)+" is not a function")},yge=vge,mge=function(e,t){var n=e[t];return null==n?void 0:yge(n)},wge=fpe,bge=Hpe,Ige=jpe,Bge=TypeError,Ege={exports:{}},Cge=ape,xge=Object.defineProperty,kge=function(e,t){try{xge(Cge,e,{value:t,configurable:!0,writable:!0})}catch(n){Cge[e]=t}return t},Sge=kge,Qge="__core-js_shared__",_ge=ape[Qge]||Sge(Qge,{}),Nge=_ge;(Ege.exports=function(e,t){return Nge[e]||(Nge[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.24.1",mode:"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.24.1/LICENSE",source:"https://github.com/zloirock/core-js"});var Dge=Mpe,Fge=Object,Pge=function(e){return Fge(Dge(e))},Uge=Pge,Lge=xpe({}.hasOwnProperty),Mge=Object.hasOwn||function(e,t){return Lge(Uge(e),t)},Tge=xpe,Rge=0,Oge=Math.random(),Hge=Tge(1..toString),Kge=function(e){return"Symbol("+(void 0===e?"":e)+")_"+Hge(++Rge+Oge,36)},jge=ape,Gge=Ege.exports,qge=Mge,Vge=Kge,zge=oge,Jge=age,Yge=Gge("wks"),Xge=jge.Symbol,Wge=Xge&&Xge.for,Zge=Jge?Xge:Xge&&Xge.withoutSetter||Vge,$ge=function(e){if(!qge(Yge,e)||!zge&&"string"!=typeof Yge[e]){var t="Symbol."+e;zge&&qge(Xge,e)?Yge[e]=Xge[e]:Yge[e]=Jge&&Wge?Wge(t):Zge(t)}return Yge[e]},eve=fpe,tve=jpe,nve=cge,rve=mge,ive=function(e,t){var n,r;if("string"===t&&bge(n=e.toString)&&!Ige(r=wge(n,e)))return r;if(bge(n=e.valueOf)&&!Ige(r=wge(n,e)))return r;if("string"!==t&&bge(n=e.toString)&&!Ige(r=wge(n,e)))return r;throw Bge("Can't convert object to primitive value")},ove=TypeError,ave=$ge("toPrimitive"),sve=function(e,t){if(!tve(e)||nve(e))return e;var n,r=rve(e,ave);if(r){if(void 0===t&&(t="default"),n=eve(r,e,t),!tve(n)||nve(n))return n;throw ove("Can't convert object to primitive value")}return void 0===t&&(t="number"),ive(e,t)},uve=cge,lve=function(e){var t=sve(e,"string");return uve(t)?t:t+""},Ave=jpe,cve=ape.document,hve=Ave(cve)&&Ave(cve.createElement),fve=function(e){return hve?cve.createElement(e):{}},dve=fve,pve=!lpe&&!upe((function(){return 7!=Object.defineProperty(dve("div"),"a",{get:function(){return 7}}).a})),gve=lpe,vve=fpe,yve=dpe,mve=wpe,wve=Ope,bve=lve,Ive=Mge,Bve=pve,Eve=Object.getOwnPropertyDescriptor;spe.f=gve?Eve:function(e,t){if(e=wve(e),t=bve(t),Bve)try{return Eve(e,t)}catch(e){}if(Ive(e,t))return mve(!vve(yve.f,e,t),e[t])};var Cve={},xve=lpe&&upe((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),kve=jpe,Sve=String,Qve=TypeError,_ve=function(e){if(kve(e))return e;throw Qve(Sve(e)+" is not an object")},Nve=lpe,Dve=pve,Fve=xve,Pve=_ve,Uve=lve,Lve=TypeError,Mve=Object.defineProperty,Tve=Object.getOwnPropertyDescriptor,Rve="enumerable",Ove="configurable",Hve="writable";Cve.f=Nve?Fve?function(e,t,n){if(Pve(e),t=Uve(t),Pve(n),"function"==typeof e&&"prototype"===t&&"value"in n&&Hve in n&&!n.writable){var r=Tve(e,t);r&&r.writable&&(e[t]=n.value,n={configurable:Ove in n?n.configurable:r.configurable,enumerable:Rve in n?n.enumerable:r.enumerable,writable:!1})}return Mve(e,t,n)}:Mve:function(e,t,n){if(Pve(e),t=Uve(t),Pve(n),Dve)try{return Mve(e,t,n)}catch(e){}if("get"in n||"set"in n)throw Lve("Accessors not supported");return"value"in n&&(e[t]=n.value),e};var Kve=Cve,jve=wpe,Gve=lpe?function(e,t,n){return Kve.f(e,t,jve(1,n))}:function(e,t,n){return e[t]=n,e},qve={exports:{}},Vve=lpe,zve=Mge,Jve=Function.prototype,Yve=Vve&&Object.getOwnPropertyDescriptor,Xve=zve(Jve,"name"),Wve={EXISTS:Xve,PROPER:Xve&&"something"===function(){}.name,CONFIGURABLE:Xve&&(!Vve||Vve&&Yve(Jve,"name").configurable)},Zve=Hpe,$ve=_ge,eye=xpe(Function.toString);Zve($ve.inspectSource)||($ve.inspectSource=function(e){return eye(e)});var tye,nye,rye,iye=$ve.inspectSource,oye=Hpe,aye=iye,sye=ape.WeakMap,uye=oye(sye)&&/native code/.test(aye(sye)),lye=Ege.exports,Aye=Kge,cye=lye("keys"),hye=function(e){return cye[e]||(cye[e]=Aye(e))},fye={},dye=uye,pye=ape,gye=xpe,vye=jpe,yye=Gve,mye=Mge,wye=_ge,bye=hye,Iye=fye,Bye="Object already initialized",Eye=pye.TypeError,Cye=pye.WeakMap;if(dye||wye.state){var xye=wye.state||(wye.state=new Cye),kye=gye(xye.get),Sye=gye(xye.has),Qye=gye(xye.set);tye=function(e,t){if(Sye(xye,e))throw new Eye(Bye);return t.facade=e,Qye(xye,e,t),t},nye=function(e){return kye(xye,e)||{}},rye=function(e){return Sye(xye,e)}}else{var _ye=bye("state");Iye[_ye]=!0,tye=function(e,t){if(mye(e,_ye))throw new Eye(Bye);return t.facade=e,yye(e,_ye,t),t},nye=function(e){return mye(e,_ye)?e[_ye]:{}},rye=function(e){return mye(e,_ye)}}var Nye={set:tye,get:nye,has:rye,enforce:function(e){return rye(e)?nye(e):tye(e,{})},getterFor:function(e){return function(t){var n;if(!vye(t)||(n=nye(t)).type!==e)throw Eye("Incompatible receiver, "+e+" required");return n}}},Dye=upe,Fye=Hpe,Pye=Mge,Uye=lpe,Lye=Wve.CONFIGURABLE,Mye=iye,Tye=Nye.enforce,Rye=Nye.get,Oye=Object.defineProperty,Hye=Uye&&!Dye((function(){return 8!==Oye((function(){}),"length",{value:8}).length})),Kye=String(String).split("String"),jye=qve.exports=function(e,t,n){"Symbol("===String(t).slice(0,7)&&(t="["+String(t).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),n&&n.getter&&(t="get "+t),n&&n.setter&&(t="set "+t),(!Pye(e,"name")||Lye&&e.name!==t)&&(Uye?Oye(e,"name",{value:t,configurable:!0}):e.name=t),Hye&&n&&Pye(n,"arity")&&e.length!==n.arity&&Oye(e,"length",{value:n.arity});try{n&&Pye(n,"constructor")&&n.constructor?Uye&&Oye(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var r=Tye(e);return Pye(r,"source")||(r.source=Kye.join("string"==typeof t?t:"")),e};Function.prototype.toString=jye((function(){return Fye(this)&&Rye(this).source||Mye(this)}),"toString");var Gye=Hpe,qye=Cve,Vye=qve.exports,zye=kge,Jye=function(e,t,n,r){r||(r={});var i=r.enumerable,o=void 0!==r.name?r.name:t;if(Gye(n)&&Vye(n,o,r),r.global)i?e[t]=n:zye(t,n);else{try{r.unsafe?e[t]&&(i=!0):delete e[t]}catch(e){}i?e[t]=n:qye.f(e,t,{value:n,enumerable:!1,configurable:!r.nonConfigurable,writable:!r.nonWritable})}return e},Yye={},Xye=Math.ceil,Wye=Math.floor,Zye=Math.trunc||function(e){var t=+e;return(t>0?Wye:Xye)(t)},$ye=Zye,eme=function(e){var t=+e;return t!=t||0===t?0:$ye(t)},tme=eme,nme=Math.max,rme=Math.min,ime=function(e,t){var n=tme(e);return n<0?nme(n+t,0):rme(n,t)},ome=eme,ame=Math.min,sme=function(e){return e>0?ame(ome(e),9007199254740991):0},ume=sme,lme=function(e){return ume(e.length)},Ame=Ope,cme=ime,hme=lme,fme=function(e){return function(t,n,r){var i,o=Ame(t),a=hme(o),s=cme(r,a);if(e&&n!=n){for(;a>s;)if((i=o[s++])!=i)return!0}else for(;a>s;s++)if((e||s in o)&&o[s]===n)return e||s||0;return!e&&-1}},dme={includes:fme(!0),indexOf:fme(!1)},pme=Mge,gme=Ope,vme=dme.indexOf,yme=fye,mme=xpe([].push),wme=function(e,t){var n,r=gme(e),i=0,o=[];for(n in r)!pme(yme,n)&&pme(r,n)&&mme(o,n);for(;t.length>i;)pme(r,n=t[i++])&&(~vme(o,n)||mme(o,n));return o},bme=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Ime=wme,Bme=bme.concat("length","prototype");Yye.f=Object.getOwnPropertyNames||function(e){return Ime(e,Bme)};var Eme={};Eme.f=Object.getOwnPropertySymbols;var Cme=zpe,xme=Yye,kme=Eme,Sme=_ve,Qme=xpe([].concat),_me=Cme("Reflect","ownKeys")||function(e){var t=xme.f(Sme(e)),n=kme.f;return n?Qme(t,n(e)):t},Nme=Mge,Dme=_me,Fme=spe,Pme=Cve,Ume=upe,Lme=Hpe,Mme=/#|\.prototype\./,Tme=function(e,t){var n=Ome[Rme(e)];return n==Kme||n!=Hme&&(Lme(t)?Ume(t):!!t)},Rme=Tme.normalize=function(e){return String(e).replace(Mme,".").toLowerCase()},Ome=Tme.data={},Hme=Tme.NATIVE="N",Kme=Tme.POLYFILL="P",jme=Tme,Gme=ape,qme=spe.f,Vme=Gve,zme=Jye,Jme=kge,Yme=function(e,t,n){for(var r=Dme(t),i=Pme.f,o=Fme.f,a=0;a<r.length;a++){var s=r[a];Nme(e,s)||n&&Nme(n,s)||i(e,s,o(t,s))}},Xme=jme,Wme=function(e,t){var n,r,o,a,s,u=e.target,l=e.global,A=e.stat;if(n=l?Gme:A?Gme[u]||Jme(u,{}):(Gme[u]||{}).prototype)for(r in t){if(a=t[r],o=e.dontCallGetSet?(s=qme(n,r))&&s.value:n[r],!Xme(l?r:u+(A?".":"#")+r,e.forced)&&void 0!==o){if(i(a)==i(o))continue;Yme(a,o)}(e.sham||o&&o.sham)&&Vme(a,"sham",!0),zme(n,r,a,e)}},Zme="process"==_pe(ape.process),$me=Hpe,ewe=String,twe=TypeError,nwe=xpe,rwe=_ve,iwe=function(e){if("object"==i(e)||$me(e))return e;throw twe("Can't set "+ewe(e)+" as a prototype")},owe=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,n={};try{(e=nwe(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(n,[]),t=n instanceof Array}catch(e){}return function(n,r){return rwe(n),iwe(r),t?e(n,r):n.__proto__=r,n}}():void 0),awe=Cve.f,swe=Mge,uwe=$ge("toStringTag"),lwe=function(e,t,n){e&&!n&&(e=e.prototype),e&&!swe(e,uwe)&&awe(e,uwe,{configurable:!0,value:t})},Awe=zpe,cwe=Cve,hwe=lpe,fwe=$ge("species"),dwe=Jpe,pwe=TypeError,gwe={};gwe[$ge("toStringTag")]="z";var vwe="[object z]"===String(gwe),ywe=Hpe,mwe=_pe,wwe=$ge("toStringTag"),bwe=Object,Iwe="Arguments"==mwe(function(){return arguments}()),Bwe=vwe?mwe:function(e){var t,n,r;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=bwe(e),wwe))?n:Iwe?mwe(t):"Object"==(r=mwe(t))&&ywe(t.callee)?"Arguments":r},Ewe=xpe,Cwe=upe,xwe=Hpe,kwe=Bwe,Swe=iye,Qwe=function(){},_we=[],Nwe=zpe("Reflect","construct"),Dwe=/^\s*(?:class|function)\b/,Fwe=Ewe(Dwe.exec),Pwe=!Dwe.exec(Qwe),Uwe=function(e){if(!xwe(e))return!1;try{return Nwe(Qwe,_we,e),!0}catch(e){return!1}},Lwe=function(e){if(!xwe(e))return!1;switch(kwe(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return Pwe||!!Fwe(Dwe,Swe(e))}catch(e){return!0}};Lwe.sham=!0;var Mwe,Twe,Rwe,Owe,Hwe=!Nwe||Cwe((function(){var e;return Uwe(Uwe.call)||!Uwe(Object)||!Uwe((function(){e=!0}))||e}))?Lwe:Uwe,Kwe=Hwe,jwe=fge,Gwe=TypeError,qwe=_ve,Vwe=function(e){if(Kwe(e))return e;throw Gwe(jwe(e)+" is not a constructor")},zwe=$ge("species"),Jwe=function(e,t){var n,r=qwe(e).constructor;return void 0===r||null==(n=qwe(r)[zwe])?t:Vwe(n)},Ywe=Ape,Xwe=Function.prototype,Wwe=Xwe.apply,Zwe=Xwe.call,$we="object"==("undefined"==typeof Reflect?"undefined":i(Reflect))&&Reflect.apply||(Ywe?Zwe.bind(Wwe):function(){return Zwe.apply(Wwe,arguments)}),ebe=vge,tbe=Ape,nbe=xpe(xpe.bind),rbe=function(e,t){return ebe(e),void 0===t?e:tbe?nbe(e,t):function(){return e.apply(t,arguments)}},ibe=zpe("document","documentElement"),obe=xpe([].slice),abe=TypeError,sbe=/(?:ipad|iphone|ipod).*applewebkit/i.test(Ype),ube=ape,lbe=$we,Abe=rbe,cbe=Hpe,hbe=Mge,fbe=upe,dbe=ibe,pbe=obe,gbe=fve,vbe=function(e,t){if(e<t)throw abe("Not enough arguments");return e},ybe=sbe,mbe=Zme,wbe=ube.setImmediate,bbe=ube.clearImmediate,Ibe=ube.process,Bbe=ube.Dispatch,Ebe=ube.Function,Cbe=ube.MessageChannel,xbe=ube.String,kbe=0,Sbe={},Qbe="onreadystatechange";try{Mwe=ube.location}catch(e){}var _be=function(e){if(hbe(Sbe,e)){var t=Sbe[e];delete Sbe[e],t()}},Nbe=function(e){return function(){_be(e)}},Dbe=function(e){_be(e.data)},Fbe=function(e){ube.postMessage(xbe(e),Mwe.protocol+"//"+Mwe.host)};wbe&&bbe||(wbe=function(e){vbe(arguments.length,1);var t=cbe(e)?e:Ebe(e),n=pbe(arguments,1);return Sbe[++kbe]=function(){lbe(t,void 0,n)},Twe(kbe),kbe},bbe=function(e){delete Sbe[e]},mbe?Twe=function(e){Ibe.nextTick(Nbe(e))}:Bbe&&Bbe.now?Twe=function(e){Bbe.now(Nbe(e))}:Cbe&&!ybe?(Owe=(Rwe=new Cbe).port2,Rwe.port1.onmessage=Dbe,Twe=Abe(Owe.postMessage,Owe)):ube.addEventListener&&cbe(ube.postMessage)&&!ube.importScripts&&Mwe&&"file:"!==Mwe.protocol&&!fbe(Fbe)?(Twe=Fbe,ube.addEventListener("message",Dbe,!1)):Twe=Qbe in gbe("script")?function(e){dbe.appendChild(gbe("script")).onreadystatechange=function(){dbe.removeChild(this),_be(e)}}:function(e){setTimeout(Nbe(e),0)});var Pbe,Ube,Lbe,Mbe,Tbe,Rbe,Obe,Hbe,Kbe={set:wbe,clear:bbe},jbe=ape,Gbe=/ipad|iphone|ipod/i.test(Ype)&&void 0!==jbe.Pebble,qbe=/web0s(?!.*chrome)/i.test(Ype),Vbe=ape,zbe=rbe,Jbe=spe.f,Ybe=Kbe.set,Xbe=sbe,Wbe=Gbe,Zbe=qbe,$be=Zme,eIe=Vbe.MutationObserver||Vbe.WebKitMutationObserver,tIe=Vbe.document,nIe=Vbe.process,rIe=Vbe.Promise,iIe=Jbe(Vbe,"queueMicrotask"),oIe=iIe&&iIe.value;oIe||(Pbe=function(){var e,t;for($be&&(e=nIe.domain)&&e.exit();Ube;){t=Ube.fn,Ube=Ube.next;try{t()}catch(e){throw Ube?Mbe():Lbe=void 0,e}}Lbe=void 0,e&&e.enter()},Xbe||$be||Zbe||!eIe||!tIe?!Wbe&&rIe&&rIe.resolve?((Obe=rIe.resolve(void 0)).constructor=rIe,Hbe=zbe(Obe.then,Obe),Mbe=function(){Hbe(Pbe)}):$be?Mbe=function(){nIe.nextTick(Pbe)}:(Ybe=zbe(Ybe,Vbe),Mbe=function(){Ybe(Pbe)}):(Tbe=!0,Rbe=tIe.createTextNode(""),new eIe(Pbe).observe(Rbe,{characterData:!0}),Mbe=function(){Rbe.data=Tbe=!Tbe}));var aIe=oIe||function(e){var t={fn:e,next:void 0};Lbe&&(Lbe.next=t),Ube||(Ube=t,Mbe()),Lbe=t},sIe=ape,uIe=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}},lIe=function(){this.head=null,this.tail=null};lIe.prototype={add:function(e){var t={item:e,next:null};this.head?this.tail.next=t:this.head=t,this.tail=t},get:function(){var e=this.head;if(e)return this.head=e.next,this.tail===e&&(this.tail=null),e.item}};var AIe=lIe,cIe=ape.Promise,hIe="object"==("undefined"==typeof Deno?"undefined":i(Deno))&&Deno&&"object"==i(Deno.version),fIe=!hIe&&!Zme&&"object"==("undefined"==typeof window?"undefined":i(window))&&"object"==("undefined"==typeof document?"undefined":i(document)),dIe=ape,pIe=cIe,gIe=Hpe,vIe=jme,yIe=iye,mIe=$ge,wIe=fIe,bIe=hIe,IIe=nge;pIe&&pIe.prototype;var BIe=mIe("species"),EIe=!1,CIe=gIe(dIe.PromiseRejectionEvent),xIe=vIe("Promise",(function(){var e=yIe(pIe),t=e!==String(pIe);if(!t&&66===IIe)return!0;if(!IIe||IIe<51||!/native code/.test(e)){var n=new pIe((function(e){e(1)})),r=function(e){e((function(){}),(function(){}))};if((n.constructor={})[BIe]=r,!(EIe=n.then((function(){}))instanceof r))return!0}return!t&&(wIe||bIe)&&!CIe})),kIe={CONSTRUCTOR:xIe,REJECTION_EVENT:CIe,SUBCLASSING:EIe},SIe={},QIe=vge,_Ie=function(e){var t,n;this.promise=new e((function(e,r){if(void 0!==t||void 0!==n)throw TypeError("Bad Promise constructor");t=e,n=r})),this.resolve=QIe(t),this.reject=QIe(n)};SIe.f=function(e){return new _Ie(e)};var NIe,DIe,FIe,PIe=Wme,UIe=Zme,LIe=ape,MIe=fpe,TIe=Jye,RIe=owe,OIe=lwe,HIe=function(e){var t=Awe(e),n=cwe.f;hwe&&t&&!t[fwe]&&n(t,fwe,{configurable:!0,get:function(){return this}})},KIe=vge,jIe=Hpe,GIe=jpe,qIe=function(e,t){if(dwe(t,e))return e;throw pwe("Incorrect invocation")},VIe=Jwe,zIe=Kbe.set,JIe=aIe,YIe=function(e,t){var n=sIe.console;n&&n.error&&(1==arguments.length?n.error(e):n.error(e,t))},XIe=uIe,WIe=AIe,ZIe=Nye,$Ie=cIe,eBe=SIe,tBe="Promise",nBe=kIe.CONSTRUCTOR,rBe=kIe.REJECTION_EVENT,iBe=kIe.SUBCLASSING,oBe=ZIe.getterFor(tBe),aBe=ZIe.set,sBe=$Ie&&$Ie.prototype,uBe=$Ie,lBe=sBe,ABe=LIe.TypeError,cBe=LIe.document,hBe=LIe.process,fBe=eBe.f,dBe=fBe,pBe=!!(cBe&&cBe.createEvent&&LIe.dispatchEvent),gBe="unhandledrejection",vBe=function(e){var t;return!(!GIe(e)||!jIe(t=e.then))&&t},yBe=function(e,t){var n,r,i,o=t.value,a=1==t.state,s=a?e.ok:e.fail,u=e.resolve,l=e.reject,A=e.domain;try{s?(a||(2===t.rejection&&BBe(t),t.rejection=1),!0===s?n=o:(A&&A.enter(),n=s(o),A&&(A.exit(),i=!0)),n===e.promise?l(ABe("Promise-chain cycle")):(r=vBe(n))?MIe(r,n,u,l):u(n)):l(o)}catch(e){A&&!i&&A.exit(),l(e)}},mBe=function(e,t){e.notified||(e.notified=!0,JIe((function(){for(var n,r=e.reactions;n=r.get();)yBe(n,e);e.notified=!1,t&&!e.rejection&&bBe(e)})))},wBe=function(e,t,n){var r,i;pBe?((r=cBe.createEvent("Event")).promise=t,r.reason=n,r.initEvent(e,!1,!0),LIe.dispatchEvent(r)):r={promise:t,reason:n},!rBe&&(i=LIe["on"+e])?i(r):e===gBe&&YIe("Unhandled promise rejection",n)},bBe=function(e){MIe(zIe,LIe,(function(){var t,n=e.facade,r=e.value;if(IBe(e)&&(t=XIe((function(){UIe?hBe.emit("unhandledRejection",r,n):wBe(gBe,n,r)})),e.rejection=UIe||IBe(e)?2:1,t.error))throw t.value}))},IBe=function(e){return 1!==e.rejection&&!e.parent},BBe=function(e){MIe(zIe,LIe,(function(){var t=e.facade;UIe?hBe.emit("rejectionHandled",t):wBe("rejectionhandled",t,e.value)}))},EBe=function(e,t,n){return function(r){e(t,r,n)}},CBe=function(e,t,n){e.done||(e.done=!0,n&&(e=n),e.value=t,e.state=2,mBe(e,!0))},xBe=function e(t,n,r){if(!t.done){t.done=!0,r&&(t=r);try{if(t.facade===n)throw ABe("Promise can't be resolved itself");var i=vBe(n);i?JIe((function(){var r={done:!1};try{MIe(i,n,EBe(e,r,t),EBe(CBe,r,t))}catch(e){CBe(r,e,t)}})):(t.value=n,t.state=1,mBe(t,!1))}catch(e){CBe({done:!1},e,t)}}};if(nBe&&(lBe=(uBe=function(e){qIe(this,lBe),KIe(e),MIe(NIe,this);var t=oBe(this);try{e(EBe(xBe,t),EBe(CBe,t))}catch(e){CBe(t,e)}}).prototype,(NIe=function(e){aBe(this,{type:tBe,done:!1,notified:!1,parent:!1,reactions:new WIe,rejection:!1,state:0,value:void 0})}).prototype=TIe(lBe,"then",(function(e,t){var n=oBe(this),r=fBe(VIe(this,uBe));return n.parent=!0,r.ok=!jIe(e)||e,r.fail=jIe(t)&&t,r.domain=UIe?hBe.domain:void 0,0==n.state?n.reactions.add(r):JIe((function(){yBe(r,n)})),r.promise})),DIe=function(){var e=new NIe,t=oBe(e);this.promise=e,this.resolve=EBe(xBe,t),this.reject=EBe(CBe,t)},eBe.f=fBe=function(e){return e===uBe||undefined===e?new DIe(e):dBe(e)},jIe($Ie)&&sBe!==Object.prototype)){FIe=sBe.then,iBe||TIe(sBe,"then",(function(e,t){var n=this;return new uBe((function(e,t){MIe(FIe,n,e,t)})).then(e,t)}),{unsafe:!0});try{delete sBe.constructor}catch(e){}RIe&&RIe(sBe,lBe)}PIe({global:!0,constructor:!0,wrap:!0,forced:nBe},{Promise:uBe}),OIe(uBe,tBe,!1),HIe(tBe);var kBe={},SBe=kBe,QBe=$ge("iterator"),_Be=Array.prototype,NBe=Bwe,DBe=mge,FBe=kBe,PBe=$ge("iterator"),UBe=function(e){if(null!=e)return DBe(e,PBe)||DBe(e,"@@iterator")||FBe[NBe(e)]},LBe=fpe,MBe=vge,TBe=_ve,RBe=fge,OBe=UBe,HBe=TypeError,KBe=fpe,jBe=_ve,GBe=mge,qBe=rbe,VBe=fpe,zBe=_ve,JBe=fge,YBe=function(e){return void 0!==e&&(SBe.Array===e||_Be[QBe]===e)},XBe=lme,WBe=Jpe,ZBe=function(e,t){var n=arguments.length<2?OBe(e):t;if(MBe(n))return TBe(LBe(n,e));throw HBe(RBe(e)+" is not iterable")},$Be=UBe,eEe=function(e,t,n){var r,i;jBe(e);try{if(!(r=GBe(e,"return"))){if("throw"===t)throw n;return n}r=KBe(r,e)}catch(e){i=!0,r=e}if("throw"===t)throw n;if(i)throw r;return jBe(r),n},tEe=TypeError,nEe=function(e,t){this.stopped=e,this.result=t},rEe=nEe.prototype,iEe=function(e,t,n){var r,o,a,s,u,l,A,c=n&&n.that,h=!(!n||!n.AS_ENTRIES),f=!(!n||!n.IS_RECORD),d=!(!n||!n.IS_ITERATOR),p=!(!n||!n.INTERRUPTED),g=qBe(t,c),v=function(e){return r&&eEe(r,"normal",e),new nEe(!0,e)},y=function(e){return h?(zBe(e),p?g(e[0],e[1],v):g(e[0],e[1])):p?g(e,v):g(e)};if(f)r=e.iterator;else if(d)r=e;else{if(!(o=$Be(e)))throw tEe(JBe(e)+" is not iterable");if(YBe(o)){for(a=0,s=XBe(e);s>a;a++)if((u=y(e[a]))&&WBe(rEe,u))return u;return new nEe(!1)}r=ZBe(e,o)}for(l=f?e.next:r.next;!(A=VBe(l,r)).done;){try{u=y(A.value)}catch(e){eEe(r,"throw",e)}if("object"==i(u)&&u&&WBe(rEe,u))return u}return new nEe(!1)},oEe=$ge("iterator"),aEe=!1;try{var sEe=0,uEe={next:function(){return{done:!!sEe++}},return:function(){aEe=!0}};uEe[oEe]=function(){return this},Array.from(uEe,(function(){throw 2}))}catch(e){}var lEe=cIe,AEe=function(e,t){if(!t&&!aEe)return!1;var n=!1;try{var r={};r[oEe]=function(){return{next:function(){return{done:n=!0}}}},e(r)}catch(e){}return n},cEe=kIe.CONSTRUCTOR||!AEe((function(e){lEe.all(e).then(void 0,(function(){}))})),hEe=fpe,fEe=vge,dEe=SIe,pEe=uIe,gEe=iEe;Wme({target:"Promise",stat:!0,forced:cEe},{all:function(e){var t=this,n=dEe.f(t),r=n.resolve,i=n.reject,o=pEe((function(){var n=fEe(t.resolve),o=[],a=0,s=1;gEe(e,(function(e){var u=a++,l=!1;s++,hEe(n,t,e).then((function(e){l||(l=!0,o[u]=e,--s||r(o))}),i)})),--s||r(o)}));return o.error&&i(o.value),n.promise}});var vEe=Wme,yEe=kIe.CONSTRUCTOR,mEe=cIe,wEe=zpe,bEe=Hpe,IEe=Jye,BEe=mEe&&mEe.prototype;if(vEe({target:"Promise",proto:!0,forced:yEe,real:!0},{catch:function(e){return this.then(void 0,e)}}),bEe(mEe)){var EEe=wEe("Promise").prototype.catch;BEe.catch!==EEe&&IEe(BEe,"catch",EEe,{unsafe:!0})}var CEe=fpe,xEe=vge,kEe=SIe,SEe=uIe,QEe=iEe;Wme({target:"Promise",stat:!0,forced:cEe},{race:function(e){var t=this,n=kEe.f(t),r=n.reject,i=SEe((function(){var i=xEe(t.resolve);QEe(e,(function(e){CEe(i,t,e).then(n.resolve,r)}))}));return i.error&&r(i.value),n.promise}});var _Ee=fpe,NEe=SIe;Wme({target:"Promise",stat:!0,forced:kIe.CONSTRUCTOR},{reject:function(e){var t=NEe.f(this);return _Ee(t.reject,void 0,e),t.promise}});var DEe=_ve,FEe=jpe,PEe=SIe,UEe=Wme,LEe=kIe.CONSTRUCTOR,MEe=function(e,t){if(DEe(e),FEe(t)&&t.constructor===e)return t;var n=PEe.f(e);return(0,n.resolve)(t),n.promise};zpe("Promise"),UEe({target:"Promise",stat:!0,forced:LEe},{resolve:function(e){return MEe(this,e)}});var TEe={exports:{}};!function(e){function t(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}e.exports=function(e){return function(){var n=this,r=arguments;return new Promise((function(i,o){var a=e.apply(n,r);function s(e){t(a,i,o,s,u,"next",e)}function u(e){t(a,i,o,s,u,"throw",e)}s(void 0)}))}},e.exports.__esModule=!0,e.exports.default=e.exports}(TEe);var REe=Rt(TEe.exports),OEe=Bwe,HEe=String,KEe=function(e){if("Symbol"===OEe(e))throw TypeError("Cannot convert a Symbol value to a string");return HEe(e)},jEe=_ve,GEe=function(){var e=jEe(this),t="";return e.hasIndices&&(t+="d"),e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.unicodeSets&&(t+="v"),e.sticky&&(t+="y"),t},qEe=upe,VEe=ape.RegExp,zEe=qEe((function(){var e=VEe("a","y");return e.lastIndex=2,null!=e.exec("abcd")})),JEe=zEe||qEe((function(){return!VEe("a","y").sticky})),YEe=zEe||qEe((function(){var e=VEe("^r","gy");return e.lastIndex=2,null!=e.exec("str")})),XEe={BROKEN_CARET:YEe,MISSED_STICKY:JEe,UNSUPPORTED_Y:zEe},WEe={},ZEe=wme,$Ee=bme,eCe=Object.keys||function(e){return ZEe(e,$Ee)},tCe=lpe,nCe=xve,rCe=Cve,iCe=_ve,oCe=Ope,aCe=eCe;WEe.f=tCe&&!nCe?Object.defineProperties:function(e,t){iCe(e);for(var n,r=oCe(t),i=aCe(t),o=i.length,a=0;o>a;)rCe.f(e,n=i[a++],r[n]);return e};var sCe,uCe=_ve,lCe=WEe,ACe=bme,cCe=fye,hCe=ibe,fCe=fve,dCe=hye("IE_PROTO"),pCe=function(){},gCe=function(e){return"<script>"+e+"</"+"script>"},vCe=function(e){e.write(gCe("")),e.close();var t=e.parentWindow.Object;return e=null,t},yCe=function(){try{sCe=new ActiveXObject("htmlfile")}catch(e){}var e,t;yCe="undefined"!=typeof document?document.domain&&sCe?vCe(sCe):((t=fCe("iframe")).style.display="none",hCe.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(gCe("document.F=Object")),e.close(),e.F):vCe(sCe);for(var n=ACe.length;n--;)delete yCe.prototype[ACe[n]];return yCe()};cCe[dCe]=!0;var mCe,wCe,bCe=Object.create||function(e,t){var n;return null!==e?(pCe.prototype=uCe(e),n=new pCe,pCe.prototype=null,n[dCe]=e):n=yCe(),void 0===t?n:lCe.f(n,t)},ICe=upe,BCe=ape.RegExp,ECe=ICe((function(){var e=BCe(".","s");return!(e.dotAll&&e.exec("\n")&&"s"===e.flags)})),CCe=upe,xCe=ape.RegExp,kCe=CCe((function(){var e=xCe("(?<a>b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$<a>c")})),SCe=fpe,QCe=xpe,_Ce=KEe,NCe=GEe,DCe=XEe,FCe=Ege.exports,PCe=bCe,UCe=Nye.get,LCe=ECe,MCe=kCe,TCe=FCe("native-string-replace",String.prototype.replace),RCe=RegExp.prototype.exec,OCe=RCe,HCe=QCe("".charAt),KCe=QCe("".indexOf),jCe=QCe("".replace),GCe=QCe("".slice),qCe=(wCe=/b*/g,SCe(RCe,mCe=/a/,"a"),SCe(RCe,wCe,"a"),0!==mCe.lastIndex||0!==wCe.lastIndex),VCe=DCe.BROKEN_CARET,zCe=void 0!==/()??/.exec("")[1];(qCe||zCe||VCe||LCe||MCe)&&(OCe=function(e){var t,n,r,i,o,a,s,u=this,l=UCe(u),A=_Ce(e),c=l.raw;if(c)return c.lastIndex=u.lastIndex,t=SCe(OCe,c,A),u.lastIndex=c.lastIndex,t;var h=l.groups,f=VCe&&u.sticky,d=SCe(NCe,u),p=u.source,g=0,v=A;if(f&&(d=jCe(d,"y",""),-1===KCe(d,"g")&&(d+="g"),v=GCe(A,u.lastIndex),u.lastIndex>0&&(!u.multiline||u.multiline&&"\n"!==HCe(A,u.lastIndex-1))&&(p="(?: "+p+")",v=" "+v,g++),n=new RegExp("^(?:"+p+")",d)),zCe&&(n=new RegExp("^"+p+"$(?!\\s)",d)),qCe&&(r=u.lastIndex),i=SCe(RCe,f?n:u,v),f?i?(i.input=GCe(i.input,g),i[0]=GCe(i[0],g),i.index=u.lastIndex,u.lastIndex+=i[0].length):u.lastIndex=0:qCe&&i&&(u.lastIndex=u.global?i.index+i[0].length:r),zCe&&i&&i.length>1&&SCe(TCe,i[0],n,(function(){for(o=1;o<arguments.length-2;o++)void 0===arguments[o]&&(i[o]=void 0)})),i&&h)for(i.groups=a=PCe(null),o=0;o<h.length;o++)a[(s=h[o])[0]]=i[s[1]];return i});var JCe=OCe;Wme({target:"RegExp",proto:!0,forced:/./.exec!==JCe},{exec:JCe});var YCe=xpe,XCe=Jye,WCe=JCe,ZCe=upe,$Ce=$ge,exe=Gve,txe=$Ce("species"),nxe=RegExp.prototype,rxe=function(e,t,n,r){var i=$Ce(e),o=!ZCe((function(){var t={};return t[i]=function(){return 7},7!=""[e](t)})),a=o&&!ZCe((function(){var t=!1,n=/a/;return"split"===e&&((n={}).constructor={},n.constructor[txe]=function(){return n},n.flags="",n[i]=/./[i]),n.exec=function(){return t=!0,null},n[i](""),!t}));if(!o||!a||n){var s=YCe(/./[i]),u=t(i,""[e],(function(e,t,n,r,i){var a=YCe(e),u=t.exec;return u===WCe||u===nxe.exec?o&&!i?{done:!0,value:s(t,n,r)}:{done:!0,value:a(n,t,r)}:{done:!1}}));XCe(String.prototype,e,u[0]),XCe(nxe,i,u[1])}r&&exe(nxe[i],"sham",!0)},ixe=xpe,oxe=eme,axe=KEe,sxe=Mpe,uxe=ixe("".charAt),lxe=ixe("".charCodeAt),Axe=ixe("".slice),cxe=function(e){return function(t,n){var r,i,o=axe(sxe(t)),a=oxe(n),s=o.length;return a<0||a>=s?e?"":void 0:(r=lxe(o,a))<55296||r>56319||a+1===s||(i=lxe(o,a+1))<56320||i>57343?e?uxe(o,a):r:e?Axe(o,a,a+2):i-56320+(r-55296<<10)+65536}},hxe={codeAt:cxe(!1),charAt:cxe(!0)}.charAt,fxe=function(e,t,n){return t+(n?hxe(e,t).length:1)},dxe=fpe,pxe=_ve,gxe=Hpe,vxe=_pe,yxe=JCe,mxe=TypeError,wxe=function(e,t){var n=e.exec;if(gxe(n)){var r=dxe(n,e,t);return null!==r&&pxe(r),r}if("RegExp"===vxe(e))return dxe(yxe,e,t);throw mxe("RegExp#exec called on incompatible receiver")},bxe=fpe,Ixe=_ve,Bxe=sme,Exe=KEe,Cxe=Mpe,xxe=mge,kxe=fxe,Sxe=wxe;rxe("match",(function(e,t,n){return[function(t){var n=Cxe(this),r=null==t?void 0:xxe(t,e);return r?bxe(r,t,n):new RegExp(t)[e](Exe(n))},function(e){var r=Ixe(this),i=Exe(e),o=n(t,r,i);if(o.done)return o.value;if(!r.global)return Sxe(r,i);var a=r.unicode;r.lastIndex=0;for(var s,u=[],l=0;null!==(s=Sxe(r,i));){var A=Exe(s[0]);u[l]=A,""===A&&(r.lastIndex=kxe(i,Bxe(r.lastIndex),a)),l++}return 0===l?null:u}]}));var Qxe=xpe,_xe=Pge,Nxe=Math.floor,Dxe=Qxe("".charAt),Fxe=Qxe("".replace),Pxe=Qxe("".slice),Uxe=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,Lxe=/\$([$&'`]|\d{1,2})/g,Mxe=$we,Txe=fpe,Rxe=xpe,Oxe=rxe,Hxe=upe,Kxe=_ve,jxe=Hpe,Gxe=eme,qxe=sme,Vxe=KEe,zxe=Mpe,Jxe=fxe,Yxe=mge,Xxe=function(e,t,n,r,i,o){var a=n+e.length,s=r.length,u=Lxe;return void 0!==i&&(i=_xe(i),u=Uxe),Fxe(o,u,(function(o,u){var l;switch(Dxe(u,0)){case"$":return"$";case"&":return e;case"`":return Pxe(t,0,n);case"'":return Pxe(t,a);case"<":l=i[Pxe(u,1,-1)];break;default:var A=+u;if(0===A)return o;if(A>s){var c=Nxe(A/10);return 0===c?o:c<=s?void 0===r[c-1]?Dxe(u,1):r[c-1]+Dxe(u,1):o}l=r[A-1]}return void 0===l?"":l}))},Wxe=wxe,Zxe=$ge("replace"),$xe=Math.max,eke=Math.min,tke=Rxe([].concat),nke=Rxe([].push),rke=Rxe("".indexOf),ike=Rxe("".slice),oke=function(e){return void 0===e?e:String(e)},ake="$0"==="a".replace(/./,"$0"),ske=!!/./[Zxe]&&""===/./[Zxe]("a","$0"),uke=!Hxe((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")}));Oxe("replace",(function(e,t,n){var r=ske?"$":"$0";return[function(e,n){var r=zxe(this),i=null==e?void 0:Yxe(e,Zxe);return i?Txe(i,e,r,n):Txe(t,Vxe(r),e,n)},function(e,i){var o=Kxe(this),a=Vxe(e);if("string"==typeof i&&-1===rke(i,r)&&-1===rke(i,"$<")){var s=n(t,o,a,i);if(s.done)return s.value}var u=jxe(i);u||(i=Vxe(i));var l=o.global;if(l){var A=o.unicode;o.lastIndex=0}for(var c=[];;){var h=Wxe(o,a);if(null===h)break;if(nke(c,h),!l)break;""===Vxe(h[0])&&(o.lastIndex=Jxe(a,qxe(o.lastIndex),A))}for(var f="",d=0,p=0;p<c.length;p++){for(var g=Vxe((h=c[p])[0]),v=$xe(eke(Gxe(h.index),a.length),0),y=[],m=1;m<h.length;m++)nke(y,oke(h[m]));var w=h.groups;if(u){var b=tke([g],y,v,a);void 0!==w&&nke(b,w);var I=Vxe(Mxe(i,void 0,b))}else I=Xxe(g,a,v,y,w,i);v>=d&&(f+=ike(a,d,v)+I,d=v+g.length)}return f+ike(a,d)}]}),!uke||!ake||ske);var lke,Ake=jpe,cke=_pe,hke=$ge("match"),fke=function(e){var t;return Ake(e)&&(void 0!==(t=e[hke])?!!t:"RegExp"==cke(e))},dke=fke,pke=TypeError,gke=function(e){if(dke(e))throw pke("The method doesn't accept regular expressions");return e},vke=$ge("match"),yke=function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[vke]=!1,"/./"[e](t)}catch(e){}}return!1},mke=Wme,wke=xpe,bke=spe.f,Ike=sme,Bke=KEe,Eke=gke,Cke=Mpe,xke=yke,kke=wke("".startsWith),Ske=wke("".slice),Qke=Math.min,_ke=xke("startsWith");mke({target:"String",proto:!0,forced:!!(_ke||(lke=bke(String.prototype,"startsWith"),!lke||lke.writable))&&!_ke},{startsWith:function(e){var t=Bke(Cke(this));Eke(e);var n=Ike(Qke(arguments.length>1?arguments[1]:void 0,t.length)),r=Bke(e);return kke?kke(t,r,n):Ske(t,n,n+r.length)===r}});var Nke=$ge,Dke=bCe,Fke=Cve.f,Pke=Nke("unscopables"),Uke=Array.prototype;null==Uke[Pke]&&Fke(Uke,Pke,{configurable:!0,value:Dke(null)});var Lke,Mke,Tke,Rke=!upe((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),Oke=Mge,Hke=Hpe,Kke=Pge,jke=Rke,Gke=hye("IE_PROTO"),qke=Object,Vke=qke.prototype,zke=jke?qke.getPrototypeOf:function(e){var t=Kke(e);if(Oke(t,Gke))return t[Gke];var n=t.constructor;return Hke(n)&&t instanceof n?n.prototype:t instanceof qke?Vke:null},Jke=upe,Yke=Hpe,Xke=zke,Wke=Jye,Zke=$ge("iterator"),$ke=!1;[].keys&&("next"in(Tke=[].keys())?(Mke=Xke(Xke(Tke)))!==Object.prototype&&(Lke=Mke):$ke=!0);var eSe=null==Lke||Jke((function(){var e={};return Lke[Zke].call(e)!==e}));eSe&&(Lke={}),Yke(Lke[Zke])||Wke(Lke,Zke,(function(){return this}));var tSe={IteratorPrototype:Lke,BUGGY_SAFARI_ITERATORS:$ke},nSe=tSe.IteratorPrototype,rSe=bCe,iSe=wpe,oSe=lwe,aSe=kBe,sSe=function(){return this},uSe=Wme,lSe=fpe,ASe=Hpe,cSe=function(e,t,n,r){var i=t+" Iterator";return e.prototype=rSe(nSe,{next:iSe(+!r,n)}),oSe(e,i,!1),aSe[i]=sSe,e},hSe=zke,fSe=owe,dSe=lwe,pSe=Gve,gSe=Jye,vSe=kBe,ySe=Wve.PROPER,mSe=Wve.CONFIGURABLE,wSe=tSe.IteratorPrototype,bSe=tSe.BUGGY_SAFARI_ITERATORS,ISe=$ge("iterator"),BSe="keys",ESe="values",CSe="entries",xSe=function(){return this},kSe=Ope,SSe=function(e){Uke[Pke][e]=!0},QSe=kBe,_Se=Nye,NSe=Cve.f,DSe=function(e,t,n,r,i,o,a){cSe(n,t,r);var s,u,l,A=function(e){if(e===i&&p)return p;if(!bSe&&e in f)return f[e];switch(e){case BSe:case ESe:case CSe:return function(){return new n(this,e)}}return function(){return new n(this)}},c=t+" Iterator",h=!1,f=e.prototype,d=f[ISe]||f["@@iterator"]||i&&f[i],p=!bSe&&d||A(i),g="Array"==t&&f.entries||d;if(g&&(s=hSe(g.call(new e)))!==Object.prototype&&s.next&&(hSe(s)!==wSe&&(fSe?fSe(s,wSe):ASe(s[ISe])||gSe(s,ISe,xSe)),dSe(s,c,!0)),ySe&&i==ESe&&d&&d.name!==ESe&&(mSe?pSe(f,"name",ESe):(h=!0,p=function(){return lSe(d,this)})),i)if(u={values:A(ESe),keys:o?p:A(BSe),entries:A(CSe)},a)for(l in u)(bSe||h||!(l in f))&&gSe(f,l,u[l]);else uSe({target:t,proto:!0,forced:bSe||h},u);return f[ISe]!==p&&gSe(f,ISe,p,{name:i}),vSe[t]=p,u},FSe=lpe,PSe="Array Iterator",USe=_Se.set,LSe=_Se.getterFor(PSe),MSe=DSe(Array,"Array",(function(e,t){USe(this,{type:PSe,target:kSe(e),index:0,kind:t})}),(function(){var e=LSe(this),t=e.target,n=e.kind,r=e.index++;return!t||r>=t.length?(e.target=void 0,{value:void 0,done:!0}):"keys"==n?{value:r,done:!1}:"values"==n?{value:t[r],done:!1}:{value:[r,t[r]],done:!1}}),"values"),TSe=QSe.Arguments=QSe.Array;if(SSe("keys"),SSe("values"),SSe("entries"),FSe&&"values"!==TSe.name)try{NSe(TSe,"name",{value:"values"})}catch(e){}var RSe=fve("span").classList,OSe=RSe&&RSe.constructor&&RSe.constructor.prototype,HSe=OSe===Object.prototype?void 0:OSe,KSe=ape,jSe={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},GSe=HSe,qSe=MSe,VSe=Gve,zSe=$ge,JSe=zSe("iterator"),YSe=zSe("toStringTag"),XSe=qSe.values,WSe=function(e,t){if(e){if(e[JSe]!==XSe)try{VSe(e,JSe,XSe)}catch(t){e[JSe]=XSe}if(e[YSe]||VSe(e,YSe,t),jSe[t])for(var n in qSe)if(e[n]!==qSe[n])try{VSe(e,n,qSe[n])}catch(t){e[n]=qSe[n]}}};for(var ZSe in jSe)WSe(KSe[ZSe]&&KSe[ZSe].prototype,ZSe);WSe(GSe,"DOMTokenList");var $Se={exports:{}};!function(e){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},e.exports.__esModule=!0,e.exports.default=e.exports}($Se);var eQe=Rt($Se.exports),tQe=vge,nQe=Pge,rQe=Upe,iQe=lme,oQe=TypeError,aQe=function(e){return function(t,n,r,i){tQe(n);var o=nQe(t),a=rQe(o),s=iQe(o),u=e?s-1:0,l=e?-1:1;if(r<2)for(;;){if(u in a){i=a[u],u+=l;break}if(u+=l,e?u<0:s<=u)throw oQe("Reduce of empty array with no initial value")}for(;e?u>=0:s>u;u+=l)u in a&&(i=n(i,a[u],u,o));return i}},sQe={left:aQe(!1),right:aQe(!0)},uQe=upe,lQe=function(e,t){var n=[][e];return!!n&&uQe((function(){n.call(null,t||function(){return 1},1)}))},AQe=sQe.left,cQe=nge,hQe=Zme;Wme({target:"Array",proto:!0,forced:!lQe("reduce")||!hQe&&cQe>79&&cQe<83},{reduce:function(e){var t=arguments.length;return AQe(this,e,t,t>1?arguments[1]:void 0)}});var fQe=Wme,dQe=xpe,pQe=spe.f,gQe=sme,vQe=KEe,yQe=gke,mQe=Mpe,wQe=yke,bQe=dQe("".endsWith),IQe=dQe("".slice),BQe=Math.min,EQe=wQe("endsWith"),CQe=!EQe&&!!function(){var e=pQe(String.prototype,"endsWith");return e&&!e.writable}();fQe({target:"String",proto:!0,forced:!CQe&&!EQe},{endsWith:function(e){var t=vQe(mQe(this));yQe(e);var n=arguments.length>1?arguments[1]:void 0,r=t.length,i=void 0===n?r:BQe(gQe(n),r),o=vQe(e);return bQe?bQe(t,o,i):IQe(t,i-o.length,i)===o}});var xQe=lve,kQe=Cve,SQe=wpe,QQe=ime,_Qe=lme,NQe=function(e,t,n){var r=xQe(t);r in e?kQe.f(e,r,SQe(0,n)):e[r]=n},DQe=Array,FQe=Math.max,PQe=$we,UQe=fpe,LQe=xpe,MQe=rxe,TQe=fke,RQe=_ve,OQe=Mpe,HQe=Jwe,KQe=fxe,jQe=sme,GQe=KEe,qQe=mge,VQe=function(e,t,n){for(var r=_Qe(e),i=QQe(t,r),o=QQe(void 0===n?r:n,r),a=DQe(FQe(o-i,0)),s=0;i<o;i++,s++)NQe(a,s,e[i]);return a.length=s,a},zQe=wxe,JQe=JCe,YQe=upe,XQe=XEe.UNSUPPORTED_Y,WQe=4294967295,ZQe=Math.min,$Qe=[].push,e_e=LQe(/./.exec),t_e=LQe($Qe),n_e=LQe("".slice),r_e=!YQe((function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var n="ab".split(e);return 2!==n.length||"a"!==n[0]||"b"!==n[1]}));MQe("split",(function(e,t,n){var r;return r="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(e,n){var r=GQe(OQe(this)),i=void 0===n?WQe:n>>>0;if(0===i)return[];if(void 0===e)return[r];if(!TQe(e))return UQe(t,r,e,i);for(var o,a,s,u=[],l=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),A=0,c=new RegExp(e.source,l+"g");(o=UQe(JQe,c,r))&&!((a=c.lastIndex)>A&&(t_e(u,n_e(r,A,o.index)),o.length>1&&o.index<r.length&&PQe($Qe,u,VQe(o,1)),s=o[0].length,A=a,u.length>=i));)c.lastIndex===o.index&&c.lastIndex++;return A===r.length?!s&&e_e(c,"")||t_e(u,""):t_e(u,n_e(r,A)),u.length>i?VQe(u,0,i):u}:"0".split(void 0,0).length?function(e,n){return void 0===e&&0===n?[]:UQe(t,this,e,n)}:t,[function(t,n){var i=OQe(this),o=null==t?void 0:qQe(t,e);return o?UQe(o,t,i,n):UQe(r,GQe(i),t,n)},function(e,i){var o=RQe(this),a=GQe(e),s=n(r,o,a,i,r!==t);if(s.done)return s.value;var u=HQe(o,RegExp),l=o.unicode,A=(o.ignoreCase?"i":"")+(o.multiline?"m":"")+(o.unicode?"u":"")+(XQe?"g":"y"),c=new u(XQe?"^(?:"+o.source+")":o,A),h=void 0===i?WQe:i>>>0;if(0===h)return[];if(0===a.length)return null===zQe(c,a)?[a]:[];for(var f=0,d=0,p=[];d<a.length;){c.lastIndex=XQe?0:d;var g,v=zQe(c,XQe?n_e(a,d):a);if(null===v||(g=ZQe(jQe(c.lastIndex+(XQe?d:0)),a.length))===f)d=KQe(a,d,l);else{if(t_e(p,n_e(a,f,d)),p.length===h)return p;for(var y=1;y<=v.length-1;y++)if(t_e(p,v[y]),p.length===h)return p;d=f=g}}return t_e(p,n_e(a,f)),p}]}),!r_e,XQe);var i_e={exports:{}},o_e={exports:{}};(function(){var e,t,n,r,i,o;"undefined"!=typeof performance&&null!==performance&&performance.now?o_e.exports=function(){return performance.now()}:"undefined"!=typeof process&&null!==process&&process.hrtime?(o_e.exports=function(){return(e()-i)/1e6},t=process.hrtime,e=function(){var e;return 1e9*(e=t())[0]+e[1]},r=e(),o=1e9*process.uptime(),i=r-o):Date.now?(o_e.exports=function(){return Date.now()-n},n=Date.now()):(o_e.exports=function(){return(new Date).getTime()-n},n=(new Date).getTime())}).call(Tt);for(var a_e=o_e.exports,s_e="undefined"==typeof window?Tt:window,u_e=["moz","webkit"],l_e="AnimationFrame",A_e=s_e["request"+l_e],c_e=s_e["cancel"+l_e]||s_e["cancelRequest"+l_e],h_e=0;!A_e&&h_e<u_e.length;h_e++)A_e=s_e[u_e[h_e]+"Request"+l_e],c_e=s_e[u_e[h_e]+"Cancel"+l_e]||s_e[u_e[h_e]+"CancelRequest"+l_e];if(!A_e||!c_e){var f_e=0,d_e=0,p_e=[];A_e=function(e){if(0===p_e.length){var t=a_e(),n=Math.max(0,16.666666666666668-(t-f_e));f_e=n+t,setTimeout((function(){var e=p_e.slice(0);p_e.length=0;for(var t=0;t<e.length;t++)if(!e[t].cancelled)try{e[t].callback(f_e)}catch(e){setTimeout((function(){throw e}),0)}}),Math.round(n))}return p_e.push({handle:++d_e,callback:e,cancelled:!1}),d_e},c_e=function(e){for(var t=0;t<p_e.length;t++)p_e[t].handle===e&&(p_e[t].cancelled=!0)}}i_e.exports=function(e){return A_e.call(s_e,e)},i_e.exports.cancel=function(){c_e.apply(s_e,arguments)},i_e.exports.polyfill=function(e){e||(e=s_e),e.requestAnimationFrame=A_e,e.cancelAnimationFrame=c_e};var g_e="\t\n\v\f\r                 \u2028\u2029\ufeff",v_e=Mpe,y_e=KEe,m_e=xpe("".replace),w_e="[\t\n\v\f\r                 \u2028\u2029\ufeff]",b_e=RegExp("^"+w_e+w_e+"*"),I_e=RegExp(w_e+w_e+"*$"),B_e=function(e){return function(t){var n=y_e(v_e(t));return 1&e&&(n=m_e(n,b_e,"")),2&e&&(n=m_e(n,I_e,"")),n}},E_e={start:B_e(1),end:B_e(2),trim:B_e(3)},C_e=Wve.PROPER,x_e=upe,k_e=g_e,S_e=E_e.trim;Wme({target:"String",proto:!0,forced:function(e){return x_e((function(){return!!k_e[e]()||"​…᠎"!=="​…᠎"[e]()||C_e&&k_e[e].name!==e}))}("trim")},{trim:function(){return S_e(this)}});var Q_e=function(e){this.ok=!1,this.alpha=1,"#"==e.charAt(0)&&(e=e.substr(1,6)),e=(e=e.replace(/ /g,"")).toLowerCase();var t={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dodgerblue:"1e90ff",feldspar:"d19275",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslateblue:"8470ff",lightslategray:"778899",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370d8",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"d87093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"ff0000",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",violetred:"d02090",wheat:"f5deb3",white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32"};e=t[e]||e;for(var n=[{re:/^rgba\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3}),\s*((?:\d?\.)?\d)\)$/,example:["rgba(123, 234, 45, 0.8)","rgba(255,234,245,1.0)"],process:function(e){return[parseInt(e[1]),parseInt(e[2]),parseInt(e[3]),parseFloat(e[4])]}},{re:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,example:["rgb(123, 234, 45)","rgb(255,234,245)"],process:function(e){return[parseInt(e[1]),parseInt(e[2]),parseInt(e[3])]}},{re:/^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,example:["#00ff00","336699"],process:function(e){return[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16)]}},{re:/^([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,example:["#fb0","f0f"],process:function(e){return[parseInt(e[1]+e[1],16),parseInt(e[2]+e[2],16),parseInt(e[3]+e[3],16)]}}],r=0;r<n.length;r++){var i=n[r].re,o=n[r].process,a=i.exec(e);if(a){var s=o(a);this.r=s[0],this.g=s[1],this.b=s[2],s.length>3&&(this.alpha=s[3]),this.ok=!0}}this.r=this.r<0||isNaN(this.r)?0:this.r>255?255:this.r,this.g=this.g<0||isNaN(this.g)?0:this.g>255?255:this.g,this.b=this.b<0||isNaN(this.b)?0:this.b>255?255:this.b,this.alpha=this.alpha<0?0:this.alpha>1||isNaN(this.alpha)?1:this.alpha,this.toRGB=function(){return"rgb("+this.r+", "+this.g+", "+this.b+")"},this.toRGBA=function(){return"rgba("+this.r+", "+this.g+", "+this.b+", "+this.alpha+")"},this.toHex=function(){var e=this.r.toString(16),t=this.g.toString(16),n=this.b.toString(16);return 1==e.length&&(e="0"+e),1==t.length&&(t="0"+t),1==n.length&&(n="0"+n),"#"+e+t+n},this.getHelpXML=function(){for(var e=new Array,r=0;r<n.length;r++)for(var i=n[r].example,o=0;o<i.length;o++)e[e.length]=i[o];for(var a in t)e[e.length]=a;var s=document.createElement("ul");s.setAttribute("id","rgbcolor-examples");for(r=0;r<e.length;r++)try{var u=document.createElement("li"),l=new RGBColor(e[r]),A=document.createElement("div");A.style.cssText="margin: 3px; border: 1px solid black; background:"+l.toHex()+"; color:"+l.toHex(),A.appendChild(document.createTextNode("test"));var c=document.createTextNode(" "+e[r]+" -> "+l.toRGB()+" -> "+l.toHex());u.appendChild(A),u.appendChild(c),s.appendChild(u)}catch(e){}return s}},__e=Wme,N_e=dme.indexOf,D_e=lQe,F_e=xpe([].indexOf),P_e=!!F_e&&1/F_e([1],1,-0)<0,U_e=D_e("indexOf");__e({target:"Array",proto:!0,forced:P_e||!U_e},{indexOf:function(e){var t=arguments.length>1?arguments[1]:void 0;return P_e?F_e(this,e,t)||0:N_e(this,e,t)}});var L_e=Wme,M_e=gke,T_e=Mpe,R_e=KEe,O_e=yke,H_e=xpe("".indexOf);L_e({target:"String",proto:!0,forced:!O_e("includes")},{includes:function(e){return!!~H_e(R_e(T_e(this)),R_e(M_e(e)),arguments.length>1?arguments[1]:void 0)}});var K_e=_pe,j_e=Wme,G_e=Array.isArray||function(e){return"Array"==K_e(e)},q_e=xpe([].reverse),V_e=[1,2];j_e({target:"Array",proto:!0,forced:String(V_e)===String(V_e.reverse())},{reverse:function(){return G_e(this)&&(this.length=this.length),q_e(this)}});
787
787
  /*! *****************************************************************************
788
788
  Copyright (c) Microsoft Corporation.
789
789
 
@@ -798,7 +798,7 @@ var _fe,Nfe,Dfe,Ffe=function(e){return function(e){return e.__litDirective=!0,e}
798
798
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
799
799
  PERFORMANCE OF THIS SOFTWARE.
800
800
  ***************************************************************************** */
801
- var V_e=function(e,t){return(V_e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function z_e(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}V_e(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function J_e(e,t){var n=e[0],r=e[1];return[n*Math.cos(t)-r*Math.sin(t),n*Math.sin(t)+r*Math.cos(t)]}function Y_e(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n=0;n<e.length;n++)if("number"!=typeof e[n])throw new Error("assertNumbers arguments["+n+"] is not a number. "+i(e[n])+" == typeof "+e[n]);return!0}var X_e=Math.PI;function W_e(e,t,n){e.lArcFlag=0===e.lArcFlag?0:1,e.sweepFlag=0===e.sweepFlag?0:1;var r=e.rX,i=e.rY,o=e.x,a=e.y;r=Math.abs(e.rX),i=Math.abs(e.rY);var s=J_e([(t-o)/2,(n-a)/2],-e.xRot/180*X_e),u=s[0],l=s[1],A=Math.pow(u,2)/Math.pow(r,2)+Math.pow(l,2)/Math.pow(i,2);1<A&&(r*=Math.sqrt(A),i*=Math.sqrt(A)),e.rX=r,e.rY=i;var c=Math.pow(r,2)*Math.pow(l,2)+Math.pow(i,2)*Math.pow(u,2),h=(e.lArcFlag!==e.sweepFlag?1:-1)*Math.sqrt(Math.max(0,(Math.pow(r,2)*Math.pow(i,2)-c)/c)),f=r*l/i*h,d=-i*u/r*h,p=J_e([f,d],e.xRot/180*X_e);e.cX=p[0]+(t+o)/2,e.cY=p[1]+(n+a)/2,e.phi1=Math.atan2((l-d)/i,(u-f)/r),e.phi2=Math.atan2((-l-d)/i,(-u-f)/r),0===e.sweepFlag&&e.phi2>e.phi1&&(e.phi2-=2*X_e),1===e.sweepFlag&&e.phi2<e.phi1&&(e.phi2+=2*X_e),e.phi1*=180/X_e,e.phi2*=180/X_e}function Z_e(e,t,n){Y_e(e,t,n);var r=e*e+t*t-n*n;if(0>r)return[];if(0===r)return[[e*n/(e*e+t*t),t*n/(e*e+t*t)]];var i=Math.sqrt(r);return[[(e*n+t*i)/(e*e+t*t),(t*n-e*i)/(e*e+t*t)],[(e*n-t*i)/(e*e+t*t),(t*n+e*i)/(e*e+t*t)]]}var $_e,eNe=Math.PI/180;function tNe(e,t,n){return(1-n)*e+n*t}function nNe(e,t,n,r){return e+Math.cos(r/180*X_e)*t+Math.sin(r/180*X_e)*n}function rNe(e,t,n,r){var i=1e-6,o=t-e,a=n-t,s=3*o+3*(r-n)-6*a,u=6*(a-o),l=3*o;return Math.abs(s)<i?[-l/u]:function(e,t,n){void 0===n&&(n=1e-6);var r=e*e/4-t;if(r<-n)return[];if(r<=n)return[-e/2];var i=Math.sqrt(r);return[-e/2-i,-e/2+i]}(u/s,l/s,i)}function iNe(e,t,n,r,i){var o=1-i;return e*(o*o*o)+t*(3*o*o*i)+n*(3*o*i*i)+r*(i*i*i)}!function(e){function t(){return i((function(e,t,n){return e.relative&&(void 0!==e.x1&&(e.x1+=t),void 0!==e.y1&&(e.y1+=n),void 0!==e.x2&&(e.x2+=t),void 0!==e.y2&&(e.y2+=n),void 0!==e.x&&(e.x+=t),void 0!==e.y&&(e.y+=n),e.relative=!1),e}))}function n(){var e=NaN,t=NaN,n=NaN,r=NaN;return i((function(i,o,a){return i.type&ANe.SMOOTH_CURVE_TO&&(i.type=ANe.CURVE_TO,e=isNaN(e)?o:e,t=isNaN(t)?a:t,i.x1=i.relative?o-e:2*o-e,i.y1=i.relative?a-t:2*a-t),i.type&ANe.CURVE_TO?(e=i.relative?o+i.x2:i.x2,t=i.relative?a+i.y2:i.y2):(e=NaN,t=NaN),i.type&ANe.SMOOTH_QUAD_TO&&(i.type=ANe.QUAD_TO,n=isNaN(n)?o:n,r=isNaN(r)?a:r,i.x1=i.relative?o-n:2*o-n,i.y1=i.relative?a-r:2*a-r),i.type&ANe.QUAD_TO?(n=i.relative?o+i.x1:i.x1,r=i.relative?a+i.y1:i.y1):(n=NaN,r=NaN),i}))}function r(){var e=NaN,t=NaN;return i((function(n,r,i){if(n.type&ANe.SMOOTH_QUAD_TO&&(n.type=ANe.QUAD_TO,e=isNaN(e)?r:e,t=isNaN(t)?i:t,n.x1=n.relative?r-e:2*r-e,n.y1=n.relative?i-t:2*i-t),n.type&ANe.QUAD_TO){e=n.relative?r+n.x1:n.x1,t=n.relative?i+n.y1:n.y1;var o=n.x1,a=n.y1;n.type=ANe.CURVE_TO,n.x1=((n.relative?0:r)+2*o)/3,n.y1=((n.relative?0:i)+2*a)/3,n.x2=(n.x+2*o)/3,n.y2=(n.y+2*a)/3}else e=NaN,t=NaN;return n}))}function i(e){var t=0,n=0,r=NaN,i=NaN;return function(o){if(isNaN(r)&&!(o.type&ANe.MOVE_TO))throw new Error("path must start with moveto");var a=e(o,t,n,r,i);return o.type&ANe.CLOSE_PATH&&(t=r,n=i),void 0!==o.x&&(t=o.relative?t+o.x:o.x),void 0!==o.y&&(n=o.relative?n+o.y:o.y),o.type&ANe.MOVE_TO&&(r=t,i=n),a}}function o(e,t,n,r,o,a){return Y_e(e,t,n,r,o,a),i((function(i,s,u,l){var A=i.x1,c=i.x2,h=i.relative&&!isNaN(l),f=void 0!==i.x?i.x:h?0:s,d=void 0!==i.y?i.y:h?0:u;function p(e){return e*e}i.type&ANe.HORIZ_LINE_TO&&0!==t&&(i.type=ANe.LINE_TO,i.y=i.relative?0:u),i.type&ANe.VERT_LINE_TO&&0!==n&&(i.type=ANe.LINE_TO,i.x=i.relative?0:s),void 0!==i.x&&(i.x=i.x*e+d*n+(h?0:o)),void 0!==i.y&&(i.y=f*t+i.y*r+(h?0:a)),void 0!==i.x1&&(i.x1=i.x1*e+i.y1*n+(h?0:o)),void 0!==i.y1&&(i.y1=A*t+i.y1*r+(h?0:a)),void 0!==i.x2&&(i.x2=i.x2*e+i.y2*n+(h?0:o)),void 0!==i.y2&&(i.y2=c*t+i.y2*r+(h?0:a));var g=e*r-t*n;if(void 0!==i.xRot&&(1!==e||0!==t||0!==n||1!==r))if(0===g)delete i.rX,delete i.rY,delete i.xRot,delete i.lArcFlag,delete i.sweepFlag,i.type=ANe.LINE_TO;else{var v=i.xRot*Math.PI/180,y=Math.sin(v),m=Math.cos(v),w=1/p(i.rX),b=1/p(i.rY),I=p(m)*w+p(y)*b,B=2*y*m*(w-b),E=p(y)*w+p(m)*b,C=I*r*r-B*t*r+E*t*t,x=B*(e*r+t*n)-2*(I*n*r+E*e*t),k=I*n*n-B*e*n+E*e*e,S=(Math.atan2(x,C-k)+Math.PI)%Math.PI/2,Q=Math.sin(S),_=Math.cos(S);i.rX=Math.abs(g)/Math.sqrt(C*p(_)+x*Q*_+k*p(Q)),i.rY=Math.abs(g)/Math.sqrt(C*p(Q)-x*Q*_+k*p(_)),i.xRot=180*S/Math.PI}return void 0!==i.sweepFlag&&0>g&&(i.sweepFlag=+!i.sweepFlag),i}))}e.ROUND=function(e){function t(t){return Math.round(t*e)/e}return void 0===e&&(e=1e13),Y_e(e),function(e){return void 0!==e.x1&&(e.x1=t(e.x1)),void 0!==e.y1&&(e.y1=t(e.y1)),void 0!==e.x2&&(e.x2=t(e.x2)),void 0!==e.y2&&(e.y2=t(e.y2)),void 0!==e.x&&(e.x=t(e.x)),void 0!==e.y&&(e.y=t(e.y)),void 0!==e.rX&&(e.rX=t(e.rX)),void 0!==e.rY&&(e.rY=t(e.rY)),e}},e.TO_ABS=t,e.TO_REL=function(){return i((function(e,t,n){return e.relative||(void 0!==e.x1&&(e.x1-=t),void 0!==e.y1&&(e.y1-=n),void 0!==e.x2&&(e.x2-=t),void 0!==e.y2&&(e.y2-=n),void 0!==e.x&&(e.x-=t),void 0!==e.y&&(e.y-=n),e.relative=!0),e}))},e.NORMALIZE_HVZ=function(e,t,n){return void 0===e&&(e=!0),void 0===t&&(t=!0),void 0===n&&(n=!0),i((function(r,i,o,a,s){if(isNaN(a)&&!(r.type&ANe.MOVE_TO))throw new Error("path must start with moveto");return t&&r.type&ANe.HORIZ_LINE_TO&&(r.type=ANe.LINE_TO,r.y=r.relative?0:o),n&&r.type&ANe.VERT_LINE_TO&&(r.type=ANe.LINE_TO,r.x=r.relative?0:i),e&&r.type&ANe.CLOSE_PATH&&(r.type=ANe.LINE_TO,r.x=r.relative?a-i:a,r.y=r.relative?s-o:s),r.type&ANe.ARC&&(0===r.rX||0===r.rY)&&(r.type=ANe.LINE_TO,delete r.rX,delete r.rY,delete r.xRot,delete r.lArcFlag,delete r.sweepFlag),r}))},e.NORMALIZE_ST=n,e.QT_TO_C=r,e.INFO=i,e.SANITIZE=function(e){void 0===e&&(e=0),Y_e(e);var t=NaN,n=NaN,r=NaN,o=NaN;return i((function(i,a,s,u,l){var A=Math.abs,c=!1,h=0,f=0;if(i.type&ANe.SMOOTH_CURVE_TO&&(h=isNaN(t)?0:a-t,f=isNaN(n)?0:s-n),i.type&(ANe.CURVE_TO|ANe.SMOOTH_CURVE_TO)?(t=i.relative?a+i.x2:i.x2,n=i.relative?s+i.y2:i.y2):(t=NaN,n=NaN),i.type&ANe.SMOOTH_QUAD_TO?(r=isNaN(r)?a:2*a-r,o=isNaN(o)?s:2*s-o):i.type&ANe.QUAD_TO?(r=i.relative?a+i.x1:i.x1,o=i.relative?s+i.y1:i.y2):(r=NaN,o=NaN),i.type&ANe.LINE_COMMANDS||i.type&ANe.ARC&&(0===i.rX||0===i.rY||!i.lArcFlag)||i.type&ANe.CURVE_TO||i.type&ANe.SMOOTH_CURVE_TO||i.type&ANe.QUAD_TO||i.type&ANe.SMOOTH_QUAD_TO){var d=void 0===i.x?0:i.relative?i.x:i.x-a,p=void 0===i.y?0:i.relative?i.y:i.y-s;h=isNaN(r)?void 0===i.x1?h:i.relative?i.x:i.x1-a:r-a,f=isNaN(o)?void 0===i.y1?f:i.relative?i.y:i.y1-s:o-s;var g=void 0===i.x2?0:i.relative?i.x:i.x2-a,v=void 0===i.y2?0:i.relative?i.y:i.y2-s;A(d)<=e&&A(p)<=e&&A(h)<=e&&A(f)<=e&&A(g)<=e&&A(v)<=e&&(c=!0)}return i.type&ANe.CLOSE_PATH&&A(a-u)<=e&&A(s-l)<=e&&(c=!0),c?[]:i}))},e.MATRIX=o,e.ROTATE=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=0),Y_e(e,t,n);var r=Math.sin(e),i=Math.cos(e);return o(i,r,-r,i,t-t*i+n*r,n-t*r-n*i)},e.TRANSLATE=function(e,t){return void 0===t&&(t=0),Y_e(e,t),o(1,0,0,1,e,t)},e.SCALE=function(e,t){return void 0===t&&(t=e),Y_e(e,t),o(e,0,0,t,0,0)},e.SKEW_X=function(e){return Y_e(e),o(1,0,Math.atan(e),1,0,0)},e.SKEW_Y=function(e){return Y_e(e),o(1,Math.atan(e),0,1,0,0)},e.X_AXIS_SYMMETRY=function(e){return void 0===e&&(e=0),Y_e(e),o(-1,0,0,1,e,0)},e.Y_AXIS_SYMMETRY=function(e){return void 0===e&&(e=0),Y_e(e),o(1,0,0,-1,0,e)},e.A_TO_C=function(){return i((function(e,t,n){return ANe.ARC===e.type?function(e,t,n){var r,i,o,a;e.cX||W_e(e,t,n);for(var s=Math.min(e.phi1,e.phi2),u=Math.max(e.phi1,e.phi2)-s,l=Math.ceil(u/90),A=new Array(l),c=t,h=n,f=0;f<l;f++){var d=tNe(e.phi1,e.phi2,f/l),p=tNe(e.phi1,e.phi2,(f+1)/l),g=p-d,v=4/3*Math.tan(g*eNe/4),y=[Math.cos(d*eNe)-v*Math.sin(d*eNe),Math.sin(d*eNe)+v*Math.cos(d*eNe)],m=y[0],w=y[1],b=[Math.cos(p*eNe),Math.sin(p*eNe)],I=b[0],B=b[1],E=[I+v*Math.sin(p*eNe),B-v*Math.cos(p*eNe)],C=E[0],x=E[1];A[f]={relative:e.relative,type:ANe.CURVE_TO};var k=function(t,n){var r=J_e([t*e.rX,n*e.rY],e.xRot),i=r[0],o=r[1];return[e.cX+i,e.cY+o]};r=k(m,w),A[f].x1=r[0],A[f].y1=r[1],i=k(C,x),A[f].x2=i[0],A[f].y2=i[1],o=k(I,B),A[f].x=o[0],A[f].y=o[1],e.relative&&(A[f].x1-=c,A[f].y1-=h,A[f].x2-=c,A[f].y2-=h,A[f].x-=c,A[f].y-=h),c=(a=[A[f].x,A[f].y])[0],h=a[1]}return A}(e,e.relative?0:t,e.relative?0:n):e}))},e.ANNOTATE_ARCS=function(){return i((function(e,t,n){return e.relative&&(t=0,n=0),ANe.ARC===e.type&&W_e(e,t,n),e}))},e.CLONE=function(){return function(e){var t={};for(var n in e)t[n]=e[n];return t}},e.CALCULATE_BOUNDS=function(){var e=t(),o=r(),a=n(),s=i((function(t,n,r){var i=a(o(e(function(e){var t={};for(var n in e)t[n]=e[n];return t}(t))));function u(e){e>s.maxX&&(s.maxX=e),e<s.minX&&(s.minX=e)}function l(e){e>s.maxY&&(s.maxY=e),e<s.minY&&(s.minY=e)}if(i.type&ANe.DRAWING_COMMANDS&&(u(n),l(r)),i.type&ANe.HORIZ_LINE_TO&&u(i.x),i.type&ANe.VERT_LINE_TO&&l(i.y),i.type&ANe.LINE_TO&&(u(i.x),l(i.y)),i.type&ANe.CURVE_TO){u(i.x),l(i.y);for(var A=0,c=rNe(n,i.x1,i.x2,i.x);A<c.length;A++)0<(k=c[A])&&1>k&&u(iNe(n,i.x1,i.x2,i.x,k));for(var h=0,f=rNe(r,i.y1,i.y2,i.y);h<f.length;h++)0<(k=f[h])&&1>k&&l(iNe(r,i.y1,i.y2,i.y,k))}if(i.type&ANe.ARC){u(i.x),l(i.y),W_e(i,n,r);for(var d=i.xRot/180*Math.PI,p=Math.cos(d)*i.rX,g=Math.sin(d)*i.rX,v=-Math.sin(d)*i.rY,y=Math.cos(d)*i.rY,m=i.phi1<i.phi2?[i.phi1,i.phi2]:-180>i.phi2?[i.phi2+360,i.phi1+360]:[i.phi2,i.phi1],w=m[0],b=m[1],I=function(e){var t=e[0],n=e[1],r=180*Math.atan2(n,t)/Math.PI;return r<w?r+360:r},B=0,E=Z_e(v,-p,0).map(I);B<E.length;B++)(k=E[B])>w&&k<b&&u(nNe(i.cX,p,v,k));for(var C=0,x=Z_e(y,-g,0).map(I);C<x.length;C++){var k;(k=x[C])>w&&k<b&&l(nNe(i.cY,g,y,k))}}return t}));return s.minX=1/0,s.maxX=-1/0,s.minY=1/0,s.maxY=-1/0,s}}($_e||($_e={}));var oNe,aNe=function(){function e(){}return e.prototype.round=function(e){return this.transform($_e.ROUND(e))},e.prototype.toAbs=function(){return this.transform($_e.TO_ABS())},e.prototype.toRel=function(){return this.transform($_e.TO_REL())},e.prototype.normalizeHVZ=function(e,t,n){return this.transform($_e.NORMALIZE_HVZ(e,t,n))},e.prototype.normalizeST=function(){return this.transform($_e.NORMALIZE_ST())},e.prototype.qtToC=function(){return this.transform($_e.QT_TO_C())},e.prototype.aToC=function(){return this.transform($_e.A_TO_C())},e.prototype.sanitize=function(e){return this.transform($_e.SANITIZE(e))},e.prototype.translate=function(e,t){return this.transform($_e.TRANSLATE(e,t))},e.prototype.scale=function(e,t){return this.transform($_e.SCALE(e,t))},e.prototype.rotate=function(e,t,n){return this.transform($_e.ROTATE(e,t,n))},e.prototype.matrix=function(e,t,n,r,i,o){return this.transform($_e.MATRIX(e,t,n,r,i,o))},e.prototype.skewX=function(e){return this.transform($_e.SKEW_X(e))},e.prototype.skewY=function(e){return this.transform($_e.SKEW_Y(e))},e.prototype.xSymmetry=function(e){return this.transform($_e.X_AXIS_SYMMETRY(e))},e.prototype.ySymmetry=function(e){return this.transform($_e.Y_AXIS_SYMMETRY(e))},e.prototype.annotateArcs=function(){return this.transform($_e.ANNOTATE_ARCS())},e}(),sNe=function(e){return" "===e||"\t"===e||"\r"===e||"\n"===e},uNe=function(e){return"0".charCodeAt(0)<=e.charCodeAt(0)&&e.charCodeAt(0)<="9".charCodeAt(0)},lNe=function(e){function t(){var t=e.call(this)||this;return t.curNumber="",t.curCommandType=-1,t.curCommandRelative=!1,t.canParseCommandOrComma=!0,t.curNumberHasExp=!1,t.curNumberHasExpDigits=!1,t.curNumberHasDecimal=!1,t.curArgs=[],t}return z_e(t,e),t.prototype.finish=function(e){if(void 0===e&&(e=[]),this.parse(" ",e),0!==this.curArgs.length||!this.canParseCommandOrComma)throw new SyntaxError("Unterminated command at the path end.");return e},t.prototype.parse=function(e,t){var n=this;void 0===t&&(t=[]);for(var r=function(e){t.push(e),n.curArgs.length=0,n.canParseCommandOrComma=!0},i=0;i<e.length;i++){var o=e[i],a=!(this.curCommandType!==ANe.ARC||3!==this.curArgs.length&&4!==this.curArgs.length||1!==this.curNumber.length||"0"!==this.curNumber&&"1"!==this.curNumber),s=uNe(o)&&("0"===this.curNumber&&"0"===o||a);if(!uNe(o)||s)if("e"!==o&&"E"!==o)if("-"!==o&&"+"!==o||!this.curNumberHasExp||this.curNumberHasExpDigits)if("."!==o||this.curNumberHasExp||this.curNumberHasDecimal||a){if(this.curNumber&&-1!==this.curCommandType){var u=Number(this.curNumber);if(isNaN(u))throw new SyntaxError("Invalid number ending at "+i);if(this.curCommandType===ANe.ARC)if(0===this.curArgs.length||1===this.curArgs.length){if(0>u)throw new SyntaxError('Expected positive number, got "'+u+'" at index "'+i+'"')}else if((3===this.curArgs.length||4===this.curArgs.length)&&"0"!==this.curNumber&&"1"!==this.curNumber)throw new SyntaxError('Expected a flag, got "'+this.curNumber+'" at index "'+i+'"');this.curArgs.push(u),this.curArgs.length===cNe[this.curCommandType]&&(ANe.HORIZ_LINE_TO===this.curCommandType?r({type:ANe.HORIZ_LINE_TO,relative:this.curCommandRelative,x:u}):ANe.VERT_LINE_TO===this.curCommandType?r({type:ANe.VERT_LINE_TO,relative:this.curCommandRelative,y:u}):this.curCommandType===ANe.MOVE_TO||this.curCommandType===ANe.LINE_TO||this.curCommandType===ANe.SMOOTH_QUAD_TO?(r({type:this.curCommandType,relative:this.curCommandRelative,x:this.curArgs[0],y:this.curArgs[1]}),ANe.MOVE_TO===this.curCommandType&&(this.curCommandType=ANe.LINE_TO)):this.curCommandType===ANe.CURVE_TO?r({type:ANe.CURVE_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x2:this.curArgs[2],y2:this.curArgs[3],x:this.curArgs[4],y:this.curArgs[5]}):this.curCommandType===ANe.SMOOTH_CURVE_TO?r({type:ANe.SMOOTH_CURVE_TO,relative:this.curCommandRelative,x2:this.curArgs[0],y2:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===ANe.QUAD_TO?r({type:ANe.QUAD_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===ANe.ARC&&r({type:ANe.ARC,relative:this.curCommandRelative,rX:this.curArgs[0],rY:this.curArgs[1],xRot:this.curArgs[2],lArcFlag:this.curArgs[3],sweepFlag:this.curArgs[4],x:this.curArgs[5],y:this.curArgs[6]})),this.curNumber="",this.curNumberHasExpDigits=!1,this.curNumberHasExp=!1,this.curNumberHasDecimal=!1,this.canParseCommandOrComma=!0}if(!sNe(o))if(","===o&&this.canParseCommandOrComma)this.canParseCommandOrComma=!1;else if("+"!==o&&"-"!==o&&"."!==o)if(s)this.curNumber=o,this.curNumberHasDecimal=!1;else{if(0!==this.curArgs.length)throw new SyntaxError("Unterminated command at index "+i+".");if(!this.canParseCommandOrComma)throw new SyntaxError('Unexpected character "'+o+'" at index '+i+". Command cannot follow comma");if(this.canParseCommandOrComma=!1,"z"!==o&&"Z"!==o)if("h"===o||"H"===o)this.curCommandType=ANe.HORIZ_LINE_TO,this.curCommandRelative="h"===o;else if("v"===o||"V"===o)this.curCommandType=ANe.VERT_LINE_TO,this.curCommandRelative="v"===o;else if("m"===o||"M"===o)this.curCommandType=ANe.MOVE_TO,this.curCommandRelative="m"===o;else if("l"===o||"L"===o)this.curCommandType=ANe.LINE_TO,this.curCommandRelative="l"===o;else if("c"===o||"C"===o)this.curCommandType=ANe.CURVE_TO,this.curCommandRelative="c"===o;else if("s"===o||"S"===o)this.curCommandType=ANe.SMOOTH_CURVE_TO,this.curCommandRelative="s"===o;else if("q"===o||"Q"===o)this.curCommandType=ANe.QUAD_TO,this.curCommandRelative="q"===o;else if("t"===o||"T"===o)this.curCommandType=ANe.SMOOTH_QUAD_TO,this.curCommandRelative="t"===o;else{if("a"!==o&&"A"!==o)throw new SyntaxError('Unexpected character "'+o+'" at index '+i+".");this.curCommandType=ANe.ARC,this.curCommandRelative="a"===o}else t.push({type:ANe.CLOSE_PATH}),this.canParseCommandOrComma=!0,this.curCommandType=-1}else this.curNumber=o,this.curNumberHasDecimal="."===o}else this.curNumber+=o,this.curNumberHasDecimal=!0;else this.curNumber+=o;else this.curNumber+=o,this.curNumberHasExp=!0;else this.curNumber+=o,this.curNumberHasExpDigits=this.curNumberHasExp}return t},t.prototype.transform=function(e){return Object.create(this,{parse:{value:function(t,n){void 0===n&&(n=[]);for(var r=0,i=Object.getPrototypeOf(this).parse.call(this,t);r<i.length;r++){var o=i[r],a=e(o);Array.isArray(a)?n.push.apply(n,a):n.push(a)}return n}}})},t}(aNe),ANe=function(e){function t(n){var r=e.call(this)||this;return r.commands="string"==typeof n?t.parse(n):n,r}return z_e(t,e),t.prototype.encode=function(){return t.encode(this.commands)},t.prototype.getBounds=function(){var e=$_e.CALCULATE_BOUNDS();return this.transform(e),e},t.prototype.transform=function(e){for(var t=[],n=0,r=this.commands;n<r.length;n++){var i=e(r[n]);Array.isArray(i)?t.push.apply(t,i):t.push(i)}return this.commands=t,this},t.encode=function(e){return function(e){var t="";Array.isArray(e)||(e=[e]);for(var n=0;n<e.length;n++){var r=e[n];if(r.type===ANe.CLOSE_PATH)t+="z";else if(r.type===ANe.HORIZ_LINE_TO)t+=(r.relative?"h":"H")+r.x;else if(r.type===ANe.VERT_LINE_TO)t+=(r.relative?"v":"V")+r.y;else if(r.type===ANe.MOVE_TO)t+=(r.relative?"m":"M")+r.x+" "+r.y;else if(r.type===ANe.LINE_TO)t+=(r.relative?"l":"L")+r.x+" "+r.y;else if(r.type===ANe.CURVE_TO)t+=(r.relative?"c":"C")+r.x1+" "+r.y1+" "+r.x2+" "+r.y2+" "+r.x+" "+r.y;else if(r.type===ANe.SMOOTH_CURVE_TO)t+=(r.relative?"s":"S")+r.x2+" "+r.y2+" "+r.x+" "+r.y;else if(r.type===ANe.QUAD_TO)t+=(r.relative?"q":"Q")+r.x1+" "+r.y1+" "+r.x+" "+r.y;else if(r.type===ANe.SMOOTH_QUAD_TO)t+=(r.relative?"t":"T")+r.x+" "+r.y;else{if(r.type!==ANe.ARC)throw new Error('Unexpected command type "'+r.type+'" at index '+n+".");t+=(r.relative?"a":"A")+r.rX+" "+r.rY+" "+r.xRot+" "+ +r.lArcFlag+" "+ +r.sweepFlag+" "+r.x+" "+r.y}}return t}(e)},t.parse=function(e){var t=new lNe,n=[];return t.parse(e,n),t.finish(n),n},t.CLOSE_PATH=1,t.MOVE_TO=2,t.HORIZ_LINE_TO=4,t.VERT_LINE_TO=8,t.LINE_TO=16,t.CURVE_TO=32,t.SMOOTH_CURVE_TO=64,t.QUAD_TO=128,t.SMOOTH_QUAD_TO=256,t.ARC=512,t.LINE_COMMANDS=t.LINE_TO|t.HORIZ_LINE_TO|t.VERT_LINE_TO,t.DRAWING_COMMANDS=t.HORIZ_LINE_TO|t.VERT_LINE_TO|t.LINE_TO|t.CURVE_TO|t.SMOOTH_CURVE_TO|t.QUAD_TO|t.SMOOTH_QUAD_TO|t.ARC,t}(aNe),cNe=((oNe={})[ANe.MOVE_TO]=2,oNe[ANe.LINE_TO]=2,oNe[ANe.HORIZ_LINE_TO]=1,oNe[ANe.VERT_LINE_TO]=1,oNe[ANe.CLOSE_PATH]=0,oNe[ANe.QUAD_TO]=4,oNe[ANe.SMOOTH_QUAD_TO]=2,oNe[ANe.CURVE_TO]=6,oNe[ANe.SMOOTH_CURVE_TO]=4,oNe[ANe.ARC]=7,oNe),hNe=hpe,fNe=Lge,dNe=zpe,pNe=jEe,gNe=RegExp.prototype,vNe=Xve.PROPER,yNe=zye,mNe=Qve,wNe=HEe,bNe=spe,INe=function(e){var t=e.flags;return void 0!==t||"flags"in gNe||fNe(e,"flags")||!dNe(gNe,e)?t:hNe(pNe,e)},BNe="toString",ENe=RegExp.prototype.toString,CNe=bNe((function(){return"/a/b"!=ENe.call({source:"a",flags:"b"})})),xNe=vNe&&ENe.name!=BNe;function kNe(e){return kNe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},kNe(e)}(CNe||xNe)&&yNe(RegExp.prototype,BNe,(function(){var e=mNe(this);return"/"+wNe(e.source)+"/"+wNe(INe(e))}),{unsafe:!0});
801
+ var z_e=function(e,t){return(z_e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function J_e(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}z_e(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function Y_e(e,t){var n=e[0],r=e[1];return[n*Math.cos(t)-r*Math.sin(t),n*Math.sin(t)+r*Math.cos(t)]}function X_e(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n=0;n<e.length;n++)if("number"!=typeof e[n])throw new Error("assertNumbers arguments["+n+"] is not a number. "+i(e[n])+" == typeof "+e[n]);return!0}var W_e=Math.PI;function Z_e(e,t,n){e.lArcFlag=0===e.lArcFlag?0:1,e.sweepFlag=0===e.sweepFlag?0:1;var r=e.rX,i=e.rY,o=e.x,a=e.y;r=Math.abs(e.rX),i=Math.abs(e.rY);var s=Y_e([(t-o)/2,(n-a)/2],-e.xRot/180*W_e),u=s[0],l=s[1],A=Math.pow(u,2)/Math.pow(r,2)+Math.pow(l,2)/Math.pow(i,2);1<A&&(r*=Math.sqrt(A),i*=Math.sqrt(A)),e.rX=r,e.rY=i;var c=Math.pow(r,2)*Math.pow(l,2)+Math.pow(i,2)*Math.pow(u,2),h=(e.lArcFlag!==e.sweepFlag?1:-1)*Math.sqrt(Math.max(0,(Math.pow(r,2)*Math.pow(i,2)-c)/c)),f=r*l/i*h,d=-i*u/r*h,p=Y_e([f,d],e.xRot/180*W_e);e.cX=p[0]+(t+o)/2,e.cY=p[1]+(n+a)/2,e.phi1=Math.atan2((l-d)/i,(u-f)/r),e.phi2=Math.atan2((-l-d)/i,(-u-f)/r),0===e.sweepFlag&&e.phi2>e.phi1&&(e.phi2-=2*W_e),1===e.sweepFlag&&e.phi2<e.phi1&&(e.phi2+=2*W_e),e.phi1*=180/W_e,e.phi2*=180/W_e}function $_e(e,t,n){X_e(e,t,n);var r=e*e+t*t-n*n;if(0>r)return[];if(0===r)return[[e*n/(e*e+t*t),t*n/(e*e+t*t)]];var i=Math.sqrt(r);return[[(e*n+t*i)/(e*e+t*t),(t*n-e*i)/(e*e+t*t)],[(e*n-t*i)/(e*e+t*t),(t*n+e*i)/(e*e+t*t)]]}var eNe,tNe=Math.PI/180;function nNe(e,t,n){return(1-n)*e+n*t}function rNe(e,t,n,r){return e+Math.cos(r/180*W_e)*t+Math.sin(r/180*W_e)*n}function iNe(e,t,n,r){var i=1e-6,o=t-e,a=n-t,s=3*o+3*(r-n)-6*a,u=6*(a-o),l=3*o;return Math.abs(s)<i?[-l/u]:function(e,t,n){void 0===n&&(n=1e-6);var r=e*e/4-t;if(r<-n)return[];if(r<=n)return[-e/2];var i=Math.sqrt(r);return[-e/2-i,-e/2+i]}(u/s,l/s,i)}function oNe(e,t,n,r,i){var o=1-i;return e*(o*o*o)+t*(3*o*o*i)+n*(3*o*i*i)+r*(i*i*i)}!function(e){function t(){return i((function(e,t,n){return e.relative&&(void 0!==e.x1&&(e.x1+=t),void 0!==e.y1&&(e.y1+=n),void 0!==e.x2&&(e.x2+=t),void 0!==e.y2&&(e.y2+=n),void 0!==e.x&&(e.x+=t),void 0!==e.y&&(e.y+=n),e.relative=!1),e}))}function n(){var e=NaN,t=NaN,n=NaN,r=NaN;return i((function(i,o,a){return i.type&cNe.SMOOTH_CURVE_TO&&(i.type=cNe.CURVE_TO,e=isNaN(e)?o:e,t=isNaN(t)?a:t,i.x1=i.relative?o-e:2*o-e,i.y1=i.relative?a-t:2*a-t),i.type&cNe.CURVE_TO?(e=i.relative?o+i.x2:i.x2,t=i.relative?a+i.y2:i.y2):(e=NaN,t=NaN),i.type&cNe.SMOOTH_QUAD_TO&&(i.type=cNe.QUAD_TO,n=isNaN(n)?o:n,r=isNaN(r)?a:r,i.x1=i.relative?o-n:2*o-n,i.y1=i.relative?a-r:2*a-r),i.type&cNe.QUAD_TO?(n=i.relative?o+i.x1:i.x1,r=i.relative?a+i.y1:i.y1):(n=NaN,r=NaN),i}))}function r(){var e=NaN,t=NaN;return i((function(n,r,i){if(n.type&cNe.SMOOTH_QUAD_TO&&(n.type=cNe.QUAD_TO,e=isNaN(e)?r:e,t=isNaN(t)?i:t,n.x1=n.relative?r-e:2*r-e,n.y1=n.relative?i-t:2*i-t),n.type&cNe.QUAD_TO){e=n.relative?r+n.x1:n.x1,t=n.relative?i+n.y1:n.y1;var o=n.x1,a=n.y1;n.type=cNe.CURVE_TO,n.x1=((n.relative?0:r)+2*o)/3,n.y1=((n.relative?0:i)+2*a)/3,n.x2=(n.x+2*o)/3,n.y2=(n.y+2*a)/3}else e=NaN,t=NaN;return n}))}function i(e){var t=0,n=0,r=NaN,i=NaN;return function(o){if(isNaN(r)&&!(o.type&cNe.MOVE_TO))throw new Error("path must start with moveto");var a=e(o,t,n,r,i);return o.type&cNe.CLOSE_PATH&&(t=r,n=i),void 0!==o.x&&(t=o.relative?t+o.x:o.x),void 0!==o.y&&(n=o.relative?n+o.y:o.y),o.type&cNe.MOVE_TO&&(r=t,i=n),a}}function o(e,t,n,r,o,a){return X_e(e,t,n,r,o,a),i((function(i,s,u,l){var A=i.x1,c=i.x2,h=i.relative&&!isNaN(l),f=void 0!==i.x?i.x:h?0:s,d=void 0!==i.y?i.y:h?0:u;function p(e){return e*e}i.type&cNe.HORIZ_LINE_TO&&0!==t&&(i.type=cNe.LINE_TO,i.y=i.relative?0:u),i.type&cNe.VERT_LINE_TO&&0!==n&&(i.type=cNe.LINE_TO,i.x=i.relative?0:s),void 0!==i.x&&(i.x=i.x*e+d*n+(h?0:o)),void 0!==i.y&&(i.y=f*t+i.y*r+(h?0:a)),void 0!==i.x1&&(i.x1=i.x1*e+i.y1*n+(h?0:o)),void 0!==i.y1&&(i.y1=A*t+i.y1*r+(h?0:a)),void 0!==i.x2&&(i.x2=i.x2*e+i.y2*n+(h?0:o)),void 0!==i.y2&&(i.y2=c*t+i.y2*r+(h?0:a));var g=e*r-t*n;if(void 0!==i.xRot&&(1!==e||0!==t||0!==n||1!==r))if(0===g)delete i.rX,delete i.rY,delete i.xRot,delete i.lArcFlag,delete i.sweepFlag,i.type=cNe.LINE_TO;else{var v=i.xRot*Math.PI/180,y=Math.sin(v),m=Math.cos(v),w=1/p(i.rX),b=1/p(i.rY),I=p(m)*w+p(y)*b,B=2*y*m*(w-b),E=p(y)*w+p(m)*b,C=I*r*r-B*t*r+E*t*t,x=B*(e*r+t*n)-2*(I*n*r+E*e*t),k=I*n*n-B*e*n+E*e*e,S=(Math.atan2(x,C-k)+Math.PI)%Math.PI/2,Q=Math.sin(S),_=Math.cos(S);i.rX=Math.abs(g)/Math.sqrt(C*p(_)+x*Q*_+k*p(Q)),i.rY=Math.abs(g)/Math.sqrt(C*p(Q)-x*Q*_+k*p(_)),i.xRot=180*S/Math.PI}return void 0!==i.sweepFlag&&0>g&&(i.sweepFlag=+!i.sweepFlag),i}))}e.ROUND=function(e){function t(t){return Math.round(t*e)/e}return void 0===e&&(e=1e13),X_e(e),function(e){return void 0!==e.x1&&(e.x1=t(e.x1)),void 0!==e.y1&&(e.y1=t(e.y1)),void 0!==e.x2&&(e.x2=t(e.x2)),void 0!==e.y2&&(e.y2=t(e.y2)),void 0!==e.x&&(e.x=t(e.x)),void 0!==e.y&&(e.y=t(e.y)),void 0!==e.rX&&(e.rX=t(e.rX)),void 0!==e.rY&&(e.rY=t(e.rY)),e}},e.TO_ABS=t,e.TO_REL=function(){return i((function(e,t,n){return e.relative||(void 0!==e.x1&&(e.x1-=t),void 0!==e.y1&&(e.y1-=n),void 0!==e.x2&&(e.x2-=t),void 0!==e.y2&&(e.y2-=n),void 0!==e.x&&(e.x-=t),void 0!==e.y&&(e.y-=n),e.relative=!0),e}))},e.NORMALIZE_HVZ=function(e,t,n){return void 0===e&&(e=!0),void 0===t&&(t=!0),void 0===n&&(n=!0),i((function(r,i,o,a,s){if(isNaN(a)&&!(r.type&cNe.MOVE_TO))throw new Error("path must start with moveto");return t&&r.type&cNe.HORIZ_LINE_TO&&(r.type=cNe.LINE_TO,r.y=r.relative?0:o),n&&r.type&cNe.VERT_LINE_TO&&(r.type=cNe.LINE_TO,r.x=r.relative?0:i),e&&r.type&cNe.CLOSE_PATH&&(r.type=cNe.LINE_TO,r.x=r.relative?a-i:a,r.y=r.relative?s-o:s),r.type&cNe.ARC&&(0===r.rX||0===r.rY)&&(r.type=cNe.LINE_TO,delete r.rX,delete r.rY,delete r.xRot,delete r.lArcFlag,delete r.sweepFlag),r}))},e.NORMALIZE_ST=n,e.QT_TO_C=r,e.INFO=i,e.SANITIZE=function(e){void 0===e&&(e=0),X_e(e);var t=NaN,n=NaN,r=NaN,o=NaN;return i((function(i,a,s,u,l){var A=Math.abs,c=!1,h=0,f=0;if(i.type&cNe.SMOOTH_CURVE_TO&&(h=isNaN(t)?0:a-t,f=isNaN(n)?0:s-n),i.type&(cNe.CURVE_TO|cNe.SMOOTH_CURVE_TO)?(t=i.relative?a+i.x2:i.x2,n=i.relative?s+i.y2:i.y2):(t=NaN,n=NaN),i.type&cNe.SMOOTH_QUAD_TO?(r=isNaN(r)?a:2*a-r,o=isNaN(o)?s:2*s-o):i.type&cNe.QUAD_TO?(r=i.relative?a+i.x1:i.x1,o=i.relative?s+i.y1:i.y2):(r=NaN,o=NaN),i.type&cNe.LINE_COMMANDS||i.type&cNe.ARC&&(0===i.rX||0===i.rY||!i.lArcFlag)||i.type&cNe.CURVE_TO||i.type&cNe.SMOOTH_CURVE_TO||i.type&cNe.QUAD_TO||i.type&cNe.SMOOTH_QUAD_TO){var d=void 0===i.x?0:i.relative?i.x:i.x-a,p=void 0===i.y?0:i.relative?i.y:i.y-s;h=isNaN(r)?void 0===i.x1?h:i.relative?i.x:i.x1-a:r-a,f=isNaN(o)?void 0===i.y1?f:i.relative?i.y:i.y1-s:o-s;var g=void 0===i.x2?0:i.relative?i.x:i.x2-a,v=void 0===i.y2?0:i.relative?i.y:i.y2-s;A(d)<=e&&A(p)<=e&&A(h)<=e&&A(f)<=e&&A(g)<=e&&A(v)<=e&&(c=!0)}return i.type&cNe.CLOSE_PATH&&A(a-u)<=e&&A(s-l)<=e&&(c=!0),c?[]:i}))},e.MATRIX=o,e.ROTATE=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=0),X_e(e,t,n);var r=Math.sin(e),i=Math.cos(e);return o(i,r,-r,i,t-t*i+n*r,n-t*r-n*i)},e.TRANSLATE=function(e,t){return void 0===t&&(t=0),X_e(e,t),o(1,0,0,1,e,t)},e.SCALE=function(e,t){return void 0===t&&(t=e),X_e(e,t),o(e,0,0,t,0,0)},e.SKEW_X=function(e){return X_e(e),o(1,0,Math.atan(e),1,0,0)},e.SKEW_Y=function(e){return X_e(e),o(1,Math.atan(e),0,1,0,0)},e.X_AXIS_SYMMETRY=function(e){return void 0===e&&(e=0),X_e(e),o(-1,0,0,1,e,0)},e.Y_AXIS_SYMMETRY=function(e){return void 0===e&&(e=0),X_e(e),o(1,0,0,-1,0,e)},e.A_TO_C=function(){return i((function(e,t,n){return cNe.ARC===e.type?function(e,t,n){var r,i,o,a;e.cX||Z_e(e,t,n);for(var s=Math.min(e.phi1,e.phi2),u=Math.max(e.phi1,e.phi2)-s,l=Math.ceil(u/90),A=new Array(l),c=t,h=n,f=0;f<l;f++){var d=nNe(e.phi1,e.phi2,f/l),p=nNe(e.phi1,e.phi2,(f+1)/l),g=p-d,v=4/3*Math.tan(g*tNe/4),y=[Math.cos(d*tNe)-v*Math.sin(d*tNe),Math.sin(d*tNe)+v*Math.cos(d*tNe)],m=y[0],w=y[1],b=[Math.cos(p*tNe),Math.sin(p*tNe)],I=b[0],B=b[1],E=[I+v*Math.sin(p*tNe),B-v*Math.cos(p*tNe)],C=E[0],x=E[1];A[f]={relative:e.relative,type:cNe.CURVE_TO};var k=function(t,n){var r=Y_e([t*e.rX,n*e.rY],e.xRot),i=r[0],o=r[1];return[e.cX+i,e.cY+o]};r=k(m,w),A[f].x1=r[0],A[f].y1=r[1],i=k(C,x),A[f].x2=i[0],A[f].y2=i[1],o=k(I,B),A[f].x=o[0],A[f].y=o[1],e.relative&&(A[f].x1-=c,A[f].y1-=h,A[f].x2-=c,A[f].y2-=h,A[f].x-=c,A[f].y-=h),c=(a=[A[f].x,A[f].y])[0],h=a[1]}return A}(e,e.relative?0:t,e.relative?0:n):e}))},e.ANNOTATE_ARCS=function(){return i((function(e,t,n){return e.relative&&(t=0,n=0),cNe.ARC===e.type&&Z_e(e,t,n),e}))},e.CLONE=function(){return function(e){var t={};for(var n in e)t[n]=e[n];return t}},e.CALCULATE_BOUNDS=function(){var e=t(),o=r(),a=n(),s=i((function(t,n,r){var i=a(o(e(function(e){var t={};for(var n in e)t[n]=e[n];return t}(t))));function u(e){e>s.maxX&&(s.maxX=e),e<s.minX&&(s.minX=e)}function l(e){e>s.maxY&&(s.maxY=e),e<s.minY&&(s.minY=e)}if(i.type&cNe.DRAWING_COMMANDS&&(u(n),l(r)),i.type&cNe.HORIZ_LINE_TO&&u(i.x),i.type&cNe.VERT_LINE_TO&&l(i.y),i.type&cNe.LINE_TO&&(u(i.x),l(i.y)),i.type&cNe.CURVE_TO){u(i.x),l(i.y);for(var A=0,c=iNe(n,i.x1,i.x2,i.x);A<c.length;A++)0<(k=c[A])&&1>k&&u(oNe(n,i.x1,i.x2,i.x,k));for(var h=0,f=iNe(r,i.y1,i.y2,i.y);h<f.length;h++)0<(k=f[h])&&1>k&&l(oNe(r,i.y1,i.y2,i.y,k))}if(i.type&cNe.ARC){u(i.x),l(i.y),Z_e(i,n,r);for(var d=i.xRot/180*Math.PI,p=Math.cos(d)*i.rX,g=Math.sin(d)*i.rX,v=-Math.sin(d)*i.rY,y=Math.cos(d)*i.rY,m=i.phi1<i.phi2?[i.phi1,i.phi2]:-180>i.phi2?[i.phi2+360,i.phi1+360]:[i.phi2,i.phi1],w=m[0],b=m[1],I=function(e){var t=e[0],n=e[1],r=180*Math.atan2(n,t)/Math.PI;return r<w?r+360:r},B=0,E=$_e(v,-p,0).map(I);B<E.length;B++)(k=E[B])>w&&k<b&&u(rNe(i.cX,p,v,k));for(var C=0,x=$_e(y,-g,0).map(I);C<x.length;C++){var k;(k=x[C])>w&&k<b&&l(rNe(i.cY,g,y,k))}}return t}));return s.minX=1/0,s.maxX=-1/0,s.minY=1/0,s.maxY=-1/0,s}}(eNe||(eNe={}));var aNe,sNe=function(){function e(){}return e.prototype.round=function(e){return this.transform(eNe.ROUND(e))},e.prototype.toAbs=function(){return this.transform(eNe.TO_ABS())},e.prototype.toRel=function(){return this.transform(eNe.TO_REL())},e.prototype.normalizeHVZ=function(e,t,n){return this.transform(eNe.NORMALIZE_HVZ(e,t,n))},e.prototype.normalizeST=function(){return this.transform(eNe.NORMALIZE_ST())},e.prototype.qtToC=function(){return this.transform(eNe.QT_TO_C())},e.prototype.aToC=function(){return this.transform(eNe.A_TO_C())},e.prototype.sanitize=function(e){return this.transform(eNe.SANITIZE(e))},e.prototype.translate=function(e,t){return this.transform(eNe.TRANSLATE(e,t))},e.prototype.scale=function(e,t){return this.transform(eNe.SCALE(e,t))},e.prototype.rotate=function(e,t,n){return this.transform(eNe.ROTATE(e,t,n))},e.prototype.matrix=function(e,t,n,r,i,o){return this.transform(eNe.MATRIX(e,t,n,r,i,o))},e.prototype.skewX=function(e){return this.transform(eNe.SKEW_X(e))},e.prototype.skewY=function(e){return this.transform(eNe.SKEW_Y(e))},e.prototype.xSymmetry=function(e){return this.transform(eNe.X_AXIS_SYMMETRY(e))},e.prototype.ySymmetry=function(e){return this.transform(eNe.Y_AXIS_SYMMETRY(e))},e.prototype.annotateArcs=function(){return this.transform(eNe.ANNOTATE_ARCS())},e}(),uNe=function(e){return" "===e||"\t"===e||"\r"===e||"\n"===e},lNe=function(e){return"0".charCodeAt(0)<=e.charCodeAt(0)&&e.charCodeAt(0)<="9".charCodeAt(0)},ANe=function(e){function t(){var t=e.call(this)||this;return t.curNumber="",t.curCommandType=-1,t.curCommandRelative=!1,t.canParseCommandOrComma=!0,t.curNumberHasExp=!1,t.curNumberHasExpDigits=!1,t.curNumberHasDecimal=!1,t.curArgs=[],t}return J_e(t,e),t.prototype.finish=function(e){if(void 0===e&&(e=[]),this.parse(" ",e),0!==this.curArgs.length||!this.canParseCommandOrComma)throw new SyntaxError("Unterminated command at the path end.");return e},t.prototype.parse=function(e,t){var n=this;void 0===t&&(t=[]);for(var r=function(e){t.push(e),n.curArgs.length=0,n.canParseCommandOrComma=!0},i=0;i<e.length;i++){var o=e[i],a=!(this.curCommandType!==cNe.ARC||3!==this.curArgs.length&&4!==this.curArgs.length||1!==this.curNumber.length||"0"!==this.curNumber&&"1"!==this.curNumber),s=lNe(o)&&("0"===this.curNumber&&"0"===o||a);if(!lNe(o)||s)if("e"!==o&&"E"!==o)if("-"!==o&&"+"!==o||!this.curNumberHasExp||this.curNumberHasExpDigits)if("."!==o||this.curNumberHasExp||this.curNumberHasDecimal||a){if(this.curNumber&&-1!==this.curCommandType){var u=Number(this.curNumber);if(isNaN(u))throw new SyntaxError("Invalid number ending at "+i);if(this.curCommandType===cNe.ARC)if(0===this.curArgs.length||1===this.curArgs.length){if(0>u)throw new SyntaxError('Expected positive number, got "'+u+'" at index "'+i+'"')}else if((3===this.curArgs.length||4===this.curArgs.length)&&"0"!==this.curNumber&&"1"!==this.curNumber)throw new SyntaxError('Expected a flag, got "'+this.curNumber+'" at index "'+i+'"');this.curArgs.push(u),this.curArgs.length===hNe[this.curCommandType]&&(cNe.HORIZ_LINE_TO===this.curCommandType?r({type:cNe.HORIZ_LINE_TO,relative:this.curCommandRelative,x:u}):cNe.VERT_LINE_TO===this.curCommandType?r({type:cNe.VERT_LINE_TO,relative:this.curCommandRelative,y:u}):this.curCommandType===cNe.MOVE_TO||this.curCommandType===cNe.LINE_TO||this.curCommandType===cNe.SMOOTH_QUAD_TO?(r({type:this.curCommandType,relative:this.curCommandRelative,x:this.curArgs[0],y:this.curArgs[1]}),cNe.MOVE_TO===this.curCommandType&&(this.curCommandType=cNe.LINE_TO)):this.curCommandType===cNe.CURVE_TO?r({type:cNe.CURVE_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x2:this.curArgs[2],y2:this.curArgs[3],x:this.curArgs[4],y:this.curArgs[5]}):this.curCommandType===cNe.SMOOTH_CURVE_TO?r({type:cNe.SMOOTH_CURVE_TO,relative:this.curCommandRelative,x2:this.curArgs[0],y2:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===cNe.QUAD_TO?r({type:cNe.QUAD_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===cNe.ARC&&r({type:cNe.ARC,relative:this.curCommandRelative,rX:this.curArgs[0],rY:this.curArgs[1],xRot:this.curArgs[2],lArcFlag:this.curArgs[3],sweepFlag:this.curArgs[4],x:this.curArgs[5],y:this.curArgs[6]})),this.curNumber="",this.curNumberHasExpDigits=!1,this.curNumberHasExp=!1,this.curNumberHasDecimal=!1,this.canParseCommandOrComma=!0}if(!uNe(o))if(","===o&&this.canParseCommandOrComma)this.canParseCommandOrComma=!1;else if("+"!==o&&"-"!==o&&"."!==o)if(s)this.curNumber=o,this.curNumberHasDecimal=!1;else{if(0!==this.curArgs.length)throw new SyntaxError("Unterminated command at index "+i+".");if(!this.canParseCommandOrComma)throw new SyntaxError('Unexpected character "'+o+'" at index '+i+". Command cannot follow comma");if(this.canParseCommandOrComma=!1,"z"!==o&&"Z"!==o)if("h"===o||"H"===o)this.curCommandType=cNe.HORIZ_LINE_TO,this.curCommandRelative="h"===o;else if("v"===o||"V"===o)this.curCommandType=cNe.VERT_LINE_TO,this.curCommandRelative="v"===o;else if("m"===o||"M"===o)this.curCommandType=cNe.MOVE_TO,this.curCommandRelative="m"===o;else if("l"===o||"L"===o)this.curCommandType=cNe.LINE_TO,this.curCommandRelative="l"===o;else if("c"===o||"C"===o)this.curCommandType=cNe.CURVE_TO,this.curCommandRelative="c"===o;else if("s"===o||"S"===o)this.curCommandType=cNe.SMOOTH_CURVE_TO,this.curCommandRelative="s"===o;else if("q"===o||"Q"===o)this.curCommandType=cNe.QUAD_TO,this.curCommandRelative="q"===o;else if("t"===o||"T"===o)this.curCommandType=cNe.SMOOTH_QUAD_TO,this.curCommandRelative="t"===o;else{if("a"!==o&&"A"!==o)throw new SyntaxError('Unexpected character "'+o+'" at index '+i+".");this.curCommandType=cNe.ARC,this.curCommandRelative="a"===o}else t.push({type:cNe.CLOSE_PATH}),this.canParseCommandOrComma=!0,this.curCommandType=-1}else this.curNumber=o,this.curNumberHasDecimal="."===o}else this.curNumber+=o,this.curNumberHasDecimal=!0;else this.curNumber+=o;else this.curNumber+=o,this.curNumberHasExp=!0;else this.curNumber+=o,this.curNumberHasExpDigits=this.curNumberHasExp}return t},t.prototype.transform=function(e){return Object.create(this,{parse:{value:function(t,n){void 0===n&&(n=[]);for(var r=0,i=Object.getPrototypeOf(this).parse.call(this,t);r<i.length;r++){var o=i[r],a=e(o);Array.isArray(a)?n.push.apply(n,a):n.push(a)}return n}}})},t}(sNe),cNe=function(e){function t(n){var r=e.call(this)||this;return r.commands="string"==typeof n?t.parse(n):n,r}return J_e(t,e),t.prototype.encode=function(){return t.encode(this.commands)},t.prototype.getBounds=function(){var e=eNe.CALCULATE_BOUNDS();return this.transform(e),e},t.prototype.transform=function(e){for(var t=[],n=0,r=this.commands;n<r.length;n++){var i=e(r[n]);Array.isArray(i)?t.push.apply(t,i):t.push(i)}return this.commands=t,this},t.encode=function(e){return function(e){var t="";Array.isArray(e)||(e=[e]);for(var n=0;n<e.length;n++){var r=e[n];if(r.type===cNe.CLOSE_PATH)t+="z";else if(r.type===cNe.HORIZ_LINE_TO)t+=(r.relative?"h":"H")+r.x;else if(r.type===cNe.VERT_LINE_TO)t+=(r.relative?"v":"V")+r.y;else if(r.type===cNe.MOVE_TO)t+=(r.relative?"m":"M")+r.x+" "+r.y;else if(r.type===cNe.LINE_TO)t+=(r.relative?"l":"L")+r.x+" "+r.y;else if(r.type===cNe.CURVE_TO)t+=(r.relative?"c":"C")+r.x1+" "+r.y1+" "+r.x2+" "+r.y2+" "+r.x+" "+r.y;else if(r.type===cNe.SMOOTH_CURVE_TO)t+=(r.relative?"s":"S")+r.x2+" "+r.y2+" "+r.x+" "+r.y;else if(r.type===cNe.QUAD_TO)t+=(r.relative?"q":"Q")+r.x1+" "+r.y1+" "+r.x+" "+r.y;else if(r.type===cNe.SMOOTH_QUAD_TO)t+=(r.relative?"t":"T")+r.x+" "+r.y;else{if(r.type!==cNe.ARC)throw new Error('Unexpected command type "'+r.type+'" at index '+n+".");t+=(r.relative?"a":"A")+r.rX+" "+r.rY+" "+r.xRot+" "+ +r.lArcFlag+" "+ +r.sweepFlag+" "+r.x+" "+r.y}}return t}(e)},t.parse=function(e){var t=new ANe,n=[];return t.parse(e,n),t.finish(n),n},t.CLOSE_PATH=1,t.MOVE_TO=2,t.HORIZ_LINE_TO=4,t.VERT_LINE_TO=8,t.LINE_TO=16,t.CURVE_TO=32,t.SMOOTH_CURVE_TO=64,t.QUAD_TO=128,t.SMOOTH_QUAD_TO=256,t.ARC=512,t.LINE_COMMANDS=t.LINE_TO|t.HORIZ_LINE_TO|t.VERT_LINE_TO,t.DRAWING_COMMANDS=t.HORIZ_LINE_TO|t.VERT_LINE_TO|t.LINE_TO|t.CURVE_TO|t.SMOOTH_CURVE_TO|t.QUAD_TO|t.SMOOTH_QUAD_TO|t.ARC,t}(sNe),hNe=((aNe={})[cNe.MOVE_TO]=2,aNe[cNe.LINE_TO]=2,aNe[cNe.HORIZ_LINE_TO]=1,aNe[cNe.VERT_LINE_TO]=1,aNe[cNe.CLOSE_PATH]=0,aNe[cNe.QUAD_TO]=4,aNe[cNe.SMOOTH_QUAD_TO]=2,aNe[cNe.CURVE_TO]=6,aNe[cNe.SMOOTH_CURVE_TO]=4,aNe[cNe.ARC]=7,aNe),fNe=fpe,dNe=Mge,pNe=Jpe,gNe=GEe,vNe=RegExp.prototype,yNe=Wve.PROPER,mNe=Jye,wNe=_ve,bNe=KEe,INe=upe,BNe=function(e){var t=e.flags;return void 0!==t||"flags"in vNe||dNe(e,"flags")||!pNe(vNe,e)?t:fNe(gNe,e)},ENe="toString",CNe=RegExp.prototype.toString,xNe=INe((function(){return"/a/b"!=CNe.call({source:"a",flags:"b"})})),kNe=yNe&&CNe.name!=ENe;function SNe(e){return SNe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},SNe(e)}(xNe||kNe)&&mNe(RegExp.prototype,ENe,(function(){var e=wNe(this);return"/"+bNe(e.source)+"/"+bNe(BNe(e))}),{unsafe:!0});
802
802
  /**
803
803
  * StackBlur - a fast almost Gaussian Blur For Canvas
804
804
  *
@@ -838,4 +838,4 @@ var V_e=function(e,t){return(V_e=Object.setPrototypeOf||{__proto__:[]}instanceof
838
838
  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
839
839
  * OTHER DEALINGS IN THE SOFTWARE.
840
840
  */
841
- var SNe=[512,512,456,512,328,456,335,512,405,328,271,456,388,335,292,512,454,405,364,328,298,271,496,456,420,388,360,335,312,292,273,512,482,454,428,405,383,364,345,328,312,298,284,271,259,496,475,456,437,420,404,388,374,360,347,335,323,312,302,292,282,273,265,512,497,482,468,454,441,428,417,405,394,383,373,364,354,345,337,328,320,312,305,298,291,284,278,271,265,259,507,496,485,475,465,456,446,437,428,420,412,404,396,388,381,374,367,360,354,347,341,335,329,323,318,312,307,302,297,292,287,282,278,273,269,265,261,512,505,497,489,482,475,468,461,454,447,441,435,428,422,417,411,405,399,394,389,383,378,373,368,364,359,354,350,345,341,337,332,328,324,320,316,312,309,305,301,298,294,291,287,284,281,278,274,271,268,265,262,259,257,507,501,496,491,485,480,475,470,465,460,456,451,446,442,437,433,428,424,420,416,412,408,404,400,396,392,388,385,381,377,374,370,367,363,360,357,354,350,347,344,341,338,335,332,329,326,323,320,318,315,312,310,307,304,302,299,297,294,292,289,287,285,282,280,278,275,273,271,269,267,265,263,261,259],QNe=[9,11,12,13,13,14,14,15,15,15,15,16,16,16,16,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24];function _Ne(e,t,n,r,i,o){if(!(isNaN(o)||o<1)){o|=0;var a=function(e,t,n,r,i){if("string"==typeof e&&(e=document.getElementById(e)),!e||"object"!==kNe(e)||!("getContext"in e))throw new TypeError("Expecting canvas with `getContext` method in processCanvasRGB(A) calls!");var o=e.getContext("2d");try{return o.getImageData(t,n,r,i)}catch(e){throw new Error("unable to access image data: "+e)}}(e,t,n,r,i);a=function(e,t,n,r,i,o){for(var a,s=e.data,u=2*o+1,l=r-1,A=i-1,c=o+1,h=c*(c+1)/2,f=new NNe,d=f,p=1;p<u;p++)d=d.next=new NNe,p===c&&(a=d);d.next=f;for(var g=null,v=null,y=0,m=0,w=SNe[o],b=QNe[o],I=0;I<i;I++){d=f;for(var B=s[m],E=s[m+1],C=s[m+2],x=s[m+3],k=0;k<c;k++)d.r=B,d.g=E,d.b=C,d.a=x,d=d.next;for(var S=0,Q=0,_=0,N=0,D=c*B,F=c*E,P=c*C,U=c*x,L=h*B,M=h*E,T=h*C,R=h*x,O=1;O<c;O++){var H=m+((l<O?l:O)<<2),K=s[H],j=s[H+1],G=s[H+2],q=s[H+3],V=c-O;L+=(d.r=K)*V,M+=(d.g=j)*V,T+=(d.b=G)*V,R+=(d.a=q)*V,S+=K,Q+=j,_+=G,N+=q,d=d.next}g=f,v=a;for(var z=0;z<r;z++){var J=R*w>>b;if(s[m+3]=J,0!==J){var Y=255/J;s[m]=(L*w>>b)*Y,s[m+1]=(M*w>>b)*Y,s[m+2]=(T*w>>b)*Y}else s[m]=s[m+1]=s[m+2]=0;L-=D,M-=F,T-=P,R-=U,D-=g.r,F-=g.g,P-=g.b,U-=g.a;var X=z+o+1;X=y+(X<l?X:l)<<2,L+=S+=g.r=s[X],M+=Q+=g.g=s[X+1],T+=_+=g.b=s[X+2],R+=N+=g.a=s[X+3],g=g.next;var W=v,Z=W.r,$=W.g,ee=W.b,te=W.a;D+=Z,F+=$,P+=ee,U+=te,S-=Z,Q-=$,_-=ee,N-=te,v=v.next,m+=4}y+=r}for(var ne=0;ne<r;ne++){var re=s[m=ne<<2],ie=s[m+1],oe=s[m+2],ae=s[m+3],se=c*re,ue=c*ie,le=c*oe,Ae=c*ae,ce=h*re,he=h*ie,fe=h*oe,de=h*ae;d=f;for(var pe=0;pe<c;pe++)d.r=re,d.g=ie,d.b=oe,d.a=ae,d=d.next;for(var ge=r,ve=0,ye=0,me=0,we=0,be=1;be<=o;be++){m=ge+ne<<2;var Ie=c-be;ce+=(d.r=re=s[m])*Ie,he+=(d.g=ie=s[m+1])*Ie,fe+=(d.b=oe=s[m+2])*Ie,de+=(d.a=ae=s[m+3])*Ie,we+=re,ve+=ie,ye+=oe,me+=ae,d=d.next,be<A&&(ge+=r)}m=ne,g=f,v=a;for(var Be=0;Be<i;Be++){var Ee=m<<2;s[Ee+3]=ae=de*w>>b,ae>0?(ae=255/ae,s[Ee]=(ce*w>>b)*ae,s[Ee+1]=(he*w>>b)*ae,s[Ee+2]=(fe*w>>b)*ae):s[Ee]=s[Ee+1]=s[Ee+2]=0,ce-=se,he-=ue,fe-=le,de-=Ae,se-=g.r,ue-=g.g,le-=g.b,Ae-=g.a,Ee=ne+((Ee=Be+c)<A?Ee:A)*r<<2,ce+=we+=g.r=s[Ee],he+=ve+=g.g=s[Ee+1],fe+=ye+=g.b=s[Ee+2],de+=me+=g.a=s[Ee+3],g=g.next,se+=re=v.r,ue+=ie=v.g,le+=oe=v.b,Ae+=ae=v.a,we-=re,ve-=ie,ye-=oe,me-=ae,v=v.next,m+=r}}return e}(a,0,0,r,i,o),e.getContext("2d").putImageData(a,t,n)}}var NNe=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.r=0,this.g=0,this.b=0,this.a=0,this.next=null};var DNe=Object.freeze({__proto__:null,offscreen:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.DOMParser,n={window:null,ignoreAnimation:!0,ignoreMouse:!0,DOMParser:t,createCanvas:function(e,t){return new OffscreenCanvas(e,t)},createImage:function(e){return TEe(r().mark((function t(){var n,i,o;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,fetch(e);case 2:return n=t.sent,t.next=5,n.blob();case 5:return i=t.sent,t.next=8,createImageBitmap(i);case 8:return o=t.sent,t.abrupt("return",o);case 10:case"end":return t.stop()}}),t)})))()}};return"undefined"==typeof DOMParser&&void 0!==t||Reflect.deleteProperty(n,"DOMParser"),n},node:function(e){var t=e.DOMParser,n=e.canvas;return{window:null,ignoreAnimation:!0,ignoreMouse:!0,DOMParser:t,fetch:e.fetch,createCanvas:n.createCanvas,createImage:n.loadImage}}});function FNe(e){return e.replace(/(?!\u3000)\s+/gm," ")}function PNe(e){return e.replace(/^[\n \t]+/,"")}function UNe(e){return e.replace(/[\n \t]+$/,"")}function LNe(e){return((e||"").match(/-?(\d+(?:\.\d*(?:[eE][+-]?\d+)?)?|\.\d+)(?=\D|$)/gm)||[]).map(parseFloat)}var MNe=/^[A-Z-]+$/;function TNe(e){return MNe.test(e)?e.toLowerCase():e}function RNe(e){var t=/url\(('([^']+)'|"([^"]+)"|([^'")]+))\)/.exec(e)||[];return t[2]||t[3]||t[4]}function ONe(e){if(!e.startsWith("rgb"))return e;var t=3;return e.replace(/\d+(\.\d+)?/g,(function(e,n){return t--&&n?String(Math.round(parseFloat(e))):e}))}var HNe=/(\[[^\]]+\])/g,KNe=/(#[^\s+>~.[:]+)/g,jNe=/(\.[^\s+>~.[:]+)/g,GNe=/(::[^\s+>~.[:]+|:first-line|:first-letter|:before|:after)/gi,qNe=/(:[\w-]+\([^)]*\))/gi,VNe=/(:[^\s+>~.[:]+)/g,zNe=/([^\s+>~.[:]+)/g;function JNe(e,t){var n=t.exec(e);return n?[e.replace(t," "),n.length]:[e,0]}function YNe(e){var t=[0,0,0],n=e.replace(/:not\(([^)]*)\)/g," $1 ").replace(/{[\s\S]*/gm," "),r=0,i=C(JNe(n,HNe),2);n=i[0],r=i[1],t[1]+=r;var o=C(JNe(n,KNe),2);n=o[0],r=o[1],t[0]+=r;var a=C(JNe(n,jNe),2);n=a[0],r=a[1],t[1]+=r;var s=C(JNe(n,GNe),2);n=s[0],r=s[1],t[2]+=r;var u=C(JNe(n,qNe),2);n=u[0],r=u[1],t[1]+=r;var l=C(JNe(n,VNe),2);n=l[0],r=l[1],t[1]+=r;var A=C(JNe(n=n.replace(/[*\s+>~]/g," ").replace(/[#.]/g," "),zNe),2);return n=A[0],r=A[1],t[2]+=r,t.join("")}var XNe=1e-8;function WNe(e){return Math.sqrt(Math.pow(e[0],2)+Math.pow(e[1],2))}function ZNe(e,t){return(e[0]*t[0]+e[1]*t[1])/(WNe(e)*WNe(t))}function $Ne(e,t){return(e[0]*t[1]<e[1]*t[0]?-1:1)*Math.acos(ZNe(e,t))}function eDe(e){return e*e*e}function tDe(e){return 3*e*e*(1-e)}function nDe(e){return 3*e*(1-e)*(1-e)}function rDe(e){return(1-e)*(1-e)*(1-e)}function iDe(e){return e*e}function oDe(e){return 2*e*(1-e)}function aDe(e){return(1-e)*(1-e)}var sDe=function(){function e(t,n,r){s(this,e),this.document=t,this.name=n,this.value=r,this.isNormalizedColor=!1}return l(e,[{key:"split",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:" ",n=this.document,r=this.name;return FNe(this.getString()).trim().split(t).map((function(t){return new e(n,r,t)}))}},{key:"hasValue",value:function(e){var t=this.value;return null!==t&&""!==t&&(e||0!==t)&&void 0!==t}},{key:"isString",value:function(e){var t=this.value,n="string"==typeof t;return n&&e?e.test(t):n}},{key:"isUrlDefinition",value:function(){return this.isString(/^url\(/)}},{key:"isPixels",value:function(){if(!this.hasValue())return!1;var e=this.getString();switch(!0){case e.endsWith("px"):case/^[0-9]+$/.test(e):return!0;default:return!1}}},{key:"setValue",value:function(e){return this.value=e,this}},{key:"getValue",value:function(e){return void 0===e||this.hasValue()?this.value:e}},{key:"getNumber",value:function(e){if(!this.hasValue())return void 0===e?0:parseFloat(e);var t=this.value,n=parseFloat(t);return this.isString(/%$/)&&(n/=100),n}},{key:"getString",value:function(e){return void 0===e||this.hasValue()?void 0===this.value?"":String(this.value):String(e)}},{key:"getColor",value:function(e){var t=this.getString(e);return this.isNormalizedColor||(this.isNormalizedColor=!0,t=ONe(t),this.value=t),t}},{key:"getDpi",value:function(){return 96}},{key:"getRem",value:function(){return this.document.rootEmSize}},{key:"getEm",value:function(){return this.document.emSize}},{key:"getUnits",value:function(){return this.getString().replace(/[0-9.-]/g,"")}},{key:"getPixels",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!this.hasValue())return 0;var n="boolean"==typeof e?[void 0,e]:[e],r=C(n,2),i=r[0],o=r[1],a=this.document.screen.viewPort;switch(!0){case this.isString(/vmin$/):return this.getNumber()/100*Math.min(a.computeSize("x"),a.computeSize("y"));case this.isString(/vmax$/):return this.getNumber()/100*Math.max(a.computeSize("x"),a.computeSize("y"));case this.isString(/vw$/):return this.getNumber()/100*a.computeSize("x");case this.isString(/vh$/):return this.getNumber()/100*a.computeSize("y");case this.isString(/rem$/):return this.getNumber()*this.getRem();case this.isString(/em$/):return this.getNumber()*this.getEm();case this.isString(/ex$/):return this.getNumber()*this.getEm()/2;case this.isString(/px$/):return this.getNumber();case this.isString(/pt$/):return this.getNumber()*this.getDpi()*(1/72);case this.isString(/pc$/):return 15*this.getNumber();case this.isString(/cm$/):return this.getNumber()*this.getDpi()/2.54;case this.isString(/mm$/):return this.getNumber()*this.getDpi()/25.4;case this.isString(/in$/):return this.getNumber()*this.getDpi();case this.isString(/%$/)&&o:return this.getNumber()*this.getEm();case this.isString(/%$/):return this.getNumber()*a.computeSize(i);default:var s=this.getNumber();return t&&s<1?s*a.computeSize(i):s}}},{key:"getMilliseconds",value:function(){return this.hasValue()?this.isString(/ms$/)?this.getNumber():1e3*this.getNumber():0}},{key:"getRadians",value:function(){if(!this.hasValue())return 0;switch(!0){case this.isString(/deg$/):return this.getNumber()*(Math.PI/180);case this.isString(/grad$/):return this.getNumber()*(Math.PI/200);case this.isString(/rad$/):return this.getNumber();default:return this.getNumber()*(Math.PI/180)}}},{key:"getDefinition",value:function(){var e=this.getString(),t=/#([^)'"]+)/.exec(e);return t&&(t=t[1]),t||(t=e),this.document.definitions[t]}},{key:"getFillStyleDefinition",value:function(e,t){var n=this.getDefinition();if(!n)return null;if("function"==typeof n.createGradient)return n.createGradient(this.document.ctx,e,t);if("function"==typeof n.createPattern){if(n.getHrefAttribute().hasValue()){var r=n.getAttribute("patternTransform");n=n.getHrefAttribute().getDefinition(),r.hasValue()&&n.getAttribute("patternTransform",!0).setValue(r.value)}return n.createPattern(this.document.ctx,e,t)}return null}},{key:"getTextBaseline",value:function(){return this.hasValue()?e.textBaselineMapping[this.getString()]:null}},{key:"addOpacity",value:function(t){for(var n=this.getColor(),r=n.length,i=0,o=0;o<r&&(","===n[o]&&i++,3!==i);o++);if(t.hasValue()&&this.isString()&&3!==i){var a=new S_e(n);a.ok&&(a.alpha=t.getNumber(),n=a.toRGBA())}return new e(this.document,this.name,n)}}],[{key:"empty",value:function(t){return new e(t,"EMPTY","")}}]),e}();sDe.textBaselineMapping={baseline:"alphabetic","before-edge":"top","text-before-edge":"top",middle:"middle",central:"middle","after-edge":"bottom","text-after-edge":"bottom",ideographic:"ideographic",alphabetic:"alphabetic",hanging:"hanging",mathematical:"alphabetic"};var uDe=function(){function e(){s(this,e),this.viewPorts=[]}return l(e,[{key:"clear",value:function(){this.viewPorts=[]}},{key:"setCurrent",value:function(e,t){this.viewPorts.push({width:e,height:t})}},{key:"removeCurrent",value:function(){this.viewPorts.pop()}},{key:"getCurrent",value:function(){var e=this.viewPorts;return e[e.length-1]}},{key:"width",get:function(){return this.getCurrent().width}},{key:"height",get:function(){return this.getCurrent().height}},{key:"computeSize",value:function(e){return"number"==typeof e?e:"x"===e?this.width:"y"===e?this.height:Math.sqrt(Math.pow(this.width,2)+Math.pow(this.height,2))/Math.sqrt(2)}}]),e}(),lDe=function(){function e(t,n){s(this,e),this.x=t,this.y=n}return l(e,[{key:"angleTo",value:function(e){return Math.atan2(e.y-this.y,e.x-this.x)}},{key:"applyTransform",value:function(e){var t=this.x,n=this.y,r=t*e[0]+n*e[2]+e[4],i=t*e[1]+n*e[3]+e[5];this.x=r,this.y=i}}],[{key:"parse",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=LNe(t),i=C(r,2),o=i[0],a=void 0===o?n:o,s=i[1],u=void 0===s?n:s;return new e(a,u)}},{key:"parseScale",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=LNe(t),i=C(r,2),o=i[0],a=void 0===o?n:o,s=i[1],u=void 0===s?a:s;return new e(a,u)}},{key:"parsePath",value:function(t){for(var n=LNe(t),r=n.length,i=[],o=0;o<r;o+=2)i.push(new e(n[o],n[o+1]));return i}}]),e}(),ADe=function(){function e(t){s(this,e),this.screen=t,this.working=!1,this.events=[],this.eventElements=[],this.onClick=this.onClick.bind(this),this.onMouseMove=this.onMouseMove.bind(this)}return l(e,[{key:"isWorking",value:function(){return this.working}},{key:"start",value:function(){if(!this.working){var e=this.screen,t=this.onClick,n=this.onMouseMove,r=e.ctx.canvas;r.onclick=t,r.onmousemove=n,this.working=!0}}},{key:"stop",value:function(){if(this.working){var e=this.screen.ctx.canvas;this.working=!1,e.onclick=null,e.onmousemove=null}}},{key:"hasEvents",value:function(){return this.working&&this.events.length>0}},{key:"runEvents",value:function(){if(this.working){var e=this.screen,t=this.events,n=this.eventElements,r=e.ctx.canvas.style;r&&(r.cursor=""),t.forEach((function(e,t){for(var r=e.run,i=n[t];i;)r(i),i=i.parent})),this.events=[],this.eventElements=[]}}},{key:"checkPath",value:function(e,t){if(this.working&&t){var n=this.events,r=this.eventElements;n.forEach((function(n,i){var o=n.x,a=n.y;!r[i]&&t.isPointInPath&&t.isPointInPath(o,a)&&(r[i]=e)}))}}},{key:"checkBoundingBox",value:function(e,t){if(this.working&&t){var n=this.events,r=this.eventElements;n.forEach((function(n,i){var o=n.x,a=n.y;!r[i]&&t.isPointInBox(o,a)&&(r[i]=e)}))}}},{key:"mapXY",value:function(e,t){for(var n=this.screen,r=n.window,i=n.ctx,o=new lDe(e,t),a=i.canvas;a;)o.x-=a.offsetLeft,o.y-=a.offsetTop,a=a.offsetParent;return r.scrollX&&(o.x+=r.scrollX),r.scrollY&&(o.y+=r.scrollY),o}},{key:"onClick",value:function(e){var t=this.mapXY(e.clientX,e.clientY),n=t.x,r=t.y;this.events.push({type:"onclick",x:n,y:r,run:function(e){e.onClick&&e.onClick()}})}},{key:"onMouseMove",value:function(e){var t=this.mapXY(e.clientX,e.clientY),n=t.x,r=t.y;this.events.push({type:"onmousemove",x:n,y:r,run:function(e){e.onMouseMove&&e.onMouseMove()}})}}]),e}(),cDe="undefined"!=typeof window?window:null,hDe="undefined"!=typeof fetch?fetch.bind(void 0):null,fDe=function(){function e(t){s(this,e);var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.fetch,i=void 0===r?hDe:r,o=n.window,a=void 0===o?cDe:o;this.ctx=t,this.FRAMERATE=30,this.MAX_VIRTUAL_PIXELS=3e4,this.CLIENT_WIDTH=800,this.CLIENT_HEIGHT=600,this.viewPort=new uDe,this.mouse=new ADe(this),this.animations=[],this.waits=[],this.frameDuration=0,this.isReadyLock=!1,this.isFirstRender=!0,this.intervalId=null,this.window=a,this.fetch=i}return l(e,[{key:"wait",value:function(e){this.waits.push(e)}},{key:"ready",value:function(){return this.readyPromise?this.readyPromise:Promise.resolve()}},{key:"isReady",value:function(){if(this.isReadyLock)return!0;var e=this.waits.every((function(e){return e()}));return e&&(this.waits=[],this.resolveReady&&this.resolveReady()),this.isReadyLock=e,e}},{key:"setDefaults",value:function(e){e.strokeStyle="rgba(0,0,0,0)",e.lineCap="butt",e.lineJoin="miter",e.miterLimit=4}},{key:"setViewBox",value:function(e){var t=e.document,n=e.ctx,r=e.aspectRatio,i=e.width,o=e.desiredWidth,a=e.height,s=e.desiredHeight,u=e.minX,l=void 0===u?0:u,A=e.minY,c=void 0===A?0:A,h=e.refX,f=e.refY,d=e.clip,p=void 0!==d&&d,g=e.clipX,v=void 0===g?0:g,y=e.clipY,m=void 0===y?0:y,w=C(FNe(r).replace(/^defer\s/,"").split(" "),2),b=w[0]||"xMidYMid",I=w[1]||"meet",B=i/o,E=a/s,x=Math.min(B,E),k=Math.max(B,E),S=o,Q=s;"meet"===I&&(S*=x,Q*=x),"slice"===I&&(S*=k,Q*=k);var _=new sDe(t,"refX",h),N=new sDe(t,"refY",f),D=_.hasValue()&&N.hasValue();if(D&&n.translate(-x*_.getPixels("x"),-x*N.getPixels("y")),p){var F=x*v,P=x*m;n.beginPath(),n.moveTo(F,P),n.lineTo(i,P),n.lineTo(i,a),n.lineTo(F,a),n.closePath(),n.clip()}if(!D){var U="meet"===I&&x===E,L="slice"===I&&k===E,M="meet"===I&&x===B,T="slice"===I&&k===B;b.startsWith("xMid")&&(U||L)&&n.translate(i/2-S/2,0),b.endsWith("YMid")&&(M||T)&&n.translate(0,a/2-Q/2),b.startsWith("xMax")&&(U||L)&&n.translate(i-S,0),b.endsWith("YMax")&&(M||T)&&n.translate(0,a-Q)}switch(!0){case"none"===b:n.scale(B,E);break;case"meet"===I:n.scale(x,x);break;case"slice"===I:n.scale(k,k)}n.translate(-l,-c)}},{key:"start",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.enableRedraw,i=void 0!==r&&r,o=n.ignoreMouse,a=void 0!==o&&o,s=n.ignoreAnimation,u=void 0!==s&&s,l=n.ignoreDimensions,A=void 0!==l&&l,c=n.ignoreClear,h=void 0!==c&&c,f=n.forceRedraw,d=n.scaleWidth,p=n.scaleHeight,g=n.offsetX,v=n.offsetY,y=this.FRAMERATE,m=this.mouse,w=1e3/y;if(this.frameDuration=w,this.readyPromise=new Promise((function(e){t.resolveReady=e})),this.isReady()&&this.render(e,A,h,d,p,g,v),i){var b=Date.now(),I=b,B=0,E=function n(){b=Date.now(),(B=b-I)>=w&&(I=b-B%w,t.shouldUpdate(u,f)&&(t.render(e,A,h,d,p,g,v),m.runEvents())),t.intervalId=r_e.exports(n)};a||m.start(),this.intervalId=r_e.exports(E)}}},{key:"stop",value:function(){this.intervalId&&(r_e.exports.cancel(this.intervalId),this.intervalId=null),this.mouse.stop()}},{key:"shouldUpdate",value:function(e,t){if(!e){var n=this.frameDuration,r=this.animations.reduce((function(e,t){return t.update(n)||e}),!1);if(r)return!0}return!("function"!=typeof t||!t())||(!(this.isReadyLock||!this.isReady())||!!this.mouse.hasEvents())}},{key:"render",value:function(e,t,n,r,i,o,a){var s=this.CLIENT_WIDTH,u=this.CLIENT_HEIGHT,l=this.viewPort,A=this.ctx,c=this.isFirstRender,h=A.canvas;l.clear(),h.width&&h.height?l.setCurrent(h.width,h.height):l.setCurrent(s,u);var f=e.getStyle("width"),d=e.getStyle("height");!t&&(c||"number"!=typeof r&&"number"!=typeof i)&&(f.hasValue()&&(h.width=f.getPixels("x"),h.style&&(h.style.width="".concat(h.width,"px"))),d.hasValue()&&(h.height=d.getPixels("y"),h.style&&(h.style.height="".concat(h.height,"px"))));var p=h.clientWidth||h.width,g=h.clientHeight||h.height;if(t&&f.hasValue()&&d.hasValue()&&(p=f.getPixels("x"),g=d.getPixels("y")),l.setCurrent(p,g),"number"==typeof o&&e.getAttribute("x",!0).setValue(o),"number"==typeof a&&e.getAttribute("y",!0).setValue(a),"number"==typeof r||"number"==typeof i){var v=LNe(e.getAttribute("viewBox").getString()),y=0,m=0;if("number"==typeof r){var w=e.getStyle("width");w.hasValue()?y=w.getPixels("x")/r:isNaN(v[2])||(y=v[2]/r)}if("number"==typeof i){var b=e.getStyle("height");b.hasValue()?m=b.getPixels("y")/i:isNaN(v[3])||(m=v[3]/i)}y||(y=m),m||(m=y),e.getAttribute("width",!0).setValue(r),e.getAttribute("height",!0).setValue(i);var I=e.getStyle("transform",!0,!0);I.setValue("".concat(I.getString()," scale(").concat(1/y,", ").concat(1/m,")"))}n||A.clearRect(0,0,p,g),e.render(A),c&&(this.isFirstRender=!1)}}]),e}();fDe.defaultWindow=cDe,fDe.defaultFetch=hDe;var dDe=fDe.defaultFetch,pDe="undefined"!=typeof DOMParser?DOMParser:null,gDe=function(){function e(){s(this,e);var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.fetch,r=void 0===n?dDe:n,i=t.DOMParser,o=void 0===i?pDe:i;this.fetch=r,this.DOMParser=o}return l(e,[{key:"parse",value:function(e){var t=this;return TEe(r().mark((function n(){return r().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!e.startsWith("<")){n.next=2;break}return n.abrupt("return",t.parseFromString(e));case 2:return n.abrupt("return",t.load(e));case 3:case"end":return n.stop()}}),n)})))()}},{key:"parseFromString",value:function(e){var t=new this.DOMParser;try{return this.checkDocument(t.parseFromString(e,"image/svg+xml"))}catch(n){return this.checkDocument(t.parseFromString(e,"text/xml"))}}},{key:"checkDocument",value:function(e){var t=e.getElementsByTagName("parsererror")[0];if(t)throw new Error(t.textContent);return e}},{key:"load",value:function(e){var t=this;return TEe(r().mark((function n(){var i,o;return r().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,t.fetch(e);case 2:return i=n.sent,n.next=5,i.text();case 5:return o=n.sent,n.abrupt("return",t.parseFromString(o));case 7:case"end":return n.stop()}}),n)})))()}}]),e}(),vDe=function(){function e(t,n){s(this,e),this.type="translate",this.point=null,this.point=lDe.parse(n)}return l(e,[{key:"apply",value:function(e){var t=this.point,n=t.x,r=t.y;e.translate(n||0,r||0)}},{key:"unapply",value:function(e){var t=this.point,n=t.x,r=t.y;e.translate(-1*n||0,-1*r||0)}},{key:"applyToPoint",value:function(e){var t=this.point,n=t.x,r=t.y;e.applyTransform([1,0,0,1,n||0,r||0])}}]),e}(),yDe=function(){function e(t,n,r){s(this,e),this.type="rotate",this.angle=null,this.originX=null,this.originY=null,this.cx=0,this.cy=0;var i=LNe(n);this.angle=new sDe(t,"angle",i[0]),this.originX=r[0],this.originY=r[1],this.cx=i[1]||0,this.cy=i[2]||0}return l(e,[{key:"apply",value:function(e){var t=this.cx,n=this.cy,r=this.originX,i=this.originY,o=this.angle,a=t+r.getPixels("x"),s=n+i.getPixels("y");e.translate(a,s),e.rotate(o.getRadians()),e.translate(-a,-s)}},{key:"unapply",value:function(e){var t=this.cx,n=this.cy,r=this.originX,i=this.originY,o=this.angle,a=t+r.getPixels("x"),s=n+i.getPixels("y");e.translate(a,s),e.rotate(-1*o.getRadians()),e.translate(-a,-s)}},{key:"applyToPoint",value:function(e){var t=this.cx,n=this.cy,r=this.angle.getRadians();e.applyTransform([1,0,0,1,t||0,n||0]),e.applyTransform([Math.cos(r),Math.sin(r),-Math.sin(r),Math.cos(r),0,0]),e.applyTransform([1,0,0,1,-t||0,-n||0])}}]),e}(),mDe=function(){function e(t,n,r){s(this,e),this.type="scale",this.scale=null,this.originX=null,this.originY=null;var i=lDe.parseScale(n);0!==i.x&&0!==i.y||(i.x=XNe,i.y=XNe),this.scale=i,this.originX=r[0],this.originY=r[1]}return l(e,[{key:"apply",value:function(e){var t=this.scale,n=t.x,r=t.y,i=this.originX,o=this.originY,a=i.getPixels("x"),s=o.getPixels("y");e.translate(a,s),e.scale(n,r||n),e.translate(-a,-s)}},{key:"unapply",value:function(e){var t=this.scale,n=t.x,r=t.y,i=this.originX,o=this.originY,a=i.getPixels("x"),s=o.getPixels("y");e.translate(a,s),e.scale(1/n,1/r||n),e.translate(-a,-s)}},{key:"applyToPoint",value:function(e){var t=this.scale,n=t.x,r=t.y;e.applyTransform([n||0,0,0,r||0,0,0])}}]),e}(),wDe=function(){function e(t,n,r){s(this,e),this.type="matrix",this.matrix=[],this.originX=null,this.originY=null,this.matrix=LNe(n),this.originX=r[0],this.originY=r[1]}return l(e,[{key:"apply",value:function(e){var t=this.originX,n=this.originY,r=this.matrix,i=t.getPixels("x"),o=n.getPixels("y");e.translate(i,o),e.transform(r[0],r[1],r[2],r[3],r[4],r[5]),e.translate(-i,-o)}},{key:"unapply",value:function(e){var t=this.originX,n=this.originY,r=this.matrix,i=r[0],o=r[2],a=r[4],s=r[1],u=r[3],l=r[5],A=1/(i*(1*u-0*l)-o*(1*s-0*l)+a*(0*s-0*u)),c=t.getPixels("x"),h=n.getPixels("y");e.translate(c,h),e.transform(A*(1*u-0*l),A*(0*l-1*s),A*(0*a-1*o),A*(1*i-0*a),A*(o*l-a*u),A*(a*s-i*l)),e.translate(-c,-h)}},{key:"applyToPoint",value:function(e){e.applyTransform(this.matrix)}}]),e}(),bDe=function(e){c(n,e);var t=b(n);function n(e,r,i){var o;return s(this,n),(o=t.call(this,e,r,i)).type="skew",o.angle=null,o.angle=new sDe(e,"angle",r),o}return l(n)}(wDe),IDe=function(e){c(n,e);var t=b(n);function n(e,r,i){var o;return s(this,n),(o=t.call(this,e,r,i)).type="skewX",o.matrix=[1,0,Math.tan(o.angle.getRadians()),1,0,0],o}return l(n)}(bDe),BDe=function(e){c(n,e);var t=b(n);function n(e,r,i){var o;return s(this,n),(o=t.call(this,e,r,i)).type="skewY",o.matrix=[1,Math.tan(o.angle.getRadians()),0,1,0,0],o}return l(n)}(bDe);var EDe=function(){function e(t,n,r){var i=this;s(this,e),this.document=t,this.transforms=[];var o=function(e){return FNe(e).trim().replace(/\)([a-zA-Z])/g,") $1").replace(/\)(\s?,\s?)/g,") ").split(/\s(?=[a-z])/)}(n);o.forEach((function(t){if("none"!==t){var n=function(e){var t=C(e.split("("),2),n=t[0],r=t[1];return[n.trim(),r.trim().replace(")","")]}(t),o=C(n,2),a=o[0],s=o[1],u=e.transformTypes[a];void 0!==u&&i.transforms.push(new u(i.document,s,r))}}))}return l(e,[{key:"apply",value:function(e){for(var t=this.transforms,n=t.length,r=0;r<n;r++)t[r].apply(e)}},{key:"unapply",value:function(e){for(var t=this.transforms,n=t.length-1;n>=0;n--)t[n].unapply(e)}},{key:"applyToPoint",value:function(e){for(var t=this.transforms,n=t.length,r=0;r<n;r++)t[r].applyToPoint(e)}}],[{key:"fromElement",value:function(t,n){var r=n.getStyle("transform",!1,!0),i=C(n.getStyle("transform-origin",!1,!0).split(),2),o=i[0],a=i[1],s=[o,void 0===a?o:a];return r.hasValue()?new e(t,r.getString(),s):null}}]),e}();EDe.transformTypes={translate:vDe,rotate:yDe,scale:mDe,matrix:wDe,skewX:IDe,skewY:BDe};var CDe=function(){function e(t,n){var r=this;s(this,e);var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(this.document=t,this.node=n,this.captureTextNodes=i,this.attributes={},this.styles={},this.stylesSpecificity={},this.animationFrozen=!1,this.animationFrozenValue="",this.parent=null,this.children=[],n&&1===n.nodeType){if(Array.from(n.attributes).forEach((function(e){var n=TNe(e.nodeName);r.attributes[n]=new sDe(t,n,e.value)})),this.addStylesFromStyleDefinition(),this.getAttribute("style").hasValue()){var o=this.getAttribute("style").getString().split(";").map((function(e){return e.trim()}));o.forEach((function(e){if(e){var n=e.split(":").map((function(e){return e.trim()})),i=C(n,2),o=i[0],a=i[1];r.styles[o]=new sDe(t,o,a)}}))}var a=t.definitions,u=this.getAttribute("id");u.hasValue()&&(a[u.getString()]||(a[u.getString()]=this)),Array.from(n.childNodes).forEach((function(e){if(1===e.nodeType)r.addChild(e);else if(i&&(3===e.nodeType||4===e.nodeType)){var n=t.createTextNode(e);n.getText().length>0&&r.addChild(n)}}))}}return l(e,[{key:"getAttribute",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.attributes[e];if(!n&&t){var r=new sDe(this.document,e,"");return this.attributes[e]=r,r}return n||sDe.empty(this.document)}},{key:"getHrefAttribute",value:function(){for(var e in this.attributes)if("href"===e||e.endsWith(":href"))return this.attributes[e];return sDe.empty(this.document)}},{key:"getStyle",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=this.styles[e];if(r)return r;var i=this.getAttribute(e);if(null!=i&&i.hasValue())return this.styles[e]=i,i;if(!n){var o=this.parent;if(o){var a=o.getStyle(e);if(null!=a&&a.hasValue())return a}}if(t){var s=new sDe(this.document,e,"");return this.styles[e]=s,s}return r||sDe.empty(this.document)}},{key:"render",value:function(e){if("none"!==this.getStyle("display").getString()&&"hidden"!==this.getStyle("visibility").getString()){if(e.save(),this.getStyle("mask").hasValue()){var t=this.getStyle("mask").getDefinition();t&&(this.applyEffects(e),t.apply(e,this))}else if("none"!==this.getStyle("filter").getValue("none")){var n=this.getStyle("filter").getDefinition();n&&(this.applyEffects(e),n.apply(e,this))}else this.setContext(e),this.renderChildren(e),this.clearContext(e);e.restore()}}},{key:"setContext",value:function(e){}},{key:"applyEffects",value:function(e){var t=EDe.fromElement(this.document,this);t&&t.apply(e);var n=this.getStyle("clip-path",!1,!0);if(n.hasValue()){var r=n.getDefinition();r&&r.apply(e)}}},{key:"clearContext",value:function(e){}},{key:"renderChildren",value:function(e){this.children.forEach((function(t){t.render(e)}))}},{key:"addChild",value:function(t){var n=t instanceof e?t:this.document.createElement(t);n.parent=this,e.ignoreChildTypes.includes(n.type)||this.children.push(n)}},{key:"matchesSelector",value:function(e){var t,n=this.node;if("function"==typeof n.matches)return n.matches(e);var r=null===(t=n.getAttribute)||void 0===t?void 0:t.call(n,"class");return!(!r||""===r)&&r.split(" ").some((function(t){return".".concat(t)===e}))}},{key:"addStylesFromStyleDefinition",value:function(){var e=this.document,t=e.styles,n=e.stylesSpecificity;for(var r in t)if(!r.startsWith("@")&&this.matchesSelector(r)){var i=t[r],o=n[r];if(i)for(var a in i){var s=this.stylesSpecificity[a];void 0===s&&(s="000"),o>=s&&(this.styles[a]=i[a],this.stylesSpecificity[a]=o)}}}},{key:"removeStyles",value:function(e,t){return t.reduce((function(t,n){var r=e.getStyle(n);if(!r.hasValue())return t;var i=r.getString();return r.setValue(""),[].concat(k(t),[[n,i]])}),[])}},{key:"restoreStyles",value:function(e,t){t.forEach((function(t){var n=C(t,2),r=n[0],i=n[1];e.getStyle(r,!0).setValue(i)}))}},{key:"isFirstChild",value:function(){var e;return 0===(null===(e=this.parent)||void 0===e?void 0:e.children.indexOf(this))}}]),e}();CDe.ignoreChildTypes=["title"];var xDe=function(e){c(n,e);var t=b(n);function n(e,r,i){return s(this,n),t.call(this,e,r,i)}return l(n)}(CDe);function kDe(e){var t=e.trim();return/^('|")/.test(t)?t:'"'.concat(t,'"')}function SDe(e){if(!e)return"";var t=e.trim().toLowerCase();switch(t){case"normal":case"italic":case"oblique":case"inherit":case"initial":case"unset":return t;default:return/^oblique\s+(-|)\d+deg$/.test(t)?t:""}}function QDe(e){if(!e)return"";var t=e.trim().toLowerCase();switch(t){case"normal":case"bold":case"lighter":case"bolder":case"inherit":case"initial":case"unset":return t;default:return/^[\d.]+$/.test(t)?t:""}}var _De=function(){function e(t,n,r,i,o,a){s(this,e);var u=a?"string"==typeof a?e.parse(a):a:{};this.fontFamily=o||u.fontFamily,this.fontSize=i||u.fontSize,this.fontStyle=t||u.fontStyle,this.fontWeight=r||u.fontWeight,this.fontVariant=n||u.fontVariant}return l(e,[{key:"toString",value:function(){return[SDe(this.fontStyle),this.fontVariant,QDe(this.fontWeight),this.fontSize,(e=this.fontFamily,"undefined"==typeof process?e:e.trim().split(",").map(kDe).join(","))].join(" ").trim();var e}}],[{key:"parse",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1?arguments[1]:void 0,r="",i="",o="",a="",s="",u=FNe(t).trim().split(" "),l={fontSize:!1,fontStyle:!1,fontWeight:!1,fontVariant:!1};return u.forEach((function(t){switch(!0){case!l.fontStyle&&e.styles.includes(t):"inherit"!==t&&(r=t),l.fontStyle=!0;break;case!l.fontVariant&&e.variants.includes(t):"inherit"!==t&&(i=t),l.fontStyle=!0,l.fontVariant=!0;break;case!l.fontWeight&&e.weights.includes(t):"inherit"!==t&&(o=t),l.fontStyle=!0,l.fontVariant=!0,l.fontWeight=!0;break;case!l.fontSize:if("inherit"!==t){var n=C(t.split("/"),1);a=n[0]}l.fontStyle=!0,l.fontVariant=!0,l.fontWeight=!0,l.fontSize=!0;break;default:"inherit"!==t&&(s+=t)}})),new e(r,i,o,a,s,n)}}]),e}();_De.styles="normal|italic|oblique|inherit",_De.variants="normal|small-caps|inherit",_De.weights="normal|bold|bolder|lighter|100|200|300|400|500|600|700|800|900|inherit";var NDe=function(){function e(){s(this,e);var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Number.NaN,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Number.NaN,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Number.NaN,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Number.NaN;this.x1=t,this.y1=n,this.x2=r,this.y2=i,this.addPoint(t,n),this.addPoint(r,i)}return l(e,[{key:"x",get:function(){return this.x1}},{key:"y",get:function(){return this.y1}},{key:"width",get:function(){return this.x2-this.x1}},{key:"height",get:function(){return this.y2-this.y1}},{key:"addPoint",value:function(e,t){void 0!==e&&((isNaN(this.x1)||isNaN(this.x2))&&(this.x1=e,this.x2=e),e<this.x1&&(this.x1=e),e>this.x2&&(this.x2=e)),void 0!==t&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=t,this.y2=t),t<this.y1&&(this.y1=t),t>this.y2&&(this.y2=t))}},{key:"addX",value:function(e){this.addPoint(e,null)}},{key:"addY",value:function(e){this.addPoint(null,e)}},{key:"addBoundingBox",value:function(e){if(e){var t=e.x1,n=e.y1,r=e.x2,i=e.y2;this.addPoint(t,n),this.addPoint(r,i)}}},{key:"sumCubic",value:function(e,t,n,r,i){return Math.pow(1-e,3)*t+3*Math.pow(1-e,2)*e*n+3*(1-e)*Math.pow(e,2)*r+Math.pow(e,3)*i}},{key:"bezierCurveAdd",value:function(e,t,n,r,i){var o=6*t-12*n+6*r,a=-3*t+9*n-9*r+3*i,s=3*n-3*t;if(0!==a){var u=Math.pow(o,2)-4*s*a;if(!(u<0)){var l=(-o+Math.sqrt(u))/(2*a);0<l&&l<1&&(e?this.addX(this.sumCubic(l,t,n,r,i)):this.addY(this.sumCubic(l,t,n,r,i)));var A=(-o-Math.sqrt(u))/(2*a);0<A&&A<1&&(e?this.addX(this.sumCubic(A,t,n,r,i)):this.addY(this.sumCubic(A,t,n,r,i)))}}else{if(0===o)return;var c=-s/o;0<c&&c<1&&(e?this.addX(this.sumCubic(c,t,n,r,i)):this.addY(this.sumCubic(c,t,n,r,i)))}}},{key:"addBezierCurve",value:function(e,t,n,r,i,o,a,s){this.addPoint(e,t),this.addPoint(a,s),this.bezierCurveAdd(!0,e,n,i,a),this.bezierCurveAdd(!1,t,r,o,s)}},{key:"addQuadraticCurve",value:function(e,t,n,r,i,o){var a=e+2/3*(n-e),s=t+2/3*(r-t),u=a+1/3*(i-e),l=s+1/3*(o-t);this.addBezierCurve(e,t,a,u,s,l,i,o)}},{key:"isPointInBox",value:function(e,t){var n=this.x1,r=this.y1,i=this.x2,o=this.y2;return n<=e&&e<=i&&r<=t&&t<=o}}]),e}(),DDe=function(e){c(n,e);var t=b(n);function n(e){var r;return s(this,n),(r=t.call(this,e.replace(/([+\-.])\s+/gm,"$1").replace(/[^MmZzLlHhVvCcSsQqTtAae\d\s.,+-].*/g,""))).control=null,r.start=null,r.current=null,r.command=null,r.commands=r.commands,r.i=-1,r.previousCommand=null,r.points=[],r.angles=[],r}return l(n,[{key:"reset",value:function(){this.i=-1,this.command=null,this.previousCommand=null,this.start=new lDe(0,0),this.control=new lDe(0,0),this.current=new lDe(0,0),this.points=[],this.angles=[]}},{key:"isEnd",value:function(){return this.i>=this.commands.length-1}},{key:"next",value:function(){var e=this.commands[++this.i];return this.previousCommand=this.command,this.command=e,e}},{key:"getPoint",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"x",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"y",n=new lDe(this.command[e],this.command[t]);return this.makeAbsolute(n)}},{key:"getAsControlPoint",value:function(e,t){var n=this.getPoint(e,t);return this.control=n,n}},{key:"getAsCurrentPoint",value:function(e,t){var n=this.getPoint(e,t);return this.current=n,n}},{key:"getReflectedControlPoint",value:function(){var e=this.previousCommand.type;if(e!==ANe.CURVE_TO&&e!==ANe.SMOOTH_CURVE_TO&&e!==ANe.QUAD_TO&&e!==ANe.SMOOTH_QUAD_TO)return this.current;var t=this.current,n=t.x,r=t.y,i=this.control,o=i.x,a=i.y;return new lDe(2*n-o,2*r-a)}},{key:"makeAbsolute",value:function(e){if(this.command.relative){var t=this.current,n=t.x,r=t.y;e.x+=n,e.y+=r}return e}},{key:"addMarker",value:function(e,t,n){var r=this.points,i=this.angles;n&&i.length>0&&!i[i.length-1]&&(i[i.length-1]=r[r.length-1].angleTo(n)),this.addMarkerAngle(e,t?t.angleTo(e):null)}},{key:"addMarkerAngle",value:function(e,t){this.points.push(e),this.angles.push(t)}},{key:"getMarkerPoints",value:function(){return this.points}},{key:"getMarkerAngles",value:function(){for(var e=this.angles,t=e.length,n=0;n<t;n++)if(!e[n])for(var r=n+1;r<t;r++)if(e[r]){e[n]=e[r];break}return e}}]),n}(ANe),FDe=function(e){c(n,e);var t=b(n);function n(){var e;return s(this,n),(e=t.apply(this,arguments)).modifiedEmSizeStack=!1,e}return l(n,[{key:"calculateOpacity",value:function(){for(var e=1,t=this;t;){var n=t.getStyle("opacity",!1,!0);n.hasValue(!0)&&(e*=n.getNumber()),t=t.parent}return e}},{key:"setContext",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!t){var n=this.getStyle("fill"),r=this.getStyle("fill-opacity"),i=this.getStyle("stroke"),o=this.getStyle("stroke-opacity");if(n.isUrlDefinition()){var a=n.getFillStyleDefinition(this,r);a&&(e.fillStyle=a)}else if(n.hasValue()){"currentColor"===n.getString()&&n.setValue(this.getStyle("color").getColor());var s=n.getColor();"inherit"!==s&&(e.fillStyle="none"===s?"rgba(0,0,0,0)":s)}if(r.hasValue()){var u=new sDe(this.document,"fill",e.fillStyle).addOpacity(r).getColor();e.fillStyle=u}if(i.isUrlDefinition()){var l=i.getFillStyleDefinition(this,o);l&&(e.strokeStyle=l)}else if(i.hasValue()){"currentColor"===i.getString()&&i.setValue(this.getStyle("color").getColor());var A=i.getString();"inherit"!==A&&(e.strokeStyle="none"===A?"rgba(0,0,0,0)":A)}if(o.hasValue()){var c=new sDe(this.document,"stroke",e.strokeStyle).addOpacity(o).getString();e.strokeStyle=c}var h=this.getStyle("stroke-width");if(h.hasValue()){var f=h.getPixels();e.lineWidth=f||XNe}var d=this.getStyle("stroke-linecap"),p=this.getStyle("stroke-linejoin"),g=this.getStyle("stroke-miterlimit"),v=this.getStyle("stroke-dasharray"),y=this.getStyle("stroke-dashoffset");if(d.hasValue()&&(e.lineCap=d.getString()),p.hasValue()&&(e.lineJoin=p.getString()),g.hasValue()&&(e.miterLimit=g.getNumber()),v.hasValue()&&"none"!==v.getString()){var m=LNe(v.getString());void 0!==e.setLineDash?e.setLineDash(m):void 0!==e.webkitLineDash?e.webkitLineDash=m:void 0===e.mozDash||1===m.length&&0===m[0]||(e.mozDash=m);var w=y.getPixels();void 0!==e.lineDashOffset?e.lineDashOffset=w:void 0!==e.webkitLineDashOffset?e.webkitLineDashOffset=w:void 0!==e.mozDashOffset&&(e.mozDashOffset=w)}}if(this.modifiedEmSizeStack=!1,void 0!==e.font){var b=this.getStyle("font"),I=this.getStyle("font-style"),B=this.getStyle("font-variant"),E=this.getStyle("font-weight"),C=this.getStyle("font-size"),x=this.getStyle("font-family"),k=new _De(I.getString(),B.getString(),E.getString(),C.hasValue()?"".concat(C.getPixels(!0),"px"):"",x.getString(),_De.parse(b.getString(),e.font));I.setValue(k.fontStyle),B.setValue(k.fontVariant),E.setValue(k.fontWeight),C.setValue(k.fontSize),x.setValue(k.fontFamily),e.font=k.toString(),C.isPixels()&&(this.document.emSize=C.getPixels(),this.modifiedEmSizeStack=!0)}t||(this.applyEffects(e),e.globalAlpha=this.calculateOpacity())}},{key:"clearContext",value:function(e){B(h(n.prototype),"clearContext",this).call(this,e),this.modifiedEmSizeStack&&this.document.popEmSize()}}]),n}(CDe),PDe=function(e){c(n,e);var t=b(n);function n(e,r,i){var o;return s(this,n),(o=t.call(this,e,r,i)).type="path",o.pathParser=null,o.pathParser=new DDe(o.getAttribute("d").getString()),o}return l(n,[{key:"path",value:function(e){var t=this.pathParser,n=new NDe;for(t.reset(),e&&e.beginPath();!t.isEnd();)switch(t.next().type){case DDe.MOVE_TO:this.pathM(e,n);break;case DDe.LINE_TO:this.pathL(e,n);break;case DDe.HORIZ_LINE_TO:this.pathH(e,n);break;case DDe.VERT_LINE_TO:this.pathV(e,n);break;case DDe.CURVE_TO:this.pathC(e,n);break;case DDe.SMOOTH_CURVE_TO:this.pathS(e,n);break;case DDe.QUAD_TO:this.pathQ(e,n);break;case DDe.SMOOTH_QUAD_TO:this.pathT(e,n);break;case DDe.ARC:this.pathA(e,n);break;case DDe.CLOSE_PATH:this.pathZ(e,n)}return n}},{key:"getBoundingBox",value:function(e){return this.path()}},{key:"getMarkers",value:function(){var e=this.pathParser,t=e.getMarkerPoints(),n=e.getMarkerAngles(),r=t.map((function(e,t){return[e,n[t]]}));return r}},{key:"renderChildren",value:function(e){this.path(e),this.document.screen.mouse.checkPath(this,e);var t=this.getStyle("fill-rule");""!==e.fillStyle&&("inherit"!==t.getString("inherit")?e.fill(t.getString()):e.fill()),""!==e.strokeStyle&&("non-scaling-stroke"===this.getAttribute("vector-effect").getString()?(e.save(),e.setTransform(1,0,0,1,0,0),e.stroke(),e.restore()):e.stroke());var n=this.getMarkers();if(n){var r=n.length-1,i=this.getStyle("marker-start"),o=this.getStyle("marker-mid"),a=this.getStyle("marker-end");if(i.isUrlDefinition()){var s=i.getDefinition(),u=C(n[0],2),l=u[0],A=u[1];s.render(e,l,A)}if(o.isUrlDefinition())for(var c=o.getDefinition(),h=1;h<r;h++){var f=C(n[h],2),d=f[0],p=f[1];c.render(e,d,p)}if(a.isUrlDefinition()){var g=a.getDefinition(),v=C(n[r],2),y=v[0],m=v[1];g.render(e,y,m)}}}},{key:"pathM",value:function(e,t){var r=this.pathParser,i=n.pathM(r).point,o=i.x,a=i.y;r.addMarker(i),t.addPoint(o,a),e&&e.moveTo(o,a)}},{key:"pathL",value:function(e,t){var r=this.pathParser,i=n.pathL(r),o=i.current,a=i.point,s=a.x,u=a.y;r.addMarker(a,o),t.addPoint(s,u),e&&e.lineTo(s,u)}},{key:"pathH",value:function(e,t){var r=this.pathParser,i=n.pathH(r),o=i.current,a=i.point,s=a.x,u=a.y;r.addMarker(a,o),t.addPoint(s,u),e&&e.lineTo(s,u)}},{key:"pathV",value:function(e,t){var r=this.pathParser,i=n.pathV(r),o=i.current,a=i.point,s=a.x,u=a.y;r.addMarker(a,o),t.addPoint(s,u),e&&e.lineTo(s,u)}},{key:"pathC",value:function(e,t){var r=this.pathParser,i=n.pathC(r),o=i.current,a=i.point,s=i.controlPoint,u=i.currentPoint;r.addMarker(u,s,a),t.addBezierCurve(o.x,o.y,a.x,a.y,s.x,s.y,u.x,u.y),e&&e.bezierCurveTo(a.x,a.y,s.x,s.y,u.x,u.y)}},{key:"pathS",value:function(e,t){var r=this.pathParser,i=n.pathS(r),o=i.current,a=i.point,s=i.controlPoint,u=i.currentPoint;r.addMarker(u,s,a),t.addBezierCurve(o.x,o.y,a.x,a.y,s.x,s.y,u.x,u.y),e&&e.bezierCurveTo(a.x,a.y,s.x,s.y,u.x,u.y)}},{key:"pathQ",value:function(e,t){var r=this.pathParser,i=n.pathQ(r),o=i.current,a=i.controlPoint,s=i.currentPoint;r.addMarker(s,a,a),t.addQuadraticCurve(o.x,o.y,a.x,a.y,s.x,s.y),e&&e.quadraticCurveTo(a.x,a.y,s.x,s.y)}},{key:"pathT",value:function(e,t){var r=this.pathParser,i=n.pathT(r),o=i.current,a=i.controlPoint,s=i.currentPoint;r.addMarker(s,a,a),t.addQuadraticCurve(o.x,o.y,a.x,a.y,s.x,s.y),e&&e.quadraticCurveTo(a.x,a.y,s.x,s.y)}},{key:"pathA",value:function(e,t){var r=this.pathParser,i=n.pathA(r),o=i.currentPoint,a=i.rX,s=i.rY,u=i.sweepFlag,l=i.xAxisRotation,A=i.centp,c=i.a1,h=i.ad,f=1-u?1:-1,d=c+f*(h/2),p=new lDe(A.x+a*Math.cos(d),A.y+s*Math.sin(d));if(r.addMarkerAngle(p,d-f*Math.PI/2),r.addMarkerAngle(o,d-f*Math.PI),t.addPoint(o.x,o.y),e&&!isNaN(c)&&!isNaN(h)){var g=a>s?a:s,v=a>s?1:a/s,y=a>s?s/a:1;e.translate(A.x,A.y),e.rotate(l),e.scale(v,y),e.arc(0,0,g,c,c+h,Boolean(1-u)),e.scale(1/v,1/y),e.rotate(-l),e.translate(-A.x,-A.y)}}},{key:"pathZ",value:function(e,t){n.pathZ(this.pathParser),e&&t.x1!==t.x2&&t.y1!==t.y2&&e.closePath()}}],[{key:"pathM",value:function(e){var t=e.getAsCurrentPoint();return e.start=e.current,{point:t}}},{key:"pathL",value:function(e){return{current:e.current,point:e.getAsCurrentPoint()}}},{key:"pathH",value:function(e){var t=e.current,n=e.command,r=new lDe((n.relative?t.x:0)+n.x,t.y);return e.current=r,{current:t,point:r}}},{key:"pathV",value:function(e){var t=e.current,n=e.command,r=new lDe(t.x,(n.relative?t.y:0)+n.y);return e.current=r,{current:t,point:r}}},{key:"pathC",value:function(e){return{current:e.current,point:e.getPoint("x1","y1"),controlPoint:e.getAsControlPoint("x2","y2"),currentPoint:e.getAsCurrentPoint()}}},{key:"pathS",value:function(e){return{current:e.current,point:e.getReflectedControlPoint(),controlPoint:e.getAsControlPoint("x2","y2"),currentPoint:e.getAsCurrentPoint()}}},{key:"pathQ",value:function(e){return{current:e.current,controlPoint:e.getAsControlPoint("x1","y1"),currentPoint:e.getAsCurrentPoint()}}},{key:"pathT",value:function(e){var t=e.current,n=e.getReflectedControlPoint();return e.control=n,{current:t,controlPoint:n,currentPoint:e.getAsCurrentPoint()}}},{key:"pathA",value:function(e){var t=e.current,n=e.command,r=n.rX,i=n.rY,o=n.xRot,a=n.lArcFlag,s=n.sweepFlag,u=o*(Math.PI/180),l=e.getAsCurrentPoint(),A=new lDe(Math.cos(u)*(t.x-l.x)/2+Math.sin(u)*(t.y-l.y)/2,-Math.sin(u)*(t.x-l.x)/2+Math.cos(u)*(t.y-l.y)/2),c=Math.pow(A.x,2)/Math.pow(r,2)+Math.pow(A.y,2)/Math.pow(i,2);c>1&&(r*=Math.sqrt(c),i*=Math.sqrt(c));var h=(a===s?-1:1)*Math.sqrt((Math.pow(r,2)*Math.pow(i,2)-Math.pow(r,2)*Math.pow(A.y,2)-Math.pow(i,2)*Math.pow(A.x,2))/(Math.pow(r,2)*Math.pow(A.y,2)+Math.pow(i,2)*Math.pow(A.x,2)));isNaN(h)&&(h=0);var f=new lDe(h*r*A.y/i,h*-i*A.x/r),d=new lDe((t.x+l.x)/2+Math.cos(u)*f.x-Math.sin(u)*f.y,(t.y+l.y)/2+Math.sin(u)*f.x+Math.cos(u)*f.y),p=$Ne([1,0],[(A.x-f.x)/r,(A.y-f.y)/i]),g=[(A.x-f.x)/r,(A.y-f.y)/i],v=[(-A.x-f.x)/r,(-A.y-f.y)/i],y=$Ne(g,v);return ZNe(g,v)<=-1&&(y=Math.PI),ZNe(g,v)>=1&&(y=0),{currentPoint:l,rX:r,rY:i,sweepFlag:s,xAxisRotation:u,centp:d,a1:p,ad:y}}},{key:"pathZ",value:function(e){e.current=e.start}}]),n}(FDe),UDe=function(e){c(n,e);var t=b(n);function n(e,r,i){var o;return s(this,n),(o=t.call(this,e,r,i)).type="glyph",o.horizAdvX=o.getAttribute("horiz-adv-x").getNumber(),o.unicode=o.getAttribute("unicode").getString(),o.arabicForm=o.getAttribute("arabic-form").getString(),o}return l(n)}(PDe),LDe=function(e){c(n,e);var t=b(n);function n(e,r,i){var o;return s(this,n),(o=t.call(this,e,r,(this instanceof n?this.constructor:void 0)===n||i)).type="text",o.x=0,o.y=0,o.measureCache=-1,o}return l(n,[{key:"setContext",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];B(h(n.prototype),"setContext",this).call(this,e,t);var r=this.getStyle("dominant-baseline").getTextBaseline()||this.getStyle("alignment-baseline").getTextBaseline();r&&(e.textBaseline=r)}},{key:"initializeCoordinates",value:function(){this.x=0,this.y=0,this.leafTexts=[],this.textChunkStart=0,this.minX=Number.POSITIVE_INFINITY,this.maxX=Number.NEGATIVE_INFINITY}},{key:"getBoundingBox",value:function(e){var t=this;if("text"!==this.type)return this.getTElementBoundingBox(e);this.initializeCoordinates(),this.adjustChildCoordinatesRecursive(e);var n=null;return this.children.forEach((function(r,i){var o=t.getChildBoundingBox(e,t,t,i);n?n.addBoundingBox(o):n=o})),n}},{key:"getFontSize",value:function(){var e=this.document,t=this.parent,n=_De.parse(e.ctx.font).fontSize;return t.getStyle("font-size").getNumber(n)}},{key:"getTElementBoundingBox",value:function(e){var t=this.getFontSize();return new NDe(this.x,this.y-t,this.x+this.measureText(e),this.y)}},{key:"getGlyph",value:function(e,t,n){var r=t[n],i=null;if(e.isArabic){var o=t.length,a=t[n-1],s=t[n+1],u="isolated";if((0===n||" "===a)&&n<o-1&&" "!==s&&(u="terminal"),n>0&&" "!==a&&n<o-1&&" "!==s&&(u="medial"),n>0&&" "!==a&&(n===o-1||" "===s)&&(u="initial"),void 0!==e.glyphs[r]){var l=e.glyphs[r];i=l instanceof UDe?l:l[u]}}else i=e.glyphs[r];return i||(i=e.missingGlyph),i}},{key:"getText",value:function(){return""}},{key:"getTextFromNode",value:function(e){var t=e||this.node,n=Array.from(t.parentNode.childNodes),r=n.indexOf(t),i=n.length-1,o=FNe(t.textContent||"");return 0===r&&(o=PNe(o)),r===i&&(o=UNe(o)),o}},{key:"renderChildren",value:function(e){var t=this;if("text"===this.type){this.initializeCoordinates(),this.adjustChildCoordinatesRecursive(e),this.children.forEach((function(n,r){t.renderChild(e,t,t,r)}));var n=this.document.screen.mouse;n.isWorking()&&n.checkBoundingBox(this,this.getBoundingBox(e))}else this.renderTElementChildren(e)}},{key:"renderTElementChildren",value:function(e){var t=this.document,n=this.parent,r=this.getText(),i=n.getStyle("font-family").getDefinition();if(i)for(var o=i.fontFace.unitsPerEm,a=_De.parse(t.ctx.font),s=n.getStyle("font-size").getNumber(a.fontSize),u=n.getStyle("font-style").getString(a.fontStyle),l=s/o,A=i.isRTL?r.split("").reverse().join(""):r,c=LNe(n.getAttribute("dx").getString()),h=A.length,f=0;f<h;f++){var d=this.getGlyph(i,A,f);e.translate(this.x,this.y),e.scale(l,-l);var p=e.lineWidth;e.lineWidth=e.lineWidth*o/s,"italic"===u&&e.transform(1,0,.4,1,0,0),d.render(e),"italic"===u&&e.transform(1,0,-.4,1,0,0),e.lineWidth=p,e.scale(1/l,-1/l),e.translate(-this.x,-this.y),this.x+=s*(d.horizAdvX||i.horizAdvX)/o,void 0===c[f]||isNaN(c[f])||(this.x+=c[f])}else{var g=this.x,v=this.y;e.fillStyle&&e.fillText(r,g,v),e.strokeStyle&&e.strokeText(r,g,v)}}},{key:"applyAnchoring",value:function(){if(!(this.textChunkStart>=this.leafTexts.length)){var e=this.leafTexts[this.textChunkStart],t=e.getStyle("text-anchor").getString("start"),n=0;n="start"===t?e.x-this.minX:"end"===t?e.x-this.maxX:e.x-(this.minX+this.maxX)/2;for(var r=this.textChunkStart;r<this.leafTexts.length;r++)this.leafTexts[r].x+=n;this.minX=Number.POSITIVE_INFINITY,this.maxX=Number.NEGATIVE_INFINITY,this.textChunkStart=this.leafTexts.length}}},{key:"adjustChildCoordinatesRecursive",value:function(e){var t=this;this.children.forEach((function(n,r){t.adjustChildCoordinatesRecursiveCore(e,t,t,r)})),this.applyAnchoring()}},{key:"adjustChildCoordinatesRecursiveCore",value:function(e,t,n,r){var i=n.children[r];i.children.length>0?i.children.forEach((function(n,r){t.adjustChildCoordinatesRecursiveCore(e,t,i,r)})):this.adjustChildCoordinates(e,t,n,r)}},{key:"adjustChildCoordinates",value:function(e,t,n,r){var i=n.children[r];if("function"!=typeof i.measureText)return i;e.save(),i.setContext(e,!0);var o=i.getAttribute("x"),a=i.getAttribute("y"),s=i.getAttribute("dx"),u=i.getAttribute("dy"),l=i.getStyle("font-family").getDefinition(),A=Boolean(l)&&l.isRTL;0===r&&(o.hasValue()||o.setValue(i.getInheritedAttribute("x")),a.hasValue()||a.setValue(i.getInheritedAttribute("y")),s.hasValue()||s.setValue(i.getInheritedAttribute("dx")),u.hasValue()||u.setValue(i.getInheritedAttribute("dy")));var c=i.measureText(e);return A&&(t.x-=c),o.hasValue()?(t.applyAnchoring(),i.x=o.getPixels("x"),s.hasValue()&&(i.x+=s.getPixels("x"))):(s.hasValue()&&(t.x+=s.getPixels("x")),i.x=t.x),t.x=i.x,A||(t.x+=c),a.hasValue()?(i.y=a.getPixels("y"),u.hasValue()&&(i.y+=u.getPixels("y"))):(u.hasValue()&&(t.y+=u.getPixels("y")),i.y=t.y),t.y=i.y,t.leafTexts.push(i),t.minX=Math.min(t.minX,i.x,i.x+c),t.maxX=Math.max(t.maxX,i.x,i.x+c),i.clearContext(e),e.restore(),i}},{key:"getChildBoundingBox",value:function(e,t,n,r){var i=n.children[r];if("function"!=typeof i.getBoundingBox)return null;var o=i.getBoundingBox(e);return o?(i.children.forEach((function(n,r){var a=t.getChildBoundingBox(e,t,i,r);o.addBoundingBox(a)})),o):null}},{key:"renderChild",value:function(e,t,n,r){var i=n.children[r];i.render(e),i.children.forEach((function(n,r){t.renderChild(e,t,i,r)}))}},{key:"measureText",value:function(e){var t=this.measureCache;if(~t)return t;var n=this.getText(),r=this.measureTargetText(e,n);return this.measureCache=r,r}},{key:"measureTargetText",value:function(e,t){if(!t.length)return 0;var n=this.parent,r=n.getStyle("font-family").getDefinition();if(r){for(var i=this.getFontSize(),o=r.isRTL?t.split("").reverse().join(""):t,a=LNe(n.getAttribute("dx").getString()),s=o.length,u=0,l=0;l<s;l++){u+=(this.getGlyph(r,o,l).horizAdvX||r.horizAdvX)*i/r.fontFace.unitsPerEm,void 0===a[l]||isNaN(a[l])||(u+=a[l])}return u}if(!e.measureText)return 10*t.length;e.save(),this.setContext(e,!0);var A=e.measureText(t).width;return this.clearContext(e),e.restore(),A}},{key:"getInheritedAttribute",value:function(e){for(var t=this;t instanceof n&&t.isFirstChild();){var r=t.parent.getAttribute(e);if(r.hasValue(!0))return r.getValue("0");t=t.parent}return null}}]),n}(FDe),MDe=function(e){c(n,e);var t=b(n);function n(e,r,i){var o;return s(this,n),(o=t.call(this,e,r,(this instanceof n?this.constructor:void 0)===n||i)).type="tspan",o.text=o.children.length>0?"":o.getTextFromNode(),o}return l(n,[{key:"getText",value:function(){return this.text}}]),n}(LDe),TDe=function(e){c(n,e);var t=b(n);function n(){var e;return s(this,n),(e=t.apply(this,arguments)).type="textNode",e}return l(n)}(MDe),RDe=function(e){c(n,e);var t=b(n);function n(){var e;return s(this,n),(e=t.apply(this,arguments)).type="svg",e.root=!1,e}return l(n,[{key:"setContext",value:function(e){var t,r=this.document,i=r.screen,o=r.window,a=e.canvas;if(i.setDefaults(e),a.style&&void 0!==e.font&&o&&void 0!==o.getComputedStyle){e.font=o.getComputedStyle(a).getPropertyValue("font");var s=new sDe(r,"fontSize",_De.parse(e.font).fontSize);s.hasValue()&&(r.rootEmSize=s.getPixels("y"),r.emSize=r.rootEmSize)}this.getAttribute("x").hasValue()||this.getAttribute("x",!0).setValue(0),this.getAttribute("y").hasValue()||this.getAttribute("y",!0).setValue(0);var u=i.viewPort,l=u.width,A=u.height;this.getStyle("width").hasValue()||this.getStyle("width",!0).setValue("100%"),this.getStyle("height").hasValue()||this.getStyle("height",!0).setValue("100%"),this.getStyle("color").hasValue()||this.getStyle("color",!0).setValue("black");var c=this.getAttribute("refX"),f=this.getAttribute("refY"),d=this.getAttribute("viewBox"),p=d.hasValue()?LNe(d.getString()):null,g=!this.root&&"visible"!==this.getStyle("overflow").getValue("hidden"),v=0,y=0,m=0,w=0;p&&(v=p[0],y=p[1]),this.root||(l=this.getStyle("width").getPixels("x"),A=this.getStyle("height").getPixels("y"),"marker"===this.type&&(m=v,w=y,v=0,y=0)),i.viewPort.setCurrent(l,A),!this.node||this.parent&&"foreignObject"!==(null===(t=this.node.parentNode)||void 0===t?void 0:t.nodeName)||!this.getStyle("transform",!1,!0).hasValue()||this.getStyle("transform-origin",!1,!0).hasValue()||this.getStyle("transform-origin",!0,!0).setValue("50% 50%"),B(h(n.prototype),"setContext",this).call(this,e),e.translate(this.getAttribute("x").getPixels("x"),this.getAttribute("y").getPixels("y")),p&&(l=p[2],A=p[3]),r.setViewBox({ctx:e,aspectRatio:this.getAttribute("preserveAspectRatio").getString(),width:i.viewPort.width,desiredWidth:l,height:i.viewPort.height,desiredHeight:A,minX:v,minY:y,refX:c.getValue(),refY:f.getValue(),clip:g,clipX:m,clipY:w}),p&&(i.viewPort.removeCurrent(),i.viewPort.setCurrent(l,A))}},{key:"clearContext",value:function(e){B(h(n.prototype),"clearContext",this).call(this,e),this.document.screen.viewPort.removeCurrent()}},{key:"resize",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=this.getAttribute("width",!0),i=this.getAttribute("height",!0),o=this.getAttribute("viewBox"),a=this.getAttribute("style"),s=r.getNumber(0),u=i.getNumber(0);if(n)if("string"==typeof n)this.getAttribute("preserveAspectRatio",!0).setValue(n);else{var l=this.getAttribute("preserveAspectRatio");l.hasValue()&&l.setValue(l.getString().replace(/^\s*(\S.*\S)\s*$/,"$1"))}if(r.setValue(e),i.setValue(t),o.hasValue()||o.setValue("0 0 ".concat(s||e," ").concat(u||t)),a.hasValue()){var A=this.getStyle("width"),c=this.getStyle("height");A.hasValue()&&A.setValue("".concat(e,"px")),c.hasValue()&&c.setValue("".concat(t,"px"))}}}]),n}(FDe),ODe=function(e){c(n,e);var t=b(n);function n(){var e;return s(this,n),(e=t.apply(this,arguments)).type="rect",e}return l(n,[{key:"path",value:function(e){var t=this.getAttribute("x").getPixels("x"),n=this.getAttribute("y").getPixels("y"),r=this.getStyle("width",!1,!0).getPixels("x"),i=this.getStyle("height",!1,!0).getPixels("y"),o=this.getAttribute("rx"),a=this.getAttribute("ry"),s=o.getPixels("x"),u=a.getPixels("y");if(o.hasValue()&&!a.hasValue()&&(u=s),a.hasValue()&&!o.hasValue()&&(s=u),s=Math.min(s,r/2),u=Math.min(u,i/2),e){var l=(Math.sqrt(2)-1)/3*4;e.beginPath(),i>0&&r>0&&(e.moveTo(t+s,n),e.lineTo(t+r-s,n),e.bezierCurveTo(t+r-s+l*s,n,t+r,n+u-l*u,t+r,n+u),e.lineTo(t+r,n+i-u),e.bezierCurveTo(t+r,n+i-u+l*u,t+r-s+l*s,n+i,t+r-s,n+i),e.lineTo(t+s,n+i),e.bezierCurveTo(t+s-l*s,n+i,t,n+i-u+l*u,t,n+i-u),e.lineTo(t,n+u),e.bezierCurveTo(t,n+u-l*u,t+s-l*s,n,t+s,n),e.closePath())}return new NDe(t,n,t+r,n+i)}},{key:"getMarkers",value:function(){return null}}]),n}(PDe),HDe=function(e){c(n,e);var t=b(n);function n(){var e;return s(this,n),(e=t.apply(this,arguments)).type="circle",e}return l(n,[{key:"path",value:function(e){var t=this.getAttribute("cx").getPixels("x"),n=this.getAttribute("cy").getPixels("y"),r=this.getAttribute("r").getPixels();return e&&r>0&&(e.beginPath(),e.arc(t,n,r,0,2*Math.PI,!1),e.closePath()),new NDe(t-r,n-r,t+r,n+r)}},{key:"getMarkers",value:function(){return null}}]),n}(PDe),KDe=function(e){c(n,e);var t=b(n);function n(){var e;return s(this,n),(e=t.apply(this,arguments)).type="ellipse",e}return l(n,[{key:"path",value:function(e){var t=(Math.sqrt(2)-1)/3*4,n=this.getAttribute("rx").getPixels("x"),r=this.getAttribute("ry").getPixels("y"),i=this.getAttribute("cx").getPixels("x"),o=this.getAttribute("cy").getPixels("y");return e&&n>0&&r>0&&(e.beginPath(),e.moveTo(i+n,o),e.bezierCurveTo(i+n,o+t*r,i+t*n,o+r,i,o+r),e.bezierCurveTo(i-t*n,o+r,i-n,o+t*r,i-n,o),e.bezierCurveTo(i-n,o-t*r,i-t*n,o-r,i,o-r),e.bezierCurveTo(i+t*n,o-r,i+n,o-t*r,i+n,o),e.closePath()),new NDe(i-n,o-r,i+n,o+r)}},{key:"getMarkers",value:function(){return null}}]),n}(PDe),jDe=function(e){c(n,e);var t=b(n);function n(){var e;return s(this,n),(e=t.apply(this,arguments)).type="line",e}return l(n,[{key:"getPoints",value:function(){return[new lDe(this.getAttribute("x1").getPixels("x"),this.getAttribute("y1").getPixels("y")),new lDe(this.getAttribute("x2").getPixels("x"),this.getAttribute("y2").getPixels("y"))]}},{key:"path",value:function(e){var t=C(this.getPoints(),2),n=t[0],r=n.x,i=n.y,o=t[1],a=o.x,s=o.y;return e&&(e.beginPath(),e.moveTo(r,i),e.lineTo(a,s)),new NDe(r,i,a,s)}},{key:"getMarkers",value:function(){var e=C(this.getPoints(),2),t=e[0],n=e[1],r=t.angleTo(n);return[[t,r],[n,r]]}}]),n}(PDe),GDe=function(e){c(n,e);var t=b(n);function n(e,r,i){var o;return s(this,n),(o=t.call(this,e,r,i)).type="polyline",o.points=[],o.points=lDe.parsePath(o.getAttribute("points").getString()),o}return l(n,[{key:"path",value:function(e){var t=this.points,n=C(t,1)[0],r=n.x,i=n.y,o=new NDe(r,i);return e&&(e.beginPath(),e.moveTo(r,i)),t.forEach((function(t){var n=t.x,r=t.y;o.addPoint(n,r),e&&e.lineTo(n,r)})),o}},{key:"getMarkers",value:function(){var e=this.points,t=e.length-1,n=[];return e.forEach((function(r,i){i!==t&&n.push([r,r.angleTo(e[i+1])])})),n.length>0&&n.push([e[e.length-1],n[n.length-1][1]]),n}}]),n}(PDe),qDe=function(e){c(n,e);var t=b(n);function n(){var e;return s(this,n),(e=t.apply(this,arguments)).type="polygon",e}return l(n,[{key:"path",value:function(e){var t=B(h(n.prototype),"path",this).call(this,e),r=C(this.points,1)[0],i=r.x,o=r.y;return e&&(e.lineTo(i,o),e.closePath()),t}}]),n}(GDe),VDe=function(e){c(n,e);var t=b(n);function n(){var e;return s(this,n),(e=t.apply(this,arguments)).type="pattern",e}return l(n,[{key:"createPattern",value:function(e,t,n){var r=this.getStyle("width").getPixels("x",!0),i=this.getStyle("height").getPixels("y",!0),o=new RDe(this.document,null);o.attributes.viewBox=new sDe(this.document,"viewBox",this.getAttribute("viewBox").getValue()),o.attributes.width=new sDe(this.document,"width","".concat(r,"px")),o.attributes.height=new sDe(this.document,"height","".concat(i,"px")),o.attributes.transform=new sDe(this.document,"transform",this.getAttribute("patternTransform").getValue()),o.children=this.children;var a=this.document.createCanvas(r,i),s=a.getContext("2d"),u=this.getAttribute("x"),l=this.getAttribute("y");u.hasValue()&&l.hasValue()&&s.translate(u.getPixels("x",!0),l.getPixels("y",!0)),n.hasValue()?this.styles["fill-opacity"]=n:Reflect.deleteProperty(this.styles,"fill-opacity");for(var A=-1;A<=1;A++)for(var c=-1;c<=1;c++)s.save(),o.attributes.x=new sDe(this.document,"x",A*a.width),o.attributes.y=new sDe(this.document,"y",c*a.height),o.render(s),s.restore();return e.createPattern(a,"repeat")}}]),n}(CDe),zDe=function(e){c(n,e);var t=b(n);function n(){var e;return s(this,n),(e=t.apply(this,arguments)).type="marker",e}return l(n,[{key:"render",value:function(e,t,n){if(t){var r=t.x,i=t.y,o=this.getAttribute("orient").getString("auto"),a=this.getAttribute("markerUnits").getString("strokeWidth");e.translate(r,i),"auto"===o&&e.rotate(n),"strokeWidth"===a&&e.scale(e.lineWidth,e.lineWidth),e.save();var s=new RDe(this.document,null);s.type=this.type,s.attributes.viewBox=new sDe(this.document,"viewBox",this.getAttribute("viewBox").getValue()),s.attributes.refX=new sDe(this.document,"refX",this.getAttribute("refX").getValue()),s.attributes.refY=new sDe(this.document,"refY",this.getAttribute("refY").getValue()),s.attributes.width=new sDe(this.document,"width",this.getAttribute("markerWidth").getValue()),s.attributes.height=new sDe(this.document,"height",this.getAttribute("markerHeight").getValue()),s.attributes.overflow=new sDe(this.document,"overflow",this.getAttribute("overflow").getValue()),s.attributes.fill=new sDe(this.document,"fill",this.getAttribute("fill").getColor("black")),s.attributes.stroke=new sDe(this.document,"stroke",this.getAttribute("stroke").getValue("none")),s.children=this.children,s.render(e),e.restore(),"strokeWidth"===a&&e.scale(1/e.lineWidth,1/e.lineWidth),"auto"===o&&e.rotate(-n),e.translate(-r,-i)}}}]),n}(CDe),JDe=function(e){c(n,e);var t=b(n);function n(){var e;return s(this,n),(e=t.apply(this,arguments)).type="defs",e}return l(n,[{key:"render",value:function(){}}]),n}(CDe),YDe=function(e){c(n,e);var t=b(n);function n(){var e;return s(this,n),(e=t.apply(this,arguments)).type="g",e}return l(n,[{key:"getBoundingBox",value:function(e){var t=new NDe;return this.children.forEach((function(n){t.addBoundingBox(n.getBoundingBox(e))})),t}}]),n}(FDe),XDe=function(e){c(n,e);var t=b(n);function n(e,r,i){var o;s(this,n),(o=t.call(this,e,r,i)).attributesToInherit=["gradientUnits"],o.stops=[];var a=m(o),u=a.stops;return a.children.forEach((function(e){"stop"===e.type&&u.push(e)})),o}return l(n,[{key:"getGradientUnits",value:function(){return this.getAttribute("gradientUnits").getString("objectBoundingBox")}},{key:"createGradient",value:function(e,t,n){var r=this,i=this;this.getHrefAttribute().hasValue()&&(i=this.getHrefAttribute().getDefinition(),this.inheritStopContainer(i));var o=i.stops,a=this.getGradient(e,t);if(!a)return this.addParentOpacity(n,o[o.length-1].color);if(o.forEach((function(e){a.addColorStop(e.offset,r.addParentOpacity(n,e.color))})),this.getAttribute("gradientTransform").hasValue()){var s=this.document,u=s.screen,l=u.MAX_VIRTUAL_PIXELS,A=C(u.viewPort.viewPorts,1)[0],c=new ODe(s,null);c.attributes.x=new sDe(s,"x",-l/3),c.attributes.y=new sDe(s,"y",-l/3),c.attributes.width=new sDe(s,"width",l),c.attributes.height=new sDe(s,"height",l);var h=new YDe(s,null);h.attributes.transform=new sDe(s,"transform",this.getAttribute("gradientTransform").getValue()),h.children=[c];var f=new RDe(s,null);f.attributes.x=new sDe(s,"x",0),f.attributes.y=new sDe(s,"y",0),f.attributes.width=new sDe(s,"width",A.width),f.attributes.height=new sDe(s,"height",A.height),f.children=[h];var d=s.createCanvas(A.width,A.height),p=d.getContext("2d");return p.fillStyle=a,f.render(p),p.createPattern(d,"no-repeat")}return a}},{key:"inheritStopContainer",value:function(e){var t=this;this.attributesToInherit.forEach((function(n){!t.getAttribute(n).hasValue()&&e.getAttribute(n).hasValue()&&t.getAttribute(n,!0).setValue(e.getAttribute(n).getValue())}))}},{key:"addParentOpacity",value:function(e,t){return e.hasValue()?new sDe(this.document,"color",t).addOpacity(e).getColor():t}}]),n}(CDe),WDe=function(e){c(n,e);var t=b(n);function n(e,r,i){var o;return s(this,n),(o=t.call(this,e,r,i)).type="linearGradient",o.attributesToInherit.push("x1","y1","x2","y2"),o}return l(n,[{key:"getGradient",value:function(e,t){var n="objectBoundingBox"===this.getGradientUnits(),r=n?t.getBoundingBox(e):null;if(n&&!r)return null;this.getAttribute("x1").hasValue()||this.getAttribute("y1").hasValue()||this.getAttribute("x2").hasValue()||this.getAttribute("y2").hasValue()||(this.getAttribute("x1",!0).setValue(0),this.getAttribute("y1",!0).setValue(0),this.getAttribute("x2",!0).setValue(1),this.getAttribute("y2",!0).setValue(0));var i=n?r.x+r.width*this.getAttribute("x1").getNumber():this.getAttribute("x1").getPixels("x"),o=n?r.y+r.height*this.getAttribute("y1").getNumber():this.getAttribute("y1").getPixels("y"),a=n?r.x+r.width*this.getAttribute("x2").getNumber():this.getAttribute("x2").getPixels("x"),s=n?r.y+r.height*this.getAttribute("y2").getNumber():this.getAttribute("y2").getPixels("y");return i===a&&o===s?null:e.createLinearGradient(i,o,a,s)}}]),n}(XDe),ZDe=function(e){c(n,e);var t=b(n);function n(e,r,i){var o;return s(this,n),(o=t.call(this,e,r,i)).type="radialGradient",o.attributesToInherit.push("cx","cy","r","fx","fy","fr"),o}return l(n,[{key:"getGradient",value:function(e,t){var n="objectBoundingBox"===this.getGradientUnits(),r=t.getBoundingBox(e);if(n&&!r)return null;this.getAttribute("cx").hasValue()||this.getAttribute("cx",!0).setValue("50%"),this.getAttribute("cy").hasValue()||this.getAttribute("cy",!0).setValue("50%"),this.getAttribute("r").hasValue()||this.getAttribute("r",!0).setValue("50%");var i=n?r.x+r.width*this.getAttribute("cx").getNumber():this.getAttribute("cx").getPixels("x"),o=n?r.y+r.height*this.getAttribute("cy").getNumber():this.getAttribute("cy").getPixels("y"),a=i,s=o;this.getAttribute("fx").hasValue()&&(a=n?r.x+r.width*this.getAttribute("fx").getNumber():this.getAttribute("fx").getPixels("x")),this.getAttribute("fy").hasValue()&&(s=n?r.y+r.height*this.getAttribute("fy").getNumber():this.getAttribute("fy").getPixels("y"));var u=n?(r.width+r.height)/2*this.getAttribute("r").getNumber():this.getAttribute("r").getPixels(),l=this.getAttribute("fr").getPixels();return e.createRadialGradient(a,s,l,i,o,u)}}]),n}(XDe),$De=function(e){c(n,e);var t=b(n);function n(e,r,i){var o;s(this,n),(o=t.call(this,e,r,i)).type="stop";var a=Math.max(0,Math.min(1,o.getAttribute("offset").getNumber())),u=o.getStyle("stop-opacity"),l=o.getStyle("stop-color",!0);return""===l.getString()&&l.setValue("#000"),u.hasValue()&&(l=l.addOpacity(u)),o.offset=a,o.color=l.getColor(),o}return l(n)}(CDe),eFe=function(e){c(n,e);var t=b(n);function n(e,r,i){var o;s(this,n),(o=t.call(this,e,r,i)).type="animate",o.duration=0,o.initialValue=null,o.initialUnits="",o.removed=!1,o.frozen=!1,e.screen.animations.push(m(o)),o.begin=o.getAttribute("begin").getMilliseconds(),o.maxDuration=o.begin+o.getAttribute("dur").getMilliseconds(),o.from=o.getAttribute("from"),o.to=o.getAttribute("to"),o.values=new sDe(e,"values",null);var a=o.getAttribute("values");return a.hasValue()&&o.values.setValue(a.getString().split(";")),o}return l(n,[{key:"getProperty",value:function(){var e=this.getAttribute("attributeType").getString(),t=this.getAttribute("attributeName").getString();return"CSS"===e?this.parent.getStyle(t,!0):this.parent.getAttribute(t,!0)}},{key:"calcValue",value:function(){var e=this.initialUnits,t=this.getProgress(),n=t.progress,r=t.from,i=t.to,o=r.getNumber()+(i.getNumber()-r.getNumber())*n;return"%"===e&&(o*=100),"".concat(o).concat(e)}},{key:"update",value:function(e){var t=this.parent,n=this.getProperty();if(this.initialValue||(this.initialValue=n.getString(),this.initialUnits=n.getUnits()),this.duration>this.maxDuration){var r=this.getAttribute("fill").getString("remove");if("indefinite"===this.getAttribute("repeatCount").getString()||"indefinite"===this.getAttribute("repeatDur").getString())this.duration=0;else if("freeze"!==r||this.frozen){if("remove"===r&&!this.removed)return this.removed=!0,n.setValue(t.animationFrozen?t.animationFrozenValue:this.initialValue),!0}else this.frozen=!0,t.animationFrozen=!0,t.animationFrozenValue=n.getString();return!1}this.duration+=e;var i=!1;if(this.begin<this.duration){var o=this.calcValue(),a=this.getAttribute("type");if(a.hasValue()){var s=a.getString();o="".concat(s,"(").concat(o,")")}n.setValue(o),i=!0}return i}},{key:"getProgress",value:function(){var e=this.document,t=this.values,n={progress:(this.duration-this.begin)/(this.maxDuration-this.begin)};if(t.hasValue()){var r=n.progress*(t.getValue().length-1),i=Math.floor(r),o=Math.ceil(r);n.from=new sDe(e,"from",parseFloat(t.getValue()[i])),n.to=new sDe(e,"to",parseFloat(t.getValue()[o])),n.progress=(r-i)/(o-i)}else n.from=this.from,n.to=this.to;return n}}]),n}(CDe),tFe=function(e){c(n,e);var t=b(n);function n(){var e;return s(this,n),(e=t.apply(this,arguments)).type="animateColor",e}return l(n,[{key:"calcValue",value:function(){var e=this.getProgress(),t=e.progress,n=e.from,r=e.to,i=new S_e(n.getColor()),o=new S_e(r.getColor());if(i.ok&&o.ok){var a=i.r+(o.r-i.r)*t,s=i.g+(o.g-i.g)*t,u=i.b+(o.b-i.b)*t;return"rgb(".concat(Math.floor(a),", ").concat(Math.floor(s),", ").concat(Math.floor(u),")")}return this.getAttribute("from").getColor()}}]),n}(eFe),nFe=function(e){c(n,e);var t=b(n);function n(){var e;return s(this,n),(e=t.apply(this,arguments)).type="animateTransform",e}return l(n,[{key:"calcValue",value:function(){var e=this.getProgress(),t=e.progress,n=e.from,r=e.to,i=LNe(n.getString()),o=LNe(r.getString()),a=i.map((function(e,n){return e+(o[n]-e)*t})).join(" ");return a}}]),n}(eFe),rFe=function(e){c(n,e);var t=b(n);function n(e,r,i){var o;s(this,n),(o=t.call(this,e,r,i)).type="font",o.glyphs={},o.horizAdvX=o.getAttribute("horiz-adv-x").getNumber();var a,u=e.definitions,l=F(m(o).children);try{for(l.s();!(a=l.n()).done;){var A=a.value;switch(A.type){case"font-face":o.fontFace=A;var c=A.getStyle("font-family");c.hasValue()&&(u[c.getString()]=m(o));break;case"missing-glyph":o.missingGlyph=A;break;case"glyph":var h=A;h.arabicForm?(o.isRTL=!0,o.isArabic=!0,void 0===o.glyphs[h.unicode]&&(o.glyphs[h.unicode]={}),o.glyphs[h.unicode][h.arabicForm]=h):o.glyphs[h.unicode]=h}}}catch(e){l.e(e)}finally{l.f()}return o}return l(n,[{key:"render",value:function(){}}]),n}(CDe),iFe=function(e){c(n,e);var t=b(n);function n(e,r,i){var o;return s(this,n),(o=t.call(this,e,r,i)).type="font-face",o.ascent=o.getAttribute("ascent").getNumber(),o.descent=o.getAttribute("descent").getNumber(),o.unitsPerEm=o.getAttribute("units-per-em").getNumber(),o}return l(n)}(CDe),oFe=function(e){c(n,e);var t=b(n);function n(){var e;return s(this,n),(e=t.apply(this,arguments)).type="missing-glyph",e.horizAdvX=0,e}return l(n)}(PDe),aFe=function(e){c(n,e);var t=b(n);function n(){var e;return s(this,n),(e=t.apply(this,arguments)).type="tref",e}return l(n,[{key:"getText",value:function(){var e=this.getHrefAttribute().getDefinition();if(e){var t=e.children[0];if(t)return t.getText()}return""}}]),n}(LDe),sFe=function(e){c(n,e);var t=b(n);function n(e,r,i){var o;s(this,n),(o=t.call(this,e,r,i)).type="a";var a=r.childNodes,u=a[0],l=a.length>0&&Array.from(a).every((function(e){return 3===e.nodeType}));return o.hasText=l,o.text=l?o.getTextFromNode(u):"",o}return l(n,[{key:"getText",value:function(){return this.text}},{key:"renderChildren",value:function(e){if(this.hasText){B(h(n.prototype),"renderChildren",this).call(this,e);var t=this.document,r=this.x,i=this.y,o=t.screen.mouse,a=new sDe(t,"fontSize",_De.parse(t.ctx.font).fontSize);o.isWorking()&&o.checkBoundingBox(this,new NDe(r,i-a.getPixels("y"),r+this.measureText(e),i))}else if(this.children.length>0){var s=new YDe(this.document,null);s.children=this.children,s.parent=this,s.render(e)}}},{key:"onClick",value:function(){var e=this.document.window;e&&e.open(this.getHrefAttribute().getString())}},{key:"onMouseMove",value:function(){this.document.ctx.canvas.style.cursor="pointer"}}]),n}(LDe);function uFe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function lFe(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?uFe(Object(n),!0).forEach((function(t){$Se(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):uFe(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var AFe=function(e){c(n,e);var t=b(n);function n(e,r,i){var o;s(this,n),(o=t.call(this,e,r,i)).type="textPath",o.textWidth=0,o.textHeight=0,o.pathLength=-1,o.glyphInfo=null,o.letterSpacingCache=[],o.measuresCache=new Map([["",0]]);var a=o.getHrefAttribute().getDefinition();return o.text=o.getTextFromNode(),o.dataArray=o.parsePathData(a),o}return l(n,[{key:"getText",value:function(){return this.text}},{key:"path",value:function(e){var t=this.dataArray;e&&e.beginPath(),t.forEach((function(t){var n=t.type,r=t.points;switch(n){case DDe.LINE_TO:e&&e.lineTo(r[0],r[1]);break;case DDe.MOVE_TO:e&&e.moveTo(r[0],r[1]);break;case DDe.CURVE_TO:e&&e.bezierCurveTo(r[0],r[1],r[2],r[3],r[4],r[5]);break;case DDe.QUAD_TO:e&&e.quadraticCurveTo(r[0],r[1],r[2],r[3]);break;case DDe.ARC:var i=C(r,8),o=i[0],a=i[1],s=i[2],u=i[3],l=i[4],A=i[5],c=i[6],h=i[7],f=s>u?s:u,d=s>u?1:s/u,p=s>u?u/s:1;e&&(e.translate(o,a),e.rotate(c),e.scale(d,p),e.arc(0,0,f,l,l+A,Boolean(1-h)),e.scale(1/d,1/p),e.rotate(-c),e.translate(-o,-a));break;case DDe.CLOSE_PATH:e&&e.closePath()}}))}},{key:"renderChildren",value:function(e){this.setTextData(e),e.save();var t=this.parent.getStyle("text-decoration").getString(),n=this.getFontSize(),r=this.glyphInfo,i=e.fillStyle;"underline"===t&&e.beginPath(),r.forEach((function(r,i){var o=r.p0,a=r.p1,s=r.rotation,u=r.text;e.save(),e.translate(o.x,o.y),e.rotate(s),e.fillStyle&&e.fillText(u,0,0),e.strokeStyle&&e.strokeText(u,0,0),e.restore(),"underline"===t&&(0===i&&e.moveTo(o.x,o.y+n/8),e.lineTo(a.x,a.y+n/5))})),"underline"===t&&(e.lineWidth=n/20,e.strokeStyle=i,e.stroke(),e.closePath()),e.restore()}},{key:"getLetterSpacingAt",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.letterSpacingCache[e]||0}},{key:"findSegmentToFitChar",value:function(e,t,n,r,i,o,a,s,u){var l=o,A=this.measureText(e,s);" "===s&&"justify"===t&&n<r&&(A+=(r-n)/i),u>-1&&(l+=this.getLetterSpacingAt(u));var c=this.textHeight/20,h=this.getEquidistantPointOnPath(l,c,0),f=this.getEquidistantPointOnPath(l+A,c,0),d={p0:h,p1:f},p=h&&f?Math.atan2(f.y-h.y,f.x-h.x):0;if(a){var g=Math.cos(Math.PI/2+p)*a,v=Math.cos(-p)*a;d.p0=lFe(lFe({},h),{},{x:h.x+g,y:h.y+v}),d.p1=lFe(lFe({},f),{},{x:f.x+g,y:f.y+v})}return{offset:l+=A,segment:d,rotation:p}}},{key:"measureText",value:function(e,t){var n=this.measuresCache,r=t||this.getText();if(n.has(r))return n.get(r);var i=this.measureTargetText(e,r);return n.set(r,i),i}},{key:"setTextData",value:function(e){var t=this;if(!this.glyphInfo){var n=this.getText(),r=n.split(""),i=n.split(" ").length-1,o=this.parent.getAttribute("dx").split().map((function(e){return e.getPixels("x")})),a=this.parent.getAttribute("dy").getPixels("y"),s=this.parent.getStyle("text-anchor").getString("start"),u=this.getStyle("letter-spacing"),l=this.parent.getStyle("letter-spacing"),A=0;u.hasValue()&&"inherit"!==u.getValue()?u.hasValue()&&"initial"!==u.getValue()&&"unset"!==u.getValue()&&(A=u.getPixels()):A=l.getPixels();var c=[],h=n.length;this.letterSpacingCache=c;for(var f=0;f<h;f++)c.push(void 0!==o[f]?o[f]:A);var d=c.reduce((function(e,t,n){return 0===n?0:e+t||0}),0),p=this.measureText(e),g=Math.max(p+d,0);this.textWidth=p,this.textHeight=this.getFontSize(),this.glyphInfo=[];var v=this.getPathLength(),y=this.getStyle("startOffset").getNumber(0)*v,m=0;"middle"!==s&&"center"!==s||(m=-g/2),"end"!==s&&"right"!==s||(m=-g),m+=y,r.forEach((function(n,o){var u=t.findSegmentToFitChar(e,s,g,v,i,m,a,n,o),l=u.offset,A=u.segment,c=u.rotation;m=l,A.p0&&A.p1&&t.glyphInfo.push({text:r[o],p0:A.p0,p1:A.p1,rotation:c})}))}}},{key:"parsePathData",value:function(e){if(this.pathLength=-1,!e)return[];var t=[],n=e.pathParser;for(n.reset();!n.isEnd();){var r=n.current,i=r?r.x:0,o=r?r.y:0,a=n.next(),s=a.type,u=[];switch(a.type){case DDe.MOVE_TO:this.pathM(n,u);break;case DDe.LINE_TO:s=this.pathL(n,u);break;case DDe.HORIZ_LINE_TO:s=this.pathH(n,u);break;case DDe.VERT_LINE_TO:s=this.pathV(n,u);break;case DDe.CURVE_TO:this.pathC(n,u);break;case DDe.SMOOTH_CURVE_TO:s=this.pathS(n,u);break;case DDe.QUAD_TO:this.pathQ(n,u);break;case DDe.SMOOTH_QUAD_TO:s=this.pathT(n,u);break;case DDe.ARC:u=this.pathA(n);break;case DDe.CLOSE_PATH:PDe.pathZ(n)}a.type!==DDe.CLOSE_PATH?t.push({type:s,points:u,start:{x:i,y:o},pathLength:this.calcLength(i,o,s,u)}):t.push({type:DDe.CLOSE_PATH,points:[],pathLength:0})}return t}},{key:"pathM",value:function(e,t){var n=PDe.pathM(e).point,r=n.x,i=n.y;t.push(r,i)}},{key:"pathL",value:function(e,t){var n=PDe.pathL(e).point,r=n.x,i=n.y;return t.push(r,i),DDe.LINE_TO}},{key:"pathH",value:function(e,t){var n=PDe.pathH(e).point,r=n.x,i=n.y;return t.push(r,i),DDe.LINE_TO}},{key:"pathV",value:function(e,t){var n=PDe.pathV(e).point,r=n.x,i=n.y;return t.push(r,i),DDe.LINE_TO}},{key:"pathC",value:function(e,t){var n=PDe.pathC(e),r=n.point,i=n.controlPoint,o=n.currentPoint;t.push(r.x,r.y,i.x,i.y,o.x,o.y)}},{key:"pathS",value:function(e,t){var n=PDe.pathS(e),r=n.point,i=n.controlPoint,o=n.currentPoint;return t.push(r.x,r.y,i.x,i.y,o.x,o.y),DDe.CURVE_TO}},{key:"pathQ",value:function(e,t){var n=PDe.pathQ(e),r=n.controlPoint,i=n.currentPoint;t.push(r.x,r.y,i.x,i.y)}},{key:"pathT",value:function(e,t){var n=PDe.pathT(e),r=n.controlPoint,i=n.currentPoint;return t.push(r.x,r.y,i.x,i.y),DDe.QUAD_TO}},{key:"pathA",value:function(e){var t=PDe.pathA(e),n=t.rX,r=t.rY,i=t.sweepFlag,o=t.xAxisRotation,a=t.centp,s=t.a1,u=t.ad;return 0===i&&u>0&&(u-=2*Math.PI),1===i&&u<0&&(u+=2*Math.PI),[a.x,a.y,n,r,s,u,o,i]}},{key:"calcLength",value:function(e,t,n,r){var i=0,o=null,a=null,s=0;switch(n){case DDe.LINE_TO:return this.getLineLength(e,t,r[0],r[1]);case DDe.CURVE_TO:for(i=0,o=this.getPointOnCubicBezier(0,e,t,r[0],r[1],r[2],r[3],r[4],r[5]),s=.01;s<=1;s+=.01)a=this.getPointOnCubicBezier(s,e,t,r[0],r[1],r[2],r[3],r[4],r[5]),i+=this.getLineLength(o.x,o.y,a.x,a.y),o=a;return i;case DDe.QUAD_TO:for(i=0,o=this.getPointOnQuadraticBezier(0,e,t,r[0],r[1],r[2],r[3]),s=.01;s<=1;s+=.01)a=this.getPointOnQuadraticBezier(s,e,t,r[0],r[1],r[2],r[3]),i+=this.getLineLength(o.x,o.y,a.x,a.y),o=a;return i;case DDe.ARC:i=0;var u=r[4],l=r[5],A=r[4]+l,c=Math.PI/180;if(Math.abs(u-A)<c&&(c=Math.abs(u-A)),o=this.getPointOnEllipticalArc(r[0],r[1],r[2],r[3],u,0),l<0)for(s=u-c;s>A;s-=c)a=this.getPointOnEllipticalArc(r[0],r[1],r[2],r[3],s,0),i+=this.getLineLength(o.x,o.y,a.x,a.y),o=a;else for(s=u+c;s<A;s+=c)a=this.getPointOnEllipticalArc(r[0],r[1],r[2],r[3],s,0),i+=this.getLineLength(o.x,o.y,a.x,a.y),o=a;return a=this.getPointOnEllipticalArc(r[0],r[1],r[2],r[3],A,0),i+=this.getLineLength(o.x,o.y,a.x,a.y)}return 0}},{key:"getPointOnLine",value:function(e,t,n,r,i){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:t,a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:n,s=(i-n)/(r-t+XNe),u=Math.sqrt(e*e/(1+s*s));r<t&&(u*=-1);var l=s*u,A=null;if(r===t)A={x:o,y:a+l};else if((a-n)/(o-t+XNe)===s)A={x:o+u,y:a+l};else{var c=0,h=0,f=this.getLineLength(t,n,r,i);if(f<XNe)return null;var d=(o-t)*(r-t)+(a-n)*(i-n);c=t+(d/=f*f)*(r-t),h=n+d*(i-n);var p=this.getLineLength(o,a,c,h),g=Math.sqrt(e*e-p*p);u=Math.sqrt(g*g/(1+s*s)),r<t&&(u*=-1),A={x:c+u,y:h+(l=s*u)}}return A}},{key:"getPointOnPath",value:function(e){var t=this.getPathLength(),n=0,r=null;if(e<-5e-5||e-5e-5>t)return null;var i,o=F(this.dataArray);try{for(o.s();!(i=o.n()).done;){var a=i.value;if(!a||!(a.pathLength<5e-5||n+a.pathLength+5e-5<e)){var s=e-n,u=0;switch(a.type){case DDe.LINE_TO:r=this.getPointOnLine(s,a.start.x,a.start.y,a.points[0],a.points[1],a.start.x,a.start.y);break;case DDe.ARC:var l=a.points[4],A=a.points[5],c=a.points[4]+A;if(u=l+s/a.pathLength*A,A<0&&u<c||A>=0&&u>c)break;r=this.getPointOnEllipticalArc(a.points[0],a.points[1],a.points[2],a.points[3],u,a.points[6]);break;case DDe.CURVE_TO:(u=s/a.pathLength)>1&&(u=1),r=this.getPointOnCubicBezier(u,a.start.x,a.start.y,a.points[0],a.points[1],a.points[2],a.points[3],a.points[4],a.points[5]);break;case DDe.QUAD_TO:(u=s/a.pathLength)>1&&(u=1),r=this.getPointOnQuadraticBezier(u,a.start.x,a.start.y,a.points[0],a.points[1],a.points[2],a.points[3])}if(r)return r;break}n+=a.pathLength}}catch(e){o.e(e)}finally{o.f()}return null}},{key:"getLineLength",value:function(e,t,n,r){return Math.sqrt((n-e)*(n-e)+(r-t)*(r-t))}},{key:"getPathLength",value:function(){return-1===this.pathLength&&(this.pathLength=this.dataArray.reduce((function(e,t){return t.pathLength>0?e+t.pathLength:e}),0)),this.pathLength}},{key:"getPointOnCubicBezier",value:function(e,t,n,r,i,o,a,s,u){return{x:s*eDe(e)+o*tDe(e)+r*nDe(e)+t*rDe(e),y:u*eDe(e)+a*tDe(e)+i*nDe(e)+n*rDe(e)}}},{key:"getPointOnQuadraticBezier",value:function(e,t,n,r,i,o,a){return{x:o*iDe(e)+r*oDe(e)+t*aDe(e),y:a*iDe(e)+i*oDe(e)+n*aDe(e)}}},{key:"getPointOnEllipticalArc",value:function(e,t,n,r,i,o){var a=Math.cos(o),s=Math.sin(o),u=n*Math.cos(i),l=r*Math.sin(i);return{x:e+(u*a-l*s),y:t+(u*s+l*a)}}},{key:"buildEquidistantCache",value:function(e,t){var n=this.getPathLength(),r=t||.25,i=e||n/100;if(!this.equidistantCache||this.equidistantCache.step!==i||this.equidistantCache.precision!==r){this.equidistantCache={step:i,precision:r,points:[]};for(var o=0,a=0;a<=n;a+=r){var s=this.getPointOnPath(a),u=this.getPointOnPath(a+r);s&&u&&((o+=this.getLineLength(s.x,s.y,u.x,u.y))>=i&&(this.equidistantCache.points.push({x:s.x,y:s.y,distance:a}),o-=i))}}}},{key:"getEquidistantPointOnPath",value:function(e,t,n){if(this.buildEquidistantCache(t,n),e<0||e-this.getPathLength()>5e-5)return null;var r=Math.round(e/this.getPathLength()*(this.equidistantCache.points.length-1));return this.equidistantCache.points[r]||null}}]),n}(LDe),cFe=/^\s*data:(([^/,;]+\/[^/,;]+)(?:;([^,;=]+=[^,;=]+))?)?(?:;(base64))?,(.*)$/i,hFe=function(e){c(n,e);var t=b(n);function n(e,r,i){var o;s(this,n),(o=t.call(this,e,r,i)).type="image",o.loaded=!1;var a=o.getHrefAttribute().getString();if(!a)return w(o);var u=a.endsWith(".svg")||/^\s*data:image\/svg\+xml/i.test(a);return e.images.push(m(o)),u?o.loadSvg(a):o.loadImage(a),o.isSvg=u,o}return l(n,[{key:"loadImage",value:function(e){var t=this;return TEe(r().mark((function n(){var i;return r().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,t.document.createImage(e);case 3:i=n.sent,t.image=i,n.next=10;break;case 7:n.prev=7,n.t0=n.catch(0),console.error('Error while loading image "'.concat(e,'":'),n.t0);case 10:t.loaded=!0;case 11:case"end":return n.stop()}}),n,null,[[0,7]])})))()}},{key:"loadSvg",value:function(e){var t=this;return TEe(r().mark((function n(){var i,o,a,s;return r().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!(i=cFe.exec(e))){n.next=6;break}o=i[5],"base64"===i[4]?t.image=atob(o):t.image=decodeURIComponent(o),n.next=19;break;case 6:return n.prev=6,n.next=9,t.document.fetch(e);case 9:return a=n.sent,n.next=12,a.text();case 12:s=n.sent,t.image=s,n.next=19;break;case 16:n.prev=16,n.t0=n.catch(6),console.error('Error while loading image "'.concat(e,'":'),n.t0);case 19:t.loaded=!0;case 20:case"end":return n.stop()}}),n,null,[[6,16]])})))()}},{key:"renderChildren",value:function(e){var t=this.document,n=this.image,r=this.loaded,i=this.getAttribute("x").getPixels("x"),o=this.getAttribute("y").getPixels("y"),a=this.getStyle("width").getPixels("x"),s=this.getStyle("height").getPixels("y");if(r&&n&&a&&s){if(e.save(),e.translate(i,o),this.isSvg){var u=t.canvg.forkString(e,this.image,{ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0,ignoreClear:!0,offsetX:0,offsetY:0,scaleWidth:a,scaleHeight:s});u.document.documentElement.parent=this,u.render()}else{var l=this.image;t.setViewBox({ctx:e,aspectRatio:this.getAttribute("preserveAspectRatio").getString(),width:a,desiredWidth:l.width,height:s,desiredHeight:l.height}),this.loaded&&(void 0===l.complete||l.complete)&&e.drawImage(l,0,0)}e.restore()}}},{key:"getBoundingBox",value:function(){var e=this.getAttribute("x").getPixels("x"),t=this.getAttribute("y").getPixels("y"),n=this.getStyle("width").getPixels("x"),r=this.getStyle("height").getPixels("y");return new NDe(e,t,e+n,t+r)}}]),n}(FDe),fFe=function(e){c(n,e);var t=b(n);function n(){var e;return s(this,n),(e=t.apply(this,arguments)).type="symbol",e}return l(n,[{key:"render",value:function(e){}}]),n}(FDe),dFe=function(){function e(t){s(this,e),this.document=t,this.loaded=!1,t.fonts.push(this)}return l(e,[{key:"load",value:function(e,t){var n=this;return TEe(r().mark((function i(){var o,a,s;return r().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,o=n.document,r.next=4,o.canvg.parser.load(t);case 4:a=r.sent,s=a.getElementsByTagName("font"),Array.from(s).forEach((function(t){var n=o.createElement(t);o.definitions[e]=n})),r.next=12;break;case 9:r.prev=9,r.t0=r.catch(0),console.error('Error while loading font "'.concat(t,'":'),r.t0);case 12:n.loaded=!0;case 13:case"end":return r.stop()}}),i,null,[[0,9]])})))()}}]),e}(),pFe=function(e){c(n,e);var t=b(n);function n(e,r,i){var o;s(this,n),(o=t.call(this,e,r,i)).type="style";var a=FNe(Array.from(r.childNodes).map((function(e){return e.textContent})).join("").replace(/(\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*+\/)|(^[\s]*\/\/.*)/gm,"").replace(/@import.*;/g,""));return a.split("}").forEach((function(t){var n=t.trim();if(n){var r=n.split("{"),i=r[0].split(","),o=r[1].split(";");i.forEach((function(t){var n=t.trim();if(n){var r=e.styles[n]||{};if(o.forEach((function(t){var n=t.indexOf(":"),i=t.substr(0,n).trim(),o=t.substr(n+1,t.length-n).trim();i&&o&&(r[i]=new sDe(e,i,o))})),e.styles[n]=r,e.stylesSpecificity[n]=YNe(n),"@font-face"===n){var i=r["font-family"].getString().replace(/"|'/g,"");r.src.getString().split(",").forEach((function(t){if(t.indexOf('format("svg")')>0){var n=RNe(t);n&&new dFe(e).load(i,n)}}))}}}))}})),o}return l(n)}(CDe);pFe.parseExternalUrl=RNe;var gFe=function(e){c(n,e);var t=b(n);function n(){var e;return s(this,n),(e=t.apply(this,arguments)).type="use",e}return l(n,[{key:"setContext",value:function(e){B(h(n.prototype),"setContext",this).call(this,e);var t=this.getAttribute("x"),r=this.getAttribute("y");t.hasValue()&&e.translate(t.getPixels("x"),0),r.hasValue()&&e.translate(0,r.getPixels("y"))}},{key:"path",value:function(e){var t=this.element;t&&t.path(e)}},{key:"renderChildren",value:function(e){var t=this.document,n=this.element;if(n){var r=n;if("symbol"===n.type&&((r=new RDe(t,null)).attributes.viewBox=new sDe(t,"viewBox",n.getAttribute("viewBox").getString()),r.attributes.preserveAspectRatio=new sDe(t,"preserveAspectRatio",n.getAttribute("preserveAspectRatio").getString()),r.attributes.overflow=new sDe(t,"overflow",n.getAttribute("overflow").getString()),r.children=n.children,n.styles.opacity=new sDe(t,"opacity",this.calculateOpacity())),"svg"===r.type){var i=this.getStyle("width",!1,!0),o=this.getStyle("height",!1,!0);i.hasValue()&&(r.attributes.width=new sDe(t,"width",i.getString())),o.hasValue()&&(r.attributes.height=new sDe(t,"height",o.getString()))}var a=r.parent;r.parent=this,r.render(e),r.parent=a}}},{key:"getBoundingBox",value:function(e){var t=this.element;return t?t.getBoundingBox(e):null}},{key:"elementTransform",value:function(){var e=this.document,t=this.element;return EDe.fromElement(e,t)}},{key:"element",get:function(){return this.cachedElement||(this.cachedElement=this.getHrefAttribute().getDefinition()),this.cachedElement}}]),n}(FDe);function vFe(e,t,n,r,i,o){return e[n*r*4+4*t+o]}function yFe(e,t,n,r,i,o,a){e[n*r*4+4*t+o]=a}function mFe(e,t,n){return e[t]*n}function wFe(e,t,n,r){return t+Math.cos(e)*n+Math.sin(e)*r}var bFe=function(e){c(n,e);var t=b(n);function n(e,r,i){var o;s(this,n),(o=t.call(this,e,r,i)).type="feColorMatrix";var a=LNe(o.getAttribute("values").getString());switch(o.getAttribute("type").getString("matrix")){case"saturate":var u=a[0];a=[.213+.787*u,.715-.715*u,.072-.072*u,0,0,.213-.213*u,.715+.285*u,.072-.072*u,0,0,.213-.213*u,.715-.715*u,.072+.928*u,0,0,0,0,0,1,0,0,0,0,0,1];break;case"hueRotate":var l=a[0]*Math.PI/180;a=[wFe(l,.213,.787,-.213),wFe(l,.715,-.715,-.715),wFe(l,.072,-.072,.928),0,0,wFe(l,.213,-.213,.143),wFe(l,.715,.285,.14),wFe(l,.072,-.072,-.283),0,0,wFe(l,.213,-.213,-.787),wFe(l,.715,-.715,.715),wFe(l,.072,.928,.072),0,0,0,0,0,1,0,0,0,0,0,1];break;case"luminanceToAlpha":a=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,.2125,.7154,.0721,0,0,0,0,0,0,1]}return o.matrix=a,o.includeOpacity=o.getAttribute("includeOpacity").hasValue(),o}return l(n,[{key:"apply",value:function(e,t,n,r,i){for(var o=this.includeOpacity,a=this.matrix,s=e.getImageData(0,0,r,i),u=0;u<i;u++)for(var l=0;l<r;l++){var A=vFe(s.data,l,u,r,0,0),c=vFe(s.data,l,u,r,0,1),h=vFe(s.data,l,u,r,0,2),f=vFe(s.data,l,u,r,0,3),d=mFe(a,0,A)+mFe(a,1,c)+mFe(a,2,h)+mFe(a,3,f)+mFe(a,4,1),p=mFe(a,5,A)+mFe(a,6,c)+mFe(a,7,h)+mFe(a,8,f)+mFe(a,9,1),g=mFe(a,10,A)+mFe(a,11,c)+mFe(a,12,h)+mFe(a,13,f)+mFe(a,14,1),v=mFe(a,15,A)+mFe(a,16,c)+mFe(a,17,h)+mFe(a,18,f)+mFe(a,19,1);o&&(d=0,p=0,g=0,v*=f/255),yFe(s.data,l,u,r,0,0,d),yFe(s.data,l,u,r,0,1,p),yFe(s.data,l,u,r,0,2,g),yFe(s.data,l,u,r,0,3,v)}e.clearRect(0,0,r,i),e.putImageData(s,0,0)}}]),n}(CDe),IFe=function(e){c(n,e);var t=b(n);function n(){var e;return s(this,n),(e=t.apply(this,arguments)).type="mask",e}return l(n,[{key:"apply",value:function(e,t){var r=this.document,i=this.getAttribute("x").getPixels("x"),o=this.getAttribute("y").getPixels("y"),a=this.getStyle("width").getPixels("x"),s=this.getStyle("height").getPixels("y");if(!a&&!s){var u=new NDe;this.children.forEach((function(t){u.addBoundingBox(t.getBoundingBox(e))})),i=Math.floor(u.x1),o=Math.floor(u.y1),a=Math.floor(u.width),s=Math.floor(u.height)}var l=this.removeStyles(t,n.ignoreStyles),A=r.createCanvas(i+a,o+s),c=A.getContext("2d");r.screen.setDefaults(c),this.renderChildren(c),new bFe(r,{nodeType:1,childNodes:[],attributes:[{nodeName:"type",value:"luminanceToAlpha"},{nodeName:"includeOpacity",value:"true"}]}).apply(c,0,0,i+a,o+s);var h=r.createCanvas(i+a,o+s),f=h.getContext("2d");r.screen.setDefaults(f),t.render(f),f.globalCompositeOperation="destination-in",f.fillStyle=c.createPattern(A,"no-repeat"),f.fillRect(0,0,i+a,o+s),e.fillStyle=f.createPattern(h,"no-repeat"),e.fillRect(0,0,i+a,o+s),this.restoreStyles(t,l)}},{key:"render",value:function(e){}}]),n}(CDe);IFe.ignoreStyles=["mask","transform","clip-path"];var BFe=function(){},EFe=function(e){c(n,e);var t=b(n);function n(){var e;return s(this,n),(e=t.apply(this,arguments)).type="clipPath",e}return l(n,[{key:"apply",value:function(e){var t=this.document,n=Reflect.getPrototypeOf(e),r=e.beginPath,i=e.closePath;n&&(n.beginPath=BFe,n.closePath=BFe),Reflect.apply(r,e,[]),this.children.forEach((function(r){if(void 0!==r.path){var o=void 0!==r.elementTransform?r.elementTransform():null;o||(o=EDe.fromElement(t,r)),o&&o.apply(e),r.path(e),n&&(n.closePath=i),o&&o.unapply(e)}})),Reflect.apply(i,e,[]),e.clip(),n&&(n.beginPath=r,n.closePath=i)}},{key:"render",value:function(e){}}]),n}(CDe),CFe=function(e){c(n,e);var t=b(n);function n(){var e;return s(this,n),(e=t.apply(this,arguments)).type="filter",e}return l(n,[{key:"apply",value:function(e,t){var r=this.document,i=this.children,o=t.getBoundingBox(e);if(o){var a=0,s=0;i.forEach((function(e){var t=e.extraFilterDistance||0;a=Math.max(a,t),s=Math.max(s,t)}));var u=Math.floor(o.width),l=Math.floor(o.height),A=u+2*a,c=l+2*s;if(!(A<1||c<1)){var h=Math.floor(o.x),f=Math.floor(o.y),d=this.removeStyles(t,n.ignoreStyles),p=r.createCanvas(A,c),g=p.getContext("2d");r.screen.setDefaults(g),g.translate(-h+a,-f+s),t.render(g),i.forEach((function(e){"function"==typeof e.apply&&e.apply(g,0,0,A,c)})),e.drawImage(p,0,0,A,c,h-a,f-s,A,c),this.restoreStyles(t,d)}}}},{key:"render",value:function(e){}}]),n}(CDe);CFe.ignoreStyles=["filter","transform","clip-path"];var xFe=function(e){c(n,e);var t=b(n);function n(e,r,i){var o;return s(this,n),(o=t.call(this,e,r,i)).type="feDropShadow",o.addStylesFromStyleDefinition(),o}return l(n,[{key:"apply",value:function(e,t,n,r,i){}}]),n}(CDe),kFe=function(e){c(n,e);var t=b(n);function n(){var e;return s(this,n),(e=t.apply(this,arguments)).type="feMorphology",e}return l(n,[{key:"apply",value:function(e,t,n,r,i){}}]),n}(CDe),SFe=function(e){c(n,e);var t=b(n);function n(){var e;return s(this,n),(e=t.apply(this,arguments)).type="feComposite",e}return l(n,[{key:"apply",value:function(e,t,n,r,i){}}]),n}(CDe),QFe=function(e){c(n,e);var t=b(n);function n(e,r,i){var o;return s(this,n),(o=t.call(this,e,r,i)).type="feGaussianBlur",o.blurRadius=Math.floor(o.getAttribute("stdDeviation").getNumber()),o.extraFilterDistance=o.blurRadius,o}return l(n,[{key:"apply",value:function(e,t,n,r,i){var o=this.document,a=this.blurRadius,s=o.window?o.window.document.body:null,u=e.canvas;u.id=o.getUniqueId(),s&&(u.style.display="none",s.appendChild(u)),_Ne(u,t,n,r,i,a),s&&s.removeChild(u)}}]),n}(CDe),_Fe=function(e){c(n,e);var t=b(n);function n(){var e;return s(this,n),(e=t.apply(this,arguments)).type="title",e}return l(n)}(CDe),NFe=function(e){c(n,e);var t=b(n);function n(){var e;return s(this,n),(e=t.apply(this,arguments)).type="desc",e}return l(n)}(CDe),DFe={svg:RDe,rect:ODe,circle:HDe,ellipse:KDe,line:jDe,polyline:GDe,polygon:qDe,path:PDe,pattern:VDe,marker:zDe,defs:JDe,linearGradient:WDe,radialGradient:ZDe,stop:$De,animate:eFe,animateColor:tFe,animateTransform:nFe,font:rFe,"font-face":iFe,"missing-glyph":oFe,glyph:UDe,text:LDe,tspan:MDe,tref:aFe,a:sFe,textPath:AFe,image:hFe,g:YDe,symbol:fFe,style:pFe,use:gFe,mask:IFe,clipPath:EFe,filter:CFe,feDropShadow:xFe,feMorphology:kFe,feComposite:SFe,feColorMatrix:bFe,feGaussianBlur:QFe,title:_Fe,desc:NFe};function FFe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function PFe(){return PFe=TEe(r().mark((function e(t){var n,i,o=arguments;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=o.length>1&&void 0!==o[1]&&o[1],i=document.createElement("img"),n&&(i.crossOrigin="Anonymous"),e.abrupt("return",new Promise((function(e,n){i.onload=function(){e(i)},i.onerror=function(e,t,r,i,o){n(o)},i.src=t})));case 4:case"end":return e.stop()}}),e)}))),PFe.apply(this,arguments)}var UFe=function(){function e(t){s(this,e);var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.rootEmSize,i=void 0===r?12:r,o=n.emSize,a=void 0===o?12:o,u=n.createCanvas,l=void 0===u?e.createCanvas:u,A=n.createImage,c=void 0===A?e.createImage:A,h=n.anonymousCrossOrigin;this.canvg=t,this.definitions={},this.styles={},this.stylesSpecificity={},this.images=[],this.fonts=[],this.emSizeStack=[],this.uniqueId=0,this.screen=t.screen,this.rootEmSize=i,this.emSize=a,this.createCanvas=l,this.createImage=this.bindCreateImage(c,h),this.screen.wait(this.isImagesLoaded.bind(this)),this.screen.wait(this.isFontsLoaded.bind(this))}return l(e,[{key:"bindCreateImage",value:function(e,t){return"boolean"==typeof t?function(n,r){return e(n,"boolean"==typeof r?r:t)}:e}},{key:"window",get:function(){return this.screen.window}},{key:"fetch",get:function(){return this.screen.fetch}},{key:"ctx",get:function(){return this.screen.ctx}},{key:"emSize",get:function(){var e=this.emSizeStack;return e[e.length-1]},set:function(e){this.emSizeStack.push(e)}},{key:"popEmSize",value:function(){this.emSizeStack.pop()}},{key:"getUniqueId",value:function(){return"canvg".concat(++this.uniqueId)}},{key:"isImagesLoaded",value:function(){return this.images.every((function(e){return e.loaded}))}},{key:"isFontsLoaded",value:function(){return this.fonts.every((function(e){return e.loaded}))}},{key:"createDocumentElement",value:function(e){var t=this.createElement(e.documentElement);return t.root=!0,t.addStylesFromStyleDefinition(),this.documentElement=t,t}},{key:"createElement",value:function(t){var n=t.nodeName.replace(/^[^:]+:/,""),r=e.elementTypes[n];return void 0!==r?new r(this,t):new xDe(this,t)}},{key:"createTextNode",value:function(e){return new TDe(this,e)}},{key:"setViewBox",value:function(e){this.screen.setViewBox(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?FFe(Object(n),!0).forEach((function(t){$Se(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):FFe(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({document:this},e))}}]),e}();function LFe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function MFe(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?LFe(Object(n),!0).forEach((function(t){$Se(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):LFe(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}UFe.createCanvas=function(e,t){var n=document.createElement("canvas");return n.width=e,n.height=t,n},UFe.createImage=function(e){return PFe.apply(this,arguments)},UFe.elementTypes=DFe;var TFe=function(){function e(t,n){s(this,e);var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.parser=new gDe(r),this.screen=new fDe(t,r),this.options=r;var i=new UFe(this,r),o=i.createDocumentElement(n);this.document=i,this.documentElement=o}return l(e,[{key:"fork",value:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return e.from(t,n,MFe(MFe({},this.options),r))}},{key:"forkString",value:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return e.fromString(t,n,MFe(MFe({},this.options),r))}},{key:"ready",value:function(){return this.screen.ready()}},{key:"isReady",value:function(){return this.screen.isReady()}},{key:"render",value:function(){var e=arguments,t=this;return TEe(r().mark((function n(){var i;return r().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return i=e.length>0&&void 0!==e[0]?e[0]:{},t.start(MFe({enableRedraw:!0,ignoreAnimation:!0,ignoreMouse:!0},i)),n.next=4,t.ready();case 4:t.stop();case 5:case"end":return n.stop()}}),n)})))()}},{key:"start",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.documentElement,n=this.screen,r=this.options;n.start(t,MFe(MFe({enableRedraw:!0},r),e))}},{key:"stop",value:function(){this.screen.stop()}},{key:"resize",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.documentElement.resize(e,t,n)}}],[{key:"from",value:function(t,n){var i=arguments;return TEe(r().mark((function o(){var a,s,u;return r().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return a=i.length>2&&void 0!==i[2]?i[2]:{},s=new gDe(a),r.next=4,s.parse(n);case 4:return u=r.sent,r.abrupt("return",new e(t,u,a));case 6:case"end":return r.stop()}}),o)})))()}},{key:"fromString",value:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=new gDe(r),o=i.parseFromString(n);return new e(t,o,r)}}]),e}(),RFe=Object.freeze({__proto__:null,AElement:sFe,AnimateColorElement:tFe,AnimateElement:eFe,AnimateTransformElement:nFe,BoundingBox:NDe,CB1:eDe,CB2:tDe,CB3:nDe,CB4:rDe,Canvg:TFe,CircleElement:HDe,ClipPathElement:EFe,DefsElement:JDe,DescElement:NFe,Document:UFe,Element:CDe,EllipseElement:KDe,FeColorMatrixElement:bFe,FeCompositeElement:SFe,FeDropShadowElement:xFe,FeGaussianBlurElement:QFe,FeMorphologyElement:kFe,FilterElement:CFe,Font:_De,FontElement:rFe,FontFaceElement:iFe,GElement:YDe,GlyphElement:UDe,GradientElement:XDe,ImageElement:hFe,LineElement:jDe,LinearGradientElement:WDe,MarkerElement:zDe,MaskElement:IFe,Matrix:wDe,MissingGlyphElement:oFe,Mouse:ADe,PSEUDO_ZERO:XNe,Parser:gDe,PathElement:PDe,PathParser:DDe,PatternElement:VDe,Point:lDe,PolygonElement:qDe,PolylineElement:GDe,Property:sDe,QB1:iDe,QB2:oDe,QB3:aDe,RadialGradientElement:ZDe,RectElement:ODe,RenderedElement:FDe,Rotate:yDe,SVGElement:RDe,SVGFontLoader:dFe,Scale:mDe,Screen:fDe,Skew:bDe,SkewX:IDe,SkewY:BDe,StopElement:$De,StyleElement:pFe,SymbolElement:fFe,TRefElement:aFe,TSpanElement:MDe,TextElement:LDe,TextPathElement:AFe,TitleElement:_Fe,Transform:EDe,Translate:vDe,UnknownElement:xDe,UseElement:gFe,ViewPort:uDe,compressSpaces:FNe,default:TFe,getSelectorSpecificity:YNe,normalizeAttributeName:TNe,normalizeColor:ONe,parseExternalUrl:RNe,presets:DNe,toNumbers:LNe,trimLeft:PNe,trimRight:UNe,vectorMagnitude:WNe,vectorsAngle:$Ne,vectorsRatio:ZNe})}();
841
+ var QNe=[512,512,456,512,328,456,335,512,405,328,271,456,388,335,292,512,454,405,364,328,298,271,496,456,420,388,360,335,312,292,273,512,482,454,428,405,383,364,345,328,312,298,284,271,259,496,475,456,437,420,404,388,374,360,347,335,323,312,302,292,282,273,265,512,497,482,468,454,441,428,417,405,394,383,373,364,354,345,337,328,320,312,305,298,291,284,278,271,265,259,507,496,485,475,465,456,446,437,428,420,412,404,396,388,381,374,367,360,354,347,341,335,329,323,318,312,307,302,297,292,287,282,278,273,269,265,261,512,505,497,489,482,475,468,461,454,447,441,435,428,422,417,411,405,399,394,389,383,378,373,368,364,359,354,350,345,341,337,332,328,324,320,316,312,309,305,301,298,294,291,287,284,281,278,274,271,268,265,262,259,257,507,501,496,491,485,480,475,470,465,460,456,451,446,442,437,433,428,424,420,416,412,408,404,400,396,392,388,385,381,377,374,370,367,363,360,357,354,350,347,344,341,338,335,332,329,326,323,320,318,315,312,310,307,304,302,299,297,294,292,289,287,285,282,280,278,275,273,271,269,267,265,263,261,259],_Ne=[9,11,12,13,13,14,14,15,15,15,15,16,16,16,16,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24];function NNe(e,t,n,r,i,o){if(!(isNaN(o)||o<1)){o|=0;var a=function(e,t,n,r,i){if("string"==typeof e&&(e=document.getElementById(e)),!e||"object"!==SNe(e)||!("getContext"in e))throw new TypeError("Expecting canvas with `getContext` method in processCanvasRGB(A) calls!");var o=e.getContext("2d");try{return o.getImageData(t,n,r,i)}catch(e){throw new Error("unable to access image data: "+e)}}(e,t,n,r,i);a=function(e,t,n,r,i,o){for(var a,s=e.data,u=2*o+1,l=r-1,A=i-1,c=o+1,h=c*(c+1)/2,f=new DNe,d=f,p=1;p<u;p++)d=d.next=new DNe,p===c&&(a=d);d.next=f;for(var g=null,v=null,y=0,m=0,w=QNe[o],b=_Ne[o],I=0;I<i;I++){d=f;for(var B=s[m],E=s[m+1],C=s[m+2],x=s[m+3],k=0;k<c;k++)d.r=B,d.g=E,d.b=C,d.a=x,d=d.next;for(var S=0,Q=0,_=0,N=0,D=c*B,F=c*E,P=c*C,U=c*x,L=h*B,M=h*E,T=h*C,R=h*x,O=1;O<c;O++){var H=m+((l<O?l:O)<<2),K=s[H],j=s[H+1],G=s[H+2],q=s[H+3],V=c-O;L+=(d.r=K)*V,M+=(d.g=j)*V,T+=(d.b=G)*V,R+=(d.a=q)*V,S+=K,Q+=j,_+=G,N+=q,d=d.next}g=f,v=a;for(var z=0;z<r;z++){var J=R*w>>b;if(s[m+3]=J,0!==J){var Y=255/J;s[m]=(L*w>>b)*Y,s[m+1]=(M*w>>b)*Y,s[m+2]=(T*w>>b)*Y}else s[m]=s[m+1]=s[m+2]=0;L-=D,M-=F,T-=P,R-=U,D-=g.r,F-=g.g,P-=g.b,U-=g.a;var X=z+o+1;X=y+(X<l?X:l)<<2,L+=S+=g.r=s[X],M+=Q+=g.g=s[X+1],T+=_+=g.b=s[X+2],R+=N+=g.a=s[X+3],g=g.next;var W=v,Z=W.r,$=W.g,ee=W.b,te=W.a;D+=Z,F+=$,P+=ee,U+=te,S-=Z,Q-=$,_-=ee,N-=te,v=v.next,m+=4}y+=r}for(var ne=0;ne<r;ne++){var re=s[m=ne<<2],ie=s[m+1],oe=s[m+2],ae=s[m+3],se=c*re,ue=c*ie,le=c*oe,Ae=c*ae,ce=h*re,he=h*ie,fe=h*oe,de=h*ae;d=f;for(var pe=0;pe<c;pe++)d.r=re,d.g=ie,d.b=oe,d.a=ae,d=d.next;for(var ge=r,ve=0,ye=0,me=0,we=0,be=1;be<=o;be++){m=ge+ne<<2;var Ie=c-be;ce+=(d.r=re=s[m])*Ie,he+=(d.g=ie=s[m+1])*Ie,fe+=(d.b=oe=s[m+2])*Ie,de+=(d.a=ae=s[m+3])*Ie,we+=re,ve+=ie,ye+=oe,me+=ae,d=d.next,be<A&&(ge+=r)}m=ne,g=f,v=a;for(var Be=0;Be<i;Be++){var Ee=m<<2;s[Ee+3]=ae=de*w>>b,ae>0?(ae=255/ae,s[Ee]=(ce*w>>b)*ae,s[Ee+1]=(he*w>>b)*ae,s[Ee+2]=(fe*w>>b)*ae):s[Ee]=s[Ee+1]=s[Ee+2]=0,ce-=se,he-=ue,fe-=le,de-=Ae,se-=g.r,ue-=g.g,le-=g.b,Ae-=g.a,Ee=ne+((Ee=Be+c)<A?Ee:A)*r<<2,ce+=we+=g.r=s[Ee],he+=ve+=g.g=s[Ee+1],fe+=ye+=g.b=s[Ee+2],de+=me+=g.a=s[Ee+3],g=g.next,se+=re=v.r,ue+=ie=v.g,le+=oe=v.b,Ae+=ae=v.a,we-=re,ve-=ie,ye-=oe,me-=ae,v=v.next,m+=r}}return e}(a,0,0,r,i,o),e.getContext("2d").putImageData(a,t,n)}}var DNe=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.r=0,this.g=0,this.b=0,this.a=0,this.next=null};var FNe=Object.freeze({__proto__:null,offscreen:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.DOMParser,n={window:null,ignoreAnimation:!0,ignoreMouse:!0,DOMParser:t,createCanvas:function(e,t){return new OffscreenCanvas(e,t)},createImage:function(e){return REe(r().mark((function t(){var n,i,o;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,fetch(e);case 2:return n=t.sent,t.next=5,n.blob();case 5:return i=t.sent,t.next=8,createImageBitmap(i);case 8:return o=t.sent,t.abrupt("return",o);case 10:case"end":return t.stop()}}),t)})))()}};return"undefined"==typeof DOMParser&&void 0!==t||Reflect.deleteProperty(n,"DOMParser"),n},node:function(e){var t=e.DOMParser,n=e.canvas;return{window:null,ignoreAnimation:!0,ignoreMouse:!0,DOMParser:t,fetch:e.fetch,createCanvas:n.createCanvas,createImage:n.loadImage}}});function PNe(e){return e.replace(/(?!\u3000)\s+/gm," ")}function UNe(e){return e.replace(/^[\n \t]+/,"")}function LNe(e){return e.replace(/[\n \t]+$/,"")}function MNe(e){return((e||"").match(/-?(\d+(?:\.\d*(?:[eE][+-]?\d+)?)?|\.\d+)(?=\D|$)/gm)||[]).map(parseFloat)}var TNe=/^[A-Z-]+$/;function RNe(e){return TNe.test(e)?e.toLowerCase():e}function ONe(e){var t=/url\(('([^']+)'|"([^"]+)"|([^'")]+))\)/.exec(e)||[];return t[2]||t[3]||t[4]}function HNe(e){if(!e.startsWith("rgb"))return e;var t=3;return e.replace(/\d+(\.\d+)?/g,(function(e,n){return t--&&n?String(Math.round(parseFloat(e))):e}))}var KNe=/(\[[^\]]+\])/g,jNe=/(#[^\s+>~.[:]+)/g,GNe=/(\.[^\s+>~.[:]+)/g,qNe=/(::[^\s+>~.[:]+|:first-line|:first-letter|:before|:after)/gi,VNe=/(:[\w-]+\([^)]*\))/gi,zNe=/(:[^\s+>~.[:]+)/g,JNe=/([^\s+>~.[:]+)/g;function YNe(e,t){var n=t.exec(e);return n?[e.replace(t," "),n.length]:[e,0]}function XNe(e){var t=[0,0,0],n=e.replace(/:not\(([^)]*)\)/g," $1 ").replace(/{[\s\S]*/gm," "),r=0,i=C(YNe(n,KNe),2);n=i[0],r=i[1],t[1]+=r;var o=C(YNe(n,jNe),2);n=o[0],r=o[1],t[0]+=r;var a=C(YNe(n,GNe),2);n=a[0],r=a[1],t[1]+=r;var s=C(YNe(n,qNe),2);n=s[0],r=s[1],t[2]+=r;var u=C(YNe(n,VNe),2);n=u[0],r=u[1],t[1]+=r;var l=C(YNe(n,zNe),2);n=l[0],r=l[1],t[1]+=r;var A=C(YNe(n=n.replace(/[*\s+>~]/g," ").replace(/[#.]/g," "),JNe),2);return n=A[0],r=A[1],t[2]+=r,t.join("")}var WNe=1e-8;function ZNe(e){return Math.sqrt(Math.pow(e[0],2)+Math.pow(e[1],2))}function $Ne(e,t){return(e[0]*t[0]+e[1]*t[1])/(ZNe(e)*ZNe(t))}function eDe(e,t){return(e[0]*t[1]<e[1]*t[0]?-1:1)*Math.acos($Ne(e,t))}function tDe(e){return e*e*e}function nDe(e){return 3*e*e*(1-e)}function rDe(e){return 3*e*(1-e)*(1-e)}function iDe(e){return(1-e)*(1-e)*(1-e)}function oDe(e){return e*e}function aDe(e){return 2*e*(1-e)}function sDe(e){return(1-e)*(1-e)}var uDe=function(){function e(t,n,r){s(this,e),this.document=t,this.name=n,this.value=r,this.isNormalizedColor=!1}return l(e,[{key:"split",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:" ",n=this.document,r=this.name;return PNe(this.getString()).trim().split(t).map((function(t){return new e(n,r,t)}))}},{key:"hasValue",value:function(e){var t=this.value;return null!==t&&""!==t&&(e||0!==t)&&void 0!==t}},{key:"isString",value:function(e){var t=this.value,n="string"==typeof t;return n&&e?e.test(t):n}},{key:"isUrlDefinition",value:function(){return this.isString(/^url\(/)}},{key:"isPixels",value:function(){if(!this.hasValue())return!1;var e=this.getString();switch(!0){case e.endsWith("px"):case/^[0-9]+$/.test(e):return!0;default:return!1}}},{key:"setValue",value:function(e){return this.value=e,this}},{key:"getValue",value:function(e){return void 0===e||this.hasValue()?this.value:e}},{key:"getNumber",value:function(e){if(!this.hasValue())return void 0===e?0:parseFloat(e);var t=this.value,n=parseFloat(t);return this.isString(/%$/)&&(n/=100),n}},{key:"getString",value:function(e){return void 0===e||this.hasValue()?void 0===this.value?"":String(this.value):String(e)}},{key:"getColor",value:function(e){var t=this.getString(e);return this.isNormalizedColor||(this.isNormalizedColor=!0,t=HNe(t),this.value=t),t}},{key:"getDpi",value:function(){return 96}},{key:"getRem",value:function(){return this.document.rootEmSize}},{key:"getEm",value:function(){return this.document.emSize}},{key:"getUnits",value:function(){return this.getString().replace(/[0-9.-]/g,"")}},{key:"getPixels",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!this.hasValue())return 0;var n="boolean"==typeof e?[void 0,e]:[e],r=C(n,2),i=r[0],o=r[1],a=this.document.screen.viewPort;switch(!0){case this.isString(/vmin$/):return this.getNumber()/100*Math.min(a.computeSize("x"),a.computeSize("y"));case this.isString(/vmax$/):return this.getNumber()/100*Math.max(a.computeSize("x"),a.computeSize("y"));case this.isString(/vw$/):return this.getNumber()/100*a.computeSize("x");case this.isString(/vh$/):return this.getNumber()/100*a.computeSize("y");case this.isString(/rem$/):return this.getNumber()*this.getRem();case this.isString(/em$/):return this.getNumber()*this.getEm();case this.isString(/ex$/):return this.getNumber()*this.getEm()/2;case this.isString(/px$/):return this.getNumber();case this.isString(/pt$/):return this.getNumber()*this.getDpi()*(1/72);case this.isString(/pc$/):return 15*this.getNumber();case this.isString(/cm$/):return this.getNumber()*this.getDpi()/2.54;case this.isString(/mm$/):return this.getNumber()*this.getDpi()/25.4;case this.isString(/in$/):return this.getNumber()*this.getDpi();case this.isString(/%$/)&&o:return this.getNumber()*this.getEm();case this.isString(/%$/):return this.getNumber()*a.computeSize(i);default:var s=this.getNumber();return t&&s<1?s*a.computeSize(i):s}}},{key:"getMilliseconds",value:function(){return this.hasValue()?this.isString(/ms$/)?this.getNumber():1e3*this.getNumber():0}},{key:"getRadians",value:function(){if(!this.hasValue())return 0;switch(!0){case this.isString(/deg$/):return this.getNumber()*(Math.PI/180);case this.isString(/grad$/):return this.getNumber()*(Math.PI/200);case this.isString(/rad$/):return this.getNumber();default:return this.getNumber()*(Math.PI/180)}}},{key:"getDefinition",value:function(){var e=this.getString(),t=/#([^)'"]+)/.exec(e);return t&&(t=t[1]),t||(t=e),this.document.definitions[t]}},{key:"getFillStyleDefinition",value:function(e,t){var n=this.getDefinition();if(!n)return null;if("function"==typeof n.createGradient)return n.createGradient(this.document.ctx,e,t);if("function"==typeof n.createPattern){if(n.getHrefAttribute().hasValue()){var r=n.getAttribute("patternTransform");n=n.getHrefAttribute().getDefinition(),r.hasValue()&&n.getAttribute("patternTransform",!0).setValue(r.value)}return n.createPattern(this.document.ctx,e,t)}return null}},{key:"getTextBaseline",value:function(){return this.hasValue()?e.textBaselineMapping[this.getString()]:null}},{key:"addOpacity",value:function(t){for(var n=this.getColor(),r=n.length,i=0,o=0;o<r&&(","===n[o]&&i++,3!==i);o++);if(t.hasValue()&&this.isString()&&3!==i){var a=new Q_e(n);a.ok&&(a.alpha=t.getNumber(),n=a.toRGBA())}return new e(this.document,this.name,n)}}],[{key:"empty",value:function(t){return new e(t,"EMPTY","")}}]),e}();uDe.textBaselineMapping={baseline:"alphabetic","before-edge":"top","text-before-edge":"top",middle:"middle",central:"middle","after-edge":"bottom","text-after-edge":"bottom",ideographic:"ideographic",alphabetic:"alphabetic",hanging:"hanging",mathematical:"alphabetic"};var lDe=function(){function e(){s(this,e),this.viewPorts=[]}return l(e,[{key:"clear",value:function(){this.viewPorts=[]}},{key:"setCurrent",value:function(e,t){this.viewPorts.push({width:e,height:t})}},{key:"removeCurrent",value:function(){this.viewPorts.pop()}},{key:"getCurrent",value:function(){var e=this.viewPorts;return e[e.length-1]}},{key:"width",get:function(){return this.getCurrent().width}},{key:"height",get:function(){return this.getCurrent().height}},{key:"computeSize",value:function(e){return"number"==typeof e?e:"x"===e?this.width:"y"===e?this.height:Math.sqrt(Math.pow(this.width,2)+Math.pow(this.height,2))/Math.sqrt(2)}}]),e}(),ADe=function(){function e(t,n){s(this,e),this.x=t,this.y=n}return l(e,[{key:"angleTo",value:function(e){return Math.atan2(e.y-this.y,e.x-this.x)}},{key:"applyTransform",value:function(e){var t=this.x,n=this.y,r=t*e[0]+n*e[2]+e[4],i=t*e[1]+n*e[3]+e[5];this.x=r,this.y=i}}],[{key:"parse",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=MNe(t),i=C(r,2),o=i[0],a=void 0===o?n:o,s=i[1],u=void 0===s?n:s;return new e(a,u)}},{key:"parseScale",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=MNe(t),i=C(r,2),o=i[0],a=void 0===o?n:o,s=i[1],u=void 0===s?a:s;return new e(a,u)}},{key:"parsePath",value:function(t){for(var n=MNe(t),r=n.length,i=[],o=0;o<r;o+=2)i.push(new e(n[o],n[o+1]));return i}}]),e}(),cDe=function(){function e(t){s(this,e),this.screen=t,this.working=!1,this.events=[],this.eventElements=[],this.onClick=this.onClick.bind(this),this.onMouseMove=this.onMouseMove.bind(this)}return l(e,[{key:"isWorking",value:function(){return this.working}},{key:"start",value:function(){if(!this.working){var e=this.screen,t=this.onClick,n=this.onMouseMove,r=e.ctx.canvas;r.onclick=t,r.onmousemove=n,this.working=!0}}},{key:"stop",value:function(){if(this.working){var e=this.screen.ctx.canvas;this.working=!1,e.onclick=null,e.onmousemove=null}}},{key:"hasEvents",value:function(){return this.working&&this.events.length>0}},{key:"runEvents",value:function(){if(this.working){var e=this.screen,t=this.events,n=this.eventElements,r=e.ctx.canvas.style;r&&(r.cursor=""),t.forEach((function(e,t){for(var r=e.run,i=n[t];i;)r(i),i=i.parent})),this.events=[],this.eventElements=[]}}},{key:"checkPath",value:function(e,t){if(this.working&&t){var n=this.events,r=this.eventElements;n.forEach((function(n,i){var o=n.x,a=n.y;!r[i]&&t.isPointInPath&&t.isPointInPath(o,a)&&(r[i]=e)}))}}},{key:"checkBoundingBox",value:function(e,t){if(this.working&&t){var n=this.events,r=this.eventElements;n.forEach((function(n,i){var o=n.x,a=n.y;!r[i]&&t.isPointInBox(o,a)&&(r[i]=e)}))}}},{key:"mapXY",value:function(e,t){for(var n=this.screen,r=n.window,i=n.ctx,o=new ADe(e,t),a=i.canvas;a;)o.x-=a.offsetLeft,o.y-=a.offsetTop,a=a.offsetParent;return r.scrollX&&(o.x+=r.scrollX),r.scrollY&&(o.y+=r.scrollY),o}},{key:"onClick",value:function(e){var t=this.mapXY(e.clientX,e.clientY),n=t.x,r=t.y;this.events.push({type:"onclick",x:n,y:r,run:function(e){e.onClick&&e.onClick()}})}},{key:"onMouseMove",value:function(e){var t=this.mapXY(e.clientX,e.clientY),n=t.x,r=t.y;this.events.push({type:"onmousemove",x:n,y:r,run:function(e){e.onMouseMove&&e.onMouseMove()}})}}]),e}(),hDe="undefined"!=typeof window?window:null,fDe="undefined"!=typeof fetch?fetch.bind(void 0):null,dDe=function(){function e(t){s(this,e);var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.fetch,i=void 0===r?fDe:r,o=n.window,a=void 0===o?hDe:o;this.ctx=t,this.FRAMERATE=30,this.MAX_VIRTUAL_PIXELS=3e4,this.CLIENT_WIDTH=800,this.CLIENT_HEIGHT=600,this.viewPort=new lDe,this.mouse=new cDe(this),this.animations=[],this.waits=[],this.frameDuration=0,this.isReadyLock=!1,this.isFirstRender=!0,this.intervalId=null,this.window=a,this.fetch=i}return l(e,[{key:"wait",value:function(e){this.waits.push(e)}},{key:"ready",value:function(){return this.readyPromise?this.readyPromise:Promise.resolve()}},{key:"isReady",value:function(){if(this.isReadyLock)return!0;var e=this.waits.every((function(e){return e()}));return e&&(this.waits=[],this.resolveReady&&this.resolveReady()),this.isReadyLock=e,e}},{key:"setDefaults",value:function(e){e.strokeStyle="rgba(0,0,0,0)",e.lineCap="butt",e.lineJoin="miter",e.miterLimit=4}},{key:"setViewBox",value:function(e){var t=e.document,n=e.ctx,r=e.aspectRatio,i=e.width,o=e.desiredWidth,a=e.height,s=e.desiredHeight,u=e.minX,l=void 0===u?0:u,A=e.minY,c=void 0===A?0:A,h=e.refX,f=e.refY,d=e.clip,p=void 0!==d&&d,g=e.clipX,v=void 0===g?0:g,y=e.clipY,m=void 0===y?0:y,w=C(PNe(r).replace(/^defer\s/,"").split(" "),2),b=w[0]||"xMidYMid",I=w[1]||"meet",B=i/o,E=a/s,x=Math.min(B,E),k=Math.max(B,E),S=o,Q=s;"meet"===I&&(S*=x,Q*=x),"slice"===I&&(S*=k,Q*=k);var _=new uDe(t,"refX",h),N=new uDe(t,"refY",f),D=_.hasValue()&&N.hasValue();if(D&&n.translate(-x*_.getPixels("x"),-x*N.getPixels("y")),p){var F=x*v,P=x*m;n.beginPath(),n.moveTo(F,P),n.lineTo(i,P),n.lineTo(i,a),n.lineTo(F,a),n.closePath(),n.clip()}if(!D){var U="meet"===I&&x===E,L="slice"===I&&k===E,M="meet"===I&&x===B,T="slice"===I&&k===B;b.startsWith("xMid")&&(U||L)&&n.translate(i/2-S/2,0),b.endsWith("YMid")&&(M||T)&&n.translate(0,a/2-Q/2),b.startsWith("xMax")&&(U||L)&&n.translate(i-S,0),b.endsWith("YMax")&&(M||T)&&n.translate(0,a-Q)}switch(!0){case"none"===b:n.scale(B,E);break;case"meet"===I:n.scale(x,x);break;case"slice"===I:n.scale(k,k)}n.translate(-l,-c)}},{key:"start",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.enableRedraw,i=void 0!==r&&r,o=n.ignoreMouse,a=void 0!==o&&o,s=n.ignoreAnimation,u=void 0!==s&&s,l=n.ignoreDimensions,A=void 0!==l&&l,c=n.ignoreClear,h=void 0!==c&&c,f=n.forceRedraw,d=n.scaleWidth,p=n.scaleHeight,g=n.offsetX,v=n.offsetY,y=this.FRAMERATE,m=this.mouse,w=1e3/y;if(this.frameDuration=w,this.readyPromise=new Promise((function(e){t.resolveReady=e})),this.isReady()&&this.render(e,A,h,d,p,g,v),i){var b=Date.now(),I=b,B=0,E=function n(){b=Date.now(),(B=b-I)>=w&&(I=b-B%w,t.shouldUpdate(u,f)&&(t.render(e,A,h,d,p,g,v),m.runEvents())),t.intervalId=i_e.exports(n)};a||m.start(),this.intervalId=i_e.exports(E)}}},{key:"stop",value:function(){this.intervalId&&(i_e.exports.cancel(this.intervalId),this.intervalId=null),this.mouse.stop()}},{key:"shouldUpdate",value:function(e,t){if(!e){var n=this.frameDuration,r=this.animations.reduce((function(e,t){return t.update(n)||e}),!1);if(r)return!0}return!("function"!=typeof t||!t())||(!(this.isReadyLock||!this.isReady())||!!this.mouse.hasEvents())}},{key:"render",value:function(e,t,n,r,i,o,a){var s=this.CLIENT_WIDTH,u=this.CLIENT_HEIGHT,l=this.viewPort,A=this.ctx,c=this.isFirstRender,h=A.canvas;l.clear(),h.width&&h.height?l.setCurrent(h.width,h.height):l.setCurrent(s,u);var f=e.getStyle("width"),d=e.getStyle("height");!t&&(c||"number"!=typeof r&&"number"!=typeof i)&&(f.hasValue()&&(h.width=f.getPixels("x"),h.style&&(h.style.width="".concat(h.width,"px"))),d.hasValue()&&(h.height=d.getPixels("y"),h.style&&(h.style.height="".concat(h.height,"px"))));var p=h.clientWidth||h.width,g=h.clientHeight||h.height;if(t&&f.hasValue()&&d.hasValue()&&(p=f.getPixels("x"),g=d.getPixels("y")),l.setCurrent(p,g),"number"==typeof o&&e.getAttribute("x",!0).setValue(o),"number"==typeof a&&e.getAttribute("y",!0).setValue(a),"number"==typeof r||"number"==typeof i){var v=MNe(e.getAttribute("viewBox").getString()),y=0,m=0;if("number"==typeof r){var w=e.getStyle("width");w.hasValue()?y=w.getPixels("x")/r:isNaN(v[2])||(y=v[2]/r)}if("number"==typeof i){var b=e.getStyle("height");b.hasValue()?m=b.getPixels("y")/i:isNaN(v[3])||(m=v[3]/i)}y||(y=m),m||(m=y),e.getAttribute("width",!0).setValue(r),e.getAttribute("height",!0).setValue(i);var I=e.getStyle("transform",!0,!0);I.setValue("".concat(I.getString()," scale(").concat(1/y,", ").concat(1/m,")"))}n||A.clearRect(0,0,p,g),e.render(A),c&&(this.isFirstRender=!1)}}]),e}();dDe.defaultWindow=hDe,dDe.defaultFetch=fDe;var pDe=dDe.defaultFetch,gDe="undefined"!=typeof DOMParser?DOMParser:null,vDe=function(){function e(){s(this,e);var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.fetch,r=void 0===n?pDe:n,i=t.DOMParser,o=void 0===i?gDe:i;this.fetch=r,this.DOMParser=o}return l(e,[{key:"parse",value:function(e){var t=this;return REe(r().mark((function n(){return r().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!e.startsWith("<")){n.next=2;break}return n.abrupt("return",t.parseFromString(e));case 2:return n.abrupt("return",t.load(e));case 3:case"end":return n.stop()}}),n)})))()}},{key:"parseFromString",value:function(e){var t=new this.DOMParser;try{return this.checkDocument(t.parseFromString(e,"image/svg+xml"))}catch(n){return this.checkDocument(t.parseFromString(e,"text/xml"))}}},{key:"checkDocument",value:function(e){var t=e.getElementsByTagName("parsererror")[0];if(t)throw new Error(t.textContent);return e}},{key:"load",value:function(e){var t=this;return REe(r().mark((function n(){var i,o;return r().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,t.fetch(e);case 2:return i=n.sent,n.next=5,i.text();case 5:return o=n.sent,n.abrupt("return",t.parseFromString(o));case 7:case"end":return n.stop()}}),n)})))()}}]),e}(),yDe=function(){function e(t,n){s(this,e),this.type="translate",this.point=null,this.point=ADe.parse(n)}return l(e,[{key:"apply",value:function(e){var t=this.point,n=t.x,r=t.y;e.translate(n||0,r||0)}},{key:"unapply",value:function(e){var t=this.point,n=t.x,r=t.y;e.translate(-1*n||0,-1*r||0)}},{key:"applyToPoint",value:function(e){var t=this.point,n=t.x,r=t.y;e.applyTransform([1,0,0,1,n||0,r||0])}}]),e}(),mDe=function(){function e(t,n,r){s(this,e),this.type="rotate",this.angle=null,this.originX=null,this.originY=null,this.cx=0,this.cy=0;var i=MNe(n);this.angle=new uDe(t,"angle",i[0]),this.originX=r[0],this.originY=r[1],this.cx=i[1]||0,this.cy=i[2]||0}return l(e,[{key:"apply",value:function(e){var t=this.cx,n=this.cy,r=this.originX,i=this.originY,o=this.angle,a=t+r.getPixels("x"),s=n+i.getPixels("y");e.translate(a,s),e.rotate(o.getRadians()),e.translate(-a,-s)}},{key:"unapply",value:function(e){var t=this.cx,n=this.cy,r=this.originX,i=this.originY,o=this.angle,a=t+r.getPixels("x"),s=n+i.getPixels("y");e.translate(a,s),e.rotate(-1*o.getRadians()),e.translate(-a,-s)}},{key:"applyToPoint",value:function(e){var t=this.cx,n=this.cy,r=this.angle.getRadians();e.applyTransform([1,0,0,1,t||0,n||0]),e.applyTransform([Math.cos(r),Math.sin(r),-Math.sin(r),Math.cos(r),0,0]),e.applyTransform([1,0,0,1,-t||0,-n||0])}}]),e}(),wDe=function(){function e(t,n,r){s(this,e),this.type="scale",this.scale=null,this.originX=null,this.originY=null;var i=ADe.parseScale(n);0!==i.x&&0!==i.y||(i.x=WNe,i.y=WNe),this.scale=i,this.originX=r[0],this.originY=r[1]}return l(e,[{key:"apply",value:function(e){var t=this.scale,n=t.x,r=t.y,i=this.originX,o=this.originY,a=i.getPixels("x"),s=o.getPixels("y");e.translate(a,s),e.scale(n,r||n),e.translate(-a,-s)}},{key:"unapply",value:function(e){var t=this.scale,n=t.x,r=t.y,i=this.originX,o=this.originY,a=i.getPixels("x"),s=o.getPixels("y");e.translate(a,s),e.scale(1/n,1/r||n),e.translate(-a,-s)}},{key:"applyToPoint",value:function(e){var t=this.scale,n=t.x,r=t.y;e.applyTransform([n||0,0,0,r||0,0,0])}}]),e}(),bDe=function(){function e(t,n,r){s(this,e),this.type="matrix",this.matrix=[],this.originX=null,this.originY=null,this.matrix=MNe(n),this.originX=r[0],this.originY=r[1]}return l(e,[{key:"apply",value:function(e){var t=this.originX,n=this.originY,r=this.matrix,i=t.getPixels("x"),o=n.getPixels("y");e.translate(i,o),e.transform(r[0],r[1],r[2],r[3],r[4],r[5]),e.translate(-i,-o)}},{key:"unapply",value:function(e){var t=this.originX,n=this.originY,r=this.matrix,i=r[0],o=r[2],a=r[4],s=r[1],u=r[3],l=r[5],A=1/(i*(1*u-0*l)-o*(1*s-0*l)+a*(0*s-0*u)),c=t.getPixels("x"),h=n.getPixels("y");e.translate(c,h),e.transform(A*(1*u-0*l),A*(0*l-1*s),A*(0*a-1*o),A*(1*i-0*a),A*(o*l-a*u),A*(a*s-i*l)),e.translate(-c,-h)}},{key:"applyToPoint",value:function(e){e.applyTransform(this.matrix)}}]),e}(),IDe=function(e){c(n,e);var t=b(n);function n(e,r,i){var o;return s(this,n),(o=t.call(this,e,r,i)).type="skew",o.angle=null,o.angle=new uDe(e,"angle",r),o}return l(n)}(bDe),BDe=function(e){c(n,e);var t=b(n);function n(e,r,i){var o;return s(this,n),(o=t.call(this,e,r,i)).type="skewX",o.matrix=[1,0,Math.tan(o.angle.getRadians()),1,0,0],o}return l(n)}(IDe),EDe=function(e){c(n,e);var t=b(n);function n(e,r,i){var o;return s(this,n),(o=t.call(this,e,r,i)).type="skewY",o.matrix=[1,Math.tan(o.angle.getRadians()),0,1,0,0],o}return l(n)}(IDe);var CDe=function(){function e(t,n,r){var i=this;s(this,e),this.document=t,this.transforms=[];var o=function(e){return PNe(e).trim().replace(/\)([a-zA-Z])/g,") $1").replace(/\)(\s?,\s?)/g,") ").split(/\s(?=[a-z])/)}(n);o.forEach((function(t){if("none"!==t){var n=function(e){var t=C(e.split("("),2),n=t[0],r=t[1];return[n.trim(),r.trim().replace(")","")]}(t),o=C(n,2),a=o[0],s=o[1],u=e.transformTypes[a];void 0!==u&&i.transforms.push(new u(i.document,s,r))}}))}return l(e,[{key:"apply",value:function(e){for(var t=this.transforms,n=t.length,r=0;r<n;r++)t[r].apply(e)}},{key:"unapply",value:function(e){for(var t=this.transforms,n=t.length-1;n>=0;n--)t[n].unapply(e)}},{key:"applyToPoint",value:function(e){for(var t=this.transforms,n=t.length,r=0;r<n;r++)t[r].applyToPoint(e)}}],[{key:"fromElement",value:function(t,n){var r=n.getStyle("transform",!1,!0),i=C(n.getStyle("transform-origin",!1,!0).split(),2),o=i[0],a=i[1],s=[o,void 0===a?o:a];return r.hasValue()?new e(t,r.getString(),s):null}}]),e}();CDe.transformTypes={translate:yDe,rotate:mDe,scale:wDe,matrix:bDe,skewX:BDe,skewY:EDe};var xDe=function(){function e(t,n){var r=this;s(this,e);var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(this.document=t,this.node=n,this.captureTextNodes=i,this.attributes={},this.styles={},this.stylesSpecificity={},this.animationFrozen=!1,this.animationFrozenValue="",this.parent=null,this.children=[],n&&1===n.nodeType){if(Array.from(n.attributes).forEach((function(e){var n=RNe(e.nodeName);r.attributes[n]=new uDe(t,n,e.value)})),this.addStylesFromStyleDefinition(),this.getAttribute("style").hasValue()){var o=this.getAttribute("style").getString().split(";").map((function(e){return e.trim()}));o.forEach((function(e){if(e){var n=e.split(":").map((function(e){return e.trim()})),i=C(n,2),o=i[0],a=i[1];r.styles[o]=new uDe(t,o,a)}}))}var a=t.definitions,u=this.getAttribute("id");u.hasValue()&&(a[u.getString()]||(a[u.getString()]=this)),Array.from(n.childNodes).forEach((function(e){if(1===e.nodeType)r.addChild(e);else if(i&&(3===e.nodeType||4===e.nodeType)){var n=t.createTextNode(e);n.getText().length>0&&r.addChild(n)}}))}}return l(e,[{key:"getAttribute",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.attributes[e];if(!n&&t){var r=new uDe(this.document,e,"");return this.attributes[e]=r,r}return n||uDe.empty(this.document)}},{key:"getHrefAttribute",value:function(){for(var e in this.attributes)if("href"===e||e.endsWith(":href"))return this.attributes[e];return uDe.empty(this.document)}},{key:"getStyle",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=this.styles[e];if(r)return r;var i=this.getAttribute(e);if(null!=i&&i.hasValue())return this.styles[e]=i,i;if(!n){var o=this.parent;if(o){var a=o.getStyle(e);if(null!=a&&a.hasValue())return a}}if(t){var s=new uDe(this.document,e,"");return this.styles[e]=s,s}return r||uDe.empty(this.document)}},{key:"render",value:function(e){if("none"!==this.getStyle("display").getString()&&"hidden"!==this.getStyle("visibility").getString()){if(e.save(),this.getStyle("mask").hasValue()){var t=this.getStyle("mask").getDefinition();t&&(this.applyEffects(e),t.apply(e,this))}else if("none"!==this.getStyle("filter").getValue("none")){var n=this.getStyle("filter").getDefinition();n&&(this.applyEffects(e),n.apply(e,this))}else this.setContext(e),this.renderChildren(e),this.clearContext(e);e.restore()}}},{key:"setContext",value:function(e){}},{key:"applyEffects",value:function(e){var t=CDe.fromElement(this.document,this);t&&t.apply(e);var n=this.getStyle("clip-path",!1,!0);if(n.hasValue()){var r=n.getDefinition();r&&r.apply(e)}}},{key:"clearContext",value:function(e){}},{key:"renderChildren",value:function(e){this.children.forEach((function(t){t.render(e)}))}},{key:"addChild",value:function(t){var n=t instanceof e?t:this.document.createElement(t);n.parent=this,e.ignoreChildTypes.includes(n.type)||this.children.push(n)}},{key:"matchesSelector",value:function(e){var t,n=this.node;if("function"==typeof n.matches)return n.matches(e);var r=null===(t=n.getAttribute)||void 0===t?void 0:t.call(n,"class");return!(!r||""===r)&&r.split(" ").some((function(t){return".".concat(t)===e}))}},{key:"addStylesFromStyleDefinition",value:function(){var e=this.document,t=e.styles,n=e.stylesSpecificity;for(var r in t)if(!r.startsWith("@")&&this.matchesSelector(r)){var i=t[r],o=n[r];if(i)for(var a in i){var s=this.stylesSpecificity[a];void 0===s&&(s="000"),o>=s&&(this.styles[a]=i[a],this.stylesSpecificity[a]=o)}}}},{key:"removeStyles",value:function(e,t){return t.reduce((function(t,n){var r=e.getStyle(n);if(!r.hasValue())return t;var i=r.getString();return r.setValue(""),[].concat(k(t),[[n,i]])}),[])}},{key:"restoreStyles",value:function(e,t){t.forEach((function(t){var n=C(t,2),r=n[0],i=n[1];e.getStyle(r,!0).setValue(i)}))}},{key:"isFirstChild",value:function(){var e;return 0===(null===(e=this.parent)||void 0===e?void 0:e.children.indexOf(this))}}]),e}();xDe.ignoreChildTypes=["title"];var kDe=function(e){c(n,e);var t=b(n);function n(e,r,i){return s(this,n),t.call(this,e,r,i)}return l(n)}(xDe);function SDe(e){var t=e.trim();return/^('|")/.test(t)?t:'"'.concat(t,'"')}function QDe(e){if(!e)return"";var t=e.trim().toLowerCase();switch(t){case"normal":case"italic":case"oblique":case"inherit":case"initial":case"unset":return t;default:return/^oblique\s+(-|)\d+deg$/.test(t)?t:""}}function _De(e){if(!e)return"";var t=e.trim().toLowerCase();switch(t){case"normal":case"bold":case"lighter":case"bolder":case"inherit":case"initial":case"unset":return t;default:return/^[\d.]+$/.test(t)?t:""}}var NDe=function(){function e(t,n,r,i,o,a){s(this,e);var u=a?"string"==typeof a?e.parse(a):a:{};this.fontFamily=o||u.fontFamily,this.fontSize=i||u.fontSize,this.fontStyle=t||u.fontStyle,this.fontWeight=r||u.fontWeight,this.fontVariant=n||u.fontVariant}return l(e,[{key:"toString",value:function(){return[QDe(this.fontStyle),this.fontVariant,_De(this.fontWeight),this.fontSize,(e=this.fontFamily,"undefined"==typeof process?e:e.trim().split(",").map(SDe).join(","))].join(" ").trim();var e}}],[{key:"parse",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1?arguments[1]:void 0,r="",i="",o="",a="",s="",u=PNe(t).trim().split(" "),l={fontSize:!1,fontStyle:!1,fontWeight:!1,fontVariant:!1};return u.forEach((function(t){switch(!0){case!l.fontStyle&&e.styles.includes(t):"inherit"!==t&&(r=t),l.fontStyle=!0;break;case!l.fontVariant&&e.variants.includes(t):"inherit"!==t&&(i=t),l.fontStyle=!0,l.fontVariant=!0;break;case!l.fontWeight&&e.weights.includes(t):"inherit"!==t&&(o=t),l.fontStyle=!0,l.fontVariant=!0,l.fontWeight=!0;break;case!l.fontSize:if("inherit"!==t){var n=C(t.split("/"),1);a=n[0]}l.fontStyle=!0,l.fontVariant=!0,l.fontWeight=!0,l.fontSize=!0;break;default:"inherit"!==t&&(s+=t)}})),new e(r,i,o,a,s,n)}}]),e}();NDe.styles="normal|italic|oblique|inherit",NDe.variants="normal|small-caps|inherit",NDe.weights="normal|bold|bolder|lighter|100|200|300|400|500|600|700|800|900|inherit";var DDe=function(){function e(){s(this,e);var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Number.NaN,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Number.NaN,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Number.NaN,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Number.NaN;this.x1=t,this.y1=n,this.x2=r,this.y2=i,this.addPoint(t,n),this.addPoint(r,i)}return l(e,[{key:"x",get:function(){return this.x1}},{key:"y",get:function(){return this.y1}},{key:"width",get:function(){return this.x2-this.x1}},{key:"height",get:function(){return this.y2-this.y1}},{key:"addPoint",value:function(e,t){void 0!==e&&((isNaN(this.x1)||isNaN(this.x2))&&(this.x1=e,this.x2=e),e<this.x1&&(this.x1=e),e>this.x2&&(this.x2=e)),void 0!==t&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=t,this.y2=t),t<this.y1&&(this.y1=t),t>this.y2&&(this.y2=t))}},{key:"addX",value:function(e){this.addPoint(e,null)}},{key:"addY",value:function(e){this.addPoint(null,e)}},{key:"addBoundingBox",value:function(e){if(e){var t=e.x1,n=e.y1,r=e.x2,i=e.y2;this.addPoint(t,n),this.addPoint(r,i)}}},{key:"sumCubic",value:function(e,t,n,r,i){return Math.pow(1-e,3)*t+3*Math.pow(1-e,2)*e*n+3*(1-e)*Math.pow(e,2)*r+Math.pow(e,3)*i}},{key:"bezierCurveAdd",value:function(e,t,n,r,i){var o=6*t-12*n+6*r,a=-3*t+9*n-9*r+3*i,s=3*n-3*t;if(0!==a){var u=Math.pow(o,2)-4*s*a;if(!(u<0)){var l=(-o+Math.sqrt(u))/(2*a);0<l&&l<1&&(e?this.addX(this.sumCubic(l,t,n,r,i)):this.addY(this.sumCubic(l,t,n,r,i)));var A=(-o-Math.sqrt(u))/(2*a);0<A&&A<1&&(e?this.addX(this.sumCubic(A,t,n,r,i)):this.addY(this.sumCubic(A,t,n,r,i)))}}else{if(0===o)return;var c=-s/o;0<c&&c<1&&(e?this.addX(this.sumCubic(c,t,n,r,i)):this.addY(this.sumCubic(c,t,n,r,i)))}}},{key:"addBezierCurve",value:function(e,t,n,r,i,o,a,s){this.addPoint(e,t),this.addPoint(a,s),this.bezierCurveAdd(!0,e,n,i,a),this.bezierCurveAdd(!1,t,r,o,s)}},{key:"addQuadraticCurve",value:function(e,t,n,r,i,o){var a=e+2/3*(n-e),s=t+2/3*(r-t),u=a+1/3*(i-e),l=s+1/3*(o-t);this.addBezierCurve(e,t,a,u,s,l,i,o)}},{key:"isPointInBox",value:function(e,t){var n=this.x1,r=this.y1,i=this.x2,o=this.y2;return n<=e&&e<=i&&r<=t&&t<=o}}]),e}(),FDe=function(e){c(n,e);var t=b(n);function n(e){var r;return s(this,n),(r=t.call(this,e.replace(/([+\-.])\s+/gm,"$1").replace(/[^MmZzLlHhVvCcSsQqTtAae\d\s.,+-].*/g,""))).control=null,r.start=null,r.current=null,r.command=null,r.commands=r.commands,r.i=-1,r.previousCommand=null,r.points=[],r.angles=[],r}return l(n,[{key:"reset",value:function(){this.i=-1,this.command=null,this.previousCommand=null,this.start=new ADe(0,0),this.control=new ADe(0,0),this.current=new ADe(0,0),this.points=[],this.angles=[]}},{key:"isEnd",value:function(){return this.i>=this.commands.length-1}},{key:"next",value:function(){var e=this.commands[++this.i];return this.previousCommand=this.command,this.command=e,e}},{key:"getPoint",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"x",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"y",n=new ADe(this.command[e],this.command[t]);return this.makeAbsolute(n)}},{key:"getAsControlPoint",value:function(e,t){var n=this.getPoint(e,t);return this.control=n,n}},{key:"getAsCurrentPoint",value:function(e,t){var n=this.getPoint(e,t);return this.current=n,n}},{key:"getReflectedControlPoint",value:function(){var e=this.previousCommand.type;if(e!==cNe.CURVE_TO&&e!==cNe.SMOOTH_CURVE_TO&&e!==cNe.QUAD_TO&&e!==cNe.SMOOTH_QUAD_TO)return this.current;var t=this.current,n=t.x,r=t.y,i=this.control,o=i.x,a=i.y;return new ADe(2*n-o,2*r-a)}},{key:"makeAbsolute",value:function(e){if(this.command.relative){var t=this.current,n=t.x,r=t.y;e.x+=n,e.y+=r}return e}},{key:"addMarker",value:function(e,t,n){var r=this.points,i=this.angles;n&&i.length>0&&!i[i.length-1]&&(i[i.length-1]=r[r.length-1].angleTo(n)),this.addMarkerAngle(e,t?t.angleTo(e):null)}},{key:"addMarkerAngle",value:function(e,t){this.points.push(e),this.angles.push(t)}},{key:"getMarkerPoints",value:function(){return this.points}},{key:"getMarkerAngles",value:function(){for(var e=this.angles,t=e.length,n=0;n<t;n++)if(!e[n])for(var r=n+1;r<t;r++)if(e[r]){e[n]=e[r];break}return e}}]),n}(cNe),PDe=function(e){c(n,e);var t=b(n);function n(){var e;return s(this,n),(e=t.apply(this,arguments)).modifiedEmSizeStack=!1,e}return l(n,[{key:"calculateOpacity",value:function(){for(var e=1,t=this;t;){var n=t.getStyle("opacity",!1,!0);n.hasValue(!0)&&(e*=n.getNumber()),t=t.parent}return e}},{key:"setContext",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!t){var n=this.getStyle("fill"),r=this.getStyle("fill-opacity"),i=this.getStyle("stroke"),o=this.getStyle("stroke-opacity");if(n.isUrlDefinition()){var a=n.getFillStyleDefinition(this,r);a&&(e.fillStyle=a)}else if(n.hasValue()){"currentColor"===n.getString()&&n.setValue(this.getStyle("color").getColor());var s=n.getColor();"inherit"!==s&&(e.fillStyle="none"===s?"rgba(0,0,0,0)":s)}if(r.hasValue()){var u=new uDe(this.document,"fill",e.fillStyle).addOpacity(r).getColor();e.fillStyle=u}if(i.isUrlDefinition()){var l=i.getFillStyleDefinition(this,o);l&&(e.strokeStyle=l)}else if(i.hasValue()){"currentColor"===i.getString()&&i.setValue(this.getStyle("color").getColor());var A=i.getString();"inherit"!==A&&(e.strokeStyle="none"===A?"rgba(0,0,0,0)":A)}if(o.hasValue()){var c=new uDe(this.document,"stroke",e.strokeStyle).addOpacity(o).getString();e.strokeStyle=c}var h=this.getStyle("stroke-width");if(h.hasValue()){var f=h.getPixels();e.lineWidth=f||WNe}var d=this.getStyle("stroke-linecap"),p=this.getStyle("stroke-linejoin"),g=this.getStyle("stroke-miterlimit"),v=this.getStyle("stroke-dasharray"),y=this.getStyle("stroke-dashoffset");if(d.hasValue()&&(e.lineCap=d.getString()),p.hasValue()&&(e.lineJoin=p.getString()),g.hasValue()&&(e.miterLimit=g.getNumber()),v.hasValue()&&"none"!==v.getString()){var m=MNe(v.getString());void 0!==e.setLineDash?e.setLineDash(m):void 0!==e.webkitLineDash?e.webkitLineDash=m:void 0===e.mozDash||1===m.length&&0===m[0]||(e.mozDash=m);var w=y.getPixels();void 0!==e.lineDashOffset?e.lineDashOffset=w:void 0!==e.webkitLineDashOffset?e.webkitLineDashOffset=w:void 0!==e.mozDashOffset&&(e.mozDashOffset=w)}}if(this.modifiedEmSizeStack=!1,void 0!==e.font){var b=this.getStyle("font"),I=this.getStyle("font-style"),B=this.getStyle("font-variant"),E=this.getStyle("font-weight"),C=this.getStyle("font-size"),x=this.getStyle("font-family"),k=new NDe(I.getString(),B.getString(),E.getString(),C.hasValue()?"".concat(C.getPixels(!0),"px"):"",x.getString(),NDe.parse(b.getString(),e.font));I.setValue(k.fontStyle),B.setValue(k.fontVariant),E.setValue(k.fontWeight),C.setValue(k.fontSize),x.setValue(k.fontFamily),e.font=k.toString(),C.isPixels()&&(this.document.emSize=C.getPixels(),this.modifiedEmSizeStack=!0)}t||(this.applyEffects(e),e.globalAlpha=this.calculateOpacity())}},{key:"clearContext",value:function(e){B(h(n.prototype),"clearContext",this).call(this,e),this.modifiedEmSizeStack&&this.document.popEmSize()}}]),n}(xDe),UDe=function(e){c(n,e);var t=b(n);function n(e,r,i){var o;return s(this,n),(o=t.call(this,e,r,i)).type="path",o.pathParser=null,o.pathParser=new FDe(o.getAttribute("d").getString()),o}return l(n,[{key:"path",value:function(e){var t=this.pathParser,n=new DDe;for(t.reset(),e&&e.beginPath();!t.isEnd();)switch(t.next().type){case FDe.MOVE_TO:this.pathM(e,n);break;case FDe.LINE_TO:this.pathL(e,n);break;case FDe.HORIZ_LINE_TO:this.pathH(e,n);break;case FDe.VERT_LINE_TO:this.pathV(e,n);break;case FDe.CURVE_TO:this.pathC(e,n);break;case FDe.SMOOTH_CURVE_TO:this.pathS(e,n);break;case FDe.QUAD_TO:this.pathQ(e,n);break;case FDe.SMOOTH_QUAD_TO:this.pathT(e,n);break;case FDe.ARC:this.pathA(e,n);break;case FDe.CLOSE_PATH:this.pathZ(e,n)}return n}},{key:"getBoundingBox",value:function(e){return this.path()}},{key:"getMarkers",value:function(){var e=this.pathParser,t=e.getMarkerPoints(),n=e.getMarkerAngles(),r=t.map((function(e,t){return[e,n[t]]}));return r}},{key:"renderChildren",value:function(e){this.path(e),this.document.screen.mouse.checkPath(this,e);var t=this.getStyle("fill-rule");""!==e.fillStyle&&("inherit"!==t.getString("inherit")?e.fill(t.getString()):e.fill()),""!==e.strokeStyle&&("non-scaling-stroke"===this.getAttribute("vector-effect").getString()?(e.save(),e.setTransform(1,0,0,1,0,0),e.stroke(),e.restore()):e.stroke());var n=this.getMarkers();if(n){var r=n.length-1,i=this.getStyle("marker-start"),o=this.getStyle("marker-mid"),a=this.getStyle("marker-end");if(i.isUrlDefinition()){var s=i.getDefinition(),u=C(n[0],2),l=u[0],A=u[1];s.render(e,l,A)}if(o.isUrlDefinition())for(var c=o.getDefinition(),h=1;h<r;h++){var f=C(n[h],2),d=f[0],p=f[1];c.render(e,d,p)}if(a.isUrlDefinition()){var g=a.getDefinition(),v=C(n[r],2),y=v[0],m=v[1];g.render(e,y,m)}}}},{key:"pathM",value:function(e,t){var r=this.pathParser,i=n.pathM(r).point,o=i.x,a=i.y;r.addMarker(i),t.addPoint(o,a),e&&e.moveTo(o,a)}},{key:"pathL",value:function(e,t){var r=this.pathParser,i=n.pathL(r),o=i.current,a=i.point,s=a.x,u=a.y;r.addMarker(a,o),t.addPoint(s,u),e&&e.lineTo(s,u)}},{key:"pathH",value:function(e,t){var r=this.pathParser,i=n.pathH(r),o=i.current,a=i.point,s=a.x,u=a.y;r.addMarker(a,o),t.addPoint(s,u),e&&e.lineTo(s,u)}},{key:"pathV",value:function(e,t){var r=this.pathParser,i=n.pathV(r),o=i.current,a=i.point,s=a.x,u=a.y;r.addMarker(a,o),t.addPoint(s,u),e&&e.lineTo(s,u)}},{key:"pathC",value:function(e,t){var r=this.pathParser,i=n.pathC(r),o=i.current,a=i.point,s=i.controlPoint,u=i.currentPoint;r.addMarker(u,s,a),t.addBezierCurve(o.x,o.y,a.x,a.y,s.x,s.y,u.x,u.y),e&&e.bezierCurveTo(a.x,a.y,s.x,s.y,u.x,u.y)}},{key:"pathS",value:function(e,t){var r=this.pathParser,i=n.pathS(r),o=i.current,a=i.point,s=i.controlPoint,u=i.currentPoint;r.addMarker(u,s,a),t.addBezierCurve(o.x,o.y,a.x,a.y,s.x,s.y,u.x,u.y),e&&e.bezierCurveTo(a.x,a.y,s.x,s.y,u.x,u.y)}},{key:"pathQ",value:function(e,t){var r=this.pathParser,i=n.pathQ(r),o=i.current,a=i.controlPoint,s=i.currentPoint;r.addMarker(s,a,a),t.addQuadraticCurve(o.x,o.y,a.x,a.y,s.x,s.y),e&&e.quadraticCurveTo(a.x,a.y,s.x,s.y)}},{key:"pathT",value:function(e,t){var r=this.pathParser,i=n.pathT(r),o=i.current,a=i.controlPoint,s=i.currentPoint;r.addMarker(s,a,a),t.addQuadraticCurve(o.x,o.y,a.x,a.y,s.x,s.y),e&&e.quadraticCurveTo(a.x,a.y,s.x,s.y)}},{key:"pathA",value:function(e,t){var r=this.pathParser,i=n.pathA(r),o=i.currentPoint,a=i.rX,s=i.rY,u=i.sweepFlag,l=i.xAxisRotation,A=i.centp,c=i.a1,h=i.ad,f=1-u?1:-1,d=c+f*(h/2),p=new ADe(A.x+a*Math.cos(d),A.y+s*Math.sin(d));if(r.addMarkerAngle(p,d-f*Math.PI/2),r.addMarkerAngle(o,d-f*Math.PI),t.addPoint(o.x,o.y),e&&!isNaN(c)&&!isNaN(h)){var g=a>s?a:s,v=a>s?1:a/s,y=a>s?s/a:1;e.translate(A.x,A.y),e.rotate(l),e.scale(v,y),e.arc(0,0,g,c,c+h,Boolean(1-u)),e.scale(1/v,1/y),e.rotate(-l),e.translate(-A.x,-A.y)}}},{key:"pathZ",value:function(e,t){n.pathZ(this.pathParser),e&&t.x1!==t.x2&&t.y1!==t.y2&&e.closePath()}}],[{key:"pathM",value:function(e){var t=e.getAsCurrentPoint();return e.start=e.current,{point:t}}},{key:"pathL",value:function(e){return{current:e.current,point:e.getAsCurrentPoint()}}},{key:"pathH",value:function(e){var t=e.current,n=e.command,r=new ADe((n.relative?t.x:0)+n.x,t.y);return e.current=r,{current:t,point:r}}},{key:"pathV",value:function(e){var t=e.current,n=e.command,r=new ADe(t.x,(n.relative?t.y:0)+n.y);return e.current=r,{current:t,point:r}}},{key:"pathC",value:function(e){return{current:e.current,point:e.getPoint("x1","y1"),controlPoint:e.getAsControlPoint("x2","y2"),currentPoint:e.getAsCurrentPoint()}}},{key:"pathS",value:function(e){return{current:e.current,point:e.getReflectedControlPoint(),controlPoint:e.getAsControlPoint("x2","y2"),currentPoint:e.getAsCurrentPoint()}}},{key:"pathQ",value:function(e){return{current:e.current,controlPoint:e.getAsControlPoint("x1","y1"),currentPoint:e.getAsCurrentPoint()}}},{key:"pathT",value:function(e){var t=e.current,n=e.getReflectedControlPoint();return e.control=n,{current:t,controlPoint:n,currentPoint:e.getAsCurrentPoint()}}},{key:"pathA",value:function(e){var t=e.current,n=e.command,r=n.rX,i=n.rY,o=n.xRot,a=n.lArcFlag,s=n.sweepFlag,u=o*(Math.PI/180),l=e.getAsCurrentPoint(),A=new ADe(Math.cos(u)*(t.x-l.x)/2+Math.sin(u)*(t.y-l.y)/2,-Math.sin(u)*(t.x-l.x)/2+Math.cos(u)*(t.y-l.y)/2),c=Math.pow(A.x,2)/Math.pow(r,2)+Math.pow(A.y,2)/Math.pow(i,2);c>1&&(r*=Math.sqrt(c),i*=Math.sqrt(c));var h=(a===s?-1:1)*Math.sqrt((Math.pow(r,2)*Math.pow(i,2)-Math.pow(r,2)*Math.pow(A.y,2)-Math.pow(i,2)*Math.pow(A.x,2))/(Math.pow(r,2)*Math.pow(A.y,2)+Math.pow(i,2)*Math.pow(A.x,2)));isNaN(h)&&(h=0);var f=new ADe(h*r*A.y/i,h*-i*A.x/r),d=new ADe((t.x+l.x)/2+Math.cos(u)*f.x-Math.sin(u)*f.y,(t.y+l.y)/2+Math.sin(u)*f.x+Math.cos(u)*f.y),p=eDe([1,0],[(A.x-f.x)/r,(A.y-f.y)/i]),g=[(A.x-f.x)/r,(A.y-f.y)/i],v=[(-A.x-f.x)/r,(-A.y-f.y)/i],y=eDe(g,v);return $Ne(g,v)<=-1&&(y=Math.PI),$Ne(g,v)>=1&&(y=0),{currentPoint:l,rX:r,rY:i,sweepFlag:s,xAxisRotation:u,centp:d,a1:p,ad:y}}},{key:"pathZ",value:function(e){e.current=e.start}}]),n}(PDe),LDe=function(e){c(n,e);var t=b(n);function n(e,r,i){var o;return s(this,n),(o=t.call(this,e,r,i)).type="glyph",o.horizAdvX=o.getAttribute("horiz-adv-x").getNumber(),o.unicode=o.getAttribute("unicode").getString(),o.arabicForm=o.getAttribute("arabic-form").getString(),o}return l(n)}(UDe),MDe=function(e){c(n,e);var t=b(n);function n(e,r,i){var o;return s(this,n),(o=t.call(this,e,r,(this instanceof n?this.constructor:void 0)===n||i)).type="text",o.x=0,o.y=0,o.measureCache=-1,o}return l(n,[{key:"setContext",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];B(h(n.prototype),"setContext",this).call(this,e,t);var r=this.getStyle("dominant-baseline").getTextBaseline()||this.getStyle("alignment-baseline").getTextBaseline();r&&(e.textBaseline=r)}},{key:"initializeCoordinates",value:function(){this.x=0,this.y=0,this.leafTexts=[],this.textChunkStart=0,this.minX=Number.POSITIVE_INFINITY,this.maxX=Number.NEGATIVE_INFINITY}},{key:"getBoundingBox",value:function(e){var t=this;if("text"!==this.type)return this.getTElementBoundingBox(e);this.initializeCoordinates(),this.adjustChildCoordinatesRecursive(e);var n=null;return this.children.forEach((function(r,i){var o=t.getChildBoundingBox(e,t,t,i);n?n.addBoundingBox(o):n=o})),n}},{key:"getFontSize",value:function(){var e=this.document,t=this.parent,n=NDe.parse(e.ctx.font).fontSize;return t.getStyle("font-size").getNumber(n)}},{key:"getTElementBoundingBox",value:function(e){var t=this.getFontSize();return new DDe(this.x,this.y-t,this.x+this.measureText(e),this.y)}},{key:"getGlyph",value:function(e,t,n){var r=t[n],i=null;if(e.isArabic){var o=t.length,a=t[n-1],s=t[n+1],u="isolated";if((0===n||" "===a)&&n<o-1&&" "!==s&&(u="terminal"),n>0&&" "!==a&&n<o-1&&" "!==s&&(u="medial"),n>0&&" "!==a&&(n===o-1||" "===s)&&(u="initial"),void 0!==e.glyphs[r]){var l=e.glyphs[r];i=l instanceof LDe?l:l[u]}}else i=e.glyphs[r];return i||(i=e.missingGlyph),i}},{key:"getText",value:function(){return""}},{key:"getTextFromNode",value:function(e){var t=e||this.node,n=Array.from(t.parentNode.childNodes),r=n.indexOf(t),i=n.length-1,o=PNe(t.textContent||"");return 0===r&&(o=UNe(o)),r===i&&(o=LNe(o)),o}},{key:"renderChildren",value:function(e){var t=this;if("text"===this.type){this.initializeCoordinates(),this.adjustChildCoordinatesRecursive(e),this.children.forEach((function(n,r){t.renderChild(e,t,t,r)}));var n=this.document.screen.mouse;n.isWorking()&&n.checkBoundingBox(this,this.getBoundingBox(e))}else this.renderTElementChildren(e)}},{key:"renderTElementChildren",value:function(e){var t=this.document,n=this.parent,r=this.getText(),i=n.getStyle("font-family").getDefinition();if(i)for(var o=i.fontFace.unitsPerEm,a=NDe.parse(t.ctx.font),s=n.getStyle("font-size").getNumber(a.fontSize),u=n.getStyle("font-style").getString(a.fontStyle),l=s/o,A=i.isRTL?r.split("").reverse().join(""):r,c=MNe(n.getAttribute("dx").getString()),h=A.length,f=0;f<h;f++){var d=this.getGlyph(i,A,f);e.translate(this.x,this.y),e.scale(l,-l);var p=e.lineWidth;e.lineWidth=e.lineWidth*o/s,"italic"===u&&e.transform(1,0,.4,1,0,0),d.render(e),"italic"===u&&e.transform(1,0,-.4,1,0,0),e.lineWidth=p,e.scale(1/l,-1/l),e.translate(-this.x,-this.y),this.x+=s*(d.horizAdvX||i.horizAdvX)/o,void 0===c[f]||isNaN(c[f])||(this.x+=c[f])}else{var g=this.x,v=this.y;e.fillStyle&&e.fillText(r,g,v),e.strokeStyle&&e.strokeText(r,g,v)}}},{key:"applyAnchoring",value:function(){if(!(this.textChunkStart>=this.leafTexts.length)){var e=this.leafTexts[this.textChunkStart],t=e.getStyle("text-anchor").getString("start"),n=0;n="start"===t?e.x-this.minX:"end"===t?e.x-this.maxX:e.x-(this.minX+this.maxX)/2;for(var r=this.textChunkStart;r<this.leafTexts.length;r++)this.leafTexts[r].x+=n;this.minX=Number.POSITIVE_INFINITY,this.maxX=Number.NEGATIVE_INFINITY,this.textChunkStart=this.leafTexts.length}}},{key:"adjustChildCoordinatesRecursive",value:function(e){var t=this;this.children.forEach((function(n,r){t.adjustChildCoordinatesRecursiveCore(e,t,t,r)})),this.applyAnchoring()}},{key:"adjustChildCoordinatesRecursiveCore",value:function(e,t,n,r){var i=n.children[r];i.children.length>0?i.children.forEach((function(n,r){t.adjustChildCoordinatesRecursiveCore(e,t,i,r)})):this.adjustChildCoordinates(e,t,n,r)}},{key:"adjustChildCoordinates",value:function(e,t,n,r){var i=n.children[r];if("function"!=typeof i.measureText)return i;e.save(),i.setContext(e,!0);var o=i.getAttribute("x"),a=i.getAttribute("y"),s=i.getAttribute("dx"),u=i.getAttribute("dy"),l=i.getStyle("font-family").getDefinition(),A=Boolean(l)&&l.isRTL;0===r&&(o.hasValue()||o.setValue(i.getInheritedAttribute("x")),a.hasValue()||a.setValue(i.getInheritedAttribute("y")),s.hasValue()||s.setValue(i.getInheritedAttribute("dx")),u.hasValue()||u.setValue(i.getInheritedAttribute("dy")));var c=i.measureText(e);return A&&(t.x-=c),o.hasValue()?(t.applyAnchoring(),i.x=o.getPixels("x"),s.hasValue()&&(i.x+=s.getPixels("x"))):(s.hasValue()&&(t.x+=s.getPixels("x")),i.x=t.x),t.x=i.x,A||(t.x+=c),a.hasValue()?(i.y=a.getPixels("y"),u.hasValue()&&(i.y+=u.getPixels("y"))):(u.hasValue()&&(t.y+=u.getPixels("y")),i.y=t.y),t.y=i.y,t.leafTexts.push(i),t.minX=Math.min(t.minX,i.x,i.x+c),t.maxX=Math.max(t.maxX,i.x,i.x+c),i.clearContext(e),e.restore(),i}},{key:"getChildBoundingBox",value:function(e,t,n,r){var i=n.children[r];if("function"!=typeof i.getBoundingBox)return null;var o=i.getBoundingBox(e);return o?(i.children.forEach((function(n,r){var a=t.getChildBoundingBox(e,t,i,r);o.addBoundingBox(a)})),o):null}},{key:"renderChild",value:function(e,t,n,r){var i=n.children[r];i.render(e),i.children.forEach((function(n,r){t.renderChild(e,t,i,r)}))}},{key:"measureText",value:function(e){var t=this.measureCache;if(~t)return t;var n=this.getText(),r=this.measureTargetText(e,n);return this.measureCache=r,r}},{key:"measureTargetText",value:function(e,t){if(!t.length)return 0;var n=this.parent,r=n.getStyle("font-family").getDefinition();if(r){for(var i=this.getFontSize(),o=r.isRTL?t.split("").reverse().join(""):t,a=MNe(n.getAttribute("dx").getString()),s=o.length,u=0,l=0;l<s;l++){u+=(this.getGlyph(r,o,l).horizAdvX||r.horizAdvX)*i/r.fontFace.unitsPerEm,void 0===a[l]||isNaN(a[l])||(u+=a[l])}return u}if(!e.measureText)return 10*t.length;e.save(),this.setContext(e,!0);var A=e.measureText(t).width;return this.clearContext(e),e.restore(),A}},{key:"getInheritedAttribute",value:function(e){for(var t=this;t instanceof n&&t.isFirstChild();){var r=t.parent.getAttribute(e);if(r.hasValue(!0))return r.getValue("0");t=t.parent}return null}}]),n}(PDe),TDe=function(e){c(n,e);var t=b(n);function n(e,r,i){var o;return s(this,n),(o=t.call(this,e,r,(this instanceof n?this.constructor:void 0)===n||i)).type="tspan",o.text=o.children.length>0?"":o.getTextFromNode(),o}return l(n,[{key:"getText",value:function(){return this.text}}]),n}(MDe),RDe=function(e){c(n,e);var t=b(n);function n(){var e;return s(this,n),(e=t.apply(this,arguments)).type="textNode",e}return l(n)}(TDe),ODe=function(e){c(n,e);var t=b(n);function n(){var e;return s(this,n),(e=t.apply(this,arguments)).type="svg",e.root=!1,e}return l(n,[{key:"setContext",value:function(e){var t,r=this.document,i=r.screen,o=r.window,a=e.canvas;if(i.setDefaults(e),a.style&&void 0!==e.font&&o&&void 0!==o.getComputedStyle){e.font=o.getComputedStyle(a).getPropertyValue("font");var s=new uDe(r,"fontSize",NDe.parse(e.font).fontSize);s.hasValue()&&(r.rootEmSize=s.getPixels("y"),r.emSize=r.rootEmSize)}this.getAttribute("x").hasValue()||this.getAttribute("x",!0).setValue(0),this.getAttribute("y").hasValue()||this.getAttribute("y",!0).setValue(0);var u=i.viewPort,l=u.width,A=u.height;this.getStyle("width").hasValue()||this.getStyle("width",!0).setValue("100%"),this.getStyle("height").hasValue()||this.getStyle("height",!0).setValue("100%"),this.getStyle("color").hasValue()||this.getStyle("color",!0).setValue("black");var c=this.getAttribute("refX"),f=this.getAttribute("refY"),d=this.getAttribute("viewBox"),p=d.hasValue()?MNe(d.getString()):null,g=!this.root&&"visible"!==this.getStyle("overflow").getValue("hidden"),v=0,y=0,m=0,w=0;p&&(v=p[0],y=p[1]),this.root||(l=this.getStyle("width").getPixels("x"),A=this.getStyle("height").getPixels("y"),"marker"===this.type&&(m=v,w=y,v=0,y=0)),i.viewPort.setCurrent(l,A),!this.node||this.parent&&"foreignObject"!==(null===(t=this.node.parentNode)||void 0===t?void 0:t.nodeName)||!this.getStyle("transform",!1,!0).hasValue()||this.getStyle("transform-origin",!1,!0).hasValue()||this.getStyle("transform-origin",!0,!0).setValue("50% 50%"),B(h(n.prototype),"setContext",this).call(this,e),e.translate(this.getAttribute("x").getPixels("x"),this.getAttribute("y").getPixels("y")),p&&(l=p[2],A=p[3]),r.setViewBox({ctx:e,aspectRatio:this.getAttribute("preserveAspectRatio").getString(),width:i.viewPort.width,desiredWidth:l,height:i.viewPort.height,desiredHeight:A,minX:v,minY:y,refX:c.getValue(),refY:f.getValue(),clip:g,clipX:m,clipY:w}),p&&(i.viewPort.removeCurrent(),i.viewPort.setCurrent(l,A))}},{key:"clearContext",value:function(e){B(h(n.prototype),"clearContext",this).call(this,e),this.document.screen.viewPort.removeCurrent()}},{key:"resize",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=this.getAttribute("width",!0),i=this.getAttribute("height",!0),o=this.getAttribute("viewBox"),a=this.getAttribute("style"),s=r.getNumber(0),u=i.getNumber(0);if(n)if("string"==typeof n)this.getAttribute("preserveAspectRatio",!0).setValue(n);else{var l=this.getAttribute("preserveAspectRatio");l.hasValue()&&l.setValue(l.getString().replace(/^\s*(\S.*\S)\s*$/,"$1"))}if(r.setValue(e),i.setValue(t),o.hasValue()||o.setValue("0 0 ".concat(s||e," ").concat(u||t)),a.hasValue()){var A=this.getStyle("width"),c=this.getStyle("height");A.hasValue()&&A.setValue("".concat(e,"px")),c.hasValue()&&c.setValue("".concat(t,"px"))}}}]),n}(PDe),HDe=function(e){c(n,e);var t=b(n);function n(){var e;return s(this,n),(e=t.apply(this,arguments)).type="rect",e}return l(n,[{key:"path",value:function(e){var t=this.getAttribute("x").getPixels("x"),n=this.getAttribute("y").getPixels("y"),r=this.getStyle("width",!1,!0).getPixels("x"),i=this.getStyle("height",!1,!0).getPixels("y"),o=this.getAttribute("rx"),a=this.getAttribute("ry"),s=o.getPixels("x"),u=a.getPixels("y");if(o.hasValue()&&!a.hasValue()&&(u=s),a.hasValue()&&!o.hasValue()&&(s=u),s=Math.min(s,r/2),u=Math.min(u,i/2),e){var l=(Math.sqrt(2)-1)/3*4;e.beginPath(),i>0&&r>0&&(e.moveTo(t+s,n),e.lineTo(t+r-s,n),e.bezierCurveTo(t+r-s+l*s,n,t+r,n+u-l*u,t+r,n+u),e.lineTo(t+r,n+i-u),e.bezierCurveTo(t+r,n+i-u+l*u,t+r-s+l*s,n+i,t+r-s,n+i),e.lineTo(t+s,n+i),e.bezierCurveTo(t+s-l*s,n+i,t,n+i-u+l*u,t,n+i-u),e.lineTo(t,n+u),e.bezierCurveTo(t,n+u-l*u,t+s-l*s,n,t+s,n),e.closePath())}return new DDe(t,n,t+r,n+i)}},{key:"getMarkers",value:function(){return null}}]),n}(UDe),KDe=function(e){c(n,e);var t=b(n);function n(){var e;return s(this,n),(e=t.apply(this,arguments)).type="circle",e}return l(n,[{key:"path",value:function(e){var t=this.getAttribute("cx").getPixels("x"),n=this.getAttribute("cy").getPixels("y"),r=this.getAttribute("r").getPixels();return e&&r>0&&(e.beginPath(),e.arc(t,n,r,0,2*Math.PI,!1),e.closePath()),new DDe(t-r,n-r,t+r,n+r)}},{key:"getMarkers",value:function(){return null}}]),n}(UDe),jDe=function(e){c(n,e);var t=b(n);function n(){var e;return s(this,n),(e=t.apply(this,arguments)).type="ellipse",e}return l(n,[{key:"path",value:function(e){var t=(Math.sqrt(2)-1)/3*4,n=this.getAttribute("rx").getPixels("x"),r=this.getAttribute("ry").getPixels("y"),i=this.getAttribute("cx").getPixels("x"),o=this.getAttribute("cy").getPixels("y");return e&&n>0&&r>0&&(e.beginPath(),e.moveTo(i+n,o),e.bezierCurveTo(i+n,o+t*r,i+t*n,o+r,i,o+r),e.bezierCurveTo(i-t*n,o+r,i-n,o+t*r,i-n,o),e.bezierCurveTo(i-n,o-t*r,i-t*n,o-r,i,o-r),e.bezierCurveTo(i+t*n,o-r,i+n,o-t*r,i+n,o),e.closePath()),new DDe(i-n,o-r,i+n,o+r)}},{key:"getMarkers",value:function(){return null}}]),n}(UDe),GDe=function(e){c(n,e);var t=b(n);function n(){var e;return s(this,n),(e=t.apply(this,arguments)).type="line",e}return l(n,[{key:"getPoints",value:function(){return[new ADe(this.getAttribute("x1").getPixels("x"),this.getAttribute("y1").getPixels("y")),new ADe(this.getAttribute("x2").getPixels("x"),this.getAttribute("y2").getPixels("y"))]}},{key:"path",value:function(e){var t=C(this.getPoints(),2),n=t[0],r=n.x,i=n.y,o=t[1],a=o.x,s=o.y;return e&&(e.beginPath(),e.moveTo(r,i),e.lineTo(a,s)),new DDe(r,i,a,s)}},{key:"getMarkers",value:function(){var e=C(this.getPoints(),2),t=e[0],n=e[1],r=t.angleTo(n);return[[t,r],[n,r]]}}]),n}(UDe),qDe=function(e){c(n,e);var t=b(n);function n(e,r,i){var o;return s(this,n),(o=t.call(this,e,r,i)).type="polyline",o.points=[],o.points=ADe.parsePath(o.getAttribute("points").getString()),o}return l(n,[{key:"path",value:function(e){var t=this.points,n=C(t,1)[0],r=n.x,i=n.y,o=new DDe(r,i);return e&&(e.beginPath(),e.moveTo(r,i)),t.forEach((function(t){var n=t.x,r=t.y;o.addPoint(n,r),e&&e.lineTo(n,r)})),o}},{key:"getMarkers",value:function(){var e=this.points,t=e.length-1,n=[];return e.forEach((function(r,i){i!==t&&n.push([r,r.angleTo(e[i+1])])})),n.length>0&&n.push([e[e.length-1],n[n.length-1][1]]),n}}]),n}(UDe),VDe=function(e){c(n,e);var t=b(n);function n(){var e;return s(this,n),(e=t.apply(this,arguments)).type="polygon",e}return l(n,[{key:"path",value:function(e){var t=B(h(n.prototype),"path",this).call(this,e),r=C(this.points,1)[0],i=r.x,o=r.y;return e&&(e.lineTo(i,o),e.closePath()),t}}]),n}(qDe),zDe=function(e){c(n,e);var t=b(n);function n(){var e;return s(this,n),(e=t.apply(this,arguments)).type="pattern",e}return l(n,[{key:"createPattern",value:function(e,t,n){var r=this.getStyle("width").getPixels("x",!0),i=this.getStyle("height").getPixels("y",!0),o=new ODe(this.document,null);o.attributes.viewBox=new uDe(this.document,"viewBox",this.getAttribute("viewBox").getValue()),o.attributes.width=new uDe(this.document,"width","".concat(r,"px")),o.attributes.height=new uDe(this.document,"height","".concat(i,"px")),o.attributes.transform=new uDe(this.document,"transform",this.getAttribute("patternTransform").getValue()),o.children=this.children;var a=this.document.createCanvas(r,i),s=a.getContext("2d"),u=this.getAttribute("x"),l=this.getAttribute("y");u.hasValue()&&l.hasValue()&&s.translate(u.getPixels("x",!0),l.getPixels("y",!0)),n.hasValue()?this.styles["fill-opacity"]=n:Reflect.deleteProperty(this.styles,"fill-opacity");for(var A=-1;A<=1;A++)for(var c=-1;c<=1;c++)s.save(),o.attributes.x=new uDe(this.document,"x",A*a.width),o.attributes.y=new uDe(this.document,"y",c*a.height),o.render(s),s.restore();return e.createPattern(a,"repeat")}}]),n}(xDe),JDe=function(e){c(n,e);var t=b(n);function n(){var e;return s(this,n),(e=t.apply(this,arguments)).type="marker",e}return l(n,[{key:"render",value:function(e,t,n){if(t){var r=t.x,i=t.y,o=this.getAttribute("orient").getString("auto"),a=this.getAttribute("markerUnits").getString("strokeWidth");e.translate(r,i),"auto"===o&&e.rotate(n),"strokeWidth"===a&&e.scale(e.lineWidth,e.lineWidth),e.save();var s=new ODe(this.document,null);s.type=this.type,s.attributes.viewBox=new uDe(this.document,"viewBox",this.getAttribute("viewBox").getValue()),s.attributes.refX=new uDe(this.document,"refX",this.getAttribute("refX").getValue()),s.attributes.refY=new uDe(this.document,"refY",this.getAttribute("refY").getValue()),s.attributes.width=new uDe(this.document,"width",this.getAttribute("markerWidth").getValue()),s.attributes.height=new uDe(this.document,"height",this.getAttribute("markerHeight").getValue()),s.attributes.overflow=new uDe(this.document,"overflow",this.getAttribute("overflow").getValue()),s.attributes.fill=new uDe(this.document,"fill",this.getAttribute("fill").getColor("black")),s.attributes.stroke=new uDe(this.document,"stroke",this.getAttribute("stroke").getValue("none")),s.children=this.children,s.render(e),e.restore(),"strokeWidth"===a&&e.scale(1/e.lineWidth,1/e.lineWidth),"auto"===o&&e.rotate(-n),e.translate(-r,-i)}}}]),n}(xDe),YDe=function(e){c(n,e);var t=b(n);function n(){var e;return s(this,n),(e=t.apply(this,arguments)).type="defs",e}return l(n,[{key:"render",value:function(){}}]),n}(xDe),XDe=function(e){c(n,e);var t=b(n);function n(){var e;return s(this,n),(e=t.apply(this,arguments)).type="g",e}return l(n,[{key:"getBoundingBox",value:function(e){var t=new DDe;return this.children.forEach((function(n){t.addBoundingBox(n.getBoundingBox(e))})),t}}]),n}(PDe),WDe=function(e){c(n,e);var t=b(n);function n(e,r,i){var o;s(this,n),(o=t.call(this,e,r,i)).attributesToInherit=["gradientUnits"],o.stops=[];var a=m(o),u=a.stops;return a.children.forEach((function(e){"stop"===e.type&&u.push(e)})),o}return l(n,[{key:"getGradientUnits",value:function(){return this.getAttribute("gradientUnits").getString("objectBoundingBox")}},{key:"createGradient",value:function(e,t,n){var r=this,i=this;this.getHrefAttribute().hasValue()&&(i=this.getHrefAttribute().getDefinition(),this.inheritStopContainer(i));var o=i.stops,a=this.getGradient(e,t);if(!a)return this.addParentOpacity(n,o[o.length-1].color);if(o.forEach((function(e){a.addColorStop(e.offset,r.addParentOpacity(n,e.color))})),this.getAttribute("gradientTransform").hasValue()){var s=this.document,u=s.screen,l=u.MAX_VIRTUAL_PIXELS,A=C(u.viewPort.viewPorts,1)[0],c=new HDe(s,null);c.attributes.x=new uDe(s,"x",-l/3),c.attributes.y=new uDe(s,"y",-l/3),c.attributes.width=new uDe(s,"width",l),c.attributes.height=new uDe(s,"height",l);var h=new XDe(s,null);h.attributes.transform=new uDe(s,"transform",this.getAttribute("gradientTransform").getValue()),h.children=[c];var f=new ODe(s,null);f.attributes.x=new uDe(s,"x",0),f.attributes.y=new uDe(s,"y",0),f.attributes.width=new uDe(s,"width",A.width),f.attributes.height=new uDe(s,"height",A.height),f.children=[h];var d=s.createCanvas(A.width,A.height),p=d.getContext("2d");return p.fillStyle=a,f.render(p),p.createPattern(d,"no-repeat")}return a}},{key:"inheritStopContainer",value:function(e){var t=this;this.attributesToInherit.forEach((function(n){!t.getAttribute(n).hasValue()&&e.getAttribute(n).hasValue()&&t.getAttribute(n,!0).setValue(e.getAttribute(n).getValue())}))}},{key:"addParentOpacity",value:function(e,t){return e.hasValue()?new uDe(this.document,"color",t).addOpacity(e).getColor():t}}]),n}(xDe),ZDe=function(e){c(n,e);var t=b(n);function n(e,r,i){var o;return s(this,n),(o=t.call(this,e,r,i)).type="linearGradient",o.attributesToInherit.push("x1","y1","x2","y2"),o}return l(n,[{key:"getGradient",value:function(e,t){var n="objectBoundingBox"===this.getGradientUnits(),r=n?t.getBoundingBox(e):null;if(n&&!r)return null;this.getAttribute("x1").hasValue()||this.getAttribute("y1").hasValue()||this.getAttribute("x2").hasValue()||this.getAttribute("y2").hasValue()||(this.getAttribute("x1",!0).setValue(0),this.getAttribute("y1",!0).setValue(0),this.getAttribute("x2",!0).setValue(1),this.getAttribute("y2",!0).setValue(0));var i=n?r.x+r.width*this.getAttribute("x1").getNumber():this.getAttribute("x1").getPixels("x"),o=n?r.y+r.height*this.getAttribute("y1").getNumber():this.getAttribute("y1").getPixels("y"),a=n?r.x+r.width*this.getAttribute("x2").getNumber():this.getAttribute("x2").getPixels("x"),s=n?r.y+r.height*this.getAttribute("y2").getNumber():this.getAttribute("y2").getPixels("y");return i===a&&o===s?null:e.createLinearGradient(i,o,a,s)}}]),n}(WDe),$De=function(e){c(n,e);var t=b(n);function n(e,r,i){var o;return s(this,n),(o=t.call(this,e,r,i)).type="radialGradient",o.attributesToInherit.push("cx","cy","r","fx","fy","fr"),o}return l(n,[{key:"getGradient",value:function(e,t){var n="objectBoundingBox"===this.getGradientUnits(),r=t.getBoundingBox(e);if(n&&!r)return null;this.getAttribute("cx").hasValue()||this.getAttribute("cx",!0).setValue("50%"),this.getAttribute("cy").hasValue()||this.getAttribute("cy",!0).setValue("50%"),this.getAttribute("r").hasValue()||this.getAttribute("r",!0).setValue("50%");var i=n?r.x+r.width*this.getAttribute("cx").getNumber():this.getAttribute("cx").getPixels("x"),o=n?r.y+r.height*this.getAttribute("cy").getNumber():this.getAttribute("cy").getPixels("y"),a=i,s=o;this.getAttribute("fx").hasValue()&&(a=n?r.x+r.width*this.getAttribute("fx").getNumber():this.getAttribute("fx").getPixels("x")),this.getAttribute("fy").hasValue()&&(s=n?r.y+r.height*this.getAttribute("fy").getNumber():this.getAttribute("fy").getPixels("y"));var u=n?(r.width+r.height)/2*this.getAttribute("r").getNumber():this.getAttribute("r").getPixels(),l=this.getAttribute("fr").getPixels();return e.createRadialGradient(a,s,l,i,o,u)}}]),n}(WDe),eFe=function(e){c(n,e);var t=b(n);function n(e,r,i){var o;s(this,n),(o=t.call(this,e,r,i)).type="stop";var a=Math.max(0,Math.min(1,o.getAttribute("offset").getNumber())),u=o.getStyle("stop-opacity"),l=o.getStyle("stop-color",!0);return""===l.getString()&&l.setValue("#000"),u.hasValue()&&(l=l.addOpacity(u)),o.offset=a,o.color=l.getColor(),o}return l(n)}(xDe),tFe=function(e){c(n,e);var t=b(n);function n(e,r,i){var o;s(this,n),(o=t.call(this,e,r,i)).type="animate",o.duration=0,o.initialValue=null,o.initialUnits="",o.removed=!1,o.frozen=!1,e.screen.animations.push(m(o)),o.begin=o.getAttribute("begin").getMilliseconds(),o.maxDuration=o.begin+o.getAttribute("dur").getMilliseconds(),o.from=o.getAttribute("from"),o.to=o.getAttribute("to"),o.values=new uDe(e,"values",null);var a=o.getAttribute("values");return a.hasValue()&&o.values.setValue(a.getString().split(";")),o}return l(n,[{key:"getProperty",value:function(){var e=this.getAttribute("attributeType").getString(),t=this.getAttribute("attributeName").getString();return"CSS"===e?this.parent.getStyle(t,!0):this.parent.getAttribute(t,!0)}},{key:"calcValue",value:function(){var e=this.initialUnits,t=this.getProgress(),n=t.progress,r=t.from,i=t.to,o=r.getNumber()+(i.getNumber()-r.getNumber())*n;return"%"===e&&(o*=100),"".concat(o).concat(e)}},{key:"update",value:function(e){var t=this.parent,n=this.getProperty();if(this.initialValue||(this.initialValue=n.getString(),this.initialUnits=n.getUnits()),this.duration>this.maxDuration){var r=this.getAttribute("fill").getString("remove");if("indefinite"===this.getAttribute("repeatCount").getString()||"indefinite"===this.getAttribute("repeatDur").getString())this.duration=0;else if("freeze"!==r||this.frozen){if("remove"===r&&!this.removed)return this.removed=!0,n.setValue(t.animationFrozen?t.animationFrozenValue:this.initialValue),!0}else this.frozen=!0,t.animationFrozen=!0,t.animationFrozenValue=n.getString();return!1}this.duration+=e;var i=!1;if(this.begin<this.duration){var o=this.calcValue(),a=this.getAttribute("type");if(a.hasValue()){var s=a.getString();o="".concat(s,"(").concat(o,")")}n.setValue(o),i=!0}return i}},{key:"getProgress",value:function(){var e=this.document,t=this.values,n={progress:(this.duration-this.begin)/(this.maxDuration-this.begin)};if(t.hasValue()){var r=n.progress*(t.getValue().length-1),i=Math.floor(r),o=Math.ceil(r);n.from=new uDe(e,"from",parseFloat(t.getValue()[i])),n.to=new uDe(e,"to",parseFloat(t.getValue()[o])),n.progress=(r-i)/(o-i)}else n.from=this.from,n.to=this.to;return n}}]),n}(xDe),nFe=function(e){c(n,e);var t=b(n);function n(){var e;return s(this,n),(e=t.apply(this,arguments)).type="animateColor",e}return l(n,[{key:"calcValue",value:function(){var e=this.getProgress(),t=e.progress,n=e.from,r=e.to,i=new Q_e(n.getColor()),o=new Q_e(r.getColor());if(i.ok&&o.ok){var a=i.r+(o.r-i.r)*t,s=i.g+(o.g-i.g)*t,u=i.b+(o.b-i.b)*t;return"rgb(".concat(Math.floor(a),", ").concat(Math.floor(s),", ").concat(Math.floor(u),")")}return this.getAttribute("from").getColor()}}]),n}(tFe),rFe=function(e){c(n,e);var t=b(n);function n(){var e;return s(this,n),(e=t.apply(this,arguments)).type="animateTransform",e}return l(n,[{key:"calcValue",value:function(){var e=this.getProgress(),t=e.progress,n=e.from,r=e.to,i=MNe(n.getString()),o=MNe(r.getString()),a=i.map((function(e,n){return e+(o[n]-e)*t})).join(" ");return a}}]),n}(tFe),iFe=function(e){c(n,e);var t=b(n);function n(e,r,i){var o;s(this,n),(o=t.call(this,e,r,i)).type="font",o.glyphs={},o.horizAdvX=o.getAttribute("horiz-adv-x").getNumber();var a,u=e.definitions,l=F(m(o).children);try{for(l.s();!(a=l.n()).done;){var A=a.value;switch(A.type){case"font-face":o.fontFace=A;var c=A.getStyle("font-family");c.hasValue()&&(u[c.getString()]=m(o));break;case"missing-glyph":o.missingGlyph=A;break;case"glyph":var h=A;h.arabicForm?(o.isRTL=!0,o.isArabic=!0,void 0===o.glyphs[h.unicode]&&(o.glyphs[h.unicode]={}),o.glyphs[h.unicode][h.arabicForm]=h):o.glyphs[h.unicode]=h}}}catch(e){l.e(e)}finally{l.f()}return o}return l(n,[{key:"render",value:function(){}}]),n}(xDe),oFe=function(e){c(n,e);var t=b(n);function n(e,r,i){var o;return s(this,n),(o=t.call(this,e,r,i)).type="font-face",o.ascent=o.getAttribute("ascent").getNumber(),o.descent=o.getAttribute("descent").getNumber(),o.unitsPerEm=o.getAttribute("units-per-em").getNumber(),o}return l(n)}(xDe),aFe=function(e){c(n,e);var t=b(n);function n(){var e;return s(this,n),(e=t.apply(this,arguments)).type="missing-glyph",e.horizAdvX=0,e}return l(n)}(UDe),sFe=function(e){c(n,e);var t=b(n);function n(){var e;return s(this,n),(e=t.apply(this,arguments)).type="tref",e}return l(n,[{key:"getText",value:function(){var e=this.getHrefAttribute().getDefinition();if(e){var t=e.children[0];if(t)return t.getText()}return""}}]),n}(MDe),uFe=function(e){c(n,e);var t=b(n);function n(e,r,i){var o;s(this,n),(o=t.call(this,e,r,i)).type="a";var a=r.childNodes,u=a[0],l=a.length>0&&Array.from(a).every((function(e){return 3===e.nodeType}));return o.hasText=l,o.text=l?o.getTextFromNode(u):"",o}return l(n,[{key:"getText",value:function(){return this.text}},{key:"renderChildren",value:function(e){if(this.hasText){B(h(n.prototype),"renderChildren",this).call(this,e);var t=this.document,r=this.x,i=this.y,o=t.screen.mouse,a=new uDe(t,"fontSize",NDe.parse(t.ctx.font).fontSize);o.isWorking()&&o.checkBoundingBox(this,new DDe(r,i-a.getPixels("y"),r+this.measureText(e),i))}else if(this.children.length>0){var s=new XDe(this.document,null);s.children=this.children,s.parent=this,s.render(e)}}},{key:"onClick",value:function(){var e=this.document.window;e&&e.open(this.getHrefAttribute().getString())}},{key:"onMouseMove",value:function(){this.document.ctx.canvas.style.cursor="pointer"}}]),n}(MDe);function lFe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function AFe(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?lFe(Object(n),!0).forEach((function(t){eQe(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lFe(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var cFe=function(e){c(n,e);var t=b(n);function n(e,r,i){var o;s(this,n),(o=t.call(this,e,r,i)).type="textPath",o.textWidth=0,o.textHeight=0,o.pathLength=-1,o.glyphInfo=null,o.letterSpacingCache=[],o.measuresCache=new Map([["",0]]);var a=o.getHrefAttribute().getDefinition();return o.text=o.getTextFromNode(),o.dataArray=o.parsePathData(a),o}return l(n,[{key:"getText",value:function(){return this.text}},{key:"path",value:function(e){var t=this.dataArray;e&&e.beginPath(),t.forEach((function(t){var n=t.type,r=t.points;switch(n){case FDe.LINE_TO:e&&e.lineTo(r[0],r[1]);break;case FDe.MOVE_TO:e&&e.moveTo(r[0],r[1]);break;case FDe.CURVE_TO:e&&e.bezierCurveTo(r[0],r[1],r[2],r[3],r[4],r[5]);break;case FDe.QUAD_TO:e&&e.quadraticCurveTo(r[0],r[1],r[2],r[3]);break;case FDe.ARC:var i=C(r,8),o=i[0],a=i[1],s=i[2],u=i[3],l=i[4],A=i[5],c=i[6],h=i[7],f=s>u?s:u,d=s>u?1:s/u,p=s>u?u/s:1;e&&(e.translate(o,a),e.rotate(c),e.scale(d,p),e.arc(0,0,f,l,l+A,Boolean(1-h)),e.scale(1/d,1/p),e.rotate(-c),e.translate(-o,-a));break;case FDe.CLOSE_PATH:e&&e.closePath()}}))}},{key:"renderChildren",value:function(e){this.setTextData(e),e.save();var t=this.parent.getStyle("text-decoration").getString(),n=this.getFontSize(),r=this.glyphInfo,i=e.fillStyle;"underline"===t&&e.beginPath(),r.forEach((function(r,i){var o=r.p0,a=r.p1,s=r.rotation,u=r.text;e.save(),e.translate(o.x,o.y),e.rotate(s),e.fillStyle&&e.fillText(u,0,0),e.strokeStyle&&e.strokeText(u,0,0),e.restore(),"underline"===t&&(0===i&&e.moveTo(o.x,o.y+n/8),e.lineTo(a.x,a.y+n/5))})),"underline"===t&&(e.lineWidth=n/20,e.strokeStyle=i,e.stroke(),e.closePath()),e.restore()}},{key:"getLetterSpacingAt",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.letterSpacingCache[e]||0}},{key:"findSegmentToFitChar",value:function(e,t,n,r,i,o,a,s,u){var l=o,A=this.measureText(e,s);" "===s&&"justify"===t&&n<r&&(A+=(r-n)/i),u>-1&&(l+=this.getLetterSpacingAt(u));var c=this.textHeight/20,h=this.getEquidistantPointOnPath(l,c,0),f=this.getEquidistantPointOnPath(l+A,c,0),d={p0:h,p1:f},p=h&&f?Math.atan2(f.y-h.y,f.x-h.x):0;if(a){var g=Math.cos(Math.PI/2+p)*a,v=Math.cos(-p)*a;d.p0=AFe(AFe({},h),{},{x:h.x+g,y:h.y+v}),d.p1=AFe(AFe({},f),{},{x:f.x+g,y:f.y+v})}return{offset:l+=A,segment:d,rotation:p}}},{key:"measureText",value:function(e,t){var n=this.measuresCache,r=t||this.getText();if(n.has(r))return n.get(r);var i=this.measureTargetText(e,r);return n.set(r,i),i}},{key:"setTextData",value:function(e){var t=this;if(!this.glyphInfo){var n=this.getText(),r=n.split(""),i=n.split(" ").length-1,o=this.parent.getAttribute("dx").split().map((function(e){return e.getPixels("x")})),a=this.parent.getAttribute("dy").getPixels("y"),s=this.parent.getStyle("text-anchor").getString("start"),u=this.getStyle("letter-spacing"),l=this.parent.getStyle("letter-spacing"),A=0;u.hasValue()&&"inherit"!==u.getValue()?u.hasValue()&&"initial"!==u.getValue()&&"unset"!==u.getValue()&&(A=u.getPixels()):A=l.getPixels();var c=[],h=n.length;this.letterSpacingCache=c;for(var f=0;f<h;f++)c.push(void 0!==o[f]?o[f]:A);var d=c.reduce((function(e,t,n){return 0===n?0:e+t||0}),0),p=this.measureText(e),g=Math.max(p+d,0);this.textWidth=p,this.textHeight=this.getFontSize(),this.glyphInfo=[];var v=this.getPathLength(),y=this.getStyle("startOffset").getNumber(0)*v,m=0;"middle"!==s&&"center"!==s||(m=-g/2),"end"!==s&&"right"!==s||(m=-g),m+=y,r.forEach((function(n,o){var u=t.findSegmentToFitChar(e,s,g,v,i,m,a,n,o),l=u.offset,A=u.segment,c=u.rotation;m=l,A.p0&&A.p1&&t.glyphInfo.push({text:r[o],p0:A.p0,p1:A.p1,rotation:c})}))}}},{key:"parsePathData",value:function(e){if(this.pathLength=-1,!e)return[];var t=[],n=e.pathParser;for(n.reset();!n.isEnd();){var r=n.current,i=r?r.x:0,o=r?r.y:0,a=n.next(),s=a.type,u=[];switch(a.type){case FDe.MOVE_TO:this.pathM(n,u);break;case FDe.LINE_TO:s=this.pathL(n,u);break;case FDe.HORIZ_LINE_TO:s=this.pathH(n,u);break;case FDe.VERT_LINE_TO:s=this.pathV(n,u);break;case FDe.CURVE_TO:this.pathC(n,u);break;case FDe.SMOOTH_CURVE_TO:s=this.pathS(n,u);break;case FDe.QUAD_TO:this.pathQ(n,u);break;case FDe.SMOOTH_QUAD_TO:s=this.pathT(n,u);break;case FDe.ARC:u=this.pathA(n);break;case FDe.CLOSE_PATH:UDe.pathZ(n)}a.type!==FDe.CLOSE_PATH?t.push({type:s,points:u,start:{x:i,y:o},pathLength:this.calcLength(i,o,s,u)}):t.push({type:FDe.CLOSE_PATH,points:[],pathLength:0})}return t}},{key:"pathM",value:function(e,t){var n=UDe.pathM(e).point,r=n.x,i=n.y;t.push(r,i)}},{key:"pathL",value:function(e,t){var n=UDe.pathL(e).point,r=n.x,i=n.y;return t.push(r,i),FDe.LINE_TO}},{key:"pathH",value:function(e,t){var n=UDe.pathH(e).point,r=n.x,i=n.y;return t.push(r,i),FDe.LINE_TO}},{key:"pathV",value:function(e,t){var n=UDe.pathV(e).point,r=n.x,i=n.y;return t.push(r,i),FDe.LINE_TO}},{key:"pathC",value:function(e,t){var n=UDe.pathC(e),r=n.point,i=n.controlPoint,o=n.currentPoint;t.push(r.x,r.y,i.x,i.y,o.x,o.y)}},{key:"pathS",value:function(e,t){var n=UDe.pathS(e),r=n.point,i=n.controlPoint,o=n.currentPoint;return t.push(r.x,r.y,i.x,i.y,o.x,o.y),FDe.CURVE_TO}},{key:"pathQ",value:function(e,t){var n=UDe.pathQ(e),r=n.controlPoint,i=n.currentPoint;t.push(r.x,r.y,i.x,i.y)}},{key:"pathT",value:function(e,t){var n=UDe.pathT(e),r=n.controlPoint,i=n.currentPoint;return t.push(r.x,r.y,i.x,i.y),FDe.QUAD_TO}},{key:"pathA",value:function(e){var t=UDe.pathA(e),n=t.rX,r=t.rY,i=t.sweepFlag,o=t.xAxisRotation,a=t.centp,s=t.a1,u=t.ad;return 0===i&&u>0&&(u-=2*Math.PI),1===i&&u<0&&(u+=2*Math.PI),[a.x,a.y,n,r,s,u,o,i]}},{key:"calcLength",value:function(e,t,n,r){var i=0,o=null,a=null,s=0;switch(n){case FDe.LINE_TO:return this.getLineLength(e,t,r[0],r[1]);case FDe.CURVE_TO:for(i=0,o=this.getPointOnCubicBezier(0,e,t,r[0],r[1],r[2],r[3],r[4],r[5]),s=.01;s<=1;s+=.01)a=this.getPointOnCubicBezier(s,e,t,r[0],r[1],r[2],r[3],r[4],r[5]),i+=this.getLineLength(o.x,o.y,a.x,a.y),o=a;return i;case FDe.QUAD_TO:for(i=0,o=this.getPointOnQuadraticBezier(0,e,t,r[0],r[1],r[2],r[3]),s=.01;s<=1;s+=.01)a=this.getPointOnQuadraticBezier(s,e,t,r[0],r[1],r[2],r[3]),i+=this.getLineLength(o.x,o.y,a.x,a.y),o=a;return i;case FDe.ARC:i=0;var u=r[4],l=r[5],A=r[4]+l,c=Math.PI/180;if(Math.abs(u-A)<c&&(c=Math.abs(u-A)),o=this.getPointOnEllipticalArc(r[0],r[1],r[2],r[3],u,0),l<0)for(s=u-c;s>A;s-=c)a=this.getPointOnEllipticalArc(r[0],r[1],r[2],r[3],s,0),i+=this.getLineLength(o.x,o.y,a.x,a.y),o=a;else for(s=u+c;s<A;s+=c)a=this.getPointOnEllipticalArc(r[0],r[1],r[2],r[3],s,0),i+=this.getLineLength(o.x,o.y,a.x,a.y),o=a;return a=this.getPointOnEllipticalArc(r[0],r[1],r[2],r[3],A,0),i+=this.getLineLength(o.x,o.y,a.x,a.y)}return 0}},{key:"getPointOnLine",value:function(e,t,n,r,i){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:t,a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:n,s=(i-n)/(r-t+WNe),u=Math.sqrt(e*e/(1+s*s));r<t&&(u*=-1);var l=s*u,A=null;if(r===t)A={x:o,y:a+l};else if((a-n)/(o-t+WNe)===s)A={x:o+u,y:a+l};else{var c=0,h=0,f=this.getLineLength(t,n,r,i);if(f<WNe)return null;var d=(o-t)*(r-t)+(a-n)*(i-n);c=t+(d/=f*f)*(r-t),h=n+d*(i-n);var p=this.getLineLength(o,a,c,h),g=Math.sqrt(e*e-p*p);u=Math.sqrt(g*g/(1+s*s)),r<t&&(u*=-1),A={x:c+u,y:h+(l=s*u)}}return A}},{key:"getPointOnPath",value:function(e){var t=this.getPathLength(),n=0,r=null;if(e<-5e-5||e-5e-5>t)return null;var i,o=F(this.dataArray);try{for(o.s();!(i=o.n()).done;){var a=i.value;if(!a||!(a.pathLength<5e-5||n+a.pathLength+5e-5<e)){var s=e-n,u=0;switch(a.type){case FDe.LINE_TO:r=this.getPointOnLine(s,a.start.x,a.start.y,a.points[0],a.points[1],a.start.x,a.start.y);break;case FDe.ARC:var l=a.points[4],A=a.points[5],c=a.points[4]+A;if(u=l+s/a.pathLength*A,A<0&&u<c||A>=0&&u>c)break;r=this.getPointOnEllipticalArc(a.points[0],a.points[1],a.points[2],a.points[3],u,a.points[6]);break;case FDe.CURVE_TO:(u=s/a.pathLength)>1&&(u=1),r=this.getPointOnCubicBezier(u,a.start.x,a.start.y,a.points[0],a.points[1],a.points[2],a.points[3],a.points[4],a.points[5]);break;case FDe.QUAD_TO:(u=s/a.pathLength)>1&&(u=1),r=this.getPointOnQuadraticBezier(u,a.start.x,a.start.y,a.points[0],a.points[1],a.points[2],a.points[3])}if(r)return r;break}n+=a.pathLength}}catch(e){o.e(e)}finally{o.f()}return null}},{key:"getLineLength",value:function(e,t,n,r){return Math.sqrt((n-e)*(n-e)+(r-t)*(r-t))}},{key:"getPathLength",value:function(){return-1===this.pathLength&&(this.pathLength=this.dataArray.reduce((function(e,t){return t.pathLength>0?e+t.pathLength:e}),0)),this.pathLength}},{key:"getPointOnCubicBezier",value:function(e,t,n,r,i,o,a,s,u){return{x:s*tDe(e)+o*nDe(e)+r*rDe(e)+t*iDe(e),y:u*tDe(e)+a*nDe(e)+i*rDe(e)+n*iDe(e)}}},{key:"getPointOnQuadraticBezier",value:function(e,t,n,r,i,o,a){return{x:o*oDe(e)+r*aDe(e)+t*sDe(e),y:a*oDe(e)+i*aDe(e)+n*sDe(e)}}},{key:"getPointOnEllipticalArc",value:function(e,t,n,r,i,o){var a=Math.cos(o),s=Math.sin(o),u=n*Math.cos(i),l=r*Math.sin(i);return{x:e+(u*a-l*s),y:t+(u*s+l*a)}}},{key:"buildEquidistantCache",value:function(e,t){var n=this.getPathLength(),r=t||.25,i=e||n/100;if(!this.equidistantCache||this.equidistantCache.step!==i||this.equidistantCache.precision!==r){this.equidistantCache={step:i,precision:r,points:[]};for(var o=0,a=0;a<=n;a+=r){var s=this.getPointOnPath(a),u=this.getPointOnPath(a+r);s&&u&&((o+=this.getLineLength(s.x,s.y,u.x,u.y))>=i&&(this.equidistantCache.points.push({x:s.x,y:s.y,distance:a}),o-=i))}}}},{key:"getEquidistantPointOnPath",value:function(e,t,n){if(this.buildEquidistantCache(t,n),e<0||e-this.getPathLength()>5e-5)return null;var r=Math.round(e/this.getPathLength()*(this.equidistantCache.points.length-1));return this.equidistantCache.points[r]||null}}]),n}(MDe),hFe=/^\s*data:(([^/,;]+\/[^/,;]+)(?:;([^,;=]+=[^,;=]+))?)?(?:;(base64))?,(.*)$/i,fFe=function(e){c(n,e);var t=b(n);function n(e,r,i){var o;s(this,n),(o=t.call(this,e,r,i)).type="image",o.loaded=!1;var a=o.getHrefAttribute().getString();if(!a)return w(o);var u=a.endsWith(".svg")||/^\s*data:image\/svg\+xml/i.test(a);return e.images.push(m(o)),u?o.loadSvg(a):o.loadImage(a),o.isSvg=u,o}return l(n,[{key:"loadImage",value:function(e){var t=this;return REe(r().mark((function n(){var i;return r().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,t.document.createImage(e);case 3:i=n.sent,t.image=i,n.next=10;break;case 7:n.prev=7,n.t0=n.catch(0),console.error('Error while loading image "'.concat(e,'":'),n.t0);case 10:t.loaded=!0;case 11:case"end":return n.stop()}}),n,null,[[0,7]])})))()}},{key:"loadSvg",value:function(e){var t=this;return REe(r().mark((function n(){var i,o,a,s;return r().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!(i=hFe.exec(e))){n.next=6;break}o=i[5],"base64"===i[4]?t.image=atob(o):t.image=decodeURIComponent(o),n.next=19;break;case 6:return n.prev=6,n.next=9,t.document.fetch(e);case 9:return a=n.sent,n.next=12,a.text();case 12:s=n.sent,t.image=s,n.next=19;break;case 16:n.prev=16,n.t0=n.catch(6),console.error('Error while loading image "'.concat(e,'":'),n.t0);case 19:t.loaded=!0;case 20:case"end":return n.stop()}}),n,null,[[6,16]])})))()}},{key:"renderChildren",value:function(e){var t=this.document,n=this.image,r=this.loaded,i=this.getAttribute("x").getPixels("x"),o=this.getAttribute("y").getPixels("y"),a=this.getStyle("width").getPixels("x"),s=this.getStyle("height").getPixels("y");if(r&&n&&a&&s){if(e.save(),e.translate(i,o),this.isSvg){var u=t.canvg.forkString(e,this.image,{ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0,ignoreClear:!0,offsetX:0,offsetY:0,scaleWidth:a,scaleHeight:s});u.document.documentElement.parent=this,u.render()}else{var l=this.image;t.setViewBox({ctx:e,aspectRatio:this.getAttribute("preserveAspectRatio").getString(),width:a,desiredWidth:l.width,height:s,desiredHeight:l.height}),this.loaded&&(void 0===l.complete||l.complete)&&e.drawImage(l,0,0)}e.restore()}}},{key:"getBoundingBox",value:function(){var e=this.getAttribute("x").getPixels("x"),t=this.getAttribute("y").getPixels("y"),n=this.getStyle("width").getPixels("x"),r=this.getStyle("height").getPixels("y");return new DDe(e,t,e+n,t+r)}}]),n}(PDe),dFe=function(e){c(n,e);var t=b(n);function n(){var e;return s(this,n),(e=t.apply(this,arguments)).type="symbol",e}return l(n,[{key:"render",value:function(e){}}]),n}(PDe),pFe=function(){function e(t){s(this,e),this.document=t,this.loaded=!1,t.fonts.push(this)}return l(e,[{key:"load",value:function(e,t){var n=this;return REe(r().mark((function i(){var o,a,s;return r().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,o=n.document,r.next=4,o.canvg.parser.load(t);case 4:a=r.sent,s=a.getElementsByTagName("font"),Array.from(s).forEach((function(t){var n=o.createElement(t);o.definitions[e]=n})),r.next=12;break;case 9:r.prev=9,r.t0=r.catch(0),console.error('Error while loading font "'.concat(t,'":'),r.t0);case 12:n.loaded=!0;case 13:case"end":return r.stop()}}),i,null,[[0,9]])})))()}}]),e}(),gFe=function(e){c(n,e);var t=b(n);function n(e,r,i){var o;s(this,n),(o=t.call(this,e,r,i)).type="style";var a=PNe(Array.from(r.childNodes).map((function(e){return e.textContent})).join("").replace(/(\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*+\/)|(^[\s]*\/\/.*)/gm,"").replace(/@import.*;/g,""));return a.split("}").forEach((function(t){var n=t.trim();if(n){var r=n.split("{"),i=r[0].split(","),o=r[1].split(";");i.forEach((function(t){var n=t.trim();if(n){var r=e.styles[n]||{};if(o.forEach((function(t){var n=t.indexOf(":"),i=t.substr(0,n).trim(),o=t.substr(n+1,t.length-n).trim();i&&o&&(r[i]=new uDe(e,i,o))})),e.styles[n]=r,e.stylesSpecificity[n]=XNe(n),"@font-face"===n){var i=r["font-family"].getString().replace(/"|'/g,"");r.src.getString().split(",").forEach((function(t){if(t.indexOf('format("svg")')>0){var n=ONe(t);n&&new pFe(e).load(i,n)}}))}}}))}})),o}return l(n)}(xDe);gFe.parseExternalUrl=ONe;var vFe=function(e){c(n,e);var t=b(n);function n(){var e;return s(this,n),(e=t.apply(this,arguments)).type="use",e}return l(n,[{key:"setContext",value:function(e){B(h(n.prototype),"setContext",this).call(this,e);var t=this.getAttribute("x"),r=this.getAttribute("y");t.hasValue()&&e.translate(t.getPixels("x"),0),r.hasValue()&&e.translate(0,r.getPixels("y"))}},{key:"path",value:function(e){var t=this.element;t&&t.path(e)}},{key:"renderChildren",value:function(e){var t=this.document,n=this.element;if(n){var r=n;if("symbol"===n.type&&((r=new ODe(t,null)).attributes.viewBox=new uDe(t,"viewBox",n.getAttribute("viewBox").getString()),r.attributes.preserveAspectRatio=new uDe(t,"preserveAspectRatio",n.getAttribute("preserveAspectRatio").getString()),r.attributes.overflow=new uDe(t,"overflow",n.getAttribute("overflow").getString()),r.children=n.children,n.styles.opacity=new uDe(t,"opacity",this.calculateOpacity())),"svg"===r.type){var i=this.getStyle("width",!1,!0),o=this.getStyle("height",!1,!0);i.hasValue()&&(r.attributes.width=new uDe(t,"width",i.getString())),o.hasValue()&&(r.attributes.height=new uDe(t,"height",o.getString()))}var a=r.parent;r.parent=this,r.render(e),r.parent=a}}},{key:"getBoundingBox",value:function(e){var t=this.element;return t?t.getBoundingBox(e):null}},{key:"elementTransform",value:function(){var e=this.document,t=this.element;return CDe.fromElement(e,t)}},{key:"element",get:function(){return this.cachedElement||(this.cachedElement=this.getHrefAttribute().getDefinition()),this.cachedElement}}]),n}(PDe);function yFe(e,t,n,r,i,o){return e[n*r*4+4*t+o]}function mFe(e,t,n,r,i,o,a){e[n*r*4+4*t+o]=a}function wFe(e,t,n){return e[t]*n}function bFe(e,t,n,r){return t+Math.cos(e)*n+Math.sin(e)*r}var IFe=function(e){c(n,e);var t=b(n);function n(e,r,i){var o;s(this,n),(o=t.call(this,e,r,i)).type="feColorMatrix";var a=MNe(o.getAttribute("values").getString());switch(o.getAttribute("type").getString("matrix")){case"saturate":var u=a[0];a=[.213+.787*u,.715-.715*u,.072-.072*u,0,0,.213-.213*u,.715+.285*u,.072-.072*u,0,0,.213-.213*u,.715-.715*u,.072+.928*u,0,0,0,0,0,1,0,0,0,0,0,1];break;case"hueRotate":var l=a[0]*Math.PI/180;a=[bFe(l,.213,.787,-.213),bFe(l,.715,-.715,-.715),bFe(l,.072,-.072,.928),0,0,bFe(l,.213,-.213,.143),bFe(l,.715,.285,.14),bFe(l,.072,-.072,-.283),0,0,bFe(l,.213,-.213,-.787),bFe(l,.715,-.715,.715),bFe(l,.072,.928,.072),0,0,0,0,0,1,0,0,0,0,0,1];break;case"luminanceToAlpha":a=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,.2125,.7154,.0721,0,0,0,0,0,0,1]}return o.matrix=a,o.includeOpacity=o.getAttribute("includeOpacity").hasValue(),o}return l(n,[{key:"apply",value:function(e,t,n,r,i){for(var o=this.includeOpacity,a=this.matrix,s=e.getImageData(0,0,r,i),u=0;u<i;u++)for(var l=0;l<r;l++){var A=yFe(s.data,l,u,r,0,0),c=yFe(s.data,l,u,r,0,1),h=yFe(s.data,l,u,r,0,2),f=yFe(s.data,l,u,r,0,3),d=wFe(a,0,A)+wFe(a,1,c)+wFe(a,2,h)+wFe(a,3,f)+wFe(a,4,1),p=wFe(a,5,A)+wFe(a,6,c)+wFe(a,7,h)+wFe(a,8,f)+wFe(a,9,1),g=wFe(a,10,A)+wFe(a,11,c)+wFe(a,12,h)+wFe(a,13,f)+wFe(a,14,1),v=wFe(a,15,A)+wFe(a,16,c)+wFe(a,17,h)+wFe(a,18,f)+wFe(a,19,1);o&&(d=0,p=0,g=0,v*=f/255),mFe(s.data,l,u,r,0,0,d),mFe(s.data,l,u,r,0,1,p),mFe(s.data,l,u,r,0,2,g),mFe(s.data,l,u,r,0,3,v)}e.clearRect(0,0,r,i),e.putImageData(s,0,0)}}]),n}(xDe),BFe=function(e){c(n,e);var t=b(n);function n(){var e;return s(this,n),(e=t.apply(this,arguments)).type="mask",e}return l(n,[{key:"apply",value:function(e,t){var r=this.document,i=this.getAttribute("x").getPixels("x"),o=this.getAttribute("y").getPixels("y"),a=this.getStyle("width").getPixels("x"),s=this.getStyle("height").getPixels("y");if(!a&&!s){var u=new DDe;this.children.forEach((function(t){u.addBoundingBox(t.getBoundingBox(e))})),i=Math.floor(u.x1),o=Math.floor(u.y1),a=Math.floor(u.width),s=Math.floor(u.height)}var l=this.removeStyles(t,n.ignoreStyles),A=r.createCanvas(i+a,o+s),c=A.getContext("2d");r.screen.setDefaults(c),this.renderChildren(c),new IFe(r,{nodeType:1,childNodes:[],attributes:[{nodeName:"type",value:"luminanceToAlpha"},{nodeName:"includeOpacity",value:"true"}]}).apply(c,0,0,i+a,o+s);var h=r.createCanvas(i+a,o+s),f=h.getContext("2d");r.screen.setDefaults(f),t.render(f),f.globalCompositeOperation="destination-in",f.fillStyle=c.createPattern(A,"no-repeat"),f.fillRect(0,0,i+a,o+s),e.fillStyle=f.createPattern(h,"no-repeat"),e.fillRect(0,0,i+a,o+s),this.restoreStyles(t,l)}},{key:"render",value:function(e){}}]),n}(xDe);BFe.ignoreStyles=["mask","transform","clip-path"];var EFe=function(){},CFe=function(e){c(n,e);var t=b(n);function n(){var e;return s(this,n),(e=t.apply(this,arguments)).type="clipPath",e}return l(n,[{key:"apply",value:function(e){var t=this.document,n=Reflect.getPrototypeOf(e),r=e.beginPath,i=e.closePath;n&&(n.beginPath=EFe,n.closePath=EFe),Reflect.apply(r,e,[]),this.children.forEach((function(r){if(void 0!==r.path){var o=void 0!==r.elementTransform?r.elementTransform():null;o||(o=CDe.fromElement(t,r)),o&&o.apply(e),r.path(e),n&&(n.closePath=i),o&&o.unapply(e)}})),Reflect.apply(i,e,[]),e.clip(),n&&(n.beginPath=r,n.closePath=i)}},{key:"render",value:function(e){}}]),n}(xDe),xFe=function(e){c(n,e);var t=b(n);function n(){var e;return s(this,n),(e=t.apply(this,arguments)).type="filter",e}return l(n,[{key:"apply",value:function(e,t){var r=this.document,i=this.children,o=t.getBoundingBox(e);if(o){var a=0,s=0;i.forEach((function(e){var t=e.extraFilterDistance||0;a=Math.max(a,t),s=Math.max(s,t)}));var u=Math.floor(o.width),l=Math.floor(o.height),A=u+2*a,c=l+2*s;if(!(A<1||c<1)){var h=Math.floor(o.x),f=Math.floor(o.y),d=this.removeStyles(t,n.ignoreStyles),p=r.createCanvas(A,c),g=p.getContext("2d");r.screen.setDefaults(g),g.translate(-h+a,-f+s),t.render(g),i.forEach((function(e){"function"==typeof e.apply&&e.apply(g,0,0,A,c)})),e.drawImage(p,0,0,A,c,h-a,f-s,A,c),this.restoreStyles(t,d)}}}},{key:"render",value:function(e){}}]),n}(xDe);xFe.ignoreStyles=["filter","transform","clip-path"];var kFe=function(e){c(n,e);var t=b(n);function n(e,r,i){var o;return s(this,n),(o=t.call(this,e,r,i)).type="feDropShadow",o.addStylesFromStyleDefinition(),o}return l(n,[{key:"apply",value:function(e,t,n,r,i){}}]),n}(xDe),SFe=function(e){c(n,e);var t=b(n);function n(){var e;return s(this,n),(e=t.apply(this,arguments)).type="feMorphology",e}return l(n,[{key:"apply",value:function(e,t,n,r,i){}}]),n}(xDe),QFe=function(e){c(n,e);var t=b(n);function n(){var e;return s(this,n),(e=t.apply(this,arguments)).type="feComposite",e}return l(n,[{key:"apply",value:function(e,t,n,r,i){}}]),n}(xDe),_Fe=function(e){c(n,e);var t=b(n);function n(e,r,i){var o;return s(this,n),(o=t.call(this,e,r,i)).type="feGaussianBlur",o.blurRadius=Math.floor(o.getAttribute("stdDeviation").getNumber()),o.extraFilterDistance=o.blurRadius,o}return l(n,[{key:"apply",value:function(e,t,n,r,i){var o=this.document,a=this.blurRadius,s=o.window?o.window.document.body:null,u=e.canvas;u.id=o.getUniqueId(),s&&(u.style.display="none",s.appendChild(u)),NNe(u,t,n,r,i,a),s&&s.removeChild(u)}}]),n}(xDe),NFe=function(e){c(n,e);var t=b(n);function n(){var e;return s(this,n),(e=t.apply(this,arguments)).type="title",e}return l(n)}(xDe),DFe=function(e){c(n,e);var t=b(n);function n(){var e;return s(this,n),(e=t.apply(this,arguments)).type="desc",e}return l(n)}(xDe),FFe={svg:ODe,rect:HDe,circle:KDe,ellipse:jDe,line:GDe,polyline:qDe,polygon:VDe,path:UDe,pattern:zDe,marker:JDe,defs:YDe,linearGradient:ZDe,radialGradient:$De,stop:eFe,animate:tFe,animateColor:nFe,animateTransform:rFe,font:iFe,"font-face":oFe,"missing-glyph":aFe,glyph:LDe,text:MDe,tspan:TDe,tref:sFe,a:uFe,textPath:cFe,image:fFe,g:XDe,symbol:dFe,style:gFe,use:vFe,mask:BFe,clipPath:CFe,filter:xFe,feDropShadow:kFe,feMorphology:SFe,feComposite:QFe,feColorMatrix:IFe,feGaussianBlur:_Fe,title:NFe,desc:DFe};function PFe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function UFe(){return UFe=REe(r().mark((function e(t){var n,i,o=arguments;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=o.length>1&&void 0!==o[1]&&o[1],i=document.createElement("img"),n&&(i.crossOrigin="Anonymous"),e.abrupt("return",new Promise((function(e,n){i.onload=function(){e(i)},i.onerror=function(e,t,r,i,o){n(o)},i.src=t})));case 4:case"end":return e.stop()}}),e)}))),UFe.apply(this,arguments)}var LFe=function(){function e(t){s(this,e);var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.rootEmSize,i=void 0===r?12:r,o=n.emSize,a=void 0===o?12:o,u=n.createCanvas,l=void 0===u?e.createCanvas:u,A=n.createImage,c=void 0===A?e.createImage:A,h=n.anonymousCrossOrigin;this.canvg=t,this.definitions={},this.styles={},this.stylesSpecificity={},this.images=[],this.fonts=[],this.emSizeStack=[],this.uniqueId=0,this.screen=t.screen,this.rootEmSize=i,this.emSize=a,this.createCanvas=l,this.createImage=this.bindCreateImage(c,h),this.screen.wait(this.isImagesLoaded.bind(this)),this.screen.wait(this.isFontsLoaded.bind(this))}return l(e,[{key:"bindCreateImage",value:function(e,t){return"boolean"==typeof t?function(n,r){return e(n,"boolean"==typeof r?r:t)}:e}},{key:"window",get:function(){return this.screen.window}},{key:"fetch",get:function(){return this.screen.fetch}},{key:"ctx",get:function(){return this.screen.ctx}},{key:"emSize",get:function(){var e=this.emSizeStack;return e[e.length-1]},set:function(e){this.emSizeStack.push(e)}},{key:"popEmSize",value:function(){this.emSizeStack.pop()}},{key:"getUniqueId",value:function(){return"canvg".concat(++this.uniqueId)}},{key:"isImagesLoaded",value:function(){return this.images.every((function(e){return e.loaded}))}},{key:"isFontsLoaded",value:function(){return this.fonts.every((function(e){return e.loaded}))}},{key:"createDocumentElement",value:function(e){var t=this.createElement(e.documentElement);return t.root=!0,t.addStylesFromStyleDefinition(),this.documentElement=t,t}},{key:"createElement",value:function(t){var n=t.nodeName.replace(/^[^:]+:/,""),r=e.elementTypes[n];return void 0!==r?new r(this,t):new kDe(this,t)}},{key:"createTextNode",value:function(e){return new RDe(this,e)}},{key:"setViewBox",value:function(e){this.screen.setViewBox(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?PFe(Object(n),!0).forEach((function(t){eQe(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):PFe(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({document:this},e))}}]),e}();function MFe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function TFe(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?MFe(Object(n),!0).forEach((function(t){eQe(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):MFe(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}LFe.createCanvas=function(e,t){var n=document.createElement("canvas");return n.width=e,n.height=t,n},LFe.createImage=function(e){return UFe.apply(this,arguments)},LFe.elementTypes=FFe;var RFe=function(){function e(t,n){s(this,e);var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.parser=new vDe(r),this.screen=new dDe(t,r),this.options=r;var i=new LFe(this,r),o=i.createDocumentElement(n);this.document=i,this.documentElement=o}return l(e,[{key:"fork",value:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return e.from(t,n,TFe(TFe({},this.options),r))}},{key:"forkString",value:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return e.fromString(t,n,TFe(TFe({},this.options),r))}},{key:"ready",value:function(){return this.screen.ready()}},{key:"isReady",value:function(){return this.screen.isReady()}},{key:"render",value:function(){var e=arguments,t=this;return REe(r().mark((function n(){var i;return r().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return i=e.length>0&&void 0!==e[0]?e[0]:{},t.start(TFe({enableRedraw:!0,ignoreAnimation:!0,ignoreMouse:!0},i)),n.next=4,t.ready();case 4:t.stop();case 5:case"end":return n.stop()}}),n)})))()}},{key:"start",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.documentElement,n=this.screen,r=this.options;n.start(t,TFe(TFe({enableRedraw:!0},r),e))}},{key:"stop",value:function(){this.screen.stop()}},{key:"resize",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.documentElement.resize(e,t,n)}}],[{key:"from",value:function(t,n){var i=arguments;return REe(r().mark((function o(){var a,s,u;return r().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return a=i.length>2&&void 0!==i[2]?i[2]:{},s=new vDe(a),r.next=4,s.parse(n);case 4:return u=r.sent,r.abrupt("return",new e(t,u,a));case 6:case"end":return r.stop()}}),o)})))()}},{key:"fromString",value:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=new vDe(r),o=i.parseFromString(n);return new e(t,o,r)}}]),e}(),OFe=Object.freeze({__proto__:null,AElement:uFe,AnimateColorElement:nFe,AnimateElement:tFe,AnimateTransformElement:rFe,BoundingBox:DDe,CB1:tDe,CB2:nDe,CB3:rDe,CB4:iDe,Canvg:RFe,CircleElement:KDe,ClipPathElement:CFe,DefsElement:YDe,DescElement:DFe,Document:LFe,Element:xDe,EllipseElement:jDe,FeColorMatrixElement:IFe,FeCompositeElement:QFe,FeDropShadowElement:kFe,FeGaussianBlurElement:_Fe,FeMorphologyElement:SFe,FilterElement:xFe,Font:NDe,FontElement:iFe,FontFaceElement:oFe,GElement:XDe,GlyphElement:LDe,GradientElement:WDe,ImageElement:fFe,LineElement:GDe,LinearGradientElement:ZDe,MarkerElement:JDe,MaskElement:BFe,Matrix:bDe,MissingGlyphElement:aFe,Mouse:cDe,PSEUDO_ZERO:WNe,Parser:vDe,PathElement:UDe,PathParser:FDe,PatternElement:zDe,Point:ADe,PolygonElement:VDe,PolylineElement:qDe,Property:uDe,QB1:oDe,QB2:aDe,QB3:sDe,RadialGradientElement:$De,RectElement:HDe,RenderedElement:PDe,Rotate:mDe,SVGElement:ODe,SVGFontLoader:pFe,Scale:wDe,Screen:dDe,Skew:IDe,SkewX:BDe,SkewY:EDe,StopElement:eFe,StyleElement:gFe,SymbolElement:dFe,TRefElement:sFe,TSpanElement:TDe,TextElement:MDe,TextPathElement:cFe,TitleElement:NFe,Transform:CDe,Translate:yDe,UnknownElement:kDe,UseElement:vFe,ViewPort:lDe,compressSpaces:PNe,default:RFe,getSelectorSpecificity:XNe,normalizeAttributeName:RNe,normalizeColor:HNe,parseExternalUrl:ONe,presets:FNe,toNumbers:MNe,trimLeft:UNe,trimRight:LNe,vectorMagnitude:ZNe,vectorsAngle:eDe,vectorsRatio:$Ne})}();