@accounter/client
Version:
Accounter client application
2 lines • 22.4 kB
JavaScript
var{entries:e,setPrototypeOf:t,isFrozen:n,getPrototypeOf:r,getOwnPropertyDescriptor:i}=Object,{freeze:a,seal:o,create:s}=Object,{apply:c,construct:l}=typeof Reflect<`u`&&Reflect;a||=function(e){return e},o||=function(e){return e},c||=function(e,t){var n=[...arguments].slice(2);return e.apply(t,n)},l||=function(e){return new e(...[...arguments].slice(1))};var u=x(Array.prototype.forEach),d=x(Array.prototype.lastIndexOf),ee=x(Array.prototype.pop),f=x(Array.prototype.push),te=x(Array.prototype.splice),p=Array.isArray,m=x(String.prototype.toLowerCase),ne=x(String.prototype.toString),re=x(String.prototype.match),h=x(String.prototype.replace),ie=x(String.prototype.indexOf),ae=x(String.prototype.trim),oe=x(Number.prototype.toString),se=x(Boolean.prototype.toString),g=typeof BigInt>`u`?null:x(BigInt.prototype.toString),ce=typeof Symbol>`u`?null:x(Symbol.prototype.toString),_=x(Object.prototype.hasOwnProperty),v=x(Object.prototype.toString),y=x(RegExp.prototype.test),b=S(TypeError);function x(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);var n=[...arguments].slice(1);return c(e,t,n)}}function S(e){return function(){return l(e,[...arguments])}}function C(e,r){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:m;if(t&&t(e,null),!p(r))return e;let a=r.length;for(;a--;){let t=r[a];if(typeof t==`string`){let e=i(t);e!==t&&(n(r)||(r[a]=e),t=e)}e[t]=!0}return e}function w(e){for(let t=0;t<e.length;t++)_(e,t)||(e[t]=null);return e}function T(t){let n=s(null);for(let[r,i]of e(t))_(t,r)&&(p(i)?n[r]=w(i):i&&typeof i==`object`&&i.constructor===Object?n[r]=T(i):n[r]=i);return n}function le(e){switch(typeof e){case`string`:return e;case`number`:return oe(e);case`boolean`:return se(e);case`bigint`:return g?g(e):`0`;case`symbol`:return ce?ce(e):`Symbol()`;case`undefined`:return v(e);case`function`:case`object`:{if(e===null)return v(e);let t=e,n=E(t,`toString`);if(typeof n==`function`){let e=n(t);return typeof e==`string`?e:v(e)}return v(e)}default:return v(e)}}function E(e,t){for(;e!==null;){let n=i(e,t);if(n){if(n.get)return x(n.get);if(typeof n.value==`function`)return x(n.value)}e=r(e)}function n(){return null}return n}function ue(e){try{return y(e,``),!0}catch{return!1}}var de=a(`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(`.`)),fe=a(`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(`.`)),pe=a([`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`]),me=a([`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`]),he=a(`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(`.`)),ge=a([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),_e=a([`#text`]),ve=a(`accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.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(`.`)),ye=a(`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.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.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-rendering.textlength.type.u1.u2.unicode.values.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan`.split(`.`)),be=a(`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(`.`)),xe=a([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),Se=o(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Ce=o(/<%[\w\W]*|[\w\W]*%>/gm),we=o(/\$\{[\w\W]*/gm),Te=o(/^data-[\-\w.\u00B7-\uFFFF]+$/),D=o(/^aria-[\-\w]+$/),Ee=o(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),O=o(/^(?:\w+script|data):/i),k=o(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),De=o(/^html$/i),A=o(/^[a-z][.\w]*(-[.\w]+)+$/i),Oe=Object.freeze({__proto__:null,ARIA_ATTR:D,ATTR_WHITESPACE:k,CUSTOM_ELEMENT:A,DATA_ATTR:Te,DOCTYPE_NAME:De,ERB_EXPR:Ce,IS_ALLOWED_URI:Ee,IS_SCRIPT_OR_DATA:O,MUSTACHE_EXPR:Se,TMPLIT_EXPR:we}),j={element:1,text:3,progressingInstruction:7,comment:8,document:9},ke=function(){return typeof window>`u`?null:window},Ae=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}},je=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Me(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ke(),n=e=>Me(e);if(n.version=`3.4.2`,n.removed=[],!t||!t.document||t.document.nodeType!==j.document||!t.Element)return n.isSupported=!1,n;let{document:r}=t,i=r,o=i.currentScript,{DocumentFragment:c,HTMLTemplateElement:l,Node:oe,Element:se,NodeFilter:g,NamedNodeMap:ce=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:v,DOMParser:x,trustedTypes:S}=t,w=se.prototype,Se=E(w,`cloneNode`),Ce=E(w,`remove`),we=E(w,`nextSibling`),Te=E(w,`childNodes`),D=E(w,`parentNode`);if(typeof l==`function`){let e=r.createElement(`template`);e.content&&e.content.ownerDocument&&(r=e.content.ownerDocument)}let O,k=``,{implementation:A,createNodeIterator:Ne,createDocumentFragment:Pe,getElementsByTagName:Fe}=r,{importNode:Ie}=i,M=je();n.isSupported=typeof e==`function`&&typeof D==`function`&&A&&A.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:Le,ERB_EXPR:Re,TMPLIT_EXPR:N,DATA_ATTR:ze,ARIA_ATTR:Be,IS_SCRIPT_OR_DATA:Ve,ATTR_WHITESPACE:He,CUSTOM_ELEMENT:Ue}=Oe,{IS_ALLOWED_URI:We}=Oe,P=null,Ge=C({},[...de,...fe,...pe,...he,..._e]),F=null,Ke=C({},[...ve,...ye,...be,...xe]),I=Object.seal(s(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),L=null,qe=null,R=Object.seal(s(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),Je=!0,Ye=!0,Xe=!1,Ze=!0,z=!1,B=!0,V=!1,Qe=!1,$e=!1,H=!1,et=!1,tt=!1,nt=!0,rt=!1,it=`user-content-`,at=!0,U=!1,W={},G=null,ot=C({},[`annotation-xml`,`audio`,`colgroup`,`desc`,`foreignobject`,`head`,`iframe`,`math`,`mi`,`mn`,`mo`,`ms`,`mtext`,`noembed`,`noframes`,`noscript`,`plaintext`,`script`,`style`,`svg`,`template`,`thead`,`title`,`video`,`xmp`]),st=null,ct=C({},[`audio`,`video`,`img`,`source`,`image`,`track`]),lt=null,ut=C({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),dt=`http://www.w3.org/1998/Math/MathML`,ft=`http://www.w3.org/2000/svg`,K=`http://www.w3.org/1999/xhtml`,q=K,pt=!1,mt=null,ht=C({},[dt,ft,K],ne),gt=C({},[`mi`,`mo`,`mn`,`ms`,`mtext`]),_t=C({},[`annotation-xml`]),vt=C({},[`title`,`style`,`font`,`a`,`script`]),J=null,yt=[`application/xhtml+xml`,`text/html`],Y=null,X=null,bt=r.createElement(`form`),xt=function(e){return e instanceof RegExp||e instanceof Function},St=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(X&&X===e)return;(!e||typeof e!=`object`)&&(e={}),e=T(e),J=yt.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,Y=J===`application/xhtml+xml`?ne:m,P=_(e,`ALLOWED_TAGS`)&&p(e.ALLOWED_TAGS)?C({},e.ALLOWED_TAGS,Y):Ge,F=_(e,`ALLOWED_ATTR`)&&p(e.ALLOWED_ATTR)?C({},e.ALLOWED_ATTR,Y):Ke,mt=_(e,`ALLOWED_NAMESPACES`)&&p(e.ALLOWED_NAMESPACES)?C({},e.ALLOWED_NAMESPACES,ne):ht,lt=_(e,`ADD_URI_SAFE_ATTR`)&&p(e.ADD_URI_SAFE_ATTR)?C(T(ut),e.ADD_URI_SAFE_ATTR,Y):ut,st=_(e,`ADD_DATA_URI_TAGS`)&&p(e.ADD_DATA_URI_TAGS)?C(T(ct),e.ADD_DATA_URI_TAGS,Y):ct,G=_(e,`FORBID_CONTENTS`)&&p(e.FORBID_CONTENTS)?C({},e.FORBID_CONTENTS,Y):ot,L=_(e,`FORBID_TAGS`)&&p(e.FORBID_TAGS)?C({},e.FORBID_TAGS,Y):T({}),qe=_(e,`FORBID_ATTR`)&&p(e.FORBID_ATTR)?C({},e.FORBID_ATTR,Y):T({}),W=_(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?T(e.USE_PROFILES):e.USE_PROFILES:!1,Je=e.ALLOW_ARIA_ATTR!==!1,Ye=e.ALLOW_DATA_ATTR!==!1,Xe=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Ze=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,z=e.SAFE_FOR_TEMPLATES||!1,B=e.SAFE_FOR_XML!==!1,V=e.WHOLE_DOCUMENT||!1,H=e.RETURN_DOM||!1,et=e.RETURN_DOM_FRAGMENT||!1,tt=e.RETURN_TRUSTED_TYPE||!1,$e=e.FORCE_BODY||!1,nt=e.SANITIZE_DOM!==!1,rt=e.SANITIZE_NAMED_PROPS||!1,at=e.KEEP_CONTENT!==!1,U=e.IN_PLACE||!1,We=ue(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:Ee,q=typeof e.NAMESPACE==`string`?e.NAMESPACE:K,gt=_(e,`MATHML_TEXT_INTEGRATION_POINTS`)&&e.MATHML_TEXT_INTEGRATION_POINTS&&typeof e.MATHML_TEXT_INTEGRATION_POINTS==`object`?T(e.MATHML_TEXT_INTEGRATION_POINTS):C({},[`mi`,`mo`,`mn`,`ms`,`mtext`]),_t=_(e,`HTML_INTEGRATION_POINTS`)&&e.HTML_INTEGRATION_POINTS&&typeof e.HTML_INTEGRATION_POINTS==`object`?T(e.HTML_INTEGRATION_POINTS):C({},[`annotation-xml`]);let t=_(e,`CUSTOM_ELEMENT_HANDLING`)&&e.CUSTOM_ELEMENT_HANDLING&&typeof e.CUSTOM_ELEMENT_HANDLING==`object`?T(e.CUSTOM_ELEMENT_HANDLING):s(null);if(I=s(null),_(t,`tagNameCheck`)&&xt(t.tagNameCheck)&&(I.tagNameCheck=t.tagNameCheck),_(t,`attributeNameCheck`)&&xt(t.attributeNameCheck)&&(I.attributeNameCheck=t.attributeNameCheck),_(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(I.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),z&&(Ye=!1),et&&(H=!0),W&&(P=C({},_e),F=s(null),W.html===!0&&(C(P,de),C(F,ve)),W.svg===!0&&(C(P,fe),C(F,ye),C(F,xe)),W.svgFilters===!0&&(C(P,pe),C(F,ye),C(F,xe)),W.mathMl===!0&&(C(P,he),C(F,be),C(F,xe))),R.tagCheck=null,R.attributeCheck=null,_(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?R.tagCheck=e.ADD_TAGS:p(e.ADD_TAGS)&&(P===Ge&&(P=T(P)),C(P,e.ADD_TAGS,Y))),_(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?R.attributeCheck=e.ADD_ATTR:p(e.ADD_ATTR)&&(F===Ke&&(F=T(F)),C(F,e.ADD_ATTR,Y))),_(e,`ADD_URI_SAFE_ATTR`)&&p(e.ADD_URI_SAFE_ATTR)&&C(lt,e.ADD_URI_SAFE_ATTR,Y),_(e,`FORBID_CONTENTS`)&&p(e.FORBID_CONTENTS)&&(G===ot&&(G=T(G)),C(G,e.FORBID_CONTENTS,Y)),_(e,`ADD_FORBID_CONTENTS`)&&p(e.ADD_FORBID_CONTENTS)&&(G===ot&&(G=T(G)),C(G,e.ADD_FORBID_CONTENTS,Y)),at&&(P[`#text`]=!0),V&&C(P,[`html`,`head`,`body`]),P.table&&(C(P,[`tbody`]),delete L.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw b(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw b(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);O=e.TRUSTED_TYPES_POLICY,k=O.createHTML(``)}else O===void 0&&(O=Ae(S,o)),O!==null&&typeof k==`string`&&(k=O.createHTML(``));a&&a(e),X=e},Ct=C({},[...fe,...pe,...me]),wt=C({},[...he,...ge]),Tt=function(e){let t=D(e);(!t||!t.tagName)&&(t={namespaceURI:q,tagName:`template`});let n=m(e.tagName),r=m(t.tagName);return mt[e.namespaceURI]?e.namespaceURI===ft?t.namespaceURI===K?n===`svg`:t.namespaceURI===dt?n===`svg`&&(r===`annotation-xml`||gt[r]):!!Ct[n]:e.namespaceURI===dt?t.namespaceURI===K?n===`math`:t.namespaceURI===ft?n===`math`&&_t[r]:!!wt[n]:e.namespaceURI===K?t.namespaceURI===ft&&!_t[r]||t.namespaceURI===dt&&!gt[r]?!1:!wt[n]&&(vt[n]||!Ct[n]):!!(J===`application/xhtml+xml`&&mt[e.namespaceURI]):!1},Z=function(e){f(n.removed,{element:e});try{D(e).removeChild(e)}catch{Ce(e)}},Q=function(e,t){try{f(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch{f(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),e===`is`)if(H||et)try{Z(t)}catch{}else try{t.setAttribute(e,``)}catch{}},Et=function(e){let t=null,n=null;if($e)e=`<remove></remove>`+e;else{let t=re(e,/^[\r\n\t ]+/);n=t&&t[0]}J===`application/xhtml+xml`&&q===K&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=O?O.createHTML(e):e;if(q===K)try{t=new x().parseFromString(i,J)}catch{}if(!t||!t.documentElement){t=A.createDocument(q,`template`,null);try{t.documentElement.innerHTML=pt?k:i}catch{}}let a=t.body||t.documentElement;return e&&n&&a.insertBefore(r.createTextNode(n),a.childNodes[0]||null),q===K?Fe.call(t,V?`html`:`body`)[0]:V?t.documentElement:a},Dt=function(e){return Ne.call(e.ownerDocument||e,e,g.SHOW_ELEMENT|g.SHOW_COMMENT|g.SHOW_TEXT|g.SHOW_PROCESSING_INSTRUCTION|g.SHOW_CDATA_SECTION,null)},Ot=function(e){return e instanceof v&&(typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||!(e.attributes instanceof ce)||typeof e.removeAttribute!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`)},kt=function(e){return typeof oe==`function`&&e instanceof oe};function $(e,t,r){u(e,e=>{e.call(n,t,r,X)})}let At=function(e){let t=null;if($(M.beforeSanitizeElements,e,null),Ot(e))return Z(e),!0;let r=Y(e.nodeName);if($(M.uponSanitizeElement,e,{tagName:r,allowedTags:P}),B&&e.hasChildNodes()&&!kt(e.firstElementChild)&&y(/<[/\w!]/g,e.innerHTML)&&y(/<[/\w!]/g,e.textContent)||B&&e.namespaceURI===K&&r===`style`&&kt(e.firstElementChild)||e.nodeType===j.progressingInstruction||B&&e.nodeType===j.comment&&y(/<[/\w]/g,e.data))return Z(e),!0;if(L[r]||!(R.tagCheck instanceof Function&&R.tagCheck(r))&&!P[r]){if(!L[r]&&Nt(r)&&(I.tagNameCheck instanceof RegExp&&y(I.tagNameCheck,r)||I.tagNameCheck instanceof Function&&I.tagNameCheck(r)))return!1;if(at&&!G[r]){let t=D(e)||e.parentNode,n=Te(e)||e.childNodes;if(n&&t){let r=n.length;for(let i=r-1;i>=0;--i){let r=Se(n[i],!0);t.insertBefore(r,we(e))}}}return Z(e),!0}return e instanceof se&&!Tt(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&y(/<\/no(script|embed|frames)/i,e.innerHTML)?(Z(e),!0):(z&&e.nodeType===j.text&&(t=e.textContent,u([Le,Re,N],e=>{t=h(t,e,` `)}),e.textContent!==t&&(f(n.removed,{element:e.cloneNode()}),e.textContent=t)),$(M.afterSanitizeElements,e,null),!1)},jt=function(e,t,n){if(qe[t]||nt&&(t===`id`||t===`name`)&&(n in r||n in bt))return!1;let i=F[t]||R.attributeCheck instanceof Function&&R.attributeCheck(t,e);if(!(Ye&&!qe[t]&&y(ze,t))&&!(Je&&y(Be,t))){if(!i||qe[t]){if(!(Nt(e)&&(I.tagNameCheck instanceof RegExp&&y(I.tagNameCheck,e)||I.tagNameCheck instanceof Function&&I.tagNameCheck(e))&&(I.attributeNameCheck instanceof RegExp&&y(I.attributeNameCheck,t)||I.attributeNameCheck instanceof Function&&I.attributeNameCheck(t,e))||t===`is`&&I.allowCustomizedBuiltInElements&&(I.tagNameCheck instanceof RegExp&&y(I.tagNameCheck,n)||I.tagNameCheck instanceof Function&&I.tagNameCheck(n))))return!1}else if(!lt[t]&&!y(We,h(n,He,``))&&!((t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&ie(n,`data:`)===0&&st[e])&&!(Xe&&!y(Ve,h(n,He,``)))&&n)return!1}return!0},Mt=C({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),Nt=function(e){return!Mt[m(e)]&&y(Ue,e)},Pt=function(e){$(M.beforeSanitizeAttributes,e,null);let{attributes:t}=e;if(!t||Ot(e))return;let r={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:F,forceKeepAttr:void 0},i=t.length;for(;i--;){let{name:a,namespaceURI:o,value:s}=t[i],c=Y(a),l=s,d=a===`value`?l:ae(l);if(r.attrName=c,r.attrValue=d,r.keepAttr=!0,r.forceKeepAttr=void 0,$(M.uponSanitizeAttribute,e,r),d=r.attrValue,rt&&(c===`id`||c===`name`)&&ie(d,it)!==0&&(Q(a,e),d=it+d),B&&y(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,d)){Q(a,e);continue}if(c===`attributename`&&re(d,`href`)){Q(a,e);continue}if(r.forceKeepAttr)continue;if(!r.keepAttr){Q(a,e);continue}if(!Ze&&y(/\/>/i,d)){Q(a,e);continue}z&&u([Le,Re,N],e=>{d=h(d,e,` `)});let f=Y(e.nodeName);if(!jt(f,c,d)){Q(a,e);continue}if(O&&typeof S==`object`&&typeof S.getAttributeType==`function`&&!o)switch(S.getAttributeType(f,c)){case`TrustedHTML`:d=O.createHTML(d);break;case`TrustedScriptURL`:d=O.createScriptURL(d);break}if(d!==l)try{o?e.setAttributeNS(o,a,d):e.setAttribute(a,d),Ot(e)?Z(e):ee(n.removed)}catch{Q(a,e)}}$(M.afterSanitizeAttributes,e,null)},Ft=function(e){let t=null,n=Dt(e);for($(M.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)$(M.uponSanitizeShadowNode,t,null),At(t),Pt(t),t.content instanceof c&&Ft(t.content);$(M.afterSanitizeShadowDOM,e,null)};return n.sanitize=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=null,a=null,o=null,s=null;if(pt=!e,pt&&(e=`<!-->`),typeof e!=`string`&&!kt(e)&&(e=le(e),typeof e!=`string`))throw b(`dirty is not a string, aborting`);if(!n.isSupported)return e;if(Qe||St(t),n.removed=[],typeof e==`string`&&(U=!1),U){let t=e.nodeName;if(typeof t==`string`){let e=Y(t);if(!P[e]||L[e])throw b(`root node is forbidden and cannot be sanitized in-place`)}}else if(e instanceof oe)r=Et(`<!---->`),a=r.ownerDocument.importNode(e,!0),a.nodeType===j.element&&a.nodeName===`BODY`||a.nodeName===`HTML`?r=a:r.appendChild(a);else{if(!H&&!z&&!V&&e.indexOf(`<`)===-1)return O&&tt?O.createHTML(e):e;if(r=Et(e),!r)return H?null:tt?k:``}r&&$e&&Z(r.firstChild);let l=Dt(U?e:r);for(;o=l.nextNode();)At(o),Pt(o),o.content instanceof c&&Ft(o.content);if(U)return e;if(H){if(z){r.normalize();let e=r.innerHTML;u([Le,Re,N],t=>{e=h(e,t,` `)}),r.innerHTML=e}if(et)for(s=Pe.call(r.ownerDocument);r.firstChild;)s.appendChild(r.firstChild);else s=r;return(F.shadowroot||F.shadowrootmode)&&(s=Ie.call(i,s,!0)),s}let d=V?r.outerHTML:r.innerHTML;return V&&P[`!doctype`]&&r.ownerDocument&&r.ownerDocument.doctype&&r.ownerDocument.doctype.name&&y(De,r.ownerDocument.doctype.name)&&(d=`<!DOCTYPE `+r.ownerDocument.doctype.name+`>
`+d),z&&u([Le,Re,N],e=>{d=h(d,e,` `)}),O&&tt?O.createHTML(d):d},n.setConfig=function(){St(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}),Qe=!0},n.clearConfig=function(){X=null,Qe=!1},n.isValidAttribute=function(e,t,n){return X||St({}),jt(Y(e),Y(t),n)},n.addHook=function(e,t){typeof t==`function`&&f(M[e],t)},n.removeHook=function(e,t){if(t!==void 0){let n=d(M[e],t);return n===-1?void 0:te(M[e],n,1)[0]}return ee(M[e])},n.removeHooks=function(e){M[e]=[]},n.removeAllHooks=function(){M=je()},n}var Ne=Me();export{Ne as default};