`+e+``);let i=T?j(e):e;if(Fe===Pe)try{t=new l().parseFromString(i,We)}catch{}if(!t||!t.documentElement){t=F.createDocument(Fe,`template`,null);try{t.documentElement.innerHTML=Ie?E:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),Fe===Pe?R.call(t,fe?`html`:`body`)[0]:fe?t.documentElement:a},ft=function(e){let t=S?S(e):e.ownerDocument;return I.call(t||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},pt=function(e){return e=Pu(e,V,` `),e=Pu(e,H,` `),e=Pu(e,ee,` `),e},mt=function(e){e.normalize();let t=S?S(e):e.ownerDocument,n=I.call(t||e,e,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null),r=n.nextNode();for(;r;)r.data=pt(r.data),r=n.nextNode();let i=e.querySelectorAll?.call(e,`template`);i&&Tu(i,e=>{gt(e.content)&&mt(e.content)})},ht=function(e){let t=x?x(e):null;return typeof t!=`string`||Ke(t)!==`form`?!1:typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||e.attributes!==y(e)||typeof e.removeAttribute!=`function`||typeof e.removeAttributeNode!=`function`||typeof e.getAttributeNode!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`||e.nodeType!==b(e)||e.childNodes!==g(e)},gt=function(e){if(!b||typeof e!=`object`||!e)return!1;try{return b(e)===gd.documentFragment}catch{return!1}},_t=function(e){if(!b||typeof e!=`object`||!e)return!1;try{return typeof b(e)==`number`}catch{return!1}};function vt(e,n,r){e.length!==0&&Tu(e,e=>{e.call(t,n,r,qe)})}let yt=function(e,t){return!!(de&&e.hasChildNodes()&&!_t(e.firstElementChild)&&Uu(fd,e.textContent)&&Uu(fd,e.innerHTML)||de&&e.namespaceURI===Pe&&vd[t]&&(_t(e.firstElementChild)||typeof e.textContent==`string`&&Uu(yd[t],e.textContent))||e.nodeType===gd.processingInstruction||de&&e.nodeType===gd.comment&&Uu(pd,e.data))},bt=function(e,t){return e instanceof RegExp?Uu(e,t):e instanceof Function&&!!e(t,...[...arguments].slice(2))},xt=function(e,t,n){if(!oe[t]&&Dt(t)&&bt(ae.tagNameCheck,t))return!1;if(Ce&&!Ee[t]){let t=_(e),r=g(e);if(r&&t){let i=r.length;for(let a=i-1;a>=0;--a){let i=e===n?f(r[a],!0):r[a];t.insertBefore(i,h(e))}}}return rt(e),!0},St=function(e,t,n,r){return e.length===0?t:t===n||t===r?lu(t):t},Ct=function(e,t){return e===t||_(e)!==null?!1:(we&&ct(e),!0)},wt=function(e,n){if(vt(B.beforeSanitizeElements,e,null),Ct(e,n))return!0;if(ht(e))return rt(e),!0;let r=Ke(w(e));if(K=St(B.uponSanitizeElement,K,q,me),vt(B.uponSanitizeElement,e,{tagName:r,allowedTags:K}),Ct(e,n))return!0;if(yt(e,r))return rt(e),!0;if(oe[r]||!(X.tagCheck instanceof Function&&X.tagCheck(r))&&!K[r]){let t=xt(e,r,n);return t===!1&&vt(B.afterSanitizeElements,e,null),t}if(C(e)===gd.element&&!nt(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&Uu(md,e.innerHTML))return rt(e),!0;if(ue&&e.nodeType===gd.text){let n=pt(e.textContent);e.textContent!==n&&(Ou(t.removed,{element:e.cloneNode()}),e.textContent=n)}return vt(B.afterSanitizeElements,e,null),!1},Tt=function(e,t,r){if(Y[t]||lt(t,e)||be&&(t===`id`||t===`name`)&&(r in n||r in Je))return!1;let i=J[t]||X.attributeCheck instanceof Function&&X.attributeCheck(t,e);return ce&&Uu(U,t)||se&&Uu(W,t)?!0:i?Ae[t]||Uu(re,Pu(r,G,``))||(t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&Fu(r,`data:`)===0&&Oe[e]||Z&&!Uu(te,Pu(r,G,``))?!0:!r:Dt(e)&&bt(ae.tagNameCheck,e)&&bt(ae.attributeNameCheck,t,e)||t===`is`&&ae.allowCustomizedBuiltInElements&&bt(ae.tagNameCheck,r)},Et=su({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),Dt=function(e){return!Et[ju(e)]&&Uu(ne,e)},Ot=function(e,t,n,r){if(T&&typeof u==`object`&&typeof u.getAttributeType==`function`&&!n)switch(u.getAttributeType(e,t)){case`TrustedHTML`:return j(r);case`TrustedScriptURL`:return M(r)}return r},kt=function(e,t,n,r){try{return n?e.setAttributeNS(n,t,r):e.setAttribute(t,r),!ht(e)||(rt(e),!1)}catch{return ot(t,e),!1}},At=function(e){vt(B.beforeSanitizeAttributes,e,null);let n=e.attributes;if(!n||ht(e))return;J=St(B.uponSanitizeAttribute,J,ie,he);let r={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:J,forceKeepAttr:void 0},i=n.length,a=Ke(e.nodeName);for(;i--;){let o=n[i],s=o.name,c=o.namespaceURI,l=o.value,u=Ke(s),d=l,f=s===`value`?d:Iu(d),p=!1;if(r.attrName=u,r.attrValue=f,r.keepAttr=!0,r.forceKeepAttr=void 0,vt(B.uponSanitizeAttribute,e,r),f=r.attrValue,xe&&(u===`id`||u===`name`)&&Fu(f,Se)!==0&&(ot(s,e,o),f=Se+f,p=!0),de&&Uu(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,f)){ot(s,e,o);continue}if(u===`attributename`&&Nu(f,`href`)){ot(s,e,o);continue}if(!r.forceKeepAttr){if(!r.keepAttr){ot(s,e,o);continue}if(!le&&Uu(hd,f)){ot(s,e,o);continue}if(ue&&(f=pt(f)),!Tt(a,u,f)){ot(s,e,o);continue}f=Ot(a,u,c,f),f!==d&&kt(e,s,c,f)&&p&&Du(t.removed)}}vt(B.afterSanitizeAttributes,e,null)},jt=function(e){let t=null,n=ft(e);for(vt(B.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if(vt(B.uponSanitizeShadowNode,t,null),wt(t,e),At(t),gt(t.content)&&jt(t.content),C(t)===gd.element){let e=v(t);gt(e)&&(Mt(e),jt(e))}vt(B.afterSanitizeShadowDOM,e,null)},Mt=function(e){let t=[{node:e,shadow:null}];for(;t.length>0;){let e=t.pop();if(e.shadow){jt(e.shadow);continue}let n=e.node,r=C(n)===gd.element,i=g(n);if(i)for(let e=i.length-1;e>=0;--e)t.push({node:i[e],shadow:null});if(r){let e=x?x(n):null;if(typeof e==`string`&&Ke(e)===`template`){let e=n.content;gt(e)&&t.push({node:e,shadow:null})}}if(r){let e=v(n);gt(e)&&t.push({node:null,shadow:e},{node:e,shadow:null})}}};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,a=null,o=null,s=null;if(Ie=!e,Ie&&(e=`\x3C!-->`),typeof e!=`string`&&!_t(e)&&(e=uu(e),typeof e!=`string`))throw Wu(`dirty is not a string, aborting`);if(!t.isSupported)return e;pe?(K=me,J=he):Xe(n),(B.uponSanitizeElement.length>0||B.uponSanitizeAttribute.length>0)&&(K=lu(K)),B.uponSanitizeAttribute.length>0&&(J=lu(J)),t.removed=[];let c=we&&typeof e!=`string`&&_t(e);if(c){ut(e);let t=w(e);if(typeof t==`string`){let n=Ke(t);if(!K[n]||oe[n])throw at(e),Wu(`root node is forbidden and cannot be sanitized in-place`)}if(ht(e))throw at(e),Wu(`root node is clobbered and cannot be sanitized in-place`);try{Mt(e)}catch(t){throw at(e),t}}else if(_t(e))i=dt(`\x3C!---->`),a=i.ownerDocument.importNode(e,!0),a.nodeType===gd.element&&a.nodeName===`BODY`||a.nodeName===`HTML`?i=a:i.appendChild(a),Mt(i);else{if(!_e&&!ue&&!fe&&e.indexOf(`<`)===-1)return T&&ye?j(e):e;if(i=dt(e),!i)return _e?null:ye?E:``}i&&ge&&rt(i.firstChild);let l=c?e:i;try{let e=ft(l);for(;o=e.nextNode();)wt(o,l),At(o),gt(o.content)&&jt(o.content)}catch(n){throw c&&(at(e),Tu(t.removed,e=>{e.element&&ct(e.element)})),n}if(c)return Tu(t.removed,e=>{e.element&&ct(e.element)}),ue&&mt(e),e;if(_e){if(ue&&mt(i),ve)for(s=L.call(i.ownerDocument);i.firstChild;)s.appendChild(i.firstChild);else s=i;return(J.shadowroot||J.shadowrootmode)&&(s=z.call(r,s,!0)),s}let u=fe?i.outerHTML:i.innerHTML;return fe&&K[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&Uu(ud,i.ownerDocument.doctype.name)&&(u=` `+u),ue&&(u=pt(u)),T&&ye?j(u):u},t.setConfig=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Xe(e),pe=!0,me=K,he=J},t.clearConfig=function(){qe=null,pe=!1,me=null,he=null,T=D,E=``},t.isValidAttribute=function(e,t,n){qe||Xe({});let r=Ke(e),i=Ke(t);return Tt(r,i,n)},t.addHook=function(e,t){typeof t==`function`&&Vu(B,e)&&Ou(B[e],t)},t.removeHook=function(e,t){if(Vu(B,e)){if(t!==void 0){let n=Eu(B[e],t);return n===-1?void 0:ku(B[e],n,1)[0]}return Du(B[e])}},t.removeHooks=function(e){Vu(B,e)&&(B[e]=[])},t.removeAllHooks=function(){B=Sd()},t}var mu,hu,gu,_u,vu,yu,bu,xu,Su,Cu,wu,Tu,Eu,Du,Ou,ku,Au,ju,Mu,Nu,Pu,Fu,Iu,Lu,Ru,zu,Bu,Vu,Hu,Uu,Wu,Gu,Ku,qu,Ju,Yu,Xu,Zu,Qu,$u,ed,td,nd,rd,id,ad,od,sd,cd,ld,ud,dd,fd,pd,md,hd,gd,_d,vd,yd,bd,xd,Sd,Cd,wd,Td,Ed=o((()=>{mu=Object.entries,hu=Object.setPrototypeOf,gu=Object.isFrozen,_u=Object.getPrototypeOf,vu=Object.getOwnPropertyDescriptor,yu=Object.freeze,bu=Object.seal,xu=Object.create,Su=typeof Reflect<`u`&&Reflect,Cu=Su.apply,wu=Su.construct,yu||(yu=function(e){return e}),bu||(bu=function(e){return e}),Cu||(Cu=function(e,t){var n=[...arguments].slice(2);return e.apply(t,n)}),wu||(wu=function(e){return new e(...[...arguments].slice(1))}),Tu=au(Array.prototype.forEach),Eu=au(Array.prototype.lastIndexOf),Du=au(Array.prototype.pop),Ou=au(Array.prototype.push),ku=au(Array.prototype.splice),Au=Array.isArray,ju=au(String.prototype.toLowerCase),Mu=au(String.prototype.toString),Nu=au(String.prototype.match),Pu=au(String.prototype.replace),Fu=au(String.prototype.indexOf),Iu=au(String.prototype.trim),Lu=au(Number.prototype.toString),Ru=au(Boolean.prototype.toString),zu=typeof BigInt>`u`?null:au(BigInt.prototype.toString),Bu=typeof Symbol>`u`?null:au(Symbol.prototype.toString),Vu=au(Object.prototype.hasOwnProperty),Hu=au(Object.prototype.toString),Uu=au(RegExp.prototype.test),Wu=ou(TypeError),Gu=yu(`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.search.section.select.shadow.slot.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`.split(`.`)),Ku=yu(`svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern`.split(`.`)),qu=yu([`feBlend`,`feColorMatrix`,`feComponentTransfer`,`feComposite`,`feConvolveMatrix`,`feDiffuseLighting`,`feDisplacementMap`,`feDistantLight`,`feDropShadow`,`feFlood`,`feFuncA`,`feFuncB`,`feFuncG`,`feFuncR`,`feGaussianBlur`,`feImage`,`feMerge`,`feMergeNode`,`feMorphology`,`feOffset`,`fePointLight`,`feSpecularLighting`,`feSpotLight`,`feTile`,`feTurbulence`]),Ju=yu([`animate`,`color-profile`,`cursor`,`discard`,`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`]),Yu=yu(`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.mprescripts`.split(`.`)),Xu=yu([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),Zu=yu([`#text`]),Qu=yu(`accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.command.commandfor.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.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.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns`.split(`.`)),$u=yu(`accent-height.accumulate.additive.alignment-baseline.amplitude.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.dominant-baseline.dur.edgemode.elevation.end.exponent.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.intercept.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.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.pointer-events.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.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.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-orientation.text-rendering.textlength.type.u1.u2.unicode.values.vector-effect.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`.split(`.`)),ed=yu(`accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.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`.split(`.`)),td=yu([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),nd=bu(/{{[\w\W]*|^[\w\W]*}}/g),rd=bu(/<%[\w\W]*|^[\w\W]*%>/g),id=bu(/\${[\w\W]*/g),ad=bu(/^data-[\-\w.\u00B7-\uFFFF]+$/),od=bu(/^aria-[\-\w]+$/),sd=bu(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),cd=bu(/^(?:\w+script|data):/i),ld=bu(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),ud=bu(/^html$/i),dd=bu(/^[a-z][.\w]*(-[.\w]+)+$/i),fd=bu(/<[/\w!]/g),pd=bu(/<[/\w]/g),md=bu(/<\/no(script|embed|frames)/i),hd=bu(/\/>/i),gd={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},_d=[`style`,`script`,`xmp`,`iframe`,`noembed`,`noframes`,`plaintext`,`noscript`],vd=yu(su({},_d)),yd=function(){let e={};return Tu(_d,t=>{e[t]=bu(RegExp(`])`,`i`))}),yu(e)}(),bd=function(){return typeof window>`u`?null:window},xd=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},Sd=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Cd=function(e,t,n,r){return Vu(e,t)&&Au(e[t])?su(r.base?lu(r.base):{},e[t],r.transform):n},wd=function(e,t,n){let r=Vu(e,t)?e[t]:void 0;return r&&typeof r==`object`?lu(r):n()},Td=pu()})),Dd=s(((e,t)=>{var n=function(e){return e&&e.Math===Math&&e};t.exports=n(typeof globalThis==`object`&&globalThis)||n(typeof window==`object`&&window)||n(typeof self==`object`&&self)||n(typeof global==`object`&&global)||n(typeof e==`object`&&e)||(function(){return this})()||Function(`return this`)()})),Od=s(((e,t)=>{t.exports=function(e){try{return!!e()}catch{return!0}}})),kd=s(((e,t)=>{t.exports=!Od()(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7})})),Ad=s(((e,t)=>{t.exports=!Od()(function(){var e=function(){}.bind();return typeof e!=`function`||e.hasOwnProperty(`prototype`)})})),jd=s(((e,t)=>{var n=Ad(),r=Function.prototype.call;t.exports=n?r.bind(r):function(){return r.apply(r,arguments)}})),Md=s((e=>{var t={}.propertyIsEnumerable,n=Object.getOwnPropertyDescriptor;e.f=n&&!t.call({1:2},1)?function(e){var t=n(this,e);return!!t&&t.enumerable}:t})),Nd=s(((e,t)=>{t.exports=function(e,t){return{enumerable:!(e&1),configurable:!(e&2),writable:!(e&4),value:t}}})),Pd=s(((e,t)=>{var n=Ad(),r=Function.prototype,i=r.call,a=n&&r.bind.bind(i,i);t.exports=n?a:function(e){return function(){return i.apply(e,arguments)}}})),Fd=s(((e,t)=>{var n=Pd(),r=n({}.toString),i=n(``.slice);t.exports=function(e){return i(r(e),8,-1)}})),Id=s(((e,t)=>{var n=Pd(),r=Od(),i=Fd(),a=Object,o=n(``.split);t.exports=r(function(){return!a(`z`).propertyIsEnumerable(0)})?function(e){return i(e)===`String`?o(e,``):a(e)}:a})),Ld=s(((e,t)=>{t.exports=function(e){return e==null}})),Rd=s(((e,t)=>{var n=Ld(),r=TypeError;t.exports=function(e){if(n(e))throw new r(`Can't call method on `+e);return e}})),zd=s(((e,t)=>{var n=Id(),r=Rd();t.exports=function(e){return n(r(e))}})),Bd=s(((e,t)=>{var n=typeof document==`object`&&document.all;t.exports=n===void 0&&n!==void 0?function(e){return typeof e==`function`||e===n}:function(e){return typeof e==`function`}})),Vd=s(((e,t)=>{var n=Bd();t.exports=function(e){return typeof e==`object`?e!==null:n(e)}})),Hd=s(((e,t)=>{var n=Dd(),r=Bd(),i=function(e){return r(e)?e:void 0};t.exports=function(e,t){return arguments.length<2?i(n[e]):n[e]&&n[e][t]}})),Ud=s(((e,t)=>{t.exports=Pd()({}.isPrototypeOf)})),Wd=s(((e,t)=>{var n=Dd().navigator,r=n&&n.userAgent;t.exports=r?String(r):``})),Gd=s(((e,t)=>{var n=Dd(),r=Wd(),i=n.process,a=n.Deno,o=i&&i.versions||a&&a.version,s=o&&o.v8,c,l;s&&(c=s.split(`.`),l=c[0]>0&&c[0]<4?1:+(c[0]+c[1])),!l&&r&&(c=r.match(/Edge\/(\d+)/),(!c||c[1]>=74)&&(c=r.match(/Chrome\/(\d+)/),c&&(l=+c[1]))),t.exports=l})),Kd=s(((e,t)=>{var n=Gd(),r=Od(),i=Dd().String;t.exports=!!Object.getOwnPropertySymbols&&!r(function(){var e=Symbol(`symbol detection`);return!i(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&n&&n<41})})),qd=s(((e,t)=>{t.exports=Kd()&&!Symbol.sham&&typeof Symbol.iterator==`symbol`})),Jd=s(((e,t)=>{var n=Hd(),r=Bd(),i=Ud(),a=qd(),o=Object;t.exports=a?function(e){return typeof e==`symbol`}:function(e){var t=n(`Symbol`);return r(t)&&i(t.prototype,o(e))}})),Yd=s(((e,t)=>{var n=String;t.exports=function(e){try{return n(e)}catch{return`Object`}}})),Xd=s(((e,t)=>{var n=Bd(),r=Yd(),i=TypeError;t.exports=function(e){if(n(e))return e;throw new i(r(e)+` is not a function`)}})),Zd=s(((e,t)=>{var n=Xd(),r=Ld();t.exports=function(e,t){var i=e[t];return r(i)?void 0:n(i)}})),Qd=s(((e,t)=>{var n=jd(),r=Bd(),i=Vd(),a=TypeError;t.exports=function(e,t){var o,s;if(t===`string`&&r(o=e.toString)&&!i(s=n(o,e))||r(o=e.valueOf)&&!i(s=n(o,e))||t!==`string`&&r(o=e.toString)&&!i(s=n(o,e)))return s;throw new a(`Can't convert object to primitive value`)}})),$d=s(((e,t)=>{t.exports=!1})),ef=s(((e,t)=>{var n=Dd(),r=Object.defineProperty;t.exports=function(e,t){try{r(n,e,{value:t,configurable:!0,writable:!0})}catch{n[e]=t}return t}})),tf=s(((e,t)=>{var n=$d(),r=Dd(),i=ef(),a=`__core-js_shared__`,o=t.exports=r[a]||i(a,{});(o.versions||(o.versions=[])).push({version:`3.50.0`,mode:n?`pure`:`global`,copyright:`© 2013–2025 Denis Pushkarev (zloirock.ru), 2025–2026 CoreJS Company (core-js.io). All rights reserved.`,license:`https://github.com/zloirock/core-js/blob/v3.50.0/LICENSE`,source:`https://github.com/zloirock/core-js`})})),nf=s(((e,t)=>{var n=tf(),r=Object.create||Object;t.exports=function(e,t){return n[e]||(n[e]=t||r(null))}})),rf=s(((e,t)=>{var n=Rd(),r=Object;t.exports=function(e){return r(n(e))}})),af=s(((e,t)=>{var n=Pd(),r=rf(),i=n({}.hasOwnProperty);t.exports=Object.hasOwn||function(e,t){return i(r(e),t)}})),of=s(((e,t)=>{var n=Pd(),r=0,i=Math.random(),a=n(1.1.toString);t.exports=function(e){return`Symbol(`+(e===void 0?``:e)+`)_`+a(++r+i,36)}})),sf=s(((e,t)=>{var n=Dd(),r=nf(),i=af(),a=of(),o=Kd(),s=qd(),c=n.Symbol,l=r(`wks`),u=s?c.for||c:c&&c.withoutSetter||a;t.exports=function(e){return i(l,e)||(l[e]=o&&i(c,e)?c[e]:u(`Symbol.`+e)),l[e]}})),cf=s(((e,t)=>{var n=jd(),r=Vd(),i=Jd(),a=Zd(),o=Qd(),s=sf(),c=TypeError,l=s(`toPrimitive`);t.exports=function(e,t){if(!r(e)||i(e))return e;var s=a(e,l),u;if(s){if(t===void 0&&(t=`default`),u=n(s,e,t),!r(u)||i(u))return u;throw new c(`Can't convert object to primitive value`)}return t===void 0&&(t=`number`),o(e,t)}})),lf=s(((e,t)=>{var n=cf(),r=Jd();t.exports=function(e){var t=n(e,`string`);return r(t)?t:t+``}})),uf=s(((e,t)=>{var n=Dd(),r=Vd(),i=n.document,a=r(i)&&r(i.createElement);t.exports=function(e){return a?i.createElement(e):{}}})),df=s(((e,t)=>{var n=kd(),r=Od(),i=uf();t.exports=!n&&!r(function(){return Object.defineProperty(i(`div`),"a",{get:function(){return 7}}).a!==7})})),ff=s((e=>{var t=kd(),n=jd(),r=Md(),i=Nd(),a=zd(),o=lf(),s=af(),c=df(),l=Object.getOwnPropertyDescriptor;e.f=t?l:function(e,t){if(e=a(e),t=o(t),c)try{return l(e,t)}catch{}if(s(e,t))return i(!n(r.f,e,t),e[t])}})),pf=s(((e,t)=>{var n=kd(),r=Od();t.exports=n&&r(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42})})),mf=s(((e,t)=>{var n=Vd(),r=String,i=TypeError;t.exports=function(e){if(n(e))return e;throw new i(r(e)+` is not an object`)}})),hf=s((e=>{var t=kd(),n=df(),r=pf(),i=mf(),a=lf(),o=TypeError,s=Object.defineProperty,c=Object.getOwnPropertyDescriptor,l=`enumerable`,u=`configurable`,d=`writable`;e.f=t?r?function(e,t,n){if(i(e),t=a(t),i(n),typeof e==`function`&&t===`prototype`&&`value`in n&&d in n&&!n[d]){var r=c(e,t);r&&r[d]&&(e[t]=n.value,n={configurable:u in n?n[u]:r[u],enumerable:l in n?n[l]:r[l],writable:!1})}return s(e,t,n)}:s:function(e,t,r){if(i(e),t=a(t),i(r),n)try{return s(e,t,r)}catch{}if(`get`in r||`set`in r)throw new o(`Accessors not supported`);return`value`in r&&(e[t]=r.value),e}})),gf=s(((e,t)=>{var n=kd(),r=hf(),i=Nd();t.exports=n?function(e,t,n){return r.f(e,t,i(1,n))}:function(e,t,n){return e[t]=n,e}})),_f=s(((e,t)=>{var n=kd(),r=af(),i=Function.prototype,a=n&&Object.getOwnPropertyDescriptor,o=r(i,`name`);t.exports={EXISTS:o,PROPER:o&&function(){}.name===`something`,CONFIGURABLE:o&&(!n||n&&a(i,`name`).configurable)}})),vf=s(((e,t)=>{var n=Pd(),r=Bd(),i=tf(),a=n(Function.toString);r(i.inspectSource)||(i.inspectSource=function(e){return a(e)}),t.exports=i.inspectSource})),yf=s(((e,t)=>{var n=Dd(),r=Bd(),i=n.WeakMap;t.exports=r(i)&&/native code/.test(String(i))})),bf=s(((e,t)=>{var n=nf(),r=of(),i=n(`keys`);t.exports=function(e){return i[e]||(i[e]=r(e))}})),xf=s(((e,t)=>{t.exports={}})),Sf=s(((e,t)=>{var n=yf(),r=Dd(),i=Vd(),a=gf(),o=af(),s=tf(),c=bf(),l=xf(),u=`Object already initialized`,d=r.TypeError,f=r.WeakMap,p,m,h,g=function(e){return h(e)?m(e):p(e,{})},_=function(e){return function(t){var n;if(!i(t)||(n=m(t)).type!==e)throw new d(`Incompatible receiver, `+e+` required`);return n}};if(n||s.state){var v=s.state||(s.state=new f);v.get=v.get,v.has=v.has,v.set=v.set,p=function(e,t){if(v.has(e))throw new d(u);return t.facade=e,v.set(e,t),t},m=function(e){return v.get(e)||{}},h=function(e){return v.has(e)}}else{var y=c(`state`);l[y]=!0,p=function(e,t){if(o(e,y))throw new d(u);return t.facade=e,a(e,y,t),t},m=function(e){return o(e,y)?e[y]:{}},h=function(e){return o(e,y)}}t.exports={set:p,get:m,has:h,enforce:g,getterFor:_}})),Cf=s(((e,t)=>{var n=Pd(),r=Od(),i=Bd(),a=af(),o=kd(),s=_f().CONFIGURABLE,c=vf(),l=Sf(),u=l.enforce,d=l.get,f=String,p=Object.defineProperty,m=n(``.slice),h=n(``.replace),g=n([].join),_=o&&!r(function(){return p(function(){},`length`,{value:8}).length!==8}),v=String(String).split(`String`),y=t.exports=function(e,t,n){m(f(t),0,7)===`Symbol(`&&(t=`[`+h(f(t),/^Symbol\(([^)]*)\).*$/,`$1`)+`]`),n&&n.getter&&(t=`get `+t),n&&n.setter&&(t=`set `+t),(!a(e,`name`)||s&&e.name!==t)&&(o?p(e,`name`,{value:t,configurable:!0}):e.name=t),_&&n&&a(n,`arity`)&&e.length!==n.arity&&p(e,`length`,{value:n.arity});try{n&&a(n,`constructor`)&&n.constructor?o&&p(e,`prototype`,{writable:!1}):e.prototype&&(e.prototype=void 0)}catch{}var r=u(e);return a(r,`source`)||(r.source=g(v,typeof t==`string`?t:``)),e};Function.prototype.toString=y(function(){return i(this)&&d(this).source||c(this)},`toString`)})),wf=s(((e,t)=>{var n=Bd(),r=hf(),i=Cf(),a=ef();t.exports=function(e,t,o,s){s||(s={});var c=s.enumerable,l=s.name===void 0?t:s.name;if(n(o)&&i(o,l,s),s.global)c?e[t]=o:a(t,o);else{try{s.unsafe?e[t]&&(c=!0):delete e[t]}catch{}c?e[t]=o:r.f(e,t,{value:o,enumerable:!1,configurable:!s.nonConfigurable,writable:!s.nonWritable})}return e}})),Tf=s(((e,t)=>{var n=Math.ceil,r=Math.floor;t.exports=Math.trunc||function(e){var t=+e;return(t>0?r:n)(t)}})),Ef=s(((e,t)=>{var n=Tf();t.exports=function(e){var t=+e;return t!==t||t===0?0:n(t)}})),Df=s(((e,t)=>{var n=Ef(),r=Math.max,i=Math.min;t.exports=function(e,t){var a=n(e);return a<0?r(a+t,0):i(a,t)}})),Of=s(((e,t)=>{var n=Ef(),r=Math.min;t.exports=function(e){var t=n(e);return t>0?r(t,9007199254740991):0}})),kf=s(((e,t)=>{var n=Of();t.exports=function(e){return n(e.length)}})),Af=s(((e,t)=>{var n=zd(),r=Df(),i=kf(),a=function(e){return function(t,a,o){var s=n(t),c=i(s);if(c===0)return!e&&-1;var l=r(o,c),u;if(e&&a!==a){for(;c>l;)if(u=s[l++],u!==u)return!0}else for(;c>l;l++)if((e||l in s)&&s[l]===a)return e||l||0;return!e&&-1}};t.exports={includes:a(!0),indexOf:a(!1)}})),jf=s(((e,t)=>{var n=Pd(),r=af(),i=zd(),a=Af().indexOf,o=xf(),s=n([].push);t.exports=function(e,t){var n=i(e),c=0,l=[],u;for(u in n)!r(o,u)&&r(n,u)&&s(l,u);for(;t.length>c;)r(n,u=t[c++])&&(~a(l,u)||s(l,u));return l}})),Mf=s(((e,t)=>{t.exports=[`constructor`,`hasOwnProperty`,`isPrototypeOf`,`propertyIsEnumerable`,`toLocaleString`,`toString`,`valueOf`]})),Nf=s((e=>{var t=jf(),n=Mf().concat(`length`,`prototype`);e.f=Object.getOwnPropertyNames||function(e){return t(e,n)}})),Pf=s((e=>{e.f=Object.getOwnPropertySymbols})),Ff=s(((e,t)=>{var n=Hd(),r=Pd(),i=Nf(),a=Pf(),o=mf(),s=r([].concat);t.exports=n(`Reflect`,`ownKeys`)||function(e){var t=i.f(o(e)),n=a.f;return n?s(t,n(e)):t}})),If=s(((e,t)=>{var n=af(),r=Ff(),i=ff(),a=hf();t.exports=function(e,t,o){for(var s=r(t),c=a.f,l=i.f,u=0;u{var n=Od(),r=Bd(),i=/#|\.prototype\./,a=function(e,t){var i=s[o(e)];return i===l?!0:i===c?!1:r(t)?n(t):!!t},o=a.normalize=function(e){return String(e).replace(i,`.`).toLowerCase()},s=a.data={},c=a.NATIVE=`N`,l=a.POLYFILL=`P`;t.exports=a})),Rf=s(((e,t)=>{var n=Dd(),r=ff().f,i=gf(),a=wf(),o=ef(),s=If(),c=Lf();t.exports=function(e,t){var l=e.target,u=e.global,d=e.stat,f,p=u?n:d?n[l]||o(l,{}):n[l]&&n[l].prototype,m,h,g,_;if(p)for(m in t){if(g=t[m],e.dontCallGetSet?(_=r(p,m),h=_&&_.value):h=p[m],f=c(u?m:l+(d?`.`:`#`)+m,e.forced),!f&&h!==void 0){if(typeof g==typeof h)continue;s(g,h)}(e.sham||h&&h.sham)&&i(g,`sham`,!0),a(p,m,g,e)}}})),zf=s(((e,t)=>{var n=Dd(),r=Wd(),i=Fd(),a=function(e){return r.slice(0,e.length)===e};t.exports=(function(){return a(`Bun/`)?`BUN`:a(`Cloudflare-Workers`)?`CLOUDFLARE`:a(`Deno/`)?`DENO`:a(`Node.js/`)?`NODE`:n.Bun&&typeof Bun.version==`string`?`BUN`:n.Deno&&typeof Deno.version==`object`?`DENO`:i(n.process)===`process`?`NODE`:n.window&&n.document?`BROWSER`:`REST`})()})),Bf=s(((e,t)=>{t.exports=zf()===`NODE`})),Vf=s(((e,t)=>{t.exports=Dd()})),Hf=s(((e,t)=>{var n=Pd(),r=Xd();t.exports=function(e,t,i){try{return n(r(Object.getOwnPropertyDescriptor(e,t)[i]))}catch{}}})),Uf=s(((e,t)=>{var n=Vd();t.exports=function(e){return n(e)||e===null}})),Wf=s(((e,t)=>{var n=Uf(),r=String,i=TypeError;t.exports=function(e){if(n(e))return e;throw new i(`Can't set `+r(e)+` as a prototype`)}})),Gf=s(((e,t)=>{var n=Hf(),r=Vd(),i=Rd(),a=Wf();t.exports=Object.setPrototypeOf||(`__proto__`in{}?function(){var e=!1,t={},o;try{o=n(Object.prototype,`__proto__`,`set`),o(t,[]),e=t instanceof Array}catch{}return function(t,n){return i(t),a(n),r(t)&&(e?o(t,n):t.__proto__=n),t}}():void 0)})),Kf=s(((e,t)=>{var n=hf().f,r=af(),i=sf()(`toStringTag`);t.exports=function(e,t,a){e&&!a&&(e=e.prototype),e&&!r(e,i)&&n(e,i,{configurable:!0,value:t})}})),qf=s(((e,t)=>{var n=Cf(),r=hf();t.exports=function(e,t,i){return i.get&&n(i.get,t,{getter:!0}),i.set&&n(i.set,t,{setter:!0}),r.f(e,t,i)}})),Jf=s(((e,t)=>{var n=Hd(),r=qf(),i=sf(),a=kd(),o=i(`species`);t.exports=function(e){var t=n(e);a&&t&&!t[o]&&r(t,o,{configurable:!0,get:function(){return this}})}})),Yf=s(((e,t)=>{var n=Ud(),r=TypeError;t.exports=function(e,t){if(n(t,e))return e;throw new r(`Incorrect invocation`)}})),Xf=s(((e,t)=>{var n=sf()(`toStringTag`),r={};r[n]=`z`,t.exports=String(r)===`[object z]`})),Zf=s(((e,t)=>{var n=Xf(),r=Bd(),i=Fd(),a=sf()(`toStringTag`),o=Object,s=i(function(){return arguments}())===`Arguments`,c=function(e,t){try{return e[t]}catch{}};t.exports=n?i:function(e){var t,n,l;return e===void 0?`Undefined`:e===null?`Null`:typeof(n=c(t=o(e),a))==`string`?n:s?i(t):(l=i(t))===`Object`&&r(t.callee)?`Arguments`:l}})),Qf=s(((e,t)=>{var n=Pd(),r=Od(),i=Bd(),a=Zf(),o=Hd(),s=vf(),c=function(){},l=o(`Reflect`,`construct`),u=/^\s*(?:class|function)\b/,d=n(u.exec),f=!u.test(c),p=function(e){if(!i(e))return!1;try{return l(c,[],e),!0}catch{return!1}},m=function(e){if(!i(e))return!1;switch(a(e)){case`AsyncFunction`:case`GeneratorFunction`:case`AsyncGeneratorFunction`:return!1}try{return f||!!d(u,s(e))}catch{return!0}};m.sham=!0,t.exports=!l||r(function(){var e;return p(p.call)||!p(Object)||!p(function(){e=!0})||e})?m:p})),$f=s(((e,t)=>{var n=Qf(),r=Yd(),i=TypeError;t.exports=function(e){if(n(e))return e;throw new i(r(e)+` is not a constructor`)}})),ep=s(((e,t)=>{var n=mf(),r=$f(),i=Ld(),a=sf()(`species`);t.exports=function(e,t){var o=n(e).constructor,s;return o===void 0||i(s=n(o)[a])?t:r(s)}})),tp=s(((e,t)=>{var n=Ad(),r=Function.prototype,i=r.apply,a=r.call;t.exports=typeof Reflect==`object`&&Reflect.apply||(n?a.bind(i):function(){return a.apply(i,arguments)})})),np=s(((e,t)=>{var n=Fd(),r=Pd();t.exports=function(e){if(n(e)===`Function`)return r(e)}})),rp=s(((e,t)=>{var n=np(),r=Xd(),i=Ad(),a=n(n.bind);t.exports=function(e,t){return r(e),t===void 0?e:i?a(e,t):function(){return e.apply(t,arguments)}}})),ip=s(((e,t)=>{t.exports=Hd()(`document`,`documentElement`)})),ap=s(((e,t)=>{t.exports=Pd()([].slice)})),op=s(((e,t)=>{var n=TypeError;t.exports=function(e,t){if(e{var n=Wd();t.exports=/ipad|iphone|ipod/i.test(n)&&/applewebkit/i.test(n)})),cp=s(((e,t)=>{var n=Dd(),r=tp(),i=rp(),a=Bd(),o=af(),s=Od(),c=ip(),l=ap(),u=uf(),d=op(),f=sp(),p=Bf(),m=n.setImmediate,h=n.clearImmediate,g=n.process,_=n.Dispatch,v=n.Function,y=n.MessageChannel,b=n.String,x=0,S={},C=`onreadystatechange`,w,T,E,D;s(function(){w=n.location});var O=function(e){if(o(S,e)){var t=S[e];delete S[e],t()}},k=function(e){return function(){O(e)}},A=function(e){O(e.data)},j=function(e){n.postMessage(b(e),w.protocol+`//`+w.host)};(!m||!h)&&(m=function(e){d(arguments.length,1);var t=a(e)?e:v(e),n=l(arguments,1);return S[++x]=function(){r(t,void 0,n)},T(x),x},h=function(e){delete S[e]},p?T=function(e){g.nextTick(k(e))}:_&&_.now?T=function(e){_.now(k(e))}:y&&!f?(E=new y,D=E.port2,E.port1.onmessage=A,T=i(D.postMessage,D)):n.addEventListener&&a(n.postMessage)&&!n.importScripts&&w&&w.protocol!==`file:`&&!s(j)?(T=j,n.addEventListener(`message`,A,!1)):T=C in u(`script`)?function(e){c.appendChild(u(`script`))[C]=function(){c.removeChild(this),O(e)}}:function(e){setTimeout(k(e),0)}),t.exports={set:m,clear:h}})),lp=s(((e,t)=>{var n=Dd(),r=kd(),i=Object.getOwnPropertyDescriptor;t.exports=function(e){if(!r)return n[e];var t=i(n,e);return t&&t.value}})),up=s(((e,t)=>{var n=function(){this.head=null,this.tail=null};n.prototype={add:function(e){var t={item:e,next:null},n=this.tail;n?n.next=t:this.head=t,this.tail=t},get:function(){var e=this.head;if(e)return(this.head=e.next)===null&&(this.tail=null),e.item}},t.exports=n})),dp=s(((e,t)=>{var n=Wd();t.exports=/ipad|iphone|ipod/i.test(n)&&typeof Pebble<`u`})),fp=s(((e,t)=>{var n=Wd();t.exports=/web0s(?!.*chrome)/i.test(n)})),pp=s(((e,t)=>{var n=Dd(),r=lp(),i=rp(),a=cp().set,o=up(),s=sp(),c=dp(),l=fp(),u=Bf(),d=n.MutationObserver||n.WebKitMutationObserver,f=n.document,p=n.process,m=n.Promise,h=r(`queueMicrotask`),g,_,v,y,b;if(!h){var x=new o,S=function(){var e,t;for(u&&(e=p.domain)&&e.exit();t=x.get();)try{t()}catch(e){throw x.head&&g(),e}e&&e.enter()};!s&&!u&&!l&&d&&f?(_=!0,v=f.createTextNode(``),new d(S).observe(v,{characterData:!0}),g=function(){v.data=_=!_}):!c&&m&&m.resolve?(y=m.resolve(void 0),y.constructor=m,b=i(y.then,y),g=function(){b(S)}):u?g=function(){p.nextTick(S)}:(a=i(a,n),g=function(){a(S)}),h=function(e){x.head||g(),x.add(e)}}t.exports=h})),mp=s(((e,t)=>{t.exports=function(e,t){try{arguments.length===1?console.error(e):console.error(e,t)}catch{}}})),hp=s(((e,t)=>{t.exports=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}}})),gp=s(((e,t)=>{t.exports=Dd().Promise})),_p=s(((e,t)=>{var n=Dd(),r=gp(),i=Bd(),a=Lf(),o=vf(),s=sf(),c=zf(),l=$d(),u=Gd(),d=r&&r.prototype,f=s(`species`),p=!1,m=i(n.PromiseRejectionEvent);t.exports={CONSTRUCTOR:a(`Promise`,function(){var e=o(r),t=e!==String(r);if(!t&&u===66||l&&!(d.catch&&d.finally))return!0;if(!u||u<51||!/native code/.test(e)){var n=new r(function(e){e(1)}),i=function(e){e(function(){},function(){})},a=n.constructor={};if(a[f]=i,p=n.then(function(){})instanceof i,!p)return!0}return!t&&(c===`BROWSER`||c===`DENO`)&&!m}),REJECTION_EVENT:m,SUBCLASSING:p}})),vp=s(((e,t)=>{var n=Xd(),r=TypeError,i=function(e){var t,i;this.promise=new e(function(e,n){if(t!==void 0||i!==void 0)throw new r(`Bad Promise constructor`);t=e,i=n}),this.resolve=n(t),this.reject=n(i)};t.exports.f=function(e){return new i(e)}})),yp=s((()=>{var e=Rf(),t=$d(),n=Bf(),r=Dd(),i=Vf(),a=jd(),o=wf(),s=Gf(),c=Kf(),l=Jf(),u=Xd(),d=Bd(),f=Vd(),p=Yf(),m=ep(),h=cp().set,g=pp(),_=mp(),v=hp(),y=up(),b=Sf(),x=gp(),S=_p(),C=vp(),w=`Promise`,T=S.CONSTRUCTOR,E=S.REJECTION_EVENT,D=S.SUBCLASSING,O=b.getterFor(w),k=b.set,A=x&&x.prototype,j=x,M=A,N=r.TypeError,P=r.document,F=r.process,I=C.f,L=I,R=!!(P&&P.createEvent&&r.dispatchEvent),z=`unhandledrejection`,B=`rejectionhandled`,V=0,H=1,ee=2,U=1,W=2,te,G,ne,re,K=function(e){var t;return f(e)&&d(t=e.then)?t:!1},q=function(e,t){var n=t.value,r=t.state===H,i=r?e.ok:e.fail,o=e.resolve,s=e.reject,c=e.domain,l,u,d;try{i?(r||(t.rejection===W&&Y(t),t.rejection=U),i===!0?l=n:(c&&c.enter(),l=i(n),c&&(c.exit(),d=!0)),l===e.promise?s(new N(`Promise-chain cycle`)):(u=K(l))?a(u,l,o,s):o(l)):s(n)}catch(e){c&&!d&&c.exit(),s(e)}},J=function(e,t){e.notified||(e.notified=!0,g(function(){for(var n=e.reactions,r;r=n.get();)q(r,e);e.notified=!1,t&&!e.rejection&&ae(e)}))},ie=function(e,t,n){var i,a;R?(i=P.createEvent(`Event`),i.promise=t,i.reason=n,i.initEvent(e,!1,!0),r.dispatchEvent(i)):i={promise:t,reason:n},!E&&(a=r[`on`+e])?a(i):e===z&&_(`Unhandled promise rejection`,n)},ae=function(e){a(h,r,function(){var t=e.facade,r=e.value,i=oe(e),a;if(i&&(a=v(function(){n?F.emit(`unhandledRejection`,r,t):ie(z,t,r)}),e.rejection=n||oe(e)?W:U,a.error))throw a.value})},oe=function(e){return e.rejection!==U&&!e.parent},Y=function(e){a(h,r,function(){var t=e.facade;n?F.emit(`rejectionHandled`,t):ie(B,t,e.value)})},X=function(e,t,n){return function(r){e(t,r,n)}},se=function(e,t,n){e.done||(e.done=!0,n&&(e=n),e.value=t,e.state=ee,J(e,!0))},ce=function(e,t,n){if(!e.done){e.done=!0,n&&(e=n);try{if(e.facade===t)throw new N(`Promise can't be resolved itself`);var r=K(t);r?g(function(){var n={done:!1};try{a(r,t,X(ce,n,e),X(se,n,e))}catch(t){se(n,t,e)}}):(e.value=t,e.state=H,J(e,!1))}catch(t){se({done:!1},t,e)}}};if(T&&(j=function(e){p(this,M),u(e),a(te,this);var t=O(this);try{e(X(ce,t),X(se,t))}catch(e){se(t,e)}},M=j.prototype,te=function(e){k(this,{type:w,done:!1,notified:!1,parent:!1,reactions:new y,rejection:!1,state:V,value:null})},te.prototype=o(M,`then`,function(e,t){var r=O(this),i=I(m(this,j));return r.parent=!0,i.ok=!d(e)||e,i.fail=d(t)&&t,i.domain=n?F.domain:void 0,r.state===V?r.reactions.add(i):g(function(){q(i,r)}),i.promise}),G=function(){var e=new te,t=O(e);this.promise=e,this.resolve=X(ce,t),this.reject=X(se,t)},C.f=I=function(e){return e===j||e===ne?new G(e):L(e)},!t&&d(x)&&A!==Object.prototype)){re=A.then,D||o(A,`then`,function(e,t){var n=this;return new j(function(e,t){a(re,n,e,t)}).then(e,t)},{unsafe:!0});try{delete A.constructor}catch{}s&&s(A,M)}e({global:!0,constructor:!0,wrap:!0,forced:T},{Promise:j}),ne=i.Promise,c(j,w,!1,!0),l(w)})),bp=s(((e,t)=>{t.exports=Object.create?Object.create(null):{}})),xp=s(((e,t)=>{var n=sf(),r=bp(),i=n(`iterator`),a=Array.prototype;t.exports=function(e){return e!==void 0&&(r.Array===e||a[i]===e)}})),Sp=s(((e,t)=>{var n=Fd(),r=Ld(),i=Zd(),a=sf()(`iterator`),o=Array.prototype;t.exports=function(e){if(!r(e))return i(e,a)||i(e,`@@iterator`)||(n(e)===`Arguments`?o[a]:void 0)}})),Cp=s(((e,t)=>{var n=jd(),r=Bd(),i=mf(),a=Yd(),o=Sp(),s=TypeError;t.exports=function(e,t){var c=arguments.length<2?o(e):t;if(r(c))return i(n(c,e));throw new s(a(e)+` is not iterable`)}})),wp=s(((e,t)=>{var n=jd(),r=mf(),i=Zd();t.exports=function(e,t,a){var o,s;r(e);try{if(o=i(e,`return`),!o){if(t===`throw`)throw a;return a}o=n(o,e)}catch(e){s=!0,o=e}if(t===`throw`)throw a;if(s)throw o;return r(o),a}})),Tp=s(((e,t)=>{var n=rp(),r=jd(),i=mf(),a=Yd(),o=xp(),s=kf(),c=Ud(),l=Cp(),u=Sp(),d=wp(),f=TypeError,p=function(e,t){this.stopped=e,this.result=t},m=p.prototype;t.exports=function(e,t,h){var g=h&&h.that,_=!!(h&&h.AS_ENTRIES),v=!!(h&&h.IS_RECORD),y=!!(h&&h.IS_ITERATOR),b=!!(h&&h.INTERRUPTED),x=n(t,g),S,C,w,T,E,D,O,k=function(e){var t=S;return S=void 0,t&&d(t,`normal`),new p(!0,e)},A=function(e){return _?(i(e),b?x(e[0],e[1],k):x(e[0],e[1])):b?x(e,k):x(e)};if(v)S=e.iterator;else if(y)S=e;else{if(C=u(e),!C)throw new f(a(e)+` is not iterable`);if(o(C)){for(w=0,T=s(e);T>w;w++)if(E=A(e[w]),E&&c(m,E))return E;return new p(!1)}S=l(e,C)}for(D=v?e.next:S.next;!(O=r(D,S)).done;){var j=O.value;try{E=A(j)}catch(e){if(S)d(S,`throw`,e);else throw e}if(typeof E==`object`&&E&&c(m,E))return E}return new p(!1)}})),Ep=s(((e,t)=>{var n=sf()(`iterator`),r=!1;try{var i=0,a={next:function(){return{done:!!i++}},return:function(){r=!0}};a[n]=function(){return this},Array.from(a,function(){throw 2})}catch{}t.exports=function(e,t){try{if(!t&&!r)return!1}catch{return!1}var i=!1;try{var a={};a[n]=function(){return{next:function(){return{done:i=!0}}}},e(a)}catch{}return i}})),Dp=s(((e,t)=>{var n=gp(),r=Ep();t.exports=_p().CONSTRUCTOR||!r(function(e){n.all(e).then(void 0,function(){})})})),Op=s((()=>{var e=Rf(),t=jd(),n=Xd(),r=vp(),i=hp(),a=Tp();e({target:`Promise`,stat:!0,forced:Dp()},{all:function(e){var o=this,s=r.f(o),c=s.resolve,l=s.reject,u=i(function(){var r=n(o.resolve),i=[],s=0,u=1;a(e,function(e){var n=s++,a=!1;u++,t(r,o,e).then(function(e){a||(a=!0,i[n]=e,--u||c(i))},l)}),--u||c(i)});return u.error&&l(u.value),s.promise}})})),kp=s((()=>{var e=Rf(),t=$d(),n=_p().CONSTRUCTOR,r=gp(),i=Hd(),a=Bd(),o=wf(),s=r&&r.prototype;if(e({target:`Promise`,proto:!0,forced:n,real:!0},{catch:function(e){return this.then(void 0,e)}}),!t&&a(r)){var c=i(`Promise`).prototype.catch;s.catch!==c&&o(s,`catch`,c,{unsafe:!0})}})),Ap=s((()=>{var e=Rf(),t=jd(),n=Xd(),r=vp(),i=hp(),a=Tp();e({target:`Promise`,stat:!0,forced:Dp()},{race:function(e){var o=this,s=r.f(o),c=s.reject,l=i(function(){var r=n(o.resolve);a(e,function(e){t(r,o,e).then(s.resolve,c)})});return l.error&&c(l.value),s.promise}})})),jp=s((()=>{var e=Rf(),t=vp(),n=_p().CONSTRUCTOR;e({target:`Promise`,stat:!0,forced:n},{reject:function(e){var n=t.f(this),r=n.reject;return r(e),n.promise}})})),Mp=s(((e,t)=>{var n=mf(),r=Vd(),i=vp();t.exports=function(e,t){if(n(e),r(t)&&t.constructor===e)return t;var a=i.f(e),o=a.resolve;return o(t),a.promise}})),Np=s((()=>{var e=Rf(),t=Hd(),n=$d(),r=gp(),i=_p().CONSTRUCTOR,a=Mp(),o=t(`Promise`),s=n&&!i;e({target:`Promise`,stat:!0,forced:n||i},{resolve:function(e){return a(s&&this===o?r:this,e)}})})),Pp=s((()=>{yp(),Op(),kp(),Ap(),jp(),Np()}));function Fp(e,t,n,r,i,a,o){try{var s=e[a](o),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,i)}function Ip(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var a=e.apply(t,n);function o(e){Fp(a,r,i,o,s,`next`,e)}function s(e){Fp(a,r,i,o,s,`throw`,e)}o(void 0)})}}var Lp=o((()=>{})),Rp=s(((e,t)=>{var n=Zf(),r=String;t.exports=function(e){if(n(e)===`Symbol`)throw TypeError(`Cannot convert a Symbol value to a string`);return r(e)}})),zp=s(((e,t)=>{var n=mf();t.exports=function(){var e=n(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}})),Bp=s(((e,t)=>{var n=Od(),r=Dd().RegExp,i=n(function(){var e=r(`a`,`y`);return e.lastIndex=2,e.exec(`abcd`)!==null}),a=i||n(function(){return!r(`a`,`y`).sticky});t.exports={BROKEN_CARET:i||n(function(){var e=r(`^r`,`gy`);return e.lastIndex=2,e.exec(`str`)!==null}),MISSED_STICKY:a,UNSUPPORTED_Y:i}})),Vp=s(((e,t)=>{var n=jf(),r=Mf();t.exports=Object.keys||function(e){return n(e,r)}})),Hp=s((e=>{var t=kd(),n=pf(),r=hf(),i=mf(),a=zd(),o=Vp();e.f=t&&!n?Object.defineProperties:function(e,t){i(e);for(var n=a(t),s=o(t),c=s.length,l=0,u;c>l;)r.f(e,u=s[l++],n[u]);return e}})),Up=s(((e,t)=>{var n=mf(),r=Hp(),i=Mf(),a=xf(),o=ip(),s=uf(),c=bf(),l=`>`,u=`<`,d=`prototype`,f=`script`,p=c(`IE_PROTO`),m=function(){},h=function(e){return u+f+l+e+u+`/`+f+l},g=function(e){e.write(h(``)),e.close();var t=e.parentWindow.Object;return e=null,t},_=function(){var e=s(`iframe`),t=`java`+f+`:`,n;return e.style.display=`none`,o.appendChild(e),e.src=String(t),n=e.contentWindow.document,n.open(),n.write(h(`document.F=Object`)),n.close(),n.F},v,y=function(){try{v=new ActiveXObject(`htmlfile`)}catch{}y=typeof document<`u`?document.domain&&v?g(v):_():g(v);for(var e=i.length;e--;)delete y[d][i[e]];return y()};a[p]=!0,t.exports=Object.create||function(e,t){var i;return e===null?i=y():(m[d]=n(e),i=new m,m[d]=null,i[p]=e),t===void 0?i:r.f(i,t)}})),Wp=s(((e,t)=>{var n=Od(),r=Dd().RegExp;t.exports=n(function(){var e=r(`.`,`s`);return!(e.dotAll&&e.test(` `)&&e.flags===`s`)})})),Gp=s(((e,t)=>{var n=Od(),r=Dd().RegExp;t.exports=n(function(){var e=r(`(?b)`,`g`);return e.exec(`b`).groups.a!==`b`||`b`.replace(e,`$c`)!==`bc`})})),Kp=s(((e,t)=>{var n=jd(),r=Pd(),i=Rp(),a=zp(),o=Bp(),s=nf(),c=Up(),l=Sf().get,u=Wp(),d=Gp(),f=s(`native-string-replace`,String.prototype.replace),p=RegExp.prototype.exec,m=p,h=r(``.charAt),g=r(``.indexOf),_=r(``.replace),v=r(``.slice),y=(function(){var e=/a/,t=/b*/g;return n(p,e,`a`),n(p,t,`a`),e.lastIndex!==0||t.lastIndex!==0})(),b=o.BROKEN_CARET,x=/()??/.exec(``)[1]!==void 0,S=y||x||b||u||d,C=function(e,t){for(var n=e.groups=c(null),r=0;r0&&h(o,t.lastIndex-1);t.lastIndex>0&&(!t.multiline||t.multiline&&k!==` `&&k!==`\r`&&k!==`\u2028`&&k!==`\u2029`)&&(E=`(?: (?:`+E+`))`,O=` `+O,D++),u=RegExp(`^(?:`+E+`)`,T)}x&&(u=RegExp(`^`+E+`$(?!\\s)`,T)),y&&(d=t.lastIndex);var A=n(p,w?u:t,O);return w?A?(A.input=o,A[0]=v(A[0],D),A.index=t.lastIndex,t.lastIndex+=A[0].length):t.lastIndex=0:y&&A&&(t.lastIndex=t.global?A.index+A[0].length:d),x&&A&&A.length>1&&n(f,A[0],u,function(){for(var e=1;e{var e=Rf(),t=Kp();e({target:`RegExp`,proto:!0,forced:/./.exec!==t},{exec:t})})),Jp=s(((e,t)=>{qp();var n=jd(),r=wf(),i=Kp(),a=Od(),o=sf(),s=gf(),c=o(`species`),l=RegExp.prototype;t.exports=function(e,t,u,d){var f=o(e),p=!a(function(){var t={};return t[f]=function(){return 7},``[e](t)!==7}),m=p&&!a(function(){var t=!1,n=/a/;if(e===`split`){var r={};r[c]=function(){return n},n={constructor:r,flags:``},n[f]=/./[f]}return n.exec=function(){return t=!0,null},n[f](``),!t});if(!p||!m||u){var h=/./[f],g=t(f,``[e],function(e,t,r,a,o){var s=t.exec;return s===i||s===l.exec?p&&!o?{done:!0,value:n(h,t,r,a)}:{done:!0,value:n(e,r,t,a)}:{done:!1}});r(String.prototype,e,g[0]),r(l,f,g[1])}d&&s(l[f],`sham`,!0)}})),Yp=s(((e,t)=>{var n=Pd(),r=Ef(),i=Rp(),a=Rd(),o=n(``.charAt),s=n(``.charCodeAt),c=n(``.slice),l=function(e){return function(t,n){var l=i(a(t)),u=r(n),d=l.length,f,p;return u<0||u>=d?e?``:void 0:(f=s(l,u),f<55296||f>56319||u+1===d||(p=s(l,u+1))<56320||p>57343?e?o(l,u):f:e?c(l,u,u+2):(f-55296<<10)+(p-56320)+65536)}};t.exports={codeAt:l(!1),charAt:l(!0)}})),Xp=s(((e,t)=>{var n=Yp().charAt;t.exports=function(e,t,r){return t+(r&&n(e,t).length||1)}})),Zp=s(((e,t)=>{var n=Dd(),r=Od(),i=n.RegExp;t.exports={correct:!r(function(){var e=!0;try{i(`.`,`d`)}catch{e=!1}var t={},n=``,r=e?`dgimsy`:`gimsy`,a=function(e,r){Object.defineProperty(t,e,{get:function(){return n+=r,!0}})},o={dotAll:`s`,global:`g`,ignoreCase:`i`,multiline:`m`,sticky:`y`};for(var s in e&&(o.hasIndices=`d`),o)a(s,o[s]);return Object.getOwnPropertyDescriptor(i.prototype,`flags`).get.call(t)!==r||n!==r})}})),Qp=s(((e,t)=>{var n=jd(),r=af(),i=Ud(),a=Zp(),o=zp(),s=RegExp.prototype;t.exports=a.correct?function(e){return e.flags}:function(e){return!a.correct&&i(s,e)&&!r(e,`flags`)?n(o,e):e.flags}})),$p=s(((e,t)=>{var n=jd(),r=mf(),i=Bd(),a=Fd(),o=Kp(),s=TypeError;t.exports=function(e,t){var c=e.exec;if(i(c)){var l=n(c,e,t);return l!==null&&r(l),l}if(a(e)===`RegExp`)return n(o,e,t);throw new s(`RegExp#exec called on incompatible receiver`)}})),em=s((()=>{var e=jd(),t=Pd(),n=Jp(),r=mf(),i=Vd(),a=Of(),o=Rp(),s=Rd(),c=Zd(),l=Xp(),u=Qp(),d=$p(),f=t(``.indexOf);n(`match`,function(t,n,p){return[function(n){var r=s(this),a=i(n)?c(n,t):void 0;if(a)return e(a,n,r);var l=o(r);return new RegExp(n)[t](l)},function(e){var t=r(this),i=o(e),s=p(n,t,i);if(s.done)return s.value;var c=o(u(t));if(!~f(c,`g`))return d(t,i);var m=!!~f(c,`u`)||!!~f(c,`v`);t.lastIndex=0;for(var h=[],g=0,_;(_=d(t,i))!==null;){var v=o(_[0]);h[g]=v,v===``&&(t.lastIndex=l(i,a(t.lastIndex),m)),g++}return g===0?null:h}]})})),tm=s(((e,t)=>{var n=Pd(),r=rf(),i=Math.floor,a=n(``.charAt),o=n(``.replace),s=n(``.slice),c=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,l=/\$([$&'`]|\d{1,2})/g;t.exports=function(e,t,n,u,d,f){var p=n+e.length,m=u.length,h=l;return d!==void 0&&(d=r(d),h=c),o(f,h,function(r,o){var c;switch(a(o,0)){case`$`:return`$`;case`&`:return e;case"`":return s(t,0,n);case`'`:return s(t,p);case`<`:c=d[s(o,1,-1)];break;default:var l=+o;if(l===0)return r;if(l>m){var f=i(l/10);return f===0?r:f<=m?u[f-1]===void 0?a(o,1):u[f-1]+a(o,1):r}c=u[l-1]}return c===void 0?``:c})}})),nm=s((()=>{var e=tp(),t=jd(),n=Pd(),r=Jp(),i=Od(),a=mf(),o=Bd(),s=Vd(),c=Ef(),l=Of(),u=Rp(),d=Rd(),f=Xp(),p=Zd(),m=tm(),h=Qp(),g=$p(),_=sf()(`replace`),v=Math.max,y=Math.min,b=n([].concat),x=n([].push),S=n(``.indexOf),C=n(``.slice),w=function(e){return e===void 0?e:String(e)},T=(function(){return`a`.replace(/./,`$0`)===`$0`})(),E=(function(){return/./[_]?/./[_](`a`,`$0`)===``:!1})();r(`replace`,function(n,r,i){var T=E?`$`:`$0`;return[function(e,n){var i=d(this),a=s(e)?p(e,_):void 0;return a?t(a,e,i,n):t(r,u(i),e,n)},function(t,n){var s=a(this),d=u(t),p=o(n);p||(n=u(n));var _=u(h(s));if(typeof n==`string`&&!~S(n,T)&&!~S(n,`$<`)&&!~S(_,`y`)){var E=i(r,s,d,n);if(E.done)return E.value}var D=!!~S(_,`g`),O;D&&(O=!!~S(_,`u`)||!!~S(_,`v`),s.lastIndex=0);for(var k=[],A;A=g(s,d),!(A===null||(x(k,A),!D));)u(A[0])===``&&(s.lastIndex=f(d,l(s.lastIndex),O));for(var j=``,M=0,N=0;N=M&&(j+=C(d,M,F)+L,M=F+P.length)}return j+C(d,M)}]},!!i(function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:`7`},e},``.replace(e,`$`)!==`7`})||!T||E)})),rm=s(((e,t)=>{var n=Vd(),r=Fd(),i=sf()(`match`);t.exports=function(e){var t;return n(e)&&((t=e[i])===void 0?r(e)===`RegExp`:!!t)}})),im=s(((e,t)=>{var n=rm(),r=TypeError;t.exports=function(e){if(n(e))throw new r(`The method doesn't accept regular expressions`);return e}})),am=s(((e,t)=>{var n=sf()(`match`);t.exports=function(e){var t=/./;try{`/./`[e](t)}catch{try{return t[n]=!1,`/./`[e](t)}catch{}}return!1}})),om=s((()=>{var e=Rf(),t=np(),n=ff().f,r=Of(),i=Rp(),a=im(),o=Rd(),s=am(),c=$d(),l=t(``.slice),u=Math.min,d=s(`startsWith`);e({target:`String`,proto:!0,forced:!(!c&&!d&&function(){var e=n(String.prototype,`startsWith`);return e&&!e.writable}())&&!d},{startsWith:function(e){var t=i(o(this));a(e);var n=i(e),s=r(u(arguments.length>1?arguments[1]:void 0,t.length));return l(t,s,s+n.length)===n}})})),sm=s(((e,t)=>{var n=sf(),r=Up(),i=hf().f,a=n(`unscopables`),o=Array.prototype;o[a]===void 0&&i(o,a,{configurable:!0,value:r(null)}),t.exports=function(e){o[a][e]=!0}})),cm=s(((e,t)=>{t.exports=!Od()(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})})),lm=s(((e,t)=>{var n=af(),r=Bd(),i=rf(),a=bf(),o=cm(),s=a(`IE_PROTO`),c=Object,l=c.prototype;t.exports=o?c.getPrototypeOf:function(e){var t=i(e);if(n(t,s))return t[s];var a=t.constructor;return r(a)&&t instanceof a?a.prototype:t instanceof c?l:null}})),um=s(((e,t)=>{var n=Od(),r=Bd(),i=Vd(),a=Up(),o=lm(),s=wf(),c=sf(),l=$d(),u=c(`iterator`),d=!1,f,p,m;[].keys&&(m=[].keys(),`next`in m?(p=o(o(m)),p!==Object.prototype&&(f=p)):d=!0),!i(f)||n(function(){var e={};return f[u].call(e)!==e})?f={}:l&&(f=a(f)),r(f[u])||s(f,u,function(){return this}),t.exports={IteratorPrototype:f,BUGGY_SAFARI_ITERATORS:d}})),dm=s(((e,t)=>{var n=um().IteratorPrototype,r=Up(),i=Nd(),a=Kf(),o=bp(),s=function(){return this};t.exports=function(e,t,c,l){var u=t+` Iterator`;return e.prototype=r(n,{next:i(+!l,c)}),a(e,u,!1,!0),o[u]=s,e}})),fm=s(((e,t)=>{var n=Rf(),r=jd(),i=$d(),a=_f(),o=Bd(),s=dm(),c=lm(),l=Gf(),u=Kf(),d=gf(),f=wf(),p=sf(),m=bp(),h=um(),g=a.PROPER,_=a.CONFIGURABLE,v=h.IteratorPrototype,y=h.BUGGY_SAFARI_ITERATORS,b=p(`iterator`),x=`keys`,S=`values`,C=`entries`,w=function(){return this};t.exports=function(e,t,a,p,h,T,E){s(a,t,p);var D=function(e){if(e===h&&M)return M;if(!y&&e&&e in A)return A[e];switch(e){case x:return function(){return new a(this,e)};case S:return function(){return new a(this,e)};case C:return function(){return new a(this,e)}}return function(){return new a(this)}},O=t+` Iterator`,k=!1,A=e.prototype,j=A[b]||A[`@@iterator`]||h&&A[h],M=!y&&j||D(h),N=t===`Array`&&A.entries||j,P,F,I;if(N&&(P=c(N.call(new e)),P!==Object.prototype&&P.next&&(!i&&c(P)!==v&&(l?l(P,v):o(P[b])||f(P,b,w)),u(P,O,!0,!0),i&&(m[O]=w))),g&&h===S&&j&&j.name!==S&&(!i&&_?d(A,`name`,S):(k=!0,M=function(){return r(j,this)})),h){if(F={values:D(S),keys:T?M:D(x),entries:D(C)},E)for(I in F)(y||k||!(I in A))&&f(A,I,F[I]);else n({target:t,proto:!0,forced:y||k},F)}return(!i||E)&&A[b]!==M&&f(A,b,M,{name:h}),m[t]=M,F}})),pm=s(((e,t)=>{t.exports=function(e,t){return{value:e,done:t}}})),mm=s(((e,t)=>{var n=zd(),r=sm(),i=bp(),a=Sf(),o=hf().f,s=fm(),c=pm(),l=$d(),u=kd(),d=`Array Iterator`,f=a.set,p=a.getterFor(d);t.exports=s(Array,`Array`,function(e,t){f(this,{type:d,target:n(e),index:0,kind:t})},function(){var e=p(this),t=e.target,n=e.index++;if(!t||n>=t.length)return e.target=null,c(void 0,!0);switch(e.kind){case`keys`:return c(n,!1);case`values`:return c(t[n],!1)}return c([n,t[n]],!1)},`values`);var m=i.Arguments=i.Array;if(r(`keys`),r(`values`),r(`entries`),!l&&u&&m.name!==`values`)try{o(m,`name`,{value:`values`})}catch{}})),hm=s(((e,t)=>{t.exports={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}})),gm=s(((e,t)=>{var n=uf()(`span`).classList,r=n&&n.constructor&&n.constructor.prototype;t.exports=r===Object.prototype?void 0:r})),_m=s((()=>{var e=Dd(),t=hm(),n=gm(),r=mm(),i=gf(),a=Kf(),o=sf()(`iterator`),s=r.values,c=function(e,n){if(e){if(e[o]!==s)try{i(e,o,s)}catch{e[o]=s}if(a(e,n,!0),t[n]){for(var c in r)if(e[c]!==r[c])try{i(e,c,r[c])}catch{e[c]=r[c]}}}};for(var l in t)c(e[l]&&e[l].prototype,l);c(n,`DOMTokenList`)}));function vm(e,t){if(vn(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(vn(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var ym=o((()=>{yn()}));function bm(e){var t=vm(e,`string`);return vn(t)==`symbol`?t:t+``}var xm=o((()=>{yn(),ym()}));function Sm(e,t,n){return(t=bm(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Cm=o((()=>{xm()})),wm=s(((e,t)=>{var n=Xd(),r=rf(),i=Id(),a=kf(),o=TypeError,s=`Reduce of empty array with no initial value`,c=function(e){return function(t,c,l,u){var d=r(t),f=i(d),p=a(d);if(n(c),p===0&&l<2)throw new o(s);var m=e?p-1:0,h=e?-1:1;if(l<2)for(;;){if(m in f){u=f[m],m+=h;break}if(m+=h,e?m<0:p<=m)throw new o(s)}for(;e?m>=0:p>m;m+=h)m in f&&(u=c(u,f[m],m,d));return u}};t.exports={left:c(!1),right:c(!0)}})),Tm=s(((e,t)=>{var n=Od();t.exports=function(e,t){var r=[][e];return!!r&&n(function(){r.call(null,t||function(){return 1},1)})}})),Em=s((()=>{var e=Rf(),t=wm().left,n=Tm(),r=Gd();e({target:`Array`,proto:!0,forced:!Bf()&&r>79&&r<83||!n(`reduce`)},{reduce:function(e){var n=arguments.length;return t(this,e,n,n>1?arguments[1]:void 0)}})})),Dm=s((()=>{var e=Rf(),t=np(),n=ff().f,r=Of(),i=Rp(),a=im(),o=Rd(),s=am(),c=$d(),l=t(``.slice),u=Math.min,d=s(`endsWith`);e({target:`String`,proto:!0,forced:!(!c&&!d&&function(){var e=n(String.prototype,`endsWith`);return e&&!e.writable}())&&!d},{endsWith:function(e){var t=i(o(this));a(e);var n=i(e),s=arguments.length>1?arguments[1]:void 0,c=t.length,d=s===void 0?c:u(r(s),c);return l(t,d-n.length,d)===n}})})),Om=s((()=>{var e=jd(),t=Pd(),n=Jp(),r=mf(),i=Vd(),a=Rd(),o=ep(),s=Xp(),c=Of(),l=Rp(),u=Zd(),d=Qp(),f=$p(),p=Bp(),m=Od(),h=p.UNSUPPORTED_Y,g=4294967295,_=Math.min,v=t([].push),y=t(``.slice),b=t(``.indexOf),x=!m(function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var n=`ab`.split(e);return n.length!==2||n[0]!==`a`||n[1]!==`b`}),S=`abbc`.split(/(b)*/)[1]===`c`||`test`.split(/(?:)/,-1).length!==4||`ab`.split(/(?:ab)*/).length!==2||`.`.split(/(.?)(.?)/).length!==4||`.`.split(/()()/).length>1||``.split(/.?/).length;n(`split`,function(t,n,p){var m=`0`.split(void 0,0).length?function(t,r){return t===void 0&&r===0?[]:e(n,this,t,r)}:n;return[function(n,r){var o=a(this),s=i(n)?u(n,t):void 0;return s?e(s,n,o,r):e(m,l(o),n,r)},function(e,t){var i=r(this),a=l(e);if(!S){var u=p(m,i,a,t,m!==n);if(u.done)return u.value}var x=o(i,RegExp),C=l(d(i)),w=!!~b(C,`u`)||!!~b(C,`v`);h?~b(C,`g`)||(C+=`g`):~b(C,`y`)||(C+=`y`);var T=new x(h?`^(?:`+i.source+`)`:i,C),E=t===void 0?g:t>>>0;if(E===0)return[];if(a.length===0)return f(T,a)===null?[a]:[];for(var D=0,O=0,k=[];O{(function(){var e,n,r,i,a,o;typeof performance<`u`&&performance!==null&&performance.now?t.exports=function(){return performance.now()}:typeof process<`u`&&process!==null&&process.hrtime?(t.exports=function(){return(e()-a)/1e6},n=process.hrtime,e=function(){var e=n();return e[0]*1e9+e[1]},i=e(),o=process.uptime()*1e9,a=i-o):Date.now?(t.exports=function(){return Date.now()-r},r=Date.now()):(t.exports=function(){return new Date().getTime()-r},r=new Date().getTime())}).call(e)})),Am=s(((e,t)=>{for(var n=km(),r=typeof window>`u`?global:window,i=[`moz`,`webkit`],a=`AnimationFrame`,o=r[`request`+a],s=r[`cancel`+a]||r[`cancelRequest`+a],c=0;!o&&c{t.exports=` \v\f\r \xA0               \u2028\u2029`})),Mm=s(((e,t)=>{var n=Pd(),r=Rd(),i=Rp(),a=jm(),o=n(``.replace),s=RegExp(`^[`+a+`]+`),c=RegExp(`(^|[^`+a+`])[`+a+`]+$`),l=function(e){return function(t){var n=i(r(t));return e&1&&(n=o(n,s,``)),e&2&&(n=o(n,c,`$1`)),n}};t.exports={start:l(1),end:l(2),trim:l(3)}})),Nm=s(((e,t)=>{var n=_f().PROPER,r=Od(),i=jm(),a=`​…᠎`;t.exports=function(e){return r(function(){return!!i[e]()||a[e]()!==a||n&&i[e].name!==e})}})),Pm=s((()=>{var e=Rf(),t=Mm().trim;e({target:`String`,proto:!0,forced:Nm()(`trim`)},{trim:function(){return t(this)}})})),Fm=s(((e,t)=>{t.exports=function(e){this.ok=!1,this.alpha=1,e.charAt(0)==`#`&&(e=e.substr(1,6)),e=e.replace(/ /g,``),e=e.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;r3&&(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 e.length==1&&(e=`0`+e),t.length==1&&(t=`0`+t),n.length==1&&(n=`0`+n),`#`+e+t+n},this.getHelpXML=function(){for(var e=[],r=0;r `+l.toRGB()+` -> `+l.toHex());c.appendChild(u),c.appendChild(d),s.appendChild(c)}catch{}return s}}})),Im=s((()=>{var e=Rf(),t=np(),n=Af().indexOf,r=Tm(),i=t([].indexOf),a=!!i&&1/i([1],1,-0)<0;e({target:`Array`,proto:!0,forced:a||!r(`indexOf`)},{indexOf:function(e){var t=arguments.length>1?arguments[1]:void 0;return a?i(this,e,t)||0:n(this,e,t)}})})),Lm=s((()=>{var e=Rf(),t=Pd(),n=im(),r=Rd(),i=Rp(),a=am(),o=t(``.indexOf);e({target:`String`,proto:!0,forced:!a(`includes`)},{includes:function(e){return!!~o(i(r(this)),i(n(e)),arguments.length>1?arguments[1]:void 0)}})})),Rm=s(((e,t)=>{var n=Fd();t.exports=Array.isArray||function(e){return n(e)===`Array`}})),zm=s((()=>{var e=Rf(),t=Pd(),n=Rm(),r=t([].reverse),i=[1,2];e({target:`Array`,proto:!0,forced:String(i)===String(i.reverse())},{reverse:function(){return n(this)&&(this.length=this.length),r(this)}})}));function Bm(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Class extends value `+String(t)+` is not a constructor or null`);function n(){this.constructor=e}Xm(e,t),e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}function Vm(e){var t=``;Array.isArray(e)||(e=[e]);for(var n=0;ne.phi1&&(e.phi2-=2*Zm),e.sweepFlag===1&&e.phi2r)return[];if(r===0)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)]]}function Km(e,t,n){return(1-n)*e+n*t}function qm(e,t,n,r){return e+Math.cos(r/180*Zm)*t+Math.sin(r/180*Zm)*n}function Jm(e,t,n,r){var i=1e-6,a=t-e,o=n-t,s=3*a+3*(r-n)-6*o,c=6*(o-a),l=3*a;return Math.abs(s){Xm=function(e,t){return(Xm=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)},Zm=Math.PI,$m=Math.PI/180,(function(e){function t(){return i((function(e,t,n){return e.relative&&(e.x1!==void 0&&(e.x1+=t),e.y1!==void 0&&(e.y1+=n),e.x2!==void 0&&(e.x2+=t),e.y2!==void 0&&(e.y2+=n),e.x!==void 0&&(e.x+=t),e.y!==void 0&&(e.y+=n),e.relative=!1),e}))}function n(){var e=NaN,t=NaN,n=NaN,r=NaN;return i((function(i,a,o){return i.type&$.SMOOTH_CURVE_TO&&(i.type=$.CURVE_TO,e=isNaN(e)?a:e,t=isNaN(t)?o:t,i.x1=i.relative?a-e:2*a-e,i.y1=i.relative?o-t:2*o-t),i.type&$.CURVE_TO?(e=i.relative?a+i.x2:i.x2,t=i.relative?o+i.y2:i.y2):(e=NaN,t=NaN),i.type&$.SMOOTH_QUAD_TO&&(i.type=$.QUAD_TO,n=isNaN(n)?a:n,r=isNaN(r)?o:r,i.x1=i.relative?a-n:2*a-n,i.y1=i.relative?o-r:2*o-r),i.type&$.QUAD_TO?(n=i.relative?a+i.x1:i.x1,r=i.relative?o+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&$.SMOOTH_QUAD_TO&&(n.type=$.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&$.QUAD_TO){e=n.relative?r+n.x1:n.x1,t=n.relative?i+n.y1:n.y1;var a=n.x1,o=n.y1;n.type=$.CURVE_TO,n.x1=((n.relative?0:r)+2*a)/3,n.y1=((n.relative?0:i)+2*o)/3,n.x2=(n.x+2*a)/3,n.y2=(n.y+2*o)/3}else e=NaN,t=NaN;return n}))}function i(e){var t=0,n=0,r=NaN,i=NaN;return function(a){if(isNaN(r)&&!(a.type&$.MOVE_TO))throw Error(`path must start with moveto`);var o=e(a,t,n,r,i);return a.type&$.CLOSE_PATH&&(t=r,n=i),a.x!==void 0&&(t=a.relative?t+a.x:a.x),a.y!==void 0&&(n=a.relative?n+a.y:a.y),a.type&$.MOVE_TO&&(r=t,i=n),o}}function a(e,t,n,r,a,o){return Um(e,t,n,r,a,o),i((function(i,s,c,l){var u=i.x1,d=i.x2,f=i.relative&&!isNaN(l),p=i.x===void 0?f?0:s:i.x,m=i.y===void 0?f?0:c:i.y;function h(e){return e*e}i.type&$.HORIZ_LINE_TO&&t!==0&&(i.type=$.LINE_TO,i.y=i.relative?0:c),i.type&$.VERT_LINE_TO&&n!==0&&(i.type=$.LINE_TO,i.x=i.relative?0:s),i.x!==void 0&&(i.x=i.x*e+m*n+(f?0:a)),i.y!==void 0&&(i.y=p*t+i.y*r+(f?0:o)),i.x1!==void 0&&(i.x1=i.x1*e+i.y1*n+(f?0:a)),i.y1!==void 0&&(i.y1=u*t+i.y1*r+(f?0:o)),i.x2!==void 0&&(i.x2=i.x2*e+i.y2*n+(f?0:a)),i.y2!==void 0&&(i.y2=d*t+i.y2*r+(f?0:o));var g=e*r-t*n;if(i.xRot!==void 0&&(e!==1||t!==0||n!==0||r!==1)){if(g===0)delete i.rX,delete i.rY,delete i.xRot,delete i.lArcFlag,delete i.sweepFlag,i.type=$.LINE_TO;else{var _=i.xRot*Math.PI/180,v=Math.sin(_),y=Math.cos(_),b=1/h(i.rX),x=1/h(i.rY),S=h(y)*b+h(v)*x,C=2*v*y*(b-x),w=h(v)*b+h(y)*x,T=S*r*r-C*t*r+w*t*t,E=C*(e*r+t*n)-2*(S*n*r+w*e*t),D=S*n*n-C*e*n+w*e*e,O=(Math.atan2(E,T-D)+Math.PI)%Math.PI/2,k=Math.sin(O),A=Math.cos(O);i.rX=Math.abs(g)/Math.sqrt(T*h(A)+E*k*A+D*h(k)),i.rY=Math.abs(g)/Math.sqrt(T*h(k)-E*k*A+D*h(A)),i.xRot=180*O/Math.PI}}return i.sweepFlag!==void 0&&0>g&&(i.sweepFlag=+!i.sweepFlag),i}))}function o(){return function(e){var t={};for(var n in e)t[n]=e[n];return t}}e.ROUND=function(e){function t(t){return Math.round(t*e)/e}return e===void 0&&(e=0x9184e72a000),Um(e),function(e){return e.x1!==void 0&&(e.x1=t(e.x1)),e.y1!==void 0&&(e.y1=t(e.y1)),e.x2!==void 0&&(e.x2=t(e.x2)),e.y2!==void 0&&(e.y2=t(e.y2)),e.x!==void 0&&(e.x=t(e.x)),e.y!==void 0&&(e.y=t(e.y)),e.rX!==void 0&&(e.rX=t(e.rX)),e.rY!==void 0&&(e.rY=t(e.rY)),e}},e.TO_ABS=t,e.TO_REL=function(){return i((function(e,t,n){return e.relative||(e.x1!==void 0&&(e.x1-=t),e.y1!==void 0&&(e.y1-=n),e.x2!==void 0&&(e.x2-=t),e.y2!==void 0&&(e.y2-=n),e.x!==void 0&&(e.x-=t),e.y!==void 0&&(e.y-=n),e.relative=!0),e}))},e.NORMALIZE_HVZ=function(e,t,n){return e===void 0&&(e=!0),t===void 0&&(t=!0),n===void 0&&(n=!0),i((function(r,i,a,o,s){if(isNaN(o)&&!(r.type&$.MOVE_TO))throw Error(`path must start with moveto`);return t&&r.type&$.HORIZ_LINE_TO&&(r.type=$.LINE_TO,r.y=r.relative?0:a),n&&r.type&$.VERT_LINE_TO&&(r.type=$.LINE_TO,r.x=r.relative?0:i),e&&r.type&$.CLOSE_PATH&&(r.type=$.LINE_TO,r.x=r.relative?o-i:o,r.y=r.relative?s-a:s),r.type&$.ARC&&(r.rX===0||r.rY===0)&&(r.type=$.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){e===void 0&&(e=0),Um(e);var t=NaN,n=NaN,r=NaN,a=NaN;return i((function(i,o,s,c,l){var u=Math.abs,d=!1,f=0,p=0;if(i.type&$.SMOOTH_CURVE_TO&&(f=isNaN(t)?0:o-t,p=isNaN(n)?0:s-n),i.type&($.CURVE_TO|$.SMOOTH_CURVE_TO)?(t=i.relative?o+i.x2:i.x2,n=i.relative?s+i.y2:i.y2):(t=NaN,n=NaN),i.type&$.SMOOTH_QUAD_TO?(r=isNaN(r)?o:2*o-r,a=isNaN(a)?s:2*s-a):i.type&$.QUAD_TO?(r=i.relative?o+i.x1:i.x1,a=i.relative?s+i.y1:i.y2):(r=NaN,a=NaN),i.type&$.LINE_COMMANDS||i.type&$.ARC&&(i.rX===0||i.rY===0||!i.lArcFlag)||i.type&$.CURVE_TO||i.type&$.SMOOTH_CURVE_TO||i.type&$.QUAD_TO||i.type&$.SMOOTH_QUAD_TO){var m=i.x===void 0?0:i.relative?i.x:i.x-o,h=i.y===void 0?0:i.relative?i.y:i.y-s;f=isNaN(r)?i.x1===void 0?f:i.relative?i.x:i.x1-o:r-o,p=isNaN(a)?i.y1===void 0?p:i.relative?i.y:i.y1-s:a-s;var g=i.x2===void 0?0:i.relative?i.x:i.x2-o,_=i.y2===void 0?0:i.relative?i.y:i.y2-s;u(m)<=e&&u(h)<=e&&u(f)<=e&&u(p)<=e&&u(g)<=e&&u(_)<=e&&(d=!0)}return i.type&$.CLOSE_PATH&&u(o-c)<=e&&u(s-l)<=e&&(d=!0),d?[]:i}))},e.MATRIX=a,e.ROTATE=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=0),Um(e,t,n);var r=Math.sin(e),i=Math.cos(e);return a(i,r,-r,i,t-t*i+n*r,n-t*r-n*i)},e.TRANSLATE=function(e,t){return t===void 0&&(t=0),Um(e,t),a(1,0,0,1,e,t)},e.SCALE=function(e,t){return t===void 0&&(t=e),Um(e,t),a(e,0,0,t,0,0)},e.SKEW_X=function(e){return Um(e),a(1,0,Math.atan(e),1,0,0)},e.SKEW_Y=function(e){return Um(e),a(1,Math.atan(e),0,1,0,0)},e.X_AXIS_SYMMETRY=function(e){return e===void 0&&(e=0),Um(e),a(-1,0,0,1,e,0)},e.Y_AXIS_SYMMETRY=function(e){return e===void 0&&(e=0),Um(e),a(1,0,0,-1,0,e)},e.A_TO_C=function(){return i((function(e,t,n){return $.ARC===e.type?function(e,t,n){var r,i,a,o;e.cX||Wm(e,t,n);for(var s=Math.min(e.phi1,e.phi2),c=Math.max(e.phi1,e.phi2)-s,l=Math.ceil(c/90),u=Array(l),d=t,f=n,p=0;pc.maxX&&(c.maxX=e),ec.maxY&&(c.maxY=e),eO&&l(Ym(n,i.x1,i.x2,i.x,O));for(var p=0,m=Jm(r,i.y1,i.y2,i.y);pO&&u(Ym(r,i.y1,i.y2,i.y,O))}if(i.type&$.ARC){l(i.x),u(i.y),Wm(i,n,r);for(var h=i.xRot/180*Math.PI,g=Math.cos(h)*i.rX,_=Math.sin(h)*i.rX,v=-Math.sin(h)*i.rY,y=Math.cos(h)*i.rY,b=i.phi1i.phi2?[i.phi2+360,i.phi1+360]:[i.phi2,i.phi1],x=b[0],S=b[1],C=function(e){var t=e[0],n=e[1],r=180*Math.atan2(n,t)/Math.PI;return rx&&Ox&&Oc)throw SyntaxError(`Expected positive number, got "`+c+`" at index "`+i+`"`)}else if((this.curArgs.length===3||this.curArgs.length===4)&&this.curNumber!==`0`&&this.curNumber!==`1`)throw SyntaxError(`Expected a flag, got "`+this.curNumber+`" at index "`+i+`"`)}this.curArgs.push(c),this.curArgs.length===ah[this.curCommandType]&&($.HORIZ_LINE_TO===this.curCommandType?r({type:$.HORIZ_LINE_TO,relative:this.curCommandRelative,x:c}):$.VERT_LINE_TO===this.curCommandType?r({type:$.VERT_LINE_TO,relative:this.curCommandRelative,y:c}):this.curCommandType===$.MOVE_TO||this.curCommandType===$.LINE_TO||this.curCommandType===$.SMOOTH_QUAD_TO?(r({type:this.curCommandType,relative:this.curCommandRelative,x:this.curArgs[0],y:this.curArgs[1]}),$.MOVE_TO===this.curCommandType&&(this.curCommandType=$.LINE_TO)):this.curCommandType===$.CURVE_TO?r({type:$.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===$.SMOOTH_CURVE_TO?r({type:$.SMOOTH_CURVE_TO,relative:this.curCommandRelative,x2:this.curArgs[0],y2:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===$.QUAD_TO?r({type:$.QUAD_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===$.ARC&&r({type:$.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(!nh(a)){if(a===`,`&&this.canParseCommandOrComma)this.canParseCommandOrComma=!1;else if(a!==`+`&&a!==`-`&&a!==`.`){if(s)this.curNumber=a,this.curNumberHasDecimal=!1;else{if(this.curArgs.length!==0)throw SyntaxError(`Unterminated command at index `+i+`.`);if(!this.canParseCommandOrComma)throw SyntaxError(`Unexpected character "`+a+`" at index `+i+`. Command cannot follow comma`);if(this.canParseCommandOrComma=!1,a!==`z`&&a!==`Z`){if(a===`h`||a===`H`)this.curCommandType=$.HORIZ_LINE_TO,this.curCommandRelative=a===`h`;else if(a===`v`||a===`V`)this.curCommandType=$.VERT_LINE_TO,this.curCommandRelative=a===`v`;else if(a===`m`||a===`M`)this.curCommandType=$.MOVE_TO,this.curCommandRelative=a===`m`;else if(a===`l`||a===`L`)this.curCommandType=$.LINE_TO,this.curCommandRelative=a===`l`;else if(a===`c`||a===`C`)this.curCommandType=$.CURVE_TO,this.curCommandRelative=a===`c`;else if(a===`s`||a===`S`)this.curCommandType=$.SMOOTH_CURVE_TO,this.curCommandRelative=a===`s`;else if(a===`q`||a===`Q`)this.curCommandType=$.QUAD_TO,this.curCommandRelative=a===`q`;else if(a===`t`||a===`T`)this.curCommandType=$.SMOOTH_QUAD_TO,this.curCommandRelative=a===`t`;else{if(a!==`a`&&a!==`A`)throw SyntaxError(`Unexpected character "`+a+`" at index `+i+`.`);this.curCommandType=$.ARC,this.curCommandRelative=a===`a`}}else t.push({type:$.CLOSE_PATH}),this.canParseCommandOrComma=!0,this.curCommandType=-1}}else this.curNumber=a,this.curNumberHasDecimal=a===`.`}}else this.curNumber+=a,this.curNumberHasDecimal=!0}else this.curNumber+=a}else this.curNumber+=a,this.curNumberHasExp=!0}else this.curNumber+=a,this.curNumberHasExpDigits=this.curNumberHasExp}return t},t.prototype.transform=function(e){return Object.create(this,{parse:{value:function(t,n){n===void 0&&(n=[]);for(var r=0,i=Object.getPrototypeOf(this).parse.call(this,t);r{var e=_f().PROPER,t=wf(),n=mf(),r=Rp(),i=Od(),a=Qp(),o=`toString`,s=RegExp.prototype,c=s[o],l=i(function(){return c.call({source:`a`,flags:`b`})!==`/a/b`}),u=e&&c.name!==o;(l||u)&&t(s,o,function(){var e=n(this),t=r(e.source),i=r(a(e));return`/`+t+`/`+i},{unsafe:!0})}));function ch(e){"@babel/helpers - typeof";return ch=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},ch(e)}function lh(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function uh(e,t,n,r,i){if(typeof e==`string`&&(e=document.getElementById(e)),!e||ch(e)!==`object`||!(`getContext`in e))throw TypeError("Expecting canvas with `getContext` method in processCanvasRGB(A) calls!");var a=e.getContext(`2d`);try{return a.getImageData(t,n,r,i)}catch(e){throw Error(`unable to access image data: `+e)}}function dh(e,t,n,r,i,a){if(!(isNaN(a)||a<1)){a|=0;var o=uh(e,t,n,r,i);o=fh(o,t,n,r,i,a),e.getContext(`2d`).putImageData(o,t,n)}}function fh(e,t,n,r,i,a){for(var o=e.data,s=2*a+1,c=r-1,l=i-1,u=a+1,d=u*(u+1)/2,f=new hh,p=f,m,h=1;h>>x;if(o[y+3]=ne,ne!==0){var re=255/ne;o[y]=(I*b>>>x)*re,o[y+1]=(L*b>>>x)*re,o[y+2]=(R*b>>>x)*re}else o[y]=o[y+1]=o[y+2]=0;I-=M,L-=N,R-=P,z-=F,M-=g.r,N-=g.g,P-=g.b,F-=g.a;var K=G+a+1;K=v+(K>>x,Z>0?(Z=255/Z,o[Ee]=(pe*b>>>x)*Z,o[Ee+1]=(me*b>>>x)*Z,o[Ee+2]=(he*b>>>x)*Z):o[Ee]=o[Ee+1]=o[Ee+2]=0,pe-=le,me-=ue,he-=de,ge-=fe,le-=g.r,ue-=g.g,de-=g.b,fe-=g.a,Ee=Y+((Ee=Te+u){ph=[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],mh=[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],hh=function e(){lh(this,e),this.r=0,this.g=0,this.b=0,this.a=0,this.next=null}})),_h=c({AElement:()=>p_,AnimateColorElement:()=>s_,AnimateElement:()=>o_,AnimateTransformElement:()=>c_,BoundingBox:()=>Lg,CB1:()=>Mh,CB2:()=>Nh,CB3:()=>Ph,CB4:()=>Fh,Canvg:()=>P_,CircleElement:()=>qg,ClipPathElement:()=>w_,DefsElement:()=>e_,DescElement:()=>j_,Document:()=>N_,Element:()=>Pg,EllipseElement:()=>Jg,FeColorMatrixElement:()=>x_,FeCompositeElement:()=>O_,FeDropShadowElement:()=>E_,FeGaussianBlurElement:()=>k_,FeMorphologyElement:()=>D_,FilterElement:()=>T_,Font:()=>Ig,FontElement:()=>l_,FontFaceElement:()=>u_,GElement:()=>t_,GlyphElement:()=>Vg,GradientElement:()=>n_,ImageElement:()=>g_,LineElement:()=>Yg,LinearGradientElement:()=>r_,MarkerElement:()=>$g,MaskElement:()=>S_,Matrix:()=>kg,MissingGlyphElement:()=>d_,Mouse:()=>yg,PSEUDO_ZERO:()=>hg,Parser:()=>Tg,PathElement:()=>Bg,PathParser:()=>Rg,PatternElement:()=>Qg,Point:()=>vg,PolygonElement:()=>Zg,PolylineElement:()=>Xg,Property:()=>gg,QB1:()=>Ih,QB2:()=>Lh,QB3:()=>Rh,RadialGradientElement:()=>i_,RectElement:()=>Kg,RenderedElement:()=>zg,Rotate:()=>Dg,SVGElement:()=>Gg,SVGFontLoader:()=>v_,Scale:()=>Og,Screen:()=>Sg,Skew:()=>Ag,SkewX:()=>jg,SkewY:()=>Mg,StopElement:()=>a_,StyleElement:()=>y_,SymbolElement:()=>__,TRefElement:()=>f_,TSpanElement:()=>Ug,TextElement:()=>Hg,TextPathElement:()=>m_,TitleElement:()=>A_,Transform:()=>Ng,Translate:()=>Eg,UnknownElement:()=>Fg,UseElement:()=>b_,ViewPort:()=>_g,compressSpaces:()=>bh,default:()=>P_,getSelectorSpecificity:()=>Oh,normalizeAttributeName:()=>wh,normalizeColor:()=>Eh,parseExternalUrl:()=>Th,presets:()=>og,toNumbers:()=>Ch,trimLeft:()=>xh,trimRight:()=>Sh,vectorMagnitude:()=>kh,vectorsAngle:()=>jh,vectorsRatio:()=>Ah});function vh(){var{DOMParser:e}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t={window:null,ignoreAnimation:!0,ignoreMouse:!0,DOMParser:e,createCanvas(e,t){return new OffscreenCanvas(e,t)},createImage(e){return Ip(function*(){var t=yield(yield fetch(e)).blob();return yield createImageBitmap(t)})()}};return(typeof DOMParser<`u`||e===void 0)&&Reflect.deleteProperty(t,`DOMParser`),t}function yh(e){var{DOMParser:t,canvas:n,fetch:r}=e;return{window:null,ignoreAnimation:!0,ignoreMouse:!0,DOMParser:t,fetch:r,createCanvas:n.createCanvas,createImage:n.loadImage}}function bh(e){return e.replace(/(?!\u3000)\s+/gm,` `)}function xh(e){return e.replace(/^[\n \t]+/,``)}function Sh(e){return e.replace(/[\n \t]+$/,``)}function Ch(e){return((e||``).match(/-?(\d+(?:\.\d*(?:[eE][+-]?\d+)?)?|\.\d+)(?=\D|$)/gm)||[]).map(parseFloat)}function wh(e){return sg.test(e)?e.toLowerCase():e}function Th(e){var t=/url\(('([^']+)'|"([^"]+)"|([^'")]+))\)/.exec(e)||[];return t[2]||t[3]||t[4]}function Eh(e){if(!e.startsWith(`rgb`))return e;var t=3;return e.replace(/\d+(\.\d+)?/g,(e,n)=>t--&&n?String(Math.round(parseFloat(e))):e)}function Dh(e,t){var n=t.exec(e);return n?[e.replace(t,` `),n.length]:[e,0]}function Oh(e){var t=[0,0,0],n=e.replace(/:not\(([^)]*)\)/g,` $1 `).replace(/{[\s\S]*/gm,` `),r=0;return[n,r]=Dh(n,cg),t[1]+=r,[n,r]=Dh(n,lg),t[0]+=r,[n,r]=Dh(n,ug),t[1]+=r,[n,r]=Dh(n,dg),t[2]+=r,[n,r]=Dh(n,fg),t[1]+=r,[n,r]=Dh(n,pg),t[1]+=r,n=n.replace(/[*\s+>~]/g,` `).replace(/[#.]/g,` `),[n,r]=Dh(n,mg),t[2]+=r,t.join(``)}function kh(e){return Math.sqrt(e[0]**2+e[1]**2)}function Ah(e,t){return(e[0]*t[0]+e[1]*t[1])/(kh(e)*kh(t))}function jh(e,t){return(e[0]*t[1]`u`?e:e.trim().split(`,`).map(Vh).join(`,`)}function Uh(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 Wh(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:``}}function Gh(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 Kh(e){for(var t=1;t1&&arguments[1]!==void 0&&arguments[1],n=document.createElement(`img`);return t&&(n.crossOrigin=`Anonymous`),new Promise((t,r)=>{n.onload=()=>{t(n)},n.onerror=(e,t,n,i,a)=>{r(a)},n.src=e})}),tg.apply(this,arguments)}function ng(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 rg(e){for(var t=1;t{Pp(),Lp(),em(),nm(),om(),mm(),_m(),Cm(),Em(),Dm(),Om(),ig=u(Am(),1),Pm(),ag=u(Fm(),1),Im(),Lm(),zm(),oh(),sh(),gh(),og=Object.freeze({__proto__:null,offscreen:vh,node:yh}),sg=/^[A-Z-]+$/,cg=/(\[[^\]]+\])/g,lg=/(#[^\s+>~.[:]+)/g,ug=/(\.[^\s+>~.[:]+)/g,dg=/(::[^\s+>~.[:]+|:first-line|:first-letter|:before|:after)/gi,fg=/(:[\w-]+\([^)]*\))/gi,pg=/(:[^\s+>~.[:]+)/g,mg=/([^\s+>~.[:]+)/g,hg=1e-8,gg=class e{constructor(e,t,n){this.document=e,this.name=t,this.value=n,this.isNormalizedColor=!1}static empty(t){return new e(t,`EMPTY`,``)}split(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:` `,{document:n,name:r}=this;return bh(this.getString()).trim().split(t).map(t=>new e(n,r,t))}hasValue(e){var{value:t}=this;return t!==null&&t!==``&&(e||t!==0)&&t!==void 0}isString(e){var{value:t}=this,n=typeof t==`string`;return!n||!e?n:e.test(t)}isUrlDefinition(){return this.isString(/^url\(/)}isPixels(){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}}setValue(e){return this.value=e,this}getValue(e){return e===void 0||this.hasValue()?this.value:e}getNumber(e){if(!this.hasValue())return e===void 0?0:parseFloat(e);var{value:t}=this,n=parseFloat(t);return this.isString(/%$/)&&(n/=100),n}getString(e){return e===void 0||this.hasValue()?this.value===void 0?``:String(this.value):String(e)}getColor(e){var t=this.getString(e);return this.isNormalizedColor?t:(this.isNormalizedColor=!0,t=Eh(t),this.value=t,t)}getDpi(){return 96}getRem(){return this.document.rootEmSize}getEm(){return this.document.emSize}getUnits(){return this.getString().replace(/[0-9.-]/g,``)}getPixels(e){var t=arguments.length>1&&arguments[1]!==void 0&&arguments[1];if(!this.hasValue())return 0;var[n,r]=typeof e==`boolean`?[void 0,e]:[e],{viewPort:i}=this.document.screen;switch(!0){case this.isString(/vmin$/):return this.getNumber()/100*Math.min(i.computeSize(`x`),i.computeSize(`y`));case this.isString(/vmax$/):return this.getNumber()/100*Math.max(i.computeSize(`x`),i.computeSize(`y`));case this.isString(/vw$/):return this.getNumber()/100*i.computeSize(`x`);case this.isString(/vh$/):return this.getNumber()/100*i.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 this.getNumber()*15;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(/%$/)&&r:return this.getNumber()*this.getEm();case this.isString(/%$/):return this.getNumber()*i.computeSize(n);default:var a=this.getNumber();return t&&a<1?a*i.computeSize(n):a}}getMilliseconds(){return this.hasValue()?this.isString(/ms$/)?this.getNumber():this.getNumber()*1e3:0}getRadians(){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)}}getDefinition(){var e=this.getString(),t=/#([^)'"]+)/.exec(e);return t&&(t=t[1]),t||(t=e),this.document.definitions[t]}getFillStyleDefinition(e,t){var n=this.getDefinition();if(!n)return null;if(typeof n.createGradient==`function`)return n.createGradient(this.document.ctx,e,t);if(typeof n.createPattern==`function`){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}getTextBaseline(){return this.hasValue()?e.textBaselineMapping[this.getString()]:null}addOpacity(t){for(var n=this.getColor(),r=n.length,i=0,a=0;a1&&arguments[1]!==void 0?arguments[1]:0,[r=n,i=n]=Ch(t);return new e(r,i)}static parseScale(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,[r=n,i=r]=Ch(t);return new e(r,i)}static parsePath(t){for(var n=Ch(t),r=n.length,i=[],a=0;a0}runEvents(){if(this.working){var{screen:e,events:t,eventElements:n}=this,{style:r}=e.ctx.canvas;r&&(r.cursor=``),t.forEach((e,t)=>{for(var{run:r}=e,i=n[t];i;)r(i),i=i.parent}),this.events=[],this.eventElements=[]}}checkPath(e,t){if(this.working&&t){var{events:n,eventElements:r}=this;n.forEach((n,i)=>{var{x:a,y:o}=n;!r[i]&&t.isPointInPath&&t.isPointInPath(a,o)&&(r[i]=e)})}}checkBoundingBox(e,t){if(this.working&&t){var{events:n,eventElements:r}=this;n.forEach((n,i)=>{var{x:a,y:o}=n;!r[i]&&t.isPointInBox(a,o)&&(r[i]=e)})}}mapXY(e,t){for(var{window:n,ctx:r}=this.screen,i=new vg(e,t),a=r.canvas;a;)i.x-=a.offsetLeft,i.y-=a.offsetTop,a=a.offsetParent;return n.scrollX&&(i.x+=n.scrollX),n.scrollY&&(i.y+=n.scrollY),i}onClick(e){var{x:t,y:n}=this.mapXY(e.clientX,e.clientY);this.events.push({type:`onclick`,x:t,y:n,run(e){e.onClick&&e.onClick()}})}onMouseMove(e){var{x:t,y:n}=this.mapXY(e.clientX,e.clientY);this.events.push({type:`onmousemove`,x:t,y:n,run(e){e.onMouseMove&&e.onMouseMove()}})}},bg=typeof window<`u`?window:null,xg=typeof fetch<`u`?fetch.bind(void 0):null,Sg=class{constructor(e){var{fetch:t=xg,window:n=bg}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.ctx=e,this.FRAMERATE=30,this.MAX_VIRTUAL_PIXELS=3e4,this.CLIENT_WIDTH=800,this.CLIENT_HEIGHT=600,this.viewPort=new _g,this.mouse=new yg(this),this.animations=[],this.waits=[],this.frameDuration=0,this.isReadyLock=!1,this.isFirstRender=!0,this.intervalId=null,this.window=n,this.fetch=t}wait(e){this.waits.push(e)}ready(){return this.readyPromise?this.readyPromise:Promise.resolve()}isReady(){if(this.isReadyLock)return!0;var e=this.waits.every(e=>e());return e&&(this.waits=[],this.resolveReady&&this.resolveReady()),this.isReadyLock=e,e}setDefaults(e){e.strokeStyle=`rgba(0,0,0,0)`,e.lineCap=`butt`,e.lineJoin=`miter`,e.miterLimit=4}setViewBox(e){var{document:t,ctx:n,aspectRatio:r,width:i,desiredWidth:a,height:o,desiredHeight:s,minX:c=0,minY:l=0,refX:u,refY:d,clip:f=!1,clipX:p=0,clipY:m=0}=e,[h,g]=bh(r).replace(/^defer\s/,``).split(` `),_=h||`xMidYMid`,v=g||`meet`,y=i/a,b=o/s,x=Math.min(y,b),S=Math.max(y,b),C=a,w=s;v===`meet`&&(C*=x,w*=x),v===`slice`&&(C*=S,w*=S);var T=new gg(t,`refX`,u),E=new gg(t,`refY`,d),D=T.hasValue()&&E.hasValue();if(D&&n.translate(-x*T.getPixels(`x`),-x*E.getPixels(`y`)),f){var O=x*p,k=x*m;n.beginPath(),n.moveTo(O,k),n.lineTo(i,k),n.lineTo(i,o),n.lineTo(O,o),n.closePath(),n.clip()}if(!D){var A=v===`meet`&&x===b,j=v===`slice`&&S===b,M=v===`meet`&&x===y,N=v===`slice`&&S===y;_.startsWith(`xMid`)&&(A||j)&&n.translate(i/2-C/2,0),_.endsWith(`YMid`)&&(M||N)&&n.translate(0,o/2-w/2),_.startsWith(`xMax`)&&(A||j)&&n.translate(i-C,0),_.endsWith(`YMax`)&&(M||N)&&n.translate(0,o-w)}switch(!0){case _===`none`:n.scale(y,b);break;case v===`meet`:n.scale(x,x);break;case v===`slice`:n.scale(S,S)}n.translate(-c,-l)}start(e){var{enableRedraw:t=!1,ignoreMouse:n=!1,ignoreAnimation:r=!1,ignoreDimensions:i=!1,ignoreClear:a=!1,forceRedraw:o,scaleWidth:s,scaleHeight:c,offsetX:l,offsetY:u}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{FRAMERATE:d,mouse:f}=this,p=1e3/d;if(this.frameDuration=p,this.readyPromise=new Promise(e=>{this.resolveReady=e}),this.isReady()&&this.render(e,i,a,s,c,l,u),t){var m=Date.now(),h=m,g=0,_=()=>{m=Date.now(),g=m-h,g>=p&&(h=m-g%p,this.shouldUpdate(r,o)&&(this.render(e,i,a,s,c,l,u),f.runEvents())),this.intervalId=(0,ig.default)(_)};n||f.start(),this.intervalId=(0,ig.default)(_)}}stop(){this.intervalId&&(ig.default.cancel(this.intervalId),this.intervalId=null),this.mouse.stop()}shouldUpdate(e,t){if(!e){var{frameDuration:n}=this;if(this.animations.reduce((e,t)=>t.update(n)||e,!1))return!0}return!!(typeof t==`function`&&t()||!this.isReadyLock&&this.isReady()||this.mouse.hasEvents())}render(e,t,n,r,i,a,o){var{CLIENT_WIDTH:s,CLIENT_HEIGHT:c,viewPort:l,ctx:u,isFirstRender:d}=this,f=u.canvas;l.clear(),f.width&&f.height?l.setCurrent(f.width,f.height):l.setCurrent(s,c);var p=e.getStyle(`width`),m=e.getStyle(`height`);!t&&(d||typeof r!=`number`&&typeof i!=`number`)&&(p.hasValue()&&(f.width=p.getPixels(`x`),f.style&&(f.style.width=`${f.width}px`)),m.hasValue()&&(f.height=m.getPixels(`y`),f.style&&(f.style.height=`${f.height}px`)));var h=f.clientWidth||f.width,g=f.clientHeight||f.height;if(t&&p.hasValue()&&m.hasValue()&&(h=p.getPixels(`x`),g=m.getPixels(`y`)),l.setCurrent(h,g),typeof a==`number`&&e.getAttribute(`x`,!0).setValue(a),typeof o==`number`&&e.getAttribute(`y`,!0).setValue(o),typeof r==`number`||typeof i==`number`){var _=Ch(e.getAttribute(`viewBox`).getString()),v=0,y=0;if(typeof r==`number`){var b=e.getStyle(`width`);b.hasValue()?v=b.getPixels(`x`)/r:isNaN(_[2])||(v=_[2]/r)}if(typeof i==`number`){var x=e.getStyle(`height`);x.hasValue()?y=x.getPixels(`y`)/i:isNaN(_[3])||(y=_[3]/i)}v||(v=y),y||(y=v),e.getAttribute(`width`,!0).setValue(r),e.getAttribute(`height`,!0).setValue(i);var S=e.getStyle(`transform`,!0,!0);S.setValue(`${S.getString()} scale(${1/v}, ${1/y})`)}n||u.clearRect(0,0,h,g),e.render(u),d&&(this.isFirstRender=!1)}},Sg.defaultWindow=bg,Sg.defaultFetch=xg,{defaultFetch:Cg}=Sg,wg=typeof DOMParser<`u`?DOMParser:null,Tg=class{constructor(){var{fetch:e=Cg,DOMParser:t=wg}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.fetch=e,this.DOMParser=t}parse(e){var t=this;return Ip(function*(){return e.startsWith(`<`)?t.parseFromString(e):t.load(e)})()}parseFromString(e){var t=new this.DOMParser;try{return this.checkDocument(t.parseFromString(e,`image/svg+xml`))}catch{return this.checkDocument(t.parseFromString(e,`text/xml`))}}checkDocument(e){var t=e.getElementsByTagName(`parsererror`)[0];if(t)throw Error(t.textContent);return e}load(e){var t=this;return Ip(function*(){var n=yield(yield t.fetch(e)).text();return t.parseFromString(n)})()}},Eg=class{constructor(e,t){this.type=`translate`,this.point=null,this.point=vg.parse(t)}apply(e){var{x:t,y:n}=this.point;e.translate(t||0,n||0)}unapply(e){var{x:t,y:n}=this.point;e.translate(-1*t||0,-1*n||0)}applyToPoint(e){var{x:t,y:n}=this.point;e.applyTransform([1,0,0,1,t||0,n||0])}},Dg=class{constructor(e,t,n){this.type=`rotate`,this.angle=null,this.originX=null,this.originY=null,this.cx=0,this.cy=0;var r=Ch(t);this.angle=new gg(e,`angle`,r[0]),this.originX=n[0],this.originY=n[1],this.cx=r[1]||0,this.cy=r[2]||0}apply(e){var{cx:t,cy:n,originX:r,originY:i,angle:a}=this,o=t+r.getPixels(`x`),s=n+i.getPixels(`y`);e.translate(o,s),e.rotate(a.getRadians()),e.translate(-o,-s)}unapply(e){var{cx:t,cy:n,originX:r,originY:i,angle:a}=this,o=t+r.getPixels(`x`),s=n+i.getPixels(`y`);e.translate(o,s),e.rotate(-1*a.getRadians()),e.translate(-o,-s)}applyToPoint(e){var{cx:t,cy:n,angle:r}=this,i=r.getRadians();e.applyTransform([1,0,0,1,t||0,n||0]),e.applyTransform([Math.cos(i),Math.sin(i),-Math.sin(i),Math.cos(i),0,0]),e.applyTransform([1,0,0,1,-t||0,-n||0])}},Og=class{constructor(e,t,n){this.type=`scale`,this.scale=null,this.originX=null,this.originY=null;var r=vg.parseScale(t);(r.x===0||r.y===0)&&(r.x=hg,r.y=hg),this.scale=r,this.originX=n[0],this.originY=n[1]}apply(e){var{scale:{x:t,y:n},originX:r,originY:i}=this,a=r.getPixels(`x`),o=i.getPixels(`y`);e.translate(a,o),e.scale(t,n||t),e.translate(-a,-o)}unapply(e){var{scale:{x:t,y:n},originX:r,originY:i}=this,a=r.getPixels(`x`),o=i.getPixels(`y`);e.translate(a,o),e.scale(1/t,1/n||t),e.translate(-a,-o)}applyToPoint(e){var{x:t,y:n}=this.scale;e.applyTransform([t||0,0,0,n||0,0,0])}},kg=class{constructor(e,t,n){this.type=`matrix`,this.matrix=[],this.originX=null,this.originY=null,this.matrix=Ch(t),this.originX=n[0],this.originY=n[1]}apply(e){var{originX:t,originY:n,matrix:r}=this,i=t.getPixels(`x`),a=n.getPixels(`y`);e.translate(i,a),e.transform(r[0],r[1],r[2],r[3],r[4],r[5]),e.translate(-i,-a)}unapply(e){var{originX:t,originY:n,matrix:r}=this,i=r[0],a=r[2],o=r[4],s=r[1],c=r[3],l=r[5],u=0,d=0,f=1,p=1/(i*(c*f-l*d)-a*(s*f-l*u)+o*(s*d-c*u)),m=t.getPixels(`x`),h=n.getPixels(`y`);e.translate(m,h),e.transform(p*(c*f-l*d),p*(l*u-s*f),p*(o*d-a*f),p*(i*f-o*u),p*(a*l-o*c),p*(o*s-i*l)),e.translate(-m,-h)}applyToPoint(e){e.applyTransform(this.matrix)}},Ag=class extends kg{constructor(e,t,n){super(e,t,n),this.type=`skew`,this.angle=null,this.angle=new gg(e,`angle`,t)}},jg=class extends Ag{constructor(e,t,n){super(e,t,n),this.type=`skewX`,this.matrix=[1,0,Math.tan(this.angle.getRadians()),1,0,0]}},Mg=class extends Ag{constructor(e,t,n){super(e,t,n),this.type=`skewY`,this.matrix=[1,Math.tan(this.angle.getRadians()),0,1,0,0]}},Ng=class e{constructor(t,n,r){this.document=t,this.transforms=[],zh(n).forEach(t=>{if(t!==`none`){var[n,i]=Bh(t),a=e.transformTypes[n];a!==void 0&&this.transforms.push(new a(this.document,i,r))}})}static fromElement(t,n){var r=n.getStyle(`transform`,!1,!0),[i,a=i]=n.getStyle(`transform-origin`,!1,!0).split(),o=[i,a];return r.hasValue()?new e(t,r.getString(),o):null}apply(e){for(var{transforms:t}=this,n=t.length,r=0;r=0;n--)t[n].unapply(e)}applyToPoint(e){for(var{transforms:t}=this,n=t.length,r=0;r2&&arguments[2]!==void 0&&arguments[2];if(this.document=e,this.node=t,this.captureTextNodes=n,this.attributes=Object.create(null),this.styles=Object.create(null),this.stylesSpecificity=Object.create(null),this.animationFrozen=!1,this.animationFrozenValue=``,this.parent=null,this.children=[],t&&t.nodeType===1){Array.from(t.attributes).forEach(t=>{var n=wh(t.nodeName);this.attributes[n]=new gg(e,n,t.value)}),this.addStylesFromStyleDefinition(),this.getAttribute(`style`).hasValue()&&this.getAttribute(`style`).getString().split(`;`).map(e=>e.trim()).forEach(t=>{if(t){var[n,r]=t.split(`:`).map(e=>e.trim());this.styles[n]=new gg(e,n,r)}});var{definitions:r}=e,i=this.getAttribute(`id`);i.hasValue()&&(r[i.getString()]||(r[i.getString()]=this)),Array.from(t.childNodes).forEach(t=>{if(t.nodeType===1)this.addChild(t);else if(n&&(t.nodeType===3||t.nodeType===4)){var r=e.createTextNode(t);r.getText().length>0&&this.addChild(r)}})}}getAttribute(e){var t=arguments.length>1&&arguments[1]!==void 0&&arguments[1],n=this.attributes[e];if(!n&&t){var r=new gg(this.document,e,``);return this.attributes[e]=r,r}return n||gg.empty(this.document)}getHrefAttribute(){for(var e in this.attributes)if(e===`href`||e.endsWith(`:href`))return this.attributes[e];return gg.empty(this.document)}getStyle(e){var t=arguments.length>1&&arguments[1]!==void 0&&arguments[1],n=arguments.length>2&&arguments[2]!==void 0&&arguments[2],r=this.styles[e];if(r)return r;var i=this.getAttribute(e);if(i!=null&&i.hasValue())return this.styles[e]=i,i;if(!n){var{parent:a}=this;if(a){var o=a.getStyle(e);if(o!=null&&o.hasValue())return o}}if(t){var s=new gg(this.document,e,``);return this.styles[e]=s,s}return r||gg.empty(this.document)}render(e){if(this.getStyle(`display`).getString()!==`none`&&this.getStyle(`visibility`).getString()!==`hidden`){if(e.save(),this.getStyle(`mask`).hasValue()){var t=this.getStyle(`mask`).getDefinition();t&&(this.applyEffects(e),t.apply(e,this))}else if(this.getStyle(`filter`).getValue(`none`)!==`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()}}setContext(e){}applyEffects(e){var t=Ng.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)}}clearContext(e){}renderChildren(e){this.children.forEach(t=>{t.render(e)})}addChild(t){var n=t instanceof e?t:this.document.createElement(t);n.parent=this,e.ignoreChildTypes.includes(n.type)||this.children.push(n)}matchesSelector(e){var{node:t}=this;if(typeof t.matches==`function`)return t.matches(e);var n=t.getAttribute?.call(t,`class`);return!n||n===``?!1:n.split(` `).some(t=>`.${t}`===e)}addStylesFromStyleDefinition(){var{styles:e,stylesSpecificity:t}=this.document;for(var n in e)if(!n.startsWith(`@`)&&this.matchesSelector(n)){var r=e[n],i=t[n];if(r)for(var a in r){var o=this.stylesSpecificity[a];o===void 0&&(o=`000`),i>=o&&(this.styles[a]=r[a],this.stylesSpecificity[a]=i)}}}removeStyles(e,t){return t.reduce((t,n)=>{var r=e.getStyle(n);if(!r.hasValue())return t;var i=r.getString();return r.setValue(``),[...t,[n,i]]},[])}restoreStyles(e,t){t.forEach(t=>{var[n,r]=t;e.getStyle(n,!0).setValue(r)})}isFirstChild(){return this.parent?.children.indexOf(this)===0}},Pg.ignoreChildTypes=[`title`],Fg=class extends Pg{constructor(e,t,n){super(e,t,n)}},Ig=class e{constructor(t,n,r,i,a,o){var s=o?typeof o==`string`?e.parse(o):o:{};this.fontFamily=a||s.fontFamily,this.fontSize=i||s.fontSize,this.fontStyle=t||s.fontStyle,this.fontWeight=r||s.fontWeight,this.fontVariant=n||s.fontVariant}static parse(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:``,n=arguments.length>1?arguments[1]:void 0,r=``,i=``,a=``,o=``,s=``,c=bh(t).trim().split(` `),l={fontSize:!1,fontStyle:!1,fontWeight:!1,fontVariant:!1};return c.forEach(t=>{switch(!0){case!l.fontStyle&&e.styles.includes(t):t!==`inherit`&&(r=t),l.fontStyle=!0;break;case!l.fontVariant&&e.variants.includes(t):t!==`inherit`&&(i=t),l.fontStyle=!0,l.fontVariant=!0;break;case!l.fontWeight&&e.weights.includes(t):t!==`inherit`&&(a=t),l.fontStyle=!0,l.fontVariant=!0,l.fontWeight=!0;break;case!l.fontSize:t!==`inherit`&&([o]=t.split(`/`)),l.fontStyle=!0,l.fontVariant=!0,l.fontWeight=!0,l.fontSize=!0;break;default:t!==`inherit`&&(s+=t)}}),new e(r,i,a,o,s,n)}toString(){return[Uh(this.fontStyle),this.fontVariant,Wh(this.fontWeight),this.fontSize,Hh(this.fontFamily)].join(` `).trim()}},Ig.styles=`normal|italic|oblique|inherit`,Ig.variants=`normal|small-caps|inherit`,Ig.weights=`normal|bold|bolder|lighter|100|200|300|400|500|600|700|800|900|inherit`,Lg=class{constructor(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:NaN,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:NaN,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:NaN,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:NaN;this.x1=e,this.y1=t,this.x2=n,this.y2=r,this.addPoint(e,t),this.addPoint(n,r)}get x(){return this.x1}get y(){return this.y1}get width(){return this.x2-this.x1}get height(){return this.y2-this.y1}addPoint(e,t){e!==void 0&&((isNaN(this.x1)||isNaN(this.x2))&&(this.x1=e,this.x2=e),ethis.x2&&(this.x2=e)),t!==void 0&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=t,this.y2=t),tthis.y2&&(this.y2=t))}addX(e){this.addPoint(e,null)}addY(e){this.addPoint(null,e)}addBoundingBox(e){if(e){var{x1:t,y1:n,x2:r,y2:i}=e;this.addPoint(t,n),this.addPoint(r,i)}}sumCubic(e,t,n,r,i){return(1-e)**3*t+3*(1-e)**2*e*n+3*(1-e)*e**2*r+e**3*i}bezierCurveAdd(e,t,n,r,i){var a=6*t-12*n+6*r,o=-3*t+9*n-9*r+3*i,s=3*n-3*t;if(o===0){if(a===0)return;var c=-s/a;0=t.length-1}next(){var e=this.commands[++this.i];return this.previousCommand=this.command,this.command=e,e}getPoint(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:`x`,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:`y`,n=new vg(this.command[e],this.command[t]);return this.makeAbsolute(n)}getAsControlPoint(e,t){var n=this.getPoint(e,t);return this.control=n,n}getAsCurrentPoint(e,t){var n=this.getPoint(e,t);return this.current=n,n}getReflectedControlPoint(){var e=this.previousCommand.type;if(e!==$.CURVE_TO&&e!==$.SMOOTH_CURVE_TO&&e!==$.QUAD_TO&&e!==$.SMOOTH_QUAD_TO)return this.current;var{current:{x:t,y:n},control:{x:r,y:i}}=this;return new vg(2*t-r,2*n-i)}makeAbsolute(e){if(this.command.relative){var{x:t,y:n}=this.current;e.x+=t,e.y+=n}return e}addMarker(e,t,n){var{points:r,angles:i}=this;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)}addMarkerAngle(e,t){this.points.push(e),this.angles.push(t)}getMarkerPoints(){return this.points}getMarkerAngles(){for(var{angles:e}=this,t=e.length,n=0;n1&&arguments[1]!==void 0&&arguments[1];if(!t){var n=this.getStyle(`fill`),r=this.getStyle(`fill-opacity`),i=this.getStyle(`stroke`),a=this.getStyle(`stroke-opacity`);if(n.isUrlDefinition()){var o=n.getFillStyleDefinition(this,r);o&&(e.fillStyle=o)}else if(n.hasValue()){n.getString()===`currentColor`&&n.setValue(this.getStyle(`color`).getColor());var s=n.getColor();s!==`inherit`&&(e.fillStyle=s===`none`?`rgba(0,0,0,0)`:s)}if(r.hasValue()&&(e.fillStyle=new gg(this.document,`fill`,e.fillStyle).addOpacity(r).getColor()),i.isUrlDefinition()){var c=i.getFillStyleDefinition(this,a);c&&(e.strokeStyle=c)}else if(i.hasValue()){i.getString()===`currentColor`&&i.setValue(this.getStyle(`color`).getColor());var l=i.getString();l!==`inherit`&&(e.strokeStyle=l===`none`?`rgba(0,0,0,0)`:l)}a.hasValue()&&(e.strokeStyle=new gg(this.document,`stroke`,e.strokeStyle).addOpacity(a).getString());var u=this.getStyle(`stroke-width`);u.hasValue()&&(e.lineWidth=u.getPixels()||hg);var d=this.getStyle(`stroke-linecap`),f=this.getStyle(`stroke-linejoin`),p=this.getStyle(`stroke-miterlimit`),m=this.getStyle(`stroke-dasharray`),h=this.getStyle(`stroke-dashoffset`);if(d.hasValue()&&(e.lineCap=d.getString()),f.hasValue()&&(e.lineJoin=f.getString()),p.hasValue()&&(e.miterLimit=p.getNumber()),m.hasValue()&&m.getString()!==`none`){var g=Ch(m.getString());e.setLineDash===void 0?e.webkitLineDash===void 0?e.mozDash!==void 0&&(g.length!==1||g[0]!==0)&&(e.mozDash=g):e.webkitLineDash=g:e.setLineDash(g);var _=h.getPixels();e.lineDashOffset===void 0?e.webkitLineDashOffset===void 0?e.mozDashOffset!==void 0&&(e.mozDashOffset=_):e.webkitLineDashOffset=_:e.lineDashOffset=_}}if(this.modifiedEmSizeStack=!1,e.font!==void 0){var v=this.getStyle(`font`),y=this.getStyle(`font-style`),b=this.getStyle(`font-variant`),x=this.getStyle(`font-weight`),S=this.getStyle(`font-size`),C=this.getStyle(`font-family`),w=new Ig(y.getString(),b.getString(),x.getString(),S.hasValue()?`${S.getPixels(!0)}px`:``,C.getString(),Ig.parse(v.getString(),e.font));y.setValue(w.fontStyle),b.setValue(w.fontVariant),x.setValue(w.fontWeight),S.setValue(w.fontSize),C.setValue(w.fontFamily),e.font=w.toString(),S.isPixels()&&(this.document.emSize=S.getPixels(),this.modifiedEmSizeStack=!0)}t||(this.applyEffects(e),e.globalAlpha=this.calculateOpacity())}clearContext(e){super.clearContext(e),this.modifiedEmSizeStack&&this.document.popEmSize()}},Bg=class e extends zg{constructor(e,t,n){super(e,t,n),this.type=`path`,this.pathParser=null,this.pathParser=new Rg(this.getAttribute(`d`).getString())}path(e){var{pathParser:t}=this,n=new Lg;for(t.reset(),e&&e.beginPath();!t.isEnd();)switch(t.next().type){case Rg.MOVE_TO:this.pathM(e,n);break;case Rg.LINE_TO:this.pathL(e,n);break;case Rg.HORIZ_LINE_TO:this.pathH(e,n);break;case Rg.VERT_LINE_TO:this.pathV(e,n);break;case Rg.CURVE_TO:this.pathC(e,n);break;case Rg.SMOOTH_CURVE_TO:this.pathS(e,n);break;case Rg.QUAD_TO:this.pathQ(e,n);break;case Rg.SMOOTH_QUAD_TO:this.pathT(e,n);break;case Rg.ARC:this.pathA(e,n);break;case Rg.CLOSE_PATH:this.pathZ(e,n)}return n}getBoundingBox(e){return this.path()}getMarkers(){var{pathParser:e}=this,t=e.getMarkerPoints(),n=e.getMarkerAngles();return t.map((e,t)=>[e,n[t]])}renderChildren(e){this.path(e),this.document.screen.mouse.checkPath(this,e);var t=this.getStyle(`fill-rule`);e.fillStyle!==``&&(t.getString(`inherit`)===`inherit`?e.fill():e.fill(t.getString())),e.strokeStyle!==``&&(this.getAttribute(`vector-effect`).getString()===`non-scaling-stroke`?(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`),a=this.getStyle(`marker-mid`),o=this.getStyle(`marker-end`);if(i.isUrlDefinition()){var s=i.getDefinition(),[c,l]=n[0];s.render(e,c,l)}if(a.isUrlDefinition())for(var u=a.getDefinition(),d=1;d1&&(r*=Math.sqrt(d),i*=Math.sqrt(d));var f=(o===s?-1:1)*Math.sqrt((r**2*i**2-r**2*u.y**2-i**2*u.x**2)/(r**2*u.y**2+i**2*u.x**2));isNaN(f)&&(f=0);var p=new vg(f*r*u.y/i,f*-i*u.x/r),m=new vg((t.x+l.x)/2+Math.cos(c)*p.x-Math.sin(c)*p.y,(t.y+l.y)/2+Math.sin(c)*p.x+Math.cos(c)*p.y),h=jh([1,0],[(u.x-p.x)/r,(u.y-p.y)/i]),g=[(u.x-p.x)/r,(u.y-p.y)/i],_=[(-u.x-p.x)/r,(-u.y-p.y)/i],v=jh(g,_);return Ah(g,_)<=-1&&(v=Math.PI),Ah(g,_)>=1&&(v=0),{currentPoint:l,rX:r,rY:i,sweepFlag:s,xAxisRotation:c,centp:m,a1:h,ad:v}}pathA(t,n){var{pathParser:r}=this,{currentPoint:i,rX:a,rY:o,sweepFlag:s,xAxisRotation:c,centp:l,a1:u,ad:d}=e.pathA(r),f=1-s?1:-1,p=u+d/2*f,m=new vg(l.x+a*Math.cos(p),l.y+o*Math.sin(p));if(r.addMarkerAngle(m,p-f*Math.PI/2),r.addMarkerAngle(i,p-f*Math.PI),n.addPoint(i.x,i.y),t&&!isNaN(u)&&!isNaN(d)){var h=a>o?a:o,g=a>o?1:a/o,_=a>o?o/a:1;t.translate(l.x,l.y),t.rotate(c),t.scale(g,_),t.arc(0,0,h,u,u+d,!!(1-s)),t.scale(1/g,1/_),t.rotate(-c),t.translate(-l.x,-l.y)}}static pathZ(e){e.current=e.start}pathZ(t,n){e.pathZ(this.pathParser),t&&n.x1!==n.x2&&n.y1!==n.y2&&t.closePath()}},Vg=class extends Bg{constructor(e,t,n){super(e,t,n),this.type=`glyph`,this.horizAdvX=this.getAttribute(`horiz-adv-x`).getNumber(),this.unicode=this.getAttribute(`unicode`).getString(),this.arabicForm=this.getAttribute(`arabic-form`).getString()}},Hg=class e extends zg{constructor(t,n,r){super(t,n,new.target===e||r),this.type=`text`,this.x=0,this.y=0,this.measureCache=-1}setContext(e){var t=arguments.length>1&&arguments[1]!==void 0&&arguments[1];super.setContext(e,t);var n=this.getStyle(`dominant-baseline`).getTextBaseline()||this.getStyle(`alignment-baseline`).getTextBaseline();n&&(e.textBaseline=n)}initializeCoordinates(){this.x=0,this.y=0,this.leafTexts=[],this.textChunkStart=0,this.minX=1/0,this.maxX=-1/0}getBoundingBox(e){if(this.type!==`text`)return this.getTElementBoundingBox(e);this.initializeCoordinates(),this.adjustChildCoordinatesRecursive(e);var t=null;return this.children.forEach((n,r)=>{var i=this.getChildBoundingBox(e,this,this,r);t?t.addBoundingBox(i):t=i}),t}getFontSize(){var{document:e,parent:t}=this,n=Ig.parse(e.ctx.font).fontSize;return t.getStyle(`font-size`).getNumber(n)}getTElementBoundingBox(e){var t=this.getFontSize();return new Lg(this.x,this.y-t,this.x+this.measureText(e),this.y)}getGlyph(e,t,n){var r=t[n],i=null;if(e.isArabic){var a=t.length,o=t[n-1],s=t[n+1],c=`isolated`;if((n===0||o===` `)&&n0&&o!==` `&&n0&&o!==` `&&(n===a-1||s===` `)&&(c=`initial`),e.glyphs[r]!==void 0){var l=e.glyphs[r];i=l instanceof Vg?l:l[c]}}else i=e.glyphs[r];return i||(i=e.missingGlyph),i}getText(){return``}getTextFromNode(e){var t=e||this.node,n=Array.from(t.parentNode.childNodes),r=n.indexOf(t),i=n.length-1,a=bh(t.textContent||``);return r===0&&(a=xh(a)),r===i&&(a=Sh(a)),a}renderChildren(e){if(this.type!==`text`){this.renderTElementChildren(e);return}this.initializeCoordinates(),this.adjustChildCoordinatesRecursive(e),this.children.forEach((t,n)=>{this.renderChild(e,this,this,n)});var{mouse:t}=this.document.screen;t.isWorking()&&t.checkBoundingBox(this,this.getBoundingBox(e))}renderTElementChildren(e){var{document:t,parent:n}=this,r=this.getText(),i=n.getStyle(`font-family`).getDefinition();if(i){for(var{unitsPerEm:a}=i.fontFace,o=Ig.parse(t.ctx.font),s=n.getStyle(`font-size`).getNumber(o.fontSize),c=n.getStyle(`font-style`).getString(o.fontStyle),l=s/a,u=i.isRTL?r.split(``).reverse().join(``):r,d=Ch(n.getAttribute(`dx`).getString()),f=u.length,p=0;p=this.leafTexts.length)){var e=this.leafTexts[this.textChunkStart],t=e.getStyle(`text-anchor`).getString(`start`),n=0;n=t===`start`?e.x-this.minX:t===`end`?e.x-this.maxX:e.x-(this.minX+this.maxX)/2;for(var r=this.textChunkStart;r{this.adjustChildCoordinatesRecursiveCore(e,this,this,n)}),this.applyAnchoring()}adjustChildCoordinatesRecursiveCore(e,t,n,r){var i=n.children[r];i.children.length>0?i.children.forEach((n,r)=>{t.adjustChildCoordinatesRecursiveCore(e,t,i,r)}):this.adjustChildCoordinates(e,t,n,r)}adjustChildCoordinates(e,t,n,r){var i=n.children[r];if(typeof i.measureText!=`function`)return i;e.save(),i.setContext(e,!0);var a=i.getAttribute(`x`),o=i.getAttribute(`y`),s=i.getAttribute(`dx`),c=i.getAttribute(`dy`),l=i.getStyle(`font-family`).getDefinition(),u=!!l&&l.isRTL;r===0&&(a.hasValue()||a.setValue(i.getInheritedAttribute(`x`)),o.hasValue()||o.setValue(i.getInheritedAttribute(`y`)),s.hasValue()||s.setValue(i.getInheritedAttribute(`dx`)),c.hasValue()||c.setValue(i.getInheritedAttribute(`dy`)));var d=i.measureText(e);return u&&(t.x-=d),a.hasValue()?(t.applyAnchoring(),i.x=a.getPixels(`x`),s.hasValue()&&(i.x+=s.getPixels(`x`))):(s.hasValue()&&(t.x+=s.getPixels(`x`)),i.x=t.x),t.x=i.x,u||(t.x+=d),o.hasValue()?(i.y=o.getPixels(`y`),c.hasValue()&&(i.y+=c.getPixels(`y`))):(c.hasValue()&&(t.y+=c.getPixels(`y`)),i.y=t.y),t.y=i.y,t.leafTexts.push(i),t.minX=Math.min(t.minX,i.x,i.x+d),t.maxX=Math.max(t.maxX,i.x,i.x+d),i.clearContext(e),e.restore(),i}getChildBoundingBox(e,t,n,r){var i=n.children[r];if(typeof i.getBoundingBox!=`function`)return null;var a=i.getBoundingBox(e);return a?(i.children.forEach((n,r)=>{var o=t.getChildBoundingBox(e,t,i,r);a.addBoundingBox(o)}),a):null}renderChild(e,t,n,r){var i=n.children[r];i.render(e),i.children.forEach((n,r)=>{t.renderChild(e,t,i,r)})}measureText(e){var{measureCache:t}=this;if(~t)return t;var n=this.getText(),r=this.measureTargetText(e,n);return this.measureCache=r,r}measureTargetText(e,t){if(!t.length)return 0;var{parent:n}=this,r=n.getStyle(`font-family`).getDefinition();if(r){for(var i=this.getFontSize(),a=r.isRTL?t.split(``).reverse().join(``):t,o=Ch(n.getAttribute(`dx`).getString()),s=a.length,c=0,l=0;l0?``:this.getTextFromNode()}getText(){return this.text}},Wg=class extends Ug{constructor(){super(...arguments),this.type=`textNode`}},Gg=class extends zg{constructor(){super(...arguments),this.type=`svg`,this.root=!1}setContext(e){var{document:t}=this,{screen:n,window:r}=t,i=e.canvas;if(n.setDefaults(e),i.style&&e.font!==void 0&&r&&r.getComputedStyle!==void 0){e.font=r.getComputedStyle(i).getPropertyValue(`font`);var a=new gg(t,`fontSize`,Ig.parse(e.font).fontSize);a.hasValue()&&(t.rootEmSize=a.getPixels(`y`),t.emSize=t.rootEmSize)}this.getAttribute(`x`).hasValue()||this.getAttribute(`x`,!0).setValue(0),this.getAttribute(`y`).hasValue()||this.getAttribute(`y`,!0).setValue(0);var{width:o,height:s}=n.viewPort;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`),l=this.getAttribute(`refY`),u=this.getAttribute(`viewBox`),d=u.hasValue()?Ch(u.getString()):null,f=!this.root&&this.getStyle(`overflow`).getValue(`hidden`)!==`visible`,p=0,m=0,h=0,g=0;d&&(p=d[0],m=d[1]),this.root||(o=this.getStyle(`width`).getPixels(`x`),s=this.getStyle(`height`).getPixels(`y`),this.type===`marker`&&(h=p,g=m,p=0,m=0)),n.viewPort.setCurrent(o,s),this.node&&(!this.parent||this.node.parentNode?.nodeName===`foreignObject`)&&this.getStyle(`transform`,!1,!0).hasValue()&&!this.getStyle(`transform-origin`,!1,!0).hasValue()&&this.getStyle(`transform-origin`,!0,!0).setValue(`50% 50%`),super.setContext(e),e.translate(this.getAttribute(`x`).getPixels(`x`),this.getAttribute(`y`).getPixels(`y`)),d&&(o=d[2],s=d[3]),t.setViewBox({ctx:e,aspectRatio:this.getAttribute(`preserveAspectRatio`).getString(),width:n.viewPort.width,desiredWidth:o,height:n.viewPort.height,desiredHeight:s,minX:p,minY:m,refX:c.getValue(),refY:l.getValue(),clip:f,clipX:h,clipY:g}),d&&(n.viewPort.removeCurrent(),n.viewPort.setCurrent(o,s))}clearContext(e){super.clearContext(e),this.document.screen.viewPort.removeCurrent()}resize(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e,n=arguments.length>2&&arguments[2]!==void 0&&arguments[2],r=this.getAttribute(`width`,!0),i=this.getAttribute(`height`,!0),a=this.getAttribute(`viewBox`),o=this.getAttribute(`style`),s=r.getNumber(0),c=i.getNumber(0);if(n){if(typeof n==`string`)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),a.hasValue()||a.setValue(`0 0 ${s||e} ${c||t}`),o.hasValue()){var u=this.getStyle(`width`),d=this.getStyle(`height`);u.hasValue()&&u.setValue(`${e}px`),d.hasValue()&&d.setValue(`${t}px`)}}},Kg=class extends Bg{constructor(){super(...arguments),this.type=`rect`}path(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`),a=this.getAttribute(`rx`),o=this.getAttribute(`ry`),s=a.getPixels(`x`),c=o.getPixels(`y`);if(a.hasValue()&&!o.hasValue()&&(c=s),o.hasValue()&&!a.hasValue()&&(s=c),s=Math.min(s,r/2),c=Math.min(c,i/2),e){var l=4*((Math.sqrt(2)-1)/3);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+c-l*c,t+r,n+c),e.lineTo(t+r,n+i-c),e.bezierCurveTo(t+r,n+i-c+l*c,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-c+l*c,t,n+i-c),e.lineTo(t,n+c),e.bezierCurveTo(t,n+c-l*c,t+s-l*s,n,t+s,n),e.closePath())}return new Lg(t,n,t+r,n+i)}getMarkers(){return null}},qg=class extends Bg{constructor(){super(...arguments),this.type=`circle`}path(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,Math.PI*2,!1),e.closePath()),new Lg(t-r,n-r,t+r,n+r)}getMarkers(){return null}},Jg=class extends Bg{constructor(){super(...arguments),this.type=`ellipse`}path(e){var t=4*((Math.sqrt(2)-1)/3),n=this.getAttribute(`rx`).getPixels(`x`),r=this.getAttribute(`ry`).getPixels(`y`),i=this.getAttribute(`cx`).getPixels(`x`),a=this.getAttribute(`cy`).getPixels(`y`);return e&&n>0&&r>0&&(e.beginPath(),e.moveTo(i+n,a),e.bezierCurveTo(i+n,a+t*r,i+t*n,a+r,i,a+r),e.bezierCurveTo(i-t*n,a+r,i-n,a+t*r,i-n,a),e.bezierCurveTo(i-n,a-t*r,i-t*n,a-r,i,a-r),e.bezierCurveTo(i+t*n,a-r,i+n,a-t*r,i+n,a),e.closePath()),new Lg(i-n,a-r,i+n,a+r)}getMarkers(){return null}},Yg=class extends Bg{constructor(){super(...arguments),this.type=`line`}getPoints(){return[new vg(this.getAttribute(`x1`).getPixels(`x`),this.getAttribute(`y1`).getPixels(`y`)),new vg(this.getAttribute(`x2`).getPixels(`x`),this.getAttribute(`y2`).getPixels(`y`))]}path(e){var[{x:t,y:n},{x:r,y:i}]=this.getPoints();return e&&(e.beginPath(),e.moveTo(t,n),e.lineTo(r,i)),new Lg(t,n,r,i)}getMarkers(){var[e,t]=this.getPoints(),n=e.angleTo(t);return[[e,n],[t,n]]}},Xg=class extends Bg{constructor(e,t,n){super(e,t,n),this.type=`polyline`,this.points=[],this.points=vg.parsePath(this.getAttribute(`points`).getString())}path(e){var{points:t}=this,[{x:n,y:r}]=t,i=new Lg(n,r);return e&&(e.beginPath(),e.moveTo(n,r)),t.forEach(t=>{var{x:n,y:r}=t;i.addPoint(n,r),e&&e.lineTo(n,r)}),i}getMarkers(){var{points:e}=this,t=e.length-1,n=[];return e.forEach((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}},Zg=class extends Xg{constructor(){super(...arguments),this.type=`polygon`}path(e){var t=super.path(e),[{x:n,y:r}]=this.points;return e&&(e.lineTo(n,r),e.closePath()),t}},Qg=class extends Pg{constructor(){super(...arguments),this.type=`pattern`}createPattern(e,t,n){var r=this.getStyle(`width`).getPixels(`x`,!0),i=this.getStyle(`height`).getPixels(`y`,!0),a=new Gg(this.document,null);a.attributes.viewBox=new gg(this.document,`viewBox`,this.getAttribute(`viewBox`).getValue()),a.attributes.width=new gg(this.document,`width`,`${r}px`),a.attributes.height=new gg(this.document,`height`,`${i}px`),a.attributes.transform=new gg(this.document,`transform`,this.getAttribute(`patternTransform`).getValue()),a.children=this.children;var o=this.document.createCanvas(r,i),s=o.getContext(`2d`),c=this.getAttribute(`x`),l=this.getAttribute(`y`);c.hasValue()&&l.hasValue()&&s.translate(c.getPixels(`x`,!0),l.getPixels(`y`,!0)),n.hasValue()?this.styles[`fill-opacity`]=n:Reflect.deleteProperty(this.styles,`fill-opacity`);for(var u=-1;u<=1;u++)for(var d=-1;d<=1;d++)s.save(),a.attributes.x=new gg(this.document,`x`,u*o.width),a.attributes.y=new gg(this.document,`y`,d*o.height),a.render(s),s.restore();return e.createPattern(o,`repeat`)}},$g=class extends Pg{constructor(){super(...arguments),this.type=`marker`}render(e,t,n){if(t){var{x:r,y:i}=t,a=this.getAttribute(`orient`).getString(`auto`),o=this.getAttribute(`markerUnits`).getString(`strokeWidth`);e.translate(r,i),a===`auto`&&e.rotate(n),o===`strokeWidth`&&e.scale(e.lineWidth,e.lineWidth),e.save();var s=new Gg(this.document,null);s.type=this.type,s.attributes.viewBox=new gg(this.document,`viewBox`,this.getAttribute(`viewBox`).getValue()),s.attributes.refX=new gg(this.document,`refX`,this.getAttribute(`refX`).getValue()),s.attributes.refY=new gg(this.document,`refY`,this.getAttribute(`refY`).getValue()),s.attributes.width=new gg(this.document,`width`,this.getAttribute(`markerWidth`).getValue()),s.attributes.height=new gg(this.document,`height`,this.getAttribute(`markerHeight`).getValue()),s.attributes.overflow=new gg(this.document,`overflow`,this.getAttribute(`overflow`).getValue()),s.attributes.fill=new gg(this.document,`fill`,this.getAttribute(`fill`).getColor(`black`)),s.attributes.stroke=new gg(this.document,`stroke`,this.getAttribute(`stroke`).getValue(`none`)),s.children=this.children,s.render(e),e.restore(),o===`strokeWidth`&&e.scale(1/e.lineWidth,1/e.lineWidth),a===`auto`&&e.rotate(-n),e.translate(-r,-i)}}},e_=class extends Pg{constructor(){super(...arguments),this.type=`defs`}render(){}},t_=class extends zg{constructor(){super(...arguments),this.type=`g`}getBoundingBox(e){var t=new Lg;return this.children.forEach(n=>{t.addBoundingBox(n.getBoundingBox(e))}),t}},n_=class extends Pg{constructor(e,t,n){super(e,t,n),this.attributesToInherit=[`gradientUnits`],this.stops=[];var{stops:r,children:i}=this;i.forEach(e=>{e.type===`stop`&&r.push(e)})}getGradientUnits(){return this.getAttribute(`gradientUnits`).getString(`objectBoundingBox`)}createGradient(e,t,n){var r=this;this.getHrefAttribute().hasValue()&&(r=this.getHrefAttribute().getDefinition(),this.inheritStopContainer(r));var{stops:i}=r,a=this.getGradient(e,t);if(!a)return this.addParentOpacity(n,i[i.length-1].color);if(i.forEach(e=>{a.addColorStop(e.offset,this.addParentOpacity(n,e.color))}),this.getAttribute(`gradientTransform`).hasValue()){var{document:o}=this,{MAX_VIRTUAL_PIXELS:s,viewPort:c}=o.screen,[l]=c.viewPorts,u=new Kg(o,null);u.attributes.x=new gg(o,`x`,-s/3),u.attributes.y=new gg(o,`y`,-s/3),u.attributes.width=new gg(o,`width`,s),u.attributes.height=new gg(o,`height`,s);var d=new t_(o,null);d.attributes.transform=new gg(o,`transform`,this.getAttribute(`gradientTransform`).getValue()),d.children=[u];var f=new Gg(o,null);f.attributes.x=new gg(o,`x`,0),f.attributes.y=new gg(o,`y`,0),f.attributes.width=new gg(o,`width`,l.width),f.attributes.height=new gg(o,`height`,l.height),f.children=[d];var p=o.createCanvas(l.width,l.height),m=p.getContext(`2d`);return m.fillStyle=a,f.render(m),m.createPattern(p,`no-repeat`)}return a}inheritStopContainer(e){this.attributesToInherit.forEach(t=>{!this.getAttribute(t).hasValue()&&e.getAttribute(t).hasValue()&&this.getAttribute(t,!0).setValue(e.getAttribute(t).getValue())})}addParentOpacity(e,t){return e.hasValue()?new gg(this.document,`color`,t).addOpacity(e).getColor():t}},r_=class extends n_{constructor(e,t,n){super(e,t,n),this.type=`linearGradient`,this.attributesToInherit.push(`x1`,`y1`,`x2`,`y2`)}getGradient(e,t){var n=this.getGradientUnits()===`objectBoundingBox`,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`),a=n?r.y+r.height*this.getAttribute(`y1`).getNumber():this.getAttribute(`y1`).getPixels(`y`),o=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===o&&a===s?null:e.createLinearGradient(i,a,o,s)}},i_=class extends n_{constructor(e,t,n){super(e,t,n),this.type=`radialGradient`,this.attributesToInherit.push(`cx`,`cy`,`r`,`fx`,`fy`,`fr`)}getGradient(e,t){var n=this.getGradientUnits()===`objectBoundingBox`,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`),a=n?r.y+r.height*this.getAttribute(`cy`).getNumber():this.getAttribute(`cy`).getPixels(`y`),o=i,s=a;this.getAttribute(`fx`).hasValue()&&(o=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 c=n?(r.width+r.height)/2*this.getAttribute(`r`).getNumber():this.getAttribute(`r`).getPixels(),l=this.getAttribute(`fr`).getPixels();return e.createRadialGradient(o,s,l,i,a,c)}},a_=class extends Pg{constructor(e,t,n){super(e,t,n),this.type=`stop`;var r=Math.max(0,Math.min(1,this.getAttribute(`offset`).getNumber())),i=this.getStyle(`stop-opacity`),a=this.getStyle(`stop-color`,!0);a.getString()===``&&a.setValue(`#000`),i.hasValue()&&(a=a.addOpacity(i)),this.offset=r,this.color=a.getColor()}},o_=class extends Pg{constructor(e,t,n){super(e,t,n),this.type=`animate`,this.duration=0,this.initialValue=null,this.initialUnits=``,this.removed=!1,this.frozen=!1,e.screen.animations.push(this),this.begin=this.getAttribute(`begin`).getMilliseconds(),this.maxDuration=this.begin+this.getAttribute(`dur`).getMilliseconds(),this.from=this.getAttribute(`from`),this.to=this.getAttribute(`to`),this.values=new gg(e,`values`,null);var r=this.getAttribute(`values`);r.hasValue()&&this.values.setValue(r.getString().split(`;`))}getProperty(){var e=this.getAttribute(`attributeType`).getString(),t=this.getAttribute(`attributeName`).getString();return e===`CSS`?this.parent.getStyle(t,!0):this.parent.getAttribute(t,!0)}calcValue(){var{initialUnits:e}=this,{progress:t,from:n,to:r}=this.getProgress(),i=n.getNumber()+(r.getNumber()-n.getNumber())*t;return e===`%`&&(i*=100),`${i}${e}`}update(e){var{parent:t}=this,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(this.getAttribute(`repeatCount`).getString()===`indefinite`||this.getAttribute(`repeatDur`).getString()===`indefinite`)this.duration=0;else if(r===`freeze`&&!this.frozen)this.frozen=!0,t.animationFrozen=!0,t.animationFrozenValue=n.getString();else if(r===`remove`&&!this.removed)return this.removed=!0,n.setValue(t.animationFrozen?t.animationFrozenValue:this.initialValue),!0;return!1}this.duration+=e;var i=!1;if(this.begint+(i[n]-t)*e).join(` `)}},l_=class extends Pg{constructor(e,t,n){super(e,t,n),this.type=`font`,this.glyphs=Object.create(null),this.horizAdvX=this.getAttribute(`horiz-adv-x`).getNumber();var{definitions:r}=e,{children:i}=this;for(var a of i)switch(a.type){case`font-face`:this.fontFace=a;var o=a.getStyle(`font-family`);o.hasValue()&&(r[o.getString()]=this);break;case`missing-glyph`:this.missingGlyph=a;break;case`glyph`:var s=a;s.arabicForm?(this.isRTL=!0,this.isArabic=!0,this.glyphs[s.unicode]===void 0&&(this.glyphs[s.unicode]=Object.create(null)),this.glyphs[s.unicode][s.arabicForm]=s):this.glyphs[s.unicode]=s}}render(){}},u_=class extends Pg{constructor(e,t,n){super(e,t,n),this.type=`font-face`,this.ascent=this.getAttribute(`ascent`).getNumber(),this.descent=this.getAttribute(`descent`).getNumber(),this.unitsPerEm=this.getAttribute(`units-per-em`).getNumber()}},d_=class extends Bg{constructor(){super(...arguments),this.type=`missing-glyph`,this.horizAdvX=0}},f_=class extends Hg{constructor(){super(...arguments),this.type=`tref`}getText(){var e=this.getHrefAttribute().getDefinition();if(e){var t=e.children[0];if(t)return t.getText()}return``}},p_=class extends Hg{constructor(e,t,n){super(e,t,n),this.type=`a`;var{childNodes:r}=t,i=r[0],a=r.length>0&&Array.from(r).every(e=>e.nodeType===3);this.hasText=a,this.text=a?this.getTextFromNode(i):``}getText(){return this.text}renderChildren(e){if(this.hasText){super.renderChildren(e);var{document:t,x:n,y:r}=this,{mouse:i}=t.screen,a=new gg(t,`fontSize`,Ig.parse(t.ctx.font).fontSize);i.isWorking()&&i.checkBoundingBox(this,new Lg(n,r-a.getPixels(`y`),n+this.measureText(e),r))}else if(this.children.length>0){var o=new t_(this.document,null);o.children=this.children,o.parent=this,o.render(e)}}onClick(){var{window:e}=this.document;e&&e.open(this.getHrefAttribute().getString())}onMouseMove(){var e=this.document.ctx;e.canvas.style.cursor=`pointer`}},m_=class extends Hg{constructor(e,t,n){super(e,t,n),this.type=`textPath`,this.textWidth=0,this.textHeight=0,this.pathLength=-1,this.glyphInfo=null,this.letterSpacingCache=[],this.measuresCache=new Map([[``,0]]);var r=this.getHrefAttribute().getDefinition();this.text=this.getTextFromNode(),this.dataArray=this.parsePathData(r)}getText(){return this.text}path(e){var{dataArray:t}=this;e&&e.beginPath(),t.forEach(t=>{var{type:n,points:r}=t;switch(n){case Rg.LINE_TO:e&&e.lineTo(r[0],r[1]);break;case Rg.MOVE_TO:e&&e.moveTo(r[0],r[1]);break;case Rg.CURVE_TO:e&&e.bezierCurveTo(r[0],r[1],r[2],r[3],r[4],r[5]);break;case Rg.QUAD_TO:e&&e.quadraticCurveTo(r[0],r[1],r[2],r[3]);break;case Rg.ARC:var[i,a,o,s,c,l,u,d]=r,f=o>s?o:s,p=o>s?1:o/s,m=o>s?s/o:1;e&&(e.translate(i,a),e.rotate(u),e.scale(p,m),e.arc(0,0,f,c,c+l,!!(1-d)),e.scale(1/p,1/m),e.rotate(-u),e.translate(-i,-a));break;case Rg.CLOSE_PATH:e&&e.closePath()}})}renderChildren(e){this.setTextData(e),e.save();var t=this.parent.getStyle(`text-decoration`).getString(),n=this.getFontSize(),{glyphInfo:r}=this,i=e.fillStyle;t===`underline`&&e.beginPath(),r.forEach((r,i)=>{var{p0:a,p1:o,rotation:s,text:c}=r;e.save(),e.translate(a.x,a.y),e.rotate(s),e.fillStyle&&e.fillText(c,0,0),e.strokeStyle&&e.strokeText(c,0,0),e.restore(),t===`underline`&&(i===0&&e.moveTo(a.x,a.y+n/8),e.lineTo(o.x,o.y+n/5))}),t===`underline`&&(e.lineWidth=n/20,e.strokeStyle=i,e.stroke(),e.closePath()),e.restore()}getLetterSpacingAt(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return this.letterSpacingCache[e]||0}findSegmentToFitChar(e,t,n,r,i,a,o,s,c){var l=a,u=this.measureText(e,s);s===` `&&t===`justify`&&n-1&&(l+=this.getLetterSpacingAt(c));var d=this.textHeight/20,f=this.getEquidistantPointOnPath(l,d,0),p=this.getEquidistantPointOnPath(l+u,d,0),m={p0:f,p1:p},h=f&&p?Math.atan2(p.y-f.y,p.x-f.x):0;if(o){var g=Math.cos(Math.PI/2+h)*o,_=Math.cos(-h)*o;m.p0=Kh(Kh({},f),{},{x:f.x+g,y:f.y+_}),m.p1=Kh(Kh({},p),{},{x:p.x+g,y:p.y+_})}return l+=u,{offset:l,segment:m,rotation:h}}measureText(e,t){var{measuresCache:n}=this,r=t||this.getText();if(n.has(r))return n.get(r);var i=this.measureTargetText(e,r);return n.set(r,i),i}setTextData(e){if(!this.glyphInfo){var t=this.getText(),n=t.split(``),r=t.split(` `).length-1,i=this.parent.getAttribute(`dx`).split().map(e=>e.getPixels(`x`)),a=this.parent.getAttribute(`dy`).getPixels(`y`),o=this.parent.getStyle(`text-anchor`).getString(`start`),s=this.getStyle(`letter-spacing`),c=this.parent.getStyle(`letter-spacing`),l=0;!s.hasValue()||s.getValue()===`inherit`?l=c.getPixels():s.hasValue()&&s.getValue()!==`initial`&&s.getValue()!==`unset`&&(l=s.getPixels());var u=[],d=t.length;this.letterSpacingCache=u;for(var f=0;fn===0?0:e+t||0,0),m=this.measureText(e),h=Math.max(m+p,0);this.textWidth=m,this.textHeight=this.getFontSize(),this.glyphInfo=[];var g=this.getPathLength(),_=this.getStyle(`startOffset`).getNumber(0)*g,v=0;(o===`middle`||o===`center`)&&(v=-h/2),(o===`end`||o===`right`)&&(v=-h),v+=_,n.forEach((t,i)=>{var{offset:s,segment:c,rotation:l}=this.findSegmentToFitChar(e,o,h,g,r,v,a,t,i);v=s,c.p0&&c.p1&&this.glyphInfo.push({text:n[i],p0:c.p0,p1:c.p1,rotation:l})})}}parsePathData(e){if(this.pathLength=-1,!e)return[];var t=[],{pathParser:n}=e;for(n.reset();!n.isEnd();){var{current:r}=n,i=r?r.x:0,a=r?r.y:0,o=n.next(),s=o.type,c=[];switch(o.type){case Rg.MOVE_TO:this.pathM(n,c);break;case Rg.LINE_TO:s=this.pathL(n,c);break;case Rg.HORIZ_LINE_TO:s=this.pathH(n,c);break;case Rg.VERT_LINE_TO:s=this.pathV(n,c);break;case Rg.CURVE_TO:this.pathC(n,c);break;case Rg.SMOOTH_CURVE_TO:s=this.pathS(n,c);break;case Rg.QUAD_TO:this.pathQ(n,c);break;case Rg.SMOOTH_QUAD_TO:s=this.pathT(n,c);break;case Rg.ARC:c=this.pathA(n);break;case Rg.CLOSE_PATH:Bg.pathZ(n)}o.type===Rg.CLOSE_PATH?t.push({type:Rg.CLOSE_PATH,points:[],pathLength:0}):t.push({type:s,points:c,start:{x:i,y:a},pathLength:this.calcLength(i,a,s,c)})}return t}pathM(e,t){var{x:n,y:r}=Bg.pathM(e).point;t.push(n,r)}pathL(e,t){var{x:n,y:r}=Bg.pathL(e).point;return t.push(n,r),Rg.LINE_TO}pathH(e,t){var{x:n,y:r}=Bg.pathH(e).point;return t.push(n,r),Rg.LINE_TO}pathV(e,t){var{x:n,y:r}=Bg.pathV(e).point;return t.push(n,r),Rg.LINE_TO}pathC(e,t){var{point:n,controlPoint:r,currentPoint:i}=Bg.pathC(e);t.push(n.x,n.y,r.x,r.y,i.x,i.y)}pathS(e,t){var{point:n,controlPoint:r,currentPoint:i}=Bg.pathS(e);return t.push(n.x,n.y,r.x,r.y,i.x,i.y),Rg.CURVE_TO}pathQ(e,t){var{controlPoint:n,currentPoint:r}=Bg.pathQ(e);t.push(n.x,n.y,r.x,r.y)}pathT(e,t){var{controlPoint:n,currentPoint:r}=Bg.pathT(e);return t.push(n.x,n.y,r.x,r.y),Rg.QUAD_TO}pathA(e){var{rX:t,rY:n,sweepFlag:r,xAxisRotation:i,centp:a,a1:o,ad:s}=Bg.pathA(e);return r===0&&s>0&&(s-=2*Math.PI),r===1&&s<0&&(s+=2*Math.PI),[a.x,a.y,t,n,o,s,i,r]}calcLength(e,t,n,r){var i=0,a=null,o=null,s=0;switch(n){case Rg.LINE_TO:return this.getLineLength(e,t,r[0],r[1]);case Rg.CURVE_TO:for(i=0,a=this.getPointOnCubicBezier(0,e,t,r[0],r[1],r[2],r[3],r[4],r[5]),s=.01;s<=1;s+=.01)o=this.getPointOnCubicBezier(s,e,t,r[0],r[1],r[2],r[3],r[4],r[5]),i+=this.getLineLength(a.x,a.y,o.x,o.y),a=o;return i;case Rg.QUAD_TO:for(i=0,a=this.getPointOnQuadraticBezier(0,e,t,r[0],r[1],r[2],r[3]),s=.01;s<=1;s+=.01)o=this.getPointOnQuadraticBezier(s,e,t,r[0],r[1],r[2],r[3]),i+=this.getLineLength(a.x,a.y,o.x,o.y),a=o;return i;case Rg.ARC:i=0;var c=r[4],l=r[5],u=r[4]+l,d=Math.PI/180;if(Math.abs(c-u)u;s-=d)o=this.getPointOnEllipticalArc(r[0],r[1],r[2],r[3],s,0),i+=this.getLineLength(a.x,a.y,o.x,o.y),a=o;else for(s=c+d;s5&&arguments[5]!==void 0?arguments[5]:t,o=arguments.length>6&&arguments[6]!==void 0?arguments[6]:n,s=(i-n)/(r-t+hg),c=Math.sqrt(e*e/(1+s*s));rt)return null;var{dataArray:i}=this;for(var a of i){if(a&&(a.pathLength<5e-5||n+a.pathLength+5e-5=0&&s>u)break;r=this.getPointOnEllipticalArc(a.points[0],a.points[1],a.points[2],a.points[3],s,a.points[6]);break;case Rg.CURVE_TO:s=o/a.pathLength,s>1&&(s=1),r=this.getPointOnCubicBezier(s,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 Rg.QUAD_TO:s=o/a.pathLength,s>1&&(s=1),r=this.getPointOnQuadraticBezier(s,a.start.x,a.start.y,a.points[0],a.points[1],a.points[2],a.points[3])}if(r)return r;break}return null}getLineLength(e,t,n,r){return Math.sqrt((n-e)*(n-e)+(r-t)*(r-t))}getPathLength(){return this.pathLength===-1&&(this.pathLength=this.dataArray.reduce((e,t)=>t.pathLength>0?e+t.pathLength:e,0)),this.pathLength}getPointOnCubicBezier(e,t,n,r,i,a,o,s,c){return{x:s*Mh(e)+a*Nh(e)+r*Ph(e)+t*Fh(e),y:c*Mh(e)+o*Nh(e)+i*Ph(e)+n*Fh(e)}}getPointOnQuadraticBezier(e,t,n,r,i,a,o){return{x:a*Ih(e)+r*Lh(e)+t*Rh(e),y:o*Ih(e)+i*Lh(e)+n*Rh(e)}}getPointOnEllipticalArc(e,t,n,r,i,a){var o=Math.cos(a),s=Math.sin(a),c={x:n*Math.cos(i),y:r*Math.sin(i)};return{x:e+(c.x*o-c.y*s),y:t+(c.x*s+c.y*o)}}buildEquidistantCache(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 a=0,o=0;o<=n;o+=r){var s=this.getPointOnPath(o),c=this.getPointOnPath(o+r);s&&c&&(a+=this.getLineLength(s.x,s.y,c.x,c.y),a>=i&&(this.equidistantCache.points.push({x:s.x,y:s.y,distance:o}),a-=i))}}}getEquidistantPointOnPath(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}},h_=/^\s*data:(([^/,;]+\/[^/,;]+)(?:;([^,;=]+=[^,;=]+))?)?(?:;(base64))?,(.*)$/i,g_=class extends zg{constructor(e,t,n){super(e,t,n),this.type=`image`,this.loaded=!1;var r=this.getHrefAttribute().getString();if(r){var i=r.endsWith(`.svg`)||/^\s*data:image\/svg\+xml/i.test(r);e.images.push(this),i?this.loadSvg(r):this.loadImage(r),this.isSvg=i}}loadImage(e){var t=this;return Ip(function*(){try{t.image=yield t.document.createImage(e)}catch(t){console.error(`Error while loading image "${e}":`,t)}t.loaded=!0})()}loadSvg(e){var t=this;return Ip(function*(){var n=h_.exec(e);if(n){var r=n[5];t.image=n[4]===`base64`?atob(r):decodeURIComponent(r)}else try{t.image=yield(yield t.document.fetch(e)).text()}catch(t){console.error(`Error while loading image "${e}":`,t)}t.loaded=!0})()}renderChildren(e){var{document:t,image:n,loaded:r}=this,i=this.getAttribute(`x`).getPixels(`x`),a=this.getAttribute(`y`).getPixels(`y`),o=this.getStyle(`width`).getPixels(`x`),s=this.getStyle(`height`).getPixels(`y`);if(r&&n&&o&&s){if(e.save(),e.translate(i,a),this.isSvg){var c=t.canvg.forkString(e,this.image,{ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0,ignoreClear:!0,offsetX:0,offsetY:0,scaleWidth:o,scaleHeight:s});c.document.documentElement.parent=this,c.render()}else{var l=this.image;t.setViewBox({ctx:e,aspectRatio:this.getAttribute(`preserveAspectRatio`).getString(),width:o,desiredWidth:l.width,height:s,desiredHeight:l.height}),this.loaded&&(l.complete===void 0||l.complete)&&e.drawImage(l,0,0)}e.restore()}}getBoundingBox(){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 Lg(e,t,e+n,t+r)}},__=class extends zg{constructor(){super(...arguments),this.type=`symbol`}render(e){}},v_=class{constructor(e){this.document=e,this.loaded=!1,e.fonts.push(this)}load(e,t){var n=this;return Ip(function*(){try{var{document:r}=n,i=(yield r.canvg.parser.load(t)).getElementsByTagName(`font`);Array.from(i).forEach(t=>{var n=r.createElement(t);r.definitions[e]=n})}catch(e){console.error(`Error while loading font "${t}":`,e)}n.loaded=!0})()}},y_=class extends Pg{constructor(e,t,n){super(e,t,n),this.type=`style`,bh(Array.from(t.childNodes).map(e=>e.textContent).join(``).replace(/(\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*+\/)|(^[\s]*\/\/.*)/gm,``).replace(/@import.*;/g,``)).split(`}`).forEach(t=>{var n=t.trim();if(n){var r=n.split(`{`),i=r[0].split(`,`),a=r[1].split(`;`);i.forEach(t=>{var n=t.trim();if(n){var r=e.styles[n]||{};if(a.forEach(t=>{var n=t.indexOf(`:`),i=t.substr(0,n).trim(),a=t.substr(n+1,t.length-n).trim();i&&a&&(r[i]=new gg(e,i,a))}),e.styles[n]=r,e.stylesSpecificity[n]=Oh(n),n===`@font-face`){var i=r[`font-family`].getString().replace(/"|'/g,``);r.src.getString().split(`,`).forEach(t=>{if(t.indexOf(`format("svg")`)>0){var n=Th(t);n&&new v_(e).load(i,n)}})}}})}})}},y_.parseExternalUrl=Th,b_=class extends zg{constructor(){super(...arguments),this.type=`use`}setContext(e){super.setContext(e);var t=this.getAttribute(`x`),n=this.getAttribute(`y`);t.hasValue()&&e.translate(t.getPixels(`x`),0),n.hasValue()&&e.translate(0,n.getPixels(`y`))}path(e){var{element:t}=this;t&&t.path(e)}renderChildren(e){var{document:t,element:n}=this;if(n){var r=n;if(n.type===`symbol`&&(r=new Gg(t,null),r.attributes.viewBox=new gg(t,`viewBox`,n.getAttribute(`viewBox`).getString()),r.attributes.preserveAspectRatio=new gg(t,`preserveAspectRatio`,n.getAttribute(`preserveAspectRatio`).getString()),r.attributes.overflow=new gg(t,`overflow`,n.getAttribute(`overflow`).getString()),r.children=n.children,n.styles.opacity=new gg(t,`opacity`,this.calculateOpacity())),r.type===`svg`){var i=this.getStyle(`width`,!1,!0),a=this.getStyle(`height`,!1,!0);i.hasValue()&&(r.attributes.width=new gg(t,`width`,i.getString())),a.hasValue()&&(r.attributes.height=new gg(t,`height`,a.getString()))}var o=r.parent;r.parent=this,r.render(e),r.parent=o}}getBoundingBox(e){var{element:t}=this;return t?t.getBoundingBox(e):null}elementTransform(){var{document:e,element:t}=this;return Ng.fromElement(e,t)}get element(){return this.cachedElement||(this.cachedElement=this.getHrefAttribute().getDefinition()),this.cachedElement}},x_=class extends Pg{constructor(e,t,n){super(e,t,n),this.type=`feColorMatrix`;var r=Ch(this.getAttribute(`values`).getString());switch(this.getAttribute(`type`).getString(`matrix`)){case`saturate`:var i=r[0];r=[.213+.787*i,.715-.715*i,.072-.072*i,0,0,.213-.213*i,.715+.285*i,.072-.072*i,0,0,.213-.213*i,.715-.715*i,.072+.928*i,0,0,0,0,0,1,0,0,0,0,0,1];break;case`hueRotate`:var a=r[0]*Math.PI/180;r=[Xh(a,.213,.787,-.213),Xh(a,.715,-.715,-.715),Xh(a,.072,-.072,.928),0,0,Xh(a,.213,-.213,.143),Xh(a,.715,.285,.14),Xh(a,.072,-.072,-.283),0,0,Xh(a,.213,-.213,-.787),Xh(a,.715,-.715,.715),Xh(a,.072,.928,.072),0,0,0,0,0,1,0,0,0,0,0,1];break;case`luminanceToAlpha`:r=[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]}this.matrix=r,this.includeOpacity=this.getAttribute(`includeOpacity`).hasValue()}apply(e,t,n,r,i){for(var{includeOpacity:a,matrix:o}=this,s=e.getImageData(0,0,r,i),c=0;c{c.addBoundingBox(e.getBoundingBox(t))}),i=Math.floor(c.x1),a=Math.floor(c.y1),o=Math.floor(c.width),s=Math.floor(c.height)}var l=this.removeStyles(n,e.ignoreStyles),u=r.createCanvas(i+o,a+s),d=u.getContext(`2d`);r.screen.setDefaults(d),this.renderChildren(d),new x_(r,{nodeType:1,childNodes:[],attributes:[{nodeName:`type`,value:`luminanceToAlpha`},{nodeName:`includeOpacity`,value:`true`}]}).apply(d,0,0,i+o,a+s);var f=r.createCanvas(i+o,a+s),p=f.getContext(`2d`);r.screen.setDefaults(p),n.render(p),p.globalCompositeOperation=`destination-in`,p.fillStyle=d.createPattern(u,`no-repeat`),p.fillRect(0,0,i+o,a+s),t.fillStyle=p.createPattern(f,`no-repeat`),t.fillRect(0,0,i+o,a+s),this.restoreStyles(n,l)}render(e){}},S_.ignoreStyles=[`mask`,`transform`,`clip-path`],C_=()=>{},w_=class extends Pg{constructor(){super(...arguments),this.type=`clipPath`}apply(e){var{document:t}=this,n=Reflect.getPrototypeOf(e),{beginPath:r,closePath:i}=e;n&&(n.beginPath=C_,n.closePath=C_),Reflect.apply(r,e,[]),this.children.forEach(r=>{if(r.path!==void 0){var a=r.elementTransform===void 0?null:r.elementTransform();a||(a=Ng.fromElement(t,r)),a&&a.apply(e),r.path(e),n&&(n.closePath=i),a&&a.unapply(e)}}),Reflect.apply(i,e,[]),e.clip(),n&&(n.beginPath=r,n.closePath=i)}render(e){}},T_=class e extends Pg{constructor(){super(...arguments),this.type=`filter`}apply(t,n){var{document:r,children:i}=this,a=n.getBoundingBox(t);if(a){var o=0,s=0;i.forEach(e=>{var t=e.extraFilterDistance||0;o=Math.max(o,t),s=Math.max(s,t)});var c=Math.floor(a.width),l=Math.floor(a.height),u=c+2*o,d=l+2*s;if(!(u<1||d<1)){var f=Math.floor(a.x),p=Math.floor(a.y),m=this.removeStyles(n,e.ignoreStyles),h=r.createCanvas(u,d),g=h.getContext(`2d`);r.screen.setDefaults(g),g.translate(-f+o,-p+s),n.render(g),i.forEach(e=>{typeof e.apply==`function`&&e.apply(g,0,0,u,d)}),t.drawImage(h,0,0,u,d,f-o,p-s,u,d),this.restoreStyles(n,m)}}}render(e){}},T_.ignoreStyles=[`filter`,`transform`,`clip-path`],E_=class extends Pg{constructor(e,t,n){super(e,t,n),this.type=`feDropShadow`,this.addStylesFromStyleDefinition()}apply(e,t,n,r,i){}},D_=class extends Pg{constructor(){super(...arguments),this.type=`feMorphology`}apply(e,t,n,r,i){}},O_=class extends Pg{constructor(){super(...arguments),this.type=`feComposite`}apply(e,t,n,r,i){}},k_=class extends Pg{constructor(e,t,n){super(e,t,n),this.type=`feGaussianBlur`,this.blurRadius=Math.floor(this.getAttribute(`stdDeviation`).getNumber()),this.extraFilterDistance=this.blurRadius}apply(e,t,n,r,i){var{document:a,blurRadius:o}=this,s=a.window?a.window.document.body:null,c=e.canvas;c.id=a.getUniqueId(),s&&(c.style.display=`none`,s.appendChild(c)),dh(c,t,n,r,i,o),s&&s.removeChild(c)}},A_=class extends Pg{constructor(){super(...arguments),this.type=`title`}},j_=class extends Pg{constructor(){super(...arguments),this.type=`desc`}},M_={svg:Gg,rect:Kg,circle:qg,ellipse:Jg,line:Yg,polyline:Xg,polygon:Zg,path:Bg,pattern:Qg,marker:$g,defs:e_,linearGradient:r_,radialGradient:i_,stop:a_,animate:o_,animateColor:s_,animateTransform:c_,font:l_,"font-face":u_,"missing-glyph":d_,glyph:Vg,text:Hg,tspan:Ug,tref:f_,a:p_,textPath:m_,image:g_,g:t_,symbol:__,style:y_,use:b_,mask:S_,clipPath:w_,filter:T_,feDropShadow:E_,feMorphology:D_,feComposite:O_,feColorMatrix:x_,feGaussianBlur:k_,title:A_,desc:j_},N_=class e{constructor(t){var{rootEmSize:n=12,emSize:r=12,createCanvas:i=e.createCanvas,createImage:a=e.createImage,anonymousCrossOrigin:o}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.canvg=t,this.definitions=Object.create(null),this.styles=Object.create(null),this.stylesSpecificity=Object.create(null),this.images=[],this.fonts=[],this.emSizeStack=[],this.uniqueId=0,this.screen=t.screen,this.rootEmSize=n,this.emSize=r,this.createCanvas=i,this.createImage=this.bindCreateImage(a,o),this.screen.wait(this.isImagesLoaded.bind(this)),this.screen.wait(this.isFontsLoaded.bind(this))}bindCreateImage(e,t){return typeof t==`boolean`?(n,r)=>e(n,typeof r==`boolean`?r:t):e}get window(){return this.screen.window}get fetch(){return this.screen.fetch}get ctx(){return this.screen.ctx}get emSize(){var{emSizeStack:e}=this;return e[e.length-1]}set emSize(e){var{emSizeStack:t}=this;t.push(e)}popEmSize(){var{emSizeStack:e}=this;e.pop()}getUniqueId(){return`canvg${++this.uniqueId}`}isImagesLoaded(){return this.images.every(e=>e.loaded)}isFontsLoaded(){return this.fonts.every(e=>e.loaded)}createDocumentElement(e){var t=this.createElement(e.documentElement);return t.root=!0,t.addStylesFromStyleDefinition(),this.documentElement=t,t}createElement(t){var n=t.nodeName.replace(/^[^:]+:/,``),r=e.elementTypes[n];return r===void 0?new Fg(this,t):new r(this,t)}createTextNode(e){return new Wg(this,e)}setViewBox(e){this.screen.setViewBox(Qh({document:this},e))}},N_.createCanvas=$h,N_.createImage=eg,N_.elementTypes=M_,P_=class e{constructor(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.parser=new Tg(n),this.screen=new Sg(e,n),this.options=n;var r=new N_(this,n),i=r.createDocumentElement(t);this.document=r,this.documentElement=i}static from(t,n){var r=arguments;return Ip(function*(){var i=r.length>2&&r[2]!==void 0?r[2]:{},a=yield new Tg(i).parse(n);return new e(t,a,i)})()}static fromString(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=new Tg(r).parseFromString(n);return new e(t,i,r)}fork(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return e.from(t,n,rg(rg({},this.options),r))}forkString(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return e.fromString(t,n,rg(rg({},this.options),r))}ready(){return this.screen.ready()}isReady(){return this.screen.isReady()}render(){var e=arguments,t=this;return Ip(function*(){var n=e.length>0&&e[0]!==void 0?e[0]:{};t.start(rg({enableRedraw:!0,ignoreAnimation:!0,ignoreMouse:!0},n)),yield t.ready(),t.stop()})()}start(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},{documentElement:t,screen:n,options:r}=this;n.start(t,rg(rg({enableRedraw:!0},r),e))}stop(){this.screen.stop()}resize(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e,n=arguments.length>2&&arguments[2]!==void 0&&arguments[2];this.documentElement.resize(e,t,n)}}})),I_=c({AcroForm:()=>Ay,AcroFormAppearance:()=>Oy,AcroFormButton:()=>xy,AcroFormCheckBox:()=>Ty,AcroFormChoiceField:()=>_y,AcroFormComboBox:()=>yy,AcroFormEditBox:()=>by,AcroFormListBox:()=>vy,AcroFormPasswordField:()=>Dy,AcroFormPushButton:()=>Sy,AcroFormRadioButton:()=>Cy,AcroFormTextField:()=>Ey,GState:()=>iv,ShadingPattern:()=>ov,TilingPattern:()=>sv,default:()=>cv,jsPDF:()=>cv});function L_(){Pv.console&&typeof Pv.console.log==`function`&&Pv.console.log.apply(Pv.console,arguments)}function R_(e,t,n){var r=new XMLHttpRequest;r.open(`GET`,e),r.responseType=`blob`,r.onload=function(){Iv(r.response,t,n)},r.onerror=function(){Fv.error(`could not download file`)},r.send()}function z_(e){var t=new XMLHttpRequest;t.open(`HEAD`,e,!1);try{t.send()}catch{}return t.status>=200&&t.status<=299}function B_(e){try{e.dispatchEvent(new MouseEvent(`click`))}catch{var t=document.createEvent(`MouseEvents`);t.initMouseEvent(`click`,!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}}function V_(e){var t;e=e||``,this.ok=!1,e.charAt(0)==`#`&&(e=e.substr(1,6)),e={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`,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=(e=e.replace(/ /g,``)).toLowerCase()]||e;for(var n=[{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:/^(\w{2})(\w{2})(\w{2})$/,example:[`#00ff00`,`336699`],process:function(e){return[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16)]}},{re:/^(\w{1})(\w{1})(\w{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;r255?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.toRGB=function(){return`rgb(`+this.r+`, `+this.g+`, `+this.b+`)`},this.toHex=function(){var e=this.r.toString(16),t=this.g.toString(16),n=this.b.toString(16);return e.length==1&&(e=`0`+e),t.length==1&&(t=`0`+t),n.length==1&&(n=`0`+n),`#`+e+t+n}}function H_(e,t){var n=e[0],r=e[1],i=e[2],a=e[3];n=W_(n,r,i,a,t[0],7,-680876936),a=W_(a,n,r,i,t[1],12,-389564586),i=W_(i,a,n,r,t[2],17,606105819),r=W_(r,i,a,n,t[3],22,-1044525330),n=W_(n,r,i,a,t[4],7,-176418897),a=W_(a,n,r,i,t[5],12,1200080426),i=W_(i,a,n,r,t[6],17,-1473231341),r=W_(r,i,a,n,t[7],22,-45705983),n=W_(n,r,i,a,t[8],7,1770035416),a=W_(a,n,r,i,t[9],12,-1958414417),i=W_(i,a,n,r,t[10],17,-42063),r=W_(r,i,a,n,t[11],22,-1990404162),n=W_(n,r,i,a,t[12],7,1804603682),a=W_(a,n,r,i,t[13],12,-40341101),i=W_(i,a,n,r,t[14],17,-1502002290),n=G_(n,r=W_(r,i,a,n,t[15],22,1236535329),i,a,t[1],5,-165796510),a=G_(a,n,r,i,t[6],9,-1069501632),i=G_(i,a,n,r,t[11],14,643717713),r=G_(r,i,a,n,t[0],20,-373897302),n=G_(n,r,i,a,t[5],5,-701558691),a=G_(a,n,r,i,t[10],9,38016083),i=G_(i,a,n,r,t[15],14,-660478335),r=G_(r,i,a,n,t[4],20,-405537848),n=G_(n,r,i,a,t[9],5,568446438),a=G_(a,n,r,i,t[14],9,-1019803690),i=G_(i,a,n,r,t[3],14,-187363961),r=G_(r,i,a,n,t[8],20,1163531501),n=G_(n,r,i,a,t[13],5,-1444681467),a=G_(a,n,r,i,t[2],9,-51403784),i=G_(i,a,n,r,t[7],14,1735328473),n=K_(n,r=G_(r,i,a,n,t[12],20,-1926607734),i,a,t[5],4,-378558),a=K_(a,n,r,i,t[8],11,-2022574463),i=K_(i,a,n,r,t[11],16,1839030562),r=K_(r,i,a,n,t[14],23,-35309556),n=K_(n,r,i,a,t[1],4,-1530992060),a=K_(a,n,r,i,t[4],11,1272893353),i=K_(i,a,n,r,t[7],16,-155497632),r=K_(r,i,a,n,t[10],23,-1094730640),n=K_(n,r,i,a,t[13],4,681279174),a=K_(a,n,r,i,t[0],11,-358537222),i=K_(i,a,n,r,t[3],16,-722521979),r=K_(r,i,a,n,t[6],23,76029189),n=K_(n,r,i,a,t[9],4,-640364487),a=K_(a,n,r,i,t[12],11,-421815835),i=K_(i,a,n,r,t[15],16,530742520),n=q_(n,r=K_(r,i,a,n,t[2],23,-995338651),i,a,t[0],6,-198630844),a=q_(a,n,r,i,t[7],10,1126891415),i=q_(i,a,n,r,t[14],15,-1416354905),r=q_(r,i,a,n,t[5],21,-57434055),n=q_(n,r,i,a,t[12],6,1700485571),a=q_(a,n,r,i,t[3],10,-1894986606),i=q_(i,a,n,r,t[10],15,-1051523),r=q_(r,i,a,n,t[1],21,-2054922799),n=q_(n,r,i,a,t[8],6,1873313359),a=q_(a,n,r,i,t[15],10,-30611744),i=q_(i,a,n,r,t[6],15,-1560198380),r=q_(r,i,a,n,t[13],21,1309151649),n=q_(n,r,i,a,t[4],6,-145523070),a=q_(a,n,r,i,t[11],10,-1120210379),i=q_(i,a,n,r,t[2],15,718787259),r=q_(r,i,a,n,t[9],21,-343485551),e[0]=$_(n,e[0]),e[1]=$_(r,e[1]),e[2]=$_(i,e[2]),e[3]=$_(a,e[3])}function U_(e,t,n,r,i,a){return t=$_($_(t,e),$_(r,a)),$_(t<>>32-i,n)}function W_(e,t,n,r,i,a,o){return U_(t&n|~t&r,e,t,i,a,o)}function G_(e,t,n,r,i,a,o){return U_(t&r|n&~r,e,t,i,a,o)}function K_(e,t,n,r,i,a,o){return U_(t^n^r,e,t,i,a,o)}function q_(e,t,n,r,i,a,o){return U_(n^(t|~r),e,t,i,a,o)}function J_(e){var t,n=e.length,r=[1732584193,-271733879,-1732584194,271733878];for(t=64;t<=e.length;t+=64)H_(r,Y_(e.substring(t-64,t)));e=e.substring(t-64);var i=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(t=0;t>2]|=e.charCodeAt(t)<<(t%4<<3);if(i[t>>2]|=128<<(t%4<<3),t>55)for(H_(r,i),t=0;t<16;t++)i[t]=0;return i[14]=8*n,H_(r,i),r}function Y_(e){var t,n=[];for(t=0;t<64;t+=4)n[t>>2]=e.charCodeAt(t)+(e.charCodeAt(t+1)<<8)+(e.charCodeAt(t+2)<<16)+(e.charCodeAt(t+3)<<24);return n}function X_(e){for(var t=``,n=0;n<4;n++)t+=zv[e>>8*n+4&15]+zv[e>>8*n&15];return t}function Z_(e){return String.fromCharCode(255&e,(65280&e)>>8,(16711680&e)>>16,(4278190080&e)>>24)}function Q_(e){return J_(e).map(Z_).join(``)}function $_(e,t){if(Bv){var n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}return e+t&4294967295}function ev(e,t){var n,r,i,a;if(e!==n){for(var o=(i=e,a=1+(256/e.length|0),Array(a+1).join(i)),s=[],c=0;c<256;c++)s[c]=c;var l=0;for(c=0;c<256;c++){var u=s[c];l=(l+u+o.charCodeAt(c))%256,s[c]=s[l],s[l]=u}n=e,r=s}else s=r;var d=t.length,f=0,p=0,m=``;for(c=0;c€/\f©þdSiz`;var a=(t+this.padding).substr(0,32),o=(n+this.padding).substr(0,32);this.O=this.processOwnerPassword(a,o),this.P=-(1+(255^i)),this.encryptionKey=Q_(a+this.O+this.lsbFirstWord(this.P)+this.hexToBytes(r)).substr(0,5),this.U=ev(this.encryptionKey,this.padding)}function nv(e){if(/[^\u0000-\u00ff]/.test(e))throw Error(`Invalid PDF Name Object: `+e+`, Only accept ASCII characters.`);for(var t=``,n=e.length,r=0;r126?`#`+(`0`+i.toString(16)).slice(-2):e[r]}return t}function rv(e){if(vn(e)!==`object`)throw Error(`Invalid Context passed to initialize PubSub (jsPDF-module)`);var t={};this.subscribe=function(e,n,r){if(r=r||!1,typeof e!=`string`||typeof n!=`function`||typeof r!=`boolean`)throw Error(`Invalid arguments passed to PubSub.subscribe (jsPDF-module)`);t.hasOwnProperty(e)||(t[e]={});var i=Math.random().toString(35);return t[e][i]=[n,!!r],i},this.unsubscribe=function(e){for(var n in t)if(t[n][e])return delete t[n][e],Object.keys(t[n]).length===0&&delete t[n],!0;return!1},this.publish=function(n){if(t.hasOwnProperty(n)){var r=Array.prototype.slice.call(arguments,1),i=[];for(var a in t[n]){var o=t[n][a];try{o[0].apply(e,r)}catch(e){Pv.console&&Fv.error(`jsPDF PubSub Error`,e.message,e)}o[1]&&i.push(a)}i.length&&i.forEach(this.unsubscribe)}},this.getTopics=function(){return t}}function iv(e){if(!(this instanceof iv))return new iv(e);var t=`opacity,stroke-opacity`.split(`,`);for(var n in e)e.hasOwnProperty(n)&&t.indexOf(n)>=0&&(this[n]=e[n]);this.id=``,this.objectNumber=-1}function av(e,t){this.gState=e,this.matrix=t,this.id=``,this.objectNumber=-1}function ov(e,t,n,r,i){if(!(this instanceof ov))return new ov(e,t,n,r,i);this.type=e===`axial`?2:3,this.coords=t,this.colors=n,av.call(this,r,i)}function sv(e,t,n,r,i){if(!(this instanceof sv))return new sv(e,t,n,r,i);this.boundingBox=e,this.xStep=t,this.yStep=n,this.stream=``,this.cloneIndex=0,av.call(this,r,i)}function cv(e){var t,n=typeof arguments[0]==`string`?arguments[0]:`p`,r=arguments[1],i=arguments[2],a=arguments[3],o=[],s=1,c=16,l=`S`,u=null;vn(e=e||{})===`object`&&(n=e.orientation,r=e.unit||r,i=e.format||i,a=e.compress||e.compressPdf||a,(u=e.encryption||null)!==null&&(u.userPassword=u.userPassword||``,u.ownerPassword=u.ownerPassword||``,u.userPermissions=u.userPermissions||[]),s=typeof e.userUnit==`number`?Math.abs(e.userUnit):1,e.precision!==void 0&&(t=e.precision),e.floatPrecision!==void 0&&(c=e.floatPrecision),l=e.defaultPathOperation||`S`),o=e.filters||(!0===a?[`FlateEncode`]:o),r=r||`mm`,n=(``+(n||`P`)).toLowerCase();var d=e.putOnlyUsedFonts||!1,f={},p={internal:{},__private__:{}};p.__private__.PubSub=rv;var m=`1.3`,h=p.__private__.getPdfVersion=function(){return m};p.__private__.setPdfVersion=function(e){m=e};var g={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]};p.__private__.getPageFormats=function(){return g};var _=p.__private__.getPageFormat=function(e){return g[e]};i=i||`a4`;var v=`compat`,y=`advanced`,b=v;function x(){this.saveGraphicsState(),q(new Ne(me,0,0,-me,0,gn()*me).toString()+` cm`),this.setFontSize(this.getFontSize()/me),l=`n`,b=y}function S(){this.restoreGraphicsState(),l=`S`,b=v}var C=p.__private__.combineFontStyleAndFontWeight=function(e,t){if(e==`bold`&&t==`normal`||e==`bold`&&t==400||e==`normal`&&t==`italic`||e==`bold`&&t==`italic`)throw Error(`Invalid Combination of fontweight and fontstyle`);return t&&(e=t==400||t===`normal`?e===`italic`?`italic`:`normal`:t!=700&&t!==`bold`||e!==`normal`?(t==700?`bold`:t)+``+e:`bold`),e};p.advancedAPI=function(e){var t=b===v;return t&&x.call(this),typeof e!=`function`||(e(this),t&&S.call(this)),this},p.compatAPI=function(e){var t=b===y;return t&&S.call(this),typeof e!=`function`||(e(this),t&&x.call(this)),this},p.isAdvancedAPI=function(){return b===y};var w,T=function(e){if(b!==y)throw Error(e+` is only available in 'advanced' API mode. You need to call advancedAPI() first.`)},E=p.roundToPrecision=p.__private__.roundToPrecision=function(e,n){var r=t||n;if(isNaN(e)||isNaN(r))throw Error(`Invalid argument passed to jsPDF.roundToPrecision`);return e.toFixed(r).replace(/0+$/,``)};w=p.hpf=p.__private__.hpf=typeof c==`number`?function(e){if(isNaN(e))throw Error(`Invalid argument passed to jsPDF.hpf`);return E(e,c)}:c===`smart`?function(e){if(isNaN(e))throw Error(`Invalid argument passed to jsPDF.hpf`);return E(e,e>-1&&e<1?16:5)}:function(e){if(isNaN(e))throw Error(`Invalid argument passed to jsPDF.hpf`);return E(e,16)};var D=p.f2=p.__private__.f2=function(e){if(isNaN(e))throw Error(`Invalid argument passed to jsPDF.f2`);return E(e,2)},O=p.__private__.f3=function(e){if(isNaN(e))throw Error(`Invalid argument passed to jsPDF.f3`);return E(e,3)},k=p.scale=p.__private__.scale=function(e){if(isNaN(e))throw Error(`Invalid argument passed to jsPDF.scale`);return b===v?e*me:b===y?e:void 0},A=function(e){return k(function(e){return b===v?gn()-e:b===y?e:void 0}(e))};p.__private__.setPrecision=p.setPrecision=function(e){typeof parseInt(e,10)==`number`&&(t=parseInt(e,10))};var j,M=`00000000000000000000000000000000`,N=p.__private__.getFileId=function(){return M},P=p.__private__.setFileId=function(e){return M=e!==void 0&&/^[a-fA-F0-9]{32}$/.test(e)?e.toUpperCase():M.split(``).map(function(){return`ABCDEF0123456789`.charAt(Math.floor(16*Math.random()))}).join(``),u!==null&&(St=new tv(u.userPermissions,u.userPassword,u.ownerPassword,M)),M};p.setFileId=function(e){return P(e),this},p.getFileId=function(){return N()};var F=p.__private__.convertDateToPDFDate=function(e){var t=e.getTimezoneOffset(),n=t<0?`+`:`-`,r=Math.floor(Math.abs(t/60)),i=Math.abs(t%60),a=[n,B(r),`'`,B(i),`'`].join(``);return[`D:`,e.getFullYear(),B(e.getMonth()+1),B(e.getDate()),B(e.getHours()),B(e.getMinutes()),B(e.getSeconds()),a].join(``)},I=p.__private__.convertPDFDateToDate=function(e){var t=parseInt(e.substr(2,4),10),n=parseInt(e.substr(6,2),10)-1,r=parseInt(e.substr(8,2),10),i=parseInt(e.substr(10,2),10),a=parseInt(e.substr(12,2),10),o=parseInt(e.substr(14,2),10);return new Date(t,n,r,i,a,o,0)},L=p.__private__.setCreationDate=function(e){var t;if(e===void 0&&(e=new Date),e instanceof Date)t=F(e);else{if(!/^D:(20[0-2][0-9]|203[0-7]|19[7-9][0-9])(0[0-9]|1[0-2])([0-2][0-9]|3[0-1])(0[0-9]|1[0-9]|2[0-3])(0[0-9]|[1-5][0-9])(0[0-9]|[1-5][0-9])(\+0[0-9]|\+1[0-4]|-0[0-9]|-1[0-1])'(0[0-9]|[1-5][0-9])'?$/.test(e))throw Error(`Invalid argument passed to jsPDF.setCreationDate`);t=e}return j=t},R=p.__private__.getCreationDate=function(e){var t=j;return e===`jsDate`&&(t=I(j)),t};p.setCreationDate=function(e){return L(e),this},p.getCreationDate=function(e){return R(e)};var z,B=p.__private__.padd2=function(e){return(`0`+parseInt(e)).slice(-2)},V=p.__private__.padd2Hex=function(e){return(`00`+(e=e.toString())).substr(e.length)},H=0,ee=[],U=[],W=0,te=[],G=[],ne=!1,re=U;p.__private__.setCustomOutputDestination=function(e){ne=!0,re=e};var K=function(e){ne||(re=e)};p.__private__.resetCustomOutputDestination=function(){ne=!1,re=U};var q=p.__private__.out=function(e){return e=e.toString(),W+=e.length+1,re.push(e),re},J=p.__private__.write=function(e){return q(arguments.length===1?e.toString():Array.prototype.join.call(arguments,` `))},ie=p.__private__.getArrayBuffer=function(e){for(var t=e.length,n=new ArrayBuffer(t),r=new Uint8Array(n);t--;)r[t]=e.charCodeAt(t);return n},ae=[[`Helvetica`,`helvetica`,`normal`,`WinAnsiEncoding`],[`Helvetica-Bold`,`helvetica`,`bold`,`WinAnsiEncoding`],[`Helvetica-Oblique`,`helvetica`,`italic`,`WinAnsiEncoding`],[`Helvetica-BoldOblique`,`helvetica`,`bolditalic`,`WinAnsiEncoding`],[`Courier`,`courier`,`normal`,`WinAnsiEncoding`],[`Courier-Bold`,`courier`,`bold`,`WinAnsiEncoding`],[`Courier-Oblique`,`courier`,`italic`,`WinAnsiEncoding`],[`Courier-BoldOblique`,`courier`,`bolditalic`,`WinAnsiEncoding`],[`Times-Roman`,`times`,`normal`,`WinAnsiEncoding`],[`Times-Bold`,`times`,`bold`,`WinAnsiEncoding`],[`Times-Italic`,`times`,`italic`,`WinAnsiEncoding`],[`Times-BoldItalic`,`times`,`bolditalic`,`WinAnsiEncoding`],[`ZapfDingbats`,`zapfdingbats`,`normal`,null],[`Symbol`,`symbol`,`normal`,null]];p.__private__.getStandardFonts=function(){return ae};var oe=e.fontSize||16;p.__private__.setFontSize=p.setFontSize=function(e){return oe=b===y?e/me:e,this};var Y,X=p.__private__.getFontSize=p.getFontSize=function(){return b===v?oe:oe*me},se=e.R2L||!1;p.__private__.setR2L=p.setR2L=function(e){return se=e,this},p.__private__.getR2L=p.getR2L=function(){return se};var ce,Z=p.__private__.setZoomMode=function(e){if(/^(?:\d+\.\d*|\d*\.\d+|\d+)%$/.test(e))Y=e;else if(isNaN(e)){if([void 0,null,`fullwidth`,`fullheight`,`fullpage`,`original`].indexOf(e)===-1)throw Error(`zoom must be Integer (e.g. 2), a percentage Value (e.g. 300%) or fullwidth, fullheight, fullpage, original. "`+e+`" is not recognized.`);Y=e}else Y=parseInt(e,10)};p.__private__.getZoomMode=function(){return Y};var le,ue=p.__private__.setPageMode=function(e){if([void 0,null,`UseNone`,`UseOutlines`,`UseThumbs`,`FullScreen`].indexOf(e)==-1)throw Error(`Page mode must be one of UseNone, UseOutlines, UseThumbs, or FullScreen. "`+e+`" is not recognized.`);ce=e};p.__private__.getPageMode=function(){return ce};var de=p.__private__.setLayoutMode=function(e){if([void 0,null,`continuous`,`single`,`twoleft`,`tworight`,`two`].indexOf(e)==-1)throw Error(`Layout mode must be one of continuous, single, twoleft, tworight. "`+e+`" is not recognized.`);le=e};p.__private__.getLayoutMode=function(){return le},p.__private__.setDisplayMode=p.setDisplayMode=function(e,t,n){return Z(e),de(t),ue(n),this};var fe={title:``,subject:``,author:``,keywords:``,creator:``};p.__private__.getDocumentProperty=function(e){if(Object.keys(fe).indexOf(e)===-1)throw Error(`Invalid argument passed to jsPDF.getDocumentProperty`);return fe[e]},p.__private__.getDocumentProperties=function(){return fe},p.__private__.setDocumentProperties=p.setProperties=p.setDocumentProperties=function(e){for(var t in fe)fe.hasOwnProperty(t)&&e[t]&&(fe[t]=e[t]);return this},p.__private__.setDocumentProperty=function(e,t){if(Object.keys(fe).indexOf(e)===-1)throw Error(`Invalid arguments passed to jsPDF.setDocumentProperty`);return fe[e]=t};var pe,me,he,ge,_e,ve={},ye={},be=[],xe={},Se={},Ce={},we={},Te=null,Ee=0,De=[],Oe=new rv(p),ke=e.hotfixes||[],Ae={},je={},Me=[],Ne=function e(t,n,r,i,a,o){if(!(this instanceof e))return new e(t,n,r,i,a,o);isNaN(t)&&(t=1),isNaN(n)&&(n=0),isNaN(r)&&(r=0),isNaN(i)&&(i=1),isNaN(a)&&(a=0),isNaN(o)&&(o=0),this._matrix=[t,n,r,i,a,o]};Object.defineProperty(Ne.prototype,"sx",{get:function(){return this._matrix[0]},set:function(e){this._matrix[0]=e}}),Object.defineProperty(Ne.prototype,"shy",{get:function(){return this._matrix[1]},set:function(e){this._matrix[1]=e}}),Object.defineProperty(Ne.prototype,"shx",{get:function(){return this._matrix[2]},set:function(e){this._matrix[2]=e}}),Object.defineProperty(Ne.prototype,"sy",{get:function(){return this._matrix[3]},set:function(e){this._matrix[3]=e}}),Object.defineProperty(Ne.prototype,"tx",{get:function(){return this._matrix[4]},set:function(e){this._matrix[4]=e}}),Object.defineProperty(Ne.prototype,"ty",{get:function(){return this._matrix[5]},set:function(e){this._matrix[5]=e}}),Object.defineProperty(Ne.prototype,"a",{get:function(){return this._matrix[0]},set:function(e){this._matrix[0]=e}}),Object.defineProperty(Ne.prototype,"b",{get:function(){return this._matrix[1]},set:function(e){this._matrix[1]=e}}),Object.defineProperty(Ne.prototype,"c",{get:function(){return this._matrix[2]},set:function(e){this._matrix[2]=e}}),Object.defineProperty(Ne.prototype,"d",{get:function(){return this._matrix[3]},set:function(e){this._matrix[3]=e}}),Object.defineProperty(Ne.prototype,"e",{get:function(){return this._matrix[4]},set:function(e){this._matrix[4]=e}}),Object.defineProperty(Ne.prototype,"f",{get:function(){return this._matrix[5]},set:function(e){this._matrix[5]=e}}),Object.defineProperty(Ne.prototype,"rotation",{get:function(){return Math.atan2(this.shx,this.sx)}}),Object.defineProperty(Ne.prototype,"scaleX",{get:function(){return this.decompose().scale.sx}}),Object.defineProperty(Ne.prototype,"scaleY",{get:function(){return this.decompose().scale.sy}}),Object.defineProperty(Ne.prototype,"isIdentity",{get:function(){return this.sx===1&&this.shy===0&&this.shx===0&&this.sy===1&&this.tx===0&&this.ty===0}}),Ne.prototype.join=function(e){return[this.sx,this.shy,this.shx,this.sy,this.tx,this.ty].map(w).join(e)},Ne.prototype.multiply=function(e){return new Ne(e.sx*this.sx+e.shy*this.shx,e.sx*this.shy+e.shy*this.sy,e.shx*this.sx+e.sy*this.shx,e.shx*this.shy+e.sy*this.sy,e.tx*this.sx+e.ty*this.shx+this.tx,e.tx*this.shy+e.ty*this.sy+this.ty)},Ne.prototype.decompose=function(){var e=this.sx,t=this.shy,n=this.shx,r=this.sy,i=this.tx,a=this.ty,o=Math.sqrt(e*e+t*t),s=(e/=o)*n+(t/=o)*r;n-=e*s,r-=t*s;var c=Math.sqrt(n*n+r*r);return s/=c,e*(r/=c)>16&255,r=c>>8&255,i=255&c}if(r===void 0||a===void 0&&n===r&&r===i)t=typeof n==`string`?n+` `+o[0]:e.precision===2?D(n/255)+` `+o[0]:O(n/255)+` `+o[0];else if(a===void 0||vn(a)===`object`){if(a&&!isNaN(a.a)&&a.a===0)return[`1.`,`1.`,`1.`,o[1]].join(` `);t=typeof n==`string`?[n,r,i,o[1]].join(` `):e.precision===2?[D(n/255),D(r/255),D(i/255),o[1]].join(` `):[O(n/255),O(r/255),O(i/255),o[1]].join(` `)}else t=typeof n==`string`?[n,r,i,a,o[2]].join(` `):e.precision===2?[D(n),D(r),D(i),D(a),o[2]].join(` `):[O(n),O(r),O(i),O(a),o[2]].join(` `);return t},Ke=p.__private__.getFilters=function(){return o},qe=p.__private__.putStream=function(e){var t=(e=e||{}).data||``,n=e.filters||Ke(),r=e.alreadyAppliedFilters||[],i=e.addLength1||!1,a=t.length,o=e.objectId,s=function(e){return e};if(u!==null&&o===void 0)throw Error(`ObjectId must be passed to putStream for file encryption`);u!==null&&(s=St.encryptor(o,0));var c={};!0===n&&(n=[`FlateEncode`]);var l=e.additionalKeyValues||[],d=(c=cv.API.processDataByFilters===void 0?{data:t,reverseChain:[]}:cv.API.processDataByFilters(t,n)).reverseChain+(Array.isArray(r)?r.join(` `):r.toString());if(c.data.length!==0&&(l.push({key:`Length`,value:c.data.length}),!0===i&&l.push({key:`Length1`,value:a})),d.length!=0){if(d.split(`/`).length-1==1)l.push({key:`Filter`,value:d});else{l.push({key:`Filter`,value:`[`+d+`]`});for(var f=0;f>`),c.data.length!==0&&(q(`stream`),q(s(c.data)),q(`endstream`))},Je=p.__private__.putPage=function(e){var t=e.number,n=e.data,r=e.objId,i=e.contentsObjId;Be(r,!0),q(`<>`),q(`endobj`);var a=n.join(` `);return b===y&&(a+=` Q`),Be(i,!0),qe({data:a,filters:Ke(),objectId:i}),q(`endobj`),r},Ye=p.__private__.putPages=function(){var e,t,n=[];for(e=1;e<=Ee;e++)De[e].objId=ze(),De[e].contentsObjId=ze();for(e=1;e<=Ee;e++)n.push(Je({number:e,data:G[e],objId:De[e].objId,contentsObjId:De[e].contentsObjId,mediaBox:De[e].mediaBox,cropBox:De[e].cropBox,bleedBox:De[e].bleedBox,trimBox:De[e].trimBox,artBox:De[e].artBox,userUnit:De[e].userUnit,rootDictionaryObjId:He,resourceDictionaryObjId:Ue}));Be(He,!0),q(`<>`),q(`endobj`),Oe.publish(`postPutPages`)},Xe=function(e){Oe.publish(`putFont`,{font:e,out:q,newObject:Re,putStream:qe}),!0!==e.isAlreadyPutted&&(e.objectNumber=Re(),q(`<<`),q(`/Type /Font`),q(`/BaseFont /`+nv(e.postScriptName)),q(`/Subtype /Type1`),typeof e.encoding==`string`&&q(`/Encoding /`+e.encoding),q(`/FirstChar 32`),q(`/LastChar 255`),q(`>>`),q(`endobj`))},Ze=function(e){e.objectNumber=Re();var t=[];t.push({key:`Type`,value:`/XObject`}),t.push({key:`Subtype`,value:`/Form`}),t.push({key:`BBox`,value:`[`+[w(e.x),w(e.y),w(e.x+e.width),w(e.y+e.height)].join(` `)+`]`}),t.push({key:`Matrix`,value:`[`+e.matrix.toString()+`]`}),qe({data:e.pages[1].join(` `),additionalKeyValues:t,objectId:e.objectNumber}),q(`endobj`)},Qe=function(e,t){t||(t=21);var n=Re(),r=function(e,t){var n,r=[],i=1/(t-1);for(n=0;n<1;n+=i)r.push(n);if(r.push(1),e[0].offset!=0){var a={offset:0,color:e[0].color};e.unshift(a)}if(e[e.length-1].offset!=1){var o={offset:1,color:e[e.length-1].color};e.push(o)}for(var s=``,c=0,l=0;le[c+1].offset;)c++;var u=e[c].offset,d=(n-u)/(e[c+1].offset-u),f=e[c].color,p=e[c+1].color;s+=V(Math.round((1-d)*f[0]+d*p[0]).toString(16))+V(Math.round((1-d)*f[1]+d*p[1]).toString(16))+V(Math.round((1-d)*f[2]+d*p[2]).toString(16))}return s.trim()}(e.colors,t),i=[];i.push({key:`FunctionType`,value:`0`}),i.push({key:`Domain`,value:`[0.0 1.0]`}),i.push({key:`Size`,value:`[`+t+`]`}),i.push({key:`BitsPerSample`,value:`8`}),i.push({key:`Range`,value:`[0.0 1.0 0.0 1.0 0.0 1.0]`}),i.push({key:`Decode`,value:`[0.0 1.0 0.0 1.0 0.0 1.0]`}),qe({data:r,additionalKeyValues:i,alreadyAppliedFilters:[`/ASCIIHexDecode`],objectId:n}),q(`endobj`),e.objectNumber=Re(),q(`<< /ShadingType `+e.type),q(`/ColorSpace /DeviceRGB`);var a=`/Coords [`+w(parseFloat(e.coords[0]))+` `+w(parseFloat(e.coords[1]))+` `;e.type===2?a+=w(parseFloat(e.coords[2]))+` `+w(parseFloat(e.coords[3])):a+=w(parseFloat(e.coords[2]))+` `+w(parseFloat(e.coords[3]))+` `+w(parseFloat(e.coords[4]))+` `+w(parseFloat(e.coords[5])),q(a+=`]`),e.matrix&&q(`/Matrix [`+e.matrix.toString()+`]`),q(`/Function `+n+` 0 R`),q(`/Extend [true true]`),q(`>>`),q(`endobj`)},$e=function(e,t){var n=ze(),r=Re();t.push({resourcesOid:n,objectOid:r}),e.objectNumber=r;var i=[];i.push({key:`Type`,value:`/Pattern`}),i.push({key:`PatternType`,value:`1`}),i.push({key:`PaintType`,value:`1`}),i.push({key:`TilingType`,value:`1`}),i.push({key:`BBox`,value:`[`+e.boundingBox.map(w).join(` `)+`]`}),i.push({key:`XStep`,value:w(e.xStep)}),i.push({key:`YStep`,value:w(e.yStep)}),i.push({key:`Resources`,value:n+` 0 R`}),e.matrix&&i.push({key:`Matrix`,value:`[`+e.matrix.toString()+`]`}),qe({data:e.stream,additionalKeyValues:i,objectId:e.objectNumber}),q(`endobj`)},et=function(e){for(var t in e.objectNumber=Re(),q(`<<`),e)switch(t){case`opacity`:q(`/ca `+D(e[t]));break;case`stroke-opacity`:q(`/CA `+D(e[t]))}q(`>>`),q(`endobj`)},tt=function(e){Be(e.resourcesOid,!0),q(`<<`),q(`/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]`),function(){for(var e in q(`/Font <<`),ve)ve.hasOwnProperty(e)&&(!1===d||!0===d&&f.hasOwnProperty(e))&&q(`/`+e+` `+ve[e].objectNumber+` 0 R`);q(`>>`)}(),function(){if(Object.keys(xe).length>0){for(var e in q(`/Shading <<`),xe)xe.hasOwnProperty(e)&&xe[e]instanceof ov&&xe[e].objectNumber>=0&&q(`/`+e+` `+xe[e].objectNumber+` 0 R`);Oe.publish(`putShadingPatternDict`),q(`>>`)}}(),function(e){if(Object.keys(xe).length>0){for(var t in q(`/Pattern <<`),xe)xe.hasOwnProperty(t)&&xe[t]instanceof p.TilingPattern&&xe[t].objectNumber>=0&&xe[t].objectNumber>`)}}(e.objectOid),function(){if(Object.keys(Ce).length>0){for(var e in q(`/ExtGState <<`),Ce)Ce.hasOwnProperty(e)&&Ce[e].objectNumber>=0&&q(`/`+e+` `+Ce[e].objectNumber+` 0 R`);Oe.publish(`putGStateDict`),q(`>>`)}}(),function(){for(var e in q(`/XObject <<`),Ae)Ae.hasOwnProperty(e)&&Ae[e].objectNumber>=0&&q(`/`+e+` `+Ae[e].objectNumber+` 0 R`);Oe.publish(`putXobjectDict`),q(`>>`)}(),q(`>>`),q(`endobj`)},nt=function(e){ye[e.fontName]=ye[e.fontName]||{},ye[e.fontName][e.fontStyle]=e.id},rt=function(e,t,n,r,i){var a={id:`F`+(Object.keys(ve).length+1).toString(10),postScriptName:e,fontName:t,fontStyle:n,encoding:r,isStandardFont:i||!1,metadata:{}};return Oe.publish(`addFont`,{font:a,instance:this}),ve[a.id]=a,nt(a),a.id},it=p.__private__.pdfEscape=p.pdfEscape=function(e,t){return function(e,t){var n,r,i=(t=t||{}).sourceEncoding||`Unicode`,a,o=t.outputEncoding,s,c,l,u;if((t.autoencode||o)&&ve[pe].metadata&&ve[pe].metadata[i]&&ve[pe].metadata[i].encoding&&(a=ve[pe].metadata[i].encoding,!o&&ve[pe].encoding&&(o=ve[pe].encoding),!o&&a.codePages&&(o=a.codePages[0]),typeof o==`string`&&(o=a[o]),o)){for(c=!1,s=[],n=0,r=e.length;n>8&&(c=!0);e=s.join(``)}for(n=e.length;c===void 0&&n!==0;)e.charCodeAt(n-1)>>8&&(c=!0),n--;if(!c)return e;for(s=t.noBOM?[]:[254,255],n=0,r=e.length;n>8)>>8)throw Error(`Character at position `+n+` of string '`+e+`' exceeds 16bits. Cannot be encoded into UCS-2 BE`);s.push(u),s.push(l-(u<<8))}return String.fromCharCode.apply(void 0,s)}(e,t).replace(/\\/g,`\\\\`).replace(/\(/g,`\\(`).replace(/\)/g,`\\)`)},at=p.__private__.beginPage=function(e){G[++Ee]=[],De[Ee]={objId:0,contentsObjId:0,userUnit:Number(s),artBox:null,bleedBox:null,cropBox:null,trimBox:null,mediaBox:{bottomLeftX:0,bottomLeftY:0,topRightX:Number(e[0]),topRightY:Number(e[1])}},ct(Ee),K(G[z])},ot=function(e,t){var r,a,o;switch(n=t||n,typeof e==`string`&&(r=_(e.toLowerCase()),Array.isArray(r)&&(a=r[0],o=r[1])),Array.isArray(e)&&(a=e[0]*me,o=e[1]*me),isNaN(a)&&(a=i[0],o=i[1]),(a>14400||o>14400)&&(Fv.warn(`A page in a PDF can not be wider or taller than 14400 userUnit. jsPDF limits the width/height to 14400`),a=Math.min(14400,a),o=Math.min(14400,o)),i=[a,o],n.substr(0,1)){case`l`:o>a&&(i=[o,a]);break;case`p`:a>o&&(i=[o,a])}at(i),Vt(zt),q(Yt),tn!==0&&q(tn+` J`),nn!==0&&q(nn+` j`),Oe.publish(`addPage`,{pageNumber:Ee})},st=function(e){e>0&&e<=Ee&&(G.splice(e,1),De.splice(e,1),Ee--,z>Ee&&(z=Ee),this.setPage(z))},ct=function(e){e>0&&e<=Ee&&(z=e)},lt=p.__private__.getNumberOfPages=p.getNumberOfPages=function(){return G.length-1},ut=function(e,t,n){var r,i=void 0;return n=n||{},e=e===void 0?ve[pe].fontName:e,t=t===void 0?ve[pe].fontStyle:t,r=e.toLowerCase(),ye[r]!==void 0&&ye[r][t]!==void 0?i=ye[r][t]:ye[e]!==void 0&&ye[e][t]!==void 0?i=ye[e][t]:!1===n.disableWarning&&Fv.warn(`Unable to look up font label for font '`+e+`', '`+t+`'. Refer to getFontList() for available fonts.`),i||n.noFallback||((i=ye.times[t])??(i=ye.times.normal)),i},dt=p.__private__.putInfo=function(){var e=Re(),t=function(e){return e};for(var n in u!==null&&(t=St.encryptor(e,0)),q(`<<`),q(`/Producer (`+it(t(`jsPDF `+cv.version))+`)`),fe)fe.hasOwnProperty(n)&&fe[n]&&q(`/`+n.substr(0,1).toUpperCase()+n.substr(1)+` (`+it(t(fe[n]))+`)`);q(`/CreationDate (`+it(t(j))+`)`),q(`>>`),q(`endobj`)},ft=p.__private__.putCatalog=function(e){var t=(e=e||{}).rootDictionaryObjId||He;switch(Re(),q(`<<`),q(`/Type /Catalog`),q(`/Pages `+t+` 0 R`),Y||(Y=`fullwidth`),Y){case`fullwidth`:q(`/OpenAction [3 0 R /FitH null]`);break;case`fullheight`:q(`/OpenAction [3 0 R /FitV null]`);break;case`fullpage`:q(`/OpenAction [3 0 R /Fit]`);break;case`original`:q(`/OpenAction [3 0 R /XYZ null null 1]`);break;default:var n=``+Y;n.substr(n.length-1)===`%`&&(Y=parseInt(Y)/100),typeof Y==`number`&&q(`/OpenAction [3 0 R /XYZ null null `+D(Y)+`]`)}switch(le||(le=`continuous`),le){case`continuous`:q(`/PageLayout /OneColumn`);break;case`single`:q(`/PageLayout /SinglePage`);break;case`two`:case`twoleft`:q(`/PageLayout /TwoColumnLeft`);break;case`tworight`:q(`/PageLayout /TwoColumnRight`)}ce&&q(`/PageMode /`+ce),Oe.publish(`putCatalog`),q(`>>`),q(`endobj`)},pt=p.__private__.putTrailer=function(){q(`trailer`),q(`<<`),q(`/Size `+(H+1)),q(`/Root `+H+` 0 R`),q(`/Info `+(H-1)+` 0 R`),u!==null&&q(`/Encrypt `+St.oid+` 0 R`),q(`/ID [ <`+M+`> <`+M+`> ]`),q(`>>`)},mt=p.__private__.putHeader=function(){q(`%PDF-`+m),q(`%ºß¬à`)},ht=p.__private__.putXRef=function(){var e=`0000000000`;q(`xref`),q(`0 `+(H+1)),q(`0000000000 65535 f `);for(var t=1;t<=H;t++)typeof ee[t]==`function`?q((e+ee[t]()).slice(-10)+` 00000 n `):ee[t]===void 0?q(`0000000000 00000 n `):q((e+ee[t]).slice(-10)+` 00000 n `)},gt=p.__private__.buildDocument=function(){var e;H=0,W=0,U=[],ee=[],te=[],He=ze(),Ue=ze(),K(U),Oe.publish(`buildDocument`),mt(),Ye(),function(){Oe.publish(`putAdditionalObjects`);for(var e=0;e`),q(`/O <`+St.toHexString(St.O)+`>`),q(`/P `+St.P),q(`>>`),q(`endobj`)),dt(),ft();var t=W;return ht(),pt(),q(`startxref`),q(``+t),q(`%%EOF`),K(G[z]),U.join(` `)},_t=p.__private__.getBlob=function(e){return new Blob([ie(e)],{type:`application/pdf`})},vt=function(e){for(;e.firstChild;)e.removeChild(e.firstChild)},yt=function(e){var t,n=e.document,r=n.documentElement,i=n.head,a=n.body;return i||(i=n.createElement(`head`),r.appendChild(i)),a||(a=n.createElement(`body`),r.appendChild(a)),vt(i),vt(a),(t=n.createElement(`style`)).appendChild(n.createTextNode(`html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;}`)),i.appendChild(t),{document:n,body:a}},bt=p.output=p.__private__.output=(Le=function(e,t){switch(typeof(t=t||{})==`string`?t={filename:t}:t.filename=t.filename||`generated.pdf`,e){case void 0:return gt();case`save`:p.save(t.filename);break;case`arraybuffer`:return ie(gt());case`blob`:return _t(gt());case`bloburi`:case`bloburl`:if(Pv.URL!==void 0&&typeof Pv.URL.createObjectURL==`function`)return Pv.URL&&Pv.URL.createObjectURL(_t(gt()))||void 0;Fv.warn(`bloburl is not supported by your system, because URL.createObjectURL is not supported by your browser.`);break;case`datauristring`:case`dataurlstring`:var n=``,r=gt();try{n=Rv(r)}catch{n=Rv(unescape(encodeURIComponent(r)))}return`data:application/pdf;filename=`+encodeURIComponent(t.filename)+`;base64,`+n;case`pdfobjectnewwindow`:if(Object.prototype.toString.call(Pv)===`[object Window]`){var i=`https://cdnjs.cloudflare.com/ajax/libs/pdfobject/2.1.1/pdfobject.min.js`,a=!t.pdfObjectUrl;a||(i=t.pdfObjectUrl);var o=Pv.open();if(o!==null){var s=yt(o),c=s.document.createElement(`script`),l=this;c.src=i,a&&(c.integrity=`sha512-4ze/a9/4jqu+tX9dfOqJYSvyYd5M6qum/3HpCLr+/Jqf0whc37VUbkpNGHR7/8pSnCFw47T1fmIpwBV7UySh3g==`,c.crossOrigin=`anonymous`),c.onload=function(){o.PDFObject.embed(l.output(`dataurlstring`),t)},s.body.appendChild(c)}return o}throw Error(`The option pdfobjectnewwindow just works in a browser-environment.`);case`pdfjsnewwindow`:if(Object.prototype.toString.call(Pv)===`[object Window]`){var u=t.pdfJsUrl||`examples/PDF.js/web/viewer.html`,d=Pv.open();if(d!==null){var f=yt(d),m=f.document.createElement(`iframe`),h=u.indexOf(`?`)===-1?`?`:`&`;l=this,m.id=`pdfViewer`,m.width=`500px`,m.height=`400px`,m.src=u+h+`file=&downloadName=`+encodeURIComponent(t.filename),m.onload=function(){d.document.title=t.filename,m.contentWindow.PDFViewerApplication.open(l.output(`bloburl`))},f.body.appendChild(m)}return d}throw Error(`The option pdfjsnewwindow just works in a browser-environment.`);case`dataurlnewwindow`:if(Object.prototype.toString.call(Pv)!==`[object Window]`)throw Error(`The option dataurlnewwindow just works in a browser-environment.`);var g=Pv.open();if(g!==null){var _=yt(g),v=_.document.createElement(`iframe`);v.src=this.output(`datauristring`,t),_.body.appendChild(v),g.document.title=t.filename}if(g||typeof safari>`u`)return g;break;case`datauri`:case`dataurl`:return Pv.document.location.href=this.output(`datauristring`,t);default:return null}},Le.foo=function(){try{return Le.apply(this,arguments)}catch(n){var e=n.stack||``;~e.indexOf(` at `)&&(e=e.split(` at `)[1]);var t=`Error in function `+e.split(` `)[0].split(`<`)[0]+`: `+n.message;if(!Pv.console)throw Error(t);Pv.console.error(t,n),Pv.alert&&alert(t)}},Le.foo.bar=Le,Le.foo),xt=function(e){return!0===Array.isArray(ke)&&ke.indexOf(e)>-1};switch(r){case`pt`:me=1;break;case`mm`:me=72/25.4;break;case`cm`:me=72/2.54;break;case`in`:me=72;break;case`px`:me=xt(`px_scaling`)==1?.75:96/72;break;case`pc`:case`em`:me=12;break;case`ex`:me=6;break;default:if(typeof r!=`number`)throw Error(`Invalid unit: `+r);me=r}var St=null;L(),P();var Ct=p.__private__.getPageInfo=p.getPageInfo=function(e){if(isNaN(e)||e%1!=0)throw Error(`Invalid argument passed to jsPDF.getPageInfo`);return{objId:De[e].objId,pageNumber:e,pageContext:De[e]}},wt=p.__private__.getPageInfoByObjId=function(e){if(isNaN(e)||e%1!=0)throw Error(`Invalid argument passed to jsPDF.getPageInfoByObjId`);for(var t in De)if(De[t].objId===e)break;return Ct(t)},Tt=p.__private__.getCurrentPageInfo=p.getCurrentPageInfo=function(){return{objId:De[z].objId,pageNumber:z,pageContext:De[z]}};p.addPage=function(){return ot.apply(this,arguments),this},p.setPage=function(){return ct.apply(this,arguments),K.call(this,G[z]),this},p.insertPage=function(e){return this.addPage(),this.movePage(z,e),this},p.movePage=function(e,t){var n,r;if(e>t){n=G[e],r=De[e];for(var i=e;i>t;i--)G[i]=G[i-1],De[i]=De[i-1];G[t]=n,De[t]=r,this.setPage(t)}else if(e0&&(typeof e==`string`?e=h.splitTextToSize(e,u):Object.prototype.toString.call(e)===`[object Array]`&&(e=e.reduce(function(e,t){return e.concat(h.splitTextToSize(t,u))},[]))),a={text:e,x:t,y:n,options:r,mutex:{pdfEscape:it,activeFontKey:pe,fonts:ve,activeFontSize:oe}},Oe.publish(`preProcessText`,a),e=a.text,s=(r=a.options).angle,m instanceof Ne==0&&s&&typeof s==`number`){s*=Math.PI/180,r.rotationDirection===0&&(s=-s),b===y&&(s=-s);var I=Math.cos(s),L=Math.sin(s);m=new Ne(I,L,-L,I,0,0)}else s&&s instanceof Ne&&(m=s);b!==y||m||(m=Fe),(l=r.charSpace||$t)!==void 0&&(v+=w(k(l))+` Tc `,this.setCharSpace(this.getCharSpace()||0)),(p=r.horizontalScale)!==void 0&&(v+=w(100*p)+` Tz `),r.lang;var R=-1,z=r.renderingMode===void 0?r.stroke:r.renderingMode,B=h.internal.getCurrentPageInfo().pageContext;switch(z){case 0:case!1:case`fill`:R=0;break;case 1:case!0:case`stroke`:R=1;break;case 2:case`fillThenStroke`:R=2;break;case 3:case`invisible`:R=3;break;case 4:case`fillAndAddForClipping`:R=4;break;case 5:case`strokeAndAddPathForClipping`:R=5;break;case 6:case`fillThenStrokeAndAddToPathForClipping`:R=6;break;case 7:case`addToPathForClipping`:R=7}var V=B.usedRenderingMode===void 0?-1:B.usedRenderingMode;R===-1?V!==-1&&(v+=`0 Tr `):v+=R+` Tr `,R!==-1&&(B.usedRenderingMode=R),c=r.align||`left`;var H,ee=oe*x,U=h.internal.pageSize.getWidth(),W=ve[pe];l=r.charSpace||$t,u=r.maxWidth||0,d=Object.assign({autoencode:!0,noBOM:!0},r.flags);var te=[],G=function(e){return h.getStringUnitWidth(e,{font:W,charSpace:l,fontSize:oe,doKerning:!1})*oe/S};if(Object.prototype.toString.call(e)===`[object Array]`){var ne;o=E(e),c!==`left`&&(H=o.map(G));var re,K=0;if(c===`right`){t-=H[0],e=[],N=o.length;for(var J=0;J0?(u-H[X])/de:0;X`:`)`),he=parseFloat(o[Se][1]),ge=parseFloat(o[Se][2]);break;case 0:_e=(_?`<`:`(`)+o[Se]+(_?`>`:`)`),he=Gt(t),ge=Kt(n)}te!==void 0&&te[Se]!==void 0&&(be=te[Se]+` Tw `),Se===0?e.push(be+xe(he,ge,m)+_e):ye===0?e.push(be+_e):ye===1&&e.push(be+xe(he,ge,m)+_e)}e=ye===0?e.join(` Tj T* `):e.join(` Tj `),e+=` Tj `;var Ce=`BT /`;return Ce+=pe+` `+oe+` Tf `,Ce+=w(oe*x)+` TL `,Ce+=Zt+` `,Ce+=v,Ce+=e,q(Ce+=`ET`),f[pe]=!0,h};var Et=p.__private__.clip=p.clip=function(e){return q(e===`evenodd`?`W*`:`W`),this};p.clipEvenOdd=function(){return Et(`evenodd`)},p.__private__.discardPath=p.discardPath=function(){return q(`n`),this};var Dt=p.__private__.isValidStyle=function(e){var t=!1;return[void 0,null,`S`,`D`,`F`,`DF`,`FD`,`f`,`f*`,`B`,`B*`,`n`].indexOf(e)!==-1&&(t=!0),t};p.__private__.setDefaultPathOperation=p.setDefaultPathOperation=function(e){return Dt(e)&&(l=e),this};var Ot=p.__private__.getStyle=p.getStyle=function(e){var t=l;switch(e){case`D`:case`S`:t=`S`;break;case`F`:t=`f`;break;case`FD`:case`DF`:t=`B`;break;case`f`:case`f*`:case`B`:case`B*`:t=e}return t},kt=p.close=function(){return q(`h`),this};p.stroke=function(){return q(`S`),this},p.fill=function(e){return At(`f`,e),this},p.fillEvenOdd=function(e){return At(`f*`,e),this},p.fillStroke=function(e){return At(`B`,e),this},p.fillStrokeEvenOdd=function(e){return At(`B*`,e),this};var At=function(e,t){vn(t)===`object`?Nt(t,e):q(e)},jt=function(e){e===null||b===y&&e===void 0||(e=Ot(e),q(e))};function Mt(e,t,n,r,i){var a=new sv(t||this.boundingBox,n||this.xStep,r||this.yStep,this.gState,i||this.matrix);return a.stream=this.stream,Ie(e+`$$`+this.cloneIndex+++`$$`,a),a}var Nt=function(e,t){var n=Se[e.key],r=xe[n];if(r instanceof ov)q(`q`),q(Pt(t)),r.gState&&p.setGState(r.gState),q(e.matrix.toString()+` cm`),q(`/`+n+` sh`),q(`Q`);else if(r instanceof sv){var i=new Ne(1,0,0,-1,0,gn());e.matrix&&(i=i.multiply(e.matrix||Fe),n=Mt.call(r,e.key,e.boundingBox,e.xStep,e.yStep,i).id),q(`q`),q(`/Pattern cs`),q(`/`+n+` scn`),r.gState&&p.setGState(r.gState),q(t),q(`Q`)}},Pt=function(e){switch(e){case`f`:case`F`:case`n`:return`W n`;case`f*`:return`W* n`;case`B`:case`S`:return`W S`;case`B*`:return`W* S`}},Ft=p.moveTo=function(e,t){return q(w(k(e))+` `+w(A(t))+` m`),this},It=p.lineTo=function(e,t){return q(w(k(e))+` `+w(A(t))+` l`),this},Lt=p.curveTo=function(e,t,n,r,i,a){return q([w(k(e)),w(A(t)),w(k(n)),w(A(r)),w(k(i)),w(A(a)),`c`].join(` `)),this};p.__private__.line=p.line=function(e,t,n,r,i){if(isNaN(e)||isNaN(t)||isNaN(n)||isNaN(r)||!Dt(i))throw Error(`Invalid arguments passed to jsPDF.line`);return b===v?this.lines([[n-e,r-t]],e,t,[1,1],i||`S`):this.lines([[n-e,r-t]],e,t,[1,1]).stroke()},p.__private__.lines=p.lines=function(e,t,n,r,i,a){var o,s,c,l,u,d,f,p,m,h,g,_;if(typeof e==`number`&&(_=n,n=t,t=e,e=_),r=r||[1,1],a=a||!1,isNaN(t)||isNaN(n)||!Array.isArray(e)||!Array.isArray(r)||!Dt(i)||typeof a!=`boolean`)throw Error(`Invalid arguments passed to jsPDF.lines`);for(Ft(t,n),o=r[0],s=r[1],l=e.length,h=t,g=n,c=0;c=100&&e<=900&&e%100==0?e:400:/^\d00$/.test(e)?parseInt(e):e===`bold`?700:400:400}(e.weight),i=function(e){return typeof Ny[e=e||`normal`]==`number`?e:`normal`}(e.stretch);return{family:t,style:n,weight:r,stretch:i,src:e.src||[],ref:e.ref||{name:t,style:[i,n,r].join(` `)}}}function dv(e,t,n,r){for(var i=n;i>=0&&i=0&&i>>1)&255}return i}function xv(e,t,n){var r=e.length,i=[];i[0]=4;for(var a=0;a>a&o}function Tv(e,t,n,r){var i=n*r,a=Math.floor(i/8),o=16-(i-8*a+r),s=(1<>8&255;e.setUint8(t,r)}})(e,a,Ev(e,a)&~(s<>7,o=1<<1+(7&i);e[t++],e[t++];var s=null,c=null;a&&(s=t,c=o,t+=3*o);var l=!0,u=[],d=0,f=null,p=0,m=null;for(this.width=n,this.height=r;l&&t=0))throw Error(`Invalid block size`);if(D===0)break;t+=D}break;case 249:if(e[t++]!==4||e[t+4]!==0)throw Error(`Invalid graphics extension block.`);var h=e[t++];d=e[t++]|e[t++]<<8,f=e[t++],1&h||(f=null),p=h>>2&7,t++;break;case 254:for(;;){if(!((D=e[t++])>=0))throw Error(`Invalid block size`);if(D===0)break;t+=D}break;default:throw Error(`Unknown graphic control label: 0x`+e[t-1].toString(16))}break;case 44:var g=e[t++]|e[t++]<<8,_=e[t++]|e[t++]<<8,v=e[t++]|e[t++]<<8,y=e[t++]|e[t++]<<8,b=e[t++],x=b>>6&1,S=1<<1+(7&b),C=s,w=c,T=!1;b>>7&&(T=!0,C=t,w=S,t+=3*S);var E=t;for(t++;;){var D;if(!((D=e[t++])>=0))throw Error(`Invalid block size`);if(D===0)break;t+=D}u.push({x:g,y:_,width:v,height:y,has_local_palette:T,palette_offset:C,palette_size:w,data_offset:E,data_length:t-E,transparent_index:f,interlaced:!!x,delay:d,disposal:p});break;case 59:l=!1;break;default:throw Error(`Unknown gif block: 0x`+e[t-1].toString(16))}this.numFrames=function(){return u.length},this.loopCount=function(){return m},this.frameInfo=function(e){if(e<0||e>=u.length)throw Error(`Frame index out of range.`);return u[e]},this.decodeAndBlitFrameBGRA=function(t,r){var i=this.frameInfo(t),a=i.width*i.height;if(a>536870912)throw Error(`Image dimensions exceed 512MB, which is too large.`);var o=new Uint8Array(a);Ov(e,i.data_offset,o,a);var s=i.palette_offset,c=i.transparent_index;c===null&&(c=256);var l=i.width,u=n-l,d=l,f=4*(i.y*n+i.x),p=4*((i.y+i.height)*n+i.x),m=f,h=4*u;!0===i.interlaced&&(h+=4*n*7);for(var g=8,_=0,v=o.length;_=p&&(h=4*u+4*n*(g-1),m=f+(l+u)*(g<<1),g>>=1)),y===c)m+=4;else{var b=e[s+3*y],x=e[s+3*y+1],S=e[s+3*y+2];r[m++]=S,r[m++]=x,r[m++]=b,r[m++]=255}--d}},this.decodeAndBlitFrameRGBA=function(t,r){var i=this.frameInfo(t),a=i.width*i.height;if(a>536870912)throw Error(`Image dimensions exceed 512MB, which is too large.`);var o=new Uint8Array(a);Ov(e,i.data_offset,o,a);var s=i.palette_offset,c=i.transparent_index;c===null&&(c=256);var l=i.width,u=n-l,d=l,f=4*(i.y*n+i.x),p=4*((i.y+i.height)*n+i.x),m=f,h=4*u;!0===i.interlaced&&(h+=4*n*7);for(var g=8,_=0,v=o.length;_=p&&(h=4*u+4*n*(g-1),m=f+(l+u)*(g<<1),g>>=1)),y===c)m+=4;else{var b=e[s+3*y],x=e[s+3*y+1],S=e[s+3*y+2];r[m++]=b,r[m++]=x,r[m++]=S,r[m++]=255}--d}}}function Ov(e,t,n,r){for(var i=e[t++],a=1<>=c,u-=c,g!==a){if(g===o)break;for(var _=ga;)y=m[y]>>8,++v;var b=y;if(f+v+(_===g?0:1)>r)return void Fv.log(`Warning, gif stream longer than expected.`);n[f++]=b;var x=f+=v;for(_!==g&&(n[f++]=b),y=_;v--;)y=m[y],n[--x]=255&y,y>>=8;h!==null&&s<4096&&(m[s++]=h<<8|b,s>=l+1&&c<12&&(++c,l=l<<1|1)),h=g}else s=o+1,l=(1<<(c=i+1))-1,h=null}return f!==r&&Fv.log(`Warning, gif stream shorter than expected.`),n}function kv(e){var t,n,r,i,a,o=Math.floor,s=Array(64),c=Array(64),l=Array(64),u=Array(64),d=Array(65535),f=Array(65535),p=Array(64),m=Array(64),h=[],g=0,_=7,v=Array(64),y=Array(64),b=Array(64),x=Array(256),S=Array(2048),C=[0,1,5,6,14,15,27,28,2,4,7,13,16,26,29,42,3,8,12,17,25,30,41,43,9,11,18,24,31,40,44,53,10,19,23,32,39,45,52,54,20,22,33,38,46,51,55,60,21,34,37,47,50,56,59,61,35,36,48,49,57,58,62,63],w=[0,0,1,5,1,1,1,1,1,1,0,0,0,0,0,0,0],T=[0,1,2,3,4,5,6,7,8,9,10,11],E=[0,0,2,1,3,3,2,4,3,5,5,4,4,0,0,1,125],D=[1,2,3,0,4,17,5,18,33,49,65,6,19,81,97,7,34,113,20,50,129,145,161,8,35,66,177,193,21,82,209,240,36,51,98,114,130,9,10,22,23,24,25,26,37,38,39,40,41,42,52,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,225,226,227,228,229,230,231,232,233,234,241,242,243,244,245,246,247,248,249,250],O=[0,0,3,1,1,1,1,1,1,1,1,1,0,0,0,0,0],k=[0,1,2,3,4,5,6,7,8,9,10,11],A=[0,0,2,1,2,4,4,3,4,7,5,4,4,0,1,2,119],j=[0,1,2,3,17,4,5,33,49,6,18,65,81,7,97,113,19,34,50,129,8,20,66,145,161,177,193,9,35,51,82,240,21,98,114,209,10,22,36,52,225,37,241,23,24,25,26,38,39,40,41,42,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,130,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,226,227,228,229,230,231,232,233,234,242,243,244,245,246,247,248,249,250];function M(e,t){for(var n=0,r=0,i=[],a=1;a<=16;a++){for(var o=1;o<=e[a];o++)i[t[r]]=[],i[t[r]][0]=n,i[t[r]][1]=a,r++,n++;n*=2}return i}function N(e){for(var t=e[0],n=e[1]-1;n>=0;)t&1<>8&255),P(255&e)}function I(e,t,n,r,i){for(var a,o=i[0],s=i[240],c=function(e,t){var n,r,i,a,o,s,c,l,u,d,f=0;for(u=0;u<8;++u){n=e[f],r=e[f+1],i=e[f+2],a=e[f+3],o=e[f+4],s=e[f+5],c=e[f+6];var m=n+(l=e[f+7]),h=n-l,g=r+c,_=r-c,v=i+s,y=i-s,b=a+o,x=a-o,S=m+b,C=m-b,w=g+v,T=g-v;e[f]=S+w,e[f+4]=S-w;var E=.707106781*(T+C);e[f+2]=C+E,e[f+6]=C-E;var D=.382683433*((S=x+y)-(T=_+h)),O=.5411961*S+D,k=1.306562965*T+D,A=.707106781*(w=y+_),j=h+A,M=h-A;e[f+5]=M+O,e[f+3]=M-O,e[f+1]=j+k,e[f+7]=j-k,f+=8}for(f=0,u=0;u<8;++u){n=e[f],r=e[f+8],i=e[f+16],a=e[f+24],o=e[f+32],s=e[f+40],c=e[f+48];var N=n+(l=e[f+56]),P=n-l,F=r+c,I=r-c,L=i+s,R=i-s,z=a+o,B=a-o,V=N+z,H=N-z,ee=F+L,U=F-L;e[f]=V+ee,e[f+32]=V-ee;var W=.707106781*(U+H);e[f+16]=H+W,e[f+48]=H-W;var te=.382683433*((V=B+R)-(U=I+P)),G=.5411961*V+te,ne=1.306562965*U+te,re=.707106781*(ee=R+I),K=P+re,q=P-re;e[f+40]=q+G,e[f+24]=q-G,e[f+8]=K+ne,e[f+56]=K-ne,f++}for(u=0;u<64;++u)d=e[u]*t[u],p[u]=d>0?d+.5|0:d-.5|0;return p}(e,t),l=0;l<64;++l)m[C[l]]=c[l];var u=m[0]-n;n=m[0],u==0?N(r[0]):(N(r[f[a=32767+u]]),N(d[a]));for(var h=63;h>0&&m[h]==0;)h--;if(h==0)return N(o),n;for(var g,_=1;_<=h;){for(var v=_;m[_]==0&&_<=h;)++_;var y=_-v;if(y>=16){g=y>>4;for(var b=1;b<=g;++b)N(s);y&=15}a=32767+m[_],N(i[(y<<4)+f[a]]),N(d[a]),_++}return h!=63&&N(o),n}function L(e){e=Math.min(Math.max(e,1),100),a!=e&&(function(e){for(var t=[16,11,10,16,24,40,51,61,12,12,14,19,26,58,60,55,14,13,16,24,40,57,69,56,14,17,22,29,51,87,80,62,18,22,37,56,68,109,103,77,24,35,55,64,81,104,113,92,49,64,78,87,103,121,120,101,72,92,95,98,112,100,103,99],n=0;n<64;n++){var r=o((t[n]*e+50)/100);r=Math.min(Math.max(r,1),255),s[C[n]]=r}for(var i=[17,18,24,47,99,99,99,99,18,21,26,66,99,99,99,99,24,26,56,99,99,99,99,99,47,66,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99],a=0;a<64;a++){var d=o((i[a]*e+50)/100);d=Math.min(Math.max(d,1),255),c[C[a]]=d}for(var f=[1,1.387039845,1.306562965,1.175875602,1,.785694958,.5411961,.275899379],p=0,m=0;m<8;m++)for(var h=0;h<8;h++)l[p]=1/(s[C[p]]*f[m]*f[h]*8),u[p]=1/(c[C[p]]*f[m]*f[h]*8),p++}(Math.floor(e<50?5e3/e:200-2*e)),a=e)}this.encode=function(e,a){a&&L(a),h=[],g=0,_=7,F(65496),F(65504),F(16),P(74),P(70),P(73),P(70),P(0),P(1),P(1),P(0),F(1),F(1),P(0),P(0),function(){F(65499),F(132),P(0);for(var e=0;e<64;e++)P(s[e]);P(1);for(var t=0;t<64;t++)P(c[t])}(),function(e,t){F(65472),F(17),P(8),F(t),F(e),P(3),P(1),P(17),P(0),P(2),P(17),P(1),P(3),P(17),P(1)}(e.width,e.height),function(){F(65476),F(418),P(0);for(var e=0;e<16;e++)P(w[e+1]);for(var t=0;t<=11;t++)P(T[t]);P(16);for(var n=0;n<16;n++)P(E[n+1]);for(var r=0;r<=161;r++)P(D[r]);P(1);for(var i=0;i<16;i++)P(O[i+1]);for(var a=0;a<=11;a++)P(k[a]);P(17);for(var o=0;o<16;o++)P(A[o+1]);for(var s=0;s<=161;s++)P(j[s])}(),F(65498),F(12),P(3),P(1),P(0),P(2),P(17),P(3),P(17),P(0),P(63),P(0);var o=0,d=0,f=0;g=0,_=7,this.encode.displayName=`_encode_`;for(var p,m,x,C,M,R,z,B,V,H=e.data,ee=e.width,U=e.height,W=4*ee,te=0;te>3)*W+(z=4*(7&V)),te+B>=U&&(R-=W*(te+1+B-U)),p+z>=W&&(R-=p+z-W+4),m=H[R++],x=H[R++],C=H[R++],v[V]=(S[m]+S[x+256|0]+S[C+512|0]>>16)-128,y[V]=(S[m+768|0]+S[x+1024|0]+S[C+1280|0]>>16)-128,b[V]=(S[m+1280|0]+S[x+1536|0]+S[C+1792|0]>>16)-128;o=I(v,l,o,t,r),d=I(y,u,d,n,i),f=I(b,u,f,n,i),p+=32}te+=8}if(_>=0){var G=[];G[1]=_+1,G[0]=(1<<_+1)-1,N(G)}return F(65497),new Uint8Array(h)},e=e||50,function(){for(var e=String.fromCharCode,t=0;t<256;t++)x[t]=e(t)}(),t=M(w,T),n=M(O,k),r=M(E,D),i=M(A,j),function(){for(var e=1,t=2,n=1;n<=15;n++){for(var r=e;rr;r++)if(e[t+r]!=n.charCodeAt(r))return!0;return!1}function r(e,t,n,r,i){for(var a=0;ar+1?[]:new t),!(i.length>>0;e&n;)n>>>=1;return n?(e&n-1)+n:e}function l(e,n,r,i,a){t(!(i%r));do e[n+(i-=r)]=a;while(0=o),512>=o)var s=a(512);else if((s=a(o))==null)return 0;return function(e,n,r,i,o,s){var u,f,p=n,m=1<u;++u){if(h[u]>1<(S-=h[u]))return 0;for(;0=u;++u,o<<=1){if(x+=S<<=1,0>(S-=h[u]))return 0;for(;0v&&!(0>=(_-=h[v]));)++v,_<<=1;m+=C=1<<(_=v-r),e[n+(v=b&y)].g=_+r,e[n+v].value=p-n-v}i.g=u-r,i.value=s[f++],l(e,p+(b>>r),o,C,i),b=c(b,u)}}return x==2*g[15]-1?m:0}(e,n,r,i,o,s)}function d(){this.value=this.g=0}function f(){this.value=this.g=0}function p(){this.G=o(5,d),this.H=a(5),this.jc=this.Qb=this.qb=this.nd=0,this.pd=o(zn,f)}function m(e,n,r,i){t(e!=null),t(n!=null),t(2147483648>i),e.Ca=254,e.I=0,e.b=-8,e.Ka=0,e.oa=n,e.pa=r,e.Jd=n,e.Yc=r+i,e.Zc=4<=i?r+i-4+1:r,E(e)}function h(e,t){for(var n=0;0i),e.Sb=i,e.Ra=0,e.u=0,e.h=0,4>>=8,e.Ra+=e.oa[e.pa+e.bb]<>>0,++e.bb,e.u-=8;C(e)&&(e.h=1,e.u=0)}function y(e,n){if(t(0<=n),!e.h&&n<=Vn){var r=S(e)&Bn[n];return e.u+=n,v(e),r}return e.h=1,e.u=0}function b(){this.b=this.Ca=this.I=0,this.oa=[],this.pa=0,this.Jd=[],this.Yc=0,this.Zc=[],this.Ka=0}function x(){this.Ra=0,this.oa=[],this.h=this.u=this.bb=this.Sb=this.pa=0}function S(e){return e.Ra>>>(e.u&Hn-1)>>>0}function C(e){return t(e.bb<=e.Sb),e.h||e.bb==e.Sb&&e.u>Hn}function w(e,t){e.u=t,e.h=C(e)}function T(e){e.u>=Un&&(t(e.u>=Un),v(e))}function E(e){t(e!=null&&e.oa!=null),e.pa>>0,e.b+=8):(t(e!=null&&e.oa!=null),e.pae.b&&E(e);var r=e.b,i=n*t>>>8,a=(e.I>>>r>i)+0;for(a?(n-=i,e.I-=i+1<>>0):n=i+1,r=n,i=0;256<=r;)i+=8,r>>=8;return r=7^i+Wn[r],e.b-=r,e.Ca=(n<>24&255,e[t+1]=n>>16&255,e[t+2]=n>>8&255,e[t+3]=255&n}function A(e,t){return e[t+0]|e[t+1]<<8}function j(e,t){return A(e,t)|e[t+2]<<16}function M(e,t){return A(e,t)|A(e,t+2)<<16}function N(e,n){var r=1<=a||0>=o?0:(r[0]=a,i[0]=o,1)}function L(e,t){return e+(1<>>t}function R(e,t){return((4278255360&e)+(4278255360&t)>>>0&4278255360)+((16711935&e)+(16711935&t)>>>0&16711935)>>>0}function z(t,n){e[n]=function(n,r,i,a,o,s,c){for(var l=0;l>>1)+(e&t)>>>0}function H(e){return 0<=e&&256>e?e:0>e?0:255>1))}function U(e,t,n){return Math.abs(t-n)-Math.abs(e-n)}function W(e,t,n,r,i,a,o){for(r=a[o-1],n=0;n>8&255,c=16711935&(c=(c=16711935&o)+((s<<16)+s));r[i+a]=(4278255360&o)+c>>>0}}function G(e,t){t.jd=255&e,t.hd=e>>8&255,t.ud=e>>16&255}function ne(e,t,n,r,i,a){for(var o=0;o>>8,l=s,u=255&(u=(u=s>>>16)+((e.jd<<24>>24)*(c<<24>>24)>>>5));l=255&(l=(l+=(e.hd<<24>>24)*(c<<24>>24)>>>5)+((e.ud<<24>>24)*(u<<24>>24)>>>5)),i[a+o]=(4278255360&s)+(u<<16)+l}}function re(t,n,r,i,a){e[n]=function(e,t,n,r,o,s,c,l,u){for(r=c;r>t.b,f=t.Ea,p=t.K[0],m=t.w;if(8>d)for(t=(1<>=d}else e[`VP8LMapColor`+r](s,c,p,m,l,u,n,o,f)}}function K(e,t,n,r,i){for(n=t+n;t>16&255,r[i++]=a>>8&255,r[i++]=255&a}}function q(e,t,n,r,i){for(n=t+n;t>16&255,r[i++]=a>>8&255,r[i++]=255&a,r[i++]=a>>24&255}}function J(e,t,n,r,i){for(n=t+n;t>16&240|o>>12&15,o=240&o|o>>28&15;r[i++]=a,r[i++]=o}}function ie(e,t,n,r,i){for(n=t+n;t>16&248|o>>13&7,o=o>>5&224|o>>3&31;r[i++]=a,r[i++]=o}}function ae(e,t,n,r,i){for(n=t+n;t>8&255,r[i++]=a>>16&255}}function oe(e,t,n,i,a,o){if(o==0)for(n=t+n;t>24|o[1]>>8&65280|o[2]<<8&16711680|o[3]<<24)>>>0),a+=32;else r(i,a,e,t,n)}function Y(t,n){e[n][0]=e[t+`0`],e[n][1]=e[t+`1`],e[n][2]=e[t+`2`],e[n][3]=e[t+`3`],e[n][4]=e[t+`4`],e[n][5]=e[t+`5`],e[n][6]=e[t+`6`],e[n][7]=e[t+`7`],e[n][8]=e[t+`8`],e[n][9]=e[t+`9`],e[n][10]=e[t+`10`],e[n][11]=e[t+`11`],e[n][12]=e[t+`12`],e[n][13]=e[t+`13`],e[n][14]=e[t+`0`],e[n][15]=e[t+`0`]}function X(e){return e==Ur||e==Wr||e==Gr||e==Kr}function se(){this.eb=[],this.size=this.A=this.fb=0}function ce(){this.y=[],this.f=[],this.ea=[],this.F=[],this.Tc=this.Ed=this.Cd=this.Fd=this.lb=this.Db=this.Ab=this.fa=this.J=this.W=this.N=this.O=0}function Z(){this.Rd=this.height=this.width=this.S=0,this.f={},this.f.RGBA=new se,this.f.kb=new ce,this.sd=null}function le(){this.width=[0],this.height=[0],this.Pd=[0],this.Qd=[0],this.format=[0]}function ue(){this.Id=this.fd=this.Md=this.hb=this.ib=this.da=this.bd=this.cd=this.j=this.v=this.Da=this.Sd=this.ob=0}function de(e){return alert(`todo:WebPSamplerProcessPlane`),e.T}function fe(e,t){var n=e.T,i=t.ba.f.RGBA,a=i.eb,o=i.fb+e.ka*i.A,s=_i[t.ba.S],c=e.y,l=e.O,u=e.f,d=e.N,f=e.ea,p=e.W,m=t.cc,h=t.dc,g=t.Mc,_=t.Nc,v=e.ka,y=e.ka+e.T,b=e.U,x=b+1>>1;for(v==0?s(c,l,null,null,u,d,f,p,u,d,f,p,a,o,null,null,b):(s(t.ec,t.fc,c,l,m,h,g,_,u,d,f,p,a,o-i.A,a,o,b),++n);v+2n,i=n==Lr||n==zr||n==Br||n==Vr||n==12||X(n);if(t.memory=null,t.Ib=null,t.Jb=null,t.Nd=null,!In(t.Oa,e,i?11:12))return 0;if(i&&X(n)&&yn(),e.da)alert(`todo:use_scaling`);else{if(r){if(t.Ib=de,e.Kb){if(n=e.U+1>>1,t.memory=a(e.U+2*n),t.memory==null)return 0;t.ec=t.memory,t.fc=0,t.cc=t.ec,t.dc=t.fc+e.U,t.Mc=t.cc,t.Nc=t.dc+n,t.Ib=fe,yn()}}else alert(`todo:EmitYUV`);i&&(t.Jb=pe,r&&_n())}if(r&&!ji){for(e=0;256>e;++e)Mi[e]=89858*(e-128)+Ei>>Ti,Fi[e]=-22014*(e-128)+Ei,Pi[e]=-45773*(e-128),Ni[e]=113618*(e-128)+Ei>>Ti;for(e=Di;e>Ti,Ii[e-Di]=qe(t,255),Li[e-Di]=qe(t+8>>4,15);ji=1}return 1}function he(e){var n=e.ma,r=e.U,i=e.T;return t(!(1&e.ka)),0>=r||0>=i?0:(r=n.Ib(e,n),n.Jb!=null&&n.Jb(e,n,r),n.Dc+=r,1)}function ge(e){e.ma.memory=null}function _e(e,t,n,r){return y(e,8)==47?(t[0]=y(e,14)+1,n[0]=y(e,14)+1,r[0]=y(e,1),y(e,3)==0?!e.h:0):0}function ve(e,t){if(4>e)return e+1;var n=e-2>>1;return(2+(1&e)<>4)*e+(8-(15&n)))?n:1;var n}function be(e,t,n){var r=S(n),i=e[t+=255&r].g-8;return 0>>0,t(8>=r.g),e.g}function Se(e,n,r){var i=e.xc;return t((n=i==0?0:e.vc[e.md*(r>>i)+(n>>i)])>E.b)*w;_x&&(A=x),(0,Qn[D[O++]>>8&15])(m,h+ +k,y,b+k-x,A-k,y,b+k),k=A}h+=x,b+=x,++_&C||(E+=w)}p!=d.nc&&r(u,l-g,u,l+(p-f-1)*g,g);break;case 1:for(g=m,v=h,x=(m=d.Ea)-(b=m&~(y=(h=1<>d.b)*_;f=a),0o.o&&(i=o.o),r=i?r=0:(a[0]+=4*o.v,o.ka=r-o.j,o.U=o.va-o.v,o.T=i-r,r=1),r){if(c=c[0],11>(r=e.ca).S){var d=r.f.RGBA,f=(i=r.S,a=o.U,o=o.T,u=d.eb,d.A),p=o;for(d=d.fb+e.Ma*d.A;0i){var a=e.l.width,o=r.ca,s=r.tb+a*i,c=e.V,l=e.Ba+e.c*i,u=e.gc;t(e.ab==1),t(u[0].hc==3),Xn(u[0],i,n,c,l,o,s),Ee(r,i,n,o,s,a)}e.C=e.Ma=n}function Oe(e,n,r,i,a,o,s){var c=e.$/i,l=e.$%i,u=e.m,d=e.s,f=r+e.$,p=f;a=r+i*a;var m=r+i*o,h=280+d.ua,g=e.Pb?c:16777216,_=0=g){var E=f-r;t((g=e).Pb),g.wd=g.m,g.xd=E,0O.g?(w(x,x.u+O.g),E[D]=O.value,x=0):(w(x,x.u+O.g-256),t(256<=O.value),x=O.value),x==0&&(b=!0)}else x=be(y.G[0],y.H[0],u)}if(u.h)break;if(b||256>x){if(!b){if(y.nd)n[f]=(y.qb|x<<8)>>>0;else{if(T(u),b=be(y.G[1],y.H[1],u),T(u),E=be(y.G[2],y.H[2],u),D=be(y.G[3],y.H[3],u),u.h)break;n[f]=(D<<24|b<<16|x<<8|E)>>>0}}if(b=!1,++f,++l>=i&&(l=0,++c,s!=null&&c<=o&&!(c%16)&&s(e,c),_!=null))for(;p>>_.Mb]=x}else if(280>x){if(x=ve(x-256,u),E=be(y.G[4],y.H[4],u),T(u),E=ye(i,E=ve(E,u)),u.h)break;if(f-r=i;)l-=i,++c,s!=null&&c<=o&&!(c%16)&&s(e,c);if(t(f<=a),l&v&&(y=Se(d,l,c)),_!=null)for(;p>>_.Mb]=x}else{if(!(x>>_.Mb]=x;x=f,t(!(b>>>(E=_).Xa)),n[x]=E.X[b],b=!0}b||t(u.h==C(u))}if(e.Pb&&u.h&&fo?o:c),e.a=0,e.$=f-r}return 1}return e.a=3,0}function ke(e){t(e!=null),e.vc=null,e.yc=null,e.Ya=null;var n=e.Wa;n!=null&&(n.X=null),e.vb=null,t(e!=null)}function Ae(){var t=new sn;return t==null?null:(t.a=0,t.xb=hi,Y(`Predictor`,`VP8LPredictors`),Y(`Predictor`,`VP8LPredictors_C`),Y(`PredictorAdd`,`VP8LPredictorsAdd`),Y(`PredictorAdd`,`VP8LPredictorsAdd_C`),qn=te,$n=ne,er=K,tr=q,nr=J,rr=ie,ir=ae,e.VP8LMapColor32b=Yn,e.VP8LMapColor8b=Zn,t)}function je(e,n,r,s,c){var l=1,f=[e],m=[n],h=s.m,g=s.s,_=null,v=0;t:for(;;){if(r)for(;l&&y(h,1);){var b=f,x=m,C=s,E=1,D=C.m,O=C.gc[C.ab],k=y(D,2);if(C.Oc&1<=C.ab),k){case 0:case 1:O.b=y(D,3)+2,E=je(L(O.Ea,O.b),L(O.nc,O.b),0,C,O.K),O.K=O.K[0];break;case 3:var A,j=y(D,8)+1,M=16>I.b),B=a(z);if(B==null)A=0;else{var V=I.K[0],H=I.w;for(B[0]=I.K[0][0],P=1;P<1*F;++P)B[P]=R(V[H+P],B[P-1]);for(;P<4*z;++P)B[P]=0;I.K[0]=null,I.K[0]=B,A=1}}E=A;break;case 2:break;default:t(0)}l=E}}if(f=f[0],m=m[0],l&&y(h,1)&&!(l=1<=(v=y(h,4))&&11>=v)){s.a=3;break t}var ee;if(ee=l)e:{var U,W,te,G=s,ne=f,re=m,K=v,q=r,J=G.m,ie=G.s,ae=[null],oe=1,Y=0,X=$r[K];r:for(;;){if(q&&y(J,1)){var se=y(J,3)+2,ce=L(ne,se),Z=L(re,se),le=ce*Z;if(!je(ce,Z,0,G,ae))break r;for(ae=ae[0],ie.xc=se,U=0;U>8&65535;ae[U]=ue,ue>=oe&&(oe=ue+1)}}if(J.h)break r;for(W=0;5>W;++W){var de=Yr[W];!W&&0=pe),he=me;var ge=a(Y);if(he==null||ge==null||fe==null){G.a=1;break r}var _e=fe;for(U=te=0;UW;++W){de=Yr[W],ye[W]=_e,be[W]=te,!W&&0qe)break i}else Ue=qe;for(We=0;Weet)Je[We++]=et,et!=0&&(Ze=et);else{var tt=et==16,nt=et-16,rt=Jr[nt],it=y(Xe,qr[nt])+rt;if(We+it>qe)break i;for(var at=tt?Ze:0;0=W){var ot,st=ge[0];for(ot=1;otst&&(st=ge[ot]);we+=st}}if(ve.nd=Ce,ve.Qb=0,Ce&&(ve.qb=(ye[3][be[3]+0].value<<24|ye[1][be[1]+0].value<<16|ye[2][be[2]+0].value)>>>0,Se==0&&256>ye[0][be[0]+0].value&&(ve.Qb=1,ve.qb+=ye[0][be[0]+0].value<<8)),ve.jc=!ve.Qb&&6>we,ve.jc){var ct,lt=ve;for(ct=0;ct>=xe(ft,8,dt),ut>>=xe(lt.G[1][lt.H[1]+ut],16,dt),ut>>=xe(lt.G[2][lt.H[2]+ut],0,dt),xe(lt.G[3][lt.H[3]+ut],24,dt))}}}ie.vc=ae,ie.Wb=oe,ie.Ya=he,ie.yc=fe,ee=1;break e}ee=0}if(!(l=ee)){s.a=3;break t}if(0n+1?[]:0),!(r.lengthe?0:e>t?t:e}function Je(){this.T=this.U=this.ka=this.height=this.width=0,this.y=[],this.f=[],this.ea=[],this.Rc=this.fa=this.W=this.N=this.O=0,this.ma=`void`,this.put=`VP8IoPutHook`,this.ac=`VP8IoSetupHook`,this.bc=`VP8IoTeardownHook`,this.ha=this.Kb=0,this.data=[],this.hb=this.ib=this.da=this.o=this.j=this.va=this.v=this.Da=this.ob=this.w=0,this.F=[],this.J=0}function Ye(){var e=new Ke;return e!=null&&(e.a=0,e.sc=`OK`,e.cb=0,e.Xb=0,ri||(ri=$e)),e}function Xe(e,t,n){return e.a==0&&(e.a=t,e.sc=n,e.cb=0),0}function Ze(e,t,n){return 3<=n&&e[t+0]==157&&e[t+1]==1&&e[t+2]==42}function Qe(e,n){if(e==null)return 0;if(e.a=0,e.sc=`OK`,n==null)return Xe(e,2,`null VP8Io passed to VP8GetHeaders()`);var r=n.data,a=n.w,o=n.ha;if(4>o)return Xe(e,7,`Truncated header.`);var s=r[a+0]|r[a+1]<<8|r[a+2]<<16,c=e.Od;if(c.Rb=!(1&s),c.td=s>>1&7,c.yd=s>>4&1,c.ub=s>>5,3o)return Xe(e,7,`cannot parse picture header`);if(!Ze(r,a,o))return Xe(e,3,`Bad code word`);l.c=16383&(r[a+4]<<8|r[a+3]),l.Td=r[a+4]>>6,l.i=16383&(r[a+6]<<8|r[a+5]),l.Ud=r[a+6]>>6,a+=7,o-=7,e.za=l.c+15>>4,e.Ub=l.i+15>>4,n.width=l.c,n.height=l.i,n.Da=0,n.j=0,n.v=0,n.va=n.width,n.o=n.height,n.da=0,n.ib=n.width,n.hb=n.height,n.U=n.width,n.T=n.height,i((s=e.Pa).jb,0,255,s.jb.length),t((s=e.Qa)!=null),s.Cb=0,s.Bb=0,s.Fb=1,i(s.Zb,0,0,s.Zb.length),i(s.Lb,0,0,s.Lb)}if(c.ub>o)return Xe(e,7,`bad partition length`);m(s=e.m,r,a,c.ub),a+=c.ub,o-=c.ub,c.Rb&&(l.Ld=D(s),l.Kd=D(s)),l=e.Qa;var u,d=e.Pa;if(t(s!=null),t(l!=null),l.Cb=D(s),l.Cb){if(l.Bb=D(s),D(s)){for(l.Fb=D(s),u=0;4>u;++u)l.Zb[u]=D(s)?g(s,7):0;for(u=0;4>u;++u)l.Lb[u]=D(s)?g(s,6):0}if(l.Bb)for(u=0;3>u;++u)d.jb[u]=D(s)?h(s,8):255}else l.Bb=0;if(s.Ka)return Xe(e,3,`cannot parse segment header`);if((l=e.ed).zd=D(s),l.Tb=h(s,6),l.wb=h(s,3),l.Pc=D(s),l.Pc&&D(s)){for(d=0;4>d;++d)D(s)&&(l.vd[d]=g(s,6));for(d=0;4>d;++d)D(s)&&(l.od[d]=g(s,6))}if(e.L=l.Tb==0?0:l.zd?1:2,s.Ka)return Xe(e,3,`cannot parse filter header`);var f=o;if(o=u=a,a=u+f,l=f,e.Xb=(1<l&&(p=l),m(e.Jc[+f],r,u,p),u+=p,l-=p,o+=3}m(e.Jc[+d],r,u,l),r=up;++p){if(f.Cb){var _=f.Zb[p];f.Fb||(_+=r)}else{if(0>16,8>v.Eb[1]&&(v.Eb[1]=8),v.Qc[0]=ti[qe(_+d,117)],v.Qc[1]=ni[qe(_+u,127)],v.lc=_+u}if(!c.Rb)return Xe(e,4,`Not a key frame.`);for(D(s),c=e.Pa,r=0;4>r;++r){for(o=0;8>o;++o)for(a=0;3>a;++a)for(l=0;11>l;++l)d=O(s,li[r][o][a][l])?h(s,8):si[r][o][a][l],c.Wc[r][o].Yb[a][l]=d;for(o=0;17>o;++o)c.Xc[r][o]=c.Wc[r][ui[o]]}return e.kc=D(s),e.kc&&(e.Bd=h(s,8)),e.cb=1}function $e(e,t,n,r,i,a,o){var s=t[i].Yb[n];for(n=0;16>i;++i){if(!O(e,s[n+0]))return i;for(;!O(e,s[n+1]);)if(s=t[++i].Yb[0],n=0,i==16)return 16;var c=t[i+1].Yb;if(O(e,s[n+2])){var l=e,u=0;if(O(l,(f=s)[(d=n)+3])){if(O(l,f[d+6])){for(s=0,d=2*(u=O(l,f[d+8]))+(f=O(l,f[d+9+u])),u=0,f=ii[d];f[s];++s)u+=u+O(l,f[s]);u+=3+(8<(l=e).b&&E(l);var d,f=l.b,p=(d=l.Ca>>1)-(l.I>>f)>>31;--l.b,l.Ca+=p,l.Ca|=1,l.I-=(d+1&p)<>3),e[t+n+32*r]=-256&i?0>i?0:255:i}function nt(e,t,n,r,i,a){tt(e,t,0,n,r+i),tt(e,t,1,n,r+a),tt(e,t,2,n,r-a),tt(e,t,3,n,r-i)}function rt(e){return(20091*e>>16)+e}function it(e,t,n,r){var i,o=0,s=a(16);for(i=0;4>i;++i){var c=e[t+0]+e[t+8],l=e[t+0]-e[t+8],u=(35468*e[t+4]>>16)-rt(e[t+12]),d=rt(e[t+4])+(35468*e[t+12]>>16);s[o+0]=c+d,s[o+1]=l+u,s[o+2]=l-u,s[o+3]=c-d,o+=4,t++}for(i=o=0;4>i;++i)c=(e=s[o+0]+4)+s[o+8],l=e-s[o+8],u=(35468*s[o+4]>>16)-rt(s[o+12]),tt(n,r,0,0,c+(d=rt(s[o+4])+(35468*s[o+12]>>16))),tt(n,r,1,0,l+u),tt(n,r,2,0,l-u),tt(n,r,3,0,c-d),o++,r+=32}function at(e,t,n,r){var i=e[t+0]+4,a=35468*e[t+4]>>16,o=rt(e[t+4]),s=35468*e[t+1]>>16;nt(n,r,0,i+o,e=rt(e[t+1]),s),nt(n,r,1,i+a,e,s),nt(n,r,2,i-a,e,s),nt(n,r,3,i-o,e,s)}function ot(e,t,n,r,i){it(e,t,n,r),i&&it(e,t+16,n,r+4)}function st(e,t,n,r){or(e,t+0,n,r,1),or(e,t+32,n,r+128,1)}function ct(e,t,n,r){var i;for(e=e[t+0]+4,i=0;4>i;++i)for(t=0;4>t;++t)tt(n,r,t,i,e)}function lt(e,t,n,r){e[t+0]&&lr(e,t+0,n,r),e[t+16]&&lr(e,t+16,n,r+4),e[t+32]&&lr(e,t+32,n,r+128),e[t+48]&&lr(e,t+48,n,r+128+4)}function ut(e,t,n,r){var i,o=a(16);for(i=0;4>i;++i){var s=e[t+0+i]+e[t+12+i],c=e[t+4+i]+e[t+8+i],l=e[t+4+i]-e[t+8+i],u=e[t+0+i]-e[t+12+i];o[0+i]=s+c,o[8+i]=s-c,o[4+i]=u+l,o[12+i]=u-l}for(i=0;4>i;++i)s=(e=o[0+4*i]+3)+o[3+4*i],c=o[1+4*i]+o[2+4*i],l=o[1+4*i]-o[2+4*i],u=e-o[3+4*i],n[r+0]=s+c>>3,n[r+16]=u+l>>3,n[r+32]=s-c>>3,n[r+48]=u-l>>3,r+=64}function dt(e,t,n){var r,i=t-32,a=Pr,o=255-e[i-1];for(r=0;rn;++n)r(e,t+32*n,e,t-32,16)}function gt(e,t){for(var n=16;0r;++r)i(t,n+32*r,e,16)}function vt(e,t){var n,r=16;for(n=0;16>n;++n)r+=e[t-1+32*n]+e[t+n-32];_t(r>>5,e,t)}function yt(e,t){var n,r=8;for(n=0;16>n;++n)r+=e[t-1+32*n];_t(r>>4,e,t)}function bt(e,t){var n,r=8;for(n=0;16>n;++n)r+=e[t+n-32];_t(r>>4,e,t)}function xt(e,t){_t(128,e,t)}function St(e,t,n){return e+2*t+n+2>>2}function Ct(e,t){var n,i=t-32;for(i=new Uint8Array([St(e[i-1],e[i+0],e[i+1]),St(e[i+0],e[i+1],e[i+2]),St(e[i+1],e[i+2],e[i+3]),St(e[i+2],e[i+3],e[i+4])]),n=0;4>n;++n)r(e,t+32*n,i,0,i.length)}function wt(e,t){var n=e[t-1],r=e[t-1+32],i=e[t-1+64],a=e[t-1+96];k(e,t+0,16843009*St(e[t-1-32],n,r)),k(e,t+32,16843009*St(n,r,i)),k(e,t+64,16843009*St(r,i,a)),k(e,t+96,16843009*St(i,a,a))}function Tt(e,t){var n,r=4;for(n=0;4>n;++n)r+=e[t+n-32]+e[t-1+32*n];for(r>>=3,n=0;4>n;++n)i(e,t+32*n,r,4)}function Et(e,t){var n=e[t-1+0],r=e[t-1+32],i=e[t-1+64],a=e[t-1-32],o=e[t+0-32],s=e[t+1-32],c=e[t+2-32],l=e[t+3-32];e[t+0+96]=St(r,i,e[t-1+96]),e[t+1+96]=e[t+0+64]=St(n,r,i),e[t+2+96]=e[t+1+64]=e[t+0+32]=St(a,n,r),e[t+3+96]=e[t+2+64]=e[t+1+32]=e[t+0+0]=St(o,a,n),e[t+3+64]=e[t+2+32]=e[t+1+0]=St(s,o,a),e[t+3+32]=e[t+2+0]=St(c,s,o),e[t+3+0]=St(l,c,s)}function Dt(e,t){var n=e[t+1-32],r=e[t+2-32],i=e[t+3-32],a=e[t+4-32],o=e[t+5-32],s=e[t+6-32],c=e[t+7-32];e[t+0+0]=St(e[t+0-32],n,r),e[t+1+0]=e[t+0+32]=St(n,r,i),e[t+2+0]=e[t+1+32]=e[t+0+64]=St(r,i,a),e[t+3+0]=e[t+2+32]=e[t+1+64]=e[t+0+96]=St(i,a,o),e[t+3+32]=e[t+2+64]=e[t+1+96]=St(a,o,s),e[t+3+64]=e[t+2+96]=St(o,s,c),e[t+3+96]=St(s,c,c)}function Ot(e,t){var n=e[t-1+0],r=e[t-1+32],i=e[t-1+64],a=e[t-1-32],o=e[t+0-32],s=e[t+1-32],c=e[t+2-32],l=e[t+3-32];e[t+0+0]=e[t+1+64]=a+o+1>>1,e[t+1+0]=e[t+2+64]=o+s+1>>1,e[t+2+0]=e[t+3+64]=s+c+1>>1,e[t+3+0]=c+l+1>>1,e[t+0+96]=St(i,r,n),e[t+0+64]=St(r,n,a),e[t+0+32]=e[t+1+96]=St(n,a,o),e[t+1+32]=e[t+2+96]=St(a,o,s),e[t+2+32]=e[t+3+96]=St(o,s,c),e[t+3+32]=St(s,c,l)}function kt(e,t){var n=e[t+0-32],r=e[t+1-32],i=e[t+2-32],a=e[t+3-32],o=e[t+4-32],s=e[t+5-32],c=e[t+6-32],l=e[t+7-32];e[t+0+0]=n+r+1>>1,e[t+1+0]=e[t+0+64]=r+i+1>>1,e[t+2+0]=e[t+1+64]=i+a+1>>1,e[t+3+0]=e[t+2+64]=a+o+1>>1,e[t+0+32]=St(n,r,i),e[t+1+32]=e[t+0+96]=St(r,i,a),e[t+2+32]=e[t+1+96]=St(i,a,o),e[t+3+32]=e[t+2+96]=St(a,o,s),e[t+3+64]=St(o,s,c),e[t+3+96]=St(s,c,l)}function At(e,t){var n=e[t-1+0],r=e[t-1+32],i=e[t-1+64],a=e[t-1+96];e[t+0+0]=n+r+1>>1,e[t+2+0]=e[t+0+32]=r+i+1>>1,e[t+2+32]=e[t+0+64]=i+a+1>>1,e[t+1+0]=St(n,r,i),e[t+3+0]=e[t+1+32]=St(r,i,a),e[t+3+32]=e[t+1+64]=St(i,a,a),e[t+3+64]=e[t+2+64]=e[t+0+96]=e[t+1+96]=e[t+2+96]=e[t+3+96]=a}function jt(e,t){var n=e[t-1+0],r=e[t-1+32],i=e[t-1+64],a=e[t-1+96],o=e[t-1-32],s=e[t+0-32],c=e[t+1-32],l=e[t+2-32];e[t+0+0]=e[t+2+32]=n+o+1>>1,e[t+0+32]=e[t+2+64]=r+n+1>>1,e[t+0+64]=e[t+2+96]=i+r+1>>1,e[t+0+96]=a+i+1>>1,e[t+3+0]=St(s,c,l),e[t+2+0]=St(o,s,c),e[t+1+0]=e[t+3+32]=St(n,o,s),e[t+1+32]=e[t+3+64]=St(r,n,o),e[t+1+64]=e[t+3+96]=St(i,r,n),e[t+1+96]=St(a,i,r)}function Mt(e,t){for(var n=0;8>n;++n)r(e,t+32*n,e,t-32,8)}function Nt(e,t){for(var n=0;8>n;++n)i(e,t,e[t-1],8),t+=32}function Pt(e,t,n){for(var r=0;8>r;++r)i(t,n+32*r,e,8)}function Ft(e,t){var n,r=8;for(n=0;8>n;++n)r+=e[t+n-32]+e[t-1+32*n];Pt(r>>4,e,t)}function It(e,t){var n,r=4;for(n=0;8>n;++n)r+=e[t+n-32];Pt(r>>3,e,t)}function Lt(e,t){var n,r=4;for(n=0;8>n;++n)r+=e[t-1+32*n];Pt(r>>3,e,t)}function Rt(e,t){Pt(128,e,t)}function Q(e,t,n){var r=e[t-n],i=e[t+0],a=3*(i-r)+Mr[1020+e[t-2*n]-e[t+n]],o=Nr[112+(a+4>>3)];e[t-n]=Pr[255+r+Nr[112+(a+3>>3)]],e[t+0]=Pr[255+i-o]}function zt(e,t,n,r){var i=e[t+0],a=e[t+n];return Fr[255+e[t-2*n]-e[t-n]]>r||Fr[255+a-i]>r}function Bt(e,t,n,r){return 4*Fr[255+e[t-n]-e[t+0]]+Fr[255+e[t-2*n]-e[t+n]]<=r}function Vt(e,t,n,r,i){var a=e[t-3*n],o=e[t-2*n],s=e[t-n],c=e[t+0],l=e[t+n],u=e[t+2*n],d=e[t+3*n];return 4*Fr[255+s-c]+Fr[255+o-l]>r?0:Fr[255+e[t-4*n]-a]<=i&&Fr[255+a-o]<=i&&Fr[255+o-s]<=i&&Fr[255+d-u]<=i&&Fr[255+u-l]<=i&&Fr[255+l-c]<=i}function Ht(e,t,n,r){var i=2*r+1;for(r=0;16>r;++r)Bt(e,t+r,n,i)&&Q(e,t+r,n)}function Ut(e,t,n,r){var i=2*r+1;for(r=0;16>r;++r)Bt(e,t+r*n,1,i)&&Q(e,t+r*n,1)}function Wt(e,t,n,r){for(var i=3;0>7,_=18*v+63>>7,v=9*v+63>>7;c[l-3*u]=Pr[255+c[l-3*u]+v],c[l-2*u]=Pr[255+d+_],c[l-u]=Pr[255+f+g],c[l+0]=Pr[255+p-g],c[l+u]=Pr[255+m-_],c[l+2*u]=Pr[255+h-v]}}t+=r}}function qt(e,t,n,r,i,a,o,s){for(a=2*a+1;0>3)],h=Nr[112+(h+3>>3)],g=m+1>>1;c[l-2*u]=Pr[255+c[l-2*u]+g],c[l-u]=Pr[255+d+h],c[l+0]=Pr[255+f-m],c[l+u]=Pr[255+p-g]}}t+=r}}function Jt(e,t,n,r,i,a){Kt(e,t,n,1,16,r,i,a)}function Yt(e,t,n,r,i,a){Kt(e,t,1,n,16,r,i,a)}function Xt(e,t,n,r,i,a){for(var o=3;0l?0:255:l)&255,l=c,i[a+s]=u}}function fn(e,n,i,o){var s=n.width,c=n.o;if(t(e!=null&&n!=null),0>i||0>=o||i+o>c)return null;if(!e.Cc){if(e.ga==null){var l;if(e.ga=new cn,(l=e.ga==null)||(l=n.width*n.o,t(e.Gb.length==0),e.Gb=a(l),e.Uc=0,e.Gb==null?l=0:(e.mb=e.Gb,e.nb=e.Uc,e.rc=null,l=1),l=!l),!l){l=e.ga;var u=e.Fa,d=e.P,f=e.qc,p=e.mb,m=e.nb,h=d+1,g=f-1,v=l.l;if(t(u!=null&&p!=null&&n!=null),gi[0]=null,gi[1]=ln,gi[2]=un,gi[3]=dn,l.ca=p,l.tb=m,l.c=n.width,l.i=n.height,t(0=f)n=0;else if(l.$a=3&u[d+0],l.Z=u[d+0]>>2&3,l.Lc=u[d+0]>>4&3,d=u[d+0]>>6&3,0>l.$a||1=l.c*l.i;l=!n}if(l)return null;e.ga.Lc==1?o=c-i:e.Ga=0}t(e.ga!=null),t(i+o<=c);t:{if(n=(u=e.ga).c,c=u.l.o,u.$a==0){if(h=e.rc,g=e.Vc,v=e.Fa,d=e.P+1+i*n,f=e.mb,p=e.nb+i*n,t(d<=e.P+e.qc),u.Z!=0)for(t(gi[u.Z]!=null),l=0;l=n)n=1;else if(u.ic||_n(),u.ic){u=l.V,h=l.Ba,g=l.c;var y=l.i,b=(v=1,d=l.$/g,f=l.$%g,p=l.m,m=l.s,l.$),x=g*y,S=g*n,w=m.wc,E=b(y=be(E.G[0],E.H[0],p)))u[h+b]=y,++b,++f>=g&&(f=0,++d<=n&&!(d%16)&&De(l,d));else{if(!(280>y)){v=0;break e}y=ve(y-256,p);var D,O=be(E.G[4],E.H[4],p);if(T(p),!(b>=(O=ye(g,O=ve(O,p)))&&x-b>=y)){v=0;break e}for(D=0;D=g;)f-=g,++d<=n&&!(d%16)&&De(l,d);bn?n:d);break e}!v||p.h&&b=c&&(e.Cc=1),o=1}if(!o)return null;if(e.Cc&&((o=e.ga)!=null&&(o.mc=null),e.ga=null,0>23,s[c+4*o+1]=s[c+4*o+1]*d>>23,s[c+4*o+2]=s[c+4*o+2]*d>>23)}t+=a}}function mn(e,t,n,r,i){for(;0>4)*c>>16;e[t+2*a+0]=(240&o|o>>4)*c>>16&240|(15&o|o<<4)*c>>16>>4&15,e[t+2*a+1]=240&l|s}t+=i}}function hn(e,t,n,r,i,a,o,s){var c,l,u=255;for(l=0;l>8}function _n(){Cr=pn,wr=mn,Tr=hn,Er=gn}function vn(n,r,i){e[n]=function(e,n,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y){var b,x=y-1>>1,S=s[c+0]|l[u+0]<<16,C=d[f+0]|p[m+0]<<16;t(e!=null);var w=3*S+C+131074>>2;for(r(e[n+0],255&w,w>>16,h,g),a!=null&&(w=3*C+S+131074>>2,r(a[o+0],255&w,w>>16,_,v)),b=1;b<=x;++b){var T=s[c+b]|l[u+b]<<16,E=d[f+b]|p[m+b]<<16,D=S+T+C+E+524296,O=D+2*(T+C)>>3;w=O+S>>1,S=(D=D+2*(S+E)>>3)+T>>1,r(e[n+2*b-1],255&w,w>>16,h,g+(2*b-1)*i),r(e[n+2*b-0],255&S,S>>16,h,g+(2*b-0)*i),a!=null&&(w=D+C>>1,S=O+E>>1,r(a[o+2*b-1],255&w,w>>16,_,v+(2*b-1)*i),r(a[o+2*b+0],255&S,S>>16,_,v+(2*b+0)*i)),S=T,C=E}1&y||(w=3*S+C+131074>>2,r(e[n+y-1],255&w,w>>16,h,g+(y-1)*i),a!=null&&(w=3*C+S+131074>>2,r(a[o+y-1],255&w,w>>16,_,v+(y-1)*i)))}}function yn(){_i[Ir]=vi,_i[Lr]=bi,_i[Rr]=yi,_i[zr]=xi,_i[Br]=Si,_i[Vr]=Ci,_i[Hr]=wi,_i[Ur]=bi,_i[Wr]=xi,_i[Gr]=Si,_i[Kr]=Ci}function bn(e){return e&~Ai?0>e?0:255:e>>ki}function xn(e,t){return bn((19077*e>>8)+(26149*t>>8)-14234)}function Sn(e,t,n){return bn((19077*e>>8)-(6419*t>>8)-(13320*n>>8)+8708)}function Cn(e,t){return bn((19077*e>>8)+(33050*t>>8)-17685)}function wn(e,t,n,r,i){r[i+0]=xn(e,n),r[i+1]=Sn(e,t,n),r[i+2]=Cn(e,t)}function Tn(e,t,n,r,i){r[i+0]=Cn(e,t),r[i+1]=Sn(e,t,n),r[i+2]=xn(e,n)}function En(e,t,n,r,i){var a=Sn(e,t,n);t=a<<3&224|Cn(e,t)>>3,r[i+0]=248&xn(e,n)|a>>5,r[i+1]=t}function Dn(e,t,n,r,i){var a=240&Cn(e,t)|15;r[i+0]=240&xn(e,n)|Sn(e,t,n)>>4,r[i+1]=a}function On(e,t,n,r,i){r[i+0]=255,wn(e,t,n,r,i+1)}function kn(e,t,n,r,i){Tn(e,t,n,r,i),r[i+3]=255}function An(e,t,n,r,i){wn(e,t,n,r,i),r[i+3]=255}function jn(t,n,r){e[t]=function(e,t,i,a,o,s,c,l,u){for(var d=l+(-2&u)*r;l!=d;)n(e[t+0],i[a+0],o[s+0],c,l),n(e[t+1],i[a+0],o[s+0],c,l+r),t+=2,++a,++s,l+=2*r;1&u&&n(e[t+0],i[a+0],o[s+0],c,l)}}function Mn(e,t,n){return n==0?e==0?t==0?6:5:t==0?4:0:n}function Nn(e,t,n,r,i){switch(e>>>30){case 3:or(t,n,r,i,0);break;case 2:sr(t,n,r,i);break;case 1:lr(t,n,r,i)}}function Pn(e,t){var n,a,o=t.M,s=t.Nb,c=e.oc,l=e.pc+40,u=e.oc,d=e.pc+584,f=e.oc,p=e.pc+600;for(n=0;16>n;++n)c[l+32*n-1]=129;for(n=0;8>n;++n)u[d+32*n-1]=129,f[p+32*n-1]=129;for(0n;++n)r(c,l+32*n-4,c,l+32*n+12,4);for(n=-1;8>n;++n)r(u,d+32*n-4,u,d+32*n+4,4),r(f,p+32*n-4,f,p+32*n+4,4)}var h=e.Gd,g=e.Hd+a,_=m.ad,v=m.Hc;if(0=e.za-1?i(y,b,h[g].y[15],4):r(y,b,h[g+1].y,0,4)),n=0;4>n;n++)y[b+128+n]=y[b+256+n]=y[b+384+n]=y[b+0+n];for(n=0;16>n;++n,v<<=2)y=c,b=l+Ri[n],fi[m.Ob[n]](y,b),Nn(v,_,16*n,y,b)}else if(y=Mn(a,o,m.Ob[0]),di[y](c,l),v!=0)for(n=0;16>n;++n,v<<=2)Nn(v,_,16*n,c,l+Ri[n]);for(n=m.Gc,y=Mn(a,o,m.Dd),pi[y](u,d),pi[y](f,p),v=_,y=u,b=d,255&(m=0|n)&&(170&m?cr(v,256,y,b):ur(v,256,y,b)),m=f,v=p,255&(n>>=8)&&(170&n?cr(_,320,m,v):ur(_,320,m,v)),on;++n)r(h,g+n*e.R,c,l+32*n,16);for(n=0;8>n;++n)r(_,m+n*e.B,u,d+32*n,8),r(v,y+n*e.B,f,p+32*n,8)}}function Fn(e,r,i,a,o,s,c,l,u){var d=[0],f=[0],p=0,m=u==null?0:u.kd,h=u??new rn;if(e==null||12>i)return 7;h.data=e,h.w=r,h.ha=i,r=[r],i=[i],h.gb=[h.gb];t:{var g=r,v=i,y=h.gb;if(t(e!=null),t(v!=null),t(y!=null),y[0]=0,12<=v[0]&&!n(e,g[0],`RIFF`)){if(n(e,g[0]+8,`WEBP`)){y=3;break t}var b=M(e,g[0]+4);if(12>b||4294967286v[0]-8){y=7;break t}y[0]=b,g[0]+=12,v[0]-=12}y=0}if(y!=0)return y;for(b=0y[0])y=7;else{if(!n(S,v[0],`VP8X`)){if(M(S,v[0]+4)!=10){y=3;break t}if(18>y[0]){y=7;break t}var E=M(S,v[0]+8),D=1+j(S,v[0]+12);if(2147483648<=D*(S=1+j(S,v[0]+15))){y=3;break t}T!=null&&(T[0]=E),C!=null&&(C[0]=D),w!=null&&(w[0]=S),v[0]+=18,y[0]-=18,O[0]=1}y=0}}if(p=p[0],g=g[0],y!=0)return y;if(v=!!(2&g),!b&&p)return 3;if(s!=null&&(s[0]=!!(16&g)),c!=null&&(c[0]=v),l!=null&&(l[0]=0),c=d[0],g=f[0],p&&v&&u==null){y=0;break}if(4>i){y=7;break}if(b&&p||!b&&!p&&!n(e,r[0],`ALPH`)){i=[i],h.na=[h.na],h.P=[h.P],h.Sa=[h.Sa];t:{E=e,y=r,b=i;var O=h.gb;C=h.na,w=h.P,T=h.Sa,D=22,t(E!=null),t(b!=null),S=y[0];var k=b[0];for(t(C!=null),t(T!=null),C[0]=null,w[0]=null,T[0]=0;;){if(y[0]=S,b[0]=k,8>k){y=7;break t}var A=M(E,S+4);if(4294967286O){y=3;break t}if(!n(E,S,`VP8 `)||!n(E,S,`VP8L`)){y=0;break t}if(k[0]b[0])y=7;else{if(S||D){if(O=M(O,E+4),12<=C&&O>C-12){y=3;break t}if(m&&O>b[0]-8){y=7;break t}w[0]=O,y[0]+=8,b[0]-=8,T[0]=D}else T[0]=5<=b[0]&&O[E+0]==47&&!(O[E+4]>>5),w[0]=b[0];y=0}if(i=i[0],h.Ja=h.Ja[0],h.xa=h.xa[0],r=r[0],y!=0)break;if(4294967286i){y=7;break}l=c,m=g,v=s,e==null||5>i?e=0:5<=i&&e[r+0]==47&&!(e[r+4]>>5)?(b=[0],O=[0],C=[0],_(w=new x,e,r,i),_e(w,b,O,C)?(l!=null&&(l[0]=b[0]),m!=null&&(m[0]=O[0]),v!=null&&(v[0]=C[0]),e=1):e=0):e=0}else{if(10>i){y=7;break}l=g,e==null||10>i||!Ze(e,r+3,i-3)?e=0:(m=e[r+0]|e[r+1]<<8|e[r+2]<<16,v=16383&(e[r+7]<<8|e[r+6]),e=16383&(e[r+9]<<8|e[r+8]),1&m||3<(m>>1&7)||!(m>>4&1)||m>>5>=h.Ja||!v||!e?e=0:(c&&(c[0]=v),l&&(l[0]=e),e=1))}if(!e||(c=c[0],g=g[0],p&&(d[0]!=c||f[0]!=g)))return 3;u!=null&&(u[0]=h,u.offset=r-u.w,t(4294967286>r-u.w),t(u.offset==u.ha-i));break}return y==0||y==7&&p&&u==null?(s!=null&&(s[0]|=h.na!=null&&0n||(a&=-2,o&=-2),0>a||0>o||0>=s||0>=c||a+s>r||o+c>i))return 0;if(t.v=a,t.j=o,t.va=a+s,t.o=o+c,t.U=s,t.T=c,t.da=e!=null&&0e.S){var t=e.f.RGBA;t.fb+=(e.height-1)*t.A,t.A=-t.A}else t=e.f.kb,e=e.height,t.O+=(e-1)*t.fa,t.fa=-t.fa,t.N+=(e-1>>1)*t.Ab,t.Ab=-t.Ab,t.W+=(e-1>>1)*t.Db,t.Db=-t.Db,t.F!=null&&(t.J+=(e-1)*t.lb,t.lb=-t.lb);return 0}function Rn(e,t,n,r){if(r==null||0>=e||0>=t)return 2;if(n!=null){if(n.Da){var i=n.cd,o=n.bd,s=-2&n.v,c=-2&n.j;if(0>s||0>c||0>=i||0>=o||s+i>e||c+o>t)return 2;e=i,t=o}if(n.da){if(!I(e,t,i=[n.ib],o=[n.hb]))return 2;e=i[0],t=o[0]}}r.width=e,r.height=t;t:{var l=r.width,u=r.height;if(e=r.S,0>=l||0>=u||!(e>=Ir&&13>e))e=2;else{if(0>=r.Rd&&r.sd==null){s=o=i=t=0;var d=(c=l*Hi[e])*u;if(11>e||(o=(u+1)/2*(t=(l+1)/2),e==12&&(s=(i=l)*u)),(u=a(d+2*o+s))==null){e=1;break t}r.sd=u,11>e?((l=r.f.RGBA).eb=u,l.fb=0,l.A=c,l.size=d):((l=r.f.kb).y=u,l.O=0,l.fa=c,l.Fd=d,l.f=u,l.N=0+d,l.Ab=t,l.Cd=o,l.ea=u,l.W=0+d+o,l.Db=t,l.Ed=o,e==12&&(l.F=u,l.J=0+d+2*o),l.Tc=s,l.lb=i)}if(t=1,i=r.S,o=r.width,s=r.height,i>=Ir&&13>i){if(11>i)e=r.f.RGBA,t&=(c=Math.abs(e.A))*(s-1)+o<=e.size,t&=c>=o*Hi[i],t&=e.eb!=null;else{e=r.f.kb,c=(o+1)/2,d=(s+1)/2,l=Math.abs(e.fa),u=Math.abs(e.Ab);var f=Math.abs(e.Db),p=Math.abs(e.lb),m=p*(s-1)+o;t&=l*(s-1)+o<=e.Fd,t&=u*(d-1)+c<=e.Cd,t=(t&=f*(d-1)+c<=e.Ed)&l>=o&u>=c&f>=c,t&=e.y!=null,t&=e.f!=null,t&=e.ea!=null,i==12&&(t&=p>=o,t&=m<=e.Tc,t&=e.F!=null)}}else t=0;e=t?0:2}}return e!=0||n!=null&&n.fd&&(e=Ln(r)),e}var zn=64,Bn=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535,131071,262143,524287,1048575,2097151,4194303,8388607,16777215],Vn=24,Hn=32,Un=8,Wn=[0,0,1,1,2,2,2,2,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7];z(`Predictor0`,`PredictorAdd0`),e.Predictor0=function(){return 4278190080},e.Predictor1=function(e){return e},e.Predictor2=function(e,t,n){return t[n+0]},e.Predictor3=function(e,t,n){return t[n+1]},e.Predictor4=function(e,t,n){return t[n-1]},e.Predictor5=function(e,t,n){return V(V(e,t[n+1]),t[n+0])},e.Predictor6=function(e,t,n){return V(e,t[n-1])},e.Predictor7=function(e,t,n){return V(e,t[n+0])},e.Predictor8=function(e,t,n){return V(t[n-1],t[n+0])},e.Predictor9=function(e,t,n){return V(t[n+0],t[n+1])},e.Predictor10=function(e,t,n){return V(V(e,t[n-1]),V(t[n+0],t[n+1]))},e.Predictor11=function(e,t,n){var r=t[n+0];return 0>=U(r>>24&255,e>>24&255,(t=t[n-1])>>24&255)+U(r>>16&255,e>>16&255,t>>16&255)+U(r>>8&255,e>>8&255,t>>8&255)+U(255&r,255&e,255&t)?r:e},e.Predictor12=function(e,t,n){var r=t[n+0];return(H((e>>24&255)+(r>>24&255)-((t=t[n-1])>>24&255))<<24|H((e>>16&255)+(r>>16&255)-(t>>16&255))<<16|H((e>>8&255)+(r>>8&255)-(t>>8&255))<<8|H((255&e)+(255&r)-(255&t)))>>>0},e.Predictor13=function(e,t,n){var r=t[n-1];return(ee((e=V(e,t[n+0]))>>24&255,r>>24&255)<<24|ee(e>>16&255,r>>16&255)<<16|ee(e>>8&255,r>>8&255)<<8|ee(255&e,255&r))>>>0};var Gn=e.PredictorAdd0;e.PredictorAdd1=W,z(`Predictor2`,`PredictorAdd2`),z(`Predictor3`,`PredictorAdd3`),z(`Predictor4`,`PredictorAdd4`),z(`Predictor5`,`PredictorAdd5`),z(`Predictor6`,`PredictorAdd6`),z(`Predictor7`,`PredictorAdd7`),z(`Predictor8`,`PredictorAdd8`),z(`Predictor9`,`PredictorAdd9`),z(`Predictor10`,`PredictorAdd10`),z(`Predictor11`,`PredictorAdd11`),z(`Predictor12`,`PredictorAdd12`),z(`Predictor13`,`PredictorAdd13`);var Kn=e.PredictorAdd2;re(`ColorIndexInverseTransform`,`MapARGB`,`32b`,function(e){return e>>8&255},function(e){return e}),re(`VP8LColorIndexInverseTransformAlpha`,`MapAlpha`,`8b`,function(e){return e},function(e){return e>>8&255});var qn,Jn=e.ColorIndexInverseTransform,Yn=e.MapARGB,Xn=e.VP8LColorIndexInverseTransformAlpha,Zn=e.MapAlpha,Qn=e.VP8LPredictorsAdd=[];Qn.length=16,(e.VP8LPredictors=[]).length=16,(e.VP8LPredictorsAdd_C=[]).length=16,(e.VP8LPredictors_C=[]).length=16;var $n,er,tr,nr,rr,ir,ar,or,sr,cr,lr,ur,dr,fr,pr,mr,hr,gr,_r,vr,yr,br,xr,Sr,Cr,wr,Tr,Er,Dr=a(511),Or=a(2041),kr=a(225),Ar=a(767),jr=0,Mr=Or,Nr=kr,Pr=Ar,Fr=Dr,Ir=0,Lr=1,Rr=2,zr=3,Br=4,Vr=5,Hr=6,Ur=7,Wr=8,Gr=9,Kr=10,qr=[2,3,7],Jr=[3,3,11],Yr=[280,256,256,256,40],Xr=[0,1,1,1,0],Zr=[17,18,0,1,2,3,4,5,16,6,7,8,9,10,11,12,13,14,15],Qr=[24,7,23,25,40,6,39,41,22,26,38,42,56,5,55,57,21,27,54,58,37,43,72,4,71,73,20,28,53,59,70,74,36,44,88,69,75,52,60,3,87,89,19,29,86,90,35,45,68,76,85,91,51,61,104,2,103,105,18,30,102,106,34,46,84,92,67,77,101,107,50,62,120,1,119,121,83,93,17,31,100,108,66,78,118,122,33,47,117,123,49,63,99,109,82,94,0,116,124,65,79,16,32,98,110,48,115,125,81,95,64,114,126,97,111,80,113,127,96,112],$r=[2954,2956,2958,2962,2970,2986,3018,3082,3212,3468,3980,5004],ei=8,ti=[4,5,6,7,8,9,10,10,11,12,13,14,15,16,17,17,18,19,20,20,21,21,22,22,23,23,24,25,25,26,27,28,29,30,31,32,33,34,35,36,37,37,38,39,40,41,42,43,44,45,46,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,76,77,78,79,80,81,82,83,84,85,86,87,88,89,91,93,95,96,98,100,101,102,104,106,108,110,112,114,116,118,122,124,126,128,130,132,134,136,138,140,143,145,148,151,154,157],ni=[4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,60,62,64,66,68,70,72,74,76,78,80,82,84,86,88,90,92,94,96,98,100,102,104,106,108,110,112,114,116,119,122,125,128,131,134,137,140,143,146,149,152,155,158,161,164,167,170,173,177,181,185,189,193,197,201,205,209,213,217,221,225,229,234,239,245,249,254,259,264,269,274,279,284],ri=null,ii=[[173,148,140,0],[176,155,140,135,0],[180,157,141,134,130,0],[254,254,243,230,196,177,153,140,133,130,129,0]],ai=[0,1,4,8,5,2,3,6,9,12,13,10,7,11,14,15],oi=[-0,1,-1,2,-2,3,4,6,-3,5,-4,-5,-6,7,-7,8,-8,-9],si=[[[[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128]],[[253,136,254,255,228,219,128,128,128,128,128],[189,129,242,255,227,213,255,219,128,128,128],[106,126,227,252,214,209,255,255,128,128,128]],[[1,98,248,255,236,226,255,255,128,128,128],[181,133,238,254,221,234,255,154,128,128,128],[78,134,202,247,198,180,255,219,128,128,128]],[[1,185,249,255,243,255,128,128,128,128,128],[184,150,247,255,236,224,128,128,128,128,128],[77,110,216,255,236,230,128,128,128,128,128]],[[1,101,251,255,241,255,128,128,128,128,128],[170,139,241,252,236,209,255,255,128,128,128],[37,116,196,243,228,255,255,255,128,128,128]],[[1,204,254,255,245,255,128,128,128,128,128],[207,160,250,255,238,128,128,128,128,128,128],[102,103,231,255,211,171,128,128,128,128,128]],[[1,152,252,255,240,255,128,128,128,128,128],[177,135,243,255,234,225,128,128,128,128,128],[80,129,211,255,194,224,128,128,128,128,128]],[[1,1,255,128,128,128,128,128,128,128,128],[246,1,255,128,128,128,128,128,128,128,128],[255,128,128,128,128,128,128,128,128,128,128]]],[[[198,35,237,223,193,187,162,160,145,155,62],[131,45,198,221,172,176,220,157,252,221,1],[68,47,146,208,149,167,221,162,255,223,128]],[[1,149,241,255,221,224,255,255,128,128,128],[184,141,234,253,222,220,255,199,128,128,128],[81,99,181,242,176,190,249,202,255,255,128]],[[1,129,232,253,214,197,242,196,255,255,128],[99,121,210,250,201,198,255,202,128,128,128],[23,91,163,242,170,187,247,210,255,255,128]],[[1,200,246,255,234,255,128,128,128,128,128],[109,178,241,255,231,245,255,255,128,128,128],[44,130,201,253,205,192,255,255,128,128,128]],[[1,132,239,251,219,209,255,165,128,128,128],[94,136,225,251,218,190,255,255,128,128,128],[22,100,174,245,186,161,255,199,128,128,128]],[[1,182,249,255,232,235,128,128,128,128,128],[124,143,241,255,227,234,128,128,128,128,128],[35,77,181,251,193,211,255,205,128,128,128]],[[1,157,247,255,236,231,255,255,128,128,128],[121,141,235,255,225,227,255,255,128,128,128],[45,99,188,251,195,217,255,224,128,128,128]],[[1,1,251,255,213,255,128,128,128,128,128],[203,1,248,255,255,128,128,128,128,128,128],[137,1,177,255,224,255,128,128,128,128,128]]],[[[253,9,248,251,207,208,255,192,128,128,128],[175,13,224,243,193,185,249,198,255,255,128],[73,17,171,221,161,179,236,167,255,234,128]],[[1,95,247,253,212,183,255,255,128,128,128],[239,90,244,250,211,209,255,255,128,128,128],[155,77,195,248,188,195,255,255,128,128,128]],[[1,24,239,251,218,219,255,205,128,128,128],[201,51,219,255,196,186,128,128,128,128,128],[69,46,190,239,201,218,255,228,128,128,128]],[[1,191,251,255,255,128,128,128,128,128,128],[223,165,249,255,213,255,128,128,128,128,128],[141,124,248,255,255,128,128,128,128,128,128]],[[1,16,248,255,255,128,128,128,128,128,128],[190,36,230,255,236,255,128,128,128,128,128],[149,1,255,128,128,128,128,128,128,128,128]],[[1,226,255,128,128,128,128,128,128,128,128],[247,192,255,128,128,128,128,128,128,128,128],[240,128,255,128,128,128,128,128,128,128,128]],[[1,134,252,255,255,128,128,128,128,128,128],[213,62,250,255,255,128,128,128,128,128,128],[55,93,255,128,128,128,128,128,128,128,128]],[[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128]]],[[[202,24,213,235,186,191,220,160,240,175,255],[126,38,182,232,169,184,228,174,255,187,128],[61,46,138,219,151,178,240,170,255,216,128]],[[1,112,230,250,199,191,247,159,255,255,128],[166,109,228,252,211,215,255,174,128,128,128],[39,77,162,232,172,180,245,178,255,255,128]],[[1,52,220,246,198,199,249,220,255,255,128],[124,74,191,243,183,193,250,221,255,255,128],[24,71,130,219,154,170,243,182,255,255,128]],[[1,182,225,249,219,240,255,224,128,128,128],[149,150,226,252,216,205,255,171,128,128,128],[28,108,170,242,183,194,254,223,255,255,128]],[[1,81,230,252,204,203,255,192,128,128,128],[123,102,209,247,188,196,255,233,128,128,128],[20,95,153,243,164,173,255,203,128,128,128]],[[1,222,248,255,216,213,128,128,128,128,128],[168,175,246,252,235,205,255,255,128,128,128],[47,116,215,255,211,212,255,255,128,128,128]],[[1,121,236,253,212,214,255,255,128,128,128],[141,84,213,252,201,202,255,219,128,128,128],[42,80,160,240,162,185,255,205,128,128,128]],[[1,1,255,128,128,128,128,128,128,128,128],[244,1,255,128,128,128,128,128,128,128,128],[238,1,255,128,128,128,128,128,128,128,128]]]],ci=[[[231,120,48,89,115,113,120,152,112],[152,179,64,126,170,118,46,70,95],[175,69,143,80,85,82,72,155,103],[56,58,10,171,218,189,17,13,152],[114,26,17,163,44,195,21,10,173],[121,24,80,195,26,62,44,64,85],[144,71,10,38,171,213,144,34,26],[170,46,55,19,136,160,33,206,71],[63,20,8,114,114,208,12,9,226],[81,40,11,96,182,84,29,16,36]],[[134,183,89,137,98,101,106,165,148],[72,187,100,130,157,111,32,75,80],[66,102,167,99,74,62,40,234,128],[41,53,9,178,241,141,26,8,107],[74,43,26,146,73,166,49,23,157],[65,38,105,160,51,52,31,115,128],[104,79,12,27,217,255,87,17,7],[87,68,71,44,114,51,15,186,23],[47,41,14,110,182,183,21,17,194],[66,45,25,102,197,189,23,18,22]],[[88,88,147,150,42,46,45,196,205],[43,97,183,117,85,38,35,179,61],[39,53,200,87,26,21,43,232,171],[56,34,51,104,114,102,29,93,77],[39,28,85,171,58,165,90,98,64],[34,22,116,206,23,34,43,166,73],[107,54,32,26,51,1,81,43,31],[68,25,106,22,64,171,36,225,114],[34,19,21,102,132,188,16,76,124],[62,18,78,95,85,57,50,48,51]],[[193,101,35,159,215,111,89,46,111],[60,148,31,172,219,228,21,18,111],[112,113,77,85,179,255,38,120,114],[40,42,1,196,245,209,10,25,109],[88,43,29,140,166,213,37,43,154],[61,63,30,155,67,45,68,1,209],[100,80,8,43,154,1,51,26,71],[142,78,78,16,255,128,34,197,171],[41,40,5,102,211,183,4,1,221],[51,50,17,168,209,192,23,25,82]],[[138,31,36,171,27,166,38,44,229],[67,87,58,169,82,115,26,59,179],[63,59,90,180,59,166,93,73,154],[40,40,21,116,143,209,34,39,175],[47,15,16,183,34,223,49,45,183],[46,17,33,183,6,98,15,32,183],[57,46,22,24,128,1,54,17,37],[65,32,73,115,28,128,23,128,205],[40,3,9,115,51,192,18,6,223],[87,37,9,115,59,77,64,21,47]],[[104,55,44,218,9,54,53,130,226],[64,90,70,205,40,41,23,26,57],[54,57,112,184,5,41,38,166,213],[30,34,26,133,152,116,10,32,134],[39,19,53,221,26,114,32,73,255],[31,9,65,234,2,15,1,118,73],[75,32,12,51,192,255,160,43,51],[88,31,35,67,102,85,55,186,85],[56,21,23,111,59,205,45,37,192],[55,38,70,124,73,102,1,34,98]],[[125,98,42,88,104,85,117,175,82],[95,84,53,89,128,100,113,101,45],[75,79,123,47,51,128,81,171,1],[57,17,5,71,102,57,53,41,49],[38,33,13,121,57,73,26,1,85],[41,10,67,138,77,110,90,47,114],[115,21,2,10,102,255,166,23,6],[101,29,16,10,85,128,101,196,26],[57,18,10,102,102,213,34,20,43],[117,20,15,36,163,128,68,1,26]],[[102,61,71,37,34,53,31,243,192],[69,60,71,38,73,119,28,222,37],[68,45,128,34,1,47,11,245,171],[62,17,19,70,146,85,55,62,70],[37,43,37,154,100,163,85,160,1],[63,9,92,136,28,64,32,201,85],[75,15,9,9,64,255,184,119,16],[86,6,28,5,64,255,25,248,1],[56,8,17,132,137,255,55,116,128],[58,15,20,82,135,57,26,121,40]],[[164,50,31,137,154,133,25,35,218],[51,103,44,131,131,123,31,6,158],[86,40,64,135,148,224,45,183,128],[22,26,17,131,240,154,14,1,209],[45,16,21,91,64,222,7,1,197],[56,21,39,155,60,138,23,102,213],[83,12,13,54,192,255,68,47,28],[85,26,85,85,128,128,32,146,171],[18,11,7,63,144,171,4,4,246],[35,27,10,146,174,171,12,26,128]],[[190,80,35,99,180,80,126,54,45],[85,126,47,87,176,51,41,20,32],[101,75,128,139,118,146,116,128,85],[56,41,15,176,236,85,37,9,62],[71,30,17,119,118,255,17,18,138],[101,38,60,138,55,70,43,26,142],[146,36,19,30,171,255,97,27,20],[138,45,61,62,219,1,81,188,64],[32,41,20,117,151,142,20,21,163],[112,19,12,61,195,128,48,4,24]]],li=[[[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[176,246,255,255,255,255,255,255,255,255,255],[223,241,252,255,255,255,255,255,255,255,255],[249,253,253,255,255,255,255,255,255,255,255]],[[255,244,252,255,255,255,255,255,255,255,255],[234,254,254,255,255,255,255,255,255,255,255],[253,255,255,255,255,255,255,255,255,255,255]],[[255,246,254,255,255,255,255,255,255,255,255],[239,253,254,255,255,255,255,255,255,255,255],[254,255,254,255,255,255,255,255,255,255,255]],[[255,248,254,255,255,255,255,255,255,255,255],[251,255,254,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[251,254,254,255,255,255,255,255,255,255,255],[254,255,254,255,255,255,255,255,255,255,255]],[[255,254,253,255,254,255,255,255,255,255,255],[250,255,254,255,254,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[217,255,255,255,255,255,255,255,255,255,255],[225,252,241,253,255,255,254,255,255,255,255],[234,250,241,250,253,255,253,254,255,255,255]],[[255,254,255,255,255,255,255,255,255,255,255],[223,254,254,255,255,255,255,255,255,255,255],[238,253,254,254,255,255,255,255,255,255,255]],[[255,248,254,255,255,255,255,255,255,255,255],[249,254,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,255,255,255,255,255,255,255,255,255],[247,254,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[252,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,254,255,255,255,255,255,255,255,255],[253,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,253,255,255,255,255,255,255,255,255],[250,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[186,251,250,255,255,255,255,255,255,255,255],[234,251,244,254,255,255,255,255,255,255,255],[251,251,243,253,254,255,254,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[236,253,254,255,255,255,255,255,255,255,255],[251,253,253,254,254,255,255,255,255,255,255]],[[255,254,254,255,255,255,255,255,255,255,255],[254,254,254,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,255,255,255,255,255,255,255,255,255],[254,254,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[248,255,255,255,255,255,255,255,255,255,255],[250,254,252,254,255,255,255,255,255,255,255],[248,254,249,253,255,255,255,255,255,255,255]],[[255,253,253,255,255,255,255,255,255,255,255],[246,253,253,255,255,255,255,255,255,255,255],[252,254,251,254,254,255,255,255,255,255,255]],[[255,254,252,255,255,255,255,255,255,255,255],[248,254,253,255,255,255,255,255,255,255,255],[253,255,254,254,255,255,255,255,255,255,255]],[[255,251,254,255,255,255,255,255,255,255,255],[245,251,254,255,255,255,255,255,255,255,255],[253,253,254,255,255,255,255,255,255,255,255]],[[255,251,253,255,255,255,255,255,255,255,255],[252,253,254,255,255,255,255,255,255,255,255],[255,254,255,255,255,255,255,255,255,255,255]],[[255,252,255,255,255,255,255,255,255,255,255],[249,255,254,255,255,255,255,255,255,255,255],[255,255,254,255,255,255,255,255,255,255,255]],[[255,255,253,255,255,255,255,255,255,255,255],[250,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]]],ui=[0,1,2,3,6,4,5,6,6,6,6,6,6,6,6,7,0],di=[],fi=[],pi=[],mi=1,hi=2,gi=[],_i=[];vn(`UpsampleRgbLinePair`,wn,3),vn(`UpsampleBgrLinePair`,Tn,3),vn(`UpsampleRgbaLinePair`,An,4),vn(`UpsampleBgraLinePair`,kn,4),vn(`UpsampleArgbLinePair`,On,4),vn(`UpsampleRgba4444LinePair`,Dn,2),vn(`UpsampleRgb565LinePair`,En,2);var vi=e.UpsampleRgbLinePair,yi=e.UpsampleBgrLinePair,bi=e.UpsampleRgbaLinePair,xi=e.UpsampleBgraLinePair,Si=e.UpsampleArgbLinePair,Ci=e.UpsampleRgba4444LinePair,wi=e.UpsampleRgb565LinePair,Ti=16,Ei=1<c.ca.S||(alert(`todo:WebPInitConvertARGBToYUV`),c.ca.f.kb.F!=null&&_n()),c.Pb&&0(p=s.Md)?0:100m;++m)12>(g=l.pb[m]).lc&&(g.ia=p*Bi[0>g.lc?0:g.lc]>>3),h|=g.ia;h&&(alert(`todo:VP8InitRandom`),l.ia=1)}l.Ga=s.Id,100l.Ga&&(l.Ga=0)}(function(e,n){if(e==null)return 0;if(n==null)return Xe(e,2,`NULL VP8Io parameter in VP8Decode().`);if(!e.cb&&!Qe(e,n))return 0;if(t(e.cb),n.ac==null||n.ac(n)){n.ob&&(e.L=0);var s=zi[e.L];if(e.L==2?(e.yb=0,e.zb=0):(e.yb=n.v-s>>4,e.zb=n.j-s>>4,0>e.yb&&(e.yb=0),0>e.zb&&(e.zb=0)),e.Va=n.o+15+s>>4,e.Hb=n.va+15+s>>4,e.Hb>e.za&&(e.Hb=e.za),e.Va>e.Ub&&(e.Va=e.Ub),0s;++s){var l;if(e.Qa.Cb){var u=e.Qa.Lb[s];e.Qa.Fb||(u+=c.Tb)}else u=c.Tb;for(l=0;1>=l;++l){var d=e.gd[s][l],f=u;if(c.Pc&&(f+=c.vd[0],l&&(f+=c.od[0])),0<(f=0>f?0:63>2:p>>1)>9-c.wb&&(p=9-c.wb),1>p&&(p=1),d.dd=p,d.tc=2*f+p,d.ld=40<=f?2:+(15<=f)}else d.tc=0;d.La=l}}}s=0}else Xe(e,6,`Frame setup failed`),s=e.a;if(s=s==0){if(s){e.$c=0,0e.Vb){if(e.Vb=0,e.Ec=a(d),e.Fc=0,e.Ec==null){s=Xe(e,1,`no memory during frame initialization.`);break e}e.Vb=d}d=e.Ec,f=e.Fc,e.Ac=d,e.Bc=f,f+=c,e.Gd=o(m,Ge),e.Hd=0,e.rb=o(h+1,Ve),e.sb=1,e.wa=g?o(g,Be):null,e.Y=0,e.D.Nb=0,e.D.wa=e.wa,e.D.Y=e.Y,0=s;++s)Dr[255+s]=0>s?-s:s;for(s=-1020;1020>=s;++s)Or[1020+s]=-128>s?-128:127=s;++s)kr[112+s]=-16>s?-16:15=s;++s)Ar[255+s]=0>s?0:255d;++d){var v,y=m[0+d];for(v=0;4>v;++v){y=ci[f[p+v]][y];for(var b=oi[O(u,y[0])];0>3;for(b=0;256>b;b+=16)d[g+b]=E}C=1,w=p[0]}var D=15&u.la,k=15&_.la;for(b=0;4>b;++b){var A=1&k;for(E=S=0;4>E;++E)D=D>>1|(A=(T=ri(f,w,T=A+(1&D),h.Sc,C,d,g))>C)<<7,S=S<<2|(3>=4,k=k>>1|A<<7,v=(v<<8|S)>>>0}for(w=D,C=k>>4,x=0;4>x;x+=2){for(S=0,D=u.la>>4+x,k=_.la>>4+x,b=0;2>b;++b){for(A=1&k,E=0;2>E;++E)T=A+(1&D),D=D>>1|(A=0<(T=ri(f,p[2],T,h.Qc,0,d,g)))<<3,S=S<<2|(3>=2,k=k>>1|A<<5}y|=S<<4*x,w|=D<<4<=s.zb&&s.M<=s.Va,s.Aa==0)e:{if(o.M=s.M,o.uc=u,Pn(s,o),l=1,o=(S=s.D).Nb,u=(y=zi[s.L])*s.R,f=y/2*s.B,b=16*o*s.R,E=8*o*s.B,p=s.sa,m=s.ta-u+b,h=s.qa,d=s.ra-f+E,g=s.Ha,_=s.Ia-f+E,k=(D=S.M)==0,v=D>=s.Va-1,s.Aa==2&&Pn(s,S),S.uc)for(A=(T=s).D.M,t(T.D.uc),S=T.yb;Sc.o&&(D=c.o),c.F=null,c.J=null,s.Fa!=null&&0>1),c.W+=s.B*(y>>1),c.F!=null&&(c.J+=c.width*y)),S>1,c.W+=c.v>>1,c.F!=null&&(c.J+=c.v),c.ka=S-c.j,c.U=c.va-c.v,c.T=D-S,l=c.put(c))}o+1!=s.Ic||v||(r(s.sa,s.ta-u,p,m+16*s.R,u),r(s.qa,s.ra-f,h,d+8*s.B,f),r(s.Ha,s.Ia-f,g,_+8*s.B,f))}if(!l)return Xe(e,6,`Output aborted.`)}return 1}(e,n)),n.bc!=null&&n.bc(n),s&=1}return s?(e.cb=0,s):0})(e,c)||(n=e.a)}}else n=e.a}n==0&&d.Oa!=null&&d.Oa.fd&&(n=Ln(d.ba))}d=n}u=d==0?11>u?f.f.RGBA.eb:f.f.kb.y:null}else u=null;return u};var Hi=[3,4,3,4,4,2,2,4,4,4,2,1,1]};function l(e,t){for(var n=``,r=0;r<4;r++)n+=String.fromCharCode(e[t++]);return n}function u(e,t){return e[t+0]|e[t+1]<<8}function d(e,t){return(e[t+0]|e[t+1]<<8|e[t+2]<<16)>>>0}function f(e,t){return(e[t+0]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}new c;var p=[0],m=[0],h=[],g=new c,_=e,v=function(e,t){var n={},r=0,i=!1,a=0,o=0;if(n.frames=[],!function(e,t){for(var n=0;n<4;n++)if(e[t+n]!=`RIFF`.charCodeAt(n))return!0;return!1}(e,t)){for(f(e,t+=4),t+=8;t>1&1}s!=`ANMF`&&(t+=p)}return n}}(_,0);v.response=_,v.rgbaoutput=!0,v.dataurl=!1;var y=v.header?v.header:null,b=v.frames?v.frames:null;if(y){y.loop_counter=y.loop_count,p=[y.canvas_height],m=[y.canvas_width];for(var x=0;x`+n.replace(/&/g,`&`).replace(//g,`>`).replace(/"/g,`"`).replace(/'/g,`'`)+``,this.internal.__metadata__.metadataObjectNumber=this.internal.newObject(),this.internal.write(`<< /Type /Metadata /Subtype /XML /Length `+e.length+` >>`),this.internal.write(`stream`),this.internal.write(e),this.internal.write(`endstream`),this.internal.write(`endobj`)}function Nv(){this.internal.__metadata__.metadataObjectNumber&&this.internal.write(`/Metadata `+this.internal.__metadata__.metadataObjectNumber+` 0 R`)}var Pv,Fv,Iv,Lv,Rv,zv,Bv,Vv,Hv,Uv,Wv,Gv,Kv,qv,Jv,Yv,Xv,Zv,Qv,$v,ey,ty,ny,ry,iy,ay,oy,sy,cy,ly,uy,dy,fy,py,my,hy,gy,_y,vy,yy,by,xy,Sy,Cy,wy,Ty,Ey,Dy,Oy,ky,Ay,jy,My,Ny,Py,Fy,Iy,Ly,Ry,zy,By,Vy,Hy,Uy,Wy,Gy,Ky,qy,Jy,Yy,Xy,Zy,Qy,$y,eb,tb,nb,rb,ib,ab,ob,sb,cb,lb,ub,db=o((()=>{yn(),ar(),_r(),Xl(),_n(),Pv=function(){return typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:this}(),Fv={log:L_,warn:function(e){Pv.console&&(typeof Pv.console.warn==`function`?Pv.console.warn.apply(Pv.console,arguments):L_.call(null,arguments))},error:function(e){Pv.console&&(typeof Pv.console.error==`function`?Pv.console.error.apply(Pv.console,arguments):L_(e))}},Iv=Pv.saveAs||((typeof window>`u`?`undefined`:vn(window))!==`object`||window!==Pv?function(){}:typeof HTMLAnchorElement<`u`&&`download`in HTMLAnchorElement.prototype?function(e,t,n){var r=Pv.URL||Pv.webkitURL,i=document.createElement(`a`);t=t||e.name||`download`,i.download=t,i.rel=`noopener`,typeof e==`string`?(i.href=e,i.origin===location.origin?B_(i):z_(i.href)?R_(e,t,n):B_(i,i.target=`_blank`)):(i.href=r.createObjectURL(e),setTimeout(function(){r.revokeObjectURL(i.href)},4e4),setTimeout(function(){B_(i)},0))}:`msSaveOrOpenBlob`in navigator?function(e,t,n){if(t=t||e.name||`download`,typeof e==`string`){if(z_(e))R_(e,t,n);else{var r=document.createElement(`a`);r.href=e,r.target=`_blank`,setTimeout(function(){B_(r)})}}else navigator.msSaveOrOpenBlob(function(e,t){return t===void 0?t={autoBom:!1}:vn(t)!==`object`&&(Fv.warn(`Deprecated: Expected third argument to be a object`),t={autoBom:!t}),t.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob([``,e],{type:e.type}):e}(e,n),t)}:function(e,t,n,r){if((r=r||open(``,`_blank`))&&(r.document.title=r.document.body.innerText=`downloading...`),typeof e==`string`)return R_(e,t,n);var i=e.type===`application/octet-stream`,a=/constructor/i.test(Pv.HTMLElement)||Pv.safari,o=/CriOS\/[\d]+/.test(navigator.userAgent);if((o||i&&a)&&(typeof FileReader>`u`?`undefined`:vn(FileReader))===`object`){var s=new FileReader;s.onloadend=function(){var e=s.result;e=o?e:e.replace(/^data:[^;]*;/,`data:attachment/file;`),r?r.location.href=e:location=e,r=null},s.readAsDataURL(e)}else{var c=Pv.URL||Pv.webkitURL,l=c.createObjectURL(e);r?r.location=l:location.href=l,r=null,setTimeout(function(){c.revokeObjectURL(l)},4e4)}}),Lv=Pv.atob.bind(Pv),Rv=Pv.btoa.bind(Pv),zv=`0123456789abcdef`.split(``),Bv=function(e){for(var t=0;t>8&255,e>>16&255,e>>24&255)},tv.prototype.toHexString=function(e){return e.split(``).map(function(e){return(`0`+(255&e.charCodeAt(0)).toString(16)).slice(-2)}).join(``)},tv.prototype.hexToBytes=function(e){for(var t=[],n=0;n>8&255,e>>16&255,255&t,t>>8&255)).substr(0,10);return function(e){return ev(n,e)}},iv.prototype.equals=function(e){var t,n=`id,objectNumber,equals`;if(!e||vn(e)!==vn(this))return!1;var r=0;for(t in this)if(!(n.indexOf(t)>=0)){if(this.hasOwnProperty(t)&&!e.hasOwnProperty(t)||this[t]!==e[t])return!1;r++}for(t in e)e.hasOwnProperty(t)&&n.indexOf(t)<0&&r--;return r===0},cv.API={events:[]},cv.version=`4.2.1`,Hv=cv.API,Uv=1,Wv=function(e){return e.replace(/\\/g,`\\\\`).replace(/\(/g,`\\(`).replace(/\)/g,`\\)`)},Gv=function(e){return e.replace(/\\\\/g,`\\`).replace(/\\\(/g,`(`).replace(/\\\)/g,`)`)},Kv=function(e){return e.toString().replace(/#/g,`#23`).replace(/[\s\n\r()<>[\]{}\/%]/g,function(e){var t=e.charCodeAt(0).toString(16).toUpperCase();return`#`+(t.length===1?`0`+t:t)})},qv=function(e){return e.toFixed(2)},Jv=function(e){return e.toFixed(5)},Hv.__acroform__={},Yv=function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e},Xv=function(e){return e*Uv},Zv=function(e){var t=new my,n=Oy.internal.getHeight(e)||0,r=Oy.internal.getWidth(e)||0;return t.BBox=[0,0,Number(qv(r)),Number(qv(n))],t},Qv=Hv.__acroform__.setBit=function(e,t){if(e=e||0,t=t||0,isNaN(e)||isNaN(t))throw Error(`Invalid arguments passed to jsPDF.API.__acroform__.setBit`);return e|1<0;){t=``,a--;var l,u,d=sy(`3`,e,a).height,f=e.multiline?o-a:(o-d)/2,p=f+=2,m=0,h=0,g=0;if(a<=0){t=`(...) Tj `,t+=`% Width of Text: `+sy(t,e,a=12).width+`, FieldWidth:`+s+` `;break}for(var _=``,v=0,y=0;yo)continue t;_+=i[y][g],b=!0,h=y,y--}else{_=(_+=i[y][g]+` `).substr(_.length-1)==` `?_.substr(0,_.length-1):_;var x=parseInt(y),S=c(x,_,a),C=y>=i.length-1;if(S&&!C){_+=` `,g=0;continue}if(S||C){if(C)h=x;else if(e.multiline&&(d+2)*(v+2)+2>o)continue t}else{if(!e.multiline||(d+2)*(v+2)+2>o)continue t;h=x}}for(var w=``,T=m;T<=h;T++){var E=i[T];if(e.multiline){if(T===h){w+=E[g]+` `,g=(g+1)%E.length;continue}if(T===m){w+=E[E.length-1]+` `;continue}}w+=E[0]+` `}switch(w=w.substr(w.length-1)==` `?w.substr(0,w.length-1):w,u=sy(w,e,a).width,e.textAlign){case`right`:l=s-u-2;break;case`center`:l=(s-u)/2;break;default:l=2}t+=qv(l)+` `+qv(p)+` Td `,t+=`(`+Wv(w)+`) Tj `,t+=-qv(l)+` 0 Td `,p=-(a+2),u=0,m=b?h:h+1,v++,_=``}break}return r.text=t,r.fontSize=a,r},sy=function(e,t,n){var r=t.scope.internal.getFont(t.fontName,t.fontStyle),i=t.scope.getStringUnitWidth(e,{font:r,fontSize:parseFloat(n),charSpace:0})*parseFloat(n);return{height:t.scope.getStringUnitWidth(`3`,{font:r,fontSize:parseFloat(n),charSpace:0})*parseFloat(n)*1.5,width:i}},cy={fields:[],xForms:[],acroFormDictionaryRoot:null,printedOut:!1,internal:null,isInitialized:!1},ly=function(e,t){var n={type:`reference`,object:e};t.internal.getPageInfo(e.page).pageContext.annotations.find(function(e){return e.type===n.type&&e.object===n.object})===void 0&&t.internal.getPageInfo(e.page).pageContext.annotations.push(n)},uy=function(e,t){if(t.scope=e,e.internal!==void 0&&(e.internal.acroformPlugin===void 0||!1===e.internal.acroformPlugin.isInitialized)){if(gy.FieldNum=0,e.internal.acroformPlugin=JSON.parse(JSON.stringify(cy)),e.internal.acroformPlugin.acroFormDictionaryRoot)throw Error(`Exception while creating AcroformDictionary`);Uv=e.internal.scaleFactor,e.internal.acroformPlugin.acroFormDictionaryRoot=new hy,e.internal.acroformPlugin.acroFormDictionaryRoot.scope=e,e.internal.acroformPlugin.acroFormDictionaryRoot._eventID=e.internal.events.subscribe(`postPutResources`,function(){(function(e){e.internal.events.unsubscribe(e.internal.acroformPlugin.acroFormDictionaryRoot._eventID),delete e.internal.acroformPlugin.acroFormDictionaryRoot._eventID,e.internal.acroformPlugin.printedOut=!0})(e)}),e.internal.events.subscribe(`buildDocument`,function(){(function(e){e.internal.acroformPlugin.acroFormDictionaryRoot.objId=void 0;var t=e.internal.acroformPlugin.acroFormDictionaryRoot.Fields;for(var n in t)if(t.hasOwnProperty(n)){var r=t[n];r.objId=void 0,r.hasAnnotation&&ly(r,e)}})(e)}),e.internal.events.subscribe(`putCatalog`,function(){(function(e){if(e.internal.acroformPlugin.acroFormDictionaryRoot===void 0)throw Error(`putCatalogCallback: Root missing.`);e.internal.write(`/AcroForm `+e.internal.acroformPlugin.acroFormDictionaryRoot.objId+` 0 R`)})(e)}),e.internal.events.subscribe(`postPutPages`,function(t){(function(e,t){var n=!e;for(var r in e||(t.internal.newObjectDeferredBegin(t.internal.acroformPlugin.acroFormDictionaryRoot.objId,!0),t.internal.acroformPlugin.acroFormDictionaryRoot.putStream()),e=e||t.internal.acroformPlugin.acroFormDictionaryRoot.Kids)if(e.hasOwnProperty(r)){var i=e[r],a=[],o=i.Rect;if(i.Rect&&(i.Rect=iy(i.Rect,t)),t.internal.newObjectDeferredBegin(i.objId,!0),i.DA=Oy.createDefaultAppearanceStream(i),vn(i)===`object`&&typeof i.getKeyValueListForStream==`function`&&(a=i.getKeyValueListForStream()),i.Rect=o,i.hasAppearanceStream&&!i.appearanceStreamContent){var s=ay(i);a.push({key:`AP`,value:`<>`}),t.internal.acroformPlugin.xForms.push(s)}if(i.appearanceStreamContent){var c=``;for(var l in i.appearanceStreamContent)if(i.appearanceStreamContent.hasOwnProperty(l)){var u=i.appearanceStreamContent[l];if(c+=`/`+l+` `,c+=`<<`,Object.keys(u).length>=1||Array.isArray(u)){for(var r in u)if(u.hasOwnProperty(r)){var d=u[r];typeof d==`function`&&(d=d.call(t,i)),c+=`/`+r+` `+d+` `,t.internal.acroformPlugin.xForms.indexOf(d)>=0||t.internal.acroformPlugin.xForms.push(d)}}else typeof(d=u)==`function`&&(d=d.call(t,i)),c+=`/`+r+` `+d,t.internal.acroformPlugin.xForms.indexOf(d)>=0||t.internal.acroformPlugin.xForms.push(d);c+=`>>`}a.push({key:`AP`,value:`<< `+c+`>>`})}t.internal.putStream({additionalKeyValues:a,objectId:i.objId}),t.internal.out(`endobj`)}n&&function(e,t){for(var n in e)if(e.hasOwnProperty(n)){var r=n,i=e[n];t.internal.newObjectDeferredBegin(i.objId,!0),vn(i)===`object`&&typeof i.putStream==`function`&&i.putStream(),delete e[r]}}(t.internal.acroformPlugin.xForms,t)})(t,e)}),e.internal.acroformPlugin.isInitialized=!0}},dy=Hv.__acroform__.arrayToPdfArray=function(e,t,n){var r=function(e){return e};if(Array.isArray(e)){for(var i=`[`,a=0;a0?t:void 0}}),Object.defineProperty(this,"Fields",{enumerable:!1,configurable:!1,get:function(){return t}}),Object.defineProperty(this,"DA",{enumerable:!1,configurable:!1,get:function(){if(e){var t=function(e){return e};return this.scope&&(t=this.scope.internal.getEncryptor(this.objId)),`(`+Wv(t(e))+`)`}},set:function(t){e=t}})},Yv(hy,py),gy=function e(){py.call(this);var t=4;Object.defineProperty(this,"F",{enumerable:!1,configurable:!1,get:function(){return t},set:function(e){if(isNaN(e))throw Error(`Invalid value "`+e+`" for attribute F supplied.`);t=e}}),Object.defineProperty(this,"showWhenPrinted",{enumerable:!0,configurable:!0,get:function(){return!!ty(t,3)},set:function(e){this.F=!!e==1?ny(t,3):ry(t,3)}});var n=0;Object.defineProperty(this,"Ff",{enumerable:!1,configurable:!1,get:function(){return n},set:function(e){if(isNaN(e))throw Error(`Invalid value "`+e+`" for attribute Ff supplied.`);n=e}});var r=[];Object.defineProperty(this,"Rect",{enumerable:!1,configurable:!1,get:function(){if(r.length!==0)return r},set:function(e){r=e===void 0?[]:e}}),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,get:function(){return!r||isNaN(r[0])?0:r[0]},set:function(e){r[0]=e}}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,get:function(){return!r||isNaN(r[1])?0:r[1]},set:function(e){r[1]=e}}),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,get:function(){return!r||isNaN(r[2])?0:r[2]},set:function(e){r[2]=e}}),Object.defineProperty(this,"height",{enumerable:!0,configurable:!0,get:function(){return!r||isNaN(r[3])?0:r[3]},set:function(e){r[3]=e}});var i=``;Object.defineProperty(this,"FT",{enumerable:!0,configurable:!1,get:function(){return i},set:function(e){switch(e){case`/Btn`:case`/Tx`:case`/Ch`:case`/Sig`:i=e;break;default:throw Error(`Invalid value "`+e+`" for attribute FT supplied.`)}}});var a=null;Object.defineProperty(this,"T",{enumerable:!0,configurable:!1,get:function(){if(!a||a.length<1){if(this instanceof wy)return;a=`FieldObject`+e.FieldNum++}var t=function(e){return e};return this.scope&&(t=this.scope.internal.getEncryptor(this.objId)),`(`+Wv(t(a))+`)`},set:function(e){a=e.toString()}}),Object.defineProperty(this,"fieldName",{configurable:!0,enumerable:!0,get:function(){return a},set:function(e){a=e}});var o=`helvetica`;Object.defineProperty(this,"fontName",{enumerable:!0,configurable:!0,get:function(){return o},set:function(e){o=e}});var s=`normal`;Object.defineProperty(this,"fontStyle",{enumerable:!0,configurable:!0,get:function(){return s},set:function(e){s=e}});var c=0;Object.defineProperty(this,"fontSize",{enumerable:!0,configurable:!0,get:function(){return c},set:function(e){c=e}});var l=void 0;Object.defineProperty(this,"maxFontSize",{enumerable:!0,configurable:!0,get:function(){return l===void 0?50/Uv:l},set:function(e){l=e}});var u=`black`;Object.defineProperty(this,"color",{enumerable:!0,configurable:!0,get:function(){return u},set:function(e){u=e}});var d=`/F1 0 Tf 0 g`;Object.defineProperty(this,"DA",{enumerable:!0,configurable:!1,get:function(){if(!(!d||this instanceof wy||this instanceof Ey))return fy(d,this.objId,this.scope)},set:function(e){e=e.toString(),d=e}});var f=null;Object.defineProperty(this,"DV",{enumerable:!1,configurable:!1,get:function(){if(f)return this instanceof xy==0?fy(f,this.objId,this.scope):f},set:function(e){e=e.toString(),f=this instanceof xy==0?e.substr(0,1)===`(`?Gv(e.substr(1,e.length-2)):Gv(e):e}}),Object.defineProperty(this,"defaultValue",{enumerable:!0,configurable:!0,get:function(){return this instanceof xy==1?Gv(f.substr(1,f.length-1)):f},set:function(e){e=e.toString(),f=this instanceof xy==1?`/`+Kv(e):e}});var p=null;Object.defineProperty(this,"_V",{enumerable:!1,configurable:!1,get:function(){if(p)return p},set:function(e){this.V=e}}),Object.defineProperty(this,"V",{enumerable:!1,configurable:!1,get:function(){if(p)return this instanceof xy==0?fy(p,this.objId,this.scope):p},set:function(e){e=e.toString(),p=this instanceof xy==0?e.substr(0,1)===`(`?Gv(e.substr(1,e.length-2)):Gv(e):e}}),Object.defineProperty(this,"value",{enumerable:!0,configurable:!0,get:function(){return this instanceof xy==1?Gv(p.substr(1,p.length-1)):p},set:function(e){e=e.toString(),p=this instanceof xy==1?`/`+Kv(e):e}}),Object.defineProperty(this,"hasAnnotation",{enumerable:!0,configurable:!0,get:function(){return this.Rect}}),Object.defineProperty(this,"Type",{enumerable:!0,configurable:!1,get:function(){return this.hasAnnotation?`/Annot`:null}}),Object.defineProperty(this,"Subtype",{enumerable:!0,configurable:!1,get:function(){return this.hasAnnotation?`/Widget`:null}});var m,h=!1;Object.defineProperty(this,"hasAppearanceStream",{enumerable:!0,configurable:!0,get:function(){return h},set:function(e){e=!!e,h=e}}),Object.defineProperty(this,"page",{enumerable:!0,configurable:!0,get:function(){if(m)return m},set:function(e){m=e}}),Object.defineProperty(this,"readOnly",{enumerable:!0,configurable:!0,get:function(){return!!ty(this.Ff,1)},set:function(e){this.Ff=!!e==1?ny(this.Ff,1):ry(this.Ff,1)}}),Object.defineProperty(this,"required",{enumerable:!0,configurable:!0,get:function(){return!!ty(this.Ff,2)},set:function(e){this.Ff=!!e==1?ny(this.Ff,2):ry(this.Ff,2)}}),Object.defineProperty(this,"noExport",{enumerable:!0,configurable:!0,get:function(){return!!ty(this.Ff,3)},set:function(e){this.Ff=!!e==1?ny(this.Ff,3):ry(this.Ff,3)}});var g=null;Object.defineProperty(this,"Q",{enumerable:!0,configurable:!1,get:function(){if(g!==null)return g},set:function(e){if([0,1,2].indexOf(e)===-1)throw Error(`Invalid value "`+e+`" for attribute Q supplied.`);g=e}}),Object.defineProperty(this,"textAlign",{get:function(){var e;switch(g){case 0:default:e=`left`;break;case 1:e=`center`;break;case 2:e=`right`}return e},configurable:!0,enumerable:!0,set:function(e){switch(e){case`right`:case 2:g=2;break;case`center`:case 1:g=1;break;default:g=0}}})},Yv(gy,py),_y=function(){gy.call(this),this.FT=`/Ch`,this.V=`()`,this.fontName=`zapfdingbats`;var e=0;Object.defineProperty(this,"TI",{enumerable:!0,configurable:!1,get:function(){return e},set:function(t){e=t}}),Object.defineProperty(this,"topIndex",{enumerable:!0,configurable:!0,get:function(){return e},set:function(t){e=t}});var t=[];Object.defineProperty(this,"Opt",{enumerable:!0,configurable:!1,get:function(){return dy(t,this.objId,this.scope)},set:function(e){var n,r=[];typeof(n=e)==`string`&&(r=function(e,t,n){n||(n=1);for(var r,i=[];r=t.exec(e);)i.push(r[n]);return i}(n,/\((.*?)\)/g)),t=r}}),this.getOptions=function(){return t},this.setOptions=function(e){t=e,this.sort&&t.sort()},this.addOption=function(e){e=(e=e||``).toString(),t.push(e),this.sort&&t.sort()},this.removeOption=function(e,n){for(n=n||!1,e=(e=e||``).toString();t.indexOf(e)!==-1&&(t.splice(t.indexOf(e),1),!1!==n););},Object.defineProperty(this,"combo",{enumerable:!0,configurable:!0,get:function(){return!!ty(this.Ff,18)},set:function(e){this.Ff=!!e==1?ny(this.Ff,18):ry(this.Ff,18)}}),Object.defineProperty(this,"edit",{enumerable:!0,configurable:!0,get:function(){return!!ty(this.Ff,19)},set:function(e){!0===this.combo&&(this.Ff=!!e==1?ny(this.Ff,19):ry(this.Ff,19))}}),Object.defineProperty(this,"sort",{enumerable:!0,configurable:!0,get:function(){return!!ty(this.Ff,20)},set:function(e){!!e==1?(this.Ff=ny(this.Ff,20),t.sort()):this.Ff=ry(this.Ff,20)}}),Object.defineProperty(this,"multiSelect",{enumerable:!0,configurable:!0,get:function(){return!!ty(this.Ff,22)},set:function(e){this.Ff=!!e==1?ny(this.Ff,22):ry(this.Ff,22)}}),Object.defineProperty(this,"doNotSpellCheck",{enumerable:!0,configurable:!0,get:function(){return!!ty(this.Ff,23)},set:function(e){this.Ff=!!e==1?ny(this.Ff,23):ry(this.Ff,23)}}),Object.defineProperty(this,"commitOnSelChange",{enumerable:!0,configurable:!0,get:function(){return!!ty(this.Ff,27)},set:function(e){this.Ff=!!e==1?ny(this.Ff,27):ry(this.Ff,27)}}),this.hasAppearanceStream=!1},Yv(_y,gy),vy=function(){_y.call(this),this.fontName=`helvetica`,this.combo=!1},Yv(vy,_y),yy=function(){vy.call(this),this.combo=!0},Yv(yy,vy),by=function(){yy.call(this),this.edit=!0},Yv(by,yy),xy=function(){gy.call(this),this.FT=`/Btn`,Object.defineProperty(this,"noToggleToOff",{enumerable:!0,configurable:!0,get:function(){return!!ty(this.Ff,15)},set:function(e){this.Ff=!!e==1?ny(this.Ff,15):ry(this.Ff,15)}}),Object.defineProperty(this,"radio",{enumerable:!0,configurable:!0,get:function(){return!!ty(this.Ff,16)},set:function(e){this.Ff=!!e==1?ny(this.Ff,16):ry(this.Ff,16)}}),Object.defineProperty(this,"pushButton",{enumerable:!0,configurable:!0,get:function(){return!!ty(this.Ff,17)},set:function(e){this.Ff=!!e==1?ny(this.Ff,17):ry(this.Ff,17)}}),Object.defineProperty(this,"radioIsUnison",{enumerable:!0,configurable:!0,get:function(){return!!ty(this.Ff,26)},set:function(e){this.Ff=!!e==1?ny(this.Ff,26):ry(this.Ff,26)}});var e,t={};Object.defineProperty(this,"MK",{enumerable:!1,configurable:!1,get:function(){var e=function(e){return e};if(this.scope&&(e=this.scope.internal.getEncryptor(this.objId)),Object.keys(t).length!==0){var n,r=[];for(n in r.push(`<<`),t)r.push(`/`+n+` (`+Wv(e(t[n]))+`)`);return r.push(`>>`),r.join(` `)}},set:function(e){vn(e)===`object`&&(t=e)}}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,get:function(){return t.CA||``},set:function(e){typeof e==`string`&&(t.CA=e)}}),Object.defineProperty(this,"AS",{enumerable:!1,configurable:!1,get:function(){return e},set:function(t){var n=t==null?``:t.toString();n.substr(0,1)===`/`&&(n=n.substr(1)),e=`/`+Kv(n)}}),Object.defineProperty(this,"appearanceState",{enumerable:!0,configurable:!0,get:function(){return e.substr(1,e.length-1)},set:function(t){e=`/`+Kv(t)}})},Yv(xy,gy),Sy=function(){xy.call(this),this.pushButton=!0},Yv(Sy,xy),Cy=function(){xy.call(this),this.radio=!0,this.pushButton=!1;var e=[];Object.defineProperty(this,"Kids",{enumerable:!0,configurable:!1,get:function(){return e},set:function(t){e=t===void 0?[]:t}})},Yv(Cy,xy),wy=function(){var e,t;gy.call(this),Object.defineProperty(this,"Parent",{enumerable:!1,configurable:!1,get:function(){return e},set:function(t){e=t}}),Object.defineProperty(this,"optionName",{enumerable:!1,configurable:!0,get:function(){return t},set:function(e){t=e}});var n,r={};Object.defineProperty(this,"MK",{enumerable:!1,configurable:!1,get:function(){var e=function(e){return e};this.scope&&(e=this.scope.internal.getEncryptor(this.objId));var t,n=[];for(t in n.push(`<<`),r)n.push(`/`+t+` (`+Wv(e(r[t]))+`)`);return n.push(`>>`),n.join(` `)},set:function(e){vn(e)===`object`&&(r=e)}}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,get:function(){return r.CA||``},set:function(e){typeof e==`string`&&(r.CA=e)}}),Object.defineProperty(this,"AS",{enumerable:!1,configurable:!1,get:function(){return n},set:function(e){var t=e==null?``:e.toString();t.substr(0,1)===`/`&&(t=t.substr(1)),n=`/`+Kv(t)}}),Object.defineProperty(this,"appearanceState",{enumerable:!0,configurable:!0,get:function(){return n.substr(1,n.length-1)},set:function(e){var t=e==null?``:e.toString();t.substr(0,1)===`/`&&(t=t.substr(1)),n=`/`+Kv(t)}}),this.caption=`l`,this.appearanceState=`Off`,this._AppearanceType=Oy.RadioButton.Circle,this.appearanceStreamContent=this._AppearanceType.createAppearanceStream(this.optionName)},Yv(wy,gy),Cy.prototype.setAppearance=function(e){if(!(`createAppearanceStream`in e)||!(`getCA`in e))throw Error(`Couldn't assign Appearance to RadioButton. Appearance was Invalid!`);for(var t in this.Kids)if(this.Kids.hasOwnProperty(t)){var n=this.Kids[t];n.appearanceStreamContent=e.createAppearanceStream(n.optionName),n.caption=e.getCA()}},Cy.prototype.createOption=function(e){var t=new wy;return t.Parent=this,t.optionName=e,this.Kids.push(t),ky.call(this.scope,t),t},Ty=function(){xy.call(this),this.fontName=`zapfdingbats`,this.caption=`3`,this.appearanceState=`On`,this.value=`On`,this.textAlign=`center`,this.appearanceStreamContent=Oy.CheckBox.createAppearanceStream()},Yv(Ty,xy),Ey=function(){gy.call(this),this.FT=`/Tx`,Object.defineProperty(this,"multiline",{enumerable:!0,configurable:!0,get:function(){return!!ty(this.Ff,13)},set:function(e){this.Ff=!!e==1?ny(this.Ff,13):ry(this.Ff,13)}}),Object.defineProperty(this,"fileSelect",{enumerable:!0,configurable:!0,get:function(){return!!ty(this.Ff,21)},set:function(e){this.Ff=!!e==1?ny(this.Ff,21):ry(this.Ff,21)}}),Object.defineProperty(this,"doNotSpellCheck",{enumerable:!0,configurable:!0,get:function(){return!!ty(this.Ff,23)},set:function(e){this.Ff=!!e==1?ny(this.Ff,23):ry(this.Ff,23)}}),Object.defineProperty(this,"doNotScroll",{enumerable:!0,configurable:!0,get:function(){return!!ty(this.Ff,24)},set:function(e){this.Ff=!!e==1?ny(this.Ff,24):ry(this.Ff,24)}}),Object.defineProperty(this,"comb",{enumerable:!0,configurable:!0,get:function(){return!!ty(this.Ff,25)},set:function(e){this.Ff=!!e==1?ny(this.Ff,25):ry(this.Ff,25)}}),Object.defineProperty(this,"richText",{enumerable:!0,configurable:!0,get:function(){return!!ty(this.Ff,26)},set:function(e){this.Ff=!!e==1?ny(this.Ff,26):ry(this.Ff,26)}});var e=null;Object.defineProperty(this,"MaxLen",{enumerable:!0,configurable:!1,get:function(){return e},set:function(t){e=t}}),Object.defineProperty(this,"maxLength",{enumerable:!0,configurable:!0,get:function(){return e},set:function(t){Number.isInteger(t)&&(e=t)}}),Object.defineProperty(this,"hasAppearanceStream",{enumerable:!0,configurable:!0,get:function(){return this.V||this.DV}})},Yv(Ey,gy),Dy=function(){Ey.call(this),Object.defineProperty(this,"password",{enumerable:!0,configurable:!0,get:function(){return!!ty(this.Ff,14)},set:function(e){this.Ff=!!e==1?ny(this.Ff,14):ry(this.Ff,14)}}),this.password=!0},Yv(Dy,Ey),Oy={CheckBox:{createAppearanceStream:function(){return{N:{On:Oy.CheckBox.YesNormal},D:{On:Oy.CheckBox.YesPushDown,Off:Oy.CheckBox.OffPushDown}}},YesPushDown:function(e){var t=Zv(e);t.scope=e.scope;var n=[],r=e.scope.internal.getFont(e.fontName,e.fontStyle).id,i=e.scope.__private__.encodeColorString(e.color),a=oy(e,e.caption);return n.push(`0.749023 g`),n.push(`0 0 `+qv(Oy.internal.getWidth(e))+` `+qv(Oy.internal.getHeight(e))+` re`),n.push(`f`),n.push(`BMC`),n.push(`q`),n.push(`0 0 1 rg`),n.push(`/`+r+` `+qv(a.fontSize)+` Tf `+i),n.push(`BT`),n.push(a.text),n.push(`ET`),n.push(`Q`),n.push(`EMC`),t.stream=n.join(` `),t},YesNormal:function(e){var t=Zv(e);t.scope=e.scope;var n=e.scope.internal.getFont(e.fontName,e.fontStyle).id,r=e.scope.__private__.encodeColorString(e.color),i=[],a=Oy.internal.getHeight(e),o=Oy.internal.getWidth(e),s=oy(e,e.caption);return i.push(`1 g`),i.push(`0 0 `+qv(o)+` `+qv(a)+` re`),i.push(`f`),i.push(`q`),i.push(`0 0 1 rg`),i.push(`0 0 `+qv(o-1)+` `+qv(a-1)+` re`),i.push(`W`),i.push(`n`),i.push(`0 g`),i.push(`BT`),i.push(`/`+n+` `+qv(s.fontSize)+` Tf `+r),i.push(s.text),i.push(`ET`),i.push(`Q`),t.stream=i.join(` `),t},OffPushDown:function(e){var t=Zv(e);t.scope=e.scope;var n=[];return n.push(`0.749023 g`),n.push(`0 0 `+qv(Oy.internal.getWidth(e))+` `+qv(Oy.internal.getHeight(e))+` re`),n.push(`f`),t.stream=n.join(` `),t}},RadioButton:{Circle:{createAppearanceStream:function(e){var t={D:{Off:Oy.RadioButton.Circle.OffPushDown},N:{}};return t.N[e]=Oy.RadioButton.Circle.YesNormal,t.D[e]=Oy.RadioButton.Circle.YesPushDown,t},getCA:function(){return`l`},YesNormal:function(e){var t=Zv(e);t.scope=e.scope;var n=[],r=Oy.internal.getWidth(e)<=Oy.internal.getHeight(e)?Oy.internal.getWidth(e)/4:Oy.internal.getHeight(e)/4;r=Number((.9*r).toFixed(5));var i=Oy.internal.Bezier_C,a=Number((r*i).toFixed(5));return n.push(`q`),n.push(`1 0 0 1 `+Jv(Oy.internal.getWidth(e)/2)+` `+Jv(Oy.internal.getHeight(e)/2)+` cm`),n.push(r+` 0 m`),n.push(r+` `+a+` `+a+` `+r+` 0 `+r+` c`),n.push(`-`+a+` `+r+` -`+r+` `+a+` -`+r+` 0 c`),n.push(`-`+r+` -`+a+` -`+a+` -`+r+` 0 -`+r+` c`),n.push(a+` -`+r+` `+r+` -`+a+` `+r+` 0 c`),n.push(`f`),n.push(`Q`),t.stream=n.join(` `),t},YesPushDown:function(e){var t=Zv(e);t.scope=e.scope;var n=[],r=Oy.internal.getWidth(e)<=Oy.internal.getHeight(e)?Oy.internal.getWidth(e)/4:Oy.internal.getHeight(e)/4;r=Number((.9*r).toFixed(5));var i=Number((2*r).toFixed(5)),a=Number((i*Oy.internal.Bezier_C).toFixed(5)),o=Number((r*Oy.internal.Bezier_C).toFixed(5));return n.push(`0.749023 g`),n.push(`q`),n.push(`1 0 0 1 `+Jv(Oy.internal.getWidth(e)/2)+` `+Jv(Oy.internal.getHeight(e)/2)+` cm`),n.push(i+` 0 m`),n.push(i+` `+a+` `+a+` `+i+` 0 `+i+` c`),n.push(`-`+a+` `+i+` -`+i+` `+a+` -`+i+` 0 c`),n.push(`-`+i+` -`+a+` -`+a+` -`+i+` 0 -`+i+` c`),n.push(a+` -`+i+` `+i+` -`+a+` `+i+` 0 c`),n.push(`f`),n.push(`Q`),n.push(`0 g`),n.push(`q`),n.push(`1 0 0 1 `+Jv(Oy.internal.getWidth(e)/2)+` `+Jv(Oy.internal.getHeight(e)/2)+` cm`),n.push(r+` 0 m`),n.push(r+` `+o+` `+o+` `+r+` 0 `+r+` c`),n.push(`-`+o+` `+r+` -`+r+` `+o+` -`+r+` 0 c`),n.push(`-`+r+` -`+o+` -`+o+` -`+r+` 0 -`+r+` c`),n.push(o+` -`+r+` `+r+` -`+o+` `+r+` 0 c`),n.push(`f`),n.push(`Q`),t.stream=n.join(` `),t},OffPushDown:function(e){var t=Zv(e);t.scope=e.scope;var n=[],r=Oy.internal.getWidth(e)<=Oy.internal.getHeight(e)?Oy.internal.getWidth(e)/4:Oy.internal.getHeight(e)/4;r=Number((.9*r).toFixed(5));var i=Number((2*r).toFixed(5)),a=Number((i*Oy.internal.Bezier_C).toFixed(5));return n.push(`0.749023 g`),n.push(`q`),n.push(`1 0 0 1 `+Jv(Oy.internal.getWidth(e)/2)+` `+Jv(Oy.internal.getHeight(e)/2)+` cm`),n.push(i+` 0 m`),n.push(i+` `+a+` `+a+` `+i+` 0 `+i+` c`),n.push(`-`+a+` `+i+` -`+i+` `+a+` -`+i+` 0 c`),n.push(`-`+i+` -`+a+` -`+a+` -`+i+` 0 -`+i+` c`),n.push(a+` -`+i+` `+i+` -`+a+` `+i+` 0 c`),n.push(`f`),n.push(`Q`),t.stream=n.join(` `),t}},Cross:{createAppearanceStream:function(e){var t={D:{Off:Oy.RadioButton.Cross.OffPushDown},N:{}};return t.N[e]=Oy.RadioButton.Cross.YesNormal,t.D[e]=Oy.RadioButton.Cross.YesPushDown,t},getCA:function(){return`8`},YesNormal:function(e){var t=Zv(e);t.scope=e.scope;var n=[],r=Oy.internal.calculateCross(e);return n.push(`q`),n.push(`1 1 `+qv(Oy.internal.getWidth(e)-2)+` `+qv(Oy.internal.getHeight(e)-2)+` re`),n.push(`W`),n.push(`n`),n.push(qv(r.x1.x)+` `+qv(r.x1.y)+` m`),n.push(qv(r.x2.x)+` `+qv(r.x2.y)+` l`),n.push(qv(r.x4.x)+` `+qv(r.x4.y)+` m`),n.push(qv(r.x3.x)+` `+qv(r.x3.y)+` l`),n.push(`s`),n.push(`Q`),t.stream=n.join(` `),t},YesPushDown:function(e){var t=Zv(e);t.scope=e.scope;var n=Oy.internal.calculateCross(e),r=[];return r.push(`0.749023 g`),r.push(`0 0 `+qv(Oy.internal.getWidth(e))+` `+qv(Oy.internal.getHeight(e))+` re`),r.push(`f`),r.push(`q`),r.push(`1 1 `+qv(Oy.internal.getWidth(e)-2)+` `+qv(Oy.internal.getHeight(e)-2)+` re`),r.push(`W`),r.push(`n`),r.push(qv(n.x1.x)+` `+qv(n.x1.y)+` m`),r.push(qv(n.x2.x)+` `+qv(n.x2.y)+` l`),r.push(qv(n.x4.x)+` `+qv(n.x4.y)+` m`),r.push(qv(n.x3.x)+` `+qv(n.x3.y)+` l`),r.push(`s`),r.push(`Q`),t.stream=r.join(` `),t},OffPushDown:function(e){var t=Zv(e);t.scope=e.scope;var n=[];return n.push(`0.749023 g`),n.push(`0 0 `+qv(Oy.internal.getWidth(e))+` `+qv(Oy.internal.getHeight(e))+` re`),n.push(`f`),t.stream=n.join(` `),t}}},createDefaultAppearanceStream:function(e){var t=e.scope.internal.getFont(e.fontName,e.fontStyle).id,n=e.scope.__private__.encodeColorString(e.color);return`/`+t+` `+e.fontSize+` Tf `+n}},Oy.internal={Bezier_C:.551915024494,calculateCross:function(e){var t=Oy.internal.getWidth(e),n=Oy.internal.getHeight(e),r=Math.min(t,n);return{x1:{x:(t-r)/2,y:(n-r)/2+r},x2:{x:(t-r)/2+r,y:(n-r)/2},x3:{x:(t-r)/2,y:(n-r)/2},x4:{x:(t-r)/2+r,y:(n-r)/2+r}}}},Oy.internal.getWidth=function(e){var t=0;return vn(e)===`object`&&(t=Xv(e.Rect[2])),t},Oy.internal.getHeight=function(e){var t=0;return vn(e)===`object`&&(t=Xv(e.Rect[3])),t},ky=Hv.addField=function(e){if(uy(this,e),!(e instanceof gy))throw Error(`Invalid argument passed to jsPDF.addField.`);var t;return(t=e).scope.internal.acroformPlugin.printedOut&&(t.scope.internal.acroformPlugin.printedOut=!1,t.scope.internal.acroformPlugin.acroFormDictionaryRoot=null),t.scope.internal.acroformPlugin.acroFormDictionaryRoot.Fields.push(t),e.page=e.scope.internal.getCurrentPageInfo().pageNumber,this},Hv.AcroFormChoiceField=_y,Hv.AcroFormListBox=vy,Hv.AcroFormComboBox=yy,Hv.AcroFormEditBox=by,Hv.AcroFormButton=xy,Hv.AcroFormPushButton=Sy,Hv.AcroFormRadioButton=Cy,Hv.AcroFormCheckBox=Ty,Hv.AcroFormTextField=Ey,Hv.AcroFormPasswordField=Dy,Hv.AcroFormAppearance=Oy,Hv.AcroForm={ChoiceField:_y,ListBox:vy,ComboBox:yy,EditBox:by,Button:xy,PushButton:Sy,RadioButton:Cy,CheckBox:Ty,TextField:Ey,PasswordField:Dy,Appearance:Oy},cv.AcroForm={ChoiceField:_y,ListBox:vy,ComboBox:yy,EditBox:by,Button:xy,PushButton:Sy,RadioButton:Cy,CheckBox:Ty,TextField:Ey,PasswordField:Dy,Appearance:Oy},Ay=cv.AcroForm,(function(e){var t=`addImage_`;e.__addimage__={};var n=`UNKNOWN`,r={PNG:[[137,80,78,71]],TIFF:[[77,77,0,42],[73,73,42,0]],JPEG:[[255,216,255,224,void 0,void 0,74,70,73,70,0],[255,216,255,225,void 0,void 0,69,120,105,102,0,0],[255,216,255,219],[255,216,255,238]],JPEG2000:[[0,0,0,12,106,80,32,32]],GIF87a:[[71,73,70,56,55,97]],GIF89a:[[71,73,70,56,57,97]],WEBP:[[82,73,70,70,void 0,void 0,void 0,void 0,87,69,66,80]],BMP:[[66,77],[66,65],[67,73],[67,80],[73,67],[80,84]]},i=e.__addimage__.getImageFileTypeByImageData=function(e,t){var i,a,o,s,c,l=n;if((t=t||n)===`RGBA`||e.data!==void 0&&e.data instanceof Uint8ClampedArray&&`height`in e&&`width`in e)return`RGBA`;if(S(e))for(c in r)for(o=r[c],i=0;i>`}),`transparency`in t&&Array.isArray(t.transparency)&&t.transparency.length>0){for(var o=``,s=0,c=t.transparency.length;s>`,m.content=i;var v=m.objId+` 0 R`;i=`<>`,h.content=i,this.internal.write(m.objId,`0 R`,h.objId,`0 R`);break;case`freetext`:r=`/Rect [`+a(n.bounds.x)+` `+o(n.bounds.y)+` `+a(n.bounds.x+n.bounds.w)+` `+o(n.bounds.y+n.bounds.h)+`] `;var y=`font: Helvetica,sans-serif 12.0pt; text-align:left; color:#`+(n.color||`#000000`);i=`<>`,this.internal.write(i);break;case`link`:if(n.options.name){var b=this.annotations._nameMap[n.options.name];n.options.pageNumber=b.page,n.options.top=b.y}else n.options.top||(n.options.top=0);if(r=`/Rect [`+n.finalBounds.x+` `+n.finalBounds.y+` `+n.finalBounds.w+` `+n.finalBounds.h+`] `,i=``,n.options.url)i=`<>`;else if(n.options.pageNumber)switch(i=`<>`,this.internal.write(i))}}this.internal.write(`]`)}}]),e.createAnnotation=function(e){var t=this.internal.getCurrentPageInfo();switch(e.type){case`link`:this.link(e.bounds.x,e.bounds.y,e.bounds.w,e.bounds.h,e);break;case`text`:case`freetext`:t.pageContext.annotations.push(e)}},e.link=function(e,t,n,r,i){var a=this.internal.getCurrentPageInfo(),o=this.internal.getCoordinateString,s=this.internal.getVerticalCoordinateString;a.pageContext.annotations.push({finalBounds:{x:o(e),y:s(t),w:o(e+n),h:s(t+r)},options:i,type:`link`})},e.textWithLink=function(e,t,n,r){var i,a,o=this.getTextWidth(e),s=this.internal.getLineHeight()/this.internal.scaleFactor;if(r.maxWidth!==void 0){a=r.maxWidth;var c=this.splitTextToSize(e,a).length;i=Math.ceil(s*c)}else a=o,i=s;return this.text(e,t,n,r),n+=.2*s,r.align===`center`&&(t-=o/2),r.align===`right`&&(t-=o),this.link(t,n-s,a,i,r),o},e.getTextWidth=function(e){var t=this.internal.getFontSize();return this.getStringUnitWidth(e)*t/this.internal.scaleFactor}}(cv.API),function(e){var t={1569:[65152],1570:[65153,65154],1571:[65155,65156],1572:[65157,65158],1573:[65159,65160],1574:[65161,65162,65163,65164],1575:[65165,65166],1576:[65167,65168,65169,65170],1577:[65171,65172],1578:[65173,65174,65175,65176],1579:[65177,65178,65179,65180],1580:[65181,65182,65183,65184],1581:[65185,65186,65187,65188],1582:[65189,65190,65191,65192],1583:[65193,65194],1584:[65195,65196],1585:[65197,65198],1586:[65199,65200],1587:[65201,65202,65203,65204],1588:[65205,65206,65207,65208],1589:[65209,65210,65211,65212],1590:[65213,65214,65215,65216],1591:[65217,65218,65219,65220],1592:[65221,65222,65223,65224],1593:[65225,65226,65227,65228],1594:[65229,65230,65231,65232],1601:[65233,65234,65235,65236],1602:[65237,65238,65239,65240],1603:[65241,65242,65243,65244],1604:[65245,65246,65247,65248],1605:[65249,65250,65251,65252],1606:[65253,65254,65255,65256],1607:[65257,65258,65259,65260],1608:[65261,65262],1609:[65263,65264,64488,64489],1610:[65265,65266,65267,65268],1649:[64336,64337],1655:[64477],1657:[64358,64359,64360,64361],1658:[64350,64351,64352,64353],1659:[64338,64339,64340,64341],1662:[64342,64343,64344,64345],1663:[64354,64355,64356,64357],1664:[64346,64347,64348,64349],1667:[64374,64375,64376,64377],1668:[64370,64371,64372,64373],1670:[64378,64379,64380,64381],1671:[64382,64383,64384,64385],1672:[64392,64393],1676:[64388,64389],1677:[64386,64387],1678:[64390,64391],1681:[64396,64397],1688:[64394,64395],1700:[64362,64363,64364,64365],1702:[64366,64367,64368,64369],1705:[64398,64399,64400,64401],1709:[64467,64468,64469,64470],1711:[64402,64403,64404,64405],1713:[64410,64411,64412,64413],1715:[64406,64407,64408,64409],1722:[64414,64415],1723:[64416,64417,64418,64419],1726:[64426,64427,64428,64429],1728:[64420,64421],1729:[64422,64423,64424,64425],1733:[64480,64481],1734:[64473,64474],1735:[64471,64472],1736:[64475,64476],1737:[64482,64483],1739:[64478,64479],1740:[64508,64509,64510,64511],1744:[64484,64485,64486,64487],1746:[64430,64431],1747:[64432,64433]},n={65247:{65154:65269,65156:65271,65160:65273,65166:65275},65248:{65154:65270,65156:65272,65160:65274,65166:65276},65165:{65247:{65248:{65258:65010}}},1617:{1612:64606,1613:64607,1614:64608,1615:64609,1616:64610}},r={1612:64606,1613:64607,1614:64608,1615:64609,1616:64610},i=[1570,1571,1573,1575];e.__arabicParser__={};var a=e.__arabicParser__.isInArabicSubstitutionA=function(e){return t[e.charCodeAt(0)]!==void 0},o=e.__arabicParser__.isArabicLetter=function(e){return typeof e==`string`&&/^[\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF\uFB50-\uFDFF\uFE70-\uFEFF]+$/.test(e)},s=e.__arabicParser__.isArabicEndLetter=function(e){return o(e)&&a(e)&&t[e.charCodeAt(0)].length<=2},c=e.__arabicParser__.isArabicAlfLetter=function(e){return o(e)&&i.indexOf(e.charCodeAt(0))>=0};e.__arabicParser__.arabicLetterHasIsolatedForm=function(e){return o(e)&&a(e)&&t[e.charCodeAt(0)].length>=1};var l=e.__arabicParser__.arabicLetterHasFinalForm=function(e){return o(e)&&a(e)&&t[e.charCodeAt(0)].length>=2};e.__arabicParser__.arabicLetterHasInitialForm=function(e){return o(e)&&a(e)&&t[e.charCodeAt(0)].length>=3};var u=e.__arabicParser__.arabicLetterHasMedialForm=function(e){return o(e)&&a(e)&&t[e.charCodeAt(0)].length==4},d=e.__arabicParser__.resolveLigatures=function(e){var t=0,r=n,i=``,a=0;for(t=0;t>`),this.internal.out(`endobj`)}),this.internal.events.subscribe(`putCatalog`,function(){this.internal.out(`/OpenAction `+t+` 0 R`)})),this},function(e){var t=function(){var e=void 0;Object.defineProperty(this,"pdf",{get:function(){return e},set:function(t){e=t}});var t=150;Object.defineProperty(this,"width",{get:function(){return t},set:function(e){t=isNaN(e)||!1===Number.isInteger(e)||e<0?150:e,this.getContext(`2d`).pageWrapXEnabled&&(this.getContext(`2d`).pageWrapX=t+1)}});var n=300;Object.defineProperty(this,"height",{get:function(){return n},set:function(e){n=isNaN(e)||!1===Number.isInteger(e)||e<0?300:e,this.getContext(`2d`).pageWrapYEnabled&&(this.getContext(`2d`).pageWrapY=n+1)}});var r=[];Object.defineProperty(this,"childNodes",{get:function(){return r},set:function(e){r=e}});var i={};Object.defineProperty(this,"style",{get:function(){return i},set:function(e){i=e}}),Object.defineProperty(this,"parentNode",{})};t.prototype.getContext=function(e,t){var n;if((e=e||`2d`)!==`2d`)return null;for(n in t)this.pdf.context2d.hasOwnProperty(n)&&(this.pdf.context2d[n]=t[n]);return this.pdf.context2d._canvas=this,this.pdf.context2d},t.prototype.toDataURL=function(){throw Error(`toDataURL is not implemented.`)},e.events.push([`initialized`,function(){this.canvas=new t,this.canvas.pdf=this}])}(cv.API),function(e){var t={left:0,top:0,bottom:0,right:0},n=!1,r=function(){this.internal.__cell__===void 0&&(this.internal.__cell__={},this.internal.__cell__.padding=3,this.internal.__cell__.headerFunction=void 0,this.internal.__cell__.margins=Object.assign({},t),this.internal.__cell__.margins.width=this.getPageWidth(),i.call(this))},i=function(){this.internal.__cell__.lastCell=new a,this.internal.__cell__.pages=1},a=function(){var e=arguments[0];Object.defineProperty(this,"x",{enumerable:!0,get:function(){return e},set:function(t){e=t}});var t=arguments[1];Object.defineProperty(this,"y",{enumerable:!0,get:function(){return t},set:function(e){t=e}});var n=arguments[2];Object.defineProperty(this,"width",{enumerable:!0,get:function(){return n},set:function(e){n=e}});var r=arguments[3];Object.defineProperty(this,"height",{enumerable:!0,get:function(){return r},set:function(e){r=e}});var i=arguments[4];Object.defineProperty(this,"text",{enumerable:!0,get:function(){return i},set:function(e){i=e}});var a=arguments[5];Object.defineProperty(this,"lineNumber",{enumerable:!0,get:function(){return a},set:function(e){a=e}});var o=arguments[6];return Object.defineProperty(this,"align",{enumerable:!0,get:function(){return o},set:function(e){o=e}}),this};a.prototype.clone=function(){return new a(this.x,this.y,this.width,this.height,this.text,this.lineNumber,this.align)},a.prototype.toArray=function(){return[this.x,this.y,this.width,this.height,this.text,this.lineNumber,this.align]},e.setHeaderFunction=function(e){return r.call(this),this.internal.__cell__.headerFunction=typeof e==`function`?e:void 0,this},e.getTextDimensions=function(e,t){r.call(this);var n=(t=t||{}).fontSize||this.getFontSize(),i=t.font||this.getFont(),a=t.scaleFactor||this.internal.scaleFactor,o=0,s=0,c=0,l=this;if(!Array.isArray(e)&&typeof e!=`string`){if(typeof e!=`number`)throw Error(`getTextDimensions expects text-parameter to be of type String or type Number or an Array of Strings.`);e=String(e)}var u=t.maxWidth;u>0?typeof e==`string`?e=this.splitTextToSize(e,u):Object.prototype.toString.call(e)===`[object Array]`&&(e=e.reduce(function(e,t){return e.concat(l.splitTextToSize(t,u))},[])):e=Array.isArray(e)?e:[e];for(var d=0;dthis.getPageHeight()?(this.cellAddPage(),e.y=s.top,l&&c&&(this.printHeaderRow(e.lineNumber,!0),e.y+=c[0].height)):e.y=i.y+i.height||e.y),e.text[0]!==void 0&&(this.rect(e.x,e.y,e.width,e.height,!0===n?`FD`:void 0),e.align===`right`?this.text(e.text,e.x+e.width-o,e.y+o,{align:`right`,baseline:`top`}):e.align===`center`?this.text(e.text,e.x+e.width/2,e.y+o,{align:`center`,baseline:`top`,maxWidth:e.width-o-o}):this.text(e.text,e.x+o,e.y+o,{align:`left`,baseline:`top`,maxWidth:e.width-o-o})),this.internal.__cell__.lastCell=e,this};e.table=function(e,n,c,l,u){if(r.call(this),!c)throw Error(`No data for PDF table.`);var d,f,p,m,h=[],g=[],_=[],v={},y={},b=[],x=[],S=(u=u||{}).autoSize||!1,C=!1!==u.printHeaders,w=u.css&&u.css[`font-size`]!==void 0?16*u.css[`font-size`]:u.fontSize||12,T=u.margins||Object.assign({width:this.getPageWidth()},t),E=typeof u.padding==`number`?u.padding:3,D=u.headerBackgroundColor||`#c8c8c8`,O=u.headerTextColor||`#000`;if(i.call(this),this.internal.__cell__.printHeaders=C,this.internal.__cell__.margins=T,this.internal.__cell__.table_font_size=w,this.internal.__cell__.padding=E,this.internal.__cell__.headerBackgroundColor=D,this.internal.__cell__.headerTextColor=O,this.setFontSize(w),l==null)g=h=Object.keys(c[0]),_=h.map(function(){return`left`});else if(Array.isArray(l)&&vn(l[0])===`object`)for(h=l.map(function(e){return e.name}),g=l.map(function(e){return e.prompt||e.name||``}),_=l.map(function(e){return e.align||`left`}),d=0;d0&&this.setTableHeaderRow(c),this.setFont(void 0,`normal`),n=!1}}(cv.API),jy={italic:[`italic`,`oblique`,`normal`],oblique:[`oblique`,`italic`,`normal`],normal:[`normal`,`oblique`,`italic`]},My=[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`],Ny=lv(My),Py=[100,200,300,400,500,600,700,800,900],Fy=lv(Py),Iy={"sans-serif":`helvetica`,fixed:`courier`,monospace:`courier`,terminal:`courier`,cursive:`times`,fantasy:`times`,serif:`times`},Ly={caption:`times`,icon:`times`,menu:`times`,"message-box":`times`,"small-caption":`times`,"status-bar":`times`},Uy=[`times`],(function(e){var t,n,r,i,a,o,s,c,l,u=function(e){return e=e||{},this.isStrokeTransparent=e.isStrokeTransparent||!1,this.strokeOpacity=e.strokeOpacity||1,this.strokeStyle=e.strokeStyle||`#000000`,this.fillStyle=e.fillStyle||`#000000`,this.isFillTransparent=e.isFillTransparent||!1,this.fillOpacity=e.fillOpacity||1,this.font=e.font||`10px sans-serif`,this.textBaseline=e.textBaseline||`alphabetic`,this.textAlign=e.textAlign||`left`,this.lineWidth=e.lineWidth||1,this.lineJoin=e.lineJoin||`miter`,this.lineCap=e.lineCap||`butt`,this.path=e.path||[],this.transform=e.transform===void 0?new c:e.transform.clone(),this.globalCompositeOperation=e.globalCompositeOperation||`normal`,this.globalAlpha=e.globalAlpha||1,this.clip_path=e.clip_path||[],this.currentPoint=e.currentPoint||new o,this.miterLimit=e.miterLimit||10,this.lastPoint=e.lastPoint||new o,this.lineDashOffset=e.lineDashOffset||0,this.lineDash=e.lineDash||[],this.margin=e.margin||[0,0,0,0],this.prevPageLastElemOffset=e.prevPageLastElemOffset||0,this.ignoreClearRect=typeof e.ignoreClearRect!=`boolean`||e.ignoreClearRect,this};e.events.push([`initialized`,function(){this.context2d=new d(this),t=this.internal.f2,n=this.internal.getCoordinateString,r=this.internal.getVerticalCoordinateString,i=this.internal.getHorizontalCoordinate,a=this.internal.getVerticalCoordinate,o=this.internal.Point,s=this.internal.Rectangle,c=this.internal.Matrix,l=new u}]);var d=function(e){Object.defineProperty(this,"canvas",{get:function(){return{parentNode:!1,style:!1}}});var t=e;Object.defineProperty(this,"pdf",{get:function(){return t}});var n=!1;Object.defineProperty(this,"pageWrapXEnabled",{get:function(){return n},set:function(e){n=!!e}});var r=!1;Object.defineProperty(this,"pageWrapYEnabled",{get:function(){return r},set:function(e){r=!!e}});var i=0;Object.defineProperty(this,"posX",{get:function(){return i},set:function(e){isNaN(e)||(i=e)}});var a=0;Object.defineProperty(this,"posY",{get:function(){return a},set:function(e){isNaN(e)||(a=e)}}),Object.defineProperty(this,"margin",{get:function(){return l.margin},set:function(e){var t;typeof e==`number`?t=[e,e,e,e]:((t=[,,,,])[0]=e[0],t[1]=e.length>=2?e[1]:t[0],t[2]=e.length>=3?e[2]:t[0],t[3]=e.length>=4?e[3]:t[1]),l.margin=t}});var o=!1;Object.defineProperty(this,"autoPaging",{get:function(){return o},set:function(e){o=e}});var s=0;Object.defineProperty(this,"lastBreak",{get:function(){return s},set:function(e){s=e}});var c=[];Object.defineProperty(this,"pageBreaks",{get:function(){return c},set:function(e){c=e}}),Object.defineProperty(this,"ctx",{get:function(){return l},set:function(e){e instanceof u&&(l=e)}}),Object.defineProperty(this,"path",{get:function(){return l.path},set:function(e){l.path=e}});var d=[];Object.defineProperty(this,"ctxStack",{get:function(){return d},set:function(e){d=e}}),Object.defineProperty(this,"fillStyle",{get:function(){return this.ctx.fillStyle},set:function(e){var t=f(e);this.ctx.fillStyle=t.style,this.ctx.isFillTransparent=t.a===0,this.ctx.fillOpacity=t.a,this.pdf.setFillColor(t.r,t.g,t.b,{a:t.a}),this.pdf.setTextColor(t.r,t.g,t.b,{a:t.a})}}),Object.defineProperty(this,"strokeStyle",{get:function(){return this.ctx.strokeStyle},set:function(e){var t=f(e);this.ctx.strokeStyle=t.style,this.ctx.isStrokeTransparent=t.a===0,this.ctx.strokeOpacity=t.a,t.a===0?this.pdf.setDrawColor(255,255,255):(t.a,this.pdf.setDrawColor(t.r,t.g,t.b))}}),Object.defineProperty(this,"lineCap",{get:function(){return this.ctx.lineCap},set:function(e){[`butt`,`round`,`square`].indexOf(e)!==-1&&(this.ctx.lineCap=e,this.pdf.setLineCap(e))}}),Object.defineProperty(this,"lineWidth",{get:function(){return this.ctx.lineWidth},set:function(e){isNaN(e)||(this.ctx.lineWidth=e,this.pdf.setLineWidth(e))}}),Object.defineProperty(this,"lineJoin",{get:function(){return this.ctx.lineJoin},set:function(e){[`bevel`,`round`,`miter`].indexOf(e)!==-1&&(this.ctx.lineJoin=e,this.pdf.setLineJoin(e))}}),Object.defineProperty(this,"miterLimit",{get:function(){return this.ctx.miterLimit},set:function(e){isNaN(e)||(this.ctx.miterLimit=e,this.pdf.setMiterLimit(e))}}),Object.defineProperty(this,"textBaseline",{get:function(){return this.ctx.textBaseline},set:function(e){this.ctx.textBaseline=e}}),Object.defineProperty(this,"textAlign",{get:function(){return this.ctx.textAlign},set:function(e){[`right`,`end`,`center`,`left`,`start`].indexOf(e)!==-1&&(this.ctx.textAlign=e)}});var p=null,m=null,h=null;Object.defineProperty(this,"fontFaces",{get:function(){return h},set:function(e){p=null,m=null,h=e}}),Object.defineProperty(this,"font",{get:function(){return this.ctx.font},set:function(e){var t;if(this.ctx.font=e,(t=/^\s*(?=(?:(?:[-a-z]+\s*){0,2}(italic|oblique))?)(?=(?:(?:[-a-z]+\s*){0,2}(small-caps))?)(?=(?:(?:[-a-z]+\s*){0,2}(bold(?:er)?|lighter|[1-9]00))?)(?:(?:normal|\1|\2|\3)\s*){0,3}((?:xx?-)?(?:small|large)|medium|smaller|larger|[.\d]+(?:\%|in|[cem]m|ex|p[ctx]))(?:\s*\/\s*(normal|[.\d]+(?:\%|in|[cem]m|ex|p[ctx])))?\s*([-_,\"\'\sa-z0-9]+?)\s*$/i.exec(e))!==null){var n=t[1];t[2];var r=t[3],i=t[4];t[5];var a=t[6],o=/^([.\d]+)((?:%|in|[cem]m|ex|p[ctx]))$/i.exec(i)[2];i=Math.floor(o===`px`?parseFloat(i)*this.pdf.internal.scaleFactor:o===`em`?parseFloat(i)*this.pdf.getFontSize():parseFloat(i)*this.pdf.internal.scaleFactor),this.pdf.setFontSize(i);var s=function(e){var t,n,r=[],i=e.trim();if(i===``)return Uy;if(i in Ly)return[Ly[i]];for(;i!==``;){switch(n=null,t=(i=pv(i)).charAt(0)){case`"`:case`'`:n=mv(i.substring(1),t);break;default:n=hv(i)}if(n===null||(r.push(n[0]),(i=pv(n[1]))!==``&&i.charAt(0)!==`,`))return Uy;i=i.replace(/^,/,``)}return r}(a);if(this.fontFaces){var c=function(e,t,n){for(var r=(n=n||{}).defaultFontFamily||`times`,i=Object.assign({},Iy,n.genericFontFamilies||{}),a=null,o=null,s=0;s=700||n===`bold`)&&(l=`bold`),n===`italic`&&(l+=`italic`),l.length===0&&(l=`normal`);for(var u=``,d={arial:`Helvetica`,Arial:`Helvetica`,verdana:`Helvetica`,Verdana:`Helvetica`,helvetica:`Helvetica`,Helvetica:`Helvetica`,"sans-serif":`Helvetica`,fixed:`Courier`,monospace:`Courier`,terminal:`Courier`,cursive:`Times`,fantasy:`Times`,serif:`Times`},f=0;f=2*Math.PI&&(r=0,i=2*Math.PI),this.path.push({type:`arc`,x:e,y:t,radius:n,startAngle:r,endAngle:i,counterclockwise:a})},d.prototype.arcTo=function(e,t,n,r,i){throw Error(`arcTo not implemented.`)},d.prototype.rect=function(e,t,n,r){if(isNaN(e)||isNaN(t)||isNaN(n)||isNaN(r))throw Fv.error(`jsPDF.context2d.rect: Invalid arguments`,arguments),Error(`Invalid arguments passed to jsPDF.context2d.rect`);this.moveTo(e,t),this.lineTo(e+n,t),this.lineTo(e+n,t+r),this.lineTo(e,t+r),this.lineTo(e,t),this.lineTo(e+n,t),this.lineTo(e,t)},d.prototype.fillRect=function(e,t,n,r){if(isNaN(e)||isNaN(t)||isNaN(n)||isNaN(r))throw Fv.error(`jsPDF.context2d.fillRect: Invalid arguments`,arguments),Error(`Invalid arguments passed to jsPDF.context2d.fillRect`);if(!p.call(this)){var i={};this.lineCap!==`butt`&&(i.lineCap=this.lineCap,this.lineCap=`butt`),this.lineJoin!==`miter`&&(i.lineJoin=this.lineJoin,this.lineJoin=`miter`),this.beginPath(),this.rect(e,t,n,r),this.fill(),i.hasOwnProperty(`lineCap`)&&(this.lineCap=i.lineCap),i.hasOwnProperty(`lineJoin`)&&(this.lineJoin=i.lineJoin)}},d.prototype.strokeRect=function(e,t,n,r){if(isNaN(e)||isNaN(t)||isNaN(n)||isNaN(r))throw Fv.error(`jsPDF.context2d.strokeRect: Invalid arguments`,arguments),Error(`Invalid arguments passed to jsPDF.context2d.strokeRect`);m.call(this)||(this.beginPath(),this.rect(e,t,n,r),this.stroke())},d.prototype.clearRect=function(e,t,n,r){if(isNaN(e)||isNaN(t)||isNaN(n)||isNaN(r))throw Fv.error(`jsPDF.context2d.clearRect: Invalid arguments`,arguments),Error(`Invalid arguments passed to jsPDF.context2d.clearRect`);this.ignoreClearRect||(this.fillStyle=`#ffffff`,this.fillRect(e,t,n,r))},d.prototype.save=function(e){e=typeof e!=`boolean`||e;for(var t=this.pdf.internal.getCurrentPageInfo().pageNumber,n=0;n0||this.margin[1]>0||this.margin[2]>0||this.margin[3]>0};d.prototype.drawImage=function(e,t,n,r,i,a,o,l,u){var d=this.pdf.getImageProperties(e),f=1,p=1,m=1,_=1;r!==void 0&&l!==void 0&&(m=l/r,_=u/i,f=d.width/r*l/r,p=d.height/i*u/i),a===void 0&&(a=t,o=n,t=0,n=0),r!==void 0&&l===void 0&&(l=r,u=i),r===void 0&&l===void 0&&(l=d.width,u=d.height);var b=this.ctx.transform.decompose(),S=P(b.rotate.shx),C=new c,w=(C=(C=(C=C.multiply(b.translate)).multiply(b.skew)).multiply(b.scale)).applyToRectangle(new s(a-t*m,o-n*_,r*f,i*p));if(this.autoPaging){for(var T,E=g.call(this,w),D=[],O=0;Ok||jC||T0)){for(;c>=0;c--)if(!0!==i[c-1].close&&!0!==i[c-1].begin){i[c-1].deltas.push(n),i[c-1].abs.push(s);break}}break;case`bct`:n=[s.x1-a[o-1].x,s.y1-a[o-1].y,s.x2-a[o-1].x,s.y2-a[o-1].y,s.x-a[o-1].x,s.y-a[o-1].y],i[i.length-1].deltas.push(n);break;case`qct`:var l=a[o-1].x+2/3*(s.x1-a[o-1].x),u=a[o-1].y+2/3*(s.y1-a[o-1].y),d=s.x+2/3*(s.x1-s.x),f=s.y+2/3*(s.y1-s.y),h=s.x,g=s.y;n=[l-a[o-1].x,u-a[o-1].y,d-a[o-1].x,f-a[o-1].y,h-a[o-1].x,g-a[o-1].y],i[i.length-1].deltas.push(n);break;case`arc`:i.push({deltas:[],abs:[],arc:!0}),Array.isArray(i[i.length-1].abs)&&i[i.length-1].abs.push(s)}}r=t?null:e===`stroke`?`stroke`:`fill`;for(var _=!1,v=0;v=.01&&(r=this.pdf.internal.getFontSize(),this.pdf.setFontSize(r*e.scale),i=this.lineWidth,this.lineWidth=i*e.scale);var R=this.autoPaging!==`text`;if(R||L.y+L.h<=j){if(R||L.y>=k&&L.x<=N){var z=R?e.text:this.pdf.splitTextToSize(e.text,e.maxWidth||N-L.x)[0],B=v([JSON.parse(JSON.stringify(m))],this.posX+this.margin[3],-F+k+this.ctx.prevPageLastElemOffset)[0],V=R&&(O>E||O=.01&&(this.pdf.setFontSize(r),this.lineWidth=i)}}else e.scale>=.01&&(r=this.pdf.internal.getFontSize(),this.pdf.setFontSize(r*e.scale),i=this.lineWidth,this.lineWidth=i*e.scale),this.pdf.text(e.text,d.x+this.posX,d.y+this.posY,{angle:e.angle,align:t,renderingMode:e.renderingMode,maxWidth:e.maxWidth}),e.scale>=.01&&(this.pdf.setFontSize(r),this.lineWidth=i)},k=function(e,t,i,a){i=i||0,a=a||0,this.pdf.internal.out(n(e+i)+` `+r(t+a)+` l`)},A=function(e,t,n){return this.pdf.lines(e,t,n,null,null)},j=function(e,n,r,o,s,c,l,u){this.pdf.internal.out([t(i(r+e)),t(a(o+n)),t(i(s+e)),t(a(c+n)),t(i(l+e)),t(a(u+n)),`c`].join(` `))},M=function(e,t,n,r){for(var i=2*Math.PI,a=Math.PI/2;t>n;)t-=i;var o=Math.abs(n-t);o1e-5;){var u=l+c*Math.min(o,a);s.push(N.call(this,e,l,u)),o-=Math.abs(u-l),l=u}return s},N=function(e,t,n){var r=(n-t)/2,i=e*Math.cos(r),a=e*Math.sin(r),o=i,s=-a,c=o*o+s*s,l=c+o*i+s*a,u=4/3*(Math.sqrt(2*c*l)-l)/(o*a-s*i),d=o-u*s,f=s+u*o,p=d,m=-f,h=r+t,g=Math.cos(h),_=Math.sin(h);return{x1:e*Math.cos(t),y1:e*Math.sin(t),x2:d*g-f*_,y2:d*_+f*g,x3:p*g-m*_,y3:p*_+m*g,x4:e*Math.cos(n),y4:e*Math.sin(n)}},P=function(e){return 180*e/Math.PI},F=function(e,t,n,r,i,a){var o=e+.5*(n-e),c=t+.5*(r-t),l=i+.5*(n-i),u=a+.5*(r-a),d=Math.min(e,i,o,l),f=Math.max(e,i,o,l),p=Math.min(t,a,c,u),m=Math.max(t,a,c,u);return new s(d,p,f-d,m-p)},I=function(e,t,n,r,i,a,o,c){var l,u,d,f,p,m,h,g,_,v,y,b,x,S,C=n-e,w=r-t,T=i-n,E=a-r,D=o-i,O=c-a;for(u=0;u<41;u++)_=(h=(d=e+(l=u/40)*C)+l*((p=n+l*T)-d))+l*(p+l*(i+l*D-p)-h),v=(g=(f=t+l*w)+l*((m=r+l*E)-f))+l*(m+l*(a+l*O-m)-g),u==0?(y=_,b=v,x=_,S=v):(y=Math.min(y,_),b=Math.min(b,v),x=Math.max(x,_),S=Math.max(S,v));return new s(Math.round(y),Math.round(b),Math.round(x-y),Math.round(S-b))},L=function(){if(this.prevLineDash||this.ctx.lineDash.length||this.ctx.lineDashOffset){var e,t,n=(e=this.ctx.lineDash,t=this.ctx.lineDashOffset,JSON.stringify({lineDash:e,lineDashOffset:t}));this.prevLineDash!==n&&(this.pdf.setLineDash(this.ctx.lineDash,this.ctx.lineDashOffset),this.prevLineDash=n)}}})(cv.API),function(e){var t=function(e){var t,n,r,i,a,o,s,c,l,u;for(/[^\x00-\xFF]/.test(e),n=[],r=0,i=(e+=t=`\0\0\0\0`.slice(e.length%4||4)).length;i>r;r+=4)(a=(e.charCodeAt(r)<<24)+(e.charCodeAt(r+1)<<16)+(e.charCodeAt(r+2)<<8)+e.charCodeAt(r+3))===0?n.push(122):(o=(a=((a=((a=((a=(a-(u=a%85))/85)-(l=a%85))/85)-(c=a%85))/85)-(s=a%85))/85)%85,n.push(o+33,s+33,c+33,l+33,u+33));return function(e,t){for(var n=t;n>0;n--)e.pop()}(n,t.length),String.fromCharCode.apply(String,n)+`~>`},n=function(e){var t,n,r,i,a,o=String,s=`length`,c=255,l=`charCodeAt`,u=`slice`,d=`replace`;for(e[u](-2),e=e[u](0,-2)[d](/\s/g,``)[d](`z`,`!!!!!`),r=[],i=0,a=(e+=t=`uuuuu`[u](e[s]%5||5))[s];a>i;i+=5)n=52200625*(e[l](i)-33)+614125*(e[l](i+1)-33)+7225*(e[l](i+2)-33)+85*(e[l](i+3)-33)+(e[l](i+4)-33),r.push(c&n>>24,c&n>>16,c&n>>8,c&n);return function(e,t){for(var n=t;n>0;n--)e.pop()}(r,t[s]),o.fromCharCode.apply(o,r)},r=function(e){return e.split(``).map(function(e){return(`0`+e.charCodeAt().toString(16)).slice(-2)}).join(``)+`>`},i=function(e){var t=new RegExp(/^([0-9A-Fa-f]{2})+$/);if((e=e.replace(/\s/g,``)).indexOf(`>`)!==-1&&(e=e.substr(0,e.indexOf(`>`))),e.length%2&&(e+=`0`),!1===t.test(e))return``;for(var n=``,r=0;rPromise.resolve().then(()=>u(Zl())),void 0,import.meta.url)).catch(function(e){return Promise.reject(Error(`Could not load html2canvas: `+e))}).then(function(e){return e.default?e.default:e})}function n(){return(Pv.DOMPurify?Promise.resolve(Pv.DOMPurify):gn(()=>Promise.resolve().then(()=>(Ed(),Ql)),void 0,import.meta.url)).catch(function(e){return Promise.reject(Error(`Could not load dompurify: `+e))}).then(function(e){return e.default?e.default:e})}var r=function(e){var t=vn(e);return t===`undefined`?`undefined`:t===`string`||e instanceof String?`string`:t===`number`||e instanceof Number?`number`:t===`function`||e instanceof Function?`function`:e&&e.constructor===Array?`array`:e&&e.nodeType===1?`element`:t===`object`?`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},a=function e(t,n){for(var r=t.nodeType===3?document.createTextNode(t.nodeValue):t.cloneNode(!1),i=t.firstChild;i;i=i.nextSibling)!0!==n&&i.nodeType===1&&i.nodeName===`SCRIPT`||r.appendChild(e(i,n));return t.nodeType===1&&(t.nodeName===`CANVAS`?(r.width=t.width,r.height=t.height,r.getContext(`2d`).drawImage(t,0,0)):t.nodeName!==`TEXTAREA`&&t.nodeName!==`SELECT`||(r.value=t.value),r.addEventListener(`load`,function(){r.scrollTop=t.scrollTop,r.scrollLeft=t.scrollLeft},!0)),r},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 e.nodeName.toLowerCase()===`canvas`?`canvas`:`element`;default:return`unknown`}}(e),t){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:(typeof this.opt.width!=`number`||isNaN(this.opt.width)||typeof this.opt.windowWidth!=`number`||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=a(this.prop.src,this.opt.html2canvas.javascriptEnabled);t.tagName===`BODY`&&(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(){return this.thenList([function(){return document.body.contains(this.prop.container)||this.toContainer()}]).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(){return this.thenList([function(){return document.body.contains(this.prop.container)||this.toContainer()}]).then(t).then(function(e){var t=this.opt.jsPDF,n=this.opt.fontFaces,r=typeof this.opt.width!=`number`||isNaN(this.opt.width)||typeof this.opt.windowWidth!=`number`||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=this.opt.autoPaging===void 0||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 a=0;ac&&(s=l,l=c,c=s);else{if(e!==`l`&&e!==`landscape`)throw`Invalid orientation: `+e;e=`l`,c>l&&(s=l,l=c,c=s)}return{width:l,height:c,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(uv):null;var n=new o(t);return t.worker?n:n.from(e).doCallback()}}(cv.API),cv.API.addJS=function(e){var t,n,r=function(e){for(var t=``,n=0;n=0&&e[a]===`\\`;a--)i++;t+=i%2==0?`\\`+r:r}else t+=r}return t}(e);return this.internal.events.subscribe(`postPutResources`,function(){t=this.internal.newObject(),this.internal.out(`<<`),this.internal.out(`/Names [(EmbeddedJS) `+(t+1)+` 0 R]`),this.internal.out(`>>`),this.internal.out(`endobj`),n=this.internal.newObject(),this.internal.out(`<<`),this.internal.out(`/S /JavaScript`),this.internal.out(`/JS (`+r+`)`),this.internal.out(`>>`),this.internal.out(`endobj`)}),this.internal.events.subscribe(`putCatalog`,function(){t!==void 0&&n!==void 0&&this.internal.out(`/Names <>`)}),this},function(e){var t;e.events.push([`postPutResources`,function(){var e=this,n=/^(\d+) 0 obj$/;if(this.outline.root.children.length>0)for(var r=e.outline.render().split(/\r\n/),i=0;i> endobj`)}var f=e.internal.newObject();for(e.internal.write(`<< /Names [ `),i=0;i>`,`endobj`),t=e.internal.newObject(),e.internal.write(`<< /Dests `+f+` 0 R`),e.internal.write(`>>`,`endobj`)}}]),e.events.push([`putCatalog`,function(){var e=this;e.outline.root.children.length>0&&(e.internal.write(`/Outlines`,this.outline.makeRef(this.outline.root)),this.outline.createNamedDestinations&&e.internal.write(`/Names `+t+` 0 R`))}]),e.events.push([`initialized`,function(){var e=this;e.outline={createNamedDestinations:!1,root:{children:[]}},e.outline.add=function(e,t,n){var r={title:t,options:n,children:[]};return e??(e=this.root),e.children.push(r),r},e.outline.render=function(){return this.ctx={},this.ctx.val=``,this.ctx.pdf=e,this.genIds_r(this.root),this.renderRoot(this.root),this.renderItems(this.root),this.ctx.val},e.outline.genIds_r=function(t){t.id=e.internal.newObjectDeferred();for(var n=0;n0&&(this.line(`/First `+this.makeRef(e.children[0])),this.line(`/Last `+this.makeRef(e.children[e.children.length-1]))),this.line(`/Count `+this.count_r({count:0},e)),this.objEnd()},e.outline.renderItems=function(t){for(var n=this.ctx.pdf.internal.getVerticalCoordinateString,r=0;r0&&this.line(`/Prev `+this.makeRef(t.children[r-1])),r0&&(this.line(`/First `+this.makeRef(i.children[0])),this.line(`/Last `+this.makeRef(i.children[i.children.length-1])));var a=this.count=this.count_r({count:0},i);if(a>0&&this.line(`/Count `+a),i.options&&i.options.pageNumber){var o=e.internal.getPageInfo(i.options.pageNumber);this.line(`/Dest [`+o.objId+` 0 R /XYZ 0 `+n(0)+` 0]`)}this.objEnd()}for(var s=0;s> \r endobj\r `},e.outline.count_r=function(e,t){for(var n=0;n1){o=!0,c=void 0;var v=t*n;l=new Uint8Array(v);for(var y=new DataView(r.buffer),b=0;b536870912)throw Error(`Image dimensions exceed 512MB, which is too large.`);this.data=new Uint8Array(t);try{this[e]()}catch(e){Fv.log(`bit decode error:`+e)}},Av.prototype.bit1=function(){var e,t=Math.ceil(this.width/8),n=t%4;for(e=this.height-1;e>=0;e--){for(var r=this.bottom_up?e:this.height-1-e,i=0;i>7-s&1];this.data[o+4*s]=c.blue,this.data[o+4*s+1]=c.green,this.data[o+4*s+2]=c.red,this.data[o+4*s+3]=255}n!==0&&(this.pos+=4-n)}},Av.prototype.bit4=function(){for(var e=Math.ceil(this.width/2),t=e%4,n=this.height-1;n>=0;n--){for(var r=this.bottom_up?n:this.height-1-n,i=0;i>4,c=15&a,l=this.palette[s];if(this.data[o]=l.blue,this.data[o+1]=l.green,this.data[o+2]=l.red,this.data[o+3]=255,2*i+1>=this.width)break;l=this.palette[c],this.data[o+4]=l.blue,this.data[o+4+1]=l.green,this.data[o+4+2]=l.red,this.data[o+4+3]=255}t!==0&&(this.pos+=4-t)}},Av.prototype.bit8=function(){for(var e=this.width%4,t=this.height-1;t>=0;t--){for(var n=this.bottom_up?t:this.height-1-t,r=0;r=0;n--){for(var r=this.bottom_up?n:this.height-1-n,i=0;i>5&t)/t*255|0,c=(a>>10&t)/t*255|0,l=a>>15?255:0,u=r*this.width*4+4*i;this.data[u]=c,this.data[u+1]=s,this.data[u+2]=o,this.data[u+3]=l}this.pos+=e}},Av.prototype.bit16=function(){for(var e=this.width%3,t=31,n=63,r=this.height-1;r>=0;r--){for(var i=this.bottom_up?r:this.height-1-r,a=0;a>5&n)/n*255|0,l=(o>>11)/t*255|0,u=i*this.width*4+4*a;this.data[u]=l,this.data[u+1]=c,this.data[u+2]=s,this.data[u+3]=255}this.pos+=e}},Av.prototype.bit24=function(){for(var e=this.height-1;e>=0;e--){for(var t=this.bottom_up?e:this.height-1-e,n=0;n=0;e--)for(var t=this.bottom_up?e:this.height-1-e,n=0;nr&&(i.push(e.slice(c,a)),s=0,c=a),s+=t[a],a++;return c!==a&&i.push(e.slice(c,a)),i},Hy=function(e,t,n){n||(n={});var r,i,a,o,s,c,l,u=[],d=[u],f=n.textIndent||0,p=0,m=0,h=e.split(` `),g=zy.apply(this,[` `,n])[0];if(c=n.lineIndent===-1?h[0].length+2:n.lineIndent||0){var _=Array(c).join(` `),v=[];h.map(function(e){(e=e.split(/\s*\n/)).length>1?v=v.concat(e.map(function(e,t){return(t&&e.length?` `:``)+e})):v.push(e[0])}),h=v,c=By.apply(this,[_,n])}for(a=0,o=h.length;at||y){if(m>t){for(s=Vy.apply(this,[r,i,t-(f+p),t]),u.push(s.shift()),u=[s.pop()];s.length;)d.push([s.shift()]);m=i.slice(r.length-(u[0]?u[0].length:0)).reduce(function(e,t){return e+t},0)}else u=[r];d.push(u),f=m+c,p=g}else u.push(r),f+=p+m,p=g}return l=c?function(e,t){return(t?_:``)+e.join(` `)}:function(e){return e.join(` `)},d.map(l)},Ry.splitTextToSize=function(e,t,n){var r,i=(n=n||{}).fontSize||this.internal.getFontSize(),a=function(e){if(e.widths&&e.kerning)return{widths:e.widths,kerning:e.kerning};var t=this.internal.getFont(e.fontName,e.fontStyle),n=`Unicode`;return t.metadata[n]?{widths:t.metadata[n].widths||{0:1},kerning:t.metadata[n].kerning||{}}:{font:t.metadata,fontSize:this.internal.getFontSize(),charSpace:this.internal.getCharSpace()}}.call(this,n);r=Array.isArray(e)?e:String(e).split(/\r?\n/);var o=1*this.internal.scaleFactor*t/i;a.textIndent=n.textIndent?1*n.textIndent*this.internal.scaleFactor/i:0,a.lineIndent=n.lineIndent;var s,c,l=[];for(s=0,c=r.length;sPromise.resolve().then(()=>(F_(),_h)),void 0,import.meta.url)).catch(function(e){return Promise.reject(Error(`Could not load canvg: `+e))}).then(function(e){return e.default?e.default:e}).then(function(t){return t.fromString(l,e,u)},function(){return Promise.reject(Error(`Could not load canvg.`))}).then(function(e){return e.render(u)}).then(function(){d.addImage(c.toDataURL(`image/jpeg`,1),t,n,r,i,o,s)})},cv.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;i1){for(u=0;u>`)}),this.internal.viewerpreferences.isSubscribed=!0),this.internal.viewerpreferences.configuration=n,this},cv.API.addMetadata=function(e,t){return this.internal.__metadata__===void 0&&(this.internal.__metadata__={metadata:e,namespaceUri:t??`http://jspdf.default.namespaceuri/`,rawXml:typeof t==`boolean`&&t},this.internal.events.subscribe(`putCatalog`,Nv),this.internal.events.subscribe(`postPutResources`,Mv)),this},function(e){var t=e.API,n=t.pdfEscape16=function(e,t){for(var n,r=t.metadata.Unicode.widths,i=[``,`0`,`00`,`000`,`0000`],a=[``],o=0,s=e.length;o> def /CMapName /Adobe-Identity-UCS def /CMapType 2 def 1 begincodespacerange <0000> endcodespacerange`,o,s;for(r=[],o=0,s=(n=Object.keys(e).sort(function(e,t){return e-t})).length;o=100&&(a+=` `+r.length+` beginbfchar `+r.join(` `)+` endbfchar`,r=[]),e[t]!==void 0&&e[t]!==null&&typeof e[t].toString==`function`&&(i=(`0000`+e[t].toString(16)).slice(-4),t=(`0000`+(+t).toString(16)).slice(-4),r.push(`<`+t+`><`+i+`>`));return r.length&&(a+=` `+r.length+` beginbfchar `+r.join(` `)+` endbfchar `),a+`endcmap CMapName currentdict /CMap defineresource pop end end`};t.events.push([`putFont`,function(t){(function(t){var n=t.font,i=t.out,a=t.newObject,o=t.putStream;if(n.metadata instanceof e.API.TTFFont&&n.encoding===`Identity-H`){for(var s=n.metadata.Unicode.widths,c=n.metadata.subset.encode(n.metadata.glyIdsUsed,1),l=``,u=0;u>`),i(`endobj`);var m=a();i(`<<`),i(`/Type /Font`),i(`/BaseFont /`+nv(n.fontName)),i(`/FontDescriptor `+p+` 0 R`),i(`/W `+e.API.PDFObject.convert(s)),i(`/CIDToGIDMap /Identity`),i(`/DW 1000`),i(`/Subtype /CIDFontType2`),i(`/CIDSystemInfo`),i(`<<`),i(`/Supplement 0`),i(`/Registry (Adobe)`),i(`/Ordering (`+n.encoding+`)`),i(`>>`),i(`>>`),i(`endobj`),n.objectNumber=a(),i(`<<`),i(`/Type /Font`),i(`/Subtype /Type0`),i(`/ToUnicode `+f+` 0 R`),i(`/BaseFont /`+nv(n.fontName)),i(`/Encoding /`+n.encoding),i(`/DescendantFonts [`+m+` 0 R]`),i(`>>`),i(`endobj`),n.isAlreadyPutted=!0}})(t)}]),t.events.push([`putFont`,function(t){(function(t){var n=t.font,i=t.out,a=t.newObject,o=t.putStream;if(n.metadata instanceof e.API.TTFFont&&n.encoding===`WinAnsiEncoding`){for(var s=n.metadata.rawData,c=``,l=0;l>`),i(`endobj`),n.objectNumber=a();for(var p=0;p>`),i(`endobj`),n.isAlreadyPutted=!0}})(t)}]);var i=function(e){var t,r=e.text||``,i=e.x,a=e.y,o=e.options||{},s=e.mutex||{},c=s.pdfEscape,l=s.activeFontKey,u=s.fonts,d=l,f=``,p=0,m=``,h=u[d].encoding;if(u[d].encoding!==`Identity-H`)return{text:r,x:i,y:a,options:o,mutex:s};for(m=r,d=l,Array.isArray(r)&&(m=r[0]),p=0;p.<.[.].[.{.}.{.«.».«.‹.›.‹.⁅.⁆.⁅.⁽.⁾.⁽.₍.₎.₍.≤.≥.≤.〈.〉.〈.﹙.﹚.﹙.﹛.﹜.﹛.﹝.﹞.﹝.﹤.﹥.﹤`.split(`.`),h=new RegExp(/^([1-4|9]|1[0-9]|2[0-9]|3[0168]|4[04589]|5[012]|7[78]|159|16[0-9]|17[0-2]|21[569]|22[03489]|250)$/),g=!1,_=0;this.__bidiEngine__={};var v=function(e){var t=e.charCodeAt(),n=t>>8,r=p[n];return r===void 0?n===252||n===253?`AL`:h.test(n)?`L`:n===8?`R`:`N`:l[256*r+(255&t)]},y=function(e){for(var t,n=0;n=t.length||(c=o[s-1])!==`EN`&&c!==`AN`||(l=t[s+1])!==`EN`&&l!==`AN`?f=`N`:g&&(l=`AN`),f=l===c?l:`N`;break;case`ES`:f=(c=s>0?o[s-1]:`B`)===`EN`&&s+10&&o[s-1]===`EN`){f=`EN`;break}if(g){f=`N`;break}for(u=s+1,d=t.length;u=1425&&p<=2303||p===64286;if(c=t[u],m&&(c===`R`||c===`AL`)){f=`R`;break}}}f=s<1||(c=t[s-1])===`B`?`N`:o[s-1];break;case`B`:g=!1,n=!0,f=_;break;case`S`:r=!0,f=`N`}return f},x=function(e,t,n){var r=e.split(``);return n&&S(r,n,{hiLevel:_}),r.reverse(),t&&t.reverse(),r.join(``)},S=function(e,t,i){var a,o,s,c,l,p=-1,m=e.length,h=0,y=[],x=_?d:u,S=[];for(g=!1,n=!1,r=!1,o=0;o0){if(a===16){for(o=p;o-1){for(o=p;o=0&&e[i]===`WS`;i--)t[i]=_}}(S,t,m)},C=function(e,t,r,i,a){if(!(a.hiLevel=e){for(c=d+1;c=e;)c++;for(l=d,s=c-1;l=0&&(e[i]=m[r+1])}(r,n,i),C(2,r,t,n,i),C(1,r,t,n,i),r.join(``)};return this.__bidiEngine__.doBidiReorder=function(e,t,n){if(function(e,t){if(t)for(var n=0;n>16)&&(t=-(1+(65535^t))),this.italicAngle=+(t+`.`+n)):this.italicAngle=0,this.ascender=Math.round(this.ascender*this.scaleFactor),this.decender=Math.round(this.decender*this.scaleFactor),this.lineGap=Math.round(this.lineGap*this.scaleFactor),this.capHeight=this.os2.exists&&this.os2.capHeight||this.ascender,this.xHeight=this.os2.exists&&this.os2.xHeight||0,this.familyClass=(this.os2.exists&&this.os2.familyClass||0)>>8,this.isSerif=(i=this.familyClass)===1||i===2||i===3||i===4||i===5||i===7,this.isScript=this.familyClass===10,this.flags=0,this.post.isFixedPitch&&(this.flags|=1),this.isSerif&&(this.flags|=2),this.isScript&&(this.flags|=8),this.italicAngle!==0&&(this.flags|=64),this.flags|=32,!this.cmap.unicode)throw Error(`No unicode cmap for font`)},e.prototype.characterToGlyph=function(e){return this.cmap.unicode?.codeMap[e]||0},e.prototype.widthOfGlyph=function(e){var t=1e3/this.head.unitsPerEm;return this.hmtx.forGlyph(e).advance*t},e.prototype.widthOfString=function(e,t,n){var r,i,a=0,o;for(i=0,o=(e=``+e).length;0<=o?io;i=0<=o?++i:--i)r=e.charCodeAt(i),a+=this.widthOfGlyph(this.characterToGlyph(r))+1e3/t*n||0;return t/1e3*a},e.prototype.lineHeight=function(e,t){var n;return t??(t=!1),n=t?this.lineGap:0,(this.ascender+n-this.decender)/1e3*e},e}(),Gy=function(){function e(e){this.data=e??[],this.pos=0,this.length=this.data.length}return e.prototype.readByte=function(){return this.data[this.pos++]},e.prototype.writeByte=function(e){return this.data[this.pos++]=e},e.prototype.readUInt32=function(){return 16777216*this.readByte()+(this.readByte()<<16)+(this.readByte()<<8)+this.readByte()},e.prototype.writeUInt32=function(e){return this.writeByte(e>>>24&255),this.writeByte(e>>16&255),this.writeByte(e>>8&255),this.writeByte(255&e)},e.prototype.readInt32=function(){var e;return(e=this.readUInt32())>=2147483648?e-4294967296:e},e.prototype.writeInt32=function(e){return e<0&&(e+=4294967296),this.writeUInt32(e)},e.prototype.readUInt16=function(){return this.readByte()<<8|this.readByte()},e.prototype.writeUInt16=function(e){return this.writeByte(e>>8&255),this.writeByte(255&e)},e.prototype.readInt16=function(){var e;return(e=this.readUInt16())>=32768?e-65536:e},e.prototype.writeInt16=function(e){return e<0&&(e+=65536),this.writeUInt16(e)},e.prototype.readString=function(e){var t,n=[];for(t=0;0<=e?te;t=0<=e?++t:--t)n[t]=String.fromCharCode(this.readByte());return n.join(``)},e.prototype.writeString=function(e){var t,n,r=[];for(t=0,n=e.length;0<=n?tn;t=0<=n?++t:--t)r.push(this.writeByte(e.charCodeAt(t)));return r},e.prototype.readShort=function(){return this.readInt16()},e.prototype.writeShort=function(e){return this.writeInt16(e)},e.prototype.readLongLong=function(){var e=this.readByte(),t=this.readByte(),n=this.readByte(),r=this.readByte(),i=this.readByte(),a=this.readByte(),o=this.readByte(),s=this.readByte();return 128&e?-1*(72057594037927940*(255^e)+281474976710656*(255^t)+1099511627776*(255^n)+4294967296*(255^r)+16777216*(255^i)+65536*(255^a)+256*(255^o)+(255^s)+1):72057594037927940*e+281474976710656*t+1099511627776*n+4294967296*r+16777216*i+65536*a+256*o+s},e.prototype.writeLongLong=function(e){var t=Math.floor(e/4294967296),n=4294967295&e;return this.writeByte(t>>24&255),this.writeByte(t>>16&255),this.writeByte(t>>8&255),this.writeByte(255&t),this.writeByte(n>>24&255),this.writeByte(n>>16&255),this.writeByte(n>>8&255),this.writeByte(255&n)},e.prototype.readInt=function(){return this.readInt32()},e.prototype.writeInt=function(e){return this.writeInt32(e)},e.prototype.read=function(e){for(var t=[],n=0;0<=e?ne;n=0<=e?++n:--n)t.push(this.readByte());return t},e.prototype.write=function(e){var t,n,r,i=[];for(n=0,r=e.length;nr;n=0<=r?++n:--n)t={tag:e.readString(4),checksum:e.readInt(),offset:e.readInt(),length:e.readInt()},this.tables[t.tag]=t}return t.prototype.encode=function(t){var n,r,i,a,o,s,c,l,u,d,f=Object.keys(t).length,p,m;for(m in s=Math.log(2),u=16*Math.floor(Math.log(f)/s),a=Math.floor(u/s),l=16*f-u,(r=new Gy).writeInt(this.scalarType),r.writeShort(f),r.writeShort(u),r.writeShort(a),r.writeShort(l),i=16*f,c=r.pos+i,o=null,p=[],t)for(d=t[m],r.writeString(m),r.writeInt(e(d)),r.writeInt(c),r.writeInt(d.length),p=p.concat(d),m===`head`&&(o=c),c+=d.length;c%4;)p.push(0),c++;return r.write(p),n=2981146554-e(r.data),r.pos=o+8,r.writeUInt32(n),r.data},e=function(e){var t,n,r,i;for(e=ab.call(e);e.length%4;)e.push(0);for(r=new Gy(e),n=0,t=0,i=e.length;td;s=0<=d?++t:--t)n.push(e.readUInt16());return n}(),e.pos+=2,m=function(){var t,n=[];for(s=t=0;0<=d?td;s=0<=d?++t:--t)n.push(e.readUInt16());return n}(),c=function(){var t,n=[];for(s=t=0;0<=d?td;s=0<=d?++t:--t)n.push(e.readUInt16());return n}(),l=function(){var t,n=[];for(s=t=0;0<=d?td;s=0<=d?++t:--t)n.push(e.readUInt16());return n}(),r=(this.length-e.pos+this.offset)/2,o=function(){var t,n=[];for(s=t=0;0<=r?tr;s=0<=r?++t:--t)n.push(e.readUInt16());return n}(),s=g=0,v=i.length;g=h;n=p<=h?++_:--_)l[s]===0?a=n+c[s]:(a=o[l[s]/2+(n-p)-(d-s)]||0)!==0&&(a+=c[s]),this.codeMap[n]=65535&a}e.pos=u}return e.encode=function(e,t){var n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D,O,k=new Gy,A,j,M,N,P,F,I,L,R,z,B,V,H,ee,U,W,te,G;switch(a=Object.keys(e).sort(function(e,t){return e-t}),t){case`macroman`:for(m=0,h=function(){var e=[];for(p=0;p<256;++p)e.push(0);return e}(),_={0:0},i={},A=0,P=a.length;A=32768)for(s.push(0),x.push(2*(f.length+w-p)),r=N=E;E<=l?N<=l:N>=l;r=E<=l?++N:--N)f.push(n[r].new);else s.push(O-E),x.push(0)}for(k.writeUInt16(3),k.writeUInt16(1),k.writeUInt32(12),k.writeUInt16(4),k.writeUInt16(16+8*w+2*f.length),k.writeUInt16(0),k.writeUInt16(T),k.writeUInt16(C),k.writeUInt16(d),k.writeUInt16(S),H=0,L=u.length;Hr;n=0<=r?++n:--n)t=new Xy(e,this.offset),this.tables.push(t),t.isUnicode&&this.unicode==null&&(this.unicode=t);return!0},e.encode=function(e,t){var n,r;return t??(t=`macroman`),n=Xy.encode(e,t),(r=new Gy).writeUInt16(0),r.writeUInt16(1),n.table=r.data.concat(n.subtable),n},e}(),Qy=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return Jy(e,Wy),e.prototype.tag=`hhea`,e.prototype.parse=function(e){return e.pos=this.offset,this.version=e.readInt(),this.ascender=e.readShort(),this.decender=e.readShort(),this.lineGap=e.readShort(),this.advanceWidthMax=e.readShort(),this.minLeftSideBearing=e.readShort(),this.minRightSideBearing=e.readShort(),this.xMaxExtent=e.readShort(),this.caretSlopeRise=e.readShort(),this.caretSlopeRun=e.readShort(),this.caretOffset=e.readShort(),e.pos+=8,this.metricDataFormat=e.readShort(),this.numberOfMetrics=e.readUInt16()},e}(),$y=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return Jy(e,Wy),e.prototype.tag=`OS/2`,e.prototype.parse=function(e){if(e.pos=this.offset,this.version=e.readUInt16(),this.averageCharWidth=e.readShort(),this.weightClass=e.readUInt16(),this.widthClass=e.readUInt16(),this.type=e.readShort(),this.ySubscriptXSize=e.readShort(),this.ySubscriptYSize=e.readShort(),this.ySubscriptXOffset=e.readShort(),this.ySubscriptYOffset=e.readShort(),this.ySuperscriptXSize=e.readShort(),this.ySuperscriptYSize=e.readShort(),this.ySuperscriptXOffset=e.readShort(),this.ySuperscriptYOffset=e.readShort(),this.yStrikeoutSize=e.readShort(),this.yStrikeoutPosition=e.readShort(),this.familyClass=e.readShort(),this.panose=function(){var t,n=[];for(t=0;t<10;++t)n.push(e.readByte());return n}(),this.charRange=function(){var t,n=[];for(t=0;t<4;++t)n.push(e.readInt());return n}(),this.vendorID=e.readString(4),this.selection=e.readShort(),this.firstCharIndex=e.readShort(),this.lastCharIndex=e.readShort(),this.version>0&&(this.ascent=e.readShort(),this.descent=e.readShort(),this.lineGap=e.readShort(),this.winAscent=e.readShort(),this.winDescent=e.readShort(),this.codePageRange=function(){var t,n=[];for(t=0;t<2;t=++t)n.push(e.readInt());return n}(),this.version>1))return this.xHeight=e.readShort(),this.capHeight=e.readShort(),this.defaultChar=e.readShort(),this.breakChar=e.readShort(),this.maxContext=e.readShort()},e}(),eb=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return Jy(e,Wy),e.prototype.tag=`post`,e.prototype.parse=function(e){var t,n,r;switch(e.pos=this.offset,this.format=e.readInt(),this.italicAngle=e.readInt(),this.underlinePosition=e.readShort(),this.underlineThickness=e.readShort(),this.isFixedPitch=e.readInt(),this.minMemType42=e.readInt(),this.maxMemType42=e.readInt(),this.minMemType1=e.readInt(),this.maxMemType1=e.readInt(),this.format){case 65536:case 196608:break;case 131072:var i;for(n=e.readUInt16(),this.glyphNameIndex=[],i=0;0<=n?in;i=0<=n?++i:--i)this.glyphNameIndex.push(e.readUInt16());for(this.names=[],r=[];e.posn;i=0<=n?++t:--t)r.push(e.readUInt32());return r}.call(this)}},e}(),tb=function(e,t){this.raw=e,this.length=e.length,this.platformID=t.platformID,this.encodingID=t.encodingID,this.languageID=t.languageID},nb=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return Jy(e,Wy),e.prototype.tag=`name`,e.prototype.parse=function(e){var t,n,r,i,a,o,s,c,l,u,d;for(e.pos=this.offset,e.readShort(),t=e.readShort(),o=e.readShort(),n=[],i=0;0<=t?it;i=0<=t?++i:--i)n.push({platformID:e.readShort(),encodingID:e.readShort(),languageID:e.readShort(),nameID:e.readShort(),length:e.readShort(),offset:this.offset+o+e.readShort()});for(s={},i=l=0,u=n.length;lo;t=0<=o?++t:--t)this.metrics.push({advance:e.readUInt16(),lsb:e.readInt16()});for(r=this.file.maxp.numGlyphs-this.file.hhea.numberOfMetrics,this.leftSideBearings=function(){var n,i=[];for(t=n=0;0<=r?nr;t=0<=r?++n:--n)i.push(e.readInt16());return i}(),this.widths=function(){var e,t,n,r=[];for(e=0,t=(n=this.metrics).length;er;t=0<=r?++a:--a)s.push(this.widths.push(n));return s},e.prototype.forGlyph=function(e){return e in this.metrics?this.metrics[e]:{advance:this.metrics[this.metrics.length-1].advance,lsb:this.leftSideBearings[e-this.metrics.length]}},e}(),ab=[].slice,ob=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return Jy(e,Wy),e.prototype.tag=`glyf`,e.prototype.parse=function(){return this.cache={}},e.prototype.glyphFor=function(e){var t,n,r,i,a,o,s,c,l,u;return e in this.cache?this.cache[e]:(i=this.file.loca,t=this.file.contents,n=i.indexOf(e),(r=i.lengthOf(e))===0?this.cache[e]=null:(t.pos=this.offset+n,a=(o=new Gy(t.read(r))).readShort(),c=o.readShort(),u=o.readShort(),s=o.readShort(),l=o.readShort(),this.cache[e]=a===-1?new cb(o,c,u,s,l):new sb(o,a,c,u,s,l),this.cache[e]))},e.prototype.encode=function(e,t,n){var r,i,a=[],o,s;for(i=[],o=0,s=t.length;o0&&(r+=s)}for(var c=Array(4*n.length),l=0;l>8,c[4*l+1]=(16711680&n[l])>>16,c[4*l]=(4278190080&n[l])>>24;return c},e}(),ub=function(){function e(e){this.font=e,this.subset={},this.unicodes={},this.next=33}return e.prototype.generateCmap=function(){var e,t,n,r=this.font.cmap.tables[0].codeMap,i;for(t in e={},i=this.subset)n=i[t],e[t]=r[n];return e},e.prototype.glyphsFor=function(e){for(var t,n,r={},i,a=0,o=e.length,s;a0)for(i in s=this.glyphsFor(t))n=s[i],r[i]=n;return r},e.prototype.encode=function(e,t){var n=Zy.encode(this.generateCmap(),`unicode`),r,i,a=this.glyphsFor(e),o,s,c,l,u,d,f={0:0},p,m,h,g;for(r in g=n.charMap)f[(s=g[r]).old]=s.new;for(p in d=n.maxGlyphID,a)p in f||(f[p]=d++);return l=function(e){var t,n={};for(t in e)n[e[t]]=t;return n}(f),u=Object.keys(l).sort(function(e,t){return e-t}),m=function(){var e,t,n=[];for(e=0,t=u.length;e>`),a.join(` `)}return``+n},t}()})),fb=c({decisionRecordPdf:()=>mb,pdfFilename:()=>hb});async function pb(e){try{let t=await new Promise((t,n)=>{let r=new Image;r.onload=()=>t(r),r.onerror=()=>n(Error(`image could not be decoded`)),r.src=e.dataUrl}),n=document.createElement(`canvas`);n.width=t.naturalWidth||e.width,n.height=t.naturalHeight||e.height;let r=n.getContext(`2d`);return r?(r.fillStyle=`#ffffff`,r.fillRect(0,0,n.width,n.height),r.drawImage(t,0,0),{dataUrl:n.toDataURL(`image/jpeg`,.92),width:n.width,height:n.height}):null}catch{return null}}async function mb(e){let{jsPDF:t}=await gn(async()=>{let{jsPDF:e}=await Promise.resolve().then(()=>(db(),I_));return{jsPDF:e}},void 0,import.meta.url),n=new t({unit:`pt`,format:`letter`,compress:!0}),{analysis:r,cycle:i}=e,a=r.remediation,o=r.exposure,s=r.reconciliation,c=e.drawLog[e.drawLog.length-1],l=c?.coverage===`census`||o.n===0&&o.measuredCount>0,u=e.provenance,d=u&&V(u)?`${u.sourceReport}, extracted ${u.extractedOn}${u.extractedBy?` by ${u.extractedBy}`:``}`:`Not recorded`,f=u&&u.fingerprint?`${u.rowsReceived.toLocaleString(`en-US`)} rows received, SHA-256 ${u.fingerprint}`:u&&u.rowsReceived?`${u.rowsReceived.toLocaleString(`en-US`)} rows received, fingerprint not recorded`:`Not recorded`,p=ee(e.columns??[],e.fieldOrigins??{}),m=U(e.columns??[],e.fieldOrigins??{}),h=(e,t,r,i={})=>{n.setFont(i.mono?`courier`:`helvetica`,i.bold?`bold`:`normal`),n.setFontSize(i.size??9),n.setTextColor(...i.color??vb),n.text(e,t,r,{align:i.align??`left`})},g=(e,t,r,i,a={})=>{n.setFont(`helvetica`,`normal`),n.setFontSize(a.size??9),n.setTextColor(...a.color??vb);let o=n.splitTextToSize(e,i);return o.forEach((e,i)=>n.text(e,t,r+i*(a.lead??12))),o.length*(a.lead??12)},_=(e,t,r=!1,i=!1)=>(n.setFont(r?`courier`:`helvetica`,i?`bold`:`normal`),n.setFontSize(t),n.getTextWidth(e)),v=(e,t,n,r=!1,i=!1)=>{if(_(e,n,r,i)<=t)return e;let a=e;for(;a.length>1&&_(`${a}...`,n,r,i)>t;)a=a.slice(0,-1);return`${a.trimEnd()}...`},y=(e,t=gb,r=_b,i=Tb,a=.5)=>{n.setDrawColor(...i),n.setLineWidth(a),n.line(t,e,t+r,e)};n.setFillColor(...xb),n.rect(gb,gb,_b,92,`F`);let b=54,x=60,S=e.logo?await pb(e.logo):null;if(S){let e=Math.min(86/S.width,30/S.height,1),t=S.width*e,r=S.height*e;try{n.setFillColor(255,255,255),n.roundedRect(b,x-11,t+8,r+8,2,2,`F`),n.addImage(S.dataUrl,`JPEG`,b+4,x-7,t,r),b+=t+18}catch{}}let C=322-b;e.clientName&&(h(v(`PREPARED FOR ${e.clientName.toUpperCase()}`,C,6.5,!0),b,x,{size:6.5,mono:!0,color:Cb}),x+=12),h(v(`EFFORT CERTIFICATION REVIEW${e.isDemo?` · DEMO DATA, FICTIONAL`:``}`,C,6.5,!0),b,x,{size:6.5,mono:!0,color:Cb});let w=14;for(;w>9.5&&_(i.institution,w,!1,!0)>C;)w-=.5;h(v(i.institution,C,w,!1,!0),b,x+17,{size:w,bold:!0,color:Sb}),h(v(`Period ${i.periodStart} to ${i.periodEnd}${i.cycleLabel?` · ${i.cycleLabel}`:``}`,C,7.5),b,x+31,{size:7.5,color:Cb}),h(`ESTIMATED EXPOSURE`,558,60,{size:6.5,mono:!0,color:Cb,align:`right`}),h(st(a.headlineRounded),558,86,{size:24,bold:!0,mono:!0,color:Sb,align:`right`});let T=l?`all ${o.measuredCount.toLocaleString(`en-US`)} certified records tested`:o.stratified?`${o.measuredCount+o.n} records tested, ${o.measuredCount} in full`:`sample of ${o.n}`;h(l?`No range: ${T}`:`Range ${st(a.rangeLowRounded)} to ${st(a.rangeHighRounded)}, ${T}`,558,100,{size:7.5,color:Cb,align:`right`});let E=Math.max(a.rangeHighRounded*1.08,1);n.setFillColor(59,52,46),n.roundedRect(348,110,210,5,2.5,2.5,`F`),n.setFillColor(...wb);let D=348+a.rangeLowRounded/E*210,O=Math.max((a.rangeHighRounded-a.rangeLowRounded)/E*210,1);n.roundedRect(D,110,O,5,2.5,2.5,`F`),n.setFillColor(...Sb),n.rect(348+a.headlineRounded/E*210-1,108,2,9,`F`);let k=154;if(k+=g(r.summary,gb,k,_b,{size:9.5,lead:13}),k+=8,e.clustering){n.setDrawColor(...bb),n.setLineWidth(2);let t=12*n.splitTextToSize(e.clustering,520).length;n.line(gb,k-9,gb,k-9+t),g(e.clustering,50,k,520,{size:9,lead:12}),k+=t+10}h(`Prioritized remediation`,gb,k,{size:11,bold:!0}),k+=8,n.setDrawColor(...vb),n.setLineWidth(1.2),n.line(gb,k,572,k),k+=12;let A=Math.max(1,...a.items.map(e=>e.amount));for(let e of a.items){h(e.title,gb,k,{size:9,bold:!0}),h(st(e.amount),498,k,{size:9.5,bold:!0,mono:!0,align:`right`});let t=g(e.kind===`known`?`Known exposure, counted in full`:`${e.recordCount} record${e.recordCount===1?``:`s`} · ${e.severity===`substantive`?`Substantive`:`Documentation`} · ${e.action}`,gb,k+10,446,{size:7.5,lead:9,color:yb}),r=k+10+t-1;n.setFillColor(...e.kind===`known`?vb:bb),n.rect(gb,r,e.amount/A*_b,1.5,`F`),y(r+6),k=r+19}k-=5;let j=a.items.reduce((e,t)=>e+t.amount,0),M=j===a.headlineRounded;k+=4,h(`Items total`,gb,k,{size:10,bold:!0}),h(M?`Equals headline`:`Does not equal headline`,110,k,{size:8.5,bold:!0,color:M?[11,92,173]:[179,65,14]}),h(st(j),498,k,{size:10,bold:!0,mono:!0,align:`right`}),k+=26;let N=p.line?`Fields: ${p.system.length} system, ${p.client.length} client, ${p.unstated.length} unstated${m.length?` (checks ${m.join(`, `)} test client data)`:``}`:`Field origin not recorded`,P=(t,n)=>{let r=`. ${f}. ${N}.`,i=492-_(r,6.5);h(`${v(d,Math.max(40,i),6.5)}${r}`,gb,696,{size:6.5,color:yb}),n>1&&h(`Page ${t} of ${n}`,572,696,{size:6.5,color:yb,align:`right`}),y(701);let a=g(`This review tests attributes of the certification record. It does not test whether the effort occurred, and the figure is a management estimate on the shares shown, not a statistical projection of questioned cost. ${nt} Produced on ${e.preparedOn}.`,gb,710,_b,{size:6.5,lead:8,color:yb});g(`${rt} ${it}`,gb,710+a+2,_b,{size:6.5,lead:8,color:yb})},F=k,I=k+13,L=7.5,R=9,z=(e,t,r,i,a,o=!1)=>{o||h(e,r,a,{size:L,color:yb});let s=o?R*n.splitTextToSize(t,i-108).length:g(t,r+108,a,i-108,{size:L,lead:R});return Math.max(s,R)+2},B=e.glControlTotal===void 0?`Not performed`:e.glControlTotal-s.totalSalary===0?`Agreed to ${st(e.glControlTotal)}`:`${st(e.glControlTotal)}, ${st(Math.abs(e.glControlTotal-s.totalSalary))} unexplained`,H=c?.confidence??.95,W=`${Math.round(H*100)}%`,te=l?`Every certified record tested. ${ct(c?.tolerableRate??0,0)} tolerable deviation rate. No sampling, so no sampling error.`:c?.tolerableRate===void 0?`Fixed sample size, not derived`:`${W} confidence, ${ct(c.tolerableRate,0)} tolerable, ${ct(c.expectedRate??0,0)} expected`+(c.sampledStratumPool?`, finite population ${c.sampledStratumPool}`:``),G=l?`All ${o.measuredCount.toLocaleString(`en-US`)} certified records`:o.stratified&&c?.highValueThreshold?`${o.measuredCount} tested in full at ${st(c.highValueThreshold)} and above; ${o.n} drawn at random from ${c.sampledStratumPool??s.certified}`:`${o.n} of ${s.certified} certified, drawn at random`,ne=o.measuredFailedCount+o.failedCount,re=[[`Exposure share, substantive`,`${ct(e.assumptions.substantiveShare,0)} (planning assumption)`],[`Exposure share, documentation`,`${ct(e.assumptions.documentationShare,0)} (planning assumption)`],[`Completion window`,`${i.completionWindowDays} days (locked to draw ${c?.drawNumber??1})`],[`Variance threshold`,`${i.varianceThresholdPct}%`],[`Population`,`${s.expected} expected, ${s.certified} certified, ${s.notCertified} not certified`],[`Ledger tie-out`,B],[`Sampling parameters`,te],[`Selection`,G],[`Results`,l?`${ne} of ${o.measuredCount} failed, a counted rate of ${ct(o.measuredCount===0?0:o.measuredFailedCount/o.measuredCount)}`:`${ne} of ${o.measuredCount+o.n} failed; sampled rate ${ct(o.pHat)}, ${W} Wilson ${ct(o.wilson.lower)} to ${ct(o.wilson.upper)}`],[`Basis of the figure`,l?`known ${st(o.known)} + counted ${st(o.measured)}. A management estimate: the defect count is exact, the dollar amount applies the severity shares above.`:o.stratified?`known ${st(o.known)} + measured ${st(o.measured)} + estimated ${st(o.likely)}. A management estimate, not a statistical projection of questioned cost.`:`known ${st(o.known)} + estimated ${st(o.likely)}. A management estimate, not a statistical projection of questioned cost.`]],K=Ue(o,c?.tolerableRate,H);K&&re.push([`Control conclusion`,K.census?`${K.exceeds?`Not met`:`Met`} at ${ct(K.tolerableRate,0)} tolerable: counted rate ${ct(K.observedRate)}, no sampling error`:`${K.exceeds?`Not supported`:`Supported`} at ${ct(K.tolerableRate,0)} tolerable: observed ${ct(K.observedRate)}, upper limit ${ct(K.upperDeviationLimit)}`]);let q=()=>re.reduce((e,[,t])=>e+z(``,t,gb,256,0,!0),0),J=I,ie=q(),ae=!1;if(ie>681-J)for(;ie>681-J&&L>6.75;)L-=.25,R=L*1.2,ie=q();ie>681-J&&(L=7.5,R=9,n.addPage(`letter`,`portrait`),ae=!0,h(`${i.institution}${e.isDemo?` · demo data, fictional`:``}`,gb,44,{size:7,mono:!0,color:yb}),h(`Basis of this review`,gb,64,{size:13,bold:!0}),k=76,I=k+13,J=I),ae?h(`Assumptions used`,gb,k,{size:9.5,bold:!0}):h(`Assumptions used`,gb,F,{size:9.5,bold:!0});for(let[e,t]of re)I+=z(e,t,gb,256,I);if(I>689)throw Error(`The basis block overran the footer by ${Math.round(I-689)}pt. Something above it grew.`);let oe=ae?k:F;h(`Draw log (${e.drawLog.length} ${e.drawLog.length===1?`draw`:`draws`})`,316,oe,{size:9.5,bold:!0});let Y=oe+13,X=[0,16,82,146,212];[`#`,`Time`,`Reviewer`,`Seed`,`n`].forEach((e,t)=>h(e,316+X[t]+(t>=3?46:0),Y,{size:6.5,mono:!0,color:yb,align:t>=3?`right`:`left`})),Y+=4,y(Y,316,256),Y+=10;for(let t of e.drawLog){let e=t===c;h(`${t.drawNumber}${e?`*`:``}`,316,Y,{size:7.5,mono:!0}),h(t.timestamp.slice(0,10),316+X[1],Y,{size:7.5,mono:!0}),h(v(t.reviewerName,X[3]-X[2]-6,7.5),316+X[2],Y,{size:7.5}),h(String(t.seed),316+X[3]+46,Y,{size:7.5,mono:!0,align:`right`}),h(String(t.sampleSize),316+X[4]+46,Y,{size:7.5,mono:!0,align:`right`}),Y+=9;let n=t.reason||(t.drawNumber===1?`First draw`:``);n&&(Y+=g(n,316+X[1],Y,256-X[1],{size:7,lead:8.5,color:yb})+2),Y+=3}e.drawLog.length>0&&h(`* the draw this record is based on`,316,Y+2,{size:6.5,color:yb});let se=n.getNumberOfPages();for(let e=1;e<=se;e++)n.setPage(e),P(e,se);return n.output(`blob`)}function hb(e,t){return`${(t?.trim()||e.institution||`effort-certification`).replace(/[^\w\s-]/g,``).trim().replace(/\s+/g,`-`)}-decision-record.pdf`}var gb,_b,vb,yb,bb,xb,Sb,Cb,wb,Tb,Eb=o((()=>{ft(),_n(),gb=40,_b=532,vb=[23,19,16],yb=[91,84,74],bb=[107,39,55],xb=[31,26,23],Sb=[244,239,231],Cb=[194,184,171],wb=[232,180,192],Tb=[217,211,200]})),Db=s(((e,t)=>{(function(n){typeof e==`object`&&t!==void 0?t.exports=n():typeof define==`function`&&define.amd?define([],n):(typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:this).ExcelJS=n()})((function(){return function e(t,n,r){function i(o,s){if(!n[o]){if(!t[o]){var c=typeof d==`function`&&d;if(!s&&c)return c(o,!0);if(a)return a(o,!0);var l=Error(`Cannot find module '`+o+`'`);throw l.code=`MODULE_NOT_FOUND`,l}var u=n[o]={exports:{}};t[o][0].call(u.exports,(function(e){return i(t[o][1][e]||e)}),u,u.exports,e,t,n,r)}return n[o].exports}for(var a=typeof d==`function`&&d,o=0;o{let a=this.workbook.addWorksheet(t.sheetName),o=t.dateFormats||[`YYYY-MM-DD[T]HH:mm:ssZ`,`YYYY-MM-DD[T]HH:mm:ss`,`MM-DD-YYYY`,`YYYY-MM-DD`],c=t.map||function(e){if(e===``)return null;let t=Number(e);if(!Number.isNaN(t)&&t!==1/0)return t;let n=o.reduce((t,n)=>{if(t)return t;let r=s(e,n,!0);return r.isValid()?r:null},null);if(n)return new Date(n.valueOf());let r=u[e];return r===void 0?e:r},l=i.parse(t.parserOptions).on(`data`,e=>{a.addRow(e.map(c))}).on(`end`,()=>{l.emit(`worksheet`,a)});l.on(`worksheet`,n).on(`error`,r),e.pipe(l)})}createInputStream(){throw Error("`CSV#createInputStream` is deprecated. You should use `CSV#read` instead. This method will be removed in version 5.0. Please follow upgrade instruction: https://github.com/exceljs/exceljs/blob/master/UPGRADE-4.0.md")}write(e,t){return new Promise((n,r)=>{t=t||{};let a=this.workbook.getWorksheet(t.sheetName||t.sheetId),o=i.format(t.formatterOptions);e.on(`finish`,()=>{n()}),o.on(`error`,r),o.pipe(e);let{dateFormat:c,dateUTC:l}=t,u=t.map||(e=>{if(e){if(e.text||e.hyperlink)return e.hyperlink||e.text||``;if(e.formula||e.result)return e.result||``;if(e instanceof Date)return c?l?s.utc(e).format(c):s(e).format(c):l?s.utc(e).format():s(e).format();if(e.error)return e.error;if(typeof e==`object`)return JSON.stringify(e)}return e}),d=t.includeEmptyRows===void 0||t.includeEmptyRows,f=1;a&&a.eachRow((e,t)=>{if(d)for(;f++2&&arguments[2]!==void 0?arguments[2]:0;if(this.worksheet=e,t){if(typeof t==`string`){let e=r.decodeAddress(t);this.nativeCol=e.col+n,this.nativeColOff=0,this.nativeRow=e.row+n,this.nativeRowOff=0}else t.nativeCol===void 0?t.col===void 0?(this.nativeCol=0,this.nativeColOff=0,this.nativeRow=0,this.nativeRowOff=0):(this.col=t.col+n,this.row=t.row+n):(this.nativeCol=t.nativeCol||0,this.nativeColOff=t.nativeColOff||0,this.nativeRow=t.nativeRow||0,this.nativeRowOff=t.nativeRowOff||0)}else this.nativeCol=0,this.nativeColOff=0,this.nativeRow=0,this.nativeRowOff=0}static asInstance(e){return e instanceof i||e==null?e:new i(e)}get col(){return this.nativeCol+Math.min(this.colWidth-1,this.nativeColOff)/this.colWidth}set col(e){this.nativeCol=Math.floor(e),this.nativeColOff=Math.floor((e-this.nativeCol)*this.colWidth)}get row(){return this.nativeRow+Math.min(this.rowHeight-1,this.nativeRowOff)/this.rowHeight}set row(e){this.nativeRow=Math.floor(e),this.nativeRowOff=Math.floor((e-this.nativeRow)*this.rowHeight)}get colWidth(){return this.worksheet&&this.worksheet.getColumn(this.nativeCol+1)&&this.worksheet.getColumn(this.nativeCol+1).isCustomWidth?Math.floor(1e4*this.worksheet.getColumn(this.nativeCol+1).width):64e4}get rowHeight(){return this.worksheet&&this.worksheet.getRow(this.nativeRow+1)&&this.worksheet.getRow(this.nativeRow+1).height?Math.floor(1e4*this.worksheet.getRow(this.nativeRow+1).height):18e4}get model(){return{nativeCol:this.nativeCol,nativeColOff:this.nativeColOff,nativeRow:this.nativeRow,nativeRowOff:this.nativeRowOff}}set model(e){this.nativeCol=e.nativeCol,this.nativeColOff=e.nativeColOff,this.nativeRow=e.nativeRow,this.nativeRowOff=e.nativeRowOff}}t.exports=i},{"../utils/col-cache":19}],3:[function(e,t,n){let r=e(`../utils/col-cache`),i=e(`../utils/under-dash`),a=e(`./enums`),{slideFormula:o}=e(`../utils/shared-formula`),s=e(`./note`);class c{constructor(e,t,n){if(!e||!t)throw Error(`A Cell needs a Row`);this._row=e,this._column=t,r.validateAddress(n),this._address=n,this._value=l.create(c.Types.Null,this),this.style=this._mergeStyle(e.style,t.style,{}),this._mergeCount=0}get worksheet(){return this._row.worksheet}get workbook(){return this._row.worksheet.workbook}destroy(){delete this.style,delete this._value,delete this._row,delete this._column,delete this._address}get numFmt(){return this.style.numFmt}set numFmt(e){this.style.numFmt=e}get font(){return this.style.font}set font(e){this.style.font=e}get alignment(){return this.style.alignment}set alignment(e){this.style.alignment=e}get border(){return this.style.border}set border(e){this.style.border=e}get fill(){return this.style.fill}set fill(e){this.style.fill=e}get protection(){return this.style.protection}set protection(e){this.style.protection=e}_mergeStyle(e,t,n){let r=e&&e.numFmt||t&&t.numFmt;r&&(n.numFmt=r);let i=e&&e.font||t&&t.font;i&&(n.font=i);let a=e&&e.alignment||t&&t.alignment;a&&(n.alignment=a);let o=e&&e.border||t&&t.border;o&&(n.border=o);let s=e&&e.fill||t&&t.fill;s&&(n.fill=s);let c=e&&e.protection||t&&t.protection;return c&&(n.protection=c),n}get address(){return this._address}get row(){return this._row.number}get col(){return this._column.number}get $col$row(){return`$${this._column.letter}$${this.row}`}get type(){return this._value.type}get effectiveType(){return this._value.effectiveType}toCsvString(){return this._value.toCsvString()}addMergeRef(){this._mergeCount++}releaseMergeRef(){this._mergeCount--}get isMerged(){return this._mergeCount>0||this.type===c.Types.Merge}merge(e,t){this._value.release(),this._value=l.create(c.Types.Merge,this,e),t||(this.style=e.style)}unmerge(){this.type===c.Types.Merge&&(this._value.release(),this._value=l.create(c.Types.Null,this),this.style=this._mergeStyle(this._row.style,this._column.style,{}))}isMergedTo(e){return this._value.type===c.Types.Merge&&this._value.isMergedTo(e)}get master(){return this.type===c.Types.Merge?this._value.master:this}get isHyperlink(){return this._value.type===c.Types.Hyperlink}get hyperlink(){return this._value.hyperlink}get value(){return this._value.value}set value(e){this.type===c.Types.Merge?this._value.master.value=e:(this._value.release(),this._value=l.create(l.getType(e),this,e))}get note(){return this._comment&&this._comment.note}set note(e){this._comment=new s(e)}get text(){return this._value.toString()}get html(){return i.escapeHtml(this.text)}toString(){return this.text}_upgradeToHyperlink(e){this.type===c.Types.String&&(this._value=l.create(c.Types.Hyperlink,this,{text:this._value.value,hyperlink:e}))}get formula(){return this._value.formula}get result(){return this._value.result}get formulaType(){return this._value.formulaType}get fullAddress(){let{worksheet:e}=this._row;return{sheetName:e.name,address:this.address,row:this.row,col:this.col}}get name(){return this.names[0]}set name(e){this.names=[e]}get names(){return this.workbook.definedNames.getNamesEx(this.fullAddress)}set names(e){let{definedNames:t}=this.workbook;t.removeAllNames(this.fullAddress),e.forEach(e=>{t.addEx(this.fullAddress,e)})}addName(e){this.workbook.definedNames.addEx(this.fullAddress,e)}removeName(e){this.workbook.definedNames.removeEx(this.fullAddress,e)}removeAllNames(){this.workbook.definedNames.removeAllNames(this.fullAddress)}get _dataValidations(){return this.worksheet.dataValidations}get dataValidation(){return this._dataValidations.find(this.address)}set dataValidation(e){this._dataValidations.add(this.address,e)}get model(){let{model:e}=this._value;return e.style=this.style,this._comment&&(e.comment=this._comment.model),e}set model(e){if(this._value.release(),this._value=l.create(e.type,this),this._value.model=e,e.comment)switch(e.comment.type){case`note`:this._comment=s.fromModel(e.comment)}this.style=e.style?e.style:{}}}c.Types=a.ValueType;let l={getType:e=>e==null?c.Types.Null:e instanceof String||typeof e==`string`?c.Types.String:typeof e==`number`?c.Types.Number:typeof e==`boolean`?c.Types.Boolean:e instanceof Date?c.Types.Date:e.text&&e.hyperlink?c.Types.Hyperlink:e.formula||e.sharedFormula?c.Types.Formula:e.richText?c.Types.RichText:e.sharedString?c.Types.SharedString:e.error?c.Types.Error:c.Types.JSON,types:[{t:c.Types.Null,f:class{constructor(e){this.model={address:e.address,type:c.Types.Null}}get value(){return null}set value(e){}get type(){return c.Types.Null}get effectiveType(){return c.Types.Null}get address(){return this.model.address}set address(e){this.model.address=e}toCsvString(){return``}release(){}toString(){return``}}},{t:c.Types.Number,f:class{constructor(e,t){this.model={address:e.address,type:c.Types.Number,value:t}}get value(){return this.model.value}set value(e){this.model.value=e}get type(){return c.Types.Number}get effectiveType(){return c.Types.Number}get address(){return this.model.address}set address(e){this.model.address=e}toCsvString(){return this.model.value.toString()}release(){}toString(){return this.model.value.toString()}}},{t:c.Types.String,f:class{constructor(e,t){this.model={address:e.address,type:c.Types.String,value:t}}get value(){return this.model.value}set value(e){this.model.value=e}get type(){return c.Types.String}get effectiveType(){return c.Types.String}get address(){return this.model.address}set address(e){this.model.address=e}toCsvString(){return`"${this.model.value.replace(/"/g,`""`)}"`}release(){}toString(){return this.model.value}}},{t:c.Types.Date,f:class{constructor(e,t){this.model={address:e.address,type:c.Types.Date,value:t}}get value(){return this.model.value}set value(e){this.model.value=e}get type(){return c.Types.Date}get effectiveType(){return c.Types.Date}get address(){return this.model.address}set address(e){this.model.address=e}toCsvString(){return this.model.value.toISOString()}release(){}toString(){return this.model.value.toString()}}},{t:c.Types.Hyperlink,f:class{constructor(e,t){this.model={address:e.address,type:c.Types.Hyperlink,text:t?t.text:void 0,hyperlink:t?t.hyperlink:void 0},t&&t.tooltip&&(this.model.tooltip=t.tooltip)}get value(){let e={text:this.model.text,hyperlink:this.model.hyperlink};return this.model.tooltip&&(e.tooltip=this.model.tooltip),e}set value(e){this.model={text:e.text,hyperlink:e.hyperlink},e.tooltip&&(this.model.tooltip=e.tooltip)}get text(){return this.model.text}set text(e){this.model.text=e}get hyperlink(){return this.model.hyperlink}set hyperlink(e){this.model.hyperlink=e}get type(){return c.Types.Hyperlink}get effectiveType(){return c.Types.Hyperlink}get address(){return this.model.address}set address(e){this.model.address=e}toCsvString(){return this.model.hyperlink}release(){}toString(){return this.model.text}}},{t:c.Types.Formula,f:class{constructor(e,t){this.cell=e,this.model={address:e.address,type:c.Types.Formula,shareType:t?t.shareType:void 0,ref:t?t.ref:void 0,formula:t?t.formula:void 0,sharedFormula:t?t.sharedFormula:void 0,result:t?t.result:void 0}}_copyModel(e){let t={},n=n=>{let r=e[n];r&&(t[n]=r)};return n(`formula`),n(`result`),n(`ref`),n(`shareType`),n(`sharedFormula`),t}get value(){return this._copyModel(this.model)}set value(e){this.model=this._copyModel(e)}validate(e){switch(l.getType(e)){case c.Types.Null:case c.Types.String:case c.Types.Number:case c.Types.Date:break;case c.Types.Hyperlink:case c.Types.Formula:default:throw Error(`Cannot process that type of result value`)}}get dependencies(){return{ranges:this.formula.match(/([a-zA-Z0-9]+!)?[A-Z]{1,3}\d{1,4}:[A-Z]{1,3}\d{1,4}/g),cells:this.formula.replace(/([a-zA-Z0-9]+!)?[A-Z]{1,3}\d{1,4}:[A-Z]{1,3}\d{1,4}/g,``).match(/([a-zA-Z0-9]+!)?[A-Z]{1,3}\d{1,4}/g)}}get formula(){return this.model.formula||this._getTranslatedFormula()}set formula(e){this.model.formula=e}get formulaType(){return this.model.formula?a.FormulaType.Master:this.model.sharedFormula?a.FormulaType.Shared:a.FormulaType.None}get result(){return this.model.result}set result(e){this.model.result=e}get type(){return c.Types.Formula}get effectiveType(){let e=this.model.result;return e==null?a.ValueType.Null:e instanceof String||typeof e==`string`?a.ValueType.String:typeof e==`number`?a.ValueType.Number:e instanceof Date?a.ValueType.Date:e.text&&e.hyperlink?a.ValueType.Hyperlink:e.formula?a.ValueType.Formula:a.ValueType.Null}get address(){return this.model.address}set address(e){this.model.address=e}_getTranslatedFormula(){if(!this._translatedFormula&&this.model.sharedFormula){let{worksheet:e}=this.cell,t=e.findCell(this.model.sharedFormula);this._translatedFormula=t&&o(t.formula,t.address,this.model.address)}return this._translatedFormula}toCsvString(){return``+(this.model.result||``)}release(){}toString(){return this.model.result?this.model.result.toString():``}}},{t:c.Types.Merge,f:class{constructor(e,t){this.model={address:e.address,type:c.Types.Merge,master:t?t.address:void 0},this._master=t,t&&t.addMergeRef()}get value(){return this._master.value}set value(e){e instanceof c?(this._master&&this._master.releaseMergeRef(),e.addMergeRef(),this._master=e):this._master.value=e}isMergedTo(e){return e===this._master}get master(){return this._master}get type(){return c.Types.Merge}get effectiveType(){return this._master.effectiveType}get address(){return this.model.address}set address(e){this.model.address=e}toCsvString(){return``}release(){this._master.releaseMergeRef()}toString(){return this.value.toString()}}},{t:c.Types.JSON,f:class{constructor(e,t){this.model={address:e.address,type:c.Types.String,value:JSON.stringify(t),rawValue:t}}get value(){return this.model.rawValue}set value(e){this.model.rawValue=e,this.model.value=JSON.stringify(e)}get type(){return c.Types.String}get effectiveType(){return c.Types.String}get address(){return this.model.address}set address(e){this.model.address=e}toCsvString(){return this.model.value}release(){}toString(){return this.model.value}}},{t:c.Types.SharedString,f:class{constructor(e,t){this.model={address:e.address,type:c.Types.SharedString,value:t}}get value(){return this.model.value}set value(e){this.model.value=e}get type(){return c.Types.SharedString}get effectiveType(){return c.Types.SharedString}get address(){return this.model.address}set address(e){this.model.address=e}toCsvString(){return this.model.value.toString()}release(){}toString(){return this.model.value.toString()}}},{t:c.Types.RichText,f:class{constructor(e,t){this.model={address:e.address,type:c.Types.String,value:t}}get value(){return this.model.value}set value(e){this.model.value=e}toString(){return this.model.value.richText.map(e=>e.text).join(``)}get type(){return c.Types.RichText}get effectiveType(){return c.Types.RichText}get address(){return this.model.address}set address(e){this.model.address=e}toCsvString(){return`"${this.text.replace(/"/g,`""`)}"`}release(){}}},{t:c.Types.Boolean,f:class{constructor(e,t){this.model={address:e.address,type:c.Types.Boolean,value:t}}get value(){return this.model.value}set value(e){this.model.value=e}get type(){return c.Types.Boolean}get effectiveType(){return c.Types.Boolean}get address(){return this.model.address}set address(e){this.model.address=e}toCsvString(){return+!!this.model.value}release(){}toString(){return this.model.value.toString()}}},{t:c.Types.Error,f:class{constructor(e,t){this.model={address:e.address,type:c.Types.Error,value:t}}get value(){return this.model.value}set value(e){this.model.value=e}get type(){return c.Types.Error}get effectiveType(){return c.Types.Error}get address(){return this.model.address}set address(e){this.model.address=e}toCsvString(){return this.toString()}release(){}toString(){return this.model.value.error.toString()}}}].reduce((e,t)=>(e[t.t]=t.f,e),[]),create(e,t,n){let r=this.types[e];if(!r)throw Error(`Could not create Value of type `+e);return new r(t,n)}};t.exports=c},{"../utils/col-cache":19,"../utils/shared-formula":23,"../utils/under-dash":26,"./enums":7,"./note":9}],4:[function(e,t,n){let r=e(`../utils/under-dash`),i=e(`./enums`),a=e(`../utils/col-cache`);class o{constructor(e,t,n){this._worksheet=e,this._number=t,!1!==n&&(this.defn=n)}get number(){return this._number}get worksheet(){return this._worksheet}get letter(){return a.n2l(this._number)}get isCustomWidth(){return this.width!==void 0&&this.width!==9}get defn(){return{header:this._header,key:this.key,width:this.width,style:this.style,hidden:this.hidden,outlineLevel:this.outlineLevel}}set defn(e){e?(this.key=e.key,this.width=e.width===void 0?9:e.width,this.outlineLevel=e.outlineLevel,this.style=e.style?e.style:{},this.header=e.header,this._hidden=!!e.hidden):(delete this._header,delete this._key,delete this.width,this.style={},this.outlineLevel=0)}get headers(){return this._header&&this._header instanceof Array?this._header:[this._header]}get header(){return this._header}set header(e){e===void 0?this._header=void 0:(this._header=e,this.headers.forEach((e,t)=>{this._worksheet.getCell(t+1,this.number).value=e}))}get key(){return this._key}set key(e){(this._key&&this._worksheet.getColumnKey(this._key))===this&&this._worksheet.deleteColumnKey(this._key),this._key=e,e&&this._worksheet.setColumnKey(this._key,this)}get hidden(){return!!this._hidden}set hidden(e){this._hidden=e}get outlineLevel(){return this._outlineLevel||0}set outlineLevel(e){this._outlineLevel=e}get collapsed(){return!!(this._outlineLevel&&this._outlineLevel>=this._worksheet.properties.outlineLevelCol)}toString(){return JSON.stringify({key:this.key,width:this.width,headers:this.headers.length?this.headers:void 0})}equivalentTo(e){return this.width===e.width&&this.hidden===e.hidden&&this.outlineLevel===e.outlineLevel&&r.isEqual(this.style,e.style)}get isDefault(){if(this.isCustomWidth||this.hidden||this.outlineLevel)return!1;let e=this.style;return!e||!(e.font||e.numFmt||e.alignment||e.border||e.fill||e.protection)}get headerCount(){return this.headers.length}eachCell(e,t){let n=this.number;t||(t=e,e=null),this._worksheet.eachRow(e,(e,r)=>{t(e.getCell(n),r)})}get values(){let e=[];return this.eachCell((t,n)=>{t&&t.type!==i.ValueType.Null&&(e[n]=t.value)}),e}set values(e){if(!e)return;let t=this.number,n=0;e.hasOwnProperty(`0`)&&(n=1),e.forEach((e,r)=>{this._worksheet.getCell(r+n,t).value=e})}_applyStyle(e,t){return this.style[e]=t,this.eachCell(n=>{n[e]=t}),t}get numFmt(){return this.style.numFmt}set numFmt(e){this._applyStyle(`numFmt`,e)}get font(){return this.style.font}set font(e){this._applyStyle(`font`,e)}get alignment(){return this.style.alignment}set alignment(e){this._applyStyle(`alignment`,e)}get protection(){return this.style.protection}set protection(e){this._applyStyle(`protection`,e)}get border(){return this.style.border}set border(e){this._applyStyle(`border`,e)}get fill(){return this.style.fill}set fill(e){this._applyStyle(`fill`,e)}static toModel(e){let t=[],n=null;return e&&e.forEach((e,r)=>{e.isDefault?n&&(n=null):n&&e.equivalentTo(n)?n.max=r+1:(n={min:r+1,max:r+1,width:e.width===void 0?9:e.width,style:e.style,isCustomWidth:e.isCustomWidth,hidden:e.hidden,outlineLevel:e.outlineLevel,collapsed:e.collapsed},t.push(n))}),t.length?t:void 0}static fromModel(e,t){let n=[],r=1,i=0;for(t=(t=t||[]).sort((function(e,t){return e.min-t.min}));i{t.removeCellEx(e)})}forEach(e){r.each(this.matrixMap,(t,n)=>{t.forEach(t=>{e(n,t)})})}getNames(e){return this.getNamesEx(i.decodeEx(e))}getNamesEx(e){return r.map(this.matrixMap,(t,n)=>t.findCellEx(e)&&n).filter(Boolean)}_explore(e,t){t.mark=!1;let{sheetName:n}=t,r=new o(t.row,t.col,t.row,t.col,n),i,a;function s(i,a){let o=e.findCellAt(n,i,t.col);return!(!o||!o.mark)&&(r[a]=i,o.mark=!1,!0)}for(a=t.row-1;s(a,`top`);a--);for(a=t.row+1;s(a,`bottom`);a++);function c(t,i){let o=[];for(a=r.top;a<=r.bottom;a++){let r=e.findCellAt(n,a,t);if(!r||!r.mark)return!1;o.push(r)}r[i]=t;for(let e=0;e{e.mark=!0}),{name:e,ranges:t.map(e=>e.mark&&this._explore(t,e)).filter(Boolean).map(e=>e.$shortRange)}):{name:e,ranges:[]}}normaliseMatrix(e,t){e.forEachInSheet(t,(e,t,n)=>{e&&(e.row===t&&e.col===n||(e.row=t,e.col=n,e.address=i.n2l(n)+t))})}spliceRows(e,t,n,i){r.each(this.matrixMap,r=>{r.spliceRows(e,t,n,i),this.normaliseMatrix(r,e)})}spliceColumns(e,t,n,i){r.each(this.matrixMap,r=>{r.spliceColumns(e,t,n,i),this.normaliseMatrix(r,e)})}get model(){return r.map(this.matrixMap,(e,t)=>this.getRanges(t,e)).filter(e=>e.ranges.length)}set model(e){let t=this.matrixMap={};e.forEach(e=>{let n=t[e.name]=new a;e.ranges.forEach(e=>{s.test(e.split(`!`).pop()||``)&&n.addCell(e)})})}}},{"../utils/cell-matrix":18,"../utils/col-cache":19,"../utils/under-dash":26,"./range":10}],7:[function(e,t,n){t.exports={ValueType:{Null:0,Merge:1,Number:2,String:3,Date:4,Hyperlink:5,Formula:6,SharedString:7,RichText:8,Boolean:9,Error:10},FormulaType:{None:0,Master:1,Shared:2},RelationshipType:{None:0,OfficeDocument:1,Worksheet:2,CalcChain:3,SharedStrings:4,Styles:5,Theme:6,Hyperlink:7},DocumentType:{Xlsx:1},ReadingOrder:{LeftToRight:1,RightToLeft:2},ErrorValue:{NotApplicable:`#N/A`,Ref:`#REF!`,Name:`#NAME?`,DivZero:`#DIV/0!`,Null:`#NULL!`,Value:`#VALUE!`,Num:`#NUM!`}}},{}],8:[function(e,t,n){let r=e(`../utils/col-cache`),i=e(`./anchor`);t.exports=class{constructor(e,t){this.worksheet=e,this.model=t}get model(){switch(this.type){case`background`:return{type:this.type,imageId:this.imageId};case`image`:return{type:this.type,imageId:this.imageId,hyperlinks:this.range.hyperlinks,range:{tl:this.range.tl.model,br:this.range.br&&this.range.br.model,ext:this.range.ext,editAs:this.range.editAs}};default:throw Error(`Invalid Image Type`)}}set model(e){let{type:t,imageId:n,range:a,hyperlinks:o}=e;if(this.type=t,this.imageId=n,t===`image`){if(typeof a==`string`){let e=r.decode(a);this.range={tl:new i(this.worksheet,{col:e.left,row:e.top},-1),br:new i(this.worksheet,{col:e.right,row:e.bottom},0),editAs:`oneCell`}}else this.range={tl:new i(this.worksheet,a.tl,0),br:a.br&&new i(this.worksheet,a.br,0),ext:a.ext,editAs:a.editAs,hyperlinks:o||a.hyperlinks}}}}},{"../utils/col-cache":19,"./anchor":2}],9:[function(e,t,n){let r=e(`../utils/under-dash`);class i{constructor(e){this.note=e}get model(){let e=null;switch(typeof this.note){case`string`:e={type:`note`,note:{texts:[{text:this.note}]}};break;default:e={type:`note`,note:this.note}}return r.deepMerge({},i.DEFAULT_CONFIGS,e)}set model(e){let{note:t}=e,{texts:n}=t;this.note=n.length===1&&Object.keys(n[0]).length===1?n[0].text:t}static fromModel(e){let t=new i;return t.model=e,t}}i.DEFAULT_CONFIGS={note:{margins:{insetmode:`auto`,inset:[.13,.13,.25,.25]},protection:{locked:`True`,lockText:`True`},editAs:`absolute`}},t.exports=i},{"../utils/under-dash":26}],10:[function(e,t,n){let r=e(`../utils/col-cache`);class i{constructor(){this.decode(arguments)}setTLBR(e,t,n,i,a){if(arguments.length<4){let i=r.decodeAddress(e),o=r.decodeAddress(t);this.model={top:Math.min(i.row,o.row),left:Math.min(i.col,o.col),bottom:Math.max(i.row,o.row),right:Math.max(i.col,o.col),sheetName:n},this.setTLBR(i.row,i.col,o.row,o.col,a)}else this.model={top:Math.min(e,n),left:Math.min(t,i),bottom:Math.max(e,n),right:Math.max(t,i),sheetName:a}}decode(e){switch(e.length){case 5:this.setTLBR(e[0],e[1],e[2],e[3],e[4]);break;case 4:this.setTLBR(e[0],e[1],e[2],e[3]);break;case 3:this.setTLBR(e[0],e[1],e[2]);break;case 2:this.setTLBR(e[0],e[1]);break;case 1:{let t=e[0];if(t instanceof i)this.model={top:t.model.top,left:t.model.left,bottom:t.model.bottom,right:t.model.right,sheetName:t.sheetName};else if(t instanceof Array)this.decode(t);else if(t.top&&t.left&&t.bottom&&t.right)this.model={top:t.top,left:t.left,bottom:t.bottom,right:t.right,sheetName:t.sheetName};else{let e=r.decodeEx(t);this.model=e.top?{top:e.top,left:e.left,bottom:e.bottom,right:e.right,sheetName:e.sheetName}:{top:e.row,left:e.col,bottom:e.row,right:e.col,sheetName:e.sheetName}}break}case 0:this.model={top:0,left:0,bottom:0,right:0};break;default:throw Error(`Invalid number of arguments to _getDimensions() - `+e.length)}}get top(){return this.model.top||1}set top(e){this.model.top=e}get left(){return this.model.left||1}set left(e){this.model.left=e}get bottom(){return this.model.bottom||1}set bottom(e){this.model.bottom=e}get right(){return this.model.right||1}set right(e){this.model.right=e}get sheetName(){return this.model.sheetName}set sheetName(e){this.model.sheetName=e}get _serialisedSheetName(){let{sheetName:e}=this.model;return e?/^[a-zA-Z0-9]*$/.test(e)?e+`!`:`'${e}'!`:``}expand(e,t,n,r){(!this.model.top||ethis.bottom)&&(this.bottom=n),(!this.model.right||r>this.right)&&(this.right=r)}expandRow(e){if(e){let{dimensions:t,number:n}=e;t&&this.expand(n,t.min,n,t.max)}}expandToAddress(e){let t=r.decodeEx(e);this.expand(t.row,t.col,t.row,t.col)}get tl(){return r.n2l(this.left)+this.top}get $t$l(){return`$${r.n2l(this.left)}$${this.top}`}get br(){return r.n2l(this.right)+this.bottom}get $b$r(){return`$${r.n2l(this.right)}$${this.bottom}`}get range(){return`${this._serialisedSheetName+this.tl}:${this.br}`}get $range(){return`${this._serialisedSheetName+this.$t$l}:${this.$b$r}`}get shortRange(){return this.count>1?this.range:this._serialisedSheetName+this.tl}get $shortRange(){return this.count>1?this.$range:this._serialisedSheetName+this.$t$l}get count(){return(1+this.bottom-this.top)*(1+this.right-this.left)}toString(){return this.range}intersects(e){return(!e.sheetName||!this.sheetName||e.sheetName===this.sheetName)&&!(e.bottomthis.bottom)&&!(e.rightthis.right)}contains(e){let t=r.decodeEx(e);return this.containsEx(t)}containsEx(e){return(!e.sheetName||!this.sheetName||e.sheetName===this.sheetName)&&e.row>=this.top&&e.row<=this.bottom&&e.col>=this.left&&e.col<=this.right}forEachAddress(e){for(let t=this.left;t<=this.right;t++)for(let n=this.top;n<=this.bottom;n++)e(r.encodeAddress(n,t),n,t)}}t.exports=i},{"../utils/col-cache":19}],11:[function(e,t,n){let r=e(`../utils/under-dash`),i=e(`./enums`),a=e(`../utils/col-cache`),o=e(`./cell`);t.exports=class{constructor(e,t){this._worksheet=e,this._number=t,this._cells=[],this.style={},this.outlineLevel=0}get number(){return this._number}get worksheet(){return this._worksheet}commit(){this._worksheet._commitRow(this)}destroy(){delete this._worksheet,delete this._cells,delete this.style}findCell(e){return this._cells[e-1]}getCellEx(e){let t=this._cells[e.col-1];if(!t){let n=this._worksheet.getColumn(e.col);t=new o(this,n,e.address),this._cells[e.col-1]=t}return t}getCell(e){if(typeof e==`string`){let t=this._worksheet.getColumnKey(e);e=t?t.number:a.l2n(e)}return this._cells[e-1]||this.getCellEx({address:a.encodeAddress(this._number,e),row:this._number,col:e})}splice(e,t){let n=e+t;var r=[...arguments].slice(2);let i=r.length-t,a=this._cells.length,o,s,c;if(i<0)for(o=e+r.length;o<=a;o++)c=this._cells[o-1],s=this._cells[o-i-1],s?(c=this.getCell(o),c.value=s.value,c.style=s.style,c._comment=s._comment):c&&(c.value=null,c.style={},c._comment=void 0);else if(i>0)for(o=a;o>=n;o--)s=this._cells[o-1],s?(c=this.getCell(o+i),c.value=s.value,c.style=s.style,c._comment=s._comment):this._cells[o+i-1]=void 0;for(o=0;o{e&&e.type!==i.ValueType.Null&&t(e,n+1)})}addPageBreak(e,t){let n=this._worksheet,r=Math.max(0,e-1)||0,i=Math.max(0,t-1)||16838,a={id:this._number,max:i,man:1};r&&(a.min=r),n.rowBreaks.push(a)}get values(){let e=[];return this._cells.forEach(t=>{t&&t.type!==i.ValueType.Null&&(e[t.col]=t.value)}),e}set values(e){if(this._cells=[],e){if(e instanceof Array){let t=0;e.hasOwnProperty(`0`)&&(t=1),e.forEach((e,n)=>{e!==void 0&&(this.getCellEx({address:a.encodeAddress(this._number,n+t),row:this._number,col:n+t}).value=e)})}else this._worksheet.eachColumnKey((t,n)=>{e[n]!==void 0&&(this.getCellEx({address:a.encodeAddress(this._number,t.number),row:this._number,col:t.number}).value=e[n])})}}get hasValues(){return r.some(this._cells,e=>e&&e.type!==i.ValueType.Null)}get cellCount(){return this._cells.length}get actualCellCount(){let e=0;return this.eachCell(()=>{e++}),e}get dimensions(){let e=0,t=0;return this._cells.forEach(n=>{n&&n.type!==i.ValueType.Null&&((!e||e>n.col)&&(e=n.col),t0?{min:e,max:t}:null}_applyStyle(e,t){return this.style[e]=t,this._cells.forEach(n=>{n&&(n[e]=t)}),t}get numFmt(){return this.style.numFmt}set numFmt(e){this._applyStyle(`numFmt`,e)}get font(){return this.style.font}set font(e){this._applyStyle(`font`,e)}get alignment(){return this.style.alignment}set alignment(e){this._applyStyle(`alignment`,e)}get protection(){return this.style.protection}set protection(e){this._applyStyle(`protection`,e)}get border(){return this.style.border}set border(e){this._applyStyle(`border`,e)}get fill(){return this.style.fill}set fill(e){this._applyStyle(`fill`,e)}get hidden(){return!!this._hidden}set hidden(e){this._hidden=e}get outlineLevel(){return this._outlineLevel||0}set outlineLevel(e){this._outlineLevel=e}get collapsed(){return!!(this._outlineLevel&&this._outlineLevel>=this._worksheet.properties.outlineLevelRow)}get model(){let e=[],t=0,n=0;return this._cells.forEach(r=>{if(r){let i=r.model;i&&((!t||t>r.col)&&(t=r.col),n{switch(e.type){case o.Types.Merge:break;default:{let n;if(e.address)n=a.decodeAddress(e.address);else if(t){let{row:e}=t,r=t.col+1;n={row:e,col:r,address:a.encodeAddress(e,r),$col$row:`$${a.n2l(r)}$${e}`}}t=n,this.getCellEx(n).model=e;break}}}),e.height?this.height=e.height:delete this.height,this.hidden=e.hidden,this.outlineLevel=e.outlineLevel||0,this.style=e.style&&JSON.parse(JSON.stringify(e.style))||{}}}},{"../utils/col-cache":19,"../utils/under-dash":26,"./cell":3,"./enums":7}],12:[function(e,t,n){let r=e(`../utils/col-cache`);class i{constructor(e,t,n){this.table=e,this.column=t,this.index=n}_set(e,t){this.table.cacheState(),this.column[e]=t}get name(){return this.column.name}set name(e){this._set(`name`,e)}get filterButton(){return this.column.filterButton}set filterButton(e){this.column.filterButton=e}get style(){return this.column.style}set style(e){this.column.style=e}get totalsRowLabel(){return this.column.totalsRowLabel}set totalsRowLabel(e){this._set(`totalsRowLabel`,e)}get totalsRowFunction(){return this.column.totalsRowFunction}set totalsRowFunction(e){this._set(`totalsRowFunction`,e)}get totalsRowResult(){return this.column.totalsRowResult}set totalsRowResult(e){this._set(`totalsRowResult`,e)}get totalsRowFormula(){return this.column.totalsRowFormula}set totalsRowFormula(e){this._set(`totalsRowFormula`,e)}}t.exports=class{constructor(e,t){this.worksheet=e,t&&(this.table=t,this.validate(),this.store())}getFormula(e){switch(e.totalsRowFunction){case`none`:return null;case`average`:return`SUBTOTAL(101,${this.table.name}[${e.name}])`;case`countNums`:return`SUBTOTAL(102,${this.table.name}[${e.name}])`;case`count`:return`SUBTOTAL(103,${this.table.name}[${e.name}])`;case`max`:return`SUBTOTAL(104,${this.table.name}[${e.name}])`;case`min`:return`SUBTOTAL(105,${this.table.name}[${e.name}])`;case`stdDev`:return`SUBTOTAL(106,${this.table.name}[${e.name}])`;case`var`:return`SUBTOTAL(107,${this.table.name}[${e.name}])`;case`sum`:return`SUBTOTAL(109,${this.table.name}[${e.name}])`;case`custom`:return e.totalsRowFormula;default:throw Error(`Invalid Totals Row Function: `+e.totalsRowFunction)}}get width(){return this.table.columns.length}get height(){return this.table.rows.length}get filterHeight(){return this.height+ +!!this.table.headerRow}get tableHeight(){return this.filterHeight+ +!!this.table.totalsRow}validate(){let{table:e}=this,t=(e,t,n)=>{e[t]===void 0&&(e[t]=n)};t(e,`headerRow`,!0),t(e,`totalsRow`,!1),t(e,`style`,{}),t(e.style,`theme`,`TableStyleMedium2`),t(e.style,`showFirstColumn`,!1),t(e.style,`showLastColumn`,!1),t(e.style,`showRowStripes`,!1),t(e.style,`showColumnStripes`,!1);let n=(e,t)=>{if(!e)throw Error(t)};n(e.ref,`Table must have ref`),n(e.columns,`Table must have column definitions`),n(e.rows,`Table must have row definitions`),e.tl=r.decodeAddress(e.ref);let{row:i,col:a}=e.tl;n(i>0,`Table must be on valid row`),n(a>0,`Table must be on valid col`);let{width:o,filterHeight:s,tableHeight:c}=this;e.autoFilterRef=r.encode(i,a,i+s-1,a+o-1),e.tableRef=r.encode(i,a,i+c-1,a+o-1),e.columns.forEach((e,r)=>{n(e.name,`Column ${r} must have a name`),r===0?t(e,`totalsRowLabel`,`Total`):(t(e,`totalsRowFunction`,`none`),e.totalsRowFormula=this.getFormula(e))})}store(){let e=(e,t)=>{t&&Object.keys(t).forEach(n=>{e[n]=t[n]})},{worksheet:t,table:n}=this,{row:r,col:i}=n.tl,a=0;if(n.headerRow){let o=t.getRow(r+a++);n.columns.forEach((t,n)=>{let{style:r,name:a}=t,s=o.getCell(i+n);s.value=a,e(s,r)})}if(n.rows.forEach(o=>{let s=t.getRow(r+a++);o.forEach((t,r)=>{let a=s.getCell(i+r);a.value=t,e(a,n.columns[r].style)})}),n.totalsRow){let o=t.getRow(r+a++);n.columns.forEach((t,n)=>{let r=o.getCell(i+n);r.value=n===0?t.totalsRowLabel:this.getFormula(t)?{formula:t.totalsRowFormula,result:t.totalsRowResult}:null,e(r,t.style)})}}load(e){let{table:t}=this,{row:n,col:r}=t.tl,i=0;if(t.headerRow){let a=e.getRow(n+i++);t.columns.forEach((e,t)=>{a.getCell(r+t).value=e.name})}if(t.rows.forEach(t=>{let a=e.getRow(n+i++);t.forEach((e,t)=>{a.getCell(r+t).value=e})}),t.totalsRow){let a=e.getRow(n+i++);t.columns.forEach((e,t)=>{let n=a.getCell(r+t);t===0?n.value=e.totalsRowLabel:this.getFormula(e)&&(n.value={formula:e.totalsRowFormula,result:e.totalsRowResult})})}}get model(){return this.table}set model(e){this.table=e}cacheState(){this._cache||(this._cache={ref:this.ref,width:this.width,tableHeight:this.tableHeight})}commit(){if(!this._cache)return;this.validate();let e=r.decodeAddress(this._cache.ref);if(this.ref!==this._cache.ref)for(let t=0;t1&&arguments[1]!==void 0?arguments[1]:1;this.cacheState(),this.table.rows.splice(e,t)}getColumn(e){let t=this.table.columns[e];return new i(this,t,e)}addColumn(e,t,n){this.cacheState(),n===void 0?(this.table.columns.push(e),this.table.rows.forEach((e,n)=>{e.push(t[n])})):(this.table.columns.splice(n,0,e),this.table.rows.forEach((e,r)=>{e.splice(n,0,t[r])}))}removeColumns(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;this.cacheState(),this.table.columns.splice(e,t),this.table.rows.forEach(n=>{n.splice(e,t)})}_assign(e,t,n){this.cacheState(),e[t]=n}get ref(){return this.table.ref}set ref(e){this._assign(this.table,`ref`,e)}get name(){return this.table.name}set name(e){this.table.name=e}get displayName(){return this.table.displyName||this.table.name}set displayNamename(e){this.table.displayName=e}get headerRow(){return this.table.headerRow}set headerRow(e){this._assign(this.table,`headerRow`,e)}get totalsRow(){return this.table.totalsRow}set totalsRow(e){this._assign(this.table,`totalsRow`,e)}get theme(){return this.table.style.name}set theme(e){this.table.style.name=e}get showFirstColumn(){return this.table.style.showFirstColumn}set showFirstColumn(e){this.table.style.showFirstColumn=e}get showLastColumn(){return this.table.style.showLastColumn}set showLastColumn(e){this.table.style.showLastColumn=e}get showRowStripes(){return this.table.style.showRowStripes}set showRowStripes(e){this.table.style.showRowStripes=e}get showColumnStripes(){return this.table.style.showColumnStripes}set showColumnStripes(e){this.table.style.showColumnStripes=e}}},{"../utils/col-cache":19}],13:[function(e,t,n){let r=e(`./worksheet`),i=e(`./defined-names`),a=e(`../xlsx/xlsx`),o=e(`../csv/csv`);t.exports=class{constructor(){this.category=``,this.company=``,this.created=new Date,this.description=``,this.keywords=``,this.manager=``,this.modified=this.created,this.properties={},this.calcProperties={},this._worksheets=[],this.subject=``,this.title=``,this.views=[],this.media=[],this._definedNames=new i}get xlsx(){return this._xlsx||(this._xlsx=new a(this)),this._xlsx}get csv(){return this._csv||(this._csv=new o(this)),this._csv}get nextId(){for(let e=1;e(t&&t.orderNo)>e?t.orderNo:e,0),a=Object.assign({},t,{id:n,name:e,orderNo:i+1,workbook:this}),o=new r(a);return this._worksheets[n]=o,o}removeWorksheetEx(e){delete this._worksheets[e.id]}removeWorksheet(e){let t=this.getWorksheet(e);t&&t.destroy()}getWorksheet(e){return e===void 0?this._worksheets.find(Boolean):typeof e==`number`?this._worksheets[e]:typeof e==`string`?this._worksheets.find(t=>t&&t.name===e):void 0}get worksheets(){return this._worksheets.slice(1).sort((e,t)=>e.orderNo-t.orderNo).filter(Boolean)}eachSheet(e){this.worksheets.forEach(t=>{e(t,t.id)})}get definedNames(){return this._definedNames}clearThemes(){this._themes=void 0}addImage(e){let t=this.media.length;return this.media.push(Object.assign({},e,{type:`image`})),t}getImage(e){return this.media[e]}get model(){return{creator:this.creator||`Unknown`,lastModifiedBy:this.lastModifiedBy||`Unknown`,lastPrinted:this.lastPrinted,created:this.created,modified:this.modified,properties:this.properties,worksheets:this.worksheets.map(e=>e.model),sheets:this.worksheets.map(e=>e.model).filter(Boolean),definedNames:this._definedNames.model,views:this.views,company:this.company,manager:this.manager,title:this.title,subject:this.subject,keywords:this.keywords,category:this.category,description:this.description,language:this.language,revision:this.revision,contentStatus:this.contentStatus,themes:this._themes,media:this.media,calcProperties:this.calcProperties}}set model(e){this.creator=e.creator,this.lastModifiedBy=e.lastModifiedBy,this.lastPrinted=e.lastPrinted,this.created=e.created,this.modified=e.modified,this.company=e.company,this.manager=e.manager,this.title=e.title,this.subject=e.subject,this.keywords=e.keywords,this.category=e.category,this.description=e.description,this.language=e.language,this.revision=e.revision,this.contentStatus=e.contentStatus,this.properties=e.properties,this.calcProperties=e.calcProperties,this._worksheets=[],e.worksheets.forEach(t=>{let{id:n,name:i,state:a}=t,o=e.sheets&&e.sheets.findIndex(e=>e.id===n);(this._worksheets[n]=new r({id:n,name:i,orderNo:o,state:a,workbook:this})).model=t}),this._definedNames.model=e.definedNames,this.views=e.views,this._themes=e.themes,this.media=e.media||[]}}},{"../csv/csv":1,"../xlsx/xlsx":144,"./defined-names":6,"./worksheet":14}],14:[function(e,t,n){let r=e(`../utils/under-dash`),i=e(`../utils/col-cache`),a=e(`./range`),o=e(`./row`),s=e(`./column`),c=e(`./enums`),l=e(`./image`),u=e(`./table`),d=e(`./data-validations`),f=e(`../utils/encryptor`),{copyStyle:p}=e(`../utils/copy-style`);t.exports=class{constructor(e){e=e||{},this._workbook=e.workbook,this.id=e.id,this.orderNo=e.orderNo,this.name=e.name,this.state=e.state||`visible`,this._rows=[],this._columns=null,this._keys={},this._merges={},this.rowBreaks=[],this.properties=Object.assign({},{defaultRowHeight:15,dyDescent:55,outlineLevelCol:0,outlineLevelRow:0},e.properties),this.pageSetup=Object.assign({},{margins:{left:.7,right:.7,top:.75,bottom:.75,header:.3,footer:.3},orientation:`portrait`,horizontalDpi:4294967295,verticalDpi:4294967295,fitToPage:!(!e.pageSetup||!e.pageSetup.fitToWidth&&!e.pageSetup.fitToHeight||e.pageSetup.scale),pageOrder:`downThenOver`,blackAndWhite:!1,draft:!1,cellComments:`None`,errors:`displayed`,scale:100,fitToWidth:1,fitToHeight:1,paperSize:void 0,showRowColHeaders:!1,showGridLines:!1,firstPageNumber:void 0,horizontalCentered:!1,verticalCentered:!1,rowBreaks:null,colBreaks:null},e.pageSetup),this.headerFooter=Object.assign({},{differentFirst:!1,differentOddEven:!1,oddHeader:null,oddFooter:null,evenHeader:null,evenFooter:null,firstHeader:null,firstFooter:null},e.headerFooter),this.dataValidations=new d,this.views=e.views||[],this.autoFilter=e.autoFilter||null,this._media=[],this.sheetProtection=null,this.tables={},this.conditionalFormattings=[]}get name(){return this._name}set name(e){if(e===void 0&&(e=`sheet`+this.id),this._name!==e){if(typeof e!=`string`)throw Error(`The name has to be a string.`);if(e===``)throw Error(`The name can't be empty.`);if(e===`History`)throw Error(`The name "History" is protected. Please use a different name.`);if(/[*?:/\\[\]]/.test(e))throw Error(`Worksheet name ${e} cannot include any of the following characters: * ? : \\ / [ ]`);if(/(^')|('$)/.test(e))throw Error(`The first or last character of worksheet name cannot be a single quotation mark: `+e);if(e&&e.length>31&&(console.warn(`Worksheet name ${e} exceeds 31 chars. This will be truncated`),e=e.substring(0,31)),this._workbook._worksheets.find(t=>t&&t.name.toLowerCase()===e.toLowerCase()))throw Error(`Worksheet name already exists: `+e);this._name=e}}get workbook(){return this._workbook}destroy(){this._workbook.removeWorksheetEx(this)}get dimensions(){let e=new a;return this._rows.forEach(t=>{if(t){let n=t.dimensions;n&&e.expand(t.number,n.min,t.number,n.max)}}),e}get columns(){return this._columns}set columns(e){this._headerRowCount=e.reduce((e,t)=>{let n=(t.header?1:t.headers&&t.headers.length)||0;return Math.max(e,n)},0);let t=1,n=this._columns=[];e.forEach(e=>{let r=new s(this,t++,!1);n.push(r),r.defn=e})}getColumnKey(e){return this._keys[e]}setColumnKey(e,t){this._keys[e]=t}deleteColumnKey(e){delete this._keys[e]}eachColumnKey(e){r.each(this._keys,e)}getColumn(e){if(typeof e==`string`){let t=this._keys[e];if(t)return t;e=i.l2n(e)}if(this._columns||(this._columns=[]),e>this._columns.length){let t=this._columns.length+1;for(;t<=e;)this._columns.push(new s(this,t++))}return this._columns[e-1]}spliceColumns(e,t){let n=this._rows.length;var r=[...arguments].slice(2);if(r.length>0)for(let i=0;i{n.push(e[i]||null)});let a=this.getRow(i+1);a.splice.apply(a,n)}else this._rows.forEach(n=>{n&&n.splice(e,t)});let i=r.length-t,a=e+t,o=this._columns.length;if(i<0)for(let t=e+r.length;t<=o;t++)this.getColumn(t).defn=this.getColumn(t-i).defn;else if(i>0)for(let e=o;e>=a;e--)this.getColumn(e+i).defn=this.getColumn(e).defn;for(let t=e;t{e=Math.max(e,t.cellCount)}),e}get actualColumnCount(){let e=[],t=0;return this.eachRow(n=>{n.eachCell(n=>{let{col:r}=n;e[r]||(e[r]=!0,t++)})}),t}_commitRow(){}get _lastRowNumber(){let e=this._rows,t=e.length;for(;t>0&&e[t-1]===void 0;)t--;return t}get _nextRow(){return this._lastRowNumber+1}get lastRow(){if(this._rows.length)return this._rows[this._rows.length-1]}findRow(e){return this._rows[e-1]}findRows(e,t){return this._rows.slice(e-1,e-1+t)}get rowCount(){return this._lastRowNumber}get actualRowCount(){let e=0;return this.eachRow(()=>{e++}),e}getRow(e){let t=this._rows[e-1];return t||(t=this._rows[e-1]=new o(this,e)),t}getRows(e,t){if(t<1)return;let n=[];for(let r=e;r1&&arguments[1]!==void 0?arguments[1]:`n`,n=this._nextRow,r=this.getRow(n);return r.values=e,this._setStyleOption(n,t[0]===`i`?t:`n`),r}addRows(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:`n`,n=[];return e.forEach(e=>{n.push(this.addRow(e,t))}),n}insertRow(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:`n`;return this.spliceRows(e,0,t),this._setStyleOption(e,n),this.getRow(e)}insertRows(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:`n`;if(this.spliceRows(e,0,...t),n!==`n`)for(let r=0;r1&&arguments[1]!==void 0?arguments[1]:`n`;t[0]===`o`&&this.findRow(e+1)!==void 0?this._copyStyle(e+1,e,t[1]===`+`):t[0]===`i`&&this.findRow(e-1)!==void 0&&this._copyStyle(e-1,e,t[1]===`+`)}_copyStyle(e,t){let n=arguments.length>2&&arguments[2]!==void 0&&arguments[2],r=this.getRow(e),i=this.getRow(t);i.style=p(r.style),r.eachCell({includeEmpty:n},(e,t)=>{i.getCell(t).style=p(e.style)}),i.height=r.height}duplicateRow(e,t){let n=arguments.length>2&&arguments[2]!==void 0&&arguments[2],r=this._rows[e-1],i=Array(t).fill(r.values);this.spliceRows(e+1,n?0:t,...i);for(let n=0;n{t.getCell(n).style=e.style})}}spliceRows(e,t){let n=e+t;var r=[...arguments].slice(2);let i=r.length,a=i-t,o=this._rows.length,s,c;if(a<0)for(e===o&&(this._rows[o-1]=void 0),s=n;s<=o;s++)if(c=this._rows[s-1],c){let e=this.getRow(s+a);e.values=c.values,e.style=c.style,e.height=c.height,c.eachCell({includeEmpty:!0},(t,n)=>{e.getCell(n).style=t.style}),this._rows[s-1]=void 0}else this._rows[s+a-1]=void 0;else if(a>0)for(s=o;s>=n;s--)if(c=this._rows[s-1],c){let e=this.getRow(s+a);e.values=c.values,e.style=c.style,e.height=c.height,c.eachCell({includeEmpty:!0},(t,n)=>{if(e.getCell(n).style=t.style,t._value.constructor.name===`MergeValue`){let e=this.getRow(t._row._number+i).getCell(n),r=t._value._master,a=this.getRow(r._row._number+i).getCell(r._column._number);e.merge(a)}})}else this._rows[s+a-1]=void 0;for(s=0;s{e&&e.hasValues&&t(e,e.number)})}getSheetValues(){let e=[];return this._rows.forEach(t=>{t&&(e[t.number]=t.values)}),e}findCell(e,t){let n=i.getAddress(e,t),r=this._rows[n.row-1];return r?r.findCell(n.col):void 0}getCell(e,t){let n=i.getAddress(e,t);return this.getRow(n.row).getCellEx(n)}mergeCells(){let e=new a([...arguments]);this._mergeCellsInternal(e)}mergeCellsWithoutStyle(){let e=new a([...arguments]);this._mergeCellsInternal(e,!0)}_mergeCellsInternal(e,t){r.each(this._merges,t=>{if(t.intersects(e))throw Error(`Cannot merge already merged cells`)});let n=this.getCell(e.top,e.left);for(let r=e.top;r<=e.bottom;r++)for(let i=e.left;i<=e.right;i++)(r>e.top||i>e.left)&&this.getCell(r,i).merge(n,t);this._merges[n.address]=e}_unMergeMaster(e){let t=this._merges[e.address];if(t){for(let e=t.top;e<=t.bottom;e++)for(let n=t.left;n<=t.right;n++)this.getCell(e,n).unmerge();delete this._merges[e.address]}}get hasMerges(){return r.some(this._merges,Boolean)}unMergeCells(){let e=new a([...arguments]);for(let t=e.top;t<=e.bottom;t++)for(let n=e.left;n<=e.right;n++){let e=this.findCell(t,n);e&&(e.type===c.ValueType.Merge?this._unMergeMaster(e.master):this._merges[e.address]&&this._unMergeMaster(e))}}fillFormula(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:`shared`,{top:a,left:o,bottom:s,right:c}=i.decode(e),l=c-o+1,u=i.encodeAddress(a,o),d=r===`shared`,f;f=typeof n==`function`?n:Array.isArray(n)?Array.isArray(n[0])?(e,t)=>n[e-a][t-o]:(e,t)=>n[(e-a)*l+(t-o)]:()=>{};let p=!0;for(let n=a;n<=s;n++)for(let i=o;i<=c;i++)p?(this.getCell(n,i).value={shareType:r,formula:t,ref:e,result:f(n,i)},p=!1):this.getCell(n,i).value=d?{sharedFormula:u,result:f(n,i)}:f(n,i)}addImage(e,t){let n={type:`image`,imageId:e,range:t};this._media.push(new l(this,n))}getImages(){return this._media.filter(e=>e.type===`image`)}addBackgroundImage(e){let t={type:`background`,imageId:e};this._media.push(new l(this,t))}getBackgroundImageId(){let e=this._media.find(e=>e.type===`background`);return e&&e.imageId}protect(e,t){return new Promise(n=>{this.sheetProtection={sheet:!0},t&&`spinCount`in t&&(t.spinCount=Number.isFinite(t.spinCount)?Math.round(Math.max(0,t.spinCount)):1e5),e&&(this.sheetProtection.algorithmName=`SHA-512`,this.sheetProtection.saltValue=f.randomBytes(16).toString(`base64`),this.sheetProtection.spinCount=t&&`spinCount`in t?t.spinCount:1e5,this.sheetProtection.hashValue=f.convertPasswordToHash(e,`SHA512`,this.sheetProtection.saltValue,this.sheetProtection.spinCount)),t&&(this.sheetProtection=Object.assign(this.sheetProtection,t),!e&&`spinCount`in t&&delete this.sheetProtection.spinCount),n()})}unprotect(){this.sheetProtection=null}addTable(e){let t=new u(this,e);return this.tables[e.name]=t,t}getTable(e){return this.tables[e]}removeTable(e){delete this.tables[e]}getTables(){return Object.values(this.tables)}addConditionalFormatting(e){this.conditionalFormattings.push(e)}removeConditionalFormatting(e){typeof e==`number`?this.conditionalFormattings.splice(e,1):this.conditionalFormattings=e instanceof Function?this.conditionalFormattings.filter(e):[]}get tabColor(){return console.trace(`worksheet.tabColor property is now deprecated. Please use worksheet.properties.tabColor`),this.properties.tabColor}set tabColor(e){console.trace(`worksheet.tabColor property is now deprecated. Please use worksheet.properties.tabColor`),this.properties.tabColor=e}get model(){let e={id:this.id,name:this.name,dataValidations:this.dataValidations.model,properties:this.properties,state:this.state,pageSetup:this.pageSetup,headerFooter:this.headerFooter,rowBreaks:this.rowBreaks,views:this.views,autoFilter:this.autoFilter,media:this._media.map(e=>e.model),sheetProtection:this.sheetProtection,tables:Object.values(this.tables).map(e=>e.model),conditionalFormattings:this.conditionalFormattings};e.cols=s.toModel(this.columns);let t=e.rows=[],n=e.dimensions=new a;return this._rows.forEach(e=>{let r=e&&e.model;r&&(n.expand(r.number,r.min,r.number,r.max),t.push(r))}),e.merges=[],r.each(this._merges,t=>{e.merges.push(t.range)}),e}_parseRows(e){this._rows=[],e.rows.forEach(e=>{let t=new o(this,e.number);this._rows[t.number-1]=t,t.model=e})}_parseMergeCells(e){r.each(e.mergeCells,e=>{this.mergeCellsWithoutStyle(e)})}set model(e){this.name=e.name,this._columns=s.fromModel(this,e.cols),this._parseRows(e),this._parseMergeCells(e),this.dataValidations=new d(e.dataValidations),this.properties=e.properties,this.pageSetup=e.pageSetup,this.headerFooter=e.headerFooter,this.views=e.views,this.autoFilter=e.autoFilter,this._media=e.media.map(e=>new l(this,e)),this.sheetProtection=e.sheetProtection,this.tables=e.tables.reduce((e,t)=>{let n=new u;return n.model=t,e[t.name]=n,e},{}),this.conditionalFormattings=e.conditionalFormattings}}},{"../utils/col-cache":19,"../utils/copy-style":20,"../utils/encryptor":21,"../utils/under-dash":26,"./column":4,"./data-validations":5,"./enums":7,"./image":8,"./range":10,"./row":11,"./table":12}],15:[function(e,t,n){e(`core-js/modules/es.promise`),e(`core-js/modules/es.promise.finally`),e(`core-js/modules/es.object.assign`),e(`core-js/modules/es.object.keys`),e(`core-js/modules/es.object.values`),e(`core-js/modules/es.symbol`),e(`core-js/modules/es.symbol.async-iterator`),e(`core-js/modules/es.array.iterator`),e(`core-js/modules/es.array.includes`),e(`core-js/modules/es.array.find-index`),e(`core-js/modules/es.array.find`),e(`core-js/modules/es.string.from-code-point`),e(`core-js/modules/es.string.includes`),e(`core-js/modules/es.number.is-nan`),e(`regenerator-runtime/runtime`);let r={Workbook:e(`./doc/workbook`)},i=e(`./doc/enums`);Object.keys(i).forEach(e=>{r[e]=i[e]}),t.exports=r},{"./doc/enums":7,"./doc/workbook":13,"core-js/modules/es.array.find":359,"core-js/modules/es.array.find-index":358,"core-js/modules/es.array.includes":360,"core-js/modules/es.array.iterator":361,"core-js/modules/es.number.is-nan":363,"core-js/modules/es.object.assign":364,"core-js/modules/es.object.keys":366,"core-js/modules/es.object.values":367,"core-js/modules/es.promise":372,"core-js/modules/es.promise.finally":371,"core-js/modules/es.string.from-code-point":376,"core-js/modules/es.string.includes":377,"core-js/modules/es.symbol":381,"core-js/modules/es.symbol.async-iterator":378,"regenerator-runtime/runtime":492}],16:[function(e,t,n){let r=typeof TextDecoder>`u`?null:new TextDecoder(`utf-8`);n.bufferToString=function(e){return typeof e==`string`?e:r?r.decode(e):e.toString()}},{}],17:[function(e,t,n){let r=typeof TextEncoder>`u`?null:new TextEncoder(`utf-8`),{Buffer:i}=e(`buffer`);n.stringToBuffer=function(e){return typeof e==`string`?r?i.from(r.encode(e).buffer):i.from(e):e}},{buffer:220}],18:[function(e,t,n){let r=e(`./under-dash`),i=e(`./col-cache`);t.exports=class{constructor(e){this.template=e,this.sheets={}}addCell(e){this.addCellEx(i.decodeEx(e))}getCell(e){return this.findCellEx(i.decodeEx(e),!0)}findCell(e){return this.findCellEx(i.decodeEx(e),!1)}findCellAt(e,t,n){let r=this.sheets[e],i=r&&r[t];return i&&i[n]}addCellEx(e){if(e.top)for(let t=e.top;t<=e.bottom;t++)for(let n=e.left;n<=e.right;n++)this.getCellAt(e.sheetName,t,n);else this.findCellEx(e,!0)}getCellEx(e){return this.findCellEx(e,!0)}findCellEx(e,t){let n=this.findSheet(e,t),r=this.findSheetRow(n,e,t);return this.findRowCell(r,e,t)}getCellAt(e,t,n){let r=this.sheets[e]||(this.sheets[e]=[]),a=r[t]||(r[t]=[]);return a[n]||(a[n]={sheetName:e,address:i.n2l(n)+t,row:t,col:n})}removeCellEx(e){let t=this.findSheet(e);if(!t)return;let n=this.findSheetRow(t,e);n&&delete n[e.col]}forEachInSheet(e,t){let n=this.sheets[e];n&&n.forEach((e,n)=>{e&&e.forEach((e,r)=>{e&&t(e,n,r)})})}forEach(e){r.each(this.sheets,(t,n)=>{this.forEachInSheet(n,e)})}map(e){let t=[];return this.forEach(n=>{t.push(e(n))}),t}findSheet(e,t){let n=e.sheetName;return this.sheets[n]?this.sheets[n]:t?this.sheets[n]=[]:void 0}findSheetRow(e,t,n){let{row:r}=t;return e&&e[r]?e[r]:n?e[r]=[]:void 0}findRowCell(e,t,n){let{col:r}=t;return e&&e[r]?e[r]:n?e[r]=this.template?Object.assign(t,JSON.parse(JSON.stringify(this.template))):t:void 0}spliceRows(e,t,n,r){let i=this.sheets[e];if(i){let e=[];for(let t=0;t{r.splice(t,n,...e)})}}}},{"./col-cache":19,"./under-dash":26}],19:[function(e,t,n){let r=/^[A-Z]+\d+$/,i={_dictionary:`ABCDEFGHIJKLMNOPQRSTUVWXYZ`.split(``),_l2nFill:0,_l2n:{},_n2l:[],_level:e=>e<=26?1:e<=676?2:3,_fill(e){let t,n,r,i,a,o=1;if(e>=4)throw Error(`Out of bounds. Excel supports columns from 1 to 16384`);if(this._l2nFill<1&&e>=1){for(;o<=26;)t=this._dictionary[o-1],this._n2l[o]=t,this._l2n[t]=o,o++;this._l2nFill=1}if(this._l2nFill<2&&e>=2){for(o=27;o<=702;)n=o-27,r=n%26,i=Math.floor(n/26),t=this._dictionary[i]+this._dictionary[r],this._n2l[o]=t,this._l2n[t]=o,o++;this._l2nFill=2}if(this._l2nFill<3&&e>=3){for(o=703;o<=16384;)n=o-703,r=n%26,i=Math.floor(n/26)%26,a=Math.floor(n/676),t=this._dictionary[a]+this._dictionary[i]+this._dictionary[r],this._n2l[o]=t,this._l2n[t]=o,o++;this._l2nFill=3}},l2n(e){if(this._l2n[e]||this._fill(e.length),!this._l2n[e])throw Error(`Out of bounds. Invalid column letter: `+e);return this._l2n[e]},n2l(e){if(e<1||e>16384)throw Error(e+` is out of bounds. Excel supports columns from 1 to 16384`);return this._n2l[e]||this._fill(this._level(e)),this._n2l[e]},_hash:{},validateAddress(e){if(!r.test(e))throw Error(`Invalid Address: `+e);return!0},decodeAddress(e){let t=e.length<5&&this._hash[e];if(t)return t;let n=!1,r=``,i=0,a=!1,o=``,s=0;for(let t,c=0;c=65&&t<=90)n=!0,r+=e[c],i=26*i+t-64;else if(t>=48&&t<=57)a=!0,o+=e[c],s=10*s+t-48;else if(a&&n&&t!==36)break;if(n){if(i>16384)throw Error(`Out of bounds. Invalid column letter: `+r)}else i=void 0;a||(s=void 0);let c={address:e=r+o,col:i,row:s,$col$row:`$${r}$${o}`};return i<=100&&s<=100&&(this._hash[e]=c,this._hash[c.$col$row]=c),c},getAddress(e,t){if(t){let n=this.n2l(t)+e;return this.decodeAddress(n)}return this.decodeAddress(e)},decode(e){let t=e.split(`:`);if(t.length===2){let e=this.decodeAddress(t[0]),n=this.decodeAddress(t[1]),r={top:Math.min(e.row,n.row),left:Math.min(e.col,n.col),bottom:Math.max(e.row,n.row),right:Math.max(e.col,n.col)};return r.tl=this.n2l(r.left)+r.top,r.br=this.n2l(r.right)+r.bottom,r.dimensions=`${r.tl}:${r.br}`,r}return this.decodeAddress(e)},decodeEx(e){let t=e.match(/(?:(?:(?:'((?:[^']|'')*)')|([^'^ !]*))!)?(.*)/),n=t[1]||t[2],r=t[3],i=r.split(`:`);if(i.length>1){let e=this.decodeAddress(i[0]),t=this.decodeAddress(i[1]),r=Math.min(e.row,t.row),a=Math.min(e.col,t.col),o=Math.max(e.row,t.row),s=Math.max(e.col,t.col);return e=this.n2l(a)+r,t=this.n2l(s)+o,{top:r,left:a,bottom:o,right:s,sheetName:n,tl:{address:e,col:a,row:r,$col$row:`$${this.n2l(a)}$${r}`,sheetName:n},br:{address:t,col:s,row:o,$col$row:`$${this.n2l(s)}$${o}`,sheetName:n},dimensions:`${e}:${t}`}}if(r.startsWith(`#`))return n?{sheetName:n,error:r}:{error:r};let a=this.decodeAddress(r);return n?{sheetName:n,...a}:a},encodeAddress:(e,t)=>i.n2l(t)+e,encode(){switch(arguments.length){case 2:return i.encodeAddress(arguments[0],arguments[1]);case 4:return`${i.encodeAddress(arguments[0],arguments[1])}:${i.encodeAddress(arguments[2],arguments[3])}`;default:throw Error(`Can only encode with 2 or 4 arguments`)}},inRange(e,t){let[n,r,,i,a]=e,[o,s]=t;return o>=n&&o<=i&&s>=r&&s<=a}};t.exports=i},{}],20:[function(e,t,n){let r=(e,t)=>({...e,...t.reduce((t,n)=>(e[n]&&(t[n]={...e[n]}),t),{})}),i=function(e,t,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:[];e[n]&&(t[n]=r(e[n],i))};n.copyStyle=e=>{if(!e)return e;if(t=e,Object.keys(t).length===0)return{};var t;let n={...e};return i(e,n,`font`,[`color`]),i(e,n,`alignment`),i(e,n,`protection`),e.border&&(i(e,n,`border`),i(e.border,n.border,`top`,[`color`]),i(e.border,n.border,`left`,[`color`]),i(e.border,n.border,`bottom`,[`color`]),i(e.border,n.border,`right`,[`color`]),i(e.border,n.border,`diagonal`,[`color`])),e.fill&&(i(e,n,`fill`,[`fgColor`,`bgColor`,`center`]),e.fill.stops&&(n.fill.stops=e.fill.stops.map(e=>r(e,[`color`])))),n}},{}],21:[function(e,t,n){(function(n){(function(){let r=e(`crypto`);t.exports={hash(e){let t=r.createHash(e);var i=[...arguments].slice(1);return t.update(n.concat(i)),t.digest()},convertPasswordToHash(e,t,i,a){if(t=t.toLowerCase(),r.getHashes().indexOf(t)<0)throw Error(`Hash algorithm '${t}' not supported!`);let o=n.from(e,`utf16le`),s=this.hash(t,n.from(i,`base64`),o);for(let e=0;er.randomBytes(e)}}).call(this)}).call(this,e(`buffer`).Buffer)},{buffer:220,crypto:390}],22:[function(e,t,n){let{SaxesParser:r}=e(`saxes`),{PassThrough:i}=e(`readable-stream`),{bufferToString:a}=e(`./browser-buffer-decode`);t.exports=async function*(e){e.pipe&&!e[Symbol.asyncIterator]&&(e=e.pipe(new i));let t=new r,n;t.on(`error`,e=>{n=e});let o=[];t.on(`opentag`,e=>o.push({eventType:`opentag`,value:e})),t.on(`text`,e=>o.push({eventType:`text`,value:e})),t.on(`closetag`,e=>o.push({eventType:`closetag`,value:e}));for await(let r of e){if(t.write(a(r)),n)throw n;yield o,o=[]}}},{"./browser-buffer-decode":16,"readable-stream":491,saxes:496}],23:[function(e,t,n){let r=e(`./col-cache`),i=/(([a-z_\-0-9]*)!)?([a-z0-9_$]{2,})([(])?/gi,a=/^([$])?([a-z]+)([$])?([1-9][0-9]*)$/i;t.exports={slideFormula:function(e,t,n){let o=r.decode(t),s=r.decode(n);return e.replace(i,(e,t,n,i,c)=>{if(c)return e;let l=a.exec(i);if(l){let n=l[1],i=l[2].toUpperCase(),a=l[3],c=l[4];if(i.length>3||i.length===3&&i>`XFD`)return e;let u=r.l2n(i),d=parseInt(c,10);return n||(u+=s.col-o.col),a||(d+=s.row-o.row),(t||``)+(n||``)+r.n2l(u)+(a||``)+d}return e})}}},{"./col-cache":19}],24:[function(e,t,n){(function(n,r){(function(){let i=e(`readable-stream`),a=e(`./utils`),o=e(`./string-buf`);class s{constructor(e,t){this._data=e,this._encoding=t}get length(){return this.toBuffer().length}copy(e,t,n,r){return this.toBuffer().copy(e,t,n,r)}toBuffer(){return this._buffer||(this._buffer=r.from(this._data,this._encoding)),this._buffer}}class c{constructor(e){this._data=e}get length(){return this._data.length}copy(e,t,n,r){return this._data._buf.copy(e,t,n,r)}toBuffer(){return this._data.toBuffer()}}class l{constructor(e){this._data=e}get length(){return this._data.length}copy(e,t,n,r){this._data.copy(e,t,n,r)}toBuffer(){return this._data}}class u{constructor(e){this.size=e,this.buffer=r.alloc(e),this.iRead=0,this.iWrite=0}toBuffer(){if(this.iRead===0&&this.iWrite===this.size)return this.buffer;let e=r.alloc(this.iWrite-this.iRead);return this.buffer.copy(e,0,this.iRead,this.iWrite),e}get length(){return this.iWrite-this.iRead}get eod(){return this.iRead===this.iWrite}get full(){return this.iWrite===this.size}read(e){let t;return e===0?null:e===void 0||e>=this.length?(t=this.toBuffer(),this.iRead=this.iWrite,t):(t=r.alloc(e),this.buffer.copy(t,0,this.iRead,e),this.iRead+=e,t)}write(e,t,n){let r=Math.min(n,this.size-this.iWrite);return e.copy(this.buffer,this.iWrite,t,t+r),this.iWrite+=r,r}}let d=function(e){e=e||{},this.bufSize=e.bufSize||1048576,this.buffers=[],this.batch=e.batch||!1,this.corked=!1,this.inPos=0,this.outPos=0,this.pipes=[],this.paused=!1,this.encoding=null};a.inherits(d,i.Duplex,{toBuffer(){switch(this.buffers.length){case 0:return null;case 1:return this.buffers[0].toBuffer();default:return r.concat(this.buffers.map(e=>e.toBuffer()))}},_getWritableBuffer(){if(this.buffers.length){let e=this.buffers[this.buffers.length-1];if(!e.full)return e}let e=new u(this.bufSize);return this.buffers.push(e),e},async _pipe(e){await Promise.all(this.pipes.map((function(t){return new Promise(n=>{t.write(e.toBuffer(),()=>{n()})})})))},_writeToBuffers(e){let t=0,n=e.length;for(;t1;)this._pipe(this.buffers.shift());else this.corked?(this._writeToBuffers(u),n.nextTick(i)):(await this._pipe(u),i())}else this.paused||this.emit(`data`,u.toBuffer()),this._writeToBuffers(u),this.emit(`readable`);return!0},cork(){this.corked=!0},_flush(){if(this.pipes.length)for(;this.buffers.length;)this._pipe(this.buffers.shift())},uncork(){this.corked=!1,this._flush()},end(e,t,n){let r=e=>{e?n(e):(this._flush(),this.pipes.forEach(e=>{e.end()}),this.emit(`finish`))};e?this.write(e,t,r):r()},read(e){let t;if(e){for(t=[];e&&this.buffers.length&&!this.buffers[0].eod;){let n=this.buffers[0],r=n.read(e);e-=r.length,t.push(r),n.eod&&n.full&&this.buffers.shift()}return r.concat(t)}return t=this.buffers.map(e=>e.toBuffer()).filter(Boolean),this.buffers=[],r.concat(t)},setEncoding(e){this.encoding=e},pause(){this.paused=!0},resume(){this.paused=!1},isPaused(){return!!this.paused},pipe(e){this.pipes.push(e),!this.paused&&this.buffers.length&&this.end()},unpipe(e){this.pipes=this.pipes.filter(t=>t!==e)},unshift(){throw Error(`Not Implemented`)},wrap(){throw Error(`Not Implemented`)}}),t.exports=d}).call(this)}).call(this,e(`_process`),e(`buffer`).Buffer)},{"./string-buf":25,"./utils":27,_process:467,buffer:220,"readable-stream":491}],25:[function(e,t,n){(function(e){(function(){t.exports=class{constructor(t){this._buf=e.alloc(t&&t.size||16384),this._encoding=t&&t.encoding||`utf8`,this._inPos=0,this._buffer=void 0}get length(){return this._inPos}get capacity(){return this._buf.length}get buffer(){return this._buf}toBuffer(){return this._buffer||(this._buffer=e.alloc(this.length),this._buf.copy(this._buffer,0,0,this.length)),this._buffer}reset(e){e=e||0,this._buffer=void 0,this._inPos=e}_grow(t){let n=2*this._buf.length;for(;n=this._buf.length-4;)this._grow(this._inPos+e.length),t=this._inPos+this._buf.write(e,this._inPos,this._encoding);this._inPos=t}addStringBuf(e){e.length&&(this._buffer=void 0,this.length+e.length>this.capacity&&this._grow(this.length+e.length),e._buf.copy(this._buf,this._inPos,0,e.length),this._inPos+=e.length)}}}).call(this)}).call(this,e(`buffer`).Buffer)},{buffer:220}],26:[function(e,t,n){let{toString:r}=Object.prototype,i=/["&<>]/,a={each:function(e,t){e&&(Array.isArray(e)?e.forEach(t):Object.keys(e).forEach(n=>{t(e[n],n)}))},some:function(e,t){return!!e&&(Array.isArray(e)?e.some(t):Object.keys(e).some(n=>t(e[n],n)))},every:function(e,t){return!e||(Array.isArray(e)?e.every(t):Object.keys(e).every(n=>t(e[n],n)))},map:function(e,t){return e?Array.isArray(e)?e.map(t):Object.keys(e).map(n=>t(e[n],n)):[]},keyBy:(e,t)=>e.reduce((e,n)=>(e[n[t]]=n,e),{}),isEqual:function(e,t){let n=typeof e,r=typeof t,i=Array.isArray(e),o=Array.isArray(t),s;if(n!==r)return!1;switch(typeof e){case`object`:if(i||o)return!(!i||!o)&&e.length===t.length&&e.every((e,n)=>{let r=t[n];return a.isEqual(e,r)});if(e===null||t===null)return e===t;if(s=Object.keys(e),Object.keys(t).length!==s.length)return!1;for(let e of s)if(!t.hasOwnProperty(e))return!1;return a.every(e,(e,n)=>{let r=t[n];return a.isEqual(e,r)});default:return e===t}},escapeHtml(e){let t=i.exec(e);if(!t)return e;let n=``,r=``,a=0,o=t.index;for(;o`:r=`>`;break;default:continue}a!==o&&(n+=e.substring(a,o)),a=o+1,n+=r}return a===o?n:n+e.substring(a,o)},strcmp:(e,t)=>et),isUndefined:e=>r.call(e)===`[object Undefined]`,isObject:e=>r.call(e)===`[object Object]`,deepMerge(){let e=arguments[0]||{},{length:t}=arguments,n,r,i;function o(t,o){n=e[o],i=Array.isArray(t),a.isObject(t)||i?(i?(i=!1,r=n&&Array.isArray(n)?n:[]):r=n&&a.isObject(n)?n:{},e[o]=a.deepMerge(r,t)):a.isUndefined(t)||(e[o]=t)}for(let e=0;e&'"\x7F\x00-\x08\x0B-\x0C\x0E-\x1F]/,o={nop(){},promiseImmediate:e=>new Promise(t=>{n.setImmediate?r(()=>{t(e)}):setTimeout(()=>{t(e)},1)}),inherits:function(e,t,n,r){e.super_=t,r||(r=n,n=null),n&&Object.keys(n).forEach(t=>{Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))});let i={constructor:{value:e,enumerable:!1,writable:!1,configurable:!0}};r&&Object.keys(r).forEach(e=>{i[e]=Object.getOwnPropertyDescriptor(r,e)}),e.prototype=Object.create(t.prototype,i)},dateToExcel:(e,t)=>25569+e.getTime()/864e5-(t?1462:0),excelToDate(e,t){let n=Math.round(24*(e-25569+(t?1462:0))*3600*1e3);return new Date(n)},parsePath(e){let t=e.lastIndexOf(`/`);return{path:e.substring(0,t),name:e.substring(t+1)}},getRelsPath(e){let t=o.parsePath(e);return`${t.path}/_rels/${t.name}.rels`},xmlEncode(e){let t=a.exec(e);if(!t)return e;let n=``,r=``,i=0,o=t.index;for(;o=11&&t!==13)){r=``;break}continue}i!==o&&(n+=e.substring(i,o)),i=o+1,r&&(n+=r)}return i===o?n:n+e.substring(i,o)},xmlDecode:e=>e.replace(/&([a-z]*);/g,e=>{switch(e){case`<`:return`<`;case`>`:return`>`;case`&`:return`&`;case`'`:return`'`;case`"`:return`"`;default:return e}}),validInt(e){let t=parseInt(e,10);return Number.isNaN(t)?0:t},isDateFmt(e){return e?(e=(e=e.replace(/\[[^\]]*]/g,``)).replace(/"[^"]*"/g,``)).match(/[ymdhMsb]+/)!==null:!1},fs:{exists:e=>new Promise(t=>{i.access(e,i.constants.F_OK,e=>{t(!e)})})},toIsoDateString:e=>e.toIsoString().subsstr(0,10),parseBoolean:e=>!0===e||e===`true`||e===1||e===`1`};t.exports=o}).call(this)}).call(this,typeof global<`u`?global:typeof self<`u`?self:typeof window<`u`?window:{},e(`timers`).setImmediate)},{fs:216,timers:523}],28:[function(e,t,n){let r=e(`./under-dash`),i=e(`./utils`);function a(e,t,n){e.push(` ${t}="${i.xmlEncode(n.toString())}"`)}function o(e,t){if(t){let n=[];r.each(t,(e,t)=>{e!==void 0&&a(n,t,e)}),e.push(n.join(``))}}class s{constructor(){this._xml=[],this._stack=[],this._rollbacks=[]}get tos(){return this._stack.length?this._stack[this._stack.length-1]:void 0}get cursor(){return this._xml.length}openXml(e){let t=this._xml;t.push(` `)}openNode(e,t){let n=this.tos,r=this._xml;n&&this.open&&r.push(`>`),this._stack.push(e),r.push(`<`),r.push(e),o(r,t),this.leaf=!0,this.open=!0}addAttribute(e,t){if(!this.open)throw Error(`Cannot write attributes to node if it is not open`);t!==void 0&&a(this._xml,e,t)}addAttributes(e){if(!this.open)throw Error(`Cannot write attributes to node if it is not open`);o(this._xml,e)}writeText(e){let t=this._xml;this.open&&(t.push(`>`),this.open=!1),this.leaf=!1,t.push(i.xmlEncode(e.toString()))}writeXml(e){this.open&&(this._xml.push(`>`),this.open=!1),this.leaf=!1,this._xml.push(e)}closeNode(){let e=this._stack.pop(),t=this._xml;this.leaf?t.push(`/>`):(t.push(``)),this.open=!1,this.leaf=!1}leafNode(e,t,n){this.openNode(e,t),n!==void 0&&this.writeText(n),this.closeNode()}closeAll(){for(;this._stack.length;)this.closeNode()}addRollback(){return this._rollbacks.push({xml:this._xml.length,stack:this._stack.length,leaf:this.leaf,open:this.open}),this.cursor}commit(){this._rollbacks.pop()}rollback(){let e=this._rollbacks.pop();this._xml.length>e.xml&&this._xml.splice(e.xml,this._xml.length-e.xml),this._stack.length>e.stack&&this._stack.splice(e.stack,this._stack.length-e.stack),this.leaf=e.leaf,this.open=e.open}get xml(){return this.closeAll(),this._xml.join(``)}}s.StdDocAttributes={version:`1.0`,encoding:`UTF-8`,standalone:`yes`},t.exports=s},{"./under-dash":26,"./utils":27}],29:[function(e,t,n){(function(n){(function(){let r=e(`events`),i=e(`jszip`),a=e(`./stream-buf`),{stringToBuffer:o}=e(`./browser-buffer-encode`);class s extends r.EventEmitter{constructor(e){super(),this.options=Object.assign({type:`nodebuffer`,compression:`DEFLATE`},e),this.zip=new i,this.stream=new a}append(e,t){t.hasOwnProperty(`base64`)&&t.base64?this.zip.file(t.name,e,{base64:!0}):(n.browser&&typeof e==`string`&&(e=o(e)),this.zip.file(t.name,e))}async finalize(){let e=await this.zip.generateAsync(this.options);this.stream.end(e),this.emit(`finish`)}read(e){return this.stream.read(e)}setEncoding(e){return this.stream.setEncoding(e)}pause(){return this.stream.pause()}resume(){return this.stream.resume()}isPaused(){return this.stream.isPaused()}pipe(e,t){return this.stream.pipe(e,t)}unpipe(e){return this.stream.unpipe(e)}unshift(e){return this.stream.unshift(e)}wrap(e){return this.stream.wrap(e)}}t.exports={ZipWriter:s}}).call(this)}).call(this,e(`_process`))},{"./browser-buffer-encode":17,"./stream-buf":24,_process:467,events:422,jszip:441}],30:[function(e,t,n){t.exports={0:{f:`General`},1:{f:`0`},2:{f:`0.00`},3:{f:`#,##0`},4:{f:`#,##0.00`},9:{f:`0%`},10:{f:`0.00%`},11:{f:`0.00E+00`},12:{f:`# ?/?`},13:{f:`# ??/??`},14:{f:`mm-dd-yy`},15:{f:`d-mmm-yy`},16:{f:`d-mmm`},17:{f:`mmm-yy`},18:{f:`h:mm AM/PM`},19:{f:`h:mm:ss AM/PM`},20:{f:`h:mm`},21:{f:`h:mm:ss`},22:{f:`m/d/yy "h":mm`},27:{"zh-tw":`[$-404]e/m/d`,"zh-cn":`yyyy"年"m"月"`,"ja-jp":`[$-411]ge.m.d`,"ko-kr":`yyyy"年" mm"月" dd"日"`},28:{"zh-tw":`[$-404]e"年"m"月"d"日"`,"zh-cn":`m"月"d"日"`,"ja-jp":`[$-411]ggge"年"m"月"d"日"`,"ko-kr":`mm-dd`},29:{"zh-tw":`[$-404]e"年"m"月"d"日"`,"zh-cn":`m"月"d"日"`,"ja-jp":`[$-411]ggge"年"m"月"d"日"`,"ko-kr":`mm-dd`},30:{"zh-tw":`m/d/yy `,"zh-cn":`m-d-yy`,"ja-jp":`m/d/yy`,"ko-kr":`mm-dd-yy`},31:{"zh-tw":`yyyy"年"m"月"d"日"`,"zh-cn":`yyyy"年"m"月"d"日"`,"ja-jp":`yyyy"年"m"月"d"日"`,"ko-kr":`yyyy"년" mm"월" dd"일"`},32:{"zh-tw":`hh"時"mm"分"`,"zh-cn":`h"时"mm"分"`,"ja-jp":`h"時"mm"分"`,"ko-kr":`h"시" mm"분"`},33:{"zh-tw":`hh"時"mm"分"ss"秒"`,"zh-cn":`h"时"mm"分"ss"秒"`,"ja-jp":`h"時"mm"分"ss"秒"`,"ko-kr":`h"시" mm"분" ss"초"`},34:{"zh-tw":`上午/下午 hh"時"mm"分"`,"zh-cn":`上午/下午 h"时"mm"分"`,"ja-jp":`yyyy"年"m"月"`,"ko-kr":`yyyy-mm-dd`},35:{"zh-tw":`上午/下午 hh"時"mm"分"ss"秒"`,"zh-cn":`上午/下午 h"时"mm"分"ss"秒"`,"ja-jp":`m"月"d"日"`,"ko-kr":`yyyy-mm-dd`},36:{"zh-tw":`[$-404]e/m/d`,"zh-cn":`yyyy"年"m"月"`,"ja-jp":`[$-411]ge.m.d`,"ko-kr":`yyyy"年" mm"月" dd"日"`},37:{f:`#,##0 ;(#,##0)`},38:{f:`#,##0 ;[Red](#,##0)`},39:{f:`#,##0.00 ;(#,##0.00)`},40:{f:`#,##0.00 ;[Red](#,##0.00)`},45:{f:`mm:ss`},46:{f:`[h]:mm:ss`},47:{f:`mmss.0`},48:{f:`##0.0E+0`},49:{f:`@`},50:{"zh-tw":`[$-404]e/m/d`,"zh-cn":`yyyy"年"m"月"`,"ja-jp":`[$-411]ge.m.d`,"ko-kr":`yyyy"年" mm"月" dd"日"`},51:{"zh-tw":`[$-404]e"年"m"月"d"日"`,"zh-cn":`m"月"d"日"`,"ja-jp":`[$-411]ggge"年"m"月"d"日"`,"ko-kr":`mm-dd`},52:{"zh-tw":`上午/下午 hh"時"mm"分"`,"zh-cn":`yyyy"年"m"月"`,"ja-jp":`yyyy"年"m"月"`,"ko-kr":`yyyy-mm-dd`},53:{"zh-tw":`上午/下午 hh"時"mm"分"ss"秒"`,"zh-cn":`m"月"d"日"`,"ja-jp":`m"月"d"日"`,"ko-kr":`yyyy-mm-dd`},54:{"zh-tw":`[$-404]e"年"m"月"d"日"`,"zh-cn":`m"月"d"日"`,"ja-jp":`[$-411]ggge"年"m"月"d"日"`,"ko-kr":`mm-dd`},55:{"zh-tw":`上午/下午 hh"時"mm"分"`,"zh-cn":`上午/下午 h"时"mm"分"`,"ja-jp":`yyyy"年"m"月"`,"ko-kr":`yyyy-mm-dd`},56:{"zh-tw":`上午/下午 hh"時"mm"分"ss"秒"`,"zh-cn":`上午/下午 h"时"mm"分"ss"秒"`,"ja-jp":`m"月"d"日"`,"ko-kr":`yyyy-mm-dd`},57:{"zh-tw":`[$-404]e/m/d`,"zh-cn":`yyyy"年"m"月"`,"ja-jp":`[$-411]ge.m.d`,"ko-kr":`yyyy"年" mm"月" dd"日"`},58:{"zh-tw":`[$-404]e"年"m"月"d"日"`,"zh-cn":`m"月"d"日"`,"ja-jp":`[$-411]ggge"年"m"月"d"日"`,"ko-kr":`mm-dd`},59:{"th-th":`t0`},60:{"th-th":`t0.00`},61:{"th-th":`t#,##0`},62:{"th-th":`t#,##0.00`},67:{"th-th":`t0%`},68:{"th-th":`t0.00%`},69:{"th-th":`t# ?/?`},70:{"th-th":`t# ??/??`},81:{"th-th":`d/m/bb`}}},{}],31:[function(e,t,n){t.exports={OfficeDocument:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument`,Worksheet:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet`,CalcChain:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/calcChain`,SharedStrings:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings`,Styles:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles`,Theme:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme`,Hyperlink:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink`,Image:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/image`,CoreProperties:`http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties`,ExtenderProperties:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties`,Comments:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments`,VmlDrawing:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing`,Table:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/table`}},{}],32:[function(e,t,n){let r=e(`../../utils/parse-sax`),i=e(`../../utils/xml-stream`);class a{prepare(){}render(){}parseOpen(e){}parseText(e){}parseClose(e){}reconcile(e,t){}reset(){this.model=null,this.map&&Object.values(this.map).forEach(e=>{e instanceof a?e.reset():e.xform&&e.xform.reset()})}mergeModel(e){this.model=Object.assign(this.model||{},e)}async parse(e){for await(let t of e)for(let{eventType:e,value:n}of t)if(e===`opentag`)this.parseOpen(n);else if(e===`text`)this.parseText(n);else if(e===`closetag`&&!this.parseClose(n.name))return this.model;return this.model}async parseStream(e){return this.parse(r(e))}get xml(){return this.toXml(this.model)}toXml(e){let t=new i;return this.render(t,e),t.xml}static toAttribute(e,t){let n=arguments.length>2&&arguments[2]!==void 0&&arguments[2];if(e===void 0){if(n)return t}else if(n||e!==t)return e.toString()}static toStringAttribute(e,t){let n=arguments.length>2&&arguments[2]!==void 0&&arguments[2];return a.toAttribute(e,t,n)}static toStringValue(e,t){return e===void 0?t:e}static toBoolAttribute(e,t){let n=arguments.length>2&&arguments[2]!==void 0&&arguments[2];if(e===void 0){if(n)return t}else if(n||e!==t)return e?`1`:`0`}static toBoolValue(e,t){return e===void 0?t:e===`1`}static toIntAttribute(e,t){let n=arguments.length>2&&arguments[2]!==void 0&&arguments[2];return a.toAttribute(e,t,n)}static toIntValue(e,t){return e===void 0?t:parseInt(e,10)}static toFloatAttribute(e,t){let n=arguments.length>2&&arguments[2]!==void 0&&arguments[2];return a.toAttribute(e,t,n)}static toFloatValue(e,t){return e===void 0?t:parseFloat(e)}}t.exports=a},{"../../utils/parse-sax":22,"../../utils/xml-stream":28}],33:[function(e,t,n){let r=e(`../base-xform`),i=e(`../../../utils/col-cache`);function a(e){try{return i.decodeEx(e),!0}catch{return!1}}function o(e){let t=[],n=!1,r=``;return e.split(`,`).forEach(e=>{if(!e)return;let i=(e.match(/'/g)||[]).length;if(!i)return void(n?r+=e+`,`:a(e)&&t.push(e));let o=i%2==0;!n&&o&&a(e)?t.push(e):n&&!o?(n=!1,a(r+e)&&t.push(r+e),r=``):(n=!0,r+=e+`,`)}),t}t.exports=class extends r{render(e,t){e.openNode(`definedName`,{name:t.name,localSheetId:t.localSheetId}),e.writeText(t.ranges.join(`,`)),e.closeNode()}parseOpen(e){switch(e.name){case`definedName`:return this._parsedName=e.attributes.name,this._parsedLocalSheetId=e.attributes.localSheetId,this._parsedText=[],!0;default:return!1}}parseText(e){this._parsedText.push(e)}parseClose(){return this.model={name:this._parsedName,ranges:o(this._parsedText.join(``))},this._parsedLocalSheetId!==void 0&&(this.model.localSheetId=parseInt(this._parsedLocalSheetId,10)),!1}}},{"../../../utils/col-cache":19,"../base-xform":32}],34:[function(e,t,n){let r=e(`../../../utils/utils`),i=e(`../base-xform`);t.exports=class extends i{render(e,t){e.leafNode(`sheet`,{sheetId:t.id,name:t.name,state:t.state,"r:id":t.rId})}parseOpen(e){return e.name===`sheet`&&(this.model={name:r.xmlDecode(e.attributes.name),id:parseInt(e.attributes.sheetId,10),state:e.attributes.state,rId:e.attributes[`r:id`]},!0)}parseText(){}parseClose(){return!1}}},{"../../../utils/utils":27,"../base-xform":32}],35:[function(e,t,n){let r=e(`../base-xform`);t.exports=class extends r{render(e,t){e.leafNode(`calcPr`,{calcId:171027,fullCalcOnLoad:t.fullCalcOnLoad?1:void 0})}parseOpen(e){return e.name===`calcPr`&&(this.model={},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],36:[function(e,t,n){let r=e(`../base-xform`);t.exports=class extends r{render(e,t){e.leafNode(`workbookPr`,{date1904:t.date1904?1:void 0,defaultThemeVersion:164011,filterPrivacy:1})}parseOpen(e){return e.name===`workbookPr`&&(this.model={date1904:e.attributes.date1904===`1`},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],37:[function(e,t,n){let r=e(`../base-xform`);t.exports=class extends r{render(e,t){let n={xWindow:t.x||0,yWindow:t.y||0,windowWidth:t.width||12e3,windowHeight:t.height||24e3,firstSheet:t.firstSheet,activeTab:t.activeTab};t.visibility&&t.visibility!==`visible`&&(n.visibility=t.visibility),e.leafNode(`workbookView`,n)}parseOpen(e){if(e.name===`workbookView`){let t=this.model={},n=function(e,n,r){let i=n===void 0?r:t[e]=n;i!==void 0&&(t[e]=i)},r=function(e,n,r){let i=n===void 0?r:t[e]=parseInt(n,10);i!==void 0&&(t[e]=i)};return r(`x`,e.attributes.xWindow,0),r(`y`,e.attributes.yWindow,0),r(`width`,e.attributes.windowWidth,25e3),r(`height`,e.attributes.windowHeight,1e4),n(`visibility`,e.attributes.visibility,`visible`),r(`activeTab`,e.attributes.activeTab,void 0),r(`firstSheet`,e.attributes.firstSheet,void 0),!0}return!1}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],38:[function(e,t,n){let r=e(`../../../utils/under-dash`),i=e(`../../../utils/col-cache`),a=e(`../../../utils/xml-stream`),o=e(`../base-xform`),s=e(`../static-xform`),c=e(`../list-xform`),l=e(`./defined-name-xform`),u=e(`./sheet-xform`),d=e(`./workbook-view-xform`),f=e(`./workbook-properties-xform`),p=e(`./workbook-calc-properties-xform`);class m extends o{constructor(){super(),this.map={fileVersion:m.STATIC_XFORMS.fileVersion,workbookPr:new f,bookViews:new c({tag:`bookViews`,count:!1,childXform:new d}),sheets:new c({tag:`sheets`,count:!1,childXform:new u}),definedNames:new c({tag:`definedNames`,count:!1,childXform:new l}),calcPr:new p}}prepare(e){e.sheets=e.worksheets;let t=[],n=0;e.sheets.forEach(e=>{if(e.pageSetup&&e.pageSetup.printArea&&e.pageSetup.printArea.split(`&&`).forEach(r=>{let i=r.split(`:`),a={name:`_xlnm.Print_Area`,ranges:[`'${e.name}'!$${i[0]}:$${i[1]}`],localSheetId:n};t.push(a)}),e.pageSetup&&(e.pageSetup.printTitlesRow||e.pageSetup.printTitlesColumn)){let r=[];if(e.pageSetup.printTitlesColumn){let t=e.pageSetup.printTitlesColumn.split(`:`);r.push(`'${e.name}'!$${t[0]}:$${t[1]}`)}if(e.pageSetup.printTitlesRow){let t=e.pageSetup.printTitlesRow.split(`:`);r.push(`'${e.name}'!$${t[0]}:$${t[1]}`)}let i={name:`_xlnm.Print_Titles`,ranges:r,localSheetId:n};t.push(i)}n++}),t.length&&(e.definedNames=e.definedNames.concat(t)),(e.media||[]).forEach((e,t)=>{e.name=e.type+(t+1)})}render(e,t){e.openXml(a.StdDocAttributes),e.openNode(`workbook`,m.WORKBOOK_ATTRIBUTES),this.map.fileVersion.render(e),this.map.workbookPr.render(e,t.properties),this.map.bookViews.render(e,t.views),this.map.sheets.render(e,t.sheets),this.map.definedNames.render(e,t.definedNames),this.map.calcPr.render(e,t.calcProperties),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`workbook`:return!0;default:return this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e),!0}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case`workbook`:return this.model={sheets:this.map.sheets.model,properties:this.map.workbookPr.model||{},views:this.map.bookViews.model,calcProperties:{}},this.map.definedNames.model&&(this.model.definedNames=this.map.definedNames.model),!1;default:return!0}}reconcile(e){let t=(e.workbookRels||[]).reduce((e,t)=>(e[t.Id]=t,e),{}),n=[],a,o=0;(e.sheets||[]).forEach(r=>{let i=t[r.rId];i&&(a=e.worksheetHash[`xl/`+i.Target.replace(/^(\s|\/xl\/)+/,``)],a&&(a.name=r.name,a.id=r.id,a.state=r.state,n[o++]=a))});let s=[];r.each(e.definedNames,e=>{if(e.name===`_xlnm.Print_Area`){if(a=n[e.localSheetId],a){a.pageSetup||(a.pageSetup={});let t=i.decodeEx(e.ranges[0]);a.pageSetup.printArea=a.pageSetup.printArea?`${a.pageSetup.printArea}&&${t.dimensions}`:t.dimensions}}else if(e.name===`_xlnm.Print_Titles`){if(a=n[e.localSheetId],a){a.pageSetup||(a.pageSetup={});let t=e.ranges.join(`,`),n=/\$/g,r=t.match(/\$\d+:\$\d+/);if(r&&r.length){let e=r[0];a.pageSetup.printTitlesRow=e.replace(n,``)}let i=t.match(/\$[A-Z]+:\$[A-Z]+/);if(i&&i.length){let e=i[0];a.pageSetup.printTitlesColumn=e.replace(n,``)}}}else s.push(e)}),e.definedNames=s,e.media.forEach((e,t)=>{e.index=t})}}m.WORKBOOK_ATTRIBUTES={xmlns:`http://schemas.openxmlformats.org/spreadsheetml/2006/main`,"xmlns:r":`http://schemas.openxmlformats.org/officeDocument/2006/relationships`,"xmlns:mc":`http://schemas.openxmlformats.org/markup-compatibility/2006`,"mc:Ignorable":`x15`,"xmlns:x15":`http://schemas.microsoft.com/office/spreadsheetml/2010/11/main`},m.STATIC_XFORMS={fileVersion:new s({tag:`fileVersion`,$:{appName:`xl`,lastEdited:5,lowestEdited:5,rupBuild:9303}})},t.exports=m},{"../../../utils/col-cache":19,"../../../utils/under-dash":26,"../../../utils/xml-stream":28,"../base-xform":32,"../list-xform":71,"../static-xform":120,"./defined-name-xform":33,"./sheet-xform":34,"./workbook-calc-properties-xform":35,"./workbook-properties-xform":36,"./workbook-view-xform":37}],39:[function(e,t,n){let r=e(`../strings/rich-text-xform`),i=e(`../../../utils/utils`),a=e(`../base-xform`),o=t.exports=function(e){this.model=e};i.inherits(o,a,{get tag(){return`r`},get richTextXform(){return this._richTextXform||(this._richTextXform=new r),this._richTextXform},render(e,t){t=t||this.model,e.openNode(`comment`,{ref:t.ref,authorId:0}),e.openNode(`text`),t&&t.note&&t.note.texts&&t.note.texts.forEach(t=>{this.richTextXform.render(e,t)}),e.closeNode(),e.closeNode()},parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`comment`:return this.model={type:`note`,note:{texts:[]},...e.attributes},!0;case`r`:return this.parser=this.richTextXform,this.parser.parseOpen(e),!0;default:return!1}},parseText(e){this.parser&&this.parser.parseText(e)},parseClose(e){switch(e){case`comment`:return!1;case`r`:return this.model.note.texts.push(this.parser.model),this.parser=void 0,!0;default:return this.parser&&this.parser.parseClose(e),!0}}})},{"../../../utils/utils":27,"../base-xform":32,"../strings/rich-text-xform":122}],40:[function(e,t,n){let r=e(`../../../utils/xml-stream`),i=e(`../../../utils/utils`),a=e(`../base-xform`),o=e(`./comment-xform`),s=t.exports=function(){this.map={comment:new o}};i.inherits(s,a,{COMMENTS_ATTRIBUTES:{xmlns:`http://schemas.openxmlformats.org/spreadsheetml/2006/main`}},{render(e,t){t=t||this.model,e.openXml(r.StdDocAttributes),e.openNode(`comments`,s.COMMENTS_ATTRIBUTES),e.openNode(`authors`),e.leafNode(`author`,null,`Author`),e.closeNode(),e.openNode(`commentList`),t.comments.forEach(t=>{this.map.comment.render(e,t)}),e.closeNode(),e.closeNode()},parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`commentList`:return this.model={comments:[]},!0;case`comment`:return this.parser=this.map.comment,this.parser.parseOpen(e),!0;default:return!1}},parseText(e){this.parser&&this.parser.parseText(e)},parseClose(e){switch(e){case`commentList`:return!1;case`comment`:return this.model.comments.push(this.parser.model),this.parser=void 0,!0;default:return this.parser&&this.parser.parseClose(e),!0}}})},{"../../../utils/utils":27,"../../../utils/xml-stream":28,"../base-xform":32,"./comment-xform":39}],41:[function(e,t,n){let r=e(`../../base-xform`);t.exports=class extends r{constructor(e){super(),this._model=e}get tag(){return this._model&&this._model.tag}render(e,t,n){(t===n[2]||this.tag===`x:SizeWithCells`&&t===n[1])&&e.leafNode(this.tag)}parseOpen(e){switch(e.name){case this.tag:return this.model={},this.model[this.tag]=!0,!0;default:return!1}}parseText(){}parseClose(){return!1}}},{"../../base-xform":32}],42:[function(e,t,n){let r=e(`../../base-xform`);t.exports=class extends r{constructor(e){super(),this._model=e}get tag(){return this._model&&this._model.tag}render(e,t){e.leafNode(this.tag,null,t)}parseOpen(e){switch(e.name){case this.tag:return this.text=``,!0;default:return!1}}parseText(e){this.text=e}parseClose(){return!1}}},{"../../base-xform":32}],43:[function(e,t,n){let r=e(`../base-xform`);t.exports=class extends r{get tag(){return`x:Anchor`}getAnchorRect(e){let t=Math.floor(e.left),n=Math.floor(68*(e.left-t)),r=Math.floor(e.top),i=Math.floor(18*(e.top-r)),a=Math.floor(e.right),o=Math.floor(68*(e.right-a)),s=Math.floor(e.bottom);return[t,n,r,i,a,o,s,Math.floor(18*(e.bottom-s))]}getDefaultRect(e){let t=e.col,n=Math.max(e.row-2,0);return[t,6,n,14,t+2,2,n+4,16]}render(e,t){let n=t.anchor?this.getAnchorRect(t.anchor):this.getDefaultRect(t.refAddress);e.leafNode(`x:Anchor`,null,n.join(`, `))}parseOpen(e){switch(e.name){case this.tag:return this.text=``,!0;default:return!1}}parseText(e){this.text=e}parseClose(){return!1}}},{"../base-xform":32}],44:[function(e,t,n){let r=e(`../base-xform`),i=e(`./vml-anchor-xform`),a=e(`./style/vml-protection-xform`),o=e(`./style/vml-position-xform`),s=[`twoCells`,`oneCells`,`absolute`];t.exports=class extends r{constructor(){super(),this.map={"x:Anchor":new i,"x:Locked":new a({tag:`x:Locked`}),"x:LockText":new a({tag:`x:LockText`}),"x:SizeWithCells":new o({tag:`x:SizeWithCells`}),"x:MoveWithCells":new o({tag:`x:MoveWithCells`})}}get tag(){return`x:ClientData`}render(e,t){let{protection:n,editAs:r}=t.note;e.openNode(this.tag,{ObjectType:`Note`}),this.map[`x:MoveWithCells`].render(e,r,s),this.map[`x:SizeWithCells`].render(e,r,s),this.map[`x:Anchor`].render(e,t),this.map[`x:Locked`].render(e,n.locked),e.leafNode(`x:AutoFill`,null,`False`),this.map[`x:LockText`].render(e,n.lockText),e.leafNode(`x:Row`,null,t.refAddress.row-1),e.leafNode(`x:Column`,null,t.refAddress.col-1),e.closeNode()}parseOpen(e){switch(e.name){case this.tag:this.reset(),this.model={anchor:[],protection:{},editAs:``};break;default:this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e)}return!0}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case this.tag:return this.normalizeModel(),!1;default:return!0}}normalizeModel(){let e=Object.assign({},this.map[`x:MoveWithCells`].model,this.map[`x:SizeWithCells`].model),t=Object.keys(e).length;this.model.editAs=s[t],this.model.anchor=this.map[`x:Anchor`].text,this.model.protection.locked=this.map[`x:Locked`].text,this.model.protection.lockText=this.map[`x:LockText`].text}}},{"../base-xform":32,"./style/vml-position-xform":41,"./style/vml-protection-xform":42,"./vml-anchor-xform":43}],45:[function(e,t,n){let r=e(`../../../utils/xml-stream`),i=e(`../base-xform`),a=e(`./vml-shape-xform`);class o extends i{constructor(){super(),this.map={"v:shape":new a}}get tag(){return`xml`}render(e,t){e.openXml(r.StdDocAttributes),e.openNode(this.tag,o.DRAWING_ATTRIBUTES),e.openNode(`o:shapelayout`,{"v:ext":`edit`}),e.leafNode(`o:idmap`,{"v:ext":`edit`,data:1}),e.closeNode(),e.openNode(`v:shapetype`,{id:`_x0000_t202`,coordsize:`21600,21600`,"o:spt":202,path:`m,l,21600r21600,l21600,xe`}),e.leafNode(`v:stroke`,{joinstyle:`miter`}),e.leafNode(`v:path`,{gradientshapeok:`t`,"o:connecttype":`rect`}),e.closeNode(),t.comments.forEach((t,n)=>{this.map[`v:shape`].render(e,t,n)}),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case this.tag:this.reset(),this.model={comments:[]};break;default:this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e)}return!0}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.model.comments.push(this.parser.model),this.parser=void 0),!0;switch(e){case this.tag:return!1;default:return!0}}reconcile(e,t){e.anchors.forEach(e=>{e.br?this.map[`xdr:twoCellAnchor`].reconcile(e,t):this.map[`xdr:oneCellAnchor`].reconcile(e,t)})}}o.DRAWING_ATTRIBUTES={"xmlns:v":`urn:schemas-microsoft-com:vml`,"xmlns:o":`urn:schemas-microsoft-com:office:office`,"xmlns:x":`urn:schemas-microsoft-com:office:excel`},t.exports=o},{"../../../utils/xml-stream":28,"../base-xform":32,"./vml-shape-xform":46}],46:[function(e,t,n){let r=e(`../base-xform`),i=e(`./vml-textbox-xform`),a=e(`./vml-client-data-xform`);class o extends r{constructor(){super(),this.map={"v:textbox":new i,"x:ClientData":new a}}get tag(){return`v:shape`}render(e,t,n){e.openNode(`v:shape`,o.V_SHAPE_ATTRIBUTES(t,n)),e.leafNode(`v:fill`,{color2:`infoBackground [80]`}),e.leafNode(`v:shadow`,{color:`none [81]`,obscured:`t`}),e.leafNode(`v:path`,{"o:connecttype":`none`}),this.map[`v:textbox`].render(e,t),this.map[`x:ClientData`].render(e,t),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case this.tag:this.reset(),this.model={margins:{insetmode:e.attributes[`o:insetmode`]},anchor:``,editAs:``,protection:{}};break;default:this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e)}return!0}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case this.tag:return this.model.margins.inset=this.map[`v:textbox`].model&&this.map[`v:textbox`].model.inset,this.model.protection=this.map[`x:ClientData`].model&&this.map[`x:ClientData`].model.protection,this.model.anchor=this.map[`x:ClientData`].model&&this.map[`x:ClientData`].model.anchor,this.model.editAs=this.map[`x:ClientData`].model&&this.map[`x:ClientData`].model.editAs,!1;default:return!0}}}o.V_SHAPE_ATTRIBUTES=(e,t)=>({id:`_x0000_s`+(1025+t),type:`#_x0000_t202`,style:`position:absolute; margin-left:105.3pt;margin-top:10.5pt;width:97.8pt;height:59.1pt;z-index:1;visibility:hidden`,fillcolor:`infoBackground [80]`,strokecolor:`none [81]`,"o:insetmode":e.note.margins&&e.note.margins.insetmode}),t.exports=o},{"../base-xform":32,"./vml-client-data-xform":44,"./vml-textbox-xform":47}],47:[function(e,t,n){let r=e(`../base-xform`);t.exports=class extends r{get tag(){return`v:textbox`}conversionUnit(e,t,n){return`${parseFloat(e)*t.toFixed(2)}${n}`}reverseConversionUnit(e){return(e||``).split(`,`).map(e=>Number(parseFloat(this.conversionUnit(parseFloat(e),.1,``)).toFixed(2)))}render(e,t){let n={style:`mso-direction-alt:auto`};if(t&&t.note){let{inset:e}=t.note&&t.note.margins;Array.isArray(e)&&(e=e.map(e=>this.conversionUnit(e,10,`mm`)).join(`,`)),e&&(n.inset=e)}e.openNode(`v:textbox`,n),e.leafNode(`div`,{style:`text-align:left`}),e.closeNode()}parseOpen(e){switch(e.name){case this.tag:return this.model={inset:this.reverseConversionUnit(e.attributes.inset)},!0;default:return!0}}parseText(){}parseClose(e){switch(e){case this.tag:return!1;default:return!0}}}},{"../base-xform":32}],48:[function(e,t,n){let r=e(`./base-xform`);t.exports=class extends r{createNewModel(e){return{}}parseOpen(e){return this.parser=this.parser||this.map[e.name],this.parser?(this.parser.parseOpen(e),!0):e.name===this.tag&&(this.model=this.createNewModel(e),!0)}parseText(e){this.parser&&this.parser.parseText(e)}onParserClose(e,t){this.model[e]=t.model}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.onParserClose(e,this.parser),this.parser=void 0),!0):e!==this.tag}}},{"./base-xform":32}],49:[function(e,t,n){let r=e(`../base-xform`);t.exports=class extends r{render(e,t){e.openNode(`HeadingPairs`),e.openNode(`vt:vector`,{size:2,baseType:`variant`}),e.openNode(`vt:variant`),e.leafNode(`vt:lpstr`,void 0,`Worksheets`),e.closeNode(),e.openNode(`vt:variant`),e.leafNode(`vt:i4`,void 0,t.length),e.closeNode(),e.closeNode(),e.closeNode()}parseOpen(e){return e.name===`HeadingPairs`}parseText(){}parseClose(e){return e!==`HeadingPairs`}}},{"../base-xform":32}],50:[function(e,t,n){let r=e(`../base-xform`);t.exports=class extends r{render(e,t){e.openNode(`TitlesOfParts`),e.openNode(`vt:vector`,{size:t.length,baseType:`lpstr`}),t.forEach(t=>{e.leafNode(`vt:lpstr`,void 0,t.name)}),e.closeNode(),e.closeNode()}parseOpen(e){return e.name===`TitlesOfParts`}parseText(){}parseClose(e){return e!==`TitlesOfParts`}}},{"../base-xform":32}],51:[function(e,t,n){let r=e(`../../../utils/xml-stream`),i=e(`../base-xform`),a=e(`../simple/string-xform`),o=e(`./app-heading-pairs-xform`),s=e(`./app-titles-of-parts-xform`);class c extends i{constructor(){super(),this.map={Company:new a({tag:`Company`}),Manager:new a({tag:`Manager`}),HeadingPairs:new o,TitleOfParts:new s}}render(e,t){e.openXml(r.StdDocAttributes),e.openNode(`Properties`,c.PROPERTY_ATTRIBUTES),e.leafNode(`Application`,void 0,`Microsoft Excel`),e.leafNode(`DocSecurity`,void 0,`0`),e.leafNode(`ScaleCrop`,void 0,`false`),this.map.HeadingPairs.render(e,t.worksheets),this.map.TitleOfParts.render(e,t.worksheets),this.map.Company.render(e,t.company||``),this.map.Manager.render(e,t.manager),e.leafNode(`LinksUpToDate`,void 0,`false`),e.leafNode(`SharedDoc`,void 0,`false`),e.leafNode(`HyperlinksChanged`,void 0,`false`),e.leafNode(`AppVersion`,void 0,`16.0300`),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`Properties`:return!0;default:return this.parser=this.map[e.name],!!this.parser&&(this.parser.parseOpen(e),!0)}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case`Properties`:return this.model={worksheets:this.map.TitleOfParts.model,company:this.map.Company.model,manager:this.map.Manager.model},!1;default:return!0}}}c.DateFormat=function(e){return e.toISOString().replace(/[.]\d{3,6}/,``)},c.DateAttrs={"xsi:type":`dcterms:W3CDTF`},c.PROPERTY_ATTRIBUTES={xmlns:`http://schemas.openxmlformats.org/officeDocument/2006/extended-properties`,"xmlns:vt":`http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes`},t.exports=c},{"../../../utils/xml-stream":28,"../base-xform":32,"../simple/string-xform":119,"./app-heading-pairs-xform":49,"./app-titles-of-parts-xform":50}],52:[function(e,t,n){let r=e(`../../../utils/xml-stream`),i=e(`../base-xform`);class a extends i{render(e,t){e.openXml(r.StdDocAttributes),e.openNode(`Types`,a.PROPERTY_ATTRIBUTES);let n={};(t.media||[]).forEach(t=>{if(t.type===`image`){let r=t.extension;n[r]||(n[r]=!0,e.leafNode(`Default`,{Extension:r,ContentType:`image/`+r}))}}),e.leafNode(`Default`,{Extension:`rels`,ContentType:`application/vnd.openxmlformats-package.relationships+xml`}),e.leafNode(`Default`,{Extension:`xml`,ContentType:`application/xml`}),e.leafNode(`Override`,{PartName:`/xl/workbook.xml`,ContentType:`application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml`}),t.worksheets.forEach(t=>{let n=`/xl/worksheets/sheet${t.id}.xml`;e.leafNode(`Override`,{PartName:n,ContentType:`application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml`})}),e.leafNode(`Override`,{PartName:`/xl/theme/theme1.xml`,ContentType:`application/vnd.openxmlformats-officedocument.theme+xml`}),e.leafNode(`Override`,{PartName:`/xl/styles.xml`,ContentType:`application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml`}),t.sharedStrings&&t.sharedStrings.count&&e.leafNode(`Override`,{PartName:`/xl/sharedStrings.xml`,ContentType:`application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml`}),t.tables&&t.tables.forEach(t=>{e.leafNode(`Override`,{PartName:`/xl/tables/`+t.target,ContentType:`application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml`})}),t.drawings&&t.drawings.forEach(t=>{e.leafNode(`Override`,{PartName:`/xl/drawings/${t.name}.xml`,ContentType:`application/vnd.openxmlformats-officedocument.drawing+xml`})}),t.commentRefs&&(e.leafNode(`Default`,{Extension:`vml`,ContentType:`application/vnd.openxmlformats-officedocument.vmlDrawing`}),t.commentRefs.forEach(t=>{let{commentName:n}=t;e.leafNode(`Override`,{PartName:`/xl/${n}.xml`,ContentType:`application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml`})})),e.leafNode(`Override`,{PartName:`/docProps/core.xml`,ContentType:`application/vnd.openxmlformats-package.core-properties+xml`}),e.leafNode(`Override`,{PartName:`/docProps/app.xml`,ContentType:`application/vnd.openxmlformats-officedocument.extended-properties+xml`}),e.closeNode()}parseOpen(){return!1}parseText(){}parseClose(){return!1}}a.PROPERTY_ATTRIBUTES={xmlns:`http://schemas.openxmlformats.org/package/2006/content-types`},t.exports=a},{"../../../utils/xml-stream":28,"../base-xform":32}],53:[function(e,t,n){let r=e(`../../../utils/xml-stream`),i=e(`../base-xform`),a=e(`../simple/date-xform`),o=e(`../simple/string-xform`),s=e(`../simple/integer-xform`);class c extends i{constructor(){super(),this.map={"dc:creator":new o({tag:`dc:creator`}),"dc:title":new o({tag:`dc:title`}),"dc:subject":new o({tag:`dc:subject`}),"dc:description":new o({tag:`dc:description`}),"dc:identifier":new o({tag:`dc:identifier`}),"dc:language":new o({tag:`dc:language`}),"cp:keywords":new o({tag:`cp:keywords`}),"cp:category":new o({tag:`cp:category`}),"cp:lastModifiedBy":new o({tag:`cp:lastModifiedBy`}),"cp:lastPrinted":new a({tag:`cp:lastPrinted`,format:c.DateFormat}),"cp:revision":new s({tag:`cp:revision`}),"cp:version":new o({tag:`cp:version`}),"cp:contentStatus":new o({tag:`cp:contentStatus`}),"cp:contentType":new o({tag:`cp:contentType`}),"dcterms:created":new a({tag:`dcterms:created`,attrs:c.DateAttrs,format:c.DateFormat}),"dcterms:modified":new a({tag:`dcterms:modified`,attrs:c.DateAttrs,format:c.DateFormat})}}render(e,t){e.openXml(r.StdDocAttributes),e.openNode(`cp:coreProperties`,c.CORE_PROPERTY_ATTRIBUTES),this.map[`dc:creator`].render(e,t.creator),this.map[`dc:title`].render(e,t.title),this.map[`dc:subject`].render(e,t.subject),this.map[`dc:description`].render(e,t.description),this.map[`dc:identifier`].render(e,t.identifier),this.map[`dc:language`].render(e,t.language),this.map[`cp:keywords`].render(e,t.keywords),this.map[`cp:category`].render(e,t.category),this.map[`cp:lastModifiedBy`].render(e,t.lastModifiedBy),this.map[`cp:lastPrinted`].render(e,t.lastPrinted),this.map[`cp:revision`].render(e,t.revision),this.map[`cp:version`].render(e,t.version),this.map[`cp:contentStatus`].render(e,t.contentStatus),this.map[`cp:contentType`].render(e,t.contentType),this.map[`dcterms:created`].render(e,t.created),this.map[`dcterms:modified`].render(e,t.modified),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`cp:coreProperties`:case`coreProperties`:return!0;default:if(this.parser=this.map[e.name],this.parser)return this.parser.parseOpen(e),!0;throw Error(`Unexpected xml node in parseOpen: `+JSON.stringify(e))}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case`cp:coreProperties`:case`coreProperties`:return this.model={creator:this.map[`dc:creator`].model,title:this.map[`dc:title`].model,subject:this.map[`dc:subject`].model,description:this.map[`dc:description`].model,identifier:this.map[`dc:identifier`].model,language:this.map[`dc:language`].model,keywords:this.map[`cp:keywords`].model,category:this.map[`cp:category`].model,lastModifiedBy:this.map[`cp:lastModifiedBy`].model,lastPrinted:this.map[`cp:lastPrinted`].model,revision:this.map[`cp:revision`].model,contentStatus:this.map[`cp:contentStatus`].model,contentType:this.map[`cp:contentType`].model,created:this.map[`dcterms:created`].model,modified:this.map[`dcterms:modified`].model},!1;default:throw Error(`Unexpected xml node in parseClose: `+e)}}}c.DateFormat=function(e){return e.toISOString().replace(/[.]\d{3}/,``)},c.DateAttrs={"xsi:type":`dcterms:W3CDTF`},c.CORE_PROPERTY_ATTRIBUTES={"xmlns:cp":`http://schemas.openxmlformats.org/package/2006/metadata/core-properties`,"xmlns:dc":`http://purl.org/dc/elements/1.1/`,"xmlns:dcterms":`http://purl.org/dc/terms/`,"xmlns:dcmitype":`http://purl.org/dc/dcmitype/`,"xmlns:xsi":`http://www.w3.org/2001/XMLSchema-instance`},t.exports=c},{"../../../utils/xml-stream":28,"../base-xform":32,"../simple/date-xform":117,"../simple/integer-xform":118,"../simple/string-xform":119}],54:[function(e,t,n){let r=e(`../base-xform`);t.exports=class extends r{render(e,t){e.leafNode(`Relationship`,t)}parseOpen(e){switch(e.name){case`Relationship`:return this.model=e.attributes,!0;default:return!1}}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],55:[function(e,t,n){let r=e(`../../../utils/xml-stream`),i=e(`../base-xform`),a=e(`./relationship-xform`);class o extends i{constructor(){super(),this.map={Relationship:new a}}render(e,t){t=t||this._values,e.openXml(r.StdDocAttributes),e.openNode(`Relationships`,o.RELATIONSHIPS_ATTRIBUTES),t.forEach(t=>{this.map.Relationship.render(e,t)}),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`Relationships`:return this.model=[],!0;default:if(this.parser=this.map[e.name],this.parser)return this.parser.parseOpen(e),!0;throw Error(`Unexpected xml node in parseOpen: `+JSON.stringify(e))}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.model.push(this.parser.model),this.parser=void 0),!0;switch(e){case`Relationships`:return!1;default:throw Error(`Unexpected xml node in parseClose: `+e)}}}o.RELATIONSHIPS_ATTRIBUTES={xmlns:`http://schemas.openxmlformats.org/package/2006/relationships`},t.exports=o},{"../../../utils/xml-stream":28,"../base-xform":32,"./relationship-xform":54}],56:[function(e,t,n){let r=e(`../base-xform`);t.exports=class extends r{parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case this.tag:this.reset(),this.model={range:{editAs:e.attributes.editAs||`oneCell`}};break;default:this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e)}return!0}parseText(e){this.parser&&this.parser.parseText(e)}reconcilePicture(e,t){if(e&&e.rId){let n=t.rels[e.rId].Target.match(/.*\/media\/(.+[.][a-zA-Z]{3,4})/);if(n){let e=n[1],r=t.mediaIndex[e];return t.media[r]}}}}},{"../base-xform":32}],57:[function(e,t,n){let r=e(`../base-xform`),i=e(`./blip-xform`);t.exports=class extends r{constructor(){super(),this.map={"a:blip":new i}}get tag(){return`xdr:blipFill`}render(e,t){e.openNode(this.tag),this.map[`a:blip`].render(e,t),e.openNode(`a:stretch`),e.leafNode(`a:fillRect`),e.closeNode(),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case this.tag:this.reset();break;default:this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e)}return!0}parseText(){}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case this.tag:return this.model=this.map[`a:blip`].model,!1;default:return!0}}}},{"../base-xform":32,"./blip-xform":58}],58:[function(e,t,n){let r=e(`../base-xform`);t.exports=class extends r{get tag(){return`a:blip`}render(e,t){e.leafNode(this.tag,{"xmlns:r":`http://schemas.openxmlformats.org/officeDocument/2006/relationships`,"r:embed":t.rId,cstate:`print`})}parseOpen(e){switch(e.name){case this.tag:return this.model={rId:e.attributes[`r:embed`]},!0;default:return!0}}parseText(){}parseClose(e){switch(e){case this.tag:return!1;default:return!0}}}},{"../base-xform":32}],59:[function(e,t,n){let r=e(`../base-xform`);t.exports=class extends r{get tag(){return`xdr:cNvPicPr`}render(e){e.openNode(this.tag),e.leafNode(`a:picLocks`,{noChangeAspect:`1`}),e.closeNode()}parseOpen(e){switch(e.name){case this.tag:default:return!0}}parseText(){}parseClose(e){switch(e){case this.tag:return!1;default:return!0}}}},{"../base-xform":32}],60:[function(e,t,n){let r=e(`../base-xform`),i=e(`./hlink-click-xform`),a=e(`./ext-lst-xform`);t.exports=class extends r{constructor(){super(),this.map={"a:hlinkClick":new i,"a:extLst":new a}}get tag(){return`xdr:cNvPr`}render(e,t){e.openNode(this.tag,{id:t.index,name:`Picture `+t.index}),this.map[`a:hlinkClick`].render(e,t),this.map[`a:extLst`].render(e,t),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case this.tag:this.reset();break;default:this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e)}return!0}parseText(){}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case this.tag:return this.model=this.map[`a:hlinkClick`].model,!1;default:return!0}}}},{"../base-xform":32,"./ext-lst-xform":63,"./hlink-click-xform":65}],61:[function(e,t,n){let r=e(`../base-xform`),i=e(`../simple/integer-xform`);t.exports=class extends r{constructor(e){super(),this.tag=e.tag,this.map={"xdr:col":new i({tag:`xdr:col`,zero:!0}),"xdr:colOff":new i({tag:`xdr:colOff`,zero:!0}),"xdr:row":new i({tag:`xdr:row`,zero:!0}),"xdr:rowOff":new i({tag:`xdr:rowOff`,zero:!0})}}render(e,t){e.openNode(this.tag),this.map[`xdr:col`].render(e,t.nativeCol),this.map[`xdr:colOff`].render(e,t.nativeColOff),this.map[`xdr:row`].render(e,t.nativeRow),this.map[`xdr:rowOff`].render(e,t.nativeRowOff),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case this.tag:this.reset();break;default:this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e)}return!0}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case this.tag:return this.model={nativeCol:this.map[`xdr:col`].model,nativeColOff:this.map[`xdr:colOff`].model,nativeRow:this.map[`xdr:row`].model,nativeRowOff:this.map[`xdr:rowOff`].model},!1;default:return!0}}}},{"../base-xform":32,"../simple/integer-xform":118}],62:[function(e,t,n){let r=e(`../../../utils/col-cache`),i=e(`../../../utils/xml-stream`),a=e(`../base-xform`),o=e(`./two-cell-anchor-xform`),s=e(`./one-cell-anchor-xform`);class c extends a{constructor(){super(),this.map={"xdr:twoCellAnchor":new o,"xdr:oneCellAnchor":new s}}prepare(e){e.anchors.forEach((e,t)=>{e.anchorType=function(e){return(typeof e.range==`string`?r.decode(e.range):e.range).br?`xdr:twoCellAnchor`:`xdr:oneCellAnchor`}(e),this.map[e.anchorType].prepare(e,{index:t})})}get tag(){return`xdr:wsDr`}render(e,t){e.openXml(i.StdDocAttributes),e.openNode(this.tag,c.DRAWING_ATTRIBUTES),t.anchors.forEach(t=>{this.map[t.anchorType].render(e,t)}),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case this.tag:this.reset(),this.model={anchors:[]};break;default:this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e)}return!0}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.model.anchors.push(this.parser.model),this.parser=void 0),!0;switch(e){case this.tag:return!1;default:return!0}}reconcile(e,t){e.anchors.forEach(e=>{e.br?this.map[`xdr:twoCellAnchor`].reconcile(e,t):this.map[`xdr:oneCellAnchor`].reconcile(e,t)})}}c.DRAWING_ATTRIBUTES={"xmlns:xdr":`http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing`,"xmlns:a":`http://schemas.openxmlformats.org/drawingml/2006/main`},t.exports=c},{"../../../utils/col-cache":19,"../../../utils/xml-stream":28,"../base-xform":32,"./one-cell-anchor-xform":67,"./two-cell-anchor-xform":70}],63:[function(e,t,n){let r=e(`../base-xform`);t.exports=class extends r{get tag(){return`a:extLst`}render(e){e.openNode(this.tag),e.openNode(`a:ext`,{uri:`{FF2B5EF4-FFF2-40B4-BE49-F238E27FC236}`}),e.leafNode(`a16:creationId`,{"xmlns:a16":`http://schemas.microsoft.com/office/drawing/2014/main`,id:`{00000000-0008-0000-0000-000002000000}`}),e.closeNode(),e.closeNode()}parseOpen(e){switch(e.name){case this.tag:default:return!0}}parseText(){}parseClose(e){switch(e){case this.tag:return!1;default:return!0}}}},{"../base-xform":32}],64:[function(e,t,n){let r=e(`../base-xform`);t.exports=class extends r{constructor(e){super(),this.tag=e.tag,this.map={}}render(e,t){e.openNode(this.tag);let n=Math.floor(9525*t.width),r=Math.floor(9525*t.height);e.addAttribute(`cx`,n),e.addAttribute(`cy`,r),e.closeNode()}parseOpen(e){return e.name===this.tag&&(this.model={width:parseInt(e.attributes.cx||`0`,10)/9525,height:parseInt(e.attributes.cy||`0`,10)/9525},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],65:[function(e,t,n){let r=e(`../base-xform`);t.exports=class extends r{get tag(){return`a:hlinkClick`}render(e,t){t.hyperlinks&&t.hyperlinks.rId&&e.leafNode(this.tag,{"xmlns:r":`http://schemas.openxmlformats.org/officeDocument/2006/relationships`,"r:id":t.hyperlinks.rId,tooltip:t.hyperlinks.tooltip})}parseOpen(e){switch(e.name){case this.tag:return this.model={hyperlinks:{rId:e.attributes[`r:id`],tooltip:e.attributes.tooltip}},!0;default:return!0}}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],66:[function(e,t,n){let r=e(`../base-xform`),i=e(`./c-nv-pr-xform`),a=e(`./c-nv-pic-pr-xform`);t.exports=class extends r{constructor(){super(),this.map={"xdr:cNvPr":new i,"xdr:cNvPicPr":new a}}get tag(){return`xdr:nvPicPr`}render(e,t){e.openNode(this.tag),this.map[`xdr:cNvPr`].render(e,t),this.map[`xdr:cNvPicPr`].render(e,t),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case this.tag:this.reset();break;default:this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e)}return!0}parseText(){}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case this.tag:return this.model=this.map[`xdr:cNvPr`].model,!1;default:return!0}}}},{"../base-xform":32,"./c-nv-pic-pr-xform":59,"./c-nv-pr-xform":60}],67:[function(e,t,n){let r=e(`./base-cell-anchor-xform`),i=e(`../static-xform`),a=e(`./cell-position-xform`),o=e(`./ext-xform`),s=e(`./pic-xform`);t.exports=class extends r{constructor(){super(),this.map={"xdr:from":new a({tag:`xdr:from`}),"xdr:ext":new o({tag:`xdr:ext`}),"xdr:pic":new s,"xdr:clientData":new i({tag:`xdr:clientData`})}}get tag(){return`xdr:oneCellAnchor`}prepare(e,t){this.map[`xdr:pic`].prepare(e.picture,t)}render(e,t){e.openNode(this.tag,{editAs:t.range.editAs||`oneCell`}),this.map[`xdr:from`].render(e,t.range.tl),this.map[`xdr:ext`].render(e,t.range.ext),this.map[`xdr:pic`].render(e,t.picture),this.map[`xdr:clientData`].render(e,{}),e.closeNode()}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case this.tag:return this.model.range.tl=this.map[`xdr:from`].model,this.model.range.ext=this.map[`xdr:ext`].model,this.model.picture=this.map[`xdr:pic`].model,!1;default:return!0}}reconcile(e,t){e.medium=this.reconcilePicture(e.picture,t)}}},{"../static-xform":120,"./base-cell-anchor-xform":56,"./cell-position-xform":61,"./ext-xform":64,"./pic-xform":68}],68:[function(e,t,n){let r=e(`../base-xform`),i=e(`../static-xform`),a=e(`./blip-fill-xform`),o=e(`./nv-pic-pr-xform`),s=e(`./sp-pr`);t.exports=class extends r{constructor(){super(),this.map={"xdr:nvPicPr":new o,"xdr:blipFill":new a,"xdr:spPr":new i(s)}}get tag(){return`xdr:pic`}prepare(e,t){e.index=t.index+1}render(e,t){e.openNode(this.tag),this.map[`xdr:nvPicPr`].render(e,t),this.map[`xdr:blipFill`].render(e,t),this.map[`xdr:spPr`].render(e,t),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case this.tag:this.reset();break;default:this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e)}return!0}parseText(){}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.mergeModel(this.parser.model),this.parser=void 0),!0;switch(e){case this.tag:return!1;default:return!0}}}},{"../base-xform":32,"../static-xform":120,"./blip-fill-xform":57,"./nv-pic-pr-xform":66,"./sp-pr":69}],69:[function(e,t,n){t.exports={tag:`xdr:spPr`,c:[{tag:`a:xfrm`,c:[{tag:`a:off`,$:{x:`0`,y:`0`}},{tag:`a:ext`,$:{cx:`0`,cy:`0`}}]},{tag:`a:prstGeom`,$:{prst:`rect`},c:[{tag:`a:avLst`}]}]}},{}],70:[function(e,t,n){let r=e(`./base-cell-anchor-xform`),i=e(`../static-xform`),a=e(`./cell-position-xform`),o=e(`./pic-xform`);t.exports=class extends r{constructor(){super(),this.map={"xdr:from":new a({tag:`xdr:from`}),"xdr:to":new a({tag:`xdr:to`}),"xdr:pic":new o,"xdr:clientData":new i({tag:`xdr:clientData`})}}get tag(){return`xdr:twoCellAnchor`}prepare(e,t){this.map[`xdr:pic`].prepare(e.picture,t)}render(e,t){e.openNode(this.tag,{editAs:t.range.editAs||`oneCell`}),this.map[`xdr:from`].render(e,t.range.tl),this.map[`xdr:to`].render(e,t.range.br),this.map[`xdr:pic`].render(e,t.picture),this.map[`xdr:clientData`].render(e,{}),e.closeNode()}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case this.tag:return this.model.range.tl=this.map[`xdr:from`].model,this.model.range.br=this.map[`xdr:to`].model,this.model.picture=this.map[`xdr:pic`].model,!1;default:return!0}}reconcile(e,t){e.medium=this.reconcilePicture(e.picture,t)}}},{"../static-xform":120,"./base-cell-anchor-xform":56,"./cell-position-xform":61,"./pic-xform":68}],71:[function(e,t,n){let r=e(`./base-xform`);t.exports=class extends r{constructor(e){super(),this.tag=e.tag,this.always=!!e.always,this.count=e.count,this.empty=e.empty,this.$count=e.$count||`count`,this.$=e.$,this.childXform=e.childXform,this.maxItems=e.maxItems}prepare(e,t){let{childXform:n}=this;e&&e.forEach((e,r)=>{t.index=r,n.prepare(e,t)})}render(e,t){if(this.always||t&&t.length){e.openNode(this.tag,this.$),this.count&&e.addAttribute(this.$count,t&&t.length||0);let{childXform:n}=this;(t||[]).forEach((t,r)=>{n.render(e,t,r)}),e.closeNode()}else this.empty&&e.leafNode(this.tag)}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case this.tag:return this.model=[],!0;default:return!!this.childXform.parseOpen(e)&&(this.parser=this.childXform,!0)}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser){if(!this.parser.parseClose(e)&&(this.model.push(this.parser.model),this.parser=void 0,this.maxItems&&this.model.length>this.maxItems))throw Error(`Max ${this.childXform.tag} count (${this.maxItems}) exceeded`);return!0}return!1}reconcile(e,t){if(e){let{childXform:n}=this;e.forEach(e=>{n.reconcile(e,t)})}}}},{"./base-xform":32}],72:[function(e,t,n){let r=e(`../../../utils/col-cache`),i=e(`../base-xform`);t.exports=class extends i{get tag(){return`autoFilter`}render(e,t){if(t){if(typeof t==`string`)e.leafNode(`autoFilter`,{ref:t});else{let n=function(e){return typeof e==`string`?e:r.getAddress(e.row,e.column).address},i=n(t.from),a=n(t.to);i&&a&&e.leafNode(`autoFilter`,{ref:`${i}:${a}`})}}}parseOpen(e){e.name===`autoFilter`&&(this.model=e.attributes.ref)}}},{"../../../utils/col-cache":19,"../base-xform":32}],73:[function(e,t,n){let r=e(`../../../utils/utils`),i=e(`../base-xform`),a=e(`../../../doc/range`),o=e(`../../../doc/enums`),s=e(`../strings/rich-text-xform`);function c(e){if(e==null)return o.ValueType.Null;if(e instanceof String||typeof e==`string`)return o.ValueType.String;if(typeof e==`number`)return o.ValueType.Number;if(typeof e==`boolean`)return o.ValueType.Boolean;if(e instanceof Date)return o.ValueType.Date;if(e.text&&e.hyperlink)return o.ValueType.Hyperlink;if(e.formula)return o.ValueType.Formula;if(e.error)return o.ValueType.Error;throw Error(`I could not understand type of value`)}t.exports=class extends i{constructor(){super(),this.richTextXForm=new s}get tag(){return`c`}prepare(e,t){let n=t.styles.addStyleModel(e.style||{},function(e){switch(e.type){case o.ValueType.Formula:return c(e.result);default:return e.type}}(e));switch(n&&(e.styleId=n),e.comment&&t.comments.push({...e.comment,ref:e.address}),e.type){case o.ValueType.String:case o.ValueType.RichText:t.sharedStrings&&(e.ssId=t.sharedStrings.add(e.value));break;case o.ValueType.Date:t.date1904&&(e.date1904=!0);break;case o.ValueType.Hyperlink:t.sharedStrings&&e.text!==void 0&&e.text!==null&&(e.ssId=t.sharedStrings.add(e.text)),t.hyperlinks.push({address:e.address,target:e.hyperlink,tooltip:e.tooltip});break;case o.ValueType.Merge:t.merges.add(e);break;case o.ValueType.Formula:if(t.date1904&&(e.date1904=!0),e.shareType===`shared`&&(e.si=t.siFormulae++),e.formula)t.formulae[e.address]=e;else if(e.sharedFormula){let n=t.formulae[e.sharedFormula];if(!n)throw Error(`Shared Formula master must exist above and or left of clone for cell `+e.address);n.si===void 0?(n.shareType=`shared`,n.si=t.siFormulae++,n.range=new a(n.address,e.address)):n.range&&n.range.expandToAddress(e.address),e.si=n.si}}}renderFormula(e,t){let n=null;switch(t.shareType){case`shared`:n={t:`shared`,ref:t.ref||t.range.range,si:t.si};break;case`array`:n={t:`array`,ref:t.ref};break;default:t.si!==void 0&&(n={t:`shared`,si:t.si})}switch(c(t.result)){case o.ValueType.Null:e.leafNode(`f`,n,t.formula);break;case o.ValueType.String:e.addAttribute(`t`,`str`),e.leafNode(`f`,n,t.formula),e.leafNode(`v`,null,t.result);break;case o.ValueType.Number:e.leafNode(`f`,n,t.formula),e.leafNode(`v`,null,t.result);break;case o.ValueType.Boolean:e.addAttribute(`t`,`b`),e.leafNode(`f`,n,t.formula),e.leafNode(`v`,null,+!!t.result);break;case o.ValueType.Error:e.addAttribute(`t`,`e`),e.leafNode(`f`,n,t.formula),e.leafNode(`v`,null,t.result.error);break;case o.ValueType.Date:e.leafNode(`f`,n,t.formula),e.leafNode(`v`,null,r.dateToExcel(t.result,t.date1904));break;default:throw Error(`I could not understand type of value`)}}render(e,t){if(t.type!==o.ValueType.Null||t.styleId){switch(e.openNode(`c`),e.addAttribute(`r`,t.address),t.styleId&&e.addAttribute(`s`,t.styleId),t.type){case o.ValueType.Null:break;case o.ValueType.Number:e.leafNode(`v`,null,t.value);break;case o.ValueType.Boolean:e.addAttribute(`t`,`b`),e.leafNode(`v`,null,t.value?`1`:`0`);break;case o.ValueType.Error:e.addAttribute(`t`,`e`),e.leafNode(`v`,null,t.value.error);break;case o.ValueType.String:case o.ValueType.RichText:t.ssId===void 0?t.value&&t.value.richText?(e.addAttribute(`t`,`inlineStr`),e.openNode(`is`),t.value.richText.forEach(t=>{this.richTextXForm.render(e,t)}),e.closeNode(`is`)):(e.addAttribute(`t`,`str`),e.leafNode(`v`,null,t.value)):(e.addAttribute(`t`,`s`),e.leafNode(`v`,null,t.ssId));break;case o.ValueType.Date:e.leafNode(`v`,null,r.dateToExcel(t.value,t.date1904));break;case o.ValueType.Hyperlink:t.ssId===void 0?(e.addAttribute(`t`,`str`),e.leafNode(`v`,null,t.text)):(e.addAttribute(`t`,`s`),e.leafNode(`v`,null,t.ssId));break;case o.ValueType.Formula:this.renderFormula(e,t);break;case o.ValueType.Merge:}e.closeNode()}}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`c`:return this.model={address:e.attributes.r},this.t=e.attributes.t,e.attributes.s&&(this.model.styleId=parseInt(e.attributes.s,10)),!0;case`f`:return this.currentNode=`f`,this.model.si=e.attributes.si,this.model.shareType=e.attributes.t,this.model.ref=e.attributes.ref,!0;case`v`:return this.currentNode=`v`,!0;case`t`:return this.currentNode=`t`,!0;case`r`:return this.parser=this.richTextXForm,this.parser.parseOpen(e),!0;default:return!1}}parseText(e){if(this.parser)this.parser.parseText(e);else switch(this.currentNode){case`f`:this.model.formula=this.model.formula?this.model.formula+e:e;break;case`v`:case`t`:this.model.value&&this.model.value.richText?this.model.value.richText.text=this.model.value.richText.text?this.model.value.richText.text+e:e:this.model.value=this.model.value?this.model.value+e:e}}parseClose(e){switch(e){case`c`:{let{model:e}=this;if(e.formula||e.shareType)e.type=o.ValueType.Formula,e.value&&(e.result=this.t===`str`?r.xmlDecode(e.value):this.t===`b`?parseInt(e.value,10)!==0:this.t===`e`?{error:e.value}:parseFloat(e.value),e.value=void 0);else if(e.value!==void 0)switch(this.t){case`s`:e.type=o.ValueType.String,e.value=parseInt(e.value,10);break;case`str`:e.type=o.ValueType.String,e.value=r.xmlDecode(e.value);break;case`inlineStr`:e.type=o.ValueType.String;break;case`b`:e.type=o.ValueType.Boolean,e.value=parseInt(e.value,10)!==0;break;case`e`:e.type=o.ValueType.Error,e.value={error:e.value};break;default:e.type=o.ValueType.Number,e.value=parseFloat(e.value)}else e.type=e.styleId?o.ValueType.Null:o.ValueType.Merge;return!1}case`f`:case`v`:case`is`:return this.currentNode=void 0,!0;case`t`:return this.parser?(this.parser.parseClose(e),!0):(this.currentNode=void 0,!0);case`r`:return this.model.value=this.model.value||{},this.model.value.richText=this.model.value.richText||[],this.model.value.richText.push(this.parser.model),this.parser=void 0,this.currentNode=void 0,!0;default:return!!this.parser&&(this.parser.parseClose(e),!0)}}reconcile(e,t){let n=e.styleId&&t.styles&&t.styles.getStyleModel(e.styleId);switch(n&&(e.style=n),e.styleId!==void 0&&(e.styleId=void 0),e.type){case o.ValueType.String:typeof e.value==`number`&&t.sharedStrings&&(e.value=t.sharedStrings.getString(e.value)),e.value.richText&&(e.type=o.ValueType.RichText);break;case o.ValueType.Number:n&&r.isDateFmt(n.numFmt)&&(e.type=o.ValueType.Date,e.value=r.excelToDate(e.value,t.date1904));break;case o.ValueType.Formula:e.result!==void 0&&n&&r.isDateFmt(n.numFmt)&&(e.result=r.excelToDate(e.result,t.date1904)),e.shareType===`shared`&&(e.ref?t.formulae[e.si]=e.address:(e.sharedFormula=t.formulae[e.si],delete e.shareType),delete e.si)}let i=t.hyperlinkMap[e.address];i&&(e.type===o.ValueType.Formula?(e.text=e.result,e.result=void 0):(e.text=e.value,e.value=void 0),e.type=o.ValueType.Hyperlink,e.hyperlink=i);let a=t.commentsMap&&t.commentsMap[e.address];a&&(e.comment=a)}}},{"../../../doc/enums":7,"../../../doc/range":10,"../../../utils/utils":27,"../base-xform":32,"../strings/rich-text-xform":122}],74:[function(e,t,n){let r=e(`../../base-xform`);t.exports=class extends r{get tag(){return`x14:cfIcon`}render(e,t){e.leafNode(this.tag,{iconSet:t.iconSet,iconId:t.iconId})}parseOpen(e){let{attributes:t}=e;this.model={iconSet:t.iconSet,iconId:r.toIntValue(t.iconId)}}parseClose(e){return e!==this.tag}}},{"../../base-xform":32}],75:[function(e,t,n){let{v4:r}=e(`uuid`),i=e(`../../base-xform`),a=e(`../../composite-xform`),o=e(`./databar-ext-xform`),s=e(`./icon-set-ext-xform`),c={"3Triangles":!0,"3Stars":!0,"5Boxes":!0};class l extends a{constructor(){super(),this.map={"x14:dataBar":this.databarXform=new o,"x14:iconSet":this.iconSetXform=new s}}get tag(){return`x14:cfRule`}static isExt(e){return e.type===`dataBar`?o.isExt(e):!(e.type!==`iconSet`||!e.custom&&!c[e.iconSet])}prepare(e){l.isExt(e)&&(e.x14Id=`{${r()}}`.toUpperCase())}render(e,t){if(l.isExt(t))switch(t.type){case`dataBar`:this.renderDataBar(e,t);break;case`iconSet`:this.renderIconSet(e,t)}}renderDataBar(e,t){e.openNode(this.tag,{type:`dataBar`,id:t.x14Id}),this.databarXform.render(e,t),e.closeNode()}renderIconSet(e,t){e.openNode(this.tag,{type:`iconSet`,priority:t.priority,id:t.x14Id||`{${r()}}`}),this.iconSetXform.render(e,t),e.closeNode()}createNewModel(e){let{attributes:t}=e;return{type:t.type,x14Id:t.id,priority:i.toIntValue(t.priority)}}onParserClose(e,t){Object.assign(this.model,t.model)}}t.exports=l},{"../../base-xform":32,"../../composite-xform":48,"./databar-ext-xform":79,"./icon-set-ext-xform":81,uuid:528}],76:[function(e,t,n){let r=e(`../../composite-xform`),i=e(`./f-ext-xform`);t.exports=class extends r{constructor(){super(),this.map={"xm:f":this.fExtXform=new i}}get tag(){return`x14:cfvo`}render(e,t){e.openNode(this.tag,{type:t.type}),t.value!==void 0&&this.fExtXform.render(e,t.value),e.closeNode()}createNewModel(e){return{type:e.attributes.type}}onParserClose(e,t){e===`xm:f`&&(this.model.value=t.model?parseFloat(t.model):0)}}},{"../../composite-xform":48,"./f-ext-xform":80}],77:[function(e,t,n){let r=e(`../../composite-xform`),i=e(`./sqref-ext-xform`),a=e(`./cf-rule-ext-xform`);t.exports=class extends r{constructor(){super(),this.map={"xm:sqref":this.sqRef=new i,"x14:cfRule":this.cfRule=new a}}get tag(){return`x14:conditionalFormatting`}prepare(e,t){e.rules.forEach(e=>{this.cfRule.prepare(e,t)})}render(e,t){t.rules.some(a.isExt)&&(e.openNode(this.tag,{"xmlns:xm":`http://schemas.microsoft.com/office/excel/2006/main`}),t.rules.filter(a.isExt).forEach(t=>this.cfRule.render(e,t)),this.sqRef.render(e,t.ref),e.closeNode())}createNewModel(){return{rules:[]}}onParserClose(e,t){switch(e){case`xm:sqref`:this.model.ref=t.model;break;case`x14:cfRule`:this.model.rules.push(t.model)}}}},{"../../composite-xform":48,"./cf-rule-ext-xform":75,"./sqref-ext-xform":82}],78:[function(e,t,n){let r=e(`../../composite-xform`),i=e(`./cf-rule-ext-xform`),a=e(`./conditional-formatting-ext-xform`);t.exports=class extends r{constructor(){super(),this.map={"x14:conditionalFormatting":this.cfXform=new a}}get tag(){return`x14:conditionalFormattings`}hasContent(e){return e.hasExtContent===void 0&&(e.hasExtContent=e.some(e=>e.rules.some(i.isExt))),e.hasExtContent}prepare(e,t){e.forEach(e=>{this.cfXform.prepare(e,t)})}render(e,t){this.hasContent(t)&&(e.openNode(this.tag),t.forEach(t=>this.cfXform.render(e,t)),e.closeNode())}createNewModel(){return[]}onParserClose(e,t){this.model.push(t.model)}}},{"../../composite-xform":48,"./cf-rule-ext-xform":75,"./conditional-formatting-ext-xform":77}],79:[function(e,t,n){let r=e(`../../base-xform`),i=e(`../../composite-xform`),a=e(`../../style/color-xform`),o=e(`./cfvo-ext-xform`);t.exports=class extends i{constructor(){super(),this.map={"x14:cfvo":this.cfvoXform=new o,"x14:borderColor":this.borderColorXform=new a(`x14:borderColor`),"x14:negativeBorderColor":this.negativeBorderColorXform=new a(`x14:negativeBorderColor`),"x14:negativeFillColor":this.negativeFillColorXform=new a(`x14:negativeFillColor`),"x14:axisColor":this.axisColorXform=new a(`x14:axisColor`)}}static isExt(e){return!e.gradient}get tag(){return`x14:dataBar`}render(e,t){e.openNode(this.tag,{minLength:r.toIntAttribute(t.minLength,0,!0),maxLength:r.toIntAttribute(t.maxLength,100,!0),border:r.toBoolAttribute(t.border,!1),gradient:r.toBoolAttribute(t.gradient,!0),negativeBarColorSameAsPositive:r.toBoolAttribute(t.negativeBarColorSameAsPositive,!0),negativeBarBorderColorSameAsPositive:r.toBoolAttribute(t.negativeBarBorderColorSameAsPositive,!0),axisPosition:r.toAttribute(t.axisPosition,`auto`),direction:r.toAttribute(t.direction,`leftToRight`)}),t.cfvo.forEach(t=>{this.cfvoXform.render(e,t)}),this.borderColorXform.render(e,t.borderColor),this.negativeBorderColorXform.render(e,t.negativeBorderColor),this.negativeFillColorXform.render(e,t.negativeFillColor),this.axisColorXform.render(e,t.axisColor),e.closeNode()}createNewModel(e){let{attributes:t}=e;return{cfvo:[],minLength:r.toIntValue(t.minLength,0),maxLength:r.toIntValue(t.maxLength,100),border:r.toBoolValue(t.border,!1),gradient:r.toBoolValue(t.gradient,!0),negativeBarColorSameAsPositive:r.toBoolValue(t.negativeBarColorSameAsPositive,!0),negativeBarBorderColorSameAsPositive:r.toBoolValue(t.negativeBarBorderColorSameAsPositive,!0),axisPosition:r.toStringValue(t.axisPosition,`auto`),direction:r.toStringValue(t.direction,`leftToRight`)}}onParserClose(e,t){let[,n]=e.split(`:`);switch(n){case`cfvo`:this.model.cfvo.push(t.model);break;default:this.model[n]=t.model}}}},{"../../base-xform":32,"../../composite-xform":48,"../../style/color-xform":128,"./cfvo-ext-xform":76}],80:[function(e,t,n){let r=e(`../../base-xform`);t.exports=class extends r{get tag(){return`xm:f`}render(e,t){e.leafNode(this.tag,null,t)}parseOpen(){this.model=``}parseText(e){this.model+=e}parseClose(e){return e!==this.tag}}},{"../../base-xform":32}],81:[function(e,t,n){let r=e(`../../base-xform`),i=e(`../../composite-xform`),a=e(`./cfvo-ext-xform`),o=e(`./cf-icon-ext-xform`);t.exports=class extends i{constructor(){super(),this.map={"x14:cfvo":this.cfvoXform=new a,"x14:cfIcon":this.cfIconXform=new o}}get tag(){return`x14:iconSet`}render(e,t){e.openNode(this.tag,{iconSet:r.toStringAttribute(t.iconSet),reverse:r.toBoolAttribute(t.reverse,!1),showValue:r.toBoolAttribute(t.showValue,!0),custom:r.toBoolAttribute(t.icons,!1)}),t.cfvo.forEach(t=>{this.cfvoXform.render(e,t)}),t.icons&&t.icons.forEach((t,n)=>{t.iconId=n,this.cfIconXform.render(e,t)}),e.closeNode()}createNewModel(e){let{attributes:t}=e;return{cfvo:[],iconSet:r.toStringValue(t.iconSet,`3TrafficLights`),reverse:r.toBoolValue(t.reverse,!1),showValue:r.toBoolValue(t.showValue,!0)}}onParserClose(e,t){let[,n]=e.split(`:`);switch(n){case`cfvo`:this.model.cfvo.push(t.model);break;case`cfIcon`:this.model.icons||(this.model.icons=[]),this.model.icons.push(t.model);break;default:this.model[n]=t.model}}}},{"../../base-xform":32,"../../composite-xform":48,"./cf-icon-ext-xform":74,"./cfvo-ext-xform":76}],82:[function(e,t,n){let r=e(`../../base-xform`);t.exports=class extends r{get tag(){return`xm:sqref`}render(e,t){e.leafNode(this.tag,null,t)}parseOpen(){this.model=``}parseText(e){this.model+=e}parseClose(e){return e!==this.tag}}},{"../../base-xform":32}],83:[function(e,t,n){let r=e(`../../base-xform`),i=e(`../../composite-xform`),a=e(`../../../../doc/range`),o=e(`./databar-xform`),s=e(`./ext-lst-ref-xform`),c=e(`./formula-xform`),l=e(`./color-scale-xform`),u=e(`./icon-set-xform`),d={"3Triangles":!0,"3Stars":!0,"5Boxes":!0},f=e=>{let{type:t,operator:n}=e;switch(t){case`containsText`:case`containsBlanks`:case`notContainsBlanks`:case`containsErrors`:case`notContainsErrors`:return{type:`containsText`,operator:t};default:return{type:t,operator:n}}};class p extends i{constructor(){super(),this.map={dataBar:this.databarXform=new o,extLst:this.extLstRefXform=new s,formula:this.formulaXform=new c,colorScale:this.colorScaleXform=new l,iconSet:this.iconSetXform=new u}}get tag(){return`cfRule`}static isPrimitive(e){return e.type!==`iconSet`||!e.custom&&!d[e.iconSet]}render(e,t){switch(t.type){case`expression`:this.renderExpression(e,t);break;case`cellIs`:this.renderCellIs(e,t);break;case`top10`:this.renderTop10(e,t);break;case`aboveAverage`:this.renderAboveAverage(e,t);break;case`dataBar`:this.renderDataBar(e,t);break;case`colorScale`:this.renderColorScale(e,t);break;case`iconSet`:this.renderIconSet(e,t);break;case`containsText`:this.renderText(e,t);break;case`timePeriod`:this.renderTimePeriod(e,t)}}renderExpression(e,t){e.openNode(this.tag,{type:`expression`,dxfId:t.dxfId,priority:t.priority}),this.formulaXform.render(e,t.formulae[0]),e.closeNode()}renderCellIs(e,t){e.openNode(this.tag,{type:`cellIs`,dxfId:t.dxfId,priority:t.priority,operator:t.operator}),t.formulae.forEach(t=>{this.formulaXform.render(e,t)}),e.closeNode()}renderTop10(e,t){e.leafNode(this.tag,{type:`top10`,dxfId:t.dxfId,priority:t.priority,percent:r.toBoolAttribute(t.percent,!1),bottom:r.toBoolAttribute(t.bottom,!1),rank:r.toIntValue(t.rank,10,!0)})}renderAboveAverage(e,t){e.leafNode(this.tag,{type:`aboveAverage`,dxfId:t.dxfId,priority:t.priority,aboveAverage:r.toBoolAttribute(t.aboveAverage,!0)})}renderDataBar(e,t){e.openNode(this.tag,{type:`dataBar`,priority:t.priority}),this.databarXform.render(e,t),this.extLstRefXform.render(e,t),e.closeNode()}renderColorScale(e,t){e.openNode(this.tag,{type:`colorScale`,priority:t.priority}),this.colorScaleXform.render(e,t),e.closeNode()}renderIconSet(e,t){p.isPrimitive(t)&&(e.openNode(this.tag,{type:`iconSet`,priority:t.priority}),this.iconSetXform.render(e,t),e.closeNode())}renderText(e,t){e.openNode(this.tag,{type:t.operator,dxfId:t.dxfId,priority:t.priority,operator:r.toStringAttribute(t.operator,`containsText`)});let n=(e=>{if(e.formulae&&e.formulae[0])return e.formulae[0];let{tl:t}=new a(e.ref);switch(e.operator){case`containsText`:return`NOT(ISERROR(SEARCH("${e.text}",${t})))`;case`containsBlanks`:return`LEN(TRIM(${t}))=0`;case`notContainsBlanks`:return`LEN(TRIM(${t}))>0`;case`containsErrors`:return`ISERROR(${t})`;case`notContainsErrors`:return`NOT(ISERROR(${t}))`;default:return}})(t);n&&this.formulaXform.render(e,n),e.closeNode()}renderTimePeriod(e,t){e.openNode(this.tag,{type:`timePeriod`,dxfId:t.dxfId,priority:t.priority,timePeriod:t.timePeriod});let n=(e=>{if(e.formulae&&e.formulae[0])return e.formulae[0];let{tl:t}=new a(e.ref);switch(e.timePeriod){case`thisWeek`:return`AND(TODAY()-ROUNDDOWN(${t},0)<=WEEKDAY(TODAY())-1,ROUNDDOWN(${t},0)-TODAY()<=7-WEEKDAY(TODAY()))`;case`lastWeek`:return`AND(TODAY()-ROUNDDOWN(${t},0)>=(WEEKDAY(TODAY())),TODAY()-ROUNDDOWN(${t},0)<(WEEKDAY(TODAY())+7))`;case`nextWeek`:return`AND(ROUNDDOWN(${t},0)-TODAY()>(7-WEEKDAY(TODAY())),ROUNDDOWN(${t},0)-TODAY()<(15-WEEKDAY(TODAY())))`;case`yesterday`:return`FLOOR(${t},1)=TODAY()-1`;case`today`:return`FLOOR(${t},1)=TODAY()`;case`tomorrow`:return`FLOOR(${t},1)=TODAY()+1`;case`last7Days`:return`AND(TODAY()-FLOOR(${t},1)<=6,FLOOR(${t},1)<=TODAY())`;case`lastMonth`:return`AND(MONTH(${t})=MONTH(EDATE(TODAY(),0-1)),YEAR(${t})=YEAR(EDATE(TODAY(),0-1)))`;case`thisMonth`:return`AND(MONTH(${t})=MONTH(TODAY()),YEAR(${t})=YEAR(TODAY()))`;case`nextMonth`:return`AND(MONTH(${t})=MONTH(EDATE(TODAY(),0+1)),YEAR(${t})=YEAR(EDATE(TODAY(),0+1)))`;default:return}})(t);n&&this.formulaXform.render(e,n),e.closeNode()}createNewModel(e){let{attributes:t}=e;return{...f(t),dxfId:r.toIntValue(t.dxfId),priority:r.toIntValue(t.priority),timePeriod:t.timePeriod,percent:r.toBoolValue(t.percent),bottom:r.toBoolValue(t.bottom),rank:r.toIntValue(t.rank),aboveAverage:r.toBoolValue(t.aboveAverage)}}onParserClose(e,t){switch(e){case`dataBar`:case`extLst`:case`colorScale`:case`iconSet`:Object.assign(this.model,t.model);break;case`formula`:this.model.formulae=this.model.formulae||[],this.model.formulae.push(t.model)}}}t.exports=p},{"../../../../doc/range":10,"../../base-xform":32,"../../composite-xform":48,"./color-scale-xform":85,"./databar-xform":88,"./ext-lst-ref-xform":89,"./formula-xform":90,"./icon-set-xform":91}],84:[function(e,t,n){let r=e(`../../base-xform`);t.exports=class extends r{get tag(){return`cfvo`}render(e,t){e.leafNode(this.tag,{type:t.type,val:t.value})}parseOpen(e){this.model={type:e.attributes.type,value:r.toFloatValue(e.attributes.val)}}parseClose(e){return e!==this.tag}}},{"../../base-xform":32}],85:[function(e,t,n){let r=e(`../../composite-xform`),i=e(`../../style/color-xform`),a=e(`./cfvo-xform`);t.exports=class extends r{constructor(){super(),this.map={cfvo:this.cfvoXform=new a,color:this.colorXform=new i}}get tag(){return`colorScale`}render(e,t){e.openNode(this.tag),t.cfvo.forEach(t=>{this.cfvoXform.render(e,t)}),t.color.forEach(t=>{this.colorXform.render(e,t)}),e.closeNode()}createNewModel(e){return{cfvo:[],color:[]}}onParserClose(e,t){this.model[e].push(t.model)}}},{"../../composite-xform":48,"../../style/color-xform":128,"./cfvo-xform":84}],86:[function(e,t,n){let r=e(`../../composite-xform`),i=e(`./cf-rule-xform`);t.exports=class extends r{constructor(){super(),this.map={cfRule:new i}}get tag(){return`conditionalFormatting`}render(e,t){t.rules.some(i.isPrimitive)&&(e.openNode(this.tag,{sqref:t.ref}),t.rules.forEach(n=>{i.isPrimitive(n)&&(n.ref=t.ref,this.map.cfRule.render(e,n))}),e.closeNode())}createNewModel(e){let{attributes:t}=e;return{ref:t.sqref,rules:[]}}onParserClose(e,t){this.model.rules.push(t.model)}}},{"../../composite-xform":48,"./cf-rule-xform":83}],87:[function(e,t,n){let r=e(`../../base-xform`),i=e(`./conditional-formatting-xform`);t.exports=class extends r{constructor(){super(),this.cfXform=new i}get tag(){return`conditionalFormatting`}reset(){this.model=[]}prepare(e,t){let n=e.reduce((e,t)=>Math.max(e,...t.rules.map(e=>e.priority||0)),1);e.forEach(e=>{e.rules.forEach(e=>{e.priority||(e.priority=n++),e.style&&(e.dxfId=t.styles.addDxfStyle(e.style))})})}render(e,t){t.forEach(t=>{this.cfXform.render(e,t)})}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`conditionalFormatting`:return this.parser=this.cfXform,this.parser.parseOpen(e),!0;default:return!1}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){return!!this.parser&&(!!this.parser.parseClose(e)||(this.model.push(this.parser.model),this.parser=void 0,!1))}reconcile(e,t){e.forEach(e=>{e.rules.forEach(e=>{e.dxfId!==void 0&&(e.style=t.styles.getDxfStyle(e.dxfId),delete e.dxfId)})})}}},{"../../base-xform":32,"./conditional-formatting-xform":86}],88:[function(e,t,n){let r=e(`../../composite-xform`),i=e(`../../style/color-xform`),a=e(`./cfvo-xform`);t.exports=class extends r{constructor(){super(),this.map={cfvo:this.cfvoXform=new a,color:this.colorXform=new i}}get tag(){return`dataBar`}render(e,t){e.openNode(this.tag),t.cfvo.forEach(t=>{this.cfvoXform.render(e,t)}),this.colorXform.render(e,t.color),e.closeNode()}createNewModel(){return{cfvo:[]}}onParserClose(e,t){switch(e){case`cfvo`:this.model.cfvo.push(t.model);break;case`color`:this.model.color=t.model}}}},{"../../composite-xform":48,"../../style/color-xform":128,"./cfvo-xform":84}],89:[function(e,t,n){let r=e(`../../base-xform`),i=e(`../../composite-xform`);class a extends r{get tag(){return`x14:id`}render(e,t){e.leafNode(this.tag,null,t)}parseOpen(){this.model=``}parseText(e){this.model+=e}parseClose(e){return e!==this.tag}}class o extends i{constructor(){super(),this.map={"x14:id":this.idXform=new a}}get tag(){return`ext`}render(e,t){e.openNode(this.tag,{uri:`{B025F937-C7B1-47D3-B67F-A62EFF666E3E}`,"xmlns:x14":`http://schemas.microsoft.com/office/spreadsheetml/2009/9/main`}),this.idXform.render(e,t.x14Id),e.closeNode()}createNewModel(){return{}}onParserClose(e,t){this.model.x14Id=t.model}}t.exports=class extends i{constructor(){super(),this.map={ext:new o}}get tag(){return`extLst`}render(e,t){e.openNode(this.tag),this.map.ext.render(e,t),e.closeNode()}createNewModel(){return{}}onParserClose(e,t){Object.assign(this.model,t.model)}}},{"../../base-xform":32,"../../composite-xform":48}],90:[function(e,t,n){let r=e(`../../base-xform`);t.exports=class extends r{get tag(){return`formula`}render(e,t){e.leafNode(this.tag,null,t)}parseOpen(){this.model=``}parseText(e){this.model+=e}parseClose(e){return e!==this.tag}}},{"../../base-xform":32}],91:[function(e,t,n){let r=e(`../../base-xform`),i=e(`../../composite-xform`),a=e(`./cfvo-xform`);t.exports=class extends i{constructor(){super(),this.map={cfvo:this.cfvoXform=new a}}get tag(){return`iconSet`}render(e,t){e.openNode(this.tag,{iconSet:r.toStringAttribute(t.iconSet,`3TrafficLights`),reverse:r.toBoolAttribute(t.reverse,!1),showValue:r.toBoolAttribute(t.showValue,!0)}),t.cfvo.forEach(t=>{this.cfvoXform.render(e,t)}),e.closeNode()}createNewModel(e){let{attributes:t}=e;return{iconSet:r.toStringValue(t.iconSet,`3TrafficLights`),reverse:r.toBoolValue(t.reverse),showValue:r.toBoolValue(t.showValue),cfvo:[]}}onParserClose(e,t){this.model[e].push(t.model)}}},{"../../base-xform":32,"../../composite-xform":48,"./cfvo-xform":84}],92:[function(e,t,n){let r=e(`../../../utils/utils`),i=e(`../base-xform`);t.exports=class extends i{get tag(){return`col`}prepare(e,t){let n=t.styles.addStyleModel(e.style||{});n&&(e.styleId=n)}render(e,t){e.openNode(`col`),e.addAttribute(`min`,t.min),e.addAttribute(`max`,t.max),t.width&&e.addAttribute(`width`,t.width),t.styleId&&e.addAttribute(`style`,t.styleId),t.hidden&&e.addAttribute(`hidden`,`1`),t.bestFit&&e.addAttribute(`bestFit`,`1`),t.outlineLevel&&e.addAttribute(`outlineLevel`,t.outlineLevel),t.collapsed&&e.addAttribute(`collapsed`,`1`),e.addAttribute(`customWidth`,`1`),e.closeNode()}parseOpen(e){if(e.name===`col`){let t=this.model={min:parseInt(e.attributes.min||`0`,10),max:parseInt(e.attributes.max||`0`,10),width:e.attributes.width===void 0?void 0:parseFloat(e.attributes.width||`0`)};return e.attributes.style&&(t.styleId=parseInt(e.attributes.style,10)),r.parseBoolean(e.attributes.hidden)&&(t.hidden=!0),r.parseBoolean(e.attributes.bestFit)&&(t.bestFit=!0),e.attributes.outlineLevel&&(t.outlineLevel=parseInt(e.attributes.outlineLevel,10)),r.parseBoolean(e.attributes.collapsed)&&(t.collapsed=!0),!0}return!1}parseText(){}parseClose(){return!1}reconcile(e,t){e.styleId&&(e.style=t.styles.getStyleModel(e.styleId))}}},{"../../../utils/utils":27,"../base-xform":32}],93:[function(e,t,n){let r=e(`../../../utils/under-dash`),i=e(`../../../utils/utils`),a=e(`../../../utils/col-cache`),o=e(`../base-xform`),s=e(`../../../doc/range`);function c(e,t,n,r){let i=t[n];i===void 0?r!==void 0&&(e[n]=r):e[n]=i}function l(e,t,n,r){let a=t[n];a===void 0?r!==void 0&&(e[n]=r):e[n]=i.parseBoolean(a)}t.exports=class extends o{get tag(){return`dataValidations`}render(e,t){let n=function(e){let t=r.map(e,(e,t)=>({address:t,dataValidation:e,marked:!1})).sort((e,t)=>r.strcmp(e.address,t.address)),n=r.keyBy(t,`address`),i=(t,n,i)=>{for(let o=0;o{if(!t.marked){let o=a.decodeEx(t.address);if(o.dimensions)return n[o.dimensions].marked=!0,{...t.dataValidation,sqref:t.address};let s=1,c=a.encodeAddress(o.row+s,o.col);for(;e[c]&&r.isEqual(t.dataValidation,e[c]);)s++,c=a.encodeAddress(o.row+s,o.col);let l=1;for(;i(o,s,o.col+l);)l++;for(let e=0;e1||l>1){let e=o.row+(s-1),n=o.col+(l-1);return{...t.dataValidation,sqref:`${t.address}:${a.encodeAddress(e,n)}`}}return{...t.dataValidation,sqref:t.address}}return null}).filter(Boolean)}(t);n.length&&(e.openNode(`dataValidations`,{count:n.length}),n.forEach(t=>{e.openNode(`dataValidation`),t.type!==`any`&&(e.addAttribute(`type`,t.type),t.operator&&t.type!==`list`&&t.operator!==`between`&&e.addAttribute(`operator`,t.operator),t.allowBlank&&e.addAttribute(`allowBlank`,`1`)),t.showInputMessage&&e.addAttribute(`showInputMessage`,`1`),t.promptTitle&&e.addAttribute(`promptTitle`,t.promptTitle),t.prompt&&e.addAttribute(`prompt`,t.prompt),t.showErrorMessage&&e.addAttribute(`showErrorMessage`,`1`),t.errorStyle&&e.addAttribute(`errorStyle`,t.errorStyle),t.errorTitle&&e.addAttribute(`errorTitle`,t.errorTitle),t.error&&e.addAttribute(`error`,t.error),e.addAttribute(`sqref`,t.sqref),(t.formulae||[]).forEach((n,r)=>{e.openNode(`formula`+(r+1)),t.type===`date`?e.writeText(i.dateToExcel(new Date(n))):e.writeText(n),e.closeNode()}),e.closeNode()}),e.closeNode())}parseOpen(e){switch(e.name){case`dataValidations`:return this.model={},!0;case`dataValidation`:{this._address=e.attributes.sqref;let t={type:e.attributes.type||`any`,formulae:[]};switch(e.attributes.type&&l(t,e.attributes,`allowBlank`),l(t,e.attributes,`showInputMessage`),l(t,e.attributes,`showErrorMessage`),t.type){case`any`:case`list`:case`custom`:break;default:c(t,e.attributes,`operator`,`between`)}return c(t,e.attributes,`promptTitle`),c(t,e.attributes,`prompt`),c(t,e.attributes,`errorStyle`),c(t,e.attributes,`errorTitle`),c(t,e.attributes,`error`),this._dataValidation=t,!0}case`formula1`:case`formula2`:return this._formula=[],!0;default:return!1}}parseText(e){this._formula&&this._formula.push(e)}parseClose(e){switch(e){case`dataValidations`:return!1;case`dataValidation`:return this._dataValidation.formulae&&this._dataValidation.formulae.length||(delete this._dataValidation.formulae,delete this._dataValidation.operator),(this._address.split(/\s+/g)||[]).forEach(e=>{e.includes(`:`)?new s(e).forEachAddress(e=>{this.model[e]=this._dataValidation}):this.model[e]=this._dataValidation}),!0;case`formula1`:case`formula2`:{let e=this._formula.join(``);switch(this._dataValidation.type){case`whole`:case`textLength`:e=parseInt(e,10);break;case`decimal`:e=parseFloat(e);break;case`date`:e=i.excelToDate(parseFloat(e))}return this._dataValidation.formulae.push(e),this._formula=void 0,!0}default:return!0}}}},{"../../../doc/range":10,"../../../utils/col-cache":19,"../../../utils/under-dash":26,"../../../utils/utils":27,"../base-xform":32}],94:[function(e,t,n){let r=e(`../base-xform`);t.exports=class extends r{get tag(){return`dimension`}render(e,t){t&&e.leafNode(`dimension`,{ref:t})}parseOpen(e){return e.name===`dimension`&&(this.model=e.attributes.ref,!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],95:[function(e,t,n){let r=e(`../base-xform`);t.exports=class extends r{get tag(){return`drawing`}render(e,t){t&&e.leafNode(this.tag,{"r:id":t.rId})}parseOpen(e){switch(e.name){case this.tag:return this.model={rId:e.attributes[`r:id`]},!0;default:return!1}}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],96:[function(e,t,n){let r=e(`../composite-xform`),i=e(`./cf-ext/conditional-formattings-ext-xform`);class a extends r{constructor(){super(),this.map={"x14:conditionalFormattings":this.conditionalFormattings=new i}}get tag(){return`ext`}hasContent(e){return this.conditionalFormattings.hasContent(e.conditionalFormattings)}prepare(e,t){this.conditionalFormattings.prepare(e.conditionalFormattings,t)}render(e,t){e.openNode(`ext`,{uri:`{78C0D931-6437-407d-A8EE-F0AAD7539E65}`,"xmlns:x14":`http://schemas.microsoft.com/office/spreadsheetml/2009/9/main`}),this.conditionalFormattings.render(e,t.conditionalFormattings),e.closeNode()}createNewModel(){return{}}onParserClose(e,t){this.model[e]=t.model}}t.exports=class extends r{constructor(){super(),this.map={ext:this.ext=new a}}get tag(){return`extLst`}prepare(e,t){this.ext.prepare(e,t)}hasContent(e){return this.ext.hasContent(e)}render(e,t){this.hasContent(t)&&(e.openNode(`extLst`),this.ext.render(e,t),e.closeNode())}createNewModel(){return{}}onParserClose(e,t){Object.assign(this.model,t.model)}}},{"../composite-xform":48,"./cf-ext/conditional-formattings-ext-xform":78}],97:[function(e,t,n){let r=e(`../base-xform`);t.exports=class extends r{get tag(){return`headerFooter`}render(e,t){if(t){e.addRollback();let n=!1;e.openNode(`headerFooter`),t.differentFirst&&(e.addAttribute(`differentFirst`,`1`),n=!0),t.differentOddEven&&(e.addAttribute(`differentOddEven`,`1`),n=!0),t.oddHeader&&typeof t.oddHeader==`string`&&(e.leafNode(`oddHeader`,null,t.oddHeader),n=!0),t.oddFooter&&typeof t.oddFooter==`string`&&(e.leafNode(`oddFooter`,null,t.oddFooter),n=!0),t.evenHeader&&typeof t.evenHeader==`string`&&(e.leafNode(`evenHeader`,null,t.evenHeader),n=!0),t.evenFooter&&typeof t.evenFooter==`string`&&(e.leafNode(`evenFooter`,null,t.evenFooter),n=!0),t.firstHeader&&typeof t.firstHeader==`string`&&(e.leafNode(`firstHeader`,null,t.firstHeader),n=!0),t.firstFooter&&typeof t.firstFooter==`string`&&(e.leafNode(`firstFooter`,null,t.firstFooter),n=!0),n?(e.closeNode(),e.commit()):e.rollback()}}parseOpen(e){switch(e.name){case`headerFooter`:return this.model={},e.attributes.differentFirst&&(this.model.differentFirst=parseInt(e.attributes.differentFirst,0)===1),e.attributes.differentOddEven&&(this.model.differentOddEven=parseInt(e.attributes.differentOddEven,0)===1),!0;case`oddHeader`:return this.currentNode=`oddHeader`,!0;case`oddFooter`:return this.currentNode=`oddFooter`,!0;case`evenHeader`:return this.currentNode=`evenHeader`,!0;case`evenFooter`:return this.currentNode=`evenFooter`,!0;case`firstHeader`:return this.currentNode=`firstHeader`,!0;case`firstFooter`:return this.currentNode=`firstFooter`,!0;default:return!1}}parseText(e){switch(this.currentNode){case`oddHeader`:this.model.oddHeader=e;break;case`oddFooter`:this.model.oddFooter=e;break;case`evenHeader`:this.model.evenHeader=e;break;case`evenFooter`:this.model.evenFooter=e;break;case`firstHeader`:this.model.firstHeader=e;break;case`firstFooter`:this.model.firstFooter=e}}parseClose(){switch(this.currentNode){case`oddHeader`:case`oddFooter`:case`evenHeader`:case`evenFooter`:case`firstHeader`:case`firstFooter`:return this.currentNode=void 0,!0;default:return!1}}}},{"../base-xform":32}],98:[function(e,t,n){let r=e(`../base-xform`);t.exports=class extends r{get tag(){return`hyperlink`}render(e,t){this.isInternalLink(t)?e.leafNode(`hyperlink`,{ref:t.address,"r:id":t.rId,tooltip:t.tooltip,location:t.target}):e.leafNode(`hyperlink`,{ref:t.address,"r:id":t.rId,tooltip:t.tooltip})}parseOpen(e){return e.name===`hyperlink`&&(this.model={address:e.attributes.ref,rId:e.attributes[`r:id`],tooltip:e.attributes.tooltip},e.attributes.location&&(this.model.target=e.attributes.location),!0)}parseText(){}parseClose(){return!1}isInternalLink(e){return e.target&&/^[^!]+![a-zA-Z]+[\d]+$/.test(e.target)}}},{"../base-xform":32}],99:[function(e,t,n){let r=e(`../base-xform`);t.exports=class extends r{get tag(){return`mergeCell`}render(e,t){e.leafNode(`mergeCell`,{ref:t})}parseOpen(e){return e.name===`mergeCell`&&(this.model=e.attributes.ref,!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],100:[function(e,t,n){let r=e(`../../../utils/under-dash`),i=e(`../../../doc/range`),a=e(`../../../utils/col-cache`),o=e(`../../../doc/enums`);t.exports=class{constructor(){this.merges={}}add(e){if(this.merges[e.master])this.merges[e.master].expandToAddress(e.address);else{let t=`${e.master}:${e.address}`;this.merges[e.master]=new i(t)}}get mergeCells(){return r.map(this.merges,e=>e.range)}reconcile(e,t){r.each(e,e=>{let n=a.decode(e);for(let e=n.top;e<=n.bottom;e++){let r=t[e-1];for(let t=n.left;t<=n.right;t++){let i=r.cells[t-1];i?i.type===o.ValueType.Merge&&(i.master=n.tl):r.cells[t]={type:o.ValueType.Null,address:a.encodeAddress(e,t)}}}})}getMasterAddress(e){let t=this.hash[e];return t&&t.tl}}},{"../../../doc/enums":7,"../../../doc/range":10,"../../../utils/col-cache":19,"../../../utils/under-dash":26}],101:[function(e,t,n){let r=e(`../base-xform`),i=e=>e!==void 0;t.exports=class extends r{get tag(){return`outlinePr`}render(e,t){return!(!t||!i(t.summaryBelow)&&!i(t.summaryRight))&&(e.leafNode(this.tag,{summaryBelow:i(t.summaryBelow)?Number(t.summaryBelow):void 0,summaryRight:i(t.summaryRight)?Number(t.summaryRight):void 0}),!0)}parseOpen(e){return e.name===this.tag&&(this.model={summaryBelow:i(e.attributes.summaryBelow)?!!Number(e.attributes.summaryBelow):void 0,summaryRight:i(e.attributes.summaryRight)?!!Number(e.attributes.summaryRight):void 0},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],102:[function(e,t,n){let r=e(`../base-xform`);t.exports=class extends r{get tag(){return`brk`}render(e,t){e.leafNode(`brk`,t)}parseOpen(e){return e.name===`brk`&&(this.model=e.attributes.ref,!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],103:[function(e,t,n){let r=e(`../../../utils/under-dash`),i=e(`../base-xform`);t.exports=class extends i{get tag(){return`pageMargins`}render(e,t){if(t){let n={left:t.left,right:t.right,top:t.top,bottom:t.bottom,header:t.header,footer:t.footer};r.some(n,e=>e!==void 0)&&e.leafNode(this.tag,n)}}parseOpen(e){switch(e.name){case this.tag:return this.model={left:parseFloat(e.attributes.left||.7),right:parseFloat(e.attributes.right||.7),top:parseFloat(e.attributes.top||.75),bottom:parseFloat(e.attributes.bottom||.75),header:parseFloat(e.attributes.header||.3),footer:parseFloat(e.attributes.footer||.3)},!0;default:return!1}}parseText(){}parseClose(){return!1}}},{"../../../utils/under-dash":26,"../base-xform":32}],104:[function(e,t,n){let r=e(`../base-xform`);t.exports=class extends r{get tag(){return`pageSetUpPr`}render(e,t){return!(!t||!t.fitToPage)&&(e.leafNode(this.tag,{fitToPage:t.fitToPage?`1`:void 0}),!0)}parseOpen(e){return e.name===this.tag&&(this.model={fitToPage:e.attributes.fitToPage===`1`},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],105:[function(e,t,n){let r=e(`../../../utils/under-dash`),i=e(`../base-xform`);function a(e){return e?`1`:void 0}function o(e){switch(e){case`overThenDown`:return e;default:return}}function s(e){switch(e){case`atEnd`:case`asDisplyed`:return e;default:return}}function c(e){switch(e){case`dash`:case`blank`:case`NA`:return e;default:return}}t.exports=class extends i{get tag(){return`pageSetup`}render(e,t){if(t){let n={paperSize:t.paperSize,orientation:t.orientation,horizontalDpi:t.horizontalDpi,verticalDpi:t.verticalDpi,pageOrder:o(t.pageOrder),blackAndWhite:a(t.blackAndWhite),draft:a(t.draft),cellComments:s(t.cellComments),errors:c(t.errors),scale:t.scale,fitToWidth:t.fitToWidth,fitToHeight:t.fitToHeight,firstPageNumber:t.firstPageNumber,useFirstPageNumber:a(t.firstPageNumber),usePrinterDefaults:a(t.usePrinterDefaults),copies:t.copies};r.some(n,e=>e!==void 0)&&e.leafNode(this.tag,n)}}parseOpen(e){switch(e.name){case this.tag:return this.model={paperSize:(t=e.attributes.paperSize,t===void 0?void 0:parseInt(t,10)),orientation:e.attributes.orientation||`portrait`,horizontalDpi:parseInt(e.attributes.horizontalDpi||`4294967295`,10),verticalDpi:parseInt(e.attributes.verticalDpi||`4294967295`,10),pageOrder:e.attributes.pageOrder||`downThenOver`,blackAndWhite:e.attributes.blackAndWhite===`1`,draft:e.attributes.draft===`1`,cellComments:e.attributes.cellComments||`None`,errors:e.attributes.errors||`displayed`,scale:parseInt(e.attributes.scale||`100`,10),fitToWidth:parseInt(e.attributes.fitToWidth||`1`,10),fitToHeight:parseInt(e.attributes.fitToHeight||`1`,10),firstPageNumber:parseInt(e.attributes.firstPageNumber||`1`,10),useFirstPageNumber:e.attributes.useFirstPageNumber===`1`,usePrinterDefaults:e.attributes.usePrinterDefaults===`1`,copies:parseInt(e.attributes.copies||`1`,10)},!0;default:return!1}var t}parseText(){}parseClose(){return!1}}},{"../../../utils/under-dash":26,"../base-xform":32}],106:[function(e,t,n){let r=e(`../base-xform`);t.exports=class extends r{get tag(){return`picture`}render(e,t){t&&e.leafNode(this.tag,{"r:id":t.rId})}parseOpen(e){switch(e.name){case this.tag:return this.model={rId:e.attributes[`r:id`]},!0;default:return!1}}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],107:[function(e,t,n){let r=e(`../../../utils/under-dash`),i=e(`../base-xform`);function a(e){return e?`1`:void 0}t.exports=class extends i{get tag(){return`printOptions`}render(e,t){if(t){let n={headings:a(t.showRowColHeaders),gridLines:a(t.showGridLines),horizontalCentered:a(t.horizontalCentered),verticalCentered:a(t.verticalCentered)};r.some(n,e=>e!==void 0)&&e.leafNode(this.tag,n)}}parseOpen(e){switch(e.name){case this.tag:return this.model={showRowColHeaders:e.attributes.headings===`1`,showGridLines:e.attributes.gridLines===`1`,horizontalCentered:e.attributes.horizontalCentered===`1`,verticalCentered:e.attributes.verticalCentered===`1`},!0;default:return!1}}parseText(){}parseClose(){return!1}}},{"../../../utils/under-dash":26,"../base-xform":32}],108:[function(e,t,n){let r=e(`./page-breaks-xform`),i=e(`../list-xform`);t.exports=class extends i{constructor(){super({tag:`rowBreaks`,count:!0,childXform:new r})}render(e,t){if(t&&t.length){e.openNode(this.tag,this.$),this.count&&(e.addAttribute(this.$count,t.length),e.addAttribute(`manualBreakCount`,t.length));let{childXform:n}=this;t.forEach(t=>{n.render(e,t)}),e.closeNode()}else this.empty&&e.leafNode(this.tag)}}},{"../list-xform":71,"./page-breaks-xform":102}],109:[function(e,t,n){let r=e(`../base-xform`),i=e(`../../../utils/utils`),a=e(`./cell-xform`);t.exports=class extends r{constructor(e){super(),this.maxItems=e&&e.maxItems,this.map={c:new a}}get tag(){return`row`}prepare(e,t){let n=t.styles.addStyleModel(e.style);n&&(e.styleId=n);let r=this.map.c;e.cells.forEach(e=>{r.prepare(e,t)})}render(e,t,n){e.openNode(`row`),e.addAttribute(`r`,t.number),t.height&&(e.addAttribute(`ht`,t.height),e.addAttribute(`customHeight`,`1`)),t.hidden&&e.addAttribute(`hidden`,`1`),t.min>0&&t.max>0&&t.min<=t.max&&e.addAttribute(`spans`,`${t.min}:${t.max}`),t.styleId&&(e.addAttribute(`s`,t.styleId),e.addAttribute(`customFormat`,`1`)),e.addAttribute(`x14ac:dyDescent`,`0.25`),t.outlineLevel&&e.addAttribute(`outlineLevel`,t.outlineLevel),t.collapsed&&e.addAttribute(`collapsed`,`1`);let r=this.map.c;t.cells.forEach(t=>{r.render(e,t,n)}),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;if(e.name===`row`){this.numRowsSeen+=1;let t=e.attributes.spans?e.attributes.spans.split(`:`).map(e=>parseInt(e,10)):[void 0,void 0],n=this.model={number:parseInt(e.attributes.r,10),min:t[0],max:t[1],cells:[]};return e.attributes.s&&(n.styleId=parseInt(e.attributes.s,10)),i.parseBoolean(e.attributes.hidden)&&(n.hidden=!0),i.parseBoolean(e.attributes.bestFit)&&(n.bestFit=!0),e.attributes.ht&&(n.height=parseFloat(e.attributes.ht)),e.attributes.outlineLevel&&(n.outlineLevel=parseInt(e.attributes.outlineLevel,10)),i.parseBoolean(e.attributes.collapsed)&&(n.collapsed=!0),!0}return this.parser=this.map[e.name],!!this.parser&&(this.parser.parseOpen(e),!0)}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser){if(!this.parser.parseClose(e)){if(this.model.cells.push(this.parser.model),this.maxItems&&this.model.cells.length>this.maxItems)throw Error(`Max column count (${this.maxItems}) exceeded`);this.parser=void 0}return!0}return!1}reconcile(e,t){e.style=e.styleId?t.styles.getStyleModel(e.styleId):{},e.styleId!==void 0&&(e.styleId=void 0);let n=this.map.c;e.cells.forEach(e=>{n.reconcile(e,t)})}}},{"../../../utils/utils":27,"../base-xform":32,"./cell-xform":73}],110:[function(e,t,n){let r=e(`../../../utils/under-dash`),i=e(`../base-xform`);t.exports=class extends i{get tag(){return`sheetFormatPr`}render(e,t){if(t){let n={defaultRowHeight:t.defaultRowHeight,outlineLevelRow:t.outlineLevelRow,outlineLevelCol:t.outlineLevelCol,"x14ac:dyDescent":t.dyDescent};t.defaultColWidth&&(n.defaultColWidth=t.defaultColWidth),t.defaultRowHeight&&t.defaultRowHeight===15||(n.customHeight=`1`),r.some(n,e=>e!==void 0)&&e.leafNode(`sheetFormatPr`,n)}}parseOpen(e){return e.name===`sheetFormatPr`&&(this.model={defaultRowHeight:parseFloat(e.attributes.defaultRowHeight||`0`),dyDescent:parseFloat(e.attributes[`x14ac:dyDescent`]||`0`),outlineLevelRow:parseInt(e.attributes.outlineLevelRow||`0`,10),outlineLevelCol:parseInt(e.attributes.outlineLevelCol||`0`,10)},e.attributes.defaultColWidth&&(this.model.defaultColWidth=parseFloat(e.attributes.defaultColWidth)),!0)}parseText(){}parseClose(){return!1}}},{"../../../utils/under-dash":26,"../base-xform":32}],111:[function(e,t,n){let r=e(`../base-xform`),i=e(`../style/color-xform`),a=e(`./page-setup-properties-xform`),o=e(`./outline-properties-xform`);t.exports=class extends r{constructor(){super(),this.map={tabColor:new i(`tabColor`),pageSetUpPr:new a,outlinePr:new o}}get tag(){return`sheetPr`}render(e,t){if(t){e.addRollback(),e.openNode(`sheetPr`);let n=!1;n=this.map.tabColor.render(e,t.tabColor)||n,n=this.map.pageSetUpPr.render(e,t.pageSetup)||n,n=this.map.outlinePr.render(e,t.outlineProperties)||n,n?(e.closeNode(),e.commit()):e.rollback()}}parseOpen(e){return this.parser?(this.parser.parseOpen(e),!0):e.name===this.tag?(this.reset(),!0):!!this.map[e.name]&&(this.parser=this.map[e.name],this.parser.parseOpen(e),!0)}parseText(e){return!!this.parser&&(this.parser.parseText(e),!0)}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.parser=void 0),!0):(this.map.tabColor.model||this.map.pageSetUpPr.model||this.map.outlinePr.model?(this.model={},this.map.tabColor.model&&(this.model.tabColor=this.map.tabColor.model),this.map.pageSetUpPr.model&&(this.model.pageSetup=this.map.pageSetUpPr.model),this.map.outlinePr.model&&(this.model.outlineProperties=this.map.outlinePr.model)):this.model=null,!1)}}},{"../base-xform":32,"../style/color-xform":128,"./outline-properties-xform":101,"./page-setup-properties-xform":104}],112:[function(e,t,n){let r=e(`../../../utils/under-dash`),i=e(`../base-xform`);function a(e,t){return e?t:void 0}function o(e,t){return e===t||void 0}t.exports=class extends i{get tag(){return`sheetProtection`}render(e,t){if(t){let n={sheet:a(t.sheet,`1`),selectLockedCells:!1===t.selectLockedCells?`1`:void 0,selectUnlockedCells:!1===t.selectUnlockedCells?`1`:void 0,formatCells:a(t.formatCells,`0`),formatColumns:a(t.formatColumns,`0`),formatRows:a(t.formatRows,`0`),insertColumns:a(t.insertColumns,`0`),insertRows:a(t.insertRows,`0`),insertHyperlinks:a(t.insertHyperlinks,`0`),deleteColumns:a(t.deleteColumns,`0`),deleteRows:a(t.deleteRows,`0`),sort:a(t.sort,`0`),autoFilter:a(t.autoFilter,`0`),pivotTables:a(t.pivotTables,`0`)};t.sheet&&(n.algorithmName=t.algorithmName,n.hashValue=t.hashValue,n.saltValue=t.saltValue,n.spinCount=t.spinCount,n.objects=a(!1===t.objects,`1`),n.scenarios=a(!1===t.scenarios,`1`)),r.some(n,e=>e!==void 0)&&e.leafNode(this.tag,n)}}parseOpen(e){switch(e.name){case this.tag:return this.model={sheet:o(e.attributes.sheet,`1`),objects:e.attributes.objects!==`1`&&void 0,scenarios:e.attributes.scenarios!==`1`&&void 0,selectLockedCells:e.attributes.selectLockedCells!==`1`&&void 0,selectUnlockedCells:e.attributes.selectUnlockedCells!==`1`&&void 0,formatCells:o(e.attributes.formatCells,`0`),formatColumns:o(e.attributes.formatColumns,`0`),formatRows:o(e.attributes.formatRows,`0`),insertColumns:o(e.attributes.insertColumns,`0`),insertRows:o(e.attributes.insertRows,`0`),insertHyperlinks:o(e.attributes.insertHyperlinks,`0`),deleteColumns:o(e.attributes.deleteColumns,`0`),deleteRows:o(e.attributes.deleteRows,`0`),sort:o(e.attributes.sort,`0`),autoFilter:o(e.attributes.autoFilter,`0`),pivotTables:o(e.attributes.pivotTables,`0`)},e.attributes.algorithmName&&(this.model.algorithmName=e.attributes.algorithmName,this.model.hashValue=e.attributes.hashValue,this.model.saltValue=e.attributes.saltValue,this.model.spinCount=parseInt(e.attributes.spinCount,10)),!0;default:return!1}}parseText(){}parseClose(){return!1}}},{"../../../utils/under-dash":26,"../base-xform":32}],113:[function(e,t,n){let r=e(`../../../utils/col-cache`),i=e(`../base-xform`),a={frozen:`frozen`,frozenSplit:`frozen`,split:`split`};t.exports=class extends i{get tag(){return`sheetView`}prepare(e){switch(e.state){case`frozen`:case`split`:break;default:e.state=`normal`}}render(e,t){e.openNode(`sheetView`,{workbookViewId:t.workbookViewId||0});let n=function(t,n,r){r&&e.addAttribute(t,n)},i,a,o,s;switch(n(`rightToLeft`,`1`,!0===t.rightToLeft),n(`tabSelected`,`1`,t.tabSelected),n(`showRuler`,`0`,!1===t.showRuler),n(`showRowColHeaders`,`0`,!1===t.showRowColHeaders),n(`showGridLines`,`0`,!1===t.showGridLines),n(`zoomScale`,t.zoomScale,t.zoomScale),n(`zoomScaleNormal`,t.zoomScaleNormal,t.zoomScaleNormal),n(`view`,t.style,t.style),t.state){case`frozen`:a=t.xSplit||0,o=t.ySplit||0,i=t.topLeftCell||r.getAddress(o+1,a+1).address,s=(t.xSplit&&t.ySplit?`bottomRight`:t.xSplit&&`topRight`)||`bottomLeft`,e.leafNode(`pane`,{xSplit:t.xSplit||void 0,ySplit:t.ySplit||void 0,topLeftCell:i,activePane:s,state:`frozen`}),e.leafNode(`selection`,{pane:s,activeCell:t.activeCell,sqref:t.activeCell});break;case`split`:t.activePane===`topLeft`&&(t.activePane=void 0),e.leafNode(`pane`,{xSplit:t.xSplit||void 0,ySplit:t.ySplit||void 0,topLeftCell:t.topLeftCell,activePane:t.activePane}),e.leafNode(`selection`,{pane:t.activePane,activeCell:t.activeCell,sqref:t.activeCell});break;case`normal`:t.activeCell&&e.leafNode(`selection`,{activeCell:t.activeCell,sqref:t.activeCell})}e.closeNode()}parseOpen(e){switch(e.name){case`sheetView`:return this.sheetView={workbookViewId:parseInt(e.attributes.workbookViewId,10),rightToLeft:e.attributes.rightToLeft===`1`,tabSelected:e.attributes.tabSelected===`1`,showRuler:e.attributes.showRuler!==`0`,showRowColHeaders:e.attributes.showRowColHeaders!==`0`,showGridLines:e.attributes.showGridLines!==`0`,zoomScale:parseInt(e.attributes.zoomScale||`100`,10),zoomScaleNormal:parseInt(e.attributes.zoomScaleNormal||`100`,10),style:e.attributes.view},this.pane=void 0,this.selections={},!0;case`pane`:return this.pane={xSplit:parseInt(e.attributes.xSplit||`0`,10),ySplit:parseInt(e.attributes.ySplit||`0`,10),topLeftCell:e.attributes.topLeftCell,activePane:e.attributes.activePane||`topLeft`,state:e.attributes.state},!0;case`selection`:{let t=e.attributes.pane||`topLeft`;return this.selections[t]={pane:t,activeCell:e.attributes.activeCell},!0}default:return!1}}parseText(){}parseClose(e){let t,n;switch(e){case`sheetView`:return this.sheetView&&this.pane?(t=this.model={workbookViewId:this.sheetView.workbookViewId,rightToLeft:this.sheetView.rightToLeft,state:a[this.pane.state]||`split`,xSplit:this.pane.xSplit,ySplit:this.pane.ySplit,topLeftCell:this.pane.topLeftCell,showRuler:this.sheetView.showRuler,showRowColHeaders:this.sheetView.showRowColHeaders,showGridLines:this.sheetView.showGridLines,zoomScale:this.sheetView.zoomScale,zoomScaleNormal:this.sheetView.zoomScaleNormal},this.model.state===`split`&&(t.activePane=this.pane.activePane),n=this.selections[this.pane.activePane],n&&n.activeCell&&(t.activeCell=n.activeCell),this.sheetView.style&&(t.style=this.sheetView.style)):(t=this.model={workbookViewId:this.sheetView.workbookViewId,rightToLeft:this.sheetView.rightToLeft,state:`normal`,showRuler:this.sheetView.showRuler,showRowColHeaders:this.sheetView.showRowColHeaders,showGridLines:this.sheetView.showGridLines,zoomScale:this.sheetView.zoomScale,zoomScaleNormal:this.sheetView.zoomScaleNormal},n=this.selections.topLeft,n&&n.activeCell&&(t.activeCell=n.activeCell),this.sheetView.style&&(t.style=this.sheetView.style)),!1;default:return!0}}reconcile(){}}},{"../../../utils/col-cache":19,"../base-xform":32}],114:[function(e,t,n){let r=e(`../base-xform`);t.exports=class extends r{get tag(){return`tablePart`}render(e,t){t&&e.leafNode(this.tag,{"r:id":t.rId})}parseOpen(e){switch(e.name){case this.tag:return this.model={rId:e.attributes[`r:id`]},!0;default:return!1}}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],115:[function(e,t,n){let r=e(`../../../utils/under-dash`),i=e(`../../../utils/col-cache`),a=e(`../../../utils/xml-stream`),o=e(`../../rel-type`),s=e(`./merges`),c=e(`../base-xform`),l=e(`../list-xform`),u=e(`./row-xform`),d=e(`./col-xform`),f=e(`./dimension-xform`),p=e(`./hyperlink-xform`),m=e(`./merge-cell-xform`),h=e(`./data-validations-xform`),g=e(`./sheet-properties-xform`),_=e(`./sheet-format-properties-xform`),v=e(`./sheet-view-xform`),y=e(`./sheet-protection-xform`),b=e(`./page-margins-xform`),x=e(`./page-setup-xform`),S=e(`./print-options-xform`),C=e(`./auto-filter-xform`),w=e(`./picture-xform`),T=e(`./drawing-xform`),E=e(`./table-part-xform`),D=e(`./row-breaks-xform`),O=e(`./header-footer-xform`),k=e(`./cf/conditional-formattings-xform`),A=e(`./ext-lst-xform`),j=(e,t)=>{if(!t||!t.length)return e;if(!e||!e.length)return t;let n={},r={};return e.forEach(e=>{n[e.ref]=e,e.rules.forEach(e=>{let{x14Id:t}=e;t&&(r[t]=e)})}),t.forEach(t=>{t.rules.forEach(i=>{let a=r[i.x14Id];a?((e,t)=>{Object.keys(t).forEach(n=>{let r=e[n],i=t[n];r===void 0&&i!==void 0&&(e[n]=i)})})(a,i):n[t.ref]?n[t.ref].rules.push(i):e.push({ref:t.ref,rules:[i]})})}),e};class M extends c{constructor(e){super();let{maxRows:t,maxCols:n,ignoreNodes:r}=e||{};this.ignoreNodes=r||[],this.map={sheetPr:new g,dimension:new f,sheetViews:new l({tag:`sheetViews`,count:!1,childXform:new v}),sheetFormatPr:new _,cols:new l({tag:`cols`,count:!1,childXform:new d}),sheetData:new l({tag:`sheetData`,count:!1,empty:!0,childXform:new u({maxItems:n}),maxItems:t}),autoFilter:new C,mergeCells:new l({tag:`mergeCells`,count:!0,childXform:new m}),rowBreaks:new D,hyperlinks:new l({tag:`hyperlinks`,count:!1,childXform:new p}),pageMargins:new b,dataValidations:new h,pageSetup:new x,headerFooter:new O,printOptions:new S,picture:new w,drawing:new T,sheetProtection:new y,tableParts:new l({tag:`tableParts`,count:!0,childXform:new E}),conditionalFormatting:new k,extLst:new A}}prepare(e,t){t.merges=new s,e.hyperlinks=t.hyperlinks=[],e.comments=t.comments=[],t.formulae={},t.siFormulae=0,this.map.cols.prepare(e.cols,t),this.map.sheetData.prepare(e.rows,t),this.map.conditionalFormatting.prepare(e.conditionalFormattings,t),e.mergeCells=t.merges.mergeCells;let n=e.rels=[];function r(e){return`rId`+(e.length+1)}if(e.hyperlinks.forEach(e=>{let t=r(n);e.rId=t,n.push({Id:t,Type:o.Hyperlink,Target:e.target,TargetMode:`External`})}),e.comments.length>0){let a={Id:r(n),Type:o.Comments,Target:`../comments${e.id}.xml`};n.push(a);let s={Id:r(n),Type:o.VmlDrawing,Target:`../drawings/vmlDrawing${e.id}.vml`};n.push(s),e.comments.forEach(e=>{e.refAddress=i.decodeAddress(e.ref)}),t.commentRefs.push({commentName:`comments`+e.id,vmlDrawing:`vmlDrawing`+e.id})}let a=[],c;e.media.forEach(i=>{if(i.type===`background`){let a=r(n);c=t.media[i.imageId],n.push({Id:a,Type:o.Image,Target:`../media/${c.name}.${c.extension}`}),e.background={rId:a},e.image=t.media[i.imageId]}else if(i.type===`image`){let{drawing:s}=e;c=t.media[i.imageId],s||(s=e.drawing={rId:r(n),name:`drawing`+ ++t.drawingsCount,anchors:[],rels:[]},t.drawings.push(s),n.push({Id:s.rId,Type:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing`,Target:`../drawings/${s.name}.xml`}));let l=this.preImageId===i.imageId?a[i.imageId]:a[s.rels.length];l||(l=r(s.rels),a[s.rels.length]=l,s.rels.push({Id:l,Type:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/image`,Target:`../media/${c.name}.${c.extension}`}));let u={picture:{rId:l},range:i.range};if(i.hyperlinks&&i.hyperlinks.hyperlink){let e=r(s.rels);a[s.rels.length]=e,u.picture.hyperlinks={tooltip:i.hyperlinks.tooltip,rId:e},s.rels.push({Id:e,Type:o.Hyperlink,Target:i.hyperlinks.hyperlink,TargetMode:`External`})}this.preImageId=i.imageId,s.anchors.push(u)}}),e.tables.forEach(e=>{let i=r(n);e.rId=i,n.push({Id:i,Type:o.Table,Target:`../tables/`+e.target}),e.columns.forEach(e=>{let{style:n}=e;n&&(e.dxfId=t.styles.addDxfStyle(n))})}),this.map.extLst.prepare(e,t)}render(e,t){e.openXml(a.StdDocAttributes),e.openNode(`worksheet`,M.WORKSHEET_ATTRIBUTES);let n=t.properties?{defaultRowHeight:t.properties.defaultRowHeight,dyDescent:t.properties.dyDescent,outlineLevelCol:t.properties.outlineLevelCol,outlineLevelRow:t.properties.outlineLevelRow}:void 0;t.properties&&t.properties.defaultColWidth&&(n.defaultColWidth=t.properties.defaultColWidth);let r={outlineProperties:t.properties&&t.properties.outlineProperties,tabColor:t.properties&&t.properties.tabColor,pageSetup:t.pageSetup&&t.pageSetup.fitToPage?{fitToPage:t.pageSetup.fitToPage}:void 0},i=t.pageSetup&&t.pageSetup.margins,s={showRowColHeaders:t.pageSetup&&t.pageSetup.showRowColHeaders,showGridLines:t.pageSetup&&t.pageSetup.showGridLines,horizontalCentered:t.pageSetup&&t.pageSetup.horizontalCentered,verticalCentered:t.pageSetup&&t.pageSetup.verticalCentered},c=t.sheetProtection;this.map.sheetPr.render(e,r),this.map.dimension.render(e,t.dimensions),this.map.sheetViews.render(e,t.views),this.map.sheetFormatPr.render(e,n),this.map.cols.render(e,t.cols),this.map.sheetData.render(e,t.rows),this.map.sheetProtection.render(e,c),this.map.autoFilter.render(e,t.autoFilter),this.map.mergeCells.render(e,t.mergeCells),this.map.conditionalFormatting.render(e,t.conditionalFormattings),this.map.dataValidations.render(e,t.dataValidations),this.map.hyperlinks.render(e,t.hyperlinks),this.map.printOptions.render(e,s),this.map.pageMargins.render(e,i),this.map.pageSetup.render(e,t.pageSetup),this.map.headerFooter.render(e,t.headerFooter),this.map.rowBreaks.render(e,t.rowBreaks),this.map.drawing.render(e,t.drawing),this.map.picture.render(e,t.background),this.map.tableParts.render(e,t.tables),this.map.extLst.render(e,t),t.rels&&t.rels.forEach(t=>{t.Type===o.VmlDrawing&&e.leafNode(`legacyDrawing`,{"r:id":t.Id})}),e.closeNode()}parseOpen(e){return this.parser?(this.parser.parseOpen(e),!0):e.name===`worksheet`?(r.each(this.map,e=>{e.reset()}),!0):(this.map[e.name]&&!this.ignoreNodes.includes(e.name)&&(this.parser=this.map[e.name],this.parser.parseOpen(e)),!0)}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case`worksheet`:{let e=this.map.sheetFormatPr.model||{};this.map.sheetPr.model&&this.map.sheetPr.model.tabColor&&(e.tabColor=this.map.sheetPr.model.tabColor),this.map.sheetPr.model&&this.map.sheetPr.model.outlineProperties&&(e.outlineProperties=this.map.sheetPr.model.outlineProperties);let t={fitToPage:this.map.sheetPr.model&&this.map.sheetPr.model.pageSetup&&this.map.sheetPr.model.pageSetup.fitToPage||!1,margins:this.map.pageMargins.model},n=Object.assign(t,this.map.pageSetup.model,this.map.printOptions.model),r=j(this.map.conditionalFormatting.model,this.map.extLst.model&&this.map.extLst.model[`x14:conditionalFormattings`]);return this.model={dimensions:this.map.dimension.model,cols:this.map.cols.model,rows:this.map.sheetData.model,mergeCells:this.map.mergeCells.model,hyperlinks:this.map.hyperlinks.model,dataValidations:this.map.dataValidations.model,properties:e,views:this.map.sheetViews.model,pageSetup:n,headerFooter:this.map.headerFooter.model,background:this.map.picture.model,drawing:this.map.drawing.model,tables:this.map.tableParts.model,conditionalFormattings:r},this.map.autoFilter.model&&(this.model.autoFilter=this.map.autoFilter.model),this.map.sheetProtection.model&&(this.model.sheetProtection=this.map.sheetProtection.model),!1}default:return!0}}reconcile(e,t){let n=(e.relationships||[]).reduce((n,r)=>{if(n[r.Id]=r,r.Type===o.Comments&&(e.comments=t.comments[r.Target].comments),r.Type===o.VmlDrawing&&e.comments&&e.comments.length){let n=t.vmlDrawings[r.Target].comments;e.comments.forEach((e,t)=>{e.note=Object.assign({},e.note,n[t])})}return n},{});if(t.commentsMap=(e.comments||[]).reduce((e,t)=>(t.ref&&(e[t.ref]=t),e),{}),t.hyperlinkMap=(e.hyperlinks||[]).reduce((e,t)=>(t.rId&&(e[t.address]=n[t.rId].Target),e),{}),t.formulae={},e.rows=e.rows&&e.rows.filter(Boolean)||[],e.rows.forEach(e=>{e.cells=e.cells&&e.cells.filter(Boolean)||[]}),this.map.cols.reconcile(e.cols,t),this.map.sheetData.reconcile(e.rows,t),this.map.conditionalFormatting.reconcile(e.conditionalFormattings,t),e.media=[],e.drawing){let r=n[e.drawing.rId].Target.match(/\/drawings\/([a-zA-Z0-9]+)[.][a-zA-Z]{3,4}$/);if(r){let n=r[1];t.drawings[n].anchors.forEach(t=>{if(t.medium){let n={type:`image`,imageId:t.medium.index,range:t.range,hyperlinks:t.picture.hyperlinks};e.media.push(n)}})}}let r=e.background&&n[e.background.rId];if(r){let n=r.Target.split(`/media/`)[1],i=t.mediaIndex&&t.mediaIndex[n];i!==void 0&&e.media.push({type:`background`,imageId:i})}e.tables=(e.tables||[]).map(e=>{let r=n[e.rId];return t.tables[r.Target]}),delete e.relationships,delete e.hyperlinks,delete e.comments}}M.WORKSHEET_ATTRIBUTES={xmlns:`http://schemas.openxmlformats.org/spreadsheetml/2006/main`,"xmlns:r":`http://schemas.openxmlformats.org/officeDocument/2006/relationships`,"xmlns:mc":`http://schemas.openxmlformats.org/markup-compatibility/2006`,"mc:Ignorable":`x14ac`,"xmlns:x14ac":`http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac`},t.exports=M},{"../../../utils/col-cache":19,"../../../utils/under-dash":26,"../../../utils/xml-stream":28,"../../rel-type":31,"../base-xform":32,"../list-xform":71,"./auto-filter-xform":72,"./cf/conditional-formattings-xform":87,"./col-xform":92,"./data-validations-xform":93,"./dimension-xform":94,"./drawing-xform":95,"./ext-lst-xform":96,"./header-footer-xform":97,"./hyperlink-xform":98,"./merge-cell-xform":99,"./merges":100,"./page-margins-xform":103,"./page-setup-xform":105,"./picture-xform":106,"./print-options-xform":107,"./row-breaks-xform":108,"./row-xform":109,"./sheet-format-properties-xform":110,"./sheet-properties-xform":111,"./sheet-protection-xform":112,"./sheet-view-xform":113,"./table-part-xform":114}],116:[function(e,t,n){let r=e(`../base-xform`);t.exports=class extends r{constructor(e){super(),this.tag=e.tag,this.attr=e.attr}render(e,t){t&&(e.openNode(this.tag),e.closeNode())}parseOpen(e){e.name===this.tag&&(this.model=!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],117:[function(e,t,n){let r=e(`../base-xform`);t.exports=class extends r{constructor(e){super(),this.tag=e.tag,this.attr=e.attr,this.attrs=e.attrs,this._format=e.format||function(e){try{return Number.isNaN(e.getTime())?``:e.toISOString()}catch{return``}},this._parse=e.parse||function(e){return new Date(e)}}render(e,t){t&&(e.openNode(this.tag),this.attrs&&e.addAttributes(this.attrs),this.attr?e.addAttribute(this.attr,this._format(t)):e.writeText(this._format(t)),e.closeNode())}parseOpen(e){e.name===this.tag&&(this.attr?this.model=this._parse(e.attributes[this.attr]):this.text=[])}parseText(e){this.attr||this.text.push(e)}parseClose(){return this.attr||(this.model=this._parse(this.text.join(``))),!1}}},{"../base-xform":32}],118:[function(e,t,n){let r=e(`../base-xform`);t.exports=class extends r{constructor(e){super(),this.tag=e.tag,this.attr=e.attr,this.attrs=e.attrs,this.zero=e.zero}render(e,t){(t||this.zero)&&(e.openNode(this.tag),this.attrs&&e.addAttributes(this.attrs),this.attr?e.addAttribute(this.attr,t):e.writeText(t),e.closeNode())}parseOpen(e){return e.name===this.tag&&(this.attr?this.model=parseInt(e.attributes[this.attr],10):this.text=[],!0)}parseText(e){this.attr||this.text.push(e)}parseClose(){return this.attr||(this.model=parseInt(this.text.join(``)||0,10)),!1}}},{"../base-xform":32}],119:[function(e,t,n){let r=e(`../base-xform`);t.exports=class extends r{constructor(e){super(),this.tag=e.tag,this.attr=e.attr,this.attrs=e.attrs}render(e,t){t!==void 0&&(e.openNode(this.tag),this.attrs&&e.addAttributes(this.attrs),this.attr?e.addAttribute(this.attr,t):e.writeText(t),e.closeNode())}parseOpen(e){e.name===this.tag&&(this.attr?this.model=e.attributes[this.attr]:this.text=[])}parseText(e){this.attr||this.text.push(e)}parseClose(){return this.attr||(this.model=this.text.join(``)),!1}}},{"../base-xform":32}],120:[function(e,t,n){let r=e(`./base-xform`),i=e(`../../utils/xml-stream`);t.exports=class extends r{constructor(e){super(),this._model=e}render(e){if(!this._xml){let e=new i;(function e(t,n){t.openNode(n.tag,n.$),n.c&&n.c.forEach(n=>{e(t,n)}),n.t&&t.writeText(n.t),t.closeNode()})(e,this._model),this._xml=e.xml}e.writeXml(this._xml)}parseOpen(){return!0}parseText(){}parseClose(e){switch(e){case this._model.tag:return!1;default:return!0}}}},{"../../utils/xml-stream":28,"./base-xform":32}],121:[function(e,t,n){let r=e(`./text-xform`),i=e(`./rich-text-xform`),a=e(`../base-xform`);t.exports=class extends a{constructor(){super(),this.map={r:new i,t:new r}}get tag(){return`rPh`}render(e,t){if(e.openNode(this.tag,{sb:t.sb||0,eb:t.eb||0}),t&&t.hasOwnProperty(`richText`)&&t.richText){let{r:n}=this.map;t.richText.forEach(t=>{n.render(e,t)})}else t&&this.map.t.render(e,t.text);e.closeNode()}parseOpen(e){let{name:t}=e;return this.parser?(this.parser.parseOpen(e),!0):t===this.tag?(this.model={sb:parseInt(e.attributes.sb,10),eb:parseInt(e.attributes.eb,10)},!0):(this.parser=this.map[t],!!this.parser&&(this.parser.parseOpen(e),!0))}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser){if(!this.parser.parseClose(e)){switch(e){case`r`:{let e=this.model.richText;e||(e=this.model.richText=[]),e.push(this.parser.model);break}case`t`:this.model.text=this.parser.model}this.parser=void 0}return!0}switch(e){case this.tag:return!1;default:return!0}}}},{"../base-xform":32,"./rich-text-xform":122,"./text-xform":125}],122:[function(e,t,n){let r=e(`./text-xform`),i=e(`../style/font-xform`),a=e(`../base-xform`);class o extends a{constructor(e){super(),this.model=e}get tag(){return`r`}get textXform(){return this._textXform||(this._textXform=new r)}get fontXform(){return this._fontXform||(this._fontXform=new i(o.FONT_OPTIONS))}render(e,t){t=t||this.model,e.openNode(`r`),t.font&&this.fontXform.render(e,t.font),this.textXform.render(e,t.text),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`r`:return this.model={},!0;case`t`:return this.parser=this.textXform,this.parser.parseOpen(e),!0;case`rPr`:return this.parser=this.fontXform,this.parser.parseOpen(e),!0;default:return!1}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){switch(e){case`r`:return!1;case`t`:return this.model.text=this.parser.model,this.parser=void 0,!0;case`rPr`:return this.model.font=this.parser.model,this.parser=void 0,!0;default:return this.parser&&this.parser.parseClose(e),!0}}}o.FONT_OPTIONS={tagName:`rPr`,fontNameTag:`rFont`},t.exports=o},{"../base-xform":32,"../style/font-xform":131,"./text-xform":125}],123:[function(e,t,n){let r=e(`./text-xform`),i=e(`./rich-text-xform`),a=e(`./phonetic-text-xform`),o=e(`../base-xform`);t.exports=class extends o{constructor(e){super(),this.model=e,this.map={r:new i,t:new r,rPh:new a}}get tag(){return`si`}render(e,t){e.openNode(this.tag),t&&t.hasOwnProperty(`richText`)&&t.richText?t.richText.length?t.richText.forEach(t=>{this.map.r.render(e,t)}):this.map.t.render(e,``):t!=null&&this.map.t.render(e,t),e.closeNode()}parseOpen(e){let{name:t}=e;return this.parser?(this.parser.parseOpen(e),!0):t===this.tag?(this.model={},!0):(this.parser=this.map[t],!!this.parser&&(this.parser.parseOpen(e),!0))}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser){if(!this.parser.parseClose(e)){switch(e){case`r`:{let e=this.model.richText;e||(e=this.model.richText=[]),e.push(this.parser.model);break}case`t`:this.model=this.parser.model}this.parser=void 0}return!0}switch(e){case this.tag:return!1;default:return!0}}}},{"../base-xform":32,"./phonetic-text-xform":121,"./rich-text-xform":122,"./text-xform":125}],124:[function(e,t,n){let r=e(`../../../utils/xml-stream`),i=e(`../base-xform`),a=e(`./shared-string-xform`);t.exports=class extends i{constructor(e){super(),this.model=e||{values:[],count:0},this.hash=Object.create(null),this.rich=Object.create(null)}get sharedStringXform(){return this._sharedStringXform||(this._sharedStringXform=new a)}get values(){return this.model.values}get uniqueCount(){return this.model.values.length}get count(){return this.model.count}getString(e){return this.model.values[e]}add(e){return e.richText?this.addRichText(e):this.addText(e)}addText(e){let t=this.hash[e];return t===void 0&&(t=this.hash[e]=this.model.values.length,this.model.values.push(e)),this.model.count++,t}addRichText(e){let t=this.sharedStringXform.toXml(e),n=this.rich[t];return n===void 0&&(n=this.rich[t]=this.model.values.length,this.model.values.push(e)),this.model.count++,n}render(e,t){t=t||this._values,e.openXml(r.StdDocAttributes),e.openNode(`sst`,{xmlns:`http://schemas.openxmlformats.org/spreadsheetml/2006/main`,count:t.count,uniqueCount:t.values.length});let n=this.sharedStringXform;t.values.forEach(t=>{n.render(e,t)}),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`sst`:return!0;case`si`:return this.parser=this.sharedStringXform,this.parser.parseOpen(e),!0;default:throw Error(`Unexpected xml node in parseOpen: `+JSON.stringify(e))}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.model.values.push(this.parser.model),this.model.count++,this.parser=void 0),!0;switch(e){case`sst`:return!1;default:throw Error(`Unexpected xml node in parseClose: `+e)}}}},{"../../../utils/xml-stream":28,"../base-xform":32,"./shared-string-xform":123}],125:[function(e,t,n){let r=e(`../base-xform`);t.exports=class extends r{get tag(){return`t`}render(e,t){e.openNode(`t`),/^\s|\n|\s$/.test(t)&&e.addAttribute(`xml:space`,`preserve`),e.writeText(t),e.closeNode()}get model(){return this._text.join(``).replace(/_x([0-9A-F]{4})_/g,(e,t)=>String.fromCharCode(parseInt(t,16)))}parseOpen(e){switch(e.name){case`t`:return this._text=[],!0;default:return!1}}parseText(e){this._text.push(e)}parseClose(){return!1}}},{"../base-xform":32}],126:[function(e,t,n){let r=e(`../../../doc/enums`),i=e(`../../../utils/utils`),a=e(`../base-xform`),o={horizontalValues:[`left`,`center`,`right`,`fill`,`centerContinuous`,`distributed`,`justify`].reduce((e,t)=>(e[t]=!0,e),{}),horizontal(e){return this.horizontalValues[e]?e:void 0},verticalValues:[`top`,`middle`,`bottom`,`distributed`,`justify`].reduce((e,t)=>(e[t]=!0,e),{}),vertical(e){return e===`middle`?`center`:this.verticalValues[e]?e:void 0},wrapText:e=>!!e||void 0,shrinkToFit:e=>!!e||void 0,textRotation(e){switch(e){case`vertical`:return e;default:return(e=i.validInt(e))>=-90&&e<=90?e:void 0}},indent:e=>(e=i.validInt(e),Math.max(0,e)),readingOrder(e){switch(e){case`ltr`:return r.ReadingOrder.LeftToRight;case`rtl`:return r.ReadingOrder.RightToLeft;default:return}}},s={toXml(e){if(e=o.textRotation(e)){if(e===`vertical`)return 255;let t=Math.round(e);if(t>=0&&t<=90)return t;if(t<0&&t>=-90)return 90-t}},toModel(e){let t=i.validInt(e);if(t!==void 0){if(t===255)return`vertical`;if(t>=0&&t<=90)return t;if(t>90&&t<=180)return 90-t}}};t.exports=class extends a{get tag(){return`alignment`}render(e,t){e.addRollback(),e.openNode(`alignment`);let n=!1;function r(t,r){r&&(e.addAttribute(t,r),n=!0)}r(`horizontal`,o.horizontal(t.horizontal)),r(`vertical`,o.vertical(t.vertical)),r(`wrapText`,!!o.wrapText(t.wrapText)&&`1`),r(`shrinkToFit`,!!o.shrinkToFit(t.shrinkToFit)&&`1`),r(`indent`,o.indent(t.indent)),r(`textRotation`,s.toXml(t.textRotation)),r(`readingOrder`,o.readingOrder(t.readingOrder)),e.closeNode(),n?e.commit():e.rollback()}parseOpen(e){let t={},n=!1;function r(e,r,i){e&&(t[r]=i,n=!0)}r(e.attributes.horizontal,`horizontal`,e.attributes.horizontal),r(e.attributes.vertical,`vertical`,e.attributes.vertical===`center`?`middle`:e.attributes.vertical),r(e.attributes.wrapText,`wrapText`,i.parseBoolean(e.attributes.wrapText)),r(e.attributes.shrinkToFit,`shrinkToFit`,i.parseBoolean(e.attributes.shrinkToFit)),r(e.attributes.indent,`indent`,parseInt(e.attributes.indent,10)),r(e.attributes.textRotation,`textRotation`,s.toModel(e.attributes.textRotation)),r(e.attributes.readingOrder,`readingOrder`,e.attributes.readingOrder===`2`?`rtl`:`ltr`),this.model=n?t:null}parseText(){}parseClose(){return!1}}},{"../../../doc/enums":7,"../../../utils/utils":27,"../base-xform":32}],127:[function(e,t,n){let r=e(`../base-xform`),i=e(`../../../utils/utils`),a=e(`./color-xform`);class o extends r{constructor(e){super(),this.name=e,this.map={color:new a}}get tag(){return this.name}render(e,t,n){let r=t&&t.color||n||this.defaultColor;e.openNode(this.name),t&&t.style&&(e.addAttribute(`style`,t.style),r&&this.map.color.render(e,r)),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case this.name:{let{style:t}=e.attributes;return this.model=t?{style:t}:void 0,!0}case`color`:return this.parser=this.map.color,this.parser.parseOpen(e),!0;default:return!1}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.parser=void 0),!0):(e===this.name&&this.map.color.model&&(this.model||(this.model={}),this.model.color=this.map.color.model),!1)}validStyle(e){return o.validStyleValues[e]}}o.validStyleValues=[`thin`,`dashed`,`dotted`,`dashDot`,`hair`,`dashDotDot`,`slantDashDot`,`mediumDashed`,`mediumDashDotDot`,`mediumDashDot`,`medium`,`double`,`thick`].reduce((e,t)=>(e[t]=!0,e),{}),t.exports=class extends r{constructor(){super(),this.map={top:new o(`top`),left:new o(`left`),bottom:new o(`bottom`),right:new o(`right`),diagonal:new o(`diagonal`)}}render(e,t){let{color:n}=t;function r(r,i){r&&!r.color&&t.color&&(r={...r,color:t.color}),i.render(e,r,n)}e.openNode(`border`),t.diagonal&&t.diagonal.style&&(t.diagonal.up&&e.addAttribute(`diagonalUp`,`1`),t.diagonal.down&&e.addAttribute(`diagonalDown`,`1`)),r(t.left,this.map.left),r(t.right,this.map.right),r(t.top,this.map.top),r(t.bottom,this.map.bottom),r(t.diagonal,this.map.diagonal),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`border`:return this.reset(),this.diagonalUp=i.parseBoolean(e.attributes.diagonalUp),this.diagonalDown=i.parseBoolean(e.attributes.diagonalDown),!0;default:return this.parser=this.map[e.name],!!this.parser&&(this.parser.parseOpen(e),!0)}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;if(e===`border`){let e=this.model={},t=function(t,n,r){n&&(r&&Object.assign(n,r),e[t]=n)};t(`left`,this.map.left.model),t(`right`,this.map.right.model),t(`top`,this.map.top.model),t(`bottom`,this.map.bottom.model),t(`diagonal`,this.map.diagonal.model,{up:this.diagonalUp,down:this.diagonalDown})}return!1}}},{"../../../utils/utils":27,"../base-xform":32,"./color-xform":128}],128:[function(e,t,n){let r=e(`../base-xform`);t.exports=class extends r{constructor(e){super(),this.name=e||`color`}get tag(){return this.name}render(e,t){return!!t&&(e.openNode(this.name),t.argb?e.addAttribute(`rgb`,t.argb):t.theme===void 0?t.indexed===void 0?e.addAttribute(`auto`,`1`):e.addAttribute(`indexed`,t.indexed):(e.addAttribute(`theme`,t.theme),t.tint!==void 0&&e.addAttribute(`tint`,t.tint)),e.closeNode(),!0)}parseOpen(e){return e.name===this.name&&(e.attributes.rgb?this.model={argb:e.attributes.rgb}:e.attributes.theme?(this.model={theme:parseInt(e.attributes.theme,10)},e.attributes.tint&&(this.model.tint=parseFloat(e.attributes.tint))):this.model=e.attributes.indexed?{indexed:parseInt(e.attributes.indexed,10)}:void 0,!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],129:[function(e,t,n){let r=e(`../base-xform`),i=e(`./alignment-xform`),a=e(`./border-xform`),o=e(`./fill-xform`),s=e(`./font-xform`),c=e(`./numfmt-xform`),l=e(`./protection-xform`);t.exports=class extends r{constructor(){super(),this.map={alignment:new i,border:new a,fill:new o,font:new s,numFmt:new c,protection:new l}}get tag(){return`dxf`}render(e,t){if(e.openNode(this.tag),t.font&&this.map.font.render(e,t.font),t.numFmt&&t.numFmtId){let n={id:t.numFmtId,formatCode:t.numFmt};this.map.numFmt.render(e,n)}t.fill&&this.map.fill.render(e,t.fill),t.alignment&&this.map.alignment.render(e,t.alignment),t.border&&this.map.border.render(e,t.border),t.protection&&this.map.protection.render(e,t.protection),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case this.tag:return this.reset(),!0;default:return this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e),!0}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.parser=void 0),!0):e!==this.tag||(this.model={alignment:this.map.alignment.model,border:this.map.border.model,fill:this.map.fill.model,font:this.map.font.model,numFmt:this.map.numFmt.model,protection:this.map.protection.model},!1)}}},{"../base-xform":32,"./alignment-xform":126,"./border-xform":127,"./fill-xform":130,"./font-xform":131,"./numfmt-xform":132,"./protection-xform":133}],130:[function(e,t,n){let r=e(`../base-xform`),i=e(`./color-xform`);class a extends r{constructor(){super(),this.map={color:new i}}get tag(){return`stop`}render(e,t){e.openNode(`stop`),e.addAttribute(`position`,t.position),this.map.color.render(e,t.color),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`stop`:return this.model={position:parseFloat(e.attributes.position)},!0;case`color`:return this.parser=this.map.color,this.parser.parseOpen(e),!0;default:return!1}}parseText(){}parseClose(e){return!!this.parser&&(this.parser.parseClose(e)||(this.model.color=this.parser.model,this.parser=void 0),!0)}}class o extends r{constructor(){super(),this.map={fgColor:new i(`fgColor`),bgColor:new i(`bgColor`)}}get name(){return`pattern`}get tag(){return`patternFill`}render(e,t){e.openNode(`patternFill`),e.addAttribute(`patternType`,t.pattern),t.fgColor&&this.map.fgColor.render(e,t.fgColor),t.bgColor&&this.map.bgColor.render(e,t.bgColor),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`patternFill`:return this.model={type:`pattern`,pattern:e.attributes.patternType},!0;default:return this.parser=this.map[e.name],!!this.parser&&(this.parser.parseOpen(e),!0)}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){return!!this.parser&&(this.parser.parseClose(e)||(this.parser.model&&(this.model[e]=this.parser.model),this.parser=void 0),!0)}}class s extends r{constructor(){super(),this.map={stop:new a}}get name(){return`gradient`}get tag(){return`gradientFill`}render(e,t){switch(e.openNode(`gradientFill`),t.gradient){case`angle`:e.addAttribute(`degree`,t.degree);break;case`path`:e.addAttribute(`type`,`path`),t.center.left&&(e.addAttribute(`left`,t.center.left),t.center.right===void 0&&e.addAttribute(`right`,t.center.left)),t.center.right&&e.addAttribute(`right`,t.center.right),t.center.top&&(e.addAttribute(`top`,t.center.top),t.center.bottom===void 0&&e.addAttribute(`bottom`,t.center.top)),t.center.bottom&&e.addAttribute(`bottom`,t.center.bottom)}let n=this.map.stop;t.stops.forEach(t=>{n.render(e,t)}),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`gradientFill`:{let t=this.model={stops:[]};return e.attributes.degree?(t.gradient=`angle`,t.degree=parseInt(e.attributes.degree,10)):e.attributes.type===`path`&&(t.gradient=`path`,t.center={left:e.attributes.left?parseFloat(e.attributes.left):0,top:e.attributes.top?parseFloat(e.attributes.top):0},e.attributes.right!==e.attributes.left&&(t.center.right=e.attributes.right?parseFloat(e.attributes.right):0),e.attributes.bottom!==e.attributes.top&&(t.center.bottom=e.attributes.bottom?parseFloat(e.attributes.bottom):0)),!0}case`stop`:return this.parser=this.map.stop,this.parser.parseOpen(e),!0;default:return!1}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){return!!this.parser&&(this.parser.parseClose(e)||(this.model.stops.push(this.parser.model),this.parser=void 0),!0)}}class c extends r{constructor(){super(),this.map={patternFill:new o,gradientFill:new s}}get tag(){return`fill`}render(e,t){switch(e.addRollback(),e.openNode(`fill`),t.type){case`pattern`:this.map.patternFill.render(e,t);break;case`gradient`:this.map.gradientFill.render(e,t);break;default:e.rollback();return}e.closeNode(),e.commit()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`fill`:return this.model={},!0;default:return this.parser=this.map[e.name],!!this.parser&&(this.parser.parseOpen(e),!0)}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){return!!this.parser&&(this.parser.parseClose(e)||(this.model=this.parser.model,this.model.type=this.parser.name,this.parser=void 0),!0)}validStyle(e){return c.validPatternValues[e]}}c.validPatternValues=[`none`,`solid`,`darkVertical`,`darkGray`,`mediumGray`,`lightGray`,`gray125`,`gray0625`,`darkHorizontal`,`darkVertical`,`darkDown`,`darkUp`,`darkGrid`,`darkTrellis`,`lightHorizontal`,`lightVertical`,`lightDown`,`lightUp`,`lightGrid`,`lightTrellis`,`lightGrid`].reduce((e,t)=>(e[t]=!0,e),{}),c.StopXform=a,c.PatternFillXform=o,c.GradientFillXform=s,t.exports=c},{"../base-xform":32,"./color-xform":128}],131:[function(e,t,n){let r=e(`./color-xform`),i=e(`../simple/boolean-xform`),a=e(`../simple/integer-xform`),o=e(`../simple/string-xform`),s=e(`./underline-xform`),c=e(`../../../utils/under-dash`),l=e(`../base-xform`);class u extends l{constructor(e){super(),this.options=e||u.OPTIONS,this.map={b:{prop:`bold`,xform:new i({tag:`b`,attr:`val`})},i:{prop:`italic`,xform:new i({tag:`i`,attr:`val`})},u:{prop:`underline`,xform:new s},charset:{prop:`charset`,xform:new a({tag:`charset`,attr:`val`})},color:{prop:`color`,xform:new r},condense:{prop:`condense`,xform:new i({tag:`condense`,attr:`val`})},extend:{prop:`extend`,xform:new i({tag:`extend`,attr:`val`})},family:{prop:`family`,xform:new a({tag:`family`,attr:`val`})},outline:{prop:`outline`,xform:new i({tag:`outline`,attr:`val`})},vertAlign:{prop:`vertAlign`,xform:new o({tag:`vertAlign`,attr:`val`})},scheme:{prop:`scheme`,xform:new o({tag:`scheme`,attr:`val`})},shadow:{prop:`shadow`,xform:new i({tag:`shadow`,attr:`val`})},strike:{prop:`strike`,xform:new i({tag:`strike`,attr:`val`})},sz:{prop:`size`,xform:new a({tag:`sz`,attr:`val`})}},this.map[this.options.fontNameTag]={prop:`name`,xform:new o({tag:this.options.fontNameTag,attr:`val`})}}get tag(){return this.options.tagName}render(e,t){let{map:n}=this;e.openNode(this.options.tagName),c.each(this.map,(r,i)=>{n[i].xform.render(e,t[r.prop])}),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;if(this.map[e.name])return this.parser=this.map[e.name].xform,this.parser.parseOpen(e);switch(e.name){case this.options.tagName:return this.model={},!0;default:return!1}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser&&!this.parser.parseClose(e)){let t=this.map[e];return this.parser.model&&(this.model[t.prop]=this.parser.model),this.parser=void 0,!0}switch(e){case this.options.tagName:return!1;default:return!0}}}u.OPTIONS={tagName:`font`,fontNameTag:`name`},t.exports=u},{"../../../utils/under-dash":26,"../base-xform":32,"../simple/boolean-xform":116,"../simple/integer-xform":118,"../simple/string-xform":119,"./color-xform":128,"./underline-xform":136}],132:[function(e,t,n){let r=e(`../../../utils/under-dash`),i=e(`../../defaultnumformats`),a=e(`../base-xform`),o=function(){let e={};return r.each(i,(t,n)=>{t.f&&(e[t.f]=parseInt(n,10))}),e}();class s extends a{constructor(e,t){super(),this.id=e,this.formatCode=t}get tag(){return`numFmt`}render(e,t){e.leafNode(`numFmt`,{numFmtId:t.id,formatCode:t.formatCode})}parseOpen(e){switch(e.name){case`numFmt`:return this.model={id:parseInt(e.attributes.numFmtId,10),formatCode:e.attributes.formatCode.replace(/[\\](.)/g,`$1`)},!0;default:return!1}}parseText(){}parseClose(){return!1}}s.getDefaultFmtId=function(e){return o[e]},s.getDefaultFmtCode=function(e){return i[e]&&i[e].f},t.exports=s},{"../../../utils/under-dash":26,"../../defaultnumformats":30,"../base-xform":32}],133:[function(e,t,n){let r=e(`../base-xform`),i={boolean:(e,t)=>e===void 0?t:e};t.exports=class extends r{get tag(){return`protection`}render(e,t){e.addRollback(),e.openNode(`protection`);let n=!1;function r(t,r){r!==void 0&&(e.addAttribute(t,r),n=!0)}r(`locked`,i.boolean(t.locked,!0)?void 0:`0`),r(`hidden`,i.boolean(t.hidden,!1)?`1`:void 0),e.closeNode(),n?e.commit():e.rollback()}parseOpen(e){let t={locked:e.attributes.locked!==`0`,hidden:e.attributes.hidden===`1`},n=!t.locked||t.hidden;this.model=n?t:null}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],134:[function(e,t,n){let r=e(`../base-xform`),i=e(`./alignment-xform`),a=e(`./protection-xform`);t.exports=class extends r{constructor(e){super(),this.xfId=!(!e||!e.xfId),this.map={alignment:new i,protection:new a}}get tag(){return`xf`}render(e,t){e.openNode(`xf`,{numFmtId:t.numFmtId||0,fontId:t.fontId||0,fillId:t.fillId||0,borderId:t.borderId||0}),this.xfId&&e.addAttribute(`xfId`,t.xfId||0),t.numFmtId&&e.addAttribute(`applyNumberFormat`,`1`),t.fontId&&e.addAttribute(`applyFont`,`1`),t.fillId&&e.addAttribute(`applyFill`,`1`),t.borderId&&e.addAttribute(`applyBorder`,`1`),t.alignment&&e.addAttribute(`applyAlignment`,`1`),t.protection&&e.addAttribute(`applyProtection`,`1`),t.alignment&&this.map.alignment.render(e,t.alignment),t.protection&&this.map.protection.render(e,t.protection),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`xf`:return this.model={numFmtId:parseInt(e.attributes.numFmtId,10),fontId:parseInt(e.attributes.fontId,10),fillId:parseInt(e.attributes.fillId,10),borderId:parseInt(e.attributes.borderId,10)},this.xfId&&(this.model.xfId=parseInt(e.attributes.xfId,10)),!0;case`alignment`:return this.parser=this.map.alignment,this.parser.parseOpen(e),!0;case`protection`:return this.parser=this.map.protection,this.parser.parseOpen(e),!0;default:return!1}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.map.protection===this.parser?this.model.protection=this.parser.model:this.model.alignment=this.parser.model,this.parser=void 0),!0):e!==`xf`}}},{"../base-xform":32,"./alignment-xform":126,"./protection-xform":133}],135:[function(e,t,n){let r=e(`../../../doc/enums`),i=e(`../../../utils/xml-stream`),a=e(`../base-xform`),o=e(`../static-xform`),s=e(`../list-xform`),c=e(`./font-xform`),l=e(`./fill-xform`),u=e(`./border-xform`),d=e(`./numfmt-xform`),f=e(`./style-xform`),p=e(`./dxf-xform`);class m extends a{constructor(e){super(),this.map={numFmts:new s({tag:`numFmts`,count:!0,childXform:new d}),fonts:new s({tag:`fonts`,count:!0,childXform:new c,$:{"x14ac:knownFonts":1}}),fills:new s({tag:`fills`,count:!0,childXform:new l}),borders:new s({tag:`borders`,count:!0,childXform:new u}),cellStyleXfs:new s({tag:`cellStyleXfs`,count:!0,childXform:new f}),cellXfs:new s({tag:`cellXfs`,count:!0,childXform:new f({xfId:!0})}),dxfs:new s({tag:`dxfs`,always:!0,count:!0,childXform:new p}),numFmt:new d,font:new c,fill:new l,border:new u,style:new f({xfId:!0}),cellStyles:m.STATIC_XFORMS.cellStyles,tableStyles:m.STATIC_XFORMS.tableStyles,extLst:m.STATIC_XFORMS.extLst},e&&this.init()}initIndex(){this.index={style:{},numFmt:{},numFmtNextId:164,font:{},border:{},fill:{}}}init(){this.model={styles:[],numFmts:[],fonts:[],borders:[],fills:[],dxfs:[]},this.initIndex(),this._addBorder({}),this._addStyle({numFmtId:0,fontId:0,fillId:0,borderId:0,xfId:0}),this._addFill({type:`pattern`,pattern:`none`}),this._addFill({type:`pattern`,pattern:`gray125`}),this.weakMap=new WeakMap}render(e,t){t=t||this.model,e.openXml(i.StdDocAttributes),e.openNode(`styleSheet`,m.STYLESHEET_ATTRIBUTES),this.index?(t.numFmts&&t.numFmts.length&&(e.openNode(`numFmts`,{count:t.numFmts.length}),t.numFmts.forEach(t=>{e.writeXml(t)}),e.closeNode()),t.fonts.length||this._addFont({size:11,color:{theme:1},name:`Calibri`,family:2,scheme:`minor`}),e.openNode(`fonts`,{count:t.fonts.length,"x14ac:knownFonts":1}),t.fonts.forEach(t=>{e.writeXml(t)}),e.closeNode(),e.openNode(`fills`,{count:t.fills.length}),t.fills.forEach(t=>{e.writeXml(t)}),e.closeNode(),e.openNode(`borders`,{count:t.borders.length}),t.borders.forEach(t=>{e.writeXml(t)}),e.closeNode(),this.map.cellStyleXfs.render(e,[{numFmtId:0,fontId:0,fillId:0,borderId:0,xfId:0}]),e.openNode(`cellXfs`,{count:t.styles.length}),t.styles.forEach(t=>{e.writeXml(t)}),e.closeNode()):(this.map.numFmts.render(e,t.numFmts),this.map.fonts.render(e,t.fonts),this.map.fills.render(e,t.fills),this.map.borders.render(e,t.borders),this.map.cellStyleXfs.render(e,[{numFmtId:0,fontId:0,fillId:0,borderId:0,xfId:0}]),this.map.cellXfs.render(e,t.styles)),m.STATIC_XFORMS.cellStyles.render(e),this.map.dxfs.render(e,t.dxfs),m.STATIC_XFORMS.tableStyles.render(e),m.STATIC_XFORMS.extLst.render(e),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`styleSheet`:return this.initIndex(),!0;default:return this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e),!0}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case`styleSheet`:{this.model={};let e=(e,t)=>{t.model&&t.model.length&&(this.model[e]=t.model)};if(e(`numFmts`,this.map.numFmts),e(`fonts`,this.map.fonts),e(`fills`,this.map.fills),e(`borders`,this.map.borders),e(`styles`,this.map.cellXfs),e(`dxfs`,this.map.dxfs),this.index={model:[],numFmt:[]},this.model.numFmts){let e=this.index.numFmt;this.model.numFmts.forEach(t=>{e[t.id]=t.formatCode})}return!1}default:return!0}}addStyleModel(e,t){if(!e)return 0;if(this.model.fonts.length||this._addFont({size:11,color:{theme:1},name:`Calibri`,family:2,scheme:`minor`}),this.weakMap&&this.weakMap.has(e))return this.weakMap.get(e);let n={};if(t=t||r.ValueType.Number,e.numFmt)n.numFmtId=this._addNumFmtStr(e.numFmt);else switch(t){case r.ValueType.Number:n.numFmtId=this._addNumFmtStr(`General`);break;case r.ValueType.Date:n.numFmtId=this._addNumFmtStr(`mm-dd-yy`)}e.font&&(n.fontId=this._addFont(e.font)),e.border&&(n.borderId=this._addBorder(e.border)),e.fill&&(n.fillId=this._addFill(e.fill)),e.alignment&&(n.alignment=e.alignment),e.protection&&(n.protection=e.protection);let i=this._addStyle(n);return this.weakMap&&this.weakMap.set(e,i),i}getStyleModel(e){let t=this.model.styles[e];if(!t)return null;let n=this.index.model[e];if(n)return n;if(n=this.index.model[e]={},t.numFmtId){let e=this.index.numFmt[t.numFmtId]||d.getDefaultFmtCode(t.numFmtId);e&&(n.numFmt=e)}function r(e,t,r){if(r||r===0){let i=t[r];i&&(n[e]=i)}}return r(`font`,this.model.fonts,t.fontId),r(`border`,this.model.borders,t.borderId),r(`fill`,this.model.fills,t.fillId),t.alignment&&(n.alignment=t.alignment),t.protection&&(n.protection=t.protection),n}addDxfStyle(e){return e.numFmt&&(e.numFmtId=this._addNumFmtStr(e.numFmt)),this.model.dxfs.push(e),this.model.dxfs.length-1}getDxfStyle(e){return this.model.dxfs[e]}_addStyle(e){let t=this.map.style.toXml(e),n=this.index.style[t];return n===void 0&&(n=this.index.style[t]=this.model.styles.length,this.model.styles.push(t)),n}_addNumFmtStr(e){let t=d.getDefaultFmtId(e);if(t!==void 0||(t=this.index.numFmt[e],t!==void 0))return t;t=this.index.numFmt[e]=164+this.model.numFmts.length;let n=this.map.numFmt.toXml({id:t,formatCode:e});return this.model.numFmts.push(n),t}_addFont(e){let t=this.map.font.toXml(e),n=this.index.font[t];return n===void 0&&(n=this.index.font[t]=this.model.fonts.length,this.model.fonts.push(t)),n}_addBorder(e){let t=this.map.border.toXml(e),n=this.index.border[t];return n===void 0&&(n=this.index.border[t]=this.model.borders.length,this.model.borders.push(t)),n}_addFill(e){let t=this.map.fill.toXml(e),n=this.index.fill[t];return n===void 0&&(n=this.index.fill[t]=this.model.fills.length,this.model.fills.push(t)),n}}m.STYLESHEET_ATTRIBUTES={xmlns:`http://schemas.openxmlformats.org/spreadsheetml/2006/main`,"xmlns:mc":`http://schemas.openxmlformats.org/markup-compatibility/2006`,"mc:Ignorable":`x14ac x16r2`,"xmlns:x14ac":`http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac`,"xmlns:x16r2":`http://schemas.microsoft.com/office/spreadsheetml/2015/02/main`},m.STATIC_XFORMS={cellStyles:new o({tag:`cellStyles`,$:{count:1},c:[{tag:`cellStyle`,$:{name:`Normal`,xfId:0,builtinId:0}}]}),dxfs:new o({tag:`dxfs`,$:{count:0}}),tableStyles:new o({tag:`tableStyles`,$:{count:0,defaultTableStyle:`TableStyleMedium2`,defaultPivotStyle:`PivotStyleLight16`}}),extLst:new o({tag:`extLst`,c:[{tag:`ext`,$:{uri:`{EB79DEF2-80B8-43e5-95BD-54CBDDF9020C}`,"xmlns:x14":`http://schemas.microsoft.com/office/spreadsheetml/2009/9/main`},c:[{tag:`x14:slicerStyles`,$:{defaultSlicerStyle:`SlicerStyleLight1`}}]},{tag:`ext`,$:{uri:`{9260A510-F301-46a8-8635-F512D64BE5F5}`,"xmlns:x15":`http://schemas.microsoft.com/office/spreadsheetml/2010/11/main`},c:[{tag:`x15:timelineStyles`,$:{defaultTimelineStyle:`TimeSlicerStyleLight1`}}]}]})},m.Mock=class extends m{constructor(){super(),this.model={styles:[{numFmtId:0,fontId:0,fillId:0,borderId:0,xfId:0}],numFmts:[],fonts:[{size:11,color:{theme:1},name:`Calibri`,family:2,scheme:`minor`}],borders:[{}],fills:[{type:`pattern`,pattern:`none`},{type:`pattern`,pattern:`gray125`}]}}parseStream(e){return e.autodrain(),Promise.resolve()}addStyleModel(e,t){switch(t){case r.ValueType.Date:return this.dateStyleId;default:return 0}}get dateStyleId(){if(!this._dateStyleId){let e={numFmtId:d.getDefaultFmtId(`mm-dd-yy`)};this._dateStyleId=this.model.styles.length,this.model.styles.push(e)}return this._dateStyleId}getStyleModel(){return{}}},t.exports=m},{"../../../doc/enums":7,"../../../utils/xml-stream":28,"../base-xform":32,"../list-xform":71,"../static-xform":120,"./border-xform":127,"./dxf-xform":129,"./fill-xform":130,"./font-xform":131,"./numfmt-xform":132,"./style-xform":134}],136:[function(e,t,n){let r=e(`../base-xform`);class i extends r{constructor(e){super(),this.model=e}get tag(){return`u`}render(e,t){if(!0===(t=t||this.model))e.leafNode(`u`);else{let n=i.Attributes[t];n&&e.leafNode(`u`,n)}}parseOpen(e){e.name===`u`&&(this.model=e.attributes.val||!0)}parseText(){}parseClose(){return!1}}i.Attributes={single:{},double:{val:`double`},singleAccounting:{val:`singleAccounting`},doubleAccounting:{val:`doubleAccounting`}},t.exports=i},{"../base-xform":32}],137:[function(e,t,n){let r=e(`../base-xform`),i=e(`./filter-column-xform`);t.exports=class extends r{constructor(){super(),this.map={filterColumn:new i}}get tag(){return`autoFilter`}prepare(e){e.columns.forEach((e,t)=>{this.map.filterColumn.prepare(e,{index:t})})}render(e,t){return e.openNode(this.tag,{ref:t.autoFilterRef}),t.columns.forEach(t=>{this.map.filterColumn.render(e,t)}),e.closeNode(),!0}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case this.tag:return this.model={autoFilterRef:e.attributes.ref,columns:[]},!0;default:if(this.parser=this.map[e.name],this.parser)return this.parseOpen(e),!0;throw Error(`Unexpected xml node in parseOpen: `+JSON.stringify(e))}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.model.columns.push(this.parser.model),this.parser=void 0),!0;switch(e){case this.tag:return!1;default:throw Error(`Unexpected xml node in parseClose: `+e)}}}},{"../base-xform":32,"./filter-column-xform":139}],138:[function(e,t,n){let r=e(`../base-xform`);t.exports=class extends r{get tag(){return`customFilter`}render(e,t){e.leafNode(this.tag,{val:t.val,operator:t.operator})}parseOpen(e){return e.name===this.tag&&(this.model={val:e.attributes.val,operator:e.attributes.operator},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],139:[function(e,t,n){let r=e(`../base-xform`),i=e(`../list-xform`),a=e(`./custom-filter-xform`),o=e(`./filter-xform`);t.exports=class extends r{constructor(){super(),this.map={customFilters:new i({tag:`customFilters`,count:!1,empty:!0,childXform:new a}),filters:new i({tag:`filters`,count:!1,empty:!0,childXform:new o})}}get tag(){return`filterColumn`}prepare(e,t){e.colId=t.index.toString()}render(e,t){return t.customFilters?(e.openNode(this.tag,{colId:t.colId,hiddenButton:t.filterButton?`0`:`1`}),this.map.customFilters.render(e,t.customFilters),e.closeNode(),!0):(e.leafNode(this.tag,{colId:t.colId,hiddenButton:t.filterButton?`0`:`1`}),!0)}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;let{attributes:t}=e;switch(e.name){case this.tag:return this.model={filterButton:t.hiddenButton===`0`},!0;default:if(this.parser=this.map[e.name],this.parser)return this.parseOpen(e),!0;throw Error(`Unexpected xml node in parseOpen: `+JSON.stringify(e))}}parseText(){}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case this.tag:return this.model.customFilters=this.map.customFilters.model,!1;default:return!0}}}},{"../base-xform":32,"../list-xform":71,"./custom-filter-xform":138,"./filter-xform":140}],140:[function(e,t,n){let r=e(`../base-xform`);t.exports=class extends r{get tag(){return`filter`}render(e,t){e.leafNode(this.tag,{val:t.val})}parseOpen(e){return e.name===this.tag&&(this.model={val:e.attributes.val},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],141:[function(e,t,n){let r=e(`../base-xform`);t.exports=class extends r{get tag(){return`tableColumn`}prepare(e,t){e.id=t.index+1}render(e,t){return e.leafNode(this.tag,{id:t.id.toString(),name:t.name,totalsRowLabel:t.totalsRowLabel,totalsRowFunction:t.totalsRowFunction,dxfId:t.dxfId}),!0}parseOpen(e){if(e.name===this.tag){let{attributes:t}=e;return this.model={name:t.name,totalsRowLabel:t.totalsRowLabel,totalsRowFunction:t.totalsRowFunction,dxfId:t.dxfId},!0}return!1}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],142:[function(e,t,n){let r=e(`../base-xform`);t.exports=class extends r{get tag(){return`tableStyleInfo`}render(e,t){return e.leafNode(this.tag,{name:t.theme?t.theme:void 0,showFirstColumn:t.showFirstColumn?`1`:`0`,showLastColumn:t.showLastColumn?`1`:`0`,showRowStripes:t.showRowStripes?`1`:`0`,showColumnStripes:t.showColumnStripes?`1`:`0`}),!0}parseOpen(e){if(e.name===this.tag){let{attributes:t}=e;return this.model={theme:t.name?t.name:null,showFirstColumn:t.showFirstColumn===`1`,showLastColumn:t.showLastColumn===`1`,showRowStripes:t.showRowStripes===`1`,showColumnStripes:t.showColumnStripes===`1`},!0}return!1}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],143:[function(e,t,n){let r=e(`../../../utils/xml-stream`),i=e(`../base-xform`),a=e(`../list-xform`),o=e(`./auto-filter-xform`),s=e(`./table-column-xform`),c=e(`./table-style-info-xform`);class l extends i{constructor(){super(),this.map={autoFilter:new o,tableColumns:new a({tag:`tableColumns`,count:!0,empty:!0,childXform:new s}),tableStyleInfo:new c}}prepare(e,t){this.map.autoFilter.prepare(e),this.map.tableColumns.prepare(e.columns,t)}get tag(){return`table`}render(e,t){e.openXml(r.StdDocAttributes),e.openNode(this.tag,{...l.TABLE_ATTRIBUTES,id:t.id,name:t.name,displayName:t.displayName||t.name,ref:t.tableRef,totalsRowCount:t.totalsRow?`1`:void 0,totalsRowShown:t.totalsRow?void 0:`1`,headerRowCount:t.headerRow?`1`:`0`}),this.map.autoFilter.render(e,t),this.map.tableColumns.render(e,t.columns),this.map.tableStyleInfo.render(e,t.style),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;let{name:t,attributes:n}=e;switch(t){case this.tag:this.reset(),this.model={name:n.name,displayName:n.displayName||n.name,tableRef:n.ref,totalsRow:n.totalsRowCount===`1`,headerRow:n.headerRowCount===`1`};break;default:this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e)}return!0}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case this.tag:return this.model.columns=this.map.tableColumns.model,this.map.autoFilter.model&&(this.model.autoFilterRef=this.map.autoFilter.model.autoFilterRef,this.map.autoFilter.model.columns.forEach((e,t)=>{this.model.columns[t].filterButton=e.filterButton})),this.model.style=this.map.tableStyleInfo.model,!1;default:return!0}}reconcile(e,t){e.columns.forEach(e=>{e.dxfId!==void 0&&(e.style=t.styles.getDxfStyle(e.dxfId))})}}l.TABLE_ATTRIBUTES={xmlns:`http://schemas.openxmlformats.org/spreadsheetml/2006/main`,"xmlns:mc":`http://schemas.openxmlformats.org/markup-compatibility/2006`,"mc:Ignorable":`xr xr3`,"xmlns:xr":`http://schemas.microsoft.com/office/spreadsheetml/2014/revision`,"xmlns:xr3":`http://schemas.microsoft.com/office/spreadsheetml/2016/revision3`},t.exports=l},{"../../../utils/xml-stream":28,"../base-xform":32,"../list-xform":71,"./auto-filter-xform":137,"./table-column-xform":141,"./table-style-info-xform":142}],144:[function(e,t,n){(function(n,r){(function(){let i=e(`fs`),a=e(`jszip`),{PassThrough:o}=e(`readable-stream`),s=e(`../utils/zip-stream`),c=e(`../utils/stream-buf`),l=e(`../utils/utils`),u=e(`../utils/xml-stream`),{bufferToString:d}=e(`../utils/browser-buffer-decode`),f=e(`./xform/style/styles-xform`),p=e(`./xform/core/core-xform`),m=e(`./xform/strings/shared-strings-xform`),h=e(`./xform/core/relationships-xform`),g=e(`./xform/core/content-types-xform`),_=e(`./xform/core/app-xform`),v=e(`./xform/book/workbook-xform`),y=e(`./xform/sheet/worksheet-xform`),b=e(`./xform/drawing/drawing-xform`),x=e(`./xform/table/table-xform`),S=e(`./xform/comment/comments-xform`),C=e(`./xform/comment/vml-notes-xform`),w=e(`./xml/theme1`);class T{constructor(e){this.workbook=e}async readFile(e,t){if(!await l.fs.exists(e))throw Error(`File not found: `+e);let n=i.createReadStream(e);try{let e=await this.read(n,t);return n.close(),e}catch(e){throw n.close(),e}}parseRels(e){return new h().parseStream(e)}parseWorkbook(e){return new v().parseStream(e)}parseSharedStrings(e){return new m().parseStream(e)}reconcile(e,t){let n=new v,r=new y(t),i=new b,a=new x;n.reconcile(e);let o={media:e.media,mediaIndex:e.mediaIndex};Object.keys(e.drawings).forEach(t=>{let n=e.drawings[t],r=e.drawingRels[t];r&&(o.rels=r.reduce((e,t)=>(e[t.Id]=t,e),{}),(n.anchors||[]).forEach(e=>{let t=e.picture&&e.picture.hyperlinks;t&&o.rels[t.rId]&&(t.hyperlink=o.rels[t.rId].Target,delete t.rId)}),i.reconcile(n,o))});let s={styles:e.styles};Object.values(e.tables).forEach(e=>{a.reconcile(e,s)});let c={styles:e.styles,sharedStrings:e.sharedStrings,media:e.media,mediaIndex:e.mediaIndex,date1904:e.properties&&e.properties.date1904,drawings:e.drawings,comments:e.comments,tables:e.tables,vmlDrawings:e.vmlDrawings};e.worksheets.forEach(t=>{t.relationships=e.worksheetRels[t.sheetNo],r.reconcile(t,c)}),delete e.worksheetHash,delete e.worksheetRels,delete e.globalRels,delete e.sharedStrings,delete e.workbookRels,delete e.sheetDefs,delete e.styles,delete e.mediaIndex,delete e.drawings,delete e.drawingRels,delete e.vmlDrawings}async _processWorksheetEntry(e,t,n,r,i){let a=await new y(r).parseStream(e);a.sheetNo=n,t.worksheetHash[i]=a,t.worksheets.push(a)}async _processCommentEntry(e,t,n){let r=await new S().parseStream(e);t.comments[`../${n}.xml`]=r}async _processTableEntry(e,t,n){let r=await new x().parseStream(e);t.tables[`../tables/${n}.xml`]=r}async _processWorksheetRelsEntry(e,t,n){let r=await new h().parseStream(e);t.worksheetRels[n]=r}async _processMediaEntry(e,t,n){let r=n.lastIndexOf(`.`);if(r>=1){let i=n.substr(r+1),a=n.substr(0,r);await new Promise((r,o)=>{let s=new c;s.on(`finish`,()=>{t.mediaIndex[n]=t.media.length,t.mediaIndex[a]=t.media.length;let e={type:`image`,name:a,extension:i,buffer:s.toBuffer()};t.media.push(e),r()}),e.on(`error`,e=>{o(e)}),e.pipe(s)})}}async _processDrawingEntry(e,t,n){let r=await new b().parseStream(e);t.drawings[n]=r}async _processDrawingRelsEntry(e,t,n){let r=await new h().parseStream(e);t.drawingRels[n]=r}async _processVmlDrawingEntry(e,t,n){let r=await new C().parseStream(e);t.vmlDrawings[`../drawings/${n}.vml`]=r}async _processThemeEntry(e,t,n){await new Promise((r,i)=>{let a=new c;e.on(`error`,i),a.on(`error`,i),a.on(`finish`,()=>{t.themes[n]=a.read().toString(),r()}),e.pipe(a)})}createInputStream(){throw Error("`XLSX#createInputStream` is deprecated. You should use `XLSX#read` instead. This method will be removed in version 5.0. Please follow upgrade instruction: https://github.com/exceljs/exceljs/blob/master/UPGRADE-4.0.md")}async read(e,t){!e[Symbol.asyncIterator]&&e.pipe&&(e=e.pipe(new o));let n=[];for await(let t of e)n.push(t);return this.load(r.concat(n),t)}async load(e,t){let i;i=t&&t.base64?r.from(e.toString(),`base64`):e;let s={worksheets:[],worksheetHash:{},worksheetRels:[],themes:{},media:[],mediaIndex:{},drawings:{},drawingRels:{},comments:{},tables:{},vmlDrawings:{}},c=await a.loadAsync(i);for(let e of Object.values(c.files))if(!e.dir){let r,i=e.name;if(i[0]===`/`&&(i=i.substr(1)),i.match(/xl\/media\//)||i.match(/xl\/theme\/([a-zA-Z0-9]+)[.]xml/))r=new o,r.write(await e.async(`nodebuffer`));else{let t;r=new o({writableObjectMode:!0,readableObjectMode:!0}),t=n.browser?d(await e.async(`nodebuffer`)):await e.async(`string`);let i=16384;for(let e=0;e{if(t.type===`image`){let n=`xl/media/${t.name}.${t.extension}`;if(t.filename){let r=await function(e,t){return new Promise((n,r)=>{i.readFile(e,t,(e,t)=>{e?r(e):n(t)})})}(t.filename);return e.append(r,{name:n})}if(t.buffer)return e.append(t.buffer,{name:n});if(t.base64){let r=t.base64,i=r.substring(r.indexOf(`,`)+1);return e.append(i,{name:n,base64:!0})}}throw Error(`Unsupported media`)}))}addDrawings(e,t){let n=new b,r=new h;t.worksheets.forEach(t=>{let{drawing:i}=t;if(i){n.prepare(i,{});let t=n.toXml(i);e.append(t,{name:`xl/drawings/${i.name}.xml`}),t=r.toXml(i.rels),e.append(t,{name:`xl/drawings/_rels/${i.name}.xml.rels`})}})}addTables(e,t){let n=new x;t.worksheets.forEach(t=>{let{tables:r}=t;r.forEach(t=>{n.prepare(t,{});let r=n.toXml(t);e.append(r,{name:`xl/tables/`+t.target})})})}async addContentTypes(e,t){let n=new g().toXml(t);e.append(n,{name:`[Content_Types].xml`})}async addApp(e,t){let n=new _().toXml(t);e.append(n,{name:`docProps/app.xml`})}async addCore(e,t){let n=new p;e.append(n.toXml(t),{name:`docProps/core.xml`})}async addThemes(e,t){let n=t.themes||{theme1:w};Object.keys(n).forEach(t=>{let r=n[t],i=`xl/theme/${t}.xml`;e.append(r,{name:i})})}async addOfficeRels(e){let t=new h().toXml([{Id:`rId1`,Type:T.RelType.OfficeDocument,Target:`xl/workbook.xml`},{Id:`rId2`,Type:T.RelType.CoreProperties,Target:`docProps/core.xml`},{Id:`rId3`,Type:T.RelType.ExtenderProperties,Target:`docProps/app.xml`}]);e.append(t,{name:`_rels/.rels`})}async addWorkbookRels(e,t){let n=1,r=[{Id:`rId`+n++,Type:T.RelType.Styles,Target:`styles.xml`},{Id:`rId`+n++,Type:T.RelType.Theme,Target:`theme/theme1.xml`}];t.sharedStrings.count&&r.push({Id:`rId`+n++,Type:T.RelType.SharedStrings,Target:`sharedStrings.xml`}),t.worksheets.forEach(e=>{e.rId=`rId`+n++,r.push({Id:e.rId,Type:T.RelType.Worksheet,Target:`worksheets/sheet${e.id}.xml`})});let i=new h().toXml(r);e.append(i,{name:`xl/_rels/workbook.xml.rels`})}async addSharedStrings(e,t){t.sharedStrings&&t.sharedStrings.count&&e.append(t.sharedStrings.xml,{name:`xl/sharedStrings.xml`})}async addStyles(e,t){let{xml:n}=t.styles;n&&e.append(n,{name:`xl/styles.xml`})}async addWorkbook(e,t){let n=new v;e.append(n.toXml(t),{name:`xl/workbook.xml`})}async addWorksheets(e,t){let n=new y,r=new h,i=new S,a=new C;t.worksheets.forEach(t=>{let o=new u;n.render(o,t),e.append(o.xml,{name:`xl/worksheets/sheet${t.id}.xml`}),t.rels&&t.rels.length&&(o=new u,r.render(o,t.rels),e.append(o.xml,{name:`xl/worksheets/_rels/sheet${t.id}.xml.rels`})),t.comments.length>0&&(o=new u,i.render(o,t),e.append(o.xml,{name:`xl/comments${t.id}.xml`}),o=new u,a.render(o,t),e.append(o.xml,{name:`xl/drawings/vmlDrawing${t.id}.vml`}))})}_finalize(e){return new Promise((t,n)=>{e.on(`finish`,()=>{t(this)}),e.on(`error`,n),e.finalize()})}prepareModel(e,t){e.creator=e.creator||`ExcelJS`,e.lastModifiedBy=e.lastModifiedBy||`ExcelJS`,e.created=e.created||new Date,e.modified=e.modified||new Date,e.useSharedStrings=t.useSharedStrings===void 0||t.useSharedStrings,e.useStyles=t.useStyles===void 0||t.useStyles,e.sharedStrings=new m,e.styles=e.useStyles?new f(!0):new f.Mock;let n=new v,r=new y;n.prepare(e);let i={sharedStrings:e.sharedStrings,styles:e.styles,date1904:e.properties.date1904,drawingsCount:0,media:e.media};i.drawings=e.drawings=[],i.commentRefs=e.commentRefs=[];let a=0;e.tables=[],e.worksheets.forEach(t=>{t.tables.forEach(t=>{a++,t.target=`table${a}.xml`,t.id=a,e.tables.push(t)}),r.prepare(t,i)})}async write(e,t){t=t||{};let{model:n}=this.workbook,r=new s.ZipWriter(t.zip);return r.pipe(e),this.prepareModel(n,t),await this.addContentTypes(r,n),await this.addOfficeRels(r,n),await this.addWorkbookRels(r,n),await this.addWorksheets(r,n),await this.addSharedStrings(r,n),await this.addDrawings(r,n),await this.addTables(r,n),await Promise.all([this.addThemes(r,n),this.addStyles(r,n)]),await this.addMedia(r,n),await Promise.all([this.addApp(r,n),this.addCore(r,n)]),await this.addWorkbook(r,n),this._finalize(r)}writeFile(e,t){let n=i.createWriteStream(e);return new Promise((e,r)=>{n.on(`finish`,()=>{e()}),n.on(`error`,e=>{r(e)}),this.write(n,t).then(()=>{n.end()}).catch(e=>{r(e)})})}async writeBuffer(e){let t=new c;return await this.write(t,e),t.read()}}T.RelType=e(`./rel-type`),t.exports=T}).call(this)}).call(this,e(`_process`),e(`buffer`).Buffer)},{"../utils/browser-buffer-decode":16,"../utils/stream-buf":24,"../utils/utils":27,"../utils/xml-stream":28,"../utils/zip-stream":29,"./rel-type":31,"./xform/book/workbook-xform":38,"./xform/comment/comments-xform":40,"./xform/comment/vml-notes-xform":45,"./xform/core/app-xform":51,"./xform/core/content-types-xform":52,"./xform/core/core-xform":53,"./xform/core/relationships-xform":55,"./xform/drawing/drawing-xform":62,"./xform/sheet/worksheet-xform":115,"./xform/strings/shared-strings-xform":124,"./xform/style/styles-xform":135,"./xform/table/table-xform":143,"./xml/theme1":145,_process:467,buffer:220,fs:216,jszip:441,"readable-stream":491}],145:[function(e,t,n){t.exports=` `},{}],146:[function(e,t,n){(function(t){(function(){Object.defineProperty(n,"__esModule",{value:!0}),n.CsvFormatterStream=void 0;let r=e(`stream`),i=e(`./formatter`);class a extends r.Transform{constructor(e){super({writableObjectMode:e.objectMode}),this.hasWrittenBOM=!1,this.formatterOptions=e,this.rowFormatter=new i.RowFormatter(e),this.hasWrittenBOM=!e.writeBOM}transform(e){return this.rowFormatter.rowTransform=e,this}_transform(e,n,r){let i=!1;try{this.hasWrittenBOM||(this.push(this.formatterOptions.BOM),this.hasWrittenBOM=!0),this.rowFormatter.format(e,(e,n)=>e?(i=!0,r(e)):(n&&n.forEach(e=>{this.push(t.from(e,`utf8`))}),i=!0,r()))}catch(e){if(i)throw e;r(e)}}_flush(e){this.rowFormatter.finish((n,r)=>n?e(n):(r&&r.forEach(e=>{this.push(t.from(e,`utf8`))}),e()))}}n.CsvFormatterStream=a}).call(this)}).call(this,e(`buffer`).Buffer)},{"./formatter":150,buffer:220,stream:505}],147:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.FormatterOptions=void 0,n.FormatterOptions=class{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};var t;this.objectMode=!0,this.delimiter=`,`,this.rowDelimiter=` `,this.quote=`"`,this.escape=this.quote,this.quoteColumns=!1,this.quoteHeaders=this.quoteColumns,this.headers=null,this.includeEndRowDelimiter=!1,this.writeBOM=!1,this.BOM=``,this.alwaysWriteHeaders=!1,Object.assign(this,e||{}),e?.quoteHeaders===void 0&&(this.quoteHeaders=this.quoteColumns),!0===e?.quote?this.quote=`"`:!1===e?.quote&&(this.quote=``),typeof e?.escape!=`string`&&(this.escape=this.quote),this.shouldWriteHeaders=!!this.headers&&((t=e.writeHeaders)==null||t),this.headers=Array.isArray(this.headers)?this.headers:null,this.escapedQuote=`${this.escape}${this.quote}`}}},{}],148:[function(e,t,n){var r=function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(n,"__esModule",{value:!0}),n.FieldFormatter=void 0;let i=r(e(`lodash.isboolean`)),a=r(e(`lodash.isnil`)),o=r(e(`lodash.escaperegexp`));n.FieldFormatter=class{constructor(e){this._headers=null,this.formatterOptions=e,e.headers!==null&&(this.headers=e.headers),this.REPLACE_REGEXP=new RegExp(e.quote,`g`);let t=`[${e.delimiter}${o.default(e.rowDelimiter)}|\r|\n]`;this.ESCAPE_REGEXP=new RegExp(t)}set headers(e){this._headers=e}shouldQuote(e,t){let n=t?this.formatterOptions.quoteHeaders:this.formatterOptions.quoteColumns;return i.default(n)?n:Array.isArray(n)?n[e]:this._headers!==null&&n[this._headers[e]]}format(e,t,n){let r=(``+(a.default(e)?``:e)).replace(/\0/g,``),{formatterOptions:i}=this;return i.quote!==``&&r.indexOf(i.quote)!==-1?this.quoteField(r.replace(this.REPLACE_REGEXP,i.escapedQuote)):r.search(this.ESCAPE_REGEXP)!==-1||this.shouldQuote(t,n)?this.quoteField(r):r}quoteField(e){let{quote:t}=this.formatterOptions;return`${t}${e}${t}`}}},{"lodash.escaperegexp":442,"lodash.isboolean":444,"lodash.isnil":447}],149:[function(e,t,n){var r=function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(n,"__esModule",{value:!0}),n.RowFormatter=void 0;let i=r(e(`lodash.isfunction`)),a=r(e(`lodash.isequal`)),o=e(`./FieldFormatter`),s=e(`../types`);class c{constructor(e){this.rowCount=0,this.formatterOptions=e,this.fieldFormatter=new o.FieldFormatter(e),this.headers=e.headers,this.shouldWriteHeaders=e.shouldWriteHeaders,this.hasWrittenHeaders=!1,this.headers!==null&&(this.fieldFormatter.headers=this.headers),e.transform&&(this.rowTransform=e.transform)}static isRowHashArray(e){return!!Array.isArray(e)&&Array.isArray(e[0])&&e[0].length===2}static isRowArray(e){return Array.isArray(e)&&!this.isRowHashArray(e)}static gatherHeaders(e){return c.isRowHashArray(e)?e.map(e=>e[0]):Array.isArray(e)?e:Object.keys(e)}static createTransform(e){return s.isSyncTransform(e)?(t,n)=>{let r=null;try{r=e(t)}catch(e){return n(e)}return n(null,r)}:(t,n)=>{e(t,n)}}set rowTransform(e){if(!i.default(e))throw TypeError(`The transform should be a function`);this._rowTransform=c.createTransform(e)}format(e,t){this.callTransformer(e,(n,r)=>{if(n)return t(n);if(!e)return t(null);let i=[];if(r){let{shouldFormatColumns:e,headers:t}=this.checkHeaders(r);if(this.shouldWriteHeaders&&t&&!this.hasWrittenHeaders&&(i.push(this.formatColumns(t,!0)),this.hasWrittenHeaders=!0),e){let e=this.gatherColumns(r);i.push(this.formatColumns(e,!1))}}return t(null,i)})}finish(e){let t=[];if(this.formatterOptions.alwaysWriteHeaders&&this.rowCount===0){if(!this.headers)return e(Error("`alwaysWriteHeaders` option is set to true but `headers` option not provided."));t.push(this.formatColumns(this.headers,!0))}return this.formatterOptions.includeEndRowDelimiter&&t.push(this.formatterOptions.rowDelimiter),e(null,t)}checkHeaders(e){if(this.headers)return{shouldFormatColumns:!0,headers:this.headers};let t=c.gatherHeaders(e);return this.headers=t,this.fieldFormatter.headers=t,this.shouldWriteHeaders?{shouldFormatColumns:!a.default(t,e),headers:t}:{shouldFormatColumns:!0,headers:null}}gatherColumns(e){if(this.headers===null)throw Error(`Headers is currently null`);return Array.isArray(e)?c.isRowHashArray(e)?this.headers.map((t,n)=>{let r=e[n];return r?r[1]:``}):c.isRowArray(e)&&!this.shouldWriteHeaders?e:this.headers.map((t,n)=>e[n]):this.headers.map(t=>e[t])}callTransformer(e,t){return this._rowTransform?this._rowTransform(e,t):t(null,e)}formatColumns(e,t){let n=e.map((e,n)=>this.fieldFormatter.format(e,n,t)).join(this.formatterOptions.delimiter),{rowCount:r}=this;return this.rowCount+=1,r?[this.formatterOptions.rowDelimiter,n].join(``):n}}n.RowFormatter=c},{"../types":152,"./FieldFormatter":148,"lodash.isequal":445,"lodash.isfunction":446}],150:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.FieldFormatter=n.RowFormatter=void 0;var r=e(`./RowFormatter`);Object.defineProperty(n,"RowFormatter",{enumerable:!0,get:function(){return r.RowFormatter}});var i=e(`./FieldFormatter`);Object.defineProperty(n,"FieldFormatter",{enumerable:!0,get:function(){return i.FieldFormatter}})},{"./FieldFormatter":148,"./RowFormatter":149}],151:[function(e,t,n){(function(t){(function(){var r=Object.create?function(e,t,n,r){r===void 0&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]},i=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t},a=function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},o=function(e,t){for(var n in e)n==="default"||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(n,"__esModule",{value:!0}),n.writeToPath=n.writeToString=n.writeToBuffer=n.writeToStream=n.write=n.format=n.FormatterOptions=n.CsvFormatterStream=void 0;let s=e(`util`),c=e(`stream`),l=a(e(`fs`)),u=e(`./FormatterOptions`),d=e(`./CsvFormatterStream`);o(e(`./types`),n);var f=e(`./CsvFormatterStream`);Object.defineProperty(n,"CsvFormatterStream",{enumerable:!0,get:function(){return f.CsvFormatterStream}});var p=e(`./FormatterOptions`);Object.defineProperty(n,"FormatterOptions",{enumerable:!0,get:function(){return p.FormatterOptions}}),n.format=e=>new d.CsvFormatterStream(new u.FormatterOptions(e)),n.write=(e,t)=>{let r=n.format(t),i=s.promisify((e,t)=>{r.write(e,void 0,t)});return e.reduce((e,t)=>e.then(()=>i(t)),Promise.resolve()).then(()=>r.end()).catch(e=>{r.emit(`error`,e)}),r},n.writeToStream=(e,t,r)=>n.write(t,r).pipe(e),n.writeToBuffer=function(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=[],a=new c.Writable({write(e,t,n){i.push(e),n()}});return new Promise((o,s)=>{a.on(`error`,s).on(`finish`,()=>o(t.concat(i))),n.write(e,r).pipe(a)})},n.writeToString=(e,t)=>n.writeToBuffer(e,t).then(e=>e.toString()),n.writeToPath=(e,t,r)=>{let i=l.createWriteStream(e,{encoding:`utf8`});return n.write(t,r).pipe(i)}}).call(this)}).call(this,e(`buffer`).Buffer)},{"./CsvFormatterStream":146,"./FormatterOptions":147,"./types":152,buffer:220,fs:216,stream:505,util:527}],152:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.isSyncTransform=void 0,n.isSyncTransform=e=>e.length===1},{}],153:[function(e,t,n){(function(t){(function(){Object.defineProperty(n,"__esModule",{value:!0}),n.CsvParserStream=void 0;let r=e(`string_decoder`),i=e(`stream`),a=e(`./transforms`),o=e(`./parser`);class s extends i.Transform{constructor(e){super({objectMode:e.objectMode}),this.lines=``,this.rowCount=0,this.parsedRowCount=0,this.parsedLineCount=0,this.endEmitted=!1,this.headersEmitted=!1,this.parserOptions=e,this.parser=new o.Parser(e),this.headerTransformer=new a.HeaderTransformer(e),this.decoder=new r.StringDecoder(e.encoding),this.rowTransformerValidator=new a.RowTransformerValidator}get hasHitRowLimit(){return this.parserOptions.limitRows&&this.rowCount>=this.parserOptions.maxRows}get shouldEmitRows(){return this.parsedRowCount>this.parserOptions.skipRows}get shouldSkipLine(){return this.parsedLineCount<=this.parserOptions.skipLines}transform(e){return this.rowTransformerValidator.rowTransform=e,this}validate(e){return this.rowTransformerValidator.rowValidator=e,this}emit(e){if(e===`end`)return this.endEmitted||(this.endEmitted=!0,super.emit(`end`,this.rowCount)),!1;var t=[...arguments].slice(1);return super.emit(e,...t)}_transform(e,t,n){if(this.hasHitRowLimit)return n();let r=s.wrapDoneCallback(n);try{let{lines:t}=this,n=t+this.decoder.write(e),i=this.parse(n,!0);return this.processRows(i,r)}catch(e){return r(e)}}_flush(e){let t=s.wrapDoneCallback(e);if(this.hasHitRowLimit)return t();try{let e=this.lines+this.decoder.end(),n=this.parse(e,!1);return this.processRows(n,t)}catch(e){return t(e)}}parse(e,t){if(!e)return[];let{line:n,rows:r}=this.parser.parse(e,t);return this.lines=n,r}processRows(e,n){let r=e.length,i=a=>{let o=e=>e?n(e):a%100==0?void t(()=>i(a+1)):i(a+1);if(this.checkAndEmitHeaders(),a>=r||this.hasHitRowLimit)return n();if(this.parsedLineCount+=1,this.shouldSkipLine)return o();let s=e[a];this.rowCount+=1,this.parsedRowCount+=1;let c=this.rowCount;return this.transformRow(s,(e,t)=>{if(e)return--this.rowCount,o(e);if(!t)return o(Error(`expected transform result`));if(t.isValid){if(t.row)return this.pushRow(t.row,o)}else this.emit(`data-invalid`,t.row,c,t.reason);return o()})};i(0)}transformRow(e,t){try{this.headerTransformer.transform(e,(n,r)=>n?t(n):r?r.isValid?r.row?this.shouldEmitRows?this.rowTransformerValidator.transformAndValidate(r.row,t):this.skipRow(t):(--this.rowCount,--this.parsedRowCount,t(null,{row:null,isValid:!0})):this.shouldEmitRows?t(null,{isValid:!1,row:e}):this.skipRow(t):t(Error(`Expected result from header transform`)))}catch(e){t(e)}}checkAndEmitHeaders(){!this.headersEmitted&&this.headerTransformer.headers&&(this.headersEmitted=!0,this.emit(`headers`,this.headerTransformer.headers))}skipRow(e){return--this.rowCount,e(null,{row:null,isValid:!0})}pushRow(e,t){try{this.parserOptions.objectMode?this.push(e):this.push(JSON.stringify(e)),t()}catch(e){t(e)}}static wrapDoneCallback(e){let t=!1;return function(n){if(n){if(t)throw n;t=!0,e(n);return}e(...[...arguments].slice(1))}}}n.CsvParserStream=s}).call(this)}).call(this,e(`timers`).setImmediate)},{"./parser":165,"./transforms":168,stream:505,string_decoder:218,timers:523}],154:[function(e,t,n){var r=function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(n,"__esModule",{value:!0}),n.ParserOptions=void 0;let i=r(e(`lodash.escaperegexp`)),a=r(e(`lodash.isnil`));n.ParserOptions=class{constructor(e){if(this.objectMode=!0,this.delimiter=`,`,this.ignoreEmpty=!1,this.quote=`"`,this.escape=null,this.escapeChar=this.quote,this.comment=null,this.supportsComments=!1,this.ltrim=!1,this.rtrim=!1,this.trim=!1,this.headers=null,this.renameHeaders=!1,this.strictColumnHandling=!1,this.discardUnmappedColumns=!1,this.carriageReturn=`\r`,this.encoding=`utf8`,this.limitRows=!1,this.maxRows=0,this.skipLines=0,this.skipRows=0,Object.assign(this,e||{}),this.delimiter.length>1)throw Error(`delimiter option must be one character long`);this.escapedDelimiter=i.default(this.delimiter),this.escapeChar=this.escape??this.quote,this.supportsComments=!a.default(this.comment),this.NEXT_TOKEN_REGEXP=RegExp(`([^\\s]|\\r\\n|\\n|\\r|${this.escapedDelimiter})`),this.maxRows>0&&(this.limitRows=!0)}}},{"lodash.escaperegexp":442,"lodash.isnil":447}],155:[function(e,t,n){var r=Object.create?function(e,t,n,r){r===void 0&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]},i=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t},a=function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},o=function(e,t){for(var n in e)n==="default"||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(n,"__esModule",{value:!0}),n.parseString=n.parseFile=n.parseStream=n.parse=n.ParserOptions=n.CsvParserStream=void 0;let s=a(e(`fs`)),c=e(`stream`),l=e(`./ParserOptions`),u=e(`./CsvParserStream`);o(e(`./types`),n);var d=e(`./CsvParserStream`);Object.defineProperty(n,"CsvParserStream",{enumerable:!0,get:function(){return d.CsvParserStream}});var f=e(`./ParserOptions`);Object.defineProperty(n,"ParserOptions",{enumerable:!0,get:function(){return f.ParserOptions}}),n.parse=e=>new u.CsvParserStream(new l.ParserOptions(e)),n.parseStream=(e,t)=>e.pipe(new u.CsvParserStream(new l.ParserOptions(t))),n.parseFile=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return s.createReadStream(e).pipe(new u.CsvParserStream(new l.ParserOptions(t)))},n.parseString=(e,t)=>{let n=new c.Readable;return n.push(e),n.push(null),n.pipe(new u.CsvParserStream(new l.ParserOptions(t)))}},{"./CsvParserStream":153,"./ParserOptions":154,"./types":169,fs:216,stream:505}],156:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.Parser=void 0;let r=e(`./Scanner`),i=e(`./RowParser`),a=e(`./Token`);class o{constructor(e){this.parserOptions=e,this.rowParser=new i.RowParser(this.parserOptions)}static removeBOM(e){return e&&e.charCodeAt(0)===65279?e.slice(1):e}parse(e,t){let n=new r.Scanner({line:o.removeBOM(e),parserOptions:this.parserOptions,hasMoreData:t});return this.parserOptions.supportsComments?this.parseWithComments(n):this.parseWithoutComments(n)}parseWithoutComments(e){let t=[],n=!0;for(;n;)n=this.parseRow(e,t);return{line:e.line,rows:t}}parseWithComments(e){let{parserOptions:t}=this,n=[];for(let r=e.nextCharacterToken;r!==null;r=e.nextCharacterToken)if(a.Token.isTokenComment(r,t)){if(e.advancePastLine()===null||!e.hasMoreCharacters)return{line:e.lineFromCursor,rows:n};e.truncateToCursor()}else if(!this.parseRow(e,n))break;return{line:e.line,rows:n}}parseRow(e,t){if(!e.nextNonSpaceToken)return!1;let n=this.rowParser.parse(e);return n!==null&&(this.parserOptions.ignoreEmpty&&i.RowParser.isEmptyRow(n)||t.push(n),!0)}}n.Parser=o},{"./RowParser":157,"./Scanner":158,"./Token":159}],157:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.RowParser=void 0;let r=e(`./column`),i=e(`./Token`);n.RowParser=class{constructor(e){this.parserOptions=e,this.columnParser=new r.ColumnParser(e)}static isEmptyRow(e){return e.join(``).replace(/\s+/g,``)===``}parse(e){let{parserOptions:t}=this,{hasMoreData:n}=e,r=e,a=[],o=this.getStartToken(r,a);for(;o;){if(i.Token.isTokenRowDelimiter(o))return r.advancePastToken(o),!r.hasMoreCharacters&&i.Token.isTokenCarriageReturn(o,t)&&n?null:(r.truncateToCursor(),a);if(!this.shouldSkipColumnParse(r,o,a)){let e=this.columnParser.parse(r);if(e===null)return null;a.push(e)}o=r.nextNonSpaceToken}return n?null:(r.truncateToCursor(),a)}getStartToken(e,t){let n=e.nextNonSpaceToken;return n!==null&&i.Token.isTokenDelimiter(n,this.parserOptions)?(t.push(``),e.nextNonSpaceToken):n}shouldSkipColumnParse(e,t,n){let{parserOptions:r}=this;if(i.Token.isTokenDelimiter(t,r)){e.advancePastToken(t);let a=e.nextCharacterToken;if(!e.hasMoreCharacters||a!==null&&i.Token.isTokenRowDelimiter(a)||a!==null&&i.Token.isTokenDelimiter(a,r))return n.push(``),!0}return!1}}},{"./Token":159,"./column":164}],158:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.Scanner=void 0;let r=e(`./Token`),i=/((?:\r\n)|\n|\r)/;n.Scanner=class{constructor(e){this.cursor=0,this.line=e.line,this.lineLength=this.line.length,this.parserOptions=e.parserOptions,this.hasMoreData=e.hasMoreData,this.cursor=e.cursor||0}get hasMoreCharacters(){return this.lineLength>this.cursor}get nextNonSpaceToken(){let{lineFromCursor:e}=this,t=this.parserOptions.NEXT_TOKEN_REGEXP;if(e.search(t)===-1)return null;let n=t.exec(e);if(n==null)return null;let i=n[1],a=this.cursor+(n.index||0);return new r.Token({token:i,startCursor:a,endCursor:a+i.length-1})}get nextCharacterToken(){let{cursor:e,lineLength:t}=this;return t<=e?null:new r.Token({token:this.line[e],startCursor:e,endCursor:e})}get lineFromCursor(){return this.line.substr(this.cursor)}advancePastLine(){let e=i.exec(this.lineFromCursor);return e?(this.cursor+=(e.index||0)+e[0].length,this):this.hasMoreData?null:(this.cursor=this.lineLength,this)}advanceTo(e){return this.cursor=e,this}advanceToToken(e){return this.cursor=e.startCursor,this}advancePastToken(e){return this.cursor=e.endCursor+1,this}truncateToCursor(){return this.line=this.lineFromCursor,this.lineLength=this.line.length,this.cursor=0,this}}},{"./Token":159}],159:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.Token=void 0,n.Token=class{constructor(e){this.token=e.token,this.startCursor=e.startCursor,this.endCursor=e.endCursor}static isTokenRowDelimiter(e){let t=e.token;return t===`\r`||t===` `||t===`\r `}static isTokenCarriageReturn(e,t){return e.token===t.carriageReturn}static isTokenComment(e,t){return t.supportsComments&&!!e&&e.token===t.comment}static isTokenEscapeCharacter(e,t){return e.token===t.escapeChar}static isTokenQuote(e,t){return e.token===t.quote}static isTokenDelimiter(e,t){return e.token===t.delimiter}}},{}],160:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.ColumnFormatter=void 0,n.ColumnFormatter=class{constructor(e){this.format=e.trim?e=>e.trim():e.ltrim?e=>e.trimLeft():e.rtrim?e=>e.trimRight():e=>e}}},{}],161:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.ColumnParser=void 0;let r=e(`./NonQuotedColumnParser`),i=e(`./QuotedColumnParser`),a=e(`../Token`);n.ColumnParser=class{constructor(e){this.parserOptions=e,this.quotedColumnParser=new i.QuotedColumnParser(e),this.nonQuotedColumnParser=new r.NonQuotedColumnParser(e)}parse(e){let{nextNonSpaceToken:t}=e;return t!==null&&a.Token.isTokenQuote(t,this.parserOptions)?(e.advanceToToken(t),this.quotedColumnParser.parse(e)):this.nonQuotedColumnParser.parse(e)}}},{"../Token":159,"./NonQuotedColumnParser":162,"./QuotedColumnParser":163}],162:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.NonQuotedColumnParser=void 0;let r=e(`./ColumnFormatter`),i=e(`../Token`);n.NonQuotedColumnParser=class{constructor(e){this.parserOptions=e,this.columnFormatter=new r.ColumnFormatter(e)}parse(e){if(!e.hasMoreCharacters)return null;let{parserOptions:t}=this,n=[],r=e.nextCharacterToken;for(;r&&!i.Token.isTokenDelimiter(r,t)&&!i.Token.isTokenRowDelimiter(r);r=e.nextCharacterToken)n.push(r.token),e.advancePastToken(r);return this.columnFormatter.format(n.join(``))}}},{"../Token":159,"./ColumnFormatter":160}],163:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.QuotedColumnParser=void 0;let r=e(`./ColumnFormatter`),i=e(`../Token`);n.QuotedColumnParser=class{constructor(e){this.parserOptions=e,this.columnFormatter=new r.ColumnFormatter(e)}parse(e){if(!e.hasMoreCharacters)return null;let t=e.cursor,{foundClosingQuote:n,col:r}=this.gatherDataBetweenQuotes(e);if(!n){if(e.advanceTo(t),!e.hasMoreData)throw Error(`Parse Error: missing closing: '${this.parserOptions.quote||``}' in line: at '${e.lineFromCursor.replace(/[\r\n]/g,`\\n'`)}'`);return null}return this.checkForMalformedColumn(e),r}gatherDataBetweenQuotes(e){let{parserOptions:t}=this,n=!1,r=!1,a=[],o=e.nextCharacterToken;for(;!r&&o!==null;o=e.nextCharacterToken){let s=i.Token.isTokenQuote(o,t);if(!n&&s)n=!0;else if(n){if(i.Token.isTokenEscapeCharacter(o,t)){e.advancePastToken(o);let n=e.nextCharacterToken;n!==null&&(i.Token.isTokenQuote(n,t)||i.Token.isTokenEscapeCharacter(n,t))?(a.push(n.token),o=n):s?r=!0:a.push(o.token)}else s?r=!0:a.push(o.token)}e.advancePastToken(o)}return{col:this.columnFormatter.format(a.join(``)),foundClosingQuote:r}}checkForMalformedColumn(e){let{parserOptions:t}=this,{nextNonSpaceToken:n}=e;if(n){let r=i.Token.isTokenDelimiter(n,t),a=i.Token.isTokenRowDelimiter(n);if(!r&&!a){let r=e.lineFromCursor.substr(0,10).replace(/[\r\n]/g,`\\n'`);throw Error(`Parse Error: expected: '${t.escapedDelimiter}' OR new line got: '${n.token}'. at '${r}`)}e.advanceToToken(n)}else e.hasMoreData||e.advancePastLine()}}},{"../Token":159,"./ColumnFormatter":160}],164:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.ColumnFormatter=n.QuotedColumnParser=n.NonQuotedColumnParser=n.ColumnParser=void 0;var r=e(`./ColumnParser`);Object.defineProperty(n,"ColumnParser",{enumerable:!0,get:function(){return r.ColumnParser}});var i=e(`./NonQuotedColumnParser`);Object.defineProperty(n,"NonQuotedColumnParser",{enumerable:!0,get:function(){return i.NonQuotedColumnParser}});var a=e(`./QuotedColumnParser`);Object.defineProperty(n,"QuotedColumnParser",{enumerable:!0,get:function(){return a.QuotedColumnParser}});var o=e(`./ColumnFormatter`);Object.defineProperty(n,"ColumnFormatter",{enumerable:!0,get:function(){return o.ColumnFormatter}})},{"./ColumnFormatter":160,"./ColumnParser":161,"./NonQuotedColumnParser":162,"./QuotedColumnParser":163}],165:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.QuotedColumnParser=n.NonQuotedColumnParser=n.ColumnParser=n.Token=n.Scanner=n.RowParser=n.Parser=void 0;var r=e(`./Parser`);Object.defineProperty(n,"Parser",{enumerable:!0,get:function(){return r.Parser}});var i=e(`./RowParser`);Object.defineProperty(n,"RowParser",{enumerable:!0,get:function(){return i.RowParser}});var a=e(`./Scanner`);Object.defineProperty(n,"Scanner",{enumerable:!0,get:function(){return a.Scanner}});var o=e(`./Token`);Object.defineProperty(n,"Token",{enumerable:!0,get:function(){return o.Token}});var s=e(`./column`);Object.defineProperty(n,"ColumnParser",{enumerable:!0,get:function(){return s.ColumnParser}}),Object.defineProperty(n,"NonQuotedColumnParser",{enumerable:!0,get:function(){return s.NonQuotedColumnParser}}),Object.defineProperty(n,"QuotedColumnParser",{enumerable:!0,get:function(){return s.QuotedColumnParser}})},{"./Parser":156,"./RowParser":157,"./Scanner":158,"./Token":159,"./column":164}],166:[function(e,t,n){var r=function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(n,"__esModule",{value:!0}),n.HeaderTransformer=void 0;let i=r(e(`lodash.isundefined`)),a=r(e(`lodash.isfunction`)),o=r(e(`lodash.uniq`)),s=r(e(`lodash.groupby`));n.HeaderTransformer=class{constructor(e){this.headers=null,this.receivedHeaders=!1,this.shouldUseFirstRow=!1,this.processedFirstRow=!1,this.headersLength=0,this.parserOptions=e,!0===e.headers?this.shouldUseFirstRow=!0:Array.isArray(e.headers)?this.setHeaders(e.headers):a.default(e.headers)&&(this.headersTransform=e.headers)}transform(e,t){return this.shouldMapRow(e)?t(null,this.processRow(e)):t(null,{row:null,isValid:!0})}shouldMapRow(e){let{parserOptions:t}=this;if(!this.headersTransform&&t.renameHeaders&&!this.processedFirstRow){if(!this.receivedHeaders)throw Error(`Error renaming headers: new headers must be provided in an array`);return this.processedFirstRow=!0,!1}if(!this.receivedHeaders&&Array.isArray(e)){if(this.headersTransform)this.setHeaders(this.headersTransform(e));else{if(!this.shouldUseFirstRow)return!0;this.setHeaders(e)}return!1}return!0}processRow(e){if(!this.headers)return{row:e,isValid:!0};let{parserOptions:t}=this;if(!t.discardUnmappedColumns&&e.length>this.headersLength){if(!t.strictColumnHandling)throw Error(`Unexpected Error: column header mismatch expected: ${this.headersLength} columns got: ${e.length}`);return{row:e,isValid:!1,reason:`Column header mismatch expected: ${this.headersLength} columns got: ${e.length}`}}return t.strictColumnHandling&&e.length!!e);if(o.default(t).length!==t.length){let e=s.default(t),n=Object.keys(e).filter(t=>e[t].length>1);throw Error(`Duplicate headers found `+JSON.stringify(n))}this.headers=e,this.receivedHeaders=!0,this.headersLength=this.headers?.length||0}}},{"lodash.groupby":443,"lodash.isfunction":446,"lodash.isundefined":448,"lodash.uniq":449}],167:[function(e,t,n){var r=function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(n,"__esModule",{value:!0}),n.RowTransformerValidator=void 0;let i=r(e(`lodash.isfunction`)),a=e(`../types`);class o{constructor(){this._rowTransform=null,this._rowValidator=null}static createTransform(e){return a.isSyncTransform(e)?(t,n)=>{let r=null;try{r=e(t)}catch(e){return n(e)}return n(null,r)}:e}static createValidator(e){return a.isSyncValidate(e)?(t,n)=>{n(null,{row:t,isValid:e(t)})}:(t,n)=>{e(t,(e,r,i)=>e?n(e):n(null,r?{row:t,isValid:r,reason:i}:{row:t,isValid:!1,reason:i}))}}set rowTransform(e){if(!i.default(e))throw TypeError(`The transform should be a function`);this._rowTransform=o.createTransform(e)}set rowValidator(e){if(!i.default(e))throw TypeError(`The validate should be a function`);this._rowValidator=o.createValidator(e)}transformAndValidate(e,t){return this.callTransformer(e,(e,n)=>e?t(e):n?this.callValidator(n,(e,r)=>e?t(e):r&&!r.isValid?t(null,{row:n,isValid:!1,reason:r.reason}):t(null,{row:n,isValid:!0})):t(null,{row:null,isValid:!0}))}callTransformer(e,t){return this._rowTransform?this._rowTransform(e,t):t(null,e)}callValidator(e,t){return this._rowValidator?this._rowValidator(e,t):t(null,{row:e,isValid:!0})}}n.RowTransformerValidator=o},{"../types":169,"lodash.isfunction":446}],168:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.HeaderTransformer=n.RowTransformerValidator=void 0;var r=e(`./RowTransformerValidator`);Object.defineProperty(n,"RowTransformerValidator",{enumerable:!0,get:function(){return r.RowTransformerValidator}});var i=e(`./HeaderTransformer`);Object.defineProperty(n,"HeaderTransformer",{enumerable:!0,get:function(){return i.HeaderTransformer}})},{"./HeaderTransformer":166,"./RowTransformerValidator":167}],169:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.isSyncValidate=n.isSyncTransform=void 0,n.isSyncTransform=e=>e.length===1,n.isSyncValidate=e=>e.length===1},{}],170:[function(e,t,n){let r=n;r.bignum=e(`bn.js`),r.define=e(`./asn1/api`).define,r.base=e(`./asn1/base`),r.constants=e(`./asn1/constants`),r.decoders=e(`./asn1/decoders`),r.encoders=e(`./asn1/encoders`)},{"./asn1/api":171,"./asn1/base":173,"./asn1/constants":177,"./asn1/decoders":179,"./asn1/encoders":182,"bn.js":184}],171:[function(e,t,n){let r=e(`./encoders`),i=e(`./decoders`),a=e(`inherits`);function o(e,t){this.name=e,this.body=t,this.decoders={},this.encoders={}}n.define=function(e,t){return new o(e,t)},o.prototype._createNamed=function(e){let t=this.name;function n(e){this._initNamed(e,t)}return a(n,e),n.prototype._initNamed=function(t,n){e.call(this,t,n)},new n(this)},o.prototype._getDecoder=function(e){return e=e||`der`,this.decoders.hasOwnProperty(e)||(this.decoders[e]=this._createNamed(i[e])),this.decoders[e]},o.prototype.decode=function(e,t,n){return this._getDecoder(t).decode(e,n)},o.prototype._getEncoder=function(e){return e=e||`der`,this.encoders.hasOwnProperty(e)||(this.encoders[e]=this._createNamed(r[e])),this.encoders[e]},o.prototype.encode=function(e,t,n){return this._getEncoder(t).encode(e,n)}},{"./decoders":179,"./encoders":182,inherits:440}],172:[function(e,t,n){let r=e(`inherits`),i=e(`../base/reporter`).Reporter,a=e(`safer-buffer`).Buffer;function o(e,t){i.call(this,t),a.isBuffer(e)?(this.base=e,this.offset=0,this.length=e.length):this.error(`Input not Buffer`)}function s(e,t){if(Array.isArray(e))this.length=0,this.value=e.map((function(e){return s.isEncoderBuffer(e)||(e=new s(e,t)),this.length+=e.length,e}),this);else if(typeof e==`number`){if(!(0<=e&&e<=255))return t.error(`non-byte EncoderBuffer value`);this.value=e,this.length=1}else if(typeof e==`string`)this.value=e,this.length=a.byteLength(e);else{if(!a.isBuffer(e))return t.error(`Unsupported type: `+typeof e);this.value=e,this.length=e.length}}r(o,i),n.DecoderBuffer=o,o.isDecoderBuffer=function(e){return e instanceof o||typeof e==`object`&&a.isBuffer(e.base)&&e.constructor.name===`DecoderBuffer`&&typeof e.offset==`number`&&typeof e.length==`number`&&typeof e.save==`function`&&typeof e.restore==`function`&&typeof e.isEmpty==`function`&&typeof e.readUInt8==`function`&&typeof e.skip==`function`&&typeof e.raw==`function`},o.prototype.save=function(){return{offset:this.offset,reporter:i.prototype.save.call(this)}},o.prototype.restore=function(e){let t=new o(this.base);return t.offset=e.offset,t.length=this.offset,this.offset=e.offset,i.prototype.restore.call(this,e.reporter),t},o.prototype.isEmpty=function(){return this.offset===this.length},o.prototype.readUInt8=function(e){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(e||`DecoderBuffer overrun`)},o.prototype.skip=function(e,t){if(!(this.offset+e<=this.length))return this.error(t||`DecoderBuffer overrun`);let n=new o(this.base);return n._reporterState=this._reporterState,n.offset=this.offset,n.length=this.offset+e,this.offset+=e,n},o.prototype.raw=function(e){return this.base.slice(e?e.offset:this.offset,this.length)},n.EncoderBuffer=s,s.isEncoderBuffer=function(e){return e instanceof s||typeof e==`object`&&e.constructor.name===`EncoderBuffer`&&typeof e.length==`number`&&typeof e.join==`function`},s.prototype.join=function(e,t){return e||(e=a.alloc(this.length)),t||(t=0),this.length===0||(Array.isArray(this.value)?this.value.forEach((function(n){n.join(e,t),t+=n.length})):(typeof this.value==`number`?e[t]=this.value:typeof this.value==`string`?e.write(this.value,t):a.isBuffer(this.value)&&this.value.copy(e,t),t+=this.length)),e}},{"../base/reporter":175,inherits:440,"safer-buffer":495}],173:[function(e,t,n){let r=n;r.Reporter=e(`./reporter`).Reporter,r.DecoderBuffer=e(`./buffer`).DecoderBuffer,r.EncoderBuffer=e(`./buffer`).EncoderBuffer,r.Node=e(`./node`)},{"./buffer":172,"./node":174,"./reporter":175}],174:[function(e,t,n){let r=e(`../base/reporter`).Reporter,i=e(`../base/buffer`).EncoderBuffer,a=e(`../base/buffer`).DecoderBuffer,o=e(`minimalistic-assert`),s=`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`.split(`.`),c=[`key`,`obj`,`use`,`optional`,`explicit`,`implicit`,`def`,`choice`,`any`,`contains`].concat(s);function l(e,t,n){let 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())}t.exports=l;let u=[`enc`,`parent`,`children`,`tag`,`args`,`reverseArgs`,`choice`,`optional`,`any`,`obj`,`use`,`alteredUse`,`key`,`default`,`explicit`,`implicit`,`contains`];l.prototype.clone=function(){let e=this._baseState,t={};u.forEach((function(n){t[n]=e[n]}));let n=new this.constructor(t.parent);return n._baseState=t,n},l.prototype._wrap=function(){let e=this._baseState;c.forEach((function(t){this[t]=function(){let n=new this.constructor(this);return e.children.push(n),n[t].apply(n,arguments)}}),this)},l.prototype._init=function(e){let t=this._baseState;o(t.parent===null),e.call(this),t.children=t.children.filter((function(e){return e._baseState.parent===this}),this),o.equal(t.children.length,1,`Root node can have only one child`)},l.prototype._useArgs=function(e){let 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),n.length!==0&&(o(t.children===null),t.children=n,n.forEach((function(e){e._baseState.parent=this}),this)),e.length!==0&&(o(t.args===null),t.args=e,t.reverseArgs=e.map((function(e){if(typeof e!=`object`||e.constructor!==Object)return e;let t={};return Object.keys(e).forEach((function(n){n==(0|n)&&(n|=0);let 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){l.prototype[e]=function(){let t=this._baseState;throw Error(e+` not implemented for encoding: `+t.enc)}})),s.forEach((function(e){l.prototype[e]=function(){let t=this._baseState,n=Array.prototype.slice.call(arguments);return o(t.tag===null),t.tag=e,this._useArgs(n),this}})),l.prototype.use=function(e){o(e);let t=this._baseState;return o(t.use===null),t.use=e,this},l.prototype.optional=function(){return this._baseState.optional=!0,this},l.prototype.def=function(e){let t=this._baseState;return o(t.default===null),t.default=e,t.optional=!0,this},l.prototype.explicit=function(e){let t=this._baseState;return o(t.explicit===null&&t.implicit===null),t.explicit=e,this},l.prototype.implicit=function(e){let t=this._baseState;return o(t.explicit===null&&t.implicit===null),t.implicit=e,this},l.prototype.obj=function(){let e=this._baseState,t=Array.prototype.slice.call(arguments);return e.obj=!0,t.length!==0&&this._useArgs(t),this},l.prototype.key=function(e){let t=this._baseState;return o(t.key===null),t.key=e,this},l.prototype.any=function(){return this._baseState.any=!0,this},l.prototype.choice=function(e){let t=this._baseState;return o(t.choice===null),t.choice=e,this._useArgs(Object.keys(e).map((function(t){return e[t]}))),this},l.prototype.contains=function(e){let t=this._baseState;return o(t.use===null),t.contains=e,this},l.prototype._decode=function(e,t){let n=this._baseState;if(n.parent===null)return e.wrapResult(n.children[0]._decode(e,t));let r,i=n.default,o=!0,s=null;if(n.key!==null&&(s=e.enterKey(n.key)),n.optional){let r=null;if(n.explicit===null?n.implicit===null?n.tag!==null&&(r=n.tag):r=n.implicit:r=n.explicit,r!==null||n.any){if(o=this._peekTag(e,r,n.any),e.isError(o))return o}else{let r=e.save();try{n.choice===null?this._decodeGeneric(n.tag,e,t):this._decodeChoice(e,t),o=!0}catch{o=!1}e.restore(r)}}if(n.obj&&o&&(r=e.enterObject()),o){if(n.explicit!==null){let t=this._decodeTag(e,n.explicit);if(e.isError(t))return t;e=t}let r=e.offset;if(n.use===null&&n.choice===null){let t;n.any&&(t=e.save());let r=this._decodeTag(e,n.implicit===null?n.tag:n.implicit,n.any);if(e.isError(r))return r;n.any?i=e.raw(t):e=r}if(t&&t.track&&n.tag!==null&&t.track(e.path(),r,e.length,`tagged`),t&&t.track&&n.tag!==null&&t.track(e.path(),e.offset,e.length,`content`),n.any||(i=n.choice===null?this._decodeGeneric(n.tag,e,t):this._decodeChoice(e,t)),e.isError(i))return i;if(n.any||n.choice!==null||n.children===null||n.children.forEach((function(n){n._decode(e,t)})),n.contains&&(n.tag===`octstr`||n.tag===`bitstr`)){let r=new a(i);i=this._getUse(n.contains,e._reporterState.obj)._decode(r,t)}}return n.obj&&o&&(i=e.leaveObject(r)),n.key===null||i===null&&!0!==o?s!==null&&e.exitKey(s):e.leaveKey(s,n.key,i),i},l.prototype._decodeGeneric=function(e,t,n){let r=this._baseState;return e===`seq`||e===`set`?null:e===`seqof`||e===`setof`?this._decodeList(t,e,r.args[0],n):/str$/.test(e)?this._decodeStr(t,e,n):e===`objid`&&r.args?this._decodeObjid(t,r.args[0],r.args[1],n):e===`objid`?this._decodeObjid(t,null,null,n):e===`gentime`||e===`utctime`?this._decodeTime(t,e,n):e===`null_`?this._decodeNull(t,n):e===`bool`?this._decodeBool(t,n):e===`objDesc`?this._decodeStr(t,e,n):e===`int`||e===`enum`?this._decodeInt(t,r.args&&r.args[0],n):r.use===null?t.error(`unknown tag: `+e):this._getUse(r.use,t._reporterState.obj)._decode(t,n)},l.prototype._getUse=function(e,t){let n=this._baseState;return n.useDecoder=this._use(e,t),o(n.useDecoder._baseState.parent===null),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},l.prototype._decodeChoice=function(e,t){let n=this._baseState,r=null,i=!1;return Object.keys(n.choice).some((function(a){let o=e.save(),s=n.choice[a];try{let n=s._decode(e,t);if(e.isError(n))return!1;r={type:a,value:n},i=!0}catch{return e.restore(o),!1}return!0}),this),i?r:e.error(`Choice not matched`)},l.prototype._createEncoderBuffer=function(e){return new i(e,this.reporter)},l.prototype._encode=function(e,t,n){let r=this._baseState;if(r.default!==null&&r.default===e)return;let i=this._encodeValue(e,t,n);return i===void 0||this._skipDefault(i,t,n)?void 0:i},l.prototype._encodeValue=function(e,t,n){let i=this._baseState;if(i.parent===null)return i.children[0]._encode(e,t||new r);let a=null;if(this.reporter=t,i.optional&&e===void 0){if(i.default===null)return;e=i.default}let o=null,s=!1;if(i.any)a=this._createEncoderBuffer(e);else if(i.choice)a=this._encodeChoice(e,t);else if(i.contains)o=this._getUse(i.contains,n)._encode(e,t),s=!0;else if(i.children)o=i.children.map((function(n){if(n._baseState.tag===`null_`)return n._encode(null,t,e);if(n._baseState.key===null)return t.error(`Child should have a key`);let r=t.enterKey(n._baseState.key);if(typeof e!=`object`)return t.error(`Child expected, but input is not object`);let i=n._encode(e[n._baseState.key],t,e);return t.leaveKey(r),i}),this).filter((function(e){return e})),o=this._createEncoderBuffer(o);else if(i.tag===`seqof`||i.tag===`setof`){if(!i.args||i.args.length!==1)return t.error(`Too many args for : `+i.tag);if(!Array.isArray(e))return t.error(`seqof/setof, but data is not Array`);let n=this.clone();n._baseState.implicit=null,o=this._createEncoderBuffer(e.map((function(n){let r=this._baseState;return this._getUse(r.args[0],e)._encode(n,t)}),n))}else i.use===null?(o=this._encodePrimitive(i.tag,e),s=!0):a=this._getUse(i.use,n)._encode(e,t);if(!i.any&&i.choice===null){let e=i.implicit===null?i.tag:i.implicit,n=i.implicit===null?`universal`:`context`;e===null?i.use===null&&t.error(`Tag could be omitted only for .use()`):i.use===null&&(a=this._encodeComposite(e,s,n,o))}return i.explicit!==null&&(a=this._encodeComposite(i.explicit,!1,`context`,a)),a},l.prototype._encodeChoice=function(e,t){let n=this._baseState,r=n.choice[e.type];return r||o(!1,e.type+` not found in `+JSON.stringify(Object.keys(n.choice))),r._encode(e.value,t)},l.prototype._encodePrimitive=function(e,t){let n=this._baseState;if(/str$/.test(e))return this._encodeStr(t,e);if(e===`objid`&&n.args)return this._encodeObjid(t,n.reverseArgs[0],n.args[1]);if(e===`objid`)return this._encodeObjid(t,null,null);if(e===`gentime`||e===`utctime`)return this._encodeTime(t,e);if(e===`null_`)return this._encodeNull();if(e===`int`||e===`enum`)return this._encodeInt(t,n.args&&n.reverseArgs[0]);if(e===`bool`)return this._encodeBool(t);if(e===`objDesc`)return this._encodeStr(t,e);throw Error(`Unsupported tag: `+e)},l.prototype._isNumstr=function(e){return/^[0-9 ]*$/.test(e)},l.prototype._isPrintstr=function(e){return/^[A-Za-z0-9 '()+,-./:=?]*$/.test(e)}},{"../base/buffer":172,"../base/reporter":175,"minimalistic-assert":453}],175:[function(e,t,n){let r=e(`inherits`);function i(e){this._reporterState={obj:null,path:[],options:e||{},errors:[]}}function a(e,t){this.path=e,this.rethrow(t)}n.Reporter=i,i.prototype.isError=function(e){return e instanceof a},i.prototype.save=function(){let e=this._reporterState;return{obj:e.obj,pathLen:e.path.length}},i.prototype.restore=function(e){let t=this._reporterState;t.obj=e.obj,t.path=t.path.slice(0,e.pathLen)},i.prototype.enterKey=function(e){return this._reporterState.path.push(e)},i.prototype.exitKey=function(e){let t=this._reporterState;t.path=t.path.slice(0,e-1)},i.prototype.leaveKey=function(e,t,n){let r=this._reporterState;this.exitKey(e),r.obj!==null&&(r.obj[t]=n)},i.prototype.path=function(){return this._reporterState.path.join(`/`)},i.prototype.enterObject=function(){let e=this._reporterState,t=e.obj;return e.obj={},t},i.prototype.leaveObject=function(e){let t=this._reporterState,n=t.obj;return t.obj=e,n},i.prototype.error=function(e){let t,n=this._reporterState,r=e instanceof a;if(t=r?e:new a(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},i.prototype.wrapResult=function(e){let t=this._reporterState;return t.options.partial?{result:this.isError(e)?null:e,errors:t.errors}:e},r(a,Error),a.prototype.rethrow=function(e){if(this.message=e+` at: `+(this.path||`(shallow)`),Error.captureStackTrace&&Error.captureStackTrace(this,a),!this.stack)try{throw Error(this.message)}catch(e){this.stack=e.stack}return this}},{inherits:440}],176:[function(e,t,n){function r(e){let t={};return Object.keys(e).forEach((function(n){(0|n)==n&&(n|=0);let r=e[n];t[r]=n})),t}n.tagClass={0:`universal`,1:`application`,2:`context`,3:`private`},n.tagClassByName=r(n.tagClass),n.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`},n.tagByName=r(n.tag)},{}],177:[function(e,t,n){let r=n;r._reverse=function(e){let t={};return Object.keys(e).forEach((function(n){(0|n)==n&&(n|=0);let r=e[n];t[r]=n})),t},r.der=e(`./der`)},{"./der":176}],178:[function(e,t,n){let r=e(`inherits`),i=e(`bn.js`),a=e(`../base/buffer`).DecoderBuffer,o=e(`../base/node`),s=e(`../constants/der`);function c(e){this.enc=`der`,this.name=e.name,this.entity=e,this.tree=new l,this.tree._init(e.body)}function l(e){o.call(this,`der`,e)}function u(e,t){let n=e.readUInt8(t);if(e.isError(n))return n;let r=s.tagClass[n>>6],i=!(32&n);if((31&n)==31){let r=n;for(n=0;(128&r)==128;){if(r=e.readUInt8(t),e.isError(r))return r;n<<=7,n|=127&r}}else n&=31;return{cls:r,primitive:i,tag:n,tagStr:s.tag[n]}}function d(e,t,n){let r=e.readUInt8(n);if(e.isError(r))return r;if(!t&&r===128)return null;if(!(128&r))return r;let i=127&r;if(i>4)return e.error(`length octect is too long`);r=0;for(let t=0;t=31?r.error(`Multi-octet tag encoding unsupported`):(t||(i|=32),i|=o.tagClassByName[n||`universal`]<<6,i)}(e,t,n,this.reporter);if(r.length<128){let e=i.alloc(2);return e[0]=a,e[1]=r.length,this._createEncoderBuffer([e,r])}let s=1;for(let e=r.length;e>=256;e>>=8)s++;let c=i.alloc(2+s);c[0]=a,c[1]=128|s;for(let e=1+s,t=r.length;t>0;e--,t>>=8)c[e]=255&t;return this._createEncoderBuffer([c,r])},c.prototype._encodeStr=function(e,t){if(t===`bitstr`)return this._createEncoderBuffer([0|e.unused,e.data]);if(t===`bmpstr`){let t=i.alloc(2*e.length);for(let n=0;n=40)return this.reporter.error(`Second objid identifier OOB`);e.splice(0,2,40*e[0]+e[1])}let r=0;for(let t=0;t=128;n>>=7)r++}let a=i.alloc(r),o=a.length-1;for(let t=e.length-1;t>=0;t--){let n=e[t];for(a[o--]=127&n;(n>>=7)>0;)a[o--]=128|127&n}return this._createEncoderBuffer(a)},c.prototype._encodeTime=function(e,t){let n,r=new Date(e);return t===`gentime`?n=[l(r.getUTCFullYear()),l(r.getUTCMonth()+1),l(r.getUTCDate()),l(r.getUTCHours()),l(r.getUTCMinutes()),l(r.getUTCSeconds()),`Z`].join(``):t===`utctime`?n=[l(r.getUTCFullYear()%100),l(r.getUTCMonth()+1),l(r.getUTCDate()),l(r.getUTCHours()),l(r.getUTCMinutes()),l(r.getUTCSeconds()),`Z`].join(``):this.reporter.error(`Encoding `+t+` time is not supported yet`),this._encodeStr(n,`octstr`)},c.prototype._encodeNull=function(){return this._createEncoderBuffer(``)},c.prototype._encodeInt=function(e,t){if(typeof e==`string`){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(typeof e!=`number`&&!i.isBuffer(e)){let t=e.toArray();!e.sign&&128&t[0]&&t.unshift(0),e=i.from(t)}if(i.isBuffer(e)){let t=e.length;e.length===0&&t++;let n=i.alloc(t);return e.copy(n),e.length===0&&(n[0]=0),this._createEncoderBuffer(n)}if(e<128)return this._createEncoderBuffer(e);if(e<256)return this._createEncoderBuffer([0,e]);let n=1;for(let t=e;t>=256;t>>=8)n++;let r=Array(n);for(let t=r.length-1;t>=0;t--)r[t]=255&e,e>>=8;return 128&r[0]&&r.unshift(0),this._createEncoderBuffer(i.from(r))},c.prototype._encodeBool=function(e){return this._createEncoderBuffer(e?255:0)},c.prototype._use=function(e,t){return typeof e==`function`&&(e=e(t)),e._getEncoder(`der`).tree},c.prototype._skipDefault=function(e,t,n){let r=this._baseState,i;if(r.default===null)return!1;let a=e.join();if(r.defaultBuffer===void 0&&(r.defaultBuffer=this._encodeValue(r.default,t,n).join()),a.length!==r.defaultBuffer.length)return!1;for(i=0;i=65&&n<=70?n-55:n>=97&&n<=102?n-87:n-48&15}function c(e,t,n){var r=s(e,n);return n-1>=t&&(r|=s(e,n-1)<<4),r}function l(e,t,n,r){for(var i=0,a=Math.min(e.length,n),o=t;o=49?s-49+10:s>=17?s-17+10:s}return i}a.isBN=function(e){return e instanceof a||typeof e==`object`&&!!e&&e.constructor.wordSize===a.wordSize&&Array.isArray(e.words)},a.max=function(e,t){return e.cmp(t)>0?e:t},a.min=function(e,t){return e.cmp(t)<0?e:t},a.prototype._init=function(e,t,n){if(typeof e==`number`)return this._initNumber(e,t,n);if(typeof e==`object`)return this._initArray(e,t,n);t===`hex`&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var i=0;(e=e.toString().replace(/\s+/g,``))[0]===`-`&&(i++,this.negative=1),i=0;i-=3)o=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[a]|=o<>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);else if(n===`le`)for(i=0,a=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);return this.strip()},a.prototype._parseHex=function(e,t,n){this.length=Math.ceil((e.length-t)/6),this.words=Array(this.length);for(var r=0;r=t;r-=2)i=c(e,t,r)<=18?(a-=18,o+=1,this.words[o]|=i>>>26):a+=8;else for(r=(e.length-t)%2==0?t+1:t;r=18?(a-=18,o+=1,this.words[o]|=i>>>26):a+=8;this.strip()},a.prototype._parseBase=function(e,t,n){this.words=[0],this.length=1;for(var r=0,i=1;i<=67108863;i*=t)r++;r--,i=i/t|0;for(var a=e.length-n,o=a%r,s=Math.min(a,a-o)+n,c=0,u=n;u1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},a.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},a.prototype.inspect=function(){return(this.red?``};var u=`.0.00.000.0000.00000.000000.0000000.00000000.000000000.0000000000.00000000000.000000000000.0000000000000.00000000000000.000000000000000.0000000000000000.00000000000000000.000000000000000000.0000000000000000000.00000000000000000000.000000000000000000000.0000000000000000000000.00000000000000000000000.000000000000000000000000.0000000000000000000000000`.split(`.`),d=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],f=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function p(e,t,n){n.negative=t.negative^e.negative;var r=e.length+t.length|0;n.length=r,r=r-1|0;var i=0|e.words[0],a=0|t.words[0],o=i*a,s=67108863&o,c=o/67108864|0;n.words[0]=s;for(var l=1;l>>26,d=67108863&c,f=Math.min(l,t.length-1),p=Math.max(0,l-e.length+1);p<=f;p++){var m=l-p|0;u+=(o=(i=0|e.words[m])*(a=0|t.words[p])+d)/67108864|0,d=67108863&o}n.words[l]=0|d,c=0|u}return c===0?n.length--:n.words[l]=0|c,n.strip()}a.prototype.toString=function(e,t){var n;if(t=0|t||1,(e=e||10)===16||e===`hex`){n=``;for(var i=0,a=0,o=0;o>>24-i&16777215)!=0||o!==this.length-1?u[6-c.length]+c+n:c+n,(i+=2)>=26&&(i-=26,o--)}for(a!==0&&(n=a.toString(16)+n);n.length%t!=0;)n=`0`+n;return this.negative!==0&&(n=`-`+n),n}if(e===(0|e)&&e>=2&&e<=36){var l=d[e],p=f[e];n=``;var m=this.clone();for(m.negative=0;!m.isZero();){var h=m.modn(p).toString(e);n=(m=m.idivn(p)).isZero()?h+n:u[l-h.length]+h+n}for(this.isZero()&&(n=`0`+n);n.length%t!=0;)n=`0`+n;return this.negative!==0&&(n=`-`+n),n}r(!1,`Base should be between 2 and 36`)},a.prototype.toNumber=function(){var e=this.words[0];return this.length===2?e+=67108864*this.words[1]:this.length===3&&this.words[2]===1?e+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,`Number can only safely store up to 53 bits`),this.negative===0?e:-e},a.prototype.toJSON=function(){return this.toString(16)},a.prototype.toBuffer=function(e,t){return r(o!==void 0),this.toArrayLike(o,e,t)},a.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},a.prototype.toArrayLike=function(e,t,n){var i=this.byteLength(),a=n||Math.max(1,i);r(i<=a,`byte array longer than desired length`),r(a>0,`Requested array length <= 0`),this.strip();var o,s,c=t===`le`,l=new e(a),u=this.clone();if(c){for(s=0;!u.isZero();s++)o=u.andln(255),u.iushrn(8),l[s]=o;for(;s=4096&&(n+=13,t>>>=13),t>=64&&(n+=7,t>>>=7),t>=8&&(n+=4,t>>>=4),t>=2&&(n+=2,t>>>=2),n+t},a.prototype._zeroBits=function(e){if(e===0)return 26;var t=e,n=0;return!(8191&t)&&(n+=13,t>>>=13),!(127&t)&&(n+=7,t>>>=7),!(15&t)&&(n+=4,t>>>=4),!(3&t)&&(n+=2,t>>>=2),!(1&t)&&n++,n},a.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},a.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},a.prototype.iuand=function(e){for(var t=this.length>e.length?e:this,n=0;ne.length?this.clone().iand(e):e.clone().iand(this)},a.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},a.prototype.iuxor=function(e){var t,n;this.length>e.length?(t=this,n=e):(t=e,n=this);for(var r=0;re.length?this.clone().ixor(e):e.clone().ixor(this)},a.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},a.prototype.inotn=function(e){r(typeof e==`number`&&e>=0);var t=0|Math.ceil(e/26),n=e%26;this._expand(t),n>0&&t--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-n),this.strip()},a.prototype.notn=function(e){return this.clone().inotn(e)},a.prototype.setn=function(e,t){r(typeof e==`number`&&e>=0);var n=e/26|0,i=e%26;return this._expand(n+1),this.words[n]=t?this.words[n]|1<e.length?(n=this,r=e):(n=e,r=this);for(var i=0,a=0;a>>26;for(;i!==0&&a>>26;if(this.length=n.length,i!==0)this.words[this.length]=i,this.length++;else if(n!==this)for(;ae.length?this.clone().iadd(e):e.clone().iadd(this)},a.prototype.isub=function(e){if(e.negative!==0){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(this.negative!==0)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var n,r,i=this.cmp(e);if(i===0)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(n=this,r=e):(n=e,r=this);for(var a=0,o=0;o>26,this.words[o]=67108863&t;for(;a!==0&&o>26,this.words[o]=67108863&t;if(a===0&&o>>13,p=0|o[1],m=8191&p,h=p>>>13,g=0|o[2],_=8191&g,v=g>>>13,y=0|o[3],b=8191&y,x=y>>>13,S=0|o[4],C=8191&S,w=S>>>13,T=0|o[5],E=8191&T,D=T>>>13,O=0|o[6],k=8191&O,A=O>>>13,j=0|o[7],M=8191&j,N=j>>>13,P=0|o[8],F=8191&P,I=P>>>13,L=0|o[9],R=8191&L,z=L>>>13,B=0|s[0],V=8191&B,H=B>>>13,ee=0|s[1],U=8191&ee,W=ee>>>13,te=0|s[2],G=8191&te,ne=te>>>13,re=0|s[3],K=8191&re,q=re>>>13,J=0|s[4],ie=8191&J,ae=J>>>13,oe=0|s[5],Y=8191&oe,X=oe>>>13,se=0|s[6],ce=8191&se,Z=se>>>13,le=0|s[7],ue=8191&le,de=le>>>13,fe=0|s[8],pe=8191&fe,me=fe>>>13,he=0|s[9],ge=8191&he,_e=he>>>13;n.negative=e.negative^t.negative,n.length=19;var ve=(l+(r=Math.imul(d,V))|0)+((8191&(i=(i=Math.imul(d,H))+Math.imul(f,V)|0))<<13)|0;l=((a=Math.imul(f,H))+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,r=Math.imul(m,V),i=(i=Math.imul(m,H))+Math.imul(h,V)|0,a=Math.imul(h,H);var ye=(l+(r=r+Math.imul(d,U)|0)|0)+((8191&(i=(i=i+Math.imul(d,W)|0)+Math.imul(f,U)|0))<<13)|0;l=((a=a+Math.imul(f,W)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,r=Math.imul(_,V),i=(i=Math.imul(_,H))+Math.imul(v,V)|0,a=Math.imul(v,H),r=r+Math.imul(m,U)|0,i=(i=i+Math.imul(m,W)|0)+Math.imul(h,U)|0,a=a+Math.imul(h,W)|0;var be=(l+(r=r+Math.imul(d,G)|0)|0)+((8191&(i=(i=i+Math.imul(d,ne)|0)+Math.imul(f,G)|0))<<13)|0;l=((a=a+Math.imul(f,ne)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,r=Math.imul(b,V),i=(i=Math.imul(b,H))+Math.imul(x,V)|0,a=Math.imul(x,H),r=r+Math.imul(_,U)|0,i=(i=i+Math.imul(_,W)|0)+Math.imul(v,U)|0,a=a+Math.imul(v,W)|0,r=r+Math.imul(m,G)|0,i=(i=i+Math.imul(m,ne)|0)+Math.imul(h,G)|0,a=a+Math.imul(h,ne)|0;var xe=(l+(r=r+Math.imul(d,K)|0)|0)+((8191&(i=(i=i+Math.imul(d,q)|0)+Math.imul(f,K)|0))<<13)|0;l=((a=a+Math.imul(f,q)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,r=Math.imul(C,V),i=(i=Math.imul(C,H))+Math.imul(w,V)|0,a=Math.imul(w,H),r=r+Math.imul(b,U)|0,i=(i=i+Math.imul(b,W)|0)+Math.imul(x,U)|0,a=a+Math.imul(x,W)|0,r=r+Math.imul(_,G)|0,i=(i=i+Math.imul(_,ne)|0)+Math.imul(v,G)|0,a=a+Math.imul(v,ne)|0,r=r+Math.imul(m,K)|0,i=(i=i+Math.imul(m,q)|0)+Math.imul(h,K)|0,a=a+Math.imul(h,q)|0;var Se=(l+(r=r+Math.imul(d,ie)|0)|0)+((8191&(i=(i=i+Math.imul(d,ae)|0)+Math.imul(f,ie)|0))<<13)|0;l=((a=a+Math.imul(f,ae)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,r=Math.imul(E,V),i=(i=Math.imul(E,H))+Math.imul(D,V)|0,a=Math.imul(D,H),r=r+Math.imul(C,U)|0,i=(i=i+Math.imul(C,W)|0)+Math.imul(w,U)|0,a=a+Math.imul(w,W)|0,r=r+Math.imul(b,G)|0,i=(i=i+Math.imul(b,ne)|0)+Math.imul(x,G)|0,a=a+Math.imul(x,ne)|0,r=r+Math.imul(_,K)|0,i=(i=i+Math.imul(_,q)|0)+Math.imul(v,K)|0,a=a+Math.imul(v,q)|0,r=r+Math.imul(m,ie)|0,i=(i=i+Math.imul(m,ae)|0)+Math.imul(h,ie)|0,a=a+Math.imul(h,ae)|0;var Ce=(l+(r=r+Math.imul(d,Y)|0)|0)+((8191&(i=(i=i+Math.imul(d,X)|0)+Math.imul(f,Y)|0))<<13)|0;l=((a=a+Math.imul(f,X)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,r=Math.imul(k,V),i=(i=Math.imul(k,H))+Math.imul(A,V)|0,a=Math.imul(A,H),r=r+Math.imul(E,U)|0,i=(i=i+Math.imul(E,W)|0)+Math.imul(D,U)|0,a=a+Math.imul(D,W)|0,r=r+Math.imul(C,G)|0,i=(i=i+Math.imul(C,ne)|0)+Math.imul(w,G)|0,a=a+Math.imul(w,ne)|0,r=r+Math.imul(b,K)|0,i=(i=i+Math.imul(b,q)|0)+Math.imul(x,K)|0,a=a+Math.imul(x,q)|0,r=r+Math.imul(_,ie)|0,i=(i=i+Math.imul(_,ae)|0)+Math.imul(v,ie)|0,a=a+Math.imul(v,ae)|0,r=r+Math.imul(m,Y)|0,i=(i=i+Math.imul(m,X)|0)+Math.imul(h,Y)|0,a=a+Math.imul(h,X)|0;var we=(l+(r=r+Math.imul(d,ce)|0)|0)+((8191&(i=(i=i+Math.imul(d,Z)|0)+Math.imul(f,ce)|0))<<13)|0;l=((a=a+Math.imul(f,Z)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,r=Math.imul(M,V),i=(i=Math.imul(M,H))+Math.imul(N,V)|0,a=Math.imul(N,H),r=r+Math.imul(k,U)|0,i=(i=i+Math.imul(k,W)|0)+Math.imul(A,U)|0,a=a+Math.imul(A,W)|0,r=r+Math.imul(E,G)|0,i=(i=i+Math.imul(E,ne)|0)+Math.imul(D,G)|0,a=a+Math.imul(D,ne)|0,r=r+Math.imul(C,K)|0,i=(i=i+Math.imul(C,q)|0)+Math.imul(w,K)|0,a=a+Math.imul(w,q)|0,r=r+Math.imul(b,ie)|0,i=(i=i+Math.imul(b,ae)|0)+Math.imul(x,ie)|0,a=a+Math.imul(x,ae)|0,r=r+Math.imul(_,Y)|0,i=(i=i+Math.imul(_,X)|0)+Math.imul(v,Y)|0,a=a+Math.imul(v,X)|0,r=r+Math.imul(m,ce)|0,i=(i=i+Math.imul(m,Z)|0)+Math.imul(h,ce)|0,a=a+Math.imul(h,Z)|0;var Te=(l+(r=r+Math.imul(d,ue)|0)|0)+((8191&(i=(i=i+Math.imul(d,de)|0)+Math.imul(f,ue)|0))<<13)|0;l=((a=a+Math.imul(f,de)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,r=Math.imul(F,V),i=(i=Math.imul(F,H))+Math.imul(I,V)|0,a=Math.imul(I,H),r=r+Math.imul(M,U)|0,i=(i=i+Math.imul(M,W)|0)+Math.imul(N,U)|0,a=a+Math.imul(N,W)|0,r=r+Math.imul(k,G)|0,i=(i=i+Math.imul(k,ne)|0)+Math.imul(A,G)|0,a=a+Math.imul(A,ne)|0,r=r+Math.imul(E,K)|0,i=(i=i+Math.imul(E,q)|0)+Math.imul(D,K)|0,a=a+Math.imul(D,q)|0,r=r+Math.imul(C,ie)|0,i=(i=i+Math.imul(C,ae)|0)+Math.imul(w,ie)|0,a=a+Math.imul(w,ae)|0,r=r+Math.imul(b,Y)|0,i=(i=i+Math.imul(b,X)|0)+Math.imul(x,Y)|0,a=a+Math.imul(x,X)|0,r=r+Math.imul(_,ce)|0,i=(i=i+Math.imul(_,Z)|0)+Math.imul(v,ce)|0,a=a+Math.imul(v,Z)|0,r=r+Math.imul(m,ue)|0,i=(i=i+Math.imul(m,de)|0)+Math.imul(h,ue)|0,a=a+Math.imul(h,de)|0;var Ee=(l+(r=r+Math.imul(d,pe)|0)|0)+((8191&(i=(i=i+Math.imul(d,me)|0)+Math.imul(f,pe)|0))<<13)|0;l=((a=a+Math.imul(f,me)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,r=Math.imul(R,V),i=(i=Math.imul(R,H))+Math.imul(z,V)|0,a=Math.imul(z,H),r=r+Math.imul(F,U)|0,i=(i=i+Math.imul(F,W)|0)+Math.imul(I,U)|0,a=a+Math.imul(I,W)|0,r=r+Math.imul(M,G)|0,i=(i=i+Math.imul(M,ne)|0)+Math.imul(N,G)|0,a=a+Math.imul(N,ne)|0,r=r+Math.imul(k,K)|0,i=(i=i+Math.imul(k,q)|0)+Math.imul(A,K)|0,a=a+Math.imul(A,q)|0,r=r+Math.imul(E,ie)|0,i=(i=i+Math.imul(E,ae)|0)+Math.imul(D,ie)|0,a=a+Math.imul(D,ae)|0,r=r+Math.imul(C,Y)|0,i=(i=i+Math.imul(C,X)|0)+Math.imul(w,Y)|0,a=a+Math.imul(w,X)|0,r=r+Math.imul(b,ce)|0,i=(i=i+Math.imul(b,Z)|0)+Math.imul(x,ce)|0,a=a+Math.imul(x,Z)|0,r=r+Math.imul(_,ue)|0,i=(i=i+Math.imul(_,de)|0)+Math.imul(v,ue)|0,a=a+Math.imul(v,de)|0,r=r+Math.imul(m,pe)|0,i=(i=i+Math.imul(m,me)|0)+Math.imul(h,pe)|0,a=a+Math.imul(h,me)|0;var De=(l+(r=r+Math.imul(d,ge)|0)|0)+((8191&(i=(i=i+Math.imul(d,_e)|0)+Math.imul(f,ge)|0))<<13)|0;l=((a=a+Math.imul(f,_e)|0)+(i>>>13)|0)+(De>>>26)|0,De&=67108863,r=Math.imul(R,U),i=(i=Math.imul(R,W))+Math.imul(z,U)|0,a=Math.imul(z,W),r=r+Math.imul(F,G)|0,i=(i=i+Math.imul(F,ne)|0)+Math.imul(I,G)|0,a=a+Math.imul(I,ne)|0,r=r+Math.imul(M,K)|0,i=(i=i+Math.imul(M,q)|0)+Math.imul(N,K)|0,a=a+Math.imul(N,q)|0,r=r+Math.imul(k,ie)|0,i=(i=i+Math.imul(k,ae)|0)+Math.imul(A,ie)|0,a=a+Math.imul(A,ae)|0,r=r+Math.imul(E,Y)|0,i=(i=i+Math.imul(E,X)|0)+Math.imul(D,Y)|0,a=a+Math.imul(D,X)|0,r=r+Math.imul(C,ce)|0,i=(i=i+Math.imul(C,Z)|0)+Math.imul(w,ce)|0,a=a+Math.imul(w,Z)|0,r=r+Math.imul(b,ue)|0,i=(i=i+Math.imul(b,de)|0)+Math.imul(x,ue)|0,a=a+Math.imul(x,de)|0,r=r+Math.imul(_,pe)|0,i=(i=i+Math.imul(_,me)|0)+Math.imul(v,pe)|0,a=a+Math.imul(v,me)|0;var Oe=(l+(r=r+Math.imul(m,ge)|0)|0)+((8191&(i=(i=i+Math.imul(m,_e)|0)+Math.imul(h,ge)|0))<<13)|0;l=((a=a+Math.imul(h,_e)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,r=Math.imul(R,G),i=(i=Math.imul(R,ne))+Math.imul(z,G)|0,a=Math.imul(z,ne),r=r+Math.imul(F,K)|0,i=(i=i+Math.imul(F,q)|0)+Math.imul(I,K)|0,a=a+Math.imul(I,q)|0,r=r+Math.imul(M,ie)|0,i=(i=i+Math.imul(M,ae)|0)+Math.imul(N,ie)|0,a=a+Math.imul(N,ae)|0,r=r+Math.imul(k,Y)|0,i=(i=i+Math.imul(k,X)|0)+Math.imul(A,Y)|0,a=a+Math.imul(A,X)|0,r=r+Math.imul(E,ce)|0,i=(i=i+Math.imul(E,Z)|0)+Math.imul(D,ce)|0,a=a+Math.imul(D,Z)|0,r=r+Math.imul(C,ue)|0,i=(i=i+Math.imul(C,de)|0)+Math.imul(w,ue)|0,a=a+Math.imul(w,de)|0,r=r+Math.imul(b,pe)|0,i=(i=i+Math.imul(b,me)|0)+Math.imul(x,pe)|0,a=a+Math.imul(x,me)|0;var ke=(l+(r=r+Math.imul(_,ge)|0)|0)+((8191&(i=(i=i+Math.imul(_,_e)|0)+Math.imul(v,ge)|0))<<13)|0;l=((a=a+Math.imul(v,_e)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,r=Math.imul(R,K),i=(i=Math.imul(R,q))+Math.imul(z,K)|0,a=Math.imul(z,q),r=r+Math.imul(F,ie)|0,i=(i=i+Math.imul(F,ae)|0)+Math.imul(I,ie)|0,a=a+Math.imul(I,ae)|0,r=r+Math.imul(M,Y)|0,i=(i=i+Math.imul(M,X)|0)+Math.imul(N,Y)|0,a=a+Math.imul(N,X)|0,r=r+Math.imul(k,ce)|0,i=(i=i+Math.imul(k,Z)|0)+Math.imul(A,ce)|0,a=a+Math.imul(A,Z)|0,r=r+Math.imul(E,ue)|0,i=(i=i+Math.imul(E,de)|0)+Math.imul(D,ue)|0,a=a+Math.imul(D,de)|0,r=r+Math.imul(C,pe)|0,i=(i=i+Math.imul(C,me)|0)+Math.imul(w,pe)|0,a=a+Math.imul(w,me)|0;var Ae=(l+(r=r+Math.imul(b,ge)|0)|0)+((8191&(i=(i=i+Math.imul(b,_e)|0)+Math.imul(x,ge)|0))<<13)|0;l=((a=a+Math.imul(x,_e)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,r=Math.imul(R,ie),i=(i=Math.imul(R,ae))+Math.imul(z,ie)|0,a=Math.imul(z,ae),r=r+Math.imul(F,Y)|0,i=(i=i+Math.imul(F,X)|0)+Math.imul(I,Y)|0,a=a+Math.imul(I,X)|0,r=r+Math.imul(M,ce)|0,i=(i=i+Math.imul(M,Z)|0)+Math.imul(N,ce)|0,a=a+Math.imul(N,Z)|0,r=r+Math.imul(k,ue)|0,i=(i=i+Math.imul(k,de)|0)+Math.imul(A,ue)|0,a=a+Math.imul(A,de)|0,r=r+Math.imul(E,pe)|0,i=(i=i+Math.imul(E,me)|0)+Math.imul(D,pe)|0,a=a+Math.imul(D,me)|0;var je=(l+(r=r+Math.imul(C,ge)|0)|0)+((8191&(i=(i=i+Math.imul(C,_e)|0)+Math.imul(w,ge)|0))<<13)|0;l=((a=a+Math.imul(w,_e)|0)+(i>>>13)|0)+(je>>>26)|0,je&=67108863,r=Math.imul(R,Y),i=(i=Math.imul(R,X))+Math.imul(z,Y)|0,a=Math.imul(z,X),r=r+Math.imul(F,ce)|0,i=(i=i+Math.imul(F,Z)|0)+Math.imul(I,ce)|0,a=a+Math.imul(I,Z)|0,r=r+Math.imul(M,ue)|0,i=(i=i+Math.imul(M,de)|0)+Math.imul(N,ue)|0,a=a+Math.imul(N,de)|0,r=r+Math.imul(k,pe)|0,i=(i=i+Math.imul(k,me)|0)+Math.imul(A,pe)|0,a=a+Math.imul(A,me)|0;var Me=(l+(r=r+Math.imul(E,ge)|0)|0)+((8191&(i=(i=i+Math.imul(E,_e)|0)+Math.imul(D,ge)|0))<<13)|0;l=((a=a+Math.imul(D,_e)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,r=Math.imul(R,ce),i=(i=Math.imul(R,Z))+Math.imul(z,ce)|0,a=Math.imul(z,Z),r=r+Math.imul(F,ue)|0,i=(i=i+Math.imul(F,de)|0)+Math.imul(I,ue)|0,a=a+Math.imul(I,de)|0,r=r+Math.imul(M,pe)|0,i=(i=i+Math.imul(M,me)|0)+Math.imul(N,pe)|0,a=a+Math.imul(N,me)|0;var Ne=(l+(r=r+Math.imul(k,ge)|0)|0)+((8191&(i=(i=i+Math.imul(k,_e)|0)+Math.imul(A,ge)|0))<<13)|0;l=((a=a+Math.imul(A,_e)|0)+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,r=Math.imul(R,ue),i=(i=Math.imul(R,de))+Math.imul(z,ue)|0,a=Math.imul(z,de),r=r+Math.imul(F,pe)|0,i=(i=i+Math.imul(F,me)|0)+Math.imul(I,pe)|0,a=a+Math.imul(I,me)|0;var Pe=(l+(r=r+Math.imul(M,ge)|0)|0)+((8191&(i=(i=i+Math.imul(M,_e)|0)+Math.imul(N,ge)|0))<<13)|0;l=((a=a+Math.imul(N,_e)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,r=Math.imul(R,pe),i=(i=Math.imul(R,me))+Math.imul(z,pe)|0,a=Math.imul(z,me);var Fe=(l+(r=r+Math.imul(F,ge)|0)|0)+((8191&(i=(i=i+Math.imul(F,_e)|0)+Math.imul(I,ge)|0))<<13)|0;l=((a=a+Math.imul(I,_e)|0)+(i>>>13)|0)+(Fe>>>26)|0,Fe&=67108863;var Ie=(l+(r=Math.imul(R,ge))|0)+((8191&(i=(i=Math.imul(R,_e))+Math.imul(z,ge)|0))<<13)|0;return l=((a=Math.imul(z,_e))+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,c[0]=ve,c[1]=ye,c[2]=be,c[3]=xe,c[4]=Se,c[5]=Ce,c[6]=we,c[7]=Te,c[8]=Ee,c[9]=De,c[10]=Oe,c[11]=ke,c[12]=Ae,c[13]=je,c[14]=Me,c[15]=Ne,c[16]=Pe,c[17]=Fe,c[18]=Ie,l!==0&&(c[19]=l,n.length++),n};function h(e,t,n){return new g().mulp(e,t,n)}function g(e,t){this.x=e,this.y=t}Math.imul||(m=p),a.prototype.mulTo=function(e,t){var n=this.length+e.length;return this.length===10&&e.length===10?m(this,e,t):n<63?p(this,e,t):n<1024?function(e,t,n){n.negative=t.negative^e.negative,n.length=e.length+t.length;for(var r=0,i=0,a=0;a>>26)|0)>>>26,o&=67108863}n.words[a]=s,r=o,o=i}return r===0?n.length--:n.words[a]=r,n.strip()}(this,e,t):h(this,e,t)},g.prototype.makeRBT=function(e){for(var t=Array(e),n=a.prototype._countBits(e)-1,r=0;r>=1;return r},g.prototype.permute=function(e,t,n,r,i,a){for(var o=0;o>>=1)i++;return 1<>>=13,n[2*o+1]=8191&a,a>>>=13;for(o=2*t;o>=26,t+=i/67108864|0,t+=a>>>26,this.words[n]=67108863&a}return t!==0&&(this.words[n]=t,this.length++),this},a.prototype.muln=function(e){return this.clone().imuln(e)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(e){var t=function(e){for(var t=Array(e.bitLength()),n=0;n>>i}return t}(e);if(t.length===0)return new a(1);for(var n=this,r=0;r=0);var t,n=e%26,i=(e-n)/26,a=67108863>>>26-n<<26-n;if(n!==0){var o=0;for(t=0;t>>26-n}o&&(this.words[t]=o,this.length++)}if(i!==0){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t=0),i=t?(t-t%26)/26:0;var a=e%26,o=Math.min((e-a)/26,this.length),s=67108863^67108863>>>a<o)for(this.length-=o,l=0;l=0&&(u!==0||l>=i);l--){var d=0|this.words[l];this.words[l]=u<<26-a|d>>>a,u=d&s}return c&&u!==0&&(c.words[c.length++]=u),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},a.prototype.ishrn=function(e,t,n){return r(this.negative===0),this.iushrn(e,t,n)},a.prototype.shln=function(e){return this.clone().ishln(e)},a.prototype.ushln=function(e){return this.clone().iushln(e)},a.prototype.shrn=function(e){return this.clone().ishrn(e)},a.prototype.ushrn=function(e){return this.clone().iushrn(e)},a.prototype.testn=function(e){r(typeof e==`number`&&e>=0);var t=e%26,n=(e-t)/26,i=1<=0);var t=e%26,n=(e-t)/26;if(r(this.negative===0,`imaskn works only with positive numbers`),this.length<=n)return this;if(t!==0&&n++,this.length=Math.min(n,this.length),t!==0){var i=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},a.prototype.isubn=function(e){if(r(typeof e==`number`),r(e<67108864),e<0)return this.iaddn(-e);if(this.negative!==0)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(c/67108864|0),this.words[i+n]=67108863&a}for(;i>26,this.words[i+n]=67108863&a;if(s===0)return this.strip();for(r(s===-1),s=0,i=0;i>26,this.words[i]=67108863&a;return this.negative=1,this.strip()},a.prototype._wordDiv=function(e,t){var n=(this.length,e.length),r=this.clone(),i=e,o=0|i.words[i.length-1];(n=26-this._countBits(o))!=0&&(i=i.ushln(n),r.iushln(n),o=0|i.words[i.length-1]);var s,c=r.length-i.length;if(t!==`mod`){(s=new a(null)).length=c+1,s.words=Array(s.length);for(var l=0;l=0;d--){var f=67108864*(0|r.words[i.length+d])+(0|r.words[i.length+d-1]);for(f=Math.min(f/o|0,67108863),r._ishlnsubmul(i,f,d);r.negative!==0;)f--,r.negative=0,r._ishlnsubmul(i,1,d),r.isZero()||(r.negative^=1);s&&(s.words[d]=f)}return s&&s.strip(),r.strip(),t!==`div`&&n!==0&&r.iushrn(n),{div:s||null,mod:r}},a.prototype.divmod=function(e,t,n){return r(!e.isZero()),this.isZero()?{div:new a(0),mod:new a(0)}:this.negative!==0&&e.negative===0?(s=this.neg().divmod(e,t),t!==`mod`&&(i=s.div.neg()),t!==`div`&&(o=s.mod.neg(),n&&o.negative!==0&&o.iadd(e)),{div:i,mod:o}):this.negative===0&&e.negative!==0?(s=this.divmod(e.neg(),t),t!==`mod`&&(i=s.div.neg()),{div:i,mod:s.mod}):(this.negative&e.negative)==0?e.length>this.length||this.cmp(e)<0?{div:new a(0),mod:this}:e.length===1?t===`div`?{div:this.divn(e.words[0]),mod:null}:t===`mod`?{div:null,mod:new a(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new a(this.modn(e.words[0]))}:this._wordDiv(e,t):(s=this.neg().divmod(e.neg(),t),t!==`div`&&(o=s.mod.neg(),n&&o.negative!==0&&o.isub(e)),{div:s.div,mod:o});var i,o,s},a.prototype.div=function(e){return this.divmod(e,`div`,!1).div},a.prototype.mod=function(e){return this.divmod(e,`mod`,!1).mod},a.prototype.umod=function(e){return this.divmod(e,`mod`,!0).mod},a.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var n=t.div.negative===0?t.mod:t.mod.isub(e),r=e.ushrn(1),i=e.andln(1),a=n.cmp(r);return a<0||i===1&&a===0?t.div:t.div.negative===0?t.div.iaddn(1):t.div.isubn(1)},a.prototype.modn=function(e){r(e<=67108863);for(var t=(1<<26)%e,n=0,i=this.length-1;i>=0;i--)n=(t*n+(0|this.words[i]))%e;return n},a.prototype.idivn=function(e){r(e<=67108863);for(var t=0,n=this.length-1;n>=0;n--){var i=(0|this.words[n])+67108864*t;this.words[n]=i/e|0,t=i%e}return this.strip()},a.prototype.divn=function(e){return this.clone().idivn(e)},a.prototype.egcd=function(e){r(e.negative===0),r(!e.isZero());var t=this,n=e.clone();t=t.negative===0?t.clone():t.umod(e);for(var i=new a(1),o=new a(0),s=new a(0),c=new a(1),l=0;t.isEven()&&n.isEven();)t.iushrn(1),n.iushrn(1),++l;for(var u=n.clone(),d=t.clone();!t.isZero();){for(var f=0,p=1;(t.words[0]&p)==0&&f<26;++f,p<<=1);if(f>0)for(t.iushrn(f);f-->0;)(i.isOdd()||o.isOdd())&&(i.iadd(u),o.isub(d)),i.iushrn(1),o.iushrn(1);for(var m=0,h=1;(n.words[0]&h)==0&&m<26;++m,h<<=1);if(m>0)for(n.iushrn(m);m-->0;)(s.isOdd()||c.isOdd())&&(s.iadd(u),c.isub(d)),s.iushrn(1),c.iushrn(1);t.cmp(n)>=0?(t.isub(n),i.isub(s),o.isub(c)):(n.isub(t),s.isub(i),c.isub(o))}return{a:s,b:c,gcd:n.iushln(l)}},a.prototype._invmp=function(e){r(e.negative===0),r(!e.isZero());var t=this,n=e.clone();t=t.negative===0?t.clone():t.umod(e);for(var i,o=new a(1),s=new a(0),c=n.clone();t.cmpn(1)>0&&n.cmpn(1)>0;){for(var l=0,u=1;(t.words[0]&u)==0&&l<26;++l,u<<=1);if(l>0)for(t.iushrn(l);l-->0;)o.isOdd()&&o.iadd(c),o.iushrn(1);for(var d=0,f=1;(n.words[0]&f)==0&&d<26;++d,f<<=1);if(d>0)for(n.iushrn(d);d-->0;)s.isOdd()&&s.iadd(c),s.iushrn(1);t.cmp(n)>=0?(t.isub(n),o.isub(s)):(n.isub(t),s.isub(o))}return(i=t.cmpn(1)===0?o:s).cmpn(0)<0&&i.iadd(e),i},a.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),n=e.clone();t.negative=0,n.negative=0;for(var r=0;t.isEven()&&n.isEven();r++)t.iushrn(1),n.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;n.isEven();)n.iushrn(1);var i=t.cmp(n);if(i<0){var a=t;t=n,n=a}else if(i===0||n.cmpn(1)===0)break;t.isub(n)}return n.iushln(r)},a.prototype.invm=function(e){return this.egcd(e).a.umod(e)},a.prototype.isEven=function(){return!(1&this.words[0])},a.prototype.isOdd=function(){return(1&this.words[0])==1},a.prototype.andln=function(e){return this.words[0]&e},a.prototype.bincn=function(e){r(typeof e==`number`);var t=e%26,n=(e-t)/26,i=1<>>26,s&=67108863,this.words[o]=s}return a!==0&&(this.words[o]=a,this.length++),this},a.prototype.isZero=function(){return this.length===1&&this.words[0]===0},a.prototype.cmpn=function(e){var t,n=e<0;if(this.negative!==0&&!n)return-1;if(this.negative===0&&n)return 1;if(this.strip(),this.length>1)t=1;else{n&&(e=-e),r(e<=67108863,`Number is too big`);var i=0|this.words[0];t=i===e?0:ie.length)return 1;if(this.length=0;n--){var r=0|this.words[n],i=0|e.words[n];if(r!==i){ri&&(t=1);break}}return t},a.prototype.gtn=function(e){return this.cmpn(e)===1},a.prototype.gt=function(e){return this.cmp(e)===1},a.prototype.gten=function(e){return this.cmpn(e)>=0},a.prototype.gte=function(e){return this.cmp(e)>=0},a.prototype.ltn=function(e){return this.cmpn(e)===-1},a.prototype.lt=function(e){return this.cmp(e)===-1},a.prototype.lten=function(e){return this.cmpn(e)<=0},a.prototype.lte=function(e){return this.cmp(e)<=0},a.prototype.eqn=function(e){return this.cmpn(e)===0},a.prototype.eq=function(e){return this.cmp(e)===0},a.red=function(e){return new C(e)},a.prototype.toRed=function(e){return r(!this.red,`Already a number in reduction context`),r(this.negative===0,`red works only with positives`),e.convertTo(this)._forceRed(e)},a.prototype.fromRed=function(){return r(this.red,`fromRed works only with numbers in reduction context`),this.red.convertFrom(this)},a.prototype._forceRed=function(e){return this.red=e,this},a.prototype.forceRed=function(e){return r(!this.red,`Already a number in reduction context`),this._forceRed(e)},a.prototype.redAdd=function(e){return r(this.red,`redAdd works only with red numbers`),this.red.add(this,e)},a.prototype.redIAdd=function(e){return r(this.red,`redIAdd works only with red numbers`),this.red.iadd(this,e)},a.prototype.redSub=function(e){return r(this.red,`redSub works only with red numbers`),this.red.sub(this,e)},a.prototype.redISub=function(e){return r(this.red,`redISub works only with red numbers`),this.red.isub(this,e)},a.prototype.redShl=function(e){return r(this.red,`redShl works only with red numbers`),this.red.shl(this,e)},a.prototype.redMul=function(e){return r(this.red,`redMul works only with red numbers`),this.red._verify2(this,e),this.red.mul(this,e)},a.prototype.redIMul=function(e){return r(this.red,`redMul works only with red numbers`),this.red._verify2(this,e),this.red.imul(this,e)},a.prototype.redSqr=function(){return r(this.red,`redSqr works only with red numbers`),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return r(this.red,`redISqr works only with red numbers`),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return r(this.red,`redSqrt works only with red numbers`),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return r(this.red,`redInvm works only with red numbers`),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return r(this.red,`redNeg works only with red numbers`),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(e){return r(this.red&&!e.red,`redPow(normalNum)`),this.red._verify1(this),this.red.pow(this,e)};var _={k256:null,p224:null,p192:null,p25519:null};function v(e,t){this.name=e,this.p=new a(t,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){v.call(this,`k256`,`ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f`)}function b(){v.call(this,`p224`,`ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001`)}function x(){v.call(this,`p192`,`ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff`)}function S(){v.call(this,`25519`,`7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed`)}function C(e){if(typeof e==`string`){var t=a._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),`modulus must be greater than 1`),this.m=e,this.prime=null}function w(e){C.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new a(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}v.prototype._tmp=function(){var e=new a(null);return e.words=Array(Math.ceil(this.n/13)),e},v.prototype.ireduce=function(e){var t,n=e;do this.split(n,this.tmp),t=(n=(n=this.imulK(n)).iadd(this.tmp)).bitLength();while(t>this.n);var r=t0?n.isub(this.p):n.strip===void 0?n._strip():n.strip(),n},v.prototype.split=function(e,t){e.iushrn(this.n,0,t)},v.prototype.imulK=function(e){return e.imul(this.k)},i(y,v),y.prototype.split=function(e,t){for(var n=Math.min(e.length,9),r=0;r>>22,i=a}i>>>=22,e.words[r-10]=i,i===0&&e.length>10?e.length-=10:e.length-=9},y.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,n=0;n>>=26,e.words[n]=i,t=r}return t!==0&&(e.words[e.length++]=t),e},a._prime=function(e){if(_[e])return _[e];var t;if(e===`k256`)t=new y;else if(e===`p224`)t=new b;else if(e===`p192`)t=new x;else{if(e!==`p25519`)throw Error(`Unknown prime `+e);t=new S}return _[e]=t,t},C.prototype._verify1=function(e){r(e.negative===0,`red works only with positives`),r(e.red,`red works only with red numbers`)},C.prototype._verify2=function(e,t){r((e.negative|t.negative)==0,`red works only with positives`),r(e.red&&e.red===t.red,`red works only with red numbers`)},C.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},C.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},C.prototype.add=function(e,t){this._verify2(e,t);var n=e.add(t);return n.cmp(this.m)>=0&&n.isub(this.m),n._forceRed(this)},C.prototype.iadd=function(e,t){this._verify2(e,t);var n=e.iadd(t);return n.cmp(this.m)>=0&&n.isub(this.m),n},C.prototype.sub=function(e,t){this._verify2(e,t);var n=e.sub(t);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},C.prototype.isub=function(e,t){this._verify2(e,t);var n=e.isub(t);return n.cmpn(0)<0&&n.iadd(this.m),n},C.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},C.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},C.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},C.prototype.isqr=function(e){return this.imul(e,e.clone())},C.prototype.sqr=function(e){return this.mul(e,e)},C.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2==1),t===3){var n=this.m.add(new a(1)).iushrn(2);return this.pow(e,n)}for(var i=this.m.subn(1),o=0;!i.isZero()&&i.andln(1)===0;)o++,i.iushrn(1);r(!i.isZero());var s=new a(1).toRed(this),c=s.redNeg(),l=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new a(2*u*u).toRed(this);this.pow(u,l).cmp(c)!==0;)u.redIAdd(c);for(var d=this.pow(u,i),f=this.pow(e,i.addn(1).iushrn(1)),p=this.pow(e,i),m=o;p.cmp(s)!==0;){for(var h=p,g=0;h.cmp(s)!==0;g++)h=h.redSqr();r(g=0;r--){for(var l=t.words[r],u=c-1;u>=0;u--){var d=l>>u&1;i!==n[0]&&(i=this.sqr(i)),d!==0||o!==0?(o<<=1,o|=d,(++s===4||r===0&&u===0)&&(i=this.mul(i,n[o]),s=0,o=0)):s=0}c=26}return i},C.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},C.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},a.mont=function(e){return new w(e)},i(w,C),w.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},w.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},w.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var n=e.imul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},w.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new a(0)._forceRed(this);var n=e.mul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},w.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}})(t===void 0||t)},{buffer:188}],185:[function(e,t,n){n.byteLength=function(e){var t=l(e),n=t[0],r=t[1];return 3*(n+r)/4-r},n.toByteArray=function(e){var t,n,r=l(e),o=r[0],s=r[1],c=new a(function(e,t,n){return 3*(t+n)/4-n}(0,o,s)),u=0,d=s>0?o-4:o;for(n=0;n>16&255,c[u++]=t>>8&255,c[u++]=255&t;return s===2&&(t=i[e.charCodeAt(n)]<<2|i[e.charCodeAt(n+1)]>>4,c[u++]=255&t),s===1&&(t=i[e.charCodeAt(n)]<<10|i[e.charCodeAt(n+1)]<<4|i[e.charCodeAt(n+2)]>>2,c[u++]=t>>8&255,c[u++]=255&t),c},n.fromByteArray=function(e){for(var t,n=e.length,i=n%3,a=[],o=0,s=n-i;os?s:o+16383));return i===1?(t=e[n-1],a.push(r[t>>2]+r[t<<4&63]+`==`)):i===2&&(t=(e[n-2]<<8)+e[n-1],a.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+`=`)),a.join(``)};for(var r=[],i=[],a=typeof Uint8Array<`u`?Uint8Array:Array,o=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,s=0,c=o.length;s0)throw Error(`Invalid string. Length must be a multiple of 4`);var n=e.indexOf(`=`);return n===-1&&(n=t),[n,n===t?0:4-n%4]}function u(e,t,n){for(var i,a,o=[],s=t;s>18&63]+r[a>>12&63]+r[a>>6&63]+r[63&a]);return o.join(``)}i[45]=62,i[95]=63},{}],186:[function(e,t,n){(function(t,n){function r(e,t){if(!e)throw Error(t||`Assertion failed`)}function i(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}function a(e,t,n){if(a.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,e!==null&&(t!==`le`&&t!==`be`||(n=t,t=10),this._init(e||0,t||10,n||`be`))}var o;typeof t==`object`?t.exports=a:(void 0).BN=a,a.BN=a,a.wordSize=26;try{o=typeof window<`u`&&window.Buffer!==void 0?window.Buffer:e(`buffer`).Buffer}catch{}function s(e,t){var n=e.charCodeAt(t);return n>=48&&n<=57?n-48:n>=65&&n<=70?n-55:n>=97&&n<=102?n-87:void r(!1,`Invalid character in `+e)}function c(e,t,n){var r=s(e,n);return n-1>=t&&(r|=s(e,n-1)<<4),r}function l(e,t,n,i){for(var a=0,o=0,s=Math.min(e.length,n),c=t;c=49?l-49+10:l>=17?l-17+10:l,r(l>=0&&o0?e:t},a.min=function(e,t){return e.cmp(t)<0?e:t},a.prototype._init=function(e,t,n){if(typeof e==`number`)return this._initNumber(e,t,n);if(typeof e==`object`)return this._initArray(e,t,n);t===`hex`&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var i=0;(e=e.toString().replace(/\s+/g,``))[0]===`-`&&(i++,this.negative=1),i=0;i-=3)o=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[a]|=o<>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);else if(n===`le`)for(i=0,a=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);return this._strip()},a.prototype._parseHex=function(e,t,n){this.length=Math.ceil((e.length-t)/6),this.words=Array(this.length);for(var r=0;r=t;r-=2)i=c(e,t,r)<=18?(a-=18,o+=1,this.words[o]|=i>>>26):a+=8;else for(r=(e.length-t)%2==0?t+1:t;r=18?(a-=18,o+=1,this.words[o]|=i>>>26):a+=8;this._strip()},a.prototype._parseBase=function(e,t,n){this.words=[0],this.length=1;for(var r=0,i=1;i<=67108863;i*=t)r++;r--,i=i/t|0;for(var a=e.length-n,o=a%r,s=Math.min(a,a-o)+n,c=0,u=n;u1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},a.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<`u`&&typeof Symbol.for==`function`)try{a.prototype[Symbol.for(`nodejs.util.inspect.custom`)]=d}catch{a.prototype.inspect=d}else a.prototype.inspect=d;function d(){return(this.red?``}var f=`.0.00.000.0000.00000.000000.0000000.00000000.000000000.0000000000.00000000000.000000000000.0000000000000.00000000000000.000000000000000.0000000000000000.00000000000000000.000000000000000000.0000000000000000000.00000000000000000000.000000000000000000000.0000000000000000000000.00000000000000000000000.000000000000000000000000.0000000000000000000000000`.split(`.`),p=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],m=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];a.prototype.toString=function(e,t){var n;if(t=0|t||1,(e=e||10)===16||e===`hex`){n=``;for(var i=0,a=0,o=0;o>>24-i&16777215,(i+=2)>=26&&(i-=26,o--),n=a!==0||o!==this.length-1?f[6-c.length]+c+n:c+n}for(a!==0&&(n=a.toString(16)+n);n.length%t!=0;)n=`0`+n;return this.negative!==0&&(n=`-`+n),n}if(e===(0|e)&&e>=2&&e<=36){var l=p[e],u=m[e];n=``;var d=this.clone();for(d.negative=0;!d.isZero();){var h=d.modrn(u).toString(e);n=(d=d.idivn(u)).isZero()?h+n:f[l-h.length]+h+n}for(this.isZero()&&(n=`0`+n);n.length%t!=0;)n=`0`+n;return this.negative!==0&&(n=`-`+n),n}r(!1,`Base should be between 2 and 36`)},a.prototype.toNumber=function(){var e=this.words[0];return this.length===2?e+=67108864*this.words[1]:this.length===3&&this.words[2]===1?e+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,`Number can only safely store up to 53 bits`),this.negative===0?e:-e},a.prototype.toJSON=function(){return this.toString(16,2)},o&&(a.prototype.toBuffer=function(e,t){return this.toArrayLike(o,e,t)}),a.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)};function h(e,t,n){n.negative=t.negative^e.negative;var r=e.length+t.length|0;n.length=r,r=r-1|0;var i=0|e.words[0],a=0|t.words[0],o=i*a,s=67108863&o,c=o/67108864|0;n.words[0]=s;for(var l=1;l>>26,d=67108863&c,f=Math.min(l,t.length-1),p=Math.max(0,l-e.length+1);p<=f;p++){var m=l-p|0;u+=(o=(i=0|e.words[m])*(a=0|t.words[p])+d)/67108864|0,d=67108863&o}n.words[l]=0|d,c=0|u}return c===0?n.length--:n.words[l]=0|c,n._strip()}a.prototype.toArrayLike=function(e,t,n){this._strip();var i=this.byteLength(),a=n||Math.max(1,i);r(i<=a,`byte array longer than desired length`),r(a>0,`Requested array length <= 0`);var o=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,a);return this[`_toArrayLike`+(t===`le`?`LE`:`BE`)](o,i),o},a.prototype._toArrayLikeLE=function(e,t){for(var n=0,r=0,i=0,a=0;i>8&255),n>16&255),a===6?(n>24&255),r=0,a=0):(r=o>>>24,a+=2)}if(n=0&&(e[n--]=o>>8&255),n>=0&&(e[n--]=o>>16&255),a===6?(n>=0&&(e[n--]=o>>24&255),r=0,a=0):(r=o>>>24,a+=2)}if(n>=0)for(e[n--]=r;n>=0;)e[n--]=0},Math.clz32?a.prototype._countBits=function(e){return 32-Math.clz32(e)}:a.prototype._countBits=function(e){var t=e,n=0;return t>=4096&&(n+=13,t>>>=13),t>=64&&(n+=7,t>>>=7),t>=8&&(n+=4,t>>>=4),t>=2&&(n+=2,t>>>=2),n+t},a.prototype._zeroBits=function(e){if(e===0)return 26;var t=e,n=0;return!(8191&t)&&(n+=13,t>>>=13),!(127&t)&&(n+=7,t>>>=7),!(15&t)&&(n+=4,t>>>=4),!(3&t)&&(n+=2,t>>>=2),!(1&t)&&n++,n},a.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},a.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},a.prototype.iuand=function(e){for(var t=this.length>e.length?e:this,n=0;ne.length?this.clone().iand(e):e.clone().iand(this)},a.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},a.prototype.iuxor=function(e){var t,n;this.length>e.length?(t=this,n=e):(t=e,n=this);for(var r=0;re.length?this.clone().ixor(e):e.clone().ixor(this)},a.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},a.prototype.inotn=function(e){r(typeof e==`number`&&e>=0);var t=0|Math.ceil(e/26),n=e%26;this._expand(t),n>0&&t--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-n),this._strip()},a.prototype.notn=function(e){return this.clone().inotn(e)},a.prototype.setn=function(e,t){r(typeof e==`number`&&e>=0);var n=e/26|0,i=e%26;return this._expand(n+1),this.words[n]=t?this.words[n]|1<e.length?(n=this,r=e):(n=e,r=this);for(var i=0,a=0;a>>26;for(;i!==0&&a>>26;if(this.length=n.length,i!==0)this.words[this.length]=i,this.length++;else if(n!==this)for(;ae.length?this.clone().iadd(e):e.clone().iadd(this)},a.prototype.isub=function(e){if(e.negative!==0){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(this.negative!==0)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var n,r,i=this.cmp(e);if(i===0)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(n=this,r=e):(n=e,r=this);for(var a=0,o=0;o>26,this.words[o]=67108863&t;for(;a!==0&&o>26,this.words[o]=67108863&t;if(a===0&&o>>13,p=0|o[1],m=8191&p,h=p>>>13,g=0|o[2],_=8191&g,v=g>>>13,y=0|o[3],b=8191&y,x=y>>>13,S=0|o[4],C=8191&S,w=S>>>13,T=0|o[5],E=8191&T,D=T>>>13,O=0|o[6],k=8191&O,A=O>>>13,j=0|o[7],M=8191&j,N=j>>>13,P=0|o[8],F=8191&P,I=P>>>13,L=0|o[9],R=8191&L,z=L>>>13,B=0|s[0],V=8191&B,H=B>>>13,ee=0|s[1],U=8191&ee,W=ee>>>13,te=0|s[2],G=8191&te,ne=te>>>13,re=0|s[3],K=8191&re,q=re>>>13,J=0|s[4],ie=8191&J,ae=J>>>13,oe=0|s[5],Y=8191&oe,X=oe>>>13,se=0|s[6],ce=8191&se,Z=se>>>13,le=0|s[7],ue=8191&le,de=le>>>13,fe=0|s[8],pe=8191&fe,me=fe>>>13,he=0|s[9],ge=8191&he,_e=he>>>13;n.negative=e.negative^t.negative,n.length=19;var ve=(l+(r=Math.imul(d,V))|0)+((8191&(i=(i=Math.imul(d,H))+Math.imul(f,V)|0))<<13)|0;l=((a=Math.imul(f,H))+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,r=Math.imul(m,V),i=(i=Math.imul(m,H))+Math.imul(h,V)|0,a=Math.imul(h,H);var ye=(l+(r=r+Math.imul(d,U)|0)|0)+((8191&(i=(i=i+Math.imul(d,W)|0)+Math.imul(f,U)|0))<<13)|0;l=((a=a+Math.imul(f,W)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,r=Math.imul(_,V),i=(i=Math.imul(_,H))+Math.imul(v,V)|0,a=Math.imul(v,H),r=r+Math.imul(m,U)|0,i=(i=i+Math.imul(m,W)|0)+Math.imul(h,U)|0,a=a+Math.imul(h,W)|0;var be=(l+(r=r+Math.imul(d,G)|0)|0)+((8191&(i=(i=i+Math.imul(d,ne)|0)+Math.imul(f,G)|0))<<13)|0;l=((a=a+Math.imul(f,ne)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,r=Math.imul(b,V),i=(i=Math.imul(b,H))+Math.imul(x,V)|0,a=Math.imul(x,H),r=r+Math.imul(_,U)|0,i=(i=i+Math.imul(_,W)|0)+Math.imul(v,U)|0,a=a+Math.imul(v,W)|0,r=r+Math.imul(m,G)|0,i=(i=i+Math.imul(m,ne)|0)+Math.imul(h,G)|0,a=a+Math.imul(h,ne)|0;var xe=(l+(r=r+Math.imul(d,K)|0)|0)+((8191&(i=(i=i+Math.imul(d,q)|0)+Math.imul(f,K)|0))<<13)|0;l=((a=a+Math.imul(f,q)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,r=Math.imul(C,V),i=(i=Math.imul(C,H))+Math.imul(w,V)|0,a=Math.imul(w,H),r=r+Math.imul(b,U)|0,i=(i=i+Math.imul(b,W)|0)+Math.imul(x,U)|0,a=a+Math.imul(x,W)|0,r=r+Math.imul(_,G)|0,i=(i=i+Math.imul(_,ne)|0)+Math.imul(v,G)|0,a=a+Math.imul(v,ne)|0,r=r+Math.imul(m,K)|0,i=(i=i+Math.imul(m,q)|0)+Math.imul(h,K)|0,a=a+Math.imul(h,q)|0;var Se=(l+(r=r+Math.imul(d,ie)|0)|0)+((8191&(i=(i=i+Math.imul(d,ae)|0)+Math.imul(f,ie)|0))<<13)|0;l=((a=a+Math.imul(f,ae)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,r=Math.imul(E,V),i=(i=Math.imul(E,H))+Math.imul(D,V)|0,a=Math.imul(D,H),r=r+Math.imul(C,U)|0,i=(i=i+Math.imul(C,W)|0)+Math.imul(w,U)|0,a=a+Math.imul(w,W)|0,r=r+Math.imul(b,G)|0,i=(i=i+Math.imul(b,ne)|0)+Math.imul(x,G)|0,a=a+Math.imul(x,ne)|0,r=r+Math.imul(_,K)|0,i=(i=i+Math.imul(_,q)|0)+Math.imul(v,K)|0,a=a+Math.imul(v,q)|0,r=r+Math.imul(m,ie)|0,i=(i=i+Math.imul(m,ae)|0)+Math.imul(h,ie)|0,a=a+Math.imul(h,ae)|0;var Ce=(l+(r=r+Math.imul(d,Y)|0)|0)+((8191&(i=(i=i+Math.imul(d,X)|0)+Math.imul(f,Y)|0))<<13)|0;l=((a=a+Math.imul(f,X)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,r=Math.imul(k,V),i=(i=Math.imul(k,H))+Math.imul(A,V)|0,a=Math.imul(A,H),r=r+Math.imul(E,U)|0,i=(i=i+Math.imul(E,W)|0)+Math.imul(D,U)|0,a=a+Math.imul(D,W)|0,r=r+Math.imul(C,G)|0,i=(i=i+Math.imul(C,ne)|0)+Math.imul(w,G)|0,a=a+Math.imul(w,ne)|0,r=r+Math.imul(b,K)|0,i=(i=i+Math.imul(b,q)|0)+Math.imul(x,K)|0,a=a+Math.imul(x,q)|0,r=r+Math.imul(_,ie)|0,i=(i=i+Math.imul(_,ae)|0)+Math.imul(v,ie)|0,a=a+Math.imul(v,ae)|0,r=r+Math.imul(m,Y)|0,i=(i=i+Math.imul(m,X)|0)+Math.imul(h,Y)|0,a=a+Math.imul(h,X)|0;var we=(l+(r=r+Math.imul(d,ce)|0)|0)+((8191&(i=(i=i+Math.imul(d,Z)|0)+Math.imul(f,ce)|0))<<13)|0;l=((a=a+Math.imul(f,Z)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,r=Math.imul(M,V),i=(i=Math.imul(M,H))+Math.imul(N,V)|0,a=Math.imul(N,H),r=r+Math.imul(k,U)|0,i=(i=i+Math.imul(k,W)|0)+Math.imul(A,U)|0,a=a+Math.imul(A,W)|0,r=r+Math.imul(E,G)|0,i=(i=i+Math.imul(E,ne)|0)+Math.imul(D,G)|0,a=a+Math.imul(D,ne)|0,r=r+Math.imul(C,K)|0,i=(i=i+Math.imul(C,q)|0)+Math.imul(w,K)|0,a=a+Math.imul(w,q)|0,r=r+Math.imul(b,ie)|0,i=(i=i+Math.imul(b,ae)|0)+Math.imul(x,ie)|0,a=a+Math.imul(x,ae)|0,r=r+Math.imul(_,Y)|0,i=(i=i+Math.imul(_,X)|0)+Math.imul(v,Y)|0,a=a+Math.imul(v,X)|0,r=r+Math.imul(m,ce)|0,i=(i=i+Math.imul(m,Z)|0)+Math.imul(h,ce)|0,a=a+Math.imul(h,Z)|0;var Te=(l+(r=r+Math.imul(d,ue)|0)|0)+((8191&(i=(i=i+Math.imul(d,de)|0)+Math.imul(f,ue)|0))<<13)|0;l=((a=a+Math.imul(f,de)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,r=Math.imul(F,V),i=(i=Math.imul(F,H))+Math.imul(I,V)|0,a=Math.imul(I,H),r=r+Math.imul(M,U)|0,i=(i=i+Math.imul(M,W)|0)+Math.imul(N,U)|0,a=a+Math.imul(N,W)|0,r=r+Math.imul(k,G)|0,i=(i=i+Math.imul(k,ne)|0)+Math.imul(A,G)|0,a=a+Math.imul(A,ne)|0,r=r+Math.imul(E,K)|0,i=(i=i+Math.imul(E,q)|0)+Math.imul(D,K)|0,a=a+Math.imul(D,q)|0,r=r+Math.imul(C,ie)|0,i=(i=i+Math.imul(C,ae)|0)+Math.imul(w,ie)|0,a=a+Math.imul(w,ae)|0,r=r+Math.imul(b,Y)|0,i=(i=i+Math.imul(b,X)|0)+Math.imul(x,Y)|0,a=a+Math.imul(x,X)|0,r=r+Math.imul(_,ce)|0,i=(i=i+Math.imul(_,Z)|0)+Math.imul(v,ce)|0,a=a+Math.imul(v,Z)|0,r=r+Math.imul(m,ue)|0,i=(i=i+Math.imul(m,de)|0)+Math.imul(h,ue)|0,a=a+Math.imul(h,de)|0;var Ee=(l+(r=r+Math.imul(d,pe)|0)|0)+((8191&(i=(i=i+Math.imul(d,me)|0)+Math.imul(f,pe)|0))<<13)|0;l=((a=a+Math.imul(f,me)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,r=Math.imul(R,V),i=(i=Math.imul(R,H))+Math.imul(z,V)|0,a=Math.imul(z,H),r=r+Math.imul(F,U)|0,i=(i=i+Math.imul(F,W)|0)+Math.imul(I,U)|0,a=a+Math.imul(I,W)|0,r=r+Math.imul(M,G)|0,i=(i=i+Math.imul(M,ne)|0)+Math.imul(N,G)|0,a=a+Math.imul(N,ne)|0,r=r+Math.imul(k,K)|0,i=(i=i+Math.imul(k,q)|0)+Math.imul(A,K)|0,a=a+Math.imul(A,q)|0,r=r+Math.imul(E,ie)|0,i=(i=i+Math.imul(E,ae)|0)+Math.imul(D,ie)|0,a=a+Math.imul(D,ae)|0,r=r+Math.imul(C,Y)|0,i=(i=i+Math.imul(C,X)|0)+Math.imul(w,Y)|0,a=a+Math.imul(w,X)|0,r=r+Math.imul(b,ce)|0,i=(i=i+Math.imul(b,Z)|0)+Math.imul(x,ce)|0,a=a+Math.imul(x,Z)|0,r=r+Math.imul(_,ue)|0,i=(i=i+Math.imul(_,de)|0)+Math.imul(v,ue)|0,a=a+Math.imul(v,de)|0,r=r+Math.imul(m,pe)|0,i=(i=i+Math.imul(m,me)|0)+Math.imul(h,pe)|0,a=a+Math.imul(h,me)|0;var De=(l+(r=r+Math.imul(d,ge)|0)|0)+((8191&(i=(i=i+Math.imul(d,_e)|0)+Math.imul(f,ge)|0))<<13)|0;l=((a=a+Math.imul(f,_e)|0)+(i>>>13)|0)+(De>>>26)|0,De&=67108863,r=Math.imul(R,U),i=(i=Math.imul(R,W))+Math.imul(z,U)|0,a=Math.imul(z,W),r=r+Math.imul(F,G)|0,i=(i=i+Math.imul(F,ne)|0)+Math.imul(I,G)|0,a=a+Math.imul(I,ne)|0,r=r+Math.imul(M,K)|0,i=(i=i+Math.imul(M,q)|0)+Math.imul(N,K)|0,a=a+Math.imul(N,q)|0,r=r+Math.imul(k,ie)|0,i=(i=i+Math.imul(k,ae)|0)+Math.imul(A,ie)|0,a=a+Math.imul(A,ae)|0,r=r+Math.imul(E,Y)|0,i=(i=i+Math.imul(E,X)|0)+Math.imul(D,Y)|0,a=a+Math.imul(D,X)|0,r=r+Math.imul(C,ce)|0,i=(i=i+Math.imul(C,Z)|0)+Math.imul(w,ce)|0,a=a+Math.imul(w,Z)|0,r=r+Math.imul(b,ue)|0,i=(i=i+Math.imul(b,de)|0)+Math.imul(x,ue)|0,a=a+Math.imul(x,de)|0,r=r+Math.imul(_,pe)|0,i=(i=i+Math.imul(_,me)|0)+Math.imul(v,pe)|0,a=a+Math.imul(v,me)|0;var Oe=(l+(r=r+Math.imul(m,ge)|0)|0)+((8191&(i=(i=i+Math.imul(m,_e)|0)+Math.imul(h,ge)|0))<<13)|0;l=((a=a+Math.imul(h,_e)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,r=Math.imul(R,G),i=(i=Math.imul(R,ne))+Math.imul(z,G)|0,a=Math.imul(z,ne),r=r+Math.imul(F,K)|0,i=(i=i+Math.imul(F,q)|0)+Math.imul(I,K)|0,a=a+Math.imul(I,q)|0,r=r+Math.imul(M,ie)|0,i=(i=i+Math.imul(M,ae)|0)+Math.imul(N,ie)|0,a=a+Math.imul(N,ae)|0,r=r+Math.imul(k,Y)|0,i=(i=i+Math.imul(k,X)|0)+Math.imul(A,Y)|0,a=a+Math.imul(A,X)|0,r=r+Math.imul(E,ce)|0,i=(i=i+Math.imul(E,Z)|0)+Math.imul(D,ce)|0,a=a+Math.imul(D,Z)|0,r=r+Math.imul(C,ue)|0,i=(i=i+Math.imul(C,de)|0)+Math.imul(w,ue)|0,a=a+Math.imul(w,de)|0,r=r+Math.imul(b,pe)|0,i=(i=i+Math.imul(b,me)|0)+Math.imul(x,pe)|0,a=a+Math.imul(x,me)|0;var ke=(l+(r=r+Math.imul(_,ge)|0)|0)+((8191&(i=(i=i+Math.imul(_,_e)|0)+Math.imul(v,ge)|0))<<13)|0;l=((a=a+Math.imul(v,_e)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,r=Math.imul(R,K),i=(i=Math.imul(R,q))+Math.imul(z,K)|0,a=Math.imul(z,q),r=r+Math.imul(F,ie)|0,i=(i=i+Math.imul(F,ae)|0)+Math.imul(I,ie)|0,a=a+Math.imul(I,ae)|0,r=r+Math.imul(M,Y)|0,i=(i=i+Math.imul(M,X)|0)+Math.imul(N,Y)|0,a=a+Math.imul(N,X)|0,r=r+Math.imul(k,ce)|0,i=(i=i+Math.imul(k,Z)|0)+Math.imul(A,ce)|0,a=a+Math.imul(A,Z)|0,r=r+Math.imul(E,ue)|0,i=(i=i+Math.imul(E,de)|0)+Math.imul(D,ue)|0,a=a+Math.imul(D,de)|0,r=r+Math.imul(C,pe)|0,i=(i=i+Math.imul(C,me)|0)+Math.imul(w,pe)|0,a=a+Math.imul(w,me)|0;var Ae=(l+(r=r+Math.imul(b,ge)|0)|0)+((8191&(i=(i=i+Math.imul(b,_e)|0)+Math.imul(x,ge)|0))<<13)|0;l=((a=a+Math.imul(x,_e)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,r=Math.imul(R,ie),i=(i=Math.imul(R,ae))+Math.imul(z,ie)|0,a=Math.imul(z,ae),r=r+Math.imul(F,Y)|0,i=(i=i+Math.imul(F,X)|0)+Math.imul(I,Y)|0,a=a+Math.imul(I,X)|0,r=r+Math.imul(M,ce)|0,i=(i=i+Math.imul(M,Z)|0)+Math.imul(N,ce)|0,a=a+Math.imul(N,Z)|0,r=r+Math.imul(k,ue)|0,i=(i=i+Math.imul(k,de)|0)+Math.imul(A,ue)|0,a=a+Math.imul(A,de)|0,r=r+Math.imul(E,pe)|0,i=(i=i+Math.imul(E,me)|0)+Math.imul(D,pe)|0,a=a+Math.imul(D,me)|0;var je=(l+(r=r+Math.imul(C,ge)|0)|0)+((8191&(i=(i=i+Math.imul(C,_e)|0)+Math.imul(w,ge)|0))<<13)|0;l=((a=a+Math.imul(w,_e)|0)+(i>>>13)|0)+(je>>>26)|0,je&=67108863,r=Math.imul(R,Y),i=(i=Math.imul(R,X))+Math.imul(z,Y)|0,a=Math.imul(z,X),r=r+Math.imul(F,ce)|0,i=(i=i+Math.imul(F,Z)|0)+Math.imul(I,ce)|0,a=a+Math.imul(I,Z)|0,r=r+Math.imul(M,ue)|0,i=(i=i+Math.imul(M,de)|0)+Math.imul(N,ue)|0,a=a+Math.imul(N,de)|0,r=r+Math.imul(k,pe)|0,i=(i=i+Math.imul(k,me)|0)+Math.imul(A,pe)|0,a=a+Math.imul(A,me)|0;var Me=(l+(r=r+Math.imul(E,ge)|0)|0)+((8191&(i=(i=i+Math.imul(E,_e)|0)+Math.imul(D,ge)|0))<<13)|0;l=((a=a+Math.imul(D,_e)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,r=Math.imul(R,ce),i=(i=Math.imul(R,Z))+Math.imul(z,ce)|0,a=Math.imul(z,Z),r=r+Math.imul(F,ue)|0,i=(i=i+Math.imul(F,de)|0)+Math.imul(I,ue)|0,a=a+Math.imul(I,de)|0,r=r+Math.imul(M,pe)|0,i=(i=i+Math.imul(M,me)|0)+Math.imul(N,pe)|0,a=a+Math.imul(N,me)|0;var Ne=(l+(r=r+Math.imul(k,ge)|0)|0)+((8191&(i=(i=i+Math.imul(k,_e)|0)+Math.imul(A,ge)|0))<<13)|0;l=((a=a+Math.imul(A,_e)|0)+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,r=Math.imul(R,ue),i=(i=Math.imul(R,de))+Math.imul(z,ue)|0,a=Math.imul(z,de),r=r+Math.imul(F,pe)|0,i=(i=i+Math.imul(F,me)|0)+Math.imul(I,pe)|0,a=a+Math.imul(I,me)|0;var Pe=(l+(r=r+Math.imul(M,ge)|0)|0)+((8191&(i=(i=i+Math.imul(M,_e)|0)+Math.imul(N,ge)|0))<<13)|0;l=((a=a+Math.imul(N,_e)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,r=Math.imul(R,pe),i=(i=Math.imul(R,me))+Math.imul(z,pe)|0,a=Math.imul(z,me);var Fe=(l+(r=r+Math.imul(F,ge)|0)|0)+((8191&(i=(i=i+Math.imul(F,_e)|0)+Math.imul(I,ge)|0))<<13)|0;l=((a=a+Math.imul(I,_e)|0)+(i>>>13)|0)+(Fe>>>26)|0,Fe&=67108863;var Ie=(l+(r=Math.imul(R,ge))|0)+((8191&(i=(i=Math.imul(R,_e))+Math.imul(z,ge)|0))<<13)|0;return l=((a=Math.imul(z,_e))+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,c[0]=ve,c[1]=ye,c[2]=be,c[3]=xe,c[4]=Se,c[5]=Ce,c[6]=we,c[7]=Te,c[8]=Ee,c[9]=De,c[10]=Oe,c[11]=ke,c[12]=Ae,c[13]=je,c[14]=Me,c[15]=Ne,c[16]=Pe,c[17]=Fe,c[18]=Ie,l!==0&&(c[19]=l,n.length++),n};function _(e,t,n){n.negative=t.negative^e.negative,n.length=e.length+t.length;for(var r=0,i=0,a=0;a>>26)|0)>>>26,o&=67108863}n.words[a]=s,r=o,o=i}return r===0?n.length--:n.words[a]=r,n._strip()}function v(e,t,n){return _(e,t,n)}function y(e,t){this.x=e,this.y=t}Math.imul||(g=h),a.prototype.mulTo=function(e,t){var n=this.length+e.length;return this.length===10&&e.length===10?g(this,e,t):n<63?h(this,e,t):n<1024?_(this,e,t):v(this,e,t)},y.prototype.makeRBT=function(e){for(var t=Array(e),n=a.prototype._countBits(e)-1,r=0;r>=1;return r},y.prototype.permute=function(e,t,n,r,i,a){for(var o=0;o>>=1)i++;return 1<>>=13,n[2*o+1]=8191&a,a>>>=13;for(o=2*t;o>=26,n+=a/67108864|0,n+=o>>>26,this.words[i]=67108863&o}return n!==0&&(this.words[i]=n,this.length++),t?this.ineg():this},a.prototype.muln=function(e){return this.clone().imuln(e)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(e){var t=function(e){for(var t=Array(e.bitLength()),n=0;n>>i&1}return t}(e);if(t.length===0)return new a(1);for(var n=this,r=0;r=0);var t,n=e%26,i=(e-n)/26,a=67108863>>>26-n<<26-n;if(n!==0){var o=0;for(t=0;t>>26-n}o&&(this.words[t]=o,this.length++)}if(i!==0){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t=0),i=t?(t-t%26)/26:0;var a=e%26,o=Math.min((e-a)/26,this.length),s=67108863^67108863>>>a<o)for(this.length-=o,l=0;l=0&&(u!==0||l>=i);l--){var d=0|this.words[l];this.words[l]=u<<26-a|d>>>a,u=d&s}return c&&u!==0&&(c.words[c.length++]=u),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},a.prototype.ishrn=function(e,t,n){return r(this.negative===0),this.iushrn(e,t,n)},a.prototype.shln=function(e){return this.clone().ishln(e)},a.prototype.ushln=function(e){return this.clone().iushln(e)},a.prototype.shrn=function(e){return this.clone().ishrn(e)},a.prototype.ushrn=function(e){return this.clone().iushrn(e)},a.prototype.testn=function(e){r(typeof e==`number`&&e>=0);var t=e%26,n=(e-t)/26,i=1<=0);var t=e%26,n=(e-t)/26;if(r(this.negative===0,`imaskn works only with positive numbers`),this.length<=n)return this;if(t!==0&&n++,this.length=Math.min(n,this.length),t!==0){var i=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},a.prototype.isubn=function(e){if(r(typeof e==`number`),r(e<67108864),e<0)return this.iaddn(-e);if(this.negative!==0)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(c/67108864|0),this.words[i+n]=67108863&a}for(;i>26,this.words[i+n]=67108863&a;if(s===0)return this._strip();for(r(s===-1),s=0,i=0;i>26,this.words[i]=67108863&a;return this.negative=1,this._strip()},a.prototype._wordDiv=function(e,t){var n=(this.length,e.length),r=this.clone(),i=e,o=0|i.words[i.length-1];(n=26-this._countBits(o))!=0&&(i=i.ushln(n),r.iushln(n),o=0|i.words[i.length-1]);var s,c=r.length-i.length;if(t!==`mod`){(s=new a(null)).length=c+1,s.words=Array(s.length);for(var l=0;l=0;d--){var f=67108864*(0|r.words[i.length+d])+(0|r.words[i.length+d-1]);for(f=Math.min(f/o|0,67108863),r._ishlnsubmul(i,f,d);r.negative!==0;)f--,r.negative=0,r._ishlnsubmul(i,1,d),r.isZero()||(r.negative^=1);s&&(s.words[d]=f)}return s&&s._strip(),r._strip(),t!==`div`&&n!==0&&r.iushrn(n),{div:s||null,mod:r}},a.prototype.divmod=function(e,t,n){return r(!e.isZero()),this.isZero()?{div:new a(0),mod:new a(0)}:this.negative!==0&&e.negative===0?(s=this.neg().divmod(e,t),t!==`mod`&&(i=s.div.neg()),t!==`div`&&(o=s.mod.neg(),n&&o.negative!==0&&o.iadd(e)),{div:i,mod:o}):this.negative===0&&e.negative!==0?(s=this.divmod(e.neg(),t),t!==`mod`&&(i=s.div.neg()),{div:i,mod:s.mod}):(this.negative&e.negative)==0?e.length>this.length||this.cmp(e)<0?{div:new a(0),mod:this}:e.length===1?t===`div`?{div:this.divn(e.words[0]),mod:null}:t===`mod`?{div:null,mod:new a(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new a(this.modrn(e.words[0]))}:this._wordDiv(e,t):(s=this.neg().divmod(e.neg(),t),t!==`div`&&(o=s.mod.neg(),n&&o.negative!==0&&o.isub(e)),{div:s.div,mod:o});var i,o,s},a.prototype.div=function(e){return this.divmod(e,`div`,!1).div},a.prototype.mod=function(e){return this.divmod(e,`mod`,!1).mod},a.prototype.umod=function(e){return this.divmod(e,`mod`,!0).mod},a.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var n=t.div.negative===0?t.mod:t.mod.isub(e),r=e.ushrn(1),i=e.andln(1),a=n.cmp(r);return a<0||i===1&&a===0?t.div:t.div.negative===0?t.div.iaddn(1):t.div.isubn(1)},a.prototype.modrn=function(e){var t=e<0;t&&(e=-e),r(e<=67108863);for(var n=(1<<26)%e,i=0,a=this.length-1;a>=0;a--)i=(n*i+(0|this.words[a]))%e;return t?-i:i},a.prototype.modn=function(e){return this.modrn(e)},a.prototype.idivn=function(e){var t=e<0;t&&(e=-e),r(e<=67108863);for(var n=0,i=this.length-1;i>=0;i--){var a=(0|this.words[i])+67108864*n;this.words[i]=a/e|0,n=a%e}return this._strip(),t?this.ineg():this},a.prototype.divn=function(e){return this.clone().idivn(e)},a.prototype.egcd=function(e){r(e.negative===0),r(!e.isZero());var t=this,n=e.clone();t=t.negative===0?t.clone():t.umod(e);for(var i=new a(1),o=new a(0),s=new a(0),c=new a(1),l=0;t.isEven()&&n.isEven();)t.iushrn(1),n.iushrn(1),++l;for(var u=n.clone(),d=t.clone();!t.isZero();){for(var f=0,p=1;(t.words[0]&p)==0&&f<26;++f,p<<=1);if(f>0)for(t.iushrn(f);f-->0;)(i.isOdd()||o.isOdd())&&(i.iadd(u),o.isub(d)),i.iushrn(1),o.iushrn(1);for(var m=0,h=1;(n.words[0]&h)==0&&m<26;++m,h<<=1);if(m>0)for(n.iushrn(m);m-->0;)(s.isOdd()||c.isOdd())&&(s.iadd(u),c.isub(d)),s.iushrn(1),c.iushrn(1);t.cmp(n)>=0?(t.isub(n),i.isub(s),o.isub(c)):(n.isub(t),s.isub(i),c.isub(o))}return{a:s,b:c,gcd:n.iushln(l)}},a.prototype._invmp=function(e){r(e.negative===0),r(!e.isZero());var t=this,n=e.clone();t=t.negative===0?t.clone():t.umod(e);for(var i,o=new a(1),s=new a(0),c=n.clone();t.cmpn(1)>0&&n.cmpn(1)>0;){for(var l=0,u=1;(t.words[0]&u)==0&&l<26;++l,u<<=1);if(l>0)for(t.iushrn(l);l-->0;)o.isOdd()&&o.iadd(c),o.iushrn(1);for(var d=0,f=1;(n.words[0]&f)==0&&d<26;++d,f<<=1);if(d>0)for(n.iushrn(d);d-->0;)s.isOdd()&&s.iadd(c),s.iushrn(1);t.cmp(n)>=0?(t.isub(n),o.isub(s)):(n.isub(t),s.isub(o))}return(i=t.cmpn(1)===0?o:s).cmpn(0)<0&&i.iadd(e),i},a.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),n=e.clone();t.negative=0,n.negative=0;for(var r=0;t.isEven()&&n.isEven();r++)t.iushrn(1),n.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;n.isEven();)n.iushrn(1);var i=t.cmp(n);if(i<0){var a=t;t=n,n=a}else if(i===0||n.cmpn(1)===0)break;t.isub(n)}return n.iushln(r)},a.prototype.invm=function(e){return this.egcd(e).a.umod(e)},a.prototype.isEven=function(){return!(1&this.words[0])},a.prototype.isOdd=function(){return(1&this.words[0])==1},a.prototype.andln=function(e){return this.words[0]&e},a.prototype.bincn=function(e){r(typeof e==`number`);var t=e%26,n=(e-t)/26,i=1<>>26,s&=67108863,this.words[o]=s}return a!==0&&(this.words[o]=a,this.length++),this},a.prototype.isZero=function(){return this.length===1&&this.words[0]===0},a.prototype.cmpn=function(e){var t,n=e<0;if(this.negative!==0&&!n)return-1;if(this.negative===0&&n)return 1;if(this._strip(),this.length>1)t=1;else{n&&(e=-e),r(e<=67108863,`Number is too big`);var i=0|this.words[0];t=i===e?0:ie.length)return 1;if(this.length=0;n--){var r=0|this.words[n],i=0|e.words[n];if(r!==i){ri&&(t=1);break}}return t},a.prototype.gtn=function(e){return this.cmpn(e)===1},a.prototype.gt=function(e){return this.cmp(e)===1},a.prototype.gten=function(e){return this.cmpn(e)>=0},a.prototype.gte=function(e){return this.cmp(e)>=0},a.prototype.ltn=function(e){return this.cmpn(e)===-1},a.prototype.lt=function(e){return this.cmp(e)===-1},a.prototype.lten=function(e){return this.cmpn(e)<=0},a.prototype.lte=function(e){return this.cmp(e)<=0},a.prototype.eqn=function(e){return this.cmpn(e)===0},a.prototype.eq=function(e){return this.cmp(e)===0},a.red=function(e){return new E(e)},a.prototype.toRed=function(e){return r(!this.red,`Already a number in reduction context`),r(this.negative===0,`red works only with positives`),e.convertTo(this)._forceRed(e)},a.prototype.fromRed=function(){return r(this.red,`fromRed works only with numbers in reduction context`),this.red.convertFrom(this)},a.prototype._forceRed=function(e){return this.red=e,this},a.prototype.forceRed=function(e){return r(!this.red,`Already a number in reduction context`),this._forceRed(e)},a.prototype.redAdd=function(e){return r(this.red,`redAdd works only with red numbers`),this.red.add(this,e)},a.prototype.redIAdd=function(e){return r(this.red,`redIAdd works only with red numbers`),this.red.iadd(this,e)},a.prototype.redSub=function(e){return r(this.red,`redSub works only with red numbers`),this.red.sub(this,e)},a.prototype.redISub=function(e){return r(this.red,`redISub works only with red numbers`),this.red.isub(this,e)},a.prototype.redShl=function(e){return r(this.red,`redShl works only with red numbers`),this.red.shl(this,e)},a.prototype.redMul=function(e){return r(this.red,`redMul works only with red numbers`),this.red._verify2(this,e),this.red.mul(this,e)},a.prototype.redIMul=function(e){return r(this.red,`redMul works only with red numbers`),this.red._verify2(this,e),this.red.imul(this,e)},a.prototype.redSqr=function(){return r(this.red,`redSqr works only with red numbers`),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return r(this.red,`redISqr works only with red numbers`),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return r(this.red,`redSqrt works only with red numbers`),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return r(this.red,`redInvm works only with red numbers`),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return r(this.red,`redNeg works only with red numbers`),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(e){return r(this.red&&!e.red,`redPow(normalNum)`),this.red._verify1(this),this.red.pow(this,e)};var b={k256:null,p224:null,p192:null,p25519:null};function x(e,t){this.name=e,this.p=new a(t,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function S(){x.call(this,`k256`,`ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f`)}function C(){x.call(this,`p224`,`ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001`)}function w(){x.call(this,`p192`,`ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff`)}function T(){x.call(this,`25519`,`7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed`)}function E(e){if(typeof e==`string`){var t=a._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),`modulus must be greater than 1`),this.m=e,this.prime=null}function D(e){E.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new a(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}x.prototype._tmp=function(){var e=new a(null);return e.words=Array(Math.ceil(this.n/13)),e},x.prototype.ireduce=function(e){var t,n=e;do this.split(n,this.tmp),t=(n=(n=this.imulK(n)).iadd(this.tmp)).bitLength();while(t>this.n);var r=t0?n.isub(this.p):n.strip===void 0?n._strip():n.strip(),n},x.prototype.split=function(e,t){e.iushrn(this.n,0,t)},x.prototype.imulK=function(e){return e.imul(this.k)},i(S,x),S.prototype.split=function(e,t){for(var n=Math.min(e.length,9),r=0;r>>22,i=a}i>>>=22,e.words[r-10]=i,i===0&&e.length>10?e.length-=10:e.length-=9},S.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,n=0;n>>=26,e.words[n]=i,t=r}return t!==0&&(e.words[e.length++]=t),e},a._prime=function(e){if(b[e])return b[e];var t;if(e===`k256`)t=new S;else if(e===`p224`)t=new C;else if(e===`p192`)t=new w;else{if(e!==`p25519`)throw Error(`Unknown prime `+e);t=new T}return b[e]=t,t},E.prototype._verify1=function(e){r(e.negative===0,`red works only with positives`),r(e.red,`red works only with red numbers`)},E.prototype._verify2=function(e,t){r((e.negative|t.negative)==0,`red works only with positives`),r(e.red&&e.red===t.red,`red works only with red numbers`)},E.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(u(e,e.umod(this.m)._forceRed(this)),e)},E.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},E.prototype.add=function(e,t){this._verify2(e,t);var n=e.add(t);return n.cmp(this.m)>=0&&n.isub(this.m),n._forceRed(this)},E.prototype.iadd=function(e,t){this._verify2(e,t);var n=e.iadd(t);return n.cmp(this.m)>=0&&n.isub(this.m),n},E.prototype.sub=function(e,t){this._verify2(e,t);var n=e.sub(t);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},E.prototype.isub=function(e,t){this._verify2(e,t);var n=e.isub(t);return n.cmpn(0)<0&&n.iadd(this.m),n},E.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},E.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},E.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},E.prototype.isqr=function(e){return this.imul(e,e.clone())},E.prototype.sqr=function(e){return this.mul(e,e)},E.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2==1),t===3){var n=this.m.add(new a(1)).iushrn(2);return this.pow(e,n)}for(var i=this.m.subn(1),o=0;!i.isZero()&&i.andln(1)===0;)o++,i.iushrn(1);r(!i.isZero());var s=new a(1).toRed(this),c=s.redNeg(),l=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new a(2*u*u).toRed(this);this.pow(u,l).cmp(c)!==0;)u.redIAdd(c);for(var d=this.pow(u,i),f=this.pow(e,i.addn(1).iushrn(1)),p=this.pow(e,i),m=o;p.cmp(s)!==0;){for(var h=p,g=0;h.cmp(s)!==0;g++)h=h.redSqr();r(g=0;r--){for(var l=t.words[r],u=c-1;u>=0;u--){var d=l>>u&1;i!==n[0]&&(i=this.sqr(i)),d!==0||o!==0?(o<<=1,o|=d,(++s===4||r===0&&u===0)&&(i=this.mul(i,n[o]),s=0,o=0)):s=0}c=26}return i},E.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},E.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},a.mont=function(e){return new D(e)},i(D,E),D.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},D.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},D.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var n=e.imul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},D.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new a(0)._forceRed(this);var n=e.mul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},D.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}})(t===void 0||t)},{buffer:188}],187:[function(e,t,n){var r;function i(e){this.rand=e}if(t.exports=function(e){return r||(r=new i(null)),r.generate(e)},t.exports.Rand=i,i.prototype.generate=function(e){return this._rand(e)},i.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),n=0;n>>24]^u[m>>>16&255]^d[h>>>8&255]^f[255&g]^t[_++],o=l[m>>>24]^u[h>>>16&255]^d[g>>>8&255]^f[255&p]^t[_++],s=l[h>>>24]^u[g>>>16&255]^d[p>>>8&255]^f[255&m]^t[_++],c=l[g>>>24]^u[p>>>16&255]^d[m>>>8&255]^f[255&h]^t[_++],p=a,m=o,h=s,g=c;return a=(r[p>>>24]<<24|r[m>>>16&255]<<16|r[h>>>8&255]<<8|r[255&g])^t[_++],o=(r[m>>>24]<<24|r[h>>>16&255]<<16|r[g>>>8&255]<<8|r[255&p])^t[_++],s=(r[h>>>24]<<24|r[g>>>16&255]<<16|r[p>>>8&255]<<8|r[255&m])^t[_++],c=(r[g>>>24]<<24|r[p>>>16&255]<<16|r[m>>>8&255]<<8|r[255&h])^t[_++],[a>>>=0,o>>>=0,s>>>=0,c>>>=0]}var s=[0,1,2,4,8,16,32,64,128,27,54],c=function(){for(var e=Array(256),t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;for(var n=[],r=[],i=[[],[],[],[]],a=[[],[],[],[]],o=0,s=0,c=0;c<256;++c){var l=s^s<<1^s<<2^s<<3^s<<4;l=l>>>8^255&l^99,n[o]=l,r[l]=o;var u=e[o],d=e[u],f=e[d],p=257*e[l]^16843008*l;i[0][o]=p<<24|p>>>8,i[1][o]=p<<16|p>>>16,i[2][o]=p<<8|p>>>24,i[3][o]=p,p=16843009*f^65537*d^257*u^16843008*o,a[0][l]=p<<24|p>>>8,a[1][l]=p<<16|p>>>16,a[2][l]=p<<8|p>>>24,a[3][l]=p,o===0?o=s=1:(o=u^e[e[e[f^u]]],s^=e[e[s]])}return{SBOX:n,INV_SBOX:r,SUB_MIX:i,INV_SUB_MIX:a}}();function l(e){this._key=i(e),this._reset()}l.blockSize=16,l.keySize=32,l.prototype.blockSize=l.blockSize,l.prototype.keySize=l.keySize,l.prototype._reset=function(){for(var e=this._key,t=e.length,n=t+6,r=4*(n+1),i=[],a=0;a>>24,o=c.SBOX[o>>>24]<<24|c.SBOX[o>>>16&255]<<16|c.SBOX[o>>>8&255]<<8|c.SBOX[255&o],o^=s[a/t|0]<<24):t>6&&a%t==4&&(o=c.SBOX[o>>>24]<<24|c.SBOX[o>>>16&255]<<16|c.SBOX[o>>>8&255]<<8|c.SBOX[255&o]),i[a]=i[a-t]^o}for(var l=[],u=0;u>>24]]^c.INV_SUB_MIX[1][c.SBOX[f>>>16&255]]^c.INV_SUB_MIX[2][c.SBOX[f>>>8&255]]^c.INV_SUB_MIX[3][c.SBOX[255&f]]}this._nRounds=n,this._keySchedule=i,this._invKeySchedule=l},l.prototype.encryptBlockRaw=function(e){return o(e=i(e),this._keySchedule,c.SUB_MIX,c.SBOX,this._nRounds)},l.prototype.encryptBlock=function(e){var t=this.encryptBlockRaw(e),n=r.allocUnsafe(16);return n.writeUInt32BE(t[0],0),n.writeUInt32BE(t[1],4),n.writeUInt32BE(t[2],8),n.writeUInt32BE(t[3],12),n},l.prototype.decryptBlock=function(e){var t=(e=i(e))[1];e[1]=e[3],e[3]=t;var n=o(e,this._invKeySchedule,c.INV_SUB_MIX,c.INV_SBOX,this._nRounds),a=r.allocUnsafe(16);return a.writeUInt32BE(n[0],0),a.writeUInt32BE(n[3],4),a.writeUInt32BE(n[2],8),a.writeUInt32BE(n[1],12),a},l.prototype.scrub=function(){a(this._keySchedule),a(this._invKeySchedule),a(this._key)},t.exports.AES=l},{"safe-buffer":494}],190:[function(e,t,n){var r=e(`./aes`),i=e(`safe-buffer`).Buffer,a=e(`cipher-base`),o=e(`inherits`),s=e(`./ghash`),c=e(`buffer-xor`),l=e(`./incr32`);function u(e,t,n,o){a.call(this);var c=i.alloc(4,0);this._cipher=new r.AES(t);var u=this._cipher.encryptBlock(c);this._ghash=new s(u),n=function(e,t,n){if(t.length===12)return e._finID=i.concat([t,i.from([0,0,0,1])]),i.concat([t,i.from([0,0,0,2])]);var r=new s(n),a=t.length,o=a%16;r.update(t),o&&(o=16-o,r.update(i.alloc(o,0))),r.update(i.alloc(8,0));var c=8*a,u=i.alloc(8);u.writeUIntBE(c,0,8),r.update(u),e._finID=r.state;var d=i.from(e._finID);return l(d),d}(this,n,u),this._prev=i.from(n),this._cache=i.allocUnsafe(0),this._secCache=i.allocUnsafe(0),this._decrypt=o,this._alen=0,this._len=0,this._mode=e,this._authTag=null,this._called=!1}o(u,a),u.prototype._update=function(e){if(!this._called&&this._alen){var t=16-this._alen%16;t<16&&(t=i.alloc(t,0),this._ghash.update(t))}this._called=!0;var n=this._mode.encrypt(this,e);return this._decrypt?this._ghash.update(e):this._ghash.update(n),this._len+=e.length,n},u.prototype._final=function(){if(this._decrypt&&!this._authTag)throw Error(`Unsupported state or unable to authenticate data`);var e=c(this._ghash.final(8*this._alen,8*this._len),this._cipher.encryptBlock(this._finID));if(this._decrypt&&function(e,t){var n=0;e.length!==t.length&&n++;for(var r=Math.min(e.length,t.length),i=0;i16)throw Error(`unable to decrypt data`);for(var n=-1;++n16)return t=this.cache.slice(0,16),this.cache=this.cache.slice(16),t}else if(this.cache.length>=16)return t=this.cache.slice(0,16),this.cache=this.cache.slice(16),t;return null},d.prototype.flush=function(){if(this.cache.length)return this.cache},n.createDecipher=function(e,t){var n=a[e.toLowerCase()];if(!n)throw TypeError(`invalid suite type`);var r=l(t,!1,n.key,n.iv);return f(e,r.key,r.iv)},n.createDecipheriv=f},{"./aes":189,"./authCipher":190,"./modes":202,"./streamCipher":205,"cipher-base":221,evp_bytestokey:423,inherits:440,"safe-buffer":494}],193:[function(e,t,n){var r=e(`./modes`),i=e(`./authCipher`),a=e(`safe-buffer`).Buffer,o=e(`./streamCipher`),s=e(`cipher-base`),c=e(`./aes`),l=e(`evp_bytestokey`);function u(e,t,n){s.call(this),this._cache=new f,this._cipher=new c.AES(t),this._prev=a.from(n),this._mode=e,this._autopadding=!0}e(`inherits`)(u,s),u.prototype._update=function(e){var t,n;this._cache.add(e);for(var r=[];t=this._cache.get();)n=this._mode.encrypt(this,t),r.push(n);return a.concat(r)};var d=a.alloc(16,16);function f(){this.cache=a.allocUnsafe(0)}function p(e,t,n){var s=r[e.toLowerCase()];if(!s)throw TypeError(`invalid suite type`);if(typeof t==`string`&&(t=a.from(t)),t.length!==s.key/8)throw TypeError(`invalid key length `+t.length);if(typeof n==`string`&&(n=a.from(n)),s.mode!==`GCM`&&n.length!==s.iv)throw TypeError(`invalid iv length `+n.length);return s.type===`stream`?new o(s.module,t,n):s.type===`auth`?new i(s.module,t,n):new u(s.module,t,n)}u.prototype._final=function(){var e=this._cache.flush();if(this._autopadding)return e=this._mode.encrypt(this,e),this._cipher.scrub(),e;if(!e.equals(d))throw this._cipher.scrub(),Error(`data not multiple of block length`)},u.prototype.setAutoPadding=function(e){return this._autopadding=!!e,this},f.prototype.add=function(e){this.cache=a.concat([this.cache,e])},f.prototype.get=function(){if(this.cache.length>15){var e=this.cache.slice(0,16);return this.cache=this.cache.slice(16),e}return null},f.prototype.flush=function(){for(var e=16-this.cache.length,t=a.allocUnsafe(e),n=-1;++n>>0,0),t.writeUInt32BE(e[1]>>>0,4),t.writeUInt32BE(e[2]>>>0,8),t.writeUInt32BE(e[3]>>>0,12),t}function o(e){this.h=e,this.state=r.alloc(16,0),this.cache=r.allocUnsafe(0)}o.prototype.ghash=function(e){for(var t=-1;++t0;t--)r[t]=r[t]>>>1|(1&r[t-1])<<31;r[0]>>>=1,n&&(r[0]^=225<<24)}this.state=a(i)},o.prototype.update=function(e){var t;for(this.cache=r.concat([this.cache,e]);this.cache.length>=16;)t=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(t)},o.prototype.final=function(e,t){return this.cache.length&&this.ghash(r.concat([this.cache,i],16)),this.ghash(a([0,e,0,t])),this.state},t.exports=o},{"safe-buffer":494}],195:[function(e,t,n){t.exports=function(e){for(var t,n=e.length;n--;){if((t=e.readUInt8(n))!==255){t++,e.writeUInt8(t,n);break}e.writeUInt8(0,n)}}},{}],196:[function(e,t,n){var r=e(`buffer-xor`);n.encrypt=function(e,t){var n=r(t,e._prev);return e._prev=e._cipher.encryptBlock(n),e._prev},n.decrypt=function(e,t){var n=e._prev;return e._prev=t,r(e._cipher.decryptBlock(t),n)}},{"buffer-xor":219}],197:[function(e,t,n){var r=e(`safe-buffer`).Buffer,i=e(`buffer-xor`);function a(e,t,n){var a=t.length,o=i(t,e._cache);return e._cache=e._cache.slice(a),e._prev=r.concat([e._prev,n?t:o]),o}n.encrypt=function(e,t,n){for(var i,o=r.allocUnsafe(0);t.length;){if(e._cache.length===0&&(e._cache=e._cipher.encryptBlock(e._prev),e._prev=r.allocUnsafe(0)),!(e._cache.length<=t.length)){o=r.concat([o,a(e,t,n)]);break}i=e._cache.length,o=r.concat([o,a(e,t.slice(0,i),n)]),t=t.slice(i)}return o}},{"buffer-xor":219,"safe-buffer":494}],198:[function(e,t,n){var r=e(`safe-buffer`).Buffer;function i(e,t,n){for(var r,i,o=-1,s=0;++o<8;)r=t&1<<7-o?128:0,s+=(128&(i=e._cipher.encryptBlock(e._prev)[0]^r))>>o%8,e._prev=a(e._prev,n?r:i);return s}function a(e,t){var n=e.length,i=-1,a=r.allocUnsafe(e.length);for(e=r.concat([e,r.from([t])]);++i>7;return a}n.encrypt=function(e,t,n){for(var a=t.length,o=r.allocUnsafe(a),s=-1;++s=0||!t.umod(e.prime1)||!t.umod(e.prime2));return t}function o(e,t){var i=function(e){var t=a(e);return{blinder:t.toRed(r.mont(e.modulus)).redPow(new r(e.publicExponent)).fromRed(),unblinder:t.invm(e.modulus)}}(t),o=t.modulus.byteLength(),s=new r(e).mul(i.blinder).umod(t.modulus),c=s.toRed(r.mont(t.prime1)),l=s.toRed(r.mont(t.prime2)),u=t.coefficient,d=t.prime1,f=t.prime2,p=c.redPow(t.exponent1).fromRed(),m=l.redPow(t.exponent2).fromRed(),h=p.isub(m).imul(u).umod(d).imul(f);return m.iadd(h).imul(i.unblinder).umod(t.modulus).toArrayLike(n,`be`,o)}o.getr=a,t.exports=o}).call(this)}).call(this,e(`buffer`).Buffer)},{"bn.js":186,buffer:220,randombytes:475}],210:[function(e,t,n){t.exports=e(`./browser/algorithms.json`)},{"./browser/algorithms.json":211}],211:[function(e,t,n){t.exports={sha224WithRSAEncryption:{sign:`rsa`,hash:`sha224`,id:`302d300d06096086480165030402040500041c`},"RSA-SHA224":{sign:`ecdsa/rsa`,hash:`sha224`,id:`302d300d06096086480165030402040500041c`},sha256WithRSAEncryption:{sign:`rsa`,hash:`sha256`,id:`3031300d060960864801650304020105000420`},"RSA-SHA256":{sign:`ecdsa/rsa`,hash:`sha256`,id:`3031300d060960864801650304020105000420`},sha384WithRSAEncryption:{sign:`rsa`,hash:`sha384`,id:`3041300d060960864801650304020205000430`},"RSA-SHA384":{sign:`ecdsa/rsa`,hash:`sha384`,id:`3041300d060960864801650304020205000430`},sha512WithRSAEncryption:{sign:`rsa`,hash:`sha512`,id:`3051300d060960864801650304020305000440`},"RSA-SHA512":{sign:`ecdsa/rsa`,hash:`sha512`,id:`3051300d060960864801650304020305000440`},"RSA-SHA1":{sign:`rsa`,hash:`sha1`,id:`3021300906052b0e03021a05000414`},"ecdsa-with-SHA1":{sign:`ecdsa`,hash:`sha1`,id:``},sha256:{sign:`ecdsa`,hash:`sha256`,id:``},sha224:{sign:`ecdsa`,hash:`sha224`,id:``},sha384:{sign:`ecdsa`,hash:`sha384`,id:``},sha512:{sign:`ecdsa`,hash:`sha512`,id:``},"DSA-SHA":{sign:`dsa`,hash:`sha1`,id:``},"DSA-SHA1":{sign:`dsa`,hash:`sha1`,id:``},DSA:{sign:`dsa`,hash:`sha1`,id:``},"DSA-WITH-SHA224":{sign:`dsa`,hash:`sha224`,id:``},"DSA-SHA224":{sign:`dsa`,hash:`sha224`,id:``},"DSA-WITH-SHA256":{sign:`dsa`,hash:`sha256`,id:``},"DSA-SHA256":{sign:`dsa`,hash:`sha256`,id:``},"DSA-WITH-SHA384":{sign:`dsa`,hash:`sha384`,id:``},"DSA-SHA384":{sign:`dsa`,hash:`sha384`,id:``},"DSA-WITH-SHA512":{sign:`dsa`,hash:`sha512`,id:``},"DSA-SHA512":{sign:`dsa`,hash:`sha512`,id:``},"DSA-RIPEMD160":{sign:`dsa`,hash:`rmd160`,id:``},ripemd160WithRSA:{sign:`rsa`,hash:`rmd160`,id:`3021300906052b2403020105000414`},"RSA-RIPEMD160":{sign:`rsa`,hash:`rmd160`,id:`3021300906052b2403020105000414`},md5WithRSAEncryption:{sign:`rsa`,hash:`md5`,id:`3020300c06082a864886f70d020505000410`},"RSA-MD5":{sign:`rsa`,hash:`md5`,id:`3020300c06082a864886f70d020505000410`}}},{}],212:[function(e,t,n){t.exports={"1.3.132.0.10":`secp256k1`,"1.3.132.0.33":`p224`,"1.2.840.10045.3.1.1":`p192`,"1.2.840.10045.3.1.7":`p256`,"1.3.132.0.34":`p384`,"1.3.132.0.35":`p521`}},{}],213:[function(e,t,n){var r=e(`safe-buffer`).Buffer,i=e(`create-hash`),a=e(`readable-stream`),o=e(`inherits`),s=e(`./sign`),c=e(`./verify`),l=e(`./algorithms.json`);function u(e){a.Writable.call(this);var t=l[e];if(!t)throw Error(`Unknown message digest`);this._hashType=t.hash,this._hash=i(t.hash),this._tag=t.id,this._signType=t.sign}function d(e){a.Writable.call(this);var t=l[e];if(!t)throw Error(`Unknown message digest`);this._hash=i(t.hash),this._tag=t.id,this._signType=t.sign}function f(e){return new u(e)}function p(e){return new d(e)}Object.keys(l).forEach((function(e){l[e].id=r.from(l[e].id,`hex`),l[e.toLowerCase()]=l[e]})),o(u,a.Writable),u.prototype._write=function(e,t,n){this._hash.update(e),n()},u.prototype.update=function(e,t){return typeof e==`string`&&(e=r.from(e,t)),this._hash.update(e),this},u.prototype.sign=function(e,t){this.end();var n=s(this._hash.digest(),e,this._hashType,this._signType,this._tag);return t?n.toString(t):n},o(d,a.Writable),d.prototype._write=function(e,t,n){this._hash.update(e),n()},d.prototype.update=function(e,t){return typeof e==`string`&&(e=r.from(e,t)),this._hash.update(e),this},d.prototype.verify=function(e,t,n){typeof t==`string`&&(t=r.from(t,n)),this.end();var i=this._hash.digest();return c(t,i,e,this._signType,this._tag)},t.exports={Sign:f,Verify:p,createSign:f,createVerify:p}},{"./algorithms.json":211,"./sign":214,"./verify":215,"create-hash":386,inherits:440,"readable-stream":491,"safe-buffer":494}],214:[function(e,t,n){var r=e(`safe-buffer`).Buffer,i=e(`create-hmac`),a=e(`browserify-rsa`),o=e(`elliptic`).ec,s=e(`bn.js`),c=e(`parse-asn1`),l=e(`./curves.json`);function u(e,t,n,a){if((e=r.from(e.toArray())).length0&&n.ishrn(r),n}function f(e,t,n){var a,o;do{for(a=r.alloc(0);8*a.length=t)throw Error(`invalid sig`)}t.exports=function(e,t,n,l,u){var d=o(n);if(d.type===`ec`){if(l!==`ecdsa`&&l!==`ecdsa/rsa`)throw Error(`wrong public key type`);return function(e,t,n){var r=s[n.data.algorithm.curve.join(`.`)];if(!r)throw Error(`unknown curve `+n.data.algorithm.curve.join(`.`));var i=new a(r),o=n.data.subjectPrivateKey.data;return i.verify(t,e,o)}(e,t,d)}if(d.type===`dsa`){if(l!==`dsa`)throw Error(`wrong public key type`);return function(e,t,n){var r=n.data.p,a=n.data.q,s=n.data.g,l=n.data.pub_key,u=o.signature.decode(e,`der`),d=u.s,f=u.r;c(d,a),c(f,a);var p=i.mont(r),m=d.invm(a);return s.toRed(p).redPow(new i(t).mul(m).mod(a)).fromRed().mul(l.toRed(p).redPow(f.mul(m).mod(a)).fromRed()).mod(r).mod(a).cmp(f)===0}(e,t,d)}if(l!==`rsa`&&l!==`ecdsa/rsa`)throw Error(`wrong public key type`);t=r.concat([u,t]);for(var f=d.modulus.byteLength(),p=[1],m=0;t.length+p.length+2>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function s(e){var t=this.lastTotal-this.lastNeed,n=function(e,t,n){if((192&t[0])!=128)return e.lastNeed=0,`�`;if(e.lastNeed>1&&t.length>1){if((192&t[1])!=128)return e.lastNeed=1,`�`;if(e.lastNeed>2&&t.length>2&&(192&t[2])!=128)return e.lastNeed=2,`�`}}(this,e);return n===void 0?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)):n}function c(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 l(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 u(e,t){var n=(e.length-t)%3;return n===0?e.toString(`base64`,t):(this.lastNeed=3-n,this.lastTotal=3,n===1?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 d(e){var t=e&&e.length?this.write(e):``;return this.lastNeed?t+this.lastChar.toString(`base64`,0,3-this.lastNeed):t}function f(e){return e.toString(this.encoding)}function p(e){return e&&e.length?this.write(e):``}n.StringDecoder=a,a.prototype.write=function(e){if(e.length===0)return``;var t,n;if(this.lastNeed){if((t=this.fillLast(e))===void 0)return``;n=this.lastNeed,this.lastNeed=0}else n=0;return n=0?(i>0&&(e.lastNeed=i-1),i):--r=0?(i>0&&(e.lastNeed=i-2),i):--r=0?(i>0&&(i===2?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)},a.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}},{"safe-buffer":217}],219:[function(e,t,n){(function(e){(function(){t.exports=function(t,n){for(var r=Math.min(t.length,n.length),i=new e(r),a=0;a2147483647)throw RangeError(`The value "`+e+`" is invalid for option "size"`);var t=new Uint8Array(e);return t.__proto__=a.prototype,t}function a(e,t,n){if(typeof e==`number`){if(typeof t==`string`)throw TypeError(`The "string" argument must be of type string. Received type number`);return c(e)}return o(e,t,n)}function o(e,t,n){if(typeof e==`string`)return function(e,t){if(typeof t==`string`&&t!==``||(t=`utf8`),!a.isEncoding(t))throw TypeError(`Unknown encoding: `+t);var n=0|d(e,t),r=i(n),o=r.write(e,t);return o!==n&&(r=r.slice(0,o)),r}(e,t);if(ArrayBuffer.isView(e))return l(e);if(e==null)throw TypeError(`The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type `+typeof e);if(R(e,ArrayBuffer)||e&&R(e.buffer,ArrayBuffer))return function(e,t,n){if(t<0||e.byteLength=2147483647)throw RangeError(`Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes`);return 0|e}function d(e,t){if(a.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||R(e,ArrayBuffer))return e.byteLength;if(typeof e!=`string`)throw TypeError(`The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type `+typeof e);var n=e.length,r=arguments.length>2&&!0===arguments[2];if(!r&&n===0)return 0;for(var i=!1;;)switch(t){case`ascii`:case`latin1`:case`binary`:return n;case`utf8`:case`utf-8`:return F(e).length;case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return 2*n;case`hex`:return n>>>1;case`base64`:return I(e).length;default:if(i)return r?-1:F(e).length;t=(``+t).toLowerCase(),i=!0}}function f(e,t,n){var r=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((n===void 0||n>this.length)&&(n=this.length),n<=0)||(n>>>=0)<=(t>>>=0))return``;for(e||(e=`utf8`);;)switch(e){case`hex`:return E(this,t,n);case`utf8`:case`utf-8`:return C(this,t,n);case`ascii`:return w(this,t,n);case`latin1`:case`binary`:return T(this,t,n);case`base64`:return S(this,t,n);case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return D(this,t,n);default:if(r)throw TypeError(`Unknown encoding: `+e);e=(e+``).toLowerCase(),r=!0}}function p(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function m(e,t,n,r,i){if(e.length===0)return-1;if(typeof n==`string`?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),z(n=+n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if(typeof t==`string`&&(t=a.from(t,r)),a.isBuffer(t))return t.length===0?-1:h(e,t,n,r,i);if(typeof t==`number`)return t&=255,typeof Uint8Array.prototype.indexOf==`function`?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):h(e,[t],n,r,i);throw TypeError(`val must be string, number or Buffer`)}function h(e,t,n,r,i){var a,o=1,s=e.length,c=t.length;if(r!==void 0&&((r=String(r).toLowerCase())===`ucs2`||r===`ucs-2`||r===`utf16le`||r===`utf-16le`)){if(e.length<2||t.length<2)return-1;o=2,s/=2,c/=2,n/=2}function l(e,t){return o===1?e[t]:e.readUInt16BE(t*o)}if(i){var u=-1;for(a=n;as&&(n=s-c),a=n;a>=0;a--){for(var d=!0,f=0;fi&&(r=i):r=i;var a=t.length;r>a/2&&(r=a/2);for(var o=0;o>8,i=n%256,a.push(i),a.push(r);return a}(t,e.length-n),e,n,r)}function S(e,n,r){return n===0&&r===e.length?t.fromByteArray(e):t.fromByteArray(e.slice(n,r))}function C(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i239?4:l>223?3:l>191?2:1;if(i+d<=n)switch(d){case 1:l<128&&(u=l);break;case 2:(192&(a=e[i+1]))==128&&(c=(31&l)<<6|63&a)>127&&(u=c);break;case 3:a=e[i+1],o=e[i+2],(192&a)==128&&(192&o)==128&&(c=(15&l)<<12|(63&a)<<6|63&o)>2047&&(c<55296||c>57343)&&(u=c);break;case 4:a=e[i+1],o=e[i+2],s=e[i+3],(192&a)==128&&(192&o)==128&&(192&s)==128&&(c=(15&l)<<18|(63&a)<<12|(63&o)<<6|63&s)>65535&&c<1114112&&(u=c)}u===null?(u=65533,d=1):u>65535&&(u-=65536,r.push(u>>>10&1023|55296),u=56320|1023&u),r.push(u),i+=d}return function(e){var t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);for(var n=``,r=0;r`u`||typeof console.error!=`function`||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}}),typeof Symbol<`u`&&Symbol.species!=null&&a[Symbol.species]===a&&Object.defineProperty(a,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),a.poolSize=8192,a.from=function(e,t,n){return o(e,t,n)},a.prototype.__proto__=Uint8Array.prototype,a.__proto__=Uint8Array,a.alloc=function(e,t,n){return function(e,t,n){return s(e),e<=0||t===void 0?i(e):typeof n==`string`?i(e).fill(t,n):i(e).fill(t)}(e,t,n)},a.allocUnsafe=function(e){return c(e)},a.allocUnsafeSlow=function(e){return c(e)},a.isBuffer=function(e){return e!=null&&!0===e._isBuffer&&e!==a.prototype},a.compare=function(e,t){if(R(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),R(t,Uint8Array)&&(t=a.from(t,t.offset,t.byteLength)),!a.isBuffer(e)||!a.isBuffer(t))throw TypeError(`The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array`);if(e===t)return 0;for(var n=e.length,r=t.length,i=0,o=Math.min(n,r);it&&(e+=` ... `),``},a.prototype.compare=function(e,t,n,r,i){if(R(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),!a.isBuffer(e))throw TypeError(`The "target" argument must be one of type Buffer or Uint8Array. Received type `+typeof e);if(t===void 0&&(t=0),n===void 0&&(n=e?e.length:0),r===void 0&&(r=0),i===void 0&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw RangeError(`out of range index`);if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(r>>>=0),s=(n>>>=0)-(t>>>=0),c=Math.min(o,s),l=this.slice(r,i),u=e.slice(t,n),d=0;d>>=0,isFinite(n)?(n>>>=0,r===void 0&&(r=`utf8`)):(r=n,n=void 0)}var i=this.length-t;if((n===void 0||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw RangeError(`Attempt to write outside buffer bounds`);r||(r=`utf8`);for(var a=!1;;)switch(r){case`hex`:return g(this,e,t,n);case`utf8`:case`utf-8`:return _(this,e,t,n);case`ascii`:return v(this,e,t,n);case`latin1`:case`binary`:return y(this,e,t,n);case`base64`:return b(this,e,t,n);case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return x(this,e,t,n);default:if(a)throw TypeError(`Unknown encoding: `+r);r=(``+r).toLowerCase(),a=!0}},a.prototype.toJSON=function(){return{type:`Buffer`,data:Array.prototype.slice.call(this._arr||this,0)}};function w(e,t,n){var r=``;n=Math.min(e.length,n);for(var i=t;ir)&&(n=r);for(var i=``,a=t;an)throw RangeError(`Trying to access beyond buffer length`)}function k(e,t,n,r,i,o){if(!a.isBuffer(e))throw TypeError(`"buffer" argument must be a Buffer instance`);if(t>i||te.length)throw RangeError(`Index out of range`)}function A(e,t,n,r,i,a){if(n+r>e.length||n<0)throw RangeError(`Index out of range`)}function j(e,t,n,i,a){return t=+t,n>>>=0,a||A(e,0,n,4),r.write(e,t,n,i,23,4),n+4}function M(e,t,n,i,a){return t=+t,n>>>=0,a||A(e,0,n,8),r.write(e,t,n,i,52,8),n+8}a.prototype.slice=function(e,t){var n=this.length;(e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=t===void 0?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t>>=0,t>>>=0,n||O(e,t,this.length);for(var r=this[e],i=1,a=0;++a>>=0,t>>>=0,n||O(e,t,this.length);for(var r=this[e+--t],i=1;t>0&&(i*=256);)r+=this[e+--t]*i;return r},a.prototype.readUInt8=function(e,t){return e>>>=0,t||O(e,1,this.length),this[e]},a.prototype.readUInt16LE=function(e,t){return e>>>=0,t||O(e,2,this.length),this[e]|this[e+1]<<8},a.prototype.readUInt16BE=function(e,t){return e>>>=0,t||O(e,2,this.length),this[e]<<8|this[e+1]},a.prototype.readUInt32LE=function(e,t){return e>>>=0,t||O(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},a.prototype.readUInt32BE=function(e,t){return e>>>=0,t||O(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},a.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||O(e,t,this.length);for(var r=this[e],i=1,a=0;++a=(i*=128)&&(r-=2**(8*t)),r},a.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||O(e,t,this.length);for(var r=t,i=1,a=this[e+--r];r>0&&(i*=256);)a+=this[e+--r]*i;return a>=(i*=128)&&(a-=2**(8*t)),a},a.prototype.readInt8=function(e,t){return e>>>=0,t||O(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},a.prototype.readInt16LE=function(e,t){e>>>=0,t||O(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},a.prototype.readInt16BE=function(e,t){e>>>=0,t||O(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},a.prototype.readInt32LE=function(e,t){return e>>>=0,t||O(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},a.prototype.readInt32BE=function(e,t){return e>>>=0,t||O(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},a.prototype.readFloatLE=function(e,t){return e>>>=0,t||O(e,4,this.length),r.read(this,e,!0,23,4)},a.prototype.readFloatBE=function(e,t){return e>>>=0,t||O(e,4,this.length),r.read(this,e,!1,23,4)},a.prototype.readDoubleLE=function(e,t){return e>>>=0,t||O(e,8,this.length),r.read(this,e,!0,52,8)},a.prototype.readDoubleBE=function(e,t){return e>>>=0,t||O(e,8,this.length),r.read(this,e,!1,52,8)},a.prototype.writeUIntLE=function(e,t,n,r){e=+e,t>>>=0,n>>>=0,r||k(this,e,t,n,2**(8*n)-1,0);var i=1,a=0;for(this[t]=255&e;++a>>=0,n>>>=0,r||k(this,e,t,n,2**(8*n)-1,0);var i=n-1,a=1;for(this[t+i]=255&e;--i>=0&&(a*=256);)this[t+i]=e/a&255;return t+n},a.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||k(this,e,t,1,255,0),this[t]=255&e,t+1},a.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||k(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},a.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||k(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},a.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||k(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},a.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||k(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},a.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){var i=2**(8*n-1);k(this,e,t,n,i-1,-i)}var a=0,o=1,s=0;for(this[t]=255&e;++a>0)-s&255;return t+n},a.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t>>>=0,!r){var i=2**(8*n-1);k(this,e,t,n,i-1,-i)}var a=n-1,o=1,s=0;for(this[t+a]=255&e;--a>=0&&(o*=256);)e<0&&s===0&&this[t+a+1]!==0&&(s=1),this[t+a]=(e/o>>0)-s&255;return t+n},a.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||k(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},a.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||k(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},a.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||k(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},a.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||k(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},a.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||k(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},a.prototype.writeFloatLE=function(e,t,n){return j(this,e,t,!0,n)},a.prototype.writeFloatBE=function(e,t,n){return j(this,e,t,!1,n)},a.prototype.writeDoubleLE=function(e,t,n){return M(this,e,t,!0,n)},a.prototype.writeDoubleBE=function(e,t,n){return M(this,e,t,!1,n)},a.prototype.copy=function(e,t,n,r){if(!a.isBuffer(e))throw TypeError(`argument should be a Buffer`);if(n||(n=0),r||r===0||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw RangeError(`Index out of range`);if(r<0)throw RangeError(`sourceEnd out of bounds`);r>this.length&&(r=this.length),e.length-t=0;--o)e[o+t]=this[o+n];else Uint8Array.prototype.set.call(e,this.subarray(n,r),t);return i},a.prototype.fill=function(e,t,n,r){if(typeof e==`string`){if(typeof t==`string`?(r=t,t=0,n=this.length):typeof n==`string`&&(r=n,n=this.length),r!==void 0&&typeof r!=`string`)throw TypeError(`encoding must be a string`);if(typeof r==`string`&&!a.isEncoding(r))throw TypeError(`Unknown encoding: `+r);if(e.length===1){var i=e.charCodeAt(0);(r===`utf8`&&i<128||r===`latin1`)&&(e=i)}}else typeof e==`number`&&(e&=255);if(t<0||this.length>>=0,n=n===void 0?this.length:n>>>0,e||(e=0),typeof e==`number`)for(o=t;o55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(o+1===r){(t-=3)>-1&&a.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&a.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,n<128){if(--t<0)break;a.push(n)}else if(n<2048){if((t-=2)<0)break;a.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;a.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw Error(`Invalid code point`);if((t-=4)<0)break;a.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return a}function I(e){return t.toByteArray(function(e){if((e=(e=e.split(`=`)[0]).trim().replace(N,``)).length<2)return``;for(;e.length%4!=0;)e+=`=`;return e}(e))}function L(e,t,n,r){for(var i=0;i=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function R(e,t){return e instanceof t||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===t.name}function z(e){return e!=e}}).call(this)}).call(this,e(`buffer`).Buffer)},{"base64-js":185,buffer:220,ieee754:439}],221:[function(e,t,n){var r=e(`safe-buffer`).Buffer,i=e(`stream`).Transform,a=e(`string_decoder`).StringDecoder;function o(e){i.call(this),this.hashMode=typeof e==`string`,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}e(`inherits`)(o,i),o.prototype.update=function(e,t,n){typeof e==`string`&&(e=r.from(e,t));var i=this._update(e);return this.hashMode?this:(n&&(i=this._toString(i,n)),i)},o.prototype.setAutoPadding=function(){},o.prototype.getAuthTag=function(){throw Error(`trying to get auth tag in unsupported state`)},o.prototype.setAuthTag=function(){throw Error(`trying to set auth tag in unsupported state`)},o.prototype.setAAD=function(){throw Error(`trying to set aad in unsupported state`)},o.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)}},o.prototype._flush=function(e){var t;try{this.push(this.__final())}catch(e){t=e}e(t)},o.prototype._finalOrDigest=function(e){var t=this.__final()||r.alloc(0);return e&&(t=this._toString(t,e,!0)),t},o.prototype._toString=function(e,t,n){if(this._decoder||(this._decoder=new a(t),this._encoding=t),this._encoding!==t)throw Error(`can't switch encodings`);var r=this._decoder.write(e);return n&&(r+=this._decoder.end()),r},t.exports=o},{inherits:440,"safe-buffer":494,stream:505,string_decoder:218}],222:[function(e,t,n){var r=e(`../internals/is-callable`),i=e(`../internals/try-to-string`),a=TypeError;t.exports=function(e){if(r(e))return e;throw new a(i(e)+` is not a function`)}},{"../internals/is-callable":285,"../internals/try-to-string":349}],223:[function(e,t,n){var r=e(`../internals/is-constructor`),i=e(`../internals/try-to-string`),a=TypeError;t.exports=function(e){if(r(e))return e;throw new a(i(e)+` is not a constructor`)}},{"../internals/is-constructor":286,"../internals/try-to-string":349}],224:[function(e,t,n){var r=e(`../internals/is-callable`),i=String,a=TypeError;t.exports=function(e){if(typeof e==`object`||r(e))return e;throw new a(`Can't set `+i(e)+` as a prototype`)}},{"../internals/is-callable":285}],225:[function(e,t,n){var r=e(`../internals/well-known-symbol`),i=e(`../internals/object-create`),a=e(`../internals/object-define-property`).f,o=r(`unscopables`),s=Array.prototype;s[o]===void 0&&a(s,o,{configurable:!0,value:i(null)}),t.exports=function(e){s[o][e]=!0}},{"../internals/object-create":306,"../internals/object-define-property":308,"../internals/well-known-symbol":357}],226:[function(e,t,n){var r=e(`../internals/object-is-prototype-of`),i=TypeError;t.exports=function(e,t){if(r(t,e))return e;throw new i(`Incorrect invocation`)}},{"../internals/object-is-prototype-of":314}],227:[function(e,t,n){var r=e(`../internals/is-object`),i=String,a=TypeError;t.exports=function(e){if(r(e))return e;throw new a(i(e)+` is not an object`)}},{"../internals/is-object":289}],228:[function(e,t,n){var r=e(`../internals/to-indexed-object`),i=e(`../internals/to-absolute-index`),a=e(`../internals/length-of-array-like`),o=function(e){return function(t,n,o){var s,c=r(t),l=a(c),u=i(o,l);if(e&&n!=n){for(;l>u;)if((s=c[u++])!=s)return!0}else for(;l>u;u++)if((e||u in c)&&c[u]===n)return e||u||0;return!e&&-1}};t.exports={includes:o(!0),indexOf:o(!1)}},{"../internals/length-of-array-like":299,"../internals/to-absolute-index":340,"../internals/to-indexed-object":341}],229:[function(e,t,n){var r=e(`../internals/function-bind-context`),i=e(`../internals/function-uncurry-this`),a=e(`../internals/indexed-object`),o=e(`../internals/to-object`),s=e(`../internals/length-of-array-like`),c=e(`../internals/array-species-create`),l=i([].push),u=function(e){var t=e===1,n=e===2,i=e===3,u=e===4,d=e===6,f=e===7,p=e===5||d;return function(m,h,g,_){for(var v,y,b=o(m),x=a(b),S=r(h,g),C=s(x),w=0,T=_||c,E=t?T(m,C):n||f?T(m,0):void 0;C>w;w++)if((p||w in x)&&(y=S(v=x[w],w,b),e)){if(t)E[w]=y;else if(y)switch(e){case 3:return!0;case 5:return v;case 6:return w;case 2:l(E,v)}else switch(e){case 4:return!1;case 7:l(E,v)}}return d?-1:i||u?u:E}};t.exports={forEach:u(0),map:u(1),filter:u(2),some:u(3),every:u(4),find:u(5),findIndex:u(6),filterReject:u(7)}},{"../internals/array-species-create":233,"../internals/function-bind-context":262,"../internals/function-uncurry-this":268,"../internals/indexed-object":280,"../internals/length-of-array-like":299,"../internals/to-object":344}],230:[function(e,t,n){var r=e(`../internals/to-absolute-index`),i=e(`../internals/length-of-array-like`),a=e(`../internals/create-property`),o=Array,s=Math.max;t.exports=function(e,t,n){for(var c=i(e),l=r(t,c),u=r(n===void 0?c:n,c),d=o(s(u-l,0)),f=0;l0&&r[0]<4?1:+(r[0]+r[1])),!i&&o&&(!(r=o.match(/Edge\/(\d+)/))||r[1]>=74)&&(r=o.match(/Chrome\/(\d+)/))&&(i=+r[1]),t.exports=i},{"../internals/engine-user-agent":256,"../internals/global":274}],258:[function(e,t,n){t.exports=[`constructor`,`hasOwnProperty`,`isPrototypeOf`,`propertyIsEnumerable`,`toLocaleString`,`toString`,`valueOf`]},{}],259:[function(e,t,n){var r=e(`../internals/global`),i=e(`../internals/object-get-own-property-descriptor`).f,a=e(`../internals/create-non-enumerable-property`),o=e(`../internals/define-built-in`),s=e(`../internals/define-global-property`),c=e(`../internals/copy-constructor-properties`),l=e(`../internals/is-forced`);t.exports=function(e,t){var n,u,d,f,p,m=e.target,h=e.global,g=e.stat;if(n=h?r:g?r[m]||s(m,{}):(r[m]||{}).prototype)for(u in t){if(f=t[u],d=e.dontCallGetSet?(p=i(n,u))&&p.value:n[u],!l(h?u:m+(g?`.`:`#`)+u,e.forced)&&d!==void 0){if(typeof f==typeof d)continue;c(f,d)}(e.sham||d&&d.sham)&&a(f,`sham`,!0),o(n,u,f,e)}}},{"../internals/copy-constructor-properties":237,"../internals/create-non-enumerable-property":241,"../internals/define-built-in":245,"../internals/define-global-property":246,"../internals/global":274,"../internals/is-forced":287,"../internals/object-get-own-property-descriptor":309}],260:[function(e,t,n){t.exports=function(e){try{return!!e()}catch{return!0}}},{}],261:[function(e,t,n){var r=e(`../internals/function-bind-native`),i=Function.prototype,a=i.apply,o=i.call;t.exports=typeof Reflect==`object`&&Reflect.apply||(r?o.bind(a):function(){return o.apply(a,arguments)})},{"../internals/function-bind-native":263}],262:[function(e,t,n){var r=e(`../internals/function-uncurry-this-clause`),i=e(`../internals/a-callable`),a=e(`../internals/function-bind-native`),o=r(r.bind);t.exports=function(e,t){return i(e),t===void 0?e:a?o(e,t):function(){return e.apply(t,arguments)}}},{"../internals/a-callable":222,"../internals/function-bind-native":263,"../internals/function-uncurry-this-clause":267}],263:[function(e,t,n){t.exports=!e(`../internals/fails`)((function(){var e=function(){}.bind();return typeof e!=`function`||e.hasOwnProperty(`prototype`)}))},{"../internals/fails":260}],264:[function(e,t,n){var r=e(`../internals/function-bind-native`),i=Function.prototype.call;t.exports=r?i.bind(i):function(){return i.apply(i,arguments)}},{"../internals/function-bind-native":263}],265:[function(e,t,n){var r=e(`../internals/descriptors`),i=e(`../internals/has-own-property`),a=Function.prototype,o=r&&Object.getOwnPropertyDescriptor,s=i(a,`name`);t.exports={EXISTS:s,PROPER:s&&function(){}.name===`something`,CONFIGURABLE:s&&(!r||r&&o(a,`name`).configurable)}},{"../internals/descriptors":247,"../internals/has-own-property":275}],266:[function(e,t,n){var r=e(`../internals/function-uncurry-this`),i=e(`../internals/a-callable`);t.exports=function(e,t,n){try{return r(i(Object.getOwnPropertyDescriptor(e,t)[n]))}catch{}}},{"../internals/a-callable":222,"../internals/function-uncurry-this":268}],267:[function(e,t,n){var r=e(`../internals/classof-raw`),i=e(`../internals/function-uncurry-this`);t.exports=function(e){if(r(e)===`Function`)return i(e)}},{"../internals/classof-raw":235,"../internals/function-uncurry-this":268}],268:[function(e,t,n){var r=e(`../internals/function-bind-native`),i=Function.prototype,a=i.call,o=r&&i.bind.bind(a,a);t.exports=r?o:function(e){return function(){return a.apply(e,arguments)}}},{"../internals/function-bind-native":263}],269:[function(e,t,n){var r=e(`../internals/global`),i=e(`../internals/is-callable`),a=function(e){return i(e)?e:void 0};t.exports=function(e,t){return arguments.length<2?a(r[e]):r[e]&&r[e][t]}},{"../internals/global":274,"../internals/is-callable":285}],270:[function(e,t,n){var r=e(`../internals/classof`),i=e(`../internals/get-method`),a=e(`../internals/is-null-or-undefined`),o=e(`../internals/iterators`),s=e(`../internals/well-known-symbol`)(`iterator`);t.exports=function(e){if(!a(e))return i(e,s)||i(e,`@@iterator`)||o[r(e)]}},{"../internals/classof":236,"../internals/get-method":273,"../internals/is-null-or-undefined":288,"../internals/iterators":298,"../internals/well-known-symbol":357}],271:[function(e,t,n){var r=e(`../internals/function-call`),i=e(`../internals/a-callable`),a=e(`../internals/an-object`),o=e(`../internals/try-to-string`),s=e(`../internals/get-iterator-method`),c=TypeError;t.exports=function(e,t){var n=arguments.length<2?s(e):t;if(i(n))return a(r(n,e));throw new c(o(e)+` is not iterable`)}},{"../internals/a-callable":222,"../internals/an-object":227,"../internals/function-call":264,"../internals/get-iterator-method":270,"../internals/try-to-string":349}],272:[function(e,t,n){var r=e(`../internals/function-uncurry-this`),i=e(`../internals/is-array`),a=e(`../internals/is-callable`),o=e(`../internals/classof-raw`),s=e(`../internals/to-string`),c=r([].push);t.exports=function(e){if(a(e))return e;if(i(e)){for(var t=e.length,n=[],r=0;rv;v++)if((b=A(e[v]))&&l(h,b))return b;return new m(!1)}g=u(e,_)}for(x=T?e.next:g.next;!(S=i(x,g)).done;){try{b=A(S.value)}catch(e){f(g,`throw`,e)}if(typeof b==`object`&&b&&l(h,b))return b}return new m(!1)}},{"../internals/an-object":227,"../internals/function-bind-context":262,"../internals/function-call":264,"../internals/get-iterator":271,"../internals/get-iterator-method":270,"../internals/is-array-iterator-method":283,"../internals/iterator-close":294,"../internals/length-of-array-like":299,"../internals/object-is-prototype-of":314,"../internals/try-to-string":349}],294:[function(e,t,n){var r=e(`../internals/function-call`),i=e(`../internals/an-object`),a=e(`../internals/get-method`);t.exports=function(e,t,n){var o,s;i(e);try{if(!(o=a(e,`return`))){if(t===`throw`)throw n;return n}o=r(o,e)}catch(e){s=!0,o=e}if(t===`throw`)throw n;if(s)throw o;return i(o),n}},{"../internals/an-object":227,"../internals/function-call":264,"../internals/get-method":273}],295:[function(e,t,n){var r=e(`../internals/iterators-core`).IteratorPrototype,i=e(`../internals/object-create`),a=e(`../internals/create-property-descriptor`),o=e(`../internals/set-to-string-tag`),s=e(`../internals/iterators`),c=function(){return this};t.exports=function(e,t,n,l){var u=t+` Iterator`;return e.prototype=i(r,{next:a(+!l,n)}),o(e,u,!1,!0),s[u]=c,e}},{"../internals/create-property-descriptor":242,"../internals/iterators":298,"../internals/iterators-core":297,"../internals/object-create":306,"../internals/set-to-string-tag":331}],296:[function(e,t,n){var r=e(`../internals/export`),i=e(`../internals/function-call`),a=e(`../internals/is-pure`),o=e(`../internals/function-name`),s=e(`../internals/is-callable`),c=e(`../internals/iterator-create-constructor`),l=e(`../internals/object-get-prototype-of`),u=e(`../internals/object-set-prototype-of`),d=e(`../internals/set-to-string-tag`),f=e(`../internals/create-non-enumerable-property`),p=e(`../internals/define-built-in`),m=e(`../internals/well-known-symbol`),h=e(`../internals/iterators`),g=e(`../internals/iterators-core`),_=o.PROPER,v=o.CONFIGURABLE,y=g.IteratorPrototype,b=g.BUGGY_SAFARI_ITERATORS,x=m(`iterator`),S=function(){return this};t.exports=function(e,t,n,o,m,g,C){c(n,t,o);var w,T,E,D=function(e){if(e===m&&M)return M;if(!b&&e&&e in A)return A[e];switch(e){case`keys`:case`values`:case`entries`:return function(){return new n(this,e)}}return function(){return new n(this)}},O=t+` Iterator`,k=!1,A=e.prototype,j=A[x]||A[`@@iterator`]||m&&A[m],M=!b&&j||D(m),N=t===`Array`&&A.entries||j;if(N&&(w=l(N.call(new e)))!==Object.prototype&&w.next&&(a||l(w)===y||(u?u(w,y):s(w[x])||p(w,x,S)),d(w,O,!0,!0),a&&(h[O]=S)),_&&m===`values`&&j&&j.name!==`values`&&(!a&&v?f(A,`name`,`values`):(k=!0,M=function(){return i(j,this)})),m){if(T={values:D(`values`),keys:g?M:D(`keys`),entries:D(`entries`)},C)for(E in T)(b||k||!(E in A))&&p(A,E,T[E]);else r({target:t,proto:!0,forced:b||k},T)}return a&&!C||A[x]===M||p(A,x,M,{name:m}),h[t]=M,T}},{"../internals/create-non-enumerable-property":241,"../internals/define-built-in":245,"../internals/export":259,"../internals/function-call":264,"../internals/function-name":265,"../internals/is-callable":285,"../internals/is-pure":290,"../internals/iterator-create-constructor":295,"../internals/iterators":298,"../internals/iterators-core":297,"../internals/object-get-prototype-of":313,"../internals/object-set-prototype-of":318,"../internals/set-to-string-tag":331,"../internals/well-known-symbol":357}],297:[function(e,t,n){var r,i,a,o=e(`../internals/fails`),s=e(`../internals/is-callable`),c=e(`../internals/is-object`),l=e(`../internals/object-create`),u=e(`../internals/object-get-prototype-of`),d=e(`../internals/define-built-in`),f=e(`../internals/well-known-symbol`),p=e(`../internals/is-pure`),m=f(`iterator`),h=!1;[].keys&&(`next`in(a=[].keys())?(i=u(u(a)))!==Object.prototype&&(r=i):h=!0),!c(r)||o((function(){var e={};return r[m].call(e)!==e}))?r={}:p&&(r=l(r)),s(r[m])||d(r,m,(function(){return this})),t.exports={IteratorPrototype:r,BUGGY_SAFARI_ITERATORS:h}},{"../internals/define-built-in":245,"../internals/fails":260,"../internals/is-callable":285,"../internals/is-object":289,"../internals/is-pure":290,"../internals/object-create":306,"../internals/object-get-prototype-of":313,"../internals/well-known-symbol":357}],298:[function(e,t,n){arguments[4][276][0].apply(n,arguments)},{dup:276}],299:[function(e,t,n){var r=e(`../internals/to-length`);t.exports=function(e){return r(e.length)}},{"../internals/to-length":343}],300:[function(e,t,n){var r=e(`../internals/function-uncurry-this`),i=e(`../internals/fails`),a=e(`../internals/is-callable`),o=e(`../internals/has-own-property`),s=e(`../internals/descriptors`),c=e(`../internals/function-name`).CONFIGURABLE,l=e(`../internals/inspect-source`),u=e(`../internals/internal-state`),d=u.enforce,f=u.get,p=String,m=Object.defineProperty,h=r(``.slice),g=r(``.replace),_=r([].join),v=s&&!i((function(){return m((function(){}),`length`,{value:8}).length!==8})),y=String(String).split(`String`),b=t.exports=function(e,t,n){h(p(t),0,7)===`Symbol(`&&(t=`[`+g(p(t),/^Symbol\(([^)]*)\)/,`$1`)+`]`),n&&n.getter&&(t=`get `+t),n&&n.setter&&(t=`set `+t),(!o(e,`name`)||c&&e.name!==t)&&(s?m(e,`name`,{value:t,configurable:!0}):e.name=t),v&&n&&o(n,`arity`)&&e.length!==n.arity&&m(e,`length`,{value:n.arity});try{n&&o(n,`constructor`)&&n.constructor?s&&m(e,`prototype`,{writable:!1}):e.prototype&&(e.prototype=void 0)}catch{}var r=d(e);return o(r,`source`)||(r.source=_(y,typeof t==`string`?t:``)),e};Function.prototype.toString=b((function(){return a(this)&&f(this).source||l(this)}),`toString`)},{"../internals/descriptors":247,"../internals/fails":260,"../internals/function-name":265,"../internals/function-uncurry-this":268,"../internals/has-own-property":275,"../internals/inspect-source":281,"../internals/internal-state":282,"../internals/is-callable":285}],301:[function(e,t,n){var r=Math.ceil,i=Math.floor;t.exports=Math.trunc||function(e){var t=+e;return(t>0?i:r)(t)}},{}],302:[function(e,t,n){var r,i,a,o,s,c=e(`../internals/global`),l=e(`../internals/function-bind-context`),u=e(`../internals/object-get-own-property-descriptor`).f,d=e(`../internals/task`).set,f=e(`../internals/queue`),p=e(`../internals/engine-is-ios`),m=e(`../internals/engine-is-ios-pebble`),h=e(`../internals/engine-is-webos-webkit`),g=e(`../internals/engine-is-node`),_=c.MutationObserver||c.WebKitMutationObserver,v=c.document,y=c.process,b=c.Promise,x=u(c,`queueMicrotask`),S=x&&x.value;if(!S){var C=new f,w=function(){var e,t;for(g&&(e=y.domain)&&e.exit();t=C.get();)try{t()}catch(e){throw C.head&&r(),e}e&&e.enter()};p||g||h||!_||!v?!m&&b&&b.resolve?((o=b.resolve(void 0)).constructor=b,s=l(o.then,o),r=function(){s(w)}):g?r=function(){y.nextTick(w)}:(d=l(d,c),r=function(){d(w)}):(i=!0,a=v.createTextNode(``),new _(w).observe(a,{characterData:!0}),r=function(){a.data=i=!i}),S=function(e){C.head||r(),C.add(e)}}t.exports=S},{"../internals/engine-is-ios":253,"../internals/engine-is-ios-pebble":252,"../internals/engine-is-node":254,"../internals/engine-is-webos-webkit":255,"../internals/function-bind-context":262,"../internals/global":274,"../internals/object-get-own-property-descriptor":309,"../internals/queue":328,"../internals/task":339}],303:[function(e,t,n){var r=e(`../internals/a-callable`),i=TypeError,a=function(e){var t,n;this.promise=new e((function(e,r){if(t!==void 0||n!==void 0)throw new i(`Bad Promise constructor`);t=e,n=r})),this.resolve=r(t),this.reject=r(n)};t.exports.f=function(e){return new a(e)}},{"../internals/a-callable":222}],304:[function(e,t,n){var r=e(`../internals/is-regexp`),i=TypeError;t.exports=function(e){if(r(e))throw new i(`The method doesn't accept regular expressions`);return e}},{"../internals/is-regexp":291}],305:[function(e,t,n){var r=e(`../internals/descriptors`),i=e(`../internals/function-uncurry-this`),a=e(`../internals/function-call`),o=e(`../internals/fails`),s=e(`../internals/object-keys`),c=e(`../internals/object-get-own-property-symbols`),l=e(`../internals/object-property-is-enumerable`),u=e(`../internals/to-object`),d=e(`../internals/indexed-object`),f=Object.assign,p=Object.defineProperty,m=i([].concat);t.exports=!f||o((function(){if(r&&f({b:1},f(p({},`a`,{enumerable:!0,get:function(){p(this,`b`,{value:3,enumerable:!1})}}),{b:2})).b!==1)return!0;var e={},t={},n=Symbol(`assign detection`);return e[n]=7,`abcdefghijklmnopqrst`.split(``).forEach((function(e){t[e]=e})),f({},e)[n]!==7||s(f({},t)).join(``)!==`abcdefghijklmnopqrst`}))?function(e,t){for(var n=u(e),i=arguments.length,o=1,f=c.f,p=l.f;i>o;)for(var h,g=d(arguments[o++]),_=f?m(s(g),f(g)):s(g),v=_.length,y=0;v>y;)h=_[y++],r&&!a(p,g,h)||(n[h]=g[h]);return n}:f},{"../internals/descriptors":247,"../internals/fails":260,"../internals/function-call":264,"../internals/function-uncurry-this":268,"../internals/indexed-object":280,"../internals/object-get-own-property-symbols":312,"../internals/object-keys":316,"../internals/object-property-is-enumerable":317,"../internals/to-object":344}],306:[function(e,t,n){var r,i=e(`../internals/an-object`),a=e(`../internals/object-define-properties`),o=e(`../internals/enum-bug-keys`),s=e(`../internals/hidden-keys`),c=e(`../internals/html`),l=e(`../internals/document-create-element`),u=e(`../internals/shared-key`)(`IE_PROTO`),d=function(){},f=function(e){return`