r.get(e.name)===e.value))&&(s+=1,s>=3&&this.entries.splice(t.idx,1))}}insertMarker(){this.entries.unshift(s)}pushElement(e,t){this._ensureNoahArkCondition(e),this.entries.unshift({type:r.Element,element:e,token:t})}insertElementAfterBookmark(e,t){const n=this.entries.indexOf(this.bookmark);this.entries.splice(n,0,{type:r.Element,element:e,token:t})}removeEntry(e){const t=this.entries.indexOf(e);t>=0&&this.entries.splice(t,1)}clearToLastMarker(){const e=this.entries.indexOf(s);e>=0?this.entries.splice(0,e+1):this.entries.length=0}getElementEntryInScopeWithTagName(e){const t=this.entries.find((t=>t.type===r.Marker||this.treeAdapter.getTagName(t.element)===e));return t&&t.type===r.Element?t:null}getElementEntry(e){return this.entries.find((t=>t.type===r.Element&&t.element===e))}}},3091:(e,t,n)=>{"use strict";n.d(t,{_:()=>_});var r=n(8628),s=n(4285),i=n(4259),a=n(8747),o=n(3477),c=n(5770),l=n(826),h=n(7853),u=n(9776),d=n(5746);const E="hidden",p=8,T=3;var m;!function(e){e[e.INITIAL=0]="INITIAL",e[e.BEFORE_HTML=1]="BEFORE_HTML",e[e.BEFORE_HEAD=2]="BEFORE_HEAD",e[e.IN_HEAD=3]="IN_HEAD",e[e.IN_HEAD_NO_SCRIPT=4]="IN_HEAD_NO_SCRIPT",e[e.AFTER_HEAD=5]="AFTER_HEAD",e[e.IN_BODY=6]="IN_BODY",e[e.TEXT=7]="TEXT",e[e.IN_TABLE=8]="IN_TABLE",e[e.IN_TABLE_TEXT=9]="IN_TABLE_TEXT",e[e.IN_CAPTION=10]="IN_CAPTION",e[e.IN_COLUMN_GROUP=11]="IN_COLUMN_GROUP",e[e.IN_TABLE_BODY=12]="IN_TABLE_BODY",e[e.IN_ROW=13]="IN_ROW",e[e.IN_CELL=14]="IN_CELL",e[e.IN_SELECT=15]="IN_SELECT",e[e.IN_SELECT_IN_TABLE=16]="IN_SELECT_IN_TABLE",e[e.IN_TEMPLATE=17]="IN_TEMPLATE",e[e.AFTER_BODY=18]="AFTER_BODY",e[e.IN_FRAMESET=19]="IN_FRAMESET",e[e.AFTER_FRAMESET=20]="AFTER_FRAMESET",e[e.AFTER_AFTER_BODY=21]="AFTER_AFTER_BODY",e[e.AFTER_AFTER_FRAMESET=22]="AFTER_AFTER_FRAMESET"}(m||(m={}));const f={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},A=new Set([u.LB.TABLE,u.LB.TBODY,u.LB.TFOOT,u.LB.THEAD,u.LB.TR]),g={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:a.g,onParseError:null};class _{constructor(e,t,n=null,a=null){this.fragmentContext=n,this.scriptHandler=a,this.currentToken=null,this.stopped=!1,this.insertionMode=m.INITIAL,this.originalInsertionMode=m.INITIAL,this.headElement=null,this.formElement=null,this.currentNotInHTML=!1,this.tmplInsertionModeStack=[],this.pendingCharacterTokens=[],this.hasNonWhitespacePendingCharacterToken=!1,this.framesetOk=!0,this.skipNextNewLine=!1,this.fosterParentingEnabled=!1,this.options={...g,...e},this.treeAdapter=this.options.treeAdapter,this.onParseError=this.options.onParseError,this.onParseError&&(this.options.sourceCodeLocationInfo=!0),this.document=null!=t?t:this.treeAdapter.createDocument(),this.tokenizer=new r.d(this.options,this),this.activeFormattingElements=new i.T(this.treeAdapter),this.fragmentContextID=n?(0,u.OL)(this.treeAdapter.getTagName(n)):u.LB.UNKNOWN,this._setContextModes(null!=n?n:this.document,this.fragmentContextID),this.openElements=new s.X(this.document,this.treeAdapter,this)}static parse(e,t){const n=new this(t);return n.tokenizer.write(e,!0),n.document}static getFragmentParser(e,t){const n={...g,...t};null!=e||(e=n.treeAdapter.createElement(u.ab.TEMPLATE,u.NS.HTML,[]));const r=n.treeAdapter.createElement("documentmock",u.NS.HTML,[]),s=new this(n,r,e);return s.fragmentContextID===u.LB.TEMPLATE&&s.tmplInsertionModeStack.unshift(m.IN_TEMPLATE),s._initTokenizerForFragmentParsing(),s._insertFakeRootElement(),s._resetInsertionMode(),s._findFormInFragmentContext(),s}getFragment(){const e=this.treeAdapter.getFirstChild(this.document),t=this.treeAdapter.createDocumentFragment();return this._adoptNodes(e,t),t}_err(e,t,n){var r;if(!this.onParseError)return;const s=null!==(r=e.location)&&void 0!==r?r:f,i={code:t,startLine:s.startLine,startCol:s.startCol,startOffset:s.startOffset,endLine:n?s.startLine:s.endLine,endCol:n?s.startCol:s.endCol,endOffset:n?s.startOffset:s.endOffset};this.onParseError(i)}onItemPush(e,t,n){var r,s;null===(s=(r=this.treeAdapter).onItemPush)||void 0===s||s.call(r,e),n&&this.openElements.stackTop>0&&this._setContextModes(e,t)}onItemPop(e,t){var n,r;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(e,this.currentToken),null===(r=(n=this.treeAdapter).onItemPop)||void 0===r||r.call(n,e,this.openElements.current),t){let e,t;0===this.openElements.stackTop&&this.fragmentContext?(e=this.fragmentContext,t=this.fragmentContextID):({current:e,currentTagId:t}=this.openElements),this._setContextModes(e,t)}}_setContextModes(e,t){const n=e===this.document||this.treeAdapter.getNamespaceURI(e)===u.NS.HTML;this.currentNotInHTML=!n,this.tokenizer.inForeignNode=!n&&!this._isIntegrationPoint(t,e)}_switchToTextParsing(e,t){this._insertElement(e,u.NS.HTML),this.tokenizer.state=t,this.originalInsertionMode=this.insertionMode,this.insertionMode=m.TEXT}switchToPlaintextParsing(){this.insertionMode=m.TEXT,this.originalInsertionMode=m.IN_BODY,this.tokenizer.state=r.P.PLAINTEXT}_getAdjustedCurrentElement(){return 0===this.openElements.stackTop&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let e=this.fragmentContext;for(;e;){if(this.treeAdapter.getTagName(e)===u.ab.FORM){this.formElement=e;break}e=this.treeAdapter.getParentNode(e)}}_initTokenizerForFragmentParsing(){if(this.fragmentContext&&this.treeAdapter.getNamespaceURI(this.fragmentContext)===u.NS.HTML)switch(this.fragmentContextID){case u.LB.TITLE:case u.LB.TEXTAREA:this.tokenizer.state=r.P.RCDATA;break;case u.LB.STYLE:case u.LB.XMP:case u.LB.IFRAME:case u.LB.NOEMBED:case u.LB.NOFRAMES:case u.LB.NOSCRIPT:this.tokenizer.state=r.P.RAWTEXT;break;case u.LB.SCRIPT:this.tokenizer.state=r.P.SCRIPT_DATA;break;case u.LB.PLAINTEXT:this.tokenizer.state=r.P.PLAINTEXT}}_setDocumentType(e){const t=e.name||"",n=e.publicId||"",r=e.systemId||"";if(this.treeAdapter.setDocumentType(this.document,t,n,r),e.location){const t=this.treeAdapter.getChildNodes(this.document).find((e=>this.treeAdapter.isDocumentTypeNode(e)));t&&this.treeAdapter.setNodeSourceCodeLocation(t,e.location)}}_attachElementToTree(e,t){if(this.options.sourceCodeLocationInfo){const n=t&&{...t,startTag:t};this.treeAdapter.setNodeSourceCodeLocation(e,n)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(e);else{const t=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(t,e)}}_appendElement(e,t){const n=this.treeAdapter.createElement(e.tagName,t,e.attrs);this._attachElementToTree(n,e.location)}_insertElement(e,t){const n=this.treeAdapter.createElement(e.tagName,t,e.attrs);this._attachElementToTree(n,e.location),this.openElements.push(n,e.tagID)}_insertFakeElement(e,t){const n=this.treeAdapter.createElement(e,u.NS.HTML,[]);this._attachElementToTree(n,null),this.openElements.push(n,t)}_insertTemplate(e){const t=this.treeAdapter.createElement(e.tagName,u.NS.HTML,e.attrs),n=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(t,n),this._attachElementToTree(t,e.location),this.openElements.push(t,e.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(n,null)}_insertFakeRootElement(){const e=this.treeAdapter.createElement(u.ab.HTML,u.NS.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(e,null),this.treeAdapter.appendChild(this.openElements.current,e),this.openElements.push(e,u.LB.HTML)}_appendCommentNode(e,t){const n=this.treeAdapter.createCommentNode(e.data);this.treeAdapter.appendChild(t,n),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(n,e.location)}_insertCharacters(e){let t,n;if(this._shouldFosterParentOnInsertion()?(({parent:t,beforeElement:n}=this._findFosterParentingLocation()),n?this.treeAdapter.insertTextBefore(t,e.chars,n):this.treeAdapter.insertText(t,e.chars)):(t=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(t,e.chars)),!e.location)return;const r=this.treeAdapter.getChildNodes(t),s=n?r.lastIndexOf(n):r.length,i=r[s-1];if(this.treeAdapter.getNodeSourceCodeLocation(i)){const{endLine:t,endCol:n,endOffset:r}=e.location;this.treeAdapter.updateNodeSourceCodeLocation(i,{endLine:t,endCol:n,endOffset:r})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(i,e.location)}_adoptNodes(e,t){for(let n=this.treeAdapter.getFirstChild(e);n;n=this.treeAdapter.getFirstChild(e))this.treeAdapter.detachNode(n),this.treeAdapter.appendChild(t,n)}_setEndLocation(e,t){if(this.treeAdapter.getNodeSourceCodeLocation(e)&&t.location){const n=t.location,r=this.treeAdapter.getTagName(e),s=t.type===d.i.END_TAG&&r===t.tagName?{endTag:{...n},endLine:n.endLine,endCol:n.endCol,endOffset:n.endOffset}:{endLine:n.startLine,endCol:n.startCol,endOffset:n.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(e,s)}}shouldProcessStartTagTokenInForeignContent(e){if(!this.currentNotInHTML)return!1;let t,n;return 0===this.openElements.stackTop&&this.fragmentContext?(t=this.fragmentContext,n=this.fragmentContextID):({current:t,currentTagId:n}=this.openElements),(e.tagID!==u.LB.SVG||this.treeAdapter.getTagName(t)!==u.ab.ANNOTATION_XML||this.treeAdapter.getNamespaceURI(t)!==u.NS.MATHML)&&(this.tokenizer.inForeignNode||(e.tagID===u.LB.MGLYPH||e.tagID===u.LB.MALIGNMARK)&&!this._isIntegrationPoint(n,t,u.NS.HTML))}_processToken(e){switch(e.type){case d.i.CHARACTER:this.onCharacter(e);break;case d.i.NULL_CHARACTER:this.onNullCharacter(e);break;case d.i.COMMENT:this.onComment(e);break;case d.i.DOCTYPE:this.onDoctype(e);break;case d.i.START_TAG:this._processStartTag(e);break;case d.i.END_TAG:this.onEndTag(e);break;case d.i.EOF:this.onEof(e);break;case d.i.WHITESPACE_CHARACTER:this.onWhitespaceCharacter(e)}}_isIntegrationPoint(e,t,n){const r=this.treeAdapter.getNamespaceURI(t),s=this.treeAdapter.getAttrList(t);return c.xM(e,r,s,n)}_reconstructActiveFormattingElements(){const e=this.activeFormattingElements.entries.length;if(e){const t=this.activeFormattingElements.entries.findIndex((e=>e.type===i.U.Marker||this.openElements.contains(e.element)));for(let n=t<0?e-1:t-1;n>=0;n--){const e=this.activeFormattingElements.entries[n];this._insertElement(e.token,this.treeAdapter.getNamespaceURI(e.element)),e.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=m.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(u.LB.P),this.openElements.popUntilTagNamePopped(u.LB.P)}_resetInsertionMode(){for(let e=this.openElements.stackTop;e>=0;e--)switch(0===e&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[e]){case u.LB.TR:return void(this.insertionMode=m.IN_ROW);case u.LB.TBODY:case u.LB.THEAD:case u.LB.TFOOT:return void(this.insertionMode=m.IN_TABLE_BODY);case u.LB.CAPTION:return void(this.insertionMode=m.IN_CAPTION);case u.LB.COLGROUP:return void(this.insertionMode=m.IN_COLUMN_GROUP);case u.LB.TABLE:return void(this.insertionMode=m.IN_TABLE);case u.LB.BODY:return void(this.insertionMode=m.IN_BODY);case u.LB.FRAMESET:return void(this.insertionMode=m.IN_FRAMESET);case u.LB.SELECT:return void this._resetInsertionModeForSelect(e);case u.LB.TEMPLATE:return void(this.insertionMode=this.tmplInsertionModeStack[0]);case u.LB.HTML:return void(this.insertionMode=this.headElement?m.AFTER_HEAD:m.BEFORE_HEAD);case u.LB.TD:case u.LB.TH:if(e>0)return void(this.insertionMode=m.IN_CELL);break;case u.LB.HEAD:if(e>0)return void(this.insertionMode=m.IN_HEAD)}this.insertionMode=m.IN_BODY}_resetInsertionModeForSelect(e){if(e>0)for(let t=e-1;t>0;t--){const e=this.openElements.tagIDs[t];if(e===u.LB.TEMPLATE)break;if(e===u.LB.TABLE)return void(this.insertionMode=m.IN_SELECT_IN_TABLE)}this.insertionMode=m.IN_SELECT}_isElementCausesFosterParenting(e){return A.has(e)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let e=this.openElements.stackTop;e>=0;e--){const t=this.openElements.items[e];switch(this.openElements.tagIDs[e]){case u.LB.TEMPLATE:if(this.treeAdapter.getNamespaceURI(t)===u.NS.HTML)return{parent:this.treeAdapter.getTemplateContent(t),beforeElement:null};break;case u.LB.TABLE:{const n=this.treeAdapter.getParentNode(t);return n?{parent:n,beforeElement:t}:{parent:this.openElements.items[e-1],beforeElement:null}}}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(e){const t=this._findFosterParentingLocation();t.beforeElement?this.treeAdapter.insertBefore(t.parent,e,t.beforeElement):this.treeAdapter.appendChild(t.parent,e)}_isSpecialElement(e,t){const n=this.treeAdapter.getNamespaceURI(e);return u.up[n].has(t)}onCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode)!function(e,t){e._insertCharacters(t),e.framesetOk=!1}(this,e);else switch(this.insertionMode){case m.INITIAL:B(this,e);break;case m.BEFORE_HTML:k(this,e);break;case m.BEFORE_HEAD:y(this,e);break;case m.IN_HEAD:H(this,e);break;case m.IN_HEAD_NO_SCRIPT:w(this,e);break;case m.AFTER_HEAD:v(this,e);break;case m.IN_BODY:case m.IN_CAPTION:case m.IN_CELL:case m.IN_TEMPLATE:F(this,e);break;case m.TEXT:case m.IN_SELECT:case m.IN_SELECT_IN_TABLE:this._insertCharacters(e);break;case m.IN_TABLE:case m.IN_TABLE_BODY:case m.IN_ROW:K(this,e);break;case m.IN_TABLE_TEXT:ee(this,e);break;case m.IN_COLUMN_GROUP:se(this,e);break;case m.AFTER_BODY:Ee(this,e);break;case m.AFTER_AFTER_BODY:pe(this,e)}}onNullCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode)!function(e,t){t.chars=h.wV,e._insertCharacters(t)}(this,e);else switch(this.insertionMode){case m.INITIAL:B(this,e);break;case m.BEFORE_HTML:k(this,e);break;case m.BEFORE_HEAD:y(this,e);break;case m.IN_HEAD:H(this,e);break;case m.IN_HEAD_NO_SCRIPT:w(this,e);break;case m.AFTER_HEAD:v(this,e);break;case m.TEXT:this._insertCharacters(e);break;case m.IN_TABLE:case m.IN_TABLE_BODY:case m.IN_ROW:K(this,e);break;case m.IN_COLUMN_GROUP:se(this,e);break;case m.AFTER_BODY:Ee(this,e);break;case m.AFTER_AFTER_BODY:pe(this,e)}}onComment(e){if(this.skipNextNewLine=!1,this.currentNotInHTML)R(this,e);else switch(this.insertionMode){case m.INITIAL:case m.BEFORE_HTML:case m.BEFORE_HEAD:case m.IN_HEAD:case m.IN_HEAD_NO_SCRIPT:case m.AFTER_HEAD:case m.IN_BODY:case m.IN_TABLE:case m.IN_CAPTION:case m.IN_COLUMN_GROUP:case m.IN_TABLE_BODY:case m.IN_ROW:case m.IN_CELL:case m.IN_SELECT:case m.IN_SELECT_IN_TABLE:case m.IN_TEMPLATE:case m.IN_FRAMESET:case m.AFTER_FRAMESET:R(this,e);break;case m.IN_TABLE_TEXT:te(this,e);break;case m.AFTER_BODY:!function(e,t){e._appendCommentNode(t,e.openElements.items[0])}(this,e);break;case m.AFTER_AFTER_BODY:case m.AFTER_AFTER_FRAMESET:!function(e,t){e._appendCommentNode(t,e.document)}(this,e)}}onDoctype(e){switch(this.skipNextNewLine=!1,this.insertionMode){case m.INITIAL:!function(e,t){e._setDocumentType(t);const n=t.forceQuirks?u.Bj.QUIRKS:o.M(t);o.f(t)||e._err(t,l.w.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=m.BEFORE_HTML}(this,e);break;case m.BEFORE_HEAD:case m.IN_HEAD:case m.IN_HEAD_NO_SCRIPT:case m.AFTER_HEAD:this._err(e,l.w.misplacedDoctype);break;case m.IN_TABLE_TEXT:te(this,e)}}onStartTag(e){this.skipNextNewLine=!1,this.currentToken=e,this._processStartTag(e),e.selfClosing&&!e.ackSelfClosing&&this._err(e,l.w.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(e){this.shouldProcessStartTagTokenInForeignContent(e)?function(e,t){if(c.GT(t))Te(e),e._startTagOutsideForeignContent(t);else{const n=e._getAdjustedCurrentElement(),r=e.treeAdapter.getNamespaceURI(n);r===u.NS.MATHML?c.ii(t):r===u.NS.SVG&&(c.TZ(t),c.NV(t)),c.cS(t),t.selfClosing?e._appendElement(t,r):e._insertElement(t,r),t.ackSelfClosing=!0}}(this,e):this._startTagOutsideForeignContent(e)}_startTagOutsideForeignContent(e){switch(this.insertionMode){case m.INITIAL:B(this,e);break;case m.BEFORE_HTML:!function(e,t){t.tagID===u.LB.HTML?(e._insertElement(t,u.NS.HTML),e.insertionMode=m.BEFORE_HEAD):k(e,t)}(this,e);break;case m.BEFORE_HEAD:!function(e,t){switch(t.tagID){case u.LB.HTML:W(e,t);break;case u.LB.HEAD:e._insertElement(t,u.NS.HTML),e.headElement=e.openElements.current,e.insertionMode=m.IN_HEAD;break;default:y(e,t)}}(this,e);break;case m.IN_HEAD:M(this,e);break;case m.IN_HEAD_NO_SCRIPT:!function(e,t){switch(t.tagID){case u.LB.HTML:W(e,t);break;case u.LB.BASEFONT:case u.LB.BGSOUND:case u.LB.HEAD:case u.LB.LINK:case u.LB.META:case u.LB.NOFRAMES:case u.LB.STYLE:M(e,t);break;case u.LB.NOSCRIPT:e._err(t,l.w.nestedNoscriptInHead);break;default:w(e,t)}}(this,e);break;case m.AFTER_HEAD:!function(e,t){switch(t.tagID){case u.LB.HTML:W(e,t);break;case u.LB.BODY:e._insertElement(t,u.NS.HTML),e.framesetOk=!1,e.insertionMode=m.IN_BODY;break;case u.LB.FRAMESET:e._insertElement(t,u.NS.HTML),e.insertionMode=m.IN_FRAMESET;break;case u.LB.BASE:case u.LB.BASEFONT:case u.LB.BGSOUND:case u.LB.LINK:case u.LB.META:case u.LB.NOFRAMES:case u.LB.SCRIPT:case u.LB.STYLE:case u.LB.TEMPLATE:case u.LB.TITLE:e._err(t,l.w.abandonedHeadElementChild),e.openElements.push(e.headElement,u.LB.HEAD),M(e,t),e.openElements.remove(e.headElement);break;case u.LB.HEAD:e._err(t,l.w.misplacedStartTagForHeadElement);break;default:v(e,t)}}(this,e);break;case m.IN_BODY:W(this,e);break;case m.IN_TABLE:z(this,e);break;case m.IN_TABLE_TEXT:te(this,e);break;case m.IN_CAPTION:!function(e,t){const n=t.tagID;ne.has(n)?e.openElements.hasInTableScope(u.LB.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(u.LB.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=m.IN_TABLE,z(e,t)):W(e,t)}(this,e);break;case m.IN_COLUMN_GROUP:re(this,e);break;case m.IN_TABLE_BODY:ie(this,e);break;case m.IN_ROW:oe(this,e);break;case m.IN_CELL:!function(e,t){const n=t.tagID;ne.has(n)?(e.openElements.hasInTableScope(u.LB.TD)||e.openElements.hasInTableScope(u.LB.TH))&&(e._closeTableCell(),oe(e,t)):W(e,t)}(this,e);break;case m.IN_SELECT:le(this,e);break;case m.IN_SELECT_IN_TABLE:!function(e,t){const n=t.tagID;n===u.LB.CAPTION||n===u.LB.TABLE||n===u.LB.TBODY||n===u.LB.TFOOT||n===u.LB.THEAD||n===u.LB.TR||n===u.LB.TD||n===u.LB.TH?(e.openElements.popUntilTagNamePopped(u.LB.SELECT),e._resetInsertionMode(),e._processStartTag(t)):le(e,t)}(this,e);break;case m.IN_TEMPLATE:!function(e,t){switch(t.tagID){case u.LB.BASE:case u.LB.BASEFONT:case u.LB.BGSOUND:case u.LB.LINK:case u.LB.META:case u.LB.NOFRAMES:case u.LB.SCRIPT:case u.LB.STYLE:case u.LB.TEMPLATE:case u.LB.TITLE:M(e,t);break;case u.LB.CAPTION:case u.LB.COLGROUP:case u.LB.TBODY:case u.LB.TFOOT:case u.LB.THEAD:e.tmplInsertionModeStack[0]=m.IN_TABLE,e.insertionMode=m.IN_TABLE,z(e,t);break;case u.LB.COL:e.tmplInsertionModeStack[0]=m.IN_COLUMN_GROUP,e.insertionMode=m.IN_COLUMN_GROUP,re(e,t);break;case u.LB.TR:e.tmplInsertionModeStack[0]=m.IN_TABLE_BODY,e.insertionMode=m.IN_TABLE_BODY,ie(e,t);break;case u.LB.TD:case u.LB.TH:e.tmplInsertionModeStack[0]=m.IN_ROW,e.insertionMode=m.IN_ROW,oe(e,t);break;default:e.tmplInsertionModeStack[0]=m.IN_BODY,e.insertionMode=m.IN_BODY,W(e,t)}}(this,e);break;case m.AFTER_BODY:!function(e,t){t.tagID===u.LB.HTML?W(e,t):Ee(e,t)}(this,e);break;case m.IN_FRAMESET:!function(e,t){switch(t.tagID){case u.LB.HTML:W(e,t);break;case u.LB.FRAMESET:e._insertElement(t,u.NS.HTML);break;case u.LB.FRAME:e._appendElement(t,u.NS.HTML),t.ackSelfClosing=!0;break;case u.LB.NOFRAMES:M(e,t)}}(this,e);break;case m.AFTER_FRAMESET:!function(e,t){switch(t.tagID){case u.LB.HTML:W(e,t);break;case u.LB.NOFRAMES:M(e,t)}}(this,e);break;case m.AFTER_AFTER_BODY:!function(e,t){t.tagID===u.LB.HTML?W(e,t):pe(e,t)}(this,e);break;case m.AFTER_AFTER_FRAMESET:!function(e,t){switch(t.tagID){case u.LB.HTML:W(e,t);break;case u.LB.NOFRAMES:M(e,t)}}(this,e)}}onEndTag(e){this.skipNextNewLine=!1,this.currentToken=e,this.currentNotInHTML?function(e,t){if(t.tagID===u.LB.P||t.tagID===u.LB.BR)return Te(e),void e._endTagOutsideForeignContent(t);for(let n=e.openElements.stackTop;n>0;n--){const r=e.openElements.items[n];if(e.treeAdapter.getNamespaceURI(r)===u.NS.HTML){e._endTagOutsideForeignContent(t);break}const s=e.treeAdapter.getTagName(r);if(s.toLowerCase()===t.tagName){t.tagName=s,e.openElements.shortenToLength(n);break}}}(this,e):this._endTagOutsideForeignContent(e)}_endTagOutsideForeignContent(e){switch(this.insertionMode){case m.INITIAL:B(this,e);break;case m.BEFORE_HTML:!function(e,t){const n=t.tagID;n!==u.LB.HTML&&n!==u.LB.HEAD&&n!==u.LB.BODY&&n!==u.LB.BR||k(e,t)}(this,e);break;case m.BEFORE_HEAD:!function(e,t){const n=t.tagID;n===u.LB.HEAD||n===u.LB.BODY||n===u.LB.HTML||n===u.LB.BR?y(e,t):e._err(t,l.w.endTagWithoutMatchingOpenElement)}(this,e);break;case m.IN_HEAD:!function(e,t){switch(t.tagID){case u.LB.HEAD:e.openElements.pop(),e.insertionMode=m.AFTER_HEAD;break;case u.LB.BODY:case u.LB.BR:case u.LB.HTML:H(e,t);break;case u.LB.TEMPLATE:P(e,t);break;default:e._err(t,l.w.endTagWithoutMatchingOpenElement)}}(this,e);break;case m.IN_HEAD_NO_SCRIPT:!function(e,t){switch(t.tagID){case u.LB.NOSCRIPT:e.openElements.pop(),e.insertionMode=m.IN_HEAD;break;case u.LB.BR:w(e,t);break;default:e._err(t,l.w.endTagWithoutMatchingOpenElement)}}(this,e);break;case m.AFTER_HEAD:!function(e,t){switch(t.tagID){case u.LB.BODY:case u.LB.HTML:case u.LB.BR:v(e,t);break;case u.LB.TEMPLATE:P(e,t);break;default:e._err(t,l.w.endTagWithoutMatchingOpenElement)}}(this,e);break;case m.IN_BODY:X(this,e);break;case m.TEXT:!function(e,t){var n;t.tagID===u.LB.SCRIPT&&(null===(n=e.scriptHandler)||void 0===n||n.call(e,e.openElements.current)),e.openElements.pop(),e.insertionMode=e.originalInsertionMode}(this,e);break;case m.IN_TABLE:$(this,e);break;case m.IN_TABLE_TEXT:te(this,e);break;case m.IN_CAPTION:!function(e,t){const n=t.tagID;switch(n){case u.LB.CAPTION:case u.LB.TABLE:e.openElements.hasInTableScope(u.LB.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(u.LB.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=m.IN_TABLE,n===u.LB.TABLE&&$(e,t));break;case u.LB.BODY:case u.LB.COL:case u.LB.COLGROUP:case u.LB.HTML:case u.LB.TBODY:case u.LB.TD:case u.LB.TFOOT:case u.LB.TH:case u.LB.THEAD:case u.LB.TR:break;default:X(e,t)}}(this,e);break;case m.IN_COLUMN_GROUP:!function(e,t){switch(t.tagID){case u.LB.COLGROUP:e.openElements.currentTagId===u.LB.COLGROUP&&(e.openElements.pop(),e.insertionMode=m.IN_TABLE);break;case u.LB.TEMPLATE:P(e,t);break;case u.LB.COL:break;default:se(e,t)}}(this,e);break;case m.IN_TABLE_BODY:ae(this,e);break;case m.IN_ROW:ce(this,e);break;case m.IN_CELL:!function(e,t){const n=t.tagID;switch(n){case u.LB.TD:case u.LB.TH:e.openElements.hasInTableScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=m.IN_ROW);break;case u.LB.TABLE:case u.LB.TBODY:case u.LB.TFOOT:case u.LB.THEAD:case u.LB.TR:e.openElements.hasInTableScope(n)&&(e._closeTableCell(),ce(e,t));break;case u.LB.BODY:case u.LB.CAPTION:case u.LB.COL:case u.LB.COLGROUP:case u.LB.HTML:break;default:X(e,t)}}(this,e);break;case m.IN_SELECT:he(this,e);break;case m.IN_SELECT_IN_TABLE:!function(e,t){const n=t.tagID;n===u.LB.CAPTION||n===u.LB.TABLE||n===u.LB.TBODY||n===u.LB.TFOOT||n===u.LB.THEAD||n===u.LB.TR||n===u.LB.TD||n===u.LB.TH?e.openElements.hasInTableScope(n)&&(e.openElements.popUntilTagNamePopped(u.LB.SELECT),e._resetInsertionMode(),e.onEndTag(t)):he(e,t)}(this,e);break;case m.IN_TEMPLATE:!function(e,t){t.tagID===u.LB.TEMPLATE&&P(e,t)}(this,e);break;case m.AFTER_BODY:de(this,e);break;case m.IN_FRAMESET:!function(e,t){t.tagID!==u.LB.FRAMESET||e.openElements.isRootHtmlElementCurrent()||(e.openElements.pop(),e.fragmentContext||e.openElements.currentTagId===u.LB.FRAMESET||(e.insertionMode=m.AFTER_FRAMESET))}(this,e);break;case m.AFTER_FRAMESET:!function(e,t){t.tagID===u.LB.HTML&&(e.insertionMode=m.AFTER_AFTER_FRAMESET)}(this,e);break;case m.AFTER_AFTER_BODY:pe(this,e)}}onEof(e){switch(this.insertionMode){case m.INITIAL:B(this,e);break;case m.BEFORE_HTML:k(this,e);break;case m.BEFORE_HEAD:y(this,e);break;case m.IN_HEAD:H(this,e);break;case m.IN_HEAD_NO_SCRIPT:w(this,e);break;case m.AFTER_HEAD:v(this,e);break;case m.IN_BODY:case m.IN_TABLE:case m.IN_CAPTION:case m.IN_COLUMN_GROUP:case m.IN_TABLE_BODY:case m.IN_ROW:case m.IN_CELL:case m.IN_SELECT:case m.IN_SELECT_IN_TABLE:j(this,e);break;case m.TEXT:!function(e,t){e._err(t,l.w.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}(this,e);break;case m.IN_TABLE_TEXT:te(this,e);break;case m.IN_TEMPLATE:ue(this,e);break;case m.AFTER_BODY:case m.IN_FRAMESET:case m.AFTER_FRAMESET:case m.AFTER_AFTER_BODY:case m.AFTER_AFTER_FRAMESET:O(this,e)}}onWhitespaceCharacter(e){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,e.chars.charCodeAt(0)===h.gH.LINE_FEED)){if(1===e.chars.length)return;e.chars=e.chars.substr(1)}if(this.tokenizer.inForeignNode)this._insertCharacters(e);else switch(this.insertionMode){case m.IN_HEAD:case m.IN_HEAD_NO_SCRIPT:case m.AFTER_HEAD:case m.TEXT:case m.IN_COLUMN_GROUP:case m.IN_SELECT:case m.IN_SELECT_IN_TABLE:case m.IN_FRAMESET:case m.AFTER_FRAMESET:this._insertCharacters(e);break;case m.IN_BODY:case m.IN_CAPTION:case m.IN_CELL:case m.IN_TEMPLATE:case m.AFTER_BODY:case m.AFTER_AFTER_BODY:case m.AFTER_AFTER_FRAMESET:U(this,e);break;case m.IN_TABLE:case m.IN_TABLE_BODY:case m.IN_ROW:K(this,e);break;case m.IN_TABLE_TEXT:J(this,e)}}}function N(e,t){let n=e.activeFormattingElements.getElementEntryInScopeWithTagName(t.tagName);return n?e.openElements.contains(n.element)?e.openElements.hasInScope(t.tagID)||(n=null):(e.activeFormattingElements.removeEntry(n),n=null):Q(e,t),n}function L(e,t){let n=null,r=e.openElements.stackTop;for(;r>=0;r--){const s=e.openElements.items[r];if(s===t.element)break;e._isSpecialElement(s,e.openElements.tagIDs[r])&&(n=s)}return n||(e.openElements.shortenToLength(r<0?0:r),e.activeFormattingElements.removeEntry(t)),n}function S(e,t,n){let r=t,s=e.openElements.getCommonAncestor(t);for(let i=0,a=s;a!==n;i++,a=s){s=e.openElements.getCommonAncestor(a);const n=e.activeFormattingElements.getElementEntry(a),o=n&&i>=T;!n||o?(o&&e.activeFormattingElements.removeEntry(n),e.openElements.remove(a)):(a=C(e,n),r===t&&(e.activeFormattingElements.bookmark=n),e.treeAdapter.detachNode(r),e.treeAdapter.appendChild(a,r),r=a)}return r}function C(e,t){const n=e.treeAdapter.getNamespaceURI(t.element),r=e.treeAdapter.createElement(t.token.tagName,n,t.token.attrs);return e.openElements.replace(t.element,r),t.element=r,r}function I(e,t,n){const r=e.treeAdapter.getTagName(t),s=(0,u.OL)(r);if(e._isElementCausesFosterParenting(s))e._fosterParentElement(n);else{const r=e.treeAdapter.getNamespaceURI(t);s===u.LB.TEMPLATE&&r===u.NS.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function b(e,t,n){const r=e.treeAdapter.getNamespaceURI(n.element),{token:s}=n,i=e.treeAdapter.createElement(s.tagName,r,s.attrs);e._adoptNodes(t,i),e.treeAdapter.appendChild(t,i),e.activeFormattingElements.insertElementAfterBookmark(i,s),e.activeFormattingElements.removeEntry(n),e.openElements.remove(n.element),e.openElements.insertAfter(t,i,s.tagID)}function D(e,t){for(let n=0;n=n;r--)e._setEndLocation(e.openElements.items[r],t);if(!e.fragmentContext&&e.openElements.stackTop>=0){const n=e.openElements.items[0],r=e.treeAdapter.getNodeSourceCodeLocation(n);if(r&&!r.endTag&&(e._setEndLocation(n,t),e.openElements.stackTop>=1)){const n=e.openElements.items[1],r=e.treeAdapter.getNodeSourceCodeLocation(n);r&&!r.endTag&&e._setEndLocation(n,t)}}}}function B(e,t){e._err(t,l.w.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,u.Bj.QUIRKS),e.insertionMode=m.BEFORE_HTML,e._processToken(t)}function k(e,t){e._insertFakeRootElement(),e.insertionMode=m.BEFORE_HEAD,e._processToken(t)}function y(e,t){e._insertFakeElement(u.ab.HEAD,u.LB.HEAD),e.headElement=e.openElements.current,e.insertionMode=m.IN_HEAD,e._processToken(t)}function M(e,t){switch(t.tagID){case u.LB.HTML:W(e,t);break;case u.LB.BASE:case u.LB.BASEFONT:case u.LB.BGSOUND:case u.LB.LINK:case u.LB.META:e._appendElement(t,u.NS.HTML),t.ackSelfClosing=!0;break;case u.LB.TITLE:e._switchToTextParsing(t,r.P.RCDATA);break;case u.LB.NOSCRIPT:e.options.scriptingEnabled?e._switchToTextParsing(t,r.P.RAWTEXT):(e._insertElement(t,u.NS.HTML),e.insertionMode=m.IN_HEAD_NO_SCRIPT);break;case u.LB.NOFRAMES:case u.LB.STYLE:e._switchToTextParsing(t,r.P.RAWTEXT);break;case u.LB.SCRIPT:e._switchToTextParsing(t,r.P.SCRIPT_DATA);break;case u.LB.TEMPLATE:e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=m.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(m.IN_TEMPLATE);break;case u.LB.HEAD:e._err(t,l.w.misplacedStartTagForHeadElement);break;default:H(e,t)}}function P(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==u.LB.TEMPLATE&&e._err(t,l.w.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(u.LB.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,l.w.endTagWithoutMatchingOpenElement)}function H(e,t){e.openElements.pop(),e.insertionMode=m.AFTER_HEAD,e._processToken(t)}function w(e,t){const n=t.type===d.i.EOF?l.w.openElementsLeftAfterEof:l.w.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=m.IN_HEAD,e._processToken(t)}function v(e,t){e._insertFakeElement(u.ab.BODY,u.LB.BODY),e.insertionMode=m.IN_BODY,x(e,t)}function x(e,t){switch(t.type){case d.i.CHARACTER:F(e,t);break;case d.i.WHITESPACE_CHARACTER:U(e,t);break;case d.i.COMMENT:R(e,t);break;case d.i.START_TAG:W(e,t);break;case d.i.END_TAG:X(e,t);break;case d.i.EOF:j(e,t)}}function U(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function F(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function G(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,u.NS.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function Y(e){const t=(0,d.F)(e,u.Ze.TYPE);return null!=t&&t.toLowerCase()===E}function q(e,t){e._switchToTextParsing(t,r.P.RAWTEXT)}function V(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,u.NS.HTML)}function W(e,t){switch(t.tagID){case u.LB.I:case u.LB.S:case u.LB.B:case u.LB.U:case u.LB.EM:case u.LB.TT:case u.LB.BIG:case u.LB.CODE:case u.LB.FONT:case u.LB.SMALL:case u.LB.STRIKE:case u.LB.STRONG:!function(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,u.NS.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}(e,t);break;case u.LB.A:!function(e,t){const n=e.activeFormattingElements.getElementEntryInScopeWithTagName(u.ab.A);n&&(D(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,u.NS.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}(e,t);break;case u.LB.H1:case u.LB.H2:case u.LB.H3:case u.LB.H4:case u.LB.H5:case u.LB.H6:!function(e,t){e.openElements.hasInButtonScope(u.LB.P)&&e._closePElement(),(0,u.Nc)(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,u.NS.HTML)}(e,t);break;case u.LB.P:case u.LB.DL:case u.LB.OL:case u.LB.UL:case u.LB.DIV:case u.LB.DIR:case u.LB.NAV:case u.LB.MAIN:case u.LB.MENU:case u.LB.ASIDE:case u.LB.CENTER:case u.LB.FIGURE:case u.LB.FOOTER:case u.LB.HEADER:case u.LB.HGROUP:case u.LB.DIALOG:case u.LB.DETAILS:case u.LB.ADDRESS:case u.LB.ARTICLE:case u.LB.SECTION:case u.LB.SUMMARY:case u.LB.FIELDSET:case u.LB.BLOCKQUOTE:case u.LB.FIGCAPTION:!function(e,t){e.openElements.hasInButtonScope(u.LB.P)&&e._closePElement(),e._insertElement(t,u.NS.HTML)}(e,t);break;case u.LB.LI:case u.LB.DD:case u.LB.DT:!function(e,t){e.framesetOk=!1;const n=t.tagID;for(let t=e.openElements.stackTop;t>=0;t--){const r=e.openElements.tagIDs[t];if(n===u.LB.LI&&r===u.LB.LI||(n===u.LB.DD||n===u.LB.DT)&&(r===u.LB.DD||r===u.LB.DT)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.popUntilTagNamePopped(r);break}if(r!==u.LB.ADDRESS&&r!==u.LB.DIV&&r!==u.LB.P&&e._isSpecialElement(e.openElements.items[t],r))break}e.openElements.hasInButtonScope(u.LB.P)&&e._closePElement(),e._insertElement(t,u.NS.HTML)}(e,t);break;case u.LB.BR:case u.LB.IMG:case u.LB.WBR:case u.LB.AREA:case u.LB.EMBED:case u.LB.KEYGEN:G(e,t);break;case u.LB.HR:!function(e,t){e.openElements.hasInButtonScope(u.LB.P)&&e._closePElement(),e._appendElement(t,u.NS.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}(e,t);break;case u.LB.RB:case u.LB.RTC:!function(e,t){e.openElements.hasInScope(u.LB.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,u.NS.HTML)}(e,t);break;case u.LB.RT:case u.LB.RP:!function(e,t){e.openElements.hasInScope(u.LB.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(u.LB.RTC),e._insertElement(t,u.NS.HTML)}(e,t);break;case u.LB.PRE:case u.LB.LISTING:!function(e,t){e.openElements.hasInButtonScope(u.LB.P)&&e._closePElement(),e._insertElement(t,u.NS.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}(e,t);break;case u.LB.XMP:!function(e,t){e.openElements.hasInButtonScope(u.LB.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,r.P.RAWTEXT)}(e,t);break;case u.LB.SVG:!function(e,t){e._reconstructActiveFormattingElements(),c.NV(t),c.cS(t),t.selfClosing?e._appendElement(t,u.NS.SVG):e._insertElement(t,u.NS.SVG),t.ackSelfClosing=!0}(e,t);break;case u.LB.HTML:!function(e,t){0===e.openElements.tmplCount&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}(e,t);break;case u.LB.BASE:case u.LB.LINK:case u.LB.META:case u.LB.STYLE:case u.LB.TITLE:case u.LB.SCRIPT:case u.LB.BGSOUND:case u.LB.BASEFONT:case u.LB.TEMPLATE:M(e,t);break;case u.LB.BODY:!function(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&0===e.openElements.tmplCount&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}(e,t);break;case u.LB.FORM:!function(e,t){const n=e.openElements.tmplCount>0;e.formElement&&!n||(e.openElements.hasInButtonScope(u.LB.P)&&e._closePElement(),e._insertElement(t,u.NS.HTML),n||(e.formElement=e.openElements.current))}(e,t);break;case u.LB.NOBR:!function(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(u.LB.NOBR)&&(D(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,u.NS.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}(e,t);break;case u.LB.MATH:!function(e,t){e._reconstructActiveFormattingElements(),c.ii(t),c.cS(t),t.selfClosing?e._appendElement(t,u.NS.MATHML):e._insertElement(t,u.NS.MATHML),t.ackSelfClosing=!0}(e,t);break;case u.LB.TABLE:!function(e,t){e.treeAdapter.getDocumentMode(e.document)!==u.Bj.QUIRKS&&e.openElements.hasInButtonScope(u.LB.P)&&e._closePElement(),e._insertElement(t,u.NS.HTML),e.framesetOk=!1,e.insertionMode=m.IN_TABLE}(e,t);break;case u.LB.INPUT:!function(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,u.NS.HTML),Y(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}(e,t);break;case u.LB.PARAM:case u.LB.TRACK:case u.LB.SOURCE:!function(e,t){e._appendElement(t,u.NS.HTML),t.ackSelfClosing=!0}(e,t);break;case u.LB.IMAGE:!function(e,t){t.tagName=u.ab.IMG,t.tagID=u.LB.IMG,G(e,t)}(e,t);break;case u.LB.BUTTON:!function(e,t){e.openElements.hasInScope(u.LB.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(u.LB.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,u.NS.HTML),e.framesetOk=!1}(e,t);break;case u.LB.APPLET:case u.LB.OBJECT:case u.LB.MARQUEE:!function(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,u.NS.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}(e,t);break;case u.LB.IFRAME:!function(e,t){e.framesetOk=!1,e._switchToTextParsing(t,r.P.RAWTEXT)}(e,t);break;case u.LB.SELECT:!function(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,u.NS.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===m.IN_TABLE||e.insertionMode===m.IN_CAPTION||e.insertionMode===m.IN_TABLE_BODY||e.insertionMode===m.IN_ROW||e.insertionMode===m.IN_CELL?m.IN_SELECT_IN_TABLE:m.IN_SELECT}(e,t);break;case u.LB.OPTION:case u.LB.OPTGROUP:!function(e,t){e.openElements.currentTagId===u.LB.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,u.NS.HTML)}(e,t);break;case u.LB.NOEMBED:q(e,t);break;case u.LB.FRAMESET:!function(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,u.NS.HTML),e.insertionMode=m.IN_FRAMESET)}(e,t);break;case u.LB.TEXTAREA:!function(e,t){e._insertElement(t,u.NS.HTML),e.skipNextNewLine=!0,e.tokenizer.state=r.P.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=m.TEXT}(e,t);break;case u.LB.NOSCRIPT:e.options.scriptingEnabled?q(e,t):V(e,t);break;case u.LB.PLAINTEXT:!function(e,t){e.openElements.hasInButtonScope(u.LB.P)&&e._closePElement(),e._insertElement(t,u.NS.HTML),e.tokenizer.state=r.P.PLAINTEXT}(e,t);break;case u.LB.COL:case u.LB.TH:case u.LB.TD:case u.LB.TR:case u.LB.HEAD:case u.LB.FRAME:case u.LB.TBODY:case u.LB.TFOOT:case u.LB.THEAD:case u.LB.CAPTION:case u.LB.COLGROUP:break;default:V(e,t)}}function Q(e,t){const n=t.tagName,r=t.tagID;for(let t=e.openElements.stackTop;t>0;t--){const s=e.openElements.items[t],i=e.openElements.tagIDs[t];if(r===i&&(r!==u.LB.UNKNOWN||e.treeAdapter.getTagName(s)===n)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.stackTop>=t&&e.openElements.shortenToLength(t);break}if(e._isSpecialElement(s,i))break}}function X(e,t){switch(t.tagID){case u.LB.A:case u.LB.B:case u.LB.I:case u.LB.S:case u.LB.U:case u.LB.EM:case u.LB.TT:case u.LB.BIG:case u.LB.CODE:case u.LB.FONT:case u.LB.NOBR:case u.LB.SMALL:case u.LB.STRIKE:case u.LB.STRONG:D(e,t);break;case u.LB.P:!function(e){e.openElements.hasInButtonScope(u.LB.P)||e._insertFakeElement(u.ab.P,u.LB.P),e._closePElement()}(e);break;case u.LB.DL:case u.LB.UL:case u.LB.OL:case u.LB.DIR:case u.LB.DIV:case u.LB.NAV:case u.LB.PRE:case u.LB.MAIN:case u.LB.MENU:case u.LB.ASIDE:case u.LB.BUTTON:case u.LB.CENTER:case u.LB.FIGURE:case u.LB.FOOTER:case u.LB.HEADER:case u.LB.HGROUP:case u.LB.DIALOG:case u.LB.ADDRESS:case u.LB.ARTICLE:case u.LB.DETAILS:case u.LB.SECTION:case u.LB.SUMMARY:case u.LB.LISTING:case u.LB.FIELDSET:case u.LB.BLOCKQUOTE:case u.LB.FIGCAPTION:!function(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}(e,t);break;case u.LB.LI:!function(e){e.openElements.hasInListItemScope(u.LB.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(u.LB.LI),e.openElements.popUntilTagNamePopped(u.LB.LI))}(e);break;case u.LB.DD:case u.LB.DT:!function(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}(e,t);break;case u.LB.H1:case u.LB.H2:case u.LB.H3:case u.LB.H4:case u.LB.H5:case u.LB.H6:!function(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}(e);break;case u.LB.BR:!function(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(u.ab.BR,u.LB.BR),e.openElements.pop(),e.framesetOk=!1}(e);break;case u.LB.BODY:!function(e,t){if(e.openElements.hasInScope(u.LB.BODY)&&(e.insertionMode=m.AFTER_BODY,e.options.sourceCodeLocationInfo)){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}(e,t);break;case u.LB.HTML:!function(e,t){e.openElements.hasInScope(u.LB.BODY)&&(e.insertionMode=m.AFTER_BODY,de(e,t))}(e,t);break;case u.LB.FORM:!function(e){const t=e.openElements.tmplCount>0,{formElement:n}=e;t||(e.formElement=null),(n||t)&&e.openElements.hasInScope(u.LB.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(u.LB.FORM):n&&e.openElements.remove(n))}(e);break;case u.LB.APPLET:case u.LB.OBJECT:case u.LB.MARQUEE:!function(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}(e,t);break;case u.LB.TEMPLATE:P(e,t);break;default:Q(e,t)}}function j(e,t){e.tmplInsertionModeStack.length>0?ue(e,t):O(e,t)}function K(e,t){if(A.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=m.IN_TABLE_TEXT,t.type){case d.i.CHARACTER:ee(e,t);break;case d.i.WHITESPACE_CHARACTER:J(e,t)}else Z(e,t)}function z(e,t){switch(t.tagID){case u.LB.TD:case u.LB.TH:case u.LB.TR:!function(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(u.ab.TBODY,u.LB.TBODY),e.insertionMode=m.IN_TABLE_BODY,ie(e,t)}(e,t);break;case u.LB.STYLE:case u.LB.SCRIPT:case u.LB.TEMPLATE:M(e,t);break;case u.LB.COL:!function(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(u.ab.COLGROUP,u.LB.COLGROUP),e.insertionMode=m.IN_COLUMN_GROUP,re(e,t)}(e,t);break;case u.LB.FORM:!function(e,t){e.formElement||0!==e.openElements.tmplCount||(e._insertElement(t,u.NS.HTML),e.formElement=e.openElements.current,e.openElements.pop())}(e,t);break;case u.LB.TABLE:!function(e,t){e.openElements.hasInTableScope(u.LB.TABLE)&&(e.openElements.popUntilTagNamePopped(u.LB.TABLE),e._resetInsertionMode(),e._processStartTag(t))}(e,t);break;case u.LB.TBODY:case u.LB.TFOOT:case u.LB.THEAD:!function(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,u.NS.HTML),e.insertionMode=m.IN_TABLE_BODY}(e,t);break;case u.LB.INPUT:!function(e,t){Y(t)?e._appendElement(t,u.NS.HTML):Z(e,t),t.ackSelfClosing=!0}(e,t);break;case u.LB.CAPTION:!function(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,u.NS.HTML),e.insertionMode=m.IN_CAPTION}(e,t);break;case u.LB.COLGROUP:!function(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,u.NS.HTML),e.insertionMode=m.IN_COLUMN_GROUP}(e,t);break;default:Z(e,t)}}function $(e,t){switch(t.tagID){case u.LB.TABLE:e.openElements.hasInTableScope(u.LB.TABLE)&&(e.openElements.popUntilTagNamePopped(u.LB.TABLE),e._resetInsertionMode());break;case u.LB.TEMPLATE:P(e,t);break;case u.LB.BODY:case u.LB.CAPTION:case u.LB.COL:case u.LB.COLGROUP:case u.LB.HTML:case u.LB.TBODY:case u.LB.TD:case u.LB.TFOOT:case u.LB.TH:case u.LB.THEAD:case u.LB.TR:break;default:Z(e,t)}}function Z(e,t){const n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,x(e,t),e.fosterParentingEnabled=n}function J(e,t){e.pendingCharacterTokens.push(t)}function ee(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function te(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n0&&e.openElements.currentTagId===u.LB.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===u.LB.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===u.LB.OPTGROUP&&e.openElements.pop();break;case u.LB.OPTION:e.openElements.currentTagId===u.LB.OPTION&&e.openElements.pop();break;case u.LB.SELECT:e.openElements.hasInSelectScope(u.LB.SELECT)&&(e.openElements.popUntilTagNamePopped(u.LB.SELECT),e._resetInsertionMode());break;case u.LB.TEMPLATE:P(e,t)}}function ue(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(u.LB.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):O(e,t)}function de(e,t){var n;if(t.tagID===u.LB.HTML){if(e.fragmentContext||(e.insertionMode=m.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===u.LB.HTML){e._setEndLocation(e.openElements.items[0],t);const r=e.openElements.items[1];r&&!(null===(n=e.treeAdapter.getNodeSourceCodeLocation(r))||void 0===n?void 0:n.endTag)&&e._setEndLocation(r,t)}}else Ee(e,t)}function Ee(e,t){e.insertionMode=m.IN_BODY,x(e,t)}function pe(e,t){e.insertionMode=m.IN_BODY,x(e,t)}function Te(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==u.NS.HTML&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}},4285:(e,t,n)=>{"use strict";n.d(t,{X:()=>d});var r=n(9776);const s=new Set([r.LB.DD,r.LB.DT,r.LB.LI,r.LB.OPTGROUP,r.LB.OPTION,r.LB.P,r.LB.RB,r.LB.RP,r.LB.RT,r.LB.RTC]),i=new Set([...s,r.LB.CAPTION,r.LB.COLGROUP,r.LB.TBODY,r.LB.TD,r.LB.TFOOT,r.LB.TH,r.LB.THEAD,r.LB.TR]),a=new Map([[r.LB.APPLET,r.NS.HTML],[r.LB.CAPTION,r.NS.HTML],[r.LB.HTML,r.NS.HTML],[r.LB.MARQUEE,r.NS.HTML],[r.LB.OBJECT,r.NS.HTML],[r.LB.TABLE,r.NS.HTML],[r.LB.TD,r.NS.HTML],[r.LB.TEMPLATE,r.NS.HTML],[r.LB.TH,r.NS.HTML],[r.LB.ANNOTATION_XML,r.NS.MATHML],[r.LB.MI,r.NS.MATHML],[r.LB.MN,r.NS.MATHML],[r.LB.MO,r.NS.MATHML],[r.LB.MS,r.NS.MATHML],[r.LB.MTEXT,r.NS.MATHML],[r.LB.DESC,r.NS.SVG],[r.LB.FOREIGN_OBJECT,r.NS.SVG],[r.LB.TITLE,r.NS.SVG]]),o=[r.LB.H1,r.LB.H2,r.LB.H3,r.LB.H4,r.LB.H5,r.LB.H6],c=[r.LB.TR,r.LB.TEMPLATE,r.LB.HTML],l=[r.LB.TBODY,r.LB.TFOOT,r.LB.THEAD,r.LB.TEMPLATE,r.LB.HTML],h=[r.LB.TABLE,r.LB.TEMPLATE,r.LB.HTML],u=[r.LB.TD,r.LB.TH];class d{get currentTmplContentOrNode(){return this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):this.current}constructor(e,t,n){this.treeAdapter=t,this.handler=n,this.items=[],this.tagIDs=[],this.stackTop=-1,this.tmplCount=0,this.currentTagId=r.LB.UNKNOWN,this.current=e}_indexOf(e){return this.items.lastIndexOf(e,this.stackTop)}_isInTemplate(){return this.currentTagId===r.LB.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===r.NS.HTML}_updateCurrentElement(){this.current=this.items[this.stackTop],this.currentTagId=this.tagIDs[this.stackTop]}push(e,t){this.stackTop++,this.items[this.stackTop]=e,this.current=e,this.tagIDs[this.stackTop]=t,this.currentTagId=t,this._isInTemplate()&&this.tmplCount++,this.handler.onItemPush(e,t,!0)}pop(){const e=this.current;this.tmplCount>0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(e,!0)}replace(e,t){const n=this._indexOf(e);this.items[n]=t,n===this.stackTop&&(this.current=t)}insertAfter(e,t,n){const r=this._indexOf(e)+1;this.items.splice(r,0,t),this.tagIDs.splice(r,0,n),this.stackTop++,r===this.stackTop&&this._updateCurrentElement(),this.handler.onItemPush(this.current,this.currentTagId,r===this.stackTop)}popUntilTagNamePopped(e){let t=this.stackTop+1;do{t=this.tagIDs.lastIndexOf(e,t-1)}while(t>0&&this.treeAdapter.getNamespaceURI(this.items[t])!==r.NS.HTML);this.shortenToLength(t<0?0:t)}shortenToLength(e){for(;this.stackTop>=e;){const t=this.current;this.tmplCount>0&&this._isInTemplate()&&(this.tmplCount-=1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,this.stackTop=0;n--)if(e.includes(this.tagIDs[n])&&this.treeAdapter.getNamespaceURI(this.items[n])===t)return n;return-1}clearBackTo(e,t){const n=this._indexOfTagNames(e,t);this.shortenToLength(n+1)}clearBackToTableContext(){this.clearBackTo(h,r.NS.HTML)}clearBackToTableBodyContext(){this.clearBackTo(l,r.NS.HTML)}clearBackToTableRowContext(){this.clearBackTo(c,r.NS.HTML)}remove(e){const t=this._indexOf(e);t>=0&&(t===this.stackTop?this.pop():(this.items.splice(t,1),this.tagIDs.splice(t,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(e,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===r.LB.BODY?this.items[1]:null}contains(e){return this._indexOf(e)>-1}getCommonAncestor(e){const t=this._indexOf(e)-1;return t>=0?this.items[t]:null}isRootHtmlElementCurrent(){return 0===this.stackTop&&this.tagIDs[0]===r.LB.HTML}hasInScope(e){for(let t=this.stackTop;t>=0;t--){const n=this.tagIDs[t],s=this.treeAdapter.getNamespaceURI(this.items[t]);if(n===e&&s===r.NS.HTML)return!0;if(a.get(n)===s)return!1}return!0}hasNumberedHeaderInScope(){for(let e=this.stackTop;e>=0;e--){const t=this.tagIDs[e],n=this.treeAdapter.getNamespaceURI(this.items[e]);if((0,r.Nc)(t)&&n===r.NS.HTML)return!0;if(a.get(t)===n)return!1}return!0}hasInListItemScope(e){for(let t=this.stackTop;t>=0;t--){const n=this.tagIDs[t],s=this.treeAdapter.getNamespaceURI(this.items[t]);if(n===e&&s===r.NS.HTML)return!0;if((n===r.LB.UL||n===r.LB.OL)&&s===r.NS.HTML||a.get(n)===s)return!1}return!0}hasInButtonScope(e){for(let t=this.stackTop;t>=0;t--){const n=this.tagIDs[t],s=this.treeAdapter.getNamespaceURI(this.items[t]);if(n===e&&s===r.NS.HTML)return!0;if(n===r.LB.BUTTON&&s===r.NS.HTML||a.get(n)===s)return!1}return!0}hasInTableScope(e){for(let t=this.stackTop;t>=0;t--){const n=this.tagIDs[t];if(this.treeAdapter.getNamespaceURI(this.items[t])===r.NS.HTML){if(n===e)return!0;if(n===r.LB.TABLE||n===r.LB.TEMPLATE||n===r.LB.HTML)return!1}}return!0}hasTableBodyContextInTableScope(){for(let e=this.stackTop;e>=0;e--){const t=this.tagIDs[e];if(this.treeAdapter.getNamespaceURI(this.items[e])===r.NS.HTML){if(t===r.LB.TBODY||t===r.LB.THEAD||t===r.LB.TFOOT)return!0;if(t===r.LB.TABLE||t===r.LB.HTML)return!1}}return!0}hasInSelectScope(e){for(let t=this.stackTop;t>=0;t--){const n=this.tagIDs[t];if(this.treeAdapter.getNamespaceURI(this.items[t])===r.NS.HTML){if(n===e)return!0;if(n!==r.LB.OPTION&&n!==r.LB.OPTGROUP)return!1}}return!0}generateImpliedEndTags(){for(;s.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;i.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(e){for(;this.currentTagId!==e&&i.has(this.currentTagId);)this.pop()}}},905:(e,t,n)=>{"use strict";n.d(t,{R:()=>c});var r=n(9776),s=n(3470),i=n(8747);const a=new Set([r.ab.AREA,r.ab.BASE,r.ab.BASEFONT,r.ab.BGSOUND,r.ab.BR,r.ab.COL,r.ab.EMBED,r.ab.FRAME,r.ab.HR,r.ab.IMG,r.ab.INPUT,r.ab.KEYGEN,r.ab.LINK,r.ab.META,r.ab.PARAM,r.ab.SOURCE,r.ab.TRACK,r.ab.WBR]);const o={treeAdapter:i.g,scriptingEnabled:!0};function c(e,t){return l(e,{...o,...t})}function l(e,t){return t.treeAdapter.isElementNode(e)?function(e,t){const n=t.treeAdapter.getTagName(e);return`<${n}${function(e,{treeAdapter:t}){let n="";for(const i of t.getAttrList(e)){if(n+=" ",i.namespace)switch(i.namespace){case r.NS.XML:n+=`xml:${i.name}`;break;case r.NS.XMLNS:"xmlns"!==i.name&&(n+="xmlns:"),n+=i.name;break;case r.NS.XLINK:n+=`xlink:${i.name}`;break;default:n+=`${i.prefix}:${i.name}`}else n+=i.name;n+=`="${(0,s.kb)(i.value)}"`}return n}(e,t)}>${function(e,t){return t.treeAdapter.isElementNode(e)&&t.treeAdapter.getNamespaceURI(e)===r.NS.HTML&&a.has(t.treeAdapter.getTagName(e))}(e,t)?"":`${function(e,t){let n="";const s=t.treeAdapter.isElementNode(e)&&t.treeAdapter.getTagName(e)===r.ab.TEMPLATE&&t.treeAdapter.getNamespaceURI(e)===r.NS.HTML?t.treeAdapter.getTemplateContent(e):e,i=t.treeAdapter.getChildNodes(s);if(i)for(const e of i)n+=l(e,t);return n}(e,t)}${n}>`}`}(e,t):t.treeAdapter.isTextNode(e)?function(e,t){const{treeAdapter:n}=t,i=n.getTextNodeContent(e),a=n.getParentNode(e),o=a&&n.isElementNode(a)&&n.getTagName(a);return o&&n.getNamespaceURI(a)===r.NS.HTML&&(0,r.UG)(o,t.scriptingEnabled)?i:(0,s.bk)(i)}(e,t):t.treeAdapter.isCommentNode(e)?function(e,{treeAdapter:t}){return`\x3c!--${t.getCommentNodeContent(e)}--\x3e`}(e,t):t.treeAdapter.isDocumentTypeNode(e)?function(e,{treeAdapter:t}){return``}(e,t):""}},8628:(e,t,n)=>{"use strict";n.d(t,{P:()=>u,d:()=>N});var r=n(7808),s=n(7853),i=n(5746),a=n(1312),o=n(826),c=n(9776);const l=new Map([[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);var h;!function(e){e[e.DATA=0]="DATA",e[e.RCDATA=1]="RCDATA",e[e.RAWTEXT=2]="RAWTEXT",e[e.SCRIPT_DATA=3]="SCRIPT_DATA",e[e.PLAINTEXT=4]="PLAINTEXT",e[e.TAG_OPEN=5]="TAG_OPEN",e[e.END_TAG_OPEN=6]="END_TAG_OPEN",e[e.TAG_NAME=7]="TAG_NAME",e[e.RCDATA_LESS_THAN_SIGN=8]="RCDATA_LESS_THAN_SIGN",e[e.RCDATA_END_TAG_OPEN=9]="RCDATA_END_TAG_OPEN",e[e.RCDATA_END_TAG_NAME=10]="RCDATA_END_TAG_NAME",e[e.RAWTEXT_LESS_THAN_SIGN=11]="RAWTEXT_LESS_THAN_SIGN",e[e.RAWTEXT_END_TAG_OPEN=12]="RAWTEXT_END_TAG_OPEN",e[e.RAWTEXT_END_TAG_NAME=13]="RAWTEXT_END_TAG_NAME",e[e.SCRIPT_DATA_LESS_THAN_SIGN=14]="SCRIPT_DATA_LESS_THAN_SIGN",e[e.SCRIPT_DATA_END_TAG_OPEN=15]="SCRIPT_DATA_END_TAG_OPEN",e[e.SCRIPT_DATA_END_TAG_NAME=16]="SCRIPT_DATA_END_TAG_NAME",e[e.SCRIPT_DATA_ESCAPE_START=17]="SCRIPT_DATA_ESCAPE_START",e[e.SCRIPT_DATA_ESCAPE_START_DASH=18]="SCRIPT_DATA_ESCAPE_START_DASH",e[e.SCRIPT_DATA_ESCAPED=19]="SCRIPT_DATA_ESCAPED",e[e.SCRIPT_DATA_ESCAPED_DASH=20]="SCRIPT_DATA_ESCAPED_DASH",e[e.SCRIPT_DATA_ESCAPED_DASH_DASH=21]="SCRIPT_DATA_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]="SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]="SCRIPT_DATA_ESCAPED_END_TAG_OPEN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]="SCRIPT_DATA_ESCAPED_END_TAG_NAME",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]="SCRIPT_DATA_DOUBLE_ESCAPE_START",e[e.SCRIPT_DATA_DOUBLE_ESCAPED=26]="SCRIPT_DATA_DOUBLE_ESCAPED",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]="SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]="SCRIPT_DATA_DOUBLE_ESCAPE_END",e[e.BEFORE_ATTRIBUTE_NAME=31]="BEFORE_ATTRIBUTE_NAME",e[e.ATTRIBUTE_NAME=32]="ATTRIBUTE_NAME",e[e.AFTER_ATTRIBUTE_NAME=33]="AFTER_ATTRIBUTE_NAME",e[e.BEFORE_ATTRIBUTE_VALUE=34]="BEFORE_ATTRIBUTE_VALUE",e[e.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]="ATTRIBUTE_VALUE_DOUBLE_QUOTED",e[e.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]="ATTRIBUTE_VALUE_SINGLE_QUOTED",e[e.ATTRIBUTE_VALUE_UNQUOTED=37]="ATTRIBUTE_VALUE_UNQUOTED",e[e.AFTER_ATTRIBUTE_VALUE_QUOTED=38]="AFTER_ATTRIBUTE_VALUE_QUOTED",e[e.SELF_CLOSING_START_TAG=39]="SELF_CLOSING_START_TAG",e[e.BOGUS_COMMENT=40]="BOGUS_COMMENT",e[e.MARKUP_DECLARATION_OPEN=41]="MARKUP_DECLARATION_OPEN",e[e.COMMENT_START=42]="COMMENT_START",e[e.COMMENT_START_DASH=43]="COMMENT_START_DASH",e[e.COMMENT=44]="COMMENT",e[e.COMMENT_LESS_THAN_SIGN=45]="COMMENT_LESS_THAN_SIGN",e[e.COMMENT_LESS_THAN_SIGN_BANG=46]="COMMENT_LESS_THAN_SIGN_BANG",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]="COMMENT_LESS_THAN_SIGN_BANG_DASH",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]="COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH",e[e.COMMENT_END_DASH=49]="COMMENT_END_DASH",e[e.COMMENT_END=50]="COMMENT_END",e[e.COMMENT_END_BANG=51]="COMMENT_END_BANG",e[e.DOCTYPE=52]="DOCTYPE",e[e.BEFORE_DOCTYPE_NAME=53]="BEFORE_DOCTYPE_NAME",e[e.DOCTYPE_NAME=54]="DOCTYPE_NAME",e[e.AFTER_DOCTYPE_NAME=55]="AFTER_DOCTYPE_NAME",e[e.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]="AFTER_DOCTYPE_PUBLIC_KEYWORD",e[e.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]="BEFORE_DOCTYPE_PUBLIC_IDENTIFIER",e[e.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]="AFTER_DOCTYPE_PUBLIC_IDENTIFIER",e[e.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]="BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS",e[e.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]="AFTER_DOCTYPE_SYSTEM_KEYWORD",e[e.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]="BEFORE_DOCTYPE_SYSTEM_IDENTIFIER",e[e.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]="AFTER_DOCTYPE_SYSTEM_IDENTIFIER",e[e.BOGUS_DOCTYPE=67]="BOGUS_DOCTYPE",e[e.CDATA_SECTION=68]="CDATA_SECTION",e[e.CDATA_SECTION_BRACKET=69]="CDATA_SECTION_BRACKET",e[e.CDATA_SECTION_END=70]="CDATA_SECTION_END",e[e.CHARACTER_REFERENCE=71]="CHARACTER_REFERENCE",e[e.NAMED_CHARACTER_REFERENCE=72]="NAMED_CHARACTER_REFERENCE",e[e.AMBIGUOUS_AMPERSAND=73]="AMBIGUOUS_AMPERSAND",e[e.NUMERIC_CHARACTER_REFERENCE=74]="NUMERIC_CHARACTER_REFERENCE",e[e.HEXADEMICAL_CHARACTER_REFERENCE_START=75]="HEXADEMICAL_CHARACTER_REFERENCE_START",e[e.HEXADEMICAL_CHARACTER_REFERENCE=76]="HEXADEMICAL_CHARACTER_REFERENCE",e[e.DECIMAL_CHARACTER_REFERENCE=77]="DECIMAL_CHARACTER_REFERENCE",e[e.NUMERIC_CHARACTER_REFERENCE_END=78]="NUMERIC_CHARACTER_REFERENCE_END"}(h||(h={}));const u={DATA:h.DATA,RCDATA:h.RCDATA,RAWTEXT:h.RAWTEXT,SCRIPT_DATA:h.SCRIPT_DATA,PLAINTEXT:h.PLAINTEXT,CDATA_SECTION:h.CDATA_SECTION};function d(e){return e>=s.gH.DIGIT_0&&e<=s.gH.DIGIT_9}function E(e){return e>=s.gH.LATIN_CAPITAL_A&&e<=s.gH.LATIN_CAPITAL_Z}function p(e){return function(e){return e>=s.gH.LATIN_SMALL_A&&e<=s.gH.LATIN_SMALL_Z}(e)||E(e)}function T(e){return p(e)||d(e)}function m(e){return e>=s.gH.LATIN_CAPITAL_A&&e<=s.gH.LATIN_CAPITAL_F}function f(e){return e>=s.gH.LATIN_SMALL_A&&e<=s.gH.LATIN_SMALL_F}function A(e){return e+32}function g(e){return e===s.gH.SPACE||e===s.gH.LINE_FEED||e===s.gH.TABULATION||e===s.gH.FORM_FEED}function _(e){return g(e)||e===s.gH.SOLIDUS||e===s.gH.GREATER_THAN_SIGN}class N{constructor(e,t){this.options=e,this.handler=t,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName="",this.active=!1,this.state=h.DATA,this.returnState=h.DATA,this.charRefCode=-1,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new r.A(t),this.currentLocation=this.getCurrentLocation(-1)}_err(e){var t,n;null===(n=(t=this.handler).onParseError)||void 0===n||n.call(t,this.preprocessor.getError(e))}getCurrentLocation(e){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-e,startOffset:this.preprocessor.offset-e,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;const e=this._consume();this._ensureHibernation()||this._callState(e)}this.inLoop=!1}}pause(){this.paused=!0}resume(e){if(!this.paused)throw new Error("Parser was already resumed");this.paused=!1,this.inLoop||(this._runParsingLoop(),this.paused||null==e||e())}write(e,t,n){this.active=!0,this.preprocessor.write(e,t),this._runParsingLoop(),this.paused||null==n||n()}insertHtmlAtCurrentPos(e){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(e),this._runParsingLoop()}_ensureHibernation(){return!!this.preprocessor.endOfChunkHit&&(this._unconsume(this.consumedAfterSnapshot),this.active=!1,!0)}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_unconsume(e){this.consumedAfterSnapshot-=e,this.preprocessor.retreat(e)}_reconsumeInState(e,t){this.state=e,this._callState(t)}_advanceBy(e){this.consumedAfterSnapshot+=e;for(let t=0;t0&&this._err(o.w.endTagWithAttributes),e.selfClosing&&this._err(o.w.endTagWithTrailingSolidus),this.handler.onEndTag(e)),this.preprocessor.dropParsedChunk()}emitCurrentComment(e){this.prepareToken(e),this.handler.onComment(e),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(e){this.prepareToken(e),this.handler.onDoctype(e),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(e){if(this.currentCharacterToken){switch(e&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=e.startLine,this.currentCharacterToken.location.endCol=e.startCol,this.currentCharacterToken.location.endOffset=e.startOffset),this.currentCharacterToken.type){case i.i.CHARACTER:this.handler.onCharacter(this.currentCharacterToken);break;case i.i.NULL_CHARACTER:this.handler.onNullCharacter(this.currentCharacterToken);break;case i.i.WHITESPACE_CHARACTER:this.handler.onWhitespaceCharacter(this.currentCharacterToken)}this.currentCharacterToken=null}}_emitEOFToken(){const e=this.getCurrentLocation(0);e&&(e.endLine=e.startLine,e.endCol=e.startCol,e.endOffset=e.startOffset),this._emitCurrentCharacterToken(e),this.handler.onEof({type:i.i.EOF,location:e}),this.active=!1}_appendCharToCurrentCharacterToken(e,t){if(this.currentCharacterToken){if(this.currentCharacterToken.type===e)return void(this.currentCharacterToken.chars+=t);this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk()}this._createCharacterToken(e,t)}_emitCodePoint(e){const t=g(e)?i.i.WHITESPACE_CHARACTER:e===s.gH.NULL?i.i.NULL_CHARACTER:i.i.CHARACTER;this._appendCharToCurrentCharacterToken(t,String.fromCodePoint(e))}_emitChars(e){this._appendCharToCurrentCharacterToken(i.i.CHARACTER,e)}_matchNamedCharacterReference(e){let t=null,n=0,r=!1;for(let o=0,c=a.HP[0];o>=0&&(o=(0,a.Go)(a.HP,c,o+1,e),!(o<0));e=this._consume()){n+=1,c=a.HP[o];const l=c&a.ge.VALUE_LENGTH;if(l){const c=(l>>14)-1;if(e!==s.gH.SEMICOLON&&this._isCharacterReferenceInAttribute()&&((i=this.preprocessor.peek(1))===s.gH.EQUALS_SIGN||T(i))?(t=[s.gH.AMPERSAND],o+=c):(t=0===c?[a.HP[o]&~a.ge.VALUE_LENGTH]:1===c?[a.HP[++o]]:[a.HP[++o],a.HP[++o]],n=0,r=e!==s.gH.SEMICOLON),0===c){this._consume();break}}}var i;return this._unconsume(n),r&&!this.preprocessor.endOfChunkHit&&this._err(o.w.missingSemicolonAfterCharacterReference),this._unconsume(1),t}_isCharacterReferenceInAttribute(){return this.returnState===h.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===h.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===h.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(e){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(e):this._emitCodePoint(e)}_callState(e){switch(this.state){case h.DATA:this._stateData(e);break;case h.RCDATA:this._stateRcdata(e);break;case h.RAWTEXT:this._stateRawtext(e);break;case h.SCRIPT_DATA:this._stateScriptData(e);break;case h.PLAINTEXT:this._statePlaintext(e);break;case h.TAG_OPEN:this._stateTagOpen(e);break;case h.END_TAG_OPEN:this._stateEndTagOpen(e);break;case h.TAG_NAME:this._stateTagName(e);break;case h.RCDATA_LESS_THAN_SIGN:this._stateRcdataLessThanSign(e);break;case h.RCDATA_END_TAG_OPEN:this._stateRcdataEndTagOpen(e);break;case h.RCDATA_END_TAG_NAME:this._stateRcdataEndTagName(e);break;case h.RAWTEXT_LESS_THAN_SIGN:this._stateRawtextLessThanSign(e);break;case h.RAWTEXT_END_TAG_OPEN:this._stateRawtextEndTagOpen(e);break;case h.RAWTEXT_END_TAG_NAME:this._stateRawtextEndTagName(e);break;case h.SCRIPT_DATA_LESS_THAN_SIGN:this._stateScriptDataLessThanSign(e);break;case h.SCRIPT_DATA_END_TAG_OPEN:this._stateScriptDataEndTagOpen(e);break;case h.SCRIPT_DATA_END_TAG_NAME:this._stateScriptDataEndTagName(e);break;case h.SCRIPT_DATA_ESCAPE_START:this._stateScriptDataEscapeStart(e);break;case h.SCRIPT_DATA_ESCAPE_START_DASH:this._stateScriptDataEscapeStartDash(e);break;case h.SCRIPT_DATA_ESCAPED:this._stateScriptDataEscaped(e);break;case h.SCRIPT_DATA_ESCAPED_DASH:this._stateScriptDataEscapedDash(e);break;case h.SCRIPT_DATA_ESCAPED_DASH_DASH:this._stateScriptDataEscapedDashDash(e);break;case h.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:this._stateScriptDataEscapedLessThanSign(e);break;case h.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:this._stateScriptDataEscapedEndTagOpen(e);break;case h.SCRIPT_DATA_ESCAPED_END_TAG_NAME:this._stateScriptDataEscapedEndTagName(e);break;case h.SCRIPT_DATA_DOUBLE_ESCAPE_START:this._stateScriptDataDoubleEscapeStart(e);break;case h.SCRIPT_DATA_DOUBLE_ESCAPED:this._stateScriptDataDoubleEscaped(e);break;case h.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:this._stateScriptDataDoubleEscapedDash(e);break;case h.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:this._stateScriptDataDoubleEscapedDashDash(e);break;case h.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:this._stateScriptDataDoubleEscapedLessThanSign(e);break;case h.SCRIPT_DATA_DOUBLE_ESCAPE_END:this._stateScriptDataDoubleEscapeEnd(e);break;case h.BEFORE_ATTRIBUTE_NAME:this._stateBeforeAttributeName(e);break;case h.ATTRIBUTE_NAME:this._stateAttributeName(e);break;case h.AFTER_ATTRIBUTE_NAME:this._stateAfterAttributeName(e);break;case h.BEFORE_ATTRIBUTE_VALUE:this._stateBeforeAttributeValue(e);break;case h.ATTRIBUTE_VALUE_DOUBLE_QUOTED:this._stateAttributeValueDoubleQuoted(e);break;case h.ATTRIBUTE_VALUE_SINGLE_QUOTED:this._stateAttributeValueSingleQuoted(e);break;case h.ATTRIBUTE_VALUE_UNQUOTED:this._stateAttributeValueUnquoted(e);break;case h.AFTER_ATTRIBUTE_VALUE_QUOTED:this._stateAfterAttributeValueQuoted(e);break;case h.SELF_CLOSING_START_TAG:this._stateSelfClosingStartTag(e);break;case h.BOGUS_COMMENT:this._stateBogusComment(e);break;case h.MARKUP_DECLARATION_OPEN:this._stateMarkupDeclarationOpen(e);break;case h.COMMENT_START:this._stateCommentStart(e);break;case h.COMMENT_START_DASH:this._stateCommentStartDash(e);break;case h.COMMENT:this._stateComment(e);break;case h.COMMENT_LESS_THAN_SIGN:this._stateCommentLessThanSign(e);break;case h.COMMENT_LESS_THAN_SIGN_BANG:this._stateCommentLessThanSignBang(e);break;case h.COMMENT_LESS_THAN_SIGN_BANG_DASH:this._stateCommentLessThanSignBangDash(e);break;case h.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:this._stateCommentLessThanSignBangDashDash(e);break;case h.COMMENT_END_DASH:this._stateCommentEndDash(e);break;case h.COMMENT_END:this._stateCommentEnd(e);break;case h.COMMENT_END_BANG:this._stateCommentEndBang(e);break;case h.DOCTYPE:this._stateDoctype(e);break;case h.BEFORE_DOCTYPE_NAME:this._stateBeforeDoctypeName(e);break;case h.DOCTYPE_NAME:this._stateDoctypeName(e);break;case h.AFTER_DOCTYPE_NAME:this._stateAfterDoctypeName(e);break;case h.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._stateAfterDoctypePublicKeyword(e);break;case h.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:this._stateBeforeDoctypePublicIdentifier(e);break;case h.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:this._stateDoctypePublicIdentifierDoubleQuoted(e);break;case h.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:this._stateDoctypePublicIdentifierSingleQuoted(e);break;case h.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:this._stateAfterDoctypePublicIdentifier(e);break;case h.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:this._stateBetweenDoctypePublicAndSystemIdentifiers(e);break;case h.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._stateAfterDoctypeSystemKeyword(e);break;case h.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:this._stateBeforeDoctypeSystemIdentifier(e);break;case h.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:this._stateDoctypeSystemIdentifierDoubleQuoted(e);break;case h.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:this._stateDoctypeSystemIdentifierSingleQuoted(e);break;case h.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:this._stateAfterDoctypeSystemIdentifier(e);break;case h.BOGUS_DOCTYPE:this._stateBogusDoctype(e);break;case h.CDATA_SECTION:this._stateCdataSection(e);break;case h.CDATA_SECTION_BRACKET:this._stateCdataSectionBracket(e);break;case h.CDATA_SECTION_END:this._stateCdataSectionEnd(e);break;case h.CHARACTER_REFERENCE:this._stateCharacterReference(e);break;case h.NAMED_CHARACTER_REFERENCE:this._stateNamedCharacterReference(e);break;case h.AMBIGUOUS_AMPERSAND:this._stateAmbiguousAmpersand(e);break;case h.NUMERIC_CHARACTER_REFERENCE:this._stateNumericCharacterReference(e);break;case h.HEXADEMICAL_CHARACTER_REFERENCE_START:this._stateHexademicalCharacterReferenceStart(e);break;case h.HEXADEMICAL_CHARACTER_REFERENCE:this._stateHexademicalCharacterReference(e);break;case h.DECIMAL_CHARACTER_REFERENCE:this._stateDecimalCharacterReference(e);break;case h.NUMERIC_CHARACTER_REFERENCE_END:this._stateNumericCharacterReferenceEnd(e);break;default:throw new Error("Unknown state")}}_stateData(e){switch(e){case s.gH.LESS_THAN_SIGN:this.state=h.TAG_OPEN;break;case s.gH.AMPERSAND:this.returnState=h.DATA,this.state=h.CHARACTER_REFERENCE;break;case s.gH.NULL:this._err(o.w.unexpectedNullCharacter),this._emitCodePoint(e);break;case s.gH.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateRcdata(e){switch(e){case s.gH.AMPERSAND:this.returnState=h.RCDATA,this.state=h.CHARACTER_REFERENCE;break;case s.gH.LESS_THAN_SIGN:this.state=h.RCDATA_LESS_THAN_SIGN;break;case s.gH.NULL:this._err(o.w.unexpectedNullCharacter),this._emitChars(s.wV);break;case s.gH.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateRawtext(e){switch(e){case s.gH.LESS_THAN_SIGN:this.state=h.RAWTEXT_LESS_THAN_SIGN;break;case s.gH.NULL:this._err(o.w.unexpectedNullCharacter),this._emitChars(s.wV);break;case s.gH.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateScriptData(e){switch(e){case s.gH.LESS_THAN_SIGN:this.state=h.SCRIPT_DATA_LESS_THAN_SIGN;break;case s.gH.NULL:this._err(o.w.unexpectedNullCharacter),this._emitChars(s.wV);break;case s.gH.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_statePlaintext(e){switch(e){case s.gH.NULL:this._err(o.w.unexpectedNullCharacter),this._emitChars(s.wV);break;case s.gH.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateTagOpen(e){if(p(e))this._createStartTagToken(),this.state=h.TAG_NAME,this._stateTagName(e);else switch(e){case s.gH.EXCLAMATION_MARK:this.state=h.MARKUP_DECLARATION_OPEN;break;case s.gH.SOLIDUS:this.state=h.END_TAG_OPEN;break;case s.gH.QUESTION_MARK:this._err(o.w.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=h.BOGUS_COMMENT,this._stateBogusComment(e);break;case s.gH.EOF:this._err(o.w.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break;default:this._err(o.w.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=h.DATA,this._stateData(e)}}_stateEndTagOpen(e){if(p(e))this._createEndTagToken(),this.state=h.TAG_NAME,this._stateTagName(e);else switch(e){case s.gH.GREATER_THAN_SIGN:this._err(o.w.missingEndTagName),this.state=h.DATA;break;case s.gH.EOF:this._err(o.w.eofBeforeTagName),this._emitChars(""),this._emitEOFToken();break;default:this._err(o.w.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=h.BOGUS_COMMENT,this._stateBogusComment(e)}}_stateTagName(e){const t=this.currentToken;switch(e){case s.gH.SPACE:case s.gH.LINE_FEED:case s.gH.TABULATION:case s.gH.FORM_FEED:this.state=h.BEFORE_ATTRIBUTE_NAME;break;case s.gH.SOLIDUS:this.state=h.SELF_CLOSING_START_TAG;break;case s.gH.GREATER_THAN_SIGN:this.state=h.DATA,this.emitCurrentTagToken();break;case s.gH.NULL:this._err(o.w.unexpectedNullCharacter),t.tagName+=s.wV;break;case s.gH.EOF:this._err(o.w.eofInTag),this._emitEOFToken();break;default:t.tagName+=String.fromCodePoint(E(e)?A(e):e)}}_stateRcdataLessThanSign(e){e===s.gH.SOLIDUS?this.state=h.RCDATA_END_TAG_OPEN:(this._emitChars("<"),this.state=h.RCDATA,this._stateRcdata(e))}_stateRcdataEndTagOpen(e){p(e)?(this.state=h.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(e)):(this._emitChars(""),this.state=h.RCDATA,this._stateRcdata(e))}handleSpecialEndTag(e){if(!this.preprocessor.startsWith(this.lastStartTagName,!1))return!this._ensureHibernation();switch(this._createEndTagToken(),this.currentToken.tagName=this.lastStartTagName,this.preprocessor.peek(this.lastStartTagName.length)){case s.gH.SPACE:case s.gH.LINE_FEED:case s.gH.TABULATION:case s.gH.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=h.BEFORE_ATTRIBUTE_NAME,!1;case s.gH.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=h.SELF_CLOSING_START_TAG,!1;case s.gH.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=h.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars(""),this.state=h.RCDATA,this._stateRcdata(e))}_stateRawtextLessThanSign(e){e===s.gH.SOLIDUS?this.state=h.RAWTEXT_END_TAG_OPEN:(this._emitChars("<"),this.state=h.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagOpen(e){p(e)?(this.state=h.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(e)):(this._emitChars(""),this.state=h.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars(""),this.state=h.RAWTEXT,this._stateRawtext(e))}_stateScriptDataLessThanSign(e){switch(e){case s.gH.SOLIDUS:this.state=h.SCRIPT_DATA_END_TAG_OPEN;break;case s.gH.EXCLAMATION_MARK:this.state=h.SCRIPT_DATA_ESCAPE_START,this._emitChars("");break;case s.gH.NULL:this._err(o.w.unexpectedNullCharacter),this.state=h.SCRIPT_DATA_ESCAPED,this._emitChars(s.wV);break;case s.gH.EOF:this._err(o.w.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=h.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedLessThanSign(e){e===s.gH.SOLIDUS?this.state=h.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:p(e)?(this._emitChars("<"),this.state=h.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(e)):(this._emitChars("<"),this.state=h.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagOpen(e){p(e)?(this.state=h.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(e)):(this._emitChars(""),this.state=h.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars(""),this.state=h.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataDoubleEscapeStart(e){if(this.preprocessor.startsWith(s.S8.SCRIPT,!1)&&_(this.preprocessor.peek(s.S8.SCRIPT.length))){this._emitCodePoint(e);for(let e=0;e");break;case s.gH.NULL:this._err(o.w.unexpectedNullCharacter),this.state=h.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(s.wV);break;case s.gH.EOF:this._err(o.w.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=h.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedLessThanSign(e){e===s.gH.SOLIDUS?(this.state=h.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=h.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateScriptDataDoubleEscapeEnd(e){if(this.preprocessor.startsWith(s.S8.SCRIPT,!1)&&_(this.preprocessor.peek(s.S8.SCRIPT.length))){this._emitCodePoint(e);for(let e=0;e1114111)this._err(o.w.characterReferenceOutsideUnicodeRange),this.charRefCode=s.gH.REPLACEMENT_CHARACTER;else if((0,s.ij)(this.charRefCode))this._err(o.w.surrogateCharacterReference),this.charRefCode=s.gH.REPLACEMENT_CHARACTER;else if((0,s.SG)(this.charRefCode))this._err(o.w.noncharacterCharacterReference);else if((0,s.b_)(this.charRefCode)||this.charRefCode===s.gH.CARRIAGE_RETURN){this._err(o.w.controlCharacterReference);const e=l.get(this.charRefCode);void 0!==e&&(this.charRefCode=e)}this._flushCodePointConsumedAsCharacterReference(this.charRefCode),this._reconsumeInState(this.returnState,e)}}},7808:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var r=n(7853),s=n(826);class i{constructor(e){this.handler=e,this.html="",this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=65536,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+Number(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(e){const{line:t,col:n,offset:r}=this;return{code:e,startLine:t,endLine:t,startCol:n,endCol:n,startOffset:r,endOffset:r}}_err(e){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(e)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(e){if(this.pos!==this.html.length-1){const t=this.html.charCodeAt(this.pos+1);if((0,r.U2)(t))return this.pos++,this._addGap(),(0,r.oP)(e,t)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,r.gH.EOF;return this._err(s.w.surrogateInInputStream),e}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(e,t){this.html.length>0?this.html+=e:this.html=e,this.endOfChunkHit=!1,this.lastChunkWritten=t}insertHtmlAtCurrentPos(e){this.html=this.html.substring(0,this.pos+1)+e+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(e,t){if(this.pos+e.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(t)return this.html.startsWith(e,this.pos);for(let t=0;t=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,r.gH.EOF;const n=this.html.charCodeAt(t);return n===r.gH.CARRIAGE_RETURN?r.gH.LINE_FEED:n}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,r.gH.EOF;let e=this.html.charCodeAt(this.pos);return e===r.gH.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,r.gH.LINE_FEED):e===r.gH.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,(0,r.ij)(e)&&(e=this._processSurrogate(e)),null===this.handler.onParseError||e>31&&e<127||e===r.gH.LINE_FEED||e===r.gH.CARRIAGE_RETURN||e>159&&e<64976||this._checkForProblematicCharacters(e),e)}_checkForProblematicCharacters(e){(0,r.b_)(e)?this._err(s.w.controlCharacterInInputStream):(0,r.SG)(e)&&this._err(s.w.noncharacterInInputStream)}retreat(e){for(this.pos-=e;this.pos{"use strict";n.d(t,{g:()=>i});var r=n(9776);function s(e){return{nodeName:"#text",value:e,parentNode:null}}const i={createDocument:()=>({nodeName:"#document",mode:r.Bj.NO_QUIRKS,childNodes:[]}),createDocumentFragment:()=>({nodeName:"#document-fragment",childNodes:[]}),createElement:(e,t,n)=>({nodeName:e,tagName:e,attrs:n,namespaceURI:t,childNodes:[],parentNode:null}),createCommentNode:e=>({nodeName:"#comment",data:e,parentNode:null}),appendChild(e,t){e.childNodes.push(t),t.parentNode=e},insertBefore(e,t,n){const r=e.childNodes.indexOf(n);e.childNodes.splice(r,0,t),t.parentNode=e},setTemplateContent(e,t){e.content=t},getTemplateContent:e=>e.content,setDocumentType(e,t,n,r){const s=e.childNodes.find((e=>"#documentType"===e.nodeName));if(s)s.name=t,s.publicId=n,s.systemId=r;else{const s={nodeName:"#documentType",name:t,publicId:n,systemId:r,parentNode:null};i.appendChild(e,s)}},setDocumentMode(e,t){e.mode=t},getDocumentMode:e=>e.mode,detachNode(e){if(e.parentNode){const t=e.parentNode.childNodes.indexOf(e);e.parentNode.childNodes.splice(t,1),e.parentNode=null}},insertText(e,t){if(e.childNodes.length>0){const n=e.childNodes[e.childNodes.length-1];if(i.isTextNode(n))return void(n.value+=t)}i.appendChild(e,s(t))},insertTextBefore(e,t,n){const r=e.childNodes[e.childNodes.indexOf(n)-1];r&&i.isTextNode(r)?r.value+=t:i.insertBefore(e,s(t),n)},adoptAttributes(e,t){const n=new Set(e.attrs.map((e=>e.name)));for(let r=0;re.childNodes[0],getChildNodes:e=>e.childNodes,getParentNode:e=>e.parentNode,getAttrList:e=>e.attrs,getTagName:e=>e.tagName,getNamespaceURI:e=>e.namespaceURI,getTextNodeContent:e=>e.value,getCommentNodeContent:e=>e.data,getDocumentTypeNodeName:e=>e.name,getDocumentTypeNodePublicId:e=>e.publicId,getDocumentTypeNodeSystemId:e=>e.systemId,isTextNode:e=>"#text"===e.nodeName,isCommentNode:e=>"#comment"===e.nodeName,isDocumentTypeNode:e=>"#documentType"===e.nodeName,isElementNode:e=>Object.prototype.hasOwnProperty.call(e,"tagName"),setNodeSourceCodeLocation(e,t){e.sourceCodeLocation=t},getNodeSourceCodeLocation:e=>e.sourceCodeLocation,updateNodeSourceCodeLocation(e,t){e.sourceCodeLocation={...e.sourceCodeLocation,...t}}}},9185:(e,t,n)=>{"use strict";n.d(t,{P:()=>a});var r=n(8121),s=n(4441),i=n(418);class a{constructor(e,t,n=4){this.logObj=t,this.stackDepthLevel=n;const r=![typeof window,typeof document].includes("undefined"),s="[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0);this.runtime=r?"browser":s?"nodejs":"unknown";const i=!!r&&null!=((window?.chrome||window.Intl&&Intl?.v8BreakIterator)&&"CSS"in window),a=!!r&&/^((?!chrome|android).)*safari/i.test(navigator?.userAgent);this.stackDepthLevel=a?4:this.stackDepthLevel,this.settings={type:e?.type??"pretty",name:e?.name,parentNames:e?.parentNames,minLevel:e?.minLevel??0,argumentsArrayName:e?.argumentsArrayName,hideLogPositionForProduction:e?.hideLogPositionForProduction??!1,prettyLogTemplate:e?.prettyLogTemplate??"{{yyyy}}.{{mm}}.{{dd}} {{hh}}:{{MM}}:{{ss}}:{{ms}}\t{{logLevelName}}\t{{filePathWithLine}}{{nameWithDelimiterPrefix}}\t",prettyErrorTemplate:e?.prettyErrorTemplate??"\n{{errorName}} {{errorMessage}}\nerror stack:\n{{errorStack}}",prettyErrorStackTemplate:e?.prettyErrorStackTemplate??" • {{fileName}}\t{{method}}\n\t{{filePathWithLine}}",prettyErrorParentNamesSeparator:e?.prettyErrorParentNamesSeparator??":",prettyErrorLoggerNameDelimiter:e?.prettyErrorLoggerNameDelimiter??"\t",stylePrettyLogs:e?.stylePrettyLogs??!0,prettyLogTimeZone:e?.prettyLogTimeZone??"UTC",prettyLogStyles:e?.prettyLogStyles??{logLevelName:{"*":["bold","black","bgWhiteBright","dim"],SILLY:["bold","white"],TRACE:["bold","whiteBright"],DEBUG:["bold","green"],INFO:["bold","blue"],WARN:["bold","yellow"],ERROR:["bold","red"],FATAL:["bold","redBright"]},dateIsoStr:"white",filePathWithLine:"white",name:["white","bold"],nameWithDelimiterPrefix:["white","bold"],nameWithDelimiterSuffix:["white","bold"],errorName:["bold","bgRedBright","whiteBright"],fileName:["yellow"],fileNameWithLine:"white"},prettyInspectOptions:e?.prettyInspectOptions??{colors:!0,compact:!1,depth:1/0},metaProperty:e?.metaProperty??"_meta",maskPlaceholder:e?.maskPlaceholder??"[***]",maskValuesOfKeys:e?.maskValuesOfKeys??["password"],maskValuesOfKeysCaseInsensitive:e?.maskValuesOfKeysCaseInsensitive??!1,maskValuesRegEx:e?.maskValuesRegEx,prefix:[...e?.prefix??[]],attachedTransports:[...e?.attachedTransports??[]],overwrite:{mask:e?.overwrite?.mask,toLogObj:e?.overwrite?.toLogObj,addMeta:e?.overwrite?.addMeta,formatMeta:e?.overwrite?.formatMeta,formatLogObj:e?.overwrite?.formatLogObj,transportFormatted:e?.overwrite?.transportFormatted,transportJSON:e?.overwrite?.transportJSON}},this.settings.stylePrettyLogs=!(this.settings.stylePrettyLogs&&r&&!i)&&this.settings.stylePrettyLogs}log(e,t,...n){if(e0?this._mask(s):s,a=null!=this.logObj?this._recursiveCloneAndExecuteFunctions(this.logObj):void 0,o=null!=this.settings.overwrite?.toLogObj?this.settings.overwrite?.toLogObj(i,a):this._toLogObj(i,a),c=null!=this.settings.overwrite?.addMeta?this.settings.overwrite?.addMeta(o,e,t):this._addMetaToLogObj(o,e,t);let l,h;return null!=this.settings.overwrite?.formatMeta&&(l=this.settings.overwrite?.formatMeta(c?.[this.settings.metaProperty])),null!=this.settings.overwrite?.formatLogObj&&(h=this.settings.overwrite?.formatLogObj(i,this.settings)),"pretty"===this.settings.type&&(l=l??this._prettyFormatLogObjMeta(c?.[this.settings.metaProperty]),h=h??(0,r.ey)(i,this.settings)),null!=l&&null!=h?null!=this.settings.overwrite?.transportFormatted?this.settings.overwrite?.transportFormatted(l,h.args,h.errors,this.settings):(0,r.g0)(l,h.args,h.errors,this.settings):null!=this.settings.overwrite?.transportJSON?this.settings.overwrite?.transportJSON(c):"hidden"!==this.settings.type&&(0,r.Gf)(c),null!=this.settings.attachedTransports&&this.settings.attachedTransports.length>0&&this.settings.attachedTransports.forEach((e=>{e(c)})),c}attachTransport(e){this.settings.attachedTransports.push(e)}getSubLogger(e,t){const n={...this.settings,...e,parentNames:null!=this.settings?.parentNames&&null!=this.settings?.name?[...this.settings.parentNames,this.settings.name]:null!=this.settings?.name?[this.settings.name]:void 0,prefix:[...this.settings.prefix,...e?.prefix??[]]};return new this.constructor(n,t??this.logObj,this.stackDepthLevel)}_mask(e){const t=!0!==this.settings.maskValuesOfKeysCaseInsensitive?this.settings.maskValuesOfKeys:this.settings.maskValuesOfKeys.map((e=>e.toLowerCase()));return e?.map((e=>this._recursiveCloneAndMaskValuesOfKeys(e,t)))}_recursiveCloneAndMaskValuesOfKeys(e,t,n=[]){return n.includes(e)?{...e}:("object"==typeof e&&null!=e&&n.push(e),(0,r.zH)(e)?e:e instanceof Map?new Map(e):e instanceof Set?new Set(e):Array.isArray(e)?e.map((e=>this._recursiveCloneAndMaskValuesOfKeys(e,t,n))):e instanceof Date?new Date(e.getTime()):(0,r.VZ)(e)?Object.getOwnPropertyNames(e).reduce(((r,s)=>(r[s]=t.includes(!0!==this.settings?.maskValuesOfKeysCaseInsensitive?s:s.toLowerCase())?this.settings.maskPlaceholder:this._recursiveCloneAndMaskValuesOfKeys(e[s],t,n),r)),this._cloneError(e)):null!=e&&"object"==typeof e?Object.getOwnPropertyNames(e).reduce(((r,s)=>(r[s]=t.includes(!0!==this.settings?.maskValuesOfKeysCaseInsensitive?s:s.toLowerCase())?this.settings.maskPlaceholder:this._recursiveCloneAndMaskValuesOfKeys(e[s],t,n),r)),Object.create(Object.getPrototypeOf(e))):(e=>(this.settings?.maskValuesRegEx?.forEach((t=>{e=e?.toString()?.replace(t,this.settings.maskPlaceholder)})),e))(e))}_recursiveCloneAndExecuteFunctions(e,t=[]){return t.includes(e)?{...e}:("object"==typeof e&&t.push(e),Array.isArray(e)?e.map((e=>this._recursiveCloneAndExecuteFunctions(e,t))):e instanceof Date?new Date(e.getTime()):e&&"object"==typeof e?Object.getOwnPropertyNames(e).reduce(((n,r)=>(Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(e,r)),n[r]="function"==typeof e[r]?e[r]():this._recursiveCloneAndExecuteFunctions(e[r],t),n)),Object.create(Object.getPrototypeOf(e))):e)}_toLogObj(e,t={}){return e=e?.map((e=>(0,r.VZ)(e)?this._toErrorObject(e):e)),null==this.settings.argumentsArrayName?1!==e.length||Array.isArray(e[0])||!0===(0,r.zH)(e[0])||e[0]instanceof Date?{...t,...e}:"object"==typeof e[0]&&null!=e[0]?{...e[0],...t}:{0:e[0],...t}:{...t,[this.settings.argumentsArrayName]:e}}_cloneError(e){const t=new(0,e.constructor)(e.message);Object.assign(t,e);const n=Object.getOwnPropertyNames(t);for(const e of n){const n=Object.getOwnPropertyDescriptor(t,e);n&&(n.writable=!0,Object.defineProperty(t,e,n))}return t}_toErrorObject(e){return{nativeError:e,name:e.name??"Error",message:e.message,stack:(0,r.DU)(e)}}_addMetaToLogObj(e,t,n){return{...e,[this.settings.metaProperty]:(0,r.xZ)(t,n,this.stackDepthLevel,this.settings.hideLogPositionForProduction,this.settings.name,this.settings.parentNames)}}_prettyFormatLogObjMeta(e){if(null==e)return"";let t=this.settings.prettyLogTemplate;const n={};t.includes("{{yyyy}}.{{mm}}.{{dd}} {{hh}}:{{MM}}:{{ss}}:{{ms}}")?t=t.replace("{{yyyy}}.{{mm}}.{{dd}} {{hh}}:{{MM}}:{{ss}}:{{ms}}","{{dateIsoStr}}"):"UTC"===this.settings.prettyLogTimeZone?(n.yyyy=e?.date?.getUTCFullYear()??"----",n.mm=(0,i.E)(e?.date?.getUTCMonth(),2,1),n.dd=(0,i.E)(e?.date?.getUTCDate(),2),n.hh=(0,i.E)(e?.date?.getUTCHours(),2),n.MM=(0,i.E)(e?.date?.getUTCMinutes(),2),n.ss=(0,i.E)(e?.date?.getUTCSeconds(),2),n.ms=(0,i.E)(e?.date?.getUTCMilliseconds(),3)):(n.yyyy=e?.date?.getFullYear()??"----",n.mm=(0,i.E)(e?.date?.getMonth(),2,1),n.dd=(0,i.E)(e?.date?.getDate(),2),n.hh=(0,i.E)(e?.date?.getHours(),2),n.MM=(0,i.E)(e?.date?.getMinutes(),2),n.ss=(0,i.E)(e?.date?.getSeconds(),2),n.ms=(0,i.E)(e?.date?.getMilliseconds(),3));const r="UTC"===this.settings.prettyLogTimeZone?e?.date:new Date(e?.date?.getTime()-6e4*e?.date?.getTimezoneOffset());n.rawIsoStr=r?.toISOString(),n.dateIsoStr=r?.toISOString().replace("T"," ").replace("Z",""),n.logLevelName=e?.logLevelName,n.fileNameWithLine=e?.path?.fileNameWithLine??"",n.filePathWithLine=e?.path?.filePathWithLine??"",n.fullFilePath=e?.path?.fullFilePath??"";let a=this.settings.parentNames?.join(this.settings.prettyErrorParentNamesSeparator);return a=null!=a&&null!=e?.name?a+this.settings.prettyErrorParentNamesSeparator:void 0,n.name=null!=e?.name||null!=a?(a??"")+e?.name??"":"",n.nameWithDelimiterPrefix=n.name.length>0?this.settings.prettyErrorLoggerNameDelimiter+n.name:"",n.nameWithDelimiterSuffix=n.name.length>0?n.name+this.settings.prettyErrorLoggerNameDelimiter:"",(0,s._)(this.settings,t,n)}}},418:(e,t,n)=>{"use strict";function r(e,t=2,n=0){return null!=e&&isNaN(e)?"":(e=null!=e?e+n:e,2===t?null==e?"--":e<10?"0"+e:e.toString():null==e?"---":e<10?"00"+e:e<100?"0"+e:e.toString())}n.d(t,{E:()=>r})},4441:(e,t,n)=>{"use strict";n.d(t,{_:()=>s});var r=n(2821);function s(e,t,n,s=!1){const i=String(t),a=(e,t)=>`[${t[0]}m${e}[${t[1]}m`,o=(e,t)=>null!=t&&"string"==typeof t?a(e,r.i[t]):null!=t&&Array.isArray(t)?t.reduce(((e,t)=>o(e,t)),e):null!=t&&null!=t[e.trim()]?o(e,t[e.trim()]):null!=t&&null!=t["*"]?o(e,t["*"]):e;return i.replace(/{{(.+?)}}/g,((t,i)=>{const c=null!=n[i]?n[i]:s?"":t;return e.stylePrettyLogs?o(c,e?.prettyLogStyles?.[i])+a("",r.i.reset):c}))}},7925:(e,t,n)=>{"use strict";n.d(t,{Y:()=>s});var r=n(9185);class s extends r.P{constructor(e,t){super(e,t,5)}log(e,t,...n){return super.log(e,t,...n)}silly(...e){return super.log(0,"SILLY",...e)}trace(...e){return super.log(1,"TRACE",...e)}debug(...e){return super.log(2,"DEBUG",...e)}info(...e){return super.log(3,"INFO",...e)}warn(...e){return super.log(4,"WARN",...e)}error(...e){return super.log(5,"ERROR",...e)}fatal(...e){return super.log(6,"FATAL",...e)}getSubLogger(e,t){return super.getSubLogger(e,t)}}},2821:(e,t,n)=>{"use strict";n.d(t,{i:()=>r});const r={reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29],black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39],bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},9106:(e,t,n)=>{"use strict";function r(e){const t=new Set;return JSON.stringify(e,((e,n)=>{if("object"==typeof n&&null!==n){if(t.has(n))return"[Circular]";t.add(n)}return n}))}n.d(t,{e:()=>r})},8121:(e,t,n)=>{"use strict";n.d(t,{DU:()=>h,Gf:()=>T,VZ:()=>d,ey:()=>E,g0:()=>p,xZ:()=>c,zH:()=>m});var r=n(4441),s=n(8755),i=n(9106);const a={runtime:[typeof window,typeof document].includes("undefined")?"Generic":"Browser",browser:globalThis?.navigator?.userAgent},o=/(?:(?:file|https?|global code|[^@]+)@)?(?:file:)?((?:\/[^:/]+){2,})(?::(\d+))?(?::(\d+))?/;function c(e,t,n,r,s,i){return Object.assign({},a,{name:s,parentNames:i,date:new Date,logLevelId:e,logLevelName:t,path:r?void 0:l(n)})}function l(e,t=Error()){return u(t?.stack?.split("\n")?.filter((e=>!e.includes("Error: ")))?.[e])}function h(e){return e?.stack?.split("\n")?.filter((e=>!e.includes("Error: ")))?.reduce(((e,t)=>(e.push(u(t)),e)),[])}function u(e){const t=globalThis.location.origin,n={fullFilePath:void 0,fileName:void 0,fileNameWithLine:void 0,fileColumn:void 0,fileLine:void 0,filePath:void 0,filePathWithLine:void 0,method:void 0};if(null!=e){const r=e.match(o);if(r){n.filePath=r[1].replace(/\?.*$/,""),n.fullFilePath=`${t}${n.filePath}`;const e=n.filePath.split("/");n.fileName=e[e.length-1],n.fileLine=r[2],n.fileColumn=r[3],n.filePathWithLine=`${n.filePath}:${n.fileLine}`,n.fileNameWithLine=`${n.fileName}:${n.fileLine}`}}return n}function d(e){return e instanceof Error}function E(e,t){return e.reduce(((e,n)=>(d(n)?e.errors.push(function(e,t){const n=h(e).map((e=>(0,r._)(t,t.prettyErrorStackTemplate,{...e},!0))),s={errorName:` ${e.name} `,errorMessage:e.message,errorStack:n.join("\n")};return(0,r._)(t,t.prettyErrorTemplate,s)}(n,t)):e.args.push(n),e)),{args:[],errors:[]})}function p(e,t,n,r){const i=(n.length>0&&t.length>0?"\n":"")+n.join("\n");r.prettyInspectOptions.colors=r.stylePrettyLogs,console.log(e+(0,s.ah)(r.prettyInspectOptions,...t)+i)}function T(e){console.log((0,i.e)(e))}function m(e){}},8755:(e,t,n)=>{"use strict";n.d(t,{ah:()=>S});var r=n(2821),s=n(9106);function i(e,t){const n={seen:[],stylize:o};return null!=t&&L(n,t),a(n.showHidden)&&(n.showHidden=!1),a(n.depth)&&(n.depth=2),a(n.colors)&&(n.colors=!0),a(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=c),g(n,e,n.depth)}function a(e){return null==e}function o(e){return e}function c(e,t){const n=i.styles[t];return null!=n&&null!=i?.colors?.[n]?.[0]&&null!=i?.colors?.[n]?.[1]?"["+i.colors[n][0]+"m"+e+"["+i.colors[n][1]+"m":e}function l(e){return"function"==typeof e}function h(e){return"string"==typeof e}function u(e){return null===e}function d(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function E(e){return p(e)&&"[object RegExp]"===f(e)}function p(e){return"object"==typeof e&&null!==e}function T(e){return p(e)&&("[object Error]"===f(e)||e instanceof Error)}function m(e){return p(e)&&"[object Date]"===f(e)}function f(e){return Object.prototype.toString.call(e)}function A(e){return"["+Error.prototype.toString.call(e)+"]"}function g(e,t,n=0){if(e.customInspect&&null!=t&&l(t)&&t?.inspect!==i&&(!t?.constructor||t?.constructor.prototype!==t)){if("function"!=typeof t.inspect&&null!=t.toString)return t.toString();let r=t?.inspect(n,e);return h(r)||(r=g(e,r,n)),r}const r=N(e,t);if(r)return r;let s=Object.keys(t);const a=function(e){const t={};return e.forEach((e=>{t[e]=!0})),t}(s);try{e.showHidden&&Object.getOwnPropertyNames&&(s=Object.getOwnPropertyNames(t))}catch(e){}if(T(t)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return A(t);if(0===s.length){if(!l(e.stylize))return t;if(l(t)){const n=t.name?": "+t.name:"";return e.stylize("[Function"+n+"]","special")}if(E(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(m(t))return e.stylize(Date.prototype.toString.call(t),"date");if(T(t))return A(t)}let o,c="",u=!1,p=["{\n","\n}"];return Array.isArray(t)&&(u=!0,p=["[\n","\n]"]),l(t)&&(c=" [Function"+(t.name?": "+t.name:"")+"]"),E(t)&&(c=" "+RegExp.prototype.toString.call(t)),m(t)&&(c=" "+Date.prototype.toUTCString.call(t)),T(t)&&(c=" "+A(t)),0!==s.length||u&&0!=t.length?n<0?E(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special"):(e.seen.push(t),o=u?function(e,t,n,r,s){const i=[];for(let s=0,a=t.length;s{s.match(/^\d+$/)||i.push(_(e,t,n,r,s,!0))})),i}(e,t,n,a,s):s.map((r=>_(e,t,n,a,r,u))),e.seen.pop(),function(e,t,n){return n[0]+(""===t?"":t+"\n")+" "+e.join(",\n ")+" "+n[1]}(o,c,p)):p[0]+c+p[1]}function _(e,t,n,r,s,i){let o,c,l;l={value:void 0};try{l.value=t[s]}catch(e){}try{Object.getOwnPropertyDescriptor&&(l=Object.getOwnPropertyDescriptor(t,s)||l)}catch(e){}if(l.get?c=l.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):l.set&&(c=e.stylize("[Setter]","special")),d(r,s)||(o="["+s+"]"),c||(e.seen.indexOf(l.value)<0?(c=u(n)?g(e,l.value,void 0):g(e,l.value,n-1),c.indexOf("\n")>-1&&(c=i?c.split("\n").map((e=>" "+e)).join("\n").substr(2):"\n"+c.split("\n").map((e=>" "+e)).join("\n"))):c=e.stylize("[Circular]","special")),a(o)){if(i&&s.match(/^\d+$/))return c;o=JSON.stringify(""+s),o.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.substr(1,o.length-2),o=e.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,"\\'").replace(/(^"|"$)/g,"'"),o=e.stylize(o,"string"))}return o+": "+c}function N(e,t){if(a(t))return e.stylize("undefined","undefined");if(h(t)){const n="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,"\\'")+"'";return e.stylize(n,"string")}return"number"==typeof t?e.stylize(""+t,"number"):"boolean"==typeof t?e.stylize(""+t,"boolean"):u(t)?e.stylize("null","null"):void 0}function L(e,t){if(!t||!p(t))return e;const n=Object.keys(t);let r=n.length;for(;r--;)e[n[r]]=t[n[r]];return e}function S(e,...t){const n={seen:[],stylize:o};null!=e&&L(n,e);const r=t[0];let a=0,c="",l="";if("string"==typeof r){if(1===t.length)return r;let o,h=0;for(let l=0;l> 10) | 0xd800, (high & 0x3ff) | 0xdc00);\n}\nfunction unescapeCSS(str) {\n return str.replace(reEscape, funescape);\n}\nfunction isQuote(c) {\n return c === 39 /* SingleQuote */ || c === 34 /* DoubleQuote */;\n}\nfunction isWhitespace(c) {\n return (c === 32 /* Space */ ||\n c === 9 /* Tab */ ||\n c === 10 /* NewLine */ ||\n c === 12 /* FormFeed */ ||\n c === 13 /* CarriageReturn */);\n}\n/**\n * Parses `selector`, optionally with the passed `options`.\n *\n * @param selector Selector to parse.\n * @param options Options for parsing.\n * @returns Returns a two-dimensional array.\n * The first dimension represents selectors separated by commas (eg. `sub1, sub2`),\n * the second contains the relevant tokens for that selector.\n */\nexport function parse(selector) {\n const subselects = [];\n const endIndex = parseSelector(subselects, `${selector}`, 0);\n if (endIndex < selector.length) {\n throw new Error(`Unmatched selector: ${selector.slice(endIndex)}`);\n }\n return subselects;\n}\nfunction parseSelector(subselects, selector, selectorIndex) {\n let tokens = [];\n function getName(offset) {\n const match = selector.slice(selectorIndex + offset).match(reName);\n if (!match) {\n throw new Error(`Expected name, found ${selector.slice(selectorIndex)}`);\n }\n const [name] = match;\n selectorIndex += offset + name.length;\n return unescapeCSS(name);\n }\n function stripWhitespace(offset) {\n selectorIndex += offset;\n while (selectorIndex < selector.length &&\n isWhitespace(selector.charCodeAt(selectorIndex))) {\n selectorIndex++;\n }\n }\n function readValueWithParenthesis() {\n selectorIndex += 1;\n const start = selectorIndex;\n let counter = 1;\n for (; counter > 0 && selectorIndex < selector.length; selectorIndex++) {\n if (selector.charCodeAt(selectorIndex) ===\n 40 /* LeftParenthesis */ &&\n !isEscaped(selectorIndex)) {\n counter++;\n }\n else if (selector.charCodeAt(selectorIndex) ===\n 41 /* RightParenthesis */ &&\n !isEscaped(selectorIndex)) {\n counter--;\n }\n }\n if (counter) {\n throw new Error(\"Parenthesis not matched\");\n }\n return unescapeCSS(selector.slice(start, selectorIndex - 1));\n }\n function isEscaped(pos) {\n let slashCount = 0;\n while (selector.charCodeAt(--pos) === 92 /* BackSlash */)\n slashCount++;\n return (slashCount & 1) === 1;\n }\n function ensureNotTraversal() {\n if (tokens.length > 0 && isTraversal(tokens[tokens.length - 1])) {\n throw new Error(\"Did not expect successive traversals.\");\n }\n }\n function addTraversal(type) {\n if (tokens.length > 0 &&\n tokens[tokens.length - 1].type === SelectorType.Descendant) {\n tokens[tokens.length - 1].type = type;\n return;\n }\n ensureNotTraversal();\n tokens.push({ type });\n }\n function addSpecialAttribute(name, action) {\n tokens.push({\n type: SelectorType.Attribute,\n name,\n action,\n value: getName(1),\n namespace: null,\n ignoreCase: \"quirks\",\n });\n }\n /**\n * We have finished parsing the current part of the selector.\n *\n * Remove descendant tokens at the end if they exist,\n * and return the last index, so that parsing can be\n * picked up from here.\n */\n function finalizeSubselector() {\n if (tokens.length &&\n tokens[tokens.length - 1].type === SelectorType.Descendant) {\n tokens.pop();\n }\n if (tokens.length === 0) {\n throw new Error(\"Empty sub-selector\");\n }\n subselects.push(tokens);\n }\n stripWhitespace(0);\n if (selector.length === selectorIndex) {\n return selectorIndex;\n }\n loop: while (selectorIndex < selector.length) {\n const firstChar = selector.charCodeAt(selectorIndex);\n switch (firstChar) {\n // Whitespace\n case 32 /* Space */:\n case 9 /* Tab */:\n case 10 /* NewLine */:\n case 12 /* FormFeed */:\n case 13 /* CarriageReturn */: {\n if (tokens.length === 0 ||\n tokens[0].type !== SelectorType.Descendant) {\n ensureNotTraversal();\n tokens.push({ type: SelectorType.Descendant });\n }\n stripWhitespace(1);\n break;\n }\n // Traversals\n case 62 /* GreaterThan */: {\n addTraversal(SelectorType.Child);\n stripWhitespace(1);\n break;\n }\n case 60 /* LessThan */: {\n addTraversal(SelectorType.Parent);\n stripWhitespace(1);\n break;\n }\n case 126 /* Tilde */: {\n addTraversal(SelectorType.Sibling);\n stripWhitespace(1);\n break;\n }\n case 43 /* Plus */: {\n addTraversal(SelectorType.Adjacent);\n stripWhitespace(1);\n break;\n }\n // Special attribute selectors: .class, #id\n case 46 /* Period */: {\n addSpecialAttribute(\"class\", AttributeAction.Element);\n break;\n }\n case 35 /* Hash */: {\n addSpecialAttribute(\"id\", AttributeAction.Equals);\n break;\n }\n case 91 /* LeftSquareBracket */: {\n stripWhitespace(1);\n // Determine attribute name and namespace\n let name;\n let namespace = null;\n if (selector.charCodeAt(selectorIndex) === 124 /* Pipe */) {\n // Equivalent to no namespace\n name = getName(1);\n }\n else if (selector.startsWith(\"*|\", selectorIndex)) {\n namespace = \"*\";\n name = getName(2);\n }\n else {\n name = getName(0);\n if (selector.charCodeAt(selectorIndex) === 124 /* Pipe */ &&\n selector.charCodeAt(selectorIndex + 1) !==\n 61 /* Equal */) {\n namespace = name;\n name = getName(1);\n }\n }\n stripWhitespace(0);\n // Determine comparison operation\n let action = AttributeAction.Exists;\n const possibleAction = actionTypes.get(selector.charCodeAt(selectorIndex));\n if (possibleAction) {\n action = possibleAction;\n if (selector.charCodeAt(selectorIndex + 1) !==\n 61 /* Equal */) {\n throw new Error(\"Expected `=`\");\n }\n stripWhitespace(2);\n }\n else if (selector.charCodeAt(selectorIndex) === 61 /* Equal */) {\n action = AttributeAction.Equals;\n stripWhitespace(1);\n }\n // Determine value\n let value = \"\";\n let ignoreCase = null;\n if (action !== \"exists\") {\n if (isQuote(selector.charCodeAt(selectorIndex))) {\n const quote = selector.charCodeAt(selectorIndex);\n let sectionEnd = selectorIndex + 1;\n while (sectionEnd < selector.length &&\n (selector.charCodeAt(sectionEnd) !== quote ||\n isEscaped(sectionEnd))) {\n sectionEnd += 1;\n }\n if (selector.charCodeAt(sectionEnd) !== quote) {\n throw new Error(\"Attribute value didn't end\");\n }\n value = unescapeCSS(selector.slice(selectorIndex + 1, sectionEnd));\n selectorIndex = sectionEnd + 1;\n }\n else {\n const valueStart = selectorIndex;\n while (selectorIndex < selector.length &&\n ((!isWhitespace(selector.charCodeAt(selectorIndex)) &&\n selector.charCodeAt(selectorIndex) !==\n 93 /* RightSquareBracket */) ||\n isEscaped(selectorIndex))) {\n selectorIndex += 1;\n }\n value = unescapeCSS(selector.slice(valueStart, selectorIndex));\n }\n stripWhitespace(0);\n // See if we have a force ignore flag\n const forceIgnore = selector.charCodeAt(selectorIndex) | 0x20;\n // If the forceIgnore flag is set (either `i` or `s`), use that value\n if (forceIgnore === 115 /* LowerS */) {\n ignoreCase = false;\n stripWhitespace(1);\n }\n else if (forceIgnore === 105 /* LowerI */) {\n ignoreCase = true;\n stripWhitespace(1);\n }\n }\n if (selector.charCodeAt(selectorIndex) !==\n 93 /* RightSquareBracket */) {\n throw new Error(\"Attribute selector didn't terminate\");\n }\n selectorIndex += 1;\n const attributeSelector = {\n type: SelectorType.Attribute,\n name,\n action,\n value,\n namespace,\n ignoreCase,\n };\n tokens.push(attributeSelector);\n break;\n }\n case 58 /* Colon */: {\n if (selector.charCodeAt(selectorIndex + 1) === 58 /* Colon */) {\n tokens.push({\n type: SelectorType.PseudoElement,\n name: getName(2).toLowerCase(),\n data: selector.charCodeAt(selectorIndex) ===\n 40 /* LeftParenthesis */\n ? readValueWithParenthesis()\n : null,\n });\n continue;\n }\n const name = getName(1).toLowerCase();\n let data = null;\n if (selector.charCodeAt(selectorIndex) ===\n 40 /* LeftParenthesis */) {\n if (unpackPseudos.has(name)) {\n if (isQuote(selector.charCodeAt(selectorIndex + 1))) {\n throw new Error(`Pseudo-selector ${name} cannot be quoted`);\n }\n data = [];\n selectorIndex = parseSelector(data, selector, selectorIndex + 1);\n if (selector.charCodeAt(selectorIndex) !==\n 41 /* RightParenthesis */) {\n throw new Error(`Missing closing parenthesis in :${name} (${selector})`);\n }\n selectorIndex += 1;\n }\n else {\n data = readValueWithParenthesis();\n if (stripQuotesFromPseudos.has(name)) {\n const quot = data.charCodeAt(0);\n if (quot === data.charCodeAt(data.length - 1) &&\n isQuote(quot)) {\n data = data.slice(1, -1);\n }\n }\n data = unescapeCSS(data);\n }\n }\n tokens.push({ type: SelectorType.Pseudo, name, data });\n break;\n }\n case 44 /* Comma */: {\n finalizeSubselector();\n tokens = [];\n stripWhitespace(1);\n break;\n }\n default: {\n if (selector.startsWith(\"/*\", selectorIndex)) {\n const endIndex = selector.indexOf(\"*/\", selectorIndex + 2);\n if (endIndex < 0) {\n throw new Error(\"Comment was not terminated\");\n }\n selectorIndex = endIndex + 2;\n // Remove leading whitespace\n if (tokens.length === 0) {\n stripWhitespace(0);\n }\n break;\n }\n let namespace = null;\n let name;\n if (firstChar === 42 /* Asterisk */) {\n selectorIndex += 1;\n name = \"*\";\n }\n else if (firstChar === 124 /* Pipe */) {\n name = \"\";\n if (selector.charCodeAt(selectorIndex + 1) === 124 /* Pipe */) {\n addTraversal(SelectorType.ColumnCombinator);\n stripWhitespace(2);\n break;\n }\n }\n else if (reName.test(selector.slice(selectorIndex))) {\n name = getName(0);\n }\n else {\n break loop;\n }\n if (selector.charCodeAt(selectorIndex) === 124 /* Pipe */ &&\n selector.charCodeAt(selectorIndex + 1) !== 124 /* Pipe */) {\n namespace = name;\n if (selector.charCodeAt(selectorIndex + 1) ===\n 42 /* Asterisk */) {\n name = \"*\";\n selectorIndex += 2;\n }\n else {\n name = getName(1);\n }\n }\n tokens.push(name === \"*\"\n ? { type: SelectorType.Universal, namespace }\n : { type: SelectorType.Tag, name, namespace });\n }\n }\n }\n finalizeSubselector();\n return selectorIndex;\n}\n","export var SelectorType;\n(function (SelectorType) {\n SelectorType[\"Attribute\"] = \"attribute\";\n SelectorType[\"Pseudo\"] = \"pseudo\";\n SelectorType[\"PseudoElement\"] = \"pseudo-element\";\n SelectorType[\"Tag\"] = \"tag\";\n SelectorType[\"Universal\"] = \"universal\";\n // Traversals\n SelectorType[\"Adjacent\"] = \"adjacent\";\n SelectorType[\"Child\"] = \"child\";\n SelectorType[\"Descendant\"] = \"descendant\";\n SelectorType[\"Parent\"] = \"parent\";\n SelectorType[\"Sibling\"] = \"sibling\";\n SelectorType[\"ColumnCombinator\"] = \"column-combinator\";\n})(SelectorType || (SelectorType = {}));\n/**\n * Modes for ignore case.\n *\n * This could be updated to an enum, and the object is\n * the current stand-in that will allow code to be updated\n * without big changes.\n */\nexport const IgnoreCaseMode = {\n Unknown: null,\n QuirksMode: \"quirks\",\n IgnoreCase: true,\n CaseSensitive: false,\n};\nexport var AttributeAction;\n(function (AttributeAction) {\n AttributeAction[\"Any\"] = \"any\";\n AttributeAction[\"Element\"] = \"element\";\n AttributeAction[\"End\"] = \"end\";\n AttributeAction[\"Equals\"] = \"equals\";\n AttributeAction[\"Exists\"] = \"exists\";\n AttributeAction[\"Hyphen\"] = \"hyphen\";\n AttributeAction[\"Not\"] = \"not\";\n AttributeAction[\"Start\"] = \"start\";\n})(AttributeAction || (AttributeAction = {}));\n","/*! @license DOMPurify 3.0.8 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.0.8/LICENSE */\n\n(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n typeof define === 'function' && define.amd ? define(factory) :\n (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.DOMPurify = factory());\n})(this, (function () { 'use strict';\n\n const {\n entries,\n setPrototypeOf,\n isFrozen,\n getPrototypeOf,\n getOwnPropertyDescriptor\n } = Object;\n let {\n freeze,\n seal,\n create\n } = Object; // eslint-disable-line import/no-mutable-exports\n let {\n apply,\n construct\n } = typeof Reflect !== 'undefined' && Reflect;\n if (!freeze) {\n freeze = function freeze(x) {\n return x;\n };\n }\n if (!seal) {\n seal = function seal(x) {\n return x;\n };\n }\n if (!apply) {\n apply = function apply(fun, thisValue, args) {\n return fun.apply(thisValue, args);\n };\n }\n if (!construct) {\n construct = function construct(Func, args) {\n return new Func(...args);\n };\n }\n const arrayForEach = unapply(Array.prototype.forEach);\n const arrayPop = unapply(Array.prototype.pop);\n const arrayPush = unapply(Array.prototype.push);\n const stringToLowerCase = unapply(String.prototype.toLowerCase);\n const stringToString = unapply(String.prototype.toString);\n const stringMatch = unapply(String.prototype.match);\n const stringReplace = unapply(String.prototype.replace);\n const stringIndexOf = unapply(String.prototype.indexOf);\n const stringTrim = unapply(String.prototype.trim);\n const regExpTest = unapply(RegExp.prototype.test);\n const typeErrorCreate = unconstruct(TypeError);\n\n /**\n * Creates a new function that calls the given function with a specified thisArg and arguments.\n *\n * @param {Function} func - The function to be wrapped and called.\n * @returns {Function} A new function that calls the given function with a specified thisArg and arguments.\n */\n function unapply(func) {\n return function (thisArg) {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n return apply(func, thisArg, args);\n };\n }\n\n /**\n * Creates a new function that constructs an instance of the given constructor function with the provided arguments.\n *\n * @param {Function} func - The constructor function to be wrapped and called.\n * @returns {Function} A new function that constructs an instance of the given constructor function with the provided arguments.\n */\n function unconstruct(func) {\n return function () {\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n return construct(func, args);\n };\n }\n\n /**\n * Add properties to a lookup table\n *\n * @param {Object} set - The set to which elements will be added.\n * @param {Array} array - The array containing elements to be added to the set.\n * @param {Function} transformCaseFunc - An optional function to transform the case of each element before adding to the set.\n * @returns {Object} The modified set with added elements.\n */\n function addToSet(set, array) {\n let transformCaseFunc = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : stringToLowerCase;\n if (setPrototypeOf) {\n // Make 'in' and truthy checks like Boolean(set.constructor)\n // independent of any properties defined on Object.prototype.\n // Prevent prototype setters from intercepting set as a this value.\n setPrototypeOf(set, null);\n }\n let l = array.length;\n while (l--) {\n let element = array[l];\n if (typeof element === 'string') {\n const lcElement = transformCaseFunc(element);\n if (lcElement !== element) {\n // Config presets (e.g. tags.js, attrs.js) are immutable.\n if (!isFrozen(array)) {\n array[l] = lcElement;\n }\n element = lcElement;\n }\n }\n set[element] = true;\n }\n return set;\n }\n\n /**\n * Clean up an array to harden against CSPP\n *\n * @param {Array} array - The array to be cleaned.\n * @returns {Array} The cleaned version of the array\n */\n function cleanArray(array) {\n for (let index = 0; index < array.length; index++) {\n if (getOwnPropertyDescriptor(array, index) === undefined) {\n array[index] = null;\n }\n }\n return array;\n }\n\n /**\n * Shallow clone an object\n *\n * @param {Object} object - The object to be cloned.\n * @returns {Object} A new object that copies the original.\n */\n function clone(object) {\n const newObject = create(null);\n for (const [property, value] of entries(object)) {\n if (getOwnPropertyDescriptor(object, property) !== undefined) {\n if (Array.isArray(value)) {\n newObject[property] = cleanArray(value);\n } else if (value && typeof value === 'object' && value.constructor === Object) {\n newObject[property] = clone(value);\n } else {\n newObject[property] = value;\n }\n }\n }\n return newObject;\n }\n\n /**\n * This method automatically checks if the prop is function or getter and behaves accordingly.\n *\n * @param {Object} object - The object to look up the getter function in its prototype chain.\n * @param {String} prop - The property name for which to find the getter function.\n * @returns {Function} The getter function found in the prototype chain or a fallback function.\n */\n function lookupGetter(object, prop) {\n while (object !== null) {\n const desc = getOwnPropertyDescriptor(object, prop);\n if (desc) {\n if (desc.get) {\n return unapply(desc.get);\n }\n if (typeof desc.value === 'function') {\n return unapply(desc.value);\n }\n }\n object = getPrototypeOf(object);\n }\n function fallbackValue(element) {\n console.warn('fallback value for', element);\n return null;\n }\n return fallbackValue;\n }\n\n const html$1 = freeze(['a', 'abbr', 'acronym', 'address', 'area', 'article', 'aside', 'audio', 'b', 'bdi', 'bdo', 'big', 'blink', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'center', 'cite', 'code', 'col', 'colgroup', 'content', 'data', 'datalist', 'dd', 'decorator', 'del', 'details', 'dfn', 'dialog', 'dir', 'div', 'dl', 'dt', 'element', 'em', 'fieldset', 'figcaption', 'figure', 'font', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'img', 'input', 'ins', 'kbd', 'label', 'legend', 'li', 'main', 'map', 'mark', 'marquee', 'menu', 'menuitem', 'meter', 'nav', 'nobr', 'ol', 'optgroup', 'option', 'output', 'p', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'section', 'select', 'shadow', 'small', 'source', 'spacer', 'span', 'strike', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'time', 'tr', 'track', 'tt', 'u', 'ul', 'var', 'video', 'wbr']);\n\n // SVG\n const svg$1 = freeze(['svg', 'a', 'altglyph', 'altglyphdef', 'altglyphitem', 'animatecolor', 'animatemotion', 'animatetransform', 'circle', 'clippath', 'defs', 'desc', 'ellipse', 'filter', 'font', 'g', 'glyph', 'glyphref', 'hkern', 'image', 'line', 'lineargradient', 'marker', 'mask', 'metadata', 'mpath', 'path', 'pattern', 'polygon', 'polyline', 'radialgradient', 'rect', 'stop', 'style', 'switch', 'symbol', 'text', 'textpath', 'title', 'tref', 'tspan', 'view', 'vkern']);\n const svgFilters = freeze(['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']);\n\n // List of SVG elements that are disallowed by default.\n // We still need to know them so that we can do namespace\n // checks properly in case one wants to add them to\n // allow-list.\n const svgDisallowed = freeze(['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']);\n const mathMl$1 = freeze(['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']);\n\n // Similarly to SVG, we want to know all MathML elements,\n // even those that we disallow by default.\n const mathMlDisallowed = freeze(['maction', 'maligngroup', 'malignmark', 'mlongdiv', 'mscarries', 'mscarry', 'msgroup', 'mstack', 'msline', 'msrow', 'semantics', 'annotation', 'annotation-xml', 'mprescripts', 'none']);\n const text = freeze(['#text']);\n\n const html = freeze(['accept', 'action', 'align', 'alt', 'autocapitalize', 'autocomplete', 'autopictureinpicture', 'autoplay', 'background', 'bgcolor', 'border', 'capture', 'cellpadding', 'cellspacing', 'checked', 'cite', 'class', 'clear', 'color', 'cols', 'colspan', 'controls', 'controlslist', 'coords', 'crossorigin', 'datetime', 'decoding', 'default', 'dir', 'disabled', 'disablepictureinpicture', 'disableremoteplayback', 'download', 'draggable', 'enctype', 'enterkeyhint', 'face', 'for', 'headers', 'height', 'hidden', 'high', 'href', 'hreflang', 'id', 'inputmode', 'integrity', 'ismap', 'kind', 'label', 'lang', 'list', 'loading', 'loop', 'low', 'max', 'maxlength', 'media', 'method', 'min', 'minlength', 'multiple', 'muted', 'name', 'nonce', 'noshade', 'novalidate', 'nowrap', 'open', 'optimum', 'pattern', 'placeholder', 'playsinline', 'poster', 'preload', 'pubdate', 'radiogroup', 'readonly', 'rel', 'required', 'rev', 'reversed', 'role', 'rows', 'rowspan', 'spellcheck', 'scope', 'selected', 'shape', 'size', 'sizes', 'span', 'srclang', 'start', 'src', 'srcset', 'step', 'style', 'summary', 'tabindex', 'title', 'translate', 'type', 'usemap', 'valign', 'value', 'width', 'xmlns', 'slot']);\n const svg = freeze(['accent-height', 'accumulate', 'additive', 'alignment-baseline', 'ascent', 'attributename', 'attributetype', 'azimuth', 'basefrequency', 'baseline-shift', 'begin', 'bias', 'by', 'class', 'clip', 'clippathunits', 'clip-path', 'clip-rule', 'color', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'cx', 'cy', 'd', 'dx', 'dy', 'diffuseconstant', 'direction', 'display', 'divisor', 'dur', 'edgemode', 'elevation', 'end', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'filterunits', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'fx', 'fy', 'g1', 'g2', 'glyph-name', 'glyphref', 'gradientunits', 'gradienttransform', 'height', 'href', 'id', 'image-rendering', 'in', 'in2', 'k', 'k1', 'k2', 'k3', 'k4', 'kerning', 'keypoints', 'keysplines', 'keytimes', 'lang', 'lengthadjust', 'letter-spacing', 'kernelmatrix', 'kernelunitlength', 'lighting-color', 'local', 'marker-end', 'marker-mid', 'marker-start', 'markerheight', 'markerunits', 'markerwidth', 'maskcontentunits', 'maskunits', 'max', 'mask', 'media', 'method', 'mode', 'min', 'name', 'numoctaves', 'offset', 'operator', 'opacity', 'order', 'orient', 'orientation', 'origin', 'overflow', 'paint-order', 'path', 'pathlength', 'patterncontentunits', 'patterntransform', 'patternunits', 'points', 'preservealpha', 'preserveaspectratio', 'primitiveunits', 'r', 'rx', 'ry', 'radius', 'refx', 'refy', 'repeatcount', 'repeatdur', 'restart', 'result', 'rotate', 'scale', 'seed', 'shape-rendering', 'specularconstant', 'specularexponent', 'spreadmethod', 'startoffset', 'stddeviation', 'stitchtiles', 'stop-color', 'stop-opacity', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke', 'stroke-width', 'style', 'surfacescale', 'systemlanguage', 'tabindex', 'targetx', 'targety', 'transform', 'transform-origin', 'text-anchor', 'text-decoration', 'text-rendering', 'textlength', 'type', 'u1', 'u2', 'unicode', 'values', 'viewbox', 'visibility', 'version', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'width', 'word-spacing', 'wrap', 'writing-mode', 'xchannelselector', 'ychannelselector', 'x', 'x1', 'x2', 'xmlns', 'y', 'y1', 'y2', 'z', 'zoomandpan']);\n const mathMl = freeze(['accent', 'accentunder', 'align', 'bevelled', 'close', 'columnsalign', 'columnlines', 'columnspan', 'denomalign', 'depth', 'dir', 'display', 'displaystyle', 'encoding', 'fence', 'frame', 'height', 'href', 'id', 'largeop', 'length', 'linethickness', 'lspace', 'lquote', 'mathbackground', 'mathcolor', 'mathsize', 'mathvariant', 'maxsize', 'minsize', 'movablelimits', 'notation', 'numalign', 'open', 'rowalign', 'rowlines', 'rowspacing', 'rowspan', 'rspace', 'rquote', 'scriptlevel', 'scriptminsize', 'scriptsizemultiplier', 'selection', 'separator', 'separators', 'stretchy', 'subscriptshift', 'supscriptshift', 'symmetric', 'voffset', 'width', 'xmlns']);\n const xml = freeze(['xlink:href', 'xml:id', 'xlink:title', 'xml:space', 'xmlns:xlink']);\n\n // eslint-disable-next-line unicorn/better-regex\n const MUSTACHE_EXPR = seal(/\\{\\{[\\w\\W]*|[\\w\\W]*\\}\\}/gm); // Specify template detection regex for SAFE_FOR_TEMPLATES mode\n const ERB_EXPR = seal(/<%[\\w\\W]*|[\\w\\W]*%>/gm);\n const TMPLIT_EXPR = seal(/\\${[\\w\\W]*}/gm);\n const DATA_ATTR = seal(/^data-[\\-\\w.\\u00B7-\\uFFFF]/); // eslint-disable-line no-useless-escape\n const ARIA_ATTR = seal(/^aria-[\\-\\w]+$/); // eslint-disable-line no-useless-escape\n const IS_ALLOWED_URI = seal(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\\-]+(?:[^a-z+.\\-:]|$))/i // eslint-disable-line no-useless-escape\n );\n\n const IS_SCRIPT_OR_DATA = seal(/^(?:\\w+script|data):/i);\n const ATTR_WHITESPACE = seal(/[\\u0000-\\u0020\\u00A0\\u1680\\u180E\\u2000-\\u2029\\u205F\\u3000]/g // eslint-disable-line no-control-regex\n );\n\n const DOCTYPE_NAME = seal(/^html$/i);\n\n var EXPRESSIONS = /*#__PURE__*/Object.freeze({\n __proto__: null,\n MUSTACHE_EXPR: MUSTACHE_EXPR,\n ERB_EXPR: ERB_EXPR,\n TMPLIT_EXPR: TMPLIT_EXPR,\n DATA_ATTR: DATA_ATTR,\n ARIA_ATTR: ARIA_ATTR,\n IS_ALLOWED_URI: IS_ALLOWED_URI,\n IS_SCRIPT_OR_DATA: IS_SCRIPT_OR_DATA,\n ATTR_WHITESPACE: ATTR_WHITESPACE,\n DOCTYPE_NAME: DOCTYPE_NAME\n });\n\n const getGlobal = function getGlobal() {\n return typeof window === 'undefined' ? null : window;\n };\n\n /**\n * Creates a no-op policy for internal use only.\n * Don't export this function outside this module!\n * @param {TrustedTypePolicyFactory} trustedTypes The policy factory.\n * @param {HTMLScriptElement} purifyHostElement The Script element used to load DOMPurify (to determine policy name suffix).\n * @return {TrustedTypePolicy} The policy created (or null, if Trusted Types\n * are not supported or creating the policy failed).\n */\n const _createTrustedTypesPolicy = function _createTrustedTypesPolicy(trustedTypes, purifyHostElement) {\n if (typeof trustedTypes !== 'object' || typeof trustedTypes.createPolicy !== 'function') {\n return null;\n }\n\n // Allow the callers to control the unique policy name\n // by adding a data-tt-policy-suffix to the script element with the DOMPurify.\n // Policy creation with duplicate names throws in Trusted Types.\n let suffix = null;\n const ATTR_NAME = 'data-tt-policy-suffix';\n if (purifyHostElement && purifyHostElement.hasAttribute(ATTR_NAME)) {\n suffix = purifyHostElement.getAttribute(ATTR_NAME);\n }\n const policyName = 'dompurify' + (suffix ? '#' + suffix : '');\n try {\n return trustedTypes.createPolicy(policyName, {\n createHTML(html) {\n return html;\n },\n createScriptURL(scriptUrl) {\n return scriptUrl;\n }\n });\n } catch (_) {\n // Policy creation failed (most likely another DOMPurify script has\n // already run). Skip creating the policy, as this will only cause errors\n // if TT are enforced.\n console.warn('TrustedTypes policy ' + policyName + ' could not be created.');\n return null;\n }\n };\n function createDOMPurify() {\n let window = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getGlobal();\n const DOMPurify = root => createDOMPurify(root);\n\n /**\n * Version label, exposed for easier checks\n * if DOMPurify is up to date or not\n */\n DOMPurify.version = '3.0.8';\n\n /**\n * Array of elements that DOMPurify removed during sanitation.\n * Empty if nothing was removed.\n */\n DOMPurify.removed = [];\n if (!window || !window.document || window.document.nodeType !== 9) {\n // Not running in a browser, provide a factory function\n // so that you can pass your own Window\n DOMPurify.isSupported = false;\n return DOMPurify;\n }\n let {\n document\n } = window;\n const originalDocument = document;\n const currentScript = originalDocument.currentScript;\n const {\n DocumentFragment,\n HTMLTemplateElement,\n Node,\n Element,\n NodeFilter,\n NamedNodeMap = window.NamedNodeMap || window.MozNamedAttrMap,\n HTMLFormElement,\n DOMParser,\n trustedTypes\n } = window;\n const ElementPrototype = Element.prototype;\n const cloneNode = lookupGetter(ElementPrototype, 'cloneNode');\n const getNextSibling = lookupGetter(ElementPrototype, 'nextSibling');\n const getChildNodes = lookupGetter(ElementPrototype, 'childNodes');\n const getParentNode = lookupGetter(ElementPrototype, 'parentNode');\n\n // As per issue #47, the web-components registry is inherited by a\n // new document created via createHTMLDocument. As per the spec\n // (http://w3c.github.io/webcomponents/spec/custom/#creating-and-passing-registries)\n // a new empty registry is used when creating a template contents owner\n // document, so we use that as our parent document to ensure nothing\n // is inherited.\n if (typeof HTMLTemplateElement === 'function') {\n const template = document.createElement('template');\n if (template.content && template.content.ownerDocument) {\n document = template.content.ownerDocument;\n }\n }\n let trustedTypesPolicy;\n let emptyHTML = '';\n const {\n implementation,\n createNodeIterator,\n createDocumentFragment,\n getElementsByTagName\n } = document;\n const {\n importNode\n } = originalDocument;\n let hooks = {};\n\n /**\n * Expose whether this browser supports running the full DOMPurify.\n */\n DOMPurify.isSupported = typeof entries === 'function' && typeof getParentNode === 'function' && implementation && implementation.createHTMLDocument !== undefined;\n const {\n MUSTACHE_EXPR,\n ERB_EXPR,\n TMPLIT_EXPR,\n DATA_ATTR,\n ARIA_ATTR,\n IS_SCRIPT_OR_DATA,\n ATTR_WHITESPACE\n } = EXPRESSIONS;\n let {\n IS_ALLOWED_URI: IS_ALLOWED_URI$1\n } = EXPRESSIONS;\n\n /**\n * We consider the elements and attributes below to be safe. Ideally\n * don't add any new ones but feel free to remove unwanted ones.\n */\n\n /* allowed element names */\n let ALLOWED_TAGS = null;\n const DEFAULT_ALLOWED_TAGS = addToSet({}, [...html$1, ...svg$1, ...svgFilters, ...mathMl$1, ...text]);\n\n /* Allowed attribute names */\n let ALLOWED_ATTR = null;\n const DEFAULT_ALLOWED_ATTR = addToSet({}, [...html, ...svg, ...mathMl, ...xml]);\n\n /*\n * Configure how DOMPUrify should handle custom elements and their attributes as well as customized built-in elements.\n * @property {RegExp|Function|null} tagNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any custom elements)\n * @property {RegExp|Function|null} attributeNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any attributes not on the allow list)\n * @property {boolean} allowCustomizedBuiltInElements allow custom elements derived from built-ins if they pass CUSTOM_ELEMENT_HANDLING.tagNameCheck. Default: `false`.\n */\n let CUSTOM_ELEMENT_HANDLING = Object.seal(create(null, {\n tagNameCheck: {\n writable: true,\n configurable: false,\n enumerable: true,\n value: null\n },\n attributeNameCheck: {\n writable: true,\n configurable: false,\n enumerable: true,\n value: null\n },\n allowCustomizedBuiltInElements: {\n writable: true,\n configurable: false,\n enumerable: true,\n value: false\n }\n }));\n\n /* Explicitly forbidden tags (overrides ALLOWED_TAGS/ADD_TAGS) */\n let FORBID_TAGS = null;\n\n /* Explicitly forbidden attributes (overrides ALLOWED_ATTR/ADD_ATTR) */\n let FORBID_ATTR = null;\n\n /* Decide if ARIA attributes are okay */\n let ALLOW_ARIA_ATTR = true;\n\n /* Decide if custom data attributes are okay */\n let ALLOW_DATA_ATTR = true;\n\n /* Decide if unknown protocols are okay */\n let ALLOW_UNKNOWN_PROTOCOLS = false;\n\n /* Decide if self-closing tags in attributes are allowed.\n * Usually removed due to a mXSS issue in jQuery 3.0 */\n let ALLOW_SELF_CLOSE_IN_ATTR = true;\n\n /* Output should be safe for common template engines.\n * This means, DOMPurify removes data attributes, mustaches and ERB\n */\n let SAFE_FOR_TEMPLATES = false;\n\n /* Decide if document with ... should be returned */\n let WHOLE_DOCUMENT = false;\n\n /* Track whether config is already set on this instance of DOMPurify. */\n let SET_CONFIG = false;\n\n /* Decide if all elements (e.g. style, script) must be children of\n * document.body. By default, browsers might move them to document.head */\n let FORCE_BODY = false;\n\n /* Decide if a DOM `HTMLBodyElement` should be returned, instead of a html\n * string (or a TrustedHTML object if Trusted Types are supported).\n * If `WHOLE_DOCUMENT` is enabled a `HTMLHtmlElement` will be returned instead\n */\n let RETURN_DOM = false;\n\n /* Decide if a DOM `DocumentFragment` should be returned, instead of a html\n * string (or a TrustedHTML object if Trusted Types are supported) */\n let RETURN_DOM_FRAGMENT = false;\n\n /* Try to return a Trusted Type object instead of a string, return a string in\n * case Trusted Types are not supported */\n let RETURN_TRUSTED_TYPE = false;\n\n /* Output should be free from DOM clobbering attacks?\n * This sanitizes markups named with colliding, clobberable built-in DOM APIs.\n */\n let SANITIZE_DOM = true;\n\n /* Achieve full DOM Clobbering protection by isolating the namespace of named\n * properties and JS variables, mitigating attacks that abuse the HTML/DOM spec rules.\n *\n * HTML/DOM spec rules that enable DOM Clobbering:\n * - Named Access on Window (§7.3.3)\n * - DOM Tree Accessors (§3.1.5)\n * - Form Element Parent-Child Relations (§4.10.3)\n * - Iframe srcdoc / Nested WindowProxies (§4.8.5)\n * - HTMLCollection (§4.2.10.2)\n *\n * Namespace isolation is implemented by prefixing `id` and `name` attributes\n * with a constant string, i.e., `user-content-`\n */\n let SANITIZE_NAMED_PROPS = false;\n const SANITIZE_NAMED_PROPS_PREFIX = 'user-content-';\n\n /* Keep element content when removing element? */\n let KEEP_CONTENT = true;\n\n /* If a `Node` is passed to sanitize(), then performs sanitization in-place instead\n * of importing it into a new Document and returning a sanitized copy */\n let IN_PLACE = false;\n\n /* Allow usage of profiles like html, svg and mathMl */\n let USE_PROFILES = {};\n\n /* Tags to ignore content of when KEEP_CONTENT is true */\n let FORBID_CONTENTS = null;\n const DEFAULT_FORBID_CONTENTS = addToSet({}, ['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']);\n\n /* Tags that are safe for data: URIs */\n let DATA_URI_TAGS = null;\n const DEFAULT_DATA_URI_TAGS = addToSet({}, ['audio', 'video', 'img', 'source', 'image', 'track']);\n\n /* Attributes safe for values like \"javascript:\" */\n let URI_SAFE_ATTRIBUTES = null;\n const DEFAULT_URI_SAFE_ATTRIBUTES = addToSet({}, ['alt', 'class', 'for', 'id', 'label', 'name', 'pattern', 'placeholder', 'role', 'summary', 'title', 'value', 'style', 'xmlns']);\n const MATHML_NAMESPACE = 'http://www.w3.org/1998/Math/MathML';\n const SVG_NAMESPACE = 'http://www.w3.org/2000/svg';\n const HTML_NAMESPACE = 'http://www.w3.org/1999/xhtml';\n /* Document namespace */\n let NAMESPACE = HTML_NAMESPACE;\n let IS_EMPTY_INPUT = false;\n\n /* Allowed XHTML+XML namespaces */\n let ALLOWED_NAMESPACES = null;\n const DEFAULT_ALLOWED_NAMESPACES = addToSet({}, [MATHML_NAMESPACE, SVG_NAMESPACE, HTML_NAMESPACE], stringToString);\n\n /* Parsing of strict XHTML documents */\n let PARSER_MEDIA_TYPE = null;\n const SUPPORTED_PARSER_MEDIA_TYPES = ['application/xhtml+xml', 'text/html'];\n const DEFAULT_PARSER_MEDIA_TYPE = 'text/html';\n let transformCaseFunc = null;\n\n /* Keep a reference to config to pass to hooks */\n let CONFIG = null;\n\n /* Ideally, do not touch anything below this line */\n /* ______________________________________________ */\n\n const formElement = document.createElement('form');\n const isRegexOrFunction = function isRegexOrFunction(testValue) {\n return testValue instanceof RegExp || testValue instanceof Function;\n };\n\n /**\n * _parseConfig\n *\n * @param {Object} cfg optional config literal\n */\n // eslint-disable-next-line complexity\n const _parseConfig = function _parseConfig() {\n let cfg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n if (CONFIG && CONFIG === cfg) {\n return;\n }\n\n /* Shield configuration object from tampering */\n if (!cfg || typeof cfg !== 'object') {\n cfg = {};\n }\n\n /* Shield configuration object from prototype pollution */\n cfg = clone(cfg);\n PARSER_MEDIA_TYPE =\n // eslint-disable-next-line unicorn/prefer-includes\n SUPPORTED_PARSER_MEDIA_TYPES.indexOf(cfg.PARSER_MEDIA_TYPE) === -1 ? DEFAULT_PARSER_MEDIA_TYPE : cfg.PARSER_MEDIA_TYPE;\n\n // HTML tags and attributes are not case-sensitive, converting to lowercase. Keeping XHTML as is.\n transformCaseFunc = PARSER_MEDIA_TYPE === 'application/xhtml+xml' ? stringToString : stringToLowerCase;\n\n /* Set configuration parameters */\n ALLOWED_TAGS = 'ALLOWED_TAGS' in cfg ? addToSet({}, cfg.ALLOWED_TAGS, transformCaseFunc) : DEFAULT_ALLOWED_TAGS;\n ALLOWED_ATTR = 'ALLOWED_ATTR' in cfg ? addToSet({}, cfg.ALLOWED_ATTR, transformCaseFunc) : DEFAULT_ALLOWED_ATTR;\n ALLOWED_NAMESPACES = 'ALLOWED_NAMESPACES' in cfg ? addToSet({}, cfg.ALLOWED_NAMESPACES, stringToString) : DEFAULT_ALLOWED_NAMESPACES;\n URI_SAFE_ATTRIBUTES = 'ADD_URI_SAFE_ATTR' in cfg ? addToSet(clone(DEFAULT_URI_SAFE_ATTRIBUTES),\n // eslint-disable-line indent\n cfg.ADD_URI_SAFE_ATTR,\n // eslint-disable-line indent\n transformCaseFunc // eslint-disable-line indent\n ) // eslint-disable-line indent\n : DEFAULT_URI_SAFE_ATTRIBUTES;\n DATA_URI_TAGS = 'ADD_DATA_URI_TAGS' in cfg ? addToSet(clone(DEFAULT_DATA_URI_TAGS),\n // eslint-disable-line indent\n cfg.ADD_DATA_URI_TAGS,\n // eslint-disable-line indent\n transformCaseFunc // eslint-disable-line indent\n ) // eslint-disable-line indent\n : DEFAULT_DATA_URI_TAGS;\n FORBID_CONTENTS = 'FORBID_CONTENTS' in cfg ? addToSet({}, cfg.FORBID_CONTENTS, transformCaseFunc) : DEFAULT_FORBID_CONTENTS;\n FORBID_TAGS = 'FORBID_TAGS' in cfg ? addToSet({}, cfg.FORBID_TAGS, transformCaseFunc) : {};\n FORBID_ATTR = 'FORBID_ATTR' in cfg ? addToSet({}, cfg.FORBID_ATTR, transformCaseFunc) : {};\n USE_PROFILES = 'USE_PROFILES' in cfg ? cfg.USE_PROFILES : false;\n ALLOW_ARIA_ATTR = cfg.ALLOW_ARIA_ATTR !== false; // Default true\n ALLOW_DATA_ATTR = cfg.ALLOW_DATA_ATTR !== false; // Default true\n ALLOW_UNKNOWN_PROTOCOLS = cfg.ALLOW_UNKNOWN_PROTOCOLS || false; // Default false\n ALLOW_SELF_CLOSE_IN_ATTR = cfg.ALLOW_SELF_CLOSE_IN_ATTR !== false; // Default true\n SAFE_FOR_TEMPLATES = cfg.SAFE_FOR_TEMPLATES || false; // Default false\n WHOLE_DOCUMENT = cfg.WHOLE_DOCUMENT || false; // Default false\n RETURN_DOM = cfg.RETURN_DOM || false; // Default false\n RETURN_DOM_FRAGMENT = cfg.RETURN_DOM_FRAGMENT || false; // Default false\n RETURN_TRUSTED_TYPE = cfg.RETURN_TRUSTED_TYPE || false; // Default false\n FORCE_BODY = cfg.FORCE_BODY || false; // Default false\n SANITIZE_DOM = cfg.SANITIZE_DOM !== false; // Default true\n SANITIZE_NAMED_PROPS = cfg.SANITIZE_NAMED_PROPS || false; // Default false\n KEEP_CONTENT = cfg.KEEP_CONTENT !== false; // Default true\n IN_PLACE = cfg.IN_PLACE || false; // Default false\n IS_ALLOWED_URI$1 = cfg.ALLOWED_URI_REGEXP || IS_ALLOWED_URI;\n NAMESPACE = cfg.NAMESPACE || HTML_NAMESPACE;\n CUSTOM_ELEMENT_HANDLING = cfg.CUSTOM_ELEMENT_HANDLING || {};\n if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck)) {\n CUSTOM_ELEMENT_HANDLING.tagNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck;\n }\n if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)) {\n CUSTOM_ELEMENT_HANDLING.attributeNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck;\n }\n if (cfg.CUSTOM_ELEMENT_HANDLING && typeof cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements === 'boolean') {\n CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements = cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements;\n }\n if (SAFE_FOR_TEMPLATES) {\n ALLOW_DATA_ATTR = false;\n }\n if (RETURN_DOM_FRAGMENT) {\n RETURN_DOM = true;\n }\n\n /* Parse profile info */\n if (USE_PROFILES) {\n ALLOWED_TAGS = addToSet({}, text);\n ALLOWED_ATTR = [];\n if (USE_PROFILES.html === true) {\n addToSet(ALLOWED_TAGS, html$1);\n addToSet(ALLOWED_ATTR, html);\n }\n if (USE_PROFILES.svg === true) {\n addToSet(ALLOWED_TAGS, svg$1);\n addToSet(ALLOWED_ATTR, svg);\n addToSet(ALLOWED_ATTR, xml);\n }\n if (USE_PROFILES.svgFilters === true) {\n addToSet(ALLOWED_TAGS, svgFilters);\n addToSet(ALLOWED_ATTR, svg);\n addToSet(ALLOWED_ATTR, xml);\n }\n if (USE_PROFILES.mathMl === true) {\n addToSet(ALLOWED_TAGS, mathMl$1);\n addToSet(ALLOWED_ATTR, mathMl);\n addToSet(ALLOWED_ATTR, xml);\n }\n }\n\n /* Merge configuration parameters */\n if (cfg.ADD_TAGS) {\n if (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) {\n ALLOWED_TAGS = clone(ALLOWED_TAGS);\n }\n addToSet(ALLOWED_TAGS, cfg.ADD_TAGS, transformCaseFunc);\n }\n if (cfg.ADD_ATTR) {\n if (ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) {\n ALLOWED_ATTR = clone(ALLOWED_ATTR);\n }\n addToSet(ALLOWED_ATTR, cfg.ADD_ATTR, transformCaseFunc);\n }\n if (cfg.ADD_URI_SAFE_ATTR) {\n addToSet(URI_SAFE_ATTRIBUTES, cfg.ADD_URI_SAFE_ATTR, transformCaseFunc);\n }\n if (cfg.FORBID_CONTENTS) {\n if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) {\n FORBID_CONTENTS = clone(FORBID_CONTENTS);\n }\n addToSet(FORBID_CONTENTS, cfg.FORBID_CONTENTS, transformCaseFunc);\n }\n\n /* Add #text in case KEEP_CONTENT is set to true */\n if (KEEP_CONTENT) {\n ALLOWED_TAGS['#text'] = true;\n }\n\n /* Add html, head and body to ALLOWED_TAGS in case WHOLE_DOCUMENT is true */\n if (WHOLE_DOCUMENT) {\n addToSet(ALLOWED_TAGS, ['html', 'head', 'body']);\n }\n\n /* Add tbody to ALLOWED_TAGS in case tables are permitted, see #286, #365 */\n if (ALLOWED_TAGS.table) {\n addToSet(ALLOWED_TAGS, ['tbody']);\n delete FORBID_TAGS.tbody;\n }\n if (cfg.TRUSTED_TYPES_POLICY) {\n if (typeof cfg.TRUSTED_TYPES_POLICY.createHTML !== 'function') {\n throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a \"createHTML\" hook.');\n }\n if (typeof cfg.TRUSTED_TYPES_POLICY.createScriptURL !== 'function') {\n throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a \"createScriptURL\" hook.');\n }\n\n // Overwrite existing TrustedTypes policy.\n trustedTypesPolicy = cfg.TRUSTED_TYPES_POLICY;\n\n // Sign local variables required by `sanitize`.\n emptyHTML = trustedTypesPolicy.createHTML('');\n } else {\n // Uninitialized policy, attempt to initialize the internal dompurify policy.\n if (trustedTypesPolicy === undefined) {\n trustedTypesPolicy = _createTrustedTypesPolicy(trustedTypes, currentScript);\n }\n\n // If creating the internal policy succeeded sign internal variables.\n if (trustedTypesPolicy !== null && typeof emptyHTML === 'string') {\n emptyHTML = trustedTypesPolicy.createHTML('');\n }\n }\n\n // Prevent further manipulation of configuration.\n // Not available in IE8, Safari 5, etc.\n if (freeze) {\n freeze(cfg);\n }\n CONFIG = cfg;\n };\n const MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, ['mi', 'mo', 'mn', 'ms', 'mtext']);\n const HTML_INTEGRATION_POINTS = addToSet({}, ['foreignobject', 'desc', 'title', 'annotation-xml']);\n\n // Certain elements are allowed in both SVG and HTML\n // namespace. We need to specify them explicitly\n // so that they don't get erroneously deleted from\n // HTML namespace.\n const COMMON_SVG_AND_HTML_ELEMENTS = addToSet({}, ['title', 'style', 'font', 'a', 'script']);\n\n /* Keep track of all possible SVG and MathML tags\n * so that we can perform the namespace checks\n * correctly. */\n const ALL_SVG_TAGS = addToSet({}, [...svg$1, ...svgFilters, ...svgDisallowed]);\n const ALL_MATHML_TAGS = addToSet({}, [...mathMl$1, ...mathMlDisallowed]);\n\n /**\n * @param {Element} element a DOM element whose namespace is being checked\n * @returns {boolean} Return false if the element has a\n * namespace that a spec-compliant parser would never\n * return. Return true otherwise.\n */\n const _checkValidNamespace = function _checkValidNamespace(element) {\n let parent = getParentNode(element);\n\n // In JSDOM, if we're inside shadow DOM, then parentNode\n // can be null. We just simulate parent in this case.\n if (!parent || !parent.tagName) {\n parent = {\n namespaceURI: NAMESPACE,\n tagName: 'template'\n };\n }\n const tagName = stringToLowerCase(element.tagName);\n const parentTagName = stringToLowerCase(parent.tagName);\n if (!ALLOWED_NAMESPACES[element.namespaceURI]) {\n return false;\n }\n if (element.namespaceURI === SVG_NAMESPACE) {\n // The only way to switch from HTML namespace to SVG\n // is via . If it happens via any other tag, then\n // it should be killed.\n if (parent.namespaceURI === HTML_NAMESPACE) {\n return tagName === 'svg';\n }\n\n // The only way to switch from MathML to SVG is via`\n // svg if parent is either or MathML\n // text integration points.\n if (parent.namespaceURI === MATHML_NAMESPACE) {\n return tagName === 'svg' && (parentTagName === 'annotation-xml' || MATHML_TEXT_INTEGRATION_POINTS[parentTagName]);\n }\n\n // We only allow elements that are defined in SVG\n // spec. All others are disallowed in SVG namespace.\n return Boolean(ALL_SVG_TAGS[tagName]);\n }\n if (element.namespaceURI === MATHML_NAMESPACE) {\n // The only way to switch from HTML namespace to MathML\n // is via